import * as nt from "path"; import ve, { join as qm, dirname as fl } from "path"; import * as Ie from "fs"; import fe, { existsSync as xu, readFileSync as PL, openSync as DL, readSync as OL, closeSync as FL, mkdirSync as ML, statSync as P3, writeFileSync as RL, promises as cs, createWriteStream as xD } from "fs"; import Lt, { stat as BL, readdir as D3, unlink as O3 } from "fs/promises"; import { ReadableStream as UL } from "node:stream/web"; import * as LL from "node:stream"; import QL, { Readable as wD, PassThrough as jL, pipeline as F3 } from "node:stream"; import Wn, { open as $L, stat as SD, writeFile as GL, constants as Ks, unlink as i0, readFile as qL, readdir as zL } from "node:fs/promises"; import { createRequire as _D } from "module"; import M3 from "node:https"; import fp from "node:http"; import * as o0 from "crypto"; import Ri, { randomUUID as Xo, createHmac as HL, createHash as WL } from "crypto"; import * as cS from "node:path"; import xe, { basename as ED, resolve as Bn, join as En, normalize as R3, dirname as N2 } from "node:path"; import KL from "node:tls"; import gt, { platform as AD, arch as VL, constants as ID } from "node:os"; import * as P2 from "https"; import hl, { createServer as YL } from "https"; import Ds, { createServer as JL } from "http"; import * as Yf from "node:fs"; import qe, { readFileSync as mo, statSync as XL, createReadStream as ZL, openSync as e7, readSync as t7, closeSync as n7, existsSync as ir, readdirSync as CD, writeFileSync as D2, promises as Fu, mkdirSync as TD, unlink as r7 } from "node:fs"; import * as kD from "node:crypto"; import La, { createHash as Wp, randomUUID as ND, pbkdf2Sync as B3, createDecipheriv as i7, randomBytes as o7 } from "node:crypto"; import * as gs from "os"; import Ln from "os"; import * as PD from "node:net"; import a7, { isIP as DD } from "node:net"; import s7 from "node:assert"; import * as OD from "node:zlib"; import FD from "node:zlib"; import { dlopen as c7 } from "node:process"; import { execFile as u7, fork as l7 } from "child_process"; import Pn, { promisify as d7 } from "util"; import mr, { PassThrough as p7, Writable as f7 } from "stream"; import ml, { gunzipSync as U3 } from "zlib"; import Qa, { EventEmitter as h7 } from "events"; import Os from "buffer"; import m7 from "constants"; import O2 from "string_decoder"; import g7 from "assert"; import { pipeline as F2 } from "stream/promises"; import { fileURLToPath as Mc, URL as MD } from "url"; import RD, { EventEmitter as y7 } from "node:events"; import ys, { Router as Tr } from "express"; import { fileURLToPath as a0 } from "node:url"; import { WebSocketServer as hp, WebSocket as Er } from "ws"; import * as b7 from "net"; import { Socket as L3 } from "net"; import { Worker as v7 } from "worker_threads"; import * as oy from "tty"; import { Buffer as x7 } from "node:buffer"; import * as Lo from "process"; function BD(t) { let e = typeof t; if (e == "object") { if (Array.isArray(t)) return "array"; if (t === null) return "null"; } return e; } function w7(t) { return t !== null && typeof t == "object" && !Array.isArray(t); } let xa = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), s0 = []; for (let t = 0; t < xa.length; t++) s0[xa[t].charCodeAt(0)] = t; s0[45] = xa.indexOf("+"); s0[95] = xa.indexOf("/"); function S7(t) { let e = t.length * 3 / 4; t[t.length - 2] == "=" ? e -= 2 : t[t.length - 1] == "=" && (e -= 1); let n = new Uint8Array(e), r = 0, i = 0, o, a = 0; for (let s = 0; s < t.length; s++) { if (o = s0[t.charCodeAt(s)], o === void 0) switch (t[s]) { case "=": i = 0; // reset state when padding found case ` `: case "\r": case " ": case " ": continue; // skip white-space, and padding default: throw Error("invalid base64 string."); } switch (i) { case 0: a = o, i = 1; break; case 1: n[r++] = a << 2 | (o & 48) >> 4, a = o, i = 2; break; case 2: n[r++] = (a & 15) << 4 | (o & 60) >> 2, a = o, i = 3; break; case 3: n[r++] = (a & 3) << 6 | o, i = 0; break; } } if (i == 1) throw Error("invalid base64 string."); return n.subarray(0, r); } function _7(t) { let e = "", n = 0, r, i = 0; for (let o = 0; o < t.length; o++) switch (r = t[o], n) { case 0: e += xa[r >> 2], i = (r & 3) << 4, n = 1; break; case 1: e += xa[i | r >> 4], i = (r & 15) << 2, n = 2; break; case 2: e += xa[i | r >> 6], e += xa[r & 63], n = 0; break; } return n && (e += xa[i], e += "=", n == 1 && (e += "=")), e; } var zm; (function(t) { t.symbol = Symbol.for("protobuf-ts/unknown"), t.onRead = (n, r, i, o, a) => { (e(r) ? r[t.symbol] : r[t.symbol] = []).push({ no: i, wireType: o, data: a }); }, t.onWrite = (n, r, i) => { for (let { no: o, wireType: a, data: s } of t.list(r)) i.tag(o, a).raw(s); }, t.list = (n, r) => { if (e(n)) { let i = n[t.symbol]; return r ? i.filter((o) => o.no == r) : i; } return []; }, t.last = (n, r) => t.list(n, r).slice(-1)[0]; const e = (n) => n && Array.isArray(n[t.symbol]); })(zm || (zm = {})); var mn; (function(t) { t[t.Varint = 0] = "Varint", t[t.Bit64 = 1] = "Bit64", t[t.LengthDelimited = 2] = "LengthDelimited", t[t.StartGroup = 3] = "StartGroup", t[t.EndGroup = 4] = "EndGroup", t[t.Bit32 = 5] = "Bit32"; })(mn || (mn = {})); function E7() { let t = 0, e = 0; for (let r = 0; r < 28; r += 7) { let i = this.buf[this.pos++]; if (t |= (i & 127) << r, (i & 128) == 0) return this.assertBounds(), [t, e]; } let n = this.buf[this.pos++]; if (t |= (n & 15) << 28, e = (n & 112) >> 4, (n & 128) == 0) return this.assertBounds(), [t, e]; for (let r = 3; r <= 31; r += 7) { let i = this.buf[this.pos++]; if (e |= (i & 127) << r, (i & 128) == 0) return this.assertBounds(), [t, e]; } throw new Error("invalid varint"); } function ay(t, e, n) { for (let o = 0; o < 28; o = o + 7) { const a = t >>> o, s = !(!(a >>> 7) && e == 0), c = (s ? a | 128 : a) & 255; if (n.push(c), !s) return; } const r = t >>> 28 & 15 | (e & 7) << 4, i = e >> 3 != 0; if (n.push((i ? r | 128 : r) & 255), !!i) { for (let o = 3; o < 31; o = o + 7) { const a = e >>> o, s = !!(a >>> 7), c = (s ? a | 128 : a) & 255; if (n.push(c), !s) return; } n.push(e >>> 31 & 1); } } const vm = 65536 * 65536; function UD(t) { let e = t[0] == "-"; e && (t = t.slice(1)); const n = 1e6; let r = 0, i = 0; function o(a, s) { const c = Number(t.slice(a, s)); i *= n, r = r * n + c, r >= vm && (i = i + (r / vm | 0), r = r % vm); } return o(-24, -18), o(-18, -12), o(-12, -6), o(-6), [e, r, i]; } function uS(t, e) { if (e >>> 0 <= 2097151) return "" + (vm * e + (t >>> 0)); let n = t & 16777215, r = (t >>> 24 | e << 8) >>> 0 & 16777215, i = e >> 16 & 65535, o = n + r * 6777216 + i * 6710656, a = r + i * 8147497, s = i * 2, c = 1e7; o >= c && (a += Math.floor(o / c), o %= c), a >= c && (s += Math.floor(a / c), a %= c); function u(d, p) { let f = d ? String(d) : ""; return p ? "0000000".slice(f.length) + f : f; } return u( s, /*needLeadingZeros=*/ 0 ) + u( a, /*needLeadingZeros=*/ s ) + // If the final 1e7 digit didn't need leading zeros, we would have // returned via the trivial code path at the top. u( o, /*needLeadingZeros=*/ 1 ); } function Q3(t, e) { if (t >= 0) { for (; t > 127; ) e.push(t & 127 | 128), t = t >>> 7; e.push(t); } else { for (let n = 0; n < 9; n++) e.push(t & 127 | 128), t = t >> 7; e.push(1); } } function A7() { let t = this.buf[this.pos++], e = t & 127; if ((t & 128) == 0) return this.assertBounds(), e; if (t = this.buf[this.pos++], e |= (t & 127) << 7, (t & 128) == 0) return this.assertBounds(), e; if (t = this.buf[this.pos++], e |= (t & 127) << 14, (t & 128) == 0) return this.assertBounds(), e; if (t = this.buf[this.pos++], e |= (t & 127) << 21, (t & 128) == 0) return this.assertBounds(), e; t = this.buf[this.pos++], e |= (t & 15) << 28; for (let n = 5; (t & 128) !== 0 && n < 10; n++) t = this.buf[this.pos++]; if ((t & 128) != 0) throw new Error("invalid varint"); return this.assertBounds(), e >>> 0; } let Qt; function I7() { const t = new DataView(new ArrayBuffer(8)); Qt = globalThis.BigInt !== void 0 && typeof t.getBigInt64 == "function" && typeof t.getBigUint64 == "function" && typeof t.setBigInt64 == "function" && typeof t.setBigUint64 == "function" ? { MIN: BigInt("-9223372036854775808"), MAX: BigInt("9223372036854775807"), UMIN: BigInt("0"), UMAX: BigInt("18446744073709551615"), C: BigInt, V: t } : void 0; } I7(); function LD(t) { if (!t) throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support"); } const QD = /^-?[0-9]+$/, Hm = 4294967296, Jf = 2147483648; class jD { /** * Create a new instance with the given bits. */ constructor(e, n) { this.lo = e | 0, this.hi = n | 0; } /** * Is this instance equal to 0? */ isZero() { return this.lo == 0 && this.hi == 0; } /** * Convert to a native number. */ toNumber() { let e = this.hi * Hm + (this.lo >>> 0); if (!Number.isSafeInteger(e)) throw new Error("cannot convert to safe number"); return e; } } class Ir extends jD { /** * Create instance from a `string`, `number` or `bigint`. */ static from(e) { if (Qt) switch (typeof e) { case "string": if (e == "0") return this.ZERO; if (e == "") throw new Error("string is no integer"); e = Qt.C(e); case "number": if (e === 0) return this.ZERO; e = Qt.C(e); case "bigint": if (!e) return this.ZERO; if (e < Qt.UMIN) throw new Error("signed value for ulong"); if (e > Qt.UMAX) throw new Error("ulong too large"); return Qt.V.setBigUint64(0, e, !0), new Ir(Qt.V.getInt32(0, !0), Qt.V.getInt32(4, !0)); } else switch (typeof e) { case "string": if (e == "0") return this.ZERO; if (e = e.trim(), !QD.test(e)) throw new Error("string is no integer"); let [n, r, i] = UD(e); if (n) throw new Error("signed value for ulong"); return new Ir(r, i); case "number": if (e == 0) return this.ZERO; if (!Number.isSafeInteger(e)) throw new Error("number is no integer"); if (e < 0) throw new Error("signed value for ulong"); return new Ir(e, e / Hm); } throw new Error("unknown value " + typeof e); } /** * Convert to decimal string. */ toString() { return Qt ? this.toBigInt().toString() : uS(this.lo, this.hi); } /** * Convert to native bigint. */ toBigInt() { return LD(Qt), Qt.V.setInt32(0, this.lo, !0), Qt.V.setInt32(4, this.hi, !0), Qt.V.getBigUint64(0, !0); } } Ir.ZERO = new Ir(0, 0); class yn extends jD { /** * Create instance from a `string`, `number` or `bigint`. */ static from(e) { if (Qt) switch (typeof e) { case "string": if (e == "0") return this.ZERO; if (e == "") throw new Error("string is no integer"); e = Qt.C(e); case "number": if (e === 0) return this.ZERO; e = Qt.C(e); case "bigint": if (!e) return this.ZERO; if (e < Qt.MIN) throw new Error("signed long too small"); if (e > Qt.MAX) throw new Error("signed long too large"); return Qt.V.setBigInt64(0, e, !0), new yn(Qt.V.getInt32(0, !0), Qt.V.getInt32(4, !0)); } else switch (typeof e) { case "string": if (e == "0") return this.ZERO; if (e = e.trim(), !QD.test(e)) throw new Error("string is no integer"); let [n, r, i] = UD(e); if (n) { if (i > Jf || i == Jf && r != 0) throw new Error("signed long too small"); } else if (i >= Jf) throw new Error("signed long too large"); let o = new yn(r, i); return n ? o.negate() : o; case "number": if (e == 0) return this.ZERO; if (!Number.isSafeInteger(e)) throw new Error("number is no integer"); return e > 0 ? new yn(e, e / Hm) : new yn(-e, -e / Hm).negate(); } throw new Error("unknown value " + typeof e); } /** * Do we have a minus sign? */ isNegative() { return (this.hi & Jf) !== 0; } /** * Negate two's complement. * Invert all the bits and add one to the result. */ negate() { let e = ~this.hi, n = this.lo; return n ? n = ~n + 1 : e += 1, new yn(n, e); } /** * Convert to decimal string. */ toString() { if (Qt) return this.toBigInt().toString(); if (this.isNegative()) { let e = this.negate(); return "-" + uS(e.lo, e.hi); } return uS(this.lo, this.hi); } /** * Convert to native bigint. */ toBigInt() { return LD(Qt), Qt.V.setInt32(0, this.lo, !0), Qt.V.setInt32(4, this.hi, !0), Qt.V.getBigInt64(0, !0); } } yn.ZERO = new yn(0, 0); const j3 = { readUnknownField: !0, readerFactory: (t) => new T7(t) }; function C7(t) { return t ? Object.assign(Object.assign({}, j3), t) : j3; } class T7 { constructor(e, n) { this.varint64 = E7, this.uint32 = A7, this.buf = e, this.len = e.length, this.pos = 0, this.view = new DataView(e.buffer, e.byteOffset, e.byteLength), this.textDecoder = n ?? new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 }); } /** * Reads a tag - field number and wire type. */ tag() { let e = this.uint32(), n = e >>> 3, r = e & 7; if (n <= 0 || r < 0 || r > 5) throw new Error("illegal tag: field no " + n + " wire type " + r); return [n, r]; } /** * Skip one element on the wire and return the skipped data. * Supports WireType.StartGroup since v2.0.0-alpha.23. */ skip(e) { let n = this.pos; switch (e) { case mn.Varint: for (; this.buf[this.pos++] & 128; ) ; break; case mn.Bit64: this.pos += 4; case mn.Bit32: this.pos += 4; break; case mn.LengthDelimited: let r = this.uint32(); this.pos += r; break; case mn.StartGroup: let i; for (; (i = this.tag()[1]) !== mn.EndGroup; ) this.skip(i); break; default: throw new Error("cant skip wire type " + e); } return this.assertBounds(), this.buf.subarray(n, this.pos); } /** * Throws error if position in byte array is out of range. */ assertBounds() { if (this.pos > this.len) throw new RangeError("premature EOF"); } /** * Read a `int32` field, a signed 32 bit varint. */ int32() { return this.uint32() | 0; } /** * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. */ sint32() { let e = this.uint32(); return e >>> 1 ^ -(e & 1); } /** * Read a `int64` field, a signed 64-bit varint. */ int64() { return new yn(...this.varint64()); } /** * Read a `uint64` field, an unsigned 64-bit varint. */ uint64() { return new Ir(...this.varint64()); } /** * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. */ sint64() { let [e, n] = this.varint64(), r = -(e & 1); return e = (e >>> 1 | (n & 1) << 31) ^ r, n = n >>> 1 ^ r, new yn(e, n); } /** * Read a `bool` field, a variant. */ bool() { let [e, n] = this.varint64(); return e !== 0 || n !== 0; } /** * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. */ fixed32() { return this.view.getUint32((this.pos += 4) - 4, !0); } /** * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. */ sfixed32() { return this.view.getInt32((this.pos += 4) - 4, !0); } /** * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. */ fixed64() { return new Ir(this.sfixed32(), this.sfixed32()); } /** * Read a `fixed64` field, a signed, fixed-length 64-bit integer. */ sfixed64() { return new yn(this.sfixed32(), this.sfixed32()); } /** * Read a `float` field, 32-bit floating point number. */ float() { return this.view.getFloat32((this.pos += 4) - 4, !0); } /** * Read a `double` field, a 64-bit floating point number. */ double() { return this.view.getFloat64((this.pos += 8) - 8, !0); } /** * Read a `bytes` field, length-delimited arbitrary data. */ bytes() { let e = this.uint32(), n = this.pos; return this.pos += e, this.assertBounds(), this.buf.subarray(n, n + e); } /** * Read a `string` field, length-delimited data converted to UTF-8 text. */ string() { return this.textDecoder.decode(this.bytes()); } } function Dt(t, e) { if (!t) throw new Error(e); } const k7 = 34028234663852886e22, N7 = -34028234663852886e22, P7 = 4294967295, D7 = 2147483647, O7 = -2147483648; function Yd(t) { if (typeof t != "number") throw new Error("invalid int 32: " + typeof t); if (!Number.isInteger(t) || t > D7 || t < O7) throw new Error("invalid int 32: " + t); } function Wm(t) { if (typeof t != "number") throw new Error("invalid uint 32: " + typeof t); if (!Number.isInteger(t) || t > P7 || t < 0) throw new Error("invalid uint 32: " + t); } function M2(t) { if (typeof t != "number") throw new Error("invalid float 32: " + typeof t); if (Number.isFinite(t) && (t > k7 || t < N7)) throw new Error("invalid float 32: " + t); } const $3 = { writeUnknownFields: !0, writerFactory: () => new M7() }; function F7(t) { return t ? Object.assign(Object.assign({}, $3), t) : $3; } class M7 { constructor(e) { this.stack = [], this.textEncoder = e ?? new TextEncoder(), this.chunks = [], this.buf = []; } /** * Return all bytes written and reset this writer. */ finish() { this.chunks.push(new Uint8Array(this.buf)); let e = 0; for (let i = 0; i < this.chunks.length; i++) e += this.chunks[i].length; let n = new Uint8Array(e), r = 0; for (let i = 0; i < this.chunks.length; i++) n.set(this.chunks[i], r), r += this.chunks[i].length; return this.chunks = [], n; } /** * Start a new fork for length-delimited data like a message * or a packed repeated field. * * Must be joined later with `join()`. */ fork() { return this.stack.push({ chunks: this.chunks, buf: this.buf }), this.chunks = [], this.buf = [], this; } /** * Join the last fork. Write its length and bytes, then * return to the previous state. */ join() { let e = this.finish(), n = this.stack.pop(); if (!n) throw new Error("invalid state, fork stack empty"); return this.chunks = n.chunks, this.buf = n.buf, this.uint32(e.byteLength), this.raw(e); } /** * Writes a tag (field number and wire type). * * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. * * Generated code should compute the tag ahead of time and call `uint32()`. */ tag(e, n) { return this.uint32((e << 3 | n) >>> 0); } /** * Write a chunk of raw bytes. */ raw(e) { return this.buf.length && (this.chunks.push(new Uint8Array(this.buf)), this.buf = []), this.chunks.push(e), this; } /** * Write a `uint32` value, an unsigned 32 bit varint. */ uint32(e) { for (Wm(e); e > 127; ) this.buf.push(e & 127 | 128), e = e >>> 7; return this.buf.push(e), this; } /** * Write a `int32` value, a signed 32 bit varint. */ int32(e) { return Yd(e), Q3(e, this.buf), this; } /** * Write a `bool` value, a variant. */ bool(e) { return this.buf.push(e ? 1 : 0), this; } /** * Write a `bytes` value, length-delimited arbitrary data. */ bytes(e) { return this.uint32(e.byteLength), this.raw(e); } /** * Write a `string` value, length-delimited data converted to UTF-8 text. */ string(e) { let n = this.textEncoder.encode(e); return this.uint32(n.byteLength), this.raw(n); } /** * Write a `float` value, 32-bit floating point number. */ float(e) { M2(e); let n = new Uint8Array(4); return new DataView(n.buffer).setFloat32(0, e, !0), this.raw(n); } /** * Write a `double` value, a 64-bit floating point number. */ double(e) { let n = new Uint8Array(8); return new DataView(n.buffer).setFloat64(0, e, !0), this.raw(n); } /** * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. */ fixed32(e) { Wm(e); let n = new Uint8Array(4); return new DataView(n.buffer).setUint32(0, e, !0), this.raw(n); } /** * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. */ sfixed32(e) { Yd(e); let n = new Uint8Array(4); return new DataView(n.buffer).setInt32(0, e, !0), this.raw(n); } /** * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. */ sint32(e) { return Yd(e), e = (e << 1 ^ e >> 31) >>> 0, Q3(e, this.buf), this; } /** * Write a `fixed64` value, a signed, fixed-length 64-bit integer. */ sfixed64(e) { let n = new Uint8Array(8), r = new DataView(n.buffer), i = yn.from(e); return r.setInt32(0, i.lo, !0), r.setInt32(4, i.hi, !0), this.raw(n); } /** * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. */ fixed64(e) { let n = new Uint8Array(8), r = new DataView(n.buffer), i = Ir.from(e); return r.setInt32(0, i.lo, !0), r.setInt32(4, i.hi, !0), this.raw(n); } /** * Write a `int64` value, a signed 64-bit varint. */ int64(e) { let n = yn.from(e); return ay(n.lo, n.hi, this.buf), this; } /** * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. */ sint64(e) { let n = yn.from(e), r = n.hi >> 31, i = n.lo << 1 ^ r, o = (n.hi << 1 | n.lo >>> 31) ^ r; return ay(i, o, this.buf), this; } /** * Write a `uint64` value, an unsigned 64-bit varint. */ uint64(e) { let n = Ir.from(e); return ay(n.lo, n.hi, this.buf), this; } } const G3 = { emitDefaultValues: !1, enumAsInteger: !1, useProtoFieldName: !1, prettySpaces: 0 }, q3 = { ignoreUnknownFields: !1 }; function R7(t) { return t ? Object.assign(Object.assign({}, q3), t) : q3; } function B7(t) { return t ? Object.assign(Object.assign({}, G3), t) : G3; } const $D = Symbol.for("protobuf-ts/message-type"); function z3(t) { let e = !1; const n = []; for (let r = 0; r < t.length; r++) { let i = t.charAt(r); i == "_" ? e = !0 : /\d/.test(i) ? (n.push(i), e = !0) : e ? (n.push(i.toUpperCase()), e = !1) : r == 0 ? n.push(i.toLowerCase()) : n.push(i); } return n.join(""); } var w; (function(t) { t[t.DOUBLE = 1] = "DOUBLE", t[t.FLOAT = 2] = "FLOAT", t[t.INT64 = 3] = "INT64", t[t.UINT64 = 4] = "UINT64", t[t.INT32 = 5] = "INT32", t[t.FIXED64 = 6] = "FIXED64", t[t.FIXED32 = 7] = "FIXED32", t[t.BOOL = 8] = "BOOL", t[t.STRING = 9] = "STRING", t[t.BYTES = 12] = "BYTES", t[t.UINT32 = 13] = "UINT32", t[t.SFIXED32 = 15] = "SFIXED32", t[t.SFIXED64 = 16] = "SFIXED64", t[t.SINT32 = 17] = "SINT32", t[t.SINT64 = 18] = "SINT64"; })(w || (w = {})); var Ko; (function(t) { t[t.BIGINT = 0] = "BIGINT", t[t.STRING = 1] = "STRING", t[t.NUMBER = 2] = "NUMBER"; })(Ko || (Ko = {})); var Wr; (function(t) { t[t.NO = 0] = "NO", t[t.PACKED = 1] = "PACKED", t[t.UNPACKED = 2] = "UNPACKED"; })(Wr || (Wr = {})); function U7(t) { var e, n, r, i; return t.localName = (e = t.localName) !== null && e !== void 0 ? e : z3(t.name), t.jsonName = (n = t.jsonName) !== null && n !== void 0 ? n : z3(t.name), t.repeat = (r = t.repeat) !== null && r !== void 0 ? r : Wr.NO, t.opt = (i = t.opt) !== null && i !== void 0 ? i : t.repeat || t.oneof ? !1 : t.kind == "message", t; } function L7(t) { if (typeof t != "object" || t === null || !t.hasOwnProperty("oneofKind")) return !1; switch (typeof t.oneofKind) { case "string": return t[t.oneofKind] === void 0 ? !1 : Object.keys(t).length == 2; case "undefined": return Object.keys(t).length == 1; default: return !1; } } class Q7 { constructor(e) { var n; this.fields = (n = e.fields) !== null && n !== void 0 ? n : []; } prepare() { if (this.data) return; const e = [], n = [], r = []; for (let i of this.fields) if (i.oneof) r.includes(i.oneof) || (r.push(i.oneof), e.push(i.oneof), n.push(i.oneof)); else switch (n.push(i.localName), i.kind) { case "scalar": case "enum": (!i.opt || i.repeat) && e.push(i.localName); break; case "message": i.repeat && e.push(i.localName); break; case "map": e.push(i.localName); break; } this.data = { req: e, known: n, oneofs: Object.values(r) }; } /** * Is the argument a valid message as specified by the * reflection information? * * Checks all field types recursively. The `depth` * specifies how deep into the structure the check will be. * * With a depth of 0, only the presence of fields * is checked. * * With a depth of 1 or more, the field types are checked. * * With a depth of 2 or more, the members of map, repeated * and message fields are checked. * * Message fields will be checked recursively with depth - 1. * * The number of map entries / repeated values being checked * is < depth. */ is(e, n, r = !1) { if (n < 0) return !0; if (e == null || typeof e != "object") return !1; this.prepare(); let i = Object.keys(e), o = this.data; if (i.length < o.req.length || o.req.some((a) => !i.includes(a)) || !r && i.some((a) => !o.known.includes(a))) return !1; if (n < 1) return !0; for (const a of o.oneofs) { const s = e[a]; if (!L7(s)) return !1; if (s.oneofKind === void 0) continue; const c = this.fields.find((u) => u.localName === s.oneofKind); if (!c || !this.field(s[s.oneofKind], c, r, n)) return !1; } for (const a of this.fields) if (a.oneof === void 0 && !this.field(e[a.localName], a, r, n)) return !1; return !0; } field(e, n, r, i) { let o = n.repeat; switch (n.kind) { case "scalar": return e === void 0 ? n.opt : o ? this.scalars(e, n.T, i, n.L) : this.scalar(e, n.T, n.L); case "enum": return e === void 0 ? n.opt : o ? this.scalars(e, w.INT32, i) : this.scalar(e, w.INT32); case "message": return e === void 0 ? !0 : o ? this.messages(e, n.T(), r, i) : this.message(e, n.T(), r, i); case "map": if (typeof e != "object" || e === null) return !1; if (i < 2) return !0; if (!this.mapKeys(e, n.K, i)) return !1; switch (n.V.kind) { case "scalar": return this.scalars(Object.values(e), n.V.T, i, n.V.L); case "enum": return this.scalars(Object.values(e), w.INT32, i); case "message": return this.messages(Object.values(e), n.V.T(), r, i); } break; } return !0; } message(e, n, r, i) { return r ? n.isAssignable(e, i) : n.is(e, i); } messages(e, n, r, i) { if (!Array.isArray(e)) return !1; if (i < 2) return !0; if (r) { for (let o = 0; o < e.length && o < i; o++) if (!n.isAssignable(e[o], i - 1)) return !1; } else for (let o = 0; o < e.length && o < i; o++) if (!n.is(e[o], i - 1)) return !1; return !0; } scalar(e, n, r) { let i = typeof e; switch (n) { case w.UINT64: case w.FIXED64: case w.INT64: case w.SFIXED64: case w.SINT64: switch (r) { case Ko.BIGINT: return i == "bigint"; case Ko.NUMBER: return i == "number" && !isNaN(e); default: return i == "string"; } case w.BOOL: return i == "boolean"; case w.STRING: return i == "string"; case w.BYTES: return e instanceof Uint8Array; case w.DOUBLE: case w.FLOAT: return i == "number" && !isNaN(e); default: return i == "number" && Number.isInteger(e); } } scalars(e, n, r, i) { if (!Array.isArray(e)) return !1; if (r < 2) return !0; if (Array.isArray(e)) { for (let o = 0; o < e.length && o < r; o++) if (!this.scalar(e[o], n, i)) return !1; } return !0; } mapKeys(e, n, r) { let i = Object.keys(e); switch (n) { case w.INT32: case w.FIXED32: case w.SFIXED32: case w.SINT32: case w.UINT32: return this.scalars(i.slice(0, r).map((o) => parseInt(o)), n, r); case w.BOOL: return this.scalars(i.slice(0, r).map((o) => o == "true" ? !0 : o == "false" ? !1 : o), n, r); default: return this.scalars(i, n, r, Ko.STRING); } } } function ao(t, e) { switch (e) { case Ko.BIGINT: return t.toBigInt(); case Ko.NUMBER: return t.toNumber(); default: return t.toString(); } } class j7 { constructor(e) { this.info = e; } prepare() { var e; if (this.fMap === void 0) { this.fMap = {}; const n = (e = this.info.fields) !== null && e !== void 0 ? e : []; for (const r of n) this.fMap[r.name] = r, this.fMap[r.jsonName] = r, this.fMap[r.localName] = r; } } // Cannot parse JSON for #. assert(e, n, r) { if (!e) { let i = BD(r); throw (i == "number" || i == "boolean") && (i = r.toString()), new Error(`Cannot parse JSON ${i} for ${this.info.typeName}#${n}`); } } /** * Reads a message from canonical JSON format into the target message. * * Repeated fields are appended. Map entries are added, overwriting * existing keys. * * If a message field is already present, it will be merged with the * new data. */ read(e, n, r) { this.prepare(); const i = []; for (const [o, a] of Object.entries(e)) { const s = this.fMap[o]; if (!s) { if (!r.ignoreUnknownFields) throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${o}`); continue; } const c = s.localName; let u; if (s.oneof) { if (a === null && (s.kind !== "enum" || s.T()[0] !== "google.protobuf.NullValue")) continue; if (i.includes(s.oneof)) throw new Error(`Multiple members of the oneof group "${s.oneof}" of ${this.info.typeName} are present in JSON.`); i.push(s.oneof), u = n[s.oneof] = { oneofKind: c }; } else u = n; if (s.kind == "map") { if (a === null) continue; this.assert(w7(a), s.name, a); const d = u[c]; for (const [p, f] of Object.entries(a)) { this.assert(f !== null, s.name + " map value", null); let m; switch (s.V.kind) { case "message": m = s.V.T().internalJsonRead(f, r); break; case "enum": if (m = this.enum(s.V.T(), f, s.name, r.ignoreUnknownFields), m === !1) continue; break; case "scalar": m = this.scalar(f, s.V.T, s.V.L, s.name); break; } this.assert(m !== void 0, s.name + " map value", f); let h = p; s.K == w.BOOL && (h = h == "true" ? !0 : h == "false" ? !1 : h), h = this.scalar(h, s.K, Ko.STRING, s.name).toString(), d[h] = m; } } else if (s.repeat) { if (a === null) continue; this.assert(Array.isArray(a), s.name, a); const d = u[c]; for (const p of a) { this.assert(p !== null, s.name, null); let f; switch (s.kind) { case "message": f = s.T().internalJsonRead(p, r); break; case "enum": if (f = this.enum(s.T(), p, s.name, r.ignoreUnknownFields), f === !1) continue; break; case "scalar": f = this.scalar(p, s.T, s.L, s.name); break; } this.assert(f !== void 0, s.name, a), d.push(f); } } else switch (s.kind) { case "message": if (a === null && s.T().typeName != "google.protobuf.Value") { this.assert(s.oneof === void 0, s.name + " (oneof member)", null); continue; } u[c] = s.T().internalJsonRead(a, r, u[c]); break; case "enum": if (a === null) continue; let d = this.enum(s.T(), a, s.name, r.ignoreUnknownFields); if (d === !1) continue; u[c] = d; break; case "scalar": if (a === null) continue; u[c] = this.scalar(a, s.T, s.L, s.name); break; } } } /** * Returns `false` for unrecognized string representations. * * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). */ enum(e, n, r, i) { if (e[0] == "google.protobuf.NullValue" && Dt(n === null || n === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} only accepts null.`), n === null) return 0; switch (typeof n) { case "number": return Dt(Number.isInteger(n), `Unable to parse field ${this.info.typeName}#${r}, enum can only be integral number, got ${n}.`), n; case "string": let o = n; e[2] && n.substring(0, e[2].length) === e[2] && (o = n.substring(e[2].length)); let a = e[1][o]; return typeof a > "u" && i ? !1 : (Dt(typeof a == "number", `Unable to parse field ${this.info.typeName}#${r}, enum ${e[0]} has no value for "${n}".`), a); } Dt(!1, `Unable to parse field ${this.info.typeName}#${r}, cannot parse enum value from ${typeof n}".`); } scalar(e, n, r, i) { let o; try { switch (n) { // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". // Either numbers or strings are accepted. Exponent notation is also accepted. case w.DOUBLE: case w.FLOAT: if (e === null) return 0; if (e === "NaN") return Number.NaN; if (e === "Infinity") return Number.POSITIVE_INFINITY; if (e === "-Infinity") return Number.NEGATIVE_INFINITY; if (e === "") { o = "empty string"; break; } if (typeof e == "string" && e.trim().length !== e.length) { o = "extra whitespace"; break; } if (typeof e != "string" && typeof e != "number") break; let a = Number(e); if (Number.isNaN(a)) { o = "not a number"; break; } if (!Number.isFinite(a)) { o = "too large or small"; break; } return n == w.FLOAT && M2(a), a; // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. case w.INT32: case w.FIXED32: case w.SFIXED32: case w.SINT32: case w.UINT32: if (e === null) return 0; let s; if (typeof e == "number" ? s = e : e === "" ? o = "empty string" : typeof e == "string" && (e.trim().length !== e.length ? o = "extra whitespace" : s = Number(e)), s === void 0) break; return n == w.UINT32 ? Wm(s) : Yd(s), s; // int64, fixed64, uint64: JSON value will be a decimal string. Either numbers or strings are accepted. case w.INT64: case w.SFIXED64: case w.SINT64: if (e === null) return ao(yn.ZERO, r); if (typeof e != "number" && typeof e != "string") break; return ao(yn.from(e), r); case w.FIXED64: case w.UINT64: if (e === null) return ao(Ir.ZERO, r); if (typeof e != "number" && typeof e != "string") break; return ao(Ir.from(e), r); // bool: case w.BOOL: if (e === null) return !1; if (typeof e != "boolean") break; return e; // string: case w.STRING: if (e === null) return ""; if (typeof e != "string") { o = "extra whitespace"; break; } try { encodeURIComponent(e); } catch (c) { c = "invalid UTF8"; break; } return e; // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. // Either standard or URL-safe base64 encoding with/without paddings are accepted. case w.BYTES: if (e === null || e === "") return new Uint8Array(0); if (typeof e != "string") break; return S7(e); } } catch (a) { o = a.message; } this.assert(!1, i + (o ? " - " + o : ""), e); } } class $7 { constructor(e) { var n; this.fields = (n = e.fields) !== null && n !== void 0 ? n : []; } /** * Converts the message to a JSON object, based on the field descriptors. */ write(e, n) { const r = {}, i = e; for (const o of this.fields) { if (!o.oneof) { let u = this.field(o, i[o.localName], n); u !== void 0 && (r[n.useProtoFieldName ? o.name : o.jsonName] = u); continue; } const a = i[o.oneof]; if (a.oneofKind !== o.localName) continue; const s = o.kind == "scalar" || o.kind == "enum" ? Object.assign(Object.assign({}, n), { emitDefaultValues: !0 }) : n; let c = this.field(o, a[o.localName], s); Dt(c !== void 0), r[n.useProtoFieldName ? o.name : o.jsonName] = c; } return r; } field(e, n, r) { let i; if (e.kind == "map") { Dt(typeof n == "object" && n !== null); const o = {}; switch (e.V.kind) { case "scalar": for (const [c, u] of Object.entries(n)) { const d = this.scalar(e.V.T, u, e.name, !1, !0); Dt(d !== void 0), o[c.toString()] = d; } break; case "message": const a = e.V.T(); for (const [c, u] of Object.entries(n)) { const d = this.message(a, u, e.name, r); Dt(d !== void 0), o[c.toString()] = d; } break; case "enum": const s = e.V.T(); for (const [c, u] of Object.entries(n)) { Dt(u === void 0 || typeof u == "number"); const d = this.enum(s, u, e.name, !1, !0, r.enumAsInteger); Dt(d !== void 0), o[c.toString()] = d; } break; } (r.emitDefaultValues || Object.keys(o).length > 0) && (i = o); } else if (e.repeat) { Dt(Array.isArray(n)); const o = []; switch (e.kind) { case "scalar": for (let c = 0; c < n.length; c++) { const u = this.scalar(e.T, n[c], e.name, e.opt, !0); Dt(u !== void 0), o.push(u); } break; case "enum": const a = e.T(); for (let c = 0; c < n.length; c++) { Dt(n[c] === void 0 || typeof n[c] == "number"); const u = this.enum(a, n[c], e.name, e.opt, !0, r.enumAsInteger); Dt(u !== void 0), o.push(u); } break; case "message": const s = e.T(); for (let c = 0; c < n.length; c++) { const u = this.message(s, n[c], e.name, r); Dt(u !== void 0), o.push(u); } break; } (r.emitDefaultValues || o.length > 0 || r.emitDefaultValues) && (i = o); } else switch (e.kind) { case "scalar": i = this.scalar(e.T, n, e.name, e.opt, r.emitDefaultValues); break; case "enum": i = this.enum(e.T(), n, e.name, e.opt, r.emitDefaultValues, r.enumAsInteger); break; case "message": i = this.message(e.T(), n, e.name, r); break; } return i; } /** * Returns `null` as the default for google.protobuf.NullValue. */ enum(e, n, r, i, o, a) { if (e[0] == "google.protobuf.NullValue") return !o && !i ? void 0 : null; if (n === void 0) { Dt(i); return; } if (!(n === 0 && !o && !i)) return Dt(typeof n == "number"), Dt(Number.isInteger(n)), a || !e[1].hasOwnProperty(n) ? n : e[2] ? e[2] + e[1][n] : e[1][n]; } message(e, n, r, i) { return n === void 0 ? i.emitDefaultValues ? null : void 0 : e.internalJsonWrite(n, i); } scalar(e, n, r, i, o) { if (n === void 0) { Dt(i); return; } const a = o || i; switch (e) { // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. case w.INT32: case w.SFIXED32: case w.SINT32: return n === 0 ? a ? 0 : void 0 : (Yd(n), n); case w.FIXED32: case w.UINT32: return n === 0 ? a ? 0 : void 0 : (Wm(n), n); // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity". // Either numbers or strings are accepted. Exponent notation is also accepted. case w.FLOAT: M2(n); case w.DOUBLE: return n === 0 ? a ? 0 : void 0 : (Dt(typeof n == "number"), Number.isNaN(n) ? "NaN" : n === Number.POSITIVE_INFINITY ? "Infinity" : n === Number.NEGATIVE_INFINITY ? "-Infinity" : n); // string: case w.STRING: return n === "" ? a ? "" : void 0 : (Dt(typeof n == "string"), n); // bool: case w.BOOL: return n === !1 ? a ? !1 : void 0 : (Dt(typeof n == "boolean"), n); // JSON value will be a decimal string. Either numbers or strings are accepted. case w.UINT64: case w.FIXED64: Dt(typeof n == "number" || typeof n == "string" || typeof n == "bigint"); let s = Ir.from(n); return s.isZero() && !a ? void 0 : s.toString(); // JSON value will be a decimal string. Either numbers or strings are accepted. case w.INT64: case w.SFIXED64: case w.SINT64: Dt(typeof n == "number" || typeof n == "string" || typeof n == "bigint"); let c = yn.from(n); return c.isZero() && !a ? void 0 : c.toString(); // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. // Either standard or URL-safe base64 encoding with/without paddings are accepted. case w.BYTES: return Dt(n instanceof Uint8Array), n.byteLength ? _7(n) : a ? "" : void 0; } } } function lS(t, e = Ko.STRING) { switch (t) { case w.BOOL: return !1; case w.UINT64: case w.FIXED64: return ao(Ir.ZERO, e); case w.INT64: case w.SFIXED64: case w.SINT64: return ao(yn.ZERO, e); case w.DOUBLE: case w.FLOAT: return 0; case w.BYTES: return new Uint8Array(0); case w.STRING: return ""; default: return 0; } } class G7 { constructor(e) { this.info = e; } prepare() { var e; if (!this.fieldNoToField) { const n = (e = this.info.fields) !== null && e !== void 0 ? e : []; this.fieldNoToField = new Map(n.map((r) => [r.no, r])); } } /** * Reads a message from binary format into the target message. * * Repeated fields are appended. Map entries are added, overwriting * existing keys. * * If a message field is already present, it will be merged with the * new data. */ read(e, n, r, i) { this.prepare(); const o = i === void 0 ? e.len : e.pos + i; for (; e.pos < o; ) { const [a, s] = e.tag(), c = this.fieldNoToField.get(a); if (!c) { let f = r.readUnknownField; if (f == "throw") throw new Error(`Unknown field ${a} (wire type ${s}) for ${this.info.typeName}`); let m = e.skip(s); f !== !1 && (f === !0 ? zm.onRead : f)(this.info.typeName, n, a, s, m); continue; } let u = n, d = c.repeat, p = c.localName; switch (c.oneof && (u = u[c.oneof], u.oneofKind !== p && (u = n[c.oneof] = { oneofKind: p })), c.kind) { case "scalar": case "enum": let f = c.kind == "enum" ? w.INT32 : c.T, m = c.kind == "scalar" ? c.L : void 0; if (d) { let x = u[p]; if (s == mn.LengthDelimited && f != w.STRING && f != w.BYTES) { let g = e.uint32() + e.pos; for (; e.pos < g; ) x.push(this.scalar(e, f, m)); } else x.push(this.scalar(e, f, m)); } else u[p] = this.scalar(e, f, m); break; case "message": if (d) { let x = u[p], g = c.T().internalBinaryRead(e, e.uint32(), r); x.push(g); } else u[p] = c.T().internalBinaryRead(e, e.uint32(), r, u[p]); break; case "map": let [h, y] = this.mapEntry(c, e, r); u[p][h] = y; break; } } } /** * Read a map field, expecting key field = 1, value field = 2 */ mapEntry(e, n, r) { let i = n.uint32(), o = n.pos + i, a, s; for (; n.pos < o; ) { let [c, u] = n.tag(); switch (c) { case 1: e.K == w.BOOL ? a = n.bool().toString() : a = this.scalar(n, e.K, Ko.STRING); break; case 2: switch (e.V.kind) { case "scalar": s = this.scalar(n, e.V.T, e.V.L); break; case "enum": s = n.int32(); break; case "message": s = e.V.T().internalBinaryRead(n, n.uint32(), r); break; } break; default: throw new Error(`Unknown field ${c} (wire type ${u}) in map entry for ${this.info.typeName}#${e.name}`); } } if (a === void 0) { let c = lS(e.K); a = e.K == w.BOOL ? c.toString() : c; } if (s === void 0) switch (e.V.kind) { case "scalar": s = lS(e.V.T, e.V.L); break; case "enum": s = 0; break; case "message": s = e.V.T().create(); break; } return [a, s]; } scalar(e, n, r) { switch (n) { case w.INT32: return e.int32(); case w.STRING: return e.string(); case w.BOOL: return e.bool(); case w.DOUBLE: return e.double(); case w.FLOAT: return e.float(); case w.INT64: return ao(e.int64(), r); case w.UINT64: return ao(e.uint64(), r); case w.FIXED64: return ao(e.fixed64(), r); case w.FIXED32: return e.fixed32(); case w.BYTES: return e.bytes(); case w.UINT32: return e.uint32(); case w.SFIXED32: return e.sfixed32(); case w.SFIXED64: return ao(e.sfixed64(), r); case w.SINT32: return e.sint32(); case w.SINT64: return ao(e.sint64(), r); } } } class q7 { constructor(e) { this.info = e; } prepare() { if (!this.fields) { const e = this.info.fields ? this.info.fields.concat() : []; this.fields = e.sort((n, r) => n.no - r.no); } } /** * Writes the message to binary format. */ write(e, n, r) { this.prepare(); for (const o of this.fields) { let a, s, c = o.repeat, u = o.localName; if (o.oneof) { const d = e[o.oneof]; if (d.oneofKind !== u) continue; a = d[u], s = !0; } else a = e[u], s = !1; switch (o.kind) { case "scalar": case "enum": let d = o.kind == "enum" ? w.INT32 : o.T; if (c) if (Dt(Array.isArray(a)), c == Wr.PACKED) this.packed(n, d, o.no, a); else for (const p of a) this.scalar(n, d, o.no, p, !0); else a === void 0 ? Dt(o.opt) : this.scalar(n, d, o.no, a, s || o.opt); break; case "message": if (c) { Dt(Array.isArray(a)); for (const p of a) this.message(n, r, o.T(), o.no, p); } else this.message(n, r, o.T(), o.no, a); break; case "map": Dt(typeof a == "object" && a !== null); for (const [p, f] of Object.entries(a)) this.mapEntry(n, r, o, p, f); break; } } let i = r.writeUnknownFields; i !== !1 && (i === !0 ? zm.onWrite : i)(this.info.typeName, e, n); } mapEntry(e, n, r, i, o) { e.tag(r.no, mn.LengthDelimited), e.fork(); let a = i; switch (r.K) { case w.INT32: case w.FIXED32: case w.UINT32: case w.SFIXED32: case w.SINT32: a = Number.parseInt(i); break; case w.BOOL: Dt(i == "true" || i == "false"), a = i == "true"; break; } switch (this.scalar(e, r.K, 1, a, !0), r.V.kind) { case "scalar": this.scalar(e, r.V.T, 2, o, !0); break; case "enum": this.scalar(e, w.INT32, 2, o, !0); break; case "message": this.message(e, n, r.V.T(), 2, o); break; } e.join(); } message(e, n, r, i, o) { o !== void 0 && (r.internalBinaryWrite(o, e.tag(i, mn.LengthDelimited).fork(), n), e.join()); } /** * Write a single scalar value. */ scalar(e, n, r, i, o) { let [a, s, c] = this.scalarInfo(n, i); (!c || o) && (e.tag(r, a), e[s](i)); } /** * Write an array of scalar values in packed format. */ packed(e, n, r, i) { if (!i.length) return; Dt(n !== w.BYTES && n !== w.STRING), e.tag(r, mn.LengthDelimited), e.fork(); let [, o] = this.scalarInfo(n); for (let a = 0; a < i.length; a++) e[o](i[a]); e.join(); } /** * Get information for writing a scalar value. * * Returns tuple: * [0]: appropriate WireType * [1]: name of the appropriate method of IBinaryWriter * [2]: whether the given value is a default value * * If argument `value` is omitted, [2] is always false. */ scalarInfo(e, n) { let r = mn.Varint, i, o = n === void 0, a = n === 0; switch (e) { case w.INT32: i = "int32"; break; case w.STRING: a = o || !n.length, r = mn.LengthDelimited, i = "string"; break; case w.BOOL: a = n === !1, i = "bool"; break; case w.UINT32: i = "uint32"; break; case w.DOUBLE: r = mn.Bit64, i = "double"; break; case w.FLOAT: r = mn.Bit32, i = "float"; break; case w.INT64: a = o || yn.from(n).isZero(), i = "int64"; break; case w.UINT64: a = o || Ir.from(n).isZero(), i = "uint64"; break; case w.FIXED64: a = o || Ir.from(n).isZero(), r = mn.Bit64, i = "fixed64"; break; case w.BYTES: a = o || !n.byteLength, r = mn.LengthDelimited, i = "bytes"; break; case w.FIXED32: r = mn.Bit32, i = "fixed32"; break; case w.SFIXED32: r = mn.Bit32, i = "sfixed32"; break; case w.SFIXED64: a = o || yn.from(n).isZero(), r = mn.Bit64, i = "sfixed64"; break; case w.SINT32: i = "sint32"; break; case w.SINT64: a = o || yn.from(n).isZero(), i = "sint64"; break; } return [r, i, o || a]; } } function z7(t) { const e = t.messagePrototype ? Object.create(t.messagePrototype) : Object.defineProperty({}, $D, { value: t }); for (let n of t.fields) { let r = n.localName; if (!n.opt) if (n.oneof) e[n.oneof] = { oneofKind: void 0 }; else if (n.repeat) e[r] = []; else switch (n.kind) { case "scalar": e[r] = lS(n.T, n.L); break; case "enum": e[r] = 0; break; case "map": e[r] = {}; break; } } return e; } function sy(t, e, n) { let r, i = n, o; for (let a of t.fields) { let s = a.localName; if (a.oneof) { const c = i[a.oneof]; if (c?.oneofKind == null) continue; if (r = c[s], o = e[a.oneof], o.oneofKind = c.oneofKind, r == null) { delete o[s]; continue; } } else if (r = i[s], o = e, r == null) continue; switch (a.repeat && (o[s].length = r.length), a.kind) { case "scalar": case "enum": if (a.repeat) for (let u = 0; u < r.length; u++) o[s][u] = r[u]; else o[s] = r; break; case "message": let c = a.T(); if (a.repeat) for (let u = 0; u < r.length; u++) o[s][u] = c.create(r[u]); else o[s] === void 0 ? o[s] = c.create(r) : c.mergePartial(o[s], r); break; case "map": switch (a.V.kind) { case "scalar": case "enum": Object.assign(o[s], r); break; case "message": let u = a.V.T(); for (let d of Object.keys(r)) o[s][d] = u.create(r[d]); break; } break; } } } function H7(t, e, n) { if (e === n) return !0; if (!e || !n) return !1; for (let r of t.fields) { let i = r.localName, o = r.oneof ? e[r.oneof][i] : e[i], a = r.oneof ? n[r.oneof][i] : n[i]; switch (r.kind) { case "enum": case "scalar": let s = r.kind == "enum" ? w.INT32 : r.T; if (!(r.repeat ? H3(s, o, a) : GD(s, o, a))) return !1; break; case "map": if (!(r.V.kind == "message" ? W3(r.V.T(), Xf(o), Xf(a)) : H3(r.V.kind == "enum" ? w.INT32 : r.V.T, Xf(o), Xf(a)))) return !1; break; case "message": let c = r.T(); if (!(r.repeat ? W3(c, o, a) : c.equals(o, a))) return !1; break; } } return !0; } const Xf = Object.values; function GD(t, e, n) { if (e === n) return !0; if (t !== w.BYTES) return !1; let r = e, i = n; if (r.length !== i.length) return !1; for (let o = 0; o < r.length; o++) if (r[o] != i[o]) return !1; return !0; } function H3(t, e, n) { if (e.length !== n.length) return !1; for (let r = 0; r < e.length; r++) if (!GD(t, e[r], n[r])) return !1; return !0; } function W3(t, e, n) { if (e.length !== n.length) return !1; for (let r = 0; r < e.length; r++) if (!t.equals(e[r], n[r])) return !1; return !0; } const qD = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})), W7 = qD[$D] = {}; class Jd { constructor(e, n, r) { this.defaultCheckDepth = 16, this.typeName = e, this.fields = n.map(U7), this.options = r ?? {}, W7.value = this, this.messagePrototype = Object.create(null, qD), this.refTypeCheck = new Q7(this), this.refJsonReader = new j7(this), this.refJsonWriter = new $7(this), this.refBinReader = new G7(this), this.refBinWriter = new q7(this); } create(e) { let n = z7(this); return e !== void 0 && sy(this, n, e), n; } /** * Clone the message. * * Unknown fields are discarded. */ clone(e) { let n = this.create(); return sy(this, n, e), n; } /** * Determines whether two message of the same type have the same field values. * Checks for deep equality, traversing repeated fields, oneof groups, maps * and messages recursively. * Will also return true if both messages are `undefined`. */ equals(e, n) { return H7(this, e, n); } /** * Is the given value assignable to our message type * and contains no [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? */ is(e, n = this.defaultCheckDepth) { return this.refTypeCheck.is(e, n, !1); } /** * Is the given value assignable to our message type, * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? */ isAssignable(e, n = this.defaultCheckDepth) { return this.refTypeCheck.is(e, n, !0); } /** * Copy partial data into the target message. */ mergePartial(e, n) { sy(this, e, n); } /** * Create a new message from binary format. */ fromBinary(e, n) { let r = C7(n); return this.internalBinaryRead(r.readerFactory(e), e.byteLength, r); } /** * Read a new message from a JSON value. */ fromJson(e, n) { return this.internalJsonRead(e, R7(n)); } /** * Read a new message from a JSON string. * This is equivalent to `T.fromJson(JSON.parse(json))`. */ fromJsonString(e, n) { let r = JSON.parse(e); return this.fromJson(r, n); } /** * Write the message to canonical JSON value. */ toJson(e, n) { return this.internalJsonWrite(e, B7(n)); } /** * Convert the message to canonical JSON string. * This is equivalent to `JSON.stringify(T.toJson(t))` */ toJsonString(e, n) { var r; let i = this.toJson(e, n); return JSON.stringify(i, null, (r = n?.prettySpaces) !== null && r !== void 0 ? r : 0); } /** * Write the message to binary format. */ toBinary(e, n) { let r = F7(n); return this.internalBinaryWrite(e, r.writerFactory(), r).finish(); } /** * This is an internal method. If you just want to read a message from * JSON, use `fromJson()` or `fromJsonString()`. * * Reads JSON value and merges the fields into the target * according to protobuf rules. If the target is omitted, * a new instance is created first. */ internalJsonRead(e, n, r) { if (e !== null && typeof e == "object" && !Array.isArray(e)) { let i = r ?? this.create(); return this.refJsonReader.read(e, i, n), i; } throw new Error(`Unable to parse message ${this.typeName} from JSON ${BD(e)}.`); } /** * This is an internal method. If you just want to write a message * to JSON, use `toJson()` or `toJsonString(). * * Writes JSON value and returns it. */ internalJsonWrite(e, n) { return this.refJsonWriter.write(e, n); } /** * This is an internal method. If you just want to write a message * in binary format, use `toBinary()`. * * Serializes the message in binary format and appends it to the given * writer. Returns passed writer. */ internalBinaryWrite(e, n, r) { return this.refBinWriter.write(e, n, r), n; } /** * This is an internal method. If you just want to read a message from * binary data, use `fromBinary()`. * * Reads data from binary format and merges the fields into * the target according to protobuf rules. If the target is * omitted, a new instance is created first. */ internalBinaryRead(e, n, r, i) { let o = i ?? this.create(); return this.refBinReader.read(e, o, r, n), o; } } function v(t, e, n, r) { return typeof e == "function" ? { kind: "message", no: t, type: e, optional: n ?? !1, repeat: r ?? !1 } : { kind: "scalar", no: t, type: e, optional: n ?? !1, repeat: r ?? !1 }; } class Km { _field; _proto_msg; static cache = /* @__PURE__ */ new WeakMap(); constructor(e) { this._field = Object.keys(e).map((n) => { const r = e[n]; if (r.kind === "scalar") { const i = r.repeat ? [w.STRING, w.BYTES].includes(r.type) ? Wr.UNPACKED : Wr.PACKED : Wr.NO; return { no: r.no, name: n, kind: "scalar", T: r.type, opt: r.optional, repeat: i }; } else { if (r.kind === "message") return { no: r.no, name: n, kind: "message", repeat: r.repeat ? Wr.PACKED : Wr.NO, T: () => Km.getInstance(r.type())._proto_msg }; throw new Error(`Unknown field kind: ${r.kind}`); } }), this._proto_msg = new Jd("nya", this._field); } static getInstance(e) { let n = this.cache.get(e); return n || (n = new Km(e), this.cache.set(e, n)), n; } encode(e) { return this._proto_msg.toBinary(this._proto_msg.create(e)); } decode(e) { return this._proto_msg.fromBinary(e); } } class he { realMsg; constructor(e) { this.realMsg = Km.getInstance(e); } encode(e) { return this.realMsg.encode(e); } decode(e) { return this.realMsg.decode(e); } } var $n = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function ra(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } function zD(t) { if (Object.prototype.hasOwnProperty.call(t, "__esModule")) return t; var e = t.default; if (typeof e == "function") { var n = function r() { return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); }; n.prototype = e.prototype; } else n = {}; return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) { var i = Object.getOwnPropertyDescriptor(t, r); Object.defineProperty(n, r, i.get ? i : { enumerable: !0, get: function() { return t[r]; } }); }), n; } var K3 = {}; /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var V3; function K7() { if (V3) return K3; V3 = 1; var t; return (function(e) { (function(n) { var r = typeof globalThis == "object" ? globalThis : typeof $n == "object" ? $n : typeof self == "object" ? self : typeof this == "object" ? this : c(), i = o(e); typeof r.Reflect < "u" && (i = o(r.Reflect, i)), n(i, r), typeof r.Reflect > "u" && (r.Reflect = e); function o(u, d) { return function(p, f) { Object.defineProperty(u, p, { configurable: !0, writable: !0, value: f }), d && d(p, f); }; } function a() { try { return Function("return this;")(); } catch { } } function s() { try { return (0, eval)("(function() { return this; })()"); } catch { } } function c() { return a() || s(); } })(function(n, r) { var i = Object.prototype.hasOwnProperty, o = typeof Symbol == "function", a = o && typeof Symbol.toPrimitive < "u" ? Symbol.toPrimitive : "@@toPrimitive", s = o && typeof Symbol.iterator < "u" ? Symbol.iterator : "@@iterator", c = typeof Object.create == "function", u = { __proto__: [] } instanceof Array, d = !c && !u, p = { // create an object in dictionary mode (a.k.a. "slow" mode in v8) create: c ? function() { return iy(/* @__PURE__ */ Object.create(null)); } : u ? function() { return iy({ __proto__: null }); } : function() { return iy({}); }, has: d ? function(ae, ue) { return i.call(ae, ue); } : function(ae, ue) { return ue in ae; }, get: d ? function(ae, ue) { return i.call(ae, ue) ? ae[ue] : void 0; } : function(ae, ue) { return ae[ue]; } }, f = Object.getPrototypeOf(Function), m = typeof Map == "function" && typeof Map.prototype.entries == "function" ? Map : lr(), h = typeof Set == "function" && typeof Set.prototype.entries == "function" ? Set : CL(), y = typeof WeakMap == "function" ? WeakMap : TL(), x = o ? Symbol.for("@reflect-metadata:registry") : void 0, g = ze(), b = Ft(g); function S(ae, ue, ge, Ne) { if (Q(ge)) { if (!j(ae)) throw new TypeError(); if (!se(ue)) throw new TypeError(); return D(ae, ue); } else { if (!j(ae)) throw new TypeError(); if (!O(ue)) throw new TypeError(); if (!O(Ne) && !Q(Ne) && !k(Ne)) throw new TypeError(); return k(Ne) && (Ne = void 0), ge = P(ge), X(ae, ue, ge, Ne); } } n("decorate", S); function E(ae, ue) { function ge(Ne, tt) { if (!O(Ne)) throw new TypeError(); if (!Q(tt) && !ce(tt)) throw new TypeError(); I(ae, ue, Ne, tt); } return ge; } n("metadata", E); function T(ae, ue, ge, Ne) { if (!O(ge)) throw new TypeError(); return Q(Ne) || (Ne = P(Ne)), I(ae, ue, ge, Ne); } n("defineMetadata", T); function U(ae, ue, ge) { if (!O(ue)) throw new TypeError(); return Q(ge) || (ge = P(ge)), V(ae, ue, ge); } n("hasMetadata", U); function q(ae, ue, ge) { if (!O(ue)) throw new TypeError(); return Q(ge) || (ge = P(ge)), K(ae, ue, ge); } n("hasOwnMetadata", q); function Y(ae, ue, ge) { if (!O(ue)) throw new TypeError(); return Q(ge) || (ge = P(ge)), $(ae, ue, ge); } n("getMetadata", Y); function H(ae, ue, ge) { if (!O(ue)) throw new TypeError(); return Q(ge) || (ge = P(ge)), _(ae, ue, ge); } n("getOwnMetadata", H); function G(ae, ue) { if (!O(ae)) throw new TypeError(); return Q(ue) || (ue = P(ue)), N(ae, ue); } n("getMetadataKeys", G); function J(ae, ue) { if (!O(ae)) throw new TypeError(); return Q(ue) || (ue = P(ue)), L(ae, ue); } n("getOwnMetadataKeys", J); function B(ae, ue, ge) { if (!O(ue)) throw new TypeError(); if (Q(ge) || (ge = P(ge)), !O(ue)) throw new TypeError(); Q(ge) || (ge = P(ge)); var Ne = ut( ue, ge, /*Create*/ !1 ); return Q(Ne) ? !1 : Ne.OrdinaryDeleteMetadata(ae, ue, ge); } n("deleteMetadata", B); function D(ae, ue) { for (var ge = ae.length - 1; ge >= 0; --ge) { var Ne = ae[ge], tt = Ne(ue); if (!Q(tt) && !k(tt)) { if (!se(tt)) throw new TypeError(); ue = tt; } } return ue; } function X(ae, ue, ge, Ne) { for (var tt = ae.length - 1; tt >= 0; --tt) { var pn = ae[tt], Fn = pn(ue, ge, Ne); if (!Q(Fn) && !k(Fn)) { if (!O(Fn)) throw new TypeError(); Ne = Fn; } } return Ne; } function V(ae, ue, ge) { var Ne = K(ae, ue, ge); if (Ne) return !0; var tt = Ye(ue); return k(tt) ? !1 : V(ae, tt, ge); } function K(ae, ue, ge) { var Ne = ut( ue, ge, /*Create*/ !1 ); return Q(Ne) ? !1 : Z(Ne.OrdinaryHasOwnMetadata(ae, ue, ge)); } function $(ae, ue, ge) { var Ne = K(ae, ue, ge); if (Ne) return _(ae, ue, ge); var tt = Ye(ue); if (!k(tt)) return $(ae, tt, ge); } function _(ae, ue, ge) { var Ne = ut( ue, ge, /*Create*/ !1 ); if (!Q(Ne)) return Ne.OrdinaryGetOwnMetadata(ae, ue, ge); } function I(ae, ue, ge, Ne) { var tt = ut( ge, Ne, /*Create*/ !0 ); tt.OrdinaryDefineOwnMetadata(ae, ue, ge, Ne); } function N(ae, ue) { var ge = L(ae, ue), Ne = Ye(ae); if (Ne === null) return ge; var tt = N(Ne, ue); if (tt.length <= 0) return ge; if (ge.length <= 0) return tt; for (var pn = new h(), Fn = [], vt = 0, Oe = ge; vt < Oe.length; vt++) { var Ue = Oe[vt], Qe = pn.has(Ue); Qe || (pn.add(Ue), Fn.push(Ue)); } for (var $e = 0, St = tt; $e < St.length; $e++) { var Ue = St[$e], Qe = pn.has(Ue); Qe || (pn.add(Ue), Fn.push(Ue)); } return Fn; } function L(ae, ue) { var ge = ut( ae, ue, /*create*/ !1 ); return ge ? ge.OrdinaryOwnMetadataKeys(ae, ue) : []; } function C(ae) { if (ae === null) return 1; switch (typeof ae) { case "undefined": return 0; case "boolean": return 2; case "string": return 3; case "symbol": return 4; case "number": return 5; case "object": return ae === null ? 1 : 6; default: return 6; } } function Q(ae) { return ae === void 0; } function k(ae) { return ae === null; } function M(ae) { return typeof ae == "symbol"; } function O(ae) { return typeof ae == "object" ? ae !== null : typeof ae == "function"; } function A(ae, ue) { switch (C(ae)) { case 0: return ae; case 1: return ae; case 2: return ae; case 3: return ae; case 4: return ae; case 5: return ae; } var ge = "string", Ne = we(ae, a); if (Ne !== void 0) { var tt = Ne.call(ae, ge); if (O(tt)) throw new TypeError(); return tt; } return F(ae); } function F(ae, ue) { var ge, Ne, tt; { var pn = ae.toString; if (W(pn)) { var Ne = pn.call(ae); if (!O(Ne)) return Ne; } var ge = ae.valueOf; if (W(ge)) { var Ne = ge.call(ae); if (!O(Ne)) return Ne; } } throw new TypeError(); } function Z(ae) { return !!ae; } function ee(ae) { return "" + ae; } function P(ae) { var ue = A(ae); return M(ue) ? ue : ee(ue); } function j(ae) { return Array.isArray ? Array.isArray(ae) : ae instanceof Object ? ae instanceof Array : Object.prototype.toString.call(ae) === "[object Array]"; } function W(ae) { return typeof ae == "function"; } function se(ae) { return typeof ae == "function"; } function ce(ae) { switch (C(ae)) { case 3: return !0; case 4: return !0; default: return !1; } } function oe(ae, ue) { return ae === ue || ae !== ae && ue !== ue; } function we(ae, ue) { var ge = ae[ue]; if (ge != null) { if (!W(ge)) throw new TypeError(); return ge; } } function Me(ae) { var ue = we(ae, s); if (!W(ue)) throw new TypeError(); var ge = ue.call(ae); if (!O(ge)) throw new TypeError(); return ge; } function He(ae) { return ae.value; } function We(ae) { var ue = ae.next(); return ue.done ? !1 : ue; } function Xe(ae) { var ue = ae.return; ue && ue.call(ae); } function Ye(ae) { var ue = Object.getPrototypeOf(ae); if (typeof ae != "function" || ae === f || ue !== f) return ue; var ge = ae.prototype, Ne = ge && Object.getPrototypeOf(ge); if (Ne == null || Ne === Object.prototype) return ue; var tt = Ne.constructor; return typeof tt != "function" || tt === ae ? ue : tt; } function it() { var ae; !Q(x) && typeof r.Reflect < "u" && !(x in r.Reflect) && typeof r.Reflect.defineMetadata == "function" && (ae = Or(r.Reflect)); var ue, ge, Ne, tt = new y(), pn = { registerProvider: Fn, getProvider: Oe, setProvider: Qe }; return pn; function Fn($e) { if (!Object.isExtensible(pn)) throw new Error("Cannot add provider to a frozen registry."); switch (!0) { case ae === $e: break; case Q(ue): ue = $e; break; case ue === $e: break; case Q(ge): ge = $e; break; case ge === $e: break; default: Ne === void 0 && (Ne = new h()), Ne.add($e); break; } } function vt($e, St) { if (!Q(ue)) { if (ue.isProviderFor($e, St)) return ue; if (!Q(ge)) { if (ge.isProviderFor($e, St)) return ue; if (!Q(Ne)) for (var Yt = Me(Ne); ; ) { var fn = We(Yt); if (!fn) return; var to = He(fn); if (to.isProviderFor($e, St)) return Xe(Yt), to; } } } if (!Q(ae) && ae.isProviderFor($e, St)) return ae; } function Oe($e, St) { var Yt = tt.get($e), fn; return Q(Yt) || (fn = Yt.get(St)), Q(fn) && (fn = vt($e, St), Q(fn) || (Q(Yt) && (Yt = new m(), tt.set($e, Yt)), Yt.set(St, fn))), fn; } function Ue($e) { if (Q($e)) throw new TypeError(); return ue === $e || ge === $e || !Q(Ne) && Ne.has($e); } function Qe($e, St, Yt) { if (!Ue(Yt)) throw new Error("Metadata provider not registered."); var fn = Oe($e, St); if (fn !== Yt) { if (!Q(fn)) return !1; var to = tt.get($e); Q(to) && (to = new m(), tt.set($e, to)), to.set(St, Yt); } return !0; } } function ze() { var ae; return !Q(x) && O(r.Reflect) && Object.isExtensible(r.Reflect) && (ae = r.Reflect[x]), Q(ae) && (ae = it()), !Q(x) && O(r.Reflect) && Object.isExtensible(r.Reflect) && Object.defineProperty(r.Reflect, x, { enumerable: !1, configurable: !1, writable: !1, value: ae }), ae; } function Ft(ae) { var ue = new y(), ge = { isProviderFor: function(Ue, Qe) { var $e = ue.get(Ue); return Q($e) ? !1 : $e.has(Qe); }, OrdinaryDefineOwnMetadata: Fn, OrdinaryHasOwnMetadata: tt, OrdinaryGetOwnMetadata: pn, OrdinaryOwnMetadataKeys: vt, OrdinaryDeleteMetadata: Oe }; return g.registerProvider(ge), ge; function Ne(Ue, Qe, $e) { var St = ue.get(Ue), Yt = !1; if (Q(St)) { if (!$e) return; St = new m(), ue.set(Ue, St), Yt = !0; } var fn = St.get(Qe); if (Q(fn)) { if (!$e) return; if (fn = new m(), St.set(Qe, fn), !ae.setProvider(Ue, Qe, ge)) throw St.delete(Qe), Yt && ue.delete(Ue), new Error("Wrong provider for target."); } return fn; } function tt(Ue, Qe, $e) { var St = Ne( Qe, $e, /*Create*/ !1 ); return Q(St) ? !1 : Z(St.has(Ue)); } function pn(Ue, Qe, $e) { var St = Ne( Qe, $e, /*Create*/ !1 ); if (!Q(St)) return St.get(Ue); } function Fn(Ue, Qe, $e, St) { var Yt = Ne( $e, St, /*Create*/ !0 ); Yt.set(Ue, Qe); } function vt(Ue, Qe) { var $e = [], St = Ne( Ue, Qe, /*Create*/ !1 ); if (Q(St)) return $e; for (var Yt = St.keys(), fn = Me(Yt), to = 0; ; ) { var N3 = We(fn); if (!N3) return $e.length = to, $e; var kL = He(N3); try { $e[to] = kL; } catch (NL) { try { Xe(fn); } finally { throw NL; } } to++; } } function Oe(Ue, Qe, $e) { var St = Ne( Qe, $e, /*Create*/ !1 ); if (Q(St) || !St.delete(Ue)) return !1; if (St.size === 0) { var Yt = ue.get(Qe); Q(Yt) || (Yt.delete($e), Yt.size === 0 && ue.delete(Yt)); } return !0; } } function Or(ae) { var ue = ae.defineMetadata, ge = ae.hasOwnMetadata, Ne = ae.getOwnMetadata, tt = ae.getOwnMetadataKeys, pn = ae.deleteMetadata, Fn = new y(), vt = { isProviderFor: function(Oe, Ue) { var Qe = Fn.get(Oe); return !Q(Qe) && Qe.has(Ue) ? !0 : tt(Oe, Ue).length ? (Q(Qe) && (Qe = new h(), Fn.set(Oe, Qe)), Qe.add(Ue), !0) : !1; }, OrdinaryDefineOwnMetadata: ue, OrdinaryHasOwnMetadata: ge, OrdinaryGetOwnMetadata: Ne, OrdinaryOwnMetadataKeys: tt, OrdinaryDeleteMetadata: pn }; return vt; } function ut(ae, ue, ge) { var Ne = g.getProvider(ae, ue); if (!Q(Ne)) return Ne; if (ge) { if (g.setProvider(ae, ue, b)) return b; throw new Error("Illegal state."); } } function lr() { var ae = {}, ue = [], ge = ( /** @class */ (function() { function vt(Oe, Ue, Qe) { this._index = 0, this._keys = Oe, this._values = Ue, this._selector = Qe; } return vt.prototype["@@iterator"] = function() { return this; }, vt.prototype[s] = function() { return this; }, vt.prototype.next = function() { var Oe = this._index; if (Oe >= 0 && Oe < this._keys.length) { var Ue = this._selector(this._keys[Oe], this._values[Oe]); return Oe + 1 >= this._keys.length ? (this._index = -1, this._keys = ue, this._values = ue) : this._index++, { value: Ue, done: !1 }; } return { value: void 0, done: !0 }; }, vt.prototype.throw = function(Oe) { throw this._index >= 0 && (this._index = -1, this._keys = ue, this._values = ue), Oe; }, vt.prototype.return = function(Oe) { return this._index >= 0 && (this._index = -1, this._keys = ue, this._values = ue), { value: Oe, done: !0 }; }, vt; })() ), Ne = ( /** @class */ (function() { function vt() { this._keys = [], this._values = [], this._cacheKey = ae, this._cacheIndex = -2; } return Object.defineProperty(vt.prototype, "size", { get: function() { return this._keys.length; }, enumerable: !0, configurable: !0 }), vt.prototype.has = function(Oe) { return this._find( Oe, /*insert*/ !1 ) >= 0; }, vt.prototype.get = function(Oe) { var Ue = this._find( Oe, /*insert*/ !1 ); return Ue >= 0 ? this._values[Ue] : void 0; }, vt.prototype.set = function(Oe, Ue) { var Qe = this._find( Oe, /*insert*/ !0 ); return this._values[Qe] = Ue, this; }, vt.prototype.delete = function(Oe) { var Ue = this._find( Oe, /*insert*/ !1 ); if (Ue >= 0) { for (var Qe = this._keys.length, $e = Ue + 1; $e < Qe; $e++) this._keys[$e - 1] = this._keys[$e], this._values[$e - 1] = this._values[$e]; return this._keys.length--, this._values.length--, oe(Oe, this._cacheKey) && (this._cacheKey = ae, this._cacheIndex = -2), !0; } return !1; }, vt.prototype.clear = function() { this._keys.length = 0, this._values.length = 0, this._cacheKey = ae, this._cacheIndex = -2; }, vt.prototype.keys = function() { return new ge(this._keys, this._values, tt); }, vt.prototype.values = function() { return new ge(this._keys, this._values, pn); }, vt.prototype.entries = function() { return new ge(this._keys, this._values, Fn); }, vt.prototype["@@iterator"] = function() { return this.entries(); }, vt.prototype[s] = function() { return this.entries(); }, vt.prototype._find = function(Oe, Ue) { if (!oe(this._cacheKey, Oe)) { this._cacheIndex = -1; for (var Qe = 0; Qe < this._keys.length; Qe++) if (oe(this._keys[Qe], Oe)) { this._cacheIndex = Qe; break; } } return this._cacheIndex < 0 && Ue && (this._cacheIndex = this._keys.length, this._keys.push(Oe), this._values.push(void 0)), this._cacheIndex; }, vt; })() ); return Ne; function tt(vt, Oe) { return vt; } function pn(vt, Oe) { return Oe; } function Fn(vt, Oe) { return [vt, Oe]; } } function CL() { var ae = ( /** @class */ (function() { function ue() { this._map = new m(); } return Object.defineProperty(ue.prototype, "size", { get: function() { return this._map.size; }, enumerable: !0, configurable: !0 }), ue.prototype.has = function(ge) { return this._map.has(ge); }, ue.prototype.add = function(ge) { return this._map.set(ge, ge), this; }, ue.prototype.delete = function(ge) { return this._map.delete(ge); }, ue.prototype.clear = function() { this._map.clear(); }, ue.prototype.keys = function() { return this._map.keys(); }, ue.prototype.values = function() { return this._map.keys(); }, ue.prototype.entries = function() { return this._map.entries(); }, ue.prototype["@@iterator"] = function() { return this.keys(); }, ue.prototype[s] = function() { return this.keys(); }, ue; })() ); return ae; } function TL() { var ae = 16, ue = p.create(), ge = Ne(); return ( /** @class */ (function() { function Oe() { this._key = Ne(); } return Oe.prototype.has = function(Ue) { var Qe = tt( Ue, /*create*/ !1 ); return Qe !== void 0 ? p.has(Qe, this._key) : !1; }, Oe.prototype.get = function(Ue) { var Qe = tt( Ue, /*create*/ !1 ); return Qe !== void 0 ? p.get(Qe, this._key) : void 0; }, Oe.prototype.set = function(Ue, Qe) { var $e = tt( Ue, /*create*/ !0 ); return $e[this._key] = Qe, this; }, Oe.prototype.delete = function(Ue) { var Qe = tt( Ue, /*create*/ !1 ); return Qe !== void 0 ? delete Qe[this._key] : !1; }, Oe.prototype.clear = function() { this._key = Ne(); }, Oe; })() ); function Ne() { var Oe; do Oe = "@@WeakMap@@" + vt(); while (p.has(ue, Oe)); return ue[Oe] = !0, Oe; } function tt(Oe, Ue) { if (!i.call(Oe, ge)) { if (!Ue) return; Object.defineProperty(Oe, ge, { value: p.create() }); } return Oe[ge]; } function pn(Oe, Ue) { for (var Qe = 0; Qe < Ue; ++Qe) Oe[Qe] = Math.random() * 255 | 0; return Oe; } function Fn(Oe) { if (typeof Uint8Array == "function") { var Ue = new Uint8Array(Oe); return typeof crypto < "u" ? crypto.getRandomValues(Ue) : typeof msCrypto < "u" ? msCrypto.getRandomValues(Ue) : pn(Ue, Oe), Ue; } return pn(new Array(Oe), Oe); } function vt() { var Oe = Fn(ae); Oe[6] = Oe[6] & 79 | 64, Oe[8] = Oe[8] & 191 | 128; for (var Ue = "", Qe = 0; Qe < ae; ++Qe) { var $e = Oe[Qe]; (Qe === 4 || Qe === 6 || Qe === 8) && (Ue += "-"), $e < 16 && (Ue += "0"), Ue += $e.toString(16).toLowerCase(); } return Ue; } } function iy(ae) { return ae.__ = void 0, delete ae.__, ae; } }); })(t || (t = {})), K3; } K7(); function Tn(t) { return (typeof t == "object" && t !== null || typeof t == "function") && typeof t.then == "function"; } function fr(t) { switch (typeof t) { case "string": case "symbol": return t.toString(); case "function": return t.name; default: throw new Error(`Unexpected ${typeof t} service id type`); } } const cy = Symbol.for("@inversifyjs/common/islazyServiceIdentifier"); class Vm { [cy]; #e; constructor(e) { this.#e = e, this[cy] = !0; } static is(e) { return typeof e == "object" && e !== null && e[cy] === !0; } unwrap() { return this.#e(); } } function Mu(t, e, n) { return Reflect.getOwnMetadata(e, t, n); } function HD(t, e, n, r) { Reflect.defineMetadata(e, n, t, r); } function WD(t, e, n, r, i) { const o = r(Mu(t, e, i) ?? n()); Reflect.defineMetadata(e, o, t, i); } const uy = "@inversifyjs/container/bindingId"; function rs() { const t = Mu(Object, uy) ?? 0; return t === Number.MAX_SAFE_INTEGER ? HD(Object, uy, Number.MIN_SAFE_INTEGER) : WD(Object, uy, () => t, (e) => e + 1), t; } const Qi = { Request: "Request", Singleton: "Singleton", Transient: "Transient" }, Tt = { ConstantValue: "ConstantValue", DynamicValue: "DynamicValue", Factory: "Factory", Instance: "Instance", Provider: "Provider", ResolvedValue: "ResolvedValue", ServiceRedirection: "ServiceRedirection" }; function* KD(...t) { for (const e of t) yield* e; } class Kp { #e; #t; #r; constructor(e) { this.#e = /* @__PURE__ */ new Map(), this.#t = {}; for (const n of Reflect.ownKeys(e)) this.#t[n] = /* @__PURE__ */ new Map(); this.#r = e; } add(e, n) { this.#o(e).push(n); for (const r of Reflect.ownKeys(n)) this.#a(r, n[r]).push(e); } clone() { const e = this.#n(), n = this.#i(), r = Reflect.ownKeys(this.#r), i = this._buildNewInstance(this.#r); this.#d(this.#e, i.#e, e, n); for (const o of r) this.#s(this.#t[o], i.#t[o], e); return i; } get(e, n) { return this.#t[e].get(n); } getAllKeys(e) { return this.#t[e].keys(); } removeByRelation(e, n) { const r = this.get(e, n); if (r === void 0) return; const i = new Set(r); for (const o of i) { const a = this.#e.get(o); if (a === void 0) throw new Error("Expecting model relation, none found"); for (const s of a) s[e] === n && this.#l(o, s); this.#e.delete(o); } } _buildNewInstance(e) { return new Kp(e); } _cloneModel(e) { return e; } _cloneRelation(e) { return e; } #n() { const e = /* @__PURE__ */ new Map(); for (const n of this.#e.keys()) { const r = this._cloneModel(n); e.set(n, r); } return e; } #i() { const e = /* @__PURE__ */ new Map(); for (const n of this.#e.values()) for (const r of n) { const i = this._cloneRelation(r); e.set(r, i); } return e; } #o(e) { let n = this.#e.get(e); return n === void 0 && (n = [], this.#e.set(e, n)), n; } #a(e, n) { let r = this.#t[e].get(n); return r === void 0 && (r = [], this.#t[e].set(n, r)), r; } #u(e, n) { const r = n.get(e); if (r === void 0) throw new Error("Expecting model to be cloned, none found"); return r; } #c(e, n) { const r = n.get(e); if (r === void 0) throw new Error("Expecting relation to be cloned, none found"); return r; } #s(e, n, r) { for (const [i, o] of e) { const a = new Array(); for (const s of o) a.push(this.#u(s, r)); n.set(i, a); } } #d(e, n, r, i) { for (const [o, a] of e) { const s = new Array(); for (const c of a) s.push(this.#c(c, i)); n.set(this.#u(o, r), s); } } #l(e, n) { for (const r of Reflect.ownKeys(n)) this.#f(e, r, n[r]); } #f(e, n, r) { const i = this.#t[n].get(r); if (i !== void 0) { const o = i.indexOf(e); o !== -1 && i.splice(o, 1), i.length === 0 && this.#t[n].delete(r); } } } var Xd; (function(t) { t.moduleId = "moduleId", t.serviceId = "serviceId"; })(Xd || (Xd = {})); class mp { #e; #t; constructor(e, n) { this.#e = n ?? new Kp({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e; } static build(e) { return new mp(e); } add(e, n) { this.#e.add(e, n); } clone() { return new mp(this.#t, this.#e.clone()); } get(e) { const n = [], r = this.#e.get(Xd.serviceId, e); r !== void 0 && n.push(r); const i = this.#t()?.get(e); if (i !== void 0 && n.push(i), n.length !== 0) return KD(...n); } removeAllByModuleId(e) { this.#e.removeByRelation(Xd.moduleId, e); } removeAllByServiceId(e) { this.#e.removeByRelation(Xd.serviceId, e); } } const VD = "@inversifyjs/core/classMetadataReflectKey"; function YD() { return { constructorArguments: [], lifecycle: { postConstructMethodNames: /* @__PURE__ */ new Set(), preDestroyMethodNames: /* @__PURE__ */ new Set() }, properties: /* @__PURE__ */ new Map(), scope: void 0 }; } const V7 = "@inversifyjs/core/pendingClassMetadataCountReflectKey", ly = Symbol.for("@inversifyjs/core/InversifyCoreError"); let Qn = class JD extends Error { [ly]; kind; constructor(e, n, r) { super(n, r), this[ly] = !0, this.kind = e; } static is(e) { return typeof e == "object" && e !== null && e[ly] === !0; } static isErrorOfKind(e, n) { return JD.is(e) && e.kind === n; } }; var bn, Ym, di, Zd, Ca; function c0(t) { const e = Mu(t, VD) ?? YD(); if (!(function(n) { const r = Mu(n, V7); return r !== void 0 && r !== 0; })(t)) return (function(n, r) { const i = []; if (r.length < n.length) throw new Qn(bn.missingInjectionDecorator, `Found unexpected missing metadata on type "${n.name}". "${n.name}" constructor requires at least ${n.length.toString()} arguments, found ${r.length.toString()} instead. Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument? If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`); for (let o = 0; o < r.length; ++o) r[o] === void 0 && i.push(o); if (i.length > 0) throw new Qn(bn.missingInjectionDecorator, `Found unexpected missing metadata on type "${n.name}" at constructor indexes "${i.join('", "')}". Are you using @inject, @multiInject or @unmanaged decorators at those indexes? If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`); })(t, e.constructorArguments), e; (function(n, r) { const i = []; for (let o = 0; o < r.constructorArguments.length; ++o) { const a = r.constructorArguments[o]; a !== void 0 && a.kind !== Ym.unknown || i.push(` - Missing or incomplete metadata for type "${n.name}" at constructor argument with index ${o.toString()}. Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`); } for (const [o, a] of r.properties) a.kind === Ym.unknown && i.push(` - Missing or incomplete metadata for type "${n.name}" at property "${o.toString()}". This property must be decorated either with @inject or @multiInject decorator.`); throw i.length === 0 ? new Qn(bn.unknown, `Unexpected class metadata for type "${n.name}" with uncompletion traces. This might be caused by one of the following reasons: 1. A third party library is targeting inversify reflection metadata. 2. A bug is causing the issue. Consider submiting an issue to fix it.`) : new Qn(bn.missingInjectionDecorator, `Invalid class metadata at type ${n.name}: ${i.join(` `)}`); })(t, e); } function XD(t, e) { const n = c0(e).scope ?? t.scope; return { cache: { isRight: !1, value: void 0 }, id: rs(), implementationType: e, isSatisfiedBy: () => !0, moduleId: void 0, onActivation: void 0, onDeactivation: void 0, scope: n, serviceIdentifier: e, type: Tt.Instance }; } function Yl(t) { return t.isRight ? { isRight: !0, value: t.value } : t; } function Y7(t) { switch (t.type) { case Tt.ConstantValue: case Tt.DynamicValue: return (function(e) { return { cache: Yl(e.cache), id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type, value: e.value }; })(t); case Tt.Factory: return (function(e) { return { cache: Yl(e.cache), factory: e.factory, id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type }; })(t); case Tt.Instance: return (function(e) { return { cache: Yl(e.cache), id: e.id, implementationType: e.implementationType, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type }; })(t); case Tt.Provider: return (function(e) { return { cache: Yl(e.cache), id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, provider: e.provider, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type }; })(t); case Tt.ResolvedValue: return (function(e) { return { cache: Yl(e.cache), factory: e.factory, id: e.id, isSatisfiedBy: e.isSatisfiedBy, metadata: e.metadata, moduleId: e.moduleId, onActivation: e.onActivation, onDeactivation: e.onDeactivation, scope: e.scope, serviceIdentifier: e.serviceIdentifier, type: e.type }; })(t); case Tt.ServiceRedirection: return (function(e) { return { id: e.id, isSatisfiedBy: e.isSatisfiedBy, moduleId: e.moduleId, serviceIdentifier: e.serviceIdentifier, targetServiceIdentifier: e.targetServiceIdentifier, type: e.type }; })(t); } } (function(t) { t[t.injectionDecoratorConflict = 0] = "injectionDecoratorConflict", t[t.missingInjectionDecorator = 1] = "missingInjectionDecorator", t[t.planning = 2] = "planning", t[t.resolution = 3] = "resolution", t[t.unknown = 4] = "unknown"; })(bn || (bn = {})), (function(t) { t[t.unknown = 32] = "unknown"; })(Ym || (Ym = {})), (function(t) { t.id = "id", t.moduleId = "moduleId", t.serviceId = "serviceId"; })(di || (di = {})); let J7 = class ZD extends Kp { _buildNewInstance(e) { return new ZD(e); } _cloneModel(e) { return Y7(e); } }, Y3 = class dS { #e; #t; #r; constructor(e, n, r) { this.#t = r ?? new J7({ id: { isOptional: !1 }, moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#r = e, this.#e = n; } static build(e, n) { return new dS(e, n); } clone() { return new dS(this.#r, this.#e, this.#t.clone()); } get(e) { const n = this.getNonParentBindings(e) ?? this.#r()?.get(e); if (n !== void 0) return n; const r = this.#n(e); return r === void 0 ? r : [r]; } *getChained(e) { const n = this.getNonParentBindings(e); n !== void 0 && (yield* n); const r = this.#r(); if (r === void 0) { if (n === void 0) { const i = this.#n(e); i !== void 0 && (yield i); } } else yield* r.getChained(e); } getBoundServices() { const e = new Set(this.#t.getAllKeys(di.serviceId)), n = this.#r(); if (n !== void 0) for (const r of n.getBoundServices()) e.add(r); return e; } getById(e) { return this.#t.get(di.id, e) ?? this.#r()?.getById(e); } getByModuleId(e) { return this.#t.get(di.moduleId, e) ?? this.#r()?.getByModuleId(e); } getNonParentBindings(e) { return this.#t.get(di.serviceId, e); } getNonParentBoundServices() { return this.#t.getAllKeys(di.serviceId); } removeById(e) { this.#t.removeByRelation(di.id, e); } removeAllByModuleId(e) { this.#t.removeByRelation(di.moduleId, e); } removeAllByServiceId(e) { this.#t.removeByRelation(di.serviceId, e); } set(e) { const n = { [di.id]: e.id, [di.serviceId]: e.serviceIdentifier }; e.moduleId !== void 0 && (n[di.moduleId] = e.moduleId), this.#t.add(e, n); } #n(e) { if (this.#e === void 0 || typeof e != "function") return; const n = XD(this.#e, e); return this.set(n), n; } }; (function(t) { t.moduleId = "moduleId", t.serviceId = "serviceId"; })(Zd || (Zd = {})); let J3 = class pS { #e; #t; constructor(e, n) { this.#e = n ?? new Kp({ moduleId: { isOptional: !0 }, serviceId: { isOptional: !1 } }), this.#t = e; } static build(e) { return new pS(e); } add(e, n) { this.#e.add(e, n); } clone() { return new pS(this.#t, this.#e.clone()); } get(e) { const n = [], r = this.#e.get(Zd.serviceId, e); r !== void 0 && n.push(r); const i = this.#t()?.get(e); if (i !== void 0 && n.push(i), n.length !== 0) return KD(...n); } removeAllByModuleId(e) { this.#e.removeByRelation(Zd.moduleId, e); } removeAllByServiceId(e) { this.#e.removeByRelation(Zd.serviceId, e); } }; (function(t) { t[t.multipleInjection = 0] = "multipleInjection", t[t.singleInjection = 1] = "singleInjection", t[t.unmanaged = 2] = "unmanaged"; })(Ca || (Ca = {})); var X3; (function(t) { t[t.method = 0] = "method", t[t.parameter = 1] = "parameter", t[t.property = 2] = "property"; })(X3 || (X3 = {})); const Z3 = "@inversifyjs/core/classIsInjectableFlagReflectKey", X7 = [Array, BigInt, Boolean, Function, Number, Object, String]; function Z7(t) { const e = Mu(t, "design:paramtypes"); e !== void 0 && WD(t, VD, YD, /* @__PURE__ */ (function(n) { return (r) => (n.forEach((i, o) => { var a; r.constructorArguments[o] !== void 0 || (a = i, X7.includes(a)) || (r.constructorArguments[o] = (function(s) { return { isFromTypescriptParamType: !0, kind: Ca.singleInjection, name: void 0, optional: !1, tags: /* @__PURE__ */ new Map(), value: s }; })(i)); }), r); })(e)); } function eQ(t) { return (e) => { (function(n) { if (Mu(n, Z3) !== void 0) throw new Qn(bn.injectionDecoratorConflict, `Cannot apply @injectable decorator multiple times at class "${n.name}"`); HD(n, Z3, !0); })(e), Z7(e); }; } var Ta; function R2(t) { return t instanceof Error ? t instanceof RangeError && /stack space|call stack|too much recursion/i.test(t.message) || t.name === "InternalError" && /too much recursion/.test(t.message) : !1; } function tQ(t, e) { if (R2(e)) { const n = (function(r) { const i = [...r]; return i.length === 0 ? "(No dependency trace)" : i.map(fr).join(" -> "); })((function(r) { const i = /* @__PURE__ */ new Set(); for (const o of r.servicesBranch) { if (i.has(o)) return [...i, o]; i.add(o); } return [...i]; })(t)); throw new Qn(bn.planning, `Circular dependency found: ${n}`, { cause: e }); } throw e; } (function(t) { t[t.multipleInjection = 0] = "multipleInjection", t[t.singleInjection = 1] = "singleInjection"; })(Ta || (Ta = {})); const dy = Symbol.for("@inversifyjs/core/LazyPlanServiceNode"); class mi { [dy]; _serviceIdentifier; _serviceNode; constructor(e, n) { this[dy] = !0, this._serviceNode = e, this._serviceIdentifier = n; } get bindings() { return this._getNode().bindings; } get isContextFree() { return this._getNode().isContextFree; } get serviceIdentifier() { return this._serviceIdentifier; } set bindings(e) { this._getNode().bindings = e; } set isContextFree(e) { this._getNode().isContextFree = e; } static is(e) { return typeof e == "object" && e !== null && e[dy] === !0; } invalidate() { this._serviceNode = void 0; } isExpanded() { return this._serviceNode !== void 0; } _getNode() { return this._serviceNode === void 0 && (this._serviceNode = this._buildPlanServiceNode()), this._serviceNode; } } class Fs { #e; constructor(e) { this.#e = e; } get name() { return this.#e.elem.name; } get serviceIdentifier() { return this.#e.elem.serviceIdentifier; } get tags() { return this.#e.elem.tags; } getAncestor() { if (this.#e.elem.getAncestorsCalled = !0, this.#e.previous !== void 0) return new Fs(this.#e.previous); } } function u0(t, e, n) { const r = n?.customServiceIdentifier ?? e.serviceIdentifier, i = (n?.chained === !0 ? [...t.operations.getBindingsChained(r)] : [...t.operations.getBindings(r) ?? []]).filter((o) => o.isSatisfiedBy(e)); if (i.length === 0 && t.autobindOptions !== void 0 && typeof r == "function") { const o = XD(t.autobindOptions, r); t.operations.setBinding(o), o.isSatisfiedBy(e) && i.push(o); } return i; } class B2 { last; constructor(e) { this.last = e; } concat(e) { return new B2({ elem: e, previous: this.last }); } [Symbol.iterator]() { let e = this.last; return { next: () => { if (e === void 0) return { done: !0, value: void 0 }; const n = e.elem; return e = e.previous, { done: !1, value: n }; } }; } } function fS(t) { const e = /* @__PURE__ */ new Map(); return t.rootConstraints.tag !== void 0 && e.set(t.rootConstraints.tag.key, t.rootConstraints.tag.value), new B2({ elem: { getAncestorsCalled: !1, name: t.rootConstraints.name, serviceIdentifier: t.rootConstraints.serviceIdentifier, tags: e }, previous: void 0 }); } function yc(t) { return t.redirections !== void 0; } function eO(t, e, n, r) { const i = n.elem.serviceIdentifier, o = n.previous?.elem.serviceIdentifier; Array.isArray(t) ? (function(a, s, c, u, d, p) { if (a.length !== 0) { const f = p[p.length - 1] ?? c, m = `Ambiguous bindings found for service: "${fr(f)}".${rO(p)} Registered bindings: ${a.map((h) => (function(y) { switch (y.type) { case Tt.Instance: return `[ type: "${y.type}", serviceIdentifier: "${fr(y.serviceIdentifier)}", scope: "${y.scope}", implementationType: "${y.implementationType.name}" ]`; case Tt.ServiceRedirection: return `[ type: "${y.type}", serviceIdentifier: "${fr(y.serviceIdentifier)}", redirection: "${fr(y.targetServiceIdentifier)}" ]`; default: return `[ type: "${y.type}", serviceIdentifier: "${fr(y.serviceIdentifier)}", scope: "${y.scope}" ]`; } })(h.binding)).join(` `)} Trying to resolve bindings for "${tO(c, u)}".${nO(d)}`; throw new Qn(bn.planning, m); } s || eI(c, u, d, p); })(t, e, i, o, n.elem, r) : (function(a, s, c, u, d, p) { a !== void 0 || s || eI(c, u, d, p); })(t, e, i, o, n.elem, r); } function eI(t, e, n, r) { const i = r[r.length - 1] ?? t, o = `No bindings found for service: "${fr(i)}". Trying to resolve bindings for "${tO(t, e)}".${rO(r)}${nO(n)}`; throw new Qn(bn.planning, o); } function tO(t, e) { return e === void 0 ? `${fr(t)} (Root service)` : fr(e); } function nO(t) { const e = t.tags.size === 0 ? "" : ` - tags: - ${[...t.tags.keys()].map((n) => n.toString()).join(` - `)}`; return ` Binding constraints: - service identifier: ${fr(t.serviceIdentifier)} - name: ${t.name?.toString() ?? "-"}${e}`; } function rO(t) { return t.length === 0 ? "" : ` - service redirections: - ${t.map((e) => fr(e)).join(` - `)}`; } function iO(t, e, n, r) { if (t.redirections.length === 1) { const [i] = t.redirections; return void (yc(i) && iO(i, e, n, [...r, i.binding.targetServiceIdentifier])); } eO(t.redirections, e, n, r); } function U2(t, e, n) { if (Array.isArray(t.bindings) && t.bindings.length === 1) { const [r] = t.bindings; return void (yc(r) && iO(r, e, n, [r.binding.targetServiceIdentifier])); } eO(t.bindings, e, n, []); } function l0(t) { return Vm.is(t) ? t.unwrap() : t; } function oO(t) { return (e, n, r) => { const i = l0(r.value), o = n.concat({ getAncestorsCalled: !1, name: r.name, serviceIdentifier: i, tags: r.tags }), a = new Fs(o.last), s = r.kind === Ca.multipleInjection && r.chained, c = u0(e, a, { chained: s }), u = [], d = { bindings: u, isContextFree: !0, serviceIdentifier: i }; if (u.push(...t(e, o, c, d, s)), d.isContextFree = !o.last.elem.getAncestorsCalled, r.kind === Ca.singleInjection) { U2(d, r.optional, o.last); const [p] = u; d.bindings = p; } return d; }; } function aO(t) { return (e, n, r) => { const i = l0(r.value), o = n.concat({ getAncestorsCalled: !1, name: r.name, serviceIdentifier: i, tags: r.tags }), a = new Fs(o.last), s = r.kind === Ta.multipleInjection && r.chained, c = u0(e, a, { chained: s }), u = [], d = { bindings: u, isContextFree: !0, serviceIdentifier: i }; if (u.push(...t(e, o, c, d, s)), d.isContextFree = !o.last.elem.getAncestorsCalled, r.kind === Ta.singleInjection) { U2(d, r.optional, o.last); const [p] = u; d.bindings = p; } return d; }; } function sO(t) { const e = /* @__PURE__ */ (function(o) { return (a, s, c) => { const u = { binding: s, classMetadata: a.operations.getClassMetadata(s.implementationType), constructorParams: [], propertyParams: /* @__PURE__ */ new Map() }, d = { autobindOptions: a.autobindOptions, node: u, operations: a.operations, servicesBranch: a.servicesBranch }; return o(d, c); }; })(t), n = /* @__PURE__ */ (function(o) { return (a, s, c) => { const u = { binding: s, params: [] }, d = { autobindOptions: a.autobindOptions, node: u, operations: a.operations, servicesBranch: a.servicesBranch }; return o(d, c); }; })(t), r = (o, a, s, c, u) => { const d = yc(c) ? c.binding.targetServiceIdentifier : c.serviceIdentifier; o.servicesBranch.push(d); const p = []; for (const f of s) switch (f.type) { case Tt.Instance: p.push(e(o, f, a)); break; case Tt.ResolvedValue: p.push(n(o, f, a)); break; case Tt.ServiceRedirection: { const m = i(o, a, f, u); p.push(m); break; } default: p.push({ binding: f }); } return o.servicesBranch.pop(), p; }, i = /* @__PURE__ */ (function(o) { return (a, s, c, u) => { const d = { binding: c, redirections: [] }, p = u0(a, new Fs(s.last), { chained: u, customServiceIdentifier: c.targetServiceIdentifier }); return d.redirections.push(...o(a, s, p, d, u)), d; }; })(r); return r; } function tI(t, e, n, r) { if (t !== void 0 && (mi.is(n) && !n.isExpanded() || n.isContextFree)) { const i = { tree: { root: n } }; e.setPlan(t, i); } else e.setNonCachedServiceNode(n, r); } class nQ extends mi { #e; #t; #r; #n; constructor(e, n, r, i, o) { super(o, l0(i.value)), this.#t = n, this.#e = e, this.#r = r, this.#n = i; } _buildPlanServiceNode() { return this.#t(this.#e, this.#r, this.#n); } } class rQ extends mi { #e; #t; #r; #n; constructor(e, n, r, i, o) { super(o, l0(i.value)), this.#e = e, this.#t = n, this.#r = r, this.#n = i; } _buildPlanServiceNode() { return this.#t(this.#e, this.#r, this.#n); } } function cO(t, e, n, r) { const i = /* @__PURE__ */ (function(a, s) { const c = /* @__PURE__ */ (function(u, d) { return (p, f, m) => { if (m.kind === Ca.unmanaged) return; const h = (function(g) { let b; if (g.tags.size === 0) b = void 0; else { if (g.tags.size !== 1) return; { const [E, T] = g.tags.entries().next().value; b = { key: E, value: T }; } } const S = Vm.is(g.value) ? g.value.unwrap() : g.value; return g.kind === Ca.multipleInjection ? { chained: g.chained, isMultiple: !0, name: g.name, optional: g.optional, serviceIdentifier: S, tag: b } : { isMultiple: !1, name: g.name, optional: g.optional, serviceIdentifier: S, tag: b }; })(m); if (h !== void 0) { const g = p.operations.getPlan(h); if (g !== void 0 && g.tree.root.isContextFree) return g.tree.root; } const y = d(p, f, m), x = new nQ(p, u, f, m, y); return tI(h, p.operations, x, { bindingConstraintsList: f, chainedBindings: m.kind === Ca.multipleInjection && m.chained, optionalBindings: m.optional }), x; }; })(a, s); return (u, d, p) => { const f = d.classMetadata; for (const [m, h] of f.constructorArguments.entries()) d.constructorParams[m] = c(u, p, h); for (const [m, h] of f.properties) { const y = c(u, p, h); y !== void 0 && d.propertyParams.set(m, y); } return u.node; }; })(t, n), o = /* @__PURE__ */ (function(a, s) { const c = /* @__PURE__ */ (function(u, d) { return (p, f, m) => { const h = (function(g) { let b; if (g.tags.size === 0) b = void 0; else { if (g.tags.size !== 1) return; { const [E, T] = g.tags.entries().next().value; b = { key: E, value: T }; } } const S = Vm.is(g.value) ? g.value.unwrap() : g.value; return g.kind === Ta.multipleInjection ? { chained: g.chained, isMultiple: !0, name: g.name, optional: g.optional, serviceIdentifier: S, tag: b } : { isMultiple: !1, name: g.name, optional: g.optional, serviceIdentifier: S, tag: b }; })(m); if (h !== void 0) { const g = p.operations.getPlan(h); if (g !== void 0 && g.tree.root.isContextFree) return g.tree.root; } const y = d(p, f, m), x = new rQ(p, u, f, m, y); return tI(h, p.operations, x, { bindingConstraintsList: f, chainedBindings: m.kind === Ta.multipleInjection && m.chained, optionalBindings: m.optional }), x; }; })(a, s); return (u, d, p) => { const f = d.binding.metadata; for (const [m, h] of f.arguments.entries()) d.params[m] = c(u, p, h); return u.node; }; })(e, r); return (a, s) => a.node.binding.type === Tt.Instance ? i(a, a.node, s) : o(a, a.node, s); } class iQ extends mi { #e; constructor(e, n) { super(n, n.serviceIdentifier), this.#e = e; } _buildPlanServiceNode() { return dO(this.#e); } } const hS = oO(lO), mS = aO(lO), uO = sO(cO(hS, mS, hS, mS)); function lO(t, e, n, r, i) { return uO(t, e, n, r, i); } const dO = /* @__PURE__ */ (function(t) { return (e) => { const n = fS(e), r = new Fs(n.last), i = e.rootConstraints.isMultiple && e.rootConstraints.chained, o = u0(e, r, { chained: i }), a = [], s = { bindings: a, isContextFree: !0, serviceIdentifier: e.rootConstraints.serviceIdentifier }; if (a.push(...t(e, n, o, s, i)), s.isContextFree = !n.last.elem.getAncestorsCalled, !e.rootConstraints.isMultiple) { U2(s, e.rootConstraints.isOptional ?? !1, n.last); const [c] = a; s.bindings = c; } return s; }; })(uO); function oQ(t) { try { const e = (function(o) { return o.rootConstraints.isMultiple ? { chained: o.rootConstraints.chained, isMultiple: !0, name: o.rootConstraints.name, optional: o.rootConstraints.isOptional ?? !1, serviceIdentifier: o.rootConstraints.serviceIdentifier, tag: o.rootConstraints.tag } : { isMultiple: !1, name: o.rootConstraints.name, optional: o.rootConstraints.isOptional ?? !1, serviceIdentifier: o.rootConstraints.serviceIdentifier, tag: o.rootConstraints.tag }; })(t), n = t.operations.getPlan(e); if (n !== void 0) return n; const r = dO(t), i = { tree: { root: new iQ(t, r) } }; return t.operations.setPlan(e, i), i; } catch (e) { tQ(t, e); } } var so; (function(t) { t.bindingAdded = "bindingAdded", t.bindingRemoved = "bindingRemoved"; })(so || (so = {})); class aQ { #e; #t; #r; constructor() { this.#e = [], this.#t = 8, this.#r = 1024; } *[Symbol.iterator]() { let e = 0; for (const n of this.#e) { const r = n.deref(); r === void 0 ? ++e : yield r; } this.#e.length >= this.#t && this.#i(e) && this.#n(e); } push(e) { const n = new WeakRef(e); if (this.#e.push(n), this.#e.length >= this.#t && this.#e.length % this.#r === 0) { let r = 0; for (const i of this.#e) i.deref() === void 0 && ++r; this.#i(r) && this.#n(r); } } #n(e) { const n = new Array(this.#e.length - e); let r = 0; for (const i of this.#e) i.deref() && (n[r++] = i); this.#e = n; } #i(e) { return e >= 0.5 * this.#e.length; } } const L2 = sO(cO(hS, mS, function(t, e, n) { return sQ(t, e, n); }, function(t, e, n) { return cQ(t, e, n); })), sQ = (function(t) { const e = oO(t); return (n, r, i) => { try { return e(n, r, i); } catch (o) { if (Qn.isErrorOfKind(o, bn.planning)) return; throw o; } }; })(L2), cQ = (function(t) { const e = aO(t); return (n, r, i) => { try { return e(n, r, i); } catch (o) { if (Qn.isErrorOfKind(o, bn.planning)) return; throw o; } }; })(L2); function nI(t, e, n, r, i) { if (mi.is(e) && !e.isExpanded()) return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 }; const o = new Fs(r.last); return !n.isSatisfiedBy(o) || r.last.elem.getAncestorsCalled ? { isContextFreeBinding: !r.last.elem.getAncestorsCalled, shouldInvalidateServiceNode: !1 } : (function(a, s, c, u, d) { let p; try { [p] = L2(a, u, [c], s, d); } catch (f) { if (R2(f)) return { isContextFreeBinding: !1, shouldInvalidateServiceNode: !0 }; throw f; } return (function(f, m) { if (Array.isArray(f.bindings)) f.bindings.push(m); else { if (f.bindings !== void 0) { if (!mi.is(f)) throw new Qn(bn.planning, "Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue"); return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !0 }; } f.bindings = m; } return { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 }; })(s, p); })(t, e, n, r, i); } function rI(t, e, n, r) { if (mi.is(t) && !t.isExpanded()) return { bindingNodeRemoved: void 0, isContextFreeBinding: !0 }; const i = new Fs(n.last); if (!e.isSatisfiedBy(i) || n.last.elem.getAncestorsCalled) return { bindingNodeRemoved: void 0, isContextFreeBinding: !n.last.elem.getAncestorsCalled }; let o; if (Array.isArray(t.bindings)) t.bindings = t.bindings.filter((a) => a.binding !== e || (o = a, !1)); else if (t.bindings?.binding === e) if (o = t.bindings, r) t.bindings = void 0; else { if (!mi.is(t)) throw new Qn(bn.planning, "Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue"); t.invalidate(); } return { bindingNodeRemoved: o, isContextFreeBinding: !0 }; } class iI { #e; #t; #r; #n; #i; #o; constructor() { this.#e = /* @__PURE__ */ new Map(), this.#t = this.#a(), this.#r = this.#a(), this.#n = this.#a(), this.#i = this.#a(), this.#o = new aQ(); } clearCache() { for (const e of this.#d()) e.clear(); for (const e of this.#o) e.clearCache(); } get(e) { return e.name === void 0 ? e.tag === void 0 ? this.#s(this.#t, e).get(e.serviceIdentifier) : this.#s(this.#i, e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value) : e.tag === void 0 ? this.#s(this.#r, e).get(e.serviceIdentifier)?.get(e.name) : this.#s(this.#n, e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value); } invalidateServiceBinding(e) { this.#v(e), this.#f(e), this.#h(e), this.#x(e), this.#b(e); for (const n of this.#o) n.invalidateServiceBinding(e); } set(e, n) { e.name === void 0 ? e.tag === void 0 ? this.#s(this.#t, e).set(e.serviceIdentifier, n) : this.#c(this.#c(this.#s(this.#i, e), e.serviceIdentifier), e.tag.key).set(e.tag.value, n) : e.tag === void 0 ? this.#c(this.#s(this.#r, e), e.serviceIdentifier).set(e.name, n) : this.#c(this.#c(this.#c(this.#s(this.#n, e), e.serviceIdentifier), e.name), e.tag.key).set(e.tag.value, n); } setNonCachedServiceNode(e, n) { let r = this.#e.get(e.serviceIdentifier); r === void 0 && (r = /* @__PURE__ */ new Map(), this.#e.set(e.serviceIdentifier, r)), r.set(e, n); } subscribe(e) { this.#o.push(e); } #a() { const e = new Array(8); for (let n = 0; n < e.length; ++n) e[n] = /* @__PURE__ */ new Map(); return e; } #u(e, n, r, i) { const o = !!(2 & n); let a; return o ? a = { chained: !!(0 & n), isMultiple: o, serviceIdentifier: e.binding.serviceIdentifier } : a = { isMultiple: o, serviceIdentifier: e.binding.serviceIdentifier }, 1 & n && (a.isOptional = !0), r !== void 0 && (a.name = r), i !== void 0 && (a.tag = i), { autobindOptions: void 0, operations: e.operations, rootConstraints: a, servicesBranch: [] }; } #c(e, n) { let r = e.get(n); return r === void 0 && (r = /* @__PURE__ */ new Map(), e.set(n, r)), r; } #s(e, n) { return e[this.#l(n)]; } #d() { return [this.#e, ...this.#t, ...this.#r, ...this.#n, ...this.#i]; } #l(e) { return e.isMultiple ? (e.chained ? 4 : 0) | (e.optional ? 1 : 0) | 2 : e.optional ? 1 : 0; } #f(e) { for (const [n, r] of this.#r.entries()) { const i = r.get(e.binding.serviceIdentifier); if (i !== void 0) for (const [o, a] of i.entries()) this.#m(e, a, n, o, void 0); } } #h(e) { for (const [n, r] of this.#n.entries()) { const i = r.get(e.binding.serviceIdentifier); if (i !== void 0) for (const [o, a] of i.entries()) for (const [s, c] of a.entries()) for (const [u, d] of c.entries()) this.#m(e, d, n, o, { key: s, value: u }); } } #p(e) { switch (e.binding.type) { case Tt.ServiceRedirection: for (const n of e.redirections) this.#p(n); break; case Tt.Instance: for (const n of e.constructorParams) n !== void 0 && this.#g(n); for (const n of e.propertyParams.values()) this.#g(n); break; case Tt.ResolvedValue: for (const n of e.params) this.#g(n); } } #g(e) { const n = this.#e.get(e.serviceIdentifier); n !== void 0 && n.has(e) && (n.delete(e), this.#y(e)); } #y(e) { if ((!mi.is(e) || e.isExpanded()) && e.bindings !== void 0) if (Array.isArray(e.bindings)) for (const n of e.bindings) this.#p(n); else this.#p(e.bindings); } #b(e) { const n = this.#e.get(e.binding.serviceIdentifier); if (n !== void 0) switch (e.kind) { case so.bindingAdded: for (const [r, i] of n) { const o = nI({ autobindOptions: void 0, operations: e.operations, servicesBranch: [] }, r, e.binding, i.bindingConstraintsList, i.chainedBindings); o.isContextFreeBinding ? o.shouldInvalidateServiceNode && mi.is(r) && (this.#y(r), r.invalidate()) : this.clearCache(); } break; case so.bindingRemoved: for (const [r, i] of n) { const o = rI(r, e.binding, i.bindingConstraintsList, i.optionalBindings); o.isContextFreeBinding ? o.bindingNodeRemoved !== void 0 && this.#p(o.bindingNodeRemoved) : this.clearCache(); } } } #v(e) { for (const [n, r] of this.#t.entries()) { const i = r.get(e.binding.serviceIdentifier); this.#m(e, i, n, void 0, void 0); } } #x(e) { for (const [n, r] of this.#i.entries()) { const i = r.get(e.binding.serviceIdentifier); if (i !== void 0) for (const [o, a] of i.entries()) for (const [s, c] of a.entries()) this.#m(e, c, n, void 0, { key: o, value: s }); } } #m(e, n, r, i, o) { if (n !== void 0 && mi.is(n.tree.root)) { const u = this.#u(e, r, i, o); switch (e.kind) { case so.bindingAdded: { const d = (a = u, s = n.tree.root, c = e.binding, mi.is(s) && !s.isExpanded() ? { isContextFreeBinding: !0, shouldInvalidateServiceNode: !1 } : nI(a, s, c, fS(a), a.rootConstraints.isMultiple && a.rootConstraints.chained)); d.isContextFreeBinding ? d.shouldInvalidateServiceNode && (this.#y(n.tree.root), n.tree.root.invalidate()) : this.clearCache(); } break; case so.bindingRemoved: { const d = (function(p, f, m) { return mi.is(f) && !f.isExpanded() ? { bindingNodeRemoved: void 0, isContextFreeBinding: !0 } : rI(f, m, fS(p), p.rootConstraints.isOptional ?? !1); })(u, n.tree.root, e.binding); d.isContextFreeBinding ? d.bindingNodeRemoved !== void 0 && this.#p(d.bindingNodeRemoved) : this.clearCache(); } } } var a, s, c; } } function uQ(t, e) { if (R2(e)) { const n = (function(r) { const i = [...r]; return i.length === 0 ? "(No dependency trace)" : i.map(fr).join(" -> "); })((function(r) { const i = r.planResult.tree.root, o = []; function a(s) { const c = o.indexOf(s); if (c !== -1) return [...o.slice(c), s].map((u) => u.serviceIdentifier); o.push(s); try { for (const u of (function(d) { const p = [], f = d.bindings; if (f === void 0) return p; const m = (h) => { if (yc(h)) for (const y of h.redirections) m(y); else switch (h.binding.type) { case Tt.Instance: { const y = h; for (const x of y.constructorParams) x !== void 0 && p.push(x); for (const x of y.propertyParams.values()) p.push(x); break; } case Tt.ResolvedValue: { const y = h; for (const x of y.params) p.push(x); break; } } }; if (Array.isArray(f)) for (const h of f) m(h); else m(f); return p; })(s)) { const d = a(u); if (d !== void 0) return d; } } finally { o.pop(); } } return a(i) ?? []; })(t)); throw new Qn(bn.planning, `Circular dependency found: ${n}`, { cause: e }); } throw e; } function pO(t, e) { return Tn(e) ? (t.cache = { isRight: !0, value: e }, e.then((n) => oI(t, n))) : oI(t, e); } function oI(t, e) { return t.cache = { isRight: !0, value: e }, e; } function lQ(t, e, n) { const r = t.getActivations(e); return r === void 0 ? n : Tn(n) ? aI(t, n, r[Symbol.iterator]()) : (function(i, o, a) { let s = o, c = a.next(); for (; c.done !== !0; ) { const u = c.value(i.context, s); if (Tn(u)) return aI(i, u, a); s = u, c = a.next(); } return s; })(t, n, r[Symbol.iterator]()); } async function aI(t, e, n) { let r = await e, i = n.next(); for (; i.done !== !0; ) r = await i.value(t.context, r), i = n.next(); return r; } function xm(t, e, n) { let r = n; if (e.onActivation !== void 0) { const i = e.onActivation; r = Tn(r) ? r.then((o) => i(t.context, o)) : i(t.context, r); } return lQ(t, e.serviceIdentifier, r); } function Q2(t) { return (e, n) => n.cache.isRight ? n.cache.value : pO(n, xm(e, n, t(e, n))); } const dQ = Q2(function(t, e) { return e.value; }); function pQ(t) { return t; } function j2(t, e) { return (n, r) => { const i = t(r); switch (i.scope) { case Qi.Singleton: return i.cache.isRight ? i.cache.value : pO(i, xm(n, i, e(n, r))); case Qi.Request: { if (n.requestScopeCache.has(i.id)) return n.requestScopeCache.get(i.id); const o = xm(n, i, e(n, r)); return n.requestScopeCache.set(i.id, o), o; } case Qi.Transient: return xm(n, i, e(n, r)); } }; } const fQ = ((t) => j2(pQ, t))(function(t, e) { return e.value(t.context); }), hQ = Q2(function(t, e) { return e.factory(t.context); }); function sI(t, e, n) { const r = (function(i, o, a) { if (!(a in i)) throw new Qn(bn.resolution, `Expecting a "${a.toString()}" property when resolving "${o.implementationType.name}" class @postConstruct decorated method, none found.`); if (typeof i[a] != "function") throw new Qn(bn.resolution, `Expecting a "${a.toString()}" method when resolving "${o.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`); { let s; try { s = i[a](); } catch (c) { throw new Qn(bn.resolution, `Unexpected error found when calling "${a.toString()}" @postConstruct decorated method on class "${o.implementationType.name}"`, { cause: c }); } if (Tn(s)) return (async function(c, u, d) { try { await d; } catch (p) { throw new Qn(bn.resolution, `Unexpected error found when calling "${u.toString()}" @postConstruct decorated method on class "${c.implementationType.name}"`, { cause: p }); } })(o, a, s); } })(t, e, n); return Tn(r) ? r.then(() => t) : t; } function cI(t, e, n) { if (n.size === 0) return t; let r = t; for (const i of n) r = Tn(r) ? r.then((o) => sI(o, e, i)) : sI(r, e, i); return r; } function uI(t) { return (e, n, r) => { const i = new r.binding.implementationType(...e), o = t(n, i, r); return Tn(o) ? o.then(() => cI(i, r.binding, r.classMetadata.lifecycle.postConstructMethodNames)) : cI(i, r.binding, r.classMetadata.lifecycle.postConstructMethodNames); }; } const mQ = Q2(function(t, e) { return e.provider(t.context); }); function gQ(t) { return t.binding; } function yQ(t) { return t.binding; } const lI = /* @__PURE__ */ (function(t) { return (e, n, r) => { const i = []; for (const [o, a] of r.propertyParams) { const s = r.classMetadata.properties.get(o); if (s === void 0) throw new Qn(bn.resolution, `Expecting metadata at property "${o.toString()}", none found`); s.kind !== Ca.unmanaged && a.bindings !== void 0 && (n[o] = t(e, a), Tn(n[o]) && i.push((async () => { n[o] = await n[o]; })())); } if (i.length > 0) return Promise.all(i).then(() => { }); }; })(d0), dI = /* @__PURE__ */ (function(t) { return function e(n, r) { const i = []; for (const o of r.redirections) yc(o) ? i.push(...e(n, o)) : i.push(t(n, o)); return i; }; })(gS), bQ = /* @__PURE__ */ (function(t, e, n) { return (r, i) => { const o = t(r, i); return Tn(o) ? e(o, r, i) : n(o, r, i); }; })(/* @__PURE__ */ (function(t) { return (e, n) => { const r = []; for (const i of n.constructorParams) i === void 0 ? r.push(void 0) : r.push(t(e, i)); return r.some(Tn) ? Promise.all(r) : r; }; })(d0), /* @__PURE__ */ (function(t) { return async (e, n, r) => { const i = await e; return t(i, n, r); }; })(uI(lI)), uI(lI)), vQ = /* @__PURE__ */ (function(t) { return (e, n) => { const r = t(e, n); return Tn(r) ? r.then((i) => n.binding.factory(...i)) : n.binding.factory(...r); }; })(/* @__PURE__ */ (function(t) { return (e, n) => { const r = []; for (const i of n.params) r.push(t(e, i)); return r.some(Tn) ? Promise.all(r) : r; }; })(d0)), xQ = ((t) => j2(gQ, t))(bQ), wQ = ((t) => j2(yQ, t))(vQ); function SQ(t) { try { return d0(t, t.planResult.tree.root); } catch (e) { uQ(t, e); } } function gS(t, e) { switch (e.binding.type) { case Tt.ConstantValue: return dQ(t, e.binding); case Tt.DynamicValue: return fQ(t, e.binding); case Tt.Factory: return hQ(t, e.binding); case Tt.Instance: return xQ(t, e); case Tt.Provider: return mQ(t, e.binding); case Tt.ResolvedValue: return wQ(t, e); } } function d0(t, e) { if (e.bindings !== void 0) return Array.isArray(e.bindings) ? (function(n, r) { const i = []; for (const o of r) yc(o) ? i.push(...dI(n, o)) : i.push(gS(n, o)); return i.some(Tn) ? Promise.all(i) : i; })(t, e.bindings) : (function(n, r) { if (yc(r)) { const i = dI(n, r); if (i.length === 1) return i[0]; throw new Qn(bn.resolution, "Unexpected multiple resolved values on single injection"); } return gS(n, r); })(t, e.bindings); } function _Q(t) { return t.scope !== void 0; } function pI(t, e) { if (typeof t[e] == "function") return t[e](); } function fI(t, e) { const n = t.lifecycle.preDestroyMethodNames; if (n.size === 0) return; let r; for (const i of n) r = r === void 0 ? pI(e, i) : r.then(() => pI(e, i)); return r; } function hI(t, e, n) { const r = t.getDeactivations(e); if (r !== void 0) return Tn(n) ? mI(n, r[Symbol.iterator]()) : (function(i, o) { let a = o.next(); for (; a.done !== !0; ) { const s = a.value(i); if (Tn(s)) return mI(i, o); a = o.next(); } })(n, r[Symbol.iterator]()); } async function mI(t, e) { const n = await t; let r = e.next(); for (; r.done !== !0; ) await r.value(n), r = e.next(); } function EQ(t, e) { const n = (function(r, i) { if (i.type === Tt.Instance) { const o = r.getClassMetadata(i.implementationType), a = i.cache.value; return Tn(a) ? a.then((s) => fI(o, s)) : fI(o, a); } })(t, e); return n === void 0 ? gI(t, e) : n.then(() => gI(t, e)); } function gI(t, e) { const n = e.cache; return Tn(n.value) ? n.value.then((r) => yI(t, e, r)) : yI(t, e, n.value); } function yI(t, e, n) { let r; return e.onDeactivation !== void 0 && (r = (0, e.onDeactivation)(n)), r === void 0 ? hI(t, e.serviceIdentifier, n) : r.then(() => hI(t, e.serviceIdentifier, n)); } function Jm(t, e) { if (e === void 0) return; const n = (function(i) { const o = []; for (const a of i) _Q(a) && a.scope === Qi.Singleton && a.cache.isRight && o.push(a); return o; })(e), r = []; for (const i of n) { const o = EQ(t, i); o !== void 0 && r.push(o); } return r.length > 0 ? Promise.all(r).then(() => { }) : void 0; } function AQ(t, e) { const n = t.getBindingsFromModule(e); return Jm(t, n); } function IQ(t, e) { const n = t.getBindings(e); return Jm(t, n); } const CQ = Symbol.for("@inversifyjs/plugin/isPlugin"), fO = Symbol.for("@inversifyjs/container/bindingIdentifier"); function bI(t) { return typeof t == "object" && t !== null && t[fO] === !0; } class Vs { static always = (e) => !0; } const py = Symbol.for("@inversifyjs/container/InversifyContainerError"); class go extends Error { [py]; kind; constructor(e, n, r) { super(n, r), this[py] = !0, this.kind = e; } static is(e) { return typeof e == "object" && e !== null && e[py] === !0; } static isErrorOfKind(e, n) { return go.is(e) && e.kind === n; } } var yo; function $2(t) { return { [fO]: !0, id: t.id }; } function hd(t) { return (e) => { for (let n = e.getAncestor(); n !== void 0; n = n.getAncestor()) if (t(n)) return !0; return !1; }; } function Jl(t) { return (e) => e.name === t; } function Zf(t) { return (e) => e.serviceIdentifier === t; } function Xl(t, e) { return (n) => n.tags.has(t) && n.tags.get(t) === e; } function TQ(t) { return t.name === void 0 && t.tags.size === 0; } function eh(t) { const e = hd(t); return (n) => !e(n); } function th(t) { return (e) => { const n = e.getAncestor(); return n === void 0 || !t(n); }; } function nh(t) { return (e) => { const n = e.getAncestor(); return n !== void 0 && t(n); }; } (function(t) { t[t.invalidOperation = 0] = "invalidOperation"; })(yo || (yo = {})); class kQ { #e; constructor(e) { this.#e = e; } getIdentifier() { return $2(this.#e); } inRequestScope() { return this.#e.scope = Qi.Request, new lc(this.#e); } inSingletonScope() { return this.#e.scope = Qi.Singleton, new lc(this.#e); } inTransientScope() { return this.#e.scope = Qi.Transient, new lc(this.#e); } } let hO = class { #e; #t; #r; #n; constructor(e, n, r, i) { this.#e = e, this.#t = n, this.#r = r, this.#n = i; } to(e) { const n = c0(e), r = { cache: { isRight: !1, value: void 0 }, id: rs(), implementationType: e, isSatisfiedBy: Vs.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: n.scope ?? this.#r, serviceIdentifier: this.#n, type: Tt.Instance }; return this.#e(r), new fy(r); } toSelf() { if (typeof this.#n != "function") throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier'); return this.to(this.#n); } toConstantValue(e) { const n = { cache: { isRight: !1, value: void 0 }, id: rs(), isSatisfiedBy: Vs.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Qi.Singleton, serviceIdentifier: this.#n, type: Tt.ConstantValue, value: e }; return this.#e(n), new lc(n); } toDynamicValue(e) { const n = { cache: { isRight: !1, value: void 0 }, id: rs(), isSatisfiedBy: Vs.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: this.#r, serviceIdentifier: this.#n, type: Tt.DynamicValue, value: e }; return this.#e(n), new fy(n); } toResolvedValue(e, n) { const r = { cache: { isRight: !1, value: void 0 }, factory: e, id: rs(), isSatisfiedBy: Vs.always, metadata: this.#i(n), moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: this.#r, serviceIdentifier: this.#n, type: Tt.ResolvedValue }; return this.#e(r), new fy(r); } toFactory(e) { const n = { cache: { isRight: !1, value: void 0 }, factory: e, id: rs(), isSatisfiedBy: Vs.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, scope: Qi.Singleton, serviceIdentifier: this.#n, type: Tt.Factory }; return this.#e(n), new lc(n); } toProvider(e) { const n = { cache: { isRight: !1, value: void 0 }, id: rs(), isSatisfiedBy: Vs.always, moduleId: this.#t, onActivation: void 0, onDeactivation: void 0, provider: e, scope: Qi.Singleton, serviceIdentifier: this.#n, type: Tt.Provider }; return this.#e(n), new lc(n); } toService(e) { const n = { id: rs(), isSatisfiedBy: Vs.always, moduleId: this.#t, serviceIdentifier: this.#n, targetServiceIdentifier: e, type: Tt.ServiceRedirection }; this.#e(n); } #i(e) { return { arguments: (e ?? []).map((n) => (function(r) { return typeof r == "object" && !Vm.is(r); })(n) ? (function(r) { return r.isMultiple === !0; })(n) ? { chained: n.chained ?? !1, kind: Ta.multipleInjection, name: n.name, optional: n.optional ?? !1, tags: new Map((n.tags ?? []).map((r) => [r.key, r.value])), value: n.serviceIdentifier } : { kind: Ta.singleInjection, name: n.name, optional: n.optional ?? !1, tags: new Map((n.tags ?? []).map((r) => [r.key, r.value])), value: n.serviceIdentifier } : { kind: Ta.singleInjection, name: void 0, optional: !1, tags: /* @__PURE__ */ new Map(), value: n }) }; } }; class mO { #e; constructor(e) { this.#e = e; } getIdentifier() { return $2(this.#e); } onActivation(e) { return this.#e.onActivation = e, new yS(this.#e); } onDeactivation(e) { if (this.#e.onDeactivation = e, this.#e.scope !== Qi.Singleton) throw new go(yo.invalidOperation, `Binding for service "${fr(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`); return new yS(this.#e); } } class yS { #e; constructor(e) { this.#e = e; } getIdentifier() { return $2(this.#e); } when(e) { return this.#e.isSatisfiedBy = e, new mO(this.#e); } whenAnyAncestor(e) { return this.when(hd(e)); } whenAnyAncestorIs(e) { return this.when(hd(Zf(e))); } whenAnyAncestorNamed(e) { return this.when((function(n) { return hd(Jl(n)); })(e)); } whenAnyAncestorTagged(e, n) { return this.when((function(r, i) { return hd(Xl(r, i)); })(e, n)); } whenDefault() { return this.when(TQ); } whenNamed(e) { return this.when(Jl(e)); } whenNoParent(e) { return this.when(th(e)); } whenNoParentIs(e) { return this.when(th(Zf(e))); } whenNoParentNamed(e) { return this.when((function(n) { return th(Jl(n)); })(e)); } whenNoParentTagged(e, n) { return this.when((function(r, i) { return th(Xl(r, i)); })(e, n)); } whenParent(e) { return this.when(nh(e)); } whenParentIs(e) { return this.when(nh(Zf(e))); } whenParentNamed(e) { return this.when((function(n) { return nh(Jl(n)); })(e)); } whenParentTagged(e, n) { return this.when((function(r, i) { return nh(Xl(r, i)); })(e, n)); } whenTagged(e, n) { return this.when(Xl(e, n)); } whenNoAncestor(e) { return this.when(eh(e)); } whenNoAncestorIs(e) { return this.when(eh(Zf(e))); } whenNoAncestorNamed(e) { return this.when((function(n) { return eh(Jl(n)); })(e)); } whenNoAncestorTagged(e, n) { return this.when((function(r, i) { return eh(Xl(r, i)); })(e, n)); } } class lc extends yS { #e; constructor(e) { super(e), this.#e = new mO(e); } onActivation(e) { return this.#e.onActivation(e); } onDeactivation(e) { return this.#e.onDeactivation(e); } } class fy extends lc { #e; constructor(e) { super(e), this.#e = new kQ(e); } inRequestScope() { return this.#e.inRequestScope(); } inSingletonScope() { return this.#e.inSingletonScope(); } inTransientScope() { return this.#e.inTransientScope(); } } class NQ { #e; #t; #r; #n; constructor(e, n, r, i) { this.#e = e, this.#t = n, this.#r = r, this.#n = i; } bind(e) { return new hO((n) => { this.#i(n); }, void 0, this.#t, e); } isBound(e, n) { const r = this.#n.bindingService.get(e); return this.#l(e, r, n); } isCurrentBound(e, n) { const r = this.#n.bindingService.getNonParentBindings(e); return this.#l(e, r, n); } async rebind(e) { return await this.unbind(e), this.bind(e); } rebindSync(e) { return this.unbindSync(e), this.bind(e); } async unbind(e) { await this.#a(e); } async unbindAll() { const e = [...this.#n.bindingService.getNonParentBoundServices()]; await Promise.all(e.map(async (n) => IQ(this.#e, n))); for (const n of e) this.#n.activationService.removeAllByServiceId(n), this.#n.bindingService.removeAllByServiceId(n), this.#n.deactivationService.removeAllByServiceId(n); this.#n.planResultCacheService.clearCache(); } unbindSync(e) { this.#a(e) !== void 0 && this.#o(e); } #i(e) { this.#n.bindingService.set(e), this.#r.invalidateService({ binding: e, kind: so.bindingAdded }); } #o(e) { let n; if (bI(e)) { const i = this.#n.bindingService.getById(e.id), o = (r = i, (function(a) { if (a === void 0) return; const s = a.next(); return s.done !== !0 ? s.value : void 0; })(r?.[Symbol.iterator]()))?.serviceIdentifier; n = o === void 0 ? "Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbind() instead." : `Unexpected asynchronous deactivation when unbinding "${fr(o)}" binding. Consider using Container.unbind() instead.`; } else n = `Unexpected asynchronous deactivation when unbinding "${fr(e)}" service. Consider using Container.unbind() instead.`; var r; throw new go(yo.invalidOperation, n); } #a(e) { return bI(e) ? this.#u(e) : this.#s(e); } #u(e) { const n = this.#n.bindingService.getById(e.id), r = n === void 0 ? void 0 : [...n], i = Jm(this.#e, n); if (i !== void 0) return i.then(() => { this.#c(r, e); }); this.#c(r, e); } #c(e, n) { if (this.#n.bindingService.removeById(n.id), e !== void 0) for (const r of e) this.#r.invalidateService({ binding: r, kind: so.bindingRemoved }); } #s(e) { const n = this.#n.bindingService.get(e), r = n === void 0 ? void 0 : [...n], i = Jm(this.#e, n); if (i !== void 0) return i.then(() => { this.#d(e, r); }); this.#d(e, r); } #d(e, n) { if (this.#n.activationService.removeAllByServiceId(e), this.#n.bindingService.removeAllByServiceId(e), this.#n.deactivationService.removeAllByServiceId(e), n !== void 0) for (const r of n) this.#r.invalidateService({ binding: r, kind: so.bindingRemoved }); } #l(e, n, r) { if (n === void 0) return !1; const i = { getAncestor: () => { }, name: r?.name, serviceIdentifier: e, tags: /* @__PURE__ */ new Map() }; r?.tag !== void 0 && i.tags.set(r.tag.key, r.tag.value); for (const o of n) if (o.isSatisfiedBy(i)) return !0; return !1; } } class PQ { #e; #t; #r; #n; #i; constructor(e, n, r, i, o) { this.#e = e, this.#t = n, this.#r = r, this.#n = i, this.#i = o; } async load(...e) { await Promise.all(this.#u(...e)); } loadSync(...e) { const n = this.#u(...e); for (const r of n) if (r !== void 0) throw new go(yo.invalidOperation, "Unexpected asynchronous module load. Consider using Container.load() instead."); } async unload(...e) { await Promise.all(this.#s(...e)), this.#a(e); } unloadSync(...e) { const n = this.#s(...e); for (const r of n) if (r !== void 0) throw new go(yo.invalidOperation, "Unexpected asynchronous module unload. Consider using Container.unload() instead."); this.#a(e); } #o(e) { return { bind: (n) => new hO((r) => { this.#c(r); }, e, this.#r, n), isBound: this.#e.isBound.bind(this.#e), onActivation: (n, r) => { this.#i.activationService.add(r, { moduleId: e, serviceId: n }); }, onDeactivation: (n, r) => { this.#i.deactivationService.add(r, { moduleId: e, serviceId: n }); }, rebind: this.#e.rebind.bind(this.#e), rebindSync: this.#e.rebindSync.bind(this.#e), unbind: this.#e.unbind.bind(this.#e), unbindSync: this.#e.unbindSync.bind(this.#e) }; } #a(e) { for (const n of e) this.#i.activationService.removeAllByModuleId(n.id), this.#i.bindingService.removeAllByModuleId(n.id), this.#i.deactivationService.removeAllByModuleId(n.id); this.#i.planResultCacheService.clearCache(); } #u(...e) { return e.map((n) => n.load(this.#o(n.id))); } #c(e) { this.#i.bindingService.set(e), this.#n.invalidateService({ binding: e, kind: so.bindingAdded }); } #s(...e) { return e.map((n) => AQ(this.#t, n.id)); } } class DQ { deactivationParams; constructor(e) { this.deactivationParams = (function(n) { return { getBindings: n.bindingService.get.bind(n.bindingService), getBindingsFromModule: n.bindingService.getByModuleId.bind(n.bindingService), getClassMetadata: c0, getDeactivations: n.deactivationService.get.bind(n.deactivationService) }; })(e), e.onReset(() => { (function(n, r) { r.getBindings = n.bindingService.get.bind(n.bindingService), r.getBindingsFromModule = n.bindingService.getByModuleId.bind(n.bindingService), r.getDeactivations = n.deactivationService.get.bind(n.deactivationService); })(e, this.deactivationParams); }); } } let OQ = class { planParamsOperations; #e; constructor(e) { this.#e = e, this.planParamsOperations = { getBindings: this.#e.bindingService.get.bind(this.#e.bindingService), getBindingsChained: this.#e.bindingService.getChained.bind(this.#e.bindingService), getClassMetadata: c0, getPlan: this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService), setBinding: this.#r.bind(this), setNonCachedServiceNode: this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService), setPlan: this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService) }, this.#e.onReset(() => { this.#t(); }); } #t() { this.planParamsOperations.getBindings = this.#e.bindingService.get.bind(this.#e.bindingService), this.planParamsOperations.getBindingsChained = this.#e.bindingService.getChained.bind(this.#e.bindingService), this.planParamsOperations.setBinding = this.#r.bind(this); } #r(e) { this.#e.bindingService.set(e), this.#e.planResultCacheService.invalidateServiceBinding({ binding: e, kind: so.bindingAdded, operations: this.planParamsOperations }); } }; class FQ { #e; #t; constructor(e, n) { this.#e = e, this.#t = n; } invalidateService(e) { this.#t.planResultCacheService.invalidateServiceBinding({ ...e, operations: this.#e.planParamsOperations }); } } class MQ { #e; #t; #r; #n; constructor(e, n, r) { this.#n = n, this.#r = r, this.#e = this.#i(e), this.#t = this.#o(); } register(e, n) { const r = new n(e, this.#t); if (r[CQ] !== !0) throw new go(yo.invalidOperation, "Invalid plugin. The plugin must extend the Plugin class"); r.load(this.#e); } #i(e) { return { define: (n, r) => { if (Object.prototype.hasOwnProperty.call(e, n)) throw new go(yo.invalidOperation, `Container already has a method named "${String(n)}"`); e[n] = r; }, onPlan: this.#r.onPlan.bind(this.#r) }; } #o() { const e = this.#n; return { get activationService() { return e.activationService; }, get bindingService() { return e.bindingService; }, get deactivationService() { return e.deactivationService; }, get planResultCacheService() { return e.planResultCacheService; } }; } } let vI = class { activationService; bindingService; deactivationService; planResultCacheService; #e; constructor(e, n, r, i) { this.activationService = e, this.bindingService = n, this.deactivationService = r, this.planResultCacheService = i, this.#e = []; } reset(e, n, r) { this.activationService = e, this.bindingService = n, this.deactivationService = r, this.planResultCacheService.clearCache(); for (const i of this.#e) i(); } onReset(e) { this.#e.push(e); } }; class RQ { #e; #t; #r; #n; #i; #o; #a; constructor(e, n, r, i) { this.#o = e, this.#a = n, this.#n = this.#f(), this.#e = r, this.#t = i, this.#r = (o) => this.#a.activationService.get(o), this.#i = [], this.#a.onReset(() => { this.#u(); }); } get(e, n) { const r = this.#l(!1, e, n), i = this.#h(r); if (Tn(i)) throw new go(yo.invalidOperation, `Unexpected asynchronous service when resolving service "${fr(e)}"`); return i; } getAll(e, n) { const r = this.#l(!0, e, n), i = this.#h(r); if (Tn(i)) throw new go(yo.invalidOperation, `Unexpected asynchronous service when resolving service "${fr(e)}"`); return i; } async getAllAsync(e, n) { const r = this.#l(!0, e, n); return this.#h(r); } async getAsync(e, n) { const r = this.#l(!1, e, n); return this.#h(r); } onPlan(e) { this.#i.push(e); } #u() { this.#n = this.#f(); } #c(e, n, r) { const i = r?.name, o = r?.optional ?? !1, a = r?.tag; return e ? { chained: r?.chained ?? !1, isMultiple: e, name: i, optional: o, serviceIdentifier: n, tag: a } : { isMultiple: e, name: i, optional: o, serviceIdentifier: n, tag: a }; } #s(e, n, r) { const i = { autobindOptions: r?.autobind ?? this.#e ? { scope: this.#t } : void 0, operations: this.#o.planParamsOperations, rootConstraints: this.#d(e, n, r), servicesBranch: [] }; return this.#p(i, r), i; } #d(e, n, r) { return n ? { chained: r?.chained ?? !1, isMultiple: n, serviceIdentifier: e } : { isMultiple: n, serviceIdentifier: e }; } #l(e, n, r) { const i = this.#c(e, n, r), o = this.#a.planResultCacheService.get(i); if (o !== void 0) return o; const a = oQ(this.#s(n, e, r)); for (const s of this.#i) s(i, a); return a; } #f() { return { get: this.get.bind(this), getAll: this.getAll.bind(this), getAllAsync: this.getAllAsync.bind(this), getAsync: this.getAsync.bind(this) }; } #h(e) { return SQ({ context: this.#n, getActivations: this.#r, planResult: e, requestScopeCache: /* @__PURE__ */ new Map() }); } #p(e, n) { n !== void 0 && (n.name !== void 0 && (e.rootConstraints.name = n.name), n.optional === !0 && (e.rootConstraints.isOptional = !0), n.tag !== void 0 && (e.rootConstraints.tag = { key: n.tag.key, value: n.tag.value }), e.rootConstraints.isMultiple && (e.rootConstraints.chained = n?.chained ?? !1)); } } let BQ = class { #e; #t; constructor(e) { this.#e = e, this.#t = []; } restore() { const e = this.#t.pop(); if (e === void 0) throw new go(yo.invalidOperation, "No snapshot available to restore"); this.#e.reset(e.activationService, e.bindingService, e.deactivationService); } snapshot() { this.#t.push({ activationService: this.#e.activationService.clone(), bindingService: this.#e.bindingService.clone(), deactivationService: this.#e.deactivationService.clone() }); } }; const UQ = Qi.Transient; class LQ { #e; #t; #r; #n; #i; #o; constructor(e) { const n = e?.autobind ?? !1, r = e?.defaultScope ?? UQ; this.#n = this.#u(e, n, r); const i = new OQ(this.#n), o = new FQ(i, this.#n), a = new DQ(this.#n); this.#e = new NQ(a.deactivationParams, r, o, this.#n), this.#t = new PQ(this.#e, a.deactivationParams, r, o, this.#n), this.#i = new RQ(i, this.#n, n, r), this.#r = new MQ(this, this.#n, this.#i), this.#o = new BQ(this.#n); } bind(e) { return this.#e.bind(e); } get(e, n) { return this.#i.get(e, n); } getAll(e, n) { return this.#i.getAll(e, n); } async getAllAsync(e, n) { return this.#i.getAllAsync(e, n); } async getAsync(e, n) { return this.#i.getAsync(e, n); } isBound(e, n) { return this.#e.isBound(e, n); } isCurrentBound(e, n) { return this.#e.isCurrentBound(e, n); } async load(...e) { return this.#t.load(...e); } loadSync(...e) { this.#t.loadSync(...e); } onActivation(e, n) { this.#n.activationService.add(n, { serviceId: e }); } onDeactivation(e, n) { this.#n.deactivationService.add(n, { serviceId: e }); } register(e) { this.#r.register(this, e); } restore() { this.#o.restore(); } async rebind(e) { return this.#e.rebind(e); } rebindSync(e) { return this.#e.rebindSync(e); } snapshot() { this.#o.snapshot(); } async unbind(e) { await this.#e.unbind(e); } async unbindAll() { return this.#e.unbindAll(); } unbindSync(e) { this.#e.unbindSync(e); } async unload(...e) { return this.#t.unload(...e); } unloadSync(...e) { this.#t.unloadSync(...e); } #a(e, n) { if (e) return { scope: n }; } #u(e, n, r) { const i = this.#a(n, r); if (e?.parent === void 0) return new vI(mp.build(() => { }), Y3.build(() => { }, i), J3.build(() => { }), new iI()); const o = new iI(), a = e.parent; return a.#n.planResultCacheService.subscribe(o), new vI(mp.build(() => a.#n.activationService), Y3.build(() => a.#n.bindingService, i), J3.build(() => a.#n.deactivationService), o); } } var md = /* @__PURE__ */ ((t) => (t[t.GENDER_UNKOWN = 0] = "GENDER_UNKOWN", t[t.GENDER_MALE = 1] = "GENDER_MALE", t[t.GENDER_FEMALE = 2] = "GENDER_FEMALE", t[t.GENDER_PRIVACY = 255] = "GENDER_PRIVACY", t))(md || {}), gd = /* @__PURE__ */ ((t) => (t[t.KNOMAL = 0] = "KNOMAL", t[t.KLETTER = 1] = "KLETTER", t))(gd || {}), yd = /* @__PURE__ */ ((t) => (t[t.KDB = 0] = "KDB", t[t.KSERVER = 1] = "KSERVER", t))(yd || {}), gO = /* @__PURE__ */ ((t) => (t[t.KALL = 0] = "KALL", t[t.KBASEEXTEND = 1] = "KBASEEXTEND", t[t.KVAS = 2] = "KVAS", t[t.KQZONE = 3] = "KQZONE", t[t.KOTHER = 4] = "KOTHER", t))(gO || {}), yO = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KBIGDATACARD = 1] = "KBIGDATACARD", t[t.KDATACARD = 2] = "KDATACARD", t[t.KNOTICE = 3] = "KNOTICE", t[t.KAIO = 4] = "KAIO", t[t.KRECENTCONTACT = 5] = "KRECENTCONTACT", t[t.KMOREPANEL = 6] = "KMOREPANEL", t))(yO || {}), Tu = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KSTRANGER = 1] = "KSTRANGER", t[t.KMEMBER = 2] = "KMEMBER", t[t.KADMIN = 3] = "KADMIN", t[t.KOWNER = 4] = "KOWNER", t))(Tu || {}), Ee = /* @__PURE__ */ ((t) => (t[t.UNKNOWN = 0] = "UNKNOWN", t[t.TEXT = 1] = "TEXT", t[t.PIC = 2] = "PIC", t[t.FILE = 3] = "FILE", t[t.PTT = 4] = "PTT", t[t.VIDEO = 5] = "VIDEO", t[t.FACE = 6] = "FACE", t[t.REPLY = 7] = "REPLY", t[t.GreyTip = 8] = "GreyTip", t[t.WALLET = 9] = "WALLET", t[t.ARK = 10] = "ARK", t[t.MFACE = 11] = "MFACE", t[t.LIVEGIFT = 12] = "LIVEGIFT", t[t.STRUCTLONGMSG = 13] = "STRUCTLONGMSG", t[t.MARKDOWN = 14] = "MARKDOWN", t[t.GIPHY = 15] = "GIPHY", t[t.MULTIFORWARD = 16] = "MULTIFORWARD", t[t.INLINEKEYBOARD = 17] = "INLINEKEYBOARD", t[t.INTEXTGIFT = 18] = "INTEXTGIFT", t[t.CALENDAR = 19] = "CALENDAR", t[t.YOLOGAMERESULT = 20] = "YOLOGAMERESULT", t[t.AVRECORD = 21] = "AVRECORD", t[t.FEED = 22] = "FEED", t[t.TOFURECORD = 23] = "TOFURECORD", t[t.ACEBUBBLE = 24] = "ACEBUBBLE", t[t.ACTIVITY = 25] = "ACTIVITY", t[t.TOFU = 26] = "TOFU", t[t.FACEBUBBLE = 27] = "FACEBUBBLE", t[t.SHARELOCATION = 28] = "SHARELOCATION", t[t.TASKTOPMSG = 29] = "TASKTOPMSG", t[t.ONLINEFOLDER = 30] = "ONLINEFOLDER", t[t.RECOMMENDEDMSG = 43] = "RECOMMENDEDMSG", t[t.ACTIONBAR = 44] = "ACTIONBAR", t))(Ee || {}), us = /* @__PURE__ */ ((t) => (t[t.KMSGTYPEARKSTRUCT = 11] = "KMSGTYPEARKSTRUCT", t[t.KMSGTYPEFACEBUBBLE = 24] = "KMSGTYPEFACEBUBBLE", t[t.KMSGTYPEFILE = 3] = "KMSGTYPEFILE", t[t.KMSGTYPEGIFT = 14] = "KMSGTYPEGIFT", t[t.KMSGTYPEGIPHY = 13] = "KMSGTYPEGIPHY", t[t.KMSGTYPEGRAYTIPS = 5] = "KMSGTYPEGRAYTIPS", t[t.KMSGTYPEMIX = 2] = "KMSGTYPEMIX", t[t.KMSGTYPEMULTIMSGFORWARD = 8] = "KMSGTYPEMULTIMSGFORWARD", t[t.KMSGTYPENULL = 1] = "KMSGTYPENULL", t[t.KMSGTYPEONLINEFILE = 21] = "KMSGTYPEONLINEFILE", t[t.KMSGTYPEONLINEFOLDER = 27] = "KMSGTYPEONLINEFOLDER", t[t.KMSGTYPEPROLOGUE = 29] = "KMSGTYPEPROLOGUE", t[t.KMSGTYPEPTT = 6] = "KMSGTYPEPTT", t[t.KMSGTYPEREPLY = 9] = "KMSGTYPEREPLY", t[t.KMSGTYPESHARELOCATION = 25] = "KMSGTYPESHARELOCATION", t[t.KMSGTYPESTRUCT = 4] = "KMSGTYPESTRUCT", t[t.KMSGTYPESTRUCTLONGMSG = 12] = "KMSGTYPESTRUCTLONGMSG", t[t.KMSGTYPETEXTGIFT = 15] = "KMSGTYPETEXTGIFT", t[t.KMSGTYPEUNKNOWN = 0] = "KMSGTYPEUNKNOWN", t[t.KMSGTYPEVIDEO = 7] = "KMSGTYPEVIDEO", t[t.KMSGTYPEWALLET = 10] = "KMSGTYPEWALLET", t))(us || {}), gp = /* @__PURE__ */ ((t) => (t[t.NEWPIC_APNG = 2001] = "NEWPIC_APNG", t[t.NEWPIC_BMP = 1005] = "NEWPIC_BMP", t[t.NEWPIC_GIF = 2e3] = "NEWPIC_GIF", t[t.NEWPIC_JPEG = 1e3] = "NEWPIC_JPEG", t[t.NEWPIC_PNG = 1001] = "NEWPIC_PNG", t[t.NEWPIC_PROGERSSIV_JPEG = 1003] = "NEWPIC_PROGERSSIV_JPEG", t[t.NEWPIC_SHARPP = 1004] = "NEWPIC_SHARPP", t[t.NEWPIC_WEBP = 1002] = "NEWPIC_WEBP", t))(gp || {}), Hr = /* @__PURE__ */ ((t) => (t[t.ATTYPEALL = 1] = "ATTYPEALL", t[t.ATTYPECATEGORY = 512] = "ATTYPECATEGORY", t[t.ATTYPECHANNEL = 16] = "ATTYPECHANNEL", t[t.ATTYPEME = 4] = "ATTYPEME", t[t.ATTYPEONE = 2] = "ATTYPEONE", t[t.ATTYPEONLINE = 64] = "ATTYPEONLINE", t[t.ATTYPEROLE = 8] = "ATTYPEROLE", t[t.ATTYPESUMMON = 32] = "ATTYPESUMMON", t[t.ATTYPESUMMONONLINE = 128] = "ATTYPESUMMONONLINE", t[t.ATTYPESUMMONROLE = 256] = "ATTYPESUMMONROLE", t[t.ATTYPEUNKNOWN = 0] = "ATTYPEUNKNOWN", t))(Hr || {}), G2 = /* @__PURE__ */ ((t) => (t[t.K_DOWN_SOURCETYPE_AIOINNER = 1] = "K_DOWN_SOURCETYPE_AIOINNER", t[t.K_DOWN_SOURCETYPE_BIGSCREEN = 2] = "K_DOWN_SOURCETYPE_BIGSCREEN", t[t.K_DOWN_SOURCETYPE_HISTORY = 3] = "K_DOWN_SOURCETYPE_HISTORY", t[t.K_DOWN_SOURCETYPE_UNKNOWN = 0] = "K_DOWN_SOURCETYPE_UNKNOWN", t))(G2 || {}), ke = /* @__PURE__ */ ((t) => (t[t.KCHATTYPEADELIE = 42] = "KCHATTYPEADELIE", t[t.KCHATTYPEBUDDYNOTIFY = 5] = "KCHATTYPEBUDDYNOTIFY", t[t.KCHATTYPEC2C = 1] = "KCHATTYPEC2C", t[t.KCHATTYPECIRCLE = 113] = "KCHATTYPECIRCLE", t[t.KCHATTYPEDATALINE = 8] = "KCHATTYPEDATALINE", t[t.KCHATTYPEDATALINEMQQ = 134] = "KCHATTYPEDATALINEMQQ", t[t.KCHATTYPEDISC = 3] = "KCHATTYPEDISC", t[t.KCHATTYPEFAV = 41] = "KCHATTYPEFAV", t[t.KCHATTYPEGAMEMESSAGE = 105] = "KCHATTYPEGAMEMESSAGE", t[t.KCHATTYPEGAMEMESSAGEFOLDER = 116] = "KCHATTYPEGAMEMESSAGEFOLDER", t[t.KCHATTYPEGROUP = 2] = "KCHATTYPEGROUP", t[t.KCHATTYPEGROUPBLESS = 133] = "KCHATTYPEGROUPBLESS", t[t.KCHATTYPEGROUPGUILD = 9] = "KCHATTYPEGROUPGUILD", t[t.KCHATTYPEGROUPHELPER = 7] = "KCHATTYPEGROUPHELPER", t[t.KCHATTYPEGROUPNOTIFY = 6] = "KCHATTYPEGROUPNOTIFY", t[t.KCHATTYPEGUILD = 4] = "KCHATTYPEGUILD", t[t.KCHATTYPEGUILDMETA = 16] = "KCHATTYPEGUILDMETA", t[t.KCHATTYPEMATCHFRIEND = 104] = "KCHATTYPEMATCHFRIEND", t[t.KCHATTYPEMATCHFRIENDFOLDER = 109] = "KCHATTYPEMATCHFRIENDFOLDER", t[t.KCHATTYPENEARBY = 106] = "KCHATTYPENEARBY", t[t.KCHATTYPENEARBYASSISTANT = 107] = "KCHATTYPENEARBYASSISTANT", t[t.KCHATTYPENEARBYFOLDER = 110] = "KCHATTYPENEARBYFOLDER", t[t.KCHATTYPENEARBYHELLOFOLDER = 112] = "KCHATTYPENEARBYHELLOFOLDER", t[t.KCHATTYPENEARBYINTERACT = 108] = "KCHATTYPENEARBYINTERACT", t[t.KCHATTYPEQQNOTIFY = 132] = "KCHATTYPEQQNOTIFY", t[t.KCHATTYPERELATEACCOUNT = 131] = "KCHATTYPERELATEACCOUNT", t[t.KCHATTYPESERVICEASSISTANT = 118] = "KCHATTYPESERVICEASSISTANT", t[t.KCHATTYPESERVICEASSISTANTSUB = 201] = "KCHATTYPESERVICEASSISTANTSUB", t[t.KCHATTYPESQUAREPUBLIC = 115] = "KCHATTYPESQUAREPUBLIC", t[t.KCHATTYPESUBSCRIBEFOLDER = 30] = "KCHATTYPESUBSCRIBEFOLDER", t[t.KCHATTYPETEMPADDRESSBOOK = 111] = "KCHATTYPETEMPADDRESSBOOK", t[t.KCHATTYPETEMPBUSSINESSCRM = 102] = "KCHATTYPETEMPBUSSINESSCRM", t[t.KCHATTYPETEMPC2CFROMGROUP = 100] = "KCHATTYPETEMPC2CFROMGROUP", t[t.KCHATTYPETEMPC2CFROMUNKNOWN = 99] = "KCHATTYPETEMPC2CFROMUNKNOWN", t[t.KCHATTYPETEMPFRIENDVERIFY = 101] = "KCHATTYPETEMPFRIENDVERIFY", t[t.KCHATTYPETEMPNEARBYPRO = 119] = "KCHATTYPETEMPNEARBYPRO", t[t.KCHATTYPETEMPPUBLICACCOUNT = 103] = "KCHATTYPETEMPPUBLICACCOUNT", t[t.KCHATTYPETEMPWPA = 117] = "KCHATTYPETEMPWPA", t[t.KCHATTYPEUNKNOWN = 0] = "KCHATTYPEUNKNOWN", t[t.KCHATTYPEWEIYUN = 40] = "KCHATTYPEWEIYUN", t))(ke || {}), ep = /* @__PURE__ */ ((t) => (t[t.GRAYTIP_ELEMENT_SUBTYPE_AIOOP = 15] = "GRAYTIP_ELEMENT_SUBTYPE_AIOOP", t[t.GRAYTIP_ELEMENT_SUBTYPE_BLOCK = 14] = "GRAYTIP_ELEMENT_SUBTYPE_BLOCK", t[t.GRAYTIP_ELEMENT_SUBTYPE_BUDDY = 5] = "GRAYTIP_ELEMENT_SUBTYPE_BUDDY", t[t.GRAYTIP_ELEMENT_SUBTYPE_BUDDYNOTIFY = 9] = "GRAYTIP_ELEMENT_SUBTYPE_BUDDYNOTIFY", t[t.GRAYTIP_ELEMENT_SUBTYPE_EMOJIREPLY = 3] = "GRAYTIP_ELEMENT_SUBTYPE_EMOJIREPLY", t[t.GRAYTIP_ELEMENT_SUBTYPE_ESSENCE = 7] = "GRAYTIP_ELEMENT_SUBTYPE_ESSENCE", t[t.GRAYTIP_ELEMENT_SUBTYPE_FEED = 6] = "GRAYTIP_ELEMENT_SUBTYPE_FEED", t[t.GRAYTIP_ELEMENT_SUBTYPE_FEEDCHANNELMSG = 11] = "GRAYTIP_ELEMENT_SUBTYPE_FEEDCHANNELMSG", t[t.GRAYTIP_ELEMENT_SUBTYPE_FILE = 10] = "GRAYTIP_ELEMENT_SUBTYPE_FILE", t[t.GRAYTIP_ELEMENT_SUBTYPE_GROUP = 4] = "GRAYTIP_ELEMENT_SUBTYPE_GROUP", t[t.GRAYTIP_ELEMENT_SUBTYPE_GROUPNOTIFY = 8] = "GRAYTIP_ELEMENT_SUBTYPE_GROUPNOTIFY", t[t.GRAYTIP_ELEMENT_SUBTYPE_JSON = 17] = "GRAYTIP_ELEMENT_SUBTYPE_JSON", t[t.GRAYTIP_ELEMENT_SUBTYPE_LOCALMSG = 13] = "GRAYTIP_ELEMENT_SUBTYPE_LOCALMSG", t[t.GRAYTIP_ELEMENT_SUBTYPE_PROCLAMATION = 2] = "GRAYTIP_ELEMENT_SUBTYPE_PROCLAMATION", t[t.GRAYTIP_ELEMENT_SUBTYPE_REVOKE = 1] = "GRAYTIP_ELEMENT_SUBTYPE_REVOKE", t[t.GRAYTIP_ELEMENT_SUBTYPE_UNKNOWN = 0] = "GRAYTIP_ELEMENT_SUBTYPE_UNKNOWN", t[t.GRAYTIP_ELEMENT_SUBTYPE_WALLET = 16] = "GRAYTIP_ELEMENT_SUBTYPE_WALLET", t[t.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG = 12] = "GRAYTIP_ELEMENT_SUBTYPE_XMLMSG", t))(ep || {}), bd = /* @__PURE__ */ ((t) => (t[t.DICE = 358] = "DICE", t[t.RPS = 359] = "RPS", t))(bd || {}), Fr = /* @__PURE__ */ ((t) => (t[t.VIDEO_FORMAT_AFS = 7] = "VIDEO_FORMAT_AFS", t[t.VIDEO_FORMAT_AVI = 1] = "VIDEO_FORMAT_AVI", t[t.VIDEO_FORMAT_MKV = 4] = "VIDEO_FORMAT_MKV", t[t.VIDEO_FORMAT_MOD = 9] = "VIDEO_FORMAT_MOD", t[t.VIDEO_FORMAT_MOV = 8] = "VIDEO_FORMAT_MOV", t[t.VIDEO_FORMAT_MP4 = 2] = "VIDEO_FORMAT_MP4", t[t.VIDEO_FORMAT_MTS = 11] = "VIDEO_FORMAT_MTS", t[t.VIDEO_FORMAT_RM = 6] = "VIDEO_FORMAT_RM", t[t.VIDEO_FORMAT_RMVB = 5] = "VIDEO_FORMAT_RMVB", t[t.VIDEO_FORMAT_TS = 10] = "VIDEO_FORMAT_TS", t[t.VIDEO_FORMAT_WMV = 3] = "VIDEO_FORMAT_WMV", t))(Fr || {}), wm = /* @__PURE__ */ ((t) => (t[t.KUNKNOWN = 0] = "KUNKNOWN", t[t.KMEMBERADD = 1] = "KMEMBERADD", t[t.KDISBANDED = 2] = "KDISBANDED", t[t.KQUITTE = 3] = "KQUITTE", t[t.KCREATED = 4] = "KCREATED", t[t.KGROUPNAMEMODIFIED = 5] = "KGROUPNAMEMODIFIED", t[t.KBLOCK = 6] = "KBLOCK", t[t.KUNBLOCK = 7] = "KUNBLOCK", t[t.KSHUTUP = 8] = "KSHUTUP", t[t.KBERECYCLED = 9] = "KBERECYCLED", t[t.KDISBANDORBERECYCLED = 10] = "KDISBANDORBERECYCLED", t))(wm || {}), tp = /* @__PURE__ */ ((t) => (t[t.KSEND_STATUS_FAILED = 0] = "KSEND_STATUS_FAILED", t[t.KSEND_STATUS_SENDING = 1] = "KSEND_STATUS_SENDING", t[t.KSEND_STATUS_SUCCESS = 2] = "KSEND_STATUS_SUCCESS", t[t.KSEND_STATUS_SUCCESS_NOSEQ = 3] = "KSEND_STATUS_SUCCESS_NOSEQ", t))(tp || {}), ls = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.OldFace = 1] = "OldFace", t[t.Normal = 2] = "Normal", t[t.AniSticke = 3] = "AniSticke", t[t.Lottie = 4] = "Lottie", t[t.Poke = 5] = "Poke", t))(ls || {}), tc = /* @__PURE__ */ ((t) => (t[t.UN_SPECIFIED = 0] = "UN_SPECIFIED", t[t.INVITED_BY_MEMBER = 1] = "INVITED_BY_MEMBER", t[t.REFUSE_INVITED = 2] = "REFUSE_INVITED", t[t.REFUSED_BY_ADMINI_STRATOR = 3] = "REFUSED_BY_ADMINI_STRATOR", t[t.AGREED_TOJOIN_DIRECT = 4] = "AGREED_TOJOIN_DIRECT", t[t.INVITED_NEED_ADMINI_STRATOR_PASS = 5] = "INVITED_NEED_ADMINI_STRATOR_PASS", t[t.AGREED_TO_JOIN_BY_ADMINI_STRATOR = 6] = "AGREED_TO_JOIN_BY_ADMINI_STRATOR", t[t.REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS = 7] = "REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS", t[t.SET_ADMIN = 8] = "SET_ADMIN", t[t.KICK_MEMBER_NOTIFY_ADMIN = 9] = "KICK_MEMBER_NOTIFY_ADMIN", t[t.KICK_MEMBER_NOTIFY_KICKED = 10] = "KICK_MEMBER_NOTIFY_KICKED", t[t.MEMBER_LEAVE_NOTIFY_ADMIN = 11] = "MEMBER_LEAVE_NOTIFY_ADMIN", t[t.CANCEL_ADMIN_NOTIFY_CANCELED = 12] = "CANCEL_ADMIN_NOTIFY_CANCELED", t[t.CANCEL_ADMIN_NOTIFY_ADMIN = 13] = "CANCEL_ADMIN_NOTIFY_ADMIN", t[t.TRANSFER_GROUP_NOTIFY_OLDOWNER = 14] = "TRANSFER_GROUP_NOTIFY_OLDOWNER", t[t.TRANSFER_GROUP_NOTIFY_ADMIN = 15] = "TRANSFER_GROUP_NOTIFY_ADMIN", t))(tc || {}), dc = /* @__PURE__ */ ((t) => (t[t.KINIT = 0] = "KINIT", t[t.KUNHANDLE = 1] = "KUNHANDLE", t[t.KAGREED = 2] = "KAGREED", t[t.KREFUSED = 3] = "KREFUSED", t[t.KIGNORED = 4] = "KIGNORED", t))(dc || {}), yp = /* @__PURE__ */ ((t) => (t[t.KUNSPECIFIED = 0] = "KUNSPECIFIED", t[t.KAGREE = 1] = "KAGREE", t[t.KREFUSE = 2] = "KREFUSE", t[t.KIGNORE = 3] = "KIGNORE", t[t.KDELETE = 4] = "KDELETE", t))(yp || {}), bO = /* @__PURE__ */ ((t) => (t[t.KMEINITIATOR = 0] = "KMEINITIATOR", t[t.KPEERINITIATOR = 1] = "KPEERINITIATOR", t[t.KMEAGREED = 2] = "KMEAGREED", t[t.KMEAGREEDANDADDED = 3] = "KMEAGREEDANDADDED", t[t.KPEERAGREED = 4] = "KPEERAGREED", t[t.KPEERAGREEDANDADDED = 5] = "KPEERAGREEDANDADDED", t[t.KPEERREFUSED = 6] = "KPEERREFUSED", t[t.KMEREFUSED = 7] = "KMEREFUSED", t[t.KMEIGNORED = 8] = "KMEIGNORED", t[t.KMEAGREEANYONE = 9] = "KMEAGREEANYONE", t[t.KMESETQUESTION = 10] = "KMESETQUESTION", t[t.KMEAGREEANDADDFAILED = 11] = "KMEAGREEANDADDFAILED", t[t.KMSGINFO = 12] = "KMSGINFO", t[t.KMEINITIATORWAITPEERCONFIRM = 13] = "KMEINITIATORWAITPEERCONFIRM", t))(bO || {}), vO = /* @__PURE__ */ ((t) => (t[t.DEFAULTTYPE = 0] = "DEFAULTTYPE", t[t.TITLETYPE = 1] = "TITLETYPE", t[t.NEWGROUPTYPE = 2] = "NEWGROUPTYPE", t))(vO || {}), fi = /* @__PURE__ */ ((t) => (t.ALL = "all", t.TALKATIVE = "talkative", t.PERFORMER = "performer", t.LEGEND = "legend", t.STRONG_NEWBIE = "strong_newbie", t.EMOTION = "emotion", t))(fi || {}); const hy = "https://gchat.qpic.cn", QQ = "https://multimedia.nt.qq.com.cn"; var xO = /* @__PURE__ */ ((t) => (t[t.AIO_AV_C2C_NOTICE = 2021] = "AIO_AV_C2C_NOTICE", t[t.AIO_AV_GROUP_NOTICE = 2022] = "AIO_AV_GROUP_NOTICE", t[t.AIO_C2C_DONT_DISTURB = 2100] = "AIO_C2C_DONT_DISTURB", t[t.AIO_CRM_FLAGS_TIPS = 2050] = "AIO_CRM_FLAGS_TIPS", t[t.AIO_GROUP_ESSENCE_MSG_TIP = 2401] = "AIO_GROUP_ESSENCE_MSG_TIP", t[t.AIO_NUDGE_CUSTOM_GUIDE = 2041] = "AIO_NUDGE_CUSTOM_GUIDE", t[t.AIO_PUSH_GUIDE_GRAY_TIPS = 2701] = "AIO_PUSH_GUIDE_GRAY_TIPS", t[t.AIO_RECALL_MSGCUSTOM_WORDINGGUIDE = 2e3] = "AIO_RECALL_MSGCUSTOM_WORDINGGUIDE", t[t.AIO_ROBOT_SAFETY_TIP = 2201] = "AIO_ROBOT_SAFETY_TIP", t[t.AIO_ZPLAN_EMOTICON_GUIDE = 2301] = "AIO_ZPLAN_EMOTICON_GUIDE", t[t.AIO_ZPLAN_SCENE_LINKAGE = 2302] = "AIO_ZPLAN_SCENE_LINKAGE", t[t.AIO_ZPLAN_SEND_MEME = 2300] = "AIO_ZPLAN_SEND_MEME", t[t.DISBAND_DISCUSSION_GRAY_TIP_ID = 2603] = "DISBAND_DISCUSSION_GRAY_TIP_ID", t[t.FILE_SENDING_SIZE_4GB_LIMIT = 3003] = "FILE_SENDING_SIZE_4GB_LIMIT", t[t.GROUP_AIO_CONFIGURABLE_GRAY_TIPS = 2407] = "GROUP_AIO_CONFIGURABLE_GRAY_TIPS", t[t.GROUP_AIO_HOME_SCHOOL_WELCOME_GRAY_TIP_ID = 2404] = "GROUP_AIO_HOME_SCHOOL_WELCOME_GRAY_TIP_ID", t[t.GROUP_AIO_MSG_FREQUENCY_GRAY_TIP_ID = 2406] = "GROUP_AIO_MSG_FREQUENCY_GRAY_TIP_ID", t[t.GROUP_AIO_SHUTUP_GRAY_TIP_ID = 2402] = "GROUP_AIO_SHUTUP_GRAY_TIP_ID", t[t.GROUP_AIO_TEMPORARY_GRAY_TIP_ID = 2405] = "GROUP_AIO_TEMPORARY_GRAY_TIP_ID", t[t.GROUP_AIO_UNREAD_MSG_AI_SUMMARY = 2408] = "GROUP_AIO_UNREAD_MSG_AI_SUMMARY", t[t.GROUP_AIO_UPLOAD_PERMISSIONS_GRAY_TIP_ID = 2403] = "GROUP_AIO_UPLOAD_PERMISSIONS_GRAY_TIP_ID", t[t.LITE_ACTION = 86] = "LITE_ACTION", t[t.ONLINE_FILE_CANCEL_RECV_ON_RECVING = 4] = "ONLINE_FILE_CANCEL_RECV_ON_RECVING", t[t.ONLINE_FILE_GO_OFFLINE = 11] = "ONLINE_FILE_GO_OFFLINE", t[t.ONLINE_FILE_GO_OFFLINE_ALL = 12] = "ONLINE_FILE_GO_OFFLINE_ALL", t[t.ONLINE_FILE_RECV_BY_MOBILE = 13] = "ONLINE_FILE_RECV_BY_MOBILE", t[t.ONLINE_FILE_RECV_ERROR = 10] = "ONLINE_FILE_RECV_ERROR", t[t.ONLINE_FILE_REFUSE_ALL_RECV = 7] = "ONLINE_FILE_REFUSE_ALL_RECV", t[t.ONLINE_FILE_REFUSE_ALL_RECV_ON_RECVING = 8] = "ONLINE_FILE_REFUSE_ALL_RECV_ON_RECVING", t[t.ONLINE_FILE_REFUSE_RECV = 3] = "ONLINE_FILE_REFUSE_RECV", t[t.ONLINE_FILE_SEND_ERROR = 9] = "ONLINE_FILE_SEND_ERROR", t[t.ONLINE_FILE_STOP_ALL_SEND = 5] = "ONLINE_FILE_STOP_ALL_SEND", t[t.ONLINE_FILE_STOP_ALL_SEND_ON_SENDING = 6] = "ONLINE_FILE_STOP_ALL_SEND_ON_SENDING", t[t.ONLINE_FILE_STOP_SEND = 1] = "ONLINE_FILE_STOP_SEND", t[t.ONLINE_FILE_STOP_SEND_ON_SENDING = 2] = "ONLINE_FILE_STOP_SEND_ON_SENDING", t[t.ONLINE_GROUP_HOME_WORK = 51] = "ONLINE_GROUP_HOME_WORK", t[t.PTT_AUTO_CHANGE_GUIDE = 2060] = "PTT_AUTO_CHANGE_GUIDE", t[t.QCIRCLE_SHOW_FULE_TIPS = 2601] = "QCIRCLE_SHOW_FULE_TIPS", t[t.QWALLET_GRAY_TIP_ID = 2602] = "QWALLET_GRAY_TIP_ID", t[t.RED_BAG = 81] = "RED_BAG", t[t.RELATION_C2C_GROUP_AIO_SETUP_GROUP_AND_REMARK = 1005] = "RELATION_C2C_GROUP_AIO_SETUP_GROUP_AND_REMARK", t[t.RELATION_C2C_LOVER_BONUS = 1003] = "RELATION_C2C_LOVER_BONUS", t[t.RELATION_C2C_MEMBER_ADD = 1017] = "RELATION_C2C_MEMBER_ADD", t[t.RELATION_C2C_REACTIVE_DEGRADE_MSG = 1019] = "RELATION_C2C_REACTIVE_DEGRADE_MSG", t[t.RELATION_C2C_REACTIVE_UPGRADE_MSG = 1018] = "RELATION_C2C_REACTIVE_UPGRADE_MSG", t[t.RELATION_C2C_SAY_HELLO = 1004] = "RELATION_C2C_SAY_HELLO", t[t.RELATION_CHAIN_BLACKED = 1e3] = "RELATION_CHAIN_BLACKED", t[t.RELATION_CHAIN_MATCH_FRIEND = 1007] = "RELATION_CHAIN_MATCH_FRIEND", t[t.RELATION_CREATE_GROUP_GRAY_TIP_ID = 1009] = "RELATION_CREATE_GROUP_GRAY_TIP_ID", t[t.RELATION_EMOJIEGG_SHOW = 1001] = "RELATION_EMOJIEGG_SHOW", t[t.RELATION_EMOJIEGG_WILL_DEGRADE = 1002] = "RELATION_EMOJIEGG_WILL_DEGRADE", t[t.RELATION_FRIEND_CLONE_INFO = 1006] = "RELATION_FRIEND_CLONE_INFO", t[t.RELATION_GROUP_BATCH_ADD_FRIEND = 1020] = "RELATION_GROUP_BATCH_ADD_FRIEND", t[t.RELATION_GROUP_MEMBER_ADD = 1022] = "RELATION_GROUP_MEMBER_ADD", t[t.RELATION_GROUP_MEMBER_ADD_WITH_MODIFY_NAME = 1015] = "RELATION_GROUP_MEMBER_ADD_WITH_MODIFY_NAME", t[t.RELATION_GROUP_MEMBER_ADD_WITH_WELCOME = 1016] = "RELATION_GROUP_MEMBER_ADD_WITH_WELCOME", t[t.RELATION_GROUP_MEMBER_RECOMMEND = 1021] = "RELATION_GROUP_MEMBER_RECOMMEND", t[t.RELATION_GROUP_SHUT_UP = 1014] = "RELATION_GROUP_SHUT_UP", t[t.RELATION_LIMIT_TMP_CONVERSATION_SET = 1011] = "RELATION_LIMIT_TMP_CONVERSATION_SET", t[t.RELATION_NEARBY_GOTO_VERIFY = 1008] = "RELATION_NEARBY_GOTO_VERIFY", t[t.RELATION_ONEWAY_FRIEND_GRAY_TIP_ID = 1012] = "RELATION_ONEWAY_FRIEND_GRAY_TIP_ID", t[t.RELATION_ONEWAY_FRIEND_NEW_GRAY_TIP_ID = 1013] = "RELATION_ONEWAY_FRIEND_NEW_GRAY_TIP_ID", t[t.RELATION_YQT = 1010] = "RELATION_YQT", t[t.TROOP_ADD_FRIEND_ACTIVE = 19264] = "TROOP_ADD_FRIEND_ACTIVE", t[t.TROOP_ADD_FRIEND_HOT_CHAT = 19265] = "TROOP_ADD_FRIEND_HOT_CHAT", t[t.TROOP_ADD_FRIEND_NEW_MEMBER = 19267] = "TROOP_ADD_FRIEND_NEW_MEMBER", t[t.TROOP_ADD_FRIEND_REPLY_OR_AT = 19266] = "TROOP_ADD_FRIEND_REPLY_OR_AT", t[t.TROOP_BREAK_ICE = 10405] = "TROOP_BREAK_ICE", t[t.TROOP_FLAME_IGNITED = 19273] = "TROOP_FLAME_IGNITED", t[t.UI_RESERVE_100000_110000 = 1e5] = "UI_RESERVE_100000_110000", t[t.VAS_FILE_UPLOAD_OVER_1G = 3002] = "VAS_FILE_UPLOAD_OVER_1G", t[t.VAS_FILE_UPLOAD_OVER_LIMIT = 3001] = "VAS_FILE_UPLOAD_OVER_LIMIT", t))(xO || {}); const jQ = "End-Of-Stream"; class hr extends Error { constructor() { super(jQ), this.name = "EndOfStreamError"; } } class wO extends Error { constructor(e = "The operation was aborted") { super(e), this.name = "AbortError"; } } class $Q { constructor() { this.resolve = () => null, this.reject = () => null, this.promise = new Promise((e, n) => { this.reject = n, this.resolve = e; }); } } class q2 { constructor() { this.endOfStream = !1, this.interrupted = !1, this.peekQueue = []; } async peek(e, n = !1) { const r = await this.read(e, n); return this.peekQueue.push(e.subarray(0, r)), r; } async read(e, n = !1) { if (e.length === 0) return 0; let r = this.readFromPeekBuffer(e); if (this.endOfStream || (r += await this.readRemainderFromStream(e.subarray(r), n)), r === 0 && !n) throw new hr(); return r; } /** * Read chunk from stream * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in * @returns Number of bytes read */ readFromPeekBuffer(e) { let n = e.length, r = 0; for (; this.peekQueue.length > 0 && n > 0; ) { const i = this.peekQueue.pop(); if (!i) throw new Error("peekData should be defined"); const o = Math.min(i.length, n); e.set(i.subarray(0, o), r), r += o, n -= o, o < i.length && this.peekQueue.push(i.subarray(o)); } return r; } async readRemainderFromStream(e, n) { let r = 0; for (; r < e.length && !this.endOfStream; ) { if (this.interrupted) throw new wO(); const i = await this.readFromStream(e.subarray(r), n); if (i === 0) break; r += i; } if (!n && r < e.length) throw new hr(); return r; } } class GQ extends q2 { constructor(e) { if (super(), this.s = e, this.deferred = null, !e.read || !e.once) throw new Error("Expected an instance of stream.Readable"); this.s.once("end", () => { this.endOfStream = !0, this.deferred && this.deferred.resolve(0); }), this.s.once("error", (n) => this.reject(n)), this.s.once("close", () => this.abort()); } /** * Read chunk from stream * @param buffer Target Uint8Array (or Buffer) to store data read from stream in * @param mayBeLess - If true, may fill the buffer partially * @returns Number of bytes read */ async readFromStream(e, n) { if (e.length === 0) return 0; const r = this.s.read(e.length); if (r) return e.set(r), r.length; const i = { buffer: e, mayBeLess: n, deferred: new $Q() }; return this.deferred = i.deferred, this.s.once("readable", () => { this.readDeferred(i); }), i.deferred.promise; } /** * Process deferred read request * @param request Deferred read request */ readDeferred(e) { const n = this.s.read(e.buffer.length); n ? (e.buffer.set(n), e.deferred.resolve(n.length), this.deferred = null) : this.s.once("readable", () => { this.readDeferred(e); }); } reject(e) { this.interrupted = !0, this.deferred && (this.deferred.reject(e), this.deferred = null); } async abort() { this.reject(new wO()); } async close() { return this.abort(); } } class qQ extends q2 { constructor(e) { super(), this.reader = e; } async abort() { return this.close(); } async close() { this.reader.releaseLock(); } } class zQ extends qQ { /** * Read from stream * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in * @param mayBeLess - If true, may fill the buffer partially * @protected Bytes read */ async readFromStream(e, n) { if (e.length === 0) return 0; const r = await this.reader.read(new Uint8Array(e.length), { min: n ? void 0 : e.length }); return r.done && (this.endOfStream = r.done), r.value ? (e.set(r.value), r.value.length) : 0; } } class xI extends q2 { constructor(e) { super(), this.reader = e, this.buffer = null; } /** * Copy chunk to target, and store the remainder in this.buffer */ writeChunk(e, n) { const r = Math.min(n.length, e.length); return e.set(n.subarray(0, r)), r < n.length ? this.buffer = n.subarray(r) : this.buffer = null, r; } /** * Read from stream * @param buffer - Target Uint8Array (or Buffer) to store data read from stream in * @param mayBeLess - If true, may fill the buffer partially * @protected Bytes read */ async readFromStream(e, n) { if (e.length === 0) return 0; let r = 0; for (this.buffer && (r += this.writeChunk(e, this.buffer)); r < e.length && !this.endOfStream; ) { const i = await this.reader.read(); if (i.done) { this.endOfStream = !0; break; } i.value && (r += this.writeChunk(e.subarray(r), i.value)); } if (!n && r === 0 && this.endOfStream) throw new hr(); return r; } abort() { return this.interrupted = !0, this.reader.cancel(); } async close() { await this.abort(), this.reader.releaseLock(); } } function HQ(t) { try { const e = t.getReader({ mode: "byob" }); return e instanceof ReadableStreamDefaultReader ? new xI(e) : new zQ(e); } catch (e) { if (e instanceof TypeError) return new xI(t.getReader()); throw e; } } class p0 { /** * Constructor * @param options Tokenizer options * @protected */ constructor(e) { this.numBuffer = new Uint8Array(8), this.position = 0, this.onClose = e?.onClose, e?.abortSignal && e.abortSignal.addEventListener("abort", () => { this.abort(); }); } /** * Read a token from the tokenizer-stream * @param token - The token to read * @param position - If provided, the desired position in the tokenizer-stream * @returns Promise with token data */ async readToken(e, n = this.position) { const r = new Uint8Array(e.len); if (await this.readBuffer(r, { position: n }) < e.len) throw new hr(); return e.get(r, 0); } /** * Peek a token from the tokenizer-stream. * @param token - Token to peek from the tokenizer-stream. * @param position - Offset where to begin reading within the file. If position is null, data will be read from the current file position. * @returns Promise with token data */ async peekToken(e, n = this.position) { const r = new Uint8Array(e.len); if (await this.peekBuffer(r, { position: n }) < e.len) throw new hr(); return e.get(r, 0); } /** * Read a numeric token from the stream * @param token - Numeric token * @returns Promise with number */ async readNumber(e) { if (await this.readBuffer(this.numBuffer, { length: e.len }) < e.len) throw new hr(); return e.get(this.numBuffer, 0); } /** * Read a numeric token from the stream * @param token - Numeric token * @returns Promise with number */ async peekNumber(e) { if (await this.peekBuffer(this.numBuffer, { length: e.len }) < e.len) throw new hr(); return e.get(this.numBuffer, 0); } /** * Ignore number of bytes, advances the pointer in under tokenizer-stream. * @param length - Number of bytes to ignore * @return resolves the number of bytes ignored, equals length if this available, otherwise the number of bytes available */ async ignore(e) { if (this.fileInfo.size !== void 0) { const n = this.fileInfo.size - this.position; if (e > n) return this.position += n, n; } return this.position += e, e; } async close() { await this.abort(), await this.onClose?.(); } normalizeOptions(e, n) { if (!this.supportsRandomAccess() && n && n.position !== void 0 && n.position < this.position) throw new Error("`options.position` must be equal or greater than `tokenizer.position`"); return { mayBeLess: !1, offset: 0, length: e.length, position: this.position, ...n }; } abort() { return Promise.resolve(); } } const WQ = 256e3; class SO extends p0 { /** * Constructor * @param streamReader stream-reader to read from * @param options Tokenizer options */ constructor(e, n) { super(n), this.streamReader = e, this.fileInfo = n?.fileInfo ?? {}; } /** * Read buffer from tokenizer * @param uint8Array - Target Uint8Array to fill with data read from the tokenizer-stream * @param options - Read behaviour options * @returns Promise with number of bytes read */ async readBuffer(e, n) { const r = this.normalizeOptions(e, n), i = r.position - this.position; if (i > 0) return await this.ignore(i), this.readBuffer(e, n); if (i < 0) throw new Error("`options.position` must be equal or greater than `tokenizer.position`"); if (r.length === 0) return 0; const o = await this.streamReader.read(e.subarray(0, r.length), r.mayBeLess); if (this.position += o, (!n || !n.mayBeLess) && o < r.length) throw new hr(); return o; } /** * Peek (read ahead) buffer from tokenizer * @param uint8Array - Uint8Array (or Buffer) to write data to * @param options - Read behaviour options * @returns Promise with number of bytes peeked */ async peekBuffer(e, n) { const r = this.normalizeOptions(e, n); let i = 0; if (r.position) { const o = r.position - this.position; if (o > 0) { const a = new Uint8Array(r.length + o); return i = await this.peekBuffer(a, { mayBeLess: r.mayBeLess }), e.set(a.subarray(o)), i - o; } if (o < 0) throw new Error("Cannot peek from a negative offset in a stream"); } if (r.length > 0) { try { i = await this.streamReader.peek(e.subarray(0, r.length), r.mayBeLess); } catch (o) { if (n?.mayBeLess && o instanceof hr) return 0; throw o; } if (!r.mayBeLess && i < r.length) throw new hr(); } return i; } async ignore(e) { const n = Math.min(WQ, e), r = new Uint8Array(n); let i = 0; for (; i < e; ) { const o = e - i, a = await this.readBuffer(r, { length: Math.min(n, o) }); if (a < 0) return a; i += a; } return i; } abort() { return this.streamReader.abort(); } async close() { return this.streamReader.close(); } supportsRandomAccess() { return !1; } } class KQ extends p0 { /** * Construct BufferTokenizer * @param uint8Array - Uint8Array to tokenize * @param options Tokenizer options */ constructor(e, n) { super(n), this.uint8Array = e, this.fileInfo = { ...n?.fileInfo ?? {}, size: e.length }; } /** * Read buffer from tokenizer * @param uint8Array - Uint8Array to tokenize * @param options - Read behaviour options * @returns {Promise} */ async readBuffer(e, n) { n?.position && (this.position = n.position); const r = await this.peekBuffer(e, n); return this.position += r, r; } /** * Peek (read ahead) buffer from tokenizer * @param uint8Array * @param options - Read behaviour options * @returns {Promise} */ async peekBuffer(e, n) { const r = this.normalizeOptions(e, n), i = Math.min(this.uint8Array.length - r.position, r.length); if (!r.mayBeLess && i < r.length) throw new hr(); return e.set(this.uint8Array.subarray(r.position, r.position + i)), i; } close() { return super.close(); } supportsRandomAccess() { return !0; } setPosition(e) { this.position = e; } } class VQ extends p0 { /** * Construct BufferTokenizer * @param blob - Uint8Array to tokenize * @param options Tokenizer options */ constructor(e, n) { super(n), this.blob = e, this.fileInfo = { ...n?.fileInfo ?? {}, size: e.size, mimeType: e.type }; } /** * Read buffer from tokenizer * @param uint8Array - Uint8Array to tokenize * @param options - Read behaviour options * @returns {Promise} */ async readBuffer(e, n) { n?.position && (this.position = n.position); const r = await this.peekBuffer(e, n); return this.position += r, r; } /** * Peek (read ahead) buffer from tokenizer * @param buffer * @param options - Read behaviour options * @returns {Promise} */ async peekBuffer(e, n) { const r = this.normalizeOptions(e, n), i = Math.min(this.blob.size - r.position, r.length); if (!r.mayBeLess && i < r.length) throw new hr(); const o = await this.blob.slice(r.position, r.position + i).arrayBuffer(); return e.set(new Uint8Array(o)), i; } close() { return super.close(); } supportsRandomAccess() { return !0; } setPosition(e) { this.position = e; } } function YQ(t, e) { const n = new GQ(t), r = e ?? {}, i = r.onClose; return r.onClose = async () => { if (await n.close(), i) return i(); }, new SO(n, r); } function _O(t, e) { const n = HQ(t), r = e ?? {}, i = r.onClose; return r.onClose = async () => { if (await n.close(), i) return i(); }, new SO(n, r); } function JQ(t, e) { return new KQ(t, e); } function XQ(t, e) { return new VQ(t, e); } class z2 extends p0 { /** * Create tokenizer from provided file path * @param sourceFilePath File path */ static async fromFile(e) { const n = await $L(e, "r"), r = await n.stat(); return new z2(n, { fileInfo: { path: e, size: r.size } }); } constructor(e, n) { super(n), this.fileHandle = e, this.fileInfo = n.fileInfo; } /** * Read buffer from file * @param uint8Array - Uint8Array to write result to * @param options - Read behaviour options * @returns Promise number of bytes read */ async readBuffer(e, n) { const r = this.normalizeOptions(e, n); if (this.position = r.position, r.length === 0) return 0; const i = await this.fileHandle.read(e, 0, r.length, r.position); if (this.position += i.bytesRead, i.bytesRead < r.length && (!n || !n.mayBeLess)) throw new hr(); return i.bytesRead; } /** * Peek buffer from file * @param uint8Array - Uint8Array (or Buffer) to write data to * @param options - Read behaviour options * @returns Promise number of bytes read */ async peekBuffer(e, n) { const r = this.normalizeOptions(e, n), i = await this.fileHandle.read(e, 0, r.length, r.position); if (!r.mayBeLess && i.bytesRead < r.length) throw new hr(); return i.bytesRead; } async close() { return await this.fileHandle.close(), super.close(); } setPosition(e) { this.position = e; } supportsRandomAccess() { return !0; } } async function ZQ(t, e) { const n = YQ(t, e); if (t.path) { const r = await SD(t.path); n.fileInfo.path = t.path, n.fileInfo.size = r.size; } return n; } const ej = z2.fromFile; var rh = {}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ var wI; function tj() { return wI || (wI = 1, rh.read = function(t, e, n, r, i) { var o, a, s = i * 8 - r - 1, c = (1 << s) - 1, u = c >> 1, d = -7, p = n ? i - 1 : 0, f = n ? -1 : 1, m = t[e + p]; for (p += f, o = m & (1 << -d) - 1, m >>= -d, d += s; d > 0; o = o * 256 + t[e + p], p += f, d -= 8) ; for (a = o & (1 << -d) - 1, o >>= -d, d += r; d > 0; a = a * 256 + t[e + p], p += f, d -= 8) ; if (o === 0) o = 1 - u; else { if (o === c) return a ? NaN : (m ? -1 : 1) * (1 / 0); a = a + Math.pow(2, r), o = o - u; } return (m ? -1 : 1) * a * Math.pow(2, o - r); }, rh.write = function(t, e, n, r, i, o) { var a, s, c, u = o * 8 - i - 1, d = (1 << u) - 1, p = d >> 1, f = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, m = r ? 0 : o - 1, h = r ? 1 : -1, y = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0; for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = d) : (a = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -a)) < 1 && (a--, c *= 2), a + p >= 1 ? e += f / c : e += f * Math.pow(2, 1 - p), e * c >= 2 && (a++, c /= 2), a + p >= d ? (s = 0, a = d) : a + p >= 1 ? (s = (e * c - 1) * Math.pow(2, i), a = a + p) : (s = e * Math.pow(2, p - 1) * Math.pow(2, i), a = 0)); i >= 8; t[n + m] = s & 255, m += h, s /= 256, i -= 8) ; for (a = a << i | s, u += i; u > 0; t[n + m] = a & 255, m += h, a /= 256, u -= 8) ; t[n + m - h] |= y * 128; }), rh; } tj(); const bS = { 128: "€", 130: "‚", 131: "ƒ", 132: "„", 133: "…", 134: "†", 135: "‡", 136: "ˆ", 137: "‰", 138: "Š", 139: "‹", 140: "Œ", 142: "Ž", 145: "‘", 146: "’", 147: "“", 148: "”", 149: "•", 150: "–", 151: "—", 152: "˜", 153: "™", 154: "š", 155: "›", 156: "œ", 158: "ž", 159: "Ÿ" }; for (const [t, e] of Object.entries(bS)) ; function nj(t, e = "utf-8") { switch (e.toLowerCase()) { case "utf-8": case "utf8": return typeof globalThis.TextDecoder < "u" ? new globalThis.TextDecoder("utf-8").decode(t) : rj(t); case "utf-16le": return ij(t); case "ascii": return oj(t); case "latin1": case "iso-8859-1": return aj(t); case "windows-1252": return sj(t); default: throw new RangeError(`Encoding '${e}' not supported`); } } function rj(t) { let e = "", n = 0; for (; n < t.length; ) { const r = t[n++]; if (r < 128) e += String.fromCharCode(r); else if (r < 224) { const i = t[n++] & 63; e += String.fromCharCode((r & 31) << 6 | i); } else if (r < 240) { const i = t[n++] & 63, o = t[n++] & 63; e += String.fromCharCode((r & 15) << 12 | i << 6 | o); } else { const i = t[n++] & 63, o = t[n++] & 63, a = t[n++] & 63; let s = (r & 7) << 18 | i << 12 | o << 6 | a; s -= 65536, e += String.fromCharCode(55296 + (s >> 10 & 1023), 56320 + (s & 1023)); } } return e; } function ij(t) { let e = ""; for (let n = 0; n < t.length; n += 2) e += String.fromCharCode(t[n] | t[n + 1] << 8); return e; } function oj(t) { return String.fromCharCode(...t.map((e) => e & 127)); } function aj(t) { return String.fromCharCode(...t); } function sj(t) { let e = ""; for (const n of t) n >= 128 && n <= 159 && bS[n] ? e += bS[n] : e += String.fromCharCode(n); return e; } function Zr(t) { return new DataView(t.buffer, t.byteOffset); } const cj = { len: 1, get(t, e) { return Zr(t).getUint8(e); }, put(t, e, n) { return Zr(t).setUint8(e, n), e + 1; } }, gn = { len: 2, get(t, e) { return Zr(t).getUint16(e, !0); }, put(t, e, n) { return Zr(t).setUint16(e, n, !0), e + 2; } }, Zl = { len: 2, get(t, e) { return Zr(t).getUint16(e); }, put(t, e, n) { return Zr(t).setUint16(e, n), e + 2; } }, Zn = { len: 4, get(t, e) { return Zr(t).getUint32(e, !0); }, put(t, e, n) { return Zr(t).setUint32(e, n, !0), e + 4; } }, uj = { len: 4, get(t, e) { return Zr(t).getUint32(e); }, put(t, e, n) { return Zr(t).setUint32(e, n), e + 4; } }, lj = { len: 4, get(t, e) { return Zr(t).getInt32(e); }, put(t, e, n) { return Zr(t).setInt32(e, n), e + 4; } }, dj = { len: 8, get(t, e) { return Zr(t).getBigUint64(e, !0); }, put(t, e, n) { return Zr(t).setBigUint64(e, n, !0), e + 8; } }; let ya = class { constructor(e, n) { this.len = e, this.encoding = n; } get(e, n = 0) { const r = e.subarray(n, n + this.len); return nj(r, this.encoding); } }; var pj = _D("/"), Sm, fj = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global"; try { Sm = pj("worker_threads").Worker; } catch { } var hj = Sm ? function(t, e, n, r, i) { var o = !1, a = new Sm(t + fj, { eval: !0 }).on("error", function(s) { return i(s, null); }).on("message", function(s) { return i(null, s); }).on("exit", function(s) { s && !o && i(new Error("exited with code " + s), null); }); return a.postMessage(n, r), a.terminate = function() { return o = !0, Sm.prototype.terminate.call(a); }, a; } : function(t, e, n, r, i) { setImmediate(function() { return i(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"), null); }); var o = function() { }; return { terminate: o, postMessage: o }; }, An = Uint8Array, sc = Uint16Array, EO = Int32Array, H2 = new An([ 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, /* unused */ 0, 0, /* impossible */ 0 ]), W2 = new An([ 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, /* unused */ 0, 0 ]), AO = new An([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), IO = function(t, e) { for (var n = new sc(31), r = 0; r < 31; ++r) n[r] = e += 1 << t[r - 1]; for (var i = new EO(n[30]), r = 1; r < 30; ++r) for (var o = n[r]; o < n[r + 1]; ++o) i[o] = o - n[r] << 5 | r; return { b: n, r: i }; }, CO = IO(H2, 2), K2 = CO.b, mj = CO.r; K2[28] = 258, mj[258] = 28; var gj = IO(W2, 0), TO = gj.b, Xm = new sc(32768); for (var Zt = 0; Zt < 32768; ++Zt) { var Xa = (Zt & 43690) >> 1 | (Zt & 21845) << 1; Xa = (Xa & 52428) >> 2 | (Xa & 13107) << 2, Xa = (Xa & 61680) >> 4 | (Xa & 3855) << 4, Xm[Zt] = ((Xa & 65280) >> 8 | (Xa & 255) << 8) >> 1; } var ku = (function(t, e, n) { for (var r = t.length, i = 0, o = new sc(e); i < r; ++i) t[i] && ++o[t[i] - 1]; var a = new sc(e); for (i = 1; i < e; ++i) a[i] = a[i - 1] + o[i - 1] << 1; var s; if (n) { s = new sc(1 << e); var c = 15 - e; for (i = 0; i < r; ++i) if (t[i]) for (var u = i << 4 | t[i], d = e - t[i], p = a[t[i] - 1]++ << d, f = p | (1 << d) - 1; p <= f; ++p) s[Xm[p] >> c] = u; } else for (s = new sc(r), i = 0; i < r; ++i) t[i] && (s[i] = Xm[a[t[i] - 1]++] >> 15 - t[i]); return s; }), Vp = new An(288); for (var Zt = 0; Zt < 144; ++Zt) Vp[Zt] = 8; for (var Zt = 144; Zt < 256; ++Zt) Vp[Zt] = 9; for (var Zt = 256; Zt < 280; ++Zt) Vp[Zt] = 7; for (var Zt = 280; Zt < 288; ++Zt) Vp[Zt] = 8; var kO = new An(32); for (var Zt = 0; Zt < 32; ++Zt) kO[Zt] = 5; var NO = /* @__PURE__ */ ku(Vp, 9, 1), PO = /* @__PURE__ */ ku(kO, 5, 1), _m = function(t) { for (var e = t[0], n = 1; n < t.length; ++n) t[n] > e && (e = t[n]); return e; }, Di = function(t, e, n) { var r = e / 8 | 0; return (t[r] | t[r + 1] << 8) >> (e & 7) & n; }, Em = function(t, e) { var n = e / 8 | 0; return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) >> (e & 7); }, V2 = function(t) { return (t + 7) / 8 | 0; }, np = function(t, e, n) { return (e == null || e < 0) && (e = 0), (n == null || n > t.length) && (n = t.length), new An(t.subarray(e, n)); }, DO = [ "unexpected EOF", "invalid block type", "invalid length/literal", "invalid distance", "stream finished", "no stream handler", , "no callback", "invalid UTF-8 data", "extra field too long", "date not in range 1980-2099", "filename too long", "stream finishing", "invalid zip data" // determined by unknown compression method ], Vn = function(t, e, n) { var r = new Error(e || DO[t]); if (r.code = t, Error.captureStackTrace && Error.captureStackTrace(r, Vn), !n) throw r; return r; }, Yp = function(t, e, n, r) { var i = t.length, o = r ? r.length : 0; if (!i || e.f && !e.l) return n || new An(0); var a = !n, s = a || e.i != 2, c = e.i; a && (n = new An(i * 3)); var u = function(P) { var j = n.length; if (P > j) { var W = new An(Math.max(j * 2, P)); W.set(n), n = W; } }, d = e.f || 0, p = e.p || 0, f = e.b || 0, m = e.l, h = e.d, y = e.m, x = e.n, g = i * 8; do { if (!m) { d = Di(t, p, 1); var b = Di(t, p + 1, 3); if (p += 3, b) if (b == 1) m = NO, h = PO, y = 9, x = 5; else if (b == 2) { var U = Di(t, p, 31) + 257, q = Di(t, p + 10, 15) + 4, Y = U + Di(t, p + 5, 31) + 1; p += 14; for (var H = new An(Y), G = new An(19), J = 0; J < q; ++J) G[AO[J]] = Di(t, p + J * 3, 7); p += q * 3; for (var B = _m(G), D = (1 << B) - 1, X = ku(G, B, 1), J = 0; J < Y; ) { var V = X[Di(t, p, D)]; p += V & 15; var S = V >> 4; if (S < 16) H[J++] = S; else { var K = 0, $ = 0; for (S == 16 ? ($ = 3 + Di(t, p, 3), p += 2, K = H[J - 1]) : S == 17 ? ($ = 3 + Di(t, p, 7), p += 3) : S == 18 && ($ = 11 + Di(t, p, 127), p += 7); $--; ) H[J++] = K; } } var _ = H.subarray(0, U), I = H.subarray(U); y = _m(_), x = _m(I), m = ku(_, y, 1), h = ku(I, x, 1); } else Vn(1); else { var S = V2(p) + 4, E = t[S - 4] | t[S - 3] << 8, T = S + E; if (T > i) { c && Vn(0); break; } s && u(f + E), n.set(t.subarray(S, T), f), e.b = f += E, e.p = p = T * 8, e.f = d; continue; } if (p > g) { c && Vn(0); break; } } s && u(f + 131072); for (var N = (1 << y) - 1, L = (1 << x) - 1, C = p; ; C = p) { var K = m[Em(t, p) & N], Q = K >> 4; if (p += K & 15, p > g) { c && Vn(0); break; } if (K || Vn(2), Q < 256) n[f++] = Q; else if (Q == 256) { C = p, m = null; break; } else { var k = Q - 254; if (Q > 264) { var J = Q - 257, M = H2[J]; k = Di(t, p, (1 << M) - 1) + K2[J], p += M; } var O = h[Em(t, p) & L], A = O >> 4; O || Vn(3), p += O & 15; var I = TO[A]; if (A > 3) { var M = W2[A]; I += Em(t, p) & (1 << M) - 1, p += M; } if (p > g) { c && Vn(0); break; } s && u(f + 131072); var F = f + k; if (f < I) { var Z = o - I, ee = Math.min(I, F); for (Z + f < 0 && Vn(3); f < ee; ++f) n[f] = r[Z + f]; } for (; f < F; ++f) n[f] = n[f - I]; } } e.l = m, e.p = C, e.b = f, e.f = d, m && (d = 1, e.m = y, e.d = h, e.n = x); } while (!d); return f != n.length && a ? np(n, 0, f) : n.subarray(0, f); }, yj = /* @__PURE__ */ new An(0), bj = function(t, e) { var n = {}; for (var r in t) n[r] = t[r]; for (var r in e) n[r] = e[r]; return n; }, SI = function(t, e, n) { for (var r = t(), i = t.toString(), o = i.slice(i.indexOf("[") + 1, i.lastIndexOf("]")).replace(/\s+/g, "").split(","), a = 0; a < r.length; ++a) { var s = r[a], c = o[a]; if (typeof s == "function") { e += ";" + c + "="; var u = s.toString(); if (s.prototype) if (u.indexOf("[native code]") != -1) { var d = u.indexOf(" ", 8) + 1; e += u.slice(d, u.indexOf("(", d)); } else { e += u; for (var p in s.prototype) e += ";" + c + ".prototype." + p + "=" + s.prototype[p].toString(); } else e += u; } else n[c] = s; } return e; }, ih = [], vj = function(t) { var e = []; for (var n in t) t[n].buffer && e.push((t[n] = new t[n].constructor(t[n])).buffer); return e; }, xj = function(t, e, n, r) { if (!ih[n]) { for (var i = "", o = {}, a = t.length - 1, s = 0; s < a; ++s) i = SI(t[s], i, o); ih[n] = { c: SI(t[a], i, o), e: o }; } var c = bj({}, ih[n].e); return hj(ih[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, c, vj(c), r); }, wj = function() { return [An, sc, EO, H2, W2, AO, K2, TO, NO, PO, Xm, DO, ku, _m, Di, Em, V2, np, Vn, Yp, FO, _j, Ej]; }, Sj = function() { return [Y2, OO]; }, _j = function(t) { return postMessage(t, [t.buffer]); }, Ej = function(t) { return t && { out: t.size && new An(t.size), dictionary: t.dictionary }; }, _I = function(t) { return t.ondata = function(e, n) { return postMessage([e, n], [e.buffer]); }, function(e) { e.data.length ? (t.push(e.data[0], e.data[1]), postMessage([e.data[0].length])) : t.flush(); }; }, Aj = function(t, e, n, r, i, o, a) { var s, c = xj(t, r, i, function(u, d) { u ? (c.terminate(), e.ondata.call(e, u)) : Array.isArray(d) ? d.length == 1 ? (e.queuedSize -= d[0], e.ondrain && e.ondrain(d[0])) : (d[1] && c.terminate(), e.ondata.call(e, u, d[0], d[1])) : a(d); }); c.postMessage(n), e.queuedSize = 0, e.push = function(u, d) { e.ondata || Vn(5), s && e.ondata(Vn(4, 0, 1), null, !!d), e.queuedSize += u.length, c.postMessage([u, s = d], [u.buffer]); }, e.terminate = function() { c.terminate(); }; }, Y2 = function(t) { (t[0] != 31 || t[1] != 139 || t[2] != 8) && Vn(6, "invalid gzip data"); var e = t[3], n = 10; e & 4 && (n += (t[10] | t[11] << 8) + 2); for (var r = (e >> 3 & 1) + (e >> 4 & 1); r > 0; r -= !t[n++]) ; return n + (e & 2); }, OO = function(t) { var e = t.length; return (t[e - 4] | t[e - 3] << 8 | t[e - 2] << 16 | t[e - 1] << 24) >>> 0; }, Ij = function(t, e) { return ((t[0] & 15) != 8 || t[0] >> 4 > 7 || (t[0] << 8 | t[1]) % 31) && Vn(6, "invalid zlib data"), (t[1] >> 5 & 1) == 1 && Vn(6, "invalid zlib data: " + (t[1] & 32 ? "need" : "unexpected") + " dictionary"), (t[1] >> 3 & 4) + 2; }; function Cj(t, e) { return typeof t == "function" && (e = t, t = {}), this.ondata = e, t; } var Am = /* @__PURE__ */ (function() { function t(e, n) { typeof e == "function" && (n = e, e = {}), this.ondata = n; var r = e && e.dictionary && e.dictionary.subarray(-32768); this.s = { i: 0, b: r ? r.length : 0 }, this.o = new An(32768), this.p = new An(0), r && this.o.set(r); } return t.prototype.e = function(e) { if (this.ondata || Vn(5), this.d && Vn(4), !this.p.length) this.p = e; else if (e.length) { var n = new An(this.p.length + e.length); n.set(this.p), n.set(e, this.p.length), this.p = n; } }, t.prototype.c = function(e) { this.s.i = +(this.d = e || !1); var n = this.s.b, r = Yp(this.p, this.s, this.o); this.ondata(np(r, n, this.s.b), this.d), this.o = np(r, this.s.b - 32768), this.s.b = this.o.length, this.p = np(this.p, this.s.p / 8 | 0), this.s.p &= 7; }, t.prototype.push = function(e, n) { this.e(e), this.c(n); }, t; })(); function FO(t, e) { return Yp(t, { i: 2 }, e && e.out, e && e.dictionary); } var EI = /* @__PURE__ */ (function() { function t(e, n) { this.v = 1, this.r = 0, Am.call(this, e, n); } return t.prototype.push = function(e, n) { if (Am.prototype.e.call(this, e), this.r += e.length, this.v) { var r = this.p.subarray(this.v - 1), i = r.length > 3 ? Y2(r) : 4; if (i > r.length) { if (!n) return; } else this.v > 1 && this.onmember && this.onmember(this.r - r.length); this.p = r.subarray(i), this.v = 0; } Am.prototype.c.call(this, n), this.s.f && !this.s.l && !n && (this.v = V2(this.s.p) + 9, this.s = { i: 0 }, this.o = new An(0), this.push(new An(0), n)); }, t; })(), Tj = /* @__PURE__ */ (function() { function t(e, n) { var r = this; Aj([ wj, Sj, function() { return [_I, Am, EI]; } ], this, Cj.call(this, e, n), function(i) { var o = new EI(i.data); o.onmember = function(a) { return postMessage(a); }, onmessage = _I(o); }, 9, 0, function(i) { return r.onmember && r.onmember(i); }); } return t; })(); function kj(t, e) { var n = Y2(t); return n + 8 > t.length && Vn(6, "invalid gzip data"), Yp(t.subarray(n, -8), { i: 2 }, new An(OO(t)), e); } function Nj(t, e) { return Yp(t.subarray(Ij(t), -4), { i: 2 }, e, e); } function Pj(t, e) { return t[0] == 31 && t[1] == 139 && t[2] == 8 ? kj(t, e) : (t[0] & 15) != 8 || t[0] >> 4 > 7 || (t[0] << 8 | t[1]) % 31 ? FO(t, e) : Nj(t, e); } var Dj = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Oj = 0; try { Dj.decode(yj, { stream: !0 }), Oj = 1; } catch { } var oh = { exports: {} }, my, AI; function MO() { if (AI) return my; AI = 1; var t = 1e3, e = t * 60, n = e * 60, r = n * 24, i = r * 7, o = r * 365.25; my = function(d, p) { p = p || {}; var f = typeof d; if (f === "string" && d.length > 0) return a(d); if (f === "number" && isFinite(d)) return p.long ? c(d) : s(d); throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(d) ); }; function a(d) { if (d = String(d), !(d.length > 100)) { var p = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( d ); if (p) { var f = parseFloat(p[1]), m = (p[2] || "ms").toLowerCase(); switch (m) { case "years": case "year": case "yrs": case "yr": case "y": return f * o; case "weeks": case "week": case "w": return f * i; case "days": case "day": case "d": return f * r; case "hours": case "hour": case "hrs": case "hr": case "h": return f * n; case "minutes": case "minute": case "mins": case "min": case "m": return f * e; case "seconds": case "second": case "secs": case "sec": case "s": return f * t; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return f; default: return; } } } } function s(d) { var p = Math.abs(d); return p >= r ? Math.round(d / r) + "d" : p >= n ? Math.round(d / n) + "h" : p >= e ? Math.round(d / e) + "m" : p >= t ? Math.round(d / t) + "s" : d + "ms"; } function c(d) { var p = Math.abs(d); return p >= r ? u(d, p, r, "day") : p >= n ? u(d, p, n, "hour") : p >= e ? u(d, p, e, "minute") : p >= t ? u(d, p, t, "second") : d + " ms"; } function u(d, p, f, m) { var h = p >= f * 1.5; return Math.round(d / f) + " " + m + (h ? "s" : ""); } return my; } var gy, II; function Fj() { if (II) return gy; II = 1; function t(e) { r.debug = r, r.default = r, r.coerce = u, r.disable = s, r.enable = o, r.enabled = c, r.humanize = MO(), r.destroy = d, Object.keys(e).forEach((p) => { r[p] = e[p]; }), r.names = [], r.skips = [], r.formatters = {}; function n(p) { let f = 0; for (let m = 0; m < p.length; m++) f = (f << 5) - f + p.charCodeAt(m), f |= 0; return r.colors[Math.abs(f) % r.colors.length]; } r.selectColor = n; function r(p) { let f, m = null, h, y; function x(...g) { if (!x.enabled) return; const b = x, S = Number(/* @__PURE__ */ new Date()), E = S - (f || S); b.diff = E, b.prev = f, b.curr = S, f = S, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O"); let T = 0; g[0] = g[0].replace(/%([a-zA-Z%])/g, (q, Y) => { if (q === "%%") return "%"; T++; const H = r.formatters[Y]; if (typeof H == "function") { const G = g[T]; q = H.call(b, G), g.splice(T, 1), T--; } return q; }), r.formatArgs.call(b, g), (b.log || r.log).apply(b, g); } return x.namespace = p, x.useColors = r.useColors(), x.color = r.selectColor(p), x.extend = i, x.destroy = r.destroy, Object.defineProperty(x, "enabled", { enumerable: !0, configurable: !1, get: () => m !== null ? m : (h !== r.namespaces && (h = r.namespaces, y = r.enabled(p)), y), set: (g) => { m = g; } }), typeof r.init == "function" && r.init(x), x; } function i(p, f) { const m = r(this.namespace + (typeof f > "u" ? ":" : f) + p); return m.log = this.log, m; } function o(p) { r.save(p), r.namespaces = p, r.names = [], r.skips = []; const f = (typeof p == "string" ? p : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean); for (const m of f) m[0] === "-" ? r.skips.push(m.slice(1)) : r.names.push(m); } function a(p, f) { let m = 0, h = 0, y = -1, x = 0; for (; m < p.length; ) if (h < f.length && (f[h] === p[m] || f[h] === "*")) f[h] === "*" ? (y = h, x = m, h++) : (m++, h++); else if (y !== -1) h = y + 1, x++, m = x; else return !1; for (; h < f.length && f[h] === "*"; ) h++; return h === f.length; } function s() { const p = [ ...r.names, ...r.skips.map((f) => "-" + f) ].join(","); return r.enable(""), p; } function c(p) { for (const f of r.skips) if (a(p, f)) return !1; for (const f of r.names) if (a(p, f)) return !0; return !1; } function u(p) { return p instanceof Error ? p.stack || p.message : p; } function d() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } return r.enable(r.load()), r; } return gy = t, gy; } var CI; function Mj() { return CI || (CI = 1, (function(t, e) { e.formatArgs = r, e.save = i, e.load = o, e.useColors = n, e.storage = a(), e.destroy = /* @__PURE__ */ (() => { let c = !1; return () => { c || (c = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")); }; })(), e.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function n() { if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return !0; if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1; let c; return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator < "u" && navigator.userAgent && (c = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(c[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function r(c) { if (c[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + c[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors) return; const u = "color: " + this.color; c.splice(1, 0, u, "color: inherit"); let d = 0, p = 0; c[0].replace(/%[a-zA-Z%]/g, (f) => { f !== "%%" && (d++, f === "%c" && (p = d)); }), c.splice(p, 0, u); } e.log = console.debug || console.log || (() => { }); function i(c) { try { c ? e.storage.setItem("debug", c) : e.storage.removeItem("debug"); } catch { } } function o() { let c; try { c = e.storage.getItem("debug") || e.storage.getItem("DEBUG"); } catch { } return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c; } function a() { try { return localStorage; } catch { } } t.exports = Fj()(e); const { formatters: s } = t.exports; s.j = function(c) { try { return JSON.stringify(c); } catch (u) { return "[UnexpectedJSONParseError]: " + u.message; } }; })(oh, oh.exports)), oh.exports; } var Rj = Mj(); const Bj = /* @__PURE__ */ ra(Rj), wu = { LocalFileHeader: 67324752, DataDescriptor: 134695760, CentralFileHeader: 33639248, EndOfCentralDirectory: 101010256 }, TI = { get(t) { return { signature: Zn.get(t, 0), compressedSize: Zn.get(t, 8), uncompressedSize: Zn.get(t, 12) }; }, len: 16 }, Uj = { get(t) { const e = gn.get(t, 6); return { signature: Zn.get(t, 0), minVersion: gn.get(t, 4), dataDescriptor: !!(e & 8), compressedMethod: gn.get(t, 8), compressedSize: Zn.get(t, 18), uncompressedSize: Zn.get(t, 22), filenameLength: gn.get(t, 26), extraFieldLength: gn.get(t, 28), filename: null }; }, len: 30 }, Lj = { get(t) { return { signature: Zn.get(t, 0), nrOfThisDisk: gn.get(t, 4), nrOfThisDiskWithTheStart: gn.get(t, 6), nrOfEntriesOnThisDisk: gn.get(t, 8), nrOfEntriesOfSize: gn.get(t, 10), sizeOfCd: Zn.get(t, 12), offsetOfStartOfCd: Zn.get(t, 16), zipFileCommentLength: gn.get(t, 20) }; }, len: 22 }, Qj = { get(t) { const e = gn.get(t, 8); return { signature: Zn.get(t, 0), minVersion: gn.get(t, 6), dataDescriptor: !!(e & 8), compressedMethod: gn.get(t, 10), compressedSize: Zn.get(t, 20), uncompressedSize: Zn.get(t, 24), filenameLength: gn.get(t, 28), extraFieldLength: gn.get(t, 30), fileCommentLength: gn.get(t, 32), relativeOffsetOfLocalHeader: Zn.get(t, 42), filename: null }; }, len: 46 }; function RO(t) { const e = new Uint8Array(Zn.len); return Zn.put(e, 0, t), e; } const Qo = Bj("tokenizer:inflate"), yy = 256 * 1024, jj = RO(wu.DataDescriptor), ah = RO(wu.EndOfCentralDirectory); class $j { constructor(e) { this.tokenizer = e, this.syncBuffer = new Uint8Array(yy); } async isZip() { return await this.peekSignature() === wu.LocalFileHeader; } peekSignature() { return this.tokenizer.peekToken(Zn); } async findEndOfCentralDirectoryLocator() { const e = this.tokenizer, n = Math.min(16 * 1024, e.fileInfo.size), r = this.syncBuffer.subarray(0, n); await this.tokenizer.readBuffer(r, { position: e.fileInfo.size - n }); for (let i = r.length - 4; i >= 0; i--) if (r[i] === ah[0] && r[i + 1] === ah[1] && r[i + 2] === ah[2] && r[i + 3] === ah[3]) return e.fileInfo.size - n + i; return -1; } async readCentralDirectory() { if (!this.tokenizer.supportsRandomAccess()) { Qo("Cannot reading central-directory without random-read support"); return; } Qo("Reading central-directory..."); const e = this.tokenizer.position, n = await this.findEndOfCentralDirectoryLocator(); if (n > 0) { Qo("Central-directory 32-bit signature found"); const r = await this.tokenizer.readToken(Lj, n), i = []; this.tokenizer.setPosition(r.offsetOfStartOfCd); for (let o = 0; o < r.nrOfEntriesOfSize; ++o) { const a = await this.tokenizer.readToken(Qj); if (a.signature !== wu.CentralFileHeader) throw new Error("Expected Central-File-Header signature"); a.filename = await this.tokenizer.readToken(new ya(a.filenameLength, "utf-8")), await this.tokenizer.ignore(a.extraFieldLength), await this.tokenizer.ignore(a.fileCommentLength), i.push(a), Qo(`Add central-directory file-entry: n=${o + 1}/${i.length}: filename=${i[o].filename}`); } return this.tokenizer.setPosition(e), i; } this.tokenizer.setPosition(e); } async unzip(e) { const n = await this.readCentralDirectory(); if (n) return this.iterateOverCentralDirectory(n, e); let r = !1; do { const i = await this.readLocalFileHeader(); if (!i) break; const o = e(i); r = !!o.stop; let a; if (await this.tokenizer.ignore(i.extraFieldLength), i.dataDescriptor && i.compressedSize === 0) { const s = []; let c = yy; Qo("Compressed-file-size unknown, scanning for next data-descriptor-signature...."); let u = -1; for (; u < 0 && c === yy; ) { c = await this.tokenizer.peekBuffer(this.syncBuffer, { mayBeLess: !0 }), u = Gj(this.syncBuffer.subarray(0, c), jj); const d = u >= 0 ? u : c; if (o.handler) { const p = new Uint8Array(d); await this.tokenizer.readBuffer(p), s.push(p); } else await this.tokenizer.ignore(d); } Qo(`Found data-descriptor-signature at pos=${this.tokenizer.position}`), o.handler && await this.inflate(i, qj(s), o.handler); } else o.handler ? (Qo(`Reading compressed-file-data: ${i.compressedSize} bytes`), a = new Uint8Array(i.compressedSize), await this.tokenizer.readBuffer(a), await this.inflate(i, a, o.handler)) : (Qo(`Ignoring compressed-file-data: ${i.compressedSize} bytes`), await this.tokenizer.ignore(i.compressedSize)); if (Qo(`Reading data-descriptor at pos=${this.tokenizer.position}`), i.dataDescriptor && (await this.tokenizer.readToken(TI)).signature !== 134695760) throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position - TI.len}`); } while (!r); } async iterateOverCentralDirectory(e, n) { for (const r of e) { const i = n(r); if (i.handler) { this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader); const o = await this.readLocalFileHeader(); if (o) { await this.tokenizer.ignore(o.extraFieldLength); const a = new Uint8Array(r.compressedSize); await this.tokenizer.readBuffer(a), await this.inflate(o, a, i.handler); } } if (i.stop) break; } } inflate(e, n, r) { if (e.compressedMethod === 0) return r(n); Qo(`Decompress filename=${e.filename}, compressed-size=${n.length}`); const i = Pj(n); return r(i); } async readLocalFileHeader() { const e = await this.tokenizer.peekToken(Zn); if (e === wu.LocalFileHeader) { const n = await this.tokenizer.readToken(Uj); return n.filename = await this.tokenizer.readToken(new ya(n.filenameLength, "utf-8")), n; } if (e === wu.CentralFileHeader) return !1; throw e === 3759263696 ? new Error("Encrypted ZIP") : new Error("Unexpected signature"); } } function Gj(t, e) { const n = t.length, r = e.length; if (r > n) return -1; for (let i = 0; i <= n - r; i++) { let o = !0; for (let a = 0; a < r; a++) if (t[i + a] !== e[a]) { o = !1; break; } if (o) return i; } return -1; } function qj(t) { const e = t.reduce((i, o) => i + o.length, 0), n = new Uint8Array(e); let r = 0; for (const i of t) n.set(i, r), r += i.length; return n; } class zj { constructor(e) { this.gunzip = void 0, this.tokenizer = e; } inflate() { let e = !1, n = !1; const r = this; return new ReadableStream({ start: (i) => { r.gunzip = new Tj((o, a, s) => { if (o) { i.error(o); return; } a && !n && i.enqueue(a), s && !n && (i.close(), r.gunzip.terminate()); }); }, async pull(i) { try { const a = new Uint8Array(1024), s = await r.tokenizer.readBuffer(a, { mayBeLess: !0 }); if (s === 0) { e || (e = !0, n || r.gunzip.push(new Uint8Array(0), !0)); return; } r.gunzip.push(a.subarray(0, s), !1); } catch (a) { i.error(a); } }, cancel: () => { r.gunzip.terminate(), n = !0; } }); } } new globalThis.TextDecoder("utf8"); new globalThis.TextEncoder(); Array.from({ length: 256 }, (t, e) => e.toString(16).padStart(2, "0")); function kI(t) { const { byteLength: e } = t; if (e === 6) return t.getUint16(0) * 2 ** 32 + t.getUint32(2); if (e === 5) return t.getUint8(0) * 2 ** 32 + t.getUint32(1); if (e === 4) return t.getUint32(0); if (e === 3) return t.getUint8(0) * 2 ** 16 + t.getUint16(1); if (e === 2) return t.getUint16(0); if (e === 1) return t.getUint8(0); } function Hj(t, e) { if (e === "utf-16le") { const n = []; for (let r = 0; r < t.length; r++) { const i = t.charCodeAt(r); n.push(i & 255, i >> 8 & 255); } return n; } if (e === "utf-16be") { const n = []; for (let r = 0; r < t.length; r++) { const i = t.charCodeAt(r); n.push(i >> 8 & 255, i & 255); } return n; } return [...t].map((n) => n.charCodeAt(0)); } function Wj(t, e = 0) { const n = Number.parseInt(new ya(6).get(t, 148).replace(/\0.*$/, "").trim(), 8); if (Number.isNaN(n)) return !1; let r = 256; for (let i = e; i < e + 148; i++) r += t[i]; for (let i = e + 156; i < e + 512; i++) r += t[i]; return n === r; } const Kj = { get: (t, e) => t[e + 3] & 127 | t[e + 2] << 7 | t[e + 1] << 14 | t[e] << 21, len: 4 }, Vj = [ "jpg", "png", "apng", "gif", "webp", "flif", "xcf", "cr2", "cr3", "orf", "arw", "dng", "nef", "rw2", "raf", "tif", "bmp", "icns", "jxr", "psd", "indd", "zip", "tar", "rar", "gz", "bz2", "7z", "dmg", "mp4", "mid", "mkv", "webm", "mov", "avi", "mpg", "mp2", "mp3", "m4a", "oga", "ogg", "ogv", "opus", "flac", "wav", "spx", "amr", "pdf", "epub", "elf", "macho", "exe", "swf", "rtf", "wasm", "woff", "woff2", "eot", "ttf", "otf", "ttc", "ico", "flv", "ps", "xz", "sqlite", "nes", "crx", "xpi", "cab", "deb", "ar", "rpm", "Z", "lz", "cfb", "mxf", "mts", "blend", "bpg", "docx", "pptx", "xlsx", "3gp", "3g2", "j2c", "jp2", "jpm", "jpx", "mj2", "aif", "qcp", "odt", "ods", "odp", "xml", "mobi", "heic", "cur", "ktx", "ape", "wv", "dcm", "ics", "glb", "pcap", "dsf", "lnk", "alias", "voc", "ac3", "m4v", "m4p", "m4b", "f4v", "f4p", "f4b", "f4a", "mie", "asf", "ogm", "ogx", "mpc", "arrow", "shp", "aac", "mp1", "it", "s3m", "xm", "skp", "avif", "eps", "lzh", "pgp", "asar", "stl", "chm", "3mf", "zst", "jxl", "vcf", "jls", "pst", "dwg", "parquet", "class", "arj", "cpio", "ace", "avro", "icc", "fbx", "vsdx", "vtt", "apk", "drc", "lz4", "potx", "xltx", "dotx", "xltm", "ott", "ots", "otp", "odg", "otg", "xlsm", "docm", "dotm", "potm", "pptm", "jar", "rm", "ppsm", "ppsx", "tar.gz", "reg", "dat" ], Yj = [ "image/jpeg", "image/png", "image/gif", "image/webp", "image/flif", "image/x-xcf", "image/x-canon-cr2", "image/x-canon-cr3", "image/tiff", "image/bmp", "image/vnd.ms-photo", "image/vnd.adobe.photoshop", "application/x-indesign", "application/epub+zip", "application/x-xpinstall", "application/vnd.ms-powerpoint.slideshow.macroenabled.12", "application/vnd.oasis.opendocument.text", "application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.presentation", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", "application/zip", "application/x-tar", "application/x-rar-compressed", "application/gzip", "application/x-bzip2", "application/x-7z-compressed", "application/x-apple-diskimage", "application/vnd.apache.arrow.file", "video/mp4", "audio/midi", "video/matroska", "video/webm", "video/quicktime", "video/vnd.avi", "audio/wav", "audio/qcelp", "audio/x-ms-asf", "video/x-ms-asf", "application/vnd.ms-asf", "video/mpeg", "video/3gpp", "audio/mpeg", "audio/mp4", // RFC 4337 "video/ogg", "audio/ogg", "audio/ogg; codecs=opus", "application/ogg", "audio/flac", "audio/ape", "audio/wavpack", "audio/amr", "application/pdf", "application/x-elf", "application/x-mach-binary", "application/x-msdownload", "application/x-shockwave-flash", "application/rtf", "application/wasm", "font/woff", "font/woff2", "application/vnd.ms-fontobject", "font/ttf", "font/otf", "font/collection", "image/x-icon", "video/x-flv", "application/postscript", "application/eps", "application/x-xz", "application/x-sqlite3", "application/x-nintendo-nes-rom", "application/x-google-chrome-extension", "application/vnd.ms-cab-compressed", "application/x-deb", "application/x-unix-archive", "application/x-rpm", "application/x-compress", "application/x-lzip", "application/x-cfb", "application/x-mie", "application/mxf", "video/mp2t", "application/x-blender", "image/bpg", "image/j2c", "image/jp2", "image/jpx", "image/jpm", "image/mj2", "audio/aiff", "application/xml", "application/x-mobipocket-ebook", "image/heif", "image/heif-sequence", "image/heic", "image/heic-sequence", "image/icns", "image/ktx", "application/dicom", "audio/x-musepack", "text/calendar", "text/vcard", "text/vtt", "model/gltf-binary", "application/vnd.tcpdump.pcap", "audio/x-dsf", // Non-standard "application/x.ms.shortcut", // Invented by us "application/x.apple.alias", // Invented by us "audio/x-voc", "audio/vnd.dolby.dd-raw", "audio/x-m4a", "image/apng", "image/x-olympus-orf", "image/x-sony-arw", "image/x-adobe-dng", "image/x-nikon-nef", "image/x-panasonic-rw2", "image/x-fujifilm-raf", "video/x-m4v", "video/3gpp2", "application/x-esri-shape", "audio/aac", "audio/x-it", "audio/x-s3m", "audio/x-xm", "video/MP1S", "video/MP2P", "application/vnd.sketchup.skp", "image/avif", "application/x-lzh-compressed", "application/pgp-encrypted", "application/x-asar", "model/stl", "application/vnd.ms-htmlhelp", "model/3mf", "image/jxl", "application/zstd", "image/jls", "application/vnd.ms-outlook", "image/vnd.dwg", "application/vnd.apache.parquet", "application/java-vm", "application/x-arj", "application/x-cpio", "application/x-ace-compressed", "application/avro", "application/vnd.iccprofile", "application/x.autodesk.fbx", // Invented by us "application/vnd.visio", "application/vnd.android.package-archive", "application/vnd.google.draco", // Invented by us "application/x-lz4", // Invented by us "application/vnd.openxmlformats-officedocument.presentationml.template", "application/vnd.openxmlformats-officedocument.spreadsheetml.template", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", "application/vnd.ms-excel.template.macroenabled.12", "application/vnd.oasis.opendocument.text-template", "application/vnd.oasis.opendocument.spreadsheet-template", "application/vnd.oasis.opendocument.presentation-template", "application/vnd.oasis.opendocument.graphics", "application/vnd.oasis.opendocument.graphics-template", "application/vnd.ms-excel.sheet.macroenabled.12", "application/vnd.ms-word.document.macroenabled.12", "application/vnd.ms-word.template.macroenabled.12", "application/vnd.ms-powerpoint.template.macroenabled.12", "application/vnd.ms-powerpoint.presentation.macroenabled.12", "application/java-archive", "application/vnd.rn-realmedia", "application/x-ms-regedit", "application/x-ft-windows-registry-hive" ], Im = 4100; function by(t) { switch (t = t.toLowerCase(), t) { case "application/epub+zip": return { ext: "epub", mime: t }; case "application/vnd.oasis.opendocument.text": return { ext: "odt", mime: t }; case "application/vnd.oasis.opendocument.text-template": return { ext: "ott", mime: t }; case "application/vnd.oasis.opendocument.spreadsheet": return { ext: "ods", mime: t }; case "application/vnd.oasis.opendocument.spreadsheet-template": return { ext: "ots", mime: t }; case "application/vnd.oasis.opendocument.presentation": return { ext: "odp", mime: t }; case "application/vnd.oasis.opendocument.presentation-template": return { ext: "otp", mime: t }; case "application/vnd.oasis.opendocument.graphics": return { ext: "odg", mime: t }; case "application/vnd.oasis.opendocument.graphics-template": return { ext: "otg", mime: t }; case "application/vnd.openxmlformats-officedocument.presentationml.slideshow": return { ext: "ppsx", mime: t }; case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return { ext: "xlsx", mime: t }; case "application/vnd.ms-excel.sheet.macroenabled": return { ext: "xlsm", mime: "application/vnd.ms-excel.sheet.macroenabled.12" }; case "application/vnd.openxmlformats-officedocument.spreadsheetml.template": return { ext: "xltx", mime: t }; case "application/vnd.ms-excel.template.macroenabled": return { ext: "xltm", mime: "application/vnd.ms-excel.template.macroenabled.12" }; case "application/vnd.ms-powerpoint.slideshow.macroenabled": return { ext: "ppsm", mime: "application/vnd.ms-powerpoint.slideshow.macroenabled.12" }; case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return { ext: "docx", mime: t }; case "application/vnd.ms-word.document.macroenabled": return { ext: "docm", mime: "application/vnd.ms-word.document.macroenabled.12" }; case "application/vnd.openxmlformats-officedocument.wordprocessingml.template": return { ext: "dotx", mime: t }; case "application/vnd.ms-word.template.macroenabledtemplate": return { ext: "dotm", mime: "application/vnd.ms-word.template.macroenabled.12" }; case "application/vnd.openxmlformats-officedocument.presentationml.template": return { ext: "potx", mime: t }; case "application/vnd.ms-powerpoint.template.macroenabled": return { ext: "potm", mime: "application/vnd.ms-powerpoint.template.macroenabled.12" }; case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return { ext: "pptx", mime: t }; case "application/vnd.ms-powerpoint.presentation.macroenabled": return { ext: "pptm", mime: "application/vnd.ms-powerpoint.presentation.macroenabled.12" }; case "application/vnd.ms-visio.drawing": return { ext: "vsdx", mime: "application/vnd.visio" }; case "application/vnd.ms-package.3dmanufacturing-3dmodel+xml": return { ext: "3mf", mime: "model/3mf" }; } } function jo(t, e, n) { n = { offset: 0, ...n }; for (const [r, i] of e.entries()) if (n.mask) { if (i !== (n.mask[r] & t[r + n.offset])) return !1; } else if (i !== t[r + n.offset]) return !1; return !0; } let Jj = class { constructor(e) { this.options = { mpegOffsetTolerance: 0, ...e }, this.detectors = [ ...e?.customDetectors ?? [], { id: "core", detect: this.detectConfident }, { id: "core.imprecise", detect: this.detectImprecise } ], this.tokenizerOptions = { abortSignal: e?.signal }; } async fromTokenizer(e) { const n = e.position; for (const r of this.detectors) { const i = await r.detect(e); if (i) return i; if (n !== e.position) return; } } async fromBuffer(e) { if (!(e instanceof Uint8Array || e instanceof ArrayBuffer)) throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``); const n = e instanceof Uint8Array ? e : new Uint8Array(e); if (n?.length > 1) return this.fromTokenizer(JQ(n, this.tokenizerOptions)); } async fromBlob(e) { const n = XQ(e, this.tokenizerOptions); try { return await this.fromTokenizer(n); } finally { await n.close(); } } async fromStream(e) { const n = _O(e, this.tokenizerOptions); try { return await this.fromTokenizer(n); } finally { await n.close(); } } async toDetectionStream(e, n) { const { sampleSize: r = Im } = n; let i, o; const a = e.getReader({ mode: "byob" }); try { const { value: u, done: d } = await a.read(new Uint8Array(r)); if (o = u, !d && u) try { i = await this.fromBuffer(u.subarray(0, r)); } catch (p) { if (!(p instanceof hr)) throw p; i = void 0; } o = u; } finally { a.releaseLock(); } const s = new TransformStream({ async start(u) { u.enqueue(o); }, transform(u, d) { d.enqueue(u); } }), c = e.pipeThrough(s); return c.fileType = i, c; } check(e, n) { return jo(this.buffer, e, n); } checkString(e, n) { return this.check(Hj(e, n?.encoding), n); } // Detections with a high degree of certainty in identifying the correct file type detectConfident = async (e) => { if (this.buffer = new Uint8Array(Im), e.fileInfo.size === void 0 && (e.fileInfo.size = Number.MAX_SAFE_INTEGER), this.tokenizer = e, await e.peekBuffer(this.buffer, { length: 32, mayBeLess: !0 }), this.check([66, 77])) return { ext: "bmp", mime: "image/bmp" }; if (this.check([11, 119])) return { ext: "ac3", mime: "audio/vnd.dolby.dd-raw" }; if (this.check([120, 1])) return { ext: "dmg", mime: "application/x-apple-diskimage" }; if (this.check([77, 90])) return { ext: "exe", mime: "application/x-msdownload" }; if (this.check([37, 33])) return await e.peekBuffer(this.buffer, { length: 24, mayBeLess: !0 }), this.checkString("PS-Adobe-", { offset: 2 }) && this.checkString(" EPSF-", { offset: 14 }) ? { ext: "eps", mime: "application/eps" } : { ext: "ps", mime: "application/postscript" }; if (this.check([31, 160]) || this.check([31, 157])) return { ext: "Z", mime: "application/x-compress" }; if (this.check([199, 113])) return { ext: "cpio", mime: "application/x-cpio" }; if (this.check([96, 234])) return { ext: "arj", mime: "application/x-arj" }; if (this.check([239, 187, 191])) return this.tokenizer.ignore(3), this.detectConfident(e); if (this.check([71, 73, 70])) return { ext: "gif", mime: "image/gif" }; if (this.check([73, 73, 188])) return { ext: "jxr", mime: "image/vnd.ms-photo" }; if (this.check([31, 139, 8])) { const r = new zj(e).inflate(); try { const i = await this.fromStream(r); if (i && i.ext === "tar") return { ext: "tar.gz", mime: "application/gzip" }; } finally { await r.cancel(); } return { ext: "gz", mime: "application/gzip" }; } if (this.check([66, 90, 104])) return { ext: "bz2", mime: "application/x-bzip2" }; if (this.checkString("ID3")) { await e.ignore(6); const n = await e.readToken(Kj); return e.position + n > e.fileInfo.size ? { ext: "mp3", mime: "audio/mpeg" } : (await e.ignore(n), this.fromTokenizer(e)); } if (this.checkString("MP+")) return { ext: "mpc", mime: "audio/x-musepack" }; if ((this.buffer[0] === 67 || this.buffer[0] === 70) && this.check([87, 83], { offset: 1 })) return { ext: "swf", mime: "application/x-shockwave-flash" }; if (this.check([255, 216, 255])) return this.check([247], { offset: 3 }) ? { ext: "jls", mime: "image/jls" } : { ext: "jpg", mime: "image/jpeg" }; if (this.check([79, 98, 106, 1])) return { ext: "avro", mime: "application/avro" }; if (this.checkString("FLIF")) return { ext: "flif", mime: "image/flif" }; if (this.checkString("8BPS")) return { ext: "psd", mime: "image/vnd.adobe.photoshop" }; if (this.checkString("MPCK")) return { ext: "mpc", mime: "audio/x-musepack" }; if (this.checkString("FORM")) return { ext: "aif", mime: "audio/aiff" }; if (this.checkString("icns", { offset: 0 })) return { ext: "icns", mime: "image/icns" }; if (this.check([80, 75, 3, 4])) { let n; return await new $j(e).unzip((r) => { switch (r.filename) { case "META-INF/mozilla.rsa": return n = { ext: "xpi", mime: "application/x-xpinstall" }, { stop: !0 }; case "META-INF/MANIFEST.MF": return n = { ext: "jar", mime: "application/java-archive" }, { stop: !0 }; case "mimetype": return { async handler(i) { const o = new TextDecoder("utf-8").decode(i).trim(); n = by(o); }, stop: !0 }; case "[Content_Types].xml": return { async handler(i) { let o = new TextDecoder("utf-8").decode(i); const a = o.indexOf('.main+xml"'); if (a === -1) { const s = "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"; o.includes(`ContentType="${s}"`) && (n = by(s)); } else { o = o.slice(0, Math.max(0, a)); const s = o.lastIndexOf('"'), c = o.slice(Math.max(0, s + 1)); n = by(c); } }, stop: !0 }; default: return /classes\d*\.dex/.test(r.filename) ? (n = { ext: "apk", mime: "application/vnd.android.package-archive" }, { stop: !0 }) : {}; } }).catch((r) => { if (!(r instanceof hr)) throw r; }), n ?? { ext: "zip", mime: "application/zip" }; } if (this.checkString("OggS")) { await e.ignore(28); const n = new Uint8Array(8); return await e.readBuffer(n), jo(n, [79, 112, 117, 115, 72, 101, 97, 100]) ? { ext: "opus", mime: "audio/ogg; codecs=opus" } : jo(n, [128, 116, 104, 101, 111, 114, 97]) ? { ext: "ogv", mime: "video/ogg" } : jo(n, [1, 118, 105, 100, 101, 111, 0]) ? { ext: "ogm", mime: "video/ogg" } : jo(n, [127, 70, 76, 65, 67]) ? { ext: "oga", mime: "audio/ogg" } : jo(n, [83, 112, 101, 101, 120, 32, 32]) ? { ext: "spx", mime: "audio/ogg" } : jo(n, [1, 118, 111, 114, 98, 105, 115]) ? { ext: "ogg", mime: "audio/ogg" } : { ext: "ogx", mime: "application/ogg" }; } if (this.check([80, 75]) && (this.buffer[2] === 3 || this.buffer[2] === 5 || this.buffer[2] === 7) && (this.buffer[3] === 4 || this.buffer[3] === 6 || this.buffer[3] === 8)) return { ext: "zip", mime: "application/zip" }; if (this.checkString("MThd")) return { ext: "mid", mime: "audio/midi" }; if (this.checkString("wOFF") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 }))) return { ext: "woff", mime: "font/woff" }; if (this.checkString("wOF2") && (this.check([0, 1, 0, 0], { offset: 4 }) || this.checkString("OTTO", { offset: 4 }))) return { ext: "woff2", mime: "font/woff2" }; if (this.check([212, 195, 178, 161]) || this.check([161, 178, 195, 212])) return { ext: "pcap", mime: "application/vnd.tcpdump.pcap" }; if (this.checkString("DSD ")) return { ext: "dsf", mime: "audio/x-dsf" // Non-standard }; if (this.checkString("LZIP")) return { ext: "lz", mime: "application/x-lzip" }; if (this.checkString("fLaC")) return { ext: "flac", mime: "audio/flac" }; if (this.check([66, 80, 71, 251])) return { ext: "bpg", mime: "image/bpg" }; if (this.checkString("wvpk")) return { ext: "wv", mime: "audio/wavpack" }; if (this.checkString("%PDF")) return { ext: "pdf", mime: "application/pdf" }; if (this.check([0, 97, 115, 109])) return { ext: "wasm", mime: "application/wasm" }; if (this.check([73, 73])) { const n = await this.readTiffHeader(!1); if (n) return n; } if (this.check([77, 77])) { const n = await this.readTiffHeader(!0); if (n) return n; } if (this.checkString("MAC ")) return { ext: "ape", mime: "audio/ape" }; if (this.check([26, 69, 223, 163])) { async function n() { const s = await e.peekNumber(cj); let c = 128, u = 0; for (; (s & c) === 0 && c !== 0; ) ++u, c >>= 1; const d = new Uint8Array(u + 1); return await e.readBuffer(d), d; } async function r() { const s = await n(), c = await n(); c[0] ^= 128 >> c.length - 1; const u = Math.min(6, c.length), d = new DataView(s.buffer), p = new DataView(c.buffer, c.length - u, u); return { id: kI(d), len: kI(p) }; } async function i(s) { for (; s > 0; ) { const c = await r(); if (c.id === 17026) return (await e.readToken(new ya(c.len))).replaceAll(/\00.*$/g, ""); await e.ignore(c.len), --s; } } const o = await r(); switch (await i(o.len)) { case "webm": return { ext: "webm", mime: "video/webm" }; case "matroska": return { ext: "mkv", mime: "video/matroska" }; default: return; } } if (this.checkString("SQLi")) return { ext: "sqlite", mime: "application/x-sqlite3" }; if (this.check([78, 69, 83, 26])) return { ext: "nes", mime: "application/x-nintendo-nes-rom" }; if (this.checkString("Cr24")) return { ext: "crx", mime: "application/x-google-chrome-extension" }; if (this.checkString("MSCF") || this.checkString("ISc(")) return { ext: "cab", mime: "application/vnd.ms-cab-compressed" }; if (this.check([237, 171, 238, 219])) return { ext: "rpm", mime: "application/x-rpm" }; if (this.check([197, 208, 211, 198])) return { ext: "eps", mime: "application/eps" }; if (this.check([40, 181, 47, 253])) return { ext: "zst", mime: "application/zstd" }; if (this.check([127, 69, 76, 70])) return { ext: "elf", mime: "application/x-elf" }; if (this.check([33, 66, 68, 78])) return { ext: "pst", mime: "application/vnd.ms-outlook" }; if (this.checkString("PAR1") || this.checkString("PARE")) return { ext: "parquet", mime: "application/vnd.apache.parquet" }; if (this.checkString("ttcf")) return { ext: "ttc", mime: "font/collection" }; if (this.check([207, 250, 237, 254])) return { ext: "macho", mime: "application/x-mach-binary" }; if (this.check([4, 34, 77, 24])) return { ext: "lz4", mime: "application/x-lz4" // Invented by us }; if (this.checkString("regf")) return { ext: "dat", mime: "application/x-ft-windows-registry-hive" }; if (this.check([79, 84, 84, 79, 0])) return { ext: "otf", mime: "font/otf" }; if (this.checkString("#!AMR")) return { ext: "amr", mime: "audio/amr" }; if (this.checkString("{\\rtf")) return { ext: "rtf", mime: "application/rtf" }; if (this.check([70, 76, 86, 1])) return { ext: "flv", mime: "video/x-flv" }; if (this.checkString("IMPM")) return { ext: "it", mime: "audio/x-it" }; if (this.checkString("-lh0-", { offset: 2 }) || this.checkString("-lh1-", { offset: 2 }) || this.checkString("-lh2-", { offset: 2 }) || this.checkString("-lh3-", { offset: 2 }) || this.checkString("-lh4-", { offset: 2 }) || this.checkString("-lh5-", { offset: 2 }) || this.checkString("-lh6-", { offset: 2 }) || this.checkString("-lh7-", { offset: 2 }) || this.checkString("-lzs-", { offset: 2 }) || this.checkString("-lz4-", { offset: 2 }) || this.checkString("-lz5-", { offset: 2 }) || this.checkString("-lhd-", { offset: 2 })) return { ext: "lzh", mime: "application/x-lzh-compressed" }; if (this.check([0, 0, 1, 186])) { if (this.check([33], { offset: 4, mask: [241] })) return { ext: "mpg", // May also be .ps, .mpeg mime: "video/MP1S" }; if (this.check([68], { offset: 4, mask: [196] })) return { ext: "mpg", // May also be .mpg, .m2p, .vob or .sub mime: "video/MP2P" }; } if (this.checkString("ITSF")) return { ext: "chm", mime: "application/vnd.ms-htmlhelp" }; if (this.check([202, 254, 186, 190])) return { ext: "class", mime: "application/java-vm" }; if (this.checkString(".RMF")) return { ext: "rm", mime: "application/vnd.rn-realmedia" }; if (this.checkString("DRACO")) return { ext: "drc", mime: "application/vnd.google.draco" // Invented by us }; if (this.check([253, 55, 122, 88, 90, 0])) return { ext: "xz", mime: "application/x-xz" }; if (this.checkString("= 1e3 && n <= 1050) return { ext: "dwg", mime: "image/vnd.dwg" }; } if (this.checkString("070707")) return { ext: "cpio", mime: "application/x-cpio" }; if (this.checkString("BLENDER")) return { ext: "blend", mime: "application/x-blender" }; if (this.checkString("!")) return await e.ignore(8), await e.readToken(new ya(13, "ascii")) === "debian-binary" ? { ext: "deb", mime: "application/x-deb" } : { ext: "ar", mime: "application/x-unix-archive" }; if (this.checkString("WEBVTT") && // One of LF, CR, tab, space, or end of file must follow "WEBVTT" per the spec (see `fixture/fixture-vtt-*.vtt` for examples). Note that `\0` is technically the null character (there is no such thing as an EOF character). However, checking for `\0` gives us the same result as checking for the end of the stream. [` `, "\r", " ", " ", "\0"].some((n) => this.checkString(n, { offset: 6 }))) return { ext: "vtt", mime: "text/vtt" }; if (this.check([137, 80, 78, 71, 13, 10, 26, 10])) { await e.ignore(8); async function n() { return { length: await e.readToken(lj), type: await e.readToken(new ya(4, "latin1")) }; } do { const r = await n(); if (r.length < 0) return; switch (r.type) { case "IDAT": return { ext: "png", mime: "image/png" }; case "acTL": return { ext: "apng", mime: "image/apng" }; default: await e.ignore(r.length + 4); } } while (e.position + 8 < e.fileInfo.size); return { ext: "png", mime: "image/png" }; } if (this.check([65, 82, 82, 79, 87, 49, 0, 0])) return { ext: "arrow", mime: "application/vnd.apache.arrow.file" }; if (this.check([103, 108, 84, 70, 2, 0, 0, 0])) return { ext: "glb", mime: "model/gltf-binary" }; if (this.check([102, 114, 101, 101], { offset: 4 }) || this.check([109, 100, 97, 116], { offset: 4 }) || this.check([109, 111, 111, 118], { offset: 4 }) || this.check([119, 105, 100, 101], { offset: 4 })) return { ext: "mov", mime: "video/quicktime" }; if (this.check([73, 73, 82, 79, 8, 0, 0, 0, 24])) return { ext: "orf", mime: "image/x-olympus-orf" }; if (this.checkString("gimp xcf ")) return { ext: "xcf", mime: "image/x-xcf" }; if (this.checkString("ftyp", { offset: 4 }) && (this.buffer[8] & 96) !== 0) { const n = new ya(4, "latin1").get(this.buffer, 8).replace("\0", " ").trim(); switch (n) { case "avif": case "avis": return { ext: "avif", mime: "image/avif" }; case "mif1": return { ext: "heic", mime: "image/heif" }; case "msf1": return { ext: "heic", mime: "image/heif-sequence" }; case "heic": case "heix": return { ext: "heic", mime: "image/heic" }; case "hevc": case "hevx": return { ext: "heic", mime: "image/heic-sequence" }; case "qt": return { ext: "mov", mime: "video/quicktime" }; case "M4V": case "M4VH": case "M4VP": return { ext: "m4v", mime: "video/x-m4v" }; case "M4P": return { ext: "m4p", mime: "video/mp4" }; case "M4B": return { ext: "m4b", mime: "audio/mp4" }; case "M4A": return { ext: "m4a", mime: "audio/x-m4a" }; case "F4V": return { ext: "f4v", mime: "video/mp4" }; case "F4P": return { ext: "f4p", mime: "video/mp4" }; case "F4A": return { ext: "f4a", mime: "audio/mp4" }; case "F4B": return { ext: "f4b", mime: "audio/mp4" }; case "crx": return { ext: "cr3", mime: "image/x-canon-cr3" }; default: return n.startsWith("3g") ? n.startsWith("3g2") ? { ext: "3g2", mime: "video/3gpp2" } : { ext: "3gp", mime: "video/3gpp" } : { ext: "mp4", mime: "video/mp4" }; } } if (this.checkString(`REGEDIT4\r `)) return { ext: "reg", mime: "application/x-ms-regedit" }; if (this.check([82, 73, 70, 70])) { if (this.checkString("WEBP", { offset: 8 })) return { ext: "webp", mime: "image/webp" }; if (this.check([65, 86, 73], { offset: 8 })) return { ext: "avi", mime: "video/vnd.avi" }; if (this.check([87, 65, 86, 69], { offset: 8 })) return { ext: "wav", mime: "audio/wav" }; if (this.check([81, 76, 67, 77], { offset: 8 })) return { ext: "qcp", mime: "audio/qcelp" }; } if (this.check([73, 73, 85, 0, 24, 0, 0, 0, 136, 231, 116, 216])) return { ext: "rw2", mime: "image/x-panasonic-rw2" }; if (this.check([48, 38, 178, 117, 142, 102, 207, 17, 166, 217])) { async function n() { const r = new Uint8Array(16); return await e.readBuffer(r), { id: r, size: Number(await e.readToken(dj)) }; } for (await e.ignore(30); e.position + 24 < e.fileInfo.size; ) { const r = await n(); let i = r.size - 24; if (jo(r.id, [145, 7, 220, 183, 183, 169, 207, 17, 142, 230, 0, 192, 12, 32, 83, 101])) { const o = new Uint8Array(16); if (i -= await e.readBuffer(o), jo(o, [64, 158, 105, 248, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) return { ext: "asf", mime: "audio/x-ms-asf" }; if (jo(o, [192, 239, 25, 188, 77, 91, 207, 17, 168, 253, 0, 128, 95, 92, 68, 43])) return { ext: "asf", mime: "video/x-ms-asf" }; break; } await e.ignore(i); } return { ext: "asf", mime: "application/vnd.ms-asf" }; } if (this.check([171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10])) return { ext: "ktx", mime: "image/ktx" }; if ((this.check([126, 16, 4]) || this.check([126, 24, 4])) && this.check([48, 77, 73, 69], { offset: 4 })) return { ext: "mie", mime: "application/x-mie" }; if (this.check([39, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], { offset: 2 })) return { ext: "shp", mime: "application/x-esri-shape" }; if (this.check([255, 79, 255, 81])) return { ext: "j2c", mime: "image/j2c" }; if (this.check([0, 0, 0, 12, 106, 80, 32, 32, 13, 10, 135, 10])) switch (await e.ignore(20), await e.readToken(new ya(4, "ascii"))) { case "jp2 ": return { ext: "jp2", mime: "image/jp2" }; case "jpx ": return { ext: "jpx", mime: "image/jpx" }; case "jpm ": return { ext: "jpm", mime: "image/jpm" }; case "mjp2": return { ext: "mj2", mime: "image/mj2" }; default: return; } if (this.check([255, 10]) || this.check([0, 0, 0, 12, 74, 88, 76, 32, 13, 10, 135, 10])) return { ext: "jxl", mime: "image/jxl" }; if (this.check([254, 255])) return this.checkString("= 16) { const n = new DataView(this.buffer.buffer).getUint32(12, !0); if (n > 12 && this.buffer.length >= n + 16) try { const r = new TextDecoder().decode(this.buffer.subarray(16, n + 16)); if (JSON.parse(r).files) return { ext: "asar", mime: "application/x-asar" }; } catch { } } if (this.check([6, 14, 43, 52, 2, 5, 1, 1, 13, 1, 2, 1, 1, 2])) return { ext: "mxf", mime: "application/mxf" }; if (this.checkString("SCRM", { offset: 44 })) return { ext: "s3m", mime: "audio/x-s3m" }; if (this.check([71]) && this.check([71], { offset: 188 })) return { ext: "mts", mime: "video/mp2t" }; if (this.check([71], { offset: 4 }) && this.check([71], { offset: 196 })) return { ext: "mts", mime: "video/mp2t" }; if (this.check([66, 79, 79, 75, 77, 79, 66, 73], { offset: 60 })) return { ext: "mobi", mime: "application/x-mobipocket-ebook" }; if (this.check([68, 73, 67, 77], { offset: 128 })) return { ext: "dcm", mime: "application/dicom" }; if (this.check([76, 0, 0, 0, 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70])) return { ext: "lnk", mime: "application/x.ms.shortcut" // Invented by us }; if (this.check([98, 111, 111, 107, 0, 0, 0, 0, 109, 97, 114, 107, 0, 0, 0, 0])) return { ext: "alias", mime: "application/x.apple.alias" // Invented by us }; if (this.checkString("Kaydara FBX Binary \0")) return { ext: "fbx", mime: "application/x.autodesk.fbx" // Invented by us }; if (this.check([76, 80], { offset: 34 }) && (this.check([0, 0, 1], { offset: 8 }) || this.check([1, 0, 2], { offset: 8 }) || this.check([2, 0, 2], { offset: 8 }))) return { ext: "eot", mime: "application/vnd.ms-fontobject" }; if (this.check([6, 6, 237, 245, 216, 29, 70, 229, 189, 49, 239, 231, 254, 116, 183, 29])) return { ext: "indd", mime: "application/x-indesign" }; if (await e.peekBuffer(this.buffer, { length: Math.min(512, e.fileInfo.size), mayBeLess: !0 }), this.checkString("ustar", { offset: 257 }) && (this.checkString("\0", { offset: 262 }) || this.checkString(" ", { offset: 262 })) || this.check([0, 0, 0, 0, 0, 0], { offset: 257 }) && Wj(this.buffer)) return { ext: "tar", mime: "application/x-tar" }; if (this.check([255, 254])) { const n = "utf-16le"; return this.checkString(" { if (this.buffer = new Uint8Array(Im), await e.peekBuffer(this.buffer, { length: Math.min(8, e.fileInfo.size), mayBeLess: !0 }), this.check([0, 0, 1, 186]) || this.check([0, 0, 1, 179])) return { ext: "mpg", mime: "video/mpeg" }; if (this.check([0, 1, 0, 0, 0])) return { ext: "ttf", mime: "font/ttf" }; if (this.check([0, 0, 1, 0])) return { ext: "ico", mime: "image/x-icon" }; if (this.check([0, 0, 2, 0])) return { ext: "cur", mime: "image/x-icon" }; if (await e.peekBuffer(this.buffer, { length: Math.min(2 + this.options.mpegOffsetTolerance, e.fileInfo.size), mayBeLess: !0 }), this.buffer.length >= 2 + this.options.mpegOffsetTolerance) for (let n = 0; n <= this.options.mpegOffsetTolerance; ++n) { const r = this.scanMpeg(n); if (r) return r; } }; async readTiffTag(e) { const n = await this.tokenizer.readToken(e ? Zl : gn); switch (this.tokenizer.ignore(10), n) { case 50341: return { ext: "arw", mime: "image/x-sony-arw" }; case 50706: return { ext: "dng", mime: "image/x-adobe-dng" }; } } async readTiffIFD(e) { const n = await this.tokenizer.readToken(e ? Zl : gn); for (let r = 0; r < n; ++r) { const i = await this.readTiffTag(e); if (i) return i; } } async readTiffHeader(e) { const n = (e ? Zl : gn).get(this.buffer, 2), r = (e ? uj : Zn).get(this.buffer, 4); if (n === 42) { if (r >= 6) { if (this.checkString("CR", { offset: 8 })) return { ext: "cr2", mime: "image/x-canon-cr2" }; if (r >= 8) { const o = (e ? Zl : gn).get(this.buffer, 8), a = (e ? Zl : gn).get(this.buffer, 10); if (o === 28 && a === 254 || o === 31 && a === 11) return { ext: "nef", mime: "image/x-nikon-nef" }; } } return await this.tokenizer.ignore(r), await this.readTiffIFD(e) ?? { ext: "tif", mime: "image/tiff" }; } if (n === 43) return { ext: "tif", mime: "image/tiff" }; } /** Scan check MPEG 1 or 2 Layer 3 header, or 'layer 0' for ADTS (MPEG sync-word 0xFFE). @param offset - Offset to scan for sync-preamble. @returns {{ext: string, mime: string}} */ scanMpeg(e) { if (this.check([255, 224], { offset: e, mask: [255, 224] })) { if (this.check([16], { offset: e + 1, mask: [22] })) return this.check([8], { offset: e + 1, mask: [8] }) ? { ext: "aac", mime: "audio/aac" } : { ext: "aac", mime: "audio/aac" }; if (this.check([2], { offset: e + 1, mask: [6] })) return { ext: "mp3", mime: "audio/mpeg" }; if (this.check([4], { offset: e + 1, mask: [6] })) return { ext: "mp2", mime: "audio/mpeg" }; if (this.check([6], { offset: e + 1, mask: [6] })) return { ext: "mp1", mime: "audio/mpeg" }; } } }; new Set(Vj); new Set(Yj); class Xj extends Jj { async fromStream(e) { const n = await (e instanceof UL ? _O(e, this.tokenizerOptions) : ZQ(e, this.tokenizerOptions)); try { return await super.fromTokenizer(n); } finally { await n.close(); } } async fromFile(e) { const n = await ej(e); try { return await super.fromTokenizer(n); } finally { await n.close(); } } async toDetectionStream(e, n = {}) { if (!(e instanceof wD)) return super.toDetectionStream(e, n); const { sampleSize: r = Im } = n; return new Promise((i, o) => { e.on("error", o), e.once("readable", () => { (async () => { try { const a = new jL(), s = F3 ? F3(e, a, () => { }) : e.pipe(a), c = e.read(r) ?? e.read() ?? new Uint8Array(0); try { a.fileType = await this.fromBuffer(c); } catch (u) { u instanceof hr ? a.fileType = void 0 : o(u); } i(s); } catch (a) { o(a); } })(); }); }); } } async function Jp(t, e) { return new Xj(e).fromFile(t, e); } class ht { // 适用于获取服务器下发cookies时获取,仅GET static async HttpsGetCookies(e) { const n = e.startsWith("https") ? M3 : fp; return new Promise((r, i) => { n.get(e, (a) => { const s = {}; a.on("data", () => { }), a.on("end", () => { this.handleRedirect(a, e, s).then(r).catch(i); }), a.headers["set-cookie"] && this.extractCookies(a.headers["set-cookie"], s); }).on("error", (a) => { i(a); }); }); } static async handleRedirect(e, n, r) { if ((e.statusCode === 301 || e.statusCode === 302) && e.headers.location) { const i = new URL(e.headers.location, n), o = await this.HttpsGetCookies(i.href); return { ...r, ...o }; } return r; } static extractCookies(e, n) { e.forEach((r) => { const i = r.split(";")[0]?.split("="); if (i) { const o = i[0], a = i[1]; o && a && o.length > 0 && a.length > 0 && (n[o] = a); } }); } // 请求和回复都是JSON data传原始内容 自动编码json // 支持 301/302 重定向(最多 5 次) static async HttpGetJson(e, n = "GET", r, i = {}, o = !0, a = !0, s = 5) { const c = new URL(e), u = e.startsWith("https://") ? M3 : fp, d = { hostname: c.hostname, port: c.port, path: c.pathname + c.search, method: n, headers: i }; return new Promise((p, f) => { const m = u.request(d, (h) => { if ((h.statusCode === 301 || h.statusCode === 302 || h.statusCode === 307 || h.statusCode === 308) && h.headers.location) { if (s <= 0) { f(new Error("Too many redirects")); return; } const x = new URL(h.headers.location, e).href; this.HttpGetJson(x, n, r, i, o, a, s - 1).then(p).catch(f); return; } let y = ""; h.on("data", (x) => { y += x.toString(); }), h.on("end", () => { try { if (h.statusCode && h.statusCode >= 200 && h.statusCode < 300) if (o) { const x = JSON.parse(y); p(x); } else p(y); else f(new Error(`Unexpected status code: ${h.statusCode}`)); } catch (x) { f(new Error(x.message)); } }); }); m.on("error", (h) => { f(h); }), (n === "POST" || n === "PUT" || n === "PATCH") && (a ? m.write(JSON.stringify(r)) : m.write(r)), m.end(); }); } // 请求返回都是原始内容 static async HttpGetText(e, n = "GET", r, i = {}) { return this.HttpGetJson(e, n, r, i, !1, !1); } } const Zj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, RequestUtil: ht }, Symbol.toStringTag, { value: "Module" })); class e$ { serverUrl = []; logger; rkeyData = { group_rkey: "", private_rkey: "", expired_time: 0 }; urlFailures = /* @__PURE__ */ new Map(); FAILURE_LIMIT = 4; ONE_DAY = 1440 * 60 * 1e3; constructor(e, n) { this.logger = n, this.serverUrl = e; } async getRkey() { if (this.getAvailableUrls().length === 0) throw this.logger.logError("[Rkey] 所有服务均已禁用, 图片使用FallBack机制"), new Error("获取rkey失败:所有服务URL均已被禁用"); if (this.isExpired()) try { await this.refreshRkey(); } catch (n) { throw new Error(`${n}`); } return this.rkeyData; } getAvailableUrls() { return this.serverUrl.filter((e) => !this.isUrlDisabled(e)); } isUrlDisabled(e) { const n = this.urlFailures.get(e); return n ? (/* @__PURE__ */ new Date()).getTime() - n.lastTimestamp > this.ONE_DAY ? (n.count = 0, this.urlFailures.set(e, n), !1) : n.count >= this.FAILURE_LIMIT : !1; } updateUrlFailure(e) { const n = (/* @__PURE__ */ new Date()).getTime(), r = this.urlFailures.get(e) || { count: 0, lastTimestamp: 0 }; n - r.lastTimestamp > this.ONE_DAY ? r.count = 1 : r.count++, r.lastTimestamp = n, this.urlFailures.set(e, r), r.count >= this.FAILURE_LIMIT && this.logger.logError(`[Rkey] URL ${e} 已被禁用,失败次数达到 ${this.FAILURE_LIMIT} 次`); } isExpired() { return (/* @__PURE__ */ new Date()).getTime() / 1e3 > this.rkeyData.expired_time; } async refreshRkey() { const e = this.getAvailableUrls(); if (e.length === 0) throw this.logger.logError("[Rkey] 所有服务均已禁用"), new Error("获取rkey失败:所有服务URL均已被禁用"); for (const n of e) try { let r = await ht.HttpGetJson(n, "GET"); if (typeof r == "object" && r !== null && "retcode" in r && (r = r.data), typeof r?.group_rkey != "string" || typeof r?.private_rkey != "string" || typeof r?.expired_time != "number" || r.group_rkey.length <= 6 || r.private_rkey.length <= 6 || r.expired_time <= 0) throw new Error("Rkey 服务返回格式无效:group_rkey/private_rkey/expired_time 缺失或不合法"); this.rkeyData = { group_rkey: r.group_rkey.slice(6), private_rkey: r.private_rkey.slice(6), expired_time: r.expired_time }; return; } catch (r) { if (this.logger.logError(`[Rkey] 异常服务 ${n} 异常 / `, r), this.updateUrlFailure(n), n === e[e.length - 1]) throw new Error(`获取rkey失败: ${r}`); } } } const t$ = {}, gl = typeof t$ < "u" && "4.18.42" || "1.0.0-dev", n$ = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; function vS(t) { if (!t || typeof t != "string") return { valid: !1, normalized: "1.0.0-dev", major: 1, minor: 0, patch: 0, prerelease: "dev", buildmetadata: null }; const e = t.trim().match(n$); if (e) { const n = parseInt(e[1], 10), r = parseInt(e[2], 10), i = parseInt(e[3], 10), o = e[4] || null, a = e[5] || null; let s = `${n}.${r}.${i}`; return o && (s += `-${o}`), a && (s += `+${a}`), { valid: !0, normalized: s, major: n, minor: r, patch: i, prerelease: o, buildmetadata: a }; } return { valid: !1, normalized: "1.0.0-dev", major: 1, minor: 0, patch: 0, prerelease: "dev", buildmetadata: null }; } function BO(t, e) { const n = vS(t), r = vS(e); if (!n.valid && !r.valid) return t.localeCompare(e); if (!n.valid) return -1; if (!r.valid) return 1; if (n.major !== r.major) return n.major > r.major ? 1 : -1; if (n.minor !== r.minor) return n.minor > r.minor ? 1 : -1; if (n.patch !== r.patch) return n.patch > r.patch ? 1 : -1; if (n.prerelease && !r.prerelease) return -1; if (!n.prerelease && r.prerelease) return 1; if (n.prerelease && r.prerelease) { const i = n.prerelease.split("."), o = r.prerelease.split("."), a = Math.max(i.length, o.length); for (let s = 0; s < a; s++) { const c = i[s], u = o[s]; if (c === void 0) return -1; if (u === void 0) return 1; const d = /^\d+$/.test(c) ? parseInt(c, 10) : NaN, p = /^\d+$/.test(u) ? parseInt(u, 10) : NaN; if (!isNaN(d) && !isNaN(p)) { if (d !== p) return d > p ? 1 : -1; continue; } if (!isNaN(d)) return -1; if (!isNaN(p)) return 1; if (c !== u) return c > u ? 1 : -1; } } return 0; } vS(gl); const J2 = [ "https://github.chenc.dev/", "https://ghproxy.cfd/", "https://github.tbedu.top/", "https://ghproxy.cc/", "https://gh.monlor.com/", "https://cdn.akaere.online/", "https://gh.idayer.com/", "https://gh.llkk.cc/", "https://ghpxy.hwinzniej.top/", "https://github-proxy.memory-echoes.cn/", "https://git.yylx.win/", "https://gitproxy.mrhjx.cn/", "https://gh.fhjhy.top/", "https://gp.zkitefly.eu.org/", "https://gh-proxy.com/", "https://ghfile.geekertao.top/", "https://j.1lin.dpdns.org/", "https://ghproxy.imciel.com/", "https://github-proxy.teach-english.tech/", "https://gh.927223.xyz/", "https://github.ednovas.xyz/", "https://ghf.xn--eqrr82bzpe.top/", "https://gh.dpik.top/", "https://gh.jasonzeng.dev/", "https://gh.xxooo.cf/", "https://gh.bugdey.us.kg/", "https://ghm.078465.xyz/", "https://j.1win.ggff.net/", "https://tvv.tw/", "https://gitproxy.127731.xyz/", "https://gh.inkchills.cn/", "https://ghproxy.cxkpro.top/", "https://gh.sixyin.com/", "https://github.geekery.cn/", "https://git.669966.xyz/", "https://gh.5050net.cn/", "https://gh.felicity.ac.cn/", "https://github.dpik.top/", "https://ghp.keleyaa.com/", "https://gh.wsmdn.dpdns.org/", "https://ghproxy.monkeyray.net/", "https://fastgit.cc/", "https://gh.catmak.name/", "https://gh.noki.icu/", "" // 原始 URL(无镜像) ], r$ = [ "https://api.github.com" // 目前没有可用的公共 API 代理镜像 ], f0 = [ "https://raw.githubusercontent.com", // 测试确认支持 raw 文件的镜像 "https://github.chenc.dev/https://raw.githubusercontent.com", "https://ghproxy.cfd/https://raw.githubusercontent.com", "https://ghproxy.cc/https://raw.githubusercontent.com", "https://gh-proxy.net/https://raw.githubusercontent.com" ], i$ = [ "https://nightly.link" // 可以添加其他 nightly.link 镜像(如果有的话) ], o$ = { fileMirrors: J2, apiMirrors: r$, rawMirrors: f0, nightlyLinkMirrors: i$, timeout: 5e3, // 5秒超时,平衡速度和可靠性 enabled: !0, customMirror: void 0 }; let co = { ...o$ }, Cm = null, ed = null; const a$ = 1800 * 1e3; let xS = 0; async function s$(t, e = 5e3) { const r = Ru("https://github.com/NapNeko/SnowCatQQ/releases/latest", t), i = Date.now(); return new Promise((o) => { try { const a = new URL(r), s = a.protocol === "https:", u = (s ? hl : Ds).request({ hostname: a.hostname, port: a.port || (s ? 443 : 80), path: a.pathname + a.search, method: "HEAD", timeout: e, headers: { "User-Agent": "NapCat-Mirror-Test" } }, (d) => { const p = d.statusCode || 0, f = p >= 200 && p < 400; o({ mirror: t, latency: Date.now() - i, success: f }); }); u.on("error", () => { o({ mirror: t, latency: 1 / 0, success: !1 }); }), u.on("timeout", () => { u.destroy(), o({ mirror: t, latency: 1 / 0, success: !1 }); }), u.end(); } catch { o({ mirror: t, latency: 1 / 0, success: !1 }); } }); } async function X2(t = !1) { const e = Date.now(); if (!t && Cm && e - xS < a$) return Cm; if (ed) return ed; ed = c$(); try { const n = await ed; return Cm = n, xS = e, n; } finally { ed = null; } } async function c$() { const e = co.fileMirrors.filter((i) => i), r = (await Promise.all( e.map((i) => s$(i, 3e3)) )).filter((i) => i.success).sort((i, o) => i.latency - o.latency).map((i) => i.mirror); return r.length === 0 ? [""] : r; } function u$() { Cm = null, xS = 0; } function UO() { return { ...co }; } function l$(t) { co.customMirror = t; } function Ru(t, e) { return e ? e.endsWith("/") ? e + t : e + "/" + t : t; } async function d$(t, e = 5e3) { try { return await bs(ht.HttpGetText(t), e), !0; } catch { return !1; } } async function p$(t, e = 5e3) { return new Promise((n) => { const r = new URL(t), i = r.protocol === "https:", a = (i ? hl : Ds).request({ hostname: r.hostname, port: r.port || (i ? 443 : 80), path: r.pathname + r.search, method: "HEAD", timeout: e, headers: { "User-Agent": "NapCat-Mirror-Test" } }, (s) => { const c = s.statusCode || 0, u = s.headers["content-type"] || "", d = c >= 200 && c < 400, p = !u.includes("text/html"); n(d && p); }); a.on("error", () => n(!1)), a.on("timeout", () => { a.destroy(), n(!1); }), a.end(); }); } async function f$(t, e = 5e3) { return new Promise((n) => { const r = new URL(t), i = r.protocol === "https:", a = (i ? hl : Ds).request({ hostname: r.hostname, port: r.port || (i ? 443 : 80), path: r.pathname + r.search, method: "HEAD", timeout: e, headers: { "User-Agent": "NapCat-Mirror-Test" } }, (s) => { const c = s.statusCode || 0, u = s.headers["content-type"] || "", d = parseInt(s.headers["content-length"] || "0", 10), p = c >= 200 && c < 400, f = !u.includes("text/html"); n(p ? f ? { valid: !0, statusCode: c, contentType: u, contentLength: d } : { valid: !1, statusCode: c, contentType: u, contentLength: d, error: "返回了 HTML 页面而非文件" } : { valid: !1, statusCode: c, contentType: u, contentLength: d, error: `HTTP ${c}` }); }); a.on("error", (s) => n({ valid: !1, error: s.message })), a.on("timeout", () => { a.destroy(), n({ valid: !1, error: "Timeout" }); }), a.end(); }); } async function wS(t, e = {}) { const { timeout: n = co.timeout, customMirror: r = co.customMirror, testMethod: i = "head", validateContent: o = !0, // 默认启用内容验证 minFileSize: a, useFastMirrors: s = !0 // 默认使用快速镜像列表 } = e; let c = e.mirrors; c || (t.includes("nightly.link") ? c = co.nightlyLinkMirrors : s ? c = await X2() : c = co.fileMirrors); const u = async (p) => { if (o) { const m = await f$(p, n); return m.valid && a && m.contentLength && m.contentLength < a ? !1 : m.valid; } return i === "head" ? await p$(p, n) : await d$(p, n); }; if (r) return Ru(t, r); if (await u(t)) return t; let d = 0; for (const p of c) { if (!p) continue; let f; if (t.includes("nightly.link") ? f = t.replace("https://nightly.link", p.startsWith("http") ? p : `https://${p}`) : f = Ru(t, p), d++, await u(f)) return f; } throw new Error(`所有下载源都不可用(已测试 ${d} 个镜像),请检查网络连接或配置自定义镜像`); } const LO = /^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-.]+))?(?:\+([0-9A-Za-z-.]+))?$/; function NI(t) { const e = t.match(LO); return e ? { major: parseInt(e[1] ?? "0", 10), minor: parseInt(e[2] ?? "0", 10), patch: parseInt(e[3] ?? "0", 10), prerelease: e[4] || "" } : null; } function h$(t, e) { const n = NI(t), r = NI(e); return !n && !r ? 0 : n ? r ? n.major !== r.major ? n.major - r.major : n.minor !== r.minor ? n.minor - r.minor : n.patch !== r.patch ? n.patch - r.patch : n.prerelease && !r.prerelease ? -1 : !n.prerelease && r.prerelease ? 1 : n.prerelease.localeCompare(r.prerelease) : 1 : -1; } async function m$(t, e, n) { const i = (await QO(t, e, n)).tags.filter((a) => LO.test(a)); if (i.length === 0) throw new Error("未找到有效的 release tag"); i.sort(h$); const o = i[i.length - 1]; if (!o) throw new Error("未找到有效的 release tag"); return o; } function g$(t, e, n, r) { return `https://github.com/${t}/${e}/releases/download/${n}/${r}`; } async function y$(t, e, n = "latest", r = {}) { const { assetNames: i = [], fetchChangelog: o = !1, mirror: a } = r; let s; n === "latest" ? s = await m$(t, e, a) : s = n; const c = i.map((d) => ({ name: d, browser_download_url: g$(t, e, s, d) })); if (!o && i.length > 0) return { tag_name: s, assets: c, body: void 0 }; const u = `https://api.github.com/repos/${t}/${e}/releases/tags/${s}`; for (const d of co.apiMirrors) try { const p = u.replace("https://api.github.com", d); return await bs( ht.HttpGetJson(p, "GET", void 0, { "User-Agent": "SnowCat", Accept: "application/vnd.github.v3+json" }), co.timeout ); } catch { continue; } if (i.length > 0) return { tag_name: s, assets: c, body: void 0 }; throw new Error("无法获取 release 信息,所有 API 源都不可用"); } const b$ = 600 * 1e3, PI = /* @__PURE__ */ new Map(); async function QO(t, e, n) { const r = `${t}/${e}/${n || "auto"}`, i = PI.get(r); if (i && Date.now() - i.timestamp < b$) return { tags: i.tags, mirror: i.mirror }; const o = `https://github.com/${t}/${e}.git/info/refs?service=git-upload-pack`, a = (d) => d.split(` `).map((p) => { const f = p.match(/refs\/tags\/(.+)$/); return f ? f[1] : void 0; }).filter((p) => p !== void 0 && !p.endsWith("^{}")), s = async (d, p) => { try { const f = await bs( ht.HttpGetText(d), co.timeout ); if (f.includes("refs/tags")) return { tags: a(f), mirror: p }; } catch { } return null; }; let c = []; n ? c = [n] : c = await X2(); const u = c.map((d) => { const p = d ? Ru(o, d) : o; return s(p, d || "https://github.com"); }); try { const d = await Promise.any(u.filter((p) => p !== null)); if (d) return PI.set(r, { tags: d.tags, mirror: d.mirror, timestamp: Date.now() }), d; } catch { } throw n ? new Error(`指定镜像 ${n} 获取 tags 失败`) : new Error("无法获取 tags,所有镜像源都不可用"); } const v$ = 600 * 1e3, DI = /* @__PURE__ */ new Map(); async function x$(t, e, n = "build.yml", r = 10, i) { const o = `https://github.com/${t}/${e}/actions/workflows/${n}`; let a = []; i ? a = [i] : a = await X2(); for (const s of a) try { const c = [], u = /* @__PURE__ */ new Set(); let d = 1; const p = 10; for (; c.length < r && d <= p; ) { const f = d > 1 ? `${o}?page=${d}` : o, m = s ? Ru(f, s) : f, y = (await bs( ht.HttpGetText(m), 1e4 )).split('
]*aria-label="([^"]*)"`, "i").exec(g); if (!b || !b[1] || !b[2]) continue; const S = parseInt(b[1]), E = b[2]; if (E.toLowerCase().includes("completed") && !u.has(S)) { const U = /]*>([\s\S]*?)<\/span>/i.exec(g); if (Y && Y[1] && (q = Y[1].trim()), !q) { q = E; const H = /^(completed successfully:\s*)/i.exec(q); H && (q = q.substring(H[0].length)); } c.push({ id: S, created_at: U[1], title: q.trim() }); } } } if (x === 0 && y.length < 2) break; d++; } if (c.length > 0) return { runs: c, mirror: s || "https://github.com" }; } catch { continue; } return { runs: [], mirror: "" }; } async function w$(t, e, n = "build.yml", r = "main", i = 10, o) { try { const { runs: a, mirror: s } = await x$(t, e, n, i, o); if (a.length === 0) return { artifacts: [], mirror: s }; const c = [], u = ["NapCat.Framework", "NapCat.Shell"], d = co.nightlyLinkMirrors[0] || "https://nightly.link"; for (const p of a) for (const f of u) c.push({ id: p.id, name: f, size_in_bytes: 0, created_at: p.created_at, expires_at: new Date(new Date(p.created_at).getTime() + 4320 * 60 * 1e3).toISOString(), archive_download_url: `${d}/${t}/${e}/actions/runs/${p.id}/${f}.zip`, workflow_run_id: p.id, workflow_title: p.title }); return { artifacts: c, mirror: s }; } catch { return { artifacts: [], mirror: "" }; } } async function S$(t, e, n = "build.yml", r = "main", i = 10, o) { const a = `${t}/${e}/${n}/${r}/${o || "auto"}`, s = DI.get(a); if (s && Date.now() - s.timestamp < v$) return { artifacts: s.artifacts, mirror: s.mirror }; let c = { artifacts: [], mirror: "" }; try { c = await w$(t, e, n, r, i, o); } catch { } return c.artifacts.length > 0 && DI.set(a, { artifacts: c.artifacts, mirror: c.mirror, timestamp: Date.now() }), c; } async function OI(t, ...e) { return new Promise((n) => { try { const r = t(...e); n(r); } catch { n(void 0); } }); } async function jO(t, ...e) { return new Promise((n) => { t(...e).then((r) => { n(r); }).catch(() => { n(void 0); }); }); } function bp(t) { return new Promise((e) => setTimeout(e, t)); } function bs(t, e) { const n = new Promise( (r, i) => setTimeout(() => i(new Error("PromiseTimer: Operation timed out")), e) ); return Promise.race([t, n]); } function FI(t) { return t == null; } function $O(t) { return /^\d+$/.test(t); } function GO(t, e = 500) { return t !== null && typeof t == "object" && Object.keys(t).forEach((n) => { typeof t[n] == "string" ? t[n].length > e && (t[n] = t[n].substring(0, e) + "...") : typeof t[n] == "object" && GO(t[n], e); }), t; } function _$() { return gt.platform() === "linux" ? { baseVersion: "3.2.12.28060", curVersion: "3.2.12.28060", prevVersion: "", onErrorVersions: [], buildId: "27254" } : gt.platform() === "darwin" ? { baseVersion: "6.9.53.28060", curVersion: "6.9.53.28060", prevVersion: "", onErrorVersions: [], buildId: "28060" } : { baseVersion: "9.9.15-28131", curVersion: "9.9.15-28131", prevVersion: "", onErrorVersions: [], buildId: "28131" }; } function E$(t = "", e) { if (process.env.NAPCAT_QQ_PACKAGE_INFO_PATH) return process.env.NAPCAT_QQ_PACKAGE_INFO_PATH; let n; return gt.platform() === "darwin" ? n = xe.join(xe.dirname(t), "..", "Resources", "app", "package.json") : gt.platform() === "linux" ? n = xe.join(xe.dirname(t), "./resources/app/package.json") : n = xe.join(xe.dirname(t), "./versions/" + e + "/resources/app/package.json"), fe.existsSync(n) || (n = xe.join(xe.dirname(t), "./resources/app/versions/" + e + "/package.json")), n; } function A$(t = "") { if (process.env.NAPCAT_QQ_VERSION_CONFIG_PATH) return process.env.NAPCAT_QQ_VERSION_CONFIG_PATH; let e; if (gt.platform() === "win32") e = xe.join(xe.dirname(t), "versions", "config.json"); else if (gt.platform() === "darwin") { const n = gt.homedir(), r = xe.resolve(n, "./Library/Application Support/QQ"); e = xe.resolve(r, "./versions/config.json"); } else { const n = gt.homedir(), r = xe.resolve(n, "./.config/QQ"); e = xe.resolve(r, "./versions/config.json"); } if (typeof e == "string" && (fe.existsSync(e) || (e = xe.join(xe.dirname(t), "./resources/app/versions/config.json")), !!fe.existsSync(e))) return e; } function SS(t) { if (!t) return 0; const { crownNum: e, sunNum: n, moonNum: r, starNum: i } = t; return e * 64 + n * 16 + r * 4 + i; } function td(t) { return JSON.stringify( t, (e, n) => typeof n == "bigint" ? n.toString() : n ); } function I$(t) { const e = Buffer.from("QQAppId/", "utf-8"), n = xe.resolve(t), r = fe.readFileSync(n); let i = 0; for (; ; ) { const o = r.indexOf(e, i); if (o === -1) break; const a = o + e.length, s = r.indexOf(0, a); if (s === -1) break; const u = r.subarray(a, s).toString("utf-8"); if (/^\d+$/.test(u)) return u; i = s + 1; } } function C$(t) { const n = Buffer.from("A4 09 00 00 00 35".replace(/ /g, ""), "hex"), r = xe.resolve(t), i = fe.readFileSync(r); let o = 0; for (; ; ) { const a = i.indexOf(n, o); if (a === -1) break; const s = a + n.length - 1, c = i.indexOf(0, s); if (c === -1) break; const u = i.subarray(s, c); if (!u.every((d) => d === 0)) try { return u.toString("utf-8"); } catch { break; } o = c + 1; } } async function qO(t) { return QO("NapNeko", "SnowCatQQ", t); } async function T$(t) { const { tags: e } = await qO(t); e.sort((r, i) => BO(r, i)); const n = e.at(-1); if (!n) throw new Error("No tags found"); return n.replace(/^v/, ""); } function Z2(t, e = 3e3) { return new Promise((n, r) => { const i = Date.now(); function o() { fe.existsSync(t) ? n() : Date.now() - i > e ? r(new Error(`文件不存在: ${t}`)) : setTimeout(o, 100); } o(); }); } async function k$(t, e = 3e3) { await Promise.race([ P$(t), N$(e, `文件不存在: ${t}`) ]); } function N$(t, e) { return new Promise((n, r) => { setTimeout(() => { r(new Error(e)); }, t); }); } async function P$(t) { try { await BL(t); } catch (e) { throw e.code === "ENOENT" ? new Error(`文件不存在: ${t}`) : e; } } function h0(t) { return new Promise((e, n) => { const r = fe.createReadStream(t), i = Ri.createHash("md5"); r.on("data", (o) => { i.update(o); }), r.on("end", () => { const o = i.digest("hex"); e(o); }), r.on("error", (o) => { n(o); }); }); } async function MI(t, e = !1) { let n, r, i = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" }; if (typeof t == "string" ? (n = t, i.Host = new URL(n).hostname) : (n = t.url, r = t.proxy, t.headers && (typeof t.headers == "string" ? i = JSON.parse(t.headers) : i = t.headers)), e && !i.Referer && (i.Referer = n), r) try { const a = await eE(n, i, r); return new Response(a, { status: 200, statusText: "OK" }); } catch (a) { console.error("代理下载失败,尝试直接下载:", a); } return await fetch(n, { headers: i, redirect: "follow" }).catch((a) => { throw a.cause ? a.cause : a; }); } function eE(t, e, n) { return new Promise((r, i) => { const o = new URL(t), a = new URL(n), s = o.protocol === "https:", c = parseInt(a.port) || (a.protocol === "https:" ? 443 : 80), u = a.username && a.password ? { "Proxy-Authorization": "Basic " + Buffer.from(`${decodeURIComponent(a.username)}:${decodeURIComponent(a.password)}`).toString("base64") } : {}; if (s) { const d = fp.request({ host: a.hostname, port: c, method: "CONNECT", path: `${o.hostname}:${o.port || 443}`, headers: { Host: `${o.hostname}:${o.port || 443}`, ...u } }); d.on("connect", (p, f) => { if (p.statusCode !== 200) { f.destroy(), i(new Error(`代理 CONNECT 失败: ${p.statusCode} ${p.statusMessage}`)); return; } const m = KL.connect({ socket: f, servername: o.hostname, rejectUnauthorized: !0 }, () => { const E = o.pathname + o.search, T = { ...e, Host: o.hostname, Connection: "close" }, U = Object.entries(T).map(([Y, H]) => `${Y}: ${H}`).join(`\r `), q = `GET ${E} HTTP/1.1\r ${U}\r \r `; m.write(q); }); let h = Buffer.alloc(0), y = !1, x = 0, g = !1, b = Buffer.alloc(0), S = null; m.on("data", (E) => { if (h = Buffer.concat([h, E]), y) b = Buffer.concat([b, E]); else { const T = h.indexOf(`\r \r `); if (T !== -1) { y = !0; const q = h.subarray(0, T).toString().split(`\r `), H = q[0]?.match(/HTTP\/\d\.\d\s+(\d+)/); x = H ? parseInt(H[1]) : 0; for (const G of q.slice(1)) { const [J, ...B] = G.split(":"), D = B.join(":").trim(); J?.toLowerCase() === "transfer-encoding" && D.toLowerCase() === "chunked" ? g = !0 : J?.toLowerCase() === "location" && (S = D); } b = h.subarray(T + 4); } } }), m.on("end", () => { if (x >= 300 && x < 400 && S) { const E = S.startsWith("http") ? S : `${o.protocol}//${o.host}${S}`; eE(E, e, n).then(r).catch(i); return; } if (x !== 200) { i(new Error(`下载失败: ${x}`)); return; } r(g ? D$(b) : b); }), m.on("error", (E) => { i(new Error(`TLS 连接错误: ${E.message}`)); }); }), d.on("error", (p) => { i(new Error(`代理连接错误: ${p.message}`)); }), d.end(); } else { const d = fp.request({ host: a.hostname, port: c, method: "GET", path: t, // 完整 URL headers: { ...e, Host: o.hostname, ...u } }, (p) => { O$(p, r, i, t, e, n); }); d.on("error", (p) => { i(new Error(`代理请求错误: ${p.message}`)); }), d.end(); } }); } function D$(t) { const e = []; let n = 0; for (; n < t.length; ) { const r = t.indexOf(`\r `, n); if (r === -1) break; const i = t.subarray(n, r).toString().split(";")[0], o = parseInt(i, 16); if (o === 0) break; const a = r + 2, s = a + o; if (s > t.length) break; e.push(t.subarray(a, s)), n = s + 2; } return Buffer.concat(e); } function O$(t, e, n, r, i, o) { if (t.statusCode && t.statusCode >= 300 && t.statusCode < 400 && t.headers.location) { eE(t.headers.location, i, o).then(e).catch(n); return; } if (t.statusCode !== 200) { n(new Error(`下载失败: ${t.statusCode} ${t.statusMessage}`)); return; } const a = []; t.on("data", (s) => a.push(s)), t.on("end", () => e(Buffer.concat(a))), t.on("error", n); } async function F$(t) { const e = typeof t == "string"; let n = await MI(t); if (n.status === 403 && e && (n = await MI(t, !0)), !n.ok) throw new Error(`下载文件失败: ${n.statusText}`); const i = await (await n.blob()).arrayBuffer(); return Buffer.from(i); } async function M$(t) { const e = await OI((r) => { if (fe.existsSync(xe.normalize(r))) return { Uri: xe.normalize(r), Type: 1 /* Local */ }; }, t); if (e) return e; const n = await OI((r) => { if (r.startsWith("http:") || r.startsWith("https:")) return { Uri: r, Type: 2 /* Remote */ }; if (r.startsWith("base64:")) return { Uri: r, Type: 3 /* Base64 */ }; if (r.startsWith("file:")) return { Uri: decodeURIComponent(r.startsWith("file:///") && process.platform === "win32" ? r.slice(8) : r.slice(7)), Type: 1 /* Local */ }; if (r.startsWith("data:")) { const i = r.split(",")[1]; if (i) return { Uri: i, Type: 3 /* Base64 */ }; } }, t); return n || { Uri: t, Type: 0 /* Unknown */ }; } async function $i(t, e, n = Xo(), r, i) { const { Uri: o, Type: a } = await M$(e), s = xe.join(t, n); switch (a) { case 1: { const c = xe.extname(o); return { success: !0, errMsg: "", fileName: xe.basename(o, c) + c, path: o, isLocal: !0 }; } case 2: { const c = await F$({ url: o, headers: r ?? {}, proxy: i }); return fe.writeFileSync(s, c), { success: !0, errMsg: "", fileName: n, path: s, isLocal: !1 }; } case 3: { const c = o.replace(/^base64:\/\//, ""), u = Buffer.from(c, "base64"); return fe.writeFileSync(s, u), { success: !0, errMsg: "", fileName: n, path: s, isLocal: !1 }; } default: return { success: !1, errMsg: `识别URL失败, uri= ${e}`, fileName: "", path: "", isLocal: !1 }; } } const RI = { appid: v(4, w.UINT32, !0), ttl: v(10, w.UINT32, !0) }; class R$ { context; core; rkeyManager; packetRkey; fetchRkeyFailures = 0; MAX_RKEY_FAILURES = 8; constructor(e, n) { this.context = e, this.core = n, this.rkeyManager = new e$( [ "http://ss.xingzhige.com/music_card/rkey", "https://secret-service.bietiaop.com/rkeys" ], this.context.logger ); } async fetchRkeyWithRetry() { if (this.fetchRkeyFailures >= this.MAX_RKEY_FAILURES) throw new Error("Native.FetchRkey 已被禁用"); try { const e = await this.core.apis.PacketApi.pkt.operation.FetchRkey(); return this.fetchRkeyFailures = 0, e; } catch (e) { throw this.fetchRkeyFailures++, this.context.logger.logError("FetchRkey 失败", e.message), e; } } async getFileUrl(e, n, r, i, o = 5e3) { if (this.core.apis.PacketApi.packetStatus) try { if (e === ke.KCHATTYPEGROUP && r) return this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+n, r, o); if (i && r) return this.core.apis.PacketApi.pkt.operation.GetPrivateFileUrl(n, r, i, o); } catch (a) { this.context.logger.logError("获取文件URL失败", a.message); } throw new Error("fileUUID or file10MMd5 is undefined"); } async getPttUrl(e, n, r = 5e3) { if (this.core.apis.PacketApi.packetStatus && n) { const i = new he(RI).decode(Buffer.from(n.replaceAll("-", "+").replaceAll("_", "/"), "base64")).appid; try { if (i && i === 1403) return this.core.apis.PacketApi.pkt.operation.GetGroupPttUrl(+e, { fileUuid: n, storeId: 1, uploadTime: 0, ttl: 0, subType: 0 }, r); if (n) return this.core.apis.PacketApi.pkt.operation.GetPttUrl(e, { fileUuid: n, storeId: 1, uploadTime: 0, ttl: 0, subType: 0 }, r); } catch (o) { this.context.logger.logError("获取文件URL失败", o.message); } } throw new Error("packet cant get ptt url"); } async getVideoUrlPacket(e, n, r = 5e3) { if (this.core.apis.PacketApi.packetStatus && n) { const i = new he(RI).decode(Buffer.from(n.replaceAll("-", "+").replaceAll("_", "/"), "base64")).appid; try { if (i && i === 1415) return this.core.apis.PacketApi.pkt.operation.GetGroupVideoUrl(+e, { fileUuid: n, storeId: 1, uploadTime: 0, ttl: 0, subType: 0 }, r); if (n) return this.core.apis.PacketApi.pkt.operation.GetVideoUrl(e, { fileUuid: n, storeId: 1, uploadTime: 0, ttl: 0, subType: 0 }, r); } catch (o) { this.context.logger.logError("获取文件URL失败", o.message); } } throw new Error("packet cant get video url"); } async copyFile(e, n) { await this.core.util.copyFile(e, n); } async getFileSize(e) { return await this.core.util.getFileSize(e); } async getVideoUrl(e, n, r) { return (await this.context.session.getRichMediaService().getVideoPlayUrlV2(e, n, r, 0, { downSourceType: 1, triggerType: 1 })).urlResult.domainUrl; } async uploadFile(e, n = Ee.PIC, r = 0, i = !0) { const o = await h0(e), a = await Jp(e).then((d) => d?.ext ?? "").catch(() => ""), s = a ? `.${a}` : ""; let c = `${ve.basename(e)}`; c.indexOf(".") === -1 && (c += s); const u = await this.getFileSize(e); if (i) { const d = this.context.session.getMsgService().getRichMediaFilePathForGuild({ md5HexStr: o, fileName: c, elementType: n, elementSubType: r, thumbSize: 0, needCreate: !0, downloadType: 1, file_uuid: "" }); return await this.copyFile(e, d), { md5: o, fileName: c, path: d, fileSize: u, ext: s }; } return { md5: o, fileName: c, path: e, fileSize: u, ext: s }; } async downloadFileForModelId(e, n, r, i = 1e3 * 60 * 2) { const [, o] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelRichMediaService/downloadFileForModelId", "NodeIKernelMsgListener/onRichMediaDownloadComplete", [e, [n], r], () => !0, (a) => a?.commonFileInfo?.fileModelId === n, 1, i ); return o.filePath; } async downloadRawMsgMedia(e) { const n = await Promise.all( e.map( (r) => Promise.all( r.elements.filter( (i) => i.elementType === Ee.PIC || i.elementType === Ee.VIDEO || i.elementType === Ee.PTT || i.elementType === Ee.FILE ).map( (i) => this.downloadMedia(r.msgId, r.chatType, r.peerUid, i.elementId, "", "", 12e4, !0) ) ) ) ); return e.forEach((r, i) => { const o = n[i]; let a = 0; r.elements.forEach((s) => { if (s.elementType === Ee.PIC || s.elementType === Ee.VIDEO || s.elementType === Ee.PTT || s.elementType === Ee.FILE) { switch (s.elementType) { case Ee.PIC: s.picElement.sourcePath = o?.[a] ?? ""; break; case Ee.VIDEO: s.videoElement.filePath = o?.[a] ?? ""; break; case Ee.PTT: s.pttElement.filePath = o?.[a] ?? ""; break; case Ee.FILE: s.fileElement.filePath = o?.[a] ?? ""; break; } a++; } }); }), n.flat(); } async downloadMedia(e, n, r, i, o, a, s = 1e3 * 60 * 2, c = !1) { if (a && fe.existsSync(a)) if (c) try { await Lt.unlink(a); } catch { } else return a; const [, u] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelMsgService/downloadRichMedia", "NodeIKernelMsgListener/onRichMediaDownloadComplete", [{ fileModelId: "0", downSourceType: 0, downloadSourceType: 0, triggerType: 1, msgId: e, chatType: n, peerUid: r, elementId: i, thumbSize: 0, downloadType: 1, filePath: o }], () => !0, (d) => d.msgElementId === i && d.msgId === e, 1, s ); return u.filePath; } async searchForFile(e) { const n = 1e5 + Math.floor(Math.random() * 1e4); let r = 0; const [, i] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelFileAssistantService/searchFile", "NodeIKernelFileAssistantListener/onFileSearch", [ e, { resultType: 2, pageLimit: 1 }, n ], (o) => (r = o, !0), (o) => o.searchId === r && o.resultId === n ); return i.resultItems[0]; } async downloadFileById(e, n = 1024576, r = n * 1e3 / 1024576 + 5e3) { const [, i] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelFileAssistantService/downloadFile", "NodeIKernelFileAssistantListener/onFileStatusChanged", [[e]], (o) => o.result === 0, (o) => o.fileStatus === 2 && o.fileProgress === "0", 1, r // estimate 1MB/s ); return i.filePath; } async getImageUrl(e) { if (!e) return ""; const n = e.originImageUrl ?? "", r = e.md5HexStr, i = e.md5HexStr, o = new URL(hy + n), a = o.searchParams.get("appid"), s = a && ["1406", "1407"].includes(a), c = o.searchParams.get("fileid"); if (n && s && c) { const u = await this.getRkeyData(); return this.getImageUrlFromParsedUrl(c, a, u); } return this.getImageUrlFromMd5(i, r); } async getRkeyData() { const e = { private_rkey: "CAQSKAB6JWENi5LM_xp9vumLbuThJSaYf-yzMrbZsuq7Uz2qEc3Rbib9LP4", group_rkey: "CAQSKAB6JWENi5LM_xp9vumLbuThJSaYf-yzMrbZsuq7Uz2qffcqm614gds", online_rkey: !1 }; try { if (this.core.apis.PacketApi.packetStatus) { const n = !this.packetRkey || this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1e3, r = !this.packetRkey || this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1e3; (n || r) && (this.packetRkey = await this.fetchRkeyWithRetry()), this.packetRkey && this.packetRkey.length > 0 && (e.group_rkey = this.packetRkey[1]?.rkey.slice(6) ?? "", e.private_rkey = this.packetRkey[0]?.rkey.slice(6) ?? "", e.online_rkey = !0); } } catch (n) { this.context.logger.logDebug("获取native.rkey失败", n.message); } if (!e.online_rkey) try { const n = await this.rkeyManager.getRkey(); e.group_rkey = n.group_rkey, e.private_rkey = n.private_rkey, e.online_rkey = n.expired_time > Date.now() / 1e3; } catch (n) { this.context.logger.logDebug("获取remote.rkey失败", n.message); } return e; } getImageUrlFromParsedUrl(e, n, r) { const i = n === "1406" ? r.private_rkey : r.group_rkey; return r.online_rkey ? QQ + `/download?appid=${n}&fileid=${e}&rkey=${i}` : hy + `/download?appid=${n}&fileid=${e}&rkey=${i}&spec=0`; } getImageUrlFromMd5(e, n) { return e || n ? `${hy}/gchatpic_new/0/0-0-${(e ?? n ?? "").toUpperCase()}/0` : (this.context.logger.logDebug("图片url获取失败", { fileMd5: e, md5HexStr: n }), ""); } } class Zm { keyToValue = /* @__PURE__ */ new Map(); valueToKey = /* @__PURE__ */ new Map(); maxSize; constructor(e) { this.maxSize = e; } resize(e) { this.maxSize = e; } set(e, n) { for (this.keyToValue.set(e, n), this.valueToKey.set(n, e); this.keyToValue.size !== this.valueToKey.size; ) this.keyToValue.clear(), this.valueToKey.clear(); for (; this.keyToValue.size > this.maxSize || this.valueToKey.size > this.maxSize; ) { const r = this.keyToValue.keys().next().value; r !== void 0 && (this.valueToKey.delete(this.keyToValue.get(r)), this.keyToValue.delete(r)); } } getValue(e) { return this.keyToValue.get(e); } getKey(e) { return this.valueToKey.get(e); } deleteByValue(e) { const n = this.valueToKey.get(e); n !== void 0 && (this.keyToValue.delete(n), this.valueToKey.delete(e)); } deleteByKey(e) { const n = this.keyToValue.get(e); n !== void 0 && (this.keyToValue.delete(e), this.valueToKey.delete(n)); } getKeyList() { return Array.from(this.keyToValue.keys()); } // 获取最近刚写入的几个值 getHeads(e) { const n = this.getKeyList(); if (n.length === 0) return; const r = [], i = Math.min(e, n.length); for (let o = 0; o < i; o++) { const a = n[i - o]; a !== void 0 && r.push({ key: a, value: this.keyToValue.get(a) }); } return r; } } class B$ { msgDataMap; msgIdMap; constructor(e = 5e3) { this.msgIdMap = new Zm(e), this.msgDataMap = new Zm(e); } getRecentMsgIds(e, n) { const r = this.msgIdMap.getHeads(n); return r ? r.map((a) => ot.getMsgIdAndPeerByShortId(a.value)).filter((a) => a?.Peer.chatType === e.chatType && a?.Peer.peerUid === e.peerUid).map((a) => a?.MsgId).filter((a) => a !== void 0) : []; } createUniqueMsgId(e, n) { const r = `${n}|${e.chatType}|${e.peerUid}`, i = Ri.createHash("md5").update(r).digest(); i[0] && (i[0] &= 127); const o = i.readInt32BE(0); return this.msgIdMap.set(n, o), this.msgDataMap.set(r, o), o; } getMsgIdAndPeerByShortId(e) { const n = this.msgDataMap.getKey(e); if (n) { const [r, i, o] = n.split("|"), a = { chatType: parseInt(i ?? "0"), peerUid: o ?? "", guildId: "" }; return { MsgId: r ?? "0", Peer: a }; } } getShortIdByMsgId(e) { return this.msgIdMap.getValue(e); } getPeerByMsgId(e) { const n = this.msgIdMap.getValue(e); if (n) return this.getMsgIdAndPeerByShortId(n); } resize(e) { this.msgIdMap.resize(e), this.msgDataMap.resize(e); } isShortId(e) { const n = Number(e); return Number.isInteger(n) && n >= -2147483648 && n <= 2147483647; } } const ot = new B$(); class U$ { context; core; constructor(e, n) { this.context = e, this.core = n; } async setBuddyRemark(e, n) { return this.context.session.getBuddyService().setBuddyRemark({ uid: e, remark: n }); } async getBuddyV2SimpleInfoMap() { const e = this.context.session.getBuddyService(); let n = []; return this.core.context.basicInfoWrapper.requireMinNTQQBuild("41679") ? n = (await e.getBuddyListV2("0", !0, gd.KNOMAL)).data.flatMap((i) => i.buddyUids) : n = (await e.getBuddyListV2("0", gd.KNOMAL)).data.flatMap((i) => i.buddyUids), await this.core.eventWrapper.callNoListenerEvent( "NodeIKernelProfileService/getCoreAndBaseInfo", "nodeStore", n ); } async getBuddy() { return Array.from((await this.getBuddyV2SimpleInfoMap()).values()); } async getBuddyIdMap() { const e = new Zm(5e3); return (await this.getBuddyV2SimpleInfoMap()).forEach((r) => e.set(r.uin, r.uid)), e; } async delBuddy(e, n = !1, r = !1) { return this.context.session.getBuddyService().delBuddy({ friendUid: e, tempBlock: n, tempBothDel: r }); } async getBuddyV2ExWithCate() { const e = this.context.session.getBuddyService(); let n = [], r; this.core.context.basicInfoWrapper.requireMinNTQQBuild("41679") ? (r = (await e.getBuddyListV2("0", !0, gd.KNOMAL)).data, n = r.flatMap((o) => o.buddyUids)) : (r = (await e.getBuddyListV2("0", gd.KNOMAL)).data, n = r.flatMap((o) => o.buddyUids)); const i = await this.core.eventWrapper.callNoListenerEvent( "NodeIKernelProfileService/getCoreAndBaseInfo", "nodeStore", n ); return r.map((o) => ({ categoryId: o.categoryId, categorySortId: o.categorySortId, categoryName: o.categroyName, categoryMbCount: o.categroyMbCount, onlineCount: o.onlineCount, buddyList: o.buddyUids.map((a) => i.get(a)).filter((a) => !!a) })); } async isBuddy(e) { return this.context.session.getBuddyService().isBuddy(e); } async clearBuddyReqUnreadCnt() { return this.context.session.getBuddyService().clearBuddyReqUnreadCnt(); } async getBuddyReq() { const [, e] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelBuddyService/getBuddyReq", "NodeIKernelBuddyListener/onBuddyReqChange", [] ); return e; } async handleFriendRequest(e, n) { this.context.session.getBuddyService()?.approvalFriendRequest({ friendUid: e.friendUid, reqTime: e.reqTime, accept: n }); } async handleDoubtFriendRequest(e, n = "", r = "") { this.context.session.getBuddyService().approvalDoubtBuddyReq(e, n, r); } async getDoubtFriendRequest(e) { const n = Date.now().toString(), [, r] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelBuddyService/getDoubtBuddyReq", "NodeIKernelBuddyListener/onDoubtBuddyReqChange", [n, e, ""], () => !0, (o) => o.reqId === n ); return Promise.all(r.doubtList.map(async (o) => ({ flag: o.uid, // 注意强制String 非isNumeric 不遵守则不符合设计 uin: await this.core.apis.UserApi.getUinByUidV2(o.uid) ?? 0, // 信息字段 nick: o.nick, // 信息字段 这个不是nickname 可能是来源的群内的昵称 source: o.source, // 信息字段 reason: o.reason, // 信息字段 msg: o.msg, // 信息字段 group_code: o.groupCode, // 信息字段 time: o.reqTime, // 信息字段 type: "doubt" // 保留字段 }))); } } class L$ { promise; cancelCallback = null; isCanceled = !1; cancelListeners = []; constructor(e) { this.promise = new Promise((n, r) => { const i = (a) => { this.cancelCallback = a; }; (async () => { try { await e( (a) => { this.isCanceled || n(a); }, (a) => { this.isCanceled || r(a); }, i ); } catch (a) { this.isCanceled || r(a); } })(); }); } cancel() { this.cancelCallback && this.cancelCallback(), this.isCanceled = !0, this.cancelListeners.forEach((e) => e()); } isTaskCanceled() { return this.isCanceled; } onCancel(e) { this.cancelListeners.push(e); } then(e, n) { return this.promise.then(e, n); } catch(e) { return this.promise.catch(e); } finally(e) { return this.promise.finally(e); } [Symbol.asyncIterator]() { return { next: () => this.promise.then((e) => ({ value: e, done: !0 })) }; } } const Q$ = 101711872, BI = 1, UI = 32768, LI = 65536, QI = 4; function jI(t, e, n) { const r = BigInt(n); return Number(BigInt(t) & ~r | BigInt(e) & r); } function j$(t, e) { let n = !1; if (e.memberInvite !== void 0) { const r = { disabled: 67108864, require_approval: 0, no_approval: 1048576, no_approval_under_100: 33554432 }; t.filter.allowMemberInvite = 1, t.modifyInfo.allowMemberInvite = e.memberInvite === "disabled" ? 0 : 1, t.filter.appPrivilegeFlag = 1, t.filter.appPrivilegeMask = 1, t.modifyInfo.appPrivilegeMask |= Q$, t.modifyInfo.appPrivilegeFlag |= r[e.memberInvite], n = !0; } return e.allowMemberUploadAlbum !== void 0 && (t.filter.appPrivilegeFlag = 1, t.filter.appPrivilegeMask = 1, t.modifyInfo.appPrivilegeMask |= BI, e.allowMemberUploadAlbum || (t.modifyInfo.appPrivilegeFlag |= BI), n = !0), e.allowMemberTemporarySession !== void 0 && (t.filter.appPrivilegeFlag = 1, t.filter.appPrivilegeMask = 1, t.modifyInfo.appPrivilegeMask |= LI, e.allowMemberTemporarySession || (t.modifyInfo.appPrivilegeFlag |= LI), n = !0), e.allowMemberCreateGroup !== void 0 && (t.filter.appPrivilegeFlag = 1, t.filter.appPrivilegeMask = 1, t.modifyInfo.appPrivilegeMask |= UI, e.allowMemberCreateGroup || (t.modifyInfo.appPrivilegeFlag |= UI), n = !0), e.newMembersSeeRecentHistory !== void 0 && (t.filter.groupFlagExt4 = 1, t.filter.groupFlagExt4Mask = 1, t.modifyInfo.groupFlagExt4Mask |= QI, e.newMembersSeeRecentHistory && (t.modifyInfo.groupFlagExt4 |= QI), n = !0), n; } function $$(t, e, n = 0, r = 0) { const i = [], o = [ { setting: "member_invite", value: { memberInvite: e.memberInvite }, operationType: 0 }, { setting: "new_members_see_recent_history", value: { newMembersSeeRecentHistory: e.newMembersSeeRecentHistory }, operationType: 0 }, { setting: "allow_member_upload_album", value: { allowMemberUploadAlbum: e.allowMemberUploadAlbum }, operationType: 8 }, { setting: "allow_member_temporary_session", value: { allowMemberTemporarySession: e.allowMemberTemporarySession }, operationType: 8 }, { setting: "allow_member_create_group", value: { allowMemberCreateGroup: e.allowMemberCreateGroup }, operationType: 8 } ]; let a = n, s = r; for (const c of o) { const u = _S(t); if (j$(u, c.value)) { if (u.filter.appPrivilegeFlag) { const d = jI( a, u.modifyInfo.appPrivilegeFlag, u.modifyInfo.appPrivilegeMask ); if (c.operationType === 8 && d === a) continue; a = d, u.modifyInfo.appPrivilegeFlag = a; } if (u.filter.groupFlagExt4) { const d = jI( s, u.modifyInfo.groupFlagExt4, u.modifyInfo.groupFlagExt4Mask ); if (d === s) continue; s = d, u.modifyInfo.groupFlagExt4 = s; } i.push({ setting: c.setting, param: u, operationType: c.operationType }); } } return i; } function _S(t) { return { groupCode: t, filter: { noCodeFingerOpenFlag: 0, noFingerOpenFlag: 0, groupName: 0, classExt: 0, classText: 0, fingerMemo: 0, richFingerMemo: 0, tagRecord: 0, groupGeoInfo: { ownerUid: 0, setTime: 0, cityId: 0, longitude: 0, latitude: 0, geoContent: 0, poiId: 0 }, groupExtAdminNum: 0, flag: 0, groupMemo: 0, groupAioSkinUrl: 0, groupBoardSkinUrl: 0, groupCoverSkinUrl: 0, groupGrade: 0, activeMemberNum: 0, certificationType: 0, certificationText: 0, groupNewGuideLines: { enabled: 0, content: 0 }, groupFace: 0, addOption: 0, shutUpTime: 0, groupTypeFlag: 0, appPrivilegeFlag: 0, appPrivilegeMask: 0, groupExtOnly: { tribeId: 0, moneyForAddGroup: 0 }, groupSecLevel: 0, groupSecLevelInfo: 0, subscriptionUin: 0, subscriptionUid: "", allowMemberInvite: 0, groupQuestion: 0, groupAnswer: 0, groupFlagExt3: 0, groupFlagExt3Mask: 0, groupOpenAppid: 0, rootId: 0, msgLimitFrequency: 0, hlGuildAppid: 0, hlGuildSubType: 0, hlGuildOrgId: 0, groupFlagExt4: 0, groupFlagExt4Mask: 0, groupSchoolInfo: { location: 0, grade: 0, school: 0 }, groupCardPrefix: { introduction: 0, rptPrefix: 0 }, allianceId: 0, groupFlagPro1: 0, groupFlagPro1Mask: 0 }, modifyInfo: { noCodeFingerOpenFlag: 0, noFingerOpenFlag: 0, groupName: "", classExt: 0, classText: "", fingerMemo: "", richFingerMemo: "", tagRecord: [], groupGeoInfo: { ownerUid: "", SetTime: 0, CityId: 0, Longitude: "", Latitude: "", GeoContent: "", poiId: "" }, groupExtAdminNum: 0, flag: 0, groupMemo: "", groupAioSkinUrl: "", groupBoardSkinUrl: "", groupCoverSkinUrl: "", groupGrade: 0, activeMemberNum: 0, certificationType: 0, certificationText: "", groupNewGuideLines: { enabled: !1, content: "" }, groupFace: 0, addOption: 0, shutUpTime: 0, groupTypeFlag: 0, appPrivilegeFlag: 0, appPrivilegeMask: 0, groupExtOnly: { tribeId: 0, moneyForAddGroup: 0 }, groupSecLevel: 0, groupSecLevelInfo: 0, subscriptionUin: "", subscriptionUid: "", allowMemberInvite: 0, groupQuestion: "", groupAnswer: "", groupFlagExt3: 0, groupFlagExt3Mask: 0, groupOpenAppid: 0, rootId: "", msgLimitFrequency: 0, hlGuildAppid: 0, hlGuildSubType: 0, hlGuildOrgId: 0, groupFlagExt4: 0, groupFlagExt4Mask: 0, groupSchoolInfo: { location: "", grade: 0, school: "" }, groupCardPrefix: { introduction: "", rptPrefix: [] }, allianceId: "", groupFlagPro1: 0, groupFlagPro1Mask: 0 } }; } function G$(t) { return { groupCode: t, resultCode: 0, extInfo: { groupInfoExtSeq: 0, reserve: 0, luckyWordId: "", lightCharNum: 0, luckyWord: "", starId: 0, essentialMsgSwitch: 0, todoSeq: 0, blacklistExpireTime: 0, isLimitGroupRtc: 0, companyId: 0, hasGroupCustomPortrait: 0, bindGuildId: "", groupOwnerId: { memberUin: "", memberUid: "", memberQid: "" }, essentialMsgPrivilege: 0, msgEventSeq: "", inviteRobotSwitch: 0, gangUpId: "", qqMusicMedalSwitch: 0, showPlayTogetherSwitch: 0, groupFlagPro1: "", groupBindGuildIds: { guildIds: [] }, viewedMsgDisappearTime: "", groupExtFlameData: { switchState: 0, state: 0, dayNums: [], version: 0, updateTime: "", isDisplayDayNum: !1 }, groupBindGuildSwitch: 0, groupAioBindGuildId: "", groupExcludeGuildIds: { guildIds: [] }, fullGroupExpansionSwitch: 0, fullGroupExpansionSeq: "", inviteRobotMemberSwitch: 0, inviteRobotMemberExamine: 0, groupSquareSwitch: 0 } }; } function q$() { return { groupInfoExtSeq: 0, reserve: 0, luckyWordId: 0, lightCharNum: 0, luckyWord: 0, starId: 0, essentialMsgSwitch: 0, todoSeq: 0, blacklistExpireTime: 0, isLimitGroupRtc: 0, companyId: 0, hasGroupCustomPortrait: 0, bindGuildId: 0, groupOwnerId: 0, essentialMsgPrivilege: 0, msgEventSeq: 0, inviteRobotSwitch: 0, gangUpId: 0, qqMusicMedalSwitch: 0, showPlayTogetherSwitch: 0, groupFlagPro1: 0, groupBindGuildIds: 0, viewedMsgDisappearTime: 0, groupExtFlameData: 0, groupBindGuildSwitch: 0, groupAioBindGuildId: 0, groupExcludeGuildIds: 0, fullGroupExpansionSwitch: 0, fullGroupExpansionSeq: 0, inviteRobotMemberSwitch: 0, inviteRobotMemberExamine: 0, groupSquareSwitch: 0 }; } class z$ { context; core; groupMemberCache = /* @__PURE__ */ new Map(); essenceLRU = new Zm(1e3); // psKey 滑动缓存,TTL 60 秒,惰性删除(不主动清理,等下次访问检测到过期再刷新) _qunPskeyCache = null; constructor(e, n) { this.context = e, this.core = n; } /** 获取 qun.qq.com 域名的 psKey,滑动 TTL 60 秒(每次访问顺延) */ async getQunPskey() { const e = Date.now(); if (this._qunPskeyCache && this._qunPskeyCache.expireAt > e) return this._qunPskeyCache.expireAt = e + 60 * 1e3, this._qunPskeyCache.value; const n = (await this.core.apis.UserApi.getPSkey(["qun.qq.com"])).domainPskeyMap.get("qun.qq.com"); return this._qunPskeyCache = { value: n, expireAt: e + 60 * 1e3 }, n; } async setGroupRemark(e, n) { return this.context.session.getGroupService().modifyGroupRemark(e, n); } async fetchGroupDetail(e) { const [, n] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelGroupService/getGroupDetailInfo", "NodeIKernelGroupListener/onGroupDetailInfoChange", [e, yO.KDATACARD], (r) => r.result === 0, (r) => r.groupCode === e, 1, 5e3 ); return n; } async initApi() { this.initCache().then().catch((e) => this.context.logger.logError(e)); } async createGrayTip(e, n) { return this.context.session.getMsgService().addLocalJsonGrayTipMsg( { chatType: ke.KCHATTYPEGROUP, peerUid: e }, { busiId: 2201, jsonStr: JSON.stringify({ align: "center", items: [{ txt: n, type: "nor" }] }), recentAbstract: n, isServer: !1 }, !0, !0 ); } async initCache() { for (const e of await this.getGroups(!0)) this.refreshGroupMemberCache(e.groupCode, !1).then().catch((n) => this.context.logger.logError(n)); } async fetchGroupEssenceList(e) { const n = await this.getQunPskey(); return this.context.session.getGroupService().fetchGroupEssenceList({ groupCode: e, pageStart: 0, pageLimit: 300 }, n); } async getGroupShutUpMemberList(e) { const n = async (i, o, a) => { this.core.eventWrapper.registerListen( "NodeIKernelGroupListener/onShutUpMemberListChanged", (s) => s === e, 1, 1e3 ).then((s) => { i(s[1]); }).catch(o), a(() => { o(new Error("Task was canceled")); }); }, r = new L$(n); return this.context.session.getGroupService().getGroupShutUpMemberList(e).then((i) => { i.result !== 0 && r.cancel(); }), await r.catch(() => []); } async clearGroupNotifiesUnreadCount(e) { return this.context.session.getGroupService().clearGroupNotifiesUnreadCount(e); } async setGroupAvatar(e, n) { return this.context.session.getGroupService().setHeader(e, n); } // 0 0 无需管理员审核 // 0 2 需要管理员审核 // 1 2 禁止Bot入群( 最好只传一个1 ?) async setGroupRobotAddOption(e, n, r) { const i = G$(e), o = q$(); return n !== void 0 && (i.extInfo.inviteRobotMemberSwitch = n, o.inviteRobotMemberSwitch = 1), r !== void 0 && (i.extInfo.inviteRobotMemberExamine = r, o.inviteRobotMemberExamine = 1), this.context.session.getGroupService().modifyGroupExtInfoV2(i, o); } async setGroupAddOption(e, n) { const r = _S(e); return r.filter.addOption = 1, (n.addOption === 4 || n.addOption === 5) && (r.filter.groupQuestion = 1, r.filter.groupAnswer = n.addOption === 4 ? 1 : 0, r.modifyInfo.groupQuestion = n.groupQuestion || "", r.modifyInfo.groupAnswer = n.addOption === 4 && n.groupAnswer || ""), r.modifyInfo.addOption = n.addOption, this.context.session.getGroupService().modifyGroupDetailInfoV2(r, 0); } async setGroupMemberInvitePolicy(e, n) { return this.modifyGroupManagementSettings(e, { memberInvite: n }); } async setGroupMemberPermissions(e, n) { return this.modifyGroupManagementSettings(e, n); } async setGroupNewMemberHistoryVisibility(e, n) { return this.modifyGroupManagementSettings(e, { newMembersSeeRecentHistory: n }); } async modifyGroupManagementSettings(e, n) { const r = [], o = n.memberInvite !== void 0 || n.allowMemberUploadAlbum !== void 0 || n.allowMemberTemporarySession !== void 0 || n.allowMemberCreateGroup !== void 0 || n.newMembersSeeRecentHistory !== void 0 ? await this.fetchGroupDetail(e) : void 0; for (const a of $$( e, n, o?.privilegeFlag, o?.groupFlagExt4 )) r.push({ setting: a.setting, result: await this.context.session.getGroupService().modifyGroupDetailInfoV2( a.param, a.operationType ) }); return r; } async setGroupSearch(e, n) { const r = _S(e); return n.noCodeFingerOpenFlag && (r.filter.noCodeFingerOpenFlag = 1, r.modifyInfo.noCodeFingerOpenFlag = n.noCodeFingerOpenFlag), n.noFingerOpenFlag && (r.filter.noFingerOpenFlag = 1, r.modifyInfo.noFingerOpenFlag = n.noFingerOpenFlag), this.context.session.getGroupService().modifyGroupDetailInfoV2(r, 0); } async getGroups(e = !1) { const [, , n] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelGroupService/getGroupList", "NodeIKernelGroupListener/onGroupListUpdate", [e] ); return n; } async getGroupExtFE0Info(e, n = !0) { return this.context.session.getGroupService().getGroupExt0xEF0Info( e, [], { bindGuildId: 1, blacklistExpireTime: 1, companyId: 1, essentialMsgPrivilege: 1, essentialMsgSwitch: 1, fullGroupExpansionSeq: 1, fullGroupExpansionSwitch: 1, gangUpId: 1, groupAioBindGuildId: 1, groupBindGuildIds: 1, groupBindGuildSwitch: 1, groupExcludeGuildIds: 1, groupExtFlameData: 1, groupFlagPro1: 1, groupInfoExtSeq: 1, groupOwnerId: 1, groupSquareSwitch: 1, hasGroupCustomPortrait: 1, inviteRobotMemberExamine: 1, inviteRobotMemberSwitch: 1, inviteRobotSwitch: 1, isLimitGroupRtc: 1, lightCharNum: 1, luckyWord: 1, luckyWordId: 1, msgEventSeq: 1, qqMusicMedalSwitch: 1, reserve: 1, showPlayTogetherSwitch: 1, starId: 1, todoSeq: 1, viewedMsgDisappearTime: 1 }, n ); } async getGroupMemberAll(e, n = !1) { return this.context.session.getGroupService().getAllMemberList(e, n); } async refreshGroupMemberCache(e, n = !0) { const r = async () => { try { const i = await this.getGroupMemberAll(e, !0); this.groupMemberCache.set(e, i.result.infos); } catch (i) { this.context.logger.logError(`刷新群成员缓存失败, 群号: ${e}, 错误: ${i}`); } }; return n ? await r() : r(), this.groupMemberCache.get(e); } async refreshGroupMemberCachePartial(e, n) { const r = await this.getGroupMemberEx(e, n, !0); return r && this.groupMemberCache.get(e)?.set(n, r), r; } async getGroupMember(e, n) { const r = e.toString(), i = n.toString(); let o = this.groupMemberCache.get(r); o || (o = await this.refreshGroupMemberCache(r, !0)); const a = () => $O(i) ? Array.from(o.values()).find((c) => c.uin === i) : o.get(i); let s = a(); return s || (o = await this.refreshGroupMemberCache(r, !0), s = a()), s; } async getGroupRecommendContactArkJson(e) { return this.context.session.getGroupService().getGroupRecommendContactArkJson(e); } async getJoinGroupLink(e, n = !0, r = 73, i = "") { return this.context.session.getGroupService().getJoinGroupLink({ groupCode: e, srcId: r, needShortUrl: n, additionalParam: i }); } async creatGroupFileFolder(e, n) { return this.context.session.getRichMediaService().createGroupFolder(e, n); } async delGroupFile(e, n) { return this.context.session.getRichMediaService().deleteGroupFile(e, [102], n); } async delGroupFileFolder(e, n) { return this.context.session.getRichMediaService().deleteGroupFolder(e, n); } async transGroupFile(e, n) { return this.context.session.getRichMediaService().transGroupFile(e, n); } async addGroupEssence(e, n) { const r = await this.context.session.getMsgService().getMsgsIncludeSelf({ chatType: 2, guildId: "", peerUid: e }, n, 1, !1); if (!r.msgList[0]) throw new Error("消息不存在"); const i = { groupCode: e, msgRandom: parseInt(r.msgList[0].msgRandom), msgSeq: parseInt(r.msgList[0].msgSeq) }; return this.context.session.getGroupService().addGroupEssence(i); } async kickMemberV2Inner(e) { return this.context.session.getGroupService().kickMemberV2(e); } async deleteGroupBulletin(e, n) { const r = await this.getQunPskey(); return this.context.session.getGroupService().deleteGroupBulletin(e, r, n); } async quitGroupV2(e, n) { const r = { groupCode: e, needDeleteLocalMsg: n }; return this.context.session.getGroupService().quitGroupV2(r); } async removeGroupEssenceBySeq(e, n, r) { const i = { groupCode: e, msgRandom: parseInt(n), msgSeq: parseInt(r) }; return this.context.session.getGroupService().removeGroupEssence(i); } async removeGroupEssence(e, n) { const r = await this.context.session.getMsgService().getMsgsIncludeSelf({ chatType: 2, guildId: "", peerUid: e }, n, 1, !1); if (!r.msgList[0]) throw new Error("消息不存在"); const i = { groupCode: e, msgRandom: parseInt(r.msgList[0].msgRandom), msgSeq: parseInt(r.msgList[0].msgSeq) }; return this.context.session.getGroupService().removeGroupEssence(i); } async getSingleScreenNotifies(e, n) { const [, , , r] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelGroupService/getSingleScreenNotifies", "NodeIKernelGroupListener/onGroupSingleScreenNotifies", [ e, "", n ] ); return r; } async searchGroup(e) { const [, n] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelSearchService/searchGroup", "NodeIKernelSearchListener/onSearchGroupResult", [{ keyWords: e, groupNum: 25, exactSearch: !1, penetrate: "" }], (r) => r.result === 0, (r) => !!r.groupInfos.find((i) => i.groupCode === e), 1, 5e3 ); return n.groupInfos.find((r) => r.groupCode === e); } async getGroupMemberEx(e, n, r = !1, i = 2) { const o = await jO((a, s, c, u = !1) => a.callNormalEventV2( "NodeIKernelGroupService/getMemberInfo", "NodeIKernelGroupListener/onMemberInfoChange", [e, [c], u], (d) => d.result === 0, (d, p, f) => d === s && f.size > 0 && f.has(c), 1, u ? 2500 : 250 ), this.core.eventWrapper, e, n, r); if (o && o[3] instanceof Map && o[3].has(n)) return o[3].get(n); if (i > 0) { const a = await this.getGroupMemberEx(e, n, !0, i - 1); if (a) return a; } } async getGroupFileCount(e) { return this.context.session.getRichMediaService().batchGetGroupFileCount(e); } // getGroupFileList also carries the group's used/total space in its call // result's `groupSpaceResult`; a single-item fetch is enough to read it. async getGroupFileSpace(e) { const [n] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelRichMediaService/getGroupFileList", "NodeIKernelMsgListener/onGroupFileInfoUpdate", [ e, { sortType: 1, fileCount: 1, startIndex: 0, sortOrder: 1, showOnlinedocFolder: 0 } ], () => !0, () => !0, 1, 5e3 ); return n?.groupSpaceResult; } async getArkJsonGroupShare(e) { return (await this.core.eventWrapper.callNoListenerEvent( "NodeIKernelGroupService/getGroupRecommendContactArkJson", e )).arkJson; } async uploadGroupBulletinPic(e, n) { const r = await this.getQunPskey(); return this.context.session.getGroupService().uploadGroupBulletinPic(e, r, n); } async handleGroupRequest(e, n, r, i) { return this.context.session.getGroupService().operateSysNotify( e, { operateType: r, targetMsg: { seq: n.seq, // 通知序列号 type: n.type, groupCode: n.group.groupCode, postscript: i ?? " " // 仅传空值可能导致处理失败,故默认给个空格 } } ); } async quitGroup(e) { return this.context.session.getGroupService().quitGroup(e); } async kickMember(e, n, r = !1, i = "") { return this.context.session.getGroupService().kickMember(e, n, r, i); } async banMember(e, n) { return this.context.session.getGroupService().setMemberShutUp(e, n); } async banGroup(e, n) { return this.context.session.getGroupService().setGroupShutUp(e, n); } async setMemberCard(e, n, r) { return this.context.session.getGroupService().modifyMemberCardName(e, n, r); } async setMemberRole(e, n, r) { return this.context.session.getGroupService().modifyMemberRole(e, n, r); } async setGroupName(e, n, r = !1) { return this.context.session.getGroupService().modifyGroupName(e, n, r); } async publishGroupBulletin(e, n, r = void 0, i = 0, o = 0) { const a = await this.getQunPskey(), s = { text: encodeURI(n), picInfo: r, oldFeedsId: "", pinned: i, confirmRequired: o }; return this.context.session.getGroupService().publishGroupBulletin(e, a, s); } async getGroupRemainAtTimes(e) { return this.context.session.getGroupService().getGroupRemainAtTimes(e); } async getMemberExtInfo(e, n) { return this.context.session.getGroupService().getMemberExtInfo( { groupCode: e, sourceType: vO.TITLETYPE, beginUin: "0", dataTime: "0", uinList: [n], uinNum: "", seq: "", groupType: "", richCardNameVer: "", memberExtFilter: { memberLevelInfoUin: 1, memberLevelInfoPoint: 1, memberLevelInfoActiveDay: 1, memberLevelInfoLevel: 1, memberLevelInfoName: 1, levelName: 1, dataTime: 1, userShowFlag: 1, sysShowFlag: 1, timeToUpdate: 1, nickName: 1, specialTitle: 1, levelNameNew: 1, userShowFlagNew: 1, msgNeedField: 1, cmdUinFlagExt3Grocery: 1, memberIcon: 1, memberInfoSeq: 1 } } ); } } class H$ { context; core; constructor(e, n) { this.context = e, this.core = n; } async clickInlineKeyboardButton(...e) { return this.context.session.getMsgService().clickInlineKeyboardButton(...e); } getMsgByClientSeqAndTime(e, n, r) { return this.context.session.getMsgService().getMsgByClientSeqAndTime(e, n, r); } async getAioFirstViewLatestMsgs(e, n) { return this.context.session.getMsgService().getAioFirstViewLatestMsgs(e, n); } async sendShowInputStatusReq(e, n) { return this.context.session.getMsgService().sendShowInputStatusReq(e.chatType, n, e.peerUid); } async getSourceOfReplyMsgV2(e, n, r) { return this.context.session.getMsgService().getSourceOfReplyMsgV2(e, n, r); } async getMsgEmojiLikesList(e, n, r, i, o = "", a = 20) { return this.context.session.getMsgService().getMsgEmojiLikesList(e, n, r, i, o, !1, a); } async setEmojiLike(e, n, r, i = !0) { return r = r.toString(), this.context.session.getMsgService().setMsgEmojiLikes(e, n, r, r.length > 3 ? "2" : "1", i); } async getMultiMsg(e, n, r) { return this.context.session.getMsgService().getMultiMsg(e, n, r); } async ForwardMsg(e, n) { return this.context.session.getMsgService().forwardMsg(n, e, [e], /* @__PURE__ */ new Map()); } async getMsgsByMsgId(e, n) { if (!e) throw new Error("peer is not allowed"); if (!n) throw new Error("msgIds is not allowed"); return await this.context.session.getMsgService().getMsgsByMsgId(e, n); } async getSingleMsg(e, n) { return await this.context.session.getMsgService().getSingleMsg(e, n); } async fetchFavEmojiList(e) { return this.context.session.getMsgService().fetchFavEmojiList("", e, !0, !0); } async addFavEmoji(e) { return this.context.session.getMsgService().addFavEmoji(e); } async deleteFavEmoji(e) { return this.context.session.getMsgService().deleteFavEmoji(e); } async modifyFavEmojiDesc(e) { return this.context.session.getMsgService().modifyFavEmojiDesc(e); } async queryMsgsWithFilterExWithSeq(e, n) { return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, { chatInfo: e, // searchFields: 3, filterMsgType: [], filterSendersUid: [], filterMsgToTime: "0", filterMsgFromTime: "0", isReverseOrder: !1, isIncludeCurrent: !0, pageLimit: 1 }); } async queryMsgsWithFilterExWithSeqV2(e, n, r, i) { return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, { chatInfo: e, filterMsgType: [], // searchFields: 3, filterSendersUid: i, filterMsgToTime: r, filterMsgFromTime: r, isReverseOrder: !1, isIncludeCurrent: !0, pageLimit: 1 }); } async queryMsgsWithFilterExWithSeqV3(e, n, r) { return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, { chatInfo: e, filterMsgType: [], filterSendersUid: r, filterMsgToTime: "0", filterMsgFromTime: "0", isReverseOrder: !1, // searchFields: 3, isIncludeCurrent: !0, pageLimit: 1 }); } async queryFirstMsgBySeq(e, n) { return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, { chatInfo: e, filterMsgType: [], filterSendersUid: [], filterMsgToTime: "0", // searchFields: 3, filterMsgFromTime: "0", isReverseOrder: !0, isIncludeCurrent: !0, pageLimit: 1 }); } // 客户端还在用别慌 async getMsgsBySeqAndCount(e, n, r, i, o) { return await this.context.session.getMsgService().getMsgsBySeqAndCount(e, n, r, i, o); } async getMsgExBySeq(e, n) { const r = Math.floor(Date.now() / 1e3), i = (r - 300).toString(), o = r.toString(); return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", n, { chatInfo: e, // 此处为Peer 为关键查询参数 没有啥也没有 by mlik iowa filterMsgType: [], filterSendersUid: [], // searchFields: 3, filterMsgToTime: o, filterMsgFromTime: i, isReverseOrder: !1, isIncludeCurrent: !0, pageLimit: 100 }); } async queryFirstMsgBySender(e, n) { return await this.context.session.getMsgService().queryMsgsWithFilterEx("0", "0", "0", { chatInfo: e, filterMsgType: [], filterSendersUid: n, // searchFields: 3, filterMsgToTime: "0", filterMsgFromTime: "0", isReverseOrder: !0, isIncludeCurrent: !0, pageLimit: 2e4 }); } async setMsgRead(e) { return this.context.session.getMsgService().setMsgRead(e); } async getGroupFileList(e, n) { const r = []; let i = n.startIndex; for (; ; ) { n.startIndex = i; const [, o] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelRichMediaService/getGroupFileList", "NodeIKernelMsgListener/onGroupFileInfoUpdate", [ e, n ], () => !0, () => !0, // 应当通过 groupFileListResult 判断 1, 5e3 ); if (!o?.item?.length || (r.push(...o.item), o.isEnd) || r.length === n.fileCount) break; i = o.nextIndex; } return r; } async getMsgHistory(e, n, r, i = !1) { return this.context.session.getMsgService().getMsgsIncludeSelf(e, n, r, i); } async recallMsg(e, n) { return await this.core.eventWrapper.callNormalEventV2( "NodeIKernelMsgService/recallMsg", "NodeIKernelMsgListener/onMsgInfoListUpdate", [e, [n]], () => !0, (r) => r.find((i) => i.msgId === n && i.recallTime !== "0") !== void 0, 1, 1e3 ); } async PrepareTempChat(e, n, r) { return this.context.session.getMsgService().prepareTempChat({ chatType: ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: e, peerNickname: r, fromGroupCode: n, sig: "", selfPhone: "", selfUid: this.core.selfInfo.uid, gameSession: { nickname: "", gameAppId: "", selfTinyId: "", peerRoleId: "", peerOpenId: "" } }); } async getTempChatInfo(e, n) { return this.context.session.getMsgService().getTempChatInfo(e, n); } async sendMsg(e, n, r = 1e4) { if (e.chatType === ke.KCHATTYPETEMPC2CFROMGROUP && e.guildId && e.guildId !== "") { const a = await this.core.apis.GroupApi.getGroupMember(e.guildId, e.peerUid); a && await this.PrepareTempChat(e.peerUid, e.guildId, a.nick); } const i = await this.generateMsgUniqueId(e.chatType); e.guildId = i; const [, o] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelMsgService/sendMsg", "NodeIKernelMsgListener/onMsgInfoListUpdate", [ "0", e, n, /* @__PURE__ */ new Map() ], (a) => a.result === 0, (a) => { for (const s of a) if (s.guildId === i && s.sendStatus === tp.KSEND_STATUS_SUCCESS) return !0; return !1; }, 1, r ); return o.find((a) => a.guildId === i); } async generateMsgUniqueId(e) { return this.context.session.getMsgService().generateMsgUniqueId(e, this.context.session.getMSFService().getServerTime()); } async forwardMsg(e, n, r) { return this.context.session.getMsgService().forwardMsg(r, e, [n], /* @__PURE__ */ new Map()); } async multiForwardMsg(e, n, r) { const i = r.map((a) => ({ msgId: a, senderShowName: this.core.selfInfo.nick })), [, o] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelMsgService/multiForwardMsgWithComment", "NodeIKernelMsgListener/onMsgInfoListUpdate", [ i, e, n, [], /* @__PURE__ */ new Map() ], () => !0, (a) => a.some( (s) => s.peerUid === n.peerUid && s.senderUid === this.core.selfInfo.uid ) ); for (const a of o) { const s = a.elements.find((u) => u.arkElement); if (!(!s || JSON.parse(s.arkElement?.bytesData ?? "").app !== "com.tencent.multimsg") && a.peerUid === n.peerUid && a.senderUid === this.core.selfInfo.uid) return a; } throw new Error("转发消息超时"); } async markAllMsgAsRead() { return this.context.session.getMsgService().setAllC2CAndGroupMsgRead(); } } class $I { handlers = []; checker; constructor(e) { this.checker = e || (async (n) => n); } add(e) { return this.handlers.push(e), this; } // 执行处理程序链 async run() { const e = []; for (const n of this.handlers) try { const r = await n(), i = await this.checker(r); if (i) return i; } catch (r) { e.push(r instanceof Error ? r : new Error(String(r))); } throw new AggregateError(e, "All handlers failed"); } } class GI { static boolchecker(e, n) { if (n) return e; throw new Error("Condition is false, throwing error"); } } class W$ { context; core; constructor(e, n) { this.context = e, this.core = n; } async getCoreAndBaseInfo(e) { return await this.core.eventWrapper.callNoListenerEvent( "NodeIKernelProfileService/getCoreAndBaseInfo", "nodeStore", e ); } // 默认获取自己的 type = 2 获取别人 type = 1 async getProfileLike(e, n, r, i = 2) { return this.context.session.getProfileLikeService().getBuddyProfileLike({ friendUids: [e], basic: 1, vote: 1, favorite: 0, userProfile: 1, type: i, start: n, limit: r }); } async setLongNick(e) { return this.context.session.getProfileService().setLongNick(e); } async setSelfOnlineStatus(e, n, r) { return this.context.session.getMsgService().setStatus({ status: e, extStatus: n, batteryStatus: r }); } async setDiySelfOnlineStatus(e, n, r) { return this.context.session.getMsgService().setStatus({ status: 10, extStatus: 2e3, customStatus: { faceId: e, wording: n, faceType: r }, batteryStatus: 0 }); } async getBuddyRecommendContactArkJson(e, n = "") { return this.context.session.getBuddyService().getBuddyRecommendContactArkJson(e, n); } async like(e, n = 1) { return this.context.session.getProfileLikeService().setBuddyProfileLike({ friendUid: e, sourceId: 71, doLikeCount: n, doLikeTollCount: 0 }); } async setQQAvatar(e) { const n = await this.context.session.getProfileService().setHeader(e); return { result: n?.result, errMsg: n?.errMsg }; } async setGroupAvatar(e, n) { return this.context.session.getGroupService().setHeader(e, n); } async fetchUserDetailInfo(e, n = yd.KDB) { const [, r] = await this.core.eventWrapper.callNormalEventV2( "NodeIKernelProfileService/fetchUserDetailInfo", "NodeIKernelProfileListener/onUserDetailInfoChanged", [ "BuddyProfileStore", [e], n, [gO.KALL] ], () => !0, (i) => i.uid === e ); return r; } async getUserDetailInfo(e, n = !1) { let r = await jO(async (i) => this.fetchUserDetailInfo(i, n ? yd.KSERVER : yd.KDB), e); return r && r.uin !== "0" && r.commonExt ? { ...r.simpleInfo.status, ...r.simpleInfo.vasInfo, ...r.commonExt, ...r.simpleInfo.baseInfo, ...r.simpleInfo.coreInfo, qqLevel: r.commonExt?.qqLevel, age: r.simpleInfo.baseInfo.age, pendantId: "", nick: r.simpleInfo.coreInfo.nick || "" } : (this.context.logger.logDebug("[SnowCat] [Mark] getUserDetailInfo Mode1 Failed."), r = await this.fetchUserDetailInfo(e, yd.KSERVER), r && r.uin === "0" && (r.uin = await this.core.apis.UserApi.getUidByUinV2(e) ?? "0"), { ...r.simpleInfo.status, ...r.simpleInfo.vasInfo, ...r.commonExt, ...r.simpleInfo.baseInfo, ...r.simpleInfo.coreInfo, qqLevel: r.commonExt?.qqLevel, age: r.simpleInfo.baseInfo.age, pendantId: "", nick: r.simpleInfo.coreInfo.nick || "" }); } async modifySelfProfile(e) { return this.context.session.getProfileService().modifyDesktopMiniProfile(e); } async getCookies(e) { const n = await this.forceFetchClientKey(), r = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + n.clientKey + "&u1=https%3A%2F%2F" + e + "%2F" + this.core.selfInfo.uin + "%2Finfocenter&keyindex=19%27", i = await ht.HttpsGetCookies(r); if (!i.p_skey || i.p_skey.length === 0) try { const o = (await this.getPSkey([e])).domainPskeyMap.get(e); o && (i.p_skey = o); } catch { return i; } return i; } async getPSkey(e) { return await this.context.session.getTipOffService().getPskey(e, !0); } async getRobotUinRange() { return (await this.context.session.getRobotService().getRobotUinRange({ justFetchMsgConfig: "1", type: 1, version: 0, aioKeywordVersion: 0 }))?.response?.robotUinRanges; } // 需要异常处理 async getQzoneCookies() { const e = await this.forceFetchClientKey(), n = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + e.clientKey + "&u1=https%3A%2F%2Fuser.qzone.qq.com%2F" + this.core.selfInfo.uin + "%2Finfocenter&keyindex=19%27"; return await ht.HttpsGetCookies(n); } // 需要异常处理 async getSKey() { const e = await this.forceFetchClientKey(); if (e.result !== 0) throw new Error("getClientKey Error"); const n = e.clientKey, r = "https://ssl.ptlogin2.qq.com/jump?ptlang=1033&clientuin=" + this.core.selfInfo.uin + "&clientkey=" + n + "&u1=https%3A%2F%2Fh5.qzone.qq.com%2Fqqnt%2Fqzoneinpcqq%2Ffriend%3Frefresh%3D0%26clientuin%3D0%26darkMode%3D0&keyindex=19%27", o = (await ht.HttpsGetCookies(r)).skey; if (!o) throw new Error("SKey is Empty"); return o; } async getUidByUinV2(e) { return e ? await new $I((i) => GI.boolchecker(i, i !== void 0 && i.indexOf("*") === -1 && i !== "")).add(() => this.context.session.getUixConvertService().getUid([e]).then((i) => i.uidInfo.get(e))).add(() => this.context.session.getProfileService().getUidByUin("FriendsServiceImpl", [e]).get(e)).add(() => this.context.session.getGroupService().getUidByUins([e]).then((i) => i.uids.get(e))).add(() => this.getUserDetailInfoByUin(e).then((i) => i.detail.uid)).run().catch(() => "") ?? "" : ""; } async getUinByUidV2(e) { return e ? await new $I((i) => GI.boolchecker(i, i !== void 0 && i !== "0" && i !== "")).add(() => this.context.session.getUixConvertService().getUin([e]).then((i) => i.uinInfo.get(e))).add(() => this.context.session.getProfileService().getUinByUid("FriendsServiceImpl", [e]).get(e)).add(() => this.context.session.getGroupService().getUinByUids([e]).then((i) => i.uins.get(e))).add(() => this.getUserDetailInfo(e).then((i) => i.uin)).run().catch(() => "0") ?? "0" : "0"; } async getRecentContactListSnapShot(e) { return await this.context.session.getRecentContactService().getRecentContactListSnapShot(e); } async getRecentContactListSyncLimit(e) { return await this.context.session.getRecentContactService().getRecentContactListSyncLimit(e); } async getRecentContactListSync() { return await this.context.session.getRecentContactService().getRecentContactListSync(); } async getRecentContactList() { return await this.context.session.getRecentContactService().getRecentContactList(); } async getUserDetailInfoByUin(e) { return await this.core.eventWrapper.callNoListenerEvent( "NodeIKernelProfileService/getUserDetailInfoByUin", e ); } async forceFetchClientKey() { return await this.context.session.getTicketService().forceFetchClientKey(""); } } function K$({ uin: t, group_id: e, pskey: n, pic_md5: r, img_size: i, img_name: o, sAlbumName: a, sAlbumID: s, photo_num: c = "1", video_num: u = "0", batch_num: d = "1" }) { const p = Math.floor(Date.now() / 1e3); return { control_req: [ { uin: t, token: { type: 4, data: n, appid: 5 }, appid: "qun", checksum: r, check_type: 0, file_len: i, env: { refer: "qzone", deviceInfo: "h5" }, model: 0, biz_req: { sPicTitle: o, sPicDesc: "", sAlbumName: a, sAlbumID: s, iAlbumTypeID: 0, iBitmap: 0, iUploadType: 0, iUpPicType: 0, iBatchID: p, sPicPath: "", iPicWidth: 0, iPicHight: 0, iWaterType: 0, iDistinctUse: 0, iNeedFeeds: 1, iUploadTime: p, mapExt: { appid: "qun", userid: e }, stExtendInfo: { mapParams: { photo_num: c, video_num: u, batch_num: d } } }, session: "", asy_upload: 0, cmd: "FileUpload" } ] }; } function V$(t, e, n) { return { cell_common: { time: "" }, cell_user_info: { user: { uin: t } }, cell_media: { album_id: e, batch_id: "", media_items: [{ image: { lloc: n } }] } }; } function Y$(t, e, n) { return { client_key: n, // 暂时只支持纯文本吧 content: [{ type: 0, content: e, who: 0, uid: "", name: "", url: "" }], user: { uin: t } }; } function J$(t, e, n, r) { return { cell_common: { time: Date.now(), feed_id: `422_0_${r}` // 需要补全feed_id }, cell_user_info: { user: { uin: e } }, cell_media: { album_id: n, batch_id: r }, cell_qun_info: { qun_id: t } }; } function X$(t) { const { uin: e, skey: n, pskey: r, g_tk: i, base64: o } = t, a = `http://upbak.photo.qzone.qq.com/cgi-bin/upload/cgi_upload_image,http://119.147.64.75/cgi-bin/upload/cgi_upload_image&url=https://up.qzone.qq.com/cgi-bin/upload/cgi_upload_image?g_tk=${i}`; return new URLSearchParams({ filename: "filename", uin: e, skey: n, zzpaneluin: e, p_uin: e, p_skey: r, uploadtype: "1", albumtype: "7", exttype: "0", refer: "shuoshuo", output_type: "jsonhtml", charset: "utf-8", output_charset: "utf-8", upload_hd: "1", hd_width: "2048", hd_height: "10000", hd_quality: "96", backUrls: a, base64: "1", jsonhtml_callback: "callback", picfile: o, qzreferrer: `https://user.qzone.qq.com/${e}/main` }).toString(); } function Z$(t) { const e = "frameElement.callback", n = "<\/script>", r = t.indexOf(e), i = t.indexOf(n); if (r === -1 || i === -1 || i <= r) throw new Error("QQ空间图片上传响应格式异常"); const o = t.slice(r + e.length, i), a = o.indexOf("("), s = o.lastIndexOf(")"); if (a === -1 || s === -1 || s <= a) throw new Error("QQ空间图片上传响应解析失败"); const c = o.slice(a + 1, s); try { return JSON.parse(c); } catch { throw new Error("QQ空间图片上传响应JSON解析失败"); } } function eG(t) { const { albumid: e, lloc: n, type: r, height: i, width: o } = t; return `,${e},${n},${n},${r},${i},${o},,${i},${o}`; } function qI(t) { const { hostuin: e, content: n, richval: r, ugcRight: i, allowUins: o } = t, a = { syn_tweet_verson: "1", paramstr: "1", con: n, feedversion: "1", ver: "1", ugc_right: String(i), to_sign: "0", hostuin: e, code_version: "1", format: "json", qzreferrer: `https://user.qzone.qq.com/${e}/main` }; return r && (a.richtype = "1", a.richval = r), o && (a.allow_uins = o, a.who = "1"), new URLSearchParams(a).toString(); } function tG(t) { const e = t.subcode ?? t.code; if (e !== void 0 && e !== 0) throw new Error(t.message || t.msg || `QQ空间发说说失败, subcode=${e}`); const n = t.t1_tid || t.tid; if (!n) throw new Error("QQ空间发说说失败, 未返回tid"); return { tid: n }; } function nG(t) { const { hostuin: e, tid: n } = t, r = { hostuin: e, tid: n, t1_source: "1", code_version: "1", format: "json", qzreferrer: `https://user.qzone.qq.com/${e}` }; return new URLSearchParams(r).toString(); } function rG(t) { const e = t.subcode ?? t.code; if (e !== void 0 && e !== 0) throw new Error(t.message || t.msg || `QQ空间删说说失败, subcode=${e}`); return { success: !0 }; } const iG = /* @__PURE__ */ new Uint16Array( // prettier-ignore /* @__PURE__ */ 'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((t) => t.charCodeAt(0)) ), oG = /* @__PURE__ */ new Uint16Array( // prettier-ignore /* @__PURE__ */ "Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((t) => t.charCodeAt(0)) ); var vy; const aG = /* @__PURE__ */ new Map([ [0, 65533], // C1 Unicode control character reference replacements [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376] ]), zI = ( // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins (vy = String.fromCodePoint) !== null && vy !== void 0 ? vy : function(t) { let e = ""; return t > 65535 && (t -= 65536, e += String.fromCharCode(t >>> 10 & 1023 | 55296), t = 56320 | t & 1023), e += String.fromCharCode(t), e; } ); function sG(t) { var e; return t >= 55296 && t <= 57343 || t > 1114111 ? 65533 : (e = aG.get(t)) !== null && e !== void 0 ? e : t; } var Xn; (function(t) { t[t.NUM = 35] = "NUM", t[t.SEMI = 59] = "SEMI", t[t.EQUALS = 61] = "EQUALS", t[t.ZERO = 48] = "ZERO", t[t.NINE = 57] = "NINE", t[t.LOWER_A = 97] = "LOWER_A", t[t.LOWER_F = 102] = "LOWER_F", t[t.LOWER_X = 120] = "LOWER_X", t[t.LOWER_Z = 122] = "LOWER_Z", t[t.UPPER_A = 65] = "UPPER_A", t[t.UPPER_F = 70] = "UPPER_F", t[t.UPPER_Z = 90] = "UPPER_Z"; })(Xn || (Xn = {})); const cG = 32; var ds; (function(t) { t[t.VALUE_LENGTH = 49152] = "VALUE_LENGTH", t[t.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", t[t.JUMP_TABLE = 127] = "JUMP_TABLE"; })(ds || (ds = {})); function ES(t) { return t >= Xn.ZERO && t <= Xn.NINE; } function uG(t) { return t >= Xn.UPPER_A && t <= Xn.UPPER_F || t >= Xn.LOWER_A && t <= Xn.LOWER_F; } function lG(t) { return t >= Xn.UPPER_A && t <= Xn.UPPER_Z || t >= Xn.LOWER_A && t <= Xn.LOWER_Z || ES(t); } function dG(t) { return t === Xn.EQUALS || lG(t); } var Hn; (function(t) { t[t.EntityStart = 0] = "EntityStart", t[t.NumericStart = 1] = "NumericStart", t[t.NumericDecimal = 2] = "NumericDecimal", t[t.NumericHex = 3] = "NumericHex", t[t.NamedEntity = 4] = "NamedEntity"; })(Hn || (Hn = {})); var zo; (function(t) { t[t.Legacy = 0] = "Legacy", t[t.Strict = 1] = "Strict", t[t.Attribute = 2] = "Attribute"; })(zo || (zo = {})); class pG { constructor(e, n, r) { this.decodeTree = e, this.emitCodePoint = n, this.errors = r, this.state = Hn.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = zo.Strict; } /** Resets the instance to make it reusable. */ startEntity(e) { this.decodeMode = e, this.state = Hn.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1; } /** * Write an entity to the decoder. This can be called multiple times with partial entities. * If the entity is incomplete, the decoder will return -1. * * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the * entity is incomplete, and resume when the next string is written. * * @param input The string containing the entity (or a continuation of the entity). * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ write(e, n) { switch (this.state) { case Hn.EntityStart: return e.charCodeAt(n) === Xn.NUM ? (this.state = Hn.NumericStart, this.consumed += 1, this.stateNumericStart(e, n + 1)) : (this.state = Hn.NamedEntity, this.stateNamedEntity(e, n)); case Hn.NumericStart: return this.stateNumericStart(e, n); case Hn.NumericDecimal: return this.stateNumericDecimal(e, n); case Hn.NumericHex: return this.stateNumericHex(e, n); case Hn.NamedEntity: return this.stateNamedEntity(e, n); } } /** * Switches between the numeric decimal and hexadecimal states. * * Equivalent to the `Numeric character reference state` in the HTML spec. * * @param input The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ stateNumericStart(e, n) { return n >= e.length ? -1 : (e.charCodeAt(n) | cG) === Xn.LOWER_X ? (this.state = Hn.NumericHex, this.consumed += 1, this.stateNumericHex(e, n + 1)) : (this.state = Hn.NumericDecimal, this.stateNumericDecimal(e, n)); } addToNumericResult(e, n, r, i) { if (n !== r) { const o = r - n; this.result = this.result * Math.pow(i, o) + Number.parseInt(e.substr(n, o), i), this.consumed += o; } } /** * Parses a hexadecimal numeric entity. * * Equivalent to the `Hexademical character reference state` in the HTML spec. * * @param input The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ stateNumericHex(e, n) { const r = n; for (; n < e.length; ) { const i = e.charCodeAt(n); if (ES(i) || uG(i)) n += 1; else return this.addToNumericResult(e, r, n, 16), this.emitNumericEntity(i, 3); } return this.addToNumericResult(e, r, n, 16), -1; } /** * Parses a decimal numeric entity. * * Equivalent to the `Decimal character reference state` in the HTML spec. * * @param input The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ stateNumericDecimal(e, n) { const r = n; for (; n < e.length; ) { const i = e.charCodeAt(n); if (ES(i)) n += 1; else return this.addToNumericResult(e, r, n, 10), this.emitNumericEntity(i, 2); } return this.addToNumericResult(e, r, n, 10), -1; } /** * Validate and emit a numeric entity. * * Implements the logic from the `Hexademical character reference start * state` and `Numeric character reference end state` in the HTML spec. * * @param lastCp The last code point of the entity. Used to see if the * entity was terminated with a semicolon. * @param expectedLength The minimum number of characters that should be * consumed. Used to validate that at least one digit * was consumed. * @returns The number of characters that were consumed. */ emitNumericEntity(e, n) { var r; if (this.consumed <= n) return (r = this.errors) === null || r === void 0 || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0; if (e === Xn.SEMI) this.consumed += 1; else if (this.decodeMode === zo.Strict) return 0; return this.emitCodePoint(sG(this.result), this.consumed), this.errors && (e !== Xn.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed; } /** * Parses a named entity. * * Equivalent to the `Named character reference state` in the HTML spec. * * @param input The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ stateNamedEntity(e, n) { const { decodeTree: r } = this; let i = r[this.treeIndex], o = (i & ds.VALUE_LENGTH) >> 14; for (; n < e.length; n++, this.excess++) { const a = e.charCodeAt(n); if (this.treeIndex = fG(r, i, this.treeIndex + Math.max(1, o), a), this.treeIndex < 0) return this.result === 0 || // If we are parsing an attribute this.decodeMode === zo.Attribute && // We shouldn't have consumed any characters after the entity, (o === 0 || // And there should be no invalid characters. dG(a)) ? 0 : this.emitNotTerminatedNamedEntity(); if (i = r[this.treeIndex], o = (i & ds.VALUE_LENGTH) >> 14, o !== 0) { if (a === Xn.SEMI) return this.emitNamedEntityData(this.treeIndex, o, this.consumed + this.excess); this.decodeMode !== zo.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0); } } return -1; } /** * Emit a named entity that was not terminated with a semicolon. * * @returns The number of characters consumed. */ emitNotTerminatedNamedEntity() { var e; const { result: n, decodeTree: r } = this, i = (r[n] & ds.VALUE_LENGTH) >> 14; return this.emitNamedEntityData(n, i, this.consumed), (e = this.errors) === null || e === void 0 || e.missingSemicolonAfterCharacterReference(), this.consumed; } /** * Emit a named entity. * * @param result The index of the entity in the decode tree. * @param valueLength The number of bytes in the entity. * @param consumed The number of characters consumed. * * @returns The number of characters consumed. */ emitNamedEntityData(e, n, r) { const { decodeTree: i } = this; return this.emitCodePoint(n === 1 ? i[e] & ~ds.VALUE_LENGTH : i[e + 1], r), n === 3 && this.emitCodePoint(i[e + 2], r), r; } /** * Signal to the parser that the end of the input was reached. * * Remaining data will be emitted and relevant errors will be produced. * * @returns The number of characters consumed. */ end() { var e; switch (this.state) { case Hn.NamedEntity: return this.result !== 0 && (this.decodeMode !== zo.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; // Otherwise, emit a numeric entity if we have one. case Hn.NumericDecimal: return this.emitNumericEntity(0, 2); case Hn.NumericHex: return this.emitNumericEntity(0, 3); case Hn.NumericStart: return (e = this.errors) === null || e === void 0 || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0; case Hn.EntityStart: return 0; } } } function fG(t, e, n, r) { const i = (e & ds.BRANCH_LENGTH) >> 7, o = e & ds.JUMP_TABLE; if (i === 0) return o !== 0 && r === o ? n : -1; if (o) { const c = r - o; return c < 0 || c >= i ? -1 : t[n + c] - 1; } let a = n, s = a + i - 1; for (; a <= s; ) { const c = a + s >>> 1, u = t[c]; if (u < r) a = c + 1; else if (u > r) s = c - 1; else return t[c + i]; } return -1; } var Ze; (function(t) { t[t.Tab = 9] = "Tab", t[t.NewLine = 10] = "NewLine", t[t.FormFeed = 12] = "FormFeed", t[t.CarriageReturn = 13] = "CarriageReturn", t[t.Space = 32] = "Space", t[t.ExclamationMark = 33] = "ExclamationMark", t[t.Number = 35] = "Number", t[t.Amp = 38] = "Amp", t[t.SingleQuote = 39] = "SingleQuote", t[t.DoubleQuote = 34] = "DoubleQuote", t[t.Dash = 45] = "Dash", t[t.Slash = 47] = "Slash", t[t.Zero = 48] = "Zero", t[t.Nine = 57] = "Nine", t[t.Semi = 59] = "Semi", t[t.Lt = 60] = "Lt", t[t.Eq = 61] = "Eq", t[t.Gt = 62] = "Gt", t[t.Questionmark = 63] = "Questionmark", t[t.UpperA = 65] = "UpperA", t[t.LowerA = 97] = "LowerA", t[t.UpperF = 70] = "UpperF", t[t.LowerF = 102] = "LowerF", t[t.UpperZ = 90] = "UpperZ", t[t.LowerZ = 122] = "LowerZ", t[t.LowerX = 120] = "LowerX", t[t.OpeningSquareBracket = 91] = "OpeningSquareBracket"; })(Ze || (Ze = {})); var Se; (function(t) { t[t.Text = 1] = "Text", t[t.BeforeTagName = 2] = "BeforeTagName", t[t.InTagName = 3] = "InTagName", t[t.InSelfClosingTag = 4] = "InSelfClosingTag", t[t.BeforeClosingTagName = 5] = "BeforeClosingTagName", t[t.InClosingTagName = 6] = "InClosingTagName", t[t.AfterClosingTagName = 7] = "AfterClosingTagName", t[t.BeforeAttributeName = 8] = "BeforeAttributeName", t[t.InAttributeName = 9] = "InAttributeName", t[t.AfterAttributeName = 10] = "AfterAttributeName", t[t.BeforeAttributeValue = 11] = "BeforeAttributeValue", t[t.InAttributeValueDq = 12] = "InAttributeValueDq", t[t.InAttributeValueSq = 13] = "InAttributeValueSq", t[t.InAttributeValueNq = 14] = "InAttributeValueNq", t[t.BeforeDeclaration = 15] = "BeforeDeclaration", t[t.InDeclaration = 16] = "InDeclaration", t[t.InProcessingInstruction = 17] = "InProcessingInstruction", t[t.BeforeComment = 18] = "BeforeComment", t[t.CDATASequence = 19] = "CDATASequence", t[t.InSpecialComment = 20] = "InSpecialComment", t[t.InCommentLike = 21] = "InCommentLike", t[t.BeforeSpecialS = 22] = "BeforeSpecialS", t[t.BeforeSpecialT = 23] = "BeforeSpecialT", t[t.SpecialStartSequence = 24] = "SpecialStartSequence", t[t.InSpecialTag = 25] = "InSpecialTag", t[t.InEntity = 26] = "InEntity"; })(Se || (Se = {})); function ma(t) { return t === Ze.Space || t === Ze.NewLine || t === Ze.Tab || t === Ze.FormFeed || t === Ze.CarriageReturn; } function sh(t) { return t === Ze.Slash || t === Ze.Gt || ma(t); } function hG(t) { return t >= Ze.LowerA && t <= Ze.LowerZ || t >= Ze.UpperA && t <= Ze.UpperZ; } var Ho; (function(t) { t[t.NoValue = 0] = "NoValue", t[t.Unquoted = 1] = "Unquoted", t[t.Single = 2] = "Single", t[t.Double = 3] = "Double"; })(Ho || (Ho = {})); const Sn = { Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]), // CDATA[ CdataEnd: new Uint8Array([93, 93, 62]), // ]]> CommentEnd: new Uint8Array([45, 45, 62]), // `-->` ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]), // `<\/script` StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]), // ` this.emitCodePoint(i, o)); } reset() { this.state = Se.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = Se.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0; } write(e) { this.offset += this.buffer.length, this.buffer = e, this.parse(); } end() { this.running && this.finish(); } pause() { this.running = !1; } resume() { this.running = !0, this.index < this.buffer.length + this.offset && this.parse(); } stateText(e) { e === Ze.Lt || !this.decodeEntities && this.fastForwardTo(Ze.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = Se.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && e === Ze.Amp && this.startEntity(); } stateSpecialStartSequence(e) { const n = this.sequenceIndex === this.currentSequence.length; if (!(n ? ( // If we are at the end of the sequence, make sure the tag name has ended sh(e) ) : ( // Otherwise, do a case-insensitive comparison (e | 32) === this.currentSequence[this.sequenceIndex] ))) this.isSpecial = !1; else if (!n) { this.sequenceIndex++; return; } this.sequenceIndex = 0, this.state = Se.InTagName, this.stateInTagName(e); } /** Look for an end tag. For tags, also decode entities. */ stateInSpecialTag(e) { if (this.sequenceIndex === this.currentSequence.length) { if (e === Ze.Gt || ma(e)) { const n = this.index - this.currentSequence.length; if (this.sectionStart < n) { const r = this.index; this.index = n, this.cbs.ontext(this.sectionStart, n), this.index = r; } this.isSpecial = !1, this.sectionStart = n + 2, this.stateInClosingTagName(e); return; } this.sequenceIndex = 0; } (e | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === Sn.TitleEnd ? this.decodeEntities && e === Ze.Amp && this.startEntity() : this.fastForwardTo(Ze.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(e === Ze.Lt); } stateCDATASequence(e) { e === Sn.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === Sn.Cdata.length && (this.state = Se.InCommentLike, this.currentSequence = Sn.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = Se.InDeclaration, this.stateInDeclaration(e)); } /** * When we wait for one specific character, we can speed things up * by skipping through the buffer until we find it. * * @returns Whether the character was found. */ fastForwardTo(e) { for (; ++this.index < this.buffer.length + this.offset; ) if (this.buffer.charCodeAt(this.index - this.offset) === e) return !0; return this.index = this.buffer.length + this.offset - 1, !1; } /** * Comments and CDATA end with `-->` and `]]>`. * * Their common qualities are: * - Their end sequences have a distinct character they start with. * - That character is then repeated, so we have to check multiple repeats. * - All characters but the start character of the sequence can be skipped. */ stateInCommentLike(e) { e === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === Sn.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = Se.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : e !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0); } /** * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. * * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). * We allow anything that wouldn't end the tag. */ isTagStartChar(e) { return this.xmlMode ? !sh(e) : hG(e); } startSpecial(e, n) { this.isSpecial = !0, this.currentSequence = e, this.sequenceIndex = n, this.state = Se.SpecialStartSequence; } stateBeforeTagName(e) { if (e === Ze.ExclamationMark) this.state = Se.BeforeDeclaration, this.sectionStart = this.index + 1; else if (e === Ze.Questionmark) this.state = Se.InProcessingInstruction, this.sectionStart = this.index + 1; else if (this.isTagStartChar(e)) { const n = e | 32; this.sectionStart = this.index, this.xmlMode ? this.state = Se.InTagName : n === Sn.ScriptEnd[2] ? this.state = Se.BeforeSpecialS : n === Sn.TitleEnd[2] || n === Sn.XmpEnd[2] ? this.state = Se.BeforeSpecialT : this.state = Se.InTagName; } else e === Ze.Slash ? this.state = Se.BeforeClosingTagName : (this.state = Se.Text, this.stateText(e)); } stateInTagName(e) { sh(e) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = Se.BeforeAttributeName, this.stateBeforeAttributeName(e)); } stateBeforeClosingTagName(e) { ma(e) || (e === Ze.Gt ? this.state = Se.Text : (this.state = this.isTagStartChar(e) ? Se.InClosingTagName : Se.InSpecialComment, this.sectionStart = this.index)); } stateInClosingTagName(e) { (e === Ze.Gt || ma(e)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = Se.AfterClosingTagName, this.stateAfterClosingTagName(e)); } stateAfterClosingTagName(e) { (e === Ze.Gt || this.fastForwardTo(Ze.Gt)) && (this.state = Se.Text, this.sectionStart = this.index + 1); } stateBeforeAttributeName(e) { e === Ze.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = Se.InSpecialTag, this.sequenceIndex = 0) : this.state = Se.Text, this.sectionStart = this.index + 1) : e === Ze.Slash ? this.state = Se.InSelfClosingTag : ma(e) || (this.state = Se.InAttributeName, this.sectionStart = this.index); } stateInSelfClosingTag(e) { e === Ze.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = Se.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : ma(e) || (this.state = Se.BeforeAttributeName, this.stateBeforeAttributeName(e)); } stateInAttributeName(e) { (e === Ze.Eq || sh(e)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = Se.AfterAttributeName, this.stateAfterAttributeName(e)); } stateAfterAttributeName(e) { e === Ze.Eq ? this.state = Se.BeforeAttributeValue : e === Ze.Slash || e === Ze.Gt ? (this.cbs.onattribend(Ho.NoValue, this.sectionStart), this.sectionStart = -1, this.state = Se.BeforeAttributeName, this.stateBeforeAttributeName(e)) : ma(e) || (this.cbs.onattribend(Ho.NoValue, this.sectionStart), this.state = Se.InAttributeName, this.sectionStart = this.index); } stateBeforeAttributeValue(e) { e === Ze.DoubleQuote ? (this.state = Se.InAttributeValueDq, this.sectionStart = this.index + 1) : e === Ze.SingleQuote ? (this.state = Se.InAttributeValueSq, this.sectionStart = this.index + 1) : ma(e) || (this.sectionStart = this.index, this.state = Se.InAttributeValueNq, this.stateInAttributeValueNoQuotes(e)); } handleInAttributeValue(e, n) { e === n || !this.decodeEntities && this.fastForwardTo(n) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(n === Ze.DoubleQuote ? Ho.Double : Ho.Single, this.index + 1), this.state = Se.BeforeAttributeName) : this.decodeEntities && e === Ze.Amp && this.startEntity(); } stateInAttributeValueDoubleQuotes(e) { this.handleInAttributeValue(e, Ze.DoubleQuote); } stateInAttributeValueSingleQuotes(e) { this.handleInAttributeValue(e, Ze.SingleQuote); } stateInAttributeValueNoQuotes(e) { ma(e) || e === Ze.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(Ho.Unquoted, this.index), this.state = Se.BeforeAttributeName, this.stateBeforeAttributeName(e)) : this.decodeEntities && e === Ze.Amp && this.startEntity(); } stateBeforeDeclaration(e) { e === Ze.OpeningSquareBracket ? (this.state = Se.CDATASequence, this.sequenceIndex = 0) : this.state = e === Ze.Dash ? Se.BeforeComment : Se.InDeclaration; } stateInDeclaration(e) { (e === Ze.Gt || this.fastForwardTo(Ze.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = Se.Text, this.sectionStart = this.index + 1); } stateInProcessingInstruction(e) { (e === Ze.Gt || this.fastForwardTo(Ze.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = Se.Text, this.sectionStart = this.index + 1); } stateBeforeComment(e) { e === Ze.Dash ? (this.state = Se.InCommentLike, this.currentSequence = Sn.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = Se.InDeclaration; } stateInSpecialComment(e) { (e === Ze.Gt || this.fastForwardTo(Ze.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = Se.Text, this.sectionStart = this.index + 1); } stateBeforeSpecialS(e) { const n = e | 32; n === Sn.ScriptEnd[3] ? this.startSpecial(Sn.ScriptEnd, 4) : n === Sn.StyleEnd[3] ? this.startSpecial(Sn.StyleEnd, 4) : (this.state = Se.InTagName, this.stateInTagName(e)); } stateBeforeSpecialT(e) { switch (e | 32) { case Sn.TitleEnd[3]: { this.startSpecial(Sn.TitleEnd, 4); break; } case Sn.TextareaEnd[3]: { this.startSpecial(Sn.TextareaEnd, 4); break; } case Sn.XmpEnd[3]: { this.startSpecial(Sn.XmpEnd, 4); break; } default: this.state = Se.InTagName, this.stateInTagName(e); } } startEntity() { this.baseState = this.state, this.state = Se.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? zo.Strict : this.baseState === Se.Text || this.baseState === Se.InSpecialTag ? zo.Legacy : zo.Attribute); } stateInEntity() { const e = this.entityDecoder.write(this.buffer, this.index - this.offset); e >= 0 ? (this.state = this.baseState, e === 0 && (this.index = this.entityStart)) : this.index = this.offset + this.buffer.length - 1; } /** * Remove data that has already been consumed from the buffer. */ cleanup() { this.running && this.sectionStart !== this.index && (this.state === Se.Text || this.state === Se.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === Se.InAttributeValueDq || this.state === Se.InAttributeValueSq || this.state === Se.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index)); } shouldContinue() { return this.index < this.buffer.length + this.offset && this.running; } /** * Iterates through the buffer, calling the function corresponding to the current state. * * States that are more likely to be hit are higher up, as a performance improvement. */ parse() { for (; this.shouldContinue(); ) { const e = this.buffer.charCodeAt(this.index - this.offset); switch (this.state) { case Se.Text: { this.stateText(e); break; } case Se.SpecialStartSequence: { this.stateSpecialStartSequence(e); break; } case Se.InSpecialTag: { this.stateInSpecialTag(e); break; } case Se.CDATASequence: { this.stateCDATASequence(e); break; } case Se.InAttributeValueDq: { this.stateInAttributeValueDoubleQuotes(e); break; } case Se.InAttributeName: { this.stateInAttributeName(e); break; } case Se.InCommentLike: { this.stateInCommentLike(e); break; } case Se.InSpecialComment: { this.stateInSpecialComment(e); break; } case Se.BeforeAttributeName: { this.stateBeforeAttributeName(e); break; } case Se.InTagName: { this.stateInTagName(e); break; } case Se.InClosingTagName: { this.stateInClosingTagName(e); break; } case Se.BeforeTagName: { this.stateBeforeTagName(e); break; } case Se.AfterAttributeName: { this.stateAfterAttributeName(e); break; } case Se.InAttributeValueSq: { this.stateInAttributeValueSingleQuotes(e); break; } case Se.BeforeAttributeValue: { this.stateBeforeAttributeValue(e); break; } case Se.BeforeClosingTagName: { this.stateBeforeClosingTagName(e); break; } case Se.AfterClosingTagName: { this.stateAfterClosingTagName(e); break; } case Se.BeforeSpecialS: { this.stateBeforeSpecialS(e); break; } case Se.BeforeSpecialT: { this.stateBeforeSpecialT(e); break; } case Se.InAttributeValueNq: { this.stateInAttributeValueNoQuotes(e); break; } case Se.InSelfClosingTag: { this.stateInSelfClosingTag(e); break; } case Se.InDeclaration: { this.stateInDeclaration(e); break; } case Se.BeforeDeclaration: { this.stateBeforeDeclaration(e); break; } case Se.BeforeComment: { this.stateBeforeComment(e); break; } case Se.InProcessingInstruction: { this.stateInProcessingInstruction(e); break; } case Se.InEntity: { this.stateInEntity(); break; } } this.index++; } this.cleanup(); } finish() { this.state === Se.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend(); } /** Handle any trailing data. */ handleTrailingData() { const e = this.buffer.length + this.offset; this.sectionStart >= e || (this.state === Se.InCommentLike ? this.currentSequence === Sn.CdataEnd ? this.cbs.oncdata(this.sectionStart, e, 0) : this.cbs.oncomment(this.sectionStart, e, 0) : this.state === Se.InTagName || this.state === Se.BeforeAttributeName || this.state === Se.BeforeAttributeValue || this.state === Se.AfterAttributeName || this.state === Se.InAttributeName || this.state === Se.InAttributeValueSq || this.state === Se.InAttributeValueDq || this.state === Se.InAttributeValueNq || this.state === Se.InClosingTagName || this.cbs.ontext(this.sectionStart, e)); } emitCodePoint(e, n) { this.baseState !== Se.Text && this.baseState !== Se.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + n, this.index = this.sectionStart - 1, this.cbs.onattribentity(e)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + n, this.index = this.sectionStart - 1, this.cbs.ontextentity(e, this.sectionStart)); } } const tu = /* @__PURE__ */ new Set([ "input", "option", "optgroup", "select", "button", "datalist", "textarea" ]), Ut = /* @__PURE__ */ new Set(["p"]), HI = /* @__PURE__ */ new Set(["thead", "tbody"]), WI = /* @__PURE__ */ new Set(["dd", "dt"]), KI = /* @__PURE__ */ new Set(["rt", "rp"]), gG = /* @__PURE__ */ new Map([ ["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])], ["th", /* @__PURE__ */ new Set(["th"])], ["td", /* @__PURE__ */ new Set(["thead", "th", "td"])], ["body", /* @__PURE__ */ new Set(["head", "link", "script"])], ["li", /* @__PURE__ */ new Set(["li"])], ["p", Ut], ["h1", Ut], ["h2", Ut], ["h3", Ut], ["h4", Ut], ["h5", Ut], ["h6", Ut], ["select", tu], ["input", tu], ["output", tu], ["button", tu], ["datalist", tu], ["textarea", tu], ["option", /* @__PURE__ */ new Set(["option"])], ["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])], ["dd", WI], ["dt", WI], ["address", Ut], ["article", Ut], ["aside", Ut], ["blockquote", Ut], ["details", Ut], ["div", Ut], ["dl", Ut], ["fieldset", Ut], ["figcaption", Ut], ["figure", Ut], ["footer", Ut], ["form", Ut], ["header", Ut], ["hr", Ut], ["main", Ut], ["nav", Ut], ["ol", Ut], ["pre", Ut], ["section", Ut], ["table", Ut], ["ul", Ut], ["rt", KI], ["rp", KI], ["tbody", HI], ["tfoot", HI] ]), yG = /* @__PURE__ */ new Set([ "area", "base", "basefont", "br", "col", "command", "embed", "frame", "hr", "img", "input", "isindex", "keygen", "link", "meta", "param", "source", "track", "wbr" ]), VI = /* @__PURE__ */ new Set(["math", "svg"]), YI = /* @__PURE__ */ new Set([ "mi", "mo", "mn", "ms", "mtext", "annotation-xml", "foreignobject", "desc", "title" ]), bG = /\s|\//; class vG { constructor(e, n = {}) { var r, i, o, a, s, c; this.options = n, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = e ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (r = n.lowerCaseTags) !== null && r !== void 0 ? r : this.htmlMode, this.lowerCaseAttributeNames = (i = n.lowerCaseAttributeNames) !== null && i !== void 0 ? i : this.htmlMode, this.recognizeSelfClosing = (o = n.recognizeSelfClosing) !== null && o !== void 0 ? o : !this.htmlMode, this.tokenizer = new ((a = n.Tokenizer) !== null && a !== void 0 ? a : mG)(this.options, this), this.foreignContext = [!this.htmlMode], (c = (s = this.cbs).onparserinit) === null || c === void 0 || c.call(s, this); } // Tokenizer event handlers /** @internal */ ontext(e, n) { var r, i; const o = this.getSlice(e, n); this.endIndex = n - 1, (i = (r = this.cbs).ontext) === null || i === void 0 || i.call(r, o), this.startIndex = n; } /** @internal */ ontextentity(e, n) { var r, i; this.endIndex = n - 1, (i = (r = this.cbs).ontext) === null || i === void 0 || i.call(r, zI(e)), this.startIndex = n; } /** * Checks if the current tag is a void element. Override this if you want * to specify your own additional void elements. */ isVoidElement(e) { return this.htmlMode && yG.has(e); } /** @internal */ onopentagname(e, n) { this.endIndex = n; let r = this.getSlice(e, n); this.lowerCaseTagNames && (r = r.toLowerCase()), this.emitOpenTag(r); } emitOpenTag(e) { var n, r, i, o; this.openTagStart = this.startIndex, this.tagname = e; const a = this.htmlMode && gG.get(e); if (a) for (; this.stack.length > 0 && a.has(this.stack[0]); ) { const s = this.stack.shift(); (r = (n = this.cbs).onclosetag) === null || r === void 0 || r.call(n, s, !0); } this.isVoidElement(e) || (this.stack.unshift(e), this.htmlMode && (VI.has(e) ? this.foreignContext.unshift(!0) : YI.has(e) && this.foreignContext.unshift(!1))), (o = (i = this.cbs).onopentagname) === null || o === void 0 || o.call(i, e), this.cbs.onopentag && (this.attribs = {}); } endOpenTag(e) { var n, r; this.startIndex = this.openTagStart, this.attribs && ((r = (n = this.cbs).onopentag) === null || r === void 0 || r.call(n, this.tagname, this.attribs, e), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = ""; } /** @internal */ onopentagend(e) { this.endIndex = e, this.endOpenTag(!1), this.startIndex = e + 1; } /** @internal */ onclosetag(e, n) { var r, i, o, a, s, c, u, d; this.endIndex = n; let p = this.getSlice(e, n); if (this.lowerCaseTagNames && (p = p.toLowerCase()), this.htmlMode && (VI.has(p) || YI.has(p)) && this.foreignContext.shift(), this.isVoidElement(p)) this.htmlMode && p === "br" && ((a = (o = this.cbs).onopentagname) === null || a === void 0 || a.call(o, "br"), (c = (s = this.cbs).onopentag) === null || c === void 0 || c.call(s, "br", {}, !0), (d = (u = this.cbs).onclosetag) === null || d === void 0 || d.call(u, "br", !1)); else { const f = this.stack.indexOf(p); if (f !== -1) for (let m = 0; m <= f; m++) { const h = this.stack.shift(); (i = (r = this.cbs).onclosetag) === null || i === void 0 || i.call(r, h, m !== f); } else this.htmlMode && p === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0)); } this.startIndex = n + 1; } /** @internal */ onselfclosingtag(e) { this.endIndex = e, this.recognizeSelfClosing || this.foreignContext[0] ? (this.closeCurrentTag(!1), this.startIndex = e + 1) : this.onopentagend(e); } closeCurrentTag(e) { var n, r; const i = this.tagname; this.endOpenTag(e), this.stack[0] === i && ((r = (n = this.cbs).onclosetag) === null || r === void 0 || r.call(n, i, !e), this.stack.shift()); } /** @internal */ onattribname(e, n) { this.startIndex = e; const r = this.getSlice(e, n); this.attribname = this.lowerCaseAttributeNames ? r.toLowerCase() : r; } /** @internal */ onattribdata(e, n) { this.attribvalue += this.getSlice(e, n); } /** @internal */ onattribentity(e) { this.attribvalue += zI(e); } /** @internal */ onattribend(e, n) { var r, i; this.endIndex = n, (i = (r = this.cbs).onattribute) === null || i === void 0 || i.call(r, this.attribname, this.attribvalue, e === Ho.Double ? '"' : e === Ho.Single ? "'" : e === Ho.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = ""; } getInstructionName(e) { const n = e.search(bG); let r = n < 0 ? e : e.substr(0, n); return this.lowerCaseTagNames && (r = r.toLowerCase()), r; } /** @internal */ ondeclaration(e, n) { this.endIndex = n; const r = this.getSlice(e, n); if (this.cbs.onprocessinginstruction) { const i = this.getInstructionName(r); this.cbs.onprocessinginstruction(`!${i}`, `!${r}`); } this.startIndex = n + 1; } /** @internal */ onprocessinginstruction(e, n) { this.endIndex = n; const r = this.getSlice(e, n); if (this.cbs.onprocessinginstruction) { const i = this.getInstructionName(r); this.cbs.onprocessinginstruction(`?${i}`, `?${r}`); } this.startIndex = n + 1; } /** @internal */ oncomment(e, n, r) { var i, o, a, s; this.endIndex = n, (o = (i = this.cbs).oncomment) === null || o === void 0 || o.call(i, this.getSlice(e, n - r)), (s = (a = this.cbs).oncommentend) === null || s === void 0 || s.call(a), this.startIndex = n + 1; } /** @internal */ oncdata(e, n, r) { var i, o, a, s, c, u, d, p, f, m; this.endIndex = n; const h = this.getSlice(e, n - r); !this.htmlMode || this.options.recognizeCDATA ? ((o = (i = this.cbs).oncdatastart) === null || o === void 0 || o.call(i), (s = (a = this.cbs).ontext) === null || s === void 0 || s.call(a, h), (u = (c = this.cbs).oncdataend) === null || u === void 0 || u.call(c)) : ((p = (d = this.cbs).oncomment) === null || p === void 0 || p.call(d, `[CDATA[${h}]]`), (m = (f = this.cbs).oncommentend) === null || m === void 0 || m.call(f)), this.startIndex = n + 1; } /** @internal */ onend() { var e, n; if (this.cbs.onclosetag) { this.endIndex = this.startIndex; for (let r = 0; r < this.stack.length; r++) this.cbs.onclosetag(this.stack[r], !0); } (n = (e = this.cbs).onend) === null || n === void 0 || n.call(e); } /** * Resets the parser to a blank state, ready to parse a new HTML document */ reset() { var e, n, r, i; (n = (e = this.cbs).onreset) === null || n === void 0 || n.call(e), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (i = (r = this.cbs).onparserinit) === null || i === void 0 || i.call(r, this), this.buffers.length = 0, this.foreignContext.length = 0, this.foreignContext.unshift(!this.htmlMode), this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1; } /** * Resets the parser, then parses a complete document and * pushes it to the handler. * * @param data Document to parse. */ parseComplete(e) { this.reset(), this.end(e); } getSlice(e, n) { for (; e - this.bufferOffset >= this.buffers[0].length; ) this.shiftBuffer(); let r = this.buffers[0].slice(e - this.bufferOffset, n - this.bufferOffset); for (; n - this.bufferOffset > this.buffers[0].length; ) this.shiftBuffer(), r += this.buffers[0].slice(0, n - this.bufferOffset); return r; } shiftBuffer() { this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift(); } /** * Parses a chunk of data and calls the corresponding callbacks. * * @param chunk Chunk to parse. */ write(e) { var n, r; if (this.ended) { (r = (n = this.cbs).onerror) === null || r === void 0 || r.call(n, new Error(".write() after done!")); return; } this.buffers.push(e), this.tokenizer.running && (this.tokenizer.write(e), this.writeIndex++); } /** * Parses the end of the buffer and clears the stack, calls onend. * * @param chunk Optional final chunk to parse. */ end(e) { var n, r; if (this.ended) { (r = (n = this.cbs).onerror) === null || r === void 0 || r.call(n, new Error(".end() after done!")); return; } e && this.write(e), this.ended = !0, this.tokenizer.end(); } /** * Pauses parsing. The parser won't emit events until `resume` is called. */ pause() { this.tokenizer.pause(); } /** * Resumes parsing after `pause` was called. */ resume() { for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; ) this.tokenizer.write(this.buffers[this.writeIndex++]); this.ended && this.tokenizer.end(); } /** * Alias of `write`, for backwards compatibility. * * @param chunk Chunk to parse. * @deprecated */ parseChunk(e) { this.write(e); } /** * Alias of `end`, for backwards compatibility. * * @param chunk Optional final chunk to parse. * @deprecated */ done(e) { this.end(e); } } var Ot; (function(t) { t.Root = "root", t.Text = "text", t.Directive = "directive", t.Comment = "comment", t.Script = "script", t.Style = "style", t.Tag = "tag", t.CDATA = "cdata", t.Doctype = "doctype"; })(Ot || (Ot = {})); function xG(t) { return t.type === Ot.Tag || t.type === Ot.Script || t.type === Ot.Style; } Ot.Root; Ot.Text; Ot.Directive; Ot.Comment; Ot.Script; Ot.Style; Ot.Tag; Ot.CDATA; Ot.Doctype; class zO { constructor() { this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null; } // Read-write aliases for properties /** * Same as {@link parent}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get parentNode() { return this.parent; } set parentNode(e) { this.parent = e; } /** * Same as {@link prev}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get previousSibling() { return this.prev; } set previousSibling(e) { this.prev = e; } /** * Same as {@link next}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get nextSibling() { return this.next; } set nextSibling(e) { this.next = e; } /** * Clone this node, and optionally its children. * * @param recursive Clone child nodes as well. * @returns A clone of the node. */ cloneNode(e = !1) { return JO(this, e); } } class tE extends zO { /** * @param data The content of the data node */ constructor(e) { super(), this.data = e; } /** * Same as {@link data}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get nodeValue() { return this.data; } set nodeValue(e) { this.data = e; } } let AS = class extends tE { constructor() { super(...arguments), this.type = Ot.Text; } get nodeType() { return 3; } }; class HO extends tE { constructor() { super(...arguments), this.type = Ot.Comment; } get nodeType() { return 8; } } class WO extends tE { constructor(e, n) { super(n), this.name = e, this.type = Ot.Directive; } get nodeType() { return 1; } } class nE extends zO { /** * @param children Children of the node. Only certain node types can have children. */ constructor(e) { super(), this.children = e; } // Aliases /** First child of the node. */ get firstChild() { var e; return (e = this.children[0]) !== null && e !== void 0 ? e : null; } /** Last child of the node. */ get lastChild() { return this.children.length > 0 ? this.children[this.children.length - 1] : null; } /** * Same as {@link children}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get childNodes() { return this.children; } set childNodes(e) { this.children = e; } } class KO extends nE { constructor() { super(...arguments), this.type = Ot.CDATA; } get nodeType() { return 4; } } class IS extends nE { constructor() { super(...arguments), this.type = Ot.Root; } get nodeType() { return 9; } } class VO extends nE { /** * @param name Name of the tag, eg. `div`, `span`. * @param attribs Object mapping attribute names to attribute values. * @param children Children of the node. */ constructor(e, n, r = [], i = e === "script" ? Ot.Script : e === "style" ? Ot.Style : Ot.Tag) { super(r), this.name = e, this.attribs = n, this.type = i; } get nodeType() { return 1; } // DOM Level 1 aliases /** * Same as {@link name}. * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. */ get tagName() { return this.name; } set tagName(e) { this.name = e; } get attributes() { return Object.keys(this.attribs).map((e) => { var n, r; return { name: e, value: this.attribs[e], namespace: (n = this["x-attribsNamespace"]) === null || n === void 0 ? void 0 : n[e], prefix: (r = this["x-attribsPrefix"]) === null || r === void 0 ? void 0 : r[e] }; }); } } function YO(t) { return xG(t); } function wG(t) { return t.type === Ot.CDATA; } function SG(t) { return t.type === Ot.Text; } function _G(t) { return t.type === Ot.Comment; } function EG(t) { return t.type === Ot.Directive; } function AG(t) { return t.type === Ot.Root; } function IG(t) { return Object.prototype.hasOwnProperty.call(t, "children"); } function JO(t, e = !1) { let n; if (SG(t)) n = new AS(t.data); else if (_G(t)) n = new HO(t.data); else if (YO(t)) { const r = e ? xy(t.children) : [], i = new VO(t.name, { ...t.attribs }, r); r.forEach((o) => o.parent = i), t.namespace != null && (i.namespace = t.namespace), t["x-attribsNamespace"] && (i["x-attribsNamespace"] = { ...t["x-attribsNamespace"] }), t["x-attribsPrefix"] && (i["x-attribsPrefix"] = { ...t["x-attribsPrefix"] }), n = i; } else if (wG(t)) { const r = e ? xy(t.children) : [], i = new KO(r); r.forEach((o) => o.parent = i), n = i; } else if (AG(t)) { const r = e ? xy(t.children) : [], i = new IS(r); r.forEach((o) => o.parent = i), t["x-mode"] && (i["x-mode"] = t["x-mode"]), n = i; } else if (EG(t)) { const r = new WO(t.name, t.data); t["x-name"] != null && (r["x-name"] = t["x-name"], r["x-publicId"] = t["x-publicId"], r["x-systemId"] = t["x-systemId"]), n = r; } else throw new Error(`Not implemented yet: ${t.type}`); return n.startIndex = t.startIndex, n.endIndex = t.endIndex, t.sourceCodeLocation != null && (n.sourceCodeLocation = t.sourceCodeLocation), n; } function xy(t) { const e = t.map((n) => JO(n, !0)); for (let n = 1; n < e.length; n++) e[n].prev = e[n - 1], e[n - 1].next = e[n]; return e; } const JI = { withStartIndices: !1, withEndIndices: !1, xmlMode: !1 }; class CG { /** * @param callback Called once parsing has completed. * @param options Settings for the handler. * @param elementCB Callback whenever a tag is closed. */ constructor(e, n, r) { this.dom = [], this.root = new IS(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof n == "function" && (r = n, n = JI), typeof e == "object" && (n = e, e = void 0), this.callback = e ?? null, this.options = n ?? JI, this.elementCB = r ?? null; } onparserinit(e) { this.parser = e; } // Resets the handler back to starting state onreset() { this.dom = [], this.root = new IS(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null; } // Signals the handler that parsing is done onend() { this.done || (this.done = !0, this.parser = null, this.handleCallback(null)); } onerror(e) { this.handleCallback(e); } onclosetag() { this.lastNode = null; const e = this.tagStack.pop(); this.options.withEndIndices && (e.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(e); } onopentag(e, n) { const r = this.options.xmlMode ? Ot.Tag : void 0, i = new VO(e, n, void 0, r); this.addNode(i), this.tagStack.push(i); } ontext(e) { const { lastNode: n } = this; if (n && n.type === Ot.Text) n.data += e, this.options.withEndIndices && (n.endIndex = this.parser.endIndex); else { const r = new AS(e); this.addNode(r), this.lastNode = r; } } oncomment(e) { if (this.lastNode && this.lastNode.type === Ot.Comment) { this.lastNode.data += e; return; } const n = new HO(e); this.addNode(n), this.lastNode = n; } oncommentend() { this.lastNode = null; } oncdatastart() { const e = new AS(""), n = new KO([e]); this.addNode(n), e.parent = n, this.lastNode = e; } oncdataend() { this.lastNode = null; } onprocessinginstruction(e, n) { const r = new WO(e, n); this.addNode(r); } handleCallback(e) { if (typeof this.callback == "function") this.callback(e, this.dom); else if (e) throw e; } addNode(e) { const n = this.tagStack[this.tagStack.length - 1], r = n.children[n.children.length - 1]; this.options.withStartIndices && (e.startIndex = this.parser.startIndex), this.options.withEndIndices && (e.endIndex = this.parser.endIndex), n.children.push(e), r && (e.prev = r, r.next = e), e.parent = n, this.lastNode = null; } } function nd(t, e) { const n = [], r = [Array.isArray(e) ? e : [e]], i = [0]; for (; ; ) { if (i[0] >= r[0].length) { if (r.length === 1) return n; r.shift(), i.shift(); continue; } const o = r[0][i[0]++]; YO(o) && t(o) && n.push(o), IG(o) && o.children.length > 0 && (i.unshift(0), r.unshift(o.children)); } } function TG(t, e) { const n = new CG(void 0, e); return new vG(n, e).end(t), n.root; } const XO = [ "begintime", "dayspac", "pagenum", "aisortEndTime", "aisortOffset", "aisortBeginTime", "aisortNextTime", "icServerTime" ], ZO = ["externparam", "daylist", "uinlist"], Tm = [...XO, ...ZO]; function eF() { return { begintime: "0", dayspac: "0", pagenum: "1", aisortEndTime: "0", aisortOffset: "0", aisortBeginTime: "0", aisortNextTime: "0", icServerTime: "0", externparam: "", daylist: "", uinlist: "" }; } function XI(t) { return typeof t == "object" && t !== null && !Array.isArray(t); } function tF(t, e) { const n = { ...e }; for (const r of XO) { const i = t[r]; if (!(i === void 0 || i === "")) { if (typeof i != "number" && typeof i != "string" || !/^\d+$/.test(String(i)) || !Number.isSafeInteger(Number(i)) || r === "pagenum" && Number(i) < 1) throw new Error(`空间好友动态分页字段异常: ${r}`); n[r] = String(Number(i)); } } for (const r of ZO) { const i = t[r]; if (!(i === void 0 || i === "" && r !== "uinlist")) { if (typeof i != "string" || i.length > 32768) throw new Error(`空间好友动态分页字段异常: ${r}`); n[r] = i; } } return n; } function ZI(t) { return JSON.stringify( Tm.filter((e) => e !== "icServerTime").map((e) => t[e]) ); } function kG(t, e, n) { if (!Number.isSafeInteger(e) || e < 2) throw new Error("空间好友动态分页页码超出范围"); const r = Buffer.from(JSON.stringify({ version: 1, uin: t, page: e, state: n })).toString( "base64url" ); if (r.length > 65536) throw new Error("空间好友动态分页游标过大"); return r; } function NG(t, e) { if (!t || t.length > 65536 || !/^[A-Za-z0-9_-]+$/.test(t)) throw new Error("无效的空间好友动态 cursor"); let n; try { const o = Buffer.from(t, "base64url"); if (o.toString("base64url") !== t) throw new Error("non-canonical encoding"); n = JSON.parse(o.toString("utf8")); } catch { throw new Error("无效的空间好友动态 cursor"); } if (!XI(n) || n.version !== 1 || n.uin !== e || typeof n.page != "number" || !Number.isSafeInteger(n.page) || n.page < 2 || !XI(n.state)) throw new Error("空间好友动态 cursor 无效或不属于当前账号"); const r = n.state; if (Object.keys(r).length !== Tm.length || !Tm.every((o) => typeof r[o] == "string")) throw new Error("无效的空间好友动态 cursor 状态"); const i = tF(r, eF()); if (Tm.some((o) => i[o] !== r[o])) throw new Error("无效的空间好友动态 cursor 状态"); return { page: n.page, state: i }; } function Mi(t, e) { return (t.attribs.class ?? "").split(/\s+/).includes(e); } function e4(t, e) { for (let n = t.parent; n && n !== e; n = n.parent) if ("attribs" in n && (Mi(n, "mod-comments") || Mi(n, "comments-list") || Mi(n, "f-item-passive") || Mi(n, "f-ct-video"))) return !1; return !0; } function t4(t) { const e = [], n = [...t.children].reverse(); for (; n.length; ) { const r = n.pop(); if (typeof r == "string") e.push(r); else if (r.type === "text") e.push(r.data.replace(/\s+/g, " ")); else if (r.type === "tag") { if (r.attribs["data-cmd"] === "qz_toggle" || Mi(r, "load_img")) continue; if (r.name === "br") e.push(` `); else if (r.name === "img") e.push(r.attribs.alt ?? ""); else { ["div", "p", "li"].includes(r.name) && (e.push(` `), n.push(` `)); for (let i = r.children.length - 1; i >= 0; i--) { const o = r.children[i]; o !== void 0 && n.push(o); } } } } return e.join("").replace(/ *\n */g, ` `).replace(/\n{3,}/g, ` `).trim(); } function wy(t) { if (typeof t != "number" && (typeof t != "string" || !/^\d+$/.test(t))) return null; const e = Number(t); return Number.isSafeInteger(e) && e >= 0 ? e : null; } function n4(t) { if (!t) return null; try { const e = new URL(t.startsWith("//") ? `https:${t}` : t); return e.protocol === "http:" || e.protocol === "https:" ? e.href : null; } catch { return null; } } function PG(t, e, n, r, i, o) { const a = TG(t), c = nd(() => !0, a.children).find( (b) => Mi(b, "f-item") && b.attribs["data-key"] === e ), u = { tid: null, content: null, content_complete: null, images: null, like_count: wy(i), comment_count: wy(o) }; if (!c) return u; let d = c; for (let b = c.parent; b && "attribs" in b; b = b.parent) if (Mi(b, "f-single")) { d = b; break; } const p = nd((b) => e4(b, c), c.children), f = p.find( (b) => b.attribs.name === "feed_data" && b.attribs["data-uin"] === String(n) && b.attribs["data-fkey"] === e ); r === 311 && f?.attribs["data-tid"] && (u.tid = f.attribs["data-tid"]); const m = p.filter((b) => Mi(b, "f-info")), h = m.find( (b) => Mi(b, "qz_info_complete") && t4(b) !== "" ), y = h ?? m.find((b) => !Mi(b, "qz_info_complete")); y && (u.content = t4(y), u.content_complete = !!h || !nd((b) => b.attribs["data-cmd"] === "qz_toggle", y.children).length); const x = /* @__PURE__ */ new Set(); for (const b of p.filter((S) => Mi(S, "img-item"))) { if (b.attribs["data-v_itemid"] || b.attribs["data-videotype"]) continue; const S = n4(b.attribs["data-originurl"] ?? b.attribs["data-url3"]); if (S) { x.add(S); continue; } for (const E of nd((T) => T.name === "img", b.children)) { const T = n4(E.attribs.truesrc ?? E.attribs.src); T && x.add(T); } } u.images = [...x]; const g = nd( (b) => Mi(b, "qz_like_btn_v3") && e4(b, d), d.children )[0]; return u.like_count ??= wy(g?.attribs["data-likecnt"]), u; } function DG(t) { const e = t.data?.main === void 0 ? t.data?.hasmore : t.data?.main?.hasMoreFeeds; if (e === !0 || e === 1 || e === "1") return !0; if (e === !1 || e === 0 || e === "0") return !1; throw new Error("空间好友动态缺少有效的分页结束标志"); } function OG(t) { if (!Array.isArray(t.data?.data)) throw new Error("无法获取空间好友动态(响应结构异常)"); return { feeds: t.data.data.filter((n) => n != null).map((n) => { if (typeof n != "object" || Array.isArray(n)) throw new Error("空间好友动态条目结构异常"); const r = { uin: Number(n.uin ?? 0), nickname: String(n.nickname ?? ""), time: Number(n.abstime ?? 0), appid: Number(n.appid ?? 0), key: String(n.key ?? n.feedskey ?? ""), html: String(n.html ?? "") }; if (![r.uin, r.time, r.appid].every( (i) => Number.isSafeInteger(i) && i >= 0 ) || typeof r.nickname != "string" || typeof r.html != "string") throw new Error("空间好友动态条目字段异常"); return { ...r, ...PG( r.html, r.key, r.uin, r.appid, n.likecnt, n.commentcnt ) }; }), has_more: DG(t), next_cursor: null }; } function Bi(t) { const e = t.trim(); try { const s = e.indexOf("{"), c = e.lastIndexOf("}"); if (s !== -1 && c !== -1 && c > s) return JSON.parse(e.slice(s, c + 1)); } catch { } try { const s = e.indexOf("back({"), c = e.lastIndexOf("})"); if (s !== -1 && c !== -1 && c > s) return JSON.parse(e.slice(s + 5, c + 1)); } catch { } const n = e.lastIndexOf("back("); if (n === -1) throw new Error("invalid response from qzone api"); const r = e.indexOf(");", n); if (r === -1) throw new Error("invalid response from qzone api"); const i = e.slice(n + 5, r).trim(), o = i.indexOf("{"), a = i.lastIndexOf("}"); if (o === -1 || a === -1 || a < o) throw new Error("invalid response from qzone api"); return JSON.parse(i.slice(o, a + 1)); } function FG(t) { let e = 0; const n = t.length, r = (d) => d === " " || d === " " || d === ` ` || d === "\r" || d === "\f" || d === "\v", i = () => { for (; e < n && r(t[e]); ) e++; }; function o(d) { e++; let p = ""; for (; e < n; ) { const f = t[e]; if (f === "\\") { const m = t[e + 1]; if (m === "x") { p += String.fromCharCode(parseInt(t.slice(e + 2, e + 4), 16)), e += 4; continue; } if (m === "u") { p += String.fromCharCode(parseInt(t.slice(e + 2, e + 6), 16)), e += 6; continue; } p += m !== void 0 ? { n: ` `, t: " ", r: "\r", b: "\b", f: "\f", v: "\v", 0: "\0" }[m] ?? m : "", e += 2; continue; } if (f === d) return e++, p; p += f, e++; } throw new Error("unterminated string in qzone feeds payload"); } function a() { i(); const d = t[e]; if (d === '"' || d === "'") return o(d); let p = ""; for (; e < n && /[A-Za-z0-9_$]/.test(t[e]); ) p += t[e], e++; if (!p) throw new Error("expected object key in qzone feeds payload"); return p; } function s() { e++; const d = {}; if (i(), t[e] === "}") return e++, d; for (; ; ) { const p = a(); if (i(), t[e] !== ":") throw new Error('expected ":" in qzone feeds payload'); e++; const f = u(); p !== "__proto__" && (d[p] = f), i(); const m = t[e]; if (m === ",") { if (e++, i(), t[e] === "}") return e++, d; continue; } if (m === "}") return e++, d; throw new Error('expected "," or "}" in qzone feeds payload'); } } function c() { e++; const d = []; if (i(), t[e] === "]") return e++, d; for (; ; ) { d.push(u()), i(); const p = t[e]; if (p === ",") { if (e++, i(), t[e] === "]") return e++, d; continue; } if (p === "]") return e++, d; throw new Error('expected "," or "]" in qzone feeds payload'); } } function u() { i(); const d = t[e]; if (d === void 0) throw new Error("unexpected end of qzone feeds payload"); if (d === "{") return s(); if (d === "[") return c(); if (d === '"' || d === "'") return o(d); let p = ""; for (; e < n && !/[,}\]:\s]/.test(t[e]); ) p += t[e], e++; if (p === "true") return !0; if (p === "false") return !1; if (p === "null") return null; if (p !== "undefined") { if (p !== "") { const f = Number(p); if (!Number.isNaN(f)) return f; } throw new Error("unexpected token in qzone feeds payload: " + p.slice(0, 20)); } } return u(); } function MG(t) { const e = t.indexOf("{"); if (e === -1) throw new Error("invalid feeds response from qzone api"); const n = FG(t.slice(e)); if (n === null || typeof n != "object") throw new Error("invalid feeds response from qzone api"); return n; } function RG(t) { return t.url1 ?? t.url2 ?? t.url3 ?? t.smallurl; } function BG(t) { const e = t.msglist ?? []; return { total: Number(t.total ?? e.length), msglist: e.map((n) => ({ tid: String(n.tid ?? ""), content: n.content ?? "", time: Number(n.created_time ?? 0), comment_num: Number(n.cmtnum ?? 0), is_private: Number(n.secret ?? 0) !== 0, images: (n.pic ?? []).map(RG).filter((r) => !!r) })) }; } function UG(t, e, n, r, i) { return { url: `https://h5.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_msglist_v6?${new URLSearchParams( { uin: e, ftype: "0", sort: "0", pos: String(n), num: String(r), replynum: "100", g_tk: i, callback: "_preloadCallback", code_version: "1", format: "jsonp", need_private_comment: "1" } ).toString()}`, headers: { Cookie: t } }; } function LG(t, e, n, r, i) { return { url: `https://user.qzone.qq.com/proxy/domain/taotao.qq.com/cgi-bin/emotion_cgi_msglist_v6?${new URLSearchParams( { uin: e, ftype: "0", sort: "0", pos: String(n), num: String(r), g_tk: i, code_version: "1", format: "json" } ).toString()}`, headers: { Cookie: t, Referer: `https://user.qzone.qq.com/${e}` } }; } function QG(t) { const e = Bi(t); if (typeof e.code == "number" && e.code !== 0) throw new Error(`qzone publish failed: code=${e.code} ${e.message ?? ""}`.trim()); const n = e.t1_tid ?? e.tid; if (!n) throw new Error("发表说说失败:响应缺少 tid"); return { tid: String(n), time: Number(e.t1_time ?? e.now ?? 0) }; } function jG(t, e, n, r = 0) { const i = `http://user.qzone.qq.com/${e}/mood/${n}`; return new URLSearchParams({ qzreferrer: `https://user.qzone.qq.com/${t}`, opuin: t, unikey: i, curkey: i, appid: "311", typeid: "0", abstime: String(r), fid: n, from: "1", active: "0", fupdate: "1", format: "json" }).toString(); } function $G(t, e) { const n = Bi(t); if (typeof n.code == "number" && n.code !== 0) throw new Error(`qzone ${e} failed: code=${n.code} ${n.message ?? ""}`.trim()); if (typeof n.subcode == "number" && n.subcode !== 0) throw new Error(`qzone ${e} failed: subcode=${n.subcode} ${n.message ?? ""}`.trim()); } function GG(t, e, n, r, i, o) { return new URLSearchParams({ qzreferrer: `https://user.qzone.qq.com/${t}`, inCharset: "utf-8", outCharset: "utf-8", hostUin: e, format: "json", ref: "feeds", topicId: `${e}_${n}__1`, feedsType: "100", private: "0", paramstr: "1", richtype: i !== void 0 ? String(i) : "", richval: o ?? "", isSignIn: "", uin: t, content: r, plat: "qzone", source: "ic", platformid: "52" }).toString(); } function qG(t, e, n) { const r = Bi(t); if (typeof r.code == "number" && r.code !== 0) throw new Error(`qzone comment failed: code=${r.code} ${r.message ?? ""}`.trim()); if (typeof r.subcode == "number" && r.subcode !== 0) throw new Error(`qzone comment failed: subcode=${r.subcode} ${r.message ?? ""}`.trim()); const i = r.commentid ?? r.commentId; return { comment_id: i !== void 0 ? String(i) : "" }; } function zG(t, e, n, r, i) { let o = r; if (i.replyTo !== void 0) { const { uin: a, name: s } = i.replyTo, c = s.trim().replace(/%/g, "%25").replace(/,/g, "%2C").replace(/}/g, "%7D"); o = `@{uin:${a},nick:${c},auto:1} ${r}`; } return new URLSearchParams({ uin: t, hostUin: e, hostuin: t, topicId: `${e}_${n}`, commentId: i.commentId, commentUin: i.commentUin, content: o, inCharset: "utf-8", outCharset: "utf-8", ref: "", code_version: "1", format: "fs", qzreferrer: `https://user.qzone.qq.com/${e}` }).toString(); } function HG(t, e, n) { return new URLSearchParams({ uin: t, act_uin: e, action: n ? "1" : "2", fupdate: "1", qzreferrer: `https://user.qzone.qq.com/${t}/main` }).toString(); } function WG(t, e) { const n = e ? "ban" : "unban"; let r; try { r = Bi(t.replace(/\{\s*name\s*:/, '{"name":')); } catch { const o = t.trim().slice(0, 300); throw new Error(`qzone ${n} failed: ${o}${t.length > 300 ? "…" : ""}`); } const i = r.message ?? r.msg ?? ""; if (typeof r.subcode == "number" && r.subcode !== 0) throw new Error(`qzone ${n} failed: subcode=${r.subcode} ${i}`.trim()); if (typeof r.code == "number" && r.code !== 0) throw new Error(`qzone ${n} failed: code=${r.code} ${i}`.trim()); } function r4(t, e, n, r) { return new URLSearchParams({ tid: e, uin: t, t1_source: "1", not_trunc_con: "1", need_right: "1", not_adapt_outpic: "1", g_tk: n, ...r ? { pos: String(r.pos), num: String(r.num) } : {} }).toString(); } function KG(t, e) { if (!t.tid) throw new Error("qzone msg detail is missing tid"); const n = t.pic ?? [], r = t.richtype !== void 0 ? Number(t.richtype) : n.length === 0 ? "" : 1, i = [], o = []; for (const f of n) { const m = String(f.pic_id ?? ""); if (!m) continue; const h = m.split(","), y = h[1] ?? "", x = h[2] ?? ""; if (!y || !x) throw new Error("qzone msg detail has unsupported pic info"); const g = x, b = String(f.pictype ?? f.type ?? 22), S = String(f.height ?? f.b_height ?? 0), E = String(f.width ?? f.b_width ?? 0); i.push(`,${y},${x},${g},${b},${S},${E},,0,0`); for (const T of ["smallurl", "url1", "url2", "url3"]) { const U = f[T]; if (!U) continue; const q = /[?&]bo=([^&#]+)/.exec(U); if (q) { o.push(decodeURIComponent(q[1])); break; } } } if (r === 1 && i.length === 0) throw new Error("qzone image post detail is missing pic info"); let a = t.content ?? ""; const s = (t.conlist ?? []).map((f) => f.con).filter((f) => f !== void 0); s.length > 0 && (a = s.join("").trim()); const c = t.t1_subtype ?? t.subrichtype ?? (i.length === 0 ? "" : 1), u = o.join(","), d = u ? `${u} ${u}` : "", p = String(t.uin ?? e); return new URLSearchParams({ syn_tweet_verson: "1", tid: String(t.tid), paramstr: "1", pic_template: t.pic_template ?? "", richtype: String(r), richval: i.length > 0 ? i.join(" ") : t.richval ?? "", special_url: t.special_url ?? "", subrichtype: String(c), pic_bo: d, con: a, feedversion: String(t.feedversion ?? 1), ver: String(t.ver ?? 1), ugc_right: String(Number(t.ugc_right ?? 1)), to_sign: String(Number(t.to_sign ?? 0)), ugcright_id: String(t.ugcright_id ?? t.tid), hostuin: p, code_version: String(t.code_version ?? 1), format: "fs", qzreferrer: `https://user.qzone.qq.com/${p}` }); } function i4(t, e) { if (t === null || typeof t != "object" || Array.isArray(t)) throw new Error(`invalid qzone msg detail: ${e} must be an object`); return t; } function rp(t, e) { if (typeof t != "string") throw new Error(`invalid qzone msg detail: ${e} must be a string`); return t; } function km(t, e, n = 0) { const r = typeof t == "string" && /^\d+$/.test(t) ? Number(t) : t; if (typeof r != "number" || !Number.isSafeInteger(r) || r < n) throw new Error(`invalid qzone msg detail: ${e} must be an integer >= ${n}`); return r; } function o4(t, e) { if (t == null) return []; if (!Array.isArray(t)) throw new Error(`invalid qzone msg detail: ${e} must be an array`); return t; } function a4(t, e) { const n = typeof t.tid == "number" ? String(km(t.tid, `${e}.tid`)) : rp(t.tid, `${e}.tid`); if (!n) throw new Error(`invalid qzone msg detail: ${e}.tid is empty`); return { comment_id: n, uin: km(t.uin, `${e}.uin`, 1), name: rp(t.name, `${e}.name`), time: km(t.create_time, `${e}.create_time`), content: rp(t.content, `${e}.content`) }; } function VG(t, e) { const n = rp(t.tid, "tid"); if (!n || n !== e) throw new Error("invalid qzone msg detail: tid does not match the requested post"); return { tid: n, content: rp(t.content, "content"), comment_num: km(t.cmtnum, "cmtnum"), comments: o4(t.commentlist, "commentlist").map((r, i) => { const o = `commentlist[${i}]`, a = i4(r, o), s = a4(a, o); return { ...s, replies: o4(a.list_3, `${o}.list_3`).map((c, u) => { const d = `${o}.list_3[${u}]`; return { ...a4(i4(c, d), d), parent_comment_id: s.comment_id, parent_comment_uin: s.uin }; }) }; }) }; } function s4(t, e) { const n = t.code !== void 0 && t.code !== 0 ? t.code : t.subcode ?? t.code ?? -1; if (n !== 0) throw new Error( `qzone msg detail failed: code=${n} ${t.message ?? t.msg ?? ""}`.trim() ); } function YG(t, e, n) { const r = Bi(t); if (typeof r.subcode == "number" && r.subcode !== 0) throw new Error( `qzone update right failed: subcode=${r.subcode} ${r.message ?? r.msg ?? ""}`.trim() ); if (typeof r.code == "number" && r.code !== 0) throw new Error( `qzone update right failed: code=${r.code} ${r.message ?? r.msg ?? ""}`.trim() ); return { ugc_right: Number(r.ugc_right ?? n) }; } function JG(t, e, n) { return new URLSearchParams({ uin: e, vuin: t, fupdate: "1", rd: String(Math.random()), g_tk: n }).toString(); } function XG(t) { const e = Bi(t); if (e.code !== 0 || e.subcode !== void 0 && e.subcode !== 0) throw new Error( `qzone profile failed: code=${e.code} subcode=${e.subcode ?? 0} ${e.message ?? ""}`.trim() ); if (typeof e.data?.spacename != "string" || typeof e.data.desc != "string") throw new Error("invalid qzone profile response"); return { name: e.data.spacename, description: e.data.desc }; } function ZG(t, e) { const n = new URLSearchParams({ uin: t, pageindex: "3", fupdate: "1" }); let r = 0; return e.name !== void 0 && (n.set("spacename", e.name.replaceAll("\r", "")), r |= 2048), e.description !== void 0 && (n.set("desc", e.description.replaceAll("\r", "")), r |= 4096), n.set("mb", String(r)), n.toString(); } function eq(t) { const e = Bi(t); if (e.code !== 0 || e.subcode !== void 0 && e.subcode !== 0) throw new Error( `qzone profile update failed: code=${e.code} subcode=${e.subcode ?? 0} ${e.message ?? ""}`.trim() ); } class tq { context; core; constructor(e, n) { this.context = e, this.core = n; } async shareDigest(e, n, r, i) { const o = await this.core.apis.UserApi.getCookies("qun.qq.com"), a = `https://qun.qq.com/cgi-bin/group_digest/share_digest?${new URLSearchParams({ bkn: this.getBknFromCookie(o), group_code: e, msg_seq: n, msg_random: r, target_group_code: i }).toString()}`; try { return ht.HttpGetText(a, "GET", "", { Cookie: this.cookieToString(o) }); } catch { return; } } async getGroupEssenceMsgAll(e) { const n = []; for (let r = 0; r < 20; r++) { const i = await this.getGroupEssenceMsg(e, r, 50); if (!i || (n.push(i), i.data.is_end)) break; } return n; } async getGroupEssenceMsg(e, n = 0, r = 50) { const i = await this.core.apis.UserApi.getCookies("qun.qq.com"), o = `https://qun.qq.com/cgi-bin/group_digest/digest_list?${new URLSearchParams({ bkn: this.getBknFromCookie(i), page_start: n.toString(), page_limit: r.toString(), group_code: e }).toString()}`; try { const a = await ht.HttpGetJson( o, "GET", "", { Cookie: this.cookieToString(i) } ); return a.retcode === 0 ? a : void 0; } catch { return; } } async getGroupMembers(e) { const n = new Array(), r = await this.core.apis.UserApi.getCookies("qun.qq.com"), i = [], o = await ht.HttpGetJson( `https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({ st: "0", end: "40", sort: "1", gc: e, bkn: this.getBknFromCookie(r) }).toString()}`, "POST", "", { Cookie: this.cookieToString(r) } ); if (!o?.count || o?.errcode !== 0 || !o?.mems) return []; for (const s in o.mems) o.mems[s] && n.push(o.mems[s]); const a = Math.ceil(o.count / 40); for (let s = 2; s <= a; s++) { const c = ht.HttpGetJson( `https://qun.qq.com/cgi-bin/qun_mgr/search_group_members?${new URLSearchParams({ st: ((s - 1) * 40).toString(), end: (s * 40).toString(), sort: "1", gc: e, bkn: this.getBknFromCookie(r) }).toString()}`, "POST", "", { Cookie: this.cookieToString(r) } ); i.push(c); } for (let s = 1; s <= a; s++) { const c = await i[s]; if (!(!c?.count || c?.errcode !== 0 || !c?.mems)) for (const u in c.mems) c.mems[u] && n.push(c.mems[u]); } return n; } // public async addGroupDigest(groupCode: string, msgSeq: string) { // const url = `https://qun.qq.com/cgi-bin/group_digest/cancel_digest?random=665&X-CROSS-ORIGIN=fetch&group_code=${groupCode}&msg_seq=${msgSeq}&msg_random=444021292`; // const res = await this.request(url); // return await res.json(); // } // public async getGroupDigest(groupCode: string) { // const url = `https://qun.qq.com/cgi-bin/group_digest/digest_list?random=665&X-CROSS-ORIGIN=fetch&group_code=${groupCode}&page_start=0&page_limit=20`; // const res = await this.request(url); // return await res.json(); // } async setGroupNotice(e, n, r = 0, i = 1, o = 1, a = 1, s = 1, c = "", u = 540, d = 300) { const p = await this.core.apis.UserApi.getCookies("qun.qq.com"); try { const f = JSON.stringify({ is_show_edit_card: o, tip_window_type: a, confirm_required: s }), m = { pic: c, imgWidth: u.toString(), imgHeight: d.toString() }; return await ht.HttpGetJson( `https://web.qun.qq.com/cgi-bin/announce/add_qun_notice?${new URLSearchParams({ bkn: this.getBknFromCookie(p), qid: e, text: n, pinned: r.toString(), type: i.toString(), settings: f, ...c === "" ? {} : m }).toString()}`, "POST", "", { Cookie: this.cookieToString(p) } ); } catch { return; } } async getGroupNotice(e) { const n = await this.core.apis.UserApi.getCookies("qun.qq.com"); try { const r = await ht.HttpGetJson( `https://web.qun.qq.com/cgi-bin/announce/get_t_list?${new URLSearchParams({ bkn: this.getBknFromCookie(n), qid: e, ft: "23", ni: "1", n: "1", i: "1", log_read: "1", platform: "1", s: "-1" }).toString()}&n=20`, "GET", "", { Cookie: this.cookieToString(n) } ); return r?.ec === 0 ? r : void 0; } catch { return; } } async getDataInternal(e, n, r) { let i; try { const o = await ht.HttpGetText( `https://qun.qq.com/interactive/honorlist?${new URLSearchParams({ gc: n, type: r.toString() }).toString()}`, "GET", "", { Cookie: this.cookieToString(e) } ), a = /window\.__INITIAL_STATE__=(.*?);/.exec(o); return a?.[1] && (i = JSON.parse(a[1].trim())), r === 1 ? i?.talkativeList : i?.actorList; } catch (o) { this.context.logger.logDebug("获取当前群荣耀失败", o); return; } } async getHonorList(e, n, r) { const i = await this.getDataInternal(e, n, r); return i ? i.map((o) => ({ user_id: o?.uin, nickname: o?.name, avatar: o?.avatar, description: o?.desc })) : (this.context.logger.logError(`获取类型 ${r} 的荣誉信息失败`), []); } async getGroupHonorInfo(e, n) { const r = await this.core.apis.UserApi.getCookies("qun.qq.com"), i = { group_id: Number(e), current_talkative: {}, talkative_list: [], performer_list: [], legend_list: [], emotion_list: [], strong_newbie_list: [] }; if (n === fi.TALKATIVE || n === fi.ALL) { const o = await this.getHonorList(r, e, 1); o.length > 0 && (i.current_talkative = o[0], i.talkative_list = o); } return (n === fi.PERFORMER || n === fi.ALL) && (i.performer_list = await this.getHonorList(r, e, 2)), (n === fi.LEGEND || n === fi.ALL) && (i.legend_list = await this.getHonorList(r, e, 3)), (n === fi.EMOTION || n === fi.ALL) && (i.emotion_list = await this.getHonorList(r, e, 6)), (n === fi.EMOTION || n === fi.ALL) && (i.strong_newbie_list = []), i; } cookieToString(e) { return Object.entries(e).map(([n, r]) => `${n}=${r}`).join("; "); } getBknFromCookie(e) { const n = e.skey; let r = 5381; for (let i = 0; i < n.length; i++) { const o = n.charCodeAt(i); r = r + (r << 5) + o; } return (r & 2147483647).toString(); } getBknFromSKey(e) { let n = 5381; for (let r = 0; r < e.length; r++) { const i = e.charCodeAt(r); n = n + (n << 5) + i; } return (n & 2147483647).toString(); } getBknFromPSKey(e) { return this.getBknFromSKey(e); } async getAlbumListByNTQQ(e, n = "") { return await this.context.session.getAlbumService().getAlbumList({ qun_id: e, attach_info: n, seq: 3331, request_time_line: { request_invoke_time: "0" } }); } async getAlbumList(e) { const n = await this.core.apis.UserApi.getSKey() || "", r = (await this.core.apis.UserApi.getPSkey(["qzone.qq.com"])).domainPskeyMap.get("qzone.qq.com") || "", i = this.getBknFromSKey(n), o = this.core.selfInfo.uin || "10001", a = `p_uin=o${this.core.selfInfo.uin}; p_skey=${r}; skey=${n}; uin=o${o} `, s = "https://h5.qzone.qq.com/proxy/domain/u.photo.qzone.qq.com/cgi-bin/upp/qun_list_album_v2?", c = new URLSearchParams({ random: "7570", g_tk: i, format: "json", inCharset: "utf-8", outCharset: "utf-8", qua: "V1_IPH_SQ_6.2.0_0_HDBM_T", cmd: "qunGetAlbumList", qunId: e, qunid: e, start: "0", num: "1000", uin: o, getMemberRole: "0" }); return (await ht.HttpGetJson(s + c.toString(), "GET", "", { Cookie: a })).data.album; } async createQunAlbumSession(e, n, r, i, o, a, s, c) { const d = mo(i).length, p = ED(i), f = this.getBknFromSKey(o), m = `p_uin=o${c}; p_skey=${a}; skey=${o}; uin=o${c}`, h = K$({ uin: c, group_id: e, pskey: a, pic_md5: s, img_size: d, img_name: p, sAlbumName: r, sAlbumID: n }), y = `https://h5.qzone.qq.com/webapp/json/sliceUpload/FileBatchControl/${s}?g_tk=${f}`; return await ht.HttpGetJson(y, "POST", h, { Cookie: m, "Content-Type": "application/json" }); } async uploadQunAlbumSlice(e, n, r, i, o, a) { const s = XL(e).size; let c = 0, u = 0; const d = this.getBknFromSKey(r), p = `p_uin=o${o}; p_skey=${i}; skey=${r}; uin=o${o}`, f = ZL(e, { highWaterMark: a }); for await (const m of f) { const h = Math.min(u + m.length, s), y = new FormData(); y.append("uin", o), y.append("appid", "qun"), y.append("session", n), y.append("offset", u.toString()), y.append("data", new Blob([m], { type: "application/octet-stream" }), "blob"), y.append("checksum", ""), y.append("check_type", "0"), y.append("retry", "0"), y.append("seq", c.toString()), y.append("end", h.toString()), y.append("cmd", "FileUpload"), y.append("slice_size", a.toString()), y.append("biz_req.iUploadType", "0"); const x = `https://h5.qzone.qq.com/webapp/json/sliceUpload/FileUpload?seq=${c}&retry=0&offset=${u}&end=${h}&total=${s}&type=form&g_tk=${d}`, g = await fetch(x, { method: "POST", headers: { Cookie: p }, body: y }); if (!g.ok) throw new Error(`HTTP error! status: ${g.status}`); const b = await g.json(); if (b.ret !== 0) throw new Error(`分片 ${c} 上传失败: ${b.msg}`); u += m.length, c++; } return { success: !0, message: "上传完成" }; } async uploadImageToQunAlbum(e, n, r, i) { const o = await this.core.apis.UserApi.getSKey() || "", a = (await this.core.apis.UserApi.getPSkey(["qzone.qq.com"])).domainPskeyMap.get("qzone.qq.com") || "", s = Wp("md5").update(mo(i)).digest("hex"), c = this.core.selfInfo.uin || "10001", u = (await this.createQunAlbumSession(e, n, r, i, o, a, s, c)).data.session; if (!u) throw new Error("创建群相册会话失败"); await this.uploadQunAlbumSlice(i, u, o, a, c, 16384); } async getAlbumMediaListByNTQQ(e, n, r = "") { return (await this.context.session.getAlbumService().getMediaList({ qun_id: e, attach_info: r, seq: 0, request_time_line: { request_invoke_time: "0" }, album_id: n, lloc: "", batch_id: "" })).response; } async doAlbumMediaPlainCommentByNTQQ(e, n, r, i) { const o = Math.floor(Math.random() * 9e3) + 1e3, a = this.core.selfInfo.uin || "10001", s = Date.now() * 1e3; return await this.context.session.getAlbumService().doQunComment( o, { map_info: [], map_bytes_info: [], map_user_account: [] }, e, 2, V$(a, n, r), Y$(a, i, s) ); } async deleteAlbumMediaByNTQQ(e, n, r) { const i = Math.floor(Math.random() * 9e3) + 1e3; return await this.context.session.getAlbumService().deleteMedias( i, e, n, [r], [] ); } async doAlbumMediaLikeByNTQQ(e, n, r, i, o) { const a = Math.floor(Math.random() * 9e3) + 1e3, s = this.core.selfInfo.uin || "10001", c = o ? 2 : 1, u = o ? 0 : 1; let d = ""; return i ? d = `421_1_0_${e}|${n}|${r}^||^421_1_0_${e}|${n}|${i}^||^0` : d = `421_1_0_${e}|${n}|${r}`, await this.context.session.getAlbumService().doQunLike( a, { map_info: [], map_bytes_info: [], map_user_account: [] }, c, { id: d, status: u }, J$(e, s, n, r) ); } async getQzoneAuth() { const e = await this.core.apis.UserApi.getSKey() || "", n = (await this.core.apis.UserApi.getPSkey(["qzone.qq.com"])).domainPskeyMap.get("qzone.qq.com") || "", r = this.core.selfInfo.uin || "10001", i = this.getBknFromSKey(e), o = `p_uin=o${r}; p_skey=${n}; skey=${e}; uin=o${r}`; return { skey: e, pskey: n, uin: r, g_tk: i, cookie: o }; } /** * 上传图片到 QQ 空间相册, 返回可用于发说说的 richval 字符串 * @param base64 图片Base64编码内容(不带data:前缀) */ async uploadImageToQzone(e) { const { skey: n, pskey: r, uin: i, g_tk: o, cookie: a } = await this.getQzoneAuth(), s = X$({ uin: i, skey: n, pskey: r, g_tk: o, base64: e }), c = `https://up.qzone.qq.com/cgi-bin/upload/cgi_upload_image?g_tk=${o}`, u = await ht.HttpGetText(c, "POST", s, { Cookie: a, "Content-Type": "application/x-www-form-urlencoded" }), d = Z$(u); if (d.code !== void 0 && d.code !== 0) throw new Error(d.msg || `QQ空间图片上传失败, code=${d.code}`); if (!d.data) throw new Error("QQ空间图片上传失败, 响应缺少data字段"); return eG(d.data); } /** * 发表QQ空间说说 * @param content 说说正文 * @param richvals 每张图片对应的richval数组, 为空表示纯文字说说 * @param ugcRight 查看权限 1所有人可见 4好友可见 16部分好友可见 64仅自己可见 128部分好友不可见 * @param targetUins 权限作用QQ号数组, ugcRight为16/128时使用 */ async publishQzoneMsg(e, n, r, i) { const { uin: o, g_tk: a, cookie: s } = await this.getQzoneAuth(), c = n.length > 0 ? n.join(" ") : void 0, u = i && i.length > 0 ? i.join("|") : void 0, d = qI({ hostuin: o, content: e, richval: c, ugcRight: r, allowUins: u }), p = `https://user.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_publish_v6?g_tk=${a}`, f = await ht.HttpGetJson(p, "POST", d, { Cookie: s, "Content-Type": "application/x-www-form-urlencoded" }, !0, !1); return tG(f); } /** * 删除QQ空间说说 * @param tid 说说Tid, 来自 publishQzoneMsg 的返回值 */ async deleteQzoneMsg(e) { const { uin: n, g_tk: r, cookie: i } = await this.getQzoneAuth(), o = nG({ hostuin: n, tid: e }), a = `https://user.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_delete_v6?g_tk=${r}`, s = await ht.HttpGetJson(a, "POST", o, { Cookie: i, "Content-Type": "application/x-www-form-urlencoded" }, !0, !1); return rG(s); } async getDaySignedList(e) { const n = (await this.core.apis.UserApi.getPSkey(["qun.qq.com"])).domainPskeyMap.get("qun.qq.com"), r = this.core.selfInfo.uin, i = `p_uin=o${r}; p_skey=${n}; uin=o${r}`; return await ht.HttpGetJson(`https://qun.qq.com/v2/signin/trpc/GetDaySignedList?g_tk=${this.getBknFromPSKey(n)}`, "POST", { dayYmd: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10).replace(/-/g, ""), offset: 0, limit: 100, uid: r, groupId: e }, { Cookie: i, "Content-Type": "application/json" }); } // ───────────── SnowCat · qzone Web 线扩展(SnowLuma 移植) ───────────── /** 获取说说列表(默认自己空间;-10000 限频自动切 user.qzone 备路) */ async getQzoneMsgList(e, n = 0, r = 20) { const { uin: i, g_tk: o, cookie: a } = await this.getQzoneAuth(), s = e ?? i; let c = UG(a, s, n, r, o), u = await ht.HttpGetText(c.url, "GET", "", c.headers), d = Bi(u); if (d.code === -1e4 && (c = LG(a, s, n, r, o), u = await ht.HttpGetText(c.url, "GET", "", c.headers), d = Bi(u)), typeof d.code == "number" && d.code !== 0) throw new Error(`qzone msglist failed: code=${d.code} ${d.message ?? ""}`.trim()); return BG(d); } /** 获取单条说说详情 + 一页评论(含内联回复) */ async getQzoneMsgDetail(e, n, r = 0, i = 20) { const { g_tk: o, cookie: a } = await this.getQzoneAuth(), c = `https://h5.qzone.qq.com/proxy/domain/taotao.qq.com/cgi-bin/emotion_cgi_msgdetail_v6?${r4(e, n, o, { pos: r, num: i })}`, u = await ht.HttpGetText(c, "GET", "", { Cookie: a }), d = Bi(u); return s4(d), VG(d, n); } /** 点赞/取消赞一条说说(abstime 传目标帖的发帖时间更稳,0 可容忍) */ async setQzoneLike(e, n, r, i = 0) { const { uin: o, g_tk: a, cookie: s } = await this.getQzoneAuth(), c = r ? "like" : "unlike", d = `https://h5.qzone.qq.com/proxy/domain/w.qzone.qq.com/cgi-bin/likes/${r ? "internal_dolike_app" : "internal_unlike_app"}?g_tk=${a}`, p = jG(o, e, n, i), f = await ht.HttpGetText(d, "POST", p, { Cookie: s, "Content-Type": "application/x-www-form-urlencoded" }); $G(f, c); } /** 评论一条说说(richval 传图片直链,与发说说的 richval 串不同) */ async commentQzoneMsg(e, n, r, i) { const { uin: o, g_tk: a, cookie: s } = await this.getQzoneAuth(), c = `https://h5.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_re_feeds?g_tk=${a}`, u = GG(o, e, n, r, i ? 1 : void 0, i), d = await ht.HttpGetText(c, "POST", u, { Cookie: s, "Content-Type": "application/x-www-form-urlencoded" }); return qG(d); } /** 楼中楼回复(独立端点 emotion_cgi_addreply_ugc;replyTo 自动转 @ 提及) */ async replyQzoneComment(e, n, r, i) { const { uin: o, g_tk: a, cookie: s } = await this.getQzoneAuth(), c = `https://h5.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_addreply_ugc?g_tk=${a}`, u = zG(o, e, n, r, i), d = await ht.HttpGetText(c, "POST", u, { Cookie: s, "Content-Type": "application/x-www-form-urlencoded" }), p = Bi(d); if (typeof p.code == "number" && p.code !== 0) throw new Error(`qzone reply failed: code=${p.code} ${p.message ?? ""}`.trim()); const f = p.data?.id; return { comment_id: f !== void 0 ? String(f) : "" }; } /** 发说说(富返回:tid + time;SnowCat 原版 publishQzoneMsg 只返回 tid,保留不动) */ async publishQzoneMsgFull(e, n, r, i) { const { uin: o, g_tk: a, cookie: s } = await this.getQzoneAuth(), c = n.length > 0 ? n.join(" ") : void 0, u = i && i.length > 0 ? i.join("|") : void 0, d = qI({ hostuin: o, content: e, richval: c, ugcRight: r, allowUins: u }), p = `https://user.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_publish_v6?g_tk=${a}`, f = await ht.HttpGetText(p, "POST", d, { Cookie: s, "Content-Type": "application/x-www-form-urlencoded" }); return QG(f); } /** 获取空间名称与说明(默认自己,可查别人——需有访问权) */ async getQzoneProfile(e) { const { uin: n, g_tk: r, cookie: i } = await this.getQzoneAuth(), a = `https://h5.qzone.qq.com/proxy/domain/base.qzone.qq.com/cgi-bin/user/cgi_userinfo_get_all?${JG(n, e ?? n, r)}`, s = await ht.HttpGetText(a, "GET", "", { Cookie: i }); return XG(s); } /** 修改空间名称/说明(只动传了的字段;空串=清空) */ async setQzoneProfile(e) { const { uin: n, g_tk: r, cookie: i } = await this.getQzoneAuth(), o = ZG(n, e), a = `https://h5.qzone.qq.com/proxy/domain/w.qzone.qq.com/cgi-bin/user/cgi_apply_updateuserinfo_new?g_tk=${r}`, s = await ht.HttpGetText(a, "POST", o, { Cookie: i, "Content-Type": "application/x-www-form-urlencoded" }); eq(s); } /** 空间拉黑/解拉黑(action=1 拉黑 / 2 解拉黑) */ async setQzoneBlack(e, n) { const { uin: r, g_tk: i, cookie: o } = await this.getQzoneAuth(), a = `https://h5.qzone.qq.com/proxy/domain/w.qzone.qq.com/cgi-bin/right/cgi_black_action_new?g_tk=${i}`, s = HG(r, e, n), c = await ht.HttpGetText(a, "POST", s, { Cookie: o, "Content-Type": "application/x-www-form-urlencoded" }); WG(c, n); } /** 改已有说说的查看权限(msgdetail_v6 → emotion_cgi_update 两步全量重提) */ async setQzoneMsgRight(e, n, r) { const { uin: i, g_tk: o, cookie: a } = await this.getQzoneAuth(), c = `https://h5.qzone.qq.com/proxy/domain/taotao.qq.com/cgi-bin/emotion_cgi_msgdetail_v6?${r4(i, e, o)}`, u = await ht.HttpGetText(c, "GET", "", { Cookie: a }), d = Bi(u); s4(d); const p = KG(d, i); p.set("ugc_right", String(n)), r && r.length > 0 && p.set("allow_uins", r.join("|")); const f = `https://h5.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_update?g_tk=${o}`, m = await ht.HttpGetText(f, "POST", p.toString(), { Cookie: a, "Content-Type": "application/x-www-form-urlencoded" }); return YG(m, e, n); } /** * 获取空间好友动态流(feeds3_html_more,HTML 载荷数据级解析)。 * cursor 传上次返回的 next_cursor 续翻;不传从第 page_num 页走。 */ async getQzoneFeeds(e = 1, n = 10, r) { const { uin: i, g_tk: o, cookie: a } = await this.getQzoneAuth(); if (!Number.isSafeInteger(e) || e < 1 || !Number.isSafeInteger(n) || n < 1 || n > 50) throw new Error("空间好友动态页码或数量无效"); const s = r === void 0 ? { page: 1, state: eF() } : NG(r, i); if (r !== void 0 && e !== 1 && e !== s.page) throw new Error("page_num 与空间好友动态 cursor 不匹配"); const c = r === void 0 ? e : s.page; let u = s.state; const d = /* @__PURE__ */ new Set([ZI(u)]); for (let p = s.page; p <= c; p++) { const f = new URLSearchParams({ uin: i, scope: "0", view: "1", gid: "", flag: "1", filter: "all", applist: "all", refresh: "0", firstGetGroup: "0", mixnocache: "0", scene: "0", sidomain: "qzonestyle.gtimg.cn", count: String(n), ...u, getAisort: u.aisortNextTime, g_tk: o, callback: "_preloadCallback", format: "jsonp", useutf8: "1", outputhtmlfeed: "1", usertime: String(Date.now()), rd: String(Math.random()), windowId: String(Math.random()) }); f.delete("aisortNextTime"); const m = `https://h5.qzone.qq.com/proxy/domain/ic2.qzone.qq.com/cgi-bin/feeds/feeds3_html_more?${f}`, h = await ht.HttpGetText(m, "GET", "", { Cookie: a }), y = MG(h); if (y.code !== 0 || y.subcode !== void 0 && y.subcode !== 0) throw new Error( `qzone feeds failed: code=${y.code} subcode=${y.subcode ?? 0} ${typeof y.message == "string" ? y.message : ""}`.trim() ); const x = y.data?.main; if (x !== void 0 && (x === null || typeof x != "object" || Array.isArray(x))) throw new Error("空间好友动态分页信息结构异常"); if (x?.error !== void 0 && x.error !== "") throw new Error("空间好友动态服务端报告拉取失败"); const g = OG(y); if (g.has_more) { if (!x) throw new Error("空间好友动态缺少下一页游标"); u = tF(x, u); const b = ZI(u); if (d.has(b)) throw new Error("空间好友动态分页游标未推进"); d.add(b), g.next_cursor = kG(i, p + 1, u); } if (p === c) return g; if (!g.has_more) return { feeds: [], has_more: !1, next_cursor: null }; } throw new Error("空间好友动态分页未完成"); } // ───────────── SnowCat · qzone 公共空间(空友)代理(SnowLuma 移植) ───────────── async getQzonePublicCapabilities(e, n, r) { return (await Promise.resolve().then(() => qr)).getQzonePublicCapabilities(e, n, r); } async getQzonePublicFeeds(e, n, r, i) { return (await Promise.resolve().then(() => qr)).getQzonePublicFeeds(e, n, r, i); } async getQzonePublicFeedDetail(e, n, r) { return (await Promise.resolve().then(() => qr)).getQzonePublicFeedDetail(e, n, r); } async getQzonePublicComments(e, n, r, i) { return (await Promise.resolve().then(() => qr)).getQzonePublicComments(e, n, r, i); } async getQzonePublicReplies(e, n, r, i, o, a) { return (await Promise.resolve().then(() => qr)).getQzonePublicReplies(e, n, r, i, o, a); } async setQzonePublicUpvote(e, n, r, i) { return (await Promise.resolve().then(() => qr)).setQzonePublicUpvote(e, n, r, i); } async setQzonePublicLike(e, n, r, i) { return (await Promise.resolve().then(() => qr)).setQzonePublicLike(e, n, r, i); } async setQzonePublicCommentLike(e, n, r, i, o, a) { return (await Promise.resolve().then(() => qr)).setQzonePublicCommentLike(e, n, r, i, o, a); } async commentQzonePublicFeed(e, n, r, i, o) { return (await Promise.resolve().then(() => qr)).commentQzonePublicFeed(e, n, r, i, o); } async replyQzonePublicFeed(e, n, r, i, o, a, s) { return (await Promise.resolve().then(() => qr)).replyQzonePublicFeed(e, n, r, i, o, a, s); } async deleteQzonePublicComment(e, n, r, i) { return (await Promise.resolve().then(() => qr)).deleteQzonePublicComment(e, n, r, i); } async deleteQzonePublicReply(e, n, r, i, o) { return (await Promise.resolve().then(() => qr)).deleteQzonePublicReply(e, n, r, i, o); } async setQzonePublicFollow(e, n, r, i) { return (await Promise.resolve().then(() => qr)).setQzonePublicFollow(e, n, r, i); } async forwardQzonePublicFeed(e, n, r, i) { return (await Promise.resolve().then(() => qr)).forwardQzonePublicFeed(e, n, r, i); } } class nq { context; core; constructor(e, n) { this.context = e, this.core = n; } async hasOtherRunningQQProcess() { return this.core.util.hasOtherRunningQQProcess(); } async ocrImage(e) { return this.context.session.getNodeMiscService().wantWinScreenOCR(e); } async translateEnWordToZn(e) { return this.context.session.getRichMediaService().translateEnWordToZn(e); } async getOnlineDev() { this.context.session.getMsgService().getOnLineDev(); } async getArkJsonCollection() { return await this.core.eventWrapper.callNoListenerEvent("NodeIKernelCollectionService/collectionArkShare", "1717662698058"); } async bootMiniApp(e, n) { return await this.context.session.getNodeMiscService().setMiniAppVersion("2.16.4"), this.context.session.getNodeMiscService().startNewMiniApp(e, n); } } const rq = { "9.9.22-40990-x64": { send: "1B5699C", recv: "1D8CA9D" }, "9.9.22-40824-x64": { send: "1B5699C", recv: "1D8CA9D" }, "9.9.22-40768-x64": { send: "1B5699C", recv: "1D8CA9D" }, "3.2.20-40768-x64": { send: "2A1B840", recv: "2D28F20" }, "3.2.20-40824-x64": { send: "2A1B840", recv: "2D28F20" }, "3.2.20-40990-x64": { send: "2A1B840", recv: "2D28F20" }, "3.2.20-40990-arm64": { send: "157C0E8", recv: "1546658" }, "3.2.20-40824-arm64": { send: "157C0E8", recv: "1546658" }, "3.2.20-40768-arm64": { send: "157C0E8", recv: "1546658" }, "9.9.23-41679-x64": { send: "09FF0F4", recv: "1D1A039" }, "6.9.82-40824-arm64": { send: "05FA930", recv: "0B41B90" }, "6.9.82-40768-arm64": { send: "05FA930", recv: "0B41B90" }, "6.9.82-40990-arm64": { send: "05FA930", recv: "0B41B90" }, "6.9.83-41679-arm64": { send: "237D114", recv: "0957648" }, "6.9.83-41785-arm64": { send: "23B0BF0", recv: "095567C" }, "9.9.23-41785-x64": { send: "09FF0A4", recv: "1D19FF9" }, "6.9.83-41857-arm64": { send: "0815774", recv: "0958B3C" }, "3.2.21-41857-x64": { send: "5B44510", recv: "2FDB0B0" }, "3.2.21-41857-arm64": { send: "3D6EE6C", recv: "1479EDC" }, "9.9.23-41857-x64": { send: "0A01394", recv: "1D1C4F9" }, "9.9.23-42086-x64": { send: "0A01814", recv: "1D1C9B9" }, "6.9.85-42086-arm64": { send: "23B0330", recv: "0957648" }, "3.2.21-42086-arm64": { send: "3D6D98C", recv: "14797C8" }, "3.2.21-42086-x64": { send: "5B42CF0", recv: "2FDA6F0" }, "9.9.23-42430-x64": { send: "0A01A34", recv: "1D1CFF9" }, "9.9.25-42744-x64": { send: "0A0D104", recv: "1D3E7F9" }, "6.9.85-42744-arm64": { send: "23DFEF0", recv: "095FD80" }, "9.9.25-42905-x64": { send: "0A12E74", recv: "1D450FD" }, "6.9.86-42905-arm64": { send: "2342408", recv: "09639B8" }, "3.2.22-42941-x64": { send: "5BC1630", recv: "3011E00" }, "3.2.22-42941-arm64": { send: "3DC90AC", recv: "1497A70" }, "9.9.25-42941-x64": { send: "0A131D4", recv: "1D4547D" }, "6.9.86-42941-arm64": { send: "2346108", recv: "09675F0" }, "9.9.26-44175-x64": { send: "0A0F2EC", recv: "1D3AD4D" }, "9.9.26-44343-x64": { send: "0A0F7BC", recv: "1D3C3CD" }, "3.2.23-44343-arm64": { send: "3C867DC", recv: "1404938" }, "3.2.23-44343-x64": { send: "59A27B0", recv: "2FFBE90" }, "9.9.26-44498-x64": { send: "0A1051C", recv: "1D3BC0D" }, "9.9.26-44725-x64": { send: "0A18D0C", recv: "1D4BF0D" }, "9.9.27-45627-x64": { send: "0A697CC", recv: "1E86AC1" }, "6.9.88-44725-x64": { send: "2756EF6", recv: "0A36152" }, "6.9.88-44725-arm64": { send: "2313C68", recv: "09693E4" }, "3.2.25-45758-x64": { send: "5CF8F30", recv: "31667E0" }, "3.2.25-45758-arm64": { send: "3EB6554", recv: "149AF0C" }, "9.9.27-45758-x64": { send: "0A6A6BC", recv: "1E87EC1" }, "9.9.28-46494-x64": { send: "0A6D66C", recv: "1E9890D" }, "3.2.26-46494-x64": { send: "5D30910", recv: "31814B0" }, "3.2.26-46494-arm64": { send: "3EDC654", recv: "14A3124" }, "3.2.26-46928-x64": { send: "5D30910", recv: "31814B0" }, "3.2.26-46928-arm64": { send: "3EDC654", recv: "14A3124" }, "9.9.28-46928-x64": { send: "0A6D66C", recv: "1E9890D" }, "3.2.27-47354-x64": { send: "5D38930", recv: "318D090" }, "3.2.27-47354-arm64": { send: "3EE8B24", recv: "14D422C" }, "9.9.29-47354-x64": { send: "0A70B3C", recv: "1EAFD51" }, "6.9.93-47354-arm64": { send: "244066C", recv: "09BCCF8" }, "6.9.93-47354-x64": { send: "28ADE46", recv: "0A8FD5A" }, "9.9.30-48517-x64": { send: "0A9B1BC", recv: "1F0324D" }, "3.2.28-48517-x64": { send: "5E41890", recv: "3216D10" }, "3.2.28-48517-arm64": { send: "3F9C7E4", recv: "14E1AA8" }, "9.9.30-48762-x64": { send: "0A9B1BC", recv: "1F0324D" }, "9.9.31-49599-x64": { send: "0AF885C", recv: "20058E1" }, "9.9.31-49738-x64": { send: "0AF9FCC", recv: "2007901" }, "3.2.29-49738-x64": { send: "6234600", recv: "33D89D0" }, "3.2.29-49738-arm64": { send: "426AA04", recv: "1596254" }, "9.9.32-50828-x64": { send: "0B245CC", recv: "2073D65" }, "3.2.30-50828-x64": { send: "6340530", recv: "346DA50" }, "3.2.30-50828-arm64": { send: "4327764", recv: "15e3184" }, "9.9.32-50969-x64": { send: "0B2E2AC", recv: "209C709" }, "3.2.30-50969-x64": { send: "63F47B0", recv: "34B9E30" }, "3.2.30-50969-arm64": { send: "43A4804", recv: "1608CC8" }, "9.9.33-52230-x64": { send: "BF2B5F", recv: "23BB4DD" }, "3.2.32-52194-x64": { send: "6C45D20", recv: "393DE00" }, "3.2.32-52194-arm64": { send: "493FAD8", recv: "17EA1DC" }, "9.9.35-52892-x64": { send: "C361DF", recv: "246F3A1" }, "3.2.33-52892-x64": { send: "6DDB4C0", recv: "39DA860" }, "3.2.33-52892-arm64": { send: "4A5D658", recv: "1813A34" }, "9.9.37-54395-x64": { send: "C5927F", recv: "24CC2B5" }, "9.9.37-54276-x64": { send: "C5927F", recv: "24CC2B5" } }; class eg { static pack(e, n) { const r = 9 + e.length + n.length + 1, i = Buffer.allocUnsafe(r); return i[0] = 40, i.writeUInt32BE(e.length, 1), i.writeUInt32BE(n.length, 5), e.copy(i, 9), n.copy(i, 9 + e.length), i[r - 1] = 41, i; } static unpack(e) { s7(e[0] === 40 && e[e.length - 1] === 41, "Invalid frame!"); const n = e.readUInt32BE(1), r = e.readUInt32BE(5); return [e.subarray(9, 9 + n), e.subarray(9 + n, 9 + n + r)]; } } v(2, w.UINT32), v(3, w.UINT32), v(6, w.UINT32); v(1, w.UINT32), v(2, w.STRING, !0), v(3, w.STRING, !0); v(1, w.UINT32), v(2, w.STRING), v(3, w.UINT32); v(1, w.STRING, !1, !0), v(2, w.STRING, !1, !0), v(3, w.STRING), v(4, w.UINT32), v(5, w.UINT32, !1, !0); v(1, w.INT32), v(2, w.INT32), v(3, w.BYTES), v(7, w.INT32), v(8, w.INT32), v(9, w.BYTES), v(10, w.INT32), v(11, w.INT32), v(13, w.INT32); v(1, w.INT32), v(2, w.STRING, !0), v(3, w.UINT32), v(10, w.UINT32), v(11, w.UINT32, !0), v(12, w.UINT32), v(14, w.UINT32); v(1, w.UINT32), v(2, w.UINT32), v(3, w.UINT32); v(1, w.UINT32), v(2, w.STRING, !0), v(3, w.UINT32); v(2, w.STRING); const iq = { field1: v(1, w.INT32), field2: v(2, w.INT32), field3: v(3, w.INT32), field4: v(4, w.INT32), tgt: v(5, w.STRING), field6: v(6, w.INT32), serviceTypes: v(7, w.INT32, !1, !0), field9: v(9, w.INT32), field10: v(10, w.INT32), field11: v(11, w.INT32), ver: v(15, w.STRING) }, oq = { httpConn: v(1281, () => iq) }, aq = { httpConn: v(1281, () => sq) }, sq = { sigSession: v(1, w.BYTES), sessionKey: v(2, w.BYTES), serverInfos: v(3, () => uq, !1, !0) }, cq = { type: v(1, w.UINT32), ip: v(2, w.FIXED32), port: v(3, w.UINT32), area: v(4, w.UINT32) }, uq = { serviceType: v(1, w.UINT32), serverAddrs: v(2, () => cq, !1, !0) }, lq = { appId: v(2, w.STRING), body: v(4, () => dq) }, dq = { extInfo: v(1, () => pq), appid: v(2, w.STRING), title: v(3, w.STRING), desc: v(4, w.STRING), time: v(5, w.UINT64), scene: v(6, w.UINT32), templateType: v(7, w.UINT32), businessType: v(8, w.UINT32), picUrl: v(9, w.STRING), vidUrl: v(10, w.STRING), jumpUrl: v(11, w.STRING), iconUrl: v(12, w.STRING), verType: v(13, w.UINT32), shareType: v(14, w.UINT32), versionId: v(15, w.STRING), withShareTicket: v(16, w.UINT32), webURL: v(17, w.STRING), appidRich: v(18, w.BYTES), template: v(19, () => fq), field20: v(20, w.STRING) }, pq = { field2: v(2, w.BYTES) }, fq = { templateId: v(1, w.STRING), templateData: v(2, w.STRING) }, hq = { field2: v(2, w.UINT32), field3: v(3, w.STRING), content: v(4, () => mq) }, mq = { jsonContent: v(2, w.STRING) }, nF = { version: v(1, w.UINT32), uin: v(2, w.STRING, !0), command: v(3, w.STRING, !0), seq: v(4, w.UINT32, !0), retryTimes: v(5, w.UINT32, !0), appId: v(6, w.UINT32), dataFlag: v(7, w.UINT32), commandId: v(8, w.UINT32), buildVer: v(9, w.BYTES, !0) }, c4 = { unknown1: v(1, w.INT32), unknown2: v(2, w.INT32), unknown3: v(3, w.INT32), entry: v(100, () => gq), unknown200: v(200, w.INT32) }, gq = { busiBuff: v(100, () => yq), fileEntry: v(200, () => bq), clientInfo: v(300, () => vq), fileNameInfo: v(400, () => xq), host: v(500, () => wq) }, yq = { busId: v(1, w.INT32), senderUin: v(100, w.UINT64), receiverUin: v(200, w.UINT64), groupCode: v(400, w.UINT64) }, bq = { fileSize: v(100, w.UINT64), md5: v(200, w.BYTES), checkKey: v(300, w.BYTES), md5S2: v(400, w.BYTES), fileId: v(600, w.STRING), uploadKey: v(700, w.BYTES) }, vq = { clientType: v(100, w.INT32), appId: v(200, w.STRING), terminalType: v(300, w.INT32), clientVer: v(400, w.STRING), unknown: v(600, w.INT32) }, xq = { fileName: v(100, w.STRING) }, wq = { hosts: v(200, () => Sq, !1, !0) }, Sq = { url: v(1, () => _q), port: v(2, w.UINT32) }, _q = { unknown: v(1, w.INT32), host: v(2, w.STRING) }, Eq = { uint32LoginSigType: v(1, w.UINT32), bytesLoginSig: v(2, w.BYTES), appId: v(3, w.UINT32) }, Za = { fileUuid: v(1, w.STRING), uKey: v(2, w.STRING), network: v(5, () => Iq), msgInfoBody: v(6, () => mF, !1, !0), blockSize: v(10, w.UINT32), hash: v(11, () => Aq) }, Aq = { fileSha1: v(1, w.BYTES, !1, !0) }, Iq = { ipv4s: v(1, () => Cq, !1, !0) }, Cq = { domain: v(1, () => Tq), port: v(2, w.UINT32) }, Tq = { isEnable: v(1, w.BOOL), ip: v(2, w.STRING) }, kq = { msgBaseHead: v(1, () => nF, !0), msgSegHead: v(2, () => iF, !0), bytesReqExtendInfo: v(3, w.BYTES, !0), timestamp: v(4, w.UINT64), msgLoginSigHead: v(5, () => Eq, !0) }, rF = { msgBaseHead: v(1, () => nF, !0), msgSegHead: v(2, () => iF, !0), errorCode: v(3, w.UINT32), allowRetry: v(4, w.UINT32), cacheCost: v(5, w.UINT32), htCost: v(6, w.UINT32), bytesRspExtendInfo: v(7, w.BYTES, !0), timestamp: v(8, w.UINT64), range: v(9, w.UINT64), isReset: v(10, w.UINT32) }, iF = { serviceId: v(1, w.UINT32, !0), filesize: v(2, w.UINT64), dataOffset: v(3, w.UINT64, !0), dataLength: v(4, w.UINT32), retCode: v(5, w.UINT32, !0), serviceTicket: v(6, w.BYTES), flag: v(7, w.UINT32, !0), md5: v(8, w.BYTES), fileMd5: v(9, w.BYTES), cacheAddr: v(10, w.UINT32, !0), queryTimes: v(11, w.UINT32), updateCacheIp: v(12, w.UINT32), cachePort: v(13, w.UINT32, !0) }; v(1, w.UINT32), v(2, w.UINT32), v(5, w.UINT32), v(6, w.UINT32); v(1, w.UINT32); const tg = { action: v(2, () => Nq, !1, !0) }, Nq = { actionCommand: v(1, w.STRING), actionData: v(2, () => Pq) }, Pq = { msgBody: v(1, () => yl, !1, !0) }, Dq = { info: v(1, () => Oq, !0), settings: v(15, () => m0, !0) }, Oq = { uid: v(1, () => oF, !0), resId: v(2, w.STRING, !0), acquire: v(3, w.BOOL) }, oF = { uid: v(2, w.STRING, !0) }, m0 = { field1: v(1, w.UINT32), field2: v(2, w.UINT32), field3: v(3, w.UINT32), field4: v(4, w.UINT32) }, Fq = { result: v(1, () => Mq), settings: v(15, () => m0) }, Mq = { resId: v(3, w.STRING), payload: v(4, w.BYTES) }, aF = { info: v(2, () => Rq), settings: v(15, () => m0) }, Rq = { type: v(1, w.UINT32), uid: v(2, () => oF, !0), groupUin: v(3, w.UINT32, !0), payload: v(4, w.BYTES, !0) }, sF = { result: v(2, () => Bq), settings: v(15, () => m0) }, Bq = { resId: v(3, w.STRING) }, Uq = { info: v(1, () => Lq), direction: v(2, w.BOOL) }, Lq = { groupUin: v(1, w.UINT32), startSequence: v(2, w.UINT32), endSequence: v(3, w.UINT32) }, Qq = { body: v(3, () => jq) }, jq = { groupUin: v(3, w.UINT32), startSequence: v(4, w.UINT32), endSequence: v(5, w.UINT32), messages: v(6, () => yl, !1, !0) }; v(1, w.STRING, !0), v(2, w.UINT32), v(3, w.UINT32), v(4, w.UINT32), v(5, w.BOOL); v(3, w.STRING), v(5, w.UINT32), v(6, w.UINT32); const $q = { friendUid: v(2, w.STRING, !0), startSequence: v(3, w.UINT32), endSequence: v(4, w.UINT32) }, Gq = { friendUid: v(4, w.STRING), messages: v(7, () => yl, !1, !0) }; v(1, w.UINT32, !0), v(2, w.STRING, !0), v(3, w.UINT32, !0), v(4, w.UINT32, !0), v(5, w.UINT32, !0), v(6, w.STRING, !0); const qq = { codePage: v(1, w.INT32), time: v(2, w.INT32), random: v(3, w.INT32), color: v(4, w.INT32), size: v(5, w.INT32), effect: v(6, w.INT32), charSet: v(7, w.INT32), pitchAndFamily: v(8, w.INT32), fontName: v(9, w.STRING), reserveData: v(10, w.BYTES) }, cF = { fileType: v(1, w.INT32, !0), sig: v(2, w.BYTES, !0), fileUuid: v(3, w.STRING, !0), fileMd5: v(4, w.BYTES, !0), fileName: v(5, w.STRING, !0), fileSize: v(6, w.INT64, !0), note: v(7, w.BYTES, !0), reserved: v(8, w.INT32, !0), subcmd: v(9, w.INT32, !0), microCloud: v(10, w.INT32, !0), bytesFileUrls: v(11, w.BYTES, !1, !0), downloadFlag: v(12, w.INT32, !0), dangerEvel: v(50, w.INT32, !0), lifeTime: v(51, w.INT32, !0), uploadTime: v(52, w.INT32, !0), absFileType: v(53, w.INT32, !0), clientType: v(54, w.INT32, !0), expireTime: v(55, w.INT32, !0), pbReserve: v(56, w.BYTES, !0), fileHash: v(57, w.STRING, !0) }, zq = { fileType: v(1, w.INT32), srcUin: v(2, w.UINT64), fileUuid: v(3, w.STRING), fileMd5: v(4, w.BYTES), fileName: v(5, w.STRING), fileSize: v(6, w.INT32), reserve: v(7, w.BYTES), fileId: v(8, w.INT32), serverIp: v(9, w.INT32), serverPort: v(10, w.INT32), boolValid: v(11, w.BOOL), signature: v(12, w.BYTES), shortcut: v(13, w.BYTES), fileKey: v(14, w.BYTES), magicPttIndex: v(15, w.INT32), voiceSwitch: v(16, w.INT32), pttUrl: v(17, w.BYTES), groupFileKey: v(18, w.STRING), time: v(19, w.INT32), downPara: v(20, w.BYTES), format: v(29, w.INT32), pbReserve: v(30, w.BYTES), bytesPttUrls: v(31, w.BYTES, !1, !0), downloadFlag: v(32, w.INT32) }, Hq = { attr: v(1, () => qq, !0), elems: v(2, () => uF, !1, !0), notOnlineFile: v(3, () => cF, !0), ptt: v(4, () => zq, !0) }; v(1, w.STRING); v(1, w.STRING), v(2, w.STRING), v(3, w.INT32); v(1, w.INT32), v(4, w.STRING), v(5, w.STRING), v(7, w.BOOL), v(8, w.BOOL); v(1, w.INT32), v(2, w.STRING, !1, !0), v(3, w.STRING, !1, !0); const Wq = { file: v(1, () => cF), field6: v(6, () => Kq) }, Kq = { field2: v(2, () => Vq) }, Vq = { field1: v(1, w.UINT32), fileUuid: v(4, w.STRING), fileName: v(5, w.STRING), field6: v(6, w.UINT32), field7: v(7, w.BYTES), field8: v(8, w.BYTES), timestamp1: v(9, w.UINT32), fileHash: v(14, w.STRING), selfUid: v(15, w.STRING), destUid: v(16, w.STRING) }, Yq = { field1: v(1, w.UINT32), fileName: v(2, w.STRING), display: v(3, w.STRING), inner: v(7, () => Jq) }, Jq = { info: v(2, () => Xq) }, Xq = { busId: v(1, w.UINT32), fileId: v(2, w.STRING), fileSize: v(3, w.UINT64), fileName: v(4, w.STRING), field5: v(5, w.UINT32), fileSha: v(6, w.BYTES), extInfoString: v(7, w.STRING), fileMd5: v(8, w.BYTES) }; v(30, w.STRING); v(1, w.UINT32), v(7, w.UINT32), v(8, w.UINT32); const uF = { text: v(1, () => Zq, !0), face: v(2, () => ez, !0), onlineImage: v(3, () => tz, !0), notOnlineImage: v(4, () => nz, !0), transElem: v(5, () => oz, !0), marketFace: v(6, () => az, !0), customFace: v(8, () => cz, !0), elemFlags2: v(9, () => lz, !0), richMsg: v(12, () => pz, !0), groupFile: v(13, () => fz, !0), extraInfo: v(16, () => hz, !0), videoFile: v(19, () => mz, !0), anonymousGroupMessage: v(21, () => gz, !0), customElem: v(31, () => yz, !0), generalFlags: v(37, () => bz, !0), srcMsg: v(45, () => vz, !0), lightAppElem: v(51, () => wz, !0), commonElem: v(53, () => Sz, !0) }, Zq = { str: v(1, w.STRING, !0), lint: v(2, w.STRING, !0), attr6Buf: v(3, w.BYTES, !0), attr7Buf: v(4, w.BYTES, !0), buf: v(11, w.BYTES, !0), pbReserve: v(12, w.BYTES, !0) }, ez = { index: v(1, w.INT32, !0), old: v(2, w.BYTES, !0), buf: v(11, w.BYTES, !0) }, tz = { guid: v(1, w.BYTES), filePath: v(2, w.BYTES), oldVerSendFile: v(3, w.BYTES) }, nz = { filePath: v(1, w.STRING), fileLen: v(2, w.UINT32), downloadPath: v(3, w.STRING), oldVerSendFile: v(4, w.BYTES), imgType: v(5, w.INT32), previewsImage: v(6, w.BYTES), picMd5: v(7, w.BYTES), picHeight: v(8, w.UINT32), picWidth: v(9, w.UINT32), resId: v(10, w.STRING), flag: v(11, w.BYTES), thumbUrl: v(12, w.STRING), original: v(13, w.INT32), bigUrl: v(14, w.STRING), origUrl: v(15, w.STRING), bizType: v(16, w.INT32), result: v(17, w.INT32), index: v(18, w.INT32), opFaceBuf: v(19, w.BYTES), oldPicMd5: v(20, w.BOOL), thumbWidth: v(21, w.INT32), thumbHeight: v(22, w.INT32), fileId: v(23, w.INT32), showLen: v(24, w.UINT32), downloadLen: v(25, w.UINT32), x400Url: v(26, w.STRING), x400Width: v(27, w.INT32), x400Height: v(28, w.INT32), pbRes: v(29, () => rz) }, rz = { subType: v(1, w.INT32), field3: v(3, w.INT32), field4: v(4, w.INT32), summary: v(8, w.STRING), field10: v(10, w.INT32), field20: v(20, () => iz), url: v(30, w.STRING), md5Str: v(31, w.STRING) }, iz = { field1: v(1, w.INT32), field2: v(2, w.STRING), field3: v(3, w.INT32), field4: v(4, w.INT32), field5: v(5, w.INT32), field7: v(7, w.STRING) }, oz = { elemType: v(1, w.INT32), elemValue: v(2, w.BYTES) }, az = { faceName: v(1, w.STRING), itemType: v(2, w.INT32), faceInfo: v(3, w.INT32), faceId: v(4, w.BYTES), tabId: v(5, w.INT32), subType: v(6, w.INT32), key: v(7, w.STRING), param: v(8, w.BYTES), mediaType: v(9, w.INT32), imageWidth: v(10, w.INT32), imageHeight: v(11, w.INT32), mobileparam: v(12, w.BYTES), pbReserve: v(13, () => sz) }, sz = { field8: v(8, w.INT32) }, cz = { guid: v(1, w.BYTES), filePath: v(2, w.STRING), shortcut: v(3, w.STRING), buffer: v(4, w.BYTES), flag: v(5, w.BYTES), oldData: v(6, w.BYTES, !0), fileId: v(7, w.UINT32), serverIp: v(8, w.INT32, !0), serverPort: v(9, w.INT32, !0), fileType: v(10, w.INT32), signature: v(11, w.BYTES), useful: v(12, w.INT32), md5: v(13, w.BYTES), thumbUrl: v(14, w.STRING), bigUrl: v(15, w.STRING), origUrl: v(16, w.STRING), bizType: v(17, w.INT32), repeatIndex: v(18, w.INT32), repeatImage: v(19, w.INT32), imageType: v(20, w.INT32), index: v(21, w.INT32), width: v(22, w.INT32), height: v(23, w.INT32), source: v(24, w.INT32), size: v(25, w.UINT32), origin: v(26, w.INT32), thumbWidth: v(27, w.INT32, !0), thumbHeight: v(28, w.INT32, !0), showLen: v(29, w.INT32), downloadLen: v(30, w.INT32), x400Url: v(31, w.STRING, !0), x400Width: v(32, w.INT32), x400Height: v(33, w.INT32), pbRes: v(34, () => uz, !0) }, uz = { subType: v(1, w.INT32), summary: v(9, w.STRING) }, lz = { colorTextId: v(1, w.UINT32), msgId: v(2, w.UINT64), whisperSessionId: v(3, w.UINT32), pttChangeBit: v(4, w.UINT32), vipStatus: v(5, w.UINT32), compatibleId: v(6, w.UINT32), insts: v(7, () => u4, !1, !0), msgRptCnt: v(8, w.UINT32), srcInst: v(9, () => u4), longtitude: v(10, w.UINT32), latitude: v(11, w.UINT32), customFont: v(12, w.UINT32), pcSupportDef: v(13, () => dz), crmFlags: v(14, w.UINT32, !0) }, dz = { pcPtlBegin: v(1, w.UINT32), pcPtlEnd: v(2, w.UINT32), macPtlBegin: v(3, w.UINT32), macPtlEnd: v(4, w.UINT32), ptlsSupport: v(5, w.INT32, !1, !0), ptlsNotSupport: v(6, w.UINT32, !1, !0) }, u4 = { appId: v(1, w.UINT32), instId: v(2, w.UINT32) }, pz = { template1: v(1, w.BYTES, !0), serviceId: v(2, w.INT32, !0), msgResId: v(3, w.BYTES, !0), rand: v(4, w.INT32, !0), seq: v(5, w.UINT32, !0) }, fz = { filename: v(1, w.BYTES), fileSize: v(2, w.UINT64), fileId: v(3, w.BYTES), batchId: v(4, w.BYTES), fileKey: v(5, w.BYTES), mark: v(6, w.BYTES), sequence: v(7, w.UINT64), batchItemId: v(8, w.BYTES), feedMsgTime: v(9, w.INT32), pbReserve: v(10, w.BYTES) }, hz = { nick: v(1, w.BYTES), groupCard: v(2, w.BYTES), level: v(3, w.INT32), flags: v(4, w.INT32), groupMask: v(5, w.INT32), msgTailId: v(6, w.INT32), senderTitle: v(7, w.BYTES), apnsTips: v(8, w.BYTES), uin: v(9, w.UINT64), msgStateFlag: v(10, w.INT32), apnsSoundType: v(11, w.INT32), newGroupFlag: v(12, w.INT32) }, mz = { fileUuid: v(1, w.STRING), fileMd5: v(2, w.BYTES), fileName: v(3, w.STRING), fileFormat: v(4, w.INT32), fileTime: v(5, w.INT32), fileSize: v(6, w.INT32), thumbWidth: v(7, w.INT32), thumbHeight: v(8, w.INT32), thumbFileMd5: v(9, w.BYTES), source: v(10, w.BYTES), thumbFileSize: v(11, w.INT32), busiType: v(12, w.INT32), fromChatType: v(13, w.INT32), toChatType: v(14, w.INT32), boolSupportProgressive: v(15, w.BOOL), fileWidth: v(16, w.INT32), fileHeight: v(17, w.INT32), subBusiType: v(18, w.INT32), videoAttr: v(19, w.INT32), bytesThumbFileUrls: v(20, w.BYTES, !1, !0), bytesVideoFileUrls: v(21, w.BYTES, !1, !0), thumbDownloadFlag: v(22, w.INT32), videoDownloadFlag: v(23, w.INT32), pbReserve: v(24, w.BYTES) }, gz = { flags: v(1, w.INT32), anonId: v(2, w.BYTES), anonNick: v(3, w.BYTES), headPortrait: v(4, w.INT32), expireTime: v(5, w.INT32), bubbleId: v(6, w.INT32), rankColor: v(7, w.BYTES) }, yz = { desc: v(1, w.BYTES), data: v(2, w.BYTES), enumType: v(3, w.INT32), ext: v(4, w.BYTES), sound: v(5, w.BYTES) }, bz = { bubbleDiyTextId: v(1, w.INT32), groupFlagNew: v(2, w.INT32), uin: v(3, w.UINT64), rpId: v(4, w.BYTES), prpFold: v(5, w.INT32), longTextFlag: v(6, w.INT32), longTextResId: v(7, w.STRING, !0), groupType: v(8, w.INT32), toUinFlag: v(9, w.INT32), glamourLevel: v(10, w.INT32), memberLevel: v(11, w.INT32), groupRankSeq: v(12, w.UINT64), olympicTorch: v(13, w.INT32), babyqGuideMsgCookie: v(14, w.BYTES), uin32ExpertFlag: v(15, w.INT32), bubbleSubId: v(16, w.INT32), pendantId: v(17, w.UINT64), rpIndex: v(18, w.BYTES), pbReserve: v(19, w.BYTES) }, vz = { origSeqs: v(1, w.UINT32, !1, !0), senderUin: v(2, w.UINT64), time: v(3, w.INT32, !0), flag: v(4, w.INT32, !0), elems: v(5, () => uF, !1, !0), type: v(6, w.INT32, !0), richMsg: v(7, w.BYTES, !0), pbReserve: v(8, () => xz, !0), sourceMsg: v(9, w.BYTES, !0), toUin: v(10, w.UINT64, !0), troopName: v(11, w.BYTES, !0) }, xz = { messageId: v(3, w.UINT64), senderUid: v(6, w.STRING, !0), receiverUid: v(7, w.STRING, !0), friendSeq: v(8, w.UINT32, !0) }, wz = { data: v(1, w.BYTES), msgResid: v(2, w.BYTES, !0) }, Sz = { serviceType: v(1, w.INT32), pbElem: v(2, w.BYTES), businessType: v(3, w.UINT32) }; v(1, w.INT32, !0); const _z = { type: v(3, w.INT32, !0), uin: v(4, w.UINT32, !0), field5: v(5, w.INT32, !0), uid: v(9, w.STRING, !0) }, l4 = { AniStickerPackId: v(1, w.STRING, !0), AniStickerId: v(2, w.STRING, !0), faceId: v(3, w.INT32, !0), sourceType: v(4, w.INT32, !0), AniStickerType: v(5, w.INT32, !0), resultId: v(6, w.STRING, !0), preview: v(7, w.STRING, !0), randomType: v(9, w.INT32, !0) }, d4 = { faceId: v(1, w.UINT32), preview: v(2, w.STRING), preview2: v(3, w.STRING) }, Ez = { content: v(1, w.STRING) }; v(1, w.UINT32), v(2, w.UINT32); v(1, w.UINT32), v(2, w.UINT32), v(3, w.UINT32); v(1, w.UINT32); const Az = { type: v(1, w.UINT32), subType: v(2, w.UINT32, !0), c2cCmd: v(3, w.UINT32, !0), ranDom: v(4, w.UINT32, !0), sequence: v(5, w.UINT32, !0), timeStamp: v(6, w.UINT32, !0), pkgNum: v(7, w.UINT64, !0), pkgIndex: v(8, w.UINT32, !0), divSeq: v(9, w.UINT32, !0), autoReply: v(10, w.UINT32), ntMsgSeq: v(10, w.UINT32, !0), newId: v(12, w.UINT64, !0), forward: v(15, () => Rz, !0) }, Iz = { richText: v(1, () => Hq, !0), msgContent: v(2, w.BYTES, !0), msgEncryptContent: v(3, w.BYTES, !0) }; v(4, w.UINT32, !0), v(5, w.UINT32, !0), v(6, w.BYTES, !0), v(8, w.UINT32, !0), v(9, w.UINT32, !0), v(14, w.UINT32); v(1, w.INT32); const lF = { message: v(1, () => yl), status: v(3, w.INT32, !0), pingFlag: v(5, w.INT32, !0), generalFlag: v(9, w.INT32, !0) }, Cz = { operator: v(1, () => Tz, !0) }, Tz = { operatorUid: v(1, w.STRING, !0) }, p4 = { groupUin: v(1, w.UINT32), flag: v(2, w.UINT32), memberUid: v(3, w.STRING, !0), decreaseType: v(4, w.UINT32), operatorInfo: v(5, w.BYTES, !0), increaseType: v(6, w.UINT32), field7: v(7, w.BYTES, !0) }, kz = { seq: v(1, w.UINT64, !0) }, Nz = { code: v(1, w.STRING, !0), count: v(3, w.UINT32, !0), operatorUid: v(4, w.STRING, !0), type: v(5, w.UINT32, !0) }, Pz = { groupReactionTarget: v(2, () => kz, !0), groupReactionDataContent: v(3, () => Nz, !0) }, Dz = { data: v(1, () => Pz, !0) }, Oz = { data: v(1, () => Dz, !0) }, dF = { groupUin: v(4, w.UINT64, !0), field13: v(13, w.UINT32, !0), groupReactionData: v(44, () => Oz, !0) }, Fz = { groupUin: v(1, w.UINT32), field2: v(2, w.UINT32), field3: v(2, w.UINT32), field4: v(2, w.UINT32), invitorUid: v(5, w.STRING) }, yl = { responseHead: v(1, () => Mz), contentHead: v(2, () => Az), body: v(3, () => Iz, !0) }, Mz = { fromUin: v(1, w.UINT32), fromUid: v(2, w.STRING, !0), type: v(3, w.UINT32), sigMap: v(4, w.UINT32), toUin: v(5, w.UINT32), toUid: v(6, w.STRING, !0), forward: v(7, () => Bz, !0), grp: v(8, () => Uz, !0) }; v(2, w.UINT32), v(3, w.UINT32), v(4, w.UINT32), v(5, w.BYTES); v(1, w.STRING), v(2, w.STRING), v(3, w.UINT32), v(4, w.UINT64), v(5, w.UINT32), v(6, w.UINT32), v(7, w.UINT32), v(8, w.UINT32), v(9, w.UINT32); const Rz = { field1: v(1, w.UINT32, !0), field2: v(2, w.UINT32, !0), field3: v(3, w.UINT32, !0), unknownBase64: v(5, w.STRING, !0), avatar: v(6, w.STRING, !0) }; v(1, w.UINT32, !0); v(1, w.UINT32, !0), v(2, w.UINT32, !0); const Bz = { friendName: v(6, w.STRING, !0) }, Uz = { groupUin: v(1, w.UINT32), memberName: v(4, w.STRING), unknown5: v(5, w.UINT32), groupName: v(7, w.STRING) }; v(1, w.UINT64, !0), v(2, w.UINT32, !0), v(8, w.STRING, !0); v(1, w.UINT64), v(2, w.BYTES); const Wi = { ReqHead: v(1, () => pF), Upload: v(2, () => cH), Download: v(3, () => Gz), DownloadRKey: v(4, () => Vz), Delete: v(5, () => Yz), UploadCompleted: v(6, () => Jz), MsgInfoAuth: v(7, () => Xz), UploadKeyRenewal: v(8, () => eH), DownloadSafe: v(9, () => Zz), Extension: v(99, w.BYTES, !0) }, pF = { Common: v(1, () => fF), Scene: v(2, () => Lz), Client: v(3, () => $z) }, fF = { RequestId: v(1, w.UINT32), Command: v(2, w.UINT32) }, Lz = { RequestType: v(101, w.UINT32), BusinessType: v(102, w.UINT32), SceneType: v(200, w.UINT32), C2C: v(201, () => Qz, !0), Group: v(202, () => jz, !0) }, Qz = { AccountType: v(1, w.UINT32), TargetUid: v(2, w.STRING) }, jz = { GroupUin: v(1, w.UINT32) }, $z = { AgentType: v(1, w.UINT32) }, Gz = { Node: v(1, () => g0), Download: v(2, () => zz) }, g0 = { Info: v(1, () => hF), FileUuid: v(2, w.STRING), StoreId: v(3, w.UINT32), UploadTime: v(4, w.UINT32), Ttl: v(5, w.UINT32), SubType: v(6, w.UINT32) }, hF = { FileSize: v(1, w.UINT32), FileHash: v(2, w.STRING), FileSha1: v(3, w.STRING), FileName: v(4, w.STRING), Type: v(5, () => qz), Width: v(6, w.UINT32), Height: v(7, w.UINT32), Time: v(8, w.UINT32), Original: v(9, w.UINT32) }, qz = { Type: v(1, w.UINT32), PicFormat: v(2, w.UINT32), VideoFormat: v(3, w.UINT32), VoiceFormat: v(4, w.UINT32) }, zz = { Pic: v(1, () => Wz), Video: v(2, () => Hz), Ptt: v(3, () => Kz) }, Hz = { BusiType: v(1, w.UINT32), SceneType: v(2, w.UINT32), SubBusiType: v(3, w.UINT32) }, Wz = {}, Kz = {}, Vz = { Types: v(1, w.INT32, !1, !0) }, Yz = { Index: v(1, () => g0, !1, !0), NeedRecallMsg: v(2, w.BOOL), MsgSeq: v(3, w.UINT64), MsgRandom: v(4, w.UINT64), MsgTime: v(5, w.UINT64) }, Jz = { SrvSendMsg: v(1, w.BOOL), ClientRandomId: v(2, w.UINT64), MsgInfo: v(3, () => Zo), ClientSeq: v(4, w.UINT32) }, Xz = { Msg: v(1, w.BYTES), AuthTime: v(2, w.UINT64) }, Zz = { Index: v(1, () => g0) }, eH = { OldUKey: v(1, w.STRING), SubType: v(2, w.UINT32) }, Zo = { MsgInfoBody: v(1, () => mF, !1, !0), ExtBizInfo: v(2, () => yF) }, mF = { Index: v(1, () => g0), Picture: v(2, () => rH), Video: v(3, () => tH), Audio: v(4, () => nH), FileExist: v(5, w.BOOL), HashSum: v(6, w.BYTES) }, tH = {}, nH = {}, rH = { UrlPath: v(1, w.STRING), Ext: v(2, () => gF), Domain: v(3, w.STRING) }, gF = { OriginalParameter: v(1, w.STRING), BigParameter: v(2, w.STRING), ThumbParameter: v(3, w.STRING) }, iH = { VideoCodecFormat: v(1, w.UINT32) }, yF = { Pic: v(1, () => sH), Video: v(2, () => aH), Ptt: v(3, () => oH), BusiType: v(10, w.UINT32) }, oH = { SrcUin: v(1, w.UINT64), PttScene: v(2, w.UINT32), PttType: v(3, w.UINT32), ChangeVoice: v(4, w.UINT32), Waveform: v(5, w.BYTES), AutoConvertText: v(6, w.UINT32), BytesReserve: v(11, w.BYTES), BytesPbReserve: v(12, w.BYTES), BytesGeneralFlags: v(13, w.BYTES) }, aH = { FromScene: v(1, w.UINT32), ToScene: v(2, w.UINT32), BytesPbReserve: v(3, w.BYTES) }, sH = { BizType: v(1, w.UINT32), TextSummary: v(2, w.STRING), BytesPbReserveC2c: v(11, () => lH), BytesPbReserveTroop: v(12, () => dH), FromScene: v(1001, w.UINT32), ToScene: v(1002, w.UINT32), OldFileId: v(1003, w.UINT32) }, cH = { UploadInfo: v(1, () => uH, !1, !0), TryFastUploadCompleted: v(2, w.BOOL), SrvSendMsg: v(3, w.BOOL), ClientRandomId: v(4, w.UINT64), CompatQMsgSceneType: v(5, w.UINT32), ExtBizInfo: v(6, () => yF), ClientSeq: v(7, w.UINT32), NoNeedCompatMsg: v(8, w.BOOL) }, uH = { FileInfo: v(1, () => hF), SubFileType: v(2, w.UINT32) }, lH = { subType: v(1, w.UINT32), field3: v(3, w.UINT32), field4: v(4, w.UINT32), field8: v(8, w.STRING), field10: v(10, w.UINT32), field12: v(12, w.STRING), field18: v(18, w.STRING), field19: v(19, w.STRING), field20: v(20, w.BYTES) }, dH = { subType: v(1, w.UINT32), field3: v(3, w.UINT32), field4: v(4, w.UINT32), field9: v(9, w.STRING), field10: v(10, w.UINT32), field12: v(12, w.STRING), field18: v(18, w.STRING), field19: v(19, w.STRING), field21: v(21, w.BYTES) }, Ki = { respHead: v(1, () => pH), upload: v(2, () => mH), download: v(3, () => fH), downloadRKey: v(4, () => _H), delete: v(5, () => SH), uploadCompleted: v(6, () => wH), msgInfoAuth: v(7, () => xH), uploadKeyRenewal: v(8, () => vH), downloadSafe: v(9, () => bH), extension: v(99, w.BYTES, !0) }, pH = { common: v(1, () => fF), retCode: v(2, w.UINT32), message: v(3, w.STRING) }, fH = { rKeyParam: v(1, w.STRING), rKeyTtlSecond: v(2, w.UINT32), info: v(3, () => hH), rKeyCreateTime: v(4, w.UINT32) }, hH = { domain: v(1, w.STRING), urlPath: v(2, w.STRING), httpsPort: v(3, w.UINT32), ipv4s: v(4, () => rE, !1, !0), ipv6s: v(5, () => iE, !1, !0), picUrlExtInfo: v(6, () => gF), videoExtInfo: v(7, () => iH) }, rE = { outIP: v(1, w.UINT32), outPort: v(2, w.UINT32), inIP: v(3, w.UINT32), inPort: v(4, w.UINT32), ipType: v(5, w.UINT32) }, iE = { outIP: v(1, w.BYTES), outPort: v(2, w.UINT32), inIP: v(3, w.BYTES), inPort: v(4, w.UINT32), ipType: v(5, w.UINT32) }, mH = { uKey: v(1, w.STRING, !0), uKeyTtlSecond: v(2, w.UINT32), ipv4s: v(3, () => rE, !1, !0), ipv6s: v(4, () => iE, !1, !0), msgSeq: v(5, w.UINT64), msgInfo: v(6, () => Zo), ext: v(7, () => gH, !1, !0), compatQMsg: v(8, w.BYTES), subFileInfos: v(10, () => yH, !1, !0) }, gH = { subType: v(1, w.UINT32), extType: v(2, w.UINT32), extValue: v(3, w.BYTES) }, yH = { subType: v(1, w.UINT32), uKey: v(2, w.STRING), uKeyTtlSecond: v(3, w.UINT32), ipv4s: v(4, () => rE, !1, !0), ipv6s: v(5, () => iE, !1, !0) }, bH = {}, vH = { ukey: v(1, w.STRING), ukeyTtlSec: v(2, w.UINT64) }, xH = { authCode: v(1, w.UINT32), msg: v(2, w.BYTES), resultTime: v(3, w.UINT64) }, wH = { msgSeq: v(1, w.UINT64) }, SH = {}, _H = { rKeys: v(1, () => EH, !1, !0) }, EH = { rkey: v(1, w.STRING), rkeyTtlSec: v(2, w.UINT64), storeId: v(3, w.UINT32), rkeyCreateTime: v(4, w.UINT32, !0), type: v(5, w.UINT32, !0) }, y0 = { file: v(1, () => AH, !0), download: v(3, () => IH, !0), delete: v(4, () => CH, !0), rename: v(5, () => TH, !0), move: v(6, () => kH, !0) }, AH = { groupUin: v(1, w.UINT32), appId: v(2, w.UINT32), busId: v(3, w.UINT32), entrance: v(4, w.UINT32), targetDirectory: v(5, w.STRING), fileName: v(6, w.STRING), localDirectory: v(7, w.STRING), fileSize: v(8, w.UINT64), fileSha1: v(9, w.BYTES), fileSha3: v(10, w.BYTES), fileMd5: v(11, w.BYTES), field15: v(15, w.BOOL) }, IH = { groupUin: v(1, w.UINT32), appId: v(2, w.UINT32), busId: v(3, w.UINT32), fileId: v(4, w.STRING) }, CH = { groupUin: v(1, w.UINT32), busId: v(3, w.UINT32), fileId: v(5, w.STRING) }, TH = { groupUin: v(1, w.UINT32), busId: v(3, w.UINT32), fileId: v(4, w.STRING), parentFolder: v(5, w.STRING), newFileName: v(6, w.STRING) }, kH = { groupUin: v(1, w.UINT32), appId: v(2, w.UINT32), busId: v(3, w.UINT32), fileId: v(4, w.STRING), parentDirectory: v(5, w.STRING), targetDirectory: v(6, w.STRING) }, b0 = { upload: v(1, () => NH), download: v(3, () => PH), delete: v(4, () => Sy), rename: v(5, () => Sy), move: v(6, () => Sy) }, NH = { retCode: v(1, w.INT32), retMsg: v(2, w.STRING), clientWording: v(3, w.STRING), uploadIp: v(4, w.STRING), serverDns: v(5, w.STRING), busId: v(6, w.INT32), fileId: v(7, w.STRING), checkKey: v(8, w.BYTES), fileKey: v(9, w.BYTES), boolFileExist: v(10, w.BOOL), uploadIpLanV4: v(12, w.STRING, !1, !0), uploadIpLanV6: v(13, w.STRING, !1, !0), uploadPort: v(14, w.UINT32) }, PH = { retCode: v(1, w.INT32), retMsg: v(2, w.STRING), clientWording: v(3, w.STRING), downloadIp: v(4, w.STRING), downloadDns: v(5, w.STRING), downloadUrl: v(6, w.BYTES), fileSha1: v(7, w.BYTES), fileSha3: v(8, w.BYTES), fileMd5: v(9, w.BYTES), cookieVal: v(10, w.BYTES), saveFileName: v(11, w.STRING), previewPort: v(12, w.UINT32) }, Sy = { retCode: v(1, w.INT32), retMsg: v(2, w.STRING), clientWording: v(3, w.STRING) }, DH = { targetUid: v(1, w.STRING), specialTitle: v(5, w.STRING, !0), expiredTime: v(6, w.INT32), uinName: v(7, w.STRING, !0), targetName: v(8, w.STRING) }, OH = { groupUin: v(1, w.UINT32), body: v(3, () => DH) }, FH = { ReqHead: v(1, () => pF), DownloadRKeyReq: v(4, () => MH) }, MH = { key: v(1, w.INT32, !1, !0) }, RH = { rkey: v(1, w.STRING), ttl: v(2, w.UINT64), time: v(4, w.UINT32), type: v(5, w.UINT32) }, BH = { rkeyList: v(1, () => RH, !1, !0) }, UH = { data: v(4, () => BH) }, LH = { groupUin: v(1, w.UINT32), chatType: v(2, w.UINT32) }, QH = { content: v(1, () => jH, !1, !0) }, jH = { category: v(1, w.STRING), voices: v(2, () => $H, !1, !0) }, $H = { voiceId: v(1, w.STRING), voiceDisplayName: v(2, w.STRING), voiceExampleUrl: v(3, w.STRING) }, GH = { groupUin: v(1, w.UINT32), voiceId: v(2, w.STRING), text: v(3, w.STRING), chatType: v(4, w.UINT32), session: v(5, () => qH) }, qH = { sessionId: v(1, w.UINT32) }, zH = { statusCode: v(1, w.UINT32), field2: v(2, w.UINT32, !0), field3: v(3, w.UINT32), msgInfo: v(4, () => Zo, !0) }, HH = { subCommand: v(1, w.UINT32, !0), field2: v(2, w.INT32, !0), body: v(14, () => WH, !0), field101: v(101, w.INT32, !0), field102: v(102, w.INT32, !0), field200: v(200, w.INT32, !0), field99999: v(99999, w.BYTES, !0) }, WH = { receiverUid: v(10, w.STRING, !0), fileUuid: v(20, w.STRING, !0), type: v(30, w.INT32, !0), fileHash: v(60, w.STRING, !0), t2: v(601, w.INT32, !0) }, KH = { command: v(1, w.UINT32, !0), subCommand: v(2, w.UINT32, !0), body: v(14, () => VH, !0), field50: v(50, w.UINT32, !0) }, VH = { field10: v(10, w.UINT32, !0), state: v(20, w.STRING, !0), result: v(30, () => YH, !0), metadata: v(40, () => JH, !0) }, YH = { server: v(20, w.STRING, !0), port: v(40, w.UINT32, !0), url: v(50, w.STRING, !0), additionalServer: v(60, w.STRING, !1, !0), ssoPort: v(80, w.UINT32, !0), ssoUrl: v(90, w.STRING, !0), extra: v(120, w.BYTES, !0) }, JH = { uin: v(1, w.UINT32, !0), field2: v(2, w.UINT32, !0), field3: v(3, w.UINT32, !0), size: v(4, w.UINT32, !0), timestamp: v(5, w.UINT32, !0), fileUuid: v(6, w.STRING, !0), fileName: v(7, w.STRING, !0), field100: v(100, w.BYTES, !0), field101: v(101, w.BYTES, !0), field110: v(110, w.UINT32, !0), timestamp1: v(130, w.UINT32, !0), fileHash: v(140, w.STRING, !0), field141: v(141, w.BYTES, !0), field142: v(142, w.BYTES, !0) }, XH = { command: v(1, w.UINT32, !0), seq: v(2, w.INT32, !0), upload: v(19, () => ZH, !0), businessId: v(101, w.INT32, !0), clientType: v(102, w.INT32, !0), flagSupportMediaPlatform: v(200, w.INT32, !0) }, ZH = { senderUid: v(10, w.STRING, !0), receiverUid: v(20, w.STRING, !0), fileSize: v(30, w.UINT32, !0), fileName: v(40, w.STRING, !0), md510MCheckSum: v(50, w.BYTES, !0), sha1CheckSum: v(60, w.BYTES, !0), localPath: v(70, w.STRING, !0), md5CheckSum: v(110, w.BYTES, !0), sha3CheckSum: v(120, w.BYTES, !0) }, eW = { subCommand: v(1, w.UINT32), field2: v(2, w.INT32), body: v(10, () => tW, !0), field101: v(101, w.INT32), field102: v(102, w.INT32), field200: v(200, w.INT32) }, tW = { senderUid: v(10, w.STRING, !0), receiverUid: v(20, w.STRING, !0), fileUuid: v(30, w.STRING, !0), fileHash: v(40, w.STRING, !0) }, bF = { command: v(1, w.UINT32), seq: v(2, w.INT32), upload: v(19, () => nW, !0), businessId: v(101, w.INT32), clientType: v(102, w.INT32), flagSupportMediaPlatform: v(200, w.INT32) }, nW = { retCode: v(10, w.INT32), retMsg: v(20, w.STRING, !0), totalSpace: v(30, w.INT64), usedSpace: v(40, w.INT64), uploadedSize: v(50, w.INT64), uploadIp: v(60, w.STRING, !0), uploadDomain: v(70, w.STRING, !0), uploadPort: v(80, w.UINT32), uuid: v(90, w.STRING, !0), uploadKey: v(100, w.BYTES, !0), boolFileExist: v(110, w.BOOL), packSize: v(120, w.INT32), uploadIpList: v(130, w.STRING, !1, !0), // repeated uploadHttpsPort: v(140, w.INT32), uploadHttpsDomain: v(150, w.STRING, !0), uploadDns: v(160, w.STRING, !0), uploadLanip: v(170, w.STRING, !0), fileAddon: v(200, w.STRING, !0), mediaPlatformUploadKey: v(220, w.BYTES, !0) }; v(1, w.UINT32, !0), v(2, w.UINT32, !0), v(50, w.UINT32, !0); v(10, w.UINT32, !0); const rW = { value: v(1, w.STRING) }, iW = { inner: v(2, () => rW) }, oW = { uin: v(1, w.STRING), groupUin: v(2, w.STRING), version: v(3, w.STRING) }, aW = { body: v(2, () => oW) }, sW = { uin: v(1, w.UINT32), groupUin: v(2, w.UINT32), friendUin: v(5, w.UINT32), ext: v(6, w.UINT32, !0) }, cW = { uin: v(1, w.UINT32), key: v(3, () => uW, !1, !0) }, uW = { key: v(1, w.UINT32) }, lW = { key: v(1, w.UINT32), value: v(2, w.UINT64) }, dW = { status: v(2, () => lW) }, pW = { data: v(1, () => dW) }, CS = { command: v(1, w.UINT32), subCommand: v(2, w.UINT32), errorCode: v(3, w.UINT32), body: v(4, w.BYTES), errorMsg: v(5, w.STRING, !0), isReserved: v(12, w.UINT32) }; v(4, w.BYTES); const fW = { version: v(1, w.UINT32), client: v(2, w.UINT32), entrance: v(3, w.UINT32), ocrReqBody: v(10, () => hW, !0) }, hW = { imageUrl: v(1, w.STRING), languageType: v(2, w.UINT32), scene: v(3, w.UINT32), originMd5: v(10, w.STRING), afterCompressMd5: v(11, w.STRING), afterCompressFileSize: v(12, w.STRING), afterCompressWeight: v(13, w.STRING), afterCompressHeight: v(14, w.STRING), isCut: v(15, w.BOOL) }, mW = { retCode: v(1, w.INT32), errMsg: v(2, w.STRING), wording: v(3, w.STRING), ocrRspBody: v(10, () => gW) }, gW = { textDetections: v(1, () => yW, !1, !0), language: v(2, w.STRING), requestId: v(3, w.STRING), ocrLanguageList: v(101, w.STRING, !1, !0), dstTranslateLanguageList: v(102, w.STRING, !1, !0), languageList: v(103, () => xW, !1, !0), afterCompressWeight: v(111, w.UINT32), afterCompressHeight: v(112, w.UINT32) }, yW = { detectedText: v(1, w.STRING), confidence: v(2, w.UINT32), polygon: v(3, () => bW), advancedInfo: v(4, w.STRING) }, bW = { coordinates: v(1, () => vW, !1, !0) }, vW = { x: v(1, w.INT32), y: v(2, w.INT32) }, xW = { languageCode: v(1, w.STRING), languageDesc: v(2, w.STRING) }, oE = { groupUin: v(1, w.UINT32), msgSeq: v(2, w.UINT64) }; class vF { trans; logger; constructor(e, n) { this.trans = e, this.logger = n; } // TODO: 没用到的加密方法先注释掉 // private encryptTransExt (key: Uint8Array) { // if (!this.trans.encrypt) return; // this.trans.ext = tea.encrypt(Buffer.from(this.trans.ext), Buffer.from(key)); // } timeout() { return new Promise((e, n) => { setTimeout( () => { n(new Error(`[Highway] timeout after ${this.trans.timeout}s`)); }, (this.trans.timeout ?? 1 / 0) * 1e3 ); }); } buildPicUpHead(e, n, r) { return new he(kq).encode({ msgBaseHead: { version: 1, uin: this.trans.uin, command: "PicUp.DataUp", seq: 0, retryTimes: 0, appId: 1600001604, dataFlag: 16, commandId: this.trans.cmd }, msgSegHead: { serviceId: 0, filesize: BigInt(this.trans.size), dataOffset: BigInt(e), dataLength: n, serviceTicket: this.trans.ticket, md5: r, fileMd5: this.trans.sum, cacheAddr: 0, cachePort: 0 }, bytesReqExtendInfo: this.trans.ext, timestamp: BigInt(0), msgLoginSigHead: { uint32LoginSigType: 8, appId: 1600001604 } }); } } class wW extends QL.Transform { uploader; offset; constructor(e) { super(), this.uploader = e, this.offset = 0; } _transform(e, n, r) { let i = 0; for (; i < e.length; ) { const o = Math.min(Mn, e.length - i), a = e.subarray(i, i + o), s = La.createHash("md5").update(a).digest(), c = this.uploader.buildPicUpHead(this.offset, a.length, s); i += a.length, this.offset += a.length, this.push(eg.pack(Buffer.from(c), a)); } r(null); } } class SW extends vF { async upload() { const e = new AbortController(), { signal: n } = e, r = new Promise((o, a) => { const s = new wW(this), c = a7.connect(this.trans.port, this.trans.server, () => { this.trans.data.pipe(s).pipe(c, { end: !1 }); }), u = (d) => { const p = new he(rF).decode(d); p.errorCode !== 0 && (c.end(), a(new Error(`[Highway] tcpUpload failed (code=${p.errorCode})`))); const f = ((Number(p.msgSegHead?.dataOffset) + Number(p.msgSegHead?.dataLength)) / Number(p.msgSegHead?.filesize)).toFixed(2); this.logger.debug(`[Highway] tcpUpload ${p.errorCode} | ${f} | ${Buffer.from(d).toString("hex")}`), Number(p.msgSegHead?.dataOffset) + Number(p.msgSegHead?.dataLength) >= Number(p.msgSegHead?.filesize) && (this.logger.debug("[Highway] tcpUpload finished."), c.end(), o()); }; c.on("data", (d) => { n.aborted && (c.end(), a(new Error("Upload aborted due to timeout"))); const [p] = eg.unpack(d); u(p); }), c.on("close", () => { this.logger.debug("[Highway] tcpUpload socket closed."), o(); }), c.on("error", (d) => { c.end(), a(new Error(`[Highway] tcpUpload socket.on error: ${d}`)); }), this.trans.data.on("error", (d) => { c.end(), a(new Error(`[Highway] tcpUpload readable error: ${d}`)); }); }), i = this.timeout().catch((o) => { throw e.abort(), new Error(o.message); }); await Promise.race([r, i]); } } class _W extends vF { async upload() { const e = new AbortController(), { signal: n } = e, r = (async () => { let o = 0; for await (const a of this.trans.data) { if (n.aborted) throw new Error("Upload aborted due to timeout"); const s = a; try { await this.uploadBlock(s, o); } catch (c) { throw new Error(`[Highway] httpUpload Error uploading block at offset ${o}: ${c}`); } o += s.length; } })(), i = this.timeout().catch((o) => { throw e.abort(), new Error(o.message); }); await Promise.race([r, i]); } async uploadBlock(e, n) { const r = La.createHash("md5").update(e).digest(), i = this.buildPicUpHead(n, e.length, r), o = eg.pack(Buffer.from(i), e), a = await this.httpPostHighwayContent(o, `http://${this.trans.server}:${this.trans.port}/cgi-bin/httpconn?htcmd=0x6FF0087&uin=${this.trans.uin}`), [s, c] = eg.unpack(a), u = new he(rF).decode(s); if (this.logger.debug(`[Highway] httpUploadBlock: ${u.errorCode} | ${u.msgSegHead?.retCode} | ${u.bytesRspExtendInfo} | ${s.toString("hex")} | ${c.toString("hex")}`), u.errorCode !== 0) throw new Error(`[Highway] httpUploadBlock failed (code=${u.errorCode})`); } async httpPostHighwayContent(e, n) { return new Promise((r, i) => { try { const o = { method: "POST", headers: { Connection: "keep-alive", "Accept-Encoding": "identity", "User-Agent": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2)", "Content-Length": e.length.toString() } }, a = fp.request(n, o, (s) => { const c = []; s.on("data", (u) => { c.push(u); }), s.on("end", () => { r(Buffer.concat(c)); }); }); a.write(e), a.on("error", (s) => { i(s); }); } catch (o) { i(new Error(o.message)); } }); } } class EW { sig; server = "htdata3.qq.com"; port = 80; logger; constructor(e, n, r = "htdata3.qq.com", i = 80) { this.sig = e, this.logger = n; } changeServer(e, n) { this.server = e, this.port = n; } buildDataUpTrans(e, n, r, i, o, a = 1200) { return { uin: this.sig.uin, cmd: e, command: "PicUp.DataUp", data: n, sum: i, size: r, ticket: this.sig.sigSession, ext: o, encrypt: !1, timeout: a, server: this.server, port: this.port }; } async upload(e, n, r, i, o) { const a = this.buildDataUpTrans(e, n, r, i, o); try { await new SW(a, this.logger).upload(); } catch (s) { this.logger.error(`[Highway] upload failed: ${s}, fallback to http upload`); try { await new _W(a, this.logger).upload(); } catch (c) { throw this.logger.error(`[Highway] http upload failed: ${c}`), c; } } } } class aE { static build(e, n, r, i, o, a, s) { const c = s ?? kD.randomUUID(), u = n.some((d) => d.isGroupMsg); return r || (r = n.length === 0 ? "聊天记录" : u ? "群聊的聊天记录" : n.map((d) => d.senderName).filter((d, p, f) => f.indexOf(d) === p).slice(0, 4).join("和") + "的聊天记录"), i || (i = n.length === 0 ? [{ text: "Nya~ This message is send from NapCat.Packet!" }] : n.map((d) => ({ text: `${d.senderName}: ${d.msg?.map((p) => p.preview).join("")}` }))), o || (o = `查看${n.length}条转发消息`), a || (a = "[聊天记录]"), { app: "com.tencent.multimsg", config: { autosize: 1, forward: 1, round: 1, type: "normal", width: 300 }, desc: a, extra: { filename: c, tsum: n.length }, meta: { detail: { news: i, resid: e, source: r, summary: o, uniseq: c } }, prompt: a, ver: "0.0.0.5", view: "contact" }; } static fromResId(e) { return this.build(e, []); } static fromPacketMsg(e, n, r, i, o, a, s) { return this.build( e, n.map((c) => ({ senderName: c.senderName, isGroupMsg: c.groupId !== void 0, msg: c.msg.map((u) => ({ preview: u.valid ? u.toPreview() : "[该消息类型暂不支持查看]" })) })), r, i, o, a, s ); } } class Po { constructor(e) { } get valid() { return !0; } buildContent() { } buildElement() { return []; } static parseElement; toPreview() { return "[暂不支持该消息类型喵~]"; } } class ng extends Po { text; constructor(e) { super(e), this.text = e.textElement.content; } buildElement() { return [{ text: { str: this.text } }]; } static parseElement = (e) => { if (e.text?.str && (e.text?.attr6Buf === void 0 || e.text?.attr6Buf?.length === 0)) return [{ textElement: { content: e.text?.str, atType: Hr.ATTYPEUNKNOWN, atUid: "", atTinyId: "", atNtUid: "" }, elementType: Ee.UNKNOWN, elementId: "" }, null]; }; toPreview() { return this.text; } } class f4 extends ng { targetUid; atAll; constructor(e) { super(e), this.targetUid = e.textElement.atNtUid, this.atAll = e.textElement.atType === Hr.ATTYPEALL; } buildElement() { return [{ text: { str: this.text, pbReserve: new he(_z).encode( { type: this.atAll ? 1 : 2, uin: 0, field5: 0, uid: this.targetUid } ) } }]; } static parseElement = (e) => { if (e.text?.str && (e.text?.attr6Buf?.length ?? 100) >= 11) return [{ textElement: { content: e.text?.str, atType: Hr.ATTYPEONE, atUid: String(Buffer.from(e.text.attr6Buf).readUInt32BE(7)), // FIXME: hack atTinyId: "", atNtUid: "" }, elementType: Ee.UNKNOWN, elementId: "" }, null]; }; } class TS extends Po { time; targetMessageId; targetMessageSeq; targetMessageClientSeq; targetUin; targetUid; targetElems; targetSourceMsg; targetPeer; constructor(e) { super(e), this.time = +(e.replyElement.replyMsgTime ?? Math.floor(Date.now() / 1e3)), this.targetMessageId = BigInt(e.replyElement.replayMsgId ?? 0), this.targetMessageSeq = +(e.replyElement.replayMsgSeq ?? 0), this.targetMessageClientSeq = +(e.replyElement.replyMsgClientSeq ?? 0), this.targetUin = +(e.replyElement.senderUin ?? 0), this.targetUid = e.replyElement.senderUidStr ?? "", this.targetPeer = e.replyElement._replyMsgPeer; } get isGroupReply() { return this.targetMessageClientSeq === 0; } buildElement() { return [{ srcMsg: { origSeqs: [this.isGroupReply ? this.targetMessageSeq : this.targetMessageClientSeq], senderUin: BigInt(this.targetUin), time: this.time, elems: this.targetElems ?? [], sourceMsg: new he(yl).encode(this.targetSourceMsg ?? {}), toUin: BigInt(0) } }]; } static parseElement = (e) => { if (e.srcMsg && e.srcMsg.pbReserve) { const n = e.srcMsg.pbReserve; return [{ replyElement: { replayMsgSeq: String(n.friendSeq ?? e.srcMsg?.origSeqs?.[0] ?? 0), replayMsgId: String(n.messageId ?? 0), senderUin: String(e?.srcMsg ?? 0) }, elementType: Ee.UNKNOWN, elementId: "" }, null]; } }; toPreview() { return "[回复消息]"; } } class AW extends Po { faceId; isLargeFace; resultId; constructor(e) { super(e), this.faceId = e.faceElement.faceIndex, this.resultId = e.faceElement.resultId, this.isLargeFace = e.faceElement.faceType === ls.AniSticke; } buildElement() { return this.isLargeFace ? [{ commonElem: { serviceType: 37, pbElem: new he(l4).encode({ aniStickerPackId: "1", aniStickerId: "8", faceId: this.faceId, sourceType: 1, resultId: this.resultId, preview: "", randomType: 1 }), businessType: 1 } }] : this.faceId < 260 ? [{ face: { index: this.faceId } }] : [{ commonElem: { serviceType: 33, pbElem: new he(d4).encode({ faceId: this.faceId, preview: "", preview2: "" }), businessType: 1 } }]; } static parseElement = (e) => { if (e.face?.index) return [{ faceElement: { faceIndex: e.face.index, faceType: ls.Normal }, elementType: Ee.UNKNOWN, elementId: "" }, null]; if (e?.commonElem?.serviceType === 37 && e?.commonElem?.pbElem) { const n = new he(l4).decode(e?.commonElem?.pbElem); if (n?.faceId) return [{ faceElement: { faceIndex: n.faceId, faceType: ls.Normal }, elementType: Ee.UNKNOWN, elementId: "" }, null]; } if (e?.commonElem?.serviceType === 33 && e?.commonElem?.pbElem) { const n = new he(d4).decode(e?.commonElem?.pbElem); if (n?.faceId) return [{ faceElement: { faceIndex: n.faceId, faceType: ls.Normal }, elementType: Ee.UNKNOWN, elementId: "" }, null]; } }; toPreview() { return "[表情]"; } } class IW extends Po { emojiName; emojiId; emojiPackageId; emojiKey; constructor(e) { super(e), this.emojiName = e.marketFaceElement.faceName, this.emojiId = e.marketFaceElement.emojiId, this.emojiPackageId = e.marketFaceElement.emojiPackageId, this.emojiKey = e.marketFaceElement.key; } buildElement() { return [{ marketFace: { faceName: this.emojiName, itemType: 6, faceInfo: 1, faceId: Buffer.from(this.emojiId, "hex"), tabId: this.emojiPackageId, subType: 3, key: this.emojiKey, imageWidth: 300, imageHeight: 300, pbReserve: { field8: 1 } } }]; } toPreview() { return `${this.emojiName}`; } } class kS extends Po { path; name; size; md5; width; height; picType; picSubType; summary; sha1 = null; msgInfo = null; groupPicExt = null; c2cPicExt = null; constructor(e) { super(e), this.path = e.picElement.sourcePath, this.name = e.picElement.fileName, this.size = +e.picElement.fileSize, this.md5 = e.picElement.md5HexStr ?? "", this.width = e.picElement.picWidth, this.height = e.picElement.picHeight, this.picType = e.picElement.picType, this.picSubType = e.picElement.picSubType ?? 0, this.summary = e.picElement.summary === "" ? e.picElement.picSubType === 0 ? "[图片]" : "[动画表情]" : e.picElement.summary; } get valid() { return !!this.msgInfo; } buildElement() { return this.msgInfo ? [{ commonElem: { serviceType: 48, pbElem: new he(Zo).encode(this.msgInfo), businessType: 10 } }] : []; } static parseElement = (e) => { if (e?.commonElem?.serviceType === 48 && [10, 20].includes(e.commonElem.businessType ?? 0) && e.commonElem.pbElem) { const i = new he(Zo).decode(e.commonElem.pbElem).msgInfoBody[0]?.index; return [{ picElement: { fileSize: i?.info.fileSize ?? 0, picWidth: i?.info?.width ?? 0, picHeight: i?.info?.height ?? 0, fileName: i?.info?.fileHash ?? "", sourcePath: "", original: !1, picType: gp.NEWPIC_APNG, fileUuid: "", fileSubId: "", thumbFileSize: 0, summary: "[图片]", thumbPath: /* @__PURE__ */ new Map() }, elementType: Ee.PIC, elementId: "" }, e]; } if (e?.notOnlineImage) { const n = e?.notOnlineImage, r = { picElement: { fileSize: n.fileLen ?? 0, picWidth: n.picWidth ?? 0, picHeight: n.picHeight ?? 0, fileName: Buffer.from(n.picMd5).toString("hex") ?? "", sourcePath: "", original: !1, picType: gp.NEWPIC_APNG, fileUuid: "", fileSubId: "", thumbFileSize: 0, summary: "[图片]", thumbPath: /* @__PURE__ */ new Map() }, elementType: Ee.UNKNOWN, elementId: "" }; return n.origUrl?.includes("&fileid=") ? r.picElement.originImageUrl = `https://multimedia.nt.qq.com.cn${n.origUrl}` : r.picElement.originImageUrl = `https://gchat.qpic.cn${n.origUrl}`, [r, e]; } }; toPreview() { return this.summary; } } class NS extends Po { fileName; fileSize; filePath; fileTime; fileFormat; fileWidth; fileHeight; thumbSize; thumbPath; fileMd5; fileSha1; thumbMd5; thumbSha1; thumbWidth; thumbHeight; businessType = 21; msgInfo = null; constructor(e) { super(e), this.fileName = e.videoElement.fileName, this.fileSize = e.videoElement.fileSize, this.filePath = e.videoElement.filePath, this.fileTime = Math.max(0, Math.round(e.videoElement.fileTime ?? 0)), this.fileFormat = e.videoElement.fileFormat ?? Fr.VIDEO_FORMAT_MP4, this.fileWidth = e.videoElement.fileWidth, this.fileHeight = e.videoElement.fileHeight, this.thumbSize = e.videoElement.thumbSize, this.thumbPath = e.videoElement.thumbPath?.get(0), this.fileMd5 = e.videoElement.videoMd5, this.thumbMd5 = e.videoElement.thumbMd5, this.thumbWidth = e.videoElement.thumbWidth, this.thumbHeight = e.videoElement.thumbHeight; } get valid() { return !!this.msgInfo; } buildElement() { return this.msgInfo ? [{ commonElem: { serviceType: 48, pbElem: new he(Zo).encode(this.msgInfo), businessType: this.businessType } }] : []; } static parseElement = (e) => { if (e?.commonElem?.serviceType !== 48 || ![11, 21].includes(e.commonElem.businessType ?? 0) || !e.commonElem.pbElem) return; const n = new he(Zo).decode(e.commonElem.pbElem), r = n.msgInfoBody[0]?.index, i = n.msgInfoBody[1]?.index; if (r) return [{ videoElement: { filePath: "", fileName: r.info.fileName || r.info.fileHash, videoMd5: r.info.fileHash, thumbMd5: i?.info.fileHash, fileTime: r.info.time, fileFormat: r.info.type.videoFormat || Fr.VIDEO_FORMAT_MP4, fileSize: String(r.info.fileSize), fileWidth: r.info.width, fileHeight: r.info.height, thumbWidth: i?.info.width, thumbHeight: i?.info.height, thumbSize: i?.info.fileSize, thumbPath: /* @__PURE__ */ new Map(), fileUuid: r.fileUuid, busiType: 0, subBusiType: 0 }, elementType: Ee.VIDEO, elementId: "" }, e]; }; toPreview() { return "[视频]"; } } class xF extends Po { filePath; fileSize; fileMd5; fileSha1; fileDuration; msgInfo = null; constructor(e) { super(e), this.filePath = e.pttElement.filePath, this.fileSize = +e.pttElement.fileSize, this.fileMd5 = e.pttElement.md5HexStr, this.fileDuration = Math.round(e.pttElement.duration); } get valid() { return !1; } buildElement() { return this.msgInfo ? [{ commonElem: { serviceType: 48, pbElem: new he(Zo).encode(this.msgInfo), businessType: 22 } }] : []; } toPreview() { return "[语音]"; } } class wF extends Po { fileName; filePath; fileSize; fileSha1; fileMd5; fileUuid; fileHash; isGroupFile; _private_send_uid; _private_recv_uid; _e37_800_rsp; constructor(e) { super(e), this.fileName = e.fileElement.fileName, this.filePath = e.fileElement.filePath, this.fileSize = +e.fileElement.fileSize; } get valid() { return this.isGroupFile || !!this._e37_800_rsp; } buildContent() { if (!(this.isGroupFile || !this._e37_800_rsp)) return new he(Wq).encode({ file: { fileType: 0, fileUuid: this.fileUuid, fileMd5: this.fileMd5, fileName: this.fileName, fileSize: BigInt(this.fileSize), subcmd: 1, dangerEvel: 0, expireTime: Math.floor(Date.now() / 1e3) + 10080 * 60, fileHash: this.fileHash }, field6: { field2: { field1: this._e37_800_rsp?.body?.field30?.field110, fileUuid: this.fileUuid, fileName: this.fileName, field6: this._e37_800_rsp?.body?.field30?.field3, field7: this._e37_800_rsp?.body?.field30?.field101, field8: this._e37_800_rsp?.body?.field30?.field100, timestamp1: this._e37_800_rsp?.body?.field30?.timestamp1, fileHash: this.fileHash, selfUid: this._private_send_uid, destUid: this._private_recv_uid } } }); } buildElement() { if (!this.isGroupFile) return []; const e = Buffer.alloc(2), n = new he(Yq).encode({ field1: 6, fileName: this.fileName, inner: { info: { busId: 102, fileId: this.fileUuid, fileSize: BigInt(this.fileSize), fileName: this.fileName, fileSha: this.fileSha1, extInfoString: "", fileMd5: this.fileMd5 } } }); return e.writeUInt16BE(n.length), [{ transElem: { elemType: 24, elemValue: Buffer.concat([Buffer.from([1]), e, n]) // TLV } }]; } toPreview() { return `[文件]${this.fileName}`; } } class CW extends Po { payload; constructor(e) { super(e), this.payload = e.arkElement.bytesData; } buildElement() { return [{ lightAppElem: { data: Buffer.concat([ Buffer.from([1]), OD.deflateSync(Buffer.from(this.payload, "utf-8")) ]) } }]; } toPreview() { return "[卡片消息]"; } } class TW extends Po { content; constructor(e) { super(e), this.content = e.markdownElement.content; } buildElement() { return [{ commonElem: { serviceType: 45, pbElem: new he(Ez).encode({ content: this.content }), businessType: 1 } }]; } toPreview() { return `[Markdown消息 ${this.content}]`; } } class kW extends Po { resid; message; uuid; constructor(e, n) { super(e), this.resid = e.multiForwardMsgElement.resId, this.message = n ?? [], this.uuid = e.multiForwardMsgElement.fileName || kD.randomUUID(); } buildElement() { return [{ lightAppElem: { data: Buffer.concat([ Buffer.from([1]), OD.deflateSync(Buffer.from(JSON.stringify(aE.fromPacketMsg(this.resid, this.message, void 0, void 0, void 0, void 0, this.uuid)), "utf-8")) ]) } }]; } toPreview() { return "[聊天记录]"; } } class sE { static failBackText = new ng( { textElement: { content: "[该消息类型暂不支持查看]" } } ); buildFakeMsg(e, n) { return n.map((r) => { const i = `https://q.qlogo.cn/headimg_dl?dst_uin=${r.senderUin}&spec=0&img_type=jpg`, o = r.msg.reduceRight((s, c) => s ?? c.buildContent(), void 0), a = r.msg.flatMap((s) => s.buildElement() ?? []); return !o && !a.length && a.push(sE.failBackText.buildElement()), { responseHead: { fromUin: r.senderUin, type: 0, sigMap: 0, toUin: 0, fromUid: "", forward: r.groupId ? void 0 : { friendName: r.senderName }, toUid: r.groupId ? void 0 : e, grp: r.groupId ? { groupUin: r.groupId, memberName: r.senderName, unknown5: 2 } : void 0 }, contentHead: { type: r.groupId ? 82 : 9, subType: r.groupId ? void 0 : 4, divSeq: r.groupId ? void 0 : 4, autoReply: 0, sequence: o0.randomBytes(4).readUInt32LE(0), timeStamp: +r.time.toString().substring(0, 10), forward: { field1: 0, field2: 0, field3: r.groupId ? 1 : 2, unknownBase64: i, avatar: i } }, body: { richText: { elems: a }, msgContent: o } }; }); } } const Ms = (t) => Buffer.from(t); class bt { msgBuilder; constructor() { this.msgBuilder = new sE(); } } class NW extends bt { build() { const e = new he(oq).encode({ httpConn: { field1: 0, field2: 0, field3: 16, field4: 1, field6: 3, serviceTypes: [1, 5, 10, 21], // tgt: "", // TODO: do we really need tgt? seems not field9: 2, field10: 9, field11: 8, ver: "1.0.1" } }); return { cmd: "HttpConn.0x6ff_501", data: Ms(e) }; } parse(e) { return new he(aq).decode(e); } } const h4 = new NW(), Nm = (t) => (t = t & 4294967295, [t & 255, (t & 65280) >> 8, (t & 16711680) >> 16, (t & 4278190080) >> 24 & 255].join(".")), es = (t) => t.map((e) => ({ domain: { isEnable: !0, ip: Nm(e.outIP ?? 0) }, port: e.outPort })); class PW { Sha1BlockSize = 64; Sha1DigestSize = 20; _padding = Buffer.concat([Buffer.from([128]), Buffer.alloc(63)]); _state = new Uint32Array(5); _count = new Uint32Array(2); _buffer = Buffer.allocUnsafe(this.Sha1BlockSize); _w = new Uint32Array(80); constructor() { this.reset(); } reset() { this._state[0] = 1732584193, this._state[1] = 4023233417, this._state[2] = 2562383102, this._state[3] = 271733878, this._state[4] = 3285377520, this._count[0] = 0, this._count[1] = 0, this._buffer.fill(0); } rotateLeft(e, n) { return (e << n | e >>> 32 - n) >>> 0; } transform(e, n) { const r = this._w, i = new DataView(e.buffer, e.byteOffset + n, 64); for (let d = 0; d < 16; d++) r[d] = i.getUint32(d * 4, !1); for (let d = 16; d < 80; d++) r[d] = this.rotateLeft(r[d - 3] ^ r[d - 8] ^ r[d - 14] ^ r[d - 16], 1) >>> 0; let o = this._state[0], a = this._state[1], s = this._state[2], c = this._state[3], u = this._state[4]; for (let d = 0; d < 80; d++) { let p; d < 20 ? p = (a & s | ~a & c) + 1518500249 : d < 40 ? p = (a ^ s ^ c) + 1859775393 : d < 60 ? p = (a & s | a & c | s & c) + 2400959708 : p = (a ^ s ^ c) + 3395469782, p += this.rotateLeft(o, 5) + u + r[d] >>> 0, u = c, c = s, s = this.rotateLeft(a, 30) >>> 0, a = o, o = p; } this._state[0] = this._state[0] + o >>> 0, this._state[1] = this._state[1] + a >>> 0, this._state[2] = this._state[2] + s >>> 0, this._state[3] = this._state[3] + c >>> 0, this._state[4] = this._state[4] + u >>> 0; } update(e, n) { let r = (this._count[0] >>> 3 & 63) >>> 0; const i = n ?? e.length; this._count[0] = this._count[0] + (i << 3) >>> 0, this._count[0] < i << 3 && (this._count[1] = this._count[1] + 1 >>> 0), this._count[1] = this._count[1] + (i >>> 29) >>> 0; const o = this.Sha1BlockSize - r >>> 0; let a = 0; if (i >= o) { for (e.copy(this._buffer, r, 0, o), this.transform(this._buffer, 0), a = o; a + this.Sha1BlockSize <= i; a = a + this.Sha1BlockSize >>> 0) this.transform(e, a); r = 0; } e.copy(this._buffer, r, a, i); } hash(e = !0) { const n = Buffer.allocUnsafe(this.Sha1DigestSize); if (e) for (let r = 0; r < 5; r++) n.writeUInt32BE(this._state[r], r * 4); else for (let r = 0; r < 5; r++) n.writeUInt32LE(this._state[r], r * 4); return n; } final() { const e = Buffer.allocUnsafe(this.Sha1DigestSize), n = Buffer.allocUnsafe(8); n.writeUInt32BE(this._count[1], 0), n.writeUInt32BE(this._count[0], 4); const r = (this._count[0] >>> 3 & 63) >>> 0, i = (r < 56 ? 56 - r : 120 - r) >>> 0; this.update(this._padding, i), this.update(n); for (let o = 0; o < 5; o++) e.writeUInt32BE(this._state[o], o * 4); return e; } } class DW extends LL.Transform { blockSize = 1024 * 1024; sha1; buffer; bytesRead; byteArrayList; constructor() { super(), this.sha1 = new PW(), this.buffer = Buffer.alloc(0), this.bytesRead = 0, this.byteArrayList = []; } _transform(e, n, r) { try { this.buffer = Buffer.concat([this.buffer, e]); let i = 0; for (; this.buffer.length - i >= this.sha1.Sha1BlockSize; ) { const o = this.buffer.subarray(i, i + this.sha1.Sha1BlockSize); if (this.sha1.update(o), i += this.sha1.Sha1BlockSize, this.bytesRead += this.sha1.Sha1BlockSize, this.bytesRead % this.blockSize === 0) { const a = this.sha1.hash(!1); this.byteArrayList.push(Buffer.from(a)); } } this.buffer = this.buffer.subarray(i), r(null); } catch (i) { r(i); } } _flush(e) { try { this.buffer.length > 0 && this.sha1.update(this.buffer); const n = this.sha1.final(); this.byteArrayList.push(Buffer.from(n)); for (const r of this.byteArrayList) this.push(r); e(null); } catch (n) { e(n); } } } function OW(t) { return new Promise((e, n) => { t.on("error", n), t.pipe(o0.createHash("sha1").on("error", n).on("data", e)); }); } function FW(t) { return new Promise((e, n) => { t.on("error", n), t.pipe(o0.createHash("md5").on("error", n).on("data", e)); }); } function $o(t) { const e = Ie.createReadStream(t); return OW(e); } function PS(t, e) { const n = Ie.createReadStream(t, e ? { start: 0, end: e - 1 } : {}); return FW(n); } function m4(t) { return new Promise((e, n) => { const r = Ie.createReadStream(t), i = new DW(), o = []; i.on("data", (a) => { o.push(a); }), i.on("end", () => { e(o); }), i.on("error", (a) => { n(a); }), r.pipe(i); }); } class MW extends bt { build(e, n, r, i = !0, o = !1) { const a = new he(CS).encode({ command: e, subCommand: n, body: r, isReserved: i ? 1 : 0 }); return { cmd: `OidbSvcTrpcTcp.0x${e.toString(16).toUpperCase()}_${n}`, data: Ms(a) }; } parse(e) { const n = new he(CS).decode(e); if (n.errorCode !== 0) throw new Error(`OidbSvcTrpcTcpBase parse error: ${n.errorMsg} (code=${n.errorCode})`); return n; } } const Ge = new MW(); class RW extends bt { build(e, n) { const r = new he(Wi).encode( { reqHead: { common: { requestId: 1, command: 100 }, scene: { requestType: 2, businessType: 1, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: +n.size, fileHash: n.md5, fileSha1: n.sha1, fileName: n.name, type: { type: 1, picFormat: n.picType, // TODO: extend NapCat imgType /cc @MliKiowa videoFormat: 0, voiceFormat: 0 }, width: n.width, height: n.height, time: 0, original: 1 }, subFileType: 0 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 2, extBizInfo: { pic: { bizType: n.picSubType, bytesPbReserveTroop: { subType: n.picSubType }, textSummary: n.summary }, video: { bytesPbReserve: Buffer.alloc(0) }, ptt: { bytesPbReserve: Buffer.alloc(0), bytesReserve: Buffer.alloc(0), bytesGeneralFlags: Buffer.alloc(0) } }, clientSeq: 0, noNeedCompatMsg: !1 } } ); return Ge.build(4548, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const g4 = new RW(); class BW extends bt { build(e, n) { const r = new he(LH).encode({ groupUin: e, chatType: n }); return Ge.build(37533, 0, r); } parse(e) { const n = Ge.parse(e).body; return new he(QH).decode(n); } } const y4 = new BW(); class UW extends bt { build(e, n, r, i, o) { const a = new he(GH).encode({ groupUin: e, voiceId: n, text: r, chatType: o, session: { sessionId: i } }); return Ge.build(37531, 0, a); } parse(e) { const n = Ge.parse(e).body; return new he(zH).decode(n); } } const b4 = new UW(); class LW extends bt { build(e) { const n = new he(lq).encode({ appId: e.sdkId, body: { extInfo: { field2: Buffer.alloc(0) }, appid: e.appId, title: e.title, desc: e.desc, time: BigInt(Date.now()), scene: e.scene, templateType: e.templateType, businessType: e.businessType, picUrl: e.picUrl, vidUrl: "", jumpUrl: e.jumpUrl, iconUrl: e.iconUrl, verType: e.verType, shareType: e.shareType, versionId: e.versionId, withShareTicket: e.withShareTicket, webURL: e.webUrl ?? "", appidRich: Buffer.alloc(0), template: { templateId: "", templateData: "" }, field20: "" } }); return { cmd: "LightAppSvc.mini_app_share.AdaptShareInfo", data: Ms(n) }; } parse(e) { return new he(hq).decode(e); } } const v4 = new LW(); class QW extends bt { build(e, n) { const r = new he(aW).encode( { body: { uin: String(e), groupUin: String(n), version: "9.0.90" } } ); return Ge.build(3767, 1, r, !1, !1); } parse(e) { return Ge.parse(e); } } const jW = new QW(); class $W extends bt { build(e) { const n = new he(cW).encode({ uin: e, key: [{ key: 27372 }] }); return Ge.build(4065, 2, n); } parse(e) { const n = Ge.parse(e).body; return new he(pW).decode(n); } } const x4 = new $W(); let GW = class extends bt { build(e, n, r) { const i = { uin: r, ext: 0, ...e ? { groupUin: n } : { friendUin: n } }, o = new he(sW).encode(i); return Ge.build(3795, 1, o); } parse(e) { return Ge.parse(e); } }; const qW = new GW(); let zW = class extends bt { build(e, n, r) { const i = new he(OH).encode({ groupUin: +e, body: { targetUid: n, specialTitle: r, expiredTime: -1, uinName: r } }); return Ge.build(2300, 2, i, !1, !1); } parse(e) { return Ge.parse(e); } }; const HW = new zW(); class WW extends bt { build(e) { const n = new he(fW).encode( { version: 1, client: 0, entrance: 1, ocrReqBody: { imageUrl: e, originMd5: "", afterCompressMd5: "", afterCompressFileSize: "", afterCompressWeight: "", afterCompressHeight: "", isCut: !1 } } ); return Ge.build(3767, 1, n, !1, !1); } parse(e) { const n = Ge.parse(e); return new he(mW).decode(n.body); } } const w4 = new WW(); let KW = class extends bt { build(e, n, r, i) { const o = new he(y0).encode({ move: { groupUin: e, appId: 5, busId: 102, fileId: n, parentDirectory: r, targetDirectory: i } }); return Ge.build(1750, 5, o, !0, !1); } parse(e) { const n = Ge.parse(e).body, r = new he(b0).decode(n); if (r.move.retCode !== 0) throw new Error(`sendGroupFileMoveReq error: ${r.move.clientWording} (code=${r.move.retCode})`); return r; } }; const S4 = new KW(); let VW = class extends bt { build(e, n, r, i) { const o = new he(y0).encode({ rename: { groupUin: e, busId: 102, fileId: n, parentFolder: r, newFileName: i } }); return Ge.build(1750, 4, o, !0, !1); } parse(e) { const n = Ge.parse(e).body, r = new he(b0).decode(n); if (r.rename.retCode !== 0) throw new Error(`sendGroupFileRenameReq error: ${r.rename.clientWording} (code=${r.rename.retCode})`); return r; } }; const _4 = new VW(); let YW = class extends bt { build(e, n) { const r = new he(oE).encode({ groupUin: e, msgSeq: BigInt(n) }); return Ge.build(3984, 2, r); } parse(e) { return Ge.parse(e); } }; const JW = new YW(); let XW = class extends bt { build(e, n) { const r = new he(oE).encode({ groupUin: e, msgSeq: BigInt(n) }); return Ge.build(3984, 3, r); } parse(e) { return Ge.parse(e); } }; const ZW = new XW(); let eK = class extends bt { build(e, n) { const r = new he(oE).encode({ groupUin: e, msgSeq: BigInt(n) }); return Ge.build(3984, 1, r); } parse(e) { return Ge.parse(e); } }; const tK = new eK(); class nK extends bt { build(e, n) { const r = new he(y0).encode({ download: { groupUin: e, appId: 7, busId: 102, fileId: n } }); return Ge.build(1750, 2, r, !0, !1); } parse(e) { const n = Ge.parse(e).body, r = new he(b0).decode(n); if (r.download.retCode !== 0) throw new Error(`sendGroupFileDownloadReq error: ${r.download.clientWording} (code=${r.download.retCode})`); return r; } } const E4 = new nK(); class rK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 4, command: 200 }, scene: { requestType: 1, businessType: 3, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4718, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const iK = new rK(); class oK extends bt { build(e, n, r, i) { const o = new he(eW).encode({ subCommand: 800, field2: 0, body: { senderUid: r, receiverUid: i, fileUuid: e, fileHash: n }, field101: 3, field102: 1, field200: 1 }); return Ge.build(3639, 800, o, !1, !1); } // TODO:check parse(e) { const n = Ge.parse(e).body; return new he(bF).decode(n); } } const A4 = new oK(); class aK extends bt { build(e, n, r) { const i = new he(HH).encode({ subCommand: 1200, field2: 1, body: { receiverUid: e, fileUuid: n, type: 2, fileHash: r, t2: 0 }, field101: 3, field102: 103, field200: 1, field99999: Buffer.from([192, 133, 44, 1]) }); return Ge.build(3639, 1200, i, !1, !1); } parse(e) { const n = Ge.parse(e).body; return new he(KH).decode(n); } } const I4 = new aK(); class sK extends bt { build(e, n) { const r = new he(y0).encode({ file: { groupUin: e, appId: 4, busId: 102, entrance: 6, targetDirectory: "/", // TODO: fileName: n.fileName, localDirectory: `/${n.fileName}`, fileSize: BigInt(n.fileSize), fileMd5: n.fileMd5, fileSha1: n.fileSha1, fileSha3: Buffer.alloc(0), field15: !0 } }); return Ge.build(1750, 0, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(b0).decode(n); } } const C4 = new sK(); class cK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 100 }, scene: { requestType: 2, businessType: 3, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: n.fileSize, fileHash: n.fileMd5, fileSha1: n.fileSha1, fileName: `${n.fileMd5}.amr`, type: { type: 3, picFormat: 0, videoFormat: 0, voiceFormat: 1 }, height: 0, width: 0, time: n.fileDuration, original: 0 }, subFileType: 0 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 2, extBizInfo: { pic: { textSummary: "Nya~" }, video: { bytesPbReserve: Buffer.alloc(0) }, ptt: { bytesPbReserve: Buffer.alloc(0), bytesReserve: Buffer.from([8, 0, 56, 0]), bytesGeneralFlags: Buffer.from([154, 1, 7, 170, 3, 4, 8, 8, 18, 0]) } }, clientSeq: 0, noNeedCompatMsg: !1 } }); return Ge.build(4718, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const T4 = new cK(); class uK extends bt { build(e, n) { if (!n.fileSize || !n.thumbSize) throw new Error("video.fileSize or video.thumbSize is empty"); const r = new he(Wi).encode({ reqHead: { common: { requestId: 3, command: 100 }, scene: { requestType: 2, businessType: 2, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: +n.fileSize, fileHash: n.fileMd5, fileSha1: n.fileSha1, fileName: n.fileName || "video.mp4", type: { type: 2, picFormat: 0, videoFormat: n.fileFormat, voiceFormat: 0 }, height: n.fileHeight ?? 0, width: n.fileWidth ?? 0, time: n.fileTime, original: 0 }, subFileType: 0 }, { fileInfo: { fileSize: +n.thumbSize, fileHash: n.thumbMd5, fileSha1: n.thumbSha1, fileName: `${n.thumbMd5 || "video-thumb"}.jpg`, type: { type: 1, picFormat: 0, videoFormat: 0, voiceFormat: 0 }, height: n.thumbHeight, width: n.thumbWidth, time: 0, original: 0 }, subFileType: 100 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 2, extBizInfo: { pic: { bizType: 0, textSummary: "Nya~" }, video: { bytesPbReserve: Buffer.from([128, 1, 0]) }, ptt: { bytesPbReserve: Buffer.alloc(0), bytesReserve: Buffer.alloc(0), bytesGeneralFlags: Buffer.alloc(0) } }, clientSeq: 0, noNeedCompatMsg: !1 } }); return Ge.build(4586, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const k4 = new uK(); class lK extends bt { async build(e, n, r) { const i = new he(XH).encode({ command: 1700, seq: 0, upload: { senderUid: e, receiverUid: n, fileSize: r.fileSize, fileName: r.fileName, md510MCheckSum: await PS(r.filePath, 10485760), sha1CheckSum: r.fileSha1, localPath: "/", md5CheckSum: r.fileMd5, sha3CheckSum: Buffer.alloc(0) }, businessId: 3, clientType: 1, flagSupportMediaPlatform: 1 }); return Ge.build(3639, 1700, i, !1, !1); } parse(e) { const n = Ge.parse(e).body; return new he(bF).decode(n); } } const N4 = new lK(); class dK extends bt { build(e, n) { const r = new he(Wi).encode( { reqHead: { common: { requestId: 1, command: 100 }, scene: { requestType: 2, businessType: 1, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: +n.size, fileHash: n.md5, fileSha1: n.sha1, fileName: n.name, type: { type: 1, picFormat: n.picType, // TODO: extend NapCat imgType /cc @MliKiowa videoFormat: 0, voiceFormat: 0 }, width: n.width, height: n.height, time: 0, original: 1 }, subFileType: 0 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 1, extBizInfo: { pic: { bizType: n.picSubType, bytesPbReserveC2C: { subType: n.picSubType }, textSummary: n.summary }, video: { bytesPbReserve: Buffer.alloc(0) }, ptt: { bytesPbReserve: Buffer.alloc(0), bytesReserve: Buffer.alloc(0), bytesGeneralFlags: Buffer.alloc(0) } }, clientSeq: 0, noNeedCompatMsg: !1 } } ); return Ge.build(4549, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const P4 = new dK(); class pK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 4, command: 100 }, scene: { requestType: 2, businessType: 3, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: n.fileSize, fileHash: n.fileMd5, fileSha1: n.fileSha1, fileName: `${n.fileMd5}.amr`, type: { type: 3, picFormat: 0, videoFormat: 0, voiceFormat: 1 }, height: 0, width: 0, time: n.fileDuration, original: 0 }, subFileType: 0 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 1, extBizInfo: { pic: { textSummary: "Nya~" }, ptt: { bytesReserve: Buffer.from([8, 0, 56, 0]), bytesGeneralFlags: Buffer.from([154, 1, 11, 170, 3, 8, 8, 4, 18, 4, 0, 0, 0, 0]) } }, clientSeq: 0, noNeedCompatMsg: !1 } }); return Ge.build(4717, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const D4 = new pK(); class fK extends bt { build(e, n) { if (!n.fileSize || !n.thumbSize) throw new Error("video.fileSize or video.thumbSize is empty"); const r = new he(Wi).encode({ reqHead: { common: { requestId: 3, command: 100 }, scene: { requestType: 2, businessType: 2, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, upload: { uploadInfo: [ { fileInfo: { fileSize: +n.fileSize, fileHash: n.fileMd5, fileSha1: n.fileSha1, fileName: n.fileName || "video.mp4", type: { type: 2, picFormat: 0, videoFormat: n.fileFormat, voiceFormat: 0 }, height: n.fileHeight ?? 0, width: n.fileWidth ?? 0, time: n.fileTime, original: 0 }, subFileType: 0 }, { fileInfo: { fileSize: +n.thumbSize, fileHash: n.thumbMd5, fileSha1: n.thumbSha1, fileName: `${n.thumbMd5 || "video-thumb"}.jpg`, type: { type: 1, picFormat: 0, videoFormat: 0, voiceFormat: 0 }, height: n.thumbHeight, width: n.thumbWidth, time: 0, original: 0 }, subFileType: 100 } ], tryFastUploadCompleted: !0, srvSendMsg: !1, clientRandomId: La.randomBytes(8).readBigUInt64BE() & BigInt("0x7FFFFFFFFFFFFFFF"), compatQMsgSceneType: 2, extBizInfo: { pic: { bizType: 0, textSummary: "Nya~" }, video: { bytesPbReserve: Buffer.from([128, 1, 0]) }, ptt: { bytesPbReserve: Buffer.alloc(0), bytesReserve: Buffer.alloc(0), bytesGeneralFlags: Buffer.alloc(0) } }, clientSeq: 0, noNeedCompatMsg: !1 } }); return Ge.build(4585, 100, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const O4 = new fK(); class hK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 200 }, scene: { requestType: 2, businessType: 1, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4549, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const rd = new hK(); class mK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 200 }, scene: { requestType: 2, businessType: 1, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4548, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const gK = new mK(); class yK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 200 }, scene: { requestType: 2, businessType: 2, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4585, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const F4 = new yK(); class bK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 200 }, scene: { requestType: 2, businessType: 2, sceneType: 2, group: { groupUin: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4586, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const vK = new bK(); class xK extends bt { build(e, n) { const r = new he(Wi).encode({ reqHead: { common: { requestId: 1, command: 200 }, scene: { requestType: 1, businessType: 3, sceneType: 1, c2C: { accountType: 2, targetUid: e } }, client: { agentType: 2 } }, download: { node: n, download: { video: { busiType: 0, sceneType: 0 } } } }); return Ge.build(4717, 200, r, !0, !1); } parse(e) { const n = Ge.parse(e).body; return new he(Ki).decode(n); } } const M4 = new xK(); class wK extends bt { build(e, n, r = 0) { const i = this.msgBuilder.buildFakeMsg(e, n), o = new he(tg).encode( { action: [{ actionCommand: "MultiMsg", actionData: { msgBody: i } }] } ), a = FD.gzipSync(Buffer.from(o)), s = new he(aF).encode( { info: { type: r === 0 ? 1 : 3, uid: { uid: r === 0 ? e : r.toString() }, groupUin: r, payload: a }, settings: { field1: 4, field2: 1, field3: 7, field4: 0 } } ); return { cmd: "trpc.group.long_msg_interface.MsgService.SsoSendLongMsg", data: Ms(s) }; } parse(e) { return new he(sF).decode(e); } } const _y = new wK(); class SK extends bt { build(e, n, r) { const i = new he(Uq).encode({ info: { groupUin: e, startSequence: n, endSequence: r }, direction: !0 }); return { cmd: "trpc.msg.register_proxy.RegisterProxy.SsoGetGroupMsg", data: Ms(i) }; } parse(e) { return new he(Qq).decode(e); } } const R4 = new SK(); class _K extends bt { build(e, n, r) { const i = new he($q).encode({ friendUid: e, startSequence: n, endSequence: r }); return { cmd: "trpc.msg.register_proxy.RegisterProxy.SsoGetC2cMsg", data: Ms(i) }; } parse(e) { return new he(Gq).decode(e); } } const B4 = new _K(); class EK extends bt { build(e, n) { const r = new he(Dq).encode({ info: { uid: { uid: e }, resId: n, acquire: !0 }, settings: { field1: 2, field2: 0, field3: 0, field4: 0 } }); return { cmd: "trpc.group.long_msg_interface.MsgService.SsoRecvLongMsg", data: Ms(r) }; } parse(e) { return new he(Fq).decode(e); } } const ch = new EK(); class AK extends bt { build(e, n, r = 0) { const i = n.map((c) => ({ actionCommand: c.actionCommand, actionData: { msgBody: c.actionMsgBody ?? this.msgBuilder.buildFakeMsg(e, c.actionMsg ?? []) } })), o = new he(tg).encode( { action: i } ), a = FD.gzipSync(Buffer.from(o)), s = new he(aF).encode( { info: { type: r === 0 ? 1 : 3, uid: { uid: r === 0 ? e : r.toString() }, groupUin: r, payload: a }, settings: { field1: 4, field2: 1, field3: 7, field4: 0 } } ); return { cmd: "trpc.group.long_msg_interface.MsgService.SsoSendLongMsg", data: Ms(s) }; } parse(e) { return new he(sF).decode(e); } } const IK = new AK(); class CK extends bt { build() { const e = new he(FH).encode({ reqHead: { common: { requestId: 1, command: 202 }, scene: { requestType: 2, businessType: 1, sceneType: 0 }, client: { agentType: 2 } }, downloadRKeyReq: { key: [10, 20, 2] } }); return Ge.build(36967, 202, e); } parse(e) { const n = Ge.parse(e).body; return new he(UH).decode(n); } } const U4 = new CK(); function TK(t) { const e = AD(), n = VL(), r = process.platform + "." + process.arch, i = xe.join(t, "./native/ffmpeg/", `ffmpegAddon.${r}.node`); if (!ir(i)) throw new Error(`Unsupported platform: ${e} ${n} - Addon not found at ${i}`); return i; } class kK { name = "FFmpegAddon"; addon = null; binaryPath; constructor(e) { this.binaryPath = e; } /** * 检查 Addon 是否可用 */ async isAvailable() { try { const e = { exports: {} }; return c7(e, TK(this.binaryPath)), this.addon = e.exports, this.addon !== null; } catch (e) { return console.log("[FFmpegAddonAdapter] Failed to load addon:", e), !1; } } ensureAddon() { if (!this.addon) throw new Error("FFmpeg Addon is not available"); return this.addon; } /** * 获取视频信息 */ async getVideoInfo(e) { const r = await this.ensureAddon().getVideoInfo(e), i = r.format.includes(",") ? r.format.split(",")[0] ?? r.format : r.format; return console.log("[FFmpegAddonAdapter] Detected format:", i), { width: r.width, height: r.height, duration: r.duration, format: i, thumbnail: r.image }; } /** * 获取时长 */ async getDuration(e) { return this.ensureAddon().getDuration(e); } /** * 判断是否为 Silk 格式 */ async isSilk(e) { try { const n = e7(e, "r"), r = Buffer.alloc(10); t7(n, r, 0, 10, 0), n7(n); const i = r.toString(); return i.includes("#!SILK") || i.includes("#!SILK"); } catch { return !1; } } /** * 转换为 PCM */ async convertToPCM(e, n) { return await this.ensureAddon().decodeAudioToPCM(e, n, 24e3); } /** * 转换文件 */ async convertFile(e, n, r) { const i = this.ensureAddon(); console.log("[FFmpegAddonAdapter] Converting file:", e, "to", n, "as", r), await i.decodeAudioToFmt(e, n, r); } async convertToNTSilkTct(e, n) { await this.ensureAddon().convertToNTSilkTct(e, n); } /** * 提取缩略图 */ async extractThumbnail(e, n) { const i = await this.ensureAddon().getVideoInfo(e); await GL(n, i.image); } } class NK { type = Rc.BMP; // BMP 魔术头:42 4D (BM) BMP_SIGNATURE = [66, 77]; canParse(e) { return Vo(e, this.BMP_SIGNATURE); } async parseSize(e) { return new Promise((n, r) => { e.once("error", r), e.once("readable", () => { const i = e.read(26); if (!i || i.length < 26) return n(void 0); if (this.canParse(i)) { const o = i.readUInt32LE(18), a = i.readUInt32LE(22); n({ width: o, height: a }); } else n(void 0); }); }); } } class PK { type = Rc.GIF; // GIF87a 魔术头:47 49 46 38 37 61 GIF87A_SIGNATURE = [71, 73, 70, 56, 55, 97]; // GIF89a 魔术头:47 49 46 38 39 61 GIF89A_SIGNATURE = [71, 73, 70, 56, 57, 97]; canParse(e) { return Vo(e, this.GIF87A_SIGNATURE) || Vo(e, this.GIF89A_SIGNATURE); } async parseSize(e) { return new Promise((n, r) => { e.once("error", r), e.once("readable", () => { const i = e.read(10); if (!i || i.length < 10) return n(void 0); if (this.canParse(i)) { const o = i.readUInt16LE(6), a = i.readUInt16LE(8); n({ width: o, height: a }); } else n(void 0); }); }); } } class DK { type = Rc.JPEG; // JPEG 魔术头:FF D8 JPEG_SIGNATURE = [255, 216]; // JPEG标记常量 SOF_MARKERS = { SOF0: 192, // 基线DCT SOF1: 193, // 扩展顺序DCT SOF2: 194, // 渐进式DCT SOF3: 195 // 无损 }; // 非SOF标记 NON_SOF_MARKERS = [ 196, // DHT 200, // JPEG扩展 204 // DAC ]; canParse(e) { return Vo(e, this.JPEG_SIGNATURE); } isSOFMarker(e) { return e === this.SOF_MARKERS.SOF0 || e === this.SOF_MARKERS.SOF1 || e === this.SOF_MARKERS.SOF2 || e === this.SOF_MARKERS.SOF3; } isNonSOFMarker(e) { return this.NON_SOF_MARKERS.includes(e); } async parseSize(e) { return new Promise((n, r) => { let o = Buffer.alloc(0), a = 0, s = !1; e.on("error", (c) => { e.destroy(), r(c); }), e.on("data", (c) => { const u = Buffer.isBuffer(c) ? c : Buffer.from(c); o = Buffer.concat([o.subarray(a), u]), a = 0; const d = o.length, p = 10; for (; a < d - p; ) { if (o[a] === 255 && o[a + 1] >= 192 && o[a + 1] <= 207) { const f = o[a + 1]; if (!f) break; if (this.isNonSOFMarker(f)) { a += 2; continue; } if (this.isSOFMarker(f)) if (a + 9 < d) { const m = o.readUInt16BE(a + 5), h = o.readUInt16BE(a + 7); s = !0, e.destroy(), n({ width: h, height: m }); return; } else break; } a++; } a > 1024 && a > 20 && (o = o.subarray(a - 20), a = 20); }), e.on("end", () => { s || n(void 0); }); }); } } class OK { type = Rc.PNG; // PNG 魔术头:89 50 4E 47 0D 0A 1A 0A PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10]; canParse(e) { return Vo(e, this.PNG_SIGNATURE); } async parseSize(e) { return new Promise((n, r) => { e.once("error", r), e.once("readable", () => { const i = e.read(24); if (!i || i.length < 24) return n(void 0); if (this.canParse(i)) { const o = i.readUInt32BE(16), a = i.readUInt32BE(20); n({ width: o, height: a }); } else n(void 0); }); }); } } class FK { type = Rc.TIFF; // TIFF Little Endian 魔术头:49 49 2A 00 (II) TIFF_LE_SIGNATURE = [73, 73, 42, 0]; // TIFF Big Endian 魔术头:4D 4D 00 2A (MM) TIFF_BE_SIGNATURE = [77, 77, 0, 42]; canParse(e) { return Vo(e, this.TIFF_LE_SIGNATURE) || Vo(e, this.TIFF_BE_SIGNATURE); } async parseSize(e) { return new Promise((n, r) => { const i = []; let o = 0; const a = 64 * 1024; e.on("error", r), e.on("data", (s) => { const c = Buffer.isBuffer(s) ? s : Buffer.from(s); i.push(c), o += c.length, o >= a && e.destroy(); }), e.on("end", () => { const s = Buffer.concat(i), c = this.parseTiffSize(s); n(c); }), e.on("close", () => { if (i.length > 0) { const s = Buffer.concat(i), c = this.parseTiffSize(s); n(c); } }); }); } parseTiffSize(e) { if (e.length < 8) return; const n = e[0] === 73, r = n ? (p) => e.readUInt16LE(p) : (p) => e.readUInt16BE(p), i = n ? (p) => e.readUInt32LE(p) : (p) => e.readUInt32BE(p), o = i(4); if (o + 2 > e.length) return; const a = r(o); let s, c; const u = 256, d = 257; for (let p = 0; p < a; p++) { const f = o + 2 + p * 12; if (f + 12 > e.length) break; const m = r(f), h = r(f + 2); let y; if (h === 3) y = r(f + 8); else if (h === 4) y = i(f + 8); else continue; if (m === u ? s = y : m === d && (c = y), s !== void 0 && c !== void 0) return { width: s, height: c }; } if (s !== void 0 && c !== void 0) return { width: s, height: c }; } } class MK { type = Rc.WEBP; // WEBP RIFF 头:52 49 46 46 (RIFF) RIFF_SIGNATURE = [82, 73, 70, 70]; // WEBP 魔术头:57 45 42 50 (WEBP) WEBP_SIGNATURE = [87, 69, 66, 80]; // WEBP 块头 CHUNK_VP8 = [86, 80, 56, 32]; // "VP8 " CHUNK_VP8L = [86, 80, 56, 76]; // "VP8L" CHUNK_VP8X = [86, 80, 56, 88]; // "VP8X" canParse(e) { return e.length >= 12 && Vo(e, this.RIFF_SIGNATURE, 0) && Vo(e, this.WEBP_SIGNATURE, 8); } isChunkType(e, n, r) { return e.length >= n + 4 && Vo(e, r, n); } async parseSize(e) { return new Promise((n, r) => { let o = 0, a = Buffer.alloc(0); e.on("error", r), e.on("data", (s) => { const c = Buffer.isBuffer(s) ? s : Buffer.from(s); if (a = Buffer.concat([a, c]), o += s.length, o >= 32) { if (e.destroy(), !this.canParse(a)) return n(void 0); if (this.isChunkType(a, 12, this.CHUNK_VP8)) { const u = a.readUInt16LE(26) & 16383, d = a.readUInt16LE(28) & 16383; return n({ width: u, height: d }); } else if (this.isChunkType(a, 12, this.CHUNK_VP8L)) { const u = a.readUInt32LE(21), d = 1 + (u & 16383), p = 1 + (u >> 14 & 16383); return n({ width: d, height: p }); } else if (this.isChunkType(a, 12, this.CHUNK_VP8X)) { if (a.length < 30) return n(void 0); const u = 1 + ((a[24] | a[25] << 8 | a[26] << 16) & 16777215), d = 1 + ((a[27] | a[28] << 8 | a[29] << 16) & 16777215); return n({ width: u, height: d }); } else return n(void 0); } }), e.on("end", () => { o < 32 && n(void 0); }); }); } } var Rc = /* @__PURE__ */ ((t) => (t.JPEG = "jpeg", t.PNG = "png", t.BMP = "bmp", t.GIF = "gif", t.WEBP = "webp", t.TIFF = "tiff", t.UNKNOWN = "unknown", t))(Rc || {}); function Vo(t, e, n = 0) { if (t.length < n + e.length) return !1; for (let r = 0; r < e.length; r++) if (t[n + r] !== e[r]) return !1; return !0; } const nc = { png: new OK(), jpeg: new DK(), bmp: new NK(), gif: new PK(), webp: new MK(), tiff: new FK() }, RK = /* @__PURE__ */ new Map([ ["png", nc.png], ["jpeg", nc.jpeg], ["bmp", nc.bmp], ["gif", nc.gif], ["webp", nc.webp], ["tiff", nc.tiff] ]), BK = Object.values(nc); async function UK(t) { return new Promise((e, n) => { const r = Ie.createReadStream(t, { highWaterMark: 64, // 优化读取buffer大小 start: 0, end: 63 }), i = []; r.on("error", (o) => { r.destroy(), n(o); }), r.on("data", (o) => { const a = Buffer.isBuffer(o) ? o : Buffer.from(o); i.push(a); }), r.on("end", () => { const o = Buffer.concat(i); if (o.length === 0) return e( "unknown" /* UNKNOWN */ ); for (const a of BK) if (a.canParse(o)) return e(a.type); e( "unknown" /* UNKNOWN */ ); }); }); } async function LK(t) { try { const e = await UK(t), n = RK.get(e); if (!n) return; const r = Ie.createReadStream(t); try { return await n.parseSize(r); } catch (i) { console.error(`解析图片尺寸出错: ${i}`); return; } finally { r.destroyed || r.destroy(); } } catch (e) { console.error(`检测图片类型出错: ${e}`); return; } } async function v0(t, e = { width: 1024, height: 1024 }) { return await LK(t) ?? e; } var nu = {}, ua = {}, Ni = {}, Ey, L4; function SF() { if (L4) return Ey; L4 = 1; var t = ve, e = fe, n = parseInt("0777", 8); Ey = r.mkdirp = r.mkdirP = r; function r(i, o, a, s) { typeof o == "function" ? (a = o, o = {}) : (!o || typeof o != "object") && (o = { mode: o }); var c = o.mode, u = o.fs || e; c === void 0 && (c = n), s || (s = null); var d = a || /* istanbul ignore next */ function() { }; i = t.resolve(i), u.mkdir(i, c, function(p) { if (!p) return s = s || i, d(null, s); switch (p.code) { case "ENOENT": if (t.dirname(i) === i) return d(p); r(t.dirname(i), o, function(f, m) { f ? d(f, m) : r(i, o, d, m); }); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: u.stat(i, function(f, m) { f || !m.isDirectory() ? d(p, s) : d(null, s); }); break; } }); } return r.sync = function i(o, a, s) { (!a || typeof a != "object") && (a = { mode: a }); var c = a.mode, u = a.fs || e; c === void 0 && (c = n), s || (s = null), o = t.resolve(o); try { u.mkdirSync(o, c), s = s || o; } catch (p) { switch (p.code) { case "ENOENT": s = i(t.dirname(o), a, s), i(o, a, s); break; // In the case of any other error, just see if there's a dir // there already. If so, then hooray! If not, then something // is borked. default: var d; try { d = u.statSync(o); } catch { throw p; } if (!d.isDirectory()) throw p; break; } } return s; }, Ey; } var uh = { exports: {} }, Ay, Q4; function QK() { if (Q4) return Ay; Q4 = 1, Ay = t; function t(e, n) { if (e && n) return t(e)(n); if (typeof e != "function") throw new TypeError("need wrapper function"); return Object.keys(e).forEach(function(i) { r[i] = e[i]; }), r; function r() { for (var i = new Array(arguments.length), o = 0; o < i.length; o++) i[o] = arguments[o]; var a = e.apply(this, i), s = i[i.length - 1]; return typeof a == "function" && a !== s && Object.keys(s).forEach(function(c) { a[c] = s[c]; }), a; } } return Ay; } var j4; function _F() { if (j4) return uh.exports; j4 = 1; var t = QK(); uh.exports = t(e), uh.exports.strict = t(n), e.proto = e(function() { Object.defineProperty(Function.prototype, "once", { value: function() { return e(this); }, configurable: !0 }), Object.defineProperty(Function.prototype, "onceStrict", { value: function() { return n(this); }, configurable: !0 }); }); function e(r) { var i = function() { return i.called ? i.value : (i.called = !0, i.value = r.apply(this, arguments)); }; return i.called = !1, i; } function n(r) { var i = function() { if (i.called) throw new Error(i.onceError); return i.called = !0, i.value = r.apply(this, arguments); }, o = r.name || "Function wrapped with `once`"; return i.onceError = o + " shouldn't be called more than once", i.called = !1, i; } return uh.exports; } var Iy, $4; function EF() { if ($4) return Iy; $4 = 1; var t = _F(), e = function() { }, n = $n.Bare ? queueMicrotask : process.nextTick.bind(process), r = function(a) { return a.setHeader && typeof a.abort == "function"; }, i = function(a) { return a.stdio && Array.isArray(a.stdio) && a.stdio.length === 3; }, o = function(a, s, c) { if (typeof s == "function") return o(a, null, s); s || (s = {}), c = t(c || e); var u = a._writableState, d = a._readableState, p = s.readable || s.readable !== !1 && a.readable, f = s.writable || s.writable !== !1 && a.writable, m = !1, h = function() { a.writable || y(); }, y = function() { f = !1, p || c.call(a); }, x = function() { p = !1, f || c.call(a); }, g = function(U) { c.call(a, U ? new Error("exited with error code: " + U) : null); }, b = function(U) { c.call(a, U); }, S = function() { n(E); }, E = function() { if (!m) { if (p && !(d && d.ended && !d.destroyed)) return c.call(a, new Error("premature close")); if (f && !(u && u.ended && !u.destroyed)) return c.call(a, new Error("premature close")); } }, T = function() { a.req.on("finish", y); }; return r(a) ? (a.on("complete", y), a.on("abort", S), a.req ? T() : a.on("request", T)) : f && !u && (a.on("end", h), a.on("close", h)), i(a) && a.on("exit", g), a.on("end", x), a.on("finish", y), s.error !== !1 && a.on("error", b), a.on("close", S), function() { m = !0, a.removeListener("complete", y), a.removeListener("abort", S), a.removeListener("request", T), a.req && a.req.removeListener("finish", y), a.removeListener("end", h), a.removeListener("close", h), a.removeListener("finish", y), a.removeListener("exit", g), a.removeListener("end", x), a.removeListener("error", b), a.removeListener("close", S); }; }; return Iy = o, Iy; } var Cy, G4; function AF() { if (G4) return Cy; G4 = 1; var t = _F(), e = EF(), n; try { n = require("fs"); } catch { } var r = function() { }, i = typeof process > "u" ? !1 : /^v?\.0/.test(process.version), o = function(f) { return typeof f == "function"; }, a = function(f) { return !i || !n ? !1 : (f instanceof (n.ReadStream || r) || f instanceof (n.WriteStream || r)) && o(f.close); }, s = function(f) { return f.setHeader && o(f.abort); }, c = function(f, m, h, y) { y = t(y); var x = !1; f.on("close", function() { x = !0; }), e(f, { readable: m, writable: h }, function(b) { if (b) return y(b); x = !0, y(); }); var g = !1; return function(b) { if (!x && !g) { if (g = !0, a(f)) return f.close(r); if (s(f)) return f.abort(); if (o(f.destroy)) return f.destroy(); y(b || new Error("stream was destroyed")); } }; }, u = function(f) { f(); }, d = function(f, m) { return f.pipe(m); }, p = function() { var f = Array.prototype.slice.call(arguments), m = o(f[f.length - 1] || r) && f.pop() || r; if (Array.isArray(f[0]) && (f = f[0]), f.length < 2) throw new Error("pump requires two streams per minimum"); var h, y = f.map(function(x, g) { var b = g < f.length - 1, S = g > 0; return c(x, b, S, function(E) { h || (h = E), E && y.forEach(u), !b && (y.forEach(u), m(h)); }); }); return f.reduce(d); }; return Cy = p, Cy; } var q4; function _i() { if (q4) return Ni; q4 = 1; const t = fe, e = ve, n = SF(), r = AF(); Ni.sourceType = (u) => { if (u) { if (u instanceof Buffer) return "buffer"; if (typeof u._read == "function" || typeof u._transform == "function") return "stream"; if (typeof u != "string") { const d = new Error("Type is not supported, must be a file path, file buffer, or a readable stream"); throw d.name = "IlligalSourceError", d; } return "file"; } }; function i(u) { if (typeof u._write == "function" || typeof u._transform == "function") return "stream"; if (typeof u != "string") { const d = new Error("Type is not supported, must be a file path, or a writable stream"); throw d.name = "IlligalDestinationError", d; } return "path"; } Ni.destType = i; const o = new Error("Type is not supported, must be a file path, directory path, file buffer, or a readable stream"); o.name = "IlligalEntryError", Ni.entryType = (u) => { if (u) { if (u instanceof Buffer) return "buffer"; if (typeof u._read == "function" || typeof u._transform == "function") return "stream"; if (typeof u != "string") throw o; return "fileOrDir"; } }, Ni.clone = (u) => { const d = {}; for (const p in u) d[p] = u[p]; return d; }, Ni.makeFileProcessFn = (u) => (d, p, f) => { f = f || {}, f.source = d; const m = i(p) === "path" ? t.createWriteStream(p) : p, h = new u(f); return a([h, m]); }, Ni.makeCompressDirFn = (u) => (d, p, f) => { const m = i(p) === "path" ? t.createWriteStream(p) : p, h = new u(); return h.addEntry(d, f), a([h, m]); }, Ni.makeUncompressFn = (u) => (d, p, f) => { if (f = f || {}, f.source = d, !d) { const m = new Error("Type is not supported, must be a file path, file buffer, or a readable stream"); throw m.name = "IlligalSourceError", m; } if (i(p) !== "path") { const m = new Error("uncompress destination must be a directory"); throw m.name = "IlligalDestError", m; } return new Promise((m, h) => { n(p, (y) => { if (y) return h(y); let x = 0, g = 0, b = !1; function S() { b && x === g && m(); } new u(f).on("finish", () => { b = !0, S(); }).on("error", h).on("entry", (E, T, U) => { T.on("end", U); const q = e.join(p, E.name); if (E.type === "file") { const Y = e.dirname(q); n(Y, (H) => { if (H) return h(H); x++, r(T, t.createWriteStream(q, { mode: f.mode || E.mode }), (G) => { if (G) return h(G); g++, S(); }); }); } else if (E.type === "symlink") { const Y = e.dirname(q), H = e.resolve(Y, E.linkname); x++, n(Y, (G) => { if (G) return h(G); const J = e.relative(Y, H); t.symlink(J, q, (B) => { if (B) return h(B); g++, T.resume(); }); }); } else n(q, (Y) => { if (Y) return h(Y); T.resume(); }); }); }); }); }, Ni.streamToBuffer = (u) => new Promise((d, p) => { const f = []; u.on("readable", () => { let m; for (; m = u.read(); ) f.push(m); }).on("end", () => d(Buffer.concat(f))).on("error", (m) => p(m)); }); function a(u) { return new Promise((d, p) => { r(u[0], u[1], (f) => { if (f) return p(f); d(); }); }); } Ni.safePipe = a; function s(u) { return u = e.normalize(u), process.platform === "win32" && (u = u.replace(/\\+/g, "/")), u; } function c(u, d, p) { Buffer.isBuffer(d) && (d = d.toString()), d.indexOf("\\") !== -1 && (d = d.replace(/\\+/g, "/")), d[0] === "/" && (d = d.replace(/^\/+/, "")), d && (d = s(d)); let f = d.split("/"); return f.indexOf("..") !== -1 && (d = d.replace(/(\.\.\/)+/, ""), p === "directory" && d && d[d.length - 1] !== "/" && (d += "/"), f = d.split("/")), u = Math.min(u, f.length - 1), f.slice(u).join("/") || "/"; } return Ni.stripFileName = c, Ni; } var lh = {}, Ty, z4; function IF() { if (z4) return Ty; z4 = 1; var t = Os.Buffer, e = [ 0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 498536548, 1789927666, 4089016648, 2227061214, 450548861, 1843258603, 4107580753, 2211677639, 325883990, 1684777152, 4251122042, 2321926636, 335633487, 1661365465, 4195302755, 2366115317, 997073096, 1281953886, 3579855332, 2724688242, 1006888145, 1258607687, 3524101629, 2768942443, 901097722, 1119000684, 3686517206, 2898065728, 853044451, 1172266101, 3705015759, 2882616665, 651767980, 1373503546, 3369554304, 3218104598, 565507253, 1454621731, 3485111705, 3099436303, 671266974, 1594198024, 3322730930, 2970347812, 795835527, 1483230225, 3244367275, 3060149565, 1994146192, 31158534, 2563907772, 4023717930, 1907459465, 112637215, 2680153253, 3904427059, 2013776290, 251722036, 2517215374, 3775830040, 2137656763, 141376813, 2439277719, 3865271297, 1802195444, 476864866, 2238001368, 4066508878, 1812370925, 453092731, 2181625025, 4111451223, 1706088902, 314042704, 2344532202, 4240017532, 1658658271, 366619977, 2362670323, 4224994405, 1303535960, 984961486, 2747007092, 3569037538, 1256170817, 1037604311, 2765210733, 3554079995, 1131014506, 879679996, 2909243462, 3663771856, 1141124467, 855842277, 2852801631, 3708648649, 1342533948, 654459306, 3188396048, 3373015174, 1466479909, 544179635, 3110523913, 3462522015, 1591671054, 702138776, 2966460450, 3352799412, 1504918807, 783551873, 3082640443, 3233442989, 3988292384, 2596254646, 62317068, 1957810842, 3939845945, 2647816111, 81470997, 1943803523, 3814918930, 2489596804, 225274430, 2053790376, 3826175755, 2466906013, 167816743, 2097651377, 4027552580, 2265490386, 503444072, 1762050814, 4150417245, 2154129355, 426522225, 1852507879, 4275313526, 2312317920, 282753626, 1742555852, 4189708143, 2394877945, 397917763, 1622183637, 3604390888, 2714866558, 953729732, 1340076626, 3518719985, 2797360999, 1068828381, 1219638859, 3624741850, 2936675148, 906185462, 1090812512, 3747672003, 2825379669, 829329135, 1181335161, 3412177804, 3160834842, 628085408, 1382605366, 3423369109, 3138078467, 570562233, 1426400815, 3317316542, 2998733608, 733239954, 1555261956, 3268935591, 3050360625, 752459403, 1541320221, 2607071920, 3965973030, 1969922972, 40735498, 2617837225, 3943577151, 1913087877, 83908371, 2512341634, 3803740692, 2075208622, 213261112, 2463272603, 3855990285, 2094854071, 198958881, 2262029012, 4057260610, 1759359992, 534414190, 2176718541, 4139329115, 1873836001, 414664567, 2282248934, 4279200368, 1711684554, 285281116, 2405801727, 4167216745, 1634467795, 376229701, 2685067896, 3608007406, 1308918612, 956543938, 2808555105, 3495958263, 1231636301, 1047427035, 2932959818, 3654703836, 1088359270, 936918e3, 2847714899, 3736837829, 1202900863, 817233897, 3183342108, 3401237130, 1404277552, 615818150, 3134207493, 3453421203, 1423857449, 601450431, 3009837614, 3294710456, 1567103746, 711928724, 3020668471, 3272380065, 1510334235, 755167117 ]; typeof Int32Array < "u" && (e = new Int32Array(e)); function n(a) { if (t.isBuffer(a)) return a; var s = typeof t.alloc == "function" && typeof t.from == "function"; if (typeof a == "number") return s ? t.alloc(a) : new t(a); if (typeof a == "string") return s ? t.from(a) : new t(a); throw new Error("input must be buffer, number, or string, received " + typeof a); } function r(a) { var s = n(4); return s.writeInt32BE(a, 0), s; } function i(a, s) { a = n(a), t.isBuffer(s) && (s = s.readUInt32BE(0)); for (var c = ~~s ^ -1, u = 0; u < a.length; u++) c = e[(c ^ a[u]) & 255] ^ c >>> 8; return c ^ -1; } function o() { return r(i.apply(null, arguments)); } return o.signed = function() { return i.apply(null, arguments); }, o.unsigned = function() { return i.apply(null, arguments) >>> 0; }, Ty = o, Ty; } var H4; function CF() { if (H4) return lh; H4 = 1; var t = fe, e = mr.Transform, n = mr.PassThrough, r = ml, i = Pn, o = Qa.EventEmitter, a = IF(); lh.ZipFile = s, lh.dateToDosDateTime = X, i.inherits(s, o); function s() { this.outputStream = new n(), this.entries = [], this.outputStreamCursor = 0, this.ended = !1, this.allDone = !1, this.forceZip64Eocd = !1; } s.prototype.addFile = function(k, M, O) { var A = this; M = g(M, !1), O == null && (O = {}); var F = new S(M, !1, O); A.entries.push(F), t.stat(k, function(Z, ee) { if (Z) return A.emit("error", Z); if (!ee.isFile()) return A.emit("error", new Error("not a file: " + k)); F.uncompressedSize = ee.size, O.mtime == null && F.setLastModDate(ee.mtime), O.mode == null && F.setFileAttributesMode(ee.mode), F.setFileDataPumpFunction(function() { var P = t.createReadStream(k); F.state = S.FILE_DATA_IN_PROGRESS, P.on("error", function(j) { A.emit("error", j); }), d(A, F, P); }), p(A); }); }, s.prototype.addReadStream = function(k, M, O) { var A = this; M = g(M, !1), O == null && (O = {}); var F = new S(M, !1, O); A.entries.push(F), F.setFileDataPumpFunction(function() { F.state = S.FILE_DATA_IN_PROGRESS, d(A, F, k); }), p(A); }, s.prototype.addBuffer = function(k, M, O) { var A = this; if (M = g(M, !1), k.length > 1073741823) throw new Error("buffer too large: " + k.length + " > 1073741823"); if (O == null && (O = {}), O.size != null) throw new Error("options.size not allowed"); var F = new S(M, !1, O); F.uncompressedSize = k.length, F.crc32 = a.unsigned(k), F.crcAndFileSizeKnown = !0, A.entries.push(F), F.compress ? r.deflateRaw(k, function(ee, P) { Z(P); }) : Z(k); function Z(ee) { F.compressedSize = ee.length, F.setFileDataPumpFunction(function() { u(A, ee), u(A, F.getDataDescriptor()), F.state = S.FILE_DATA_DONE, setImmediate(function() { p(A); }); }), p(A); } }, s.prototype.addEmptyDirectory = function(k, M) { var O = this; if (k = g(k, !0), M == null && (M = {}), M.size != null) throw new Error("options.size not allowed"); if (M.compress != null) throw new Error("options.compress not allowed"); var A = new S(k, !0, M); O.entries.push(A), A.setFileDataPumpFunction(function() { u(O, A.getDataDescriptor()), A.state = S.FILE_DATA_DONE, p(O); }), p(O); }; var c = C([80, 75, 5, 6]); s.prototype.end = function(k, M) { if (typeof k == "function" && (M = k, k = null), k == null && (k = {}), !this.ended) { if (this.ended = !0, this.finalSizeCallback = M, this.forceZip64Eocd = !!k.forceZip64Format, k.comment) { if (typeof k.comment == "string" ? this.comment = N(k.comment) : this.comment = k.comment, this.comment.length > 65535) throw new Error("comment is too large"); if (Q(this.comment, c)) throw new Error("comment contains end of central directory record signature"); } else this.comment = b; p(this); } }; function u(k, M) { k.outputStream.write(M), k.outputStreamCursor += M.length; } function d(k, M, O) { var A = new $(), F = new K(), Z = M.compress ? new r.DeflateRaw() : new n(), ee = new K(); O.pipe(A).pipe(F).pipe(Z).pipe(ee).pipe(k.outputStream, { end: !1 }), ee.on("end", function() { if (M.crc32 = A.crc32, M.uncompressedSize == null) M.uncompressedSize = F.byteCount; else if (M.uncompressedSize !== F.byteCount) return k.emit("error", new Error("file data stream has unexpected number of bytes")); M.compressedSize = ee.byteCount, k.outputStreamCursor += M.compressedSize, u(k, M.getDataDescriptor()), M.state = S.FILE_DATA_DONE, p(k); }); } function p(k) { if (k.allDone) return; if (k.ended && k.finalSizeCallback != null) { var M = f(k); M != null && (k.finalSizeCallback(M), k.finalSizeCallback = null); } var O = A(); function A() { for (var Z = 0; Z < k.entries.length; Z++) { var ee = k.entries[Z]; if (ee.state < S.FILE_DATA_DONE) return ee; } return null; } if (O != null) { if (O.state < S.READY_TO_PUMP_FILE_DATA || O.state === S.FILE_DATA_IN_PROGRESS) return; O.relativeOffsetOfLocalHeader = k.outputStreamCursor; var F = O.getLocalFileHeader(); u(k, F), O.doFileDataPump(); } else k.ended && (k.offsetOfStartOfCentralDirectory = k.outputStreamCursor, k.entries.forEach(function(Z) { var ee = Z.getCentralDirectoryRecord(); u(k, ee); }), u(k, x(k)), k.outputStream.end(), k.allDone = !0); } function f(k) { for (var M = 0, O = 0, A = 0; A < k.entries.length; A++) { var F = k.entries[A]; if (F.compress) return -1; if (F.state >= S.READY_TO_PUMP_FILE_DATA) { if (F.uncompressedSize == null) return -1; } else if (F.uncompressedSize == null) return null; F.relativeOffsetOfLocalHeader = M; var Z = F.useZip64Format(); M += E + F.utf8FileName.length, M += F.uncompressedSize, F.crcAndFileSizeKnown || (Z ? M += J : M += G), O += B + F.utf8FileName.length + F.fileComment.length, Z && (O += D); } var ee = 0; return (k.forceZip64Eocd || k.entries.length >= 65535 || O >= 65535 || M >= 4294967295) && (ee += m + h), ee += y + k.comment.length, M + O + ee; } var m = 56, h = 20, y = 22; function x(k, M) { var O = !1, A = k.entries.length; (k.forceZip64Eocd || k.entries.length >= 65535) && (A = 65535, O = !0); var F = k.outputStreamCursor - k.offsetOfStartOfCentralDirectory, Z = F; (k.forceZip64Eocd || F >= 4294967295) && (Z = 4294967295, O = !0); var ee = k.offsetOfStartOfCentralDirectory; (k.forceZip64Eocd || k.offsetOfStartOfCentralDirectory >= 4294967295) && (ee = 4294967295, O = !0); var P = L(y + k.comment.length); if (P.writeUInt32LE(101010256, 0), P.writeUInt16LE(0, 4), P.writeUInt16LE(0, 6), P.writeUInt16LE(A, 8), P.writeUInt16LE(A, 10), P.writeUInt32LE(Z, 12), P.writeUInt32LE(ee, 16), P.writeUInt16LE(k.comment.length, 20), k.comment.copy(P, 22), !O) return P; var j = L(m); j.writeUInt32LE(101075792, 0), V(j, m - 12, 4), j.writeUInt16LE(q, 12), j.writeUInt16LE(U, 14), j.writeUInt32LE(0, 16), j.writeUInt32LE(0, 20), V(j, k.entries.length, 24), V(j, k.entries.length, 32), V(j, F, 40), V(j, k.offsetOfStartOfCentralDirectory, 48); var W = L(h); return W.writeUInt32LE(117853008, 0), W.writeUInt32LE(0, 4), V(W, k.outputStreamCursor, 8), W.writeUInt32LE(1, 16), Buffer.concat([ j, W, P ]); } function g(k, M) { if (k === "") throw new Error("empty metadataPath"); if (k = k.replace(/\\/g, "/"), /^[a-zA-Z]:/.test(k) || /^\//.test(k)) throw new Error("absolute path: " + k); if (k.split("/").indexOf("..") !== -1) throw new Error("invalid relative path: " + k); var O = /\/$/.test(k); if (M) O || (k += "/"); else if (O) throw new Error("file path cannot end with '/': " + k); return k; } var b = L(0); function S(k, M, O) { if (this.utf8FileName = C(k), this.utf8FileName.length > 65535) throw new Error("utf8 file name too long. " + utf8FileName.length + " > 65535"); if (this.isDirectory = M, this.state = S.WAITING_FOR_METADATA, this.setLastModDate(O.mtime != null ? O.mtime : /* @__PURE__ */ new Date()), O.mode != null ? this.setFileAttributesMode(O.mode) : this.setFileAttributesMode(M ? 16893 : 33204), M ? (this.crcAndFileSizeKnown = !0, this.crc32 = 0, this.uncompressedSize = 0, this.compressedSize = 0) : (this.crcAndFileSizeKnown = !1, this.crc32 = null, this.uncompressedSize = null, this.compressedSize = null, O.size != null && (this.uncompressedSize = O.size)), M ? this.compress = !1 : (this.compress = !0, O.compress != null && (this.compress = !!O.compress)), this.forceZip64Format = !!O.forceZip64Format, O.fileComment) { if (typeof O.fileComment == "string" ? this.fileComment = C(O.fileComment, "utf-8") : this.fileComment = O.fileComment, this.fileComment.length > 65535) throw new Error("fileComment is too large"); } else this.fileComment = b; } S.WAITING_FOR_METADATA = 0, S.READY_TO_PUMP_FILE_DATA = 1, S.FILE_DATA_IN_PROGRESS = 2, S.FILE_DATA_DONE = 3, S.prototype.setLastModDate = function(k) { var M = X(k); this.lastModFileTime = M.time, this.lastModFileDate = M.date; }, S.prototype.setFileAttributesMode = function(k) { if ((k & 65535) !== k) throw new Error("invalid mode. expected: 0 <= " + k + " <= 65535"); this.externalFileAttributes = k << 16 >>> 0; }, S.prototype.setFileDataPumpFunction = function(k) { this.doFileDataPump = k, this.state = S.READY_TO_PUMP_FILE_DATA; }, S.prototype.useZip64Format = function() { return this.forceZip64Format || this.uncompressedSize != null && this.uncompressedSize > 4294967294 || this.compressedSize != null && this.compressedSize > 4294967294 || this.relativeOffsetOfLocalHeader != null && this.relativeOffsetOfLocalHeader > 4294967294; }; var E = 30, T = 20, U = 45, q = 831, Y = 2048, H = 8; S.prototype.getLocalFileHeader = function() { var k = 0, M = 0, O = 0; this.crcAndFileSizeKnown && (k = this.crc32, M = this.compressedSize, O = this.uncompressedSize); var A = L(E), F = Y; return this.crcAndFileSizeKnown || (F |= H), A.writeUInt32LE(67324752, 0), A.writeUInt16LE(T, 4), A.writeUInt16LE(F, 6), A.writeUInt16LE(this.getCompressionMethod(), 8), A.writeUInt16LE(this.lastModFileTime, 10), A.writeUInt16LE(this.lastModFileDate, 12), A.writeUInt32LE(k, 14), A.writeUInt32LE(M, 18), A.writeUInt32LE(O, 22), A.writeUInt16LE(this.utf8FileName.length, 26), A.writeUInt16LE(0, 28), Buffer.concat([ A, // file name (variable size) this.utf8FileName // extra field (variable size) // no extra fields ]); }; var G = 16, J = 24; S.prototype.getDataDescriptor = function() { if (this.crcAndFileSizeKnown) return b; if (this.useZip64Format()) { var k = L(J); return k.writeUInt32LE(134695760, 0), k.writeUInt32LE(this.crc32, 4), V(k, this.compressedSize, 8), V(k, this.uncompressedSize, 16), k; } else { var k = L(G); return k.writeUInt32LE(134695760, 0), k.writeUInt32LE(this.crc32, 4), k.writeUInt32LE(this.compressedSize, 8), k.writeUInt32LE(this.uncompressedSize, 12), k; } }; var B = 46, D = 28; S.prototype.getCentralDirectoryRecord = function() { var k = L(B), M = Y; this.crcAndFileSizeKnown || (M |= H); var O = this.compressedSize, A = this.uncompressedSize, F = this.relativeOffsetOfLocalHeader, Z, ee; return this.useZip64Format() ? (O = 4294967295, A = 4294967295, F = 4294967295, Z = U, ee = L(D), ee.writeUInt16LE(1, 0), ee.writeUInt16LE(D - 4, 2), V(ee, this.uncompressedSize, 4), V(ee, this.compressedSize, 12), V(ee, this.relativeOffsetOfLocalHeader, 20)) : (Z = T, ee = b), k.writeUInt32LE(33639248, 0), k.writeUInt16LE(q, 4), k.writeUInt16LE(Z, 6), k.writeUInt16LE(M, 8), k.writeUInt16LE(this.getCompressionMethod(), 10), k.writeUInt16LE(this.lastModFileTime, 12), k.writeUInt16LE(this.lastModFileDate, 14), k.writeUInt32LE(this.crc32, 16), k.writeUInt32LE(O, 20), k.writeUInt32LE(A, 24), k.writeUInt16LE(this.utf8FileName.length, 28), k.writeUInt16LE(ee.length, 30), k.writeUInt16LE(this.fileComment.length, 32), k.writeUInt16LE(0, 34), k.writeUInt16LE(0, 36), k.writeUInt32LE(this.externalFileAttributes, 38), k.writeUInt32LE(F, 42), Buffer.concat([ k, // file name (variable size) this.utf8FileName, // extra field (variable size) ee, // file comment (variable size) this.fileComment ]); }, S.prototype.getCompressionMethod = function() { var k = 0, M = 8; return this.compress ? M : k; }; function X(k) { var M = 0; M |= k.getDate() & 31, M |= (k.getMonth() + 1 & 15) << 5, M |= (k.getFullYear() - 1980 & 127) << 9; var O = 0; return O |= Math.floor(k.getSeconds() / 2), O |= (k.getMinutes() & 63) << 5, O |= (k.getHours() & 31) << 11, { date: M, time: O }; } function V(k, M, O) { var A = Math.floor(M / 4294967296), F = M % 4294967296; k.writeUInt32LE(F, O), k.writeUInt32LE(A, O + 4); } i.inherits(K, e); function K(k) { e.call(this, k), this.byteCount = 0; } K.prototype._transform = function(k, M, O) { this.byteCount += k.length, O(null, k); }, i.inherits($, e); function $(k) { e.call(this, k), this.crc32 = 0; } $.prototype._transform = function(k, M, O) { this.crc32 = a.unsigned(k, this.crc32), O(null, k); }; var _ = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "; if (_.length !== 256) throw new Error("assertion failure"); var I = null; function N(k) { if (/^[\x20-\x7e]*$/.test(k)) return C(k, "utf-8"); if (I == null) { I = {}; for (var M = 0; M < _.length; M++) I[_[M]] = M; } for (var O = L(k.length), M = 0; M < k.length; M++) { var A = I[k[M]]; if (A == null) throw new Error("character not encodable in CP437: " + JSON.stringify(k[M])); O[M] = A; } return O; } function L(k) { L = M; try { return L(k); } catch { return L = O, L(k); } function M(A) { return Buffer.allocUnsafe(A); } function O(A) { return new Buffer(A); } } function C(k, M) { C = O; try { return C(k, M); } catch { return C = A, C(k, M); } function O(F, Z) { return Buffer.from(F, Z); } function A(F, Z) { return new Buffer(F, Z); } } function Q(k, M) { Q = O; try { return Q(k, M); } catch { return Q = A, Q(k, M); } function O(F, Z) { return F.includes(Z); } function A(F, Z) { for (var ee = 0; ee <= F.length - Z.length; ee++) for (var P = 0; ; P++) { if (P === Z.length) return !0; if (F[ee + P] !== Z[P]) break; } return !1; } } return lh; } var dh = {}, ph = { exports: {} }, W4; function x0() { if (W4) return ph.exports; W4 = 1, typeof process > "u" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0 ? ph.exports = { nextTick: t } : ph.exports = process; function t(e, n, r, i) { if (typeof e != "function") throw new TypeError('"callback" argument must be a function'); var o = arguments.length, a, s; switch (o) { case 0: case 1: return process.nextTick(e); case 2: return process.nextTick(function() { e.call(null, n); }); case 3: return process.nextTick(function() { e.call(null, n, r); }); case 4: return process.nextTick(function() { e.call(null, n, r, i); }); default: for (a = new Array(o - 1), s = 0; s < a.length; ) a[s++] = arguments[s]; return process.nextTick(function() { e.apply(null, a); }); } } return ph.exports; } var dr = {}, K4; function Xp() { if (K4) return dr; K4 = 1; function t(y) { return Array.isArray ? Array.isArray(y) : h(y) === "[object Array]"; } dr.isArray = t; function e(y) { return typeof y == "boolean"; } dr.isBoolean = e; function n(y) { return y === null; } dr.isNull = n; function r(y) { return y == null; } dr.isNullOrUndefined = r; function i(y) { return typeof y == "number"; } dr.isNumber = i; function o(y) { return typeof y == "string"; } dr.isString = o; function a(y) { return typeof y == "symbol"; } dr.isSymbol = a; function s(y) { return y === void 0; } dr.isUndefined = s; function c(y) { return h(y) === "[object RegExp]"; } dr.isRegExp = c; function u(y) { return typeof y == "object" && y !== null; } dr.isObject = u; function d(y) { return h(y) === "[object Date]"; } dr.isDate = d; function p(y) { return h(y) === "[object Error]" || y instanceof Error; } dr.isError = p; function f(y) { return typeof y == "function"; } dr.isFunction = f; function m(y) { return y === null || typeof y == "boolean" || typeof y == "number" || typeof y == "string" || typeof y == "symbol" || // ES6 symbol typeof y > "u"; } dr.isPrimitive = m, dr.isBuffer = Os.Buffer.isBuffer; function h(y) { return Object.prototype.toString.call(y); } return dr; } var fh = { exports: {} }, V4; function Do() { return V4 || (V4 = 1, typeof Object.create == "function" ? fh.exports = function(e, n) { n && (e.super_ = n, e.prototype = Object.create(n.prototype, { constructor: { value: e, enumerable: !1, writable: !0, configurable: !0 } })); } : fh.exports = function(e, n) { if (n) { e.super_ = n; var r = function() { }; r.prototype = n.prototype, e.prototype = new r(), e.prototype.constructor = e; } }), fh.exports; } var ky, Y4; function jK() { if (Y4) return ky; Y4 = 1; var t = {}.toString; return ky = Array.isArray || function(e) { return t.call(e) == "[object Array]"; }, ky; } var Ny, J4; function TF() { return J4 || (J4 = 1, Ny = Qa.EventEmitter), Ny; } var hh = { exports: {} }, X4; function w0() { return X4 || (X4 = 1, (function(t, e) { var n = Os, r = n.Buffer; function i(a, s) { for (var c in a) s[c] = a[c]; } r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = n : (i(n, e), e.Buffer = o); function o(a, s, c) { return r(a, s, c); } i(r, o), o.from = function(a, s, c) { if (typeof a == "number") throw new TypeError("Argument must not be a number"); return r(a, s, c); }, o.alloc = function(a, s, c) { if (typeof a != "number") throw new TypeError("Argument must be a number"); var u = r(a); return s !== void 0 ? typeof c == "string" ? u.fill(s, c) : u.fill(s) : u.fill(0), u; }, o.allocUnsafe = function(a) { if (typeof a != "number") throw new TypeError("Argument must be a number"); return r(a); }, o.allocUnsafeSlow = function(a) { if (typeof a != "number") throw new TypeError("Argument must be a number"); return n.SlowBuffer(a); }; })(hh, hh.exports)), hh.exports; } var Py = { exports: {} }, Z4; function $K() { return Z4 || (Z4 = 1, (function(t) { function e(o, a) { if (!(o instanceof a)) throw new TypeError("Cannot call a class as a function"); } var n = w0().Buffer, r = Pn; function i(o, a, s) { o.copy(a, s); } t.exports = (function() { function o() { e(this, o), this.head = null, this.tail = null, this.length = 0; } return o.prototype.push = function(s) { var c = { data: s, next: null }; this.length > 0 ? this.tail.next = c : this.head = c, this.tail = c, ++this.length; }, o.prototype.unshift = function(s) { var c = { data: s, next: this.head }; this.length === 0 && (this.tail = c), this.head = c, ++this.length; }, o.prototype.shift = function() { if (this.length !== 0) { var s = this.head.data; return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, s; } }, o.prototype.clear = function() { this.head = this.tail = null, this.length = 0; }, o.prototype.join = function(s) { if (this.length === 0) return ""; for (var c = this.head, u = "" + c.data; c = c.next; ) u += s + c.data; return u; }, o.prototype.concat = function(s) { if (this.length === 0) return n.alloc(0); for (var c = n.allocUnsafe(s >>> 0), u = this.head, d = 0; u; ) i(u.data, c, d), d += u.data.length, u = u.next; return c; }, o; })(), r && r.inspect && r.inspect.custom && (t.exports.prototype[r.inspect.custom] = function() { var o = r.inspect({ length: this.length }); return this.constructor.name + " " + o; }); })(Py)), Py.exports; } var Dy, eC; function kF() { if (eC) return Dy; eC = 1; var t = x0(); function e(i, o) { var a = this, s = this._readableState && this._readableState.destroyed, c = this._writableState && this._writableState.destroyed; return s || c ? (o ? o(i) : i && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, t.nextTick(r, this, i)) : t.nextTick(r, this, i)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(i || null, function(u) { !o && u ? a._writableState ? a._writableState.errorEmitted || (a._writableState.errorEmitted = !0, t.nextTick(r, a, u)) : t.nextTick(r, a, u) : o && o(u); }), this); } function n() { this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); } function r(i, o) { i.emit("error", o); } return Dy = { destroy: e, undestroy: n }, Dy; } var Oy = {}, tC; function nC() { if (tC) return Oy; tC = 1; var t = w0().Buffer, e = t.isEncoding || function(g) { switch (g = "" + g, g && g.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function n(g) { if (!g) return "utf8"; for (var b; ; ) switch (g) { case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return g; default: if (b) return; g = ("" + g).toLowerCase(), b = !0; } } function r(g) { var b = n(g); if (typeof b != "string" && (t.isEncoding === e || !e(g))) throw new Error("Unknown encoding: " + g); return b || g; } Oy.StringDecoder = i; function i(g) { this.encoding = r(g); var b; switch (this.encoding) { case "utf16le": this.text = p, this.end = f, b = 4; break; case "utf8": this.fillLast = c, b = 4; break; case "base64": this.text = m, this.end = h, b = 3; break; default: this.write = y, this.end = x; return; } this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(b); } i.prototype.write = function(g) { if (g.length === 0) return ""; var b, S; if (this.lastNeed) { if (b = this.fillLast(g), b === void 0) return ""; S = this.lastNeed, this.lastNeed = 0; } else S = 0; return S < g.length ? b ? b + this.text(g, S) : this.text(g, S) : b || ""; }, i.prototype.end = d, i.prototype.text = u, i.prototype.fillLast = function(g) { if (this.lastNeed <= g.length) return g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, g.length), this.lastNeed -= g.length; }; function o(g) { return g <= 127 ? 0 : g >> 5 === 6 ? 2 : g >> 4 === 14 ? 3 : g >> 3 === 30 ? 4 : g >> 6 === 2 ? -1 : -2; } function a(g, b, S) { var E = b.length - 1; if (E < S) return 0; var T = o(b[E]); return T >= 0 ? (T > 0 && (g.lastNeed = T - 1), T) : --E < S || T === -2 ? 0 : (T = o(b[E]), T >= 0 ? (T > 0 && (g.lastNeed = T - 2), T) : --E < S || T === -2 ? 0 : (T = o(b[E]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : g.lastNeed = T - 3), T) : 0)); } function s(g, b, S) { if ((b[0] & 192) !== 128) return g.lastNeed = 0, "�"; if (g.lastNeed > 1 && b.length > 1) { if ((b[1] & 192) !== 128) return g.lastNeed = 1, "�"; if (g.lastNeed > 2 && b.length > 2 && (b[2] & 192) !== 128) return g.lastNeed = 2, "�"; } } function c(g) { var b = this.lastTotal - this.lastNeed, S = s(this, g); if (S !== void 0) return S; if (this.lastNeed <= g.length) return g.copy(this.lastChar, b, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); g.copy(this.lastChar, b, 0, g.length), this.lastNeed -= g.length; } function u(g, b) { var S = a(this, g, b); if (!this.lastNeed) return g.toString("utf8", b); this.lastTotal = S; var E = g.length - (S - this.lastNeed); return g.copy(this.lastChar, 0, E), g.toString("utf8", b, E); } function d(g) { var b = g && g.length ? this.write(g) : ""; return this.lastNeed ? b + "�" : b; } function p(g, b) { if ((g.length - b) % 2 === 0) { var S = g.toString("utf16le", b); if (S) { var E = S.charCodeAt(S.length - 1); if (E >= 55296 && E <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1], S.slice(0, -1); } return S; } return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = g[g.length - 1], g.toString("utf16le", b, g.length - 1); } function f(g) { var b = g && g.length ? this.write(g) : ""; if (this.lastNeed) { var S = this.lastTotal - this.lastNeed; return b + this.lastChar.toString("utf16le", 0, S); } return b; } function m(g, b) { var S = (g.length - b) % 3; return S === 0 ? g.toString("base64", b) : (this.lastNeed = 3 - S, this.lastTotal = 3, S === 1 ? this.lastChar[0] = g[g.length - 1] : (this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1]), g.toString("base64", b, g.length - S)); } function h(g) { var b = g && g.length ? this.write(g) : ""; return this.lastNeed ? b + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : b; } function y(g) { return g.toString(this.encoding); } function x(g) { return g && g.length ? this.write(g) : ""; } return Oy; } var Fy, rC; function NF() { if (rC) return Fy; rC = 1; var t = x0(); Fy = b; var e = jK(), n; b.ReadableState = g, Qa.EventEmitter; var r = function(A, F) { return A.listeners(F).length; }, i = TF(), o = w0().Buffer, a = (typeof $n < "u" ? $n : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() { }; function s(A) { return o.from(A); } function c(A) { return o.isBuffer(A) || A instanceof a; } var u = Object.create(Xp()); u.inherits = Do(); var d = Pn, p = void 0; d && d.debuglog ? p = d.debuglog("stream") : p = function() { }; var f = $K(), m = kF(), h; u.inherits(b, i); var y = ["error", "close", "destroy", "pause", "resume"]; function x(A, F, Z) { if (typeof A.prependListener == "function") return A.prependListener(F, Z); !A._events || !A._events[F] ? A.on(F, Z) : e(A._events[F]) ? A._events[F].unshift(Z) : A._events[F] = [Z, A._events[F]]; } function g(A, F) { n = n || bc(), A = A || {}; var Z = F instanceof n; this.objectMode = !!A.objectMode, Z && (this.objectMode = this.objectMode || !!A.readableObjectMode); var ee = A.highWaterMark, P = A.readableHighWaterMark, j = this.objectMode ? 16 : 16 * 1024; ee || ee === 0 ? this.highWaterMark = ee : Z && (P || P === 0) ? this.highWaterMark = P : this.highWaterMark = j, this.highWaterMark = Math.floor(this.highWaterMark), this.buffer = new f(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.destroyed = !1, this.defaultEncoding = A.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, A.encoding && (h || (h = nC().StringDecoder), this.decoder = new h(A.encoding), this.encoding = A.encoding); } function b(A) { if (n = n || bc(), !(this instanceof b)) return new b(A); this._readableState = new g(A, this), this.readable = !0, A && (typeof A.read == "function" && (this._read = A.read), typeof A.destroy == "function" && (this._destroy = A.destroy)), i.call(this); } Object.defineProperty(b.prototype, "destroyed", { get: function() { return this._readableState === void 0 ? !1 : this._readableState.destroyed; }, set: function(A) { this._readableState && (this._readableState.destroyed = A); } }), b.prototype.destroy = m.destroy, b.prototype._undestroy = m.undestroy, b.prototype._destroy = function(A, F) { this.push(null), F(A); }, b.prototype.push = function(A, F) { var Z = this._readableState, ee; return Z.objectMode ? ee = !0 : typeof A == "string" && (F = F || Z.defaultEncoding, F !== Z.encoding && (A = o.from(A, F), F = ""), ee = !0), S(this, A, F, !1, ee); }, b.prototype.unshift = function(A) { return S(this, A, null, !0, !1); }; function S(A, F, Z, ee, P) { var j = A._readableState; if (F === null) j.reading = !1, G(A, j); else { var W; P || (W = T(j, F)), W ? A.emit("error", W) : j.objectMode || F && F.length > 0 ? (typeof F != "string" && !j.objectMode && Object.getPrototypeOf(F) !== o.prototype && (F = s(F)), ee ? j.endEmitted ? A.emit("error", new Error("stream.unshift() after end event")) : E(A, j, F, !0) : j.ended ? A.emit("error", new Error("stream.push() after EOF")) : (j.reading = !1, j.decoder && !Z ? (F = j.decoder.write(F), j.objectMode || F.length !== 0 ? E(A, j, F, !1) : D(A, j)) : E(A, j, F, !1))) : ee || (j.reading = !1); } return U(j); } function E(A, F, Z, ee) { F.flowing && F.length === 0 && !F.sync ? (A.emit("data", Z), A.read(0)) : (F.length += F.objectMode ? 1 : Z.length, ee ? F.buffer.unshift(Z) : F.buffer.push(Z), F.needReadable && J(A)), D(A, F); } function T(A, F) { var Z; return !c(F) && typeof F != "string" && F !== void 0 && !A.objectMode && (Z = new TypeError("Invalid non-string/buffer chunk")), Z; } function U(A) { return !A.ended && (A.needReadable || A.length < A.highWaterMark || A.length === 0); } b.prototype.isPaused = function() { return this._readableState.flowing === !1; }, b.prototype.setEncoding = function(A) { return h || (h = nC().StringDecoder), this._readableState.decoder = new h(A), this._readableState.encoding = A, this; }; var q = 8388608; function Y(A) { return A >= q ? A = q : (A--, A |= A >>> 1, A |= A >>> 2, A |= A >>> 4, A |= A >>> 8, A |= A >>> 16, A++), A; } function H(A, F) { return A <= 0 || F.length === 0 && F.ended ? 0 : F.objectMode ? 1 : A !== A ? F.flowing && F.length ? F.buffer.head.data.length : F.length : (A > F.highWaterMark && (F.highWaterMark = Y(A)), A <= F.length ? A : F.ended ? F.length : (F.needReadable = !0, 0)); } b.prototype.read = function(A) { p("read", A), A = parseInt(A, 10); var F = this._readableState, Z = A; if (A !== 0 && (F.emittedReadable = !1), A === 0 && F.needReadable && (F.length >= F.highWaterMark || F.ended)) return p("read: emitReadable", F.length, F.ended), F.length === 0 && F.ended ? k(this) : J(this), null; if (A = H(A, F), A === 0 && F.ended) return F.length === 0 && k(this), null; var ee = F.needReadable; p("need readable", ee), (F.length === 0 || F.length - A < F.highWaterMark) && (ee = !0, p("length less than watermark", ee)), F.ended || F.reading ? (ee = !1, p("reading or ended", ee)) : ee && (p("do read"), F.reading = !0, F.sync = !0, F.length === 0 && (F.needReadable = !0), this._read(F.highWaterMark), F.sync = !1, F.reading || (A = H(Z, F))); var P; return A > 0 ? P = N(A, F) : P = null, P === null ? (F.needReadable = !0, A = 0) : F.length -= A, F.length === 0 && (F.ended || (F.needReadable = !0), Z !== A && F.ended && k(this)), P !== null && this.emit("data", P), P; }; function G(A, F) { if (!F.ended) { if (F.decoder) { var Z = F.decoder.end(); Z && Z.length && (F.buffer.push(Z), F.length += F.objectMode ? 1 : Z.length); } F.ended = !0, J(A); } } function J(A) { var F = A._readableState; F.needReadable = !1, F.emittedReadable || (p("emitReadable", F.flowing), F.emittedReadable = !0, F.sync ? t.nextTick(B, A) : B(A)); } function B(A) { p("emit readable"), A.emit("readable"), I(A); } function D(A, F) { F.readingMore || (F.readingMore = !0, t.nextTick(X, A, F)); } function X(A, F) { for (var Z = F.length; !F.reading && !F.flowing && !F.ended && F.length < F.highWaterMark && (p("maybeReadMore read 0"), A.read(0), Z !== F.length); ) Z = F.length; F.readingMore = !1; } b.prototype._read = function(A) { this.emit("error", new Error("_read() is not implemented")); }, b.prototype.pipe = function(A, F) { var Z = this, ee = this._readableState; switch (ee.pipesCount) { case 0: ee.pipes = A; break; case 1: ee.pipes = [ee.pipes, A]; break; default: ee.pipes.push(A); break; } ee.pipesCount += 1, p("pipe count=%d opts=%j", ee.pipesCount, F); var P = (!F || F.end !== !1) && A !== process.stdout && A !== process.stderr, j = P ? se : it; ee.endEmitted ? t.nextTick(j) : Z.once("end", j), A.on("unpipe", W); function W(ze, Ft) { p("onunpipe"), ze === Z && Ft && Ft.hasUnpiped === !1 && (Ft.hasUnpiped = !0, we()); } function se() { p("onend"), A.end(); } var ce = V(Z); A.on("drain", ce); var oe = !1; function we() { p("cleanup"), A.removeListener("close", Xe), A.removeListener("finish", Ye), A.removeListener("drain", ce), A.removeListener("error", We), A.removeListener("unpipe", W), Z.removeListener("end", se), Z.removeListener("end", it), Z.removeListener("data", He), oe = !0, ee.awaitDrain && (!A._writableState || A._writableState.needDrain) && ce(); } var Me = !1; Z.on("data", He); function He(ze) { p("ondata"), Me = !1; var Ft = A.write(ze); Ft === !1 && !Me && ((ee.pipesCount === 1 && ee.pipes === A || ee.pipesCount > 1 && O(ee.pipes, A) !== -1) && !oe && (p("false write response, pause", ee.awaitDrain), ee.awaitDrain++, Me = !0), Z.pause()); } function We(ze) { p("onerror", ze), it(), A.removeListener("error", We), r(A, "error") === 0 && A.emit("error", ze); } x(A, "error", We); function Xe() { A.removeListener("finish", Ye), it(); } A.once("close", Xe); function Ye() { p("onfinish"), A.removeListener("close", Xe), it(); } A.once("finish", Ye); function it() { p("unpipe"), Z.unpipe(A); } return A.emit("pipe", Z), ee.flowing || (p("pipe resume"), Z.resume()), A; }; function V(A) { return function() { var F = A._readableState; p("pipeOnDrain", F.awaitDrain), F.awaitDrain && F.awaitDrain--, F.awaitDrain === 0 && r(A, "data") && (F.flowing = !0, I(A)); }; } b.prototype.unpipe = function(A) { var F = this._readableState, Z = { hasUnpiped: !1 }; if (F.pipesCount === 0) return this; if (F.pipesCount === 1) return A && A !== F.pipes ? this : (A || (A = F.pipes), F.pipes = null, F.pipesCount = 0, F.flowing = !1, A && A.emit("unpipe", this, Z), this); if (!A) { var ee = F.pipes, P = F.pipesCount; F.pipes = null, F.pipesCount = 0, F.flowing = !1; for (var j = 0; j < P; j++) ee[j].emit("unpipe", this, { hasUnpiped: !1 }); return this; } var W = O(F.pipes, A); return W === -1 ? this : (F.pipes.splice(W, 1), F.pipesCount -= 1, F.pipesCount === 1 && (F.pipes = F.pipes[0]), A.emit("unpipe", this, Z), this); }, b.prototype.on = function(A, F) { var Z = i.prototype.on.call(this, A, F); if (A === "data") this._readableState.flowing !== !1 && this.resume(); else if (A === "readable") { var ee = this._readableState; !ee.endEmitted && !ee.readableListening && (ee.readableListening = ee.needReadable = !0, ee.emittedReadable = !1, ee.reading ? ee.length && J(this) : t.nextTick(K, this)); } return Z; }, b.prototype.addListener = b.prototype.on; function K(A) { p("readable nexttick read 0"), A.read(0); } b.prototype.resume = function() { var A = this._readableState; return A.flowing || (p("resume"), A.flowing = !0, $(this, A)), this; }; function $(A, F) { F.resumeScheduled || (F.resumeScheduled = !0, t.nextTick(_, A, F)); } function _(A, F) { F.reading || (p("resume read 0"), A.read(0)), F.resumeScheduled = !1, F.awaitDrain = 0, A.emit("resume"), I(A), F.flowing && !F.reading && A.read(0); } b.prototype.pause = function() { return p("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (p("pause"), this._readableState.flowing = !1, this.emit("pause")), this; }; function I(A) { var F = A._readableState; for (p("flow", F.flowing); F.flowing && A.read() !== null; ) ; } b.prototype.wrap = function(A) { var F = this, Z = this._readableState, ee = !1; A.on("end", function() { if (p("wrapped end"), Z.decoder && !Z.ended) { var W = Z.decoder.end(); W && W.length && F.push(W); } F.push(null); }), A.on("data", function(W) { if (p("wrapped data"), Z.decoder && (W = Z.decoder.write(W)), !(Z.objectMode && W == null) && !(!Z.objectMode && (!W || !W.length))) { var se = F.push(W); se || (ee = !0, A.pause()); } }); for (var P in A) this[P] === void 0 && typeof A[P] == "function" && (this[P] = /* @__PURE__ */ (function(W) { return function() { return A[W].apply(A, arguments); }; })(P)); for (var j = 0; j < y.length; j++) A.on(y[j], this.emit.bind(this, y[j])); return this._read = function(W) { p("wrapped _read", W), ee && (ee = !1, A.resume()); }, this; }, Object.defineProperty(b.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState.highWaterMark; } }), b._fromList = N; function N(A, F) { if (F.length === 0) return null; var Z; return F.objectMode ? Z = F.buffer.shift() : !A || A >= F.length ? (F.decoder ? Z = F.buffer.join("") : F.buffer.length === 1 ? Z = F.buffer.head.data : Z = F.buffer.concat(F.length), F.buffer.clear()) : Z = L(A, F.buffer, F.decoder), Z; } function L(A, F, Z) { var ee; return A < F.head.data.length ? (ee = F.head.data.slice(0, A), F.head.data = F.head.data.slice(A)) : A === F.head.data.length ? ee = F.shift() : ee = Z ? C(A, F) : Q(A, F), ee; } function C(A, F) { var Z = F.head, ee = 1, P = Z.data; for (A -= P.length; Z = Z.next; ) { var j = Z.data, W = A > j.length ? j.length : A; if (W === j.length ? P += j : P += j.slice(0, A), A -= W, A === 0) { W === j.length ? (++ee, Z.next ? F.head = Z.next : F.head = F.tail = null) : (F.head = Z, Z.data = j.slice(W)); break; } ++ee; } return F.length -= ee, P; } function Q(A, F) { var Z = o.allocUnsafe(A), ee = F.head, P = 1; for (ee.data.copy(Z), A -= ee.data.length; ee = ee.next; ) { var j = ee.data, W = A > j.length ? j.length : A; if (j.copy(Z, Z.length - A, 0, W), A -= W, A === 0) { W === j.length ? (++P, ee.next ? F.head = ee.next : F.head = F.tail = null) : (F.head = ee, ee.data = j.slice(W)); break; } ++P; } return F.length -= P, Z; } function k(A) { var F = A._readableState; if (F.length > 0) throw new Error('"endReadable()" called on non-empty stream'); F.endEmitted || (F.ended = !0, t.nextTick(M, F, A)); } function M(A, F) { !A.endEmitted && A.length === 0 && (A.endEmitted = !0, F.readable = !1, F.emit("end")); } function O(A, F) { for (var Z = 0, ee = A.length; Z < ee; Z++) if (A[Z] === F) return Z; return -1; } return Fy; } var My, iC; function PF() { if (iC) return My; iC = 1, My = t; function t(n, r) { if (e("noDeprecation")) return n; var i = !1; function o() { if (!i) { if (e("throwDeprecation")) throw new Error(r); e("traceDeprecation") ? console.trace(r) : console.warn(r), i = !0; } return n.apply(this, arguments); } return o; } function e(n) { try { if (!$n.localStorage) return !1; } catch { return !1; } var r = $n.localStorage[n]; return r == null ? !1 : String(r).toLowerCase() === "true"; } return My; } var Ry, oC; function DF() { if (oC) return Ry; oC = 1; var t = x0(); Ry = y; function e($) { var _ = this; this.next = null, this.entry = null, this.finish = function() { K(_, $); }; } var n = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : t.nextTick, r; y.WritableState = m; var i = Object.create(Xp()); i.inherits = Do(); var o = { deprecate: PF() }, a = TF(), s = w0().Buffer, c = (typeof $n < "u" ? $n : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() { }; function u($) { return s.from($); } function d($) { return s.isBuffer($) || $ instanceof c; } var p = kF(); i.inherits(y, a); function f() { } function m($, _) { r = r || bc(), $ = $ || {}; var I = _ instanceof r; this.objectMode = !!$.objectMode, I && (this.objectMode = this.objectMode || !!$.writableObjectMode); var N = $.highWaterMark, L = $.writableHighWaterMark, C = this.objectMode ? 16 : 16 * 1024; N || N === 0 ? this.highWaterMark = N : I && (L || L === 0) ? this.highWaterMark = L : this.highWaterMark = C, this.highWaterMark = Math.floor(this.highWaterMark), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; var Q = $.decodeStrings === !1; this.decodeStrings = !Q, this.defaultEncoding = $.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(k) { q(_, k); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.bufferedRequestCount = 0, this.corkedRequestsFree = new e(this); } m.prototype.getBuffer = function() { for (var _ = this.bufferedRequest, I = []; _; ) I.push(_), _ = _.next; return I; }, (function() { try { Object.defineProperty(m.prototype, "buffer", { get: o.deprecate(function() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch { } })(); var h; typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (h = Function.prototype[Symbol.hasInstance], Object.defineProperty(y, Symbol.hasInstance, { value: function($) { return h.call(this, $) ? !0 : this !== y ? !1 : $ && $._writableState instanceof m; } })) : h = function($) { return $ instanceof this; }; function y($) { if (r = r || bc(), !h.call(y, this) && !(this instanceof r)) return new y($); this._writableState = new m($, this), this.writable = !0, $ && (typeof $.write == "function" && (this._write = $.write), typeof $.writev == "function" && (this._writev = $.writev), typeof $.destroy == "function" && (this._destroy = $.destroy), typeof $.final == "function" && (this._final = $.final)), a.call(this); } y.prototype.pipe = function() { this.emit("error", new Error("Cannot pipe, not readable")); }; function x($, _) { var I = new Error("write after end"); $.emit("error", I), t.nextTick(_, I); } function g($, _, I, N) { var L = !0, C = !1; return I === null ? C = new TypeError("May not write null values to stream") : typeof I != "string" && I !== void 0 && !_.objectMode && (C = new TypeError("Invalid non-string/buffer chunk")), C && ($.emit("error", C), t.nextTick(N, C), L = !1), L; } y.prototype.write = function($, _, I) { var N = this._writableState, L = !1, C = !N.objectMode && d($); return C && !s.isBuffer($) && ($ = u($)), typeof _ == "function" && (I = _, _ = null), C ? _ = "buffer" : _ || (_ = N.defaultEncoding), typeof I != "function" && (I = f), N.ended ? x(this, I) : (C || g(this, N, $, I)) && (N.pendingcb++, L = S(this, N, C, $, _, I)), L; }, y.prototype.cork = function() { var $ = this._writableState; $.corked++; }, y.prototype.uncork = function() { var $ = this._writableState; $.corked && ($.corked--, !$.writing && !$.corked && !$.bufferProcessing && $.bufferedRequest && G(this, $)); }, y.prototype.setDefaultEncoding = function(_) { if (typeof _ == "string" && (_ = _.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((_ + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + _); return this._writableState.defaultEncoding = _, this; }; function b($, _, I) { return !$.objectMode && $.decodeStrings !== !1 && typeof _ == "string" && (_ = s.from(_, I)), _; } Object.defineProperty(y.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.highWaterMark; } }); function S($, _, I, N, L, C) { if (!I) { var Q = b(_, N, L); N !== Q && (I = !0, L = "buffer", N = Q); } var k = _.objectMode ? 1 : N.length; _.length += k; var M = _.length < _.highWaterMark; if (M || (_.needDrain = !0), _.writing || _.corked) { var O = _.lastBufferedRequest; _.lastBufferedRequest = { chunk: N, encoding: L, isBuf: I, callback: C, next: null }, O ? O.next = _.lastBufferedRequest : _.bufferedRequest = _.lastBufferedRequest, _.bufferedRequestCount += 1; } else E($, _, !1, k, N, L, C); return M; } function E($, _, I, N, L, C, Q) { _.writelen = N, _.writecb = Q, _.writing = !0, _.sync = !0, I ? $._writev(L, _.onwrite) : $._write(L, C, _.onwrite), _.sync = !1; } function T($, _, I, N, L) { --_.pendingcb, I ? (t.nextTick(L, N), t.nextTick(X, $, _), $._writableState.errorEmitted = !0, $.emit("error", N)) : (L(N), $._writableState.errorEmitted = !0, $.emit("error", N), X($, _)); } function U($) { $.writing = !1, $.writecb = null, $.length -= $.writelen, $.writelen = 0; } function q($, _) { var I = $._writableState, N = I.sync, L = I.writecb; if (U(I), _) T($, I, N, _, L); else { var C = J(I); !C && !I.corked && !I.bufferProcessing && I.bufferedRequest && G($, I), N ? n(Y, $, I, C, L) : Y($, I, C, L); } } function Y($, _, I, N) { I || H($, _), _.pendingcb--, N(), X($, _); } function H($, _) { _.length === 0 && _.needDrain && (_.needDrain = !1, $.emit("drain")); } function G($, _) { _.bufferProcessing = !0; var I = _.bufferedRequest; if ($._writev && I && I.next) { var N = _.bufferedRequestCount, L = new Array(N), C = _.corkedRequestsFree; C.entry = I; for (var Q = 0, k = !0; I; ) L[Q] = I, I.isBuf || (k = !1), I = I.next, Q += 1; L.allBuffers = k, E($, _, !0, _.length, L, "", C.finish), _.pendingcb++, _.lastBufferedRequest = null, C.next ? (_.corkedRequestsFree = C.next, C.next = null) : _.corkedRequestsFree = new e(_), _.bufferedRequestCount = 0; } else { for (; I; ) { var M = I.chunk, O = I.encoding, A = I.callback, F = _.objectMode ? 1 : M.length; if (E($, _, !1, F, M, O, A), I = I.next, _.bufferedRequestCount--, _.writing) break; } I === null && (_.lastBufferedRequest = null); } _.bufferedRequest = I, _.bufferProcessing = !1; } y.prototype._write = function($, _, I) { I(new Error("_write() is not implemented")); }, y.prototype._writev = null, y.prototype.end = function($, _, I) { var N = this._writableState; typeof $ == "function" ? (I = $, $ = null, _ = null) : typeof _ == "function" && (I = _, _ = null), $ != null && this.write($, _), N.corked && (N.corked = 1, this.uncork()), N.ending || V(this, N, I); }; function J($) { return $.ending && $.length === 0 && $.bufferedRequest === null && !$.finished && !$.writing; } function B($, _) { $._final(function(I) { _.pendingcb--, I && $.emit("error", I), _.prefinished = !0, $.emit("prefinish"), X($, _); }); } function D($, _) { !_.prefinished && !_.finalCalled && (typeof $._final == "function" ? (_.pendingcb++, _.finalCalled = !0, t.nextTick(B, $, _)) : (_.prefinished = !0, $.emit("prefinish"))); } function X($, _) { var I = J(_); return I && (D($, _), _.pendingcb === 0 && (_.finished = !0, $.emit("finish"))), I; } function V($, _, I) { _.ending = !0, X($, _), I && (_.finished ? t.nextTick(I) : $.once("finish", I)), _.ended = !0, $.writable = !1; } function K($, _, I) { var N = $.entry; for ($.entry = null; N; ) { var L = N.callback; _.pendingcb--, L(I), N = N.next; } _.corkedRequestsFree.next = $; } return Object.defineProperty(y.prototype, "destroyed", { get: function() { return this._writableState === void 0 ? !1 : this._writableState.destroyed; }, set: function($) { this._writableState && (this._writableState.destroyed = $); } }), y.prototype.destroy = p.destroy, y.prototype._undestroy = p.undestroy, y.prototype._destroy = function($, _) { this.end(), _($); }, Ry; } var By, aC; function bc() { if (aC) return By; aC = 1; var t = x0(), e = Object.keys || function(p) { var f = []; for (var m in p) f.push(m); return f; }; By = c; var n = Object.create(Xp()); n.inherits = Do(); var r = NF(), i = DF(); n.inherits(c, r); for (var o = e(i.prototype), a = 0; a < o.length; a++) { var s = o[a]; c.prototype[s] || (c.prototype[s] = i.prototype[s]); } function c(p) { if (!(this instanceof c)) return new c(p); r.call(this, p), i.call(this, p), p && p.readable === !1 && (this.readable = !1), p && p.writable === !1 && (this.writable = !1), this.allowHalfOpen = !0, p && p.allowHalfOpen === !1 && (this.allowHalfOpen = !1), this.once("end", u); } Object.defineProperty(c.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.highWaterMark; } }); function u() { this.allowHalfOpen || this._writableState.ended || t.nextTick(d, this); } function d(p) { p.end(); } return Object.defineProperty(c.prototype, "destroyed", { get: function() { return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed; }, set: function(p) { this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = p, this._writableState.destroyed = p); } }), c.prototype._destroy = function(p, f) { this.push(null), this.end(), t.nextTick(f, p); }, By; } var Uy, sC; function GK() { return sC || (sC = 1, Uy = bc()), Uy; } var mh = { exports: {} }; /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ var cC; function S0() { return cC || (cC = 1, (function(t, e) { var n = Os, r = n.Buffer; function i(a, s) { for (var c in a) s[c] = a[c]; } r.from && r.alloc && r.allocUnsafe && r.allocUnsafeSlow ? t.exports = n : (i(n, e), e.Buffer = o); function o(a, s, c) { return r(a, s, c); } o.prototype = Object.create(r.prototype), i(r, o), o.from = function(a, s, c) { if (typeof a == "number") throw new TypeError("Argument must not be a number"); return r(a, s, c); }, o.alloc = function(a, s, c) { if (typeof a != "number") throw new TypeError("Argument must be a number"); var u = r(a); return s !== void 0 ? typeof c == "string" ? u.fill(s, c) : u.fill(s) : u.fill(0), u; }, o.allocUnsafe = function(a) { if (typeof a != "number") throw new TypeError("Argument must be a number"); return r(a); }, o.allocUnsafeSlow = function(a) { if (typeof a != "number") throw new TypeError("Argument must be a number"); return n.SlowBuffer(a); }; })(mh, mh.exports)), mh.exports; } var Ly, uC; function qK() { if (uC) return Ly; uC = 1; var t = GK(), e = Pn, n = S0().Buffer; function r(i) { if (!(this instanceof r)) return new r(i); if (this._bufs = [], this.length = 0, typeof i == "function") { this._callback = i; var o = function(s) { this._callback && (this._callback(s), this._callback = null); }.bind(this); this.on("pipe", function(s) { s.on("error", o); }), this.on("unpipe", function(s) { s.removeListener("error", o); }); } else this.append(i); t.call(this); } return e.inherits(r, t), r.prototype._offset = function(o) { var a = 0, s = 0, c; if (o === 0) return [0, 0]; for (; s < this._bufs.length; s++) { if (c = a + this._bufs[s].length, o < c || s == this._bufs.length - 1) return [s, o - a]; a = c; } }, r.prototype.append = function(o) { var a = 0; if (n.isBuffer(o)) this._appendBuffer(o); else if (Array.isArray(o)) for (; a < o.length; a++) this.append(o[a]); else if (o instanceof r) for (; a < o._bufs.length; a++) this.append(o._bufs[a]); else o != null && (typeof o == "number" && (o = o.toString()), this._appendBuffer(n.from(o))); return this; }, r.prototype._appendBuffer = function(o) { this._bufs.push(o), this.length += o.length; }, r.prototype._write = function(o, a, s) { this._appendBuffer(o), typeof s == "function" && s(); }, r.prototype._read = function(o) { if (!this.length) return this.push(null); o = Math.min(o, this.length), this.push(this.slice(0, o)), this.consume(o); }, r.prototype.end = function(o) { t.prototype.end.call(this, o), this._callback && (this._callback(null, this.slice()), this._callback = null); }, r.prototype.get = function(o) { return this.slice(o, o + 1)[0]; }, r.prototype.slice = function(o, a) { return typeof o == "number" && o < 0 && (o += this.length), typeof a == "number" && a < 0 && (a += this.length), this.copy(null, 0, o, a); }, r.prototype.copy = function(o, a, s, c) { if ((typeof s != "number" || s < 0) && (s = 0), (typeof c != "number" || c > this.length) && (c = this.length), s >= this.length || c <= 0) return o || n.alloc(0); var u = !!o, d = this._offset(s), p = c - s, f = p, m = u && a || 0, h = d[1], y, x; if (s === 0 && c == this.length) { if (!u) return this._bufs.length === 1 ? this._bufs[0] : n.concat(this._bufs, this.length); for (x = 0; x < this._bufs.length; x++) this._bufs[x].copy(o, m), m += this._bufs[x].length; return o; } if (f <= this._bufs[d[0]].length - h) return u ? this._bufs[d[0]].copy(o, a, h, h + f) : this._bufs[d[0]].slice(h, h + f); for (u || (o = n.allocUnsafe(p)), x = d[0]; x < this._bufs.length; x++) { if (y = this._bufs[x].length - h, f > y) this._bufs[x].copy(o, m, h), m += y; else { this._bufs[x].copy(o, m, h, h + f), m += y; break; } f -= y, h && (h = 0); } return o.length > m ? o.slice(0, m) : o; }, r.prototype.shallowSlice = function(o, a) { o = o || 0, a = a || this.length, o < 0 && (o += this.length), a < 0 && (a += this.length); var s = this._offset(o), c = this._offset(a), u = this._bufs.slice(s[0], c[0] + 1); return c[1] == 0 ? u.pop() : u[u.length - 1] = u[u.length - 1].slice(0, c[1]), s[1] != 0 && (u[0] = u[0].slice(s[1])), new r(u); }, r.prototype.toString = function(o, a, s) { return this.slice(a, s).toString(o); }, r.prototype.consume = function(o) { if (o = Math.trunc(o), Number.isNaN(o) || o <= 0) return this; for (; this._bufs.length; ) if (o >= this._bufs[0].length) o -= this._bufs[0].length, this.length -= this._bufs[0].length, this._bufs.shift(); else { this._bufs[0] = this._bufs[0].slice(o), this.length -= o; break; } return this; }, r.prototype.duplicate = function() { for (var o = 0, a = new r(); o < this._bufs.length; o++) a.append(this._bufs[o]); return a; }, r.prototype.destroy = function() { this._bufs.length = 0, this.length = 0, this.push(null); }, (function() { var i = { readDoubleBE: 8, readDoubleLE: 8, readFloatBE: 4, readFloatLE: 4, readInt32BE: 4, readInt32LE: 4, readUInt32BE: 4, readUInt32LE: 4, readInt16BE: 2, readInt16LE: 2, readUInt16BE: 2, readUInt16LE: 2, readInt8: 1, readUInt8: 1 }; for (var o in i) (function(a) { r.prototype[a] = function(s) { return this.slice(s, s + i[a])[a](0); }; })(o); })(), Ly = r, Ly; } var Qy, lC; function OF() { if (lC) return Qy; lC = 1, Qy = e; var t = Object.prototype.hasOwnProperty; function e() { for (var n = {}, r = 0; r < arguments.length; r++) { var i = arguments[r]; for (var o in i) t.call(i, o) && (n[o] = i[o]); } return n; } return Qy; } var Ys = {}, jy, dC; function zK() { if (dC) return jy; dC = 1; var t = {}.toString; return jy = Array.isArray || function(e) { return t.call(e) == "[object Array]"; }, jy; } var $y, pC; function Zp() { return pC || (pC = 1, $y = TypeError), $y; } var Gy, fC; function FF() { return fC || (fC = 1, Gy = Object), Gy; } var qy, hC; function HK() { return hC || (hC = 1, qy = Error), qy; } var zy, mC; function WK() { return mC || (mC = 1, zy = EvalError), zy; } var Hy, gC; function KK() { return gC || (gC = 1, Hy = RangeError), Hy; } var Wy, yC; function VK() { return yC || (yC = 1, Wy = ReferenceError), Wy; } var Ky, bC; function MF() { return bC || (bC = 1, Ky = SyntaxError), Ky; } var Vy, vC; function YK() { return vC || (vC = 1, Vy = URIError), Vy; } var Yy, xC; function JK() { return xC || (xC = 1, Yy = Math.abs), Yy; } var Jy, wC; function XK() { return wC || (wC = 1, Jy = Math.floor), Jy; } var Xy, SC; function ZK() { return SC || (SC = 1, Xy = Math.max), Xy; } var Zy, _C; function eV() { return _C || (_C = 1, Zy = Math.min), Zy; } var eb, EC; function tV() { return EC || (EC = 1, eb = Math.pow), eb; } var tb, AC; function nV() { return AC || (AC = 1, tb = Math.round), tb; } var nb, IC; function rV() { return IC || (IC = 1, nb = Number.isNaN || function(e) { return e !== e; }), nb; } var rb, CC; function iV() { if (CC) return rb; CC = 1; var t = /* @__PURE__ */ rV(); return rb = function(n) { return t(n) || n === 0 ? n : n < 0 ? -1 : 1; }, rb; } var ib, TC; function oV() { return TC || (TC = 1, ib = Object.getOwnPropertyDescriptor), ib; } var ob, kC; function ef() { if (kC) return ob; kC = 1; var t = /* @__PURE__ */ oV(); if (t) try { t([], "length"); } catch { t = null; } return ob = t, ob; } var ab, NC; function _0() { if (NC) return ab; NC = 1; var t = Object.defineProperty || !1; if (t) try { t({}, "a", { value: 1 }); } catch { t = !1; } return ab = t, ab; } var sb, PC; function RF() { return PC || (PC = 1, sb = function() { if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function") return !1; if (typeof Symbol.iterator == "symbol") return !0; var e = {}, n = Symbol("test"), r = Object(n); if (typeof n == "string" || Object.prototype.toString.call(n) !== "[object Symbol]" || Object.prototype.toString.call(r) !== "[object Symbol]") return !1; var i = 42; e[n] = i; for (var o in e) return !1; if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0) return !1; var a = Object.getOwnPropertySymbols(e); if (a.length !== 1 || a[0] !== n || !Object.prototype.propertyIsEnumerable.call(e, n)) return !1; if (typeof Object.getOwnPropertyDescriptor == "function") { var s = ( /** @type {PropertyDescriptor} */ Object.getOwnPropertyDescriptor(e, n) ); if (s.value !== i || s.enumerable !== !0) return !1; } return !0; }), sb; } var cb, DC; function aV() { if (DC) return cb; DC = 1; var t = typeof Symbol < "u" && Symbol, e = RF(); return cb = function() { return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e(); }, cb; } var ub, OC; function BF() { return OC || (OC = 1, ub = typeof Reflect < "u" && Reflect.getPrototypeOf || null), ub; } var lb, FC; function UF() { if (FC) return lb; FC = 1; var t = /* @__PURE__ */ FF(); return lb = t.getPrototypeOf || null, lb; } var db, MC; function sV() { if (MC) return db; MC = 1; var t = "Function.prototype.bind called on incompatible ", e = Object.prototype.toString, n = Math.max, r = "[object Function]", i = function(c, u) { for (var d = [], p = 0; p < c.length; p += 1) d[p] = c[p]; for (var f = 0; f < u.length; f += 1) d[f + c.length] = u[f]; return d; }, o = function(c, u) { for (var d = [], p = u, f = 0; p < c.length; p += 1, f += 1) d[f] = c[p]; return d; }, a = function(s, c) { for (var u = "", d = 0; d < s.length; d += 1) u += s[d], d + 1 < s.length && (u += c); return u; }; return db = function(c) { var u = this; if (typeof u != "function" || e.apply(u) !== r) throw new TypeError(t + u); for (var d = o(arguments, 1), p, f = function() { if (this instanceof p) { var g = u.apply( this, i(d, arguments) ); return Object(g) === g ? g : this; } return u.apply( c, i(d, arguments) ); }, m = n(0, u.length - d.length), h = [], y = 0; y < m; y++) h[y] = "$" + y; if (p = Function("binder", "return function (" + a(h, ",") + "){ return binder.apply(this,arguments); }")(f), u.prototype) { var x = function() { }; x.prototype = u.prototype, p.prototype = new x(), x.prototype = null; } return p; }, db; } var pb, RC; function tf() { if (RC) return pb; RC = 1; var t = sV(); return pb = Function.prototype.bind || t, pb; } var fb, BC; function cE() { return BC || (BC = 1, fb = Function.prototype.call), fb; } var hb, UC; function uE() { return UC || (UC = 1, hb = Function.prototype.apply), hb; } var mb, LC; function cV() { return LC || (LC = 1, mb = typeof Reflect < "u" && Reflect && Reflect.apply), mb; } var gb, QC; function LF() { if (QC) return gb; QC = 1; var t = tf(), e = uE(), n = cE(), r = cV(); return gb = r || t.call(n, e), gb; } var yb, jC; function lE() { if (jC) return yb; jC = 1; var t = tf(), e = /* @__PURE__ */ Zp(), n = cE(), r = LF(); return yb = function(o) { if (o.length < 1 || typeof o[0] != "function") throw new e("a function is required"); return r(t, n, o); }, yb; } var bb, $C; function uV() { if ($C) return bb; $C = 1; var t = lE(), e = /* @__PURE__ */ ef(), n; try { n = /** @type {{ __proto__?: typeof Array.prototype }} */ [].__proto__ === Array.prototype; } catch (a) { if (!a || typeof a != "object" || !("code" in a) || a.code !== "ERR_PROTO_ACCESS") throw a; } var r = !!n && e && e( Object.prototype, /** @type {keyof typeof Object.prototype} */ "__proto__" ), i = Object, o = i.getPrototypeOf; return bb = r && typeof r.get == "function" ? t([r.get]) : typeof o == "function" ? ( /** @type {import('./get')} */ function(s) { return o(s == null ? s : i(s)); } ) : !1, bb; } var vb, GC; function QF() { if (GC) return vb; GC = 1; var t = BF(), e = UF(), n = /* @__PURE__ */ uV(); return vb = t ? function(i) { return t(i); } : e ? function(i) { if (!i || typeof i != "object" && typeof i != "function") throw new TypeError("getProto: not an object"); return e(i); } : n ? function(i) { return n(i); } : null, vb; } var xb, qC; function lV() { if (qC) return xb; qC = 1; var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, n = tf(); return xb = n.call(t, e), xb; } var wb, zC; function jF() { if (zC) return wb; zC = 1; var t, e = /* @__PURE__ */ FF(), n = /* @__PURE__ */ HK(), r = /* @__PURE__ */ WK(), i = /* @__PURE__ */ KK(), o = /* @__PURE__ */ VK(), a = /* @__PURE__ */ MF(), s = /* @__PURE__ */ Zp(), c = /* @__PURE__ */ YK(), u = /* @__PURE__ */ JK(), d = /* @__PURE__ */ XK(), p = /* @__PURE__ */ ZK(), f = /* @__PURE__ */ eV(), m = /* @__PURE__ */ tV(), h = /* @__PURE__ */ nV(), y = /* @__PURE__ */ iV(), x = Function, g = function(Z) { try { return x('"use strict"; return (' + Z + ").constructor;")(); } catch { } }, b = /* @__PURE__ */ ef(), S = /* @__PURE__ */ _0(), E = function() { throw new s(); }, T = b ? (function() { try { return arguments.callee, E; } catch { try { return b(arguments, "callee").get; } catch { return E; } } })() : E, U = aV()(), q = QF(), Y = UF(), H = BF(), G = uE(), J = cE(), B = {}, D = typeof Uint8Array > "u" || !q ? t : q(Uint8Array), X = { __proto__: null, "%AggregateError%": typeof AggregateError > "u" ? t : AggregateError, "%Array%": Array, "%ArrayBuffer%": typeof ArrayBuffer > "u" ? t : ArrayBuffer, "%ArrayIteratorPrototype%": U && q ? q([][Symbol.iterator]()) : t, "%AsyncFromSyncIteratorPrototype%": t, "%AsyncFunction%": B, "%AsyncGenerator%": B, "%AsyncGeneratorFunction%": B, "%AsyncIteratorPrototype%": B, "%Atomics%": typeof Atomics > "u" ? t : Atomics, "%BigInt%": typeof BigInt > "u" ? t : BigInt, "%BigInt64Array%": typeof BigInt64Array > "u" ? t : BigInt64Array, "%BigUint64Array%": typeof BigUint64Array > "u" ? t : BigUint64Array, "%Boolean%": Boolean, "%DataView%": typeof DataView > "u" ? t : DataView, "%Date%": Date, "%decodeURI%": decodeURI, "%decodeURIComponent%": decodeURIComponent, "%encodeURI%": encodeURI, "%encodeURIComponent%": encodeURIComponent, "%Error%": n, "%eval%": eval, // eslint-disable-line no-eval "%EvalError%": r, "%Float16Array%": typeof Float16Array > "u" ? t : Float16Array, "%Float32Array%": typeof Float32Array > "u" ? t : Float32Array, "%Float64Array%": typeof Float64Array > "u" ? t : Float64Array, "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? t : FinalizationRegistry, "%Function%": x, "%GeneratorFunction%": B, "%Int8Array%": typeof Int8Array > "u" ? t : Int8Array, "%Int16Array%": typeof Int16Array > "u" ? t : Int16Array, "%Int32Array%": typeof Int32Array > "u" ? t : Int32Array, "%isFinite%": isFinite, "%isNaN%": isNaN, "%IteratorPrototype%": U && q ? q(q([][Symbol.iterator]())) : t, "%JSON%": typeof JSON == "object" ? JSON : t, "%Map%": typeof Map > "u" ? t : Map, "%MapIteratorPrototype%": typeof Map > "u" || !U || !q ? t : q((/* @__PURE__ */ new Map())[Symbol.iterator]()), "%Math%": Math, "%Number%": Number, "%Object%": e, "%Object.getOwnPropertyDescriptor%": b, "%parseFloat%": parseFloat, "%parseInt%": parseInt, "%Promise%": typeof Promise > "u" ? t : Promise, "%Proxy%": typeof Proxy > "u" ? t : Proxy, "%RangeError%": i, "%ReferenceError%": o, "%Reflect%": typeof Reflect > "u" ? t : Reflect, "%RegExp%": RegExp, "%Set%": typeof Set > "u" ? t : Set, "%SetIteratorPrototype%": typeof Set > "u" || !U || !q ? t : q((/* @__PURE__ */ new Set())[Symbol.iterator]()), "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? t : SharedArrayBuffer, "%String%": String, "%StringIteratorPrototype%": U && q ? q(""[Symbol.iterator]()) : t, "%Symbol%": U ? Symbol : t, "%SyntaxError%": a, "%ThrowTypeError%": T, "%TypedArray%": D, "%TypeError%": s, "%Uint8Array%": typeof Uint8Array > "u" ? t : Uint8Array, "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? t : Uint8ClampedArray, "%Uint16Array%": typeof Uint16Array > "u" ? t : Uint16Array, "%Uint32Array%": typeof Uint32Array > "u" ? t : Uint32Array, "%URIError%": c, "%WeakMap%": typeof WeakMap > "u" ? t : WeakMap, "%WeakRef%": typeof WeakRef > "u" ? t : WeakRef, "%WeakSet%": typeof WeakSet > "u" ? t : WeakSet, "%Function.prototype.call%": J, "%Function.prototype.apply%": G, "%Object.defineProperty%": S, "%Object.getPrototypeOf%": Y, "%Math.abs%": u, "%Math.floor%": d, "%Math.max%": p, "%Math.min%": f, "%Math.pow%": m, "%Math.round%": h, "%Math.sign%": y, "%Reflect.getPrototypeOf%": H }; if (q) try { null.error; } catch (Z) { var V = q(q(Z)); X["%Error.prototype%"] = V; } var K = function Z(ee) { var P; if (ee === "%AsyncFunction%") P = g("async function () {}"); else if (ee === "%GeneratorFunction%") P = g("function* () {}"); else if (ee === "%AsyncGeneratorFunction%") P = g("async function* () {}"); else if (ee === "%AsyncGenerator%") { var j = Z("%AsyncGeneratorFunction%"); j && (P = j.prototype); } else if (ee === "%AsyncIteratorPrototype%") { var W = Z("%AsyncGenerator%"); W && q && (P = q(W.prototype)); } return X[ee] = P, P; }, $ = { __proto__: null, "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], "%ArrayPrototype%": ["Array", "prototype"], "%ArrayProto_entries%": ["Array", "prototype", "entries"], "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], "%ArrayProto_keys%": ["Array", "prototype", "keys"], "%ArrayProto_values%": ["Array", "prototype", "values"], "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], "%BooleanPrototype%": ["Boolean", "prototype"], "%DataViewPrototype%": ["DataView", "prototype"], "%DatePrototype%": ["Date", "prototype"], "%ErrorPrototype%": ["Error", "prototype"], "%EvalErrorPrototype%": ["EvalError", "prototype"], "%Float32ArrayPrototype%": ["Float32Array", "prototype"], "%Float64ArrayPrototype%": ["Float64Array", "prototype"], "%FunctionPrototype%": ["Function", "prototype"], "%Generator%": ["GeneratorFunction", "prototype"], "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], "%Int8ArrayPrototype%": ["Int8Array", "prototype"], "%Int16ArrayPrototype%": ["Int16Array", "prototype"], "%Int32ArrayPrototype%": ["Int32Array", "prototype"], "%JSONParse%": ["JSON", "parse"], "%JSONStringify%": ["JSON", "stringify"], "%MapPrototype%": ["Map", "prototype"], "%NumberPrototype%": ["Number", "prototype"], "%ObjectPrototype%": ["Object", "prototype"], "%ObjProto_toString%": ["Object", "prototype", "toString"], "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], "%PromisePrototype%": ["Promise", "prototype"], "%PromiseProto_then%": ["Promise", "prototype", "then"], "%Promise_all%": ["Promise", "all"], "%Promise_reject%": ["Promise", "reject"], "%Promise_resolve%": ["Promise", "resolve"], "%RangeErrorPrototype%": ["RangeError", "prototype"], "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], "%RegExpPrototype%": ["RegExp", "prototype"], "%SetPrototype%": ["Set", "prototype"], "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], "%StringPrototype%": ["String", "prototype"], "%SymbolPrototype%": ["Symbol", "prototype"], "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], "%TypedArrayPrototype%": ["TypedArray", "prototype"], "%TypeErrorPrototype%": ["TypeError", "prototype"], "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], "%URIErrorPrototype%": ["URIError", "prototype"], "%WeakMapPrototype%": ["WeakMap", "prototype"], "%WeakSetPrototype%": ["WeakSet", "prototype"] }, _ = tf(), I = /* @__PURE__ */ lV(), N = _.call(J, Array.prototype.concat), L = _.call(G, Array.prototype.splice), C = _.call(J, String.prototype.replace), Q = _.call(J, String.prototype.slice), k = _.call(J, RegExp.prototype.exec), M = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, O = /\\(\\)?/g, A = function(ee) { var P = Q(ee, 0, 1), j = Q(ee, -1); if (P === "%" && j !== "%") throw new a("invalid intrinsic syntax, expected closing `%`"); if (j === "%" && P !== "%") throw new a("invalid intrinsic syntax, expected opening `%`"); var W = []; return C(ee, M, function(se, ce, oe, we) { W[W.length] = oe ? C(we, O, "$1") : ce || se; }), W; }, F = function(ee, P) { var j = ee, W; if (I($, j) && (W = $[j], j = "%" + W[0] + "%"), I(X, j)) { var se = X[j]; if (se === B && (se = K(j)), typeof se > "u" && !P) throw new s("intrinsic " + ee + " exists, but is not available. Please file an issue!"); return { alias: W, name: j, value: se }; } throw new a("intrinsic " + ee + " does not exist!"); }; return wb = function(ee, P) { if (typeof ee != "string" || ee.length === 0) throw new s("intrinsic name must be a non-empty string"); if (arguments.length > 1 && typeof P != "boolean") throw new s('"allowMissing" argument must be a boolean'); if (k(/^%?[^%]*%?$/, ee) === null) throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); var j = A(ee), W = j.length > 0 ? j[0] : "", se = F("%" + W + "%", P), ce = se.name, oe = se.value, we = !1, Me = se.alias; Me && (W = Me[0], L(j, N([0, 1], Me))); for (var He = 1, We = !0; He < j.length; He += 1) { var Xe = j[He], Ye = Q(Xe, 0, 1), it = Q(Xe, -1); if ((Ye === '"' || Ye === "'" || Ye === "`" || it === '"' || it === "'" || it === "`") && Ye !== it) throw new a("property names with quotes must have matching quotes"); if ((Xe === "constructor" || !We) && (we = !0), W += "." + Xe, ce = "%" + W + "%", I(X, ce)) oe = X[ce]; else if (oe != null) { if (!(Xe in oe)) { if (!P) throw new s("base intrinsic for " + ee + " exists, but the property is not available."); return; } if (b && He + 1 >= j.length) { var ze = b(oe, Xe); We = !!ze, We && "get" in ze && !("originalValue" in ze.get) ? oe = ze.get : oe = oe[Xe]; } else We = I(oe, Xe), oe = oe[Xe]; We && !we && (X[ce] = oe); } } return oe; }, wb; } var Sb, HC; function $F() { if (HC) return Sb; HC = 1; var t = /* @__PURE__ */ jF(), e = lE(), n = e([t("%String.prototype.indexOf%")]); return Sb = function(i, o) { var a = ( /** @type {(this: unknown, ...args: unknown[]) => unknown} */ t(i, !!o) ); return typeof a == "function" && n(i, ".prototype.") > -1 ? e( /** @type {const} */ [a] ) : a; }, Sb; } var _b, WC; function dV() { if (WC) return _b; WC = 1; var t = Function.prototype.toString, e = typeof Reflect == "object" && Reflect !== null && Reflect.apply, n, r; if (typeof e == "function" && typeof Object.defineProperty == "function") try { n = Object.defineProperty({}, "length", { get: function() { throw r; } }), r = {}, e(function() { throw 42; }, null, n); } catch (b) { b !== r && (e = null); } else e = null; var i = /^\s*class\b/, o = function(S) { try { var E = t.call(S); return i.test(E); } catch { return !1; } }, a = function(S) { try { return o(S) ? !1 : (t.call(S), !0); } catch { return !1; } }, s = Object.prototype.toString, c = "[object Object]", u = "[object Function]", d = "[object GeneratorFunction]", p = "[object HTMLAllCollection]", f = "[object HTML document.all class]", m = "[object HTMLCollection]", h = typeof Symbol == "function" && !!Symbol.toStringTag, y = !(0 in [,]), x = function() { return !1; }; if (typeof document == "object") { var g = document.all; s.call(g) === s.call(document.all) && (x = function(S) { if ((y || !S) && (typeof S > "u" || typeof S == "object")) try { var E = s.call(S); return (E === p || E === f || E === m || E === c) && S("") == null; } catch { } return !1; }); } return _b = e ? function(S) { if (x(S)) return !0; if (!S || typeof S != "function" && typeof S != "object") return !1; try { e(S, null, n); } catch (E) { if (E !== r) return !1; } return !o(S) && a(S); } : function(S) { if (x(S)) return !0; if (!S || typeof S != "function" && typeof S != "object") return !1; if (h) return a(S); if (o(S)) return !1; var E = s.call(S); return E !== u && E !== d && !/^\[object HTML/.test(E) ? !1 : a(S); }, _b; } var Eb, KC; function pV() { if (KC) return Eb; KC = 1; var t = dV(), e = Object.prototype.toString, n = Object.prototype.hasOwnProperty, r = function(c, u, d) { for (var p = 0, f = c.length; p < f; p++) n.call(c, p) && (d == null ? u(c[p], p, c) : u.call(d, c[p], p, c)); }, i = function(c, u, d) { for (var p = 0, f = c.length; p < f; p++) d == null ? u(c.charAt(p), p, c) : u.call(d, c.charAt(p), p, c); }, o = function(c, u, d) { for (var p in c) n.call(c, p) && (d == null ? u(c[p], p, c) : u.call(d, c[p], p, c)); }; function a(s) { return e.call(s) === "[object Array]"; } return Eb = function(c, u, d) { if (!t(u)) throw new TypeError("iterator must be a function"); var p; arguments.length >= 3 && (p = d), a(c) ? r(c, u, p) : typeof c == "string" ? i(c, u, p) : o(c, u, p); }, Eb; } var Ab, VC; function fV() { return VC || (VC = 1, Ab = [ "Float16Array", "Float32Array", "Float64Array", "Int8Array", "Int16Array", "Int32Array", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "BigInt64Array", "BigUint64Array" ]), Ab; } var Ib, YC; function hV() { if (YC) return Ib; YC = 1; var t = /* @__PURE__ */ fV(), e = typeof globalThis > "u" ? $n : globalThis; return Ib = function() { for (var r = [], i = 0; i < t.length; i++) typeof e[t[i]] == "function" && (r[r.length] = t[i]); return r; }, Ib; } var Cb = { exports: {} }, Tb, JC; function mV() { if (JC) return Tb; JC = 1; var t = /* @__PURE__ */ _0(), e = /* @__PURE__ */ MF(), n = /* @__PURE__ */ Zp(), r = /* @__PURE__ */ ef(); return Tb = function(o, a, s) { if (!o || typeof o != "object" && typeof o != "function") throw new n("`obj` must be an object or a function`"); if (typeof a != "string" && typeof a != "symbol") throw new n("`property` must be a string or a symbol`"); if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null) throw new n("`nonEnumerable`, if provided, must be a boolean or null"); if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null) throw new n("`nonWritable`, if provided, must be a boolean or null"); if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null) throw new n("`nonConfigurable`, if provided, must be a boolean or null"); if (arguments.length > 6 && typeof arguments[6] != "boolean") throw new n("`loose`, if provided, must be a boolean"); var c = arguments.length > 3 ? arguments[3] : null, u = arguments.length > 4 ? arguments[4] : null, d = arguments.length > 5 ? arguments[5] : null, p = arguments.length > 6 ? arguments[6] : !1, f = !!r && r(o, a); if (t) t(o, a, { configurable: d === null && f ? f.configurable : !d, enumerable: c === null && f ? f.enumerable : !c, value: s, writable: u === null && f ? f.writable : !u }); else if (p || !c && !u && !d) o[a] = s; else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); }, Tb; } var kb, XC; function gV() { if (XC) return kb; XC = 1; var t = /* @__PURE__ */ _0(), e = function() { return !!t; }; return e.hasArrayLengthDefineBug = function() { if (!t) return null; try { return t([], "length", { value: 1 }).length !== 1; } catch { return !0; } }, kb = e, kb; } var Nb, ZC; function yV() { if (ZC) return Nb; ZC = 1; var t = /* @__PURE__ */ jF(), e = /* @__PURE__ */ mV(), n = /* @__PURE__ */ gV()(), r = /* @__PURE__ */ ef(), i = /* @__PURE__ */ Zp(), o = t("%Math.floor%"); return Nb = function(s, c) { if (typeof s != "function") throw new i("`fn` is not a function"); if (typeof c != "number" || c < 0 || c > 4294967295 || o(c) !== c) throw new i("`length` must be a positive 32-bit integer"); var u = arguments.length > 2 && !!arguments[2], d = !0, p = !0; if ("length" in s && r) { var f = r(s, "length"); f && !f.configurable && (d = !1), f && !f.writable && (p = !1); } return (d || p || !u) && (n ? e( /** @type {Parameters<define>[0]} */ s, "length", c, !0, !0 ) : e( /** @type {Parameters<define>[0]} */ s, "length", c )), s; }, Nb; } var Pb, e6; function bV() { if (e6) return Pb; e6 = 1; var t = tf(), e = uE(), n = LF(); return Pb = function() { return n(t, e, arguments); }, Pb; } var t6; function vV() { return t6 || (t6 = 1, (function(t) { var e = /* @__PURE__ */ yV(), n = /* @__PURE__ */ _0(), r = lE(), i = bV(); t.exports = function(a) { var s = r(arguments), c = a.length - (arguments.length - 1); return e( s, 1 + (c > 0 ? c : 0), !0 ); }, n ? n(t.exports, "apply", { value: i }) : t.exports.apply = i; })(Cb)), Cb.exports; } var Db, n6; function xV() { if (n6) return Db; n6 = 1; var t = RF(); return Db = function() { return t() && !!Symbol.toStringTag; }, Db; } var Ob, r6; function wV() { if (r6) return Ob; r6 = 1; var t = pV(), e = /* @__PURE__ */ hV(), n = vV(), r = /* @__PURE__ */ $F(), i = /* @__PURE__ */ ef(), o = QF(), a = r("Object.prototype.toString"), s = xV()(), c = typeof globalThis > "u" ? $n : globalThis, u = e(), d = r("String.prototype.slice"), p = r("Array.prototype.indexOf", !0) || function(x, g) { for (var b = 0; b < x.length; b += 1) if (x[b] === g) return b; return -1; }, f = { __proto__: null }; s && i && o ? t(u, function(y) { var x = new c[y](); if (Symbol.toStringTag in x && o) { var g = o(x), b = i(g, Symbol.toStringTag); if (!b && g) { var S = o(g); b = i(S, Symbol.toStringTag); } f["$" + y] = n(b.get); } }) : t(u, function(y) { var x = new c[y](), g = x.slice || x.set; g && (f[ /** @type {`$${import('.').TypedArrayName}`} */ "$" + y ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ // @ts-expect-error TODO FIXME n(g)); }); var m = function(x) { var g = !1; return t( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ f, /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function(b, S) { if (!g) try { "$" + b(x) === S && (g = /** @type {import('.').TypedArrayName} */ d(S, 1)); } catch { } } ), g; }, h = function(x) { var g = !1; return t( /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ f, /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function(b, S) { if (!g) try { b(x), g = /** @type {import('.').TypedArrayName} */ d(S, 1); } catch { } } ), g; }; return Ob = function(x) { if (!x || typeof x != "object") return !1; if (!s) { var g = d(a(x), 8, -1); return p(u, g) > -1 ? g : g !== "Object" ? !1 : h(x); } return i ? m(x) : null; }, Ob; } var Fb, i6; function SV() { if (i6) return Fb; i6 = 1; var t = /* @__PURE__ */ wV(); return Fb = function(n) { return !!t(n); }, Fb; } var Mb, o6; function _V() { if (o6) return Mb; o6 = 1; var t = /* @__PURE__ */ Zp(), e = /* @__PURE__ */ $F(), n = e("TypedArray.prototype.buffer", !0), r = /* @__PURE__ */ SV(); return Mb = n || function(o) { if (!r(o)) throw new t("Not a Typed Array"); return o.buffer; }, Mb; } var Rb, a6; function GF() { if (a6) return Rb; a6 = 1; var t = S0().Buffer, e = zK(), n = /* @__PURE__ */ _V(), r = ArrayBuffer.isView || function(c) { try { return n(c), !0; } catch { return !1; } }, i = typeof Uint8Array < "u", o = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", a = o && (t.prototype instanceof Uint8Array || t.TYPED_ARRAY_SUPPORT); return Rb = function(c, u) { if (t.isBuffer(c)) return c.constructor && !("isBuffer" in c) ? t.from(c) : c; if (typeof c == "string") return t.from(c, u); if (o && r(c)) { if (c.byteLength === 0) return t.alloc(0); if (a) { var d = t.from(c.buffer, c.byteOffset, c.byteLength); if (d.byteLength === c.byteLength) return d; } var p = c instanceof Uint8Array ? c : new Uint8Array(c.buffer, c.byteOffset, c.byteLength), f = t.from(p); if (f.length === c.byteLength) return f; } if (i && c instanceof Uint8Array) return t.from(c); var m = e(c); if (m) for (var h = 0; h < c.length; h += 1) { var y = c[h]; if (typeof y != "number" || y < 0 || y > 255 || ~~y !== y) throw new RangeError("Array items must be numbers in the range 0-255."); } if (m || t.isBuffer(c) && c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c)) return t.from(c); throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.'); }, Rb; } var Bb, s6; function EV() { if (s6) return Bb; s6 = 1; var t = (function() { try { if (!Buffer.isEncoding("latin1")) return !1; var o = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4); return o.fill("ab", "ucs2"), o.toString("hex") === "61006200"; } catch { return !1; } })(); function e(o) { return o.length === 1 && o.charCodeAt(0) < 256; } function n(o, a, s, c) { if (s < 0 || c > o.length) throw new RangeError("Out of range index"); return s = s >>> 0, c = c === void 0 ? o.length : c >>> 0, c > s && o.fill(a, s, c), o; } function r(o, a, s, c) { if (s < 0 || c > o.length) throw new RangeError("Out of range index"); if (c <= s) return o; s = s >>> 0, c = c === void 0 ? o.length : c >>> 0; for (var u = s, d = a.length; u <= c - d; ) a.copy(o, u), u += d; return u !== c && a.copy(o, u, 0, c - u), o; } function i(o, a, s, c, u) { if (t) return o.fill(a, s, c, u); if (typeof a == "number") return n(o, a, s, c); if (typeof a == "string") { if (typeof s == "string" ? (u = s, s = 0, c = o.length) : typeof c == "string" && (u = c, c = o.length), u !== void 0 && typeof u != "string") throw new TypeError("encoding must be a string"); if (u === "latin1" && (u = "binary"), typeof u == "string" && !Buffer.isEncoding(u)) throw new TypeError("Unknown encoding: " + u); if (a === "") return n(o, 0, s, c); if (e(a)) return n(o, a.charCodeAt(0), s, c); a = new Buffer(a, u); } return Buffer.isBuffer(a) ? r(o, a, s, c) : n(o, 0, s, c); } return Bb = i, Bb; } var Ub, c6; function AV() { if (c6) return Ub; c6 = 1; function t(e) { if (typeof e != "number") throw new TypeError('"size" argument must be a number'); if (e < 0) throw new RangeError('"size" argument must not be negative'); return Buffer.allocUnsafe ? Buffer.allocUnsafe(e) : new Buffer(e); } return Ub = t, Ub; } var Lb, u6; function qF() { if (u6) return Lb; u6 = 1; var t = EV(), e = AV(); return Lb = function(r, i, o) { if (typeof r != "number") throw new TypeError('"size" argument must be a number'); if (r < 0) throw new RangeError('"size" argument must not be negative'); if (Buffer.alloc) return Buffer.alloc(r, i, o); var a = e(r); return r === 0 ? a : i === void 0 ? t(a, 0) : (typeof o != "string" && (o = void 0), t(a, i, o)); }, Lb; } var l6; function zF() { if (l6) return Ys; l6 = 1; var t = /* @__PURE__ */ GF(), e = qF(), n = "0000000000000000000", r = "7777777777777777777", i = 48, o = "ustar\x0000", a = parseInt("7777", 8), s = function(g, b, S) { return typeof g != "number" ? S : (g = ~~g, g >= b ? b : g >= 0 || (g += b, g >= 0) ? g : 0); }, c = function(g) { switch (g) { case 0: return "file"; case 1: return "link"; case 2: return "symlink"; case 3: return "character-device"; case 4: return "block-device"; case 5: return "directory"; case 6: return "fifo"; case 7: return "contiguous-file"; case 72: return "pax-header"; case 55: return "pax-global-header"; case 27: return "gnu-long-link-path"; case 28: case 30: return "gnu-long-path"; } return null; }, u = function(g) { switch (g) { case "file": return 0; case "link": return 1; case "symlink": return 2; case "character-device": return 3; case "block-device": return 4; case "directory": return 5; case "fifo": return 6; case "contiguous-file": return 7; case "pax-header": return 72; } return 0; }, d = function(g, b, S, E) { for (; S < E; S++) if (g[S] === b) return S; return E; }, p = function(g) { for (var b = 256, S = 0; S < 148; S++) b += g[S]; for (var E = 156; E < 512; E++) b += g[E]; return b; }, f = function(g, b) { return g = g.toString(8), g.length > b ? r.slice(0, b) + " " : n.slice(0, b - g.length) + g + " "; }; function m(g) { var b; if (g[0] === 128) b = !0; else if (g[0] === 255) b = !1; else return null; for (var S = [], E = g.length - 1; E > 0; E--) { var T = g[E]; b ? S.push(T) : S.push(255 - T); } var U = 0, q = S.length; for (E = 0; E < q; E++) U += S[E] * Math.pow(256, E); return b ? U : -1 * U; } var h = function(g, b, S) { if (g = g.slice(b, b + S), b = 0, g[b] & 128) return m(g); for (; b < g.length && g[b] === 32; ) b++; for (var E = s(d(g, 32, b, g.length), g.length, g.length); b < E && g[b] === 0; ) b++; return E === b ? 0 : parseInt(g.slice(b, E).toString(), 8); }, y = function(g, b, S, E) { return g.slice(b, d(g, 0, b, b + S)).toString(E); }, x = function(g) { var b = Buffer.byteLength(g), S = Math.floor(Math.log(b) / Math.log(10)) + 1; return b + S >= Math.pow(10, S) && S++, b + S + g; }; return Ys.decodeLongPath = function(g, b) { return y(g, 0, g.length, b); }, Ys.encodePax = function(g) { var b = ""; g.name && (b += x(" path=" + g.name + ` `)), g.linkname && (b += x(" linkpath=" + g.linkname + ` `)); var S = g.pax; if (S) for (var E in S) b += x(" " + E + "=" + S[E] + ` `); return t(b); }, Ys.decodePax = function(g) { for (var b = {}; g.length; ) { for (var S = 0; S < g.length && g[S] !== 32; ) S++; var E = parseInt(g.slice(0, S).toString(), 10); if (!E) return b; var T = g.slice(S + 1, E - 1).toString(), U = T.indexOf("="); if (U === -1) return b; b[T.slice(0, U)] = T.slice(U + 1), g = g.slice(E); } return b; }, Ys.encode = function(g) { var b = e(512), S = g.name, E = ""; if (g.typeflag === 5 && S[S.length - 1] !== "/" && (S += "/"), Buffer.byteLength(S) !== S.length) return null; for (; Buffer.byteLength(S) > 100; ) { var T = S.indexOf("/"); if (T === -1) return null; E += E ? "/" + S.slice(0, T) : S.slice(0, T), S = S.slice(T + 1); } return Buffer.byteLength(S) > 100 || Buffer.byteLength(E) > 155 || g.linkname && Buffer.byteLength(g.linkname) > 100 ? null : (b.write(S), b.write(f(g.mode & a, 6), 100), b.write(f(g.uid, 6), 108), b.write(f(g.gid, 6), 116), b.write(f(g.size, 11), 124), b.write(f(g.mtime.getTime() / 1e3 | 0, 11), 136), b[156] = i + u(g.type), g.linkname && b.write(g.linkname, 157), b.write(o, 257), g.uname && b.write(g.uname, 265), g.gname && b.write(g.gname, 297), b.write(f(g.devmajor || 0, 6), 329), b.write(f(g.devminor || 0, 6), 337), E && b.write(E, 345), b.write(f(p(b), 6), 148), b); }, Ys.decode = function(g, b) { var S = g[156] === 0 ? 0 : g[156] - i, E = y(g, 0, 100, b), T = h(g, 100, 8), U = h(g, 108, 8), q = h(g, 116, 8), Y = h(g, 124, 12), H = h(g, 136, 12), G = c(S), J = g[157] === 0 ? null : y(g, 157, 100, b), B = y(g, 265, 32), D = y(g, 297, 32), X = h(g, 329, 8), V = h(g, 337, 8); g[345] && (E = y(g, 345, 155, b) + "/" + E), S === 0 && E && E[E.length - 1] === "/" && (S = 5); var K = p(g); if (K === 256) return null; if (K !== h(g, 148, 8)) throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?"); return { name: E, mode: T, uid: U, gid: q, size: Y, mtime: new Date(1e3 * H), type: G, linkname: J, uname: B, gname: D, devmajor: X, devminor: V }; }, Ys; } var gh = { exports: {} }, Qb, d6; function HF() { if (d6) return Qb; d6 = 1, Qb = r; var t = bc(), e = Object.create(Xp()); e.inherits = Do(), e.inherits(r, t); function n(a, s) { var c = this._transformState; c.transforming = !1; var u = c.writecb; if (!u) return this.emit("error", new Error("write callback called multiple times")); c.writechunk = null, c.writecb = null, s != null && this.push(s), u(a); var d = this._readableState; d.reading = !1, (d.needReadable || d.length < d.highWaterMark) && this._read(d.highWaterMark); } function r(a) { if (!(this instanceof r)) return new r(a); t.call(this, a), this._transformState = { afterTransform: n.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, a && (typeof a.transform == "function" && (this._transform = a.transform), typeof a.flush == "function" && (this._flush = a.flush)), this.on("prefinish", i); } function i() { var a = this; typeof this._flush == "function" ? this._flush(function(s, c) { o(a, s, c); }) : o(this, null, null); } r.prototype.push = function(a, s) { return this._transformState.needTransform = !1, t.prototype.push.call(this, a, s); }, r.prototype._transform = function(a, s, c) { throw new Error("_transform() is not implemented"); }, r.prototype._write = function(a, s, c) { var u = this._transformState; if (u.writecb = c, u.writechunk = a, u.writeencoding = s, !u.transforming) { var d = this._readableState; (u.needTransform || d.needReadable || d.length < d.highWaterMark) && this._read(d.highWaterMark); } }, r.prototype._read = function(a) { var s = this._transformState; s.writechunk !== null && s.writecb && !s.transforming ? (s.transforming = !0, this._transform(s.writechunk, s.writeencoding, s.afterTransform)) : s.needTransform = !0; }, r.prototype._destroy = function(a, s) { var c = this; t.prototype._destroy.call(this, a, function(u) { s(u), c.emit("close"); }); }; function o(a, s, c) { if (s) return a.emit("error", s); if (c != null && a.push(c), a._writableState.length) throw new Error("Calling transform done when ws.length != 0"); if (a._transformState.transforming) throw new Error("Calling transform done when still transforming"); return a.push(null); } return Qb; } var jb, p6; function IV() { if (p6) return jb; p6 = 1, jb = n; var t = HF(), e = Object.create(Xp()); e.inherits = Do(), e.inherits(n, t); function n(r) { if (!(this instanceof n)) return new n(r); t.call(this, r); } return n.prototype._transform = function(r, i, o) { o(null, r); }, jb; } var f6; function rg() { return f6 || (f6 = 1, (function(t, e) { e = t.exports = NF(), e.Stream = e, e.Readable = e, e.Writable = DF(), e.Duplex = bc(), e.Transform = HF(), e.PassThrough = IV(); })(gh, gh.exports)), gh.exports; } var $b, h6; function CV() { if (h6) return $b; h6 = 1; var t = Pn, e = qK(), n = OF(), r = zF(), i = rg().Writable, o = rg().PassThrough, a = function() { }, s = function(f) { return f &= 511, f && 512 - f; }, c = function(f, m) { var h = new d(f, m); return h.end(), h; }, u = function(f, m) { return m.path && (f.name = m.path), m.linkpath && (f.linkname = m.linkpath), m.size && (f.size = parseInt(m.size, 10)), f.pax = m, f; }, d = function(f, m) { this._parent = f, this.offset = m, o.call(this); }; t.inherits(d, o), d.prototype.destroy = function(f) { this._parent.destroy(f); }; var p = function(f) { if (!(this instanceof p)) return new p(f); i.call(this, f), f = f || {}, this._offset = 0, this._buffer = e(), this._missing = 0, this._partial = !1, this._onparse = a, this._header = null, this._stream = null, this._overflow = null, this._cb = null, this._locked = !1, this._destroyed = !1, this._pax = null, this._paxGlobal = null, this._gnuLongPath = null, this._gnuLongLinkPath = null; var m = this, h = m._buffer, y = function() { m._continue(); }, x = function(Y) { if (m._locked = !1, Y) return m.destroy(Y); m._stream || y(); }, g = function() { m._stream = null; var Y = s(m._header.size); Y ? m._parse(Y, b) : m._parse(512, q), m._locked || y(); }, b = function() { m._buffer.consume(s(m._header.size)), m._parse(512, q), y(); }, S = function() { var Y = m._header.size; m._paxGlobal = r.decodePax(h.slice(0, Y)), h.consume(Y), g(); }, E = function() { var Y = m._header.size; m._pax = r.decodePax(h.slice(0, Y)), m._paxGlobal && (m._pax = n(m._paxGlobal, m._pax)), h.consume(Y), g(); }, T = function() { var Y = m._header.size; this._gnuLongPath = r.decodeLongPath(h.slice(0, Y), f.filenameEncoding), h.consume(Y), g(); }, U = function() { var Y = m._header.size; this._gnuLongLinkPath = r.decodeLongPath(h.slice(0, Y), f.filenameEncoding), h.consume(Y), g(); }, q = function() { var Y = m._offset, H; try { H = m._header = r.decode(h.slice(0, 512), f.filenameEncoding); } catch (G) { m.emit("error", G); } if (h.consume(512), !H) { m._parse(512, q), y(); return; } if (H.type === "gnu-long-path") { m._parse(H.size, T), y(); return; } if (H.type === "gnu-long-link-path") { m._parse(H.size, U), y(); return; } if (H.type === "pax-global-header") { m._parse(H.size, S), y(); return; } if (H.type === "pax-header") { m._parse(H.size, E), y(); return; } if (m._gnuLongPath && (H.name = m._gnuLongPath, m._gnuLongPath = null), m._gnuLongLinkPath && (H.linkname = m._gnuLongLinkPath, m._gnuLongLinkPath = null), m._pax && (m._header = H = u(H, m._pax), m._pax = null), m._locked = !0, !H.size || H.type === "directory") { m._parse(512, q), m.emit("entry", H, c(m, Y), x); return; } m._stream = new d(m, Y), m.emit("entry", H, m._stream, x), m._parse(H.size, g), y(); }; this._onheader = q, this._parse(512, q); }; return t.inherits(p, i), p.prototype.destroy = function(f) { this._destroyed || (this._destroyed = !0, f && this.emit("error", f), this.emit("close"), this._stream && this._stream.emit("close")); }, p.prototype._parse = function(f, m) { this._destroyed || (this._offset += f, this._missing = f, m === this._onheader && (this._partial = !1), this._onparse = m); }, p.prototype._continue = function() { if (!this._destroyed) { var f = this._cb; this._cb = a, this._overflow ? this._write(this._overflow, void 0, f) : f(); } }, p.prototype._write = function(f, m, h) { if (!this._destroyed) { var y = this._stream, x = this._buffer, g = this._missing; if (f.length && (this._partial = !0), f.length < g) return this._missing -= f.length, this._overflow = null, y ? y.write(f, h) : (x.append(f), h()); this._cb = h, this._missing = 0; var b = null; f.length > g && (b = f.slice(g), f = f.slice(0, g)), y ? y.end(f) : x.append(f), this._overflow = b, this._onparse(); } }, p.prototype._final = function(f) { if (this._partial) return this.destroy(new Error("Unexpected end of data")); f(); }, $b = p, $b; } var Gb, m6; function TV() { return m6 || (m6 = 1, Gb = m7), Gb; } var qb, g6; function kV() { if (g6) return qb; g6 = 1; var t = TV(), e = EF(), n = Pn, r = qF(), i = /* @__PURE__ */ GF(), o = rg().Readable, a = rg().Writable, s = O2.StringDecoder, c = zF(), u = parseInt("755", 8), d = parseInt("644", 8), p = r(1024), f = function() { }, m = function(S, E) { E &= 511, E && S.push(p.slice(0, 512 - E)); }; function h(S) { switch (S & t.S_IFMT) { case t.S_IFBLK: return "block-device"; case t.S_IFCHR: return "character-device"; case t.S_IFDIR: return "directory"; case t.S_IFIFO: return "fifo"; case t.S_IFLNK: return "symlink"; } return "file"; } var y = function(S) { a.call(this), this.written = 0, this._to = S, this._destroyed = !1; }; n.inherits(y, a), y.prototype._write = function(S, E, T) { if (this.written += S.length, this._to.push(S)) return T(); this._to._drain = T; }, y.prototype.destroy = function() { this._destroyed || (this._destroyed = !0, this.emit("close")); }; var x = function() { a.call(this), this.linkname = "", this._decoder = new s("utf-8"), this._destroyed = !1; }; n.inherits(x, a), x.prototype._write = function(S, E, T) { this.linkname += this._decoder.write(S), T(); }, x.prototype.destroy = function() { this._destroyed || (this._destroyed = !0, this.emit("close")); }; var g = function() { a.call(this), this._destroyed = !1; }; n.inherits(g, a), g.prototype._write = function(S, E, T) { T(new Error("No body allowed for this entry")); }, g.prototype.destroy = function() { this._destroyed || (this._destroyed = !0, this.emit("close")); }; var b = function(S) { if (!(this instanceof b)) return new b(S); o.call(this, S), this._drain = f, this._finalized = !1, this._finalizing = !1, this._destroyed = !1, this._stream = null; }; return n.inherits(b, o), b.prototype.entry = function(S, E, T) { if (this._stream) throw new Error("already piping an entry"); if (!(this._finalized || this._destroyed)) { typeof E == "function" && (T = E, E = null), T || (T = f); var U = this; if ((!S.size || S.type === "symlink") && (S.size = 0), S.type || (S.type = h(S.mode)), S.mode || (S.mode = S.type === "directory" ? u : d), S.uid || (S.uid = 0), S.gid || (S.gid = 0), S.mtime || (S.mtime = /* @__PURE__ */ new Date()), typeof E == "string" && (E = i(E)), Buffer.isBuffer(E)) return S.size = E.length, this._encode(S), this.push(E), m(U, S.size), process.nextTick(T), new g(); if (S.type === "symlink" && !S.linkname) { var q = new x(); return e(q, function(H) { if (H) return U.destroy(), T(H); S.linkname = q.linkname, U._encode(S), T(); }), q; } if (this._encode(S), S.type !== "file" && S.type !== "contiguous-file") return process.nextTick(T), new g(); var Y = new y(this); return this._stream = Y, e(Y, function(H) { if (U._stream = null, H) return U.destroy(), T(H); if (Y.written !== S.size) return U.destroy(), T(new Error("size mismatch")); m(U, S.size), U._finalizing && U.finalize(), T(); }), Y; } }, b.prototype.finalize = function() { if (this._stream) { this._finalizing = !0; return; } this._finalized || (this._finalized = !0, this.push(p), this.push(null)); }, b.prototype.destroy = function(S) { this._destroyed || (this._destroyed = !0, S && this.emit("error", S), this.emit("close"), this._stream && this._stream.destroy && this._stream.destroy()); }, b.prototype._encode = function(S) { if (!S.pax) { var E = c.encode(S); if (E) { this.push(E); return; } } this._encodePax(S); }, b.prototype._encodePax = function(S) { var E = c.encodePax({ name: S.name, linkname: S.linkname, pax: S.pax }), T = { name: "PaxHeader", mode: S.mode, uid: S.uid, gid: S.gid, size: E.length, mtime: S.mtime, type: "pax-header", linkname: S.linkname && "PaxHeader", uname: S.uname, gname: S.gname, devmajor: S.devmajor, devminor: S.devminor }; this.push(c.encode(T)), this.push(E), m(this, E.length), T.size = S.size, T.type = S.type, this.push(c.encode(T)); }, b.prototype._read = function(S) { var E = this._drain; this._drain = f, E(); }, qb = b, qb; } var y6; function dE() { return y6 || (y6 = 1, dh.extract = CV(), dh.pack = kV()), dh; } var zb, b6; function WF() { if (b6) return zb; b6 = 1; const t = mr; class e extends t.Readable { addEntry() { throw new Error(".addEntry not implemented in sub class!"); } _read() { } emit(r, i) { if (r === "error") { const o = i; o.name === "Error" && (o.name = this.constructor.name + "Error"); } super.emit(r, i); } } return zb = e, zb; } var Hb, v6; function KF() { if (v6) return Hb; v6 = 1; const t = fe, e = ve, n = mr, r = dE(), i = _i(), o = WF(); class a extends o { constructor(c) { super(c), this._waitingEntries = [], this._processing = !1, this._init(c); } _init() { const c = this._pack = r.pack(); c.on("end", () => this.push(null)), c.on("data", (u) => this.push(u)), c.on("error", (u) => this.emit("error", u)); } addEntry(c, u) { if (this._processing) return this._waitingEntries.push([c, u]); u = u || {}, this._processing = !0; const d = i.entryType(c); d && (d === "fileOrDir" ? this._addFileOrDirEntry(c, u) : d === "buffer" ? this._addBufferEntry(c, u) : this._addStreamEntry(c, u)); } _addFileOrDirEntry(c, u) { t.stat(c, (d, p) => { if (d) return this.emit("error", d); if (p.isDirectory()) return this._addDirEntry(c, u); if (p.isFile()) return this._addFileEntry(c, u); const f = new Error("Type is not supported, must be a file path, directory path, file buffer, or a readable stream"); f.name = "IlligalEntryError", this.emit("error", f); }); } _addFileEntry(c, u) { t.stat(c, (d, p) => { if (d) return this.emit("error", d); const f = this._pack.entry({ name: u.relativePath || e.basename(c), size: p.size, mode: p.mode & 511 }, this._onEntryFinish.bind(this)), m = t.createReadStream(c, u.fs); m.on("error", (h) => this.emit("error", h)), m.pipe(f); }); } _addDirEntry(c, u) { t.readdir(c, (d, p) => { if (d) return this.emit("error", d); const f = u.relativePath || ""; p.forEach((m) => { const h = i.clone(u); u.ignoreBase ? h.relativePath = e.posix.join(f, m) : h.relativePath = e.posix.join(f, e.basename(c), m), h.ignoreBase = !0, this.addEntry(e.posix.join(c, m), h); }), this._onEntryFinish(); }); } _addBufferEntry(c, u) { if (!u.relativePath) return this.emit("error", "opts.relativePath is required if entry is a buffer"); this._pack.entry({ name: u.relativePath }, c, this._onEntryFinish.bind(this)); } _addStreamEntry(c, u) { if (c.on("error", (d) => this.emit("error", d)), !u.relativePath) return this.emit("error", new Error("opts.relativePath is required")); if (u.size) { const d = this._pack.entry({ name: u.relativePath, size: u.size }, this._onEntryFinish.bind(this)); c.pipe(d); } else { u.suppressSizeWarning || console.warn("You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning"); const d = [], p = new n.Writable({ write(f, m, h) { d.push(f), h(); } }); p.on("error", (f) => this.emit("error", f)), p.on("finish", () => { this._pack.entry({ name: u.relativePath }, Buffer.concat(d), this._onEntryFinish.bind(this)); }), c.pipe(p); } } _read() { } _onEntryFinish(c) { if (c) return this.emit("error", c); this._processing = !1; const u = this._waitingEntries.shift(); u ? this.addEntry.apply(this, u) : this._finalize(); } _finalize() { this._pack.finalize(); } } return Hb = a, Hb; } var Wb, x6; function NV() { if (x6) return Wb; x6 = 1; const t = ve, e = CF(), n = KF(); class r extends n { _init() { const a = (this._zipfile = new e.ZipFile()).outputStream; a.on("end", () => this.push(null)), a.on("data", (s) => this.push(s)), a.on("error", (s) => this.emit("error", s)); } _addFileEntry(o, a) { this._zipfile.addFile(o, a.relativePath || t.basename(o), a), this._onEntryFinish(); } _addBufferEntry(o, a) { if (!a.relativePath) return this.emit("error", new Error("opts.relativePath is required if entry is a buffer")); this._zipfile.addBuffer(o, a.relativePath, a), this._onEntryFinish(); } _addStreamEntry(o, a) { if (!a.relativePath) return this.emit("error", new Error("opts.relativePath is required if entry is a stream")); o.on("error", (s) => this.emit("error", s)), this._zipfile.addReadStream(o, a.relativePath, a), this._onEntryFinish(); } _finalize() { this._zipfile.end(); } } return Wb = r, Wb; } var yh = { exports: {} }, w6; function E0() { if (w6) return yh.exports; w6 = 1; function t(n) { if (this._ready = !!this._ready, this._readyCallbacks = this._readyCallbacks || [], arguments.length === 0) return new Promise(function(r) { if (this._ready) return r(); this._readyCallbacks.push(r); }.bind(this)); typeof n == "function" ? this._readyCallbacks.push(n) : this._ready = !!n, this._ready && this._readyCallbacks.splice(0, 1 / 0).forEach(function(r) { process.nextTick(r); }); } function e(n) { n.ready = t; } return yh.exports = e, yh.exports.mixin = e, yh.exports; } var Kb, S6; function PV() { if (S6) return Kb; S6 = 1; const t = ve, e = CF(), n = g7, r = mr, i = _i(), o = E0(); class a extends r.Transform { constructor(c) { super(c); const u = i.sourceType(c.source), d = new e.ZipFile(), p = d.outputStream; if (p.on("data", (f) => this.push(f)), p.on("end", () => this.ready(!0)), d.on("error", (f) => this.emit("error", f)), u !== "file" && n(c.relativePath, "opts.relativePath is required when compressing a buffer, or a stream"), u && this.end(), u === "file") d.addFile(c.source, c.relativePath || t.basename(c.source), c.yazl); else if (u === "buffer") d.addBuffer(c.source, c.relativePath, c.yazl); else if (u === "stream") d.addReadStream(c.source, c.relativePath, c.yazl); else { const f = this._passThrough = new r.PassThrough(); this.on("finish", () => f.end()), d.addReadStream(f, c.relativePath, c.yazl); } d.end(c.yazl); } _transform(c, u, d) { this._passThrough && this._passThrough.write(c, u, d); } _flush(c) { this.ready(c); } } return o.mixin(a.prototype), Kb = a, Kb; } var no = {}, ru = {}, Vb, _6; function DV() { if (_6) return Vb; _6 = 1, Vb = t; function t() { this.pending = 0, this.max = 1 / 0, this.listeners = [], this.waiting = [], this.error = null; } t.prototype.go = function(r) { this.pending < this.max ? n(this, r) : this.waiting.push(r); }, t.prototype.wait = function(r) { this.pending === 0 ? r(this.error) : this.listeners.push(r); }, t.prototype.hold = function() { return e(this); }; function e(r) { r.pending += 1; var i = !1; return o; function o(s) { if (i) throw new Error("callback called twice"); if (i = !0, r.error = r.error || s, r.pending -= 1, r.waiting.length > 0 && r.pending < r.max) n(r, r.waiting.shift()); else if (r.pending === 0) { var c = r.listeners; r.listeners = [], c.forEach(a); } } function a(s) { s(r.error); } } function n(r, i) { i(e(r)); } return Vb; } var E6; function OV() { if (E6) return ru; E6 = 1; const t = fe, { Readable: e, Writable: n, PassThrough: r } = mr, i = DV(), { EventEmitter: o } = Qa; class a extends o { constructor(h, y = {}) { super(), this.fd = h, this.pend = new i(), this.pend.max = 1, this.refCount = 0, this.autoClose = !!y.autoClose; } read(h, y, x, g, b) { this.pend.go((S) => { t.read(this.fd, h, y, x, g, (E, T, U) => { S(), b(E, T, U); }); }); } write(h, y, x, g, b) { this.pend.go((S) => { t.write(this.fd, h, y, x, g, (E, T, U) => { S(), b(E, T, U); }); }); } createReadStream(h) { return new s(this, h); } createWriteStream(h) { return new c(this, h); } ref() { this.refCount += 1; } unref() { if (this.refCount -= 1, !(this.refCount > 0)) { if (this.refCount < 0) throw new Error("invalid unref"); this.autoClose && t.close(this.fd, (h) => { h ? this.emit("error", h) : this.emit("close"); }); } } } class s extends e { constructor(h, y = {}) { super(y), this.context = h, this.context.ref(), this.start = y.start || 0, this.endOffset = y.end, this.pos = this.start, this.destroyed = !1; } _read(h) { if (this.destroyed) return; let y = Math.min(this._readableState.highWaterMark, h); if (this.endOffset != null && (y = Math.min(y, this.endOffset - this.pos)), y <= 0) { this.destroyed = !0, this.push(null), this.context.unref(); return; } this.context.pend.go((x) => { if (this.destroyed) return x(); const g = Buffer.alloc(y); t.read(this.context.fd, g, 0, y, this.pos, (b, S) => { b ? this.destroy(b) : S === 0 ? (this.destroyed = !0, this.push(null), this.context.unref()) : (this.pos += S, this.push(g.slice(0, S))), x(); }); }); } destroy(h) { this.destroyed || (h = h || new Error("stream destroyed"), this.destroyed = !0, this.emit("error", h), this.context.unref()); } } class c extends n { constructor(h, y = {}) { super(y), this.context = h, this.context.ref(), this.start = y.start || 0, this.endOffset = y.end == null ? 1 / 0 : +y.end, this.bytesWritten = 0, this.pos = this.start, this.destroyed = !1, this.on("finish", this.destroy.bind(this)); } _write(h, y, x) { if (!this.destroyed) { if (this.pos + h.length > this.endOffset) { const g = new Error("maximum file length exceeded"); g.code = "ETOOBIG", this.destroy(), x(g); return; } this.context.pend.go((g) => { if (this.destroyed) return g(); t.write(this.context.fd, h, 0, h.length, this.pos, (b, S) => { b ? (this.destroy(), g(), x(b)) : (this.bytesWritten += S, this.pos += S, this.emit("progress"), g(), x()); }); }); } } destroy() { this.destroyed || (this.destroyed = !0, this.context.unref()); } } const { MAX_SAFE_INTEGER: u } = Number; class d extends o { constructor(h, y) { super(), y = y || {}, this.refCount = 0, this.buffer = h, this.maxChunkSize = y.maxChunkSize || u; } read(h, y, x, g, b) { const S = g + x, E = S - this.buffer.length, T = E > 0 ? E : x; this.buffer.copy(h, y, g, S), setImmediate(() => { b(null, T); }); } write(h, y, x, g, b) { h.copy(this.buffer, g, y, y + x), setImmediate(() => { b(null, x, h); }); } createReadStream(h = {}) { const y = new r(h); y.destroyed = !1, y.start = h.start || 0, y.endOffset = h.end, y.pos = y.endOffset || this.buffer.length; const x = this.buffer.slice(y.start, y.pos); let g = 0; for (; ; ) { const b = g + this.maxChunkSize; if (b >= x.length) { g < x.length && y.write(x.slice(g, x.length)); break; } y.write(x.slice(g, b)), g = b; } return y.end(), y.destroy = () => { y.destroyed = !0; }, y; } createWriteStream(h) { const y = this; h = h || {}; const x = new n(h); return x.start = h.start || 0, x.endOffset = h.end == null ? this.buffer.length : +h.end, x.bytesWritten = 0, x.pos = x.start, x.destroyed = !1, x._write = (g, b, S) => { if (x.destroyed) return; const E = x.pos + g.length; if (E > x.endOffset) { const T = new Error("maximum file length exceeded"); T.code = "ETOOBIG", x.destroyed = !0, S(T); return; } g.copy(y.buffer, x.pos, 0, g.length), x.bytesWritten += g.length, x.pos = E, x.emit("progress"), S(); }, x.destroy = () => { x.destroyed = !0; }, x; } ref() { this.refCount += 1; } unref() { if (this.refCount -= 1, this.refCount < 0) throw new Error("invalid unref"); } } function p(m, h) { return new d(m, h); } function f(m, h) { return new a(m, h); } return ru.createFromBuffer = p, ru.createFromFd = f, ru.BufferSlicer = d, ru.FdSlicer = a, ru; } var A6; function FV() { if (A6) return no; A6 = 1; var t = fe, e = ml, n = OV(), r = IF(), i = Pn, o = Qa.EventEmitter, a = mr.Transform, s = mr.PassThrough, c = mr.Writable; no.open = u, no.fromFd = d, no.fromBuffer = p, no.fromRandomAccessReader = f, no.dosDateTimeToDate = g, no.validateFileName = b, no.ZipFile = m, no.Entry = x, no.RandomAccessReader = T; function u(B, D, X) { typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose == null && (D.autoClose = !0), D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1), X == null && (X = J), t.open(B, "r", function(V, K) { if (V) return X(V); d(K, D, function($, _) { $ && t.close(K, J), X($, _); }); }); } function d(B, D, X) { typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose == null && (D.autoClose = !1), D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1), X == null && (X = J), t.fstat(B, function(V, K) { if (V) return X(V); var $ = n.createFromFd(B, { autoClose: !0 }); f($, K.size, D, X); }); } function p(B, D, X) { typeof D == "function" && (X = D, D = null), D == null && (D = {}), D.autoClose = !1, D.lazyEntries == null && (D.lazyEntries = !1), D.decodeStrings == null && (D.decodeStrings = !0), D.validateEntrySizes == null && (D.validateEntrySizes = !0), D.strictFileNames == null && (D.strictFileNames = !1); var V = n.createFromBuffer(B, { maxChunkSize: 65536 }); f(V, B.length, D, X); } function f(B, D, X, V) { typeof X == "function" && (V = X, X = null), X == null && (X = {}), X.autoClose == null && (X.autoClose = !0), X.lazyEntries == null && (X.lazyEntries = !1), X.decodeStrings == null && (X.decodeStrings = !0); var K = !!X.decodeStrings; if (X.validateEntrySizes == null && (X.validateEntrySizes = !0), X.strictFileNames == null && (X.strictFileNames = !1), V == null && (V = J), typeof D != "number") throw new Error("expected totalSize parameter to be a number"); if (D > Number.MAX_SAFE_INTEGER) throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double."); B.ref(); var $ = 22, _ = 65535, I = Math.min($ + _, D), N = G(I), L = D - N.length; S(B, N, 0, I, L, function(C) { if (C) return V(C); for (var Q = I - $; Q >= 0; Q -= 1) if (N.readUInt32LE(Q) === 101010256) { var k = N.slice(Q), M = k.readUInt16LE(4); if (M !== 0) return V(new Error("multi-disk zip files are not supported: found disk number: " + M)); var O = k.readUInt16LE(10), A = k.readUInt32LE(16), F = k.readUInt16LE(20), Z = k.length - $; if (F !== Z) return V(new Error("invalid comment length. expected: " + Z + ". found: " + F)); var ee = K ? Y(k, 22, k.length, !1) : k.slice(22); if (!(O === 65535 || A === 4294967295)) return V(null, new m(B, A, D, O, ee, X.autoClose, X.lazyEntries, K, X.validateEntrySizes, X.strictFileNames)); var P = G(20), j = L + Q - P.length; S(B, P, 0, P.length, j, function(W) { if (W) return V(W); if (P.readUInt32LE(0) !== 117853008) return V(new Error("invalid zip64 end of central directory locator signature")); var se = H(P, 8), ce = G(56); S(B, ce, 0, ce.length, se, function(oe) { return oe ? V(oe) : ce.readUInt32LE(0) !== 101075792 ? V(new Error("invalid zip64 end of central directory record signature")) : (O = H(ce, 32), A = H(ce, 48), V(null, new m(B, A, D, O, ee, X.autoClose, X.lazyEntries, K, X.validateEntrySizes, X.strictFileNames))); }); }); return; } V(new Error("end of central directory record signature not found")); }); } i.inherits(m, o); function m(B, D, X, V, K, $, _, I, N, L) { var C = this; o.call(C), C.reader = B, C.reader.on("error", function(Q) { y(C, Q); }), C.reader.once("close", function() { C.emit("close"); }), C.readEntryCursor = D, C.fileSize = X, C.entryCount = V, C.comment = K, C.entriesRead = 0, C.autoClose = !!$, C.lazyEntries = !!_, C.decodeStrings = !!I, C.validateEntrySizes = !!N, C.strictFileNames = !!L, C.isOpen = !0, C.emittedError = !1, C.lazyEntries || C._readEntry(); } m.prototype.close = function() { this.isOpen && (this.isOpen = !1, this.reader.unref()); }; function h(B, D) { B.autoClose && B.close(), y(B, D); } function y(B, D) { B.emittedError || (B.emittedError = !0, B.emit("error", D)); } m.prototype.readEntry = function() { if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true"); this._readEntry(); }, m.prototype._readEntry = function() { var B = this; if (B.entryCount === B.entriesRead) { setImmediate(function() { B.autoClose && B.close(), !B.emittedError && B.emit("end"); }); return; } if (!B.emittedError) { var D = G(46); S(B.reader, D, 0, D.length, B.readEntryCursor, function(X) { if (X) return h(B, X); if (!B.emittedError) { var V = new x(), K = D.readUInt32LE(0); if (K !== 33639248) return h(B, new Error("invalid central directory file header signature: 0x" + K.toString(16))); if (V.versionMadeBy = D.readUInt16LE(4), V.versionNeededToExtract = D.readUInt16LE(6), V.generalPurposeBitFlag = D.readUInt16LE(8), V.compressionMethod = D.readUInt16LE(10), V.lastModFileTime = D.readUInt16LE(12), V.lastModFileDate = D.readUInt16LE(14), V.crc32 = D.readUInt32LE(16), V.compressedSize = D.readUInt32LE(20), V.uncompressedSize = D.readUInt32LE(24), V.fileNameLength = D.readUInt16LE(28), V.extraFieldLength = D.readUInt16LE(30), V.fileCommentLength = D.readUInt16LE(32), V.internalFileAttributes = D.readUInt16LE(36), V.externalFileAttributes = D.readUInt32LE(38), V.relativeOffsetOfLocalHeader = D.readUInt32LE(42), V.generalPurposeBitFlag & 64) return h(B, new Error("strong encryption is not supported")); B.readEntryCursor += 46, D = G(V.fileNameLength + V.extraFieldLength + V.fileCommentLength), S(B.reader, D, 0, D.length, B.readEntryCursor, function($) { if ($) return h(B, $); if (!B.emittedError) { var _ = (V.generalPurposeBitFlag & 2048) !== 0; V.fileName = B.decodeStrings ? Y(D, 0, V.fileNameLength, _) : D.slice(0, V.fileNameLength); var I = V.fileNameLength + V.extraFieldLength, N = D.slice(V.fileNameLength, I); V.extraFields = []; for (var L = 0; L < N.length - 3; ) { var C = N.readUInt16LE(L + 0), Q = N.readUInt16LE(L + 2), k = L + 4, M = k + Q; if (M > N.length) return h(B, new Error("extra field length exceeds extra field buffer size")); var O = G(Q); N.copy(O, 0, k, M), V.extraFields.push({ id: C, data: O }), L = M; } if (V.fileComment = B.decodeStrings ? Y(D, I, I + V.fileCommentLength, _) : D.slice(I, I + V.fileCommentLength), V.comment = V.fileComment, B.readEntryCursor += D.length, B.entriesRead += 1, V.uncompressedSize === 4294967295 || V.compressedSize === 4294967295 || V.relativeOffsetOfLocalHeader === 4294967295) { for (var A = null, L = 0; L < V.extraFields.length; L++) { var F = V.extraFields[L]; if (F.id === 1) { A = F.data; break; } } if (A == null) return h(B, new Error("expected zip64 extended information extra field")); var Z = 0; if (V.uncompressedSize === 4294967295) { if (Z + 8 > A.length) return h(B, new Error("zip64 extended information extra field does not include uncompressed size")); V.uncompressedSize = H(A, Z), Z += 8; } if (V.compressedSize === 4294967295) { if (Z + 8 > A.length) return h(B, new Error("zip64 extended information extra field does not include compressed size")); V.compressedSize = H(A, Z), Z += 8; } if (V.relativeOffsetOfLocalHeader === 4294967295) { if (Z + 8 > A.length) return h(B, new Error("zip64 extended information extra field does not include relative header offset")); V.relativeOffsetOfLocalHeader = H(A, Z), Z += 8; } } if (B.decodeStrings) for (var L = 0; L < V.extraFields.length; L++) { var F = V.extraFields[L]; if (F.id === 28789) { if (F.data.length < 6 || F.data.readUInt8(0) !== 1) continue; var ee = F.data.readUInt32LE(1); if (r.unsigned(D.slice(0, V.fileNameLength)) !== ee) continue; V.fileName = Y(F.data, 5, F.data.length, !0); break; } } if (B.validateEntrySizes && V.compressionMethod === 0) { var P = V.uncompressedSize; if (V.isEncrypted() && (P += 12), V.compressedSize !== P) { var j = "compressed/uncompressed size mismatch for stored file: " + V.compressedSize + " != " + V.uncompressedSize; return h(B, new Error(j)); } } if (B.decodeStrings) { B.strictFileNames || (V.fileName = V.fileName.replace(/\\/g, "/")); var W = b(V.fileName, B.validateFileNameOptions); if (W != null) return h(B, new Error(W)); } B.emit("entry", V), B.lazyEntries || B._readEntry(); } }); } }); } }, m.prototype.openReadStream = function(B, D, X) { var V = this, K = 0, $ = B.compressedSize; if (X == null) X = D, D = {}; else { if (D.decrypt != null) { if (!B.isEncrypted()) throw new Error("options.decrypt can only be specified for encrypted entries"); if (D.decrypt !== !1) throw new Error("invalid options.decrypt value: " + D.decrypt); if (B.isCompressed() && D.decompress !== !1) throw new Error("entry is encrypted and compressed, and options.decompress !== false"); } if (D.decompress != null) { if (!B.isCompressed()) throw new Error("options.decompress can only be specified for compressed entries"); if (!(D.decompress === !1 || D.decompress === !0)) throw new Error("invalid options.decompress value: " + D.decompress); } if (D.start != null || D.end != null) { if (B.isCompressed() && D.decompress !== !1) throw new Error("start/end range not allowed for compressed entry without options.decompress === false"); if (B.isEncrypted() && D.decrypt !== !1) throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false"); } if (D.start != null) { if (K = D.start, K < 0) throw new Error("options.start < 0"); if (K > B.compressedSize) throw new Error("options.start > entry.compressedSize"); } if (D.end != null) { if ($ = D.end, $ < 0) throw new Error("options.end < 0"); if ($ > B.compressedSize) throw new Error("options.end > entry.compressedSize"); if ($ < K) throw new Error("options.end < options.start"); } } if (!V.isOpen) return X(new Error("closed")); if (B.isEncrypted() && D.decrypt !== !1) return X(new Error("entry is encrypted, and options.decrypt !== false")); V.reader.ref(); var _ = G(30); S(V.reader, _, 0, _.length, B.relativeOffsetOfLocalHeader, function(I) { try { if (I) return X(I); var N = _.readUInt32LE(0); if (N !== 67324752) return X(new Error("invalid local file header signature: 0x" + N.toString(16))); var L = _.readUInt16LE(26), C = _.readUInt16LE(28), Q = B.relativeOffsetOfLocalHeader + _.length + L + C, k; if (B.compressionMethod === 0) k = !1; else if (B.compressionMethod === 8) k = D.decompress != null ? D.decompress : !0; else return X(new Error("unsupported compression method: " + B.compressionMethod)); var M = Q, O = M + B.compressedSize; if (B.compressedSize !== 0 && O > V.fileSize) return X(new Error("file data overflows file bounds: " + M + " + " + B.compressedSize + " > " + V.fileSize)); var A = V.reader.createReadStream({ start: M + K, end: M + $ }), F = A; if (k) { var Z = !1, ee = e.createInflateRaw(); A.on("error", function(P) { setImmediate(function() { Z || ee.emit("error", P); }); }), A.pipe(ee), V.validateEntrySizes ? (F = new E(B.uncompressedSize), ee.on("error", function(P) { setImmediate(function() { Z || F.emit("error", P); }); }), ee.pipe(F)) : F = ee, F.destroy = function() { Z = !0, ee !== F && ee.unpipe(F), A.unpipe(ee), A.destroy(); }; } X(null, F); } finally { V.reader.unref(); } }); }; function x() { } x.prototype.getLastModDate = function() { return g(this.lastModFileDate, this.lastModFileTime); }, x.prototype.isEncrypted = function() { return (this.generalPurposeBitFlag & 1) !== 0; }, x.prototype.isCompressed = function() { return this.compressionMethod === 8; }; function g(B, D) { var X = B & 31, V = (B >> 5 & 15) - 1, K = (B >> 9 & 127) + 1980, $ = 0, _ = (D & 31) * 2, I = D >> 5 & 63, N = D >> 11 & 31; return new Date(K, V, X, N, I, _, $); } function b(B) { return B.indexOf("\\") !== -1 ? "invalid characters in fileName: " + B : /^[a-zA-Z]:/.test(B) || /^\//.test(B) ? "absolute path: " + B : B.split("/").indexOf("..") !== -1 ? "invalid relative path: " + B : null; } function S(B, D, X, V, K, $) { if (V === 0) return setImmediate(function() { $(null, G(0)); }); B.read(D, X, V, K, function(_, I) { if (_) return $(_); if (I < V) return $(new Error("unexpected EOF")); $(); }); } i.inherits(E, a); function E(B) { a.call(this), this.actualByteCount = 0, this.expectedByteCount = B; } E.prototype._transform = function(B, D, X) { if (this.actualByteCount += B.length, this.actualByteCount > this.expectedByteCount) { var V = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount; return X(new Error(V)); } X(null, B); }, E.prototype._flush = function(B) { if (this.actualByteCount < this.expectedByteCount) { var D = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount; return B(new Error(D)); } B(); }, i.inherits(T, o); function T() { o.call(this), this.refCount = 0; } T.prototype.ref = function() { this.refCount += 1; }, T.prototype.unref = function() { var B = this; if (B.refCount -= 1, B.refCount > 0) return; if (B.refCount < 0) throw new Error("invalid unref"); B.close(D); function D(X) { if (X) return B.emit("error", X); B.emit("close"); } }, T.prototype.createReadStream = function(B) { var D = B.start, X = B.end; if (D === X) { var V = new s(); return setImmediate(function() { V.end(); }), V; } var K = this._readStreamForRange(D, X), $ = !1, _ = new U(this); K.on("error", function(N) { setImmediate(function() { $ || _.emit("error", N); }); }), _.destroy = function() { K.unpipe(_), _.unref(), K.destroy(); }; var I = new E(X - D); return _.on("error", function(N) { setImmediate(function() { $ || I.emit("error", N); }); }), I.destroy = function() { $ = !0, _.unpipe(I), _.destroy(); }, K.pipe(_).pipe(I); }, T.prototype._readStreamForRange = function(B, D) { throw new Error("not implemented"); }, T.prototype.read = function(B, D, X, V, K) { var $ = this.createReadStream({ start: V, end: V + X }), _ = new c(), I = 0; _._write = function(N, L, C) { N.copy(B, D + I, 0, N.length), I += N.length, C(); }, _.on("finish", K), $.on("error", function(N) { K(N); }), $.pipe(_); }, T.prototype.close = function(B) { setImmediate(B); }, i.inherits(U, s); function U(B) { s.call(this), this.context = B, this.context.ref(), this.unreffedYet = !1; } U.prototype._flush = function(B) { this.unref(), B(); }, U.prototype.unref = function(B) { this.unreffedYet || (this.unreffedYet = !0, this.context.unref()); }; var q = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "; function Y(B, D, X, V) { if (V) return B.toString("utf8", D, X); for (var K = "", $ = D; $ < X; $++) K += q[B[$]]; return K; } function H(B, D) { var X = B.readUInt32LE(D), V = B.readUInt32LE(D + 4); return V * 4294967296 + X; } var G; typeof Buffer.allocUnsafe == "function" ? G = function(B) { return Buffer.allocUnsafe(B); } : G = function(B) { return new Buffer(B); }; function J(B) { if (B) throw B; } return no; } var Yb, I6; function MV() { if (I6) return Yb; I6 = 1; const t = mr; class e extends t.Writable { emit(r, i) { if (r === "error") { const o = i; o.name === "Error" && (o.name = this.constructor.name + "Error"); } super.emit.apply(this, arguments); } } return Yb = e, Yb; } var Jb = { exports: {} }, Xb, C6; function Bc() { if (C6) return Xb; C6 = 1; var t = Os, e = t.Buffer, n = {}, r; for (r in t) t.hasOwnProperty(r) && (r === "SlowBuffer" || r === "Buffer" || (n[r] = t[r])); var i = n.Buffer = {}; for (r in e) e.hasOwnProperty(r) && (r === "allocUnsafe" || r === "allocUnsafeSlow" || (i[r] = e[r])); if (n.Buffer.prototype = e.prototype, (!i.from || i.from === Uint8Array.from) && (i.from = function(o, a, s) { if (typeof o == "number") throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof o); if (o && typeof o.length > "u") throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o); return e(o, a, s); }), i.alloc || (i.alloc = function(o, a, s) { if (typeof o != "number") throw new TypeError('The "size" argument must be of type number. Received type ' + typeof o); if (o < 0 || o >= 2 * (1 << 30)) throw new RangeError('The value "' + o + '" is invalid for option "size"'); var c = e(o); return !a || a.length === 0 ? c.fill(0) : typeof s == "string" ? c.fill(a, s) : c.fill(a), c; }), !n.kStringMaxLength) try { n.kStringMaxLength = process.binding("buffer").kStringMaxLength; } catch { } return n.constants || (n.constants = { MAX_LENGTH: n.kMaxLength }, n.kStringMaxLength && (n.constants.MAX_STRING_LENGTH = n.kStringMaxLength)), Xb = n, Xb; } var bh = {}, T6; function RV() { if (T6) return bh; T6 = 1; var t = "\uFEFF"; bh.PrependBOM = e; function e(r, i) { this.encoder = r, this.addBOM = !0; } e.prototype.write = function(r) { return this.addBOM && (r = t + r, this.addBOM = !1), this.encoder.write(r); }, e.prototype.end = function() { return this.encoder.end(); }, bh.StripBOM = n; function n(r, i) { this.decoder = r, this.pass = !1, this.options = i || {}; } return n.prototype.write = function(r) { var i = this.decoder.write(r); return this.pass || !i || (i[0] === t && (i = i.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), i; }, n.prototype.end = function() { return this.decoder.end(); }, bh; } var Zb = {}, ev, k6; function BV() { if (k6) return ev; k6 = 1; var t = Bc().Buffer; ev = { // Encodings utf8: { type: "_internal", bomAware: !0 }, cesu8: { type: "_internal", bomAware: !0 }, unicode11utf8: "utf8", ucs2: { type: "_internal", bomAware: !0 }, utf16le: "ucs2", binary: { type: "_internal" }, base64: { type: "_internal" }, hex: { type: "_internal" }, // Codec. _internal: e }; function e(c, u) { this.enc = c.encodingName, this.bomAware = c.bomAware, this.enc === "base64" ? this.encoder = o : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = a, t.from("eda0bdedb2a9", "hex").toString() !== "💩" && (this.decoder = s, this.defaultCharUnicode = u.defaultCharUnicode)); } e.prototype.encoder = i, e.prototype.decoder = r; var n = O2.StringDecoder; n.prototype.end || (n.prototype.end = function() { }); function r(c, u) { n.call(this, u.enc); } r.prototype = n.prototype; function i(c, u) { this.enc = u.enc; } i.prototype.write = function(c) { return t.from(c, this.enc); }, i.prototype.end = function() { }; function o(c, u) { this.prevStr = ""; } o.prototype.write = function(c) { c = this.prevStr + c; var u = c.length - c.length % 4; return this.prevStr = c.slice(u), c = c.slice(0, u), t.from(c, "base64"); }, o.prototype.end = function() { return t.from(this.prevStr, "base64"); }; function a(c, u) { } a.prototype.write = function(c) { for (var u = t.alloc(c.length * 3), d = 0, p = 0; p < c.length; p++) { var f = c.charCodeAt(p); f < 128 ? u[d++] = f : f < 2048 ? (u[d++] = 192 + (f >>> 6), u[d++] = 128 + (f & 63)) : (u[d++] = 224 + (f >>> 12), u[d++] = 128 + (f >>> 6 & 63), u[d++] = 128 + (f & 63)); } return u.slice(0, d); }, a.prototype.end = function() { }; function s(c, u) { this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = u.defaultCharUnicode; } return s.prototype.write = function(c) { for (var u = this.acc, d = this.contBytes, p = this.accBytes, f = "", m = 0; m < c.length; m++) { var h = c[m]; (h & 192) !== 128 ? (d > 0 && (f += this.defaultCharUnicode, d = 0), h < 128 ? f += String.fromCharCode(h) : h < 224 ? (u = h & 31, d = 1, p = 1) : h < 240 ? (u = h & 15, d = 2, p = 1) : f += this.defaultCharUnicode) : d > 0 ? (u = u << 6 | h & 63, d--, p++, d === 0 && (p === 2 && u < 128 && u > 0 ? f += this.defaultCharUnicode : p === 3 && u < 2048 ? f += this.defaultCharUnicode : f += String.fromCharCode(u))) : f += this.defaultCharUnicode; } return this.acc = u, this.contBytes = d, this.accBytes = p, f; }, s.prototype.end = function() { var c = 0; return this.contBytes > 0 && (c += this.defaultCharUnicode), c; }, ev; } var la = {}, N6; function UV() { if (N6) return la; N6 = 1; var t = Bc().Buffer; la._utf32 = e; function e(c, u) { this.iconv = u, this.bomAware = !0, this.isLE = c.isLE; } la.utf32le = { type: "_utf32", isLE: !0 }, la.utf32be = { type: "_utf32", isLE: !1 }, la.ucs4le = "utf32le", la.ucs4be = "utf32be", e.prototype.encoder = n, e.prototype.decoder = r; function n(c, u) { this.isLE = u.isLE, this.highSurrogate = 0; } n.prototype.write = function(c) { for (var u = t.from(c, "ucs2"), d = t.alloc(u.length * 2), p = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, f = 0, m = 0; m < u.length; m += 2) { var h = u.readUInt16LE(m), y = 55296 <= h && h < 56320, x = 56320 <= h && h < 57344; if (this.highSurrogate) if (y || !x) p.call(d, this.highSurrogate, f), f += 4; else { var g = (this.highSurrogate - 55296 << 10 | h - 56320) + 65536; p.call(d, g, f), f += 4, this.highSurrogate = 0; continue; } y ? this.highSurrogate = h : (p.call(d, h, f), f += 4, this.highSurrogate = 0); } return f < d.length && (d = d.slice(0, f)), d; }, n.prototype.end = function() { if (this.highSurrogate) { var c = t.alloc(4); return this.isLE ? c.writeUInt32LE(this.highSurrogate, 0) : c.writeUInt32BE(this.highSurrogate, 0), this.highSurrogate = 0, c; } }; function r(c, u) { this.isLE = u.isLE, this.badChar = u.iconv.defaultCharUnicode.charCodeAt(0), this.overflow = null; } r.prototype.write = function(c) { if (c.length === 0) return ""; this.overflow && (c = t.concat([this.overflow, c])); var u = c.length - c.length % 4; c.length !== u ? (this.overflow = c.slice(u), c = c.slice(0, u)) : this.overflow = null; for (var d = t.alloc(u), p = 0, f = 0; f < u; f += 4) { var m = this.isLE ? c.readUInt32LE(f) : c.readUInt32BE(f); if (m < 65536) d.writeUInt16LE(m, p), p += 2; else if (m > 1114111) d.writeUInt16LE(this.badChar, p), p += 2; else { m -= 65536; var h = 55296 | m >> 10, y = 56320 + (m & 1023); d.writeUInt16LE(h, p), p += 2, d.writeUInt16LE(y, p), p += 2; } } return d.slice(0, p).toString("ucs2"); }, r.prototype.end = function() { this.overflow = null; }, la.utf32 = i, la.ucs4 = i; function i(c, u) { this.iconv = u; } i.prototype.encoder = o, i.prototype.decoder = a; function o(c, u) { c = c || {}, c.addBOM === void 0 && (c.addBOM = !0), this.encoder = u.iconv.getEncoder(c.defaultEncoding || "utf-32le", c); } o.prototype.write = function(c) { return this.encoder.write(c); }, o.prototype.end = function() { return this.encoder.end(); }; function a(c, u) { this.decoder = null, this.initialBytes = [], this.initialBytesLen = 0, this.options = c || {}, this.iconv = u.iconv; } a.prototype.write = function(c) { if (!this.decoder) { if (this.initialBytes.push(c), this.initialBytesLen += c.length, this.initialBytesLen < 32) return ""; var u = t.concat(this.initialBytes), d = s(u, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(d, this.options), this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(c); }, a.prototype.end = function() { if (!this.decoder) { var c = t.concat(this.initialBytes), u = s(c, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(u, this.options); var d = this.decoder.write(c), p = this.decoder.end(); return p ? d + p : d; } return this.decoder.end(); }; function s(c, u) { var d = u || "utf-32le"; if (c.length >= 4) if (c.readUInt32BE(0) === 65279) d = "utf-32be"; else if (c.readUInt32LE(0) === 65279) d = "utf-32le"; else { for (var p = 0, f = 0, m = 0, h = 0, y = Math.min(c.length - c.length % 4, 128), x = 0; x < y; x += 4) { var g = c[x], b = c[x + 1], S = c[x + 2], E = c[x + 3]; (g !== 0 || b > 16) && ++f, (E !== 0 || S > 16) && ++p, g === 0 && b === 0 && S === 0 && E !== 0 && h++, g !== 0 && b === 0 && S === 0 && E === 0 && m++; } f < p ? d = "utf-32be" : p < f && (d = "utf-32le"), h > m ? d = "utf-32be" : h < m && (d = "utf-32le"); } return d; } return la; } var vh = {}, P6; function LV() { if (P6) return vh; P6 = 1; var t = Bc().Buffer; vh.utf16be = e; function e() { } e.prototype.encoder = n, e.prototype.decoder = r, e.prototype.bomAware = !0; function n() { } n.prototype.write = function(c) { for (var u = t.from(c, "ucs2"), d = 0; d < u.length; d += 2) { var p = u[d]; u[d] = u[d + 1], u[d + 1] = p; } return u; }, n.prototype.end = function() { }; function r() { this.overflowByte = -1; } r.prototype.write = function(c) { if (c.length == 0) return ""; var u = t.alloc(c.length + 1), d = 0, p = 0; for (this.overflowByte !== -1 && (u[0] = c[0], u[1] = this.overflowByte, d = 1, p = 2); d < c.length - 1; d += 2, p += 2) u[p] = c[d + 1], u[p + 1] = c[d]; return this.overflowByte = d == c.length - 1 ? c[c.length - 1] : -1, u.slice(0, p).toString("ucs2"); }, r.prototype.end = function() { }, vh.utf16 = i; function i(c, u) { this.iconv = u; } i.prototype.encoder = o, i.prototype.decoder = a; function o(c, u) { c = c || {}, c.addBOM === void 0 && (c.addBOM = !0), this.encoder = u.iconv.getEncoder("utf-16le", c); } o.prototype.write = function(c) { return this.encoder.write(c); }, o.prototype.end = function() { return this.encoder.end(); }; function a(c, u) { this.decoder = null, this.initialBytes = [], this.initialBytesLen = 0, this.options = c || {}, this.iconv = u.iconv; } a.prototype.write = function(c) { if (!this.decoder) { if (this.initialBytes.push(c), this.initialBytesLen += c.length, this.initialBytesLen < 16) return ""; var c = t.concat(this.initialBytes), u = s(c, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(u, this.options), this.initialBytes.length = this.initialBytesLen = 0; } return this.decoder.write(c); }, a.prototype.end = function() { if (!this.decoder) { var c = t.concat(this.initialBytes), u = s(c, this.options.defaultEncoding); this.decoder = this.iconv.getDecoder(u, this.options); var d = this.decoder.write(c), p = this.decoder.end(); return p ? d + p : d; } return this.decoder.end(); }; function s(c, u) { var d = u || "utf-16le"; if (c.length >= 2) if (c[0] == 254 && c[1] == 255) d = "utf-16be"; else if (c[0] == 255 && c[1] == 254) d = "utf-16le"; else { for (var p = 0, f = 0, m = Math.min(c.length - c.length % 2, 64), h = 0; h < m; h += 2) c[h] === 0 && c[h + 1] !== 0 && f++, c[h] !== 0 && c[h + 1] === 0 && p++; f > p ? d = "utf-16be" : f < p && (d = "utf-16le"); } return d; } return vh; } var id = {}, D6; function QV() { if (D6) return id; D6 = 1; var t = Bc().Buffer; id.utf7 = e, id.unicode11utf7 = "utf7"; function e(y, x) { this.iconv = x; } e.prototype.encoder = r, e.prototype.decoder = i, e.prototype.bomAware = !0; var n = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; function r(y, x) { this.iconv = x.iconv; } r.prototype.write = function(y) { return t.from(y.replace(n, function(x) { return "+" + (x === "+" ? "" : this.iconv.encode(x, "utf16-be").toString("base64").replace(/=+$/, "")) + "-"; }.bind(this))); }, r.prototype.end = function() { }; function i(y, x) { this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = ""; } for (var o = /[A-Za-z0-9\/+]/, a = [], s = 0; s < 256; s++) a[s] = o.test(String.fromCharCode(s)); var c = 43, u = 45, d = 38; i.prototype.write = function(y) { for (var x = "", g = 0, b = this.inBase64, S = this.base64Accum, E = 0; E < y.length; E++) if (!b) y[E] == c && (x += this.iconv.decode(y.slice(g, E), "ascii"), g = E + 1, b = !0); else if (!a[y[E]]) { if (E == g && y[E] == u) x += "+"; else { var T = S + y.slice(g, E).toString(); x += this.iconv.decode(t.from(T, "base64"), "utf16-be"); } y[E] != u && E--, g = E + 1, b = !1, S = ""; } if (!b) x += this.iconv.decode(y.slice(g), "ascii"); else { var T = S + y.slice(g).toString(), U = T.length - T.length % 8; S = T.slice(U), T = T.slice(0, U), x += this.iconv.decode(t.from(T, "base64"), "utf16-be"); } return this.inBase64 = b, this.base64Accum = S, x; }, i.prototype.end = function() { var y = ""; return this.inBase64 && this.base64Accum.length > 0 && (y = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", y; }, id.utf7imap = p; function p(y, x) { this.iconv = x; } p.prototype.encoder = f, p.prototype.decoder = m, p.prototype.bomAware = !0; function f(y, x) { this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0; } f.prototype.write = function(y) { for (var x = this.inBase64, g = this.base64Accum, b = this.base64AccumIdx, S = t.alloc(y.length * 5 + 10), E = 0, T = 0; T < y.length; T++) { var U = y.charCodeAt(T); 32 <= U && U <= 126 ? (x && (b > 0 && (E += S.write(g.slice(0, b).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), E), b = 0), S[E++] = u, x = !1), x || (S[E++] = U, U === d && (S[E++] = u))) : (x || (S[E++] = d, x = !0), x && (g[b++] = U >> 8, g[b++] = U & 255, b == g.length && (E += S.write(g.toString("base64").replace(/\//g, ","), E), b = 0))); } return this.inBase64 = x, this.base64AccumIdx = b, S.slice(0, E); }, f.prototype.end = function() { var y = t.alloc(10), x = 0; return this.inBase64 && (this.base64AccumIdx > 0 && (x += y.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), x), this.base64AccumIdx = 0), y[x++] = u, this.inBase64 = !1), y.slice(0, x); }; function m(y, x) { this.iconv = x.iconv, this.inBase64 = !1, this.base64Accum = ""; } var h = a.slice(); return h[44] = !0, m.prototype.write = function(y) { for (var x = "", g = 0, b = this.inBase64, S = this.base64Accum, E = 0; E < y.length; E++) if (!b) y[E] == d && (x += this.iconv.decode(y.slice(g, E), "ascii"), g = E + 1, b = !0); else if (!h[y[E]]) { if (E == g && y[E] == u) x += "&"; else { var T = S + y.slice(g, E).toString().replace(/,/g, "/"); x += this.iconv.decode(t.from(T, "base64"), "utf16-be"); } y[E] != u && E--, g = E + 1, b = !1, S = ""; } if (!b) x += this.iconv.decode(y.slice(g), "ascii"); else { var T = S + y.slice(g).toString().replace(/,/g, "/"), U = T.length - T.length % 8; S = T.slice(U), T = T.slice(0, U), x += this.iconv.decode(t.from(T, "base64"), "utf16-be"); } return this.inBase64 = b, this.base64Accum = S, x; }, m.prototype.end = function() { var y = ""; return this.inBase64 && this.base64Accum.length > 0 && (y = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", y; }, id; } var tv = {}, O6; function jV() { if (O6) return tv; O6 = 1; var t = Bc().Buffer; tv._sbcs = e; function e(i, o) { if (!i) throw new Error("SBCS codec is called without the data."); if (!i.chars || i.chars.length !== 128 && i.chars.length !== 256) throw new Error("Encoding '" + i.type + "' has incorrect 'chars' (must be of len 128 or 256)"); if (i.chars.length === 128) { for (var a = "", s = 0; s < 128; s++) a += String.fromCharCode(s); i.chars = a + i.chars; } this.decodeBuf = t.from(i.chars, "ucs2"); for (var c = t.alloc(65536, o.defaultCharSingleByte.charCodeAt(0)), s = 0; s < i.chars.length; s++) c[i.chars.charCodeAt(s)] = s; this.encodeBuf = c; } e.prototype.encoder = n, e.prototype.decoder = r; function n(i, o) { this.encodeBuf = o.encodeBuf; } n.prototype.write = function(i) { for (var o = t.alloc(i.length), a = 0; a < i.length; a++) o[a] = this.encodeBuf[i.charCodeAt(a)]; return o; }, n.prototype.end = function() { }; function r(i, o) { this.decodeBuf = o.decodeBuf; } return r.prototype.write = function(i) { for (var o = this.decodeBuf, a = t.alloc(i.length * 2), s = 0, c = 0, u = 0; u < i.length; u++) s = i[u] * 2, c = u * 2, a[c] = o[s], a[c + 1] = o[s + 1]; return a.toString("ucs2"); }, r.prototype.end = function() { }, tv; } var nv, F6; function $V() { return F6 || (F6 = 1, nv = { // Not supported by iconv, not sure why. 10029: "maccenteuro", maccenteuro: { type: "_sbcs", chars: "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" }, 808: "cp808", ibm808: "cp808", cp808: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " }, mik: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, cp720: { type: "_sbcs", chars: "€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ " }, // Aliases of generated encodings. ascii8bit: "ascii", usascii: "ascii", ansix34: "ascii", ansix341968: "ascii", ansix341986: "ascii", csascii: "ascii", cp367: "ascii", ibm367: "ascii", isoir6: "ascii", iso646us: "ascii", iso646irv: "ascii", us: "ascii", latin1: "iso88591", latin2: "iso88592", latin3: "iso88593", latin4: "iso88594", latin5: "iso88599", latin6: "iso885910", latin7: "iso885913", latin8: "iso885914", latin9: "iso885915", latin10: "iso885916", csisolatin1: "iso88591", csisolatin2: "iso88592", csisolatin3: "iso88593", csisolatin4: "iso88594", csisolatincyrillic: "iso88595", csisolatinarabic: "iso88596", csisolatingreek: "iso88597", csisolatinhebrew: "iso88598", csisolatin5: "iso88599", csisolatin6: "iso885910", l1: "iso88591", l2: "iso88592", l3: "iso88593", l4: "iso88594", l5: "iso88599", l6: "iso885910", l7: "iso885913", l8: "iso885914", l9: "iso885915", l10: "iso885916", isoir14: "iso646jp", isoir57: "iso646cn", isoir100: "iso88591", isoir101: "iso88592", isoir109: "iso88593", isoir110: "iso88594", isoir144: "iso88595", isoir127: "iso88596", isoir126: "iso88597", isoir138: "iso88598", isoir148: "iso88599", isoir157: "iso885910", isoir166: "tis620", isoir179: "iso885913", isoir199: "iso885914", isoir203: "iso885915", isoir226: "iso885916", cp819: "iso88591", ibm819: "iso88591", cyrillic: "iso88595", arabic: "iso88596", arabic8: "iso88596", ecma114: "iso88596", asmo708: "iso88596", greek: "iso88597", greek8: "iso88597", ecma118: "iso88597", elot928: "iso88597", hebrew: "iso88598", hebrew8: "iso88598", turkish: "iso88599", turkish8: "iso88599", thai: "iso885911", thai8: "iso885911", celtic: "iso885914", celtic8: "iso885914", isoceltic: "iso885914", tis6200: "tis620", tis62025291: "tis620", tis62025330: "tis620", 1e4: "macroman", 10006: "macgreek", 10007: "maccyrillic", 10079: "maciceland", 10081: "macturkish", cspc8codepage437: "cp437", cspc775baltic: "cp775", cspc850multilingual: "cp850", cspcp852: "cp852", cspc862latinhebrew: "cp862", cpgr: "cp869", msee: "cp1250", mscyrl: "cp1251", msansi: "cp1252", msgreek: "cp1253", msturk: "cp1254", mshebr: "cp1255", msarab: "cp1256", winbaltrim: "cp1257", cp20866: "koi8r", 20866: "koi8r", ibm878: "koi8r", cskoi8r: "koi8r", cp21866: "koi8u", 21866: "koi8u", ibm1168: "koi8u", strk10482002: "rk1048", tcvn5712: "tcvn", tcvn57121: "tcvn", gb198880: "iso646cn", cn: "iso646cn", csiso14jisc6220ro: "iso646jp", jisc62201969ro: "iso646jp", jp: "iso646jp", cshproman8: "hproman8", r8: "hproman8", roman8: "hproman8", xroman8: "hproman8", ibm1051: "hproman8", mac: "macintosh", csmacintosh: "macintosh" }), nv; } var rv, M6; function GV() { return M6 || (M6 = 1, rv = { 437: "cp437", 737: "cp737", 775: "cp775", 850: "cp850", 852: "cp852", 855: "cp855", 856: "cp856", 857: "cp857", 858: "cp858", 860: "cp860", 861: "cp861", 862: "cp862", 863: "cp863", 864: "cp864", 865: "cp865", 866: "cp866", 869: "cp869", 874: "windows874", 922: "cp922", 1046: "cp1046", 1124: "cp1124", 1125: "cp1125", 1129: "cp1129", 1133: "cp1133", 1161: "cp1161", 1162: "cp1162", 1163: "cp1163", 1250: "windows1250", 1251: "windows1251", 1252: "windows1252", 1253: "windows1253", 1254: "windows1254", 1255: "windows1255", 1256: "windows1256", 1257: "windows1257", 1258: "windows1258", 28591: "iso88591", 28592: "iso88592", 28593: "iso88593", 28594: "iso88594", 28595: "iso88595", 28596: "iso88596", 28597: "iso88597", 28598: "iso88598", 28599: "iso88599", 28600: "iso885910", 28601: "iso885911", 28603: "iso885913", 28604: "iso885914", 28605: "iso885915", 28606: "iso885916", windows874: { type: "_sbcs", chars: "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, win874: "windows874", cp874: "windows874", windows1250: { type: "_sbcs", chars: "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, win1250: "windows1250", cp1250: "windows1250", windows1251: { type: "_sbcs", chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, win1251: "windows1251", cp1251: "windows1251", windows1252: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, win1252: "windows1252", cp1252: "windows1252", windows1253: { type: "_sbcs", chars: "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, win1253: "windows1253", cp1253: "windows1253", windows1254: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, win1254: "windows1254", cp1254: "windows1254", windows1255: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, win1255: "windows1255", cp1255: "windows1255", windows1256: { type: "_sbcs", chars: "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" }, win1256: "windows1256", cp1256: "windows1256", windows1257: { type: "_sbcs", chars: "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" }, win1257: "windows1257", cp1257: "windows1257", windows1258: { type: "_sbcs", chars: "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, win1258: "windows1258", cp1258: "windows1258", iso88591: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, cp28591: "iso88591", iso88592: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" }, cp28592: "iso88592", iso88593: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" }, cp28593: "iso88593", iso88594: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" }, cp28594: "iso88594", iso88595: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" }, cp28595: "iso88595", iso88596: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" }, cp28596: "iso88596", iso88597: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" }, cp28597: "iso88597", iso88598: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" }, cp28598: "iso88598", iso88599: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" }, cp28599: "iso88599", iso885910: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" }, cp28600: "iso885910", iso885911: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, cp28601: "iso885911", iso885913: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" }, cp28603: "iso885913", iso885914: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" }, cp28604: "iso885914", iso885915: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, cp28605: "iso885915", iso885916: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" }, cp28606: "iso885916", cp437: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm437: "cp437", csibm437: "cp437", cp737: { type: "_sbcs", chars: "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " }, ibm737: "cp737", csibm737: "cp737", cp775: { type: "_sbcs", chars: "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " }, ibm775: "cp775", csibm775: "cp775", cp850: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm850: "cp850", csibm850: "cp850", cp852: { type: "_sbcs", chars: "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " }, ibm852: "cp852", csibm852: "cp852", cp855: { type: "_sbcs", chars: "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " }, ibm855: "cp855", csibm855: "cp855", cp856: { type: "_sbcs", chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm856: "cp856", csibm856: "cp856", cp857: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " }, ibm857: "cp857", csibm857: "cp857", cp858: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " }, ibm858: "cp858", csibm858: "cp858", cp860: { type: "_sbcs", chars: "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm860: "cp860", csibm860: "cp860", cp861: { type: "_sbcs", chars: "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm861: "cp861", csibm861: "cp861", cp862: { type: "_sbcs", chars: "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm862: "cp862", csibm862: "cp862", cp863: { type: "_sbcs", chars: "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm863: "cp863", csibm863: "cp863", cp864: { type: "_sbcs", chars: `\0\x07\b \v\f\r\x1B !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�` }, ibm864: "cp864", csibm864: "cp864", cp865: { type: "_sbcs", chars: "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " }, ibm865: "cp865", csibm865: "cp865", cp866: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " }, ibm866: "cp866", csibm866: "cp866", cp869: { type: "_sbcs", chars: "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " }, ibm869: "cp869", csibm869: "cp869", cp922: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" }, ibm922: "cp922", csibm922: "cp922", cp1046: { type: "_sbcs", chars: "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" }, ibm1046: "cp1046", csibm1046: "cp1046", cp1124: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" }, ibm1124: "cp1124", csibm1124: "cp1124", cp1125: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " }, ibm1125: "cp1125", csibm1125: "cp1125", cp1129: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, ibm1129: "cp1129", csibm1129: "cp1129", cp1133: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" }, ibm1133: "cp1133", csibm1133: "cp1133", cp1161: { type: "_sbcs", chars: "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " }, ibm1161: "cp1161", csibm1161: "cp1161", cp1162: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" }, ibm1162: "cp1162", csibm1162: "cp1162", cp1163: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" }, ibm1163: "cp1163", csibm1163: "cp1163", maccroatian: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" }, maccyrillic: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, macgreek: { type: "_sbcs", chars: "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" }, maciceland: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macroman: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macromania: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, macthai: { type: "_sbcs", chars: "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\uFEFF​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" }, macturkish: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" }, macukraine: { type: "_sbcs", chars: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" }, koi8r: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8u: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8ru: { type: "_sbcs", chars: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, koi8t: { type: "_sbcs", chars: "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" }, armscii8: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" }, rk1048: { type: "_sbcs", chars: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, tcvn: { type: "_sbcs", chars: `\0ÚỤỪỬỮ\x07\b \v\f\rỨỰỲỶỸÝỴ\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ` }, georgianacademy: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, georgianps: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" }, pt154: { type: "_sbcs", chars: "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" }, viscii: { type: "_sbcs", chars: `\0ẲẴẪ\x07\b \v\f\rỶỸ\x1BỴ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ` }, iso646cn: { type: "_sbcs", chars: `\0\x07\b \v\f\r\x1B !"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������` }, iso646jp: { type: "_sbcs", chars: `\0\x07\b \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_\`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������` }, hproman8: { type: "_sbcs", chars: "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" }, macintosh: { type: "_sbcs", chars: "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" }, ascii: { type: "_sbcs", chars: "��������������������������������������������������������������������������������������������������������������������������������" }, tis620: { type: "_sbcs", chars: "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" } }), rv; } var iv = {}, R6; function qV() { if (R6) return iv; R6 = 1; var t = Bc().Buffer; iv._dbcs = c; for (var e = -1, n = -2, r = -10, i = -1e3, o = new Array(256), a = -1, s = 0; s < 256; s++) o[s] = e; function c(f, m) { if (this.encodingName = f.encodingName, !f) throw new Error("DBCS codec is called without the data."); if (!f.table) throw new Error("Encoding '" + this.encodingName + "' has no data."); var h = f.table(); this.decodeTables = [], this.decodeTables[0] = o.slice(0), this.decodeTableSeq = []; for (var y = 0; y < h.length; y++) this._addDecodeChunk(h[y]); this.defaultCharUnicode = m.defaultCharUnicode, this.encodeTable = [], this.encodeTableSeq = []; var x = {}; if (f.encodeSkipVals) for (var y = 0; y < f.encodeSkipVals.length; y++) { var g = f.encodeSkipVals[y]; if (typeof g == "number") x[g] = !0; else for (var b = g.from; b <= g.to; b++) x[b] = !0; } if (this._fillEncodeTable(0, 0, x), f.encodeAdd) for (var S in f.encodeAdd) Object.prototype.hasOwnProperty.call(f.encodeAdd, S) && this._setEncodeChar(S.charCodeAt(0), f.encodeAdd[S]); if (this.defCharSB = this.encodeTable[0][m.defaultCharSingleByte.charCodeAt(0)], this.defCharSB === e && (this.defCharSB = this.encodeTable[0]["?"]), this.defCharSB === e && (this.defCharSB = 63), typeof f.gb18030 == "function") { this.gb18030 = f.gb18030(); for (var E = this.decodeTables.length, T = this.decodeTables[E] = o.slice(0), U = this.decodeTables.length, q = this.decodeTables[U] = o.slice(0), y = 129; y <= 254; y++) for (var Y = i - this.decodeTables[0][y], H = this.decodeTables[Y], b = 48; b <= 57; b++) H[b] = i - E; for (var y = 129; y <= 254; y++) T[y] = i - U; for (var y = 48; y <= 57; y++) q[y] = n; } } c.prototype.encoder = u, c.prototype.decoder = d, c.prototype._getDecodeTrieNode = function(f) { for (var m = []; f > 0; f >>= 8) m.push(f & 255); m.length == 0 && m.push(0); for (var h = this.decodeTables[0], y = m.length - 1; y > 0; y--) { var x = h[m[y]]; if (x == e) h[m[y]] = i - this.decodeTables.length, this.decodeTables.push(h = o.slice(0)); else if (x <= i) h = this.decodeTables[i - x]; else throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + f.toString(16)); } return h; }, c.prototype._addDecodeChunk = function(f) { var m = parseInt(f[0], 16), h = this._getDecodeTrieNode(m); m = m & 255; for (var y = 1; y < f.length; y++) { var x = f[y]; if (typeof x == "string") for (var g = 0; g < x.length; ) { var b = x.charCodeAt(g++); if (55296 <= b && b < 56320) { var S = x.charCodeAt(g++); if (56320 <= S && S < 57344) h[m++] = 65536 + (b - 55296) * 1024 + (S - 56320); else throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + f[0]); } else if (4080 < b && b <= 4095) { for (var E = 4095 - b + 2, T = [], U = 0; U < E; U++) T.push(x.charCodeAt(g++)); h[m++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(T); } else h[m++] = b; } else if (typeof x == "number") for (var q = h[m - 1] + 1, g = 0; g < x; g++) h[m++] = q++; else throw new Error("Incorrect type '" + typeof x + "' given in " + this.encodingName + " at chunk " + f[0]); } if (m > 255) throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + f[0] + ": too long" + m); }, c.prototype._getEncodeBucket = function(f) { var m = f >> 8; return this.encodeTable[m] === void 0 && (this.encodeTable[m] = o.slice(0)), this.encodeTable[m]; }, c.prototype._setEncodeChar = function(f, m) { var h = this._getEncodeBucket(f), y = f & 255; h[y] <= r ? this.encodeTableSeq[r - h[y]][a] = m : h[y] == e && (h[y] = m); }, c.prototype._setEncodeSequence = function(f, m) { var h = f[0], y = this._getEncodeBucket(h), x = h & 255, g; y[x] <= r ? g = this.encodeTableSeq[r - y[x]] : (g = {}, y[x] !== e && (g[a] = y[x]), y[x] = r - this.encodeTableSeq.length, this.encodeTableSeq.push(g)); for (var b = 1; b < f.length - 1; b++) { var S = g[h]; typeof S == "object" ? g = S : (g = g[h] = {}, S !== void 0 && (g[a] = S)); } h = f[f.length - 1], g[h] = m; }, c.prototype._fillEncodeTable = function(f, m, h) { for (var y = this.decodeTables[f], x = 0; x < 256; x++) { var g = y[x], b = m + x; h[b] || (g >= 0 ? this._setEncodeChar(g, b) : g <= i ? this._fillEncodeTable(i - g, b << 8, h) : g <= r && this._setEncodeSequence(this.decodeTableSeq[r - g], b)); } }; function u(f, m) { this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = m.encodeTable, this.encodeTableSeq = m.encodeTableSeq, this.defaultCharSingleByte = m.defCharSB, this.gb18030 = m.gb18030; } u.prototype.write = function(f) { for (var m = t.alloc(f.length * (this.gb18030 ? 4 : 3)), h = this.leadSurrogate, y = this.seqObj, x = -1, g = 0, b = 0; ; ) { if (x === -1) { if (g == f.length) break; var S = f.charCodeAt(g++); } else { var S = x; x = -1; } if (55296 <= S && S < 57344) if (S < 56320) if (h === -1) { h = S; continue; } else h = S, S = e; else h !== -1 ? (S = 65536 + (h - 55296) * 1024 + (S - 56320), h = -1) : S = e; else h !== -1 && (x = S, S = e, h = -1); var E = e; if (y !== void 0 && S != e) { var T = y[S]; if (typeof T == "object") { y = T; continue; } else typeof T == "number" ? E = T : T == null && (T = y[a], T !== void 0 && (E = T, x = S)); y = void 0; } else if (S >= 0) { var U = this.encodeTable[S >> 8]; if (U !== void 0 && (E = U[S & 255]), E <= r) { y = this.encodeTableSeq[r - E]; continue; } if (E == e && this.gb18030) { var q = p(this.gb18030.uChars, S); if (q != -1) { var E = this.gb18030.gbChars[q] + (S - this.gb18030.uChars[q]); m[b++] = 129 + Math.floor(E / 12600), E = E % 12600, m[b++] = 48 + Math.floor(E / 1260), E = E % 1260, m[b++] = 129 + Math.floor(E / 10), E = E % 10, m[b++] = 48 + E; continue; } } } E === e && (E = this.defaultCharSingleByte), E < 256 ? m[b++] = E : E < 65536 ? (m[b++] = E >> 8, m[b++] = E & 255) : (m[b++] = E >> 16, m[b++] = E >> 8 & 255, m[b++] = E & 255); } return this.seqObj = y, this.leadSurrogate = h, m.slice(0, b); }, u.prototype.end = function() { if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) { var f = t.alloc(10), m = 0; if (this.seqObj) { var h = this.seqObj[a]; h !== void 0 && (h < 256 ? f[m++] = h : (f[m++] = h >> 8, f[m++] = h & 255)), this.seqObj = void 0; } return this.leadSurrogate !== -1 && (f[m++] = this.defaultCharSingleByte, this.leadSurrogate = -1), f.slice(0, m); } }, u.prototype.findIdx = p; function d(f, m) { this.nodeIdx = 0, this.prevBuf = t.alloc(0), this.decodeTables = m.decodeTables, this.decodeTableSeq = m.decodeTableSeq, this.defaultCharUnicode = m.defaultCharUnicode, this.gb18030 = m.gb18030; } d.prototype.write = function(f) { var m = t.alloc(f.length * 2), h = this.nodeIdx, y = this.prevBuf, x = this.prevBuf.length, g = -this.prevBuf.length, b; x > 0 && (y = t.concat([y, f.slice(0, 10)])); for (var S = 0, E = 0; S < f.length; S++) { var T = S >= 0 ? f[S] : y[S + x], b = this.decodeTables[h][T]; if (!(b >= 0)) if (b === e) S = g, b = this.defaultCharUnicode.charCodeAt(0); else if (b === n) { var U = g >= 0 ? f.slice(g, S + 1) : y.slice(g + x, S + 1 + x), q = (U[0] - 129) * 12600 + (U[1] - 48) * 1260 + (U[2] - 129) * 10 + (U[3] - 48), Y = p(this.gb18030.gbChars, q); b = this.gb18030.uChars[Y] + q - this.gb18030.gbChars[Y]; } else if (b <= i) { h = i - b; continue; } else if (b <= r) { for (var H = this.decodeTableSeq[r - b], G = 0; G < H.length - 1; G++) b = H[G], m[E++] = b & 255, m[E++] = b >> 8; b = H[H.length - 1]; } else throw new Error("iconv-lite internal error: invalid decoding table value " + b + " at " + h + "/" + T); if (b > 65535) { b -= 65536; var J = 55296 + Math.floor(b / 1024); m[E++] = J & 255, m[E++] = J >> 8, b = 56320 + b % 1024; } m[E++] = b & 255, m[E++] = b >> 8, h = 0, g = S + 1; } return this.nodeIdx = h, this.prevBuf = g >= 0 ? f.slice(g) : y.slice(g + x), m.slice(0, E).toString("ucs2"); }, d.prototype.end = function() { for (var f = ""; this.prevBuf.length > 0; ) { f += this.defaultCharUnicode; var m = this.prevBuf.slice(1); this.prevBuf = t.alloc(0), this.nodeIdx = 0, m.length > 0 && (f += this.write(m)); } return this.nodeIdx = 0, f; }; function p(f, m) { if (f[0] > m) return -1; for (var h = 0, y = f.length; h < y - 1; ) { var x = h + Math.floor((y - h + 1) / 2); f[x] <= m ? h = x : y = x; } return h; } return iv; } const zV = [ [ "0", "\0", 128 ], [ "a1", "。", 62 ], [ "8140", " 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈", 9, "+-±×" ], [ "8180", "÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓" ], [ "81b8", "∈∋⊆⊇⊂⊃∪∩" ], [ "81c8", "∧∨¬⇒⇔∀∃" ], [ "81da", "∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬" ], [ "81f0", "ʼn♯♭♪†‡¶" ], [ "81fc", "◯" ], [ "824f", "0", 9 ], [ "8260", "A", 25 ], [ "8281", "a", 25 ], [ "829f", "ぁ", 82 ], [ "8340", "ァ", 62 ], [ "8380", "ム", 22 ], [ "839f", "Α", 16, "Σ", 6 ], [ "83bf", "α", 16, "σ", 6 ], [ "8440", "А", 5, "ЁЖ", 25 ], [ "8470", "а", 5, "ёж", 7 ], [ "8480", "о", 17 ], [ "849f", "─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂" ], [ "8740", "①", 19, "Ⅰ", 9 ], [ "875f", "㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡" ], [ "877e", "㍻" ], [ "8780", "〝〟№㏍℡㊤", 4, "㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪" ], [ "889f", "亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭" ], [ "8940", "院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円" ], [ "8980", "園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改" ], [ "8a40", "魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫" ], [ "8a80", "橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄" ], [ "8b40", "機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救" ], [ "8b80", "朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈" ], [ "8c40", "掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨" ], [ "8c80", "劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向" ], [ "8d40", "后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降" ], [ "8d80", "項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷" ], [ "8e40", "察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止" ], [ "8e80", "死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周" ], [ "8f40", "宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳" ], [ "8f80", "準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾" ], [ "9040", "拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨" ], [ "9080", "逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線" ], [ "9140", "繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻" ], [ "9180", "操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只" ], [ "9240", "叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄" ], [ "9280", "逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓" ], [ "9340", "邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬" ], [ "9380", "凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入" ], [ "9440", "如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅" ], [ "9480", "楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美" ], [ "9540", "鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷" ], [ "9580", "斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋" ], [ "9640", "法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆" ], [ "9680", "摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒" ], [ "9740", "諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲" ], [ "9780", "沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯" ], [ "9840", "蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕" ], [ "989f", "弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲" ], [ "9940", "僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭" ], [ "9980", "凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨" ], [ "9a40", "咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸" ], [ "9a80", "噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩" ], [ "9b40", "奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀" ], [ "9b80", "它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏" ], [ "9c40", "廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠" ], [ "9c80", "怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛" ], [ "9d40", "戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫" ], [ "9d80", "捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼" ], [ "9e40", "曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎" ], [ "9e80", "梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣" ], [ "9f40", "檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯" ], [ "9f80", "麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌" ], [ "e040", "漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝" ], [ "e080", "烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱" ], [ "e140", "瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿" ], [ "e180", "痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬" ], [ "e240", "磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰" ], [ "e280", "窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆" ], [ "e340", "紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷" ], [ "e380", "縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋" ], [ "e440", "隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤" ], [ "e480", "艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈" ], [ "e540", "蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬" ], [ "e580", "蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞" ], [ "e640", "襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧" ], [ "e680", "諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊" ], [ "e740", "蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜" ], [ "e780", "轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮" ], [ "e840", "錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙" ], [ "e880", "閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰" ], [ "e940", "顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃" ], [ "e980", "騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈" ], [ "ea40", "鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯" ], [ "ea80", "黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙" ], [ "ed40", "纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏" ], [ "ed80", "塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱" ], [ "ee40", "犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙" ], [ "ee80", "蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑" ], [ "eeef", "ⅰ", 9, "¬¦'"" ], [ "f040", "", 62 ], [ "f080", "", 124 ], [ "f140", "", 62 ], [ "f180", "", 124 ], [ "f240", "", 62 ], [ "f280", "", 124 ], [ "f340", "", 62 ], [ "f380", "", 124 ], [ "f440", "", 62 ], [ "f480", "", 124 ], [ "f540", "", 62 ], [ "f580", "", 124 ], [ "f640", "", 62 ], [ "f680", "", 124 ], [ "f740", "", 62 ], [ "f780", "", 124 ], [ "f840", "", 62 ], [ "f880", "", 124 ], [ "f940", "" ], [ "fa40", "ⅰ", 9, "Ⅰ", 9, "¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊" ], [ "fa80", "兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯" ], [ "fb40", "涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神" ], [ "fb80", "祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙" ], [ "fc40", "髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑" ] ], HV = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]'), ov = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]'), B6 = [ [ "a140", "", 62 ], [ "a180", "", 32 ], [ "a240", "", 62 ], [ "a280", "", 32 ], [ "a2ab", "", 5 ], [ "a2e3", "€" ], [ "a2ef", "" ], [ "a2fd", "" ], [ "a340", "", 62 ], [ "a380", "", 31, " " ], [ "a440", "", 62 ], [ "a480", "", 32 ], [ "a4f4", "", 10 ], [ "a540", "", 62 ], [ "a580", "", 32 ], [ "a5f7", "", 7 ], [ "a640", "", 62 ], [ "a680", "", 32 ], [ "a6b9", "", 7 ], [ "a6d9", "", 6 ], [ "a6ec", "" ], [ "a6f3", "" ], [ "a6f6", "", 8 ], [ "a740", "", 62 ], [ "a780", "", 32 ], [ "a7c2", "", 14 ], [ "a7f2", "", 12 ], [ "a896", "", 10 ], [ "a8bc", "" ], [ "a8bf", "ǹ" ], [ "a8c1", "" ], [ "a8ea", "", 20 ], [ "a958", "" ], [ "a95b", "" ], [ "a95d", "" ], [ "a989", "〾⿰", 11 ], [ "a997", "", 12 ], [ "a9f0", "", 14 ], [ "aaa1", "", 93 ], [ "aba1", "", 93 ], [ "aca1", "", 93 ], [ "ada1", "", 93 ], [ "aea1", "", 93 ], [ "afa1", "", 93 ], [ "d7fa", "", 4 ], [ "f8a1", "", 93 ], [ "f9a1", "", 93 ], [ "faa1", "", 93 ], [ "fba1", "", 93 ], [ "fca1", "", 93 ], [ "fda1", "", 93 ], [ "fe50", "⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌" ], [ "fe80", "䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓", 6, "䶮", 93 ] ], WV = [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], KV = [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3], VV = { uChars: WV, gbChars: KV }, YV = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆÐªĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]'), U6 = /* @__PURE__ */ JSON.parse('[["0","\\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]'), JV = [ [ "8740", "䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻" ], [ "8767", "綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬" ], [ "87a1", "𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋" ], [ "8840", "㇀", 4, "𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ" ], [ "88a1", "ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛" ], [ "8940", "𪎩𡅅" ], [ "8943", "攊" ], [ "8946", "丽滝鵎釟" ], [ "894c", "𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮" ], [ "89a1", "琑糼緍楆竉刧" ], [ "89ab", "醌碸酞肼" ], [ "89b0", "贋胶𠧧" ], [ "89b5", "肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁" ], [ "89c1", "溚舾甙" ], [ "89c5", "䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅" ], [ "8a40", "𧶄唥" ], [ "8a43", "𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓" ], [ "8a64", "𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕" ], [ "8a76", "䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯" ], [ "8aa1", "𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱" ], [ "8aac", "䠋𠆩㿺塳𢶍" ], [ "8ab2", "𤗈𠓼𦂗𠽌𠶖啹䂻䎺" ], [ "8abb", "䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃" ], [ "8ac9", "𪘁𠸉𢫏𢳉" ], [ "8ace", "𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻" ], [ "8adf", "𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌" ], [ "8af6", "𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭" ], [ "8b40", "𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹" ], [ "8b55", "𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑" ], [ "8ba1", "𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁" ], [ "8bde", "𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢" ], [ "8c40", "倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋" ], [ "8ca1", "𣏹椙橃𣱣泿" ], [ "8ca7", "爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚" ], [ "8cc9", "顨杫䉶圽" ], [ "8cce", "藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶" ], [ "8ce6", "峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻" ], [ "8d40", "𠮟" ], [ "8d42", "𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱" ], [ "8da1", "㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘" ], [ "8e40", "𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎" ], [ "8ea1", "繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛" ], [ "8f40", "蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖" ], [ "8fa1", "𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起" ], [ "9040", "趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛" ], [ "90a1", "𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜" ], [ "9140", "𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈" ], [ "91a1", "鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨" ], [ "9240", "𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘" ], [ "92a1", "働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃" ], [ "9340", "媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍" ], [ "93a1", "摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋" ], [ "9440", "銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻" ], [ "94a1", "㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡" ], [ "9540", "𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂" ], [ "95a1", "衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰" ], [ "9640", "桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸" ], [ "96a1", "𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉" ], [ "9740", "愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫" ], [ "97a1", "𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎" ], [ "9840", "𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦" ], [ "98a1", "咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃" ], [ "9940", "䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚" ], [ "99a1", "䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿" ], [ "9a40", "鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺" ], [ "9aa1", "黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪" ], [ "9b40", "𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌" ], [ "9b62", "𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎" ], [ "9ba1", "椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊" ], [ "9c40", "嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶" ], [ "9ca1", "㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏" ], [ "9d40", "𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁" ], [ "9da1", "辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢" ], [ "9e40", "𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺" ], [ "9ea1", "鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭" ], [ "9ead", "𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹" ], [ "9ec5", "㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲" ], [ "9ef5", "噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼" ], [ "9f40", "籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱" ], [ "9f4f", "凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰" ], [ "9fa1", "椬叚鰊鴂䰻陁榀傦畆𡝭駚剳" ], [ "9fae", "酙隁酜" ], [ "9fb2", "酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽" ], [ "9fc1", "𤤙盖鮝个𠳔莾衂" ], [ "9fc9", "届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳" ], [ "9fdb", "歒酼龥鮗頮颴骺麨麄煺笔" ], [ "9fe7", "毺蠘罸" ], [ "9feb", "嘠𪙊蹷齓" ], [ "9ff0", "跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇" ], [ "a040", "𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷" ], [ "a055", "𡠻𦸅" ], [ "a058", "詾𢔛" ], [ "a05b", "惽癧髗鵄鍮鮏蟵" ], [ "a063", "蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽" ], [ "a073", "坟慯抦戹拎㩜懢厪𣏵捤栂㗒" ], [ "a0a1", "嵗𨯂迚𨸹" ], [ "a0a6", "僙𡵆礆匲阸𠼻䁥" ], [ "a0ae", "矾" ], [ "a0b0", "糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦" ], [ "a0d4", "覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷" ], [ "a0e2", "罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫" ], [ "a3c0", "␀", 31, "␡" ], [ "c6a1", "①", 9, "⑴", 9, "ⅰ", 9, "丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ", 23 ], [ "c740", "す", 58, "ァアィイ" ], [ "c7a1", "ゥ", 81, "А", 5, "ЁЖ", 4 ], [ "c840", "Л", 26, "ёж", 25, "⇧↸↹㇏𠃌乚𠂊刂䒑" ], [ "c8a1", "龰冈龱𧘇" ], [ "c8cd", "¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣" ], [ "c8f5", "ʃɐɛɔɵœøŋʊɪ" ], [ "f9fe", "■" ], [ "fa40", "𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸" ], [ "faa1", "鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍" ], [ "fb40", "𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙" ], [ "fba1", "𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂" ], [ "fc40", "廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷" ], [ "fca1", "𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝" ], [ "fd40", "𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀" ], [ "fda1", "𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎" ], [ "fe40", "鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌" ], [ "fea1", "𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔" ] ]; var av, L6; function XV() { return L6 || (L6 = 1, av = { // == Japanese/ShiftJIS ==================================================== // All japanese encodings are based on JIS X set of standards: // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. // Has several variations in 1978, 1983, 1990 and 1997. // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. // 2 planes, first is superset of 0208, second - revised 0212. // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) // Byte encodings are: // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. // 0x00-0x7F - lower part of 0201 // 0x8E, 0xA1-0xDF - upper part of 0201 // (0xA1-0xFE)x2 - 0208 plane (94x94). // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. // Used as-is in ISO2022 family. // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, // 0201-1976 Roman, 0208-1978, 0208-1983. // * ISO2022-JP-1: Adds esc seq for 0212-1990. // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. // // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. // // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html shiftjis: { type: "_dbcs", table: function() { return zV; }, encodeAdd: { "¥": 92, "‾": 126 }, encodeSkipVals: [{ from: 60736, to: 63808 }] }, csshiftjis: "shiftjis", mskanji: "shiftjis", sjis: "shiftjis", windows31j: "shiftjis", ms31j: "shiftjis", xsjis: "shiftjis", windows932: "shiftjis", ms932: "shiftjis", 932: "shiftjis", cp932: "shiftjis", eucjp: { type: "_dbcs", table: function() { return HV; }, encodeAdd: { "¥": 92, "‾": 126 } }, // TODO: KDDI extension to Shift_JIS // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. // == Chinese/GBK ========================================================== // http://en.wikipedia.org/wiki/GBK // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 gb2312: "cp936", gb231280: "cp936", gb23121980: "cp936", csgb2312: "cp936", csiso58gb231280: "cp936", euccn: "cp936", // Microsoft's CP936 is a subset and approximation of GBK. windows936: "cp936", ms936: "cp936", 936: "cp936", cp936: { type: "_dbcs", table: function() { return ov; } }, // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. gbk: { type: "_dbcs", table: function() { return ov.concat(B6); } }, xgbk: "gbk", isoir58: "gbk", // GB18030 is an algorithmic extension of GBK. // Main source: https://www.w3.org/TR/encoding/#gbk-encoder // http://icu-project.org/docs/papers/gb18030.html // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 gb18030: { type: "_dbcs", table: function() { return ov.concat(B6); }, gb18030: function() { return VV; }, encodeSkipVals: [128], encodeAdd: { "€": 41699 } }, chinese: "gb18030", // == Korean =============================================================== // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. windows949: "cp949", ms949: "cp949", 949: "cp949", cp949: { type: "_dbcs", table: function() { return YV; } }, cseuckr: "cp949", csksc56011987: "cp949", euckr: "cp949", isoir149: "cp949", korean: "cp949", ksc56011987: "cp949", ksc56011989: "cp949", ksc5601: "cp949", // == Big5/Taiwan/Hong Kong ================================================ // There are lots of tables for Big5 and cp950. Please see the following links for history: // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html // Variations, in roughly number of defined chars: // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ // * Big5-2003 (Taiwan standard) almost superset of cp950. // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. // Plus, it has 4 combining sequences. // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. // Implementations are not consistent within browsers; sometimes labeled as just big5. // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt // // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. windows950: "cp950", ms950: "cp950", 950: "cp950", cp950: { type: "_dbcs", table: function() { return U6; } }, // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. big5: "big5hkscs", big5hkscs: { type: "_dbcs", table: function() { return U6.concat(JV); }, encodeSkipVals: [41676] }, cnbig5: "big5hkscs", csbig5: "big5hkscs", xxbig5: "big5hkscs" }), av; } var Q6; function ZV() { return Q6 || (Q6 = 1, (function(t) { for (var e = [ BV(), UV(), LV(), QV(), jV(), $V(), GV(), qV(), XV() ], n = 0; n < e.length; n++) { var r = e[n]; for (var i in r) Object.prototype.hasOwnProperty.call(r, i) && (t[i] = r[i]); } })(Zb)), Zb; } const eY = {}, tY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: eY }, Symbol.toStringTag, { value: "Module" })), j6 = /* @__PURE__ */ zD(tY); var $6; function nY() { return $6 || ($6 = 1, (function(t) { var e = Bc().Buffer, n = RV(), r = t.exports; r.encodings = null, r.defaultCharUnicode = "�", r.defaultCharSingleByte = "?", r.encode = function(s, c, u) { s = "" + (s || ""); var d = r.getEncoder(c, u), p = d.write(s), f = d.end(); return f && f.length > 0 ? e.concat([p, f]) : p; }, r.decode = function(s, c, u) { typeof s == "string" && (r.skipDecodeWarning || (console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"), r.skipDecodeWarning = !0), s = e.from("" + (s || ""), "binary")); var d = r.getDecoder(c, u), p = d.write(s), f = d.end(); return f ? p + f : p; }, r.encodingExists = function(s) { try { return r.getCodec(s), !0; } catch { return !1; } }, r.toEncoding = r.encode, r.fromEncoding = r.decode, r._codecDataCache = {}, r.getCodec = function(s) { r.encodings || (r.encodings = ZV()); for (var c = r._canonicalizeEncoding(s), u = {}; ; ) { var d = r._codecDataCache[c]; if (d) return d; var p = r.encodings[c]; switch (typeof p) { case "string": c = p; break; case "object": for (var f in p) u[f] = p[f]; u.encodingName || (u.encodingName = c), c = p.type; break; case "function": return u.encodingName || (u.encodingName = c), d = new p(u, r), r._codecDataCache[u.encodingName] = d, d; default: throw new Error("Encoding not recognized: '" + s + "' (searched as: '" + c + "')"); } } }, r._canonicalizeEncoding = function(a) { return ("" + a).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); }, r.getEncoder = function(s, c) { var u = r.getCodec(s), d = new u.encoder(c, u); return u.bomAware && c && c.addBOM && (d = new n.PrependBOM(d, c)), d; }, r.getDecoder = function(s, c) { var u = r.getCodec(s), d = new u.decoder(c, u); return u.bomAware && !(c && c.stripBOM === !1) && (d = new n.StripBOM(d, c)), d; }; var i = typeof process < "u" && process.versions && process.versions.node; if (i) { var o = i.split(".").map(Number); (o[0] > 0 || o[1] >= 10) && j6(r), j6(r); } })(Jb)), Jb.exports; } var sv, G6; function rY() { if (G6) return sv; G6 = 1; const t = FV(), e = mr, n = MV(), r = _i(); let i; const o = Symbol("ZipUncompressStream#yauzlCallback"), a = Symbol("ZipUncompressStream#stripName"), s = { lazyEntries: !0, decodeStrings: !1 }; function c(d) { const p = d.externalFileAttributes >> 16 || 33188; return [ 448, 56, 7 /* S_IRWXO */ ].map((f) => p & f).reduce( (f, m) => f + m, p & 61440 /* S_IFMT */ ); } class u extends n { constructor(p) { p = p || {}, super(p), this._chunks = [], this._strip = Number(p.strip) || 0, this._zipFileNameEncoding = p.zipFileNameEncoding || "utf8", this._zipFileNameEncoding === "utf-8" && (this._zipFileNameEncoding = "utf8"), this[o] = this[o].bind(this); const f = r.sourceType(p.source), m = this._yauzlOpts = Object.assign({}, s, p.yauzl); if (f === "file") { t.open(p.source, m, this[o]); return; } if (f === "buffer") { t.fromBuffer(p.source, m, this[o]); return; } if (f === "stream") { r.streamToBuffer(p.source).then((h) => t.fromBuffer(h, m, this[o])).catch((h) => this.emit("error", h)); return; } this.on("pipe", (h) => { h.unpipe(h), r.streamToBuffer(h).then((y) => { this._chunks.push(y), y = Buffer.concat(this._chunks), t.fromBuffer(y, m, this[o]); }).catch((y) => this.emit("error", y)); }); } _write(p) { this._chunks.push(p); } [o](p, f) { if (p) return this.emit("error", p); f.readEntry(), f.on("entry", (h) => { const y = c(h); Buffer.isBuffer(h.fileName) && (this._zipFileNameEncoding === "utf8" ? h.fileName = h.fileName.toString() : (i || (i = nY()), h.fileName = i.decode(h.fileName, this._zipFileNameEncoding))); const x = /[\\\/]$/.test(h.fileName) ? "directory" : "file", b = { name: h.fileName = this[a](h.fileName, x), type: x, yauzl: h, mode: y }; if (x === "file") f.openReadStream(h, (S, E) => { if (S) return this.emit("error", S); this.emit("entry", b, E, m); }); else { const S = new e.Readable({ read() { } }); this.emit("entry", b, S, m), setImmediate(() => S.emit("end")); } }).on("end", () => this.emit("finish")).on("error", (h) => this.emit("error", h)); function m() { f.readEntry(); } } [a](p, f) { return r.stripFileName(this._strip, p, f); } } return sv = u, sv; } var q6; function iY() { if (q6) return ua; q6 = 1; const t = _i(), e = NV(), n = PV(), r = rY(); return ua.Stream = e, ua.FileStream = n, ua.UncompressStream = r, ua.compressDir = t.makeCompressDirFn(e), ua.compressFile = t.makeFileProcessFn(n), ua.uncompress = t.makeUncompressFn(r), ua.decompress = t.makeUncompressFn(r), ua; } var Js = {}, cv = {}, z6; function A0() { if (z6) return cv; z6 = 1; var t = Pn, e = mr; cv.createReadStream = function(r, i) { return new n(r, i); }; var n = function(r, i) { r instanceof Buffer || typeof r == "string" ? (i = i || {}, e.Readable.call(this, { highWaterMark: i.highWaterMark, encoding: i.encoding })) : e.Readable.call(this, { objectMode: !0 }), this._object = r; }; return t.inherits(n, e.Readable), n.prototype._read = function() { this.push(this._object), this._object = null; }, cv; } var uv, H6; function oY() { if (H6) return uv; H6 = 1; const t = fe, e = ml, n = _i(), r = A0(); class i extends e.Gzip { constructor(a) { a = a || {}, super(a.zlib); const s = n.sourceType(a.source); if (s === "file") { const c = t.createReadStream(a.source, a.fs); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } if (s === "buffer") { const c = r.createReadStream(a.source, a.streamifier); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } s === "stream" && (a.source.on("error", (c) => this.emit("error", c)), a.source.pipe(this)); } } return uv = i, uv; } var lv, W6; function aY() { if (W6) return lv; W6 = 1; const t = fe, e = ml, n = _i(), r = A0(); class i extends e.Unzip { constructor(a) { a = a || {}, super(a.zlib); const s = n.sourceType(a.source); if (s === "file") { const c = t.createReadStream(a.source, a.fs); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } if (s === "buffer") { const c = r.createReadStream(a.source, a.streamifier); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } s === "stream" && (a.source.on("error", (c) => this.emit("error", c)), a.source.pipe(this)); } } return lv = i, lv; } var K6; function I0() { if (K6) return Js; K6 = 1; const t = _i(), e = oY(), n = aY(); return Js.FileStream = e, Js.UncompressStream = n, Js.compressFile = t.makeFileProcessFn(e), Js.uncompress = t.makeFileProcessFn(n), Js.decompress = t.makeFileProcessFn(n), Js; } var da = {}, dv, V6; function sY() { if (V6) return dv; V6 = 1; const t = fe, e = ve, n = mr, r = dE(), i = _i(), o = E0(); class a extends n.Transform { constructor(c) { super(c); const u = r.pack(); u.on("data", (p) => this.push(p)), u.on("end", () => this.ready(!0)); const d = i.sourceType(c.source); if (d === "file") t.stat(c.source, (p, f) => { if (p) return this.emit("error", p); this.entry = u.entry({ name: c.relativePath || e.basename(c.source), size: f.size, mode: f.mode & 511 }, (h) => { if (h) return this.emit("error", h); u.finalize(); }); const m = t.createReadStream(c.source, c.fs); m.on("error", (h) => this.emit("error", h)), m.pipe(this); }); else if (d === "buffer") { if (!c.relativePath) return this.emit("error", "opts.relativePath is required if opts.source is a buffer"); u.entry({ name: c.relativePath }, c.source), u.finalize(), this.end(); } else { if (!c.relativePath) return process.nextTick(() => this.emit("error", "opts.relativePath is required")); if (c.size) this.entry = u.entry({ name: c.relativePath, size: c.size }, (p) => { if (p) return this.emit("error", p); u.finalize(); }); else { c.suppressSizeWarning || console.warn("You should specify the size of streamming data by opts.size to prevent all streaming data from loading into memory. If you are sure about memory cost, pass opts.suppressSizeWarning: true to suppress this warning"); const p = []; this.entry = new n.Writable({ write(f, m, h) { p.push(f), h(); } }), this.entry.on("finish", () => { u.entry({ name: c.relativePath }, Buffer.concat(p)), u.finalize(); }); } d === "stream" && (c.source.on("error", (p) => this.emit("error", p)), c.source.pipe(this)); } } _transform(c, u, d) { this.entry && this.entry.write(c, u, d); } _flush(c) { this.entry && this.entry.end(), this.ready(c); } } return o.mixin(a.prototype), dv = a, dv; } var pv, Y6; function cY() { if (Y6) return pv; Y6 = 1; const t = fe, e = dE(), n = _i(), r = A0(); class i extends e.extract { constructor(a) { a = a || {}, super(a); const s = n.sourceType(a.source); if (s === "file") { const c = t.createReadStream(a.source, a.fs); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } if (s === "buffer") { const c = r.createReadStream(a.source, a.streamifier); c.on("error", (u) => this.emit("error", u)), c.pipe(this); return; } s === "stream" && (a.source.on("error", (c) => this.emit("error", c)), a.source.pipe(this)); } } return pv = i, pv; } var J6; function C0() { if (J6) return da; J6 = 1; const t = _i(), e = KF(), n = sY(), r = cY(); return da.Stream = e, da.FileStream = n, da.UncompressStream = r, da.compressDir = t.makeCompressDirFn(e), da.compressFile = t.makeFileProcessFn(n), da.uncompress = t.makeUncompressFn(r), da.decompress = t.makeUncompressFn(r), da; } var pa = {}, fv, X6; function uY() { if (X6) return fv; X6 = 1; const t = C0(), e = I0(), n = WF(); class r extends n { constructor(o) { super(o); const a = this._tarStream = new t.Stream(); a.on("error", (c) => this.emit("error", c)); const s = new e.FileStream(); s.on("end", () => this.push(null)), s.on("data", (c) => this.push(c)), s.on("error", (c) => this.emit("error", c)), a.pipe(s); } addEntry(o, a) { this._tarStream.addEntry(o, a); } } return fv = r, fv; } var hv, Z6; function lY() { if (Z6) return hv; Z6 = 1; const t = C0(), e = I0(), n = _i(), r = mr, i = AF(), o = E0(); class a extends r.Transform { constructor(c) { c = c || {}, super(c); const u = this._sourceType = n.sourceType(c.source), d = this._tarStream = new t.FileStream(c); c = n.clone(c), delete c.source; const p = new e.FileStream(c); p.on("data", (f) => { this.push(f); }), p.on("end", () => this.ready(!0)), i(d, p, (f) => { f && this.emit("error", f); }), u !== "stream" && u !== void 0 && this.end(); } _transform(c, u, d) { this._tarStream.write(c, u, d); } _flush(c) { (this._sourceType === "stream" || this._sourceType === void 0) && this._tarStream.end(), this.ready(c); } } return o.mixin(a.prototype), hv = a, hv; } var mv, eT; function dY() { if (eT) return mv; eT = 1; var t = Qa.EventEmitter, e = mr.Writable, n = Pn; function r(i) { e.call(this, i); } return n.inherits(r, e), r.prototype.emit = function(i) { if (i === "finish" && this._flush && !e.prototype._flush) this._flush(function(a) { a ? t.prototype.emit.call(this, "error", a) : t.prototype.emit.call(this, "finish"); }.bind(this)); else { var o = Array.prototype.slice.call(arguments); t.prototype.emit.apply(this, o); } }, mv = r, mv; } var gv, tT; function pY() { if (tT) return gv; tT = 1; const t = fe, e = _i(), n = E0(), r = A0(), i = dY(), o = I0().UncompressStream, a = C0().UncompressStream; class s extends i { constructor(u) { u = u || {}, super(u); const d = e.clone(u); d.source = void 0, this._gzipStream = new o(d).on("error", (m) => this.emit("error", m)); const p = new a(d).on("finish", () => this.ready(!0)).on("entry", this.emit.bind(this, "entry")).on("error", (m) => this.emit("error", m)); this._gzipStream.pipe(p); const f = e.sourceType(u.source); if (f === "file") { const m = t.createReadStream(u.source, u.fs); m.on("error", (h) => this.emit("error", h)), m.pipe(this); return; } if (f === "buffer") { const m = r.createReadStream(u.source, u.streamifier); m.on("error", (h) => this.emit("error", h)), m.pipe(this); return; } f === "stream" && (u.source.on("error", (m) => this.emit("error", m)), u.source.pipe(this)); } _write(u, d, p) { this._gzipStream.write(u, d, p); } _flush(u) { this._gzipStream.end(), this.ready(u); } } return n.mixin(s.prototype), gv = s, gv; } var nT; function fY() { if (nT) return pa; nT = 1; const t = _i(), e = uY(), n = lY(), r = pY(); return pa.Stream = e, pa.FileStream = n, pa.UncompressStream = r, pa.compressDir = t.makeCompressDirFn(e), pa.compressFile = t.makeFileProcessFn(n), pa.uncompress = t.makeUncompressFn(r), pa.decompress = t.makeUncompressFn(r), pa; } var rT; function hY() { return rT || (rT = 1, nu.zip = iY(), nu.gzip = I0(), nu.tar = C0(), nu.tgz = fY()), nu; } var VF = hY(); const bl = /* @__PURE__ */ ra(VF), fa = "https://github.com/NapNeko/ffmpeg-build/releases/download/v1.0.0/ffmpeg-7.1.1-win64.zip", mY = [ "https://j.1win.ggff.net/" + fa, "https://git.yylx.win/" + fa, "https://ghfile.geekertao.top/" + fa, "https://gh-proxy.net/" + fa, "https://ghm.078465.xyz/" + fa, "https://gitproxy.127731.xyz/" + fa, "https://jiashu.1win.eu.org/" + fa, "https://github.tbedu.top/" + fa, fa ]; async function gY(t) { return new Promise((e) => { const n = P2.get(t, { timeout: 5e3 }, (r) => { const i = r.statusCode || 0; i >= 200 && i < 300 ? (n.destroy(), e(!0)) : (n.destroy(), e(!1)); }); n.on("error", () => { e(!1); }), n.on("timeout", () => { n.destroy(), e(!1); }); }); } async function yY() { for (const t of mY) try { if (await gY(t)) return t; } catch { } return null; } async function bY(t, e, n) { return new Promise((r) => { const i = Ie.createWriteStream(e); P2.get(t, (a) => { const s = a.statusCode || 0; if (s >= 200 && s < 300) { const c = parseInt(a.headers["content-length"] || "0", 10); let u = 0, d = -1, p = 0; c > 0 && n && (n(0), p = Date.now(), a.on("data", (f) => { u += f.length; const m = Math.floor(u / c * 100), h = Date.now(); m !== d && (m - d >= 1 || m === 100) && (h - p >= 1e3 || m === 100) && (n(m), d = m, p = h); })), F2(a, i).then(() => { n && d !== 100 && n(100), r(!0); }).catch(() => r(!1)); } else i.close(), Ie.unlink(e, () => { }), r(!1); }).on("error", () => { i.close(), Ie.unlink(e, () => { }), r(!1); }); }); } async function vY(t, e) { Ie.existsSync(e) || Ie.mkdirSync(e, { recursive: !0 }); const n = new VF.zip.UncompressStream({ source: t }); return new Promise((r, i) => { n.on("entry", (o, a, s) => { const c = o.name; if (c.includes("/bin/") && c.endsWith(".exe")) { const u = nt.basename(c), d = nt.join(e, u), p = Ie.createWriteStream(d); a.pipe(p), p.on("finish", () => { s(); }), p.on("error", () => { s(); }); } else a.resume(), s(); }), n.on("error", (o) => { i(o); }), n.on("finish", () => { r(); }); }); } async function xY(t, e, n) { if (gs.platform() !== "win32") return null; const r = t || nt.join(gs.tmpdir(), "ffmpeg"), i = e || gs.tmpdir(), o = nt.join(i, "ffmpeg.zip"), a = nt.join(r, "ffmpeg.exe"); if (Ie.existsSync(r) || Ie.mkdirSync(r, { recursive: !0 }), Ie.existsSync(i) || Ie.mkdirSync(i, { recursive: !0 }), Ie.existsSync(a)) return n && n(100, "已找到FFmpeg"), a; n && n(0, "查找可用下载源"); const s = await yY(); if (!s || (n && n(5, "开始下载FFmpeg"), !await bY( s, o, (u) => { n && n(5 + Math.floor(u * 0.7), "下载FFmpeg"); } ))) return null; try { n && n(75, "解压FFmpeg"), await vY(o, r), n && n(95, "清理临时文件"); try { Ie.unlinkSync(o); } catch { } return Ie.existsSync(a) ? (n && n(100, "FFmpeg安装完成"), a) : null; } catch { return null; } } function iT(t) { if (gs.platform() !== "win32") return null; const n = (process.env.PATH || "").split(";"); for (const r of n) if (r) try { const i = nt.join(r, t); if (Ie.existsSync(i)) return i; } catch { continue; } return null; } async function wY(t) { if (gs.platform() !== "win32") return { path: null, reset: !1 }; const e = iT("ffmpeg.exe"), n = iT("ffprobe.exe"); if (e && n) return { path: nt.dirname(e), reset: !0 }; const r = nt.dirname(Mc(import.meta.url)), i = Ie.existsSync(nt.join(r, "ffmpeg", "ffmpeg.exe")), o = Ie.existsSync(nt.join(r, "ffmpeg", "ffprobe.exe")); return !i || !o ? await xY(nt.join(r, "ffmpeg"), nt.join(r, "cache"), (s, c) => { t.log(`[FFmpeg] [Download] ${s}% - ${c}`); }) ? { path: nt.join(r, "ffmpeg"), reset: !0 } : (t.log("[FFmpeg] [Error] 下载FFmpeg失败"), { path: null, reset: !1 }) : { path: nt.join(r, "ffmpeg"), reset: !0 }; } const iu = d7(u7); function yv(t) { const e = fl(t); xu(e) || ML(e, { recursive: !0 }); } class DS { constructor(e = "ffmpeg", n = "ffprobe", r, i) { this.ffmpegPath = e, this.ffprobePath = n, this.binaryPath = r, this.logger = i; } name = "FFmpegExec"; downloadAttempted = !1; /** * 检查 FFmpeg 是否可用,如果不可用则尝试下载 */ async isAvailable() { try { return await iu(this.ffmpegPath, ["-version"]), !0; } catch { if (!this.downloadAttempted && this.binaryPath && this.logger) { if (this.downloadAttempted = !0, process.env.NAPCAT_DISABLE_FFMPEG_DOWNLOAD) return !1; this.logger.log("[FFmpeg] 未找到可用的 FFmpeg,尝试自动下载..."); const e = await wY(this.logger); if (e.path && e.reset && process.platform === "win32") { this.ffmpegPath = qm(e.path, "ffmpeg.exe"), this.ffprobePath = qm(e.path, "ffprobe.exe"), this.logger.log("[FFmpeg] 已更新路径:", this.ffmpegPath); try { return await iu(this.ffmpegPath, ["-version"]), !0; } catch { return !1; } } } return !1; } } /** * 设置 FFmpeg 路径 */ setFFmpegPath(e) { this.ffmpegPath = e; } /** * 设置 FFprobe 路径 */ setFFprobePath(e) { this.ffprobePath = e; } /** * 获取视频信息 */ async getVideoInfo(e) { const [n, r] = await Promise.all([ Jp(e).catch(() => null), this.getDuration(e).catch(() => 60) ]), i = `${e}.thumbnail.bmp`; let o = 100, a = 100, s; try { await this.extractThumbnail(e, i); const c = await v0(i); o = c.width ?? 100, a = c.height ?? 100, xu(i) && (s = PL(i)); } catch { } return { width: o, height: a, duration: r, format: n?.ext ?? "mp4", thumbnail: s }; } /** * 获取时长 */ async getDuration(e) { const { stdout: n } = await iu(this.ffprobePath, [ "-v", "error", "-show_entries", "format=duration", "-of", "default=noprint_wrappers=1:nokey=1", e ]), r = parseFloat(n.trim()); if (isNaN(r)) throw new Error(`ffprobe 返回了无效的时长值: "${n.trim()}"`); return r; } /** * 判断是否为 Silk 格式 */ async isSilk(e) { try { const n = DL(e, "r"), r = Buffer.alloc(10); OL(n, r, 0, 10, 0), FL(n); const i = r.toString(); return i.includes("#!SILK") || i.includes("#!SILK"); } catch { return !1; } } /** * 转换为 PCM */ async convertToPCM(e, n) { try { if (yv(n), await iu(this.ffmpegPath, [ "-y", "-i", e, "-ar", "24000", "-ac", "1", "-f", "s16le", n ]), !xu(n)) throw new Error("转换PCM失败,输出文件不存在"); return { result: !0, sampleRate: 24e3 }; } catch (r) { throw new Error(`FFmpeg处理转换出错: ${r.message}`); } } /** * 转换文件 */ async convertFile(e, n, r) { try { yv(n); const i = r === "amr" ? [ "-f", "s16le", "-ar", "24000", "-ac", "1", "-i", e, "-ar", "8000", "-b:a", "12.2k", "-y", n ] : [ "-f", "s16le", "-ar", "24000", "-ac", "1", "-i", e, "-y", n ]; if (await iu(this.ffmpegPath, i), !xu(n)) throw new Error("转换失败,输出文件不存在"); } catch (i) { throw console.error("Error converting file:", i), new Error(`文件转换失败: ${i.message}`); } } /** * 提取缩略图 */ async extractThumbnail(e, n) { try { yv(n); const { stderr: r } = await iu(this.ffmpegPath, [ "-i", e, "-ss", "00:00:01.000", "-vframes", "1", "-y", // 覆盖输出文件 n ]); if (!xu(n)) throw new Error(`提取缩略图失败,输出文件不存在: ${r}`); } catch (r) { throw console.error("Error extracting thumbnail:", r), new Error(`提取缩略图失败: ${r.message}`); } } async convertToNTSilkTct(e, n) { throw new Error("convertToNTSilkTct is not implemented in FFmpegExecAdapter"); } } class oT { static instance = null; static initPromise = null; /** * 初始化并获取最佳的 FFmpeg 适配器 * @param logger 日志记录器 * @param ffmpegPath FFmpeg 可执行文件路径(用于 Exec 适配器) * @param ffprobePath FFprobe 可执行文件路径(用于 Exec 适配器) * @param binaryPath 二进制文件路径(来自 pathWrapper.binaryPath,用于 Addon 适配器) */ static async getAdapter(e, n = "ffmpeg", r = "ffprobe", i) { if (this.instance) return this.instance; if (this.initPromise) return this.initPromise; this.initPromise = this.initialize(e, n, r, i); try { return this.instance = await this.initPromise, this.instance; } finally { this.initPromise = null; } } /** * 初始化适配器 */ static async initialize(e, n, r, i) { if (i) { const a = new kK(i); if (e.log("[FFmpeg] 检查 Native Addon 可用性..."), await a.isAvailable()) return e.log("[FFmpeg] ✓ 使用 Native Addon 适配器"), a; e.log("[FFmpeg] Native Addon 不可用,尝试使用命令行工具"); } else e.log("[FFmpeg] 未提供 binaryPath,跳过 Native Addon 检测"); const o = new DS(n, r, i, e); return e.log(`[FFmpeg] 检查命令行工具可用性: ${n}`), await o.isAvailable() ? (e.log("[FFmpeg] 使用命令行工具适配器 ✓"), o) : (e.logError("[FFmpeg] 警告: FFmpeg 不可用,将使用命令行适配器但可能失败"), o); } /** * 重置适配器(用于测试或重新初始化) */ static reset() { this.instance = null, this.initPromise = null; } /** * 更新 FFmpeg 路径并重新初始化 * @param logger 日志记录器 * @param ffmpegPath FFmpeg 可执行文件路径 * @param ffprobePath FFprobe 可执行文件路径 */ static async updateFFmpegPath(e, n, r) { this.instance && this.instance instanceof DS && (e.log(`[FFmpeg] 更新 FFmpeg 路径: ${n}`), this.instance.setFFmpegPath(n), this.instance.setFFprobePath(r), await this.instance.isAvailable() ? e.log("[FFmpeg] 新路径验证成功 ✓") : e.logError("[FFmpeg] 警告: 新 FFmpeg 路径不可用")); } /** * 获取当前适配器(不初始化) */ static getCurrentAdapter() { return this.instance; } } const aT = (t, e) => { if (process.platform === "win32" && e) { const n = `${t}.exe`, r = ve.join(e, "ffmpeg", n); return xu(r) ? r : n; } return t; }; let ou = "ffmpeg", au = "ffprobe"; class uo { static adapter = null; static initialized = !1; /** * 初始化 FFmpeg 服务 * @param binaryPath 二进制文件路径(来自 pathWrapper.binaryPath) * @param logger 日志记录器 */ static async init(e, n) { this.initialized || (ou = aT("ffmpeg", e), au = aT("ffprobe", e), this.adapter = await oT.getAdapter( n, ou, au, e ), this.initialized = !0); } static getAdapterName() { if (!this.adapter) throw new Error("FFmpeg service not initialized. Please call FFmpegService.init() first."); return this.adapter.name; } /** * 获取 FFmpeg 适配器 */ static async getAdapter() { if (!this.adapter) throw new Error("FFmpeg service not initialized. Please call FFmpegService.init() first."); return this.adapter; } static async convertToNTSilkTct(e, n) { await (await this.getAdapter()).convertToNTSilkTct(e, n); } /** * 设置 FFmpeg 路径并更新适配器 * @deprecated 建议使用 init() 方法初始化 */ static async setFfmpegPath(e, n) { AD() === "win32" && (ou = ve.join(e, "ffmpeg.exe"), au = ve.join(e, "ffprobe.exe"), n.log("[Check] ffmpeg:", ou), n.log("[Check] ffprobe:", au), await oT.updateFFmpegPath(n, ou, au)); } /** * 提取视频缩略图 */ static async extractThumbnail(e, n) { await (await this.getAdapter()).extractThumbnail(e, n); } /** * 直接发送到 QQ kernel 的旧视频元素使用 PNG 缩略图。 * Packet/forward 路径继续使用当前适配器生成的 JPEG。 */ static async extractLegacyVideoThumbnail(e, n) { await new DS(ou, au).extractThumbnail(e, n); } /** * 转换音频文件 */ static async convertAudioFmt(e, n, r) { await (await this.getAdapter()).convertFile(e, n, r); } /** * 获取音频时长 */ static async getDuration(e) { return (await this.getAdapter()).getDuration(e); } /** * 判断是否为 Silk 格式 */ static async isSilk(e) { return (await this.getAdapter()).isSilk(e); } /** * 转换为 PCM 格式 */ static async convert(e, n) { return (await this.getAdapter()).convertToPCM(e, n); } /** * 获取视频信息 */ static async getVideoInfo(e, n) { const r = await this.getAdapter(); try { const i = P3(e).size, o = await r.getVideoInfo(e); return n && o.thumbnail && RL(n, o.thumbnail), { width: o.width, height: o.height, time: o.duration, format: o.format, size: i, filePath: e }; } catch { const o = await Jp(e).catch(() => null), a = P3(e).size; return { width: 100, height: 100, time: 60, format: o?.ext ?? "mp4", size: a, filePath: e }; } } } const YF = "/9j/4AAQSkZJRgABAQAAAQABAAD//gAXR2VuZXJhdGVkIGJ5IFNuaXBhc3Rl/9sAhAAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47AQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAF/APADAREAAhEBAxEB/8QBogAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoLEAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+foBAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKCxEAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDiAayNxwagBwNAC5oAM0xBmgBM0ANJoAjY0AQsaBkTGgCM0DEpAFAC0AFMBaACgAoEJTASgQlACUwCgQ4UAOFADhQA4UAOFADxQIkBqDQUGgBwagBQaBC5pgGaAELUAMLUARs1AETGgBhNAxhoASkAUALQIKYxaBBQAUwEoAQ0CEoASmAUAOoEKKAHCgBwoAeKAHigQ7NZmoZpgLmgBd1Ahd1ABupgNLUAMLUAMY0AMJoAYaAENACUCCgAoAWgAoAWgBKYCUAJQISgApgLQAooEOFACigB4oAeKBDxQAVmaiZpgGaAFzQAbqAE3UAIWpgNJoAYTQIaaAEoAQ0CEoASgBaACgBaACmAUAJQAlAgoAKYC0AKKBCigB4FADgKBDwKAHigBuazNRM0DEzTAM0AJmgAzQAhNAhpNACGmA2gQlACUCEoAKACgBaAFpgFACUAJQAUCCmAUALQIcBQA4CgB4FADgKBDhQA4UAMzWZqNzTGJQAZoATNABmgBKAEoEIaYCUCEoASgQlABQAtABQAtMBKACgAoEFABimAYoEKBQA4CgB4FADwKBDgKAFFADhQBCazNhKAEpgFACUAFACUAFAhDTAbQISgAoEJQAUALQAtMAoAKADFABigQYoAMUALimIUCgBwFAh4FADgKAHUALQAtAENZmwlACUwEoAKAEoAKACgQlMBpoEJQAUCCgBcUAFABTAXFAC4oAMUAGKBBigAxQIKYCigQ8UAOFADhQAtAC0ALQBDWZqJQMSgBKYBQAlABQISgBKYCGgQlAC0CCgBcUAFABTAUCkA7FMAxQAYoEJQAUCCmAooEOFADxQA4UAFAC0ALQBDWZqJQAlACUxhQAlABQIKAEoASmISgBcUCCgBaACgBcUAKBQAuKYC0CEoAQ0AJQISmAooEPFADhQA4UALQAtAC0AQ1maiUAFACUAJTAKAEoAKAEoAMUxBigAxQIWgAoAKAFAoAWgBaYBQIQ0ANNACUCCmIUUAOFADxQA4UALQAtABQBFWZqFACUAFACYpgFACUAFACUAFAgxTEFABQAUALQAooAWgAoAKYDTQIaaAEpiCgQ4UAOFAh4oGOFAC0ALSAKYEdZmglABQAUDDFACUwEoASgAoAKBBQIKYBQAUALQAtAC0AJQAhpgNJoENJoATNMQCgQ8UCHigB4oAWgYtABQAUAMrM0CgAoAKADFACUxiUAJQAlAgoAKYgoAKACgYtAC0AFAhDTAQmgBhNAhpNACZpiFBoEPFAEi0CHigB1ABQAUDEoAbWZoFABQAtABTAQ0ANNAxDQAlAhaAEpiCgAoGFAC0AFABmgBCaYhpNADCaBDSaBBmgABpiJFNAEimgB4NADqAFzQAlACE0AJWZoFAC0AFAC0wEIoAaaAG0AJQAUCCgApjCgAoAKADNABmgBpNMQ0mgBpNAhhNAgzQAoNADwaAHqaAJAaBDgaYC5oATNACZoAWszQKACgBaBDqYCGgBpoAYaBiUCCgBKYBQMKACgAoAM0AITQIaTQA0mmA0mgQ3NAhKAHCgBwNADwaAHg0AOBpiFzQAZoATNAD6zNAoAKAFoEOpgBoAaaAGGmAw0AJmgAzQMM0AGaADNABmgBM0AITQIaTQAhNMQw0AJQIKAFFADhQA4GgBwNADs0xC5oAM0CDNAEtZmoUCCgBaAHUwCgBppgRtQAw0ANzQAZoAM0AGaADNABmgBKAEoAQ0ANNMQhoEJQAlMBaQDgaAFBoAcDTAdmgQuaADNAgzQBPWZqFAgoAWgBaYC0CGmmBG1AyM0ANJoATNACZoAXNABmgAzQAUAJQAhoAQ0xDTQISmAUALQAUgHA0AKDTAdmgQuaBBQAtAFiszQKACgBaAFFMAoEIaYEbUDI2oAYaAEoASgAzQAuaACgAoAKAENMQ00AJTEFAhKACgAoAXNACg0AOBoAWgQtAC0AWazNAoAKACgBaYBQIQ0AMNMYw0AMIoAbQAlMAoAKACgAzSAKYhKAENACUxBQIKACgBKACgBaAHCgQ4UALQAUAWqzNAoAKACgApgFACGgQ00xjTQAwigBCKAG4pgJQAlABQAUCCgBKACgBKYgoEFABQISgAoAWgBRQA4UALQAUCLdZmoUAFABQAlMAoASgBDQA00wENACYoATFMBpFADSKAEoEJQAUAFABQAlMQtAgoASgQUAJQAUAKKAHCgBaBBQBbrM1CgAoAKACmAUAJQAlADaYBQAlACYpgIRQA0igBpFAhtABQAUAFMAoEFABQIKAEoASgQUALQAooAWgQUAW81mbC0CCgApgFACUAIaAEpgJQAUAFABQAhFMBpFADSKAGkUCExQAYoAMUAGKADFMQYoAMUCExSATFABQIKYBQAtABQIt5qDYM0ALmgQtIApgIaAENADaACmAlAC0ALQAUwGkUANIoAaRQAmKBBigAxQAYoAMUAGKBBigBMUAJigQmKAExTAKBC0AFAFnNQaig0AKDQAtAgoASgBDQAlMBKACgAFADhQAtMBCKAGkUAIRQAmKADFABigQmKADFACYoAXFABigQmKAExQAmKBCYpgJigAoAnzUGgZoAcDQAuaBC0AJQAhoASmAlABQAtADhQAtMAoATFACEUAJigAxQAYoATFAhMUAFABQAuKADFABigBpWgBCKBCYpgJigB+ag0DNADgaBDgaAFzQITNACUAJTAKACgBRQAopgOoAWgBKAEoAKACgAoASgBpoEJQAooAWgBaBhigBMUCEIoAQigBMUAJSLCgBQaBDgaQC5oEFACUwCgBKACmAtADhQA4UALQAUAJQAUAJQAUAJQAhoENoAWgBRQAooGLQAUAGKAGkUAIRQIZSKEoGKKBDhQAUCCgAoAKBBQAUwFoGKKAHCgBaACgAoASgAoASgBCaAEoEJmgAoAUGgBQaAHZoGFABQAUANoAjpDEoAWgBaAFoEFACUALQAUCCmAUAOFAxRQAtAC0AJQAUAJQAmaBDSaAEzQAmaYBmgBQaAHA0gFzQAuaBhmgAzQAlAEdIYUALQAtAgoAKAEoEFAC0AFMAoAUUDFFAC0ALQAUAJQAhoENNACE0wEoATNABmgBc0ALmgBc0gDNAC5oATNABmgBKRQlACigB1AgoASgQlABTAWgBKACgBaBi0ALQAZoAM0AFACGgQ00wENACUAJQAUCFzQMM0ALmgAzQAZoAM0AGaQC0igoAUUALQIWgBDQISmAUAFACUAFABQAuaBi5oAM0AGaBBmgBKAEpgIaAG0AJQAUCFoAM0DDNAC5oATNABmgAzQBJUlBQAooAWgQtACGmIaaACgAoASgBKACgBc0DCgQUAGaADNABTASgBDQAlACUAFAgoAKBhQAUAFABQAlAE1SUFAxRQIWgQtMBDQIQ0AJQAlAhKBiUAFABmgBc0AGaADNABTAKACgBKAEoASgQlABQAUAFAC0AFACUAFAE1SaBQAUCHCgQtMBKBCUAJQISgBDQA00DEzQAuaADNMBc0AGaADNABQAUAJQAlABQISgAoAKACgBaACgBKAEoAnqTQSgBRQIcKBC0xCUAJQISgBKAENADDQAmaYwzQAuaADNAC0AFABQAUAFAhKACgBKACgAoAWgAoELQAlAxKAJqk0EoAWgQooELTEFADaBCUABoENNMY00ANNAwzQAZoAXNAC0AFAC0CFoASgAoASgBKACgAoAWgQtABQAUANNAyWpNAoAKBCimIWgQUCEoASmIQ0ANNADTQMaaAEoGLmgAzQAtADhQIWgBaACgQhoASgYlACUALQIWgBaACgBKAENAyWpNBKYBQIcKBC0CEoEJTAKBCUANNADDQMQ0ANoGFAC5oAUGgBwNAhRQIWgBaAENACGgBtAwoAKAFzQIXNABmgAoAQ0DJKRoJQAtAhRQSLQIKYCUCCgBDQA00AMNAxpoGNoAM0AGaAFBoAcDQIcKBDqACgBDQAhoAQ0DEoAKADNAC5oEGaBhmgAoAkpGgUCCgQooELQIKYhKACgBKAGmgBpoGMNAxDQAlAwzQIUUAOFAhwoAcKBC0AJQAhoGNNACUAFABQAZoAXNABQAUAS0ixKACgQoNAhaYgoEFACUABoAaaAGmgYw0DENAxtABQAooEOFADhQIcKAFoASgBDQAhoGJQAUAFACUALQIKBi0CJDSLEoATNAhc0CHZpiCgQUAJQIKBjTQAhoGNNAxpoATFABigBQKAHCgBwoAWgAoAKACgBKAEoASgAoASgBaAAUAOoEONIoaTQAZoAUGmIUGgQtAgzQISgAoAQ0DGmgYlAxKACgAxQAtACigBRQAtAxaACgAoATFABigBCKAG0CEoAWgBRTAUUAf//Z", Mn = 1024 * 1024, sT = 1024 * 1024; class SY { napcore; client; sig; logger; hwClient; cachedPrepareReq = null; constructor(e, n, r) { this.napcore = e, this.client = r, this.sig = { uin: String(this.napcore.basicInfo.uin), uid: this.napcore.basicInfo.uid, sigSession: null, sessionKey: null, serverAddr: [] }, this.logger = n, this.hwClient = new EW(this.sig, this.logger); } async checkAvailable() { (this.sig.sigSession === null || this.sig.sessionKey === null) && (this.cachedPrepareReq === null && (this.cachedPrepareReq = this.prepareUpload().finally(() => { this.cachedPrepareReq = null; })), await this.cachedPrepareReq); } async prepareUpload() { this.logger.debug("[Highway] on prepareUpload!"); const e = h4.build(), n = await this.client.sendOidbPacket(e, !0), r = h4.parse(n); this.sig.sigSession = r.httpConn.sigSession, this.sig.sessionKey = r.httpConn.sessionKey; for (const i of r.httpConn.serverInfos) if (i.serviceType === 1) for (const o of i.serverAddrs) this.logger.debug(`[Highway PrepareUpload] server addr add: ${Nm(o.ip)}:${o.port}`), this.sig.serverAddr.push({ ip: Nm(o.ip), port: o.port }), this.hwClient.changeServer(Nm(o.ip), o.port); this.sig.serverAddr.length === 0 && this.logger.warn("[Highway PrepareUpload] server addr is empty!"); } async uploadImage(e, n) { if (await this.checkAvailable(), e.chatType === ke.KCHATTYPEGROUP) await this.uploadGroupImage(+e.peerUid, n); else if (e.chatType === ke.KCHATTYPEC2C) await this.uploadC2CImage(e.peerUid, n); else throw new Error(`[Highway] unsupported chatType: ${e.chatType}`); } async uploadVideo(e, n) { if (await this.checkAvailable(), +(n.fileSize ?? 0) > 1024 * 1024 * 100) throw new Error(`[Highway] 视频文件过大: ${(+(n.fileSize ?? 0) / (1024 * 1024)).toFixed(2)} MB > 100 MB,请使用文件上传!`); const r = []; try { let i = !1; if (n.thumbPath) try { await fe.promises.access(n.thumbPath, fe.constants.F_OK), i = !0; } catch { i = !1; } let o = !n.thumbPath || !i; if (!o) try { await this.updateVideoThumbInfo(n), (n.thumbSize ?? 0) > sT && (this.logger.warn(`[Highway] Video thumbnail is too large: ${n.thumbSize} bytes, regenerating`), o = !0); } catch (a) { this.logger.warn(`[Highway] Failed to inspect video thumbnail, regenerating. Reason: ${a instanceof Error ? a.message : a}`), o = !0; } if (o && r.push(await this.ensureVideoThumb(n)), n.businessType = e.chatType === ke.KCHATTYPEGROUP ? 21 : 11, e.chatType === ke.KCHATTYPEGROUP) await this.uploadGroupVideo(+e.peerUid, n); else if (e.chatType === ke.KCHATTYPEC2C) await this.uploadC2CVideo(e.peerUid, n); else throw new Error(`[Highway] unsupported chatType: ${e.chatType}`); } finally { await Promise.allSettled(r.map(async (i) => { try { await fe.promises.unlink(i), this.logger.debug(`[Highway] Cleaned up temp thumbnail: ${i}`); } catch (o) { o.code !== "ENOENT" && this.logger.warn(`[Highway] Failed to clean up temp thumbnail: ${i}, reason: ${o instanceof Error ? o.message : o}`); } })); } } /** * 使用当前 FFmpeg 适配器生成符合 QQ 大小限制的视频缩略图 * @returns 生成的临时缩略图路径,用于后续清理 */ async ensureVideoThumb(e) { if (!e.filePath) throw new Error("video.filePath is empty, cannot generate thumbnail"); const n = ve.dirname(e.filePath), r = ve.basename(e.filePath, ve.extname(e.filePath)), i = ve.join(n, `${r}_thumb_${ND()}.jpg`); this.logger.debug(`[Highway] Video thumb missing, generating at: ${i}`), e.thumbPath = i; try { await uo.extractThumbnail(e.filePath, i); try { await fe.promises.access(i, fe.constants.F_OK), this.logger.debug("[Highway] Video thumbnail generated successfully using FFmpeg"); } catch { throw new Error("FFmpeg failed to generate thumbnail"); } if (await this.updateVideoThumbInfo(e), (e.thumbSize ?? 0) > sT) throw new Error(`generated thumbnail is too large: ${e.thumbSize} bytes`); } catch (o) { this.logger.warn(`[Highway] Failed to extract thumbnail, using default. Reason: ${o instanceof Error ? o.message : o}`), await fe.promises.writeFile(i, Buffer.from(YF, "base64")), await this.updateVideoThumbInfo(e); } return i; } async updateVideoThumbInfo(e) { if (!e.thumbPath) throw new Error("video.thumbPath is empty, cannot inspect thumbnail"); const [n, r, i] = await Promise.all([ fe.promises.stat(e.thumbPath), h0(e.thumbPath), v0(e.thumbPath) ]); e.thumbSize = n.size, e.thumbMd5 = r, e.thumbWidth = i.width, e.thumbHeight = i.height, this.logger.debug(`[Highway] Video thumbnail ready: ${i.width}x${i.height}, ${n.size} bytes`); } async uploadPtt(e, n) { if (await this.checkAvailable(), e.chatType === ke.KCHATTYPEGROUP) await this.uploadGroupPtt(+e.peerUid, n); else if (e.chatType === ke.KCHATTYPEC2C) await this.uploadC2CPtt(e.peerUid, n); else throw new Error(`[Highway] unsupported chatType: ${e.chatType}`); } async uploadFile(e, n) { if (await this.checkAvailable(), e.chatType === ke.KCHATTYPEGROUP) await this.uploadGroupFile(+e.peerUid, n); else if (e.chatType === ke.KCHATTYPEC2C) await this.uploadC2CFile(e.peerUid, n); else throw new Error(`[Highway] unsupported chatType: ${e.chatType}`); } async uploadGroupImage(e, n) { n.sha1 = Buffer.from(await $o(n.path)).toString("hex"); const r = g4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = g4.parse(i), a = o.upload.uKey; if (a && a !== "") { this.logger.debug(`[Highway] uploadGroupImageReq get upload ukey: ${a}, need upload!`); const s = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(s.info.fileSha1, "hex"), u = Buffer.from(s.info.fileHash, "hex"), d = new he(Za).encode({ fileUuid: s.fileUuid, uKey: a, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [c] } }); await this.hwClient.upload( 1004, fe.createReadStream(n.path, { highWaterMark: Mn }), n.size, u, d ); } else this.logger.debug(`[Highway] uploadGroupImageReq get upload invalid ukey ${a}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadC2CImage(e, n) { n.sha1 = Buffer.from(await $o(n.path)).toString("hex"); const r = P4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = P4.parse(i), a = o.upload.uKey; if (a && a !== "") { this.logger.debug(`[Highway] uploadC2CImageReq get upload ukey: ${a}, need upload!`); const s = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(s.info.fileSha1, "hex"), u = Buffer.from(s.info.fileHash, "hex"), d = new he(Za).encode({ fileUuid: s.fileUuid, uKey: a, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [c] } }); await this.hwClient.upload( 1003, fe.createReadStream(n.path, { highWaterMark: Mn }), n.size, u, d ); } else this.logger.debug(`[Highway] uploadC2CImageReq get upload invalid ukey ${a}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadGroupVideo(e, n) { if (!n.filePath || !n.thumbPath) throw new Error("video.filePath or video.thumbPath is empty"); n.fileSha1 = Buffer.from(await $o(n.filePath)).toString("hex"), n.thumbSha1 = Buffer.from(await $o(n.thumbPath)).toString("hex"); const r = k4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = k4.parse(i), a = o.upload.msgInfo.msgInfoBody[0]?.index, s = o.upload.msgInfo.msgInfoBody[1]?.index; if (!a || !s) throw new Error("[Highway] uploadGroupVideo response is missing video or thumbnail MsgInfo"); const c = o.upload.uKey; if (c && c !== "") { this.logger.debug(`[Highway] uploadGroupVideoReq get upload video ukey: ${c}, need upload!`); const d = Buffer.from(a.info.fileHash, "hex"), p = new he(Za).encode({ fileUuid: a.fileUuid, uKey: c, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: await m4(n.filePath) } }); await this.hwClient.upload( 1005, fe.createReadStream(n.filePath, { highWaterMark: Mn }), +n.fileSize, d, p ); } else this.logger.debug(`[Highway] uploadGroupVideoReq get upload invalid ukey ${c}, don't need upload!`); const u = o.upload.subFileInfos[0]; if (u?.uKey && u.uKey !== "") { this.logger.debug(`[Highway] uploadGroupVideoReq get upload video thumb ukey: ${u.uKey}, need upload!`); const d = Buffer.from(s.info.fileHash, "hex"), p = Buffer.from(s.info.fileSha1, "hex"), f = new he(Za).encode({ fileUuid: s.fileUuid, uKey: u.uKey, network: { ipv4S: es(u.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [p] } }); await this.hwClient.upload( 1006, fe.createReadStream(n.thumbPath, { highWaterMark: Mn }), +n.thumbSize, d, f ); } else this.logger.debug(`[Highway] uploadGroupVideoReq get upload invalid thumb ukey ${u?.uKey ?? ""}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadC2CVideo(e, n) { if (!n.filePath || !n.thumbPath) throw new Error("video.filePath or video.thumbPath is empty"); n.fileSha1 = Buffer.from(await $o(n.filePath)).toString("hex"), n.thumbSha1 = Buffer.from(await $o(n.thumbPath)).toString("hex"); const r = O4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = O4.parse(i), a = o.upload.msgInfo.msgInfoBody[0]?.index, s = o.upload.msgInfo.msgInfoBody[1]?.index; if (!a || !s) throw new Error("[Highway] uploadC2CVideo response is missing video or thumbnail MsgInfo"); const c = o.upload.uKey; if (c && c !== "") { this.logger.debug(`[Highway] uploadC2CVideoReq get upload video ukey: ${c}, need upload!`); const d = Buffer.from(a.info.fileHash, "hex"), p = new he(Za).encode({ fileUuid: a.fileUuid, uKey: c, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: await m4(n.filePath) } }); await this.hwClient.upload( 1001, fe.createReadStream(n.filePath, { highWaterMark: Mn }), +n.fileSize, d, p ); } else this.logger.debug(`[Highway] uploadC2CVideoReq get upload invalid ukey ${c}, don't need upload!`); const u = o.upload.subFileInfos[0]; if (u?.uKey && u.uKey !== "") { this.logger.debug(`[Highway] uploadC2CVideoReq get upload video thumb ukey: ${u.uKey}, need upload!`); const d = Buffer.from(s.info.fileHash, "hex"), p = Buffer.from(s.info.fileSha1, "hex"), f = new he(Za).encode({ fileUuid: s.fileUuid, uKey: u.uKey, network: { ipv4S: es(u.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [p] } }); await this.hwClient.upload( 1002, fe.createReadStream(n.thumbPath, { highWaterMark: Mn }), +n.thumbSize, d, f ); } else this.logger.debug(`[Highway] uploadC2CVideoReq get upload invalid thumb ukey ${u?.uKey ?? ""}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadGroupPtt(e, n) { n.fileSha1 = Buffer.from(await $o(n.filePath)).toString("hex"); const r = T4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = T4.parse(i), a = o.upload.uKey; if (a && a !== "") { this.logger.debug(`[Highway] uploadGroupPttReq get upload ptt ukey: ${a}, need upload!`); const s = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(s.info.fileHash, "hex"), u = Buffer.from(s.info.fileSha1, "hex"), d = new he(Za).encode({ fileUuid: s.fileUuid, uKey: a, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [u] } }); await this.hwClient.upload( 1008, fe.createReadStream(n.filePath, { highWaterMark: Mn }), n.fileSize, c, d ); } else this.logger.debug(`[Highway] uploadGroupPttReq get upload invalid ukey ${a}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadC2CPtt(e, n) { n.fileSha1 = Buffer.from(await $o(n.filePath)).toString("hex"); const r = D4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = D4.parse(i), a = o.upload.uKey; if (a && a !== "") { this.logger.debug(`[Highway] uploadC2CPttReq get upload ptt ukey: ${a}, need upload!`); const s = o.upload.msgInfo.msgInfoBody[0].index, c = Buffer.from(s.info.fileHash, "hex"), u = Buffer.from(s.info.fileSha1, "hex"), d = new he(Za).encode({ fileUuid: s.fileUuid, uKey: a, network: { ipv4S: es(o.upload.ipv4S) }, msgInfoBody: o.upload.msgInfo.msgInfoBody, blockSize: Mn, hash: { fileSha1: [u] } }); await this.hwClient.upload( 1007, fe.createReadStream(n.filePath, { highWaterMark: Mn }), n.fileSize, c, d ); } else this.logger.debug(`[Highway] uploadC2CPttReq get upload invalid ukey ${a}, don't need upload!`); n.msgInfo = o.upload.msgInfo; } async uploadGroupFile(e, n) { n.isGroupFile = !0, n.fileMd5 = await PS(n.filePath), n.fileSha1 = await $o(n.filePath); const r = C4.build(e, n), i = await this.client.sendOidbPacket(r, !0), o = C4.parse(i); if (o?.upload?.boolFileExist) this.logger.debug("[Highway] uploadGroupFileReq file exist, don't need upload!"); else { this.logger.debug("[Highway] uploadGroupFileReq file not exist, need upload!"); const a = new he(c4).encode({ unknown1: 100, unknown2: 1, entry: { busiBuff: { senderUin: BigInt(this.sig.uin), receiverUin: BigInt(e), groupCode: BigInt(e) }, fileEntry: { fileSize: BigInt(n.fileSize), md5: n.fileMd5, md5S2: n.fileMd5, checkKey: o.upload.checkKey, fileId: o.upload.fileId, uploadKey: o.upload.fileKey }, clientInfo: { clientType: 3, appId: "100", terminalType: 3, clientVer: "1.1.1", unknown: 4 }, fileNameInfo: { fileName: n.fileName }, host: { hosts: [ { url: { host: o.upload.uploadIp, unknown: 1 }, port: o.upload.uploadPort } ] } }, unknown200: 0 }); await this.hwClient.upload( 71, fe.createReadStream(n.filePath, { highWaterMark: Mn }), n.fileSize, n.fileMd5, a ); } n.fileUuid = o.upload.fileId; } async uploadC2CFile(e, n) { n.isGroupFile = !1, n.fileMd5 = await PS(n.filePath), n.fileSha1 = await $o(n.filePath); const r = await N4.build(this.sig.uid, e, n), i = await this.client.sendOidbPacket(r, !0), o = N4.parse(i); if (!o.upload?.boolFileExist) { this.logger.debug("[Highway] uploadC2CFileReq file not exist, need upload!"); const c = new he(c4).encode({ unknown1: 100, unknown2: 1, entry: { busiBuff: { senderUin: BigInt(this.sig.uin) }, fileEntry: { fileSize: BigInt(n.fileSize), md5: n.fileMd5, md5S2: n.fileMd5, checkKey: n.fileSha1, fileId: o.upload?.uuid, uploadKey: o.upload?.mediaPlatformUploadKey }, clientInfo: { clientType: 3, appId: "100", terminalType: 3, clientVer: "1.1.1", unknown: 4 }, fileNameInfo: { fileName: n.fileName }, host: { hosts: [ { url: { host: o.upload?.uploadIp, unknown: 1 }, port: o.upload?.uploadPort } ] } }, unknown200: 1, unknown3: 0 }); await this.hwClient.upload( 95, fe.createReadStream(n.filePath, { highWaterMark: Mn }), n.fileSize, n.fileMd5, c ); } n.fileUuid = o.upload?.uuid, n.fileHash = o.upload?.fileAddon; const a = A4.build(n.fileUuid, n.fileHash, this.sig.uid, e), s = await this.client.sendOidbPacket(a, !0); n._e37_800_rsp = A4.parse(s), n._private_send_uid = this.sig.uid, n._private_recv_uid = e; } } var bv = {}, xh = {}, vv, cT; function Ei() { if (cT) return vv; cT = 1; function t(h) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(y) { return typeof y; } : function(y) { return y && typeof Symbol == "function" && y.constructor === Symbol && y !== Symbol.prototype ? "symbol" : typeof y; }, t(h); } function e(h, y, x) { return Object.defineProperty(h, "prototype", { writable: !1 }), h; } function n(h, y) { if (!(h instanceof y)) throw new TypeError("Cannot call a class as a function"); } function r(h, y, x) { return y = f(y), i(h, u() ? Reflect.construct(y, x || [], f(h).constructor) : y.apply(h, x)); } function i(h, y) { if (y && (t(y) == "object" || typeof y == "function")) return y; if (y !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return o(h); } function o(h) { if (h === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return h; } function a(h, y) { if (typeof y != "function" && y !== null) throw new TypeError("Super expression must either be null or a function"); h.prototype = Object.create(y && y.prototype, { constructor: { value: h, writable: !0, configurable: !0 } }), Object.defineProperty(h, "prototype", { writable: !1 }), y && p(h, y); } function s(h) { var y = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0; return s = function(g) { if (g === null || !d(g)) return g; if (typeof g != "function") throw new TypeError("Super expression must either be null or a function"); if (y !== void 0) { if (y.has(g)) return y.get(g); y.set(g, b); } function b() { return c(g, arguments, f(this).constructor); } return b.prototype = Object.create(g.prototype, { constructor: { value: b, enumerable: !1, writable: !0, configurable: !0 } }), p(b, g); }, s(h); } function c(h, y, x) { if (u()) return Reflect.construct.apply(null, arguments); var g = [null]; g.push.apply(g, y); var b = new (h.bind.apply(h, g))(); return x && p(b, x.prototype), b; } function u() { try { var h = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!h; })(); } function d(h) { try { return Function.toString.call(h).indexOf("[native code]") !== -1; } catch { return typeof h == "function"; } } function p(h, y) { return p = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(x, g) { return x.__proto__ = g, x; }, p(h, y); } function f(h) { return f = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(y) { return y.__proto__ || Object.getPrototypeOf(y); }, f(h); } var m = /* @__PURE__ */ (function(h) { function y(x) { var g; return n(this, y), g = r(this, y, [`Format functions must be synchronous taking a two arguments: (info, opts) Found: `.concat(x.toString().split(` `)[0], ` `)]), Error.captureStackTrace(g, y), g; } return a(y, h), e(y); })(/* @__PURE__ */ s(Error)); return vv = function(h) { if (h.length > 2) throw new m(h); function y() { var g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; this.options = g; } y.prototype.transform = h; function x(g) { return new y(g); } return x.Format = y, x; }, vv; } var od = { exports: {} }, xv = { exports: {} }, wv = { exports: {} }, Sv = { exports: {} }, uT; function _Y() { return uT || (uT = 1, (function(t) { var e = {}; t.exports = e; var n = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], grey: [90, 39], brightRed: [91, 39], brightGreen: [92, 39], brightYellow: [93, 39], brightBlue: [94, 39], brightMagenta: [95, 39], brightCyan: [96, 39], brightWhite: [97, 39], bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgGray: [100, 49], bgGrey: [100, 49], bgBrightRed: [101, 49], bgBrightGreen: [102, 49], bgBrightYellow: [103, 49], bgBrightBlue: [104, 49], bgBrightMagenta: [105, 49], bgBrightCyan: [106, 49], bgBrightWhite: [107, 49], // legacy styles for colors pre v1.0.0 blackBG: [40, 49], redBG: [41, 49], greenBG: [42, 49], yellowBG: [43, 49], blueBG: [44, 49], magentaBG: [45, 49], cyanBG: [46, 49], whiteBG: [47, 49] }; Object.keys(n).forEach(function(r) { var i = n[r], o = e[r] = []; o.open = "\x1B[" + i[0] + "m", o.close = "\x1B[" + i[1] + "m"; }); })(Sv)), Sv.exports; } var _v, lT; function EY() { return lT || (lT = 1, _v = function(t, e) { e = e || process.argv || []; var n = e.indexOf("--"), r = /^-{1,2}/.test(t) ? "" : "--", i = e.indexOf(r + t); return i !== -1 && (n === -1 ? !0 : i < n); }), _v; } var Ev, dT; function AY() { if (dT) return Ev; dT = 1; var t = Ln, e = EY(), n = process.env, r = void 0; e("no-color") || e("no-colors") || e("color=false") ? r = !1 : (e("color") || e("colors") || e("color=true") || e("color=always")) && (r = !0), "FORCE_COLOR" in n && (r = n.FORCE_COLOR.length === 0 || parseInt(n.FORCE_COLOR, 10) !== 0); function i(s) { return s === 0 ? !1 : { level: s, hasBasic: !0, has256: s >= 2, has16m: s >= 3 }; } function o(s) { if (r === !1) return 0; if (e("color=16m") || e("color=full") || e("color=truecolor")) return 3; if (e("color=256")) return 2; if (s && !s.isTTY && r !== !0) return 0; var c = r ? 1 : 0; if (process.platform === "win32") { var u = t.release().split("."); return Number(process.versions.node.split(".")[0]) >= 8 && Number(u[0]) >= 10 && Number(u[2]) >= 10586 ? Number(u[2]) >= 14931 ? 3 : 2 : 1; } if ("CI" in n) return ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(p) { return p in n; }) || n.CI_NAME === "codeship" ? 1 : c; if ("TEAMCITY_VERSION" in n) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION) ? 1 : 0; if ("TERM_PROGRAM" in n) { var d = parseInt((n.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (n.TERM_PROGRAM) { case "iTerm.app": return d >= 3 ? 3 : 2; case "Hyper": return 3; case "Apple_Terminal": return 2; } } return /-256(color)?$/i.test(n.TERM) ? 2 : /^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM) || "COLORTERM" in n ? 1 : (n.TERM === "dumb", c); } function a(s) { var c = o(s); return i(c); } return Ev = { supportsColor: a, stdout: a(process.stdout), stderr: a(process.stderr) }, Ev; } var Av = { exports: {} }, pT; function IY() { return pT || (pT = 1, (function(t) { t.exports = function(n, r) { var i = ""; n = n || "Run the trap, drop the bass", n = n.split(""); var o = { a: ["@", "Ą", "Ⱥ", "Ʌ", "Δ", "Λ", "Д"], b: ["ß", "Ɓ", "Ƀ", "ɮ", "β", "฿"], c: ["©", "Ȼ", "Ͼ"], d: ["Ð", "Ɗ", "Ԁ", "ԁ", "Ԃ", "ԃ"], e: [ "Ë", "ĕ", "Ǝ", "ɘ", "Σ", "ξ", "Ҽ", "੬" ], f: ["Ӻ"], g: ["ɢ"], h: ["Ħ", "ƕ", "Ң", "Һ", "Ӈ", "Ԋ"], i: ["༏"], j: ["Ĵ"], k: ["ĸ", "Ҡ", "Ӄ", "Ԟ"], l: ["Ĺ"], m: ["ʍ", "Ӎ", "ӎ", "Ԡ", "ԡ", "൩"], n: ["Ñ", "ŋ", "Ɲ", "Ͷ", "Π", "Ҋ"], o: [ "Ø", "õ", "ø", "Ǿ", "ʘ", "Ѻ", "ם", "۝", "๏" ], p: ["Ƿ", "Ҏ"], q: ["্"], r: ["®", "Ʀ", "Ȑ", "Ɍ", "ʀ", "Я"], s: ["§", "Ϟ", "ϟ", "Ϩ"], t: ["Ł", "Ŧ", "ͳ"], u: ["Ʊ", "Ս"], v: ["ט"], w: ["Ш", "Ѡ", "Ѽ", "൰"], x: ["Ҳ", "Ӿ", "Ӽ", "ӽ"], y: ["¥", "Ұ", "Ӌ"], z: ["Ƶ", "ɀ"] }; return n.forEach(function(a) { a = a.toLowerCase(); var s = o[a] || [" "], c = Math.floor(Math.random() * s.length); typeof o[a] < "u" ? i += o[a][c] : i += a; }), i; }; })(Av)), Av.exports; } var Iv = { exports: {} }, fT; function CY() { return fT || (fT = 1, (function(t) { t.exports = function(n, r) { n = n || " he is here "; var i = { up: [ "̍", "̎", "̄", "̅", "̿", "̑", "̆", "̐", "͒", "͗", "͑", "̇", "̈", "̊", "͂", "̓", "̈", "͊", "͋", "͌", "̃", "̂", "̌", "͐", "̀", "́", "̋", "̏", "̒", "̓", "̔", "̽", "̉", "ͣ", "ͤ", "ͥ", "ͦ", "ͧ", "ͨ", "ͩ", "ͪ", "ͫ", "ͬ", "ͭ", "ͮ", "ͯ", "̾", "͛", "͆", "̚" ], down: [ "̖", "̗", "̘", "̙", "̜", "̝", "̞", "̟", "̠", "̤", "̥", "̦", "̩", "̪", "̫", "̬", "̭", "̮", "̯", "̰", "̱", "̲", "̳", "̹", "̺", "̻", "̼", "ͅ", "͇", "͈", "͉", "͍", "͎", "͓", "͔", "͕", "͖", "͙", "͚", "̣" ], mid: [ "̕", "̛", "̀", "́", "͘", "̡", "̢", "̧", "̨", "̴", "̵", "̶", "͜", "͝", "͞", "͟", "͠", "͢", "̸", "̷", "͡", " ҉" ] }, o = [].concat(i.up, i.down, i.mid); function a(u) { var d = Math.floor(Math.random() * u); return d; } function s(u) { var d = !1; return o.filter(function(p) { d = p === u; }), d; } function c(u, d) { var p = "", f, m; d = d || {}, d.up = typeof d.up < "u" ? d.up : !0, d.mid = typeof d.mid < "u" ? d.mid : !0, d.down = typeof d.down < "u" ? d.down : !0, d.size = typeof d.size < "u" ? d.size : "maxi", u = u.split(""); for (m in u) if (!s(m)) { switch (p = p + u[m], f = { up: 0, down: 0, mid: 0 }, d.size) { case "mini": f.up = a(8), f.mid = a(2), f.down = a(8); break; case "maxi": f.up = a(16) + 3, f.mid = a(4) + 1, f.down = a(64) + 3; break; default: f.up = a(8) + 1, f.mid = a(6) / 2, f.down = a(8) + 1; break; } var h = ["up", "mid", "down"]; for (var y in h) for (var x = h[y], g = 0; g <= f[x]; g++) d[x] && (p = p + i[x][a(i[x].length)]); } return p; } return c(n, r); }; })(Iv)), Iv.exports; } var Cv = { exports: {} }, hT; function TY() { return hT || (hT = 1, (function(t) { t.exports = function(e) { return function(n, r, i) { if (n === " ") return n; switch (r % 3) { case 0: return e.red(n); case 1: return e.white(n); case 2: return e.blue(n); } }; }; })(Cv)), Cv.exports; } var Tv = { exports: {} }, mT; function kY() { return mT || (mT = 1, (function(t) { t.exports = function(e) { return function(n, r, i) { return r % 2 === 0 ? n : e.inverse(n); }; }; })(Tv)), Tv.exports; } var kv = { exports: {} }, gT; function NY() { return gT || (gT = 1, (function(t) { t.exports = function(e) { var n = ["red", "yellow", "green", "blue", "magenta"]; return function(r, i, o) { return r === " " ? r : e[n[i++ % n.length]](r); }; }; })(kv)), kv.exports; } var Nv = { exports: {} }, yT; function PY() { return yT || (yT = 1, (function(t) { t.exports = function(e) { var n = [ "underline", "inverse", "grey", "yellow", "red", "green", "blue", "white", "cyan", "magenta", "brightYellow", "brightRed", "brightGreen", "brightBlue", "brightWhite", "brightCyan", "brightMagenta" ]; return function(r, i, o) { return r === " " ? r : e[n[Math.round(Math.random() * (n.length - 2))]](r); }; }; })(Nv)), Nv.exports; } var bT; function DY() { return bT || (bT = 1, (function(t) { var e = {}; t.exports = e, e.themes = {}; var n = Pn, r = e.styles = _Y(), i = Object.defineProperties, o = new RegExp(/[\r\n]+/g); e.supportsColor = AY().supportsColor, typeof e.enabled > "u" && (e.enabled = e.supportsColor() !== !1), e.enable = function() { e.enabled = !0; }, e.disable = function() { e.enabled = !1; }, e.stripColors = e.strip = function(y) { return ("" + y).replace(/\x1B\[\d+m/g, ""); }, e.stylize = function(x, g) { if (!e.enabled) return x + ""; var b = r[g]; return !b && g in e ? e[g](x) : b.open + x + b.close; }; var a = /[|\\{}()[\]^$+*?.]/g, s = function(y) { if (typeof y != "string") throw new TypeError("Expected a string"); return y.replace(a, "\\$&"); }; function c(y) { var x = function g() { return p.apply(g, arguments); }; return x._styles = y, x.__proto__ = d, x; } var u = (function() { var y = {}; return r.grey = r.gray, Object.keys(r).forEach(function(x) { r[x].closeRe = new RegExp(s(r[x].close), "g"), y[x] = { get: function() { return c(this._styles.concat(x)); } }; }), y; })(), d = i(function() { }, u); function p() { var y = Array.prototype.slice.call(arguments), x = y.map(function(T) { return T != null && T.constructor === String ? T : n.inspect(T); }).join(" "); if (!e.enabled || !x) return x; for (var g = x.indexOf(` `) != -1, b = this._styles, S = b.length; S--; ) { var E = r[b[S]]; x = E.open + x.replace(E.closeRe, E.open) + E.close, g && (x = x.replace(o, function(T) { return E.close + T + E.open; })); } return x; } e.setTheme = function(y) { if (typeof y == "string") { console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); return; } for (var x in y) (function(g) { e[g] = function(b) { if (typeof y[g] == "object") { var S = b; for (var E in y[g]) S = e[y[g][E]](S); return S; } return e[y[g]](b); }; })(x); }; function f() { var y = {}; return Object.keys(u).forEach(function(x) { y[x] = { get: function() { return c([x]); } }; }), y; } var m = function(x, g) { var b = g.split(""); return b = b.map(x), b.join(""); }; e.trap = IY(), e.zalgo = CY(), e.maps = {}, e.maps.america = TY()(e), e.maps.zebra = kY()(e), e.maps.rainbow = NY()(e), e.maps.random = PY()(e); for (var h in e.maps) (function(y) { e[y] = function(x) { return m(e.maps[y], x); }; })(h); i(e, f()); })(wv)), wv.exports; } var vT; function JF() { return vT || (vT = 1, (function(t) { var e = DY(); t.exports = e; })(xv)), xv.exports; } var Pv = {}, Dv = {}, wh = {}, xT; function OY() { return xT || (xT = 1, wh.levels = { error: 0, warn: 1, help: 2, data: 3, info: 4, debug: 5, prompt: 6, verbose: 7, input: 8, silly: 9 }, wh.colors = { error: "red", warn: "yellow", help: "cyan", data: "grey", info: "green", debug: "blue", prompt: "grey", verbose: "cyan", input: "grey", silly: "magenta" }), wh; } var Sh = {}, wT; function FY() { return wT || (wT = 1, Sh.levels = { error: 0, warn: 1, info: 2, http: 3, verbose: 4, debug: 5, silly: 6 }, Sh.colors = { error: "red", warn: "yellow", info: "green", http: "green", verbose: "cyan", debug: "blue", silly: "magenta" }), Sh; } var _h = {}, ST; function MY() { return ST || (ST = 1, _h.levels = { emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 }, _h.colors = { emerg: "red", alert: "yellow", crit: "red", error: "red", warning: "red", notice: "yellow", info: "green", debug: "blue" }), _h; } var _T; function RY() { return _T || (_T = 1, (function(t) { Object.defineProperty(t, "cli", { value: OY() }), Object.defineProperty(t, "npm", { value: FY() }), Object.defineProperty(t, "syslog", { value: MY() }); })(Dv)), Dv; } var ET; function dn() { return ET || (ET = 1, (function(t) { Object.defineProperty(t, "LEVEL", { value: Symbol.for("level") }), Object.defineProperty(t, "MESSAGE", { value: Symbol.for("message") }), Object.defineProperty(t, "SPLAT", { value: Symbol.for("splat") }), Object.defineProperty(t, "configs", { value: RY() }); })(Pv)), Pv; } var AT; function pE() { if (AT) return od.exports; AT = 1; function t(f) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) { return typeof m; } : function(m) { return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m; }, t(f); } function e(f, m) { if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function"); } function n(f, m) { for (var h = 0; h < m.length; h++) { var y = m[h]; y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y); } } function r(f, m, h) { return m && n(f.prototype, m), h && n(f, h), Object.defineProperty(f, "prototype", { writable: !1 }), f; } function i(f) { var m = o(f, "string"); return t(m) == "symbol" ? m : m + ""; } function o(f, m) { if (t(f) != "object" || !f) return f; var h = f[Symbol.toPrimitive]; if (h !== void 0) { var y = h.call(f, m); if (t(y) != "object") return y; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(f); } var a = JF(), s = dn(), c = s.LEVEL, u = s.MESSAGE; a.enabled = !0; var d = /\s+/, p = /* @__PURE__ */ (function() { function f() { var m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e(this, f), m.colors && this.addColors(m.colors), this.options = m; } return r(f, [{ key: "addColors", value: ( /* * Adds the colors Object to the set of allColors * known by the Colorizer * * @param {Object} colors Set of color mappings to add. */ function(h) { return f.addColors(h); } ) /* * function colorize (lookup, level, message) * Performs multi-step colorization using @colors/colors/safe */ }, { key: "colorize", value: function(h, y, x) { if (typeof x > "u" && (x = y), !Array.isArray(f.allColors[h])) return a[f.allColors[h]](x); for (var g = 0, b = f.allColors[h].length; g < b; g++) x = a[f.allColors[h][g]](x); return x; } /* * function transform (info, opts) * Attempts to colorize the { level, message } of the given * `logform` info object. */ }, { key: "transform", value: function(h, y) { return y.all && typeof h[u] == "string" && (h[u] = this.colorize(h[c], h.level, h[u])), (y.level || y.all || !y.message) && (h.level = this.colorize(h[c], h.level)), (y.all || y.message) && (h.message = this.colorize(h[c], h.level, h.message)), h; } }], [{ key: "addColors", value: function(h) { var y = Object.keys(h).reduce(function(x, g) { return x[g] = d.test(h[g]) ? h[g].split(d) : h[g], x; }, {}); return f.allColors = Object.assign({}, f.allColors || {}, y), f.allColors; } }]); })(); return od.exports = function(f) { return new p(f); }, od.exports.Colorizer = od.exports.Format = p, od.exports; } var Ov, IT; function BY() { if (IT) return Ov; IT = 1; var t = pE(), e = t.Colorizer; return Ov = function(n) { return e.addColors(n.colors || n), n; }, Ov; } var Fv, CT; function UY() { if (CT) return Fv; CT = 1; var t = Ei(); return Fv = t(function(e) { return e.message = " ".concat(e.message), e; }), Fv; } var Eh = { exports: {} }, ad = { exports: {} }, TT; function XF() { if (TT) return ad.exports; TT = 1; function t(g) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(b) { return typeof b; } : function(b) { return b && typeof Symbol == "function" && b.constructor === Symbol && b !== Symbol.prototype ? "symbol" : typeof b; }, t(g); } function e(g) { return o(g) || i(g) || r(g) || n(); } function n() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function r(g, b) { if (g) { if (typeof g == "string") return a(g, b); var S = {}.toString.call(g).slice(8, -1); return S === "Object" && g.constructor && (S = g.constructor.name), S === "Map" || S === "Set" ? Array.from(g) : S === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S) ? a(g, b) : void 0; } } function i(g) { if (typeof Symbol < "u" && g[Symbol.iterator] != null || g["@@iterator"] != null) return Array.from(g); } function o(g) { if (Array.isArray(g)) return a(g); } function a(g, b) { (b == null || b > g.length) && (b = g.length); for (var S = 0, E = Array(b); S < b; S++) E[S] = g[S]; return E; } function s(g, b) { if (!(g instanceof b)) throw new TypeError("Cannot call a class as a function"); } function c(g, b) { for (var S = 0; S < b.length; S++) { var E = b[S]; E.enumerable = E.enumerable || !1, E.configurable = !0, "value" in E && (E.writable = !0), Object.defineProperty(g, d(E.key), E); } } function u(g, b, S) { return b && c(g.prototype, b), S && c(g, S), Object.defineProperty(g, "prototype", { writable: !1 }), g; } function d(g) { var b = p(g, "string"); return t(b) == "symbol" ? b : b + ""; } function p(g, b) { if (t(g) != "object" || !g) return g; var S = g[Symbol.toPrimitive]; if (S !== void 0) { var E = S.call(g, b); if (t(E) != "object") return E; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(g); } var f = dn(), m = f.configs, h = f.LEVEL, y = f.MESSAGE, x = /* @__PURE__ */ (function() { function g() { var b = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { levels: m.npm.levels }; s(this, g), this.paddings = g.paddingForLevels(b.levels, b.filler), this.options = b; } return u(g, [{ key: "transform", value: ( /** * Prepends the padding onto the `message` based on the `LEVEL` of * the `info`. This is based on the behavior of `winston@2` which also * prepended the level onto the message. * * See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201 * * @param {Info} info Logform info object * @param {Object} opts Options passed along to this instance. * @returns {Info} Modified logform info object. */ function(S, E) { return S.message = "".concat(this.paddings[S[h]]).concat(S.message), S[y] && (S[y] = "".concat(this.paddings[S[h]]).concat(S[y])), S; } ) }], [{ key: "getLongestLevel", value: function(S) { var E = Object.keys(S).map(function(T) { return T.length; }); return Math.max.apply(Math, e(E)); } /** * Returns the padding for the specified `level` assuming that the * maximum length of all levels it's associated with is `maxLength`. * @param {String} level Level to calculate padding for. * @param {String} filler Repeatable text to use for padding. * @param {Number} maxLength Length of the longest level * @returns {String} Padding string for the `level` */ }, { key: "paddingForLevel", value: function(S, E, T) { var U = T + 1 - S.length, q = Math.floor(U / E.length), Y = "".concat(E).concat(E.repeat(q)); return Y.slice(0, U); } /** * Returns an object with the string paddings for the given `levels` * using the specified `filler`. * @param {Object} levels Set of all levels to calculate padding for. * @param {String} filler Repeatable text to use for padding. * @returns {Object} Mapping of level to desired padding. */ }, { key: "paddingForLevels", value: function(S) { var E = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : " ", T = g.getLongestLevel(S); return Object.keys(S).reduce(function(U, q) { return U[q] = g.paddingForLevel(q, E, T), U; }, {}); } }]); })(); return ad.exports = function(g) { return new x(g); }, ad.exports.Padder = ad.exports.Format = x, ad.exports; } var kT; function LY() { if (kT) return Eh.exports; kT = 1; function t(h) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(y) { return typeof y; } : function(y) { return y && typeof Symbol == "function" && y.constructor === Symbol && y !== Symbol.prototype ? "symbol" : typeof y; }, t(h); } function e(h, y) { if (!(h instanceof y)) throw new TypeError("Cannot call a class as a function"); } function n(h, y) { for (var x = 0; x < y.length; x++) { var g = y[x]; g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(h, i(g.key), g); } } function r(h, y, x) { return y && n(h.prototype, y), Object.defineProperty(h, "prototype", { writable: !1 }), h; } function i(h) { var y = o(h, "string"); return t(y) == "symbol" ? y : y + ""; } function o(h, y) { if (t(h) != "object" || !h) return h; var x = h[Symbol.toPrimitive]; if (x !== void 0) { var g = x.call(h, y); if (t(g) != "object") return g; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(h); } var a = pE(), s = a.Colorizer, c = XF(), u = c.Padder, d = dn(), p = d.configs, f = d.MESSAGE, m = /* @__PURE__ */ (function() { function h() { var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e(this, h), y.levels || (y.levels = p.cli.levels), this.colorizer = new s(y), this.padder = new u(y), this.options = y; } return r(h, [{ key: "transform", value: function(x, g) { return this.colorizer.transform(this.padder.transform(x, g), g), x[f] = "".concat(x.level, ":").concat(x.message), x; } }]); })(); return Eh.exports = function(h) { return new m(h); }, Eh.exports.Format = m, Eh.exports; } var Ah = { exports: {} }, NT; function QY() { if (NT) return Ah.exports; NT = 1; var t = Ei(); function e(r) { if (r.every(n)) return function(i) { for (var o = i, a = 0; a < r.length; a++) if (o = r[a].transform(o, r[a].options), !o) return !1; return o; }; } function n(r) { if (typeof r.transform != "function") throw new Error(["No transform function found on format. Did you create a format instance?", "const myFormat = format(formatFn);", "const instance = myFormat();"].join(` `)); return !0; } return Ah.exports = function() { for (var r = arguments.length, i = new Array(r), o = 0; o < r; o++) i[o] = arguments[o]; var a = t(e(i)), s = a(); return s.Format = a.Format, s; }, Ah.exports.cascade = e, Ah.exports; } var Mv, PT; function jY() { if (PT) return Mv; PT = 1; function t(c) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) { return typeof u; } : function(u) { return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u; }, t(c); } function e(c, u, d) { return (u = n(u)) in c ? Object.defineProperty(c, u, { value: d, enumerable: !0, configurable: !0, writable: !0 }) : c[u] = d, c; } function n(c) { var u = r(c, "string"); return t(u) == "symbol" ? u : u + ""; } function r(c, u) { if (t(c) != "object" || !c) return c; var d = c[Symbol.toPrimitive]; if (d !== void 0) { var p = d.call(c, u); if (t(p) != "object") return p; throw new TypeError("@@toPrimitive must return a primitive value."); } return (u === "string" ? String : Number)(c); } var i = Ei(), o = dn(), a = o.LEVEL, s = o.MESSAGE; return Mv = i(function(c, u) { var d = u.stack, p = u.cause; if (c instanceof Error) { var f = Object.assign({}, c, e(e(e({ level: c.level }, a, c[a] || c.level), "message", c.message), s, c[s] || c.message)); return d && (f.stack = c.stack), p && (f.cause = c.cause), f; } if (!(c.message instanceof Error)) return c; var m = c.message; return Object.assign(c, m), c.message = m.message, c[s] = m.message, d && (c.stack = m.stack), p && (c.cause = m.cause), c; }), Mv; } var Ih = { exports: {} }, DT; function nf() { return DT || (DT = 1, (function(t, e) { const { hasOwnProperty: n } = Object.prototype, r = g(); r.configure = g, r.stringify = r, r.default = r, e.stringify = r, e.configure = g, t.exports = r; const i = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/; function o(b) { return b.length < 5e3 && !i.test(b) ? `"${b}"` : JSON.stringify(b); } function a(b, S) { if (b.length > 200 || S) return b.sort(S); for (let E = 1; E < b.length; E++) { const T = b[E]; let U = E; for (; U !== 0 && b[U - 1] > T; ) b[U] = b[U - 1], U--; b[U] = T; } return b; } const s = Object.getOwnPropertyDescriptor( Object.getPrototypeOf( Object.getPrototypeOf( new Int8Array() ) ), Symbol.toStringTag ).get; function c(b) { return s.call(b) !== void 0 && b.length !== 0; } function u(b, S, E) { b.length < E && (E = b.length); const T = S === "," ? "" : " "; let U = `"0":${T}${b[0]}`; for (let q = 1; q < E; q++) U += `${S}"${q}":${T}${b[q]}`; return U; } function d(b) { if (n.call(b, "circularValue")) { const S = b.circularValue; if (typeof S == "string") return `"${S}"`; if (S == null) return S; if (S === Error || S === TypeError) return { toString() { throw new TypeError("Converting circular structure to JSON"); } }; throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); } return '"[Circular]"'; } function p(b) { let S; if (n.call(b, "deterministic") && (S = b.deterministic, typeof S != "boolean" && typeof S != "function")) throw new TypeError('The "deterministic" argument must be of type boolean or comparator function'); return S === void 0 ? !0 : S; } function f(b, S) { let E; if (n.call(b, S) && (E = b[S], typeof E != "boolean")) throw new TypeError(`The "${S}" argument must be of type boolean`); return E === void 0 ? !0 : E; } function m(b, S) { let E; if (n.call(b, S)) { if (E = b[S], typeof E != "number") throw new TypeError(`The "${S}" argument must be of type number`); if (!Number.isInteger(E)) throw new TypeError(`The "${S}" argument must be an integer`); if (E < 1) throw new RangeError(`The "${S}" argument must be >= 1`); } return E === void 0 ? 1 / 0 : E; } function h(b) { return b === 1 ? "1 item" : `${b} items`; } function y(b) { const S = /* @__PURE__ */ new Set(); for (const E of b) (typeof E == "string" || typeof E == "number") && S.add(String(E)); return S; } function x(b) { if (n.call(b, "strict")) { const S = b.strict; if (typeof S != "boolean") throw new TypeError('The "strict" argument must be of type boolean'); if (S) return (E) => { let T = `Object can not safely be stringified. Received type ${typeof E}`; throw typeof E != "function" && (T += ` (${E.toString()})`), new Error(T); }; } } function g(b) { b = { ...b }; const S = x(b); S && (b.bigint === void 0 && (b.bigint = !1), "circularValue" in b || (b.circularValue = Error)); const E = d(b), T = f(b, "bigint"), U = p(b), q = typeof U == "function" ? U : void 0, Y = m(b, "maximumDepth"), H = m(b, "maximumBreadth"); function G(V, K, $, _, I, N) { let L = K[V]; switch (typeof L == "object" && L !== null && typeof L.toJSON == "function" && (L = L.toJSON(V)), L = _.call(K, V, L), typeof L) { case "string": return o(L); case "object": { if (L === null) return "null"; if ($.indexOf(L) !== -1) return E; let C = "", Q = ","; const k = N; if (Array.isArray(L)) { if (L.length === 0) return "[]"; if (Y < $.length + 1) return '"[Array]"'; $.push(L), I !== "" && (N += I, C += ` ${N}`, Q = `, ${N}`); const ee = Math.min(L.length, H); let P = 0; for (; P < ee - 1; P++) { const W = G(String(P), L, $, _, I, N); C += W !== void 0 ? W : "null", C += Q; } const j = G(String(P), L, $, _, I, N); if (C += j !== void 0 ? j : "null", L.length - 1 > H) { const W = L.length - H - 1; C += `${Q}"... ${h(W)} not stringified"`; } return I !== "" && (C += ` ${k}`), $.pop(), `[${C}]`; } let M = Object.keys(L); const O = M.length; if (O === 0) return "{}"; if (Y < $.length + 1) return '"[Object]"'; let A = "", F = ""; I !== "" && (N += I, Q = `, ${N}`, A = " "); const Z = Math.min(O, H); U && !c(L) && (M = a(M, q)), $.push(L); for (let ee = 0; ee < Z; ee++) { const P = M[ee], j = G(P, L, $, _, I, N); j !== void 0 && (C += `${F}${o(P)}:${A}${j}`, F = Q); } if (O > H) { const ee = O - H; C += `${F}"...":${A}"${h(ee)} not stringified"`, F = Q; } return I !== "" && F.length > 1 && (C = ` ${N}${C} ${k}`), $.pop(), `{${C}}`; } case "number": return isFinite(L) ? String(L) : S ? S(L) : "null"; case "boolean": return L === !0 ? "true" : "false"; case "undefined": return; case "bigint": if (T) return String(L); // fallthrough default: return S ? S(L) : void 0; } } function J(V, K, $, _, I, N) { switch (typeof K == "object" && K !== null && typeof K.toJSON == "function" && (K = K.toJSON(V)), typeof K) { case "string": return o(K); case "object": { if (K === null) return "null"; if ($.indexOf(K) !== -1) return E; const L = N; let C = "", Q = ","; if (Array.isArray(K)) { if (K.length === 0) return "[]"; if (Y < $.length + 1) return '"[Array]"'; $.push(K), I !== "" && (N += I, C += ` ${N}`, Q = `, ${N}`); const O = Math.min(K.length, H); let A = 0; for (; A < O - 1; A++) { const Z = J(String(A), K[A], $, _, I, N); C += Z !== void 0 ? Z : "null", C += Q; } const F = J(String(A), K[A], $, _, I, N); if (C += F !== void 0 ? F : "null", K.length - 1 > H) { const Z = K.length - H - 1; C += `${Q}"... ${h(Z)} not stringified"`; } return I !== "" && (C += ` ${L}`), $.pop(), `[${C}]`; } $.push(K); let k = ""; I !== "" && (N += I, Q = `, ${N}`, k = " "); let M = ""; for (const O of _) { const A = J(O, K[O], $, _, I, N); A !== void 0 && (C += `${M}${o(O)}:${k}${A}`, M = Q); } return I !== "" && M.length > 1 && (C = ` ${N}${C} ${L}`), $.pop(), `{${C}}`; } case "number": return isFinite(K) ? String(K) : S ? S(K) : "null"; case "boolean": return K === !0 ? "true" : "false"; case "undefined": return; case "bigint": if (T) return String(K); // fallthrough default: return S ? S(K) : void 0; } } function B(V, K, $, _, I) { switch (typeof K) { case "string": return o(K); case "object": { if (K === null) return "null"; if (typeof K.toJSON == "function") { if (K = K.toJSON(V), typeof K != "object") return B(V, K, $, _, I); if (K === null) return "null"; } if ($.indexOf(K) !== -1) return E; const N = I; if (Array.isArray(K)) { if (K.length === 0) return "[]"; if (Y < $.length + 1) return '"[Array]"'; $.push(K), I += _; let A = ` ${I}`; const F = `, ${I}`, Z = Math.min(K.length, H); let ee = 0; for (; ee < Z - 1; ee++) { const j = B(String(ee), K[ee], $, _, I); A += j !== void 0 ? j : "null", A += F; } const P = B(String(ee), K[ee], $, _, I); if (A += P !== void 0 ? P : "null", K.length - 1 > H) { const j = K.length - H - 1; A += `${F}"... ${h(j)} not stringified"`; } return A += ` ${N}`, $.pop(), `[${A}]`; } let L = Object.keys(K); const C = L.length; if (C === 0) return "{}"; if (Y < $.length + 1) return '"[Object]"'; I += _; const Q = `, ${I}`; let k = "", M = "", O = Math.min(C, H); c(K) && (k += u(K, Q, H), L = L.slice(K.length), O -= K.length, M = Q), U && (L = a(L, q)), $.push(K); for (let A = 0; A < O; A++) { const F = L[A], Z = B(F, K[F], $, _, I); Z !== void 0 && (k += `${M}${o(F)}: ${Z}`, M = Q); } if (C > H) { const A = C - H; k += `${M}"...": "${h(A)} not stringified"`, M = Q; } return M !== "" && (k = ` ${I}${k} ${N}`), $.pop(), `{${k}}`; } case "number": return isFinite(K) ? String(K) : S ? S(K) : "null"; case "boolean": return K === !0 ? "true" : "false"; case "undefined": return; case "bigint": if (T) return String(K); // fallthrough default: return S ? S(K) : void 0; } } function D(V, K, $) { switch (typeof K) { case "string": return o(K); case "object": { if (K === null) return "null"; if (typeof K.toJSON == "function") { if (K = K.toJSON(V), typeof K != "object") return D(V, K, $); if (K === null) return "null"; } if ($.indexOf(K) !== -1) return E; let _ = ""; const I = K.length !== void 0; if (I && Array.isArray(K)) { if (K.length === 0) return "[]"; if (Y < $.length + 1) return '"[Array]"'; $.push(K); const k = Math.min(K.length, H); let M = 0; for (; M < k - 1; M++) { const A = D(String(M), K[M], $); _ += A !== void 0 ? A : "null", _ += ","; } const O = D(String(M), K[M], $); if (_ += O !== void 0 ? O : "null", K.length - 1 > H) { const A = K.length - H - 1; _ += `,"... ${h(A)} not stringified"`; } return $.pop(), `[${_}]`; } let N = Object.keys(K); const L = N.length; if (L === 0) return "{}"; if (Y < $.length + 1) return '"[Object]"'; let C = "", Q = Math.min(L, H); I && c(K) && (_ += u(K, ",", H), N = N.slice(K.length), Q -= K.length, C = ","), U && (N = a(N, q)), $.push(K); for (let k = 0; k < Q; k++) { const M = N[k], O = D(M, K[M], $); O !== void 0 && (_ += `${C}${o(M)}:${O}`, C = ","); } if (L > H) { const k = L - H; _ += `${C}"...":"${h(k)} not stringified"`; } return $.pop(), `{${_}}`; } case "number": return isFinite(K) ? String(K) : S ? S(K) : "null"; case "boolean": return K === !0 ? "true" : "false"; case "undefined": return; case "bigint": if (T) return String(K); // fallthrough default: return S ? S(K) : void 0; } } function X(V, K, $) { if (arguments.length > 1) { let _ = ""; if (typeof $ == "number" ? _ = " ".repeat(Math.min($, 10)) : typeof $ == "string" && (_ = $.slice(0, 10)), K != null) { if (typeof K == "function") return G("", { "": V }, [], K, _, ""); if (Array.isArray(K)) return J("", V, [], y(K), _, ""); } if (_.length !== 0) return B("", V, [], _, ""); } return D("", V, []); } return X; } })(Ih, Ih.exports)), Ih.exports; } var Rv, OT; function $Y() { if (OT) return Rv; OT = 1; var t = Ei(), e = dn(), n = e.MESSAGE, r = nf(); function i(o, a) { return typeof a == "bigint" ? a.toString() : a; } return Rv = t(function(o, a) { var s = r.configure(a); return o[n] = s(o, a.replacer || i, a.space), o; }), Rv; } var Bv, FT; function GY() { if (FT) return Bv; FT = 1; var t = Ei(); return Bv = t(function(e, n) { return n.message ? (e.message = "[".concat(n.label, "] ").concat(e.message), e) : (e.label = n.label, e); }), Bv; } var Uv, MT; function qY() { if (MT) return Uv; MT = 1; var t = Ei(), e = dn(), n = e.MESSAGE, r = nf(); return Uv = t(function(i) { var o = {}; return i.message && (o["@message"] = i.message, delete i.message), i.timestamp && (o["@timestamp"] = i.timestamp, delete i.timestamp), o["@fields"] = i, i[n] = r(o), i; }), Uv; } var Lv, RT; function zY() { if (RT) return Lv; RT = 1; function t(s) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) { return typeof c; } : function(c) { return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c; }, t(s); } function e(s, c, u) { return (c = n(c)) in s ? Object.defineProperty(s, c, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : s[c] = u, s; } function n(s) { var c = r(s, "string"); return t(c) == "symbol" ? c : c + ""; } function r(s, c) { if (t(s) != "object" || !s) return s; var u = s[Symbol.toPrimitive]; if (u !== void 0) { var d = u.call(s, c); if (t(d) != "object") return d; throw new TypeError("@@toPrimitive must return a primitive value."); } return (c === "string" ? String : Number)(s); } var i = Ei(); function o(s, c, u) { var d = c.reduce(function(f, m) { return f[m] = s[m], delete s[m], f; }, {}), p = Object.keys(s).reduce(function(f, m) { return f[m] = s[m], delete s[m], f; }, {}); return Object.assign(s, d, e({}, u, p)), s; } function a(s, c, u) { return s[u] = c.reduce(function(d, p) { return d[p] = s[p], delete s[p], d; }, {}), s; } return Lv = i(function(s) { var c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = "metadata"; c.key && (u = c.key); var d = []; return !c.fillExcept && !c.fillWith && (d.push("level"), d.push("message")), c.fillExcept && (d = c.fillExcept), d.length > 0 ? o(s, d, u) : c.fillWith ? a(s, c.fillWith, u) : s; }), Lv; } var Qv, BT; function HY() { if (BT) return Qv; BT = 1; var t = void 0, e = Ei(), n = MO(); return Qv = e(function(r) { var i = +/* @__PURE__ */ new Date(); return t.diff = i - (t.prevTime || i), t.prevTime = i, r.ms = "+".concat(n(t.diff)), r; }), Qv; } var jv, UT; function WY() { if (UT) return jv; UT = 1; var t = Pn.inspect, e = Ei(), n = dn(), r = n.LEVEL, i = n.MESSAGE, o = n.SPLAT; return jv = e(function(a) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = Object.assign({}, a); return delete c[r], delete c[i], delete c[o], a[i] = t(c, !1, s.depth || null, s.colorize), a; }), jv; } var sd = { exports: {} }, LT; function KY() { if (LT) return sd.exports; LT = 1; function t(u) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(d) { return typeof d; } : function(d) { return d && typeof Symbol == "function" && d.constructor === Symbol && d !== Symbol.prototype ? "symbol" : typeof d; }, t(u); } function e(u, d) { if (!(u instanceof d)) throw new TypeError("Cannot call a class as a function"); } function n(u, d) { for (var p = 0; p < d.length; p++) { var f = d[p]; f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(u, i(f.key), f); } } function r(u, d, p) { return d && n(u.prototype, d), Object.defineProperty(u, "prototype", { writable: !1 }), u; } function i(u) { var d = o(u, "string"); return t(d) == "symbol" ? d : d + ""; } function o(u, d) { if (t(u) != "object" || !u) return u; var p = u[Symbol.toPrimitive]; if (p !== void 0) { var f = p.call(u, d); if (t(f) != "object") return f; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(u); } var a = dn(), s = a.MESSAGE, c = /* @__PURE__ */ (function() { function u(d) { e(this, u), this.template = d; } return r(u, [{ key: "transform", value: function(p) { return p[s] = this.template(p), p; } }]); })(); return sd.exports = function(u) { return new c(u); }, sd.exports.Printf = sd.exports.Format = c, sd.exports; } var $v, QT; function VY() { if (QT) return $v; QT = 1; var t = Ei(), e = dn(), n = e.MESSAGE, r = nf(); return $v = t(function(i) { var o = r(Object.assign({}, i, { level: void 0, message: void 0, splat: void 0 })), a = i.padding && i.padding[i.level] || ""; return o !== "{}" ? i[n] = "".concat(i.level, ":").concat(a, " ").concat(i.message, " ").concat(o) : i[n] = "".concat(i.level, ":").concat(a, " ").concat(i.message), i; }), $v; } var Gv, jT; function YY() { if (jT) return Gv; jT = 1; function t(b) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) { return typeof S; } : function(S) { return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S; }, t(b); } function e(b) { return o(b) || i(b) || r(b) || n(); } function n() { throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } function r(b, S) { if (b) { if (typeof b == "string") return a(b, S); var E = {}.toString.call(b).slice(8, -1); return E === "Object" && b.constructor && (E = b.constructor.name), E === "Map" || E === "Set" ? Array.from(b) : E === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E) ? a(b, S) : void 0; } } function i(b) { if (typeof Symbol < "u" && b[Symbol.iterator] != null || b["@@iterator"] != null) return Array.from(b); } function o(b) { if (Array.isArray(b)) return a(b); } function a(b, S) { (S == null || S > b.length) && (S = b.length); for (var E = 0, T = Array(S); E < S; E++) T[E] = b[E]; return T; } function s(b, S) { if (!(b instanceof S)) throw new TypeError("Cannot call a class as a function"); } function c(b, S) { for (var E = 0; E < S.length; E++) { var T = S[E]; T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(b, d(T.key), T); } } function u(b, S, E) { return S && c(b.prototype, S), Object.defineProperty(b, "prototype", { writable: !1 }), b; } function d(b) { var S = p(b, "string"); return t(S) == "symbol" ? S : S + ""; } function p(b, S) { if (t(b) != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var T = E.call(b, S); if (t(T) != "object") return T; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); } var f = Pn, m = dn(), h = m.SPLAT, y = /%[scdjifoO%]/g, x = /%%/g, g = /* @__PURE__ */ (function() { function b(S) { s(this, b), this.options = S; } return u(b, [{ key: "_splat", value: function(E, T) { var U = E.message, q = E[h] || E.splat || [], Y = U.match(x), H = Y && Y.length || 0, G = T.length - H, J = G - q.length, B = J < 0 ? q.splice(J, -1 * J) : [], D = B.length; if (D) for (var X = 0; X < D; X++) Object.assign(E, B[X]); return E.message = f.format.apply(f, [U].concat(e(q))), E; } /** * Transforms the `info` message by using `util.format` to complete * any `info.message` provided it has string interpolation tokens. * If no tokens exist then `info` is immutable. * * @param {Info} info Logform info message. * @param {Object} opts Options for this instance. * @returns {Info} Modified info message */ }, { key: "transform", value: function(E) { var T = E.message, U = E[h] || E.splat; if (!U || !U.length) return E; var q = T && T.match && T.match(y); if (!q && (U || U.length)) { var Y = U.length > 1 ? U.splice(0) : U, H = Y.length; if (H) for (var G = 0; G < H; G++) Object.assign(E, Y[G]); return E; } return q ? this._splat(E, q) : E; } }]); })(); return Gv = function(b) { return new g(b); }, Gv; } var ZF = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g, is = "\\d\\d?", ts = "\\d\\d", JY = "\\d{3}", XY = "\\d{4}", ip = "[^\\s]+", eM = /\[([^]*?)\]/gm; function tM(t, e) { for (var n = [], r = 0, i = t.length; r < i; r++) n.push(t[r].substr(0, e)); return n; } var $T = function(t) { return function(e, n) { var r = n[t].map(function(o) { return o.toLowerCase(); }), i = r.indexOf(e.toLowerCase()); return i > -1 ? i : null; }; }; function Ss(t) { for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n]; for (var r = 0, i = e; r < i.length; r++) { var o = i[r]; for (var a in o) t[a] = o[a]; } return t; } var nM = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], rM = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], ZY = tM(rM, 3), eJ = tM(nM, 3), fE = { dayNamesShort: eJ, dayNames: nM, monthNamesShort: ZY, monthNames: rM, amPm: ["am", "pm"], DoFn: function(t) { return t + ["th", "st", "nd", "rd"][t % 10 > 3 ? 0 : (t - t % 10 !== 10 ? 1 : 0) * t % 10]; } }, ig = Ss({}, fE), iM = function(t) { return ig = Ss(ig, t); }, GT = function(t) { return t.replace(/[|\\{()[^$+*?.-]/g, "\\$&"); }, $r = function(t, e) { for (e === void 0 && (e = 2), t = String(t); t.length < e; ) t = "0" + t; return t; }, tJ = { D: function(t) { return String(t.getDate()); }, DD: function(t) { return $r(t.getDate()); }, Do: function(t, e) { return e.DoFn(t.getDate()); }, d: function(t) { return String(t.getDay()); }, dd: function(t) { return $r(t.getDay()); }, ddd: function(t, e) { return e.dayNamesShort[t.getDay()]; }, dddd: function(t, e) { return e.dayNames[t.getDay()]; }, M: function(t) { return String(t.getMonth() + 1); }, MM: function(t) { return $r(t.getMonth() + 1); }, MMM: function(t, e) { return e.monthNamesShort[t.getMonth()]; }, MMMM: function(t, e) { return e.monthNames[t.getMonth()]; }, YY: function(t) { return $r(String(t.getFullYear()), 4).substr(2); }, YYYY: function(t) { return $r(t.getFullYear(), 4); }, h: function(t) { return String(t.getHours() % 12 || 12); }, hh: function(t) { return $r(t.getHours() % 12 || 12); }, H: function(t) { return String(t.getHours()); }, HH: function(t) { return $r(t.getHours()); }, m: function(t) { return String(t.getMinutes()); }, mm: function(t) { return $r(t.getMinutes()); }, s: function(t) { return String(t.getSeconds()); }, ss: function(t) { return $r(t.getSeconds()); }, S: function(t) { return String(Math.round(t.getMilliseconds() / 100)); }, SS: function(t) { return $r(Math.round(t.getMilliseconds() / 10), 2); }, SSS: function(t) { return $r(t.getMilliseconds(), 3); }, a: function(t, e) { return t.getHours() < 12 ? e.amPm[0] : e.amPm[1]; }, A: function(t, e) { return t.getHours() < 12 ? e.amPm[0].toUpperCase() : e.amPm[1].toUpperCase(); }, ZZ: function(t) { var e = t.getTimezoneOffset(); return (e > 0 ? "-" : "+") + $r(Math.floor(Math.abs(e) / 60) * 100 + Math.abs(e) % 60, 4); }, Z: function(t) { var e = t.getTimezoneOffset(); return (e > 0 ? "-" : "+") + $r(Math.floor(Math.abs(e) / 60), 2) + ":" + $r(Math.abs(e) % 60, 2); } }, qT = function(t) { return +t - 1; }, zT = [null, is], HT = [null, ip], WT = [ "isPm", ip, function(t, e) { var n = t.toLowerCase(); return n === e.amPm[0] ? 0 : n === e.amPm[1] ? 1 : null; } ], KT = [ "timezoneOffset", "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?", function(t) { var e = (t + "").match(/([+-]|\d\d)/gi); if (e) { var n = +e[1] * 60 + parseInt(e[2], 10); return e[0] === "+" ? n : -n; } return 0; } ], nJ = { D: ["day", is], DD: ["day", ts], Do: ["day", is + ip, function(t) { return parseInt(t, 10); }], M: ["month", is, qT], MM: ["month", ts, qT], YY: [ "year", ts, function(t) { var e = /* @__PURE__ */ new Date(), n = +("" + e.getFullYear()).substr(0, 2); return +("" + (+t > 68 ? n - 1 : n) + t); } ], h: ["hour", is, void 0, "isPm"], hh: ["hour", ts, void 0, "isPm"], H: ["hour", is], HH: ["hour", ts], m: ["minute", is], mm: ["minute", ts], s: ["second", is], ss: ["second", ts], YYYY: ["year", XY], S: ["millisecond", "\\d", function(t) { return +t * 100; }], SS: ["millisecond", ts, function(t) { return +t * 10; }], SSS: ["millisecond", JY], d: zT, dd: zT, ddd: HT, dddd: HT, MMM: ["month", ip, $T("monthNamesShort")], MMMM: ["month", ip, $T("monthNames")], a: WT, A: WT, ZZ: KT, Z: KT }, og = { default: "ddd MMM DD YYYY HH:mm:ss", shortDate: "M/D/YY", mediumDate: "MMM D, YYYY", longDate: "MMMM D, YYYY", fullDate: "dddd, MMMM D, YYYY", isoDate: "YYYY-MM-DD", isoDateTime: "YYYY-MM-DDTHH:mm:ssZ", shortTime: "HH:mm", mediumTime: "HH:mm:ss", longTime: "HH:mm:ss.SSS" }, oM = function(t) { return Ss(og, t); }, aM = function(t, e, n) { if (e === void 0 && (e = og.default), n === void 0 && (n = {}), typeof t == "number" && (t = new Date(t)), Object.prototype.toString.call(t) !== "[object Date]" || isNaN(t.getTime())) throw new Error("Invalid Date pass to format"); e = og[e] || e; var r = []; e = e.replace(eM, function(o, a) { return r.push(a), "@@@"; }); var i = Ss(Ss({}, ig), n); return e = e.replace(ZF, function(o) { return tJ[o](t, i); }), e.replace(/@@@/g, function() { return r.shift(); }); }; function sM(t, e, n) { if (n === void 0 && (n = {}), typeof e != "string") throw new Error("Invalid format in fecha parse"); if (e = og[e] || e, t.length > 1e3) return null; var r = /* @__PURE__ */ new Date(), i = { year: r.getFullYear(), month: 0, day: 1, hour: 0, minute: 0, second: 0, millisecond: 0, isPm: null, timezoneOffset: null }, o = [], a = [], s = e.replace(eM, function(E, T) { return a.push(GT(T)), "@@@"; }), c = {}, u = {}; s = GT(s).replace(ZF, function(E) { var T = nJ[E], U = T[0], q = T[1], Y = T[3]; if (c[U]) throw new Error("Invalid format. " + U + " specified twice in format"); return c[U] = !0, Y && (u[Y] = !0), o.push(T), "(" + q + ")"; }), Object.keys(u).forEach(function(E) { if (!c[E]) throw new Error("Invalid format. " + E + " is required in specified format"); }), s = s.replace(/@@@/g, function() { return a.shift(); }); var d = t.match(new RegExp(s, "i")); if (!d) return null; for (var p = Ss(Ss({}, ig), n), f = 1; f < d.length; f++) { var m = o[f - 1], h = m[0], y = m[2], x = y ? y(d[f], p) : +d[f]; if (x == null) return null; i[h] = x; } i.isPm === 1 && i.hour != null && +i.hour != 12 ? i.hour = +i.hour + 12 : i.isPm === 0 && +i.hour == 12 && (i.hour = 0); var g; if (i.timezoneOffset == null) { g = new Date(i.year, i.month, i.day, i.hour, i.minute, i.second, i.millisecond); for (var b = [ ["month", "getMonth"], ["day", "getDate"], ["hour", "getHours"], ["minute", "getMinutes"], ["second", "getSeconds"] ], f = 0, S = b.length; f < S; f++) if (c[b[f][0]] && i[b[f][0]] !== g[b[f][1]]()) return null; } else if (g = new Date(Date.UTC(i.year, i.month, i.day, i.hour, i.minute - i.timezoneOffset, i.second, i.millisecond)), i.month > 11 || i.month < 0 || i.day > 31 || i.day < 1 || i.hour > 23 || i.hour < 0 || i.minute > 59 || i.minute < 0 || i.second > 59 || i.second < 0) return null; return g; } var rJ = { format: aM, parse: sM, defaultI18n: fE, setGlobalDateI18n: iM, setGlobalDateMasks: oM }; const iJ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, assign: Ss, default: rJ, defaultI18n: fE, format: aM, parse: sM, setGlobalDateI18n: iM, setGlobalDateMasks: oM }, Symbol.toStringTag, { value: "Module" })), oJ = /* @__PURE__ */ zD(iJ); var qv, VT; function aJ() { if (VT) return qv; VT = 1; var t = oJ, e = Ei(); return qv = e(function(n) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; return r.format && (n.timestamp = typeof r.format == "function" ? r.format() : t.format(/* @__PURE__ */ new Date(), r.format)), n.timestamp || (n.timestamp = (/* @__PURE__ */ new Date()).toISOString()), r.alias && (n[r.alias] = n.timestamp), n; }), qv; } var zv, YT; function sJ() { if (YT) return zv; YT = 1; var t = JF(), e = Ei(), n = dn(), r = n.MESSAGE; return zv = e(function(i, o) { return o.level !== !1 && (i.level = t.strip(i.level)), o.message !== !1 && (i.message = t.strip(String(i.message))), o.raw !== !1 && i[r] && (i[r] = t.strip(String(i[r]))), i; }), zv; } var JT; function cM() { if (JT) return xh; JT = 1; var t = xh.format = Ei(); return xh.levels = BY(), Object.defineProperty(t, "align", { value: UY() }), Object.defineProperty(t, "cli", { value: LY() }), Object.defineProperty(t, "colorize", { value: pE() }), Object.defineProperty(t, "combine", { value: QY() }), Object.defineProperty(t, "errors", { value: jY() }), Object.defineProperty(t, "json", { value: $Y() }), Object.defineProperty(t, "label", { value: GY() }), Object.defineProperty(t, "logstash", { value: qY() }), Object.defineProperty(t, "metadata", { value: zY() }), Object.defineProperty(t, "ms", { value: HY() }), Object.defineProperty(t, "padLevels", { value: XF() }), Object.defineProperty(t, "prettyPrint", { value: WY() }), Object.defineProperty(t, "printf", { value: KY() }), Object.defineProperty(t, "simple", { value: VY() }), Object.defineProperty(t, "splat", { value: YY() }), Object.defineProperty(t, "timestamp", { value: aJ() }), Object.defineProperty(t, "uncolorize", { value: sJ() }), xh; } var Hv = {}, XT; function uM() { return XT || (XT = 1, (function(t) { var e = Pn, n = e.format; t.warn = { deprecated: function(i) { return function() { throw new Error(n("{ %s } was removed in winston@3.0.0.", i)); }; }, useFormat: function(i) { return function() { throw new Error([n("{ %s } was removed in winston@3.0.0.", i), "Use a custom winston.format = winston.format(function) instead."].join(` `)); }; }, forFunctions: function(i, o, a) { a.forEach(function(s) { i[s] = t.warn[o](s); }); }, forProperties: function(i, o, a) { a.forEach(function(s) { var c = t.warn[o](s); Object.defineProperty(i, s, { get: c, set: c }); }); } }; })(Hv)), Hv; } const cJ = "3.18.3", uJ = { version: cJ }; var Wv = {}, Ch = { exports: {} }, Kv = { exports: {} }, Vv, ZT; function lM() { return ZT || (ZT = 1, Vv = Qa.EventEmitter), Vv; } var Yv, ek; function dM() { if (ek) return Yv; ek = 1; function t(a, s) { var c = this, u = this._readableState && this._readableState.destroyed, d = this._writableState && this._writableState.destroyed; return u || d ? (s ? s(a) : a && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(i, this, a)) : process.nextTick(i, this, a)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(a || null, function(p) { !s && p ? c._writableState ? c._writableState.errorEmitted ? process.nextTick(n, c) : (c._writableState.errorEmitted = !0, process.nextTick(e, c, p)) : process.nextTick(e, c, p) : s ? (process.nextTick(n, c), s(p)) : process.nextTick(n, c); }), this); } function e(a, s) { i(a, s), n(a); } function n(a) { a._writableState && !a._writableState.emitClose || a._readableState && !a._readableState.emitClose || a.emit("close"); } function r() { this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1); } function i(a, s) { a.emit("error", s); } function o(a, s) { var c = a._readableState, u = a._writableState; c && c.autoDestroy || u && u.autoDestroy ? a.destroy(s) : a.emit("error", s); } return Yv = { destroy: t, undestroy: r, errorOrDestroy: o }, Yv; } var Jv = {}, tk; function vl() { if (tk) return Jv; tk = 1; function t(s, c) { s.prototype = Object.create(c.prototype), s.prototype.constructor = s, s.__proto__ = c; } var e = {}; function n(s, c, u) { u || (u = Error); function d(f, m, h) { return typeof c == "string" ? c : c(f, m, h); } var p = /* @__PURE__ */ (function(f) { t(m, f); function m(h, y, x) { return f.call(this, d(h, y, x)) || this; } return m; })(u); p.prototype.name = u.name, p.prototype.code = s, e[s] = p; } function r(s, c) { if (Array.isArray(s)) { var u = s.length; return s = s.map(function(d) { return String(d); }), u > 2 ? "one of ".concat(c, " ").concat(s.slice(0, u - 1).join(", "), ", or ") + s[u - 1] : u === 2 ? "one of ".concat(c, " ").concat(s[0], " or ").concat(s[1]) : "of ".concat(c, " ").concat(s[0]); } else return "of ".concat(c, " ").concat(String(s)); } function i(s, c, u) { return s.substr(0, c.length) === c; } function o(s, c, u) { return (u === void 0 || u > s.length) && (u = s.length), s.substring(u - c.length, u) === c; } function a(s, c, u) { return typeof u != "number" && (u = 0), u + c.length > s.length ? !1 : s.indexOf(c, u) !== -1; } return n("ERR_INVALID_OPT_VALUE", function(s, c) { return 'The value "' + c + '" is invalid for option "' + s + '"'; }, TypeError), n("ERR_INVALID_ARG_TYPE", function(s, c, u) { var d; typeof c == "string" && i(c, "not ") ? (d = "must not be", c = c.replace(/^not /, "")) : d = "must be"; var p; if (o(s, " argument")) p = "The ".concat(s, " ").concat(d, " ").concat(r(c, "type")); else { var f = a(s, ".") ? "property" : "argument"; p = 'The "'.concat(s, '" ').concat(f, " ").concat(d, " ").concat(r(c, "type")); } return p += ". Received type ".concat(typeof u), p; }, TypeError), n("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), n("ERR_METHOD_NOT_IMPLEMENTED", function(s) { return "The " + s + " method is not implemented"; }), n("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), n("ERR_STREAM_DESTROYED", function(s) { return "Cannot call " + s + " after a stream was destroyed"; }), n("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), n("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), n("ERR_STREAM_WRITE_AFTER_END", "write after end"), n("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), n("ERR_UNKNOWN_ENCODING", function(s) { return "Unknown encoding: " + s; }, TypeError), n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), Jv.codes = e, Jv; } var Xv, nk; function pM() { if (nk) return Xv; nk = 1; var t = vl().codes.ERR_INVALID_OPT_VALUE; function e(r, i, o) { return r.highWaterMark != null ? r.highWaterMark : i ? r[o] : null; } function n(r, i, o, a) { var s = e(i, a, o); if (s != null) { if (!(isFinite(s) && Math.floor(s) === s) || s < 0) { var c = a ? o : "highWaterMark"; throw new t(c, s); } return Math.floor(s); } return r.objectMode ? 16 : 16 * 1024; } return Xv = { getHighWaterMark: n }, Xv; } var Zv, rk; function lJ() { if (rk) return Zv; rk = 1; function t(h, y) { var x = Object.keys(h); if (Object.getOwnPropertySymbols) { var g = Object.getOwnPropertySymbols(h); y && (g = g.filter(function(b) { return Object.getOwnPropertyDescriptor(h, b).enumerable; })), x.push.apply(x, g); } return x; } function e(h) { for (var y = 1; y < arguments.length; y++) { var x = arguments[y] != null ? arguments[y] : {}; y % 2 ? t(Object(x), !0).forEach(function(g) { n(h, g, x[g]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(h, Object.getOwnPropertyDescriptors(x)) : t(Object(x)).forEach(function(g) { Object.defineProperty(h, g, Object.getOwnPropertyDescriptor(x, g)); }); } return h; } function n(h, y, x) { return y = a(y), y in h ? Object.defineProperty(h, y, { value: x, enumerable: !0, configurable: !0, writable: !0 }) : h[y] = x, h; } function r(h, y) { if (!(h instanceof y)) throw new TypeError("Cannot call a class as a function"); } function i(h, y) { for (var x = 0; x < y.length; x++) { var g = y[x]; g.enumerable = g.enumerable || !1, g.configurable = !0, "value" in g && (g.writable = !0), Object.defineProperty(h, a(g.key), g); } } function o(h, y, x) { return y && i(h.prototype, y), Object.defineProperty(h, "prototype", { writable: !1 }), h; } function a(h) { var y = s(h, "string"); return typeof y == "symbol" ? y : String(y); } function s(h, y) { if (typeof h != "object" || h === null) return h; var x = h[Symbol.toPrimitive]; if (x !== void 0) { var g = x.call(h, y); if (typeof g != "object") return g; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(h); } var c = Os, u = c.Buffer, d = Pn, p = d.inspect, f = p && p.custom || "inspect"; function m(h, y, x) { u.prototype.copy.call(h, y, x); } return Zv = /* @__PURE__ */ (function() { function h() { r(this, h), this.head = null, this.tail = null, this.length = 0; } return o(h, [{ key: "push", value: function(x) { var g = { data: x, next: null }; this.length > 0 ? this.tail.next = g : this.head = g, this.tail = g, ++this.length; } }, { key: "unshift", value: function(x) { var g = { data: x, next: this.head }; this.length === 0 && (this.tail = g), this.head = g, ++this.length; } }, { key: "shift", value: function() { if (this.length !== 0) { var x = this.head.data; return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, x; } } }, { key: "clear", value: function() { this.head = this.tail = null, this.length = 0; } }, { key: "join", value: function(x) { if (this.length === 0) return ""; for (var g = this.head, b = "" + g.data; g = g.next; ) b += x + g.data; return b; } }, { key: "concat", value: function(x) { if (this.length === 0) return u.alloc(0); for (var g = u.allocUnsafe(x >>> 0), b = this.head, S = 0; b; ) m(b.data, g, S), S += b.data.length, b = b.next; return g; } // Consumes a specified amount of bytes or characters from the buffered data. }, { key: "consume", value: function(x, g) { var b; return x < this.head.data.length ? (b = this.head.data.slice(0, x), this.head.data = this.head.data.slice(x)) : x === this.head.data.length ? b = this.shift() : b = g ? this._getString(x) : this._getBuffer(x), b; } }, { key: "first", value: function() { return this.head.data; } // Consumes a specified amount of characters from the buffered data. }, { key: "_getString", value: function(x) { var g = this.head, b = 1, S = g.data; for (x -= S.length; g = g.next; ) { var E = g.data, T = x > E.length ? E.length : x; if (T === E.length ? S += E : S += E.slice(0, x), x -= T, x === 0) { T === E.length ? (++b, g.next ? this.head = g.next : this.head = this.tail = null) : (this.head = g, g.data = E.slice(T)); break; } ++b; } return this.length -= b, S; } // Consumes a specified amount of bytes from the buffered data. }, { key: "_getBuffer", value: function(x) { var g = u.allocUnsafe(x), b = this.head, S = 1; for (b.data.copy(g), x -= b.data.length; b = b.next; ) { var E = b.data, T = x > E.length ? E.length : x; if (E.copy(g, g.length - x, 0, T), x -= T, x === 0) { T === E.length ? (++S, b.next ? this.head = b.next : this.head = this.tail = null) : (this.head = b, b.data = E.slice(T)); break; } ++S; } return this.length -= S, g; } // Make sure the linked list only shows the minimal necessary information. }, { key: f, value: function(x, g) { return p(this, e(e({}, g), {}, { // Only inspect one level. depth: 0, // It should not recurse. customInspect: !1 })); } }]), h; })(), Zv; } var ex = {}, ik; function ok() { if (ik) return ex; ik = 1; var t = S0().Buffer, e = t.isEncoding || function(g) { switch (g = "" + g, g && g.toLowerCase()) { case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return !0; default: return !1; } }; function n(g) { if (!g) return "utf8"; for (var b; ; ) switch (g) { case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return g; default: if (b) return; g = ("" + g).toLowerCase(), b = !0; } } function r(g) { var b = n(g); if (typeof b != "string" && (t.isEncoding === e || !e(g))) throw new Error("Unknown encoding: " + g); return b || g; } ex.StringDecoder = i; function i(g) { this.encoding = r(g); var b; switch (this.encoding) { case "utf16le": this.text = p, this.end = f, b = 4; break; case "utf8": this.fillLast = c, b = 4; break; case "base64": this.text = m, this.end = h, b = 3; break; default: this.write = y, this.end = x; return; } this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(b); } i.prototype.write = function(g) { if (g.length === 0) return ""; var b, S; if (this.lastNeed) { if (b = this.fillLast(g), b === void 0) return ""; S = this.lastNeed, this.lastNeed = 0; } else S = 0; return S < g.length ? b ? b + this.text(g, S) : this.text(g, S) : b || ""; }, i.prototype.end = d, i.prototype.text = u, i.prototype.fillLast = function(g) { if (this.lastNeed <= g.length) return g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); g.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, g.length), this.lastNeed -= g.length; }; function o(g) { return g <= 127 ? 0 : g >> 5 === 6 ? 2 : g >> 4 === 14 ? 3 : g >> 3 === 30 ? 4 : g >> 6 === 2 ? -1 : -2; } function a(g, b, S) { var E = b.length - 1; if (E < S) return 0; var T = o(b[E]); return T >= 0 ? (T > 0 && (g.lastNeed = T - 1), T) : --E < S || T === -2 ? 0 : (T = o(b[E]), T >= 0 ? (T > 0 && (g.lastNeed = T - 2), T) : --E < S || T === -2 ? 0 : (T = o(b[E]), T >= 0 ? (T > 0 && (T === 2 ? T = 0 : g.lastNeed = T - 3), T) : 0)); } function s(g, b, S) { if ((b[0] & 192) !== 128) return g.lastNeed = 0, "�"; if (g.lastNeed > 1 && b.length > 1) { if ((b[1] & 192) !== 128) return g.lastNeed = 1, "�"; if (g.lastNeed > 2 && b.length > 2 && (b[2] & 192) !== 128) return g.lastNeed = 2, "�"; } } function c(g) { var b = this.lastTotal - this.lastNeed, S = s(this, g); if (S !== void 0) return S; if (this.lastNeed <= g.length) return g.copy(this.lastChar, b, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal); g.copy(this.lastChar, b, 0, g.length), this.lastNeed -= g.length; } function u(g, b) { var S = a(this, g, b); if (!this.lastNeed) return g.toString("utf8", b); this.lastTotal = S; var E = g.length - (S - this.lastNeed); return g.copy(this.lastChar, 0, E), g.toString("utf8", b, E); } function d(g) { var b = g && g.length ? this.write(g) : ""; return this.lastNeed ? b + "�" : b; } function p(g, b) { if ((g.length - b) % 2 === 0) { var S = g.toString("utf16le", b); if (S) { var E = S.charCodeAt(S.length - 1); if (E >= 55296 && E <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1], S.slice(0, -1); } return S; } return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = g[g.length - 1], g.toString("utf16le", b, g.length - 1); } function f(g) { var b = g && g.length ? this.write(g) : ""; if (this.lastNeed) { var S = this.lastTotal - this.lastNeed; return b + this.lastChar.toString("utf16le", 0, S); } return b; } function m(g, b) { var S = (g.length - b) % 3; return S === 0 ? g.toString("base64", b) : (this.lastNeed = 3 - S, this.lastTotal = 3, S === 1 ? this.lastChar[0] = g[g.length - 1] : (this.lastChar[0] = g[g.length - 2], this.lastChar[1] = g[g.length - 1]), g.toString("base64", b, g.length - S)); } function h(g) { var b = g && g.length ? this.write(g) : ""; return this.lastNeed ? b + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : b; } function y(g) { return g.toString(this.encoding); } function x(g) { return g && g.length ? this.write(g) : ""; } return ex; } var tx, ak; function hE() { if (ak) return tx; ak = 1; var t = vl().codes.ERR_STREAM_PREMATURE_CLOSE; function e(o) { var a = !1; return function() { if (!a) { a = !0; for (var s = arguments.length, c = new Array(s), u = 0; u < s; u++) c[u] = arguments[u]; o.apply(this, c); } }; } function n() { } function r(o) { return o.setHeader && typeof o.abort == "function"; } function i(o, a, s) { if (typeof a == "function") return i(o, null, a); a || (a = {}), s = e(s || n); var c = a.readable || a.readable !== !1 && o.readable, u = a.writable || a.writable !== !1 && o.writable, d = function() { o.writable || f(); }, p = o._writableState && o._writableState.finished, f = function() { u = !1, p = !0, c || s.call(o); }, m = o._readableState && o._readableState.endEmitted, h = function() { c = !1, m = !0, u || s.call(o); }, y = function(S) { s.call(o, S); }, x = function() { var S; if (c && !m) return (!o._readableState || !o._readableState.ended) && (S = new t()), s.call(o, S); if (u && !p) return (!o._writableState || !o._writableState.ended) && (S = new t()), s.call(o, S); }, g = function() { o.req.on("finish", f); }; return r(o) ? (o.on("complete", f), o.on("abort", x), o.req ? g() : o.on("request", g)) : u && !o._writableState && (o.on("end", d), o.on("close", d)), o.on("end", h), o.on("finish", f), a.error !== !1 && o.on("error", y), o.on("close", x), function() { o.removeListener("complete", f), o.removeListener("abort", x), o.removeListener("request", g), o.req && o.req.removeListener("finish", f), o.removeListener("end", d), o.removeListener("close", d), o.removeListener("finish", f), o.removeListener("end", h), o.removeListener("error", y), o.removeListener("close", x); }; } return tx = i, tx; } var nx, sk; function dJ() { if (sk) return nx; sk = 1; var t; function e(S, E, T) { return E = n(E), E in S ? Object.defineProperty(S, E, { value: T, enumerable: !0, configurable: !0, writable: !0 }) : S[E] = T, S; } function n(S) { var E = r(S, "string"); return typeof E == "symbol" ? E : String(E); } function r(S, E) { if (typeof S != "object" || S === null) return S; var T = S[Symbol.toPrimitive]; if (T !== void 0) { var U = T.call(S, E); if (typeof U != "object") return U; throw new TypeError("@@toPrimitive must return a primitive value."); } return (E === "string" ? String : Number)(S); } var i = hE(), o = Symbol("lastResolve"), a = Symbol("lastReject"), s = Symbol("error"), c = Symbol("ended"), u = Symbol("lastPromise"), d = Symbol("handlePromise"), p = Symbol("stream"); function f(S, E) { return { value: S, done: E }; } function m(S) { var E = S[o]; if (E !== null) { var T = S[p].read(); T !== null && (S[u] = null, S[o] = null, S[a] = null, E(f(T, !1))); } } function h(S) { process.nextTick(m, S); } function y(S, E) { return function(T, U) { S.then(function() { if (E[c]) { T(f(void 0, !0)); return; } E[d](T, U); }, U); }; } var x = Object.getPrototypeOf(function() { }), g = Object.setPrototypeOf((t = { get stream() { return this[p]; }, next: function() { var E = this, T = this[s]; if (T !== null) return Promise.reject(T); if (this[c]) return Promise.resolve(f(void 0, !0)); if (this[p].destroyed) return new Promise(function(H, G) { process.nextTick(function() { E[s] ? G(E[s]) : H(f(void 0, !0)); }); }); var U = this[u], q; if (U) q = new Promise(y(U, this)); else { var Y = this[p].read(); if (Y !== null) return Promise.resolve(f(Y, !1)); q = new Promise(this[d]); } return this[u] = q, q; } }, e(t, Symbol.asyncIterator, function() { return this; }), e(t, "return", function() { var E = this; return new Promise(function(T, U) { E[p].destroy(null, function(q) { if (q) { U(q); return; } T(f(void 0, !0)); }); }); }), t), x), b = function(E) { var T, U = Object.create(g, (T = {}, e(T, p, { value: E, writable: !0 }), e(T, o, { value: null, writable: !0 }), e(T, a, { value: null, writable: !0 }), e(T, s, { value: null, writable: !0 }), e(T, c, { value: E._readableState.endEmitted, writable: !0 }), e(T, d, { value: function(Y, H) { var G = U[p].read(); G ? (U[u] = null, U[o] = null, U[a] = null, Y(f(G, !1))) : (U[o] = Y, U[a] = H); }, writable: !0 }), T)); return U[u] = null, i(E, function(q) { if (q && q.code !== "ERR_STREAM_PREMATURE_CLOSE") { var Y = U[a]; Y !== null && (U[u] = null, U[o] = null, U[a] = null, Y(q)), U[s] = q; return; } var H = U[o]; H !== null && (U[u] = null, U[o] = null, U[a] = null, H(f(void 0, !0))), U[c] = !0; }), E.on("readable", h.bind(null, U)), U; }; return nx = b, nx; } var rx, ck; function pJ() { return ck || (ck = 1, rx = function() { throw new Error("Readable.from is not available in the browser"); }), rx; } var ix, uk; function fM() { if (uk) return ix; uk = 1, ix = H; var t; H.ReadableState = Y, Qa.EventEmitter; var e = function(j, W) { return j.listeners(W).length; }, n = lM(), r = Os.Buffer, i = (typeof $n < "u" ? $n : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() { }; function o(P) { return r.from(P); } function a(P) { return r.isBuffer(P) || P instanceof i; } var s = Pn, c; s && s.debuglog ? c = s.debuglog("stream") : c = function() { }; var u = lJ(), d = dM(), p = pM(), f = p.getHighWaterMark, m = vl().codes, h = m.ERR_INVALID_ARG_TYPE, y = m.ERR_STREAM_PUSH_AFTER_EOF, x = m.ERR_METHOD_NOT_IMPLEMENTED, g = m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT, b, S, E; Do()(H, n); var T = d.errorOrDestroy, U = ["error", "close", "destroy", "pause", "resume"]; function q(P, j, W) { if (typeof P.prependListener == "function") return P.prependListener(j, W); !P._events || !P._events[j] ? P.on(j, W) : Array.isArray(P._events[j]) ? P._events[j].unshift(W) : P._events[j] = [W, P._events[j]]; } function Y(P, j, W) { t = t || Bu(), P = P || {}, typeof W != "boolean" && (W = j instanceof t), this.objectMode = !!P.objectMode, W && (this.objectMode = this.objectMode || !!P.readableObjectMode), this.highWaterMark = f(this, P, "readableHighWaterMark", W), this.buffer = new u(), this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = P.emitClose !== !1, this.autoDestroy = !!P.autoDestroy, this.destroyed = !1, this.defaultEncoding = P.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, P.encoding && (b || (b = ok().StringDecoder), this.decoder = new b(P.encoding), this.encoding = P.encoding); } function H(P) { if (t = t || Bu(), !(this instanceof H)) return new H(P); var j = this instanceof t; this._readableState = new Y(P, this, j), this.readable = !0, P && (typeof P.read == "function" && (this._read = P.read), typeof P.destroy == "function" && (this._destroy = P.destroy)), n.call(this); } Object.defineProperty(H.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState === void 0 ? !1 : this._readableState.destroyed; }, set: function(j) { this._readableState && (this._readableState.destroyed = j); } }), H.prototype.destroy = d.destroy, H.prototype._undestroy = d.undestroy, H.prototype._destroy = function(P, j) { j(P); }, H.prototype.push = function(P, j) { var W = this._readableState, se; return W.objectMode ? se = !0 : typeof P == "string" && (j = j || W.defaultEncoding, j !== W.encoding && (P = r.from(P, j), j = ""), se = !0), G(this, P, j, !1, se); }, H.prototype.unshift = function(P) { return G(this, P, null, !0, !1); }; function G(P, j, W, se, ce) { c("readableAddChunk", j); var oe = P._readableState; if (j === null) oe.reading = !1, K(P, oe); else { var we; if (ce || (we = B(oe, j)), we) T(P, we); else if (oe.objectMode || j && j.length > 0) if (typeof j != "string" && !oe.objectMode && Object.getPrototypeOf(j) !== r.prototype && (j = o(j)), se) oe.endEmitted ? T(P, new g()) : J(P, oe, j, !0); else if (oe.ended) T(P, new y()); else { if (oe.destroyed) return !1; oe.reading = !1, oe.decoder && !W ? (j = oe.decoder.write(j), oe.objectMode || j.length !== 0 ? J(P, oe, j, !1) : I(P, oe)) : J(P, oe, j, !1); } else se || (oe.reading = !1, I(P, oe)); } return !oe.ended && (oe.length < oe.highWaterMark || oe.length === 0); } function J(P, j, W, se) { j.flowing && j.length === 0 && !j.sync ? (j.awaitDrain = 0, P.emit("data", W)) : (j.length += j.objectMode ? 1 : W.length, se ? j.buffer.unshift(W) : j.buffer.push(W), j.needReadable && $(P)), I(P, j); } function B(P, j) { var W; return !a(j) && typeof j != "string" && j !== void 0 && !P.objectMode && (W = new h("chunk", ["string", "Buffer", "Uint8Array"], j)), W; } H.prototype.isPaused = function() { return this._readableState.flowing === !1; }, H.prototype.setEncoding = function(P) { b || (b = ok().StringDecoder); var j = new b(P); this._readableState.decoder = j, this._readableState.encoding = this._readableState.decoder.encoding; for (var W = this._readableState.buffer.head, se = ""; W !== null; ) se += j.write(W.data), W = W.next; return this._readableState.buffer.clear(), se !== "" && this._readableState.buffer.push(se), this._readableState.length = se.length, this; }; var D = 1073741824; function X(P) { return P >= D ? P = D : (P--, P |= P >>> 1, P |= P >>> 2, P |= P >>> 4, P |= P >>> 8, P |= P >>> 16, P++), P; } function V(P, j) { return P <= 0 || j.length === 0 && j.ended ? 0 : j.objectMode ? 1 : P !== P ? j.flowing && j.length ? j.buffer.head.data.length : j.length : (P > j.highWaterMark && (j.highWaterMark = X(P)), P <= j.length ? P : j.ended ? j.length : (j.needReadable = !0, 0)); } H.prototype.read = function(P) { c("read", P), P = parseInt(P, 10); var j = this._readableState, W = P; if (P !== 0 && (j.emittedReadable = !1), P === 0 && j.needReadable && ((j.highWaterMark !== 0 ? j.length >= j.highWaterMark : j.length > 0) || j.ended)) return c("read: emitReadable", j.length, j.ended), j.length === 0 && j.ended ? F(this) : $(this), null; if (P = V(P, j), P === 0 && j.ended) return j.length === 0 && F(this), null; var se = j.needReadable; c("need readable", se), (j.length === 0 || j.length - P < j.highWaterMark) && (se = !0, c("length less than watermark", se)), j.ended || j.reading ? (se = !1, c("reading or ended", se)) : se && (c("do read"), j.reading = !0, j.sync = !0, j.length === 0 && (j.needReadable = !0), this._read(j.highWaterMark), j.sync = !1, j.reading || (P = V(W, j))); var ce; return P > 0 ? ce = A(P, j) : ce = null, ce === null ? (j.needReadable = j.length <= j.highWaterMark, P = 0) : (j.length -= P, j.awaitDrain = 0), j.length === 0 && (j.ended || (j.needReadable = !0), W !== P && j.ended && F(this)), ce !== null && this.emit("data", ce), ce; }; function K(P, j) { if (c("onEofChunk"), !j.ended) { if (j.decoder) { var W = j.decoder.end(); W && W.length && (j.buffer.push(W), j.length += j.objectMode ? 1 : W.length); } j.ended = !0, j.sync ? $(P) : (j.needReadable = !1, j.emittedReadable || (j.emittedReadable = !0, _(P))); } } function $(P) { var j = P._readableState; c("emitReadable", j.needReadable, j.emittedReadable), j.needReadable = !1, j.emittedReadable || (c("emitReadable", j.flowing), j.emittedReadable = !0, process.nextTick(_, P)); } function _(P) { var j = P._readableState; c("emitReadable_", j.destroyed, j.length, j.ended), !j.destroyed && (j.length || j.ended) && (P.emit("readable"), j.emittedReadable = !1), j.needReadable = !j.flowing && !j.ended && j.length <= j.highWaterMark, O(P); } function I(P, j) { j.readingMore || (j.readingMore = !0, process.nextTick(N, P, j)); } function N(P, j) { for (; !j.reading && !j.ended && (j.length < j.highWaterMark || j.flowing && j.length === 0); ) { var W = j.length; if (c("maybeReadMore read 0"), P.read(0), W === j.length) break; } j.readingMore = !1; } H.prototype._read = function(P) { T(this, new x("_read()")); }, H.prototype.pipe = function(P, j) { var W = this, se = this._readableState; switch (se.pipesCount) { case 0: se.pipes = P; break; case 1: se.pipes = [se.pipes, P]; break; default: se.pipes.push(P); break; } se.pipesCount += 1, c("pipe count=%d opts=%j", se.pipesCount, j); var ce = (!j || j.end !== !1) && P !== process.stdout && P !== process.stderr, oe = ce ? Me : Or; se.endEmitted ? process.nextTick(oe) : W.once("end", oe), P.on("unpipe", we); function we(ut, lr) { c("onunpipe"), ut === W && lr && lr.hasUnpiped === !1 && (lr.hasUnpiped = !0, Xe()); } function Me() { c("onend"), P.end(); } var He = L(W); P.on("drain", He); var We = !1; function Xe() { c("cleanup"), P.removeListener("close", ze), P.removeListener("finish", Ft), P.removeListener("drain", He), P.removeListener("error", it), P.removeListener("unpipe", we), W.removeListener("end", Me), W.removeListener("end", Or), W.removeListener("data", Ye), We = !0, se.awaitDrain && (!P._writableState || P._writableState.needDrain) && He(); } W.on("data", Ye); function Ye(ut) { c("ondata"); var lr = P.write(ut); c("dest.write", lr), lr === !1 && ((se.pipesCount === 1 && se.pipes === P || se.pipesCount > 1 && ee(se.pipes, P) !== -1) && !We && (c("false write response, pause", se.awaitDrain), se.awaitDrain++), W.pause()); } function it(ut) { c("onerror", ut), Or(), P.removeListener("error", it), e(P, "error") === 0 && T(P, ut); } q(P, "error", it); function ze() { P.removeListener("finish", Ft), Or(); } P.once("close", ze); function Ft() { c("onfinish"), P.removeListener("close", ze), Or(); } P.once("finish", Ft); function Or() { c("unpipe"), W.unpipe(P); } return P.emit("pipe", W), se.flowing || (c("pipe resume"), W.resume()), P; }; function L(P) { return function() { var W = P._readableState; c("pipeOnDrain", W.awaitDrain), W.awaitDrain && W.awaitDrain--, W.awaitDrain === 0 && e(P, "data") && (W.flowing = !0, O(P)); }; } H.prototype.unpipe = function(P) { var j = this._readableState, W = { hasUnpiped: !1 }; if (j.pipesCount === 0) return this; if (j.pipesCount === 1) return P && P !== j.pipes ? this : (P || (P = j.pipes), j.pipes = null, j.pipesCount = 0, j.flowing = !1, P && P.emit("unpipe", this, W), this); if (!P) { var se = j.pipes, ce = j.pipesCount; j.pipes = null, j.pipesCount = 0, j.flowing = !1; for (var oe = 0; oe < ce; oe++) se[oe].emit("unpipe", this, { hasUnpiped: !1 }); return this; } var we = ee(j.pipes, P); return we === -1 ? this : (j.pipes.splice(we, 1), j.pipesCount -= 1, j.pipesCount === 1 && (j.pipes = j.pipes[0]), P.emit("unpipe", this, W), this); }, H.prototype.on = function(P, j) { var W = n.prototype.on.call(this, P, j), se = this._readableState; return P === "data" ? (se.readableListening = this.listenerCount("readable") > 0, se.flowing !== !1 && this.resume()) : P === "readable" && !se.endEmitted && !se.readableListening && (se.readableListening = se.needReadable = !0, se.flowing = !1, se.emittedReadable = !1, c("on readable", se.length, se.reading), se.length ? $(this) : se.reading || process.nextTick(Q, this)), W; }, H.prototype.addListener = H.prototype.on, H.prototype.removeListener = function(P, j) { var W = n.prototype.removeListener.call(this, P, j); return P === "readable" && process.nextTick(C, this), W; }, H.prototype.removeAllListeners = function(P) { var j = n.prototype.removeAllListeners.apply(this, arguments); return (P === "readable" || P === void 0) && process.nextTick(C, this), j; }; function C(P) { var j = P._readableState; j.readableListening = P.listenerCount("readable") > 0, j.resumeScheduled && !j.paused ? j.flowing = !0 : P.listenerCount("data") > 0 && P.resume(); } function Q(P) { c("readable nexttick read 0"), P.read(0); } H.prototype.resume = function() { var P = this._readableState; return P.flowing || (c("resume"), P.flowing = !P.readableListening, k(this, P)), P.paused = !1, this; }; function k(P, j) { j.resumeScheduled || (j.resumeScheduled = !0, process.nextTick(M, P, j)); } function M(P, j) { c("resume", j.reading), j.reading || P.read(0), j.resumeScheduled = !1, P.emit("resume"), O(P), j.flowing && !j.reading && P.read(0); } H.prototype.pause = function() { return c("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (c("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this; }; function O(P) { var j = P._readableState; for (c("flow", j.flowing); j.flowing && P.read() !== null; ) ; } H.prototype.wrap = function(P) { var j = this, W = this._readableState, se = !1; P.on("end", function() { if (c("wrapped end"), W.decoder && !W.ended) { var we = W.decoder.end(); we && we.length && j.push(we); } j.push(null); }), P.on("data", function(we) { if (c("wrapped data"), W.decoder && (we = W.decoder.write(we)), !(W.objectMode && we == null) && !(!W.objectMode && (!we || !we.length))) { var Me = j.push(we); Me || (se = !0, P.pause()); } }); for (var ce in P) this[ce] === void 0 && typeof P[ce] == "function" && (this[ce] = /* @__PURE__ */ (function(Me) { return function() { return P[Me].apply(P, arguments); }; })(ce)); for (var oe = 0; oe < U.length; oe++) P.on(U[oe], this.emit.bind(this, U[oe])); return this._read = function(we) { c("wrapped _read", we), se && (se = !1, P.resume()); }, this; }, typeof Symbol == "function" && (H.prototype[Symbol.asyncIterator] = function() { return S === void 0 && (S = dJ()), S(this); }), Object.defineProperty(H.prototype, "readableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState.highWaterMark; } }), Object.defineProperty(H.prototype, "readableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState && this._readableState.buffer; } }), Object.defineProperty(H.prototype, "readableFlowing", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState.flowing; }, set: function(j) { this._readableState && (this._readableState.flowing = j); } }), H._fromList = A, Object.defineProperty(H.prototype, "readableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState.length; } }); function A(P, j) { if (j.length === 0) return null; var W; return j.objectMode ? W = j.buffer.shift() : !P || P >= j.length ? (j.decoder ? W = j.buffer.join("") : j.buffer.length === 1 ? W = j.buffer.first() : W = j.buffer.concat(j.length), j.buffer.clear()) : W = j.buffer.consume(P, j.decoder), W; } function F(P) { var j = P._readableState; c("endReadable", j.endEmitted), j.endEmitted || (j.ended = !0, process.nextTick(Z, j, P)); } function Z(P, j) { if (c("endReadableNT", P.endEmitted, P.length), !P.endEmitted && P.length === 0 && (P.endEmitted = !0, j.readable = !1, j.emit("end"), P.autoDestroy)) { var W = j._writableState; (!W || W.autoDestroy && W.finished) && j.destroy(); } } typeof Symbol == "function" && (H.from = function(P, j) { return E === void 0 && (E = pJ()), E(H, P, j); }); function ee(P, j) { for (var W = 0, se = P.length; W < se; W++) if (P[W] === j) return W; return -1; } return ix; } var ox, lk; function Bu() { if (lk) return ox; lk = 1; var t = Object.keys || function(u) { var d = []; for (var p in u) d.push(p); return d; }; ox = a; var e = fM(), n = T0(); Do()(a, e); for (var r = t(n.prototype), i = 0; i < r.length; i++) { var o = r[i]; a.prototype[o] || (a.prototype[o] = n.prototype[o]); } function a(u) { if (!(this instanceof a)) return new a(u); e.call(this, u), n.call(this, u), this.allowHalfOpen = !0, u && (u.readable === !1 && (this.readable = !1), u.writable === !1 && (this.writable = !1), u.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", s))); } Object.defineProperty(a.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.highWaterMark; } }), Object.defineProperty(a.prototype, "writableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState && this._writableState.getBuffer(); } }), Object.defineProperty(a.prototype, "writableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.length; } }); function s() { this._writableState.ended || process.nextTick(c, this); } function c(u) { u.end(); } return Object.defineProperty(a.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed; }, set: function(d) { this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = d, this._writableState.destroyed = d); } }), ox; } var ax, dk; function T0() { if (dk) return ax; dk = 1, ax = Y; function t(O) { var A = this; this.next = null, this.entry = null, this.finish = function() { M(A, O); }; } var e; Y.WritableState = U; var n = { deprecate: PF() }, r = lM(), i = Os.Buffer, o = (typeof $n < "u" ? $n : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function() { }; function a(O) { return i.from(O); } function s(O) { return i.isBuffer(O) || O instanceof o; } var c = dM(), u = pM(), d = u.getHighWaterMark, p = vl().codes, f = p.ERR_INVALID_ARG_TYPE, m = p.ERR_METHOD_NOT_IMPLEMENTED, h = p.ERR_MULTIPLE_CALLBACK, y = p.ERR_STREAM_CANNOT_PIPE, x = p.ERR_STREAM_DESTROYED, g = p.ERR_STREAM_NULL_VALUES, b = p.ERR_STREAM_WRITE_AFTER_END, S = p.ERR_UNKNOWN_ENCODING, E = c.errorOrDestroy; Do()(Y, r); function T() { } function U(O, A, F) { e = e || Bu(), O = O || {}, typeof F != "boolean" && (F = A instanceof e), this.objectMode = !!O.objectMode, F && (this.objectMode = this.objectMode || !!O.writableObjectMode), this.highWaterMark = d(this, O, "writableHighWaterMark", F), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1; var Z = O.decodeStrings === !1; this.decodeStrings = !Z, this.defaultEncoding = O.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function(ee) { K(A, ee); }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = O.emitClose !== !1, this.autoDestroy = !!O.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new t(this); } U.prototype.getBuffer = function() { for (var A = this.bufferedRequest, F = []; A; ) F.push(A), A = A.next; return F; }, (function() { try { Object.defineProperty(U.prototype, "buffer", { get: n.deprecate(function() { return this.getBuffer(); }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") }); } catch { } })(); var q; typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (q = Function.prototype[Symbol.hasInstance], Object.defineProperty(Y, Symbol.hasInstance, { value: function(A) { return q.call(this, A) ? !0 : this !== Y ? !1 : A && A._writableState instanceof U; } })) : q = function(A) { return A instanceof this; }; function Y(O) { e = e || Bu(); var A = this instanceof e; if (!A && !q.call(Y, this)) return new Y(O); this._writableState = new U(O, this, A), this.writable = !0, O && (typeof O.write == "function" && (this._write = O.write), typeof O.writev == "function" && (this._writev = O.writev), typeof O.destroy == "function" && (this._destroy = O.destroy), typeof O.final == "function" && (this._final = O.final)), r.call(this); } Y.prototype.pipe = function() { E(this, new y()); }; function H(O, A) { var F = new b(); E(O, F), process.nextTick(A, F); } function G(O, A, F, Z) { var ee; return F === null ? ee = new g() : typeof F != "string" && !A.objectMode && (ee = new f("chunk", ["string", "Buffer"], F)), ee ? (E(O, ee), process.nextTick(Z, ee), !1) : !0; } Y.prototype.write = function(O, A, F) { var Z = this._writableState, ee = !1, P = !Z.objectMode && s(O); return P && !i.isBuffer(O) && (O = a(O)), typeof A == "function" && (F = A, A = null), P ? A = "buffer" : A || (A = Z.defaultEncoding), typeof F != "function" && (F = T), Z.ending ? H(this, F) : (P || G(this, Z, O, F)) && (Z.pendingcb++, ee = B(this, Z, P, O, A, F)), ee; }, Y.prototype.cork = function() { this._writableState.corked++; }, Y.prototype.uncork = function() { var O = this._writableState; O.corked && (O.corked--, !O.writing && !O.corked && !O.bufferProcessing && O.bufferedRequest && I(this, O)); }, Y.prototype.setDefaultEncoding = function(A) { if (typeof A == "string" && (A = A.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((A + "").toLowerCase()) > -1)) throw new S(A); return this._writableState.defaultEncoding = A, this; }, Object.defineProperty(Y.prototype, "writableBuffer", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState && this._writableState.getBuffer(); } }); function J(O, A, F) { return !O.objectMode && O.decodeStrings !== !1 && typeof A == "string" && (A = i.from(A, F)), A; } Object.defineProperty(Y.prototype, "writableHighWaterMark", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.highWaterMark; } }); function B(O, A, F, Z, ee, P) { if (!F) { var j = J(A, Z, ee); Z !== j && (F = !0, ee = "buffer", Z = j); } var W = A.objectMode ? 1 : Z.length; A.length += W; var se = A.length < A.highWaterMark; if (se || (A.needDrain = !0), A.writing || A.corked) { var ce = A.lastBufferedRequest; A.lastBufferedRequest = { chunk: Z, encoding: ee, isBuf: F, callback: P, next: null }, ce ? ce.next = A.lastBufferedRequest : A.bufferedRequest = A.lastBufferedRequest, A.bufferedRequestCount += 1; } else D(O, A, !1, W, Z, ee, P); return se; } function D(O, A, F, Z, ee, P, j) { A.writelen = Z, A.writecb = j, A.writing = !0, A.sync = !0, A.destroyed ? A.onwrite(new x("write")) : F ? O._writev(ee, A.onwrite) : O._write(ee, P, A.onwrite), A.sync = !1; } function X(O, A, F, Z, ee) { --A.pendingcb, F ? (process.nextTick(ee, Z), process.nextTick(Q, O, A), O._writableState.errorEmitted = !0, E(O, Z)) : (ee(Z), O._writableState.errorEmitted = !0, E(O, Z), Q(O, A)); } function V(O) { O.writing = !1, O.writecb = null, O.length -= O.writelen, O.writelen = 0; } function K(O, A) { var F = O._writableState, Z = F.sync, ee = F.writecb; if (typeof ee != "function") throw new h(); if (V(F), A) X(O, F, Z, A, ee); else { var P = N(F) || O.destroyed; !P && !F.corked && !F.bufferProcessing && F.bufferedRequest && I(O, F), Z ? process.nextTick($, O, F, P, ee) : $(O, F, P, ee); } } function $(O, A, F, Z) { F || _(O, A), A.pendingcb--, Z(), Q(O, A); } function _(O, A) { A.length === 0 && A.needDrain && (A.needDrain = !1, O.emit("drain")); } function I(O, A) { A.bufferProcessing = !0; var F = A.bufferedRequest; if (O._writev && F && F.next) { var Z = A.bufferedRequestCount, ee = new Array(Z), P = A.corkedRequestsFree; P.entry = F; for (var j = 0, W = !0; F; ) ee[j] = F, F.isBuf || (W = !1), F = F.next, j += 1; ee.allBuffers = W, D(O, A, !0, A.length, ee, "", P.finish), A.pendingcb++, A.lastBufferedRequest = null, P.next ? (A.corkedRequestsFree = P.next, P.next = null) : A.corkedRequestsFree = new t(A), A.bufferedRequestCount = 0; } else { for (; F; ) { var se = F.chunk, ce = F.encoding, oe = F.callback, we = A.objectMode ? 1 : se.length; if (D(O, A, !1, we, se, ce, oe), F = F.next, A.bufferedRequestCount--, A.writing) break; } F === null && (A.lastBufferedRequest = null); } A.bufferedRequest = F, A.bufferProcessing = !1; } Y.prototype._write = function(O, A, F) { F(new m("_write()")); }, Y.prototype._writev = null, Y.prototype.end = function(O, A, F) { var Z = this._writableState; return typeof O == "function" ? (F = O, O = null, A = null) : typeof A == "function" && (F = A, A = null), O != null && this.write(O, A), Z.corked && (Z.corked = 1, this.uncork()), Z.ending || k(this, Z, F), this; }, Object.defineProperty(Y.prototype, "writableLength", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState.length; } }); function N(O) { return O.ending && O.length === 0 && O.bufferedRequest === null && !O.finished && !O.writing; } function L(O, A) { O._final(function(F) { A.pendingcb--, F && E(O, F), A.prefinished = !0, O.emit("prefinish"), Q(O, A); }); } function C(O, A) { !A.prefinished && !A.finalCalled && (typeof O._final == "function" && !A.destroyed ? (A.pendingcb++, A.finalCalled = !0, process.nextTick(L, O, A)) : (A.prefinished = !0, O.emit("prefinish"))); } function Q(O, A) { var F = N(A); if (F && (C(O, A), A.pendingcb === 0 && (A.finished = !0, O.emit("finish"), A.autoDestroy))) { var Z = O._readableState; (!Z || Z.autoDestroy && Z.endEmitted) && O.destroy(); } return F; } function k(O, A, F) { A.ending = !0, Q(O, A), F && (A.finished ? process.nextTick(F) : O.once("finish", F)), A.ended = !0, O.writable = !1; } function M(O, A, F) { var Z = O.entry; for (O.entry = null; Z; ) { var ee = Z.callback; A.pendingcb--, ee(F), Z = Z.next; } A.corkedRequestsFree.next = O; } return Object.defineProperty(Y.prototype, "destroyed", { // making it explicit this property is not enumerable // because otherwise some prototype manipulation in // userland will fail enumerable: !1, get: function() { return this._writableState === void 0 ? !1 : this._writableState.destroyed; }, set: function(A) { this._writableState && (this._writableState.destroyed = A); } }), Y.prototype.destroy = c.destroy, Y.prototype._undestroy = c.undestroy, Y.prototype._destroy = function(O, A) { A(O); }, ax; } var pk; function hM() { if (pk) return Kv.exports; pk = 1; var t = Pn, e = T0(), n = dn(), r = n.LEVEL, i = Kv.exports = function() { var a = this, s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e.call(this, { objectMode: !0, highWaterMark: s.highWaterMark }), this.format = s.format, this.level = s.level, this.handleExceptions = s.handleExceptions, this.handleRejections = s.handleRejections, this.silent = s.silent, s.log && (this.log = s.log), s.logv && (this.logv = s.logv), s.close && (this.close = s.close), this.once("pipe", function(c) { a.levels = c.levels, a.parent = c; }), this.once("unpipe", function(c) { c === a.parent && (a.parent = null, a.close && a.close()); }); }; return t.inherits(i, e), i.prototype._write = function(a, s, c) { if (this.silent || a.exception === !0 && !this.handleExceptions) return c(null); var u = this.level || this.parent && this.parent.level; if (!u || this.levels[u] >= this.levels[a[r]]) { if (a && !this.format) return this.log(a, c); var d = void 0, p = void 0; try { p = this.format.transform(Object.assign({}, a), this.format.options); } catch (f) { d = f; } if (d || !p) { if (c(), d) throw d; return; } return this.log(p, c); } return this._writableState.sync = !1, c(null); }, i.prototype._writev = function(a, s) { if (this.logv) { var c = a.filter(this._accept, this); return c.length ? this.logv(c, s) : s(null); } for (var u = 0; u < a.length; u++) if (this._accept(a[u])) { if (a[u].chunk && !this.format) { this.log(a[u].chunk, a[u].callback); continue; } var d = void 0, p = void 0; try { p = this.format.transform(Object.assign({}, a[u].chunk), this.format.options); } catch (f) { d = f; } if (d || !p) { if (a[u].callback(), d) throw s(null), d; } else this.log(p, a[u].callback); } return s(null); }, i.prototype._accept = function(a) { var s = a.chunk; if (this.silent) return !1; var c = this.level || this.parent && this.parent.level; return !!((s.exception === !0 || !c || this.levels[c] >= this.levels[s[r]]) && (this.handleExceptions || s.exception !== !0)); }, i.prototype._nop = function() { }, Kv.exports; } var sx = { exports: {} }, fk; function fJ() { if (fk) return sx.exports; fk = 1; var t = Pn, e = dn(), n = e.LEVEL, r = hM(), i = sx.exports = function() { var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; if (r.call(this, a), !a.transport || typeof a.transport.log != "function") throw new Error("Invalid transport, must be an object with a log method."); this.transport = a.transport, this.level = this.level || a.transport.level, this.handleExceptions = this.handleExceptions || a.transport.handleExceptions, this._deprecated(); function s(c) { this.emit("error", c, this.transport); } this.transport.__winstonError || (this.transport.__winstonError = s.bind(this), this.transport.on("error", this.transport.__winstonError)); }; return t.inherits(i, r), i.prototype._write = function(a, s, c) { if (this.silent || a.exception === !0 && !this.handleExceptions) return c(null); (!this.level || this.levels[this.level] >= this.levels[a[n]]) && this.transport.log(a[n], a.message, a, this._nop), c(null); }, i.prototype._writev = function(a, s) { for (var c = 0; c < a.length; c++) this._accept(a[c]) && (this.transport.log(a[c].chunk[n], a[c].chunk.message, a[c].chunk, this._nop), a[c].callback()); return s(null); }, i.prototype._deprecated = function() { console.error([this.transport.name + " is a legacy winston transport. Consider upgrading: ", "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(` `)); }, i.prototype.close = function() { this.transport.close && this.transport.close(), this.transport.__winstonError && (this.transport.removeListener("error", this.transport.__winstonError), this.transport.__winstonError = null); }, sx.exports; } var hk; function rf() { return hk || (hk = 1, Ch.exports = hM(), Ch.exports.LegacyTransportStream = fJ()), Ch.exports; } var cx, mk; function hJ() { if (mk) return cx; mk = 1; function t(b) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) { return typeof S; } : function(S) { return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S; }, t(b); } function e(b, S) { if (!(b instanceof S)) throw new TypeError("Cannot call a class as a function"); } function n(b, S) { for (var E = 0; E < S.length; E++) { var T = S[E]; T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(b, i(T.key), T); } } function r(b, S, E) { return S && n(b.prototype, S), Object.defineProperty(b, "prototype", { writable: !1 }), b; } function i(b) { var S = o(b, "string"); return t(S) == "symbol" ? S : S + ""; } function o(b, S) { if (t(b) != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var T = E.call(b, S); if (t(T) != "object") return T; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); } function a(b, S, E) { return S = d(S), s(b, u() ? Reflect.construct(S, E || [], d(b).constructor) : S.apply(b, E)); } function s(b, S) { if (S && (t(S) == "object" || typeof S == "function")) return S; if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return c(b); } function c(b) { if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return b; } function u() { try { var b = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!b; })(); } function d(b) { return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) { return S.__proto__ || Object.getPrototypeOf(S); }, d(b); } function p(b, S) { if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function"); b.prototype = Object.create(S && S.prototype, { constructor: { value: b, writable: !0, configurable: !0 } }), Object.defineProperty(b, "prototype", { writable: !1 }), S && f(b, S); } function f(b, S) { return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(E, T) { return E.__proto__ = T, E; }, f(b, S); } var m = Ln, h = dn(), y = h.LEVEL, x = h.MESSAGE, g = rf(); return cx = /* @__PURE__ */ (function(b) { function S() { var E, T = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return e(this, S), E = a(this, S, [T]), E.name = T.name || "console", E.stderrLevels = E._stringArrayToSet(T.stderrLevels), E.consoleWarnLevels = E._stringArrayToSet(T.consoleWarnLevels), E.eol = typeof T.eol == "string" ? T.eol : m.EOL, E.forceConsole = T.forceConsole || !1, E._consoleLog = console.log.bind(console), E._consoleWarn = console.warn.bind(console), E._consoleError = console.error.bind(console), E.setMaxListeners(30), E; } return p(S, b), r(S, [{ key: "log", value: function(T, U) { var q = this; if (setImmediate(function() { return q.emit("logged", T); }), this.stderrLevels[T[y]]) { console._stderr && !this.forceConsole ? console._stderr.write("".concat(T[x]).concat(this.eol)) : this._consoleError(T[x]), U && U(); return; } else if (this.consoleWarnLevels[T[y]]) { console._stderr && !this.forceConsole ? console._stderr.write("".concat(T[x]).concat(this.eol)) : this._consoleWarn(T[x]), U && U(); return; } console._stdout && !this.forceConsole ? console._stdout.write("".concat(T[x]).concat(this.eol)) : this._consoleLog(T[x]), U && U(); } /** * Returns a Set-like object with strArray's elements as keys (each with the * value true). * @param {Array} strArray - Array of Set-elements as strings. * @param {?string} [errMsg] - Custom error message thrown on invalid input. * @returns {Object} - TODO: add return description. * @private */ }, { key: "_stringArrayToSet", value: function(T, U) { if (!T) return {}; if (U = U || "Cannot make set from type other than Array of string elements", !Array.isArray(T)) throw new Error(U); return T.reduce(function(q, Y) { if (typeof Y != "string") throw new Error(U); return q[Y] = !0, q; }, {}); } }]); })(g), cx; } var Th = { exports: {} }, kh = { exports: {} }, Nh = { exports: {} }, gk; function mE() { return gk || (gk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n; function n(r) { return r && typeof r.length == "number" && r.length >= 0 && r.length % 1 === 0; } t.exports = e.default; })(Nh, Nh.exports)), Nh.exports; } var Go = {}, Ph = { exports: {} }, Dh = { exports: {} }, yk; function mJ() { return yk || (yk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = function(n) { return function(...r) { var i = r.pop(); return n.call(this, r, i); }; }, t.exports = e.default; })(Dh, Dh.exports)), Dh.exports; } var ha = {}, bk; function gJ() { if (bk) return ha; bk = 1, Object.defineProperty(ha, "__esModule", { value: !0 }), ha.fallback = r, ha.wrap = i; var t = ha.hasQueueMicrotask = typeof queueMicrotask == "function" && queueMicrotask, e = ha.hasSetImmediate = typeof setImmediate == "function" && setImmediate, n = ha.hasNextTick = typeof process == "object" && typeof process.nextTick == "function"; function r(a) { setTimeout(a, 0); } function i(a) { return (s, ...c) => a(() => s(...c)); } var o; return t ? o = queueMicrotask : e ? o = setImmediate : n ? o = process.nextTick : o = r, ha.default = i(o), ha; } var vk; function yJ() { return vk || (vk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = c; var n = mJ(), r = s(n), i = gJ(), o = s(i), a = xl(); function s(p) { return p && p.__esModule ? p : { default: p }; } function c(p) { return (0, a.isAsync)(p) ? function(...f) { const m = f.pop(), h = p.apply(this, f); return u(h, m); } : (0, r.default)(function(f, m) { var h; try { h = p.apply(this, f); } catch (y) { return m(y); } if (h && typeof h.then == "function") return u(h, m); m(null, h); }); } function u(p, f) { return p.then((m) => { d(f, null, m); }, (m) => { d(f, m && (m instanceof Error || m.message) ? m : new Error(m)); }); } function d(p, f, m) { try { p(f, m); } catch (h) { (0, o.default)((y) => { throw y; }, h); } } t.exports = e.default; })(Ph, Ph.exports)), Ph.exports; } var xk; function xl() { if (xk) return Go; xk = 1, Object.defineProperty(Go, "__esModule", { value: !0 }), Go.isAsyncIterable = Go.isAsyncGenerator = Go.isAsync = void 0; var t = yJ(), e = n(t); function n(s) { return s && s.__esModule ? s : { default: s }; } function r(s) { return s[Symbol.toStringTag] === "AsyncFunction"; } function i(s) { return s[Symbol.toStringTag] === "AsyncGenerator"; } function o(s) { return typeof s[Symbol.asyncIterator] == "function"; } function a(s) { if (typeof s != "function") throw new Error("expected a function"); return r(s) ? (0, e.default)(s) : s; } return Go.default = a, Go.isAsync = r, Go.isAsyncGenerator = i, Go.isAsyncIterable = o, Go; } var Oh = { exports: {} }, wk; function of() { return wk || (wk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n; function n(r, i) { if (i || (i = r.length), !i) throw new Error("arity is undefined"); function o(...a) { return typeof a[i - 1] == "function" ? r.apply(this, a) : new Promise((s, c) => { a[i - 1] = (u, ...d) => { if (u) return c(u); s(d.length > 1 ? d : d[0]); }, r.apply(this, a); }); } return o; } t.exports = e.default; })(Oh, Oh.exports)), Oh.exports; } var Sk; function bJ() { return Sk || (Sk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = mE(), r = c(n), i = xl(), o = c(i), a = of(), s = c(a); function c(u) { return u && u.__esModule ? u : { default: u }; } e.default = (0, s.default)((u, d, p) => { var f = (0, r.default)(d) ? [] : {}; u(d, (m, h, y) => { (0, o.default)(m)((x, ...g) => { g.length < 2 && ([g] = g), f[h] = g, y(x); }); }, (m) => p(m, f)); }, 3), t.exports = e.default; })(kh, kh.exports)), kh.exports; } var Fh = { exports: {} }, Mh = { exports: {} }, Rh = { exports: {} }, Bh = { exports: {} }, _k; function mM() { return _k || (_k = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n; function n(r) { function i(...o) { if (r !== null) { var a = r; r = null, a.apply(this, o); } } return Object.assign(i, r), i; } t.exports = e.default; })(Bh, Bh.exports)), Bh.exports; } var Uh = { exports: {} }, Lh = { exports: {} }, Ek; function vJ() { return Ek || (Ek = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = function(n) { return n[Symbol.iterator] && n[Symbol.iterator](); }, t.exports = e.default; })(Lh, Lh.exports)), Lh.exports; } var Ak; function xJ() { return Ak || (Ak = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = d; var n = mE(), r = a(n), i = vJ(), o = a(i); function a(p) { return p && p.__esModule ? p : { default: p }; } function s(p) { var f = -1, m = p.length; return function() { return ++f < m ? { value: p[f], key: f } : null; }; } function c(p) { var f = -1; return function() { var h = p.next(); return h.done ? null : (f++, { value: h.value, key: f }); }; } function u(p) { var f = p ? Object.keys(p) : [], m = -1, h = f.length; return function y() { var x = f[++m]; return x === "__proto__" ? y() : m < h ? { value: p[x], key: x } : null; }; } function d(p) { if ((0, r.default)(p)) return s(p); var f = (0, o.default)(p); return f ? c(f) : u(p); } t.exports = e.default; })(Uh, Uh.exports)), Uh.exports; } var Qh = { exports: {} }, Ik; function gM() { return Ik || (Ik = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n; function n(r) { return function(...i) { if (r === null) throw new Error("Callback was already called."); var o = r; r = null, o.apply(this, i); }; } t.exports = e.default; })(Qh, Qh.exports)), Qh.exports; } var jh = { exports: {} }, $h = { exports: {} }, Ck; function gE() { return Ck || (Ck = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); const n = {}; e.default = n, t.exports = e.default; })($h, $h.exports)), $h.exports; } var Tk; function wJ() { return Tk || (Tk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = o; var n = gE(), r = i(n); function i(a) { return a && a.__esModule ? a : { default: a }; } function o(a, s, c, u) { let d = !1, p = !1, f = !1, m = 0, h = 0; function y() { m >= s || f || d || (f = !0, a.next().then(({ value: b, done: S }) => { if (!(p || d)) { if (f = !1, S) { d = !0, m <= 0 && u(null); return; } m++, c(b, h, x), h++, y(); } }).catch(g)); } function x(b, S) { if (m -= 1, !p) { if (b) return g(b); if (b === !1) { d = !0, p = !0; return; } if (S === r.default || d && m <= 0) return d = !0, u(null); y(); } } function g(b) { p || (f = !1, d = !0, u(b)); } y(); } t.exports = e.default; })(jh, jh.exports)), jh.exports; } var kk; function SJ() { return kk || (kk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = mM(), r = m(n), i = xJ(), o = m(i), a = gM(), s = m(a), c = xl(), u = wJ(), d = m(u), p = gE(), f = m(p); function m(h) { return h && h.__esModule ? h : { default: h }; } e.default = (h) => (y, x, g) => { if (g = (0, r.default)(g), h <= 0) throw new RangeError("concurrency limit cannot be less than 1"); if (!y) return g(null); if ((0, c.isAsyncGenerator)(y)) return (0, d.default)(y, h, x, g); if ((0, c.isAsyncIterable)(y)) return (0, d.default)(y[Symbol.asyncIterator](), h, x, g); var b = (0, o.default)(y), S = !1, E = !1, T = 0, U = !1; function q(H, G) { if (!E) if (T -= 1, H) S = !0, g(H); else if (H === !1) S = !0, E = !0; else { if (G === f.default || S && T <= 0) return S = !0, g(null); U || Y(); } } function Y() { for (U = !0; T < h && !S; ) { var H = b(); if (H === null) { S = !0, T <= 0 && g(null); return; } T += 1, x(H.value, H.key, (0, s.default)(q)); } U = !1; } Y(); }, t.exports = e.default; })(Rh, Rh.exports)), Rh.exports; } var Nk; function yM() { return Nk || (Nk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = SJ(), r = c(n), i = xl(), o = c(i), a = of(), s = c(a); function c(d) { return d && d.__esModule ? d : { default: d }; } function u(d, p, f, m) { return (0, r.default)(p)(d, (0, o.default)(f), m); } e.default = (0, s.default)(u, 4), t.exports = e.default; })(Mh, Mh.exports)), Mh.exports; } var Pk; function _J() { return Pk || (Pk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = yM(), r = a(n), i = of(), o = a(i); function a(c) { return c && c.__esModule ? c : { default: c }; } function s(c, u, d) { return (0, r.default)(c, 1, u, d); } e.default = (0, o.default)(s, 3), t.exports = e.default; })(Fh, Fh.exports)), Fh.exports; } var Dk; function EJ() { return Dk || (Dk = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = s; var n = bJ(), r = a(n), i = _J(), o = a(i); function a(c) { return c && c.__esModule ? c : { default: c }; } function s(c, u) { return (0, r.default)(o.default, c, u); } t.exports = e.default; })(Th, Th.exports)), Th.exports; } var Gh = { exports: {} }, ux, Ok; function bM() { if (Ok) return ux; Ok = 1, ux = s; var t = vl().codes, e = t.ERR_METHOD_NOT_IMPLEMENTED, n = t.ERR_MULTIPLE_CALLBACK, r = t.ERR_TRANSFORM_ALREADY_TRANSFORMING, i = t.ERR_TRANSFORM_WITH_LENGTH_0, o = Bu(); Do()(s, o); function a(d, p) { var f = this._transformState; f.transforming = !1; var m = f.writecb; if (m === null) return this.emit("error", new n()); f.writechunk = null, f.writecb = null, p != null && this.push(p), m(d); var h = this._readableState; h.reading = !1, (h.needReadable || h.length < h.highWaterMark) && this._read(h.highWaterMark); } function s(d) { if (!(this instanceof s)) return new s(d); o.call(this, d), this._transformState = { afterTransform: a.bind(this), needTransform: !1, transforming: !1, writecb: null, writechunk: null, writeencoding: null }, this._readableState.needReadable = !0, this._readableState.sync = !1, d && (typeof d.transform == "function" && (this._transform = d.transform), typeof d.flush == "function" && (this._flush = d.flush)), this.on("prefinish", c); } function c() { var d = this; typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function(p, f) { u(d, p, f); }) : u(this, null, null); } s.prototype.push = function(d, p) { return this._transformState.needTransform = !1, o.prototype.push.call(this, d, p); }, s.prototype._transform = function(d, p, f) { f(new e("_transform()")); }, s.prototype._write = function(d, p, f) { var m = this._transformState; if (m.writecb = f, m.writechunk = d, m.writeencoding = p, !m.transforming) { var h = this._readableState; (m.needTransform || h.needReadable || h.length < h.highWaterMark) && this._read(h.highWaterMark); } }, s.prototype._read = function(d) { var p = this._transformState; p.writechunk !== null && !p.transforming ? (p.transforming = !0, this._transform(p.writechunk, p.writeencoding, p.afterTransform)) : p.needTransform = !0; }, s.prototype._destroy = function(d, p) { o.prototype._destroy.call(this, d, function(f) { p(f); }); }; function u(d, p, f) { if (p) return d.emit("error", p); if (f != null && d.push(f), d._writableState.length) throw new i(); if (d._transformState.transforming) throw new r(); return d.push(null); } return ux; } var lx, Fk; function AJ() { if (Fk) return lx; Fk = 1, lx = e; var t = bM(); Do()(e, t); function e(n) { if (!(this instanceof e)) return new e(n); t.call(this, n); } return e.prototype._transform = function(n, r, i) { i(null, n); }, lx; } var dx, Mk; function IJ() { if (Mk) return dx; Mk = 1; var t; function e(f) { var m = !1; return function() { m || (m = !0, f.apply(void 0, arguments)); }; } var n = vl().codes, r = n.ERR_MISSING_ARGS, i = n.ERR_STREAM_DESTROYED; function o(f) { if (f) throw f; } function a(f) { return f.setHeader && typeof f.abort == "function"; } function s(f, m, h, y) { y = e(y); var x = !1; f.on("close", function() { x = !0; }), t === void 0 && (t = hE()), t(f, { readable: m, writable: h }, function(b) { if (b) return y(b); x = !0, y(); }); var g = !1; return function(b) { if (!x && !g) { if (g = !0, a(f)) return f.abort(); if (typeof f.destroy == "function") return f.destroy(); y(b || new i("pipe")); } }; } function c(f) { f(); } function u(f, m) { return f.pipe(m); } function d(f) { return !f.length || typeof f[f.length - 1] != "function" ? o : f.pop(); } function p() { for (var f = arguments.length, m = new Array(f), h = 0; h < f; h++) m[h] = arguments[h]; var y = d(m); if (Array.isArray(m[0]) && (m = m[0]), m.length < 2) throw new r("streams"); var x, g = m.map(function(b, S) { var E = S < m.length - 1, T = S > 0; return s(b, E, T, function(U) { x || (x = U), U && g.forEach(c), !E && (g.forEach(c), y(x)); }); }); return m.reduce(u); } return dx = p, dx; } var Rk; function Uc() { return Rk || (Rk = 1, (function(t, e) { e = t.exports = fM(), e.Stream = e, e.Readable = e, e.Writable = T0(), e.Duplex = Bu(), e.Transform = bM(), e.PassThrough = AJ(), e.finished = hE(), e.pipeline = IJ(); })(Gh, Gh.exports)), Gh.exports; } var qh = { exports: {} }, px, Bk; function vM() { if (Bk) return px; Bk = 1; var t = [], e = [], n = function() { }; function r(f) { return ~t.indexOf(f) ? !1 : (t.push(f), !0); } function i(f) { n = f; } function o(f) { for (var m = [], h = 0; h < t.length; h++) { if (t[h].async) { m.push(t[h]); continue; } if (t[h](f)) return !0; } return m.length ? new Promise(function(x) { Promise.all( m.map(function(b) { return b(f); }) ).then(function(b) { x(b.some(Boolean)); }); }) : !1; } function a(f) { return ~e.indexOf(f) ? !1 : (e.push(f), !0); } function s() { n.apply(n, arguments); } function c(f) { for (var m = 0; m < e.length; m++) f = e[m].apply(e[m], arguments); return f; } function u(f, m) { var h = Object.prototype.hasOwnProperty; for (var y in m) h.call(m, y) && (f[y] = m[y]); return f; } function d(f) { return f.enabled = !1, f.modify = a, f.set = i, f.use = r, u(function() { return !1; }, f); } function p(f) { function m() { var h = Array.prototype.slice.call(arguments, 0); return s.call(s, f, c(h, f)), !0; } return f.enabled = !0, f.modify = a, f.set = i, f.use = r, u(m, f); } return px = function(m) { return m.introduce = u, m.enabled = o, m.process = c, m.modify = a, m.write = s, m.nope = d, m.yep = p, m.set = i, m.use = r, m; }, px; } var fx, Uk; function CJ() { if (Uk) return fx; Uk = 1; var t = vM(), e = t(function n(r, i) { return i = i || {}, i.namespace = r, i.prod = !0, i.dev = !1, i.force || n.force ? n.yep(i) : n.nope(i); }); return fx = e, fx; } var hx, Lk; function TJ() { if (Lk) return hx; Lk = 1; var t = { aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], grey: [128, 128, 128], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], rebeccapurple: [102, 51, 153], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }; const e = /* @__PURE__ */ Object.create(null); for (const _ in t) Object.hasOwn(t, _) && (e[t[_]] = _); const n = { to: {}, get: {} }; n.get = function(_) { const I = _.slice(0, 3).toLowerCase(); let N, L; switch (I) { case "hsl": { N = n.get.hsl(_), L = "hsl"; break; } case "hwb": { N = n.get.hwb(_), L = "hwb"; break; } default: { N = n.get.rgb(_), L = "rgb"; break; } } return N ? { model: L, value: N } : null; }, n.get.rgb = function(_) { if (!_) return null; const I = /^#([a-f\d]{3,4})$/i, N = /^#([a-f\d]{6})([a-f\d]{2})?$/i, L = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, C = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, Q = /^(\w+)$/; let k = [0, 0, 0, 1], M, O, A; if (M = _.match(N)) { for (A = M[2], M = M[1], O = 0; O < 3; O++) { const F = O * 2; k[O] = Number.parseInt(M.slice(F, F + 2), 16); } A && (k[3] = Number.parseInt(A, 16) / 255); } else if (M = _.match(I)) { for (M = M[1], A = M[3], O = 0; O < 3; O++) k[O] = Number.parseInt(M[O] + M[O], 16); A && (k[3] = Number.parseInt(A + A, 16) / 255); } else if (M = _.match(L)) { for (O = 0; O < 3; O++) k[O] = Number.parseInt(M[O + 1], 10); M[4] && (k[3] = M[5] ? Number.parseFloat(M[4]) * 0.01 : Number.parseFloat(M[4])); } else if (M = _.match(C)) { for (O = 0; O < 3; O++) k[O] = Math.round(Number.parseFloat(M[O + 1]) * 2.55); M[4] && (k[3] = M[5] ? Number.parseFloat(M[4]) * 0.01 : Number.parseFloat(M[4])); } else return (M = _.match(Q)) ? M[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(t, M[1]) ? (k = t[M[1]], k[3] = 1, k) : null : null; for (O = 0; O < 3; O++) k[O] = r(k[O], 0, 255); return k[3] = r(k[3], 0, 1), k; }, n.get.hsl = function(_) { if (!_) return null; const I = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, N = _.match(I); if (N) { const L = Number.parseFloat(N[4]), C = (Number.parseFloat(N[1]) % 360 + 360) % 360, Q = r(Number.parseFloat(N[2]), 0, 100), k = r(Number.parseFloat(N[3]), 0, 100), M = r(Number.isNaN(L) ? 1 : L, 0, 1); return [C, Q, k, M]; } return null; }, n.get.hwb = function(_) { if (!_) return null; const I = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, N = _.match(I); if (N) { const L = Number.parseFloat(N[4]), C = (Number.parseFloat(N[1]) % 360 + 360) % 360, Q = r(Number.parseFloat(N[2]), 0, 100), k = r(Number.parseFloat(N[3]), 0, 100), M = r(Number.isNaN(L) ? 1 : L, 0, 1); return [C, Q, k, M]; } return null; }, n.to.hex = function(..._) { return "#" + i(_[0]) + i(_[1]) + i(_[2]) + (_[3] < 1 ? i(Math.round(_[3] * 255)) : ""); }, n.to.rgb = function(..._) { return _.length < 4 || _[3] === 1 ? "rgb(" + Math.round(_[0]) + ", " + Math.round(_[1]) + ", " + Math.round(_[2]) + ")" : "rgba(" + Math.round(_[0]) + ", " + Math.round(_[1]) + ", " + Math.round(_[2]) + ", " + _[3] + ")"; }, n.to.rgb.percent = function(..._) { const I = Math.round(_[0] / 255 * 100), N = Math.round(_[1] / 255 * 100), L = Math.round(_[2] / 255 * 100); return _.length < 4 || _[3] === 1 ? "rgb(" + I + "%, " + N + "%, " + L + "%)" : "rgba(" + I + "%, " + N + "%, " + L + "%, " + _[3] + ")"; }, n.to.hsl = function(..._) { return _.length < 4 || _[3] === 1 ? "hsl(" + _[0] + ", " + _[1] + "%, " + _[2] + "%)" : "hsla(" + _[0] + ", " + _[1] + "%, " + _[2] + "%, " + _[3] + ")"; }, n.to.hwb = function(..._) { let I = ""; return _.length >= 4 && _[3] !== 1 && (I = ", " + _[3]), "hwb(" + _[0] + ", " + _[1] + "%, " + _[2] + "%" + I + ")"; }, n.to.keyword = function(..._) { return e[_.slice(0, 3)]; }; function r(_, I, N) { return Math.min(Math.max(I, _), N); } function i(_) { const I = Math.round(_).toString(16).toUpperCase(); return I.length < 2 ? "0" + I : I; } const o = {}; for (const _ of Object.keys(t)) o[t[_]] = _; const a = { rgb: { channels: 3, labels: "rgb" }, hsl: { channels: 3, labels: "hsl" }, hsv: { channels: 3, labels: "hsv" }, hwb: { channels: 3, labels: "hwb" }, cmyk: { channels: 4, labels: "cmyk" }, xyz: { channels: 3, labels: "xyz" }, lab: { channels: 3, labels: "lab" }, oklab: { channels: 3, labels: ["okl", "oka", "okb"] }, lch: { channels: 3, labels: "lch" }, oklch: { channels: 3, labels: ["okl", "okc", "okh"] }, hex: { channels: 1, labels: ["hex"] }, keyword: { channels: 1, labels: ["keyword"] }, ansi16: { channels: 1, labels: ["ansi16"] }, ansi256: { channels: 1, labels: ["ansi256"] }, hcg: { channels: 3, labels: ["h", "c", "g"] }, apple: { channels: 3, labels: ["r16", "g16", "b16"] }, gray: { channels: 1, labels: ["gray"] } }, s = (6 / 29) ** 3; function c(_) { const I = _ > 31308e-7 ? 1.055 * _ ** 0.4166666666666667 - 0.055 : _ * 12.92; return Math.min(Math.max(0, I), 1); } function u(_) { return _ > 0.04045 ? ((_ + 0.055) / 1.055) ** 2.4 : _ / 12.92; } for (const _ of Object.keys(a)) { if (!("channels" in a[_])) throw new Error("missing channels property: " + _); if (!("labels" in a[_])) throw new Error("missing channel labels property: " + _); if (a[_].labels.length !== a[_].channels) throw new Error("channel and label counts mismatch: " + _); const { channels: I, labels: N } = a[_]; delete a[_].channels, delete a[_].labels, Object.defineProperty(a[_], "channels", { value: I }), Object.defineProperty(a[_], "labels", { value: N }); } a.rgb.hsl = function(_) { const I = _[0] / 255, N = _[1] / 255, L = _[2] / 255, C = Math.min(I, N, L), Q = Math.max(I, N, L), k = Q - C; let M, O; switch (Q) { case C: { M = 0; break; } case I: { M = (N - L) / k; break; } case N: { M = 2 + (L - I) / k; break; } case L: { M = 4 + (I - N) / k; break; } } M = Math.min(M * 60, 360), M < 0 && (M += 360); const A = (C + Q) / 2; return Q === C ? O = 0 : A <= 0.5 ? O = k / (Q + C) : O = k / (2 - Q - C), [M, O * 100, A * 100]; }, a.rgb.hsv = function(_) { let I, N, L, C, Q; const k = _[0] / 255, M = _[1] / 255, O = _[2] / 255, A = Math.max(k, M, O), F = A - Math.min(k, M, O), Z = function(ee) { return (A - ee) / 6 / F + 1 / 2; }; if (F === 0) C = 0, Q = 0; else { switch (Q = F / A, I = Z(k), N = Z(M), L = Z(O), A) { case k: { C = L - N; break; } case M: { C = 1 / 3 + I - L; break; } case O: { C = 2 / 3 + N - I; break; } } C < 0 ? C += 1 : C > 1 && (C -= 1); } return [ C * 360, Q * 100, A * 100 ]; }, a.rgb.hwb = function(_) { const I = _[0], N = _[1]; let L = _[2]; const C = a.rgb.hsl(_)[0], Q = 1 / 255 * Math.min(I, Math.min(N, L)); return L = 1 - 1 / 255 * Math.max(I, Math.max(N, L)), [C, Q * 100, L * 100]; }, a.rgb.oklab = function(_) { const I = u(_[0] / 255), N = u(_[1] / 255), L = u(_[2] / 255), C = Math.cbrt(0.4122214708 * I + 0.5363325363 * N + 0.0514459929 * L), Q = Math.cbrt(0.2119034982 * I + 0.6806995451 * N + 0.1073969566 * L), k = Math.cbrt(0.0883024619 * I + 0.2817188376 * N + 0.6299787005 * L), M = 0.2104542553 * C + 0.793617785 * Q - 0.0040720468 * k, O = 1.9779984951 * C - 2.428592205 * Q + 0.4505937099 * k, A = 0.0259040371 * C + 0.7827717662 * Q - 0.808675766 * k; return [M * 100, O * 100, A * 100]; }, a.rgb.cmyk = function(_) { const I = _[0] / 255, N = _[1] / 255, L = _[2] / 255, C = Math.min(1 - I, 1 - N, 1 - L), Q = (1 - I - C) / (1 - C) || 0, k = (1 - N - C) / (1 - C) || 0, M = (1 - L - C) / (1 - C) || 0; return [Q * 100, k * 100, M * 100, C * 100]; }; function d(_, I) { return (_[0] - I[0]) ** 2 + (_[1] - I[1]) ** 2 + (_[2] - I[2]) ** 2; } a.rgb.keyword = function(_) { const I = o[_]; if (I) return I; let N = Number.POSITIVE_INFINITY, L; for (const C of Object.keys(t)) { const Q = t[C], k = d(_, Q); k < N && (N = k, L = C); } return L; }, a.keyword.rgb = function(_) { return t[_]; }, a.rgb.xyz = function(_) { const I = u(_[0] / 255), N = u(_[1] / 255), L = u(_[2] / 255), C = I * 0.4124564 + N * 0.3575761 + L * 0.1804375, Q = I * 0.2126729 + N * 0.7151522 + L * 0.072175, k = I * 0.0193339 + N * 0.119192 + L * 0.9503041; return [C * 100, Q * 100, k * 100]; }, a.rgb.lab = function(_) { const I = a.rgb.xyz(_); let N = I[0], L = I[1], C = I[2]; N /= 95.047, L /= 100, C /= 108.883, N = N > s ? N ** (1 / 3) : 7.787 * N + 16 / 116, L = L > s ? L ** (1 / 3) : 7.787 * L + 16 / 116, C = C > s ? C ** (1 / 3) : 7.787 * C + 16 / 116; const Q = 116 * L - 16, k = 500 * (N - L), M = 200 * (L - C); return [Q, k, M]; }, a.hsl.rgb = function(_) { const I = _[0] / 360, N = _[1] / 100, L = _[2] / 100; let C, Q; if (N === 0) return Q = L * 255, [Q, Q, Q]; const k = L < 0.5 ? L * (1 + N) : L + N - L * N, M = 2 * L - k, O = [0, 0, 0]; for (let A = 0; A < 3; A++) C = I + 1 / 3 * -(A - 1), C < 0 && C++, C > 1 && C--, 6 * C < 1 ? Q = M + (k - M) * 6 * C : 2 * C < 1 ? Q = k : 3 * C < 2 ? Q = M + (k - M) * (2 / 3 - C) * 6 : Q = M, O[A] = Q * 255; return O; }, a.hsl.hsv = function(_) { const I = _[0]; let N = _[1] / 100, L = _[2] / 100, C = N; const Q = Math.max(L, 0.01); L *= 2, N *= L <= 1 ? L : 2 - L, C *= Q <= 1 ? Q : 2 - Q; const k = (L + N) / 2, M = L === 0 ? 2 * C / (Q + C) : 2 * N / (L + N); return [I, M * 100, k * 100]; }, a.hsv.rgb = function(_) { const I = _[0] / 60, N = _[1] / 100; let L = _[2] / 100; const C = Math.floor(I) % 6, Q = I - Math.floor(I), k = 255 * L * (1 - N), M = 255 * L * (1 - N * Q), O = 255 * L * (1 - N * (1 - Q)); switch (L *= 255, C) { case 0: return [L, O, k]; case 1: return [M, L, k]; case 2: return [k, L, O]; case 3: return [k, M, L]; case 4: return [O, k, L]; case 5: return [L, k, M]; } }, a.hsv.hsl = function(_) { const I = _[0], N = _[1] / 100, L = _[2] / 100, C = Math.max(L, 0.01); let Q, k; k = (2 - N) * L; const M = (2 - N) * C; return Q = N * C, Q /= M <= 1 ? M : 2 - M, Q = Q || 0, k /= 2, [I, Q * 100, k * 100]; }, a.hwb.rgb = function(_) { const I = _[0] / 360; let N = _[1] / 100, L = _[2] / 100; const C = N + L; let Q; C > 1 && (N /= C, L /= C); const k = Math.floor(6 * I), M = 1 - L; Q = 6 * I - k, (k & 1) !== 0 && (Q = 1 - Q); const O = N + Q * (M - N); let A, F, Z; switch (k) { default: case 6: case 0: { A = M, F = O, Z = N; break; } case 1: { A = O, F = M, Z = N; break; } case 2: { A = N, F = M, Z = O; break; } case 3: { A = N, F = O, Z = M; break; } case 4: { A = O, F = N, Z = M; break; } case 5: { A = M, F = N, Z = O; break; } } return [A * 255, F * 255, Z * 255]; }, a.cmyk.rgb = function(_) { const I = _[0] / 100, N = _[1] / 100, L = _[2] / 100, C = _[3] / 100, Q = 1 - Math.min(1, I * (1 - C) + C), k = 1 - Math.min(1, N * (1 - C) + C), M = 1 - Math.min(1, L * (1 - C) + C); return [Q * 255, k * 255, M * 255]; }, a.xyz.rgb = function(_) { const I = _[0] / 100, N = _[1] / 100, L = _[2] / 100; let C, Q, k; return C = I * 3.2404542 + N * -1.5371385 + L * -0.4985314, Q = I * -0.969266 + N * 1.8760108 + L * 0.041556, k = I * 0.0556434 + N * -0.2040259 + L * 1.0572252, C = c(C), Q = c(Q), k = c(k), [C * 255, Q * 255, k * 255]; }, a.xyz.lab = function(_) { let I = _[0], N = _[1], L = _[2]; I /= 95.047, N /= 100, L /= 108.883, I = I > s ? I ** (1 / 3) : 7.787 * I + 16 / 116, N = N > s ? N ** (1 / 3) : 7.787 * N + 16 / 116, L = L > s ? L ** (1 / 3) : 7.787 * L + 16 / 116; const C = 116 * N - 16, Q = 500 * (I - N), k = 200 * (N - L); return [C, Q, k]; }, a.xyz.oklab = function(_) { const I = _[0] / 100, N = _[1] / 100, L = _[2] / 100, C = Math.cbrt(0.8189330101 * I + 0.3618667424 * N - 0.1288597137 * L), Q = Math.cbrt(0.0329845436 * I + 0.9293118715 * N + 0.0361456387 * L), k = Math.cbrt(0.0482003018 * I + 0.2643662691 * N + 0.633851707 * L), M = 0.2104542553 * C + 0.793617785 * Q - 0.0040720468 * k, O = 1.9779984951 * C - 2.428592205 * Q + 0.4505937099 * k, A = 0.0259040371 * C + 0.7827717662 * Q - 0.808675766 * k; return [M * 100, O * 100, A * 100]; }, a.oklab.oklch = function(_) { return a.lab.lch(_); }, a.oklab.xyz = function(_) { const I = _[0] / 100, N = _[1] / 100, L = _[2] / 100, C = (0.999999998 * I + 0.396337792 * N + 0.215803758 * L) ** 3, Q = (1.000000008 * I - 0.105561342 * N - 0.063854175 * L) ** 3, k = (1.000000055 * I - 0.089484182 * N - 1.291485538 * L) ** 3, M = 1.227013851 * C - 0.55779998 * Q + 0.281256149 * k, O = -0.040580178 * C + 1.11225687 * Q - 0.071676679 * k, A = -0.076381285 * C - 0.421481978 * Q + 1.58616322 * k; return [M * 100, O * 100, A * 100]; }, a.oklab.rgb = function(_) { const I = _[0] / 100, N = _[1] / 100, L = _[2] / 100, C = (I + 0.3963377774 * N + 0.2158037573 * L) ** 3, Q = (I - 0.1055613458 * N - 0.0638541728 * L) ** 3, k = (I - 0.0894841775 * N - 1.291485548 * L) ** 3, M = c(4.0767416621 * C - 3.3077115913 * Q + 0.2309699292 * k), O = c(-1.2684380046 * C + 2.6097574011 * Q - 0.3413193965 * k), A = c(-0.0041960863 * C - 0.7034186147 * Q + 1.707614701 * k); return [M * 255, O * 255, A * 255]; }, a.oklch.oklab = function(_) { return a.lch.lab(_); }, a.lab.xyz = function(_) { const I = _[0], N = _[1], L = _[2]; let C, Q, k; Q = (I + 16) / 116, C = N / 500 + Q, k = Q - L / 200; const M = Q ** 3, O = C ** 3, A = k ** 3; return Q = M > s ? M : (Q - 16 / 116) / 7.787, C = O > s ? O : (C - 16 / 116) / 7.787, k = A > s ? A : (k - 16 / 116) / 7.787, C *= 95.047, Q *= 100, k *= 108.883, [C, Q, k]; }, a.lab.lch = function(_) { const I = _[0], N = _[1], L = _[2]; let C; C = Math.atan2(L, N) * 360 / 2 / Math.PI, C < 0 && (C += 360); const k = Math.sqrt(N * N + L * L); return [I, k, C]; }, a.lch.lab = function(_) { const I = _[0], N = _[1], C = _[2] / 360 * 2 * Math.PI, Q = N * Math.cos(C), k = N * Math.sin(C); return [I, Q, k]; }, a.rgb.ansi16 = function(_, I = null) { const [N, L, C] = _; let Q = I === null ? a.rgb.hsv(_)[2] : I; if (Q = Math.round(Q / 50), Q === 0) return 30; let k = 30 + (Math.round(C / 255) << 2 | Math.round(L / 255) << 1 | Math.round(N / 255)); return Q === 2 && (k += 60), k; }, a.hsv.ansi16 = function(_) { return a.rgb.ansi16(a.hsv.rgb(_), _[2]); }, a.rgb.ansi256 = function(_) { const I = _[0], N = _[1], L = _[2]; return I >> 4 === N >> 4 && N >> 4 === L >> 4 ? I < 8 ? 16 : I > 248 ? 231 : Math.round((I - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(I / 255 * 5) + 6 * Math.round(N / 255 * 5) + Math.round(L / 255 * 5); }, a.ansi16.rgb = function(_) { _ = _[0]; let I = _ % 10; if (I === 0 || I === 7) return _ > 50 && (I += 3.5), I = I / 10.5 * 255, [I, I, I]; const N = (Math.trunc(_ > 50) + 1) * 0.5, L = (I & 1) * N * 255, C = (I >> 1 & 1) * N * 255, Q = (I >> 2 & 1) * N * 255; return [L, C, Q]; }, a.ansi256.rgb = function(_) { if (_ = _[0], _ >= 232) { const Q = (_ - 232) * 10 + 8; return [Q, Q, Q]; } _ -= 16; let I; const N = Math.floor(_ / 36) / 5 * 255, L = Math.floor((I = _ % 36) / 6) / 5 * 255, C = I % 6 / 5 * 255; return [N, L, C]; }, a.rgb.hex = function(_) { const N = (((Math.round(_[0]) & 255) << 16) + ((Math.round(_[1]) & 255) << 8) + (Math.round(_[2]) & 255)).toString(16).toUpperCase(); return "000000".slice(N.length) + N; }, a.hex.rgb = function(_) { const I = _.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i); if (!I) return [0, 0, 0]; let N = I[0]; I[0].length === 3 && (N = [...N].map((M) => M + M).join("")); const L = Number.parseInt(N, 16), C = L >> 16 & 255, Q = L >> 8 & 255, k = L & 255; return [C, Q, k]; }, a.rgb.hcg = function(_) { const I = _[0] / 255, N = _[1] / 255, L = _[2] / 255, C = Math.max(Math.max(I, N), L), Q = Math.min(Math.min(I, N), L), k = C - Q; let M; const O = k < 1 ? Q / (1 - k) : 0; return k <= 0 ? M = 0 : C === I ? M = (N - L) / k % 6 : C === N ? M = 2 + (L - I) / k : M = 4 + (I - N) / k, M /= 6, M %= 1, [M * 360, k * 100, O * 100]; }, a.hsl.hcg = function(_) { const I = _[1] / 100, N = _[2] / 100, L = N < 0.5 ? 2 * I * N : 2 * I * (1 - N); let C = 0; return L < 1 && (C = (N - 0.5 * L) / (1 - L)), [_[0], L * 100, C * 100]; }, a.hsv.hcg = function(_) { const I = _[1] / 100, N = _[2] / 100, L = I * N; let C = 0; return L < 1 && (C = (N - L) / (1 - L)), [_[0], L * 100, C * 100]; }, a.hcg.rgb = function(_) { const I = _[0] / 360, N = _[1] / 100, L = _[2] / 100; if (N === 0) return [L * 255, L * 255, L * 255]; const C = [0, 0, 0], Q = I % 1 * 6, k = Q % 1, M = 1 - k; let O = 0; switch (Math.floor(Q)) { case 0: { C[0] = 1, C[1] = k, C[2] = 0; break; } case 1: { C[0] = M, C[1] = 1, C[2] = 0; break; } case 2: { C[0] = 0, C[1] = 1, C[2] = k; break; } case 3: { C[0] = 0, C[1] = M, C[2] = 1; break; } case 4: { C[0] = k, C[1] = 0, C[2] = 1; break; } default: C[0] = 1, C[1] = 0, C[2] = M; } return O = (1 - N) * L, [ (N * C[0] + O) * 255, (N * C[1] + O) * 255, (N * C[2] + O) * 255 ]; }, a.hcg.hsv = function(_) { const I = _[1] / 100, N = _[2] / 100, L = I + N * (1 - I); let C = 0; return L > 0 && (C = I / L), [_[0], C * 100, L * 100]; }, a.hcg.hsl = function(_) { const I = _[1] / 100, L = _[2] / 100 * (1 - I) + 0.5 * I; let C = 0; return L > 0 && L < 0.5 ? C = I / (2 * L) : L >= 0.5 && L < 1 && (C = I / (2 * (1 - L))), [_[0], C * 100, L * 100]; }, a.hcg.hwb = function(_) { const I = _[1] / 100, N = _[2] / 100, L = I + N * (1 - I); return [_[0], (L - I) * 100, (1 - L) * 100]; }, a.hwb.hcg = function(_) { const I = _[1] / 100, L = 1 - _[2] / 100, C = L - I; let Q = 0; return C < 1 && (Q = (L - C) / (1 - C)), [_[0], C * 100, Q * 100]; }, a.apple.rgb = function(_) { return [_[0] / 65535 * 255, _[1] / 65535 * 255, _[2] / 65535 * 255]; }, a.rgb.apple = function(_) { return [_[0] / 255 * 65535, _[1] / 255 * 65535, _[2] / 255 * 65535]; }, a.gray.rgb = function(_) { return [_[0] / 100 * 255, _[0] / 100 * 255, _[0] / 100 * 255]; }, a.gray.hsl = function(_) { return [0, 0, _[0]]; }, a.gray.hsv = a.gray.hsl, a.gray.hwb = function(_) { return [0, 100, _[0]]; }, a.gray.cmyk = function(_) { return [0, 0, 0, _[0]]; }, a.gray.lab = function(_) { return [_[0], 0, 0]; }, a.gray.hex = function(_) { const I = Math.round(_[0] / 100 * 255) & 255, L = ((I << 16) + (I << 8) + I).toString(16).toUpperCase(); return "000000".slice(L.length) + L; }, a.rgb.gray = function(_) { return [(_[0] + _[1] + _[2]) / 3 / 255 * 100]; }; function p() { const _ = {}, I = Object.keys(a); for (let { length: N } = I, L = 0; L < N; L++) _[I[L]] = { // http://jsperf.com/1-vs-infinity // micro-opt, but this is simple. distance: -1, parent: null }; return _; } function f(_) { const I = p(), N = [_]; for (I[_].distance = 0; N.length > 0; ) { const L = N.pop(), C = Object.keys(a[L]); for (let { length: Q } = C, k = 0; k < Q; k++) { const M = C[k], O = I[M]; O.distance === -1 && (O.distance = I[L].distance + 1, O.parent = L, N.unshift(M)); } } return I; } function m(_, I) { return function(N) { return I(_(N)); }; } function h(_, I) { const N = [I[_].parent, _]; let L = a[I[_].parent][_], C = I[_].parent; for (; I[C].parent; ) N.unshift(I[C].parent), L = m(a[I[C].parent][C], L), C = I[C].parent; return L.conversion = N, L; } function y(_) { const I = f(_), N = {}, L = Object.keys(I); for (let { length: C } = L, Q = 0; Q < C; Q++) { const k = L[Q]; I[k].parent !== null && (N[k] = h(k, I)); } return N; } const x = {}, g = Object.keys(a); function b(_) { const I = function(...N) { const L = N[0]; return L == null ? L : (L.length > 1 && (N = L), _(N)); }; return "conversion" in _ && (I.conversion = _.conversion), I; } function S(_) { const I = function(...N) { const L = N[0]; if (L == null) return L; L.length > 1 && (N = L); const C = _(N); if (typeof C == "object") for (let { length: Q } = C, k = 0; k < Q; k++) C[k] = Math.round(C[k]); return C; }; return "conversion" in _ && (I.conversion = _.conversion), I; } for (const _ of g) { x[_] = {}, Object.defineProperty(x[_], "channels", { value: a[_].channels }), Object.defineProperty(x[_], "labels", { value: a[_].labels }); const I = y(_), N = Object.keys(I); for (const L of N) { const C = I[L]; x[_][L] = S(C), x[_][L].raw = b(C); } } const E = [ // To be honest, I don't really feel like keyword belongs in color convert, but eh. "keyword", // Gray conflicts with some method names, and has its own method defined. "gray", // Shouldn't really be in color-convert either... "hex" ], T = {}; for (const _ of Object.keys(x)) T[[...x[_].labels].sort().join("")] = _; const U = {}; function q(_, I) { if (!(this instanceof q)) return new q(_, I); if (I && I in E && (I = null), I && !(I in x)) throw new Error("Unknown model: " + I); let N, L; if (_ == null) this.model = "rgb", this.color = [0, 0, 0], this.valpha = 1; else if (_ instanceof q) this.model = _.model, this.color = [..._.color], this.valpha = _.valpha; else if (typeof _ == "string") { const C = n.get(_); if (C === null) throw new Error("Unable to parse color from string: " + _); this.model = C.model, L = x[this.model].channels, this.color = C.value.slice(0, L), this.valpha = typeof C.value[L] == "number" ? C.value[L] : 1; } else if (_.length > 0) { this.model = I || "rgb", L = x[this.model].channels; const C = Array.prototype.slice.call(_, 0, L); this.color = D(C, L), this.valpha = typeof _[L] == "number" ? _[L] : 1; } else if (typeof _ == "number") this.model = "rgb", this.color = [ _ >> 16 & 255, _ >> 8 & 255, _ & 255 ], this.valpha = 1; else { this.valpha = 1; const C = Object.keys(_); "alpha" in _ && (C.splice(C.indexOf("alpha"), 1), this.valpha = typeof _.alpha == "number" ? _.alpha : 0); const Q = C.sort().join(""); if (!(Q in T)) throw new Error("Unable to parse color from object: " + JSON.stringify(_)); this.model = T[Q]; const { labels: k } = x[this.model], M = []; for (N = 0; N < k.length; N++) M.push(_[k[N]]); this.color = D(M); } if (U[this.model]) for (L = x[this.model].channels, N = 0; N < L; N++) { const C = U[this.model][N]; C && (this.color[N] = C(this.color[N])); } this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this); } q.prototype = { toString() { return this.string(); }, toJSON() { return this[this.model](); }, string(_) { let I = this.model in n.to ? this : this.rgb(); I = I.round(typeof _ == "number" ? _ : 1); const N = I.valpha === 1 ? I.color : [...I.color, this.valpha]; return n.to[I.model](...N); }, percentString(_) { const I = this.rgb().round(typeof _ == "number" ? _ : 1), N = I.valpha === 1 ? I.color : [...I.color, this.valpha]; return n.to.rgb.percent(...N); }, array() { return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha]; }, object() { const _ = {}, { channels: I } = x[this.model], { labels: N } = x[this.model]; for (let L = 0; L < I; L++) _[N[L]] = this.color[L]; return this.valpha !== 1 && (_.alpha = this.valpha), _; }, unitArray() { const _ = this.rgb().color; return _[0] /= 255, _[1] /= 255, _[2] /= 255, this.valpha !== 1 && _.push(this.valpha), _; }, unitObject() { const _ = this.rgb().object(); return _.r /= 255, _.g /= 255, _.b /= 255, this.valpha !== 1 && (_.alpha = this.valpha), _; }, round(_) { return _ = Math.max(_ || 0, 0), new q([...this.color.map(H(_)), this.valpha], this.model); }, alpha(_) { return _ !== void 0 ? new q([...this.color, Math.max(0, Math.min(1, _))], this.model) : this.valpha; }, // Rgb red: G("rgb", 0, J(255)), green: G("rgb", 1, J(255)), blue: G("rgb", 2, J(255)), hue: G(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (_) => (_ % 360 + 360) % 360), saturationl: G("hsl", 1, J(100)), lightness: G("hsl", 2, J(100)), saturationv: G("hsv", 1, J(100)), value: G("hsv", 2, J(100)), chroma: G("hcg", 1, J(100)), gray: G("hcg", 2, J(100)), white: G("hwb", 1, J(100)), wblack: G("hwb", 2, J(100)), cyan: G("cmyk", 0, J(100)), magenta: G("cmyk", 1, J(100)), yellow: G("cmyk", 2, J(100)), black: G("cmyk", 3, J(100)), x: G("xyz", 0, J(95.047)), y: G("xyz", 1, J(100)), z: G("xyz", 2, J(108.833)), l: G("lab", 0, J(100)), a: G("lab", 1), b: G("lab", 2), keyword(_) { return _ !== void 0 ? new q(_) : x[this.model].keyword(this.color); }, hex(_) { return _ !== void 0 ? new q(_) : n.to.hex(...this.rgb().round().color); }, hexa(_) { if (_ !== void 0) return new q(_); const I = this.rgb().round().color; let N = Math.round(this.valpha * 255).toString(16).toUpperCase(); return N.length === 1 && (N = "0" + N), n.to.hex(...I) + N; }, rgbNumber() { const _ = this.rgb().color; return (_[0] & 255) << 16 | (_[1] & 255) << 8 | _[2] & 255; }, luminosity() { const _ = this.rgb().color, I = []; for (const [N, L] of _.entries()) { const C = L / 255; I[N] = C <= 0.04045 ? C / 12.92 : ((C + 0.055) / 1.055) ** 2.4; } return 0.2126 * I[0] + 0.7152 * I[1] + 0.0722 * I[2]; }, contrast(_) { const I = this.luminosity(), N = _.luminosity(); return I > N ? (I + 0.05) / (N + 0.05) : (N + 0.05) / (I + 0.05); }, level(_) { const I = this.contrast(_); return I >= 7 ? "AAA" : I >= 4.5 ? "AA" : ""; }, isDark() { const _ = this.rgb().color; return (_[0] * 2126 + _[1] * 7152 + _[2] * 722) / 1e4 < 128; }, isLight() { return !this.isDark(); }, negate() { const _ = this.rgb(); for (let I = 0; I < 3; I++) _.color[I] = 255 - _.color[I]; return _; }, lighten(_) { const I = this.hsl(); return I.color[2] += I.color[2] * _, I; }, darken(_) { const I = this.hsl(); return I.color[2] -= I.color[2] * _, I; }, saturate(_) { const I = this.hsl(); return I.color[1] += I.color[1] * _, I; }, desaturate(_) { const I = this.hsl(); return I.color[1] -= I.color[1] * _, I; }, whiten(_) { const I = this.hwb(); return I.color[1] += I.color[1] * _, I; }, blacken(_) { const I = this.hwb(); return I.color[2] += I.color[2] * _, I; }, grayscale() { const _ = this.rgb().color, I = _[0] * 0.3 + _[1] * 0.59 + _[2] * 0.11; return q.rgb(I, I, I); }, fade(_) { return this.alpha(this.valpha - this.valpha * _); }, opaquer(_) { return this.alpha(this.valpha + this.valpha * _); }, rotate(_) { const I = this.hsl(); let N = I.color[0]; return N = (N + _) % 360, N = N < 0 ? 360 + N : N, I.color[0] = N, I; }, mix(_, I) { if (!_ || !_.rgb) throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof _); const N = _.rgb(), L = this.rgb(), C = I === void 0 ? 0.5 : I, Q = 2 * C - 1, k = N.alpha() - L.alpha(), M = ((Q * k === -1 ? Q : (Q + k) / (1 + Q * k)) + 1) / 2, O = 1 - M; return q.rgb( M * N.red() + O * L.red(), M * N.green() + O * L.green(), M * N.blue() + O * L.blue(), N.alpha() * C + L.alpha() * (1 - C) ); } }; for (const _ of Object.keys(x)) { if (E.includes(_)) continue; const { channels: I } = x[_]; q.prototype[_] = function(...N) { return this.model === _ ? new q(this) : N.length > 0 ? new q(N, _) : new q([...B(x[this.model][_].raw(this.color)), this.valpha], _); }, q[_] = function(...N) { let L = N[0]; return typeof L == "number" && (L = D(N, I)), new q(L, _); }; } function Y(_, I) { return Number(_.toFixed(I)); } function H(_) { return function(I) { return Y(I, _); }; } function G(_, I, N) { _ = Array.isArray(_) ? _ : [_]; for (const L of _) (U[L] ||= [])[I] = N; return _ = _[0], function(L) { let C; return L !== void 0 ? (N && (L = N(L)), C = this[_](), C.color[I] = L, C) : (C = this[_]().color[I], N && (C = N(C)), C); }; } function J(_) { return function(I) { return Math.max(0, Math.min(_, I)); }; } function B(_) { return Array.isArray(_) ? _ : [_]; } function D(_, I) { for (let N = 0; N < I; N++) typeof _[N] != "number" && (_[N] = 0); return _; } function X(_) { return _ && _.__esModule && Object.prototype.hasOwnProperty.call(_, "default") ? _.default : _; } var V = function(I) { for (var N = 0, L = 0; N < I.length; L = I.charCodeAt(N++) + ((L << 5) - L)) ; var C = Math.floor( Math.abs( Math.sin(L) * 1e4 % 1 * 16777216 ) ).toString(16); return "#" + Array(6 - C.length + 1).join("0") + C; }, K = /* @__PURE__ */ X(V); function $(_, I) { const N = _.split(I || ":"); let L = K(N[0]); if (!N.length) return L; for (let C = 0, Q = N.length - 1; C < Q; C++) L = q(L).mix(q(K(N[C + 1]))).saturate(1).hex(); return L; } return hx = $, hx; } var mx, Qk; function kJ() { if (Qk) return mx; Qk = 1; var t = TJ(); return mx = function(n, r) { var i = r.namespace; if (r.colors === !1) return n[0] = i + ": " + n[0], n; var o = t(i); return n[0] = "%c" + i + ":%c " + n[0], n.splice(1, 0, "color:" + o, "color:inherit"), n; }, mx; } var gx, jk; function NJ() { return jk || (jk = 1, gx = function(e, n) { if (!n) return !1; for (var r = n.split(/[\s,]+/), i = 0; i < r.length; i++) { if (n = r[i].replace("*", ".*?"), n.charAt(0) === "-") { if (new RegExp("^" + n.substr(1) + "$").test(e)) return !1; continue; } if (new RegExp("^" + n + "$").test(e)) return !0; } return !1; }), gx; } var yx, $k; function xM() { if ($k) return yx; $k = 1; var t = NJ(); return yx = function(n) { return function(i) { try { return t(i, n()); } catch { } return !1; }; }, yx; } var bx, Gk; function PJ() { if (Gk) return bx; Gk = 1; var t = xM(); return bx = t(function() { return localStorage.getItem("debug") || localStorage.getItem("diagnostics"); }), bx; } var vx, qk; function DJ() { if (qk) return vx; qk = 1; var t = xM(); return vx = t(function() { return /(debug|diagnostics)=([^&]+)/i.exec(window.location.hash)[2]; }), vx; } var xx, zk; function OJ() { return zk || (zk = 1, xx = function(t, e) { try { Function.prototype.apply.call(console.log, console, e); } catch { } }), xx; } var wx, Hk; function FJ() { if (Hk) return wx; Hk = 1; var t = vM(), e = t(function n(r, i) { return i = i || {}, i.namespace = r, i.prod = !1, i.dev = !0, !n.enabled(r) && !(i.force || n.force) ? n.nope(i) : n.yep(i); }); return e.modify(kJ()), e.use(PJ()), e.use(DJ()), e.set(OJ()), wx = e, wx; } var Wk; function k0() { return Wk || (Wk = 1, process.env.NODE_ENV === "production" ? qh.exports = CJ() : qh.exports = FJ()), qh.exports; } var Sx, Kk; function MJ() { if (Kk) return Sx; Kk = 1; var t = fe, e = O2, n = e.StringDecoder, r = Uc(), i = r.Stream; function o() { } return Sx = function(a, s) { var c = Buffer.alloc(65536), u = new n("utf8"), d = new i(), p = "", f = 0, m = 0; return a.start === -1 && delete a.start, d.readable = !0, d.destroy = function() { d.destroyed = !0, d.emit("end"), d.emit("close"); }, t.open(a.file, "a+", "0644", function(h, y) { if (h) { s ? s(h) : d.emit("error", h), d.destroy(); return; } (function x() { if (d.destroyed) { t.close(y, o); return; } return t.read(y, c, 0, c.length, f, function(g, b) { if (g) { s ? s(g) : d.emit("error", g), d.destroy(); return; } if (!b) return p && ((a.start == null || m > a.start) && (s ? s(null, p) : d.emit("line", p)), m++, p = ""), setTimeout(x, 1e3); var S = u.write(c.slice(0, b)); s || d.emit("data", S), S = (p + S).split(/\n+/); for (var E = S.length - 1, T = 0; T < E; T++) (a.start == null || m > a.start) && (s ? s(null, S[T]) : d.emit("line", S[T])), m++; return p = S[E], f += b, x(); }); })(); }), s ? d.destroy : d; }, Sx; } var _x, Vk; function RJ() { if (Vk) return _x; Vk = 1; function t(G) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(J) { return typeof J; } : function(J) { return J && typeof Symbol == "function" && J.constructor === Symbol && J !== Symbol.prototype ? "symbol" : typeof J; }, t(G); } function e(G, J) { if (!(G instanceof J)) throw new TypeError("Cannot call a class as a function"); } function n(G, J) { for (var B = 0; B < J.length; B++) { var D = J[B]; D.enumerable = D.enumerable || !1, D.configurable = !0, "value" in D && (D.writable = !0), Object.defineProperty(G, i(D.key), D); } } function r(G, J, B) { return J && n(G.prototype, J), Object.defineProperty(G, "prototype", { writable: !1 }), G; } function i(G) { var J = o(G, "string"); return t(J) == "symbol" ? J : J + ""; } function o(G, J) { if (t(G) != "object" || !G) return G; var B = G[Symbol.toPrimitive]; if (B !== void 0) { var D = B.call(G, J); if (t(D) != "object") return D; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(G); } function a(G, J, B) { return J = d(J), s(G, u() ? Reflect.construct(J, B || [], d(G).constructor) : J.apply(G, B)); } function s(G, J) { if (J && (t(J) == "object" || typeof J == "function")) return J; if (J !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return c(G); } function c(G) { if (G === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return G; } function u() { try { var G = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!G; })(); } function d(G) { return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(J) { return J.__proto__ || Object.getPrototypeOf(J); }, d(G); } function p(G, J) { if (typeof J != "function" && J !== null) throw new TypeError("Super expression must either be null or a function"); G.prototype = Object.create(J && J.prototype, { constructor: { value: G, writable: !0, configurable: !0 } }), Object.defineProperty(G, "prototype", { writable: !1 }), J && f(G, J); } function f(G, J) { return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(B, D) { return B.__proto__ = D, B; }, f(G, J); } var m = fe, h = ve, y = EJ(), x = ml, g = dn(), b = g.MESSAGE, S = Uc(), E = S.Stream, T = S.PassThrough, U = rf(), q = k0()("winston:file"), Y = Ln, H = MJ(); return _x = /* @__PURE__ */ (function(G) { function J() { var B, D = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e(this, J), B = a(this, J, [D]), B.name = D.name || "file"; function X(V) { for (var K = arguments.length, $ = new Array(K > 1 ? K - 1 : 0), _ = 1; _ < K; _++) $[_ - 1] = arguments[_]; $.slice(1).forEach(function(I) { if (D[I]) throw new Error("Cannot set ".concat(I, " and ").concat(V, " together")); }); } if (B._stream = new T(), B._stream.setMaxListeners(30), B._onError = B._onError.bind(B), D.filename || D.dirname) X("filename or dirname", "stream"), B._basename = B.filename = D.filename ? h.basename(D.filename) : "winston.log", B.dirname = D.dirname || h.dirname(D.filename), B.options = D.options || { flags: "a" }; else if (D.stream) console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"), X("stream", "filename", "maxsize"), B._dest = B._stream.pipe(B._setupStream(D.stream)), B.dirname = h.dirname(B._dest.path); else throw new Error("Cannot log to file without filename or stream."); return B.maxsize = D.maxsize || null, B.rotationFormat = D.rotationFormat || !1, B.zippedArchive = D.zippedArchive || !1, B.maxFiles = D.maxFiles || null, B.eol = typeof D.eol == "string" ? D.eol : Y.EOL, B.tailable = D.tailable || !1, B.lazy = D.lazy || !1, B._size = 0, B._pendingSize = 0, B._created = 0, B._drain = !1, B._opening = !1, B._ending = !1, B._fileExist = !1, B.dirname && B._createLogDirIfNotExist(B.dirname), B.lazy || B.open(), B; } return p(J, G), r(J, [{ key: "finishIfEnding", value: function() { var D = this; this._ending && (this._opening ? this.once("open", function() { D._stream.once("finish", function() { return D.emit("finish"); }), setImmediate(function() { return D._stream.end(); }); }) : (this._stream.once("finish", function() { return D.emit("finish"); }), setImmediate(function() { return D._stream.end(); }))); } /** * Core logging method exposed to Winston. Metadata is optional. * @param {Object} info - TODO: add param description. * @param {Function} callback - TODO: add param description. * @returns {undefined} */ }, { key: "log", value: function(D) { var X = this, V = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : function() { }; if (this.silent) return V(), !0; if (this._drain) { this._stream.once("drain", function() { X._drain = !1, X.log(D, V); }); return; } if (this._rotate) { this._stream.once("rotate", function() { X._rotate = !1, X.log(D, V); }); return; } if (this.lazy) { if (!this._fileExist) { this._opening || this.open(), this.once("open", function() { X._fileExist = !0, X.log(D, V); }); return; } if (this._needsNewFile(this._pendingSize)) { this._dest.once("close", function() { X._opening || X.open(), X.once("open", function() { X.log(D, V); }); }); return; } } var K = "".concat(D[b]).concat(this.eol), $ = Buffer.byteLength(K); function _() { var N = this; if (this._size += $, this._pendingSize -= $, q("logged %s %s", this._size, K), this.emit("logged", D), !this._rotate && !this._opening && this._needsNewFile()) { if (this.lazy) { this._endStream(function() { N.emit("fileclosed"); }); return; } this._rotate = !0, this._endStream(function() { return N._rotateFile(); }); } } this._pendingSize += $, this._opening && !this.rotatedWhileOpening && this._needsNewFile(this._size + this._pendingSize) && (this.rotatedWhileOpening = !0); var I = this._stream.write(K, _.bind(this)); return I ? V() : (this._drain = !0, this._stream.once("drain", function() { X._drain = !1, V(); })), q("written", I, this._drain), this.finishIfEnding(), I; } /** * Query the transport. Options object is optional. * @param {Object} options - Loggly-like query options for this instance. * @param {function} callback - Continuation to respond to when complete. * TODO: Refactor me. */ }, { key: "query", value: function(D, X) { typeof D == "function" && (X = D, D = {}), D = Q(D); var V = h.join(this.dirname, this.filename), K = "", $ = [], _ = 0, I = m.createReadStream(V, { encoding: "utf8" }); I.on("error", function(k) { if (I.readable && I.destroy(), !!X) return k.code !== "ENOENT" ? X(k) : X(null, $); }), I.on("data", function(k) { k = (K + k).split(/\n+/); for (var M = k.length - 1, O = 0; O < M; O++) (!D.start || _ >= D.start) && N(k[O]), _++; K = k[M]; }), I.on("close", function() { K && N(K, !0), D.order === "desc" && ($ = $.reverse()), X && X(null, $); }); function N(k, M) { try { var O = JSON.parse(k); C(O) && L(O); } catch (A) { M || I.emit("error", A); } } function L(k) { if (D.rows && $.length >= D.rows && D.order !== "desc") { I.readable && I.destroy(); return; } D.fields && (k = D.fields.reduce(function(M, O) { return M[O] = k[O], M; }, {})), D.order === "desc" && $.length >= D.rows && $.shift(), $.push(k); } function C(k) { if (k && t(k) === "object") { var M = new Date(k.timestamp); if (!(D.from && M < D.from || D.until && M > D.until || D.level && D.level !== k.level)) return !0; } } function Q(k) { return k = k || {}, k.rows = k.rows || k.limit || 10, k.start = k.start || 0, k.until = k.until || /* @__PURE__ */ new Date(), t(k.until) !== "object" && (k.until = new Date(k.until)), k.from = k.from || k.until - 1440 * 60 * 1e3, t(k.from) !== "object" && (k.from = new Date(k.from)), k.order = k.order || "desc", k; } } /** * Returns a log stream for this transport. Options object is optional. * @param {Object} options - Stream options for this instance. * @returns {Stream} - TODO: add return description. * TODO: Refactor me. */ }, { key: "stream", value: function() { var D = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, X = h.join(this.dirname, this.filename), V = new E(), K = { file: X, start: D.start }; return V.destroy = H(K, function($, _) { if ($) return V.emit("error", $); try { V.emit("data", _), _ = JSON.parse(_), V.emit("log", _); } catch (I) { V.emit("error", I); } }), V; } /** * Checks to see the filesize of. * @returns {undefined} */ }, { key: "open", value: function() { var D = this; this.filename && (this._opening || (this._opening = !0, this.stat(function(X, V) { if (X) return D.emit("error", X); q("stat done: %s { size: %s }", D.filename, V), D._size = V, D._dest = D._createStream(D._stream), D._opening = !1, D.once("open", function() { D._stream.emit("rotate") || (D._rotate = !1); }); }))); } /** * Stat the file and assess information in order to create the proper stream. * @param {function} callback - TODO: add param description. * @returns {undefined} */ }, { key: "stat", value: function(D) { var X = this, V = this._getFile(), K = h.join(this.dirname, V); m.stat(K, function($, _) { if ($ && $.code === "ENOENT") return q("ENOENT ok", K), X.filename = V, D(null, 0); if ($) return q("err ".concat($.code, " ").concat(K)), D($); if (!_ || X._needsNewFile(_.size)) return X._incFile(function() { return X.stat(D); }); X.filename = V, D(null, _.size); }); } /** * Closes the stream associated with this instance. * @param {function} cb - TODO: add param description. * @returns {undefined} */ }, { key: "close", value: function(D) { var X = this; this._stream && this._stream.end(function() { D && D(), X.emit("flush"), X.emit("closed"); }); } /** * TODO: add method description. * @param {number} size - TODO: add param description. * @returns {undefined} */ }, { key: "_needsNewFile", value: function(D) { return D = D || this._size, this.maxsize && D >= this.maxsize; } /** * TODO: add method description. * @param {Error} err - TODO: add param description. * @returns {undefined} */ }, { key: "_onError", value: function(D) { this.emit("error", D); } /** * TODO: add method description. * @param {Stream} stream - TODO: add param description. * @returns {mixed} - TODO: add return description. */ }, { key: "_setupStream", value: function(D) { return D.on("error", this._onError), D; } /** * TODO: add method description. * @param {Stream} stream - TODO: add param description. * @returns {mixed} - TODO: add return description. */ }, { key: "_cleanupStream", value: function(D) { return D.removeListener("error", this._onError), D.destroy(), D; } /** * TODO: add method description. */ }, { key: "_rotateFile", value: function() { var D = this; this._incFile(function() { return D.open(); }); } /** * Unpipe from the stream that has been marked as full and end it so it * flushes to disk. * * @param {function} callback - Callback for when the current file has closed. * @private */ }, { key: "_endStream", value: function() { var D = this, X = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() { }; this._dest ? (this._stream.unpipe(this._dest), this._dest.end(function() { D._cleanupStream(D._dest), X(); })) : X(); } /** * Returns the WritableStream for the active file on this instance. If we * should gzip the file then a zlib stream is returned. * * @param {ReadableStream} source –PassThrough to pipe to the file when open. * @returns {WritableStream} Stream that writes to disk for the active file. */ }, { key: "_createStream", value: function(D) { var X = this, V = h.join(this.dirname, this.filename); q("create stream start", V, this.options); var K = m.createWriteStream(V, this.options).on("error", function($) { return q($); }).on("close", function() { return q("close", K.path, K.bytesWritten); }).on("open", function() { q("file open ok", V), X.emit("open", V), D.pipe(K), X.rotatedWhileOpening && (X._stream = new T(), X._stream.setMaxListeners(30), X._rotateFile(), X.rotatedWhileOpening = !1, X._cleanupStream(K), D.end()); }); return q("create stream ok", V), K; } /** * TODO: add method description. * @param {function} callback - TODO: add param description. * @returns {undefined} */ }, { key: "_incFile", value: function(D) { q("_incFile", this.filename); var X = h.extname(this._basename), V = h.basename(this._basename, X), K = []; this.zippedArchive && K.push(function($) { var _ = this._created > 0 && !this.tailable ? this._created : ""; this._compressFile(h.join(this.dirname, "".concat(V).concat(_).concat(X)), h.join(this.dirname, "".concat(V).concat(_).concat(X, ".gz")), $); }.bind(this)), K.push(function($) { this.tailable ? this._checkMaxFilesTailable(X, V, $) : (this._created += 1, this._checkMaxFilesIncrementing(X, V, $)); }.bind(this)), y(K, D); } /** * Gets the next filename to use for this instance in the case that log * filesizes are being capped. * @returns {string} - TODO: add return description. * @private */ }, { key: "_getFile", value: function() { var D = h.extname(this._basename), X = h.basename(this._basename, D), V = this.rotationFormat ? this.rotationFormat() : this._created; return !this.tailable && this._created ? "".concat(X).concat(V).concat(D) : "".concat(X).concat(D); } /** * Increment the number of files created or checked by this instance. * @param {mixed} ext - TODO: add param description. * @param {mixed} basename - TODO: add param description. * @param {mixed} callback - TODO: add param description. * @returns {undefined} * @private */ }, { key: "_checkMaxFilesIncrementing", value: function(D, X, V) { if (!this.maxFiles || this._created < this.maxFiles) return setImmediate(V); var K = this._created - this.maxFiles, $ = K !== 0 ? K : "", _ = this.zippedArchive ? ".gz" : "", I = "".concat(X).concat($).concat(D).concat(_), N = h.join(this.dirname, I); m.unlink(N, V); } /** * Roll files forward based on integer, up to maxFiles. e.g. if base if * file.log and it becomes oversized, roll to file1.log, and allow file.log * to be re-used. If file is oversized again, roll file1.log to file2.log, * roll file.log to file1.log, and so on. * @param {mixed} ext - TODO: add param description. * @param {mixed} basename - TODO: add param description. * @param {mixed} callback - TODO: add param description. * @returns {undefined} * @private */ }, { key: "_checkMaxFilesTailable", value: function(D, X, V) { var K = this, $ = []; if (this.maxFiles) { for (var _ = this.zippedArchive ? ".gz" : "", I = this.maxFiles - 1; I > 1; I--) $.push(function(N, L) { var C = this, Q = "".concat(X).concat(N - 1).concat(D).concat(_), k = h.join(this.dirname, Q); m.exists(k, function(M) { if (!M) return L(null); Q = "".concat(X).concat(N).concat(D).concat(_), m.rename(k, h.join(C.dirname, Q), L); }); }.bind(this, I)); y($, function() { m.rename(h.join(K.dirname, "".concat(X).concat(D).concat(_)), h.join(K.dirname, "".concat(X, "1").concat(D).concat(_)), V); }); } } /** * Compresses src to dest with gzip and unlinks src * @param {string} src - path to source file. * @param {string} dest - path to zipped destination file. * @param {Function} callback - callback called after file has been compressed. * @returns {undefined} * @private */ }, { key: "_compressFile", value: function(D, X, V) { m.access(D, m.F_OK, function(K) { if (K) return V(); var $ = x.createGzip(), _ = m.createReadStream(D), I = m.createWriteStream(X); I.on("finish", function() { m.unlink(D, V); }), _.pipe($).pipe(I); }); } }, { key: "_createLogDirIfNotExist", value: function(D) { m.existsSync(D) || m.mkdirSync(D, { recursive: !0 }); } }]); })(U), _x; } var Ex, Yk; function BJ() { if (Yk) return Ex; Yk = 1; function t(q) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(Y) { return typeof Y; } : function(Y) { return Y && typeof Symbol == "function" && Y.constructor === Symbol && Y !== Symbol.prototype ? "symbol" : typeof Y; }, t(q); } function e(q, Y) { var H = Object.keys(q); if (Object.getOwnPropertySymbols) { var G = Object.getOwnPropertySymbols(q); Y && (G = G.filter(function(J) { return Object.getOwnPropertyDescriptor(q, J).enumerable; })), H.push.apply(H, G); } return H; } function n(q) { for (var Y = 1; Y < arguments.length; Y++) { var H = arguments[Y] != null ? arguments[Y] : {}; Y % 2 ? e(Object(H), !0).forEach(function(G) { r(q, G, H[G]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(q, Object.getOwnPropertyDescriptors(H)) : e(Object(H)).forEach(function(G) { Object.defineProperty(q, G, Object.getOwnPropertyDescriptor(H, G)); }); } return q; } function r(q, Y, H) { return (Y = s(Y)) in q ? Object.defineProperty(q, Y, { value: H, enumerable: !0, configurable: !0, writable: !0 }) : q[Y] = H, q; } function i(q, Y) { if (!(q instanceof Y)) throw new TypeError("Cannot call a class as a function"); } function o(q, Y) { for (var H = 0; H < Y.length; H++) { var G = Y[H]; G.enumerable = G.enumerable || !1, G.configurable = !0, "value" in G && (G.writable = !0), Object.defineProperty(q, s(G.key), G); } } function a(q, Y, H) { return Y && o(q.prototype, Y), Object.defineProperty(q, "prototype", { writable: !1 }), q; } function s(q) { var Y = c(q, "string"); return t(Y) == "symbol" ? Y : Y + ""; } function c(q, Y) { if (t(q) != "object" || !q) return q; var H = q[Symbol.toPrimitive]; if (H !== void 0) { var G = H.call(q, Y); if (t(G) != "object") return G; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(q); } function u(q, Y, H) { return Y = m(Y), d(q, f() ? Reflect.construct(Y, H || [], m(q).constructor) : Y.apply(q, H)); } function d(q, Y) { if (Y && (t(Y) == "object" || typeof Y == "function")) return Y; if (Y !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return p(q); } function p(q) { if (q === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return q; } function f() { try { var q = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (f = function() { return !!q; })(); } function m(q) { return m = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(Y) { return Y.__proto__ || Object.getPrototypeOf(Y); }, m(q); } function h(q, Y) { if (typeof Y != "function" && Y !== null) throw new TypeError("Super expression must either be null or a function"); q.prototype = Object.create(Y && Y.prototype, { constructor: { value: q, writable: !0, configurable: !0 } }), Object.defineProperty(q, "prototype", { writable: !1 }), Y && y(q, Y); } function y(q, Y) { return y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(H, G) { return H.__proto__ = G, H; }, y(q, Y); } var x = Ds, g = hl, b = Uc(), S = b.Stream, E = rf(), T = nf(), U = T.configure; return Ex = /* @__PURE__ */ (function(q) { function Y() { var H, G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; return i(this, Y), H = u(this, Y, [G]), H.options = G, H.name = G.name || "http", H.ssl = !!G.ssl, H.host = G.host || "localhost", H.port = G.port, H.auth = G.auth, H.path = G.path || "", H.maximumDepth = G.maximumDepth, H.agent = G.agent, H.headers = G.headers || {}, H.headers["content-type"] = "application/json", H.batch = G.batch || !1, H.batchInterval = G.batchInterval || 5e3, H.batchCount = G.batchCount || 10, H.batchOptions = [], H.batchTimeoutID = -1, H.batchCallback = {}, H.port || (H.port = H.ssl ? 443 : 80), H; } return h(Y, q), a(Y, [{ key: "log", value: function(G, J) { var B = this; this._request(G, null, null, function(D, X) { X && X.statusCode !== 200 && (D = new Error("Invalid HTTP Status Code: ".concat(X.statusCode))), D ? B.emit("warn", D) : B.emit("logged", G); }), J && setImmediate(J); } /** * Query the transport. Options object is optional. * @param {Object} options - Loggly-like query options for this instance. * @param {function} callback - Continuation to respond to when complete. * @returns {undefined} */ }, { key: "query", value: function(G, J) { typeof G == "function" && (J = G, G = {}), G = { method: "query", params: this.normalizeQuery(G) }; var B = G.params.auth || null; delete G.params.auth; var D = G.params.path || null; delete G.params.path, this._request(G, B, D, function(X, V, K) { if (V && V.statusCode !== 200 && (X = new Error("Invalid HTTP Status Code: ".concat(V.statusCode))), X) return J(X); if (typeof K == "string") try { K = JSON.parse(K); } catch ($) { return J($); } J(null, K); }); } /** * Returns a log stream for this transport. Options object is optional. * @param {Object} options - Stream options for this instance. * @returns {Stream} - TODO: add return description */ }, { key: "stream", value: function() { var G = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, J = new S(); G = { method: "stream", params: G }; var B = G.params.path || null; delete G.params.path; var D = G.params.auth || null; delete G.params.auth; var X = "", V = this._request(G, D, B); return J.destroy = function() { return V.destroy(); }, V.on("data", function(K) { K = (X + K).split(/\n+/); for (var $ = K.length - 1, _ = 0; _ < $; _++) try { J.emit("log", JSON.parse(K[_])); } catch (I) { J.emit("error", I); } X = K[$]; }), V.on("error", function(K) { return J.emit("error", K); }), J; } /** * Make a request to a winstond server or any http server which can * handle json-rpc. * @param {function} options - Options to sent the request. * @param {Object?} auth - authentication options * @param {string} path - request path * @param {function} callback - Continuation to respond to when complete. */ }, { key: "_request", value: function(G, J, B, D) { G = G || {}, J = J || this.auth, B = B || this.path || "", this.batch ? this._doBatch(G, D, J, B) : this._doRequest(G, D, J, B); } /** * Send or memorize the options according to batch configuration * @param {function} options - Options to sent the request. * @param {function} callback - Continuation to respond to when complete. * @param {Object?} auth - authentication options * @param {string} path - request path */ }, { key: "_doBatch", value: function(G, J, B, D) { if (this.batchOptions.push(G), this.batchOptions.length === 1) { var X = this; this.batchCallback = J, this.batchTimeoutID = setTimeout(function() { X.batchTimeoutID = -1, X._doBatchRequest(X.batchCallback, B, D); }, this.batchInterval); } this.batchOptions.length === this.batchCount && this._doBatchRequest(this.batchCallback, B, D); } /** * Initiate a request with the memorized batch options, stop the batch timeout * @param {function} callback - Continuation to respond to when complete. * @param {Object?} auth - authentication options * @param {string} path - request path */ }, { key: "_doBatchRequest", value: function(G, J, B) { this.batchTimeoutID > 0 && (clearTimeout(this.batchTimeoutID), this.batchTimeoutID = -1); var D = this.batchOptions.slice(); this.batchOptions = [], this._doRequest(D, G, J, B); } /** * Make a request to a winstond server or any http server which can * handle json-rpc. * @param {function} options - Options to sent the request. * @param {function} callback - Continuation to respond to when complete. * @param {Object?} auth - authentication options * @param {string} path - request path */ }, { key: "_doRequest", value: function(G, J, B, D) { var X = Object.assign({}, this.headers); B && B.bearer && (X.Authorization = "Bearer ".concat(B.bearer)); var V = (this.ssl ? g : x).request(n(n({}, this.options), {}, { method: "POST", host: this.host, port: this.port, path: "/".concat(D.replace(/^\//, "")), headers: X, auth: B && B.username && B.password ? "".concat(B.username, ":").concat(B.password) : "", agent: this.agent })); V.on("error", J), V.on("response", function($) { return $.on("end", function() { return J(null, $); }).resume(); }); var K = U(n({}, this.maximumDepth && { maximumDepth: this.maximumDepth })); V.end(Buffer.from(K(G, this.options.replacer), "utf8")); } }]); })(E), Ex; } var Ax, Jk; function wM() { if (Jk) return Ax; Jk = 1; const t = (e) => e !== null && typeof e == "object" && typeof e.pipe == "function"; return t.writable = (e) => t(e) && e.writable !== !1 && typeof e._write == "function" && typeof e._writableState == "object", t.readable = (e) => t(e) && e.readable !== !1 && typeof e._read == "function" && typeof e._readableState == "object", t.duplex = (e) => t.writable(e) && t.readable(e), t.transform = (e) => t.duplex(e) && typeof e._transform == "function", Ax = t, Ax; } var Ix, Xk; function UJ() { if (Xk) return Ix; Xk = 1; function t(b) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) { return typeof S; } : function(S) { return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S; }, t(b); } function e(b, S) { if (!(b instanceof S)) throw new TypeError("Cannot call a class as a function"); } function n(b, S) { for (var E = 0; E < S.length; E++) { var T = S[E]; T.enumerable = T.enumerable || !1, T.configurable = !0, "value" in T && (T.writable = !0), Object.defineProperty(b, i(T.key), T); } } function r(b, S, E) { return S && n(b.prototype, S), Object.defineProperty(b, "prototype", { writable: !1 }), b; } function i(b) { var S = o(b, "string"); return t(S) == "symbol" ? S : S + ""; } function o(b, S) { if (t(b) != "object" || !b) return b; var E = b[Symbol.toPrimitive]; if (E !== void 0) { var T = E.call(b, S); if (t(T) != "object") return T; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(b); } function a(b, S, E) { return S = d(S), s(b, u() ? Reflect.construct(S, E || [], d(b).constructor) : S.apply(b, E)); } function s(b, S) { if (S && (t(S) == "object" || typeof S == "function")) return S; if (S !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return c(b); } function c(b) { if (b === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return b; } function u() { try { var b = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!b; })(); } function d(b) { return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(S) { return S.__proto__ || Object.getPrototypeOf(S); }, d(b); } function p(b, S) { if (typeof S != "function" && S !== null) throw new TypeError("Super expression must either be null or a function"); b.prototype = Object.create(S && S.prototype, { constructor: { value: b, writable: !0, configurable: !0 } }), Object.defineProperty(b, "prototype", { writable: !1 }), S && f(b, S); } function f(b, S) { return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(E, T) { return E.__proto__ = T, E; }, f(b, S); } var m = wM(), h = dn(), y = h.MESSAGE, x = Ln, g = rf(); return Ix = /* @__PURE__ */ (function(b) { function S() { var E, T = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; if (e(this, S), E = a(this, S, [T]), !T.stream || !m(T.stream)) throw new Error("options.stream is required."); return E._stream = T.stream, E._stream.setMaxListeners(1 / 0), E.isObjectMode = T.stream._writableState.objectMode, E.eol = typeof T.eol == "string" ? T.eol : x.EOL, E; } return p(S, b), r(S, [{ key: "log", value: function(T, U) { var q = this; if (setImmediate(function() { return q.emit("logged", T); }), this.isObjectMode) { this._stream.write(T), U && U(); return; } this._stream.write("".concat(T[y]).concat(this.eol)), U && U(); } }]); })(g), Ix; } var Zk; function LJ() { return Zk || (Zk = 1, (function(t) { Object.defineProperty(t, "Console", { configurable: !0, enumerable: !0, get: function() { return hJ(); } }), Object.defineProperty(t, "File", { configurable: !0, enumerable: !0, get: function() { return RJ(); } }), Object.defineProperty(t, "Http", { configurable: !0, enumerable: !0, get: function() { return BJ(); } }), Object.defineProperty(t, "Stream", { configurable: !0, enumerable: !0, get: function() { return UJ(); } }); })(Wv)), Wv; } var su = {}, e8; function yE() { if (e8) return su; e8 = 1; var t = cM(), e = dn(), n = e.configs; return su.cli = t.levels(n.cli), su.npm = t.levels(n.npm), su.syslog = t.levels(n.syslog), su.addColors = t.levels, su; } var zh = { exports: {} }, Hh = { exports: {} }, t8; function QJ() { return t8 || (t8 = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = mE(), r = x(n), i = gE(), o = x(i), a = yM(), s = x(a), c = mM(), u = x(c), d = gM(), p = x(d), f = xl(), m = x(f), h = of(), y = x(h); function x(E) { return E && E.__esModule ? E : { default: E }; } function g(E, T, U) { U = (0, u.default)(U); var q = 0, Y = 0, { length: H } = E, G = !1; H === 0 && U(null); function J(B, D) { B === !1 && (G = !0), G !== !0 && (B ? U(B) : (++Y === H || D === o.default) && U(null)); } for (; q < H; q++) T(E[q], q, (0, p.default)(J)); } function b(E, T, U) { return (0, s.default)(E, 1 / 0, T, U); } function S(E, T, U) { var q = (0, r.default)(E) ? g : b; return q(E, (0, m.default)(T), U); } e.default = (0, y.default)(S, 3), t.exports = e.default; })(Hh, Hh.exports)), Hh.exports; } var Wh = { exports: {} }, n8; function jJ() { return n8 || (n8 = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }), e.default = n; function n(r) { return (i, o, a) => r(i, a); } t.exports = e.default; })(Wh, Wh.exports)), Wh.exports; } var r8; function bE() { return r8 || (r8 = 1, (function(t, e) { Object.defineProperty(e, "__esModule", { value: !0 }); var n = QJ(), r = d(n), i = jJ(), o = d(i), a = xl(), s = d(a), c = of(), u = d(c); function d(f) { return f && f.__esModule ? f : { default: f }; } function p(f, m, h) { return (0, r.default)(f, (0, o.default)((0, s.default)(m)), h); } e.default = (0, u.default)(p, 3), t.exports = e.default; })(zh, zh.exports)), zh.exports; } var Cx, i8; function $J() { if (i8) return Cx; i8 = 1; var t = Object.prototype.toString; return Cx = function(n) { if (typeof n.displayName == "string" && n.constructor.name) return n.displayName; if (typeof n.name == "string" && n.name) return n.name; if (typeof n == "object" && n.constructor && typeof n.constructor.name == "string") return n.constructor.name; var r = n.toString(), i = t.call(n).slice(8, -1); return i === "Function" ? r = r.substring(r.indexOf("(") + 1, r.indexOf(")")) : r = i, r || "anonymous"; }, Cx; } var Tx, o8; function SM() { if (o8) return Tx; o8 = 1; var t = $J(); return Tx = function(n) { var r = 0, i; function o() { return r || (r = 1, i = n.apply(this, arguments), n = null), i; } return o.displayName = t(n), o; }, Tx; } var kx = {}, a8; function _M() { return a8 || (a8 = 1, (function(t) { t.get = function(i) { var o = Error.stackTraceLimit; Error.stackTraceLimit = 1 / 0; var a = {}, s = Error.prepareStackTrace; Error.prepareStackTrace = function(u, d) { return d; }, Error.captureStackTrace(a, i || t.get); var c = a.stack; return Error.prepareStackTrace = s, Error.stackTraceLimit = o, c; }, t.parse = function(i) { if (!i.stack) return []; var o = this, a = i.stack.split(` `).slice(1); return a.map(function(s) { if (s.match(/^\s*[-]{4,}$/)) return o._createParsedCallSite({ fileName: s, lineNumber: null, functionName: null, typeName: null, methodName: null, columnNumber: null, native: null }); var c = s.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/); if (c) { var u = null, d = null, p = null, f = null, m = null, h = c[5] === "native"; if (c[1]) { p = c[1]; var y = p.lastIndexOf("."); if (p[y - 1] == "." && y--, y > 0) { u = p.substr(0, y), d = p.substr(y + 1); var x = u.indexOf(".Module"); x > 0 && (p = p.substr(x + 1), u = u.substr(0, x)); } f = null; } d && (f = u, m = d), d === "<anonymous>" && (m = null, p = null); var g = { fileName: c[2] || null, lineNumber: parseInt(c[3], 10) || null, functionName: p, typeName: f, methodName: m, columnNumber: parseInt(c[4], 10) || null, native: h }; return o._createParsedCallSite(g); } }).filter(function(s) { return !!s; }); }; function e(i) { for (var o in i) this[o] = i[o]; } var n = [ "this", "typeName", "functionName", "methodName", "fileName", "lineNumber", "columnNumber", "function", "evalOrigin" ], r = [ "topLevel", "eval", "native", "constructor" ]; n.forEach(function(i) { e.prototype[i] = null, e.prototype["get" + i[0].toUpperCase() + i.substr(1)] = function() { return this[i]; }; }), r.forEach(function(i) { e.prototype[i] = !1, e.prototype["is" + i[0].toUpperCase() + i.substr(1)] = function() { return this[i]; }; }), t._createParsedCallSite = function(i) { return new e(i); }; })(kx)), kx; } var Nx, s8; function GJ() { if (s8) return Nx; s8 = 1; function t(y) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(x) { return typeof x; } : function(x) { return x && typeof Symbol == "function" && x.constructor === Symbol && x !== Symbol.prototype ? "symbol" : typeof x; }, t(y); } function e(y, x) { if (!(y instanceof x)) throw new TypeError("Cannot call a class as a function"); } function n(y, x) { for (var g = 0; g < x.length; g++) { var b = x[g]; b.enumerable = b.enumerable || !1, b.configurable = !0, "value" in b && (b.writable = !0), Object.defineProperty(y, i(b.key), b); } } function r(y, x, g) { return x && n(y.prototype, x), Object.defineProperty(y, "prototype", { writable: !1 }), y; } function i(y) { var x = o(y, "string"); return t(x) == "symbol" ? x : x + ""; } function o(y, x) { if (t(y) != "object" || !y) return y; var g = y[Symbol.toPrimitive]; if (g !== void 0) { var b = g.call(y, x); if (t(b) != "object") return b; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(y); } function a(y, x, g) { return x = d(x), s(y, u() ? Reflect.construct(x, g || [], d(y).constructor) : x.apply(y, g)); } function s(y, x) { if (x && (t(x) == "object" || typeof x == "function")) return x; if (x !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return c(y); } function c(y) { if (y === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return y; } function u() { try { var y = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!y; })(); } function d(y) { return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(x) { return x.__proto__ || Object.getPrototypeOf(x); }, d(y); } function p(y, x) { if (typeof x != "function" && x !== null) throw new TypeError("Super expression must either be null or a function"); y.prototype = Object.create(x && x.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), Object.defineProperty(y, "prototype", { writable: !1 }), x && f(y, x); } function f(y, x) { return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(g, b) { return g.__proto__ = b, g; }, f(y, x); } var m = Uc(), h = m.Writable; return Nx = /* @__PURE__ */ (function(y) { function x(g) { var b; if (e(this, x), b = a(this, x, [{ objectMode: !0 }]), !g) throw new Error("ExceptionStream requires a TransportStream instance."); return b.handleExceptions = !0, b.transport = g, b; } return p(x, y), r(x, [{ key: "_write", value: function(b, S, E) { return b.exception ? this.transport.log(b, E) : (E(), !0); } }]); })(h), Nx; } var Px, c8; function EM() { if (c8) return Px; c8 = 1; function t(f) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) { return typeof m; } : function(m) { return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m; }, t(f); } function e(f, m) { if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function"); } function n(f, m) { for (var h = 0; h < m.length; h++) { var y = m[h]; y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y); } } function r(f, m, h) { return m && n(f.prototype, m), Object.defineProperty(f, "prototype", { writable: !1 }), f; } function i(f) { var m = o(f, "string"); return t(m) == "symbol" ? m : m + ""; } function o(f, m) { if (t(f) != "object" || !f) return f; var h = f[Symbol.toPrimitive]; if (h !== void 0) { var y = h.call(f, m); if (t(y) != "object") return y; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(f); } var a = Ln, s = bE(), c = k0()("winston:exception"), u = SM(), d = _M(), p = GJ(); return Px = /* @__PURE__ */ (function() { function f(m) { if (e(this, f), !m) throw new Error("Logger is required to handle exceptions"); this.logger = m, this.handlers = /* @__PURE__ */ new Map(); } return r(f, [{ key: "handle", value: function() { for (var h = this, y = arguments.length, x = new Array(y), g = 0; g < y; g++) x[g] = arguments[g]; x.forEach(function(b) { if (Array.isArray(b)) return b.forEach(function(S) { return h._addHandler(S); }); h._addHandler(b); }), this.catcher || (this.catcher = this._uncaughtException.bind(this), process.on("uncaughtException", this.catcher)); } /** * Removes any handlers to `uncaughtException` events for the current * process. This does not modify the state of the `this.handlers` set. * @returns {undefined} */ }, { key: "unhandle", value: function() { var h = this; this.catcher && (process.removeListener("uncaughtException", this.catcher), this.catcher = !1, Array.from(this.handlers.values()).forEach(function(y) { return h.logger.unpipe(y); })); } /** * TODO: add method description * @param {Error} err - Error to get information about. * @returns {mixed} - TODO: add return description. */ }, { key: "getAllInfo", value: function(h) { var y = null; return h && (y = typeof h == "string" ? h : h.message), { error: h, // TODO (indexzero): how do we configure this? level: "error", message: ["uncaughtException: ".concat(y || "(no error message)"), h && h.stack || " No stack trace"].join(` `), stack: h && h.stack, exception: !0, date: (/* @__PURE__ */ new Date()).toString(), process: this.getProcessInfo(), os: this.getOsInfo(), trace: this.getTrace(h) }; } /** * Gets all relevant process information for the currently running process. * @returns {mixed} - TODO: add return description. */ }, { key: "getProcessInfo", value: function() { return { pid: process.pid, uid: process.getuid ? process.getuid() : null, gid: process.getgid ? process.getgid() : null, cwd: process.cwd(), execPath: process.execPath, version: process.version, argv: process.argv, memoryUsage: process.memoryUsage() }; } /** * Gets all relevant OS information for the currently running process. * @returns {mixed} - TODO: add return description. */ }, { key: "getOsInfo", value: function() { return { loadavg: a.loadavg(), uptime: a.uptime() }; } /** * Gets a stack trace for the specified error. * @param {mixed} err - TODO: add param description. * @returns {mixed} - TODO: add return description. */ }, { key: "getTrace", value: function(h) { var y = h ? d.parse(h) : d.get(); return y.map(function(x) { return { column: x.getColumnNumber(), file: x.getFileName(), function: x.getFunctionName(), line: x.getLineNumber(), method: x.getMethodName(), native: x.isNative() }; }); } /** * Helper method to add a transport as an exception handler. * @param {Transport} handler - The transport to add as an exception handler. * @returns {void} */ }, { key: "_addHandler", value: function(h) { if (!this.handlers.has(h)) { h.handleExceptions = !0; var y = new p(h); this.handlers.set(h, y), this.logger.pipe(y); } } /** * Logs all relevant information around the `err` and exits the current * process. * @param {Error} err - Error to handle * @returns {mixed} - TODO: add return description. * @private */ }, { key: "_uncaughtException", value: function(h) { var y = this.getAllInfo(h), x = this._getExceptionHandlers(), g = typeof this.logger.exitOnError == "function" ? this.logger.exitOnError(h) : this.logger.exitOnError, b; !x.length && g && (console.warn("winston: exitOnError cannot be true with no exception handlers."), console.warn("winston: not exiting process."), g = !1); function S() { c("doExit", g), c("process._exiting", process._exiting), g && !process._exiting && (b && clearTimeout(b), process.exit(1)); } if (!x || x.length === 0) return process.nextTick(S); s(x, function(E, T) { var U = u(T), q = E.transport || E; function Y(H) { return function() { c(H), U(); }; } q._ending = !0, q.once("finish", Y("finished")), q.once("error", Y("error")); }, function() { return g && S(); }), this.logger.log(y), g && (b = setTimeout(S, 3e3)); } /** * Returns the list of transports and exceptionHandlers for this instance. * @returns {Array} - List of transports and exceptionHandlers for this * instance. * @private */ }, { key: "_getExceptionHandlers", value: function() { return this.logger.transports.filter(function(h) { var y = h.transport || h; return y.handleExceptions; }); } }]); })(), Px; } var Dx, u8; function qJ() { if (u8) return Dx; u8 = 1; function t(y) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(x) { return typeof x; } : function(x) { return x && typeof Symbol == "function" && x.constructor === Symbol && x !== Symbol.prototype ? "symbol" : typeof x; }, t(y); } function e(y, x) { if (!(y instanceof x)) throw new TypeError("Cannot call a class as a function"); } function n(y, x) { for (var g = 0; g < x.length; g++) { var b = x[g]; b.enumerable = b.enumerable || !1, b.configurable = !0, "value" in b && (b.writable = !0), Object.defineProperty(y, i(b.key), b); } } function r(y, x, g) { return x && n(y.prototype, x), Object.defineProperty(y, "prototype", { writable: !1 }), y; } function i(y) { var x = o(y, "string"); return t(x) == "symbol" ? x : x + ""; } function o(y, x) { if (t(y) != "object" || !y) return y; var g = y[Symbol.toPrimitive]; if (g !== void 0) { var b = g.call(y, x); if (t(b) != "object") return b; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(y); } function a(y, x, g) { return x = d(x), s(y, u() ? Reflect.construct(x, g || [], d(y).constructor) : x.apply(y, g)); } function s(y, x) { if (x && (t(x) == "object" || typeof x == "function")) return x; if (x !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return c(y); } function c(y) { if (y === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return y; } function u() { try { var y = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (u = function() { return !!y; })(); } function d(y) { return d = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(x) { return x.__proto__ || Object.getPrototypeOf(x); }, d(y); } function p(y, x) { if (typeof x != "function" && x !== null) throw new TypeError("Super expression must either be null or a function"); y.prototype = Object.create(x && x.prototype, { constructor: { value: y, writable: !0, configurable: !0 } }), Object.defineProperty(y, "prototype", { writable: !1 }), x && f(y, x); } function f(y, x) { return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(g, b) { return g.__proto__ = b, g; }, f(y, x); } var m = Uc(), h = m.Writable; return Dx = /* @__PURE__ */ (function(y) { function x(g) { var b; if (e(this, x), b = a(this, x, [{ objectMode: !0 }]), !g) throw new Error("RejectionStream requires a TransportStream instance."); return b.handleRejections = !0, b.transport = g, b; } return p(x, y), r(x, [{ key: "_write", value: function(b, S, E) { return b.rejection ? this.transport.log(b, E) : (E(), !0); } }]); })(h), Dx; } var Ox, l8; function AM() { if (l8) return Ox; l8 = 1; function t(f) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(m) { return typeof m; } : function(m) { return m && typeof Symbol == "function" && m.constructor === Symbol && m !== Symbol.prototype ? "symbol" : typeof m; }, t(f); } function e(f, m) { if (!(f instanceof m)) throw new TypeError("Cannot call a class as a function"); } function n(f, m) { for (var h = 0; h < m.length; h++) { var y = m[h]; y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(f, i(y.key), y); } } function r(f, m, h) { return m && n(f.prototype, m), Object.defineProperty(f, "prototype", { writable: !1 }), f; } function i(f) { var m = o(f, "string"); return t(m) == "symbol" ? m : m + ""; } function o(f, m) { if (t(f) != "object" || !f) return f; var h = f[Symbol.toPrimitive]; if (h !== void 0) { var y = h.call(f, m); if (t(y) != "object") return y; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(f); } var a = Ln, s = bE(), c = k0()("winston:rejection"), u = SM(), d = _M(), p = qJ(); return Ox = /* @__PURE__ */ (function() { function f(m) { if (e(this, f), !m) throw new Error("Logger is required to handle rejections"); this.logger = m, this.handlers = /* @__PURE__ */ new Map(); } return r(f, [{ key: "handle", value: function() { for (var h = this, y = arguments.length, x = new Array(y), g = 0; g < y; g++) x[g] = arguments[g]; x.forEach(function(b) { if (Array.isArray(b)) return b.forEach(function(S) { return h._addHandler(S); }); h._addHandler(b); }), this.catcher || (this.catcher = this._unhandledRejection.bind(this), process.on("unhandledRejection", this.catcher)); } /** * Removes any handlers to `unhandledRejection` events for the current * process. This does not modify the state of the `this.handlers` set. * @returns {undefined} */ }, { key: "unhandle", value: function() { var h = this; this.catcher && (process.removeListener("unhandledRejection", this.catcher), this.catcher = !1, Array.from(this.handlers.values()).forEach(function(y) { return h.logger.unpipe(y); })); } /** * TODO: add method description * @param {Error} err - Error to get information about. * @returns {mixed} - TODO: add return description. */ }, { key: "getAllInfo", value: function(h) { var y = null; return h && (y = typeof h == "string" ? h : h.message), { error: h, // TODO (indexzero): how do we configure this? level: "error", message: ["unhandledRejection: ".concat(y || "(no error message)"), h && h.stack || " No stack trace"].join(` `), stack: h && h.stack, rejection: !0, date: (/* @__PURE__ */ new Date()).toString(), process: this.getProcessInfo(), os: this.getOsInfo(), trace: this.getTrace(h) }; } /** * Gets all relevant process information for the currently running process. * @returns {mixed} - TODO: add return description. */ }, { key: "getProcessInfo", value: function() { return { pid: process.pid, uid: process.getuid ? process.getuid() : null, gid: process.getgid ? process.getgid() : null, cwd: process.cwd(), execPath: process.execPath, version: process.version, argv: process.argv, memoryUsage: process.memoryUsage() }; } /** * Gets all relevant OS information for the currently running process. * @returns {mixed} - TODO: add return description. */ }, { key: "getOsInfo", value: function() { return { loadavg: a.loadavg(), uptime: a.uptime() }; } /** * Gets a stack trace for the specified error. * @param {mixed} err - TODO: add param description. * @returns {mixed} - TODO: add return description. */ }, { key: "getTrace", value: function(h) { var y = h ? d.parse(h) : d.get(); return y.map(function(x) { return { column: x.getColumnNumber(), file: x.getFileName(), function: x.getFunctionName(), line: x.getLineNumber(), method: x.getMethodName(), native: x.isNative() }; }); } /** * Helper method to add a transport as an exception handler. * @param {Transport} handler - The transport to add as an exception handler. * @returns {void} */ }, { key: "_addHandler", value: function(h) { if (!this.handlers.has(h)) { h.handleRejections = !0; var y = new p(h); this.handlers.set(h, y), this.logger.pipe(y); } } /** * Logs all relevant information around the `err` and exits the current * process. * @param {Error} err - Error to handle * @returns {mixed} - TODO: add return description. * @private */ }, { key: "_unhandledRejection", value: function(h) { var y = this.getAllInfo(h), x = this._getRejectionHandlers(), g = typeof this.logger.exitOnError == "function" ? this.logger.exitOnError(h) : this.logger.exitOnError, b; !x.length && g && (console.warn("winston: exitOnError cannot be true with no rejection handlers."), console.warn("winston: not exiting process."), g = !1); function S() { c("doExit", g), c("process._exiting", process._exiting), g && !process._exiting && (b && clearTimeout(b), process.exit(1)); } if (!x || x.length === 0) return process.nextTick(S); s(x, function(E, T) { var U = u(T), q = E.transport || E; function Y(H) { return function() { c(H), U(); }; } q._ending = !0, q.once("finish", Y("finished")), q.once("error", Y("error")); }, function() { return g && S(); }), this.logger.log(y), g && (b = setTimeout(S, 3e3)); } /** * Returns the list of transports and exceptionHandlers for this instance. * @returns {Array} - List of transports and exceptionHandlers for this * instance. * @private */ }, { key: "_getRejectionHandlers", value: function() { return this.logger.transports.filter(function(h) { var y = h.transport || h; return y.handleRejections; }); } }]); })(), Ox; } var Fx = { exports: {} }, Mx = { exports: {} }, d8; function zJ() { if (d8) return Mx.exports; d8 = 1; const t = Pn, e = T0(), { LEVEL: n } = dn(), r = Mx.exports = function(o = {}) { e.call(this, { objectMode: !0, highWaterMark: o.highWaterMark }), this.format = o.format, this.level = o.level, this.handleExceptions = o.handleExceptions, this.handleRejections = o.handleRejections, this.silent = o.silent, o.log && (this.log = o.log), o.logv && (this.logv = o.logv), o.close && (this.close = o.close), this.once("pipe", (a) => { this.levels = a.levels, this.parent = a; }), this.once("unpipe", (a) => { a === this.parent && (this.parent = null, this.close && this.close()); }); }; return t.inherits(r, e), r.prototype._write = function(o, a, s) { if (this.silent || o.exception === !0 && !this.handleExceptions) return s(null); const c = this.level || this.parent && this.parent.level; if (!c || this.levels[c] >= this.levels[o[n]]) { if (o && !this.format) return this.log(o, s); let u, d; try { d = this.format.transform(Object.assign({}, o), this.format.options); } catch (p) { u = p; } if (u || !d) { if (s(), u) throw u; return; } return this.log(d, s); } return this._writableState.sync = !1, s(null); }, r.prototype._writev = function(o, a) { if (this.logv) { const s = o.filter(this._accept, this); return s.length ? this.logv(s, a) : a(null); } for (let s = 0; s < o.length; s++) { if (!this._accept(o[s])) continue; if (o[s].chunk && !this.format) { this.log(o[s].chunk, o[s].callback); continue; } let c, u; try { u = this.format.transform( Object.assign({}, o[s].chunk), this.format.options ); } catch (d) { c = d; } if (c || !u) { if (o[s].callback(), c) throw a(null), c; } else this.log(u, o[s].callback); } return a(null); }, r.prototype._accept = function(o) { const a = o.chunk; if (this.silent) return !1; const s = this.level || this.parent && this.parent.level; return !!((a.exception === !0 || !s || this.levels[s] >= this.levels[a[n]]) && (this.handleExceptions || a.exception !== !0)); }, r.prototype._nop = function() { }, Mx.exports; } var p8; function HJ() { if (p8) return Fx.exports; p8 = 1; const t = Pn, { LEVEL: e } = dn(), n = zJ(), r = Fx.exports = function(o = {}) { if (n.call(this, o), !o.transport || typeof o.transport.log != "function") throw new Error("Invalid transport, must be an object with a log method."); this.transport = o.transport, this.level = this.level || o.transport.level, this.handleExceptions = this.handleExceptions || o.transport.handleExceptions, this._deprecated(); function a(s) { this.emit("error", s, this.transport); } this.transport.__winstonError || (this.transport.__winstonError = a.bind(this), this.transport.on("error", this.transport.__winstonError)); }; return t.inherits(r, n), r.prototype._write = function(o, a, s) { if (this.silent || o.exception === !0 && !this.handleExceptions) return s(null); (!this.level || this.levels[this.level] >= this.levels[o[e]]) && this.transport.log(o[e], o.message, o, this._nop), s(null); }, r.prototype._writev = function(o, a) { for (let s = 0; s < o.length; s++) this._accept(o[s]) && (this.transport.log( o[s].chunk[e], o[s].chunk.message, o[s].chunk, this._nop ), o[s].callback()); return a(null); }, r.prototype._deprecated = function() { console.error([ `${this.transport.name} is a legacy winston transport. Consider upgrading: `, "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md" ].join(` `)); }, r.prototype.close = function() { this.transport.close && this.transport.close(), this.transport.__winstonError && (this.transport.removeListener("error", this.transport.__winstonError), this.transport.__winstonError = null); }, Fx.exports; } var Rx, f8; function WJ() { if (f8) return Rx; f8 = 1; function t(s) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) { return typeof c; } : function(c) { return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c; }, t(s); } function e(s, c) { if (!(s instanceof c)) throw new TypeError("Cannot call a class as a function"); } function n(s, c) { for (var u = 0; u < c.length; u++) { var d = c[u]; d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(s, i(d.key), d); } } function r(s, c, u) { return c && n(s.prototype, c), Object.defineProperty(s, "prototype", { writable: !1 }), s; } function i(s) { var c = o(s, "string"); return t(c) == "symbol" ? c : c + ""; } function o(s, c) { if (t(s) != "object" || !s) return s; var u = s[Symbol.toPrimitive]; if (u !== void 0) { var d = u.call(s, c); if (t(d) != "object") return d; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); } var a = /* @__PURE__ */ (function() { function s(c) { e(this, s); var u = vE(); if (t(c) !== "object" || Array.isArray(c) || !(c instanceof u)) throw new Error("Logger is required for profiling"); this.logger = c, this.start = Date.now(); } return r(s, [{ key: "done", value: function() { for (var u = arguments.length, d = new Array(u), p = 0; p < u; p++) d[p] = arguments[p]; typeof d[d.length - 1] == "function" && (console.warn("Callback function no longer supported as of winston@3.0.0"), d.pop()); var f = t(d[d.length - 1]) === "object" ? d.pop() : {}; return f.level = f.level || "info", f.durationMs = Date.now() - this.start, this.logger.write(f); } }]); })(); return Rx = a, Rx; } var Bx, h8; function KJ() { if (h8) return Bx; h8 = 1; class t extends Error { constructor(n) { super(`Format functions must be synchronous taking a two arguments: (info, opts) Found: ${n.toString().split(` `)[0]} `), Error.captureStackTrace(this, t); } } return Bx = (e) => { if (e.length > 2) throw new t(e); function n(i = {}) { this.options = i; } n.prototype.transform = e; function r(i) { return new n(i); } return r.Format = n, r; }, Bx; } var Ux, m8; function VJ() { if (m8) return Ux; m8 = 1; const t = KJ(), { MESSAGE: e } = dn(), n = nf(); function r(i, o) { return typeof o == "bigint" ? o.toString() : o; } return Ux = t((i, o) => { const a = n.configure(o); return i[e] = a(i, o.replacer || r, o.space), i; }), Ux; } var Lx, g8; function vE() { if (g8) return Lx; g8 = 1; function t(K, $, _) { return ($ = o($)) in K ? Object.defineProperty(K, $, { value: _, enumerable: !0, configurable: !0, writable: !0 }) : K[$] = _, K; } function e(K) { "@babel/helpers - typeof"; return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function($) { return typeof $; } : function($) { return $ && typeof Symbol == "function" && $.constructor === Symbol && $ !== Symbol.prototype ? "symbol" : typeof $; }, e(K); } function n(K, $) { if (!(K instanceof $)) throw new TypeError("Cannot call a class as a function"); } function r(K, $) { for (var _ = 0; _ < $.length; _++) { var I = $[_]; I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(K, o(I.key), I); } } function i(K, $, _) { return $ && r(K.prototype, $), Object.defineProperty(K, "prototype", { writable: !1 }), K; } function o(K) { var $ = a(K, "string"); return e($) == "symbol" ? $ : $ + ""; } function a(K, $) { if (e(K) != "object" || !K) return K; var _ = K[Symbol.toPrimitive]; if (_ !== void 0) { var I = _.call(K, $); if (e(I) != "object") return I; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(K); } function s(K, $, _) { return $ = p($), c(K, d() ? Reflect.construct($, _ || [], p(K).constructor) : $.apply(K, _)); } function c(K, $) { if ($ && (e($) == "object" || typeof $ == "function")) return $; if ($ !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return u(K); } function u(K) { if (K === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return K; } function d() { try { var K = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (d = function() { return !!K; })(); } function p(K) { return p = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function($) { return $.__proto__ || Object.getPrototypeOf($); }, p(K); } function f(K, $) { if (typeof $ != "function" && $ !== null) throw new TypeError("Super expression must either be null or a function"); K.prototype = Object.create($ && $.prototype, { constructor: { value: K, writable: !0, configurable: !0 } }), Object.defineProperty(K, "prototype", { writable: !1 }), $ && m(K, $); } function m(K, $) { return m = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(_, I) { return _.__proto__ = I, _; }, m(K, $); } var h = Uc(), y = h.Stream, x = h.Transform, g = bE(), b = dn(), S = b.LEVEL, E = b.SPLAT, T = wM(), U = EM(), q = AM(), Y = HJ(), H = WJ(), G = uM(), J = G.warn, B = yE(), D = /%[scdjifoO%]/g, X = /* @__PURE__ */ (function(K) { function $(_) { var I; return n(this, $), I = s(this, $, [{ objectMode: !0 }]), I.configure(_), I; } return f($, K), i($, [{ key: "child", value: function(I) { var N = this; return Object.create(N, { write: { value: function(C) { var Q = Object.assign({}, I, C); C instanceof Error && (Q.stack = C.stack, Q.message = C.message), N.write(Q); } } }); } /** * This will wholesale reconfigure this instance by: * 1. Resetting all transports. Older transports will be removed implicitly. * 2. Set all other options including levels, colors, rewriters, filters, * exceptionHandlers, etc. * @param {!Object} options - TODO: add param description. * @returns {undefined} */ }, { key: "configure", value: function() { var I = this, N = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, L = N.silent, C = N.format, Q = N.defaultMeta, k = N.levels, M = N.level, O = M === void 0 ? "info" : M, A = N.exitOnError, F = A === void 0 ? !0 : A, Z = N.transports, ee = N.colors, P = N.emitErrs, j = N.formatters, W = N.padLevels, se = N.rewriters, ce = N.stripColors, oe = N.exceptionHandlers, we = N.rejectionHandlers; if (this.transports.length && this.clear(), this.silent = L, this.format = C || this.format || VJ()(), this.defaultMeta = Q || null, this.levels = k || this.levels || B.npm.levels, this.level = O, this.exceptions && this.exceptions.unhandle(), this.rejections && this.rejections.unhandle(), this.exceptions = new U(this), this.rejections = new q(this), this.profilers = {}, this.exitOnError = F, Z && (Z = Array.isArray(Z) ? Z : [Z], Z.forEach(function(Me) { return I.add(Me); })), ee || P || j || W || se || ce) throw new Error(["{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.", "Use a custom winston.format(function) instead.", "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(` `)); oe && this.exceptions.handle(oe), we && this.rejections.handle(we); } /* eslint-disable valid-jsdoc */ /** * Helper method to get the highest logging level associated with a logger * * @returns { number | null } - The highest configured logging level, null * for invalid configuration */ }, { key: "getHighestLogLevel", value: function() { var I = this, N = V(this.levels, this.level); return !this.transports || this.transports.length === 0 ? N : this.transports.reduce(function(L, C) { var Q = V(I.levels, C.level); return Q !== null && Q > L ? Q : L; }, N); } }, { key: "isLevelEnabled", value: function(I) { var N = this, L = V(this.levels, I); if (L === null) return !1; var C = V(this.levels, this.level); if (C === null) return !1; if (!this.transports || this.transports.length === 0) return C >= L; var Q = this.transports.findIndex(function(k) { var M = V(N.levels, k.level); return M === null && (M = C), M >= L; }); return Q !== -1; } /* eslint-disable valid-jsdoc */ /** * Ensure backwards compatibility with a `log` method * @param {mixed} level - Level the log message is written at. * @param {mixed} msg - TODO: add param description. * @param {mixed} meta - TODO: add param description. * @returns {Logger} - TODO: add return description. * * @example * // Supports the existing API: * logger.log('info', 'Hello world', { custom: true }); * logger.log('info', new Error('Yo, it\'s on fire')); * * // Requires winston.format.splat() * logger.log('info', '%s %d%%', 'A string', 50, { thisIsMeta: true }); * * // And the new API with a single JSON literal: * logger.log({ level: 'info', message: 'Hello world', custom: true }); * logger.log({ level: 'info', message: new Error('Yo, it\'s on fire') }); * * // Also requires winston.format.splat() * logger.log({ * level: 'info', * message: '%s %d%%', * [SPLAT]: ['A string', 50], * meta: { thisIsMeta: true } * }); * */ /* eslint-enable valid-jsdoc */ }, { key: "log", value: function(I, N) { for (var L = arguments.length, C = new Array(L > 2 ? L - 2 : 0), Q = 2; Q < L; Q++) C[Q - 2] = arguments[Q]; if (arguments.length === 1) return I[S] = I.level, this._addDefaultMeta(I), this.write(I), this; if (arguments.length === 2) return N && e(N) === "object" ? (N[S] = N.level = I, this._addDefaultMeta(N), this.write(N), this) : (N = t(t(t({}, S, I), "level", I), "message", N), this._addDefaultMeta(N), this.write(N), this); var k = C[0]; if (e(k) === "object" && k !== null) { var M = N && N.match && N.match(D); if (!M) { var O = Object.assign({}, this.defaultMeta, k, t(t(t(t({}, S, I), E, C), "level", I), "message", N)); return k.message && (O.message = "".concat(O.message, " ").concat(k.message)), k.stack && (O.stack = k.stack), k.cause && (O.cause = k.cause), this.write(O), this; } } return this.write(Object.assign({}, this.defaultMeta, t(t(t(t({}, S, I), E, C), "level", I), "message", N))), this; } /** * Pushes data so that it can be picked up by all of our pipe targets. * @param {mixed} info - TODO: add param description. * @param {mixed} enc - TODO: add param description. * @param {mixed} callback - Continues stream processing. * @returns {undefined} * @private */ }, { key: "_transform", value: function(I, N, L) { if (this.silent) return L(); I[S] || (I[S] = I.level), !this.levels[I[S]] && this.levels[I[S]] !== 0 && console.error("[winston] Unknown logger level: %s", I[S]), this._readableState.pipes || console.error("[winston] Attempt to write logs with no transports, which can increase memory usage: %j", I); try { this.push(this.format.transform(I, this.format.options)); } finally { this._writableState.sync = !1, L(); } } /** * Delays the 'finish' event until all transport pipe targets have * also emitted 'finish' or are already finished. * @param {mixed} callback - Continues stream processing. */ }, { key: "_final", value: function(I) { var N = this.transports.slice(); g(N, function(L, C) { if (!L || L.finished) return setImmediate(C); L.once("finish", C), L.end(); }, I); } /** * Adds the transport to this logger instance by piping to it. * @param {mixed} transport - TODO: add param description. * @returns {Logger} - TODO: add return description. */ }, { key: "add", value: function(I) { var N = !T(I) || I.log.length > 2 ? new Y({ transport: I }) : I; if (!N._writableState || !N._writableState.objectMode) throw new Error("Transports must WritableStreams in objectMode. Set { objectMode: true }."); return this._onEvent("error", N), this._onEvent("warn", N), this.pipe(N), I.handleExceptions && this.exceptions.handle(), I.handleRejections && this.rejections.handle(), this; } /** * Removes the transport from this logger instance by unpiping from it. * @param {mixed} transport - TODO: add param description. * @returns {Logger} - TODO: add return description. */ }, { key: "remove", value: function(I) { if (!I) return this; var N = I; return (!T(I) || I.log.length > 2) && (N = this.transports.filter(function(L) { return L.transport === I; })[0]), N && this.unpipe(N), this; } /** * Removes all transports from this logger instance. * @returns {Logger} - TODO: add return description. */ }, { key: "clear", value: function() { return this.unpipe(), this; } /** * Cleans up resources (streams, event listeners) for all transports * associated with this instance (if necessary). * @returns {Logger} - TODO: add return description. */ }, { key: "close", value: function() { return this.exceptions.unhandle(), this.rejections.unhandle(), this.clear(), this.emit("close"), this; } /** * Sets the `target` levels specified on this instance. * @param {Object} Target levels to use on this instance. */ }, { key: "setLevels", value: function() { J.deprecated("setLevels"); } /** * Queries the all transports for this instance with the specified `options`. * This will aggregate each transport's results into one object containing * a property per transport. * @param {Object} options - Query options for this instance. * @param {function} callback - Continuation to respond to when complete. */ }, { key: "query", value: function(I, N) { typeof I == "function" && (N = I, I = {}), I = I || {}; var L = {}, C = Object.assign({}, I.query || {}); function Q(M, O) { I.query && typeof M.formatQuery == "function" && (I.query = M.formatQuery(C)), M.query(I, function(A, F) { if (A) return O(A); typeof M.formatResults == "function" && (F = M.formatResults(F, I.format)), O(null, F); }); } function k(M, O) { Q(M, function(A, F) { O && (F = A || F, F && (L[M.name] = F), O()), O = null; }); } g(this.transports.filter(function(M) { return !!M.query; }), k, function() { return N(null, L); }); } /** * Returns a log stream for all transports. Options object is optional. * @param{Object} options={} - Stream options for this instance. * @returns {Stream} - TODO: add return description. */ }, { key: "stream", value: function() { var I = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, N = new y(), L = []; return N._streams = L, N.destroy = function() { for (var C = L.length; C--; ) L[C].destroy(); }, this.transports.filter(function(C) { return !!C.stream; }).forEach(function(C) { var Q = C.stream(I); Q && (L.push(Q), Q.on("log", function(k) { k.transport = k.transport || [], k.transport.push(C.name), N.emit("log", k); }), Q.on("error", function(k) { k.transport = k.transport || [], k.transport.push(C.name), N.emit("error", k); })); }), N; } /** * Returns an object corresponding to a specific timing. When done is called * the timer will finish and log the duration. e.g.: * @returns {Profile} - TODO: add return description. * @example * const timer = winston.startTimer() * setTimeout(() => { * timer.done({ * message: 'Logging message' * }); * }, 1000); */ }, { key: "startTimer", value: function() { return new H(this); } /** * Tracks the time inbetween subsequent calls to this method with the same * `id` parameter. The second call to this method will log the difference in * milliseconds along with the message. * @param {string} id Unique id of the profiler * @returns {Logger} - TODO: add return description. */ }, { key: "profile", value: function(I) { var N = Date.now(); if (this.profilers[I]) { var L = this.profilers[I]; delete this.profilers[I]; for (var C = arguments.length, Q = new Array(C > 1 ? C - 1 : 0), k = 1; k < C; k++) Q[k - 1] = arguments[k]; typeof Q[Q.length - 2] == "function" && (console.warn("Callback function no longer supported as of winston@3.0.0"), Q.pop()); var M = e(Q[Q.length - 1]) === "object" ? Q.pop() : {}; return M.level = M.level || "info", M.durationMs = N - L, M.message = M.message || I, this.write(M); } return this.profilers[I] = N, this; } /** * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. * @returns {undefined} * @deprecated */ }, { key: "handleExceptions", value: function() { var I; console.warn("Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()"), (I = this.exceptions).handle.apply(I, arguments); } /** * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. * @returns {undefined} * @deprecated */ }, { key: "unhandleExceptions", value: function() { var I; console.warn("Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()"), (I = this.exceptions).unhandle.apply(I, arguments); } /** * Throw a more meaningful deprecation notice * @throws {Error} - TODO: add throws description. */ }, { key: "cli", value: function() { throw new Error(["Logger.cli() was removed in winston@3.0.0", "Use a custom winston.formats.cli() instead.", "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md"].join(` `)); } /** * Bubbles the `event` that occured on the specified `transport` up * from this instance. * @param {string} event - The event that occured * @param {Object} transport - Transport on which the event occured * @private */ }, { key: "_onEvent", value: function(I, N) { function L(C) { I === "error" && !this.transports.includes(N) && this.add(N), this.emit(I, C, N); } N["__winston" + I] || (N["__winston" + I] = L.bind(this), N.on(I, N["__winston" + I])); } }, { key: "_addDefaultMeta", value: function(I) { this.defaultMeta && Object.assign(I, this.defaultMeta); } }]); })(x); function V(K, $) { var _ = K[$]; return !_ && _ !== 0 ? null : _; } return Object.defineProperty(X.prototype, "transports", { configurable: !1, enumerable: !0, get: function() { var $ = this._readableState.pipes; return Array.isArray($) ? $ : [$].filter(Boolean); } }), Lx = X, Lx; } var Qx, y8; function IM() { if (y8) return Qx; y8 = 1; function t(x) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(g) { return typeof g; } : function(g) { return g && typeof Symbol == "function" && g.constructor === Symbol && g !== Symbol.prototype ? "symbol" : typeof g; }, t(x); } function e(x, g, b) { return Object.defineProperty(x, "prototype", { writable: !1 }), x; } function n(x, g) { if (!(x instanceof g)) throw new TypeError("Cannot call a class as a function"); } function r(x, g, b) { return g = s(g), i(x, a() ? Reflect.construct(g, b || [], s(x).constructor) : g.apply(x, b)); } function i(x, g) { if (g && (t(g) == "object" || typeof g == "function")) return g; if (g !== void 0) throw new TypeError("Derived constructors may only return object or undefined"); return o(x); } function o(x) { if (x === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return x; } function a() { try { var x = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { })); } catch { } return (a = function() { return !!x; })(); } function s(x) { return s = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(g) { return g.__proto__ || Object.getPrototypeOf(g); }, s(x); } function c(x, g) { if (typeof g != "function" && g !== null) throw new TypeError("Super expression must either be null or a function"); x.prototype = Object.create(g && g.prototype, { constructor: { value: x, writable: !0, configurable: !0 } }), Object.defineProperty(x, "prototype", { writable: !1 }), g && u(x, g); } function u(x, g) { return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(b, S) { return b.__proto__ = S, b; }, u(x, g); } var d = dn(), p = d.LEVEL, f = yE(), m = vE(), h = k0()("winston:create-logger"); function y(x) { return "is" + x.charAt(0).toUpperCase() + x.slice(1) + "Enabled"; } return Qx = function() { var x = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; x.levels = x.levels || f.npm.levels; var g = /* @__PURE__ */ (function(S) { function E(T) { return n(this, E), r(this, E, [T]); } return c(E, S), e(E); })(m), b = new g(x); return Object.keys(x.levels).forEach(function(S) { if (h('Define prototype method for "%s"', S), S === "log") { console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.'); return; } g.prototype[S] = function() { for (var E = this || b, T = arguments.length, U = new Array(T), q = 0; q < T; q++) U[q] = arguments[q]; if (U.length === 1) { var Y = U[0], H = Y && Y.message && Y || { message: Y }; return H.level = H[p] = S, E._addDefaultMeta(H), E.write(H), this || b; } return U.length === 0 ? (E.log(S, ""), E) : E.log.apply(E, [S].concat(U)); }, g.prototype[y(S)] = function() { return (this || b).isLevelEnabled(S); }; }), b; }, Qx; } var jx, b8; function YJ() { if (b8) return jx; b8 = 1; function t(s) { "@babel/helpers - typeof"; return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(c) { return typeof c; } : function(c) { return c && typeof Symbol == "function" && c.constructor === Symbol && c !== Symbol.prototype ? "symbol" : typeof c; }, t(s); } function e(s, c) { if (!(s instanceof c)) throw new TypeError("Cannot call a class as a function"); } function n(s, c) { for (var u = 0; u < c.length; u++) { var d = c[u]; d.enumerable = d.enumerable || !1, d.configurable = !0, "value" in d && (d.writable = !0), Object.defineProperty(s, i(d.key), d); } } function r(s, c, u) { return c && n(s.prototype, c), Object.defineProperty(s, "prototype", { writable: !1 }), s; } function i(s) { var c = o(s, "string"); return t(c) == "symbol" ? c : c + ""; } function o(s, c) { if (t(s) != "object" || !s) return s; var u = s[Symbol.toPrimitive]; if (u !== void 0) { var d = u.call(s, c); if (t(d) != "object") return d; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); } var a = IM(); return jx = /* @__PURE__ */ (function() { function s() { var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; e(this, s), this.loggers = /* @__PURE__ */ new Map(), this.options = c; } return r(s, [{ key: "add", value: function(u, d) { var p = this; if (!this.loggers.has(u)) { d = Object.assign({}, d || this.options); var f = d.transports || this.options.transports; f ? d.transports = Array.isArray(f) ? f.slice() : [f] : d.transports = []; var m = a(d); m.on("close", function() { return p._delete(u); }), this.loggers.set(u, m); } return this.loggers.get(u); } /** * Retreives a `winston.Logger` instance for the specified `id`. If * an instance does not exist, one is created. * @param {!string} id - The id of the Logger to get. * @param {?Object} [options] - Options for the Logger instance. * @returns {Logger} - A configured Logger instance with a specified id. */ }, { key: "get", value: function(u, d) { return this.add(u, d); } /** * Check if the container has a logger with the id. * @param {?string} id - The id of the Logger instance to find. * @returns {boolean} - Boolean value indicating if this instance has a * logger with the specified `id`. */ }, { key: "has", value: function(u) { return !!this.loggers.has(u); } /** * Closes a `Logger` instance with the specified `id` if it exists. * If no `id` is supplied then all Loggers are closed. * @param {?string} id - The id of the Logger instance to close. * @returns {undefined} */ }, { key: "close", value: function(u) { var d = this; if (u) return this._removeLogger(u); this.loggers.forEach(function(p, f) { return d._removeLogger(f); }); } /** * Remove a logger based on the id. * @param {!string} id - The id of the logger to remove. * @returns {undefined} * @private */ }, { key: "_removeLogger", value: function(u) { if (this.loggers.has(u)) { var d = this.loggers.get(u); d.close(), this._delete(u); } } /** * Deletes a `Logger` instance with the specified `id`. * @param {!string} id - The id of the Logger instance to delete from * container. * @returns {undefined} * @private */ }, { key: "_delete", value: function(u) { this.loggers.delete(u); } }]); })(), jx; } var v8; function JJ() { return v8 || (v8 = 1, (function(t) { var e = cM(), n = uM(), r = n.warn; t.version = uJ.version, t.transports = LJ(), t.config = yE(), t.addColors = e.levels, t.format = e.format, t.createLogger = IM(), t.Logger = vE(), t.ExceptionHandler = EM(), t.RejectionHandler = AM(), t.Container = YJ(), t.Transport = rf(), t.loggers = new t.Container(); var i = t.createLogger(); Object.keys(t.config.npm.levels).concat(["log", "query", "stream", "add", "remove", "clear", "profile", "startTimer", "handleExceptions", "unhandleExceptions", "handleRejections", "unhandleRejections", "configure", "child"]).forEach(function(o) { return t[o] = function() { return i[o].apply(i, arguments); }; }), Object.defineProperty(t, "level", { get: function() { return i.level; }, set: function(a) { i.level = a; } }), Object.defineProperty(t, "exceptions", { get: function() { return i.exceptions; } }), Object.defineProperty(t, "rejections", { get: function() { return i.rejections; } }), ["exitOnError"].forEach(function(o) { Object.defineProperty(t, o, { get: function() { return i[o]; }, set: function(s) { i[o] = s; } }); }), Object.defineProperty(t, "default", { get: function() { return { exceptionHandlers: i.exceptionHandlers, rejectionHandlers: i.rejectionHandlers, transports: i.transports }; } }), r.deprecated(t, "setLevels"), r.forFunctions(t, "useFormat", ["cli"]), r.forProperties(t, "useFormat", ["padLevels", "stripColors"]), r.forFunctions(t, "deprecated", ["addRewriter", "addFilter", "clone", "extend"]), r.forProperties(t, "deprecated", ["emitErrs", "levelLength"]); })(bv)), bv; } var ui = JJ(); const XJ = /* @__PURE__ */ ra(ui); var pu = /* @__PURE__ */ ((t) => (t.DEBUG = "debug", t.INFO = "info", t.WARN = "warn", t.ERROR = "error", t.FATAL = "fatal", t))(pu || {}); function ZJ() { const t = /* @__PURE__ */ new Date(), e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0"), i = t.getHours().toString().padStart(2, "0"), o = t.getMinutes().toString().padStart(2, "0"), a = t.getSeconds().toString().padStart(2, "0"), s = t.getMilliseconds().toString().padStart(3, "0"); return `${e}-${n}-${r}_${i}-${o}-${a}.${s}`; } const $x = new RD(); class ic { static MAX_HISTORY = 100; static history = []; subscribe(e) { for (const n of ic.history) try { e(n); } catch { } $x.on("log", e); } unsubscribe(e) { $x.off("log", e); } notify(e) { $x.emit("log", e), ic.history.length >= ic.MAX_HISTORY && ic.history.shift(), ic.history.push(e); } } const CM = new ic(); class TM { fileLogEnabled = !1; consoleLogEnabled = !0; logger; logPath; fileTransportAdded = !1; fileLogLevel = "debug"; constructor(e) { const n = `${ZJ()}.log`; this.logPath = xe.join(e, n), this.logger = XJ.createLogger({ level: "debug", format: ui.format.combine( ui.format.timestamp({ format: "MM-DD HH:mm:ss" }), ui.format.printf(({ timestamp: r, level: i, message: o, ...a }) => { const s = a.userInfo ? `${a.userInfo} | ` : ""; return `${r} [${i}] ${s}${o}`; }) ), transports: [ new ui.transports.Console({ format: ui.format.combine( ui.format.colorize(), ui.format.printf(({ timestamp: r, level: i, message: o, ...a }) => { const s = a.userInfo ? `${a.userInfo} | ` : ""; return `${r} [${i}] ${s}${o}`; }) ) }) ] }), this.setLogSelfInfo({ nick: "", uid: "" }), this.cleanOldLogs(e); } cleanOldLogs(e) { const n = Date.now() - 6048e5; Wn.readdir(e).then((r) => { r.forEach((i) => { const o = xe.join(e, i); this.deleteOldLogFile(o, n); }); }).catch((r) => { this.logError("Failed to read log directory", r); }); } deleteOldLogFile(e, n) { Wn.stat(e).then((r) => { r.mtime.getTime() < n && Wn.unlink(e).catch((i) => { i ? i.code === "ENOENT" ? this.logWarn(`File already deleted: ${e}`) : this.logError("Failed to delete old log file", i) : this.log(`Deleted old log file: ${e}`); }); }).catch((r) => { this.logError("Failed to get file stats", r); }); } setFileAndConsoleLogLevel(e, n) { this.fileLogLevel = e, this.logger.transports.forEach((r) => { r instanceof ui.transports.File ? r.level = e : r instanceof ui.transports.Console && (r.level = n); }); } setLogSelfInfo(e) { const n = `${e.nick}`; this.logger.defaultMeta = { userInfo: n }; } setFileLogEnabled(e) { this.fileLogEnabled = e, e && !this.fileTransportAdded && (this.fileTransportAdded = !0, this.logger.add(new ui.transports.File({ filename: this.logPath, level: this.fileLogLevel, maxsize: 5 * 1024 * 1024, // 5MB maxFiles: 5 }))), this.logger.transports.forEach((n) => { n instanceof ui.transports.File && (n.silent = !e); }); } setConsoleLogEnabled(e) { this.consoleLogEnabled = e, this.logger.transports.forEach((n) => { n instanceof ui.transports.Console && (n.silent = !e); }); } formatMsg(e) { return e.map((n) => n instanceof Error ? n.stack : typeof n == "object" ? JSON.stringify(GO(JSON.parse(JSON.stringify(n, null, 2)))) : n).join(" "); } _log(e, ...n) { if (this.consoleLogEnabled || this.fileLogEnabled) { const r = this.formatMsg(n).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]|\x1B\[[0-?]*[ -/]*[@-~]|\x1B/g, ""); this.consoleLogEnabled && this.fileLogEnabled ? this.logger.log(e, r) : this.consoleLogEnabled ? this.logger.log(e, r) : this.fileLogEnabled && this.logger.log(e, r), CM.notify(JSON.stringify({ level: e, message: r })); } } log(...e) { this._log("info", ...e); } logDebug(...e) { this._log("debug", ...e); } logError(...e) { this._log("error", ...e); } logWarn(...e) { this._log("warn", ...e); } logFatal(...e) { this._log("fatal", ...e); } logMessage(e, n) { const r = e.senderUin === n.uin; e.elements[0]?.elementType !== Ee.GreyTip && this.log(`${r ? "发送 ->" : "接收 <-"} ${kM(e)}`); } } function kM(t, e = 0) { if (e > 2) return "..."; const n = []; t.chatType === ke.KCHATTYPEC2C ? n.push(`私聊 (${t.peerUin})`) : t.chatType === ke.KCHATTYPEGROUP ? (e < 1 && n.push(`群聊 [${t.peerName}(${t.peerUin})]`), t.senderUin !== "0" && n.push(`[${t.sendMemberName || t.sendRemarkName || t.sendNickName}(${t.senderUin})]`)) : t.chatType === ke.KCHATTYPEDATALINE ? n.push("移动设备") : n.push(`临时消息 (${t.peerUin})`); for (const r of t.elements) n.push(eX(r, t, e)); return n.join(" "); } function eX(t, e, n) { if (t.textElement) return tX(t.textElement); if (t.replyElement) return nX(t.replyElement, e, n); if (t.picElement) return "[图片]"; if (t.fileElement) { if (t.fileElement.fileUuid) return `[文件 ${t.fileElement.fileName}]`; if (t.elementType === Ee.TOFURECORD) return `[在线文件 ${t.fileElement.fileName}]`; if (t.elementType === Ee.ONLINEFOLDER) return `[在线文件夹 ${t.fileElement.fileName}/]`; } return t.videoElement ? "[视频]" : t.pttElement ? `[语音 ${t.pttElement.duration}s]` : t.arkElement ? "[卡片消息]" : t.faceElement ? `[表情 ${t.faceElement.faceText ?? ""}]` : t.marketFaceElement ? t.marketFaceElement.faceName : t.markdownElement ? t.markdownElement?.mdSummary ? t.markdownElement.mdSummary : "[Markdown 消息]" : t.multiForwardMsgElement ? "[转发消息]" : t.elementType === Ee.GreyTip ? "[灰条消息]" : t.elementType === Ee.FILE ? "[文件发送中]" : `[未实现 (ElementType = ${t.elementType})]`; } function tX(t) { if (t.atType === Hr.ATTYPEUNKNOWN) { const e = t.content.split(` `); return `${e[0]}${e.length > 1 ? " ..." : ""}`; } else { if (t.atType === Hr.ATTYPEALL) return "@全体成员"; if (t.atType === Hr.ATTYPEONE) return `${t.content} (${t.atUid})`; } return ""; } function nX(t, e, n) { const r = e.records.find((i) => t.sourceMsgIdInRecords === i.msgId); return `[回复消息 ${r && r.peerUin !== "284840486" && r.peerUin !== "1094950020" ? kM(r, n + 1) : `未找到消息记录 (MsgId = ${t.sourceMsgIdInRecords})`}]`; } class rX { napLogger; constructor(e) { this.napLogger = e.logger; } _log(e, ...n) { this.napLogger._log(e, "[Core] [Packet] " + n); } debug(...e) { this._log(pu.DEBUG, e); } info(...e) { this._log(pu.INFO, e); } warn(...e) { this._log(pu.WARN, e); } error(...e) { this._log(pu.ERROR, e); } fatal(...e) { this._log(pu.FATAL, e); } } class iX { core; constructor(e) { this.core = e; } get logger() { return this.core.context.logger; } get basicInfo() { return { requireMinNTQQBuild: (e) => this.core.context.basicInfoWrapper.requireMinNTQQBuild(e), uin: +this.core.selfInfo.uin, uid: this.core.selfInfo.uid, uin2uid: (e) => this.core.apis.UserApi.getUidByUinV2(String(e)).then((n) => n ?? ""), uid2uin: (e) => this.core.apis.UserApi.getUinByUidV2(e).then((n) => +n) }; } get config() { return this.core.configLoader.configData; } get napi2nativeLoader() { return this.core.context.napi2nativeLoader; } sendSsoCmdReqByContend = (e, n) => this.core.context.session.getMsgService().sendSsoCmdReqByContend(e, n); } class oX { napcore; logger; cb = /* @__PURE__ */ new Map(); // hash-type callback napi2nativeLoader; logStack; available = !1; constructor(e, n, r, i) { this.napcore = e, this.logger = n, this.logStack = r, this.napi2nativeLoader = i; } check() { return this.napi2nativeLoader.loaded ? !0 : (this.logStack.pushLogWarn("NativePacketClient: Napi2NativeLoader 未成功加载"), !1); } async init(e, n, r) { if (!this.napcore.basicInfo.requireMinNTQQBuild("40824")) { this.logStack.pushLogWarn("[PacketClient] 当前 QQ 版本低于 NativePacketClient 要求,跳过 Hook 初始化"); return; } if (this.napi2nativeLoader.initHook(r, n)) { this.available = !0, this.logStack.pushLogInfo(`[PacketClient] NativePacketClient Hook 初始化成功 platform=${process.platform}.${process.arch}`); return; } this.logStack.pushLogError(`[PacketClient] NativePacketClient Hook 初始化失败 platform=${process.platform}.${process.arch} send=${r} recv=${n}`); } async sendPacket(e, n, r = !1, i = 5e3) { if (!r) return this.napcore.sendSsoCmdReqByContend(e, n).catch( (s) => this.logger.error( `[PacketClient] sendPacket 无响应命令发送失败 cmd=${e} err=${s}` ) ), { seq: 0, cmd: e, data: Buffer.alloc(0) }; const o = this.napcore.sendSsoCmdReqByContend(e, n).then((s) => ({ seq: 0, cmd: e, data: s.rspbuffer })), a = new Promise((s, c) => { setTimeout( () => c( new Error( `[PacketClient] sendPacket 超时 cmd=${e} timeout=${i}ms` ) ), i ); }); return Promise.race([o, a]); } async sendOidbPacket(e, n = !1, r = 5e3) { return await this.sendPacket(e.cmd, e.data, n, r); } } class aX { stack = []; logger; constructor(e) { this.logger = e; } push(e) { this.stack.push(e); } pushLogInfo(e) { this.logger.info(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [INFO] ${e}`); } pushLogWarn(e) { this.logger.warn(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [WARN] ${e}`); } pushLogError(e) { this.logger.error(e), this.stack.push(`${(/* @__PURE__ */ new Date()).toISOString()} [ERROR] ${e}`); } clear() { this.stack = []; } content() { return this.stack.join(` `); } } class sX { napCore; logger; logStack; napi2nativeLoader; _client; constructor(e, n, r) { this.napCore = e, this.logger = n, this.logStack = new aX(n), this.napi2nativeLoader = r, this._client = this.newClient(); } get available() { return this._client.available; } get clientLogStack() { return this._client.logStack.content(); } async init(e, n, r) { await this._client.init(e, n, r); } async sendOidbPacket(e, n, r) { return (await this._client.sendOidbPacket(e, n, r)).data; } newClient() { this.logger.info("使用 NativePacketClient 作为后端"); const e = new oX(this.napCore, this.logger, this.logStack, this.napi2nativeLoader); if (!e.check()) throw new Error("[Core] [Packet] NativePacketClient 不可用,NapCat.Packet将不会加载!"); return e; } } const cX = [ Ee.TEXT, Ee.PIC, Ee.REPLY, Ee.FACE, Ee.MFACE, Ee.VIDEO, Ee.FILE, Ee.PTT, Ee.ARK, Ee.MARKDOWN, Ee.MULTIFORWARD ]; class NM { isValidElementType(e) { return cX.includes(e); } rawToPacketMsgConverters = { [Ee.TEXT]: (e) => e.textElement?.atType ? new f4(e) : new ng(e), [Ee.PIC]: (e) => new kS(e), [Ee.REPLY]: (e) => new TS(e), [Ee.FACE]: (e) => new AW(e), [Ee.MFACE]: (e) => new IW(e), [Ee.VIDEO]: (e) => new NS(e), [Ee.FILE]: (e) => new wF(e), [Ee.PTT]: (e) => new xF(e), [Ee.ARK]: (e) => new CW(e), [Ee.MARKDOWN]: (e) => new TW(e), [Ee.MULTIFORWARD]: (e) => new kW(e) }; rawMsgWithSendMsgToPacketMsg(e) { return { senderUid: e.senderUid ?? "", senderUin: e.senderUin, senderName: e.senderName, groupId: e.groupId, time: e.time, msg: e.msg.map((n) => this.isValidElementType(n.elementType) ? this.rawToPacketMsgConverters[n.elementType](n) : null).filter((n) => n !== null) }; } rawMsgToPacketMsg(e, n) { return { seq: +e.msgSeq, groupId: n.chatType === ke.KCHATTYPEGROUP ? +e.peerUid : void 0, senderUid: e.senderUid, senderUin: +e.senderUin, senderName: e.sendMemberName && e.sendMemberName !== "" ? e.sendMemberName : e.sendNickName && e.sendNickName !== "" ? e.sendNickName : "QQ用户", time: +e.msgTime, msg: e.elements.map((r) => this.isValidElementType(r.elementType) ? this.rawToPacketMsgConverters[r.elementType](r) : null).filter((r) => r !== null) }; } packetMsgToRaw(e) { const n = [ ng.parseElement, f4.parseElement, TS.parseElement, NS.parseElement, kS.parseElement ]; return e.map((r) => { for (const i of n) { const o = i(r); if (o) return o; } return null; }).filter((r) => r !== null); } } function uX(t, e) { const n = t.filter((r) => r.status === "rejected"); if (n.length !== 0) throw e.warn(`上传资源${t.length}个,失败${n.length}个`), t.forEach((r, i) => { if (r.status === "rejected") { const o = r.reason instanceof Error ? r.reason.stack ?? r.reason.message : String(r.reason); e.error(`上传第${i + 1}个资源失败:${o}`); } }), new AggregateError( n.map((r) => r.reason), `上传转发消息资源失败:${n.length}/${t.length}` ); } class lX { context; constructor(e) { this.context = e; } async sendPacket(e, n) { return await this.context.client.sendOidbPacket(e, n); } async SendPoke(e, n, r) { const i = qW.build(e, n, r ?? n); await this.context.client.sendOidbPacket(i); } async SetGroupTodo(e, n) { const r = tK.build(e, n); await this.context.client.sendOidbPacket(r, !0); } async CompleteGroupTodo(e, n) { const r = JW.build(e, n); await this.context.client.sendOidbPacket(r, !0); } async CancelGroupTodo(e, n) { const r = ZW.build(e, n); await this.context.client.sendOidbPacket(r, !0); } async FetchRkey(e = 1e4) { const n = U4.build(), r = await this.context.client.sendOidbPacket(n, !0, e); return U4.parse(r).data.rkeyList; } async GroupSign(e) { const n = jW.build(this.context.napcore.basicInfo.uin, e); await this.context.client.sendOidbPacket(n); } async GetStrangerStatus(e) { let n = 0; try { const r = x4.build(e), i = await this.context.client.sendOidbPacket(r, !0), o = x4.parse(i), a = BigInt(o.data.status.value); return a <= 10n ? { status: Number(a) * 10, ext_status: 0 } : (n = Number((a & 0xff00n) + (a >> 16n & 0xffn)), { status: 10, ext_status: n }); } catch { return; } } async SetGroupSpecialTitle(e, n, r) { const i = HW.build(e, n, r); await this.context.client.sendOidbPacket(i); } async UploadResources(e, n = 0) { const r = n ? ke.KCHATTYPEGROUP : ke.KCHATTYPEC2C, i = n ? String(n) : this.context.napcore.basicInfo.uid, o = e.flatMap( (s) => s.msg.map((c) => c instanceof kS ? this.context.highway.uploadImage({ chatType: r, peerUid: i }, c) : c instanceof NS ? this.context.highway.uploadVideo({ chatType: r, peerUid: i }, c) : c instanceof xF ? this.context.highway.uploadPtt({ chatType: r, peerUid: i }, c) : c instanceof wF ? this.context.highway.uploadFile({ chatType: r, peerUid: i }, c) : null).filter(Boolean) ), a = await Promise.allSettled(o); uX(a, this.context.logger); } async UploadImage(e) { await this.context.highway.uploadImage( { chatType: ke.KCHATTYPEC2C, peerUid: this.context.napcore.basicInfo.uid }, e ); const n = e.msgInfo?.msgInfoBody?.at(0)?.index; if (!n) throw new Error("img.msgInfo?.msgInfoBody![0].index! is undefined"); return await this.GetImageUrl(this.context.napcore.basicInfo.uid, n); } async GetImageUrl(e, n) { const r = rd.build(e, n), i = await this.context.client.sendOidbPacket(r, !0), o = rd.parse(i); return `https://${o.download.info.domain}${o.download.info.urlPath}${o.download.rKeyParam}`; } async GetPttUrl(e, n, r) { const i = M4.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = M4.parse(o); return `https://${a.download.info.domain}${a.download.info.urlPath}${a.download.rKeyParam}`; } async GetVideoUrl(e, n, r) { const i = F4.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = F4.parse(o); return `https://${a.download.info.domain}${a.download.info.urlPath}${a.download.rKeyParam}`; } async GetGroupImageUrl(e, n, r) { const i = gK.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = rd.parse(o); return `https://${a.download.info.domain}${a.download.info.urlPath}${a.download.rKeyParam}`; } async GetGroupPttUrl(e, n, r) { const i = iK.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = rd.parse(o); return `https://${a.download.info.domain}${a.download.info.urlPath}${a.download.rKeyParam}`; } async GetGroupVideoUrl(e, n, r = 2e4) { const i = vK.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = rd.parse(o); return `https://${a.download.info.domain}${a.download.info.urlPath}${a.download.rKeyParam}`; } async ImageOCR(e) { const n = w4.build(e), r = await this.context.client.sendOidbPacket(n, !0), i = w4.parse(r); return { texts: i.ocrRspBody.textDetections.map((o) => ({ text: o.detectedText, confidence: o.confidence, coordinates: o.polygon.coordinates.map((a) => ({ x: a.x, y: a.y })) })), language: i.ocrRspBody.language }; } async SendPreprocess(e, n = 0) { const r = e.map((i) => i.msg.map(async (o) => { if (o instanceof TS && !o.targetElems) { this.context.logger.debug("Cannot find reply element's targetElems, prepare to fetch it..."), o.targetPeer?.peerUid || this.context.logger.error("targetPeer is undefined!"); let a; o.isGroupReply ? a = await this.FetchGroupMessage(+(o.targetPeer?.peerUid ?? 0), o.targetMessageSeq, o.targetMessageSeq) : a = await this.FetchC2CMessage(await this.context.napcore.basicInfo.uin2uid(o.targetUin), o.targetMessageSeq, o.targetMessageSeq), o.targetElems = a.at(0)?.body?.richText?.elems, o.targetSourceMsg = a.at(0); } })).flat(); await Promise.all(r), await this.UploadResources(e, n); } async FetchGroupMessage(e, n, r) { const i = R4.build(e, n, r), o = await this.context.client.sendOidbPacket(i, !0); return R4.parse(o).body.messages; } async FetchC2CMessage(e, n, r) { const i = B4.build(e, n, r), o = await this.context.client.sendOidbPacket(i, !0); return B4.parse(o).messages; } async UploadForwardMsg(e, n = 0) { await this.SendPreprocess(e, n); const r = _y.build(this.context.napcore.basicInfo.uid, e, n), i = await this.context.client.sendOidbPacket(r, !0); return _y.parse(i).result.resId; } async UploadForwardMsgV2(e, n = 0) { await Promise.all(e.filter((a) => a.actionMsg).map(async (a) => { await this.SendPreprocess(a.actionMsg, n); })); const r = IK.build(this.context.napcore.basicInfo.uid, e, n), i = await this.context.client.sendOidbPacket(r, !0); return _y.parse(i).result.resId; } async MoveGroupFile(e, n, r, i) { const o = S4.build(e, n, r, i), a = await this.context.client.sendOidbPacket(o, !0); return S4.parse(a).move.retCode; } async RenameGroupFile(e, n, r, i) { const o = _4.build(e, n, r, i), a = await this.context.client.sendOidbPacket(o, !0); return _4.parse(a).rename.retCode; } async GetGroupFileUrl(e, n, r) { const i = E4.build(e, n), o = await this.context.client.sendOidbPacket(i, !0, r), a = E4.parse(o); return `https://${a.download.downloadDns}/ftn_handler/${Buffer.from(a.download.downloadUrl).toString("hex")}/?fname=`; } async GetPrivateFileUrl(e, n, r, i) { const o = I4.build(e, n, r), a = await this.context.client.sendOidbPacket(o, !0, i), s = I4.parse(a); return `http://${s.body?.result?.server}:${s.body?.result?.port}${s.body?.result?.url?.slice(8)}&isthumb=0`; } async GetMiniAppAdaptShareInfo(e) { const n = v4.build(e), r = await this.context.client.sendOidbPacket(n, !0), i = v4.parse(r); return JSON.parse(i.content.jsonContent); } async FetchAiVoiceList(e, n) { const r = y4.build(e, n), i = await this.context.client.sendOidbPacket(r, !0), o = y4.parse(i); return o.content ? o.content.map((a) => ({ category: a.category, voices: a.voices })) : null; } async GetAiVoice(e, n, r, i) { let o = 0; const a = 30, s = o0.randomBytes(4).readUInt32BE(0); for (; ; ) { if (o >= a) throw new Error(`sendAiVoiceChatReq failed after ${a} times`); o++; const c = b4.build(e, n, r, s, i), u = await this.context.client.sendOidbPacket(c, !0), d = b4.parse(u); if (d.msgInfo) return d.msgInfo; } } async FetchForwardMsgRaw(e) { const n = ch.build(this.context.napcore.basicInfo.uid, e), r = await this.context.client.sendOidbPacket(n, !0), i = ch.parse(r), o = U3(i.result.payload); return new he(tg).decode(o).action; } async FetchForwardMsg(e) { const n = ch.build(this.context.napcore.basicInfo.uid, e), r = await this.context.client.sendOidbPacket(n, !0), i = ch.parse(r), o = U3(i.result.payload), s = new he(tg).decode(o).action.find((u) => u.actionCommand === "MultiMsg"); if (!s?.actionData.msgBody) throw new Error("msgBody is empty"); this.context.logger.debug("rawChains ", o.toString("hex")); const c = s.actionData.msgBody.map(async (u) => { if (!u?.body?.richText?.elems) throw new Error("msg.body.richText.elems is empty"); const d = new NM().packetMsgToRaw(u?.body?.richText?.elems), p = await Promise.all( d.map(async ([x, g]) => { if (x.picElement && g?.commonElem?.pbElem) { const S = new he(Zo).decode(g.commonElem.pbElem)?.msgInfoBody[0]?.index; if (u?.responseHead.grp !== void 0) { const E = u?.responseHead.grp?.groupUin ?? 0; x.picElement = { ...x.picElement, originImageUrl: await this.GetGroupImageUrl(E, S) }; } else x.picElement = { ...x.picElement, originImageUrl: await this.GetImageUrl(this.context.napcore.basicInfo.uid, S) }; return x; } if (x.videoElement && g?.commonElem?.pbElem) { const S = new he(Zo).decode(g.commonElem.pbElem)?.msgInfoBody[0]?.index; return S && (u?.responseHead.grp !== void 0 ? x.videoElement = { ...x.videoElement, filePath: await this.GetGroupVideoUrl(u.responseHead.grp.groupUin ?? 0, S) } : x.videoElement = { ...x.videoElement, filePath: await this.GetVideoUrl(this.context.napcore.basicInfo.uid, S) }), x; } return x; }) ), f = u?.responseHead.grp !== void 0, m = String(f ? u?.responseHead.grp?.groupUin ?? 0 : u?.responseHead.fromUin ?? 0), h = String(f ? u?.responseHead.grp?.groupUin ?? 0 : u?.responseHead.fromUid ?? ""), y = f ? u?.responseHead.grp?.memberName ?? "" : u?.responseHead.forward?.friendName ?? ""; return { chatType: f ? ke.KCHATTYPEGROUP : ke.KCHATTYPEC2C, elements: p, guildId: "", isOnlineMsg: !1, msgId: "7467703692092974645", // TODO: no necessary msgRandom: "0", msgSeq: String(u.contentHead.sequence ?? 0), msgTime: String(u.contentHead.timeStamp ?? 0), msgType: us.KMSGTYPEMIX, parentMsgIdList: [], parentMsgPeer: { chatType: f ? ke.KCHATTYPEGROUP : ke.KCHATTYPEC2C, peerUid: h }, peerName: "", peerUid: h, peerUin: m, recallTime: "0", records: [], sendNickName: y, sendRemarkName: y, senderUid: u?.responseHead.fromUid ?? "", senderUin: String(u?.responseHead.fromUin ?? 0), sourceType: G2.K_DOWN_SOURCETYPE_UNKNOWN, subMsgType: 1 }; }); return await Promise.all(c); } } class dX { msgConverter; napcore; logger; client; highway; operation; constructor(e) { this.msgConverter = new NM(), this.napcore = new iX(e), this.logger = new rX(this.napcore), this.client = new sX(this.napcore, this.logger, this.napcore.napi2nativeLoader), this.highway = new SY(this.napcore, this.logger, this.client), this.operation = new lX(this); } } class pX { context; constructor(e) { this.context = new dX(e); } init(e, n, r) { return this.context.client.init(e, n, r); } get clientLogStack() { return this.context.client.clientLogStack; } get available() { return this.context.client.available; } get operation() { return this.context.operation; } // TODO: global message element adapter (? get msgConverter() { return this.context.msgConverter; } } const fX = rq; class hX { context; core; logger; qqVersion; pkt; errStack = []; packetStatus = !1; constructor(e, n) { this.context = e, this.core = n, this.logger = n.context.logger; } async initApi() { this.packetStatus = await this.InitSendPacket(this.context.basicInfoWrapper.getFullQQVersion()).then((e) => e).catch((e) => (this.logger.logError(e), this.pushError(e), !1)) && this.pkt?.available; } get available() { return this.pkt?.available ?? !1; } get clientLogStack() { return [this.pkt?.clientLogStack, ...this.errStack].filter(Boolean).join(` `); } pushError(e) { if (e instanceof Error) { this.errStack.push(e.stack || e.message); return; } this.errStack.push(String(e)); } async InitSendPacket(e) { this.qqVersion = e; const n = fX[e + "-" + gs.arch()]; if (!n) { const r = `[Core] [Packet] PacketBackend 不支持当前QQ版本架构:${e}-${gs.arch()}, 请参照 https://github.com/NapNeko/SnowCatQQ/releases/tag/v${gl} 配置正确的QQ版本!`; return this.logger.logError(r), this.errStack.push(r), !1; } if (this.core.configLoader.configData.packetBackend === "disable") { const r = "[Core] [Packet] 已禁用PacketBackend,NapCat.Packet将不会加载!"; return this.logger.logError(r), this.errStack.push(r), !1; } if (this.pkt = new pX(this.core), await this.pkt.init(process.pid, n.recv, n.send), !this.pkt.available) { const r = "[Core] [Packet] NativePacketClient 初始化失败,PacketBackend 发包能力不可用!"; return this.logger.logError(r), this.errStack.push(r), !1; } try { await this.pkt.operation.FetchRkey(3e3); } catch (r) { return this.logger.logError("测试Packet状态异常", r), this.pushError(r), !1; } return !0; } } var rc = /* @__PURE__ */ ((t) => (t[t.OK = 0] = "OK", t[t.ERROR = -1] = "ERROR", t))(rc || {}); const Kh = (t) => cS.normalize(t).toLowerCase(); class mX { context; core; constructor(e, n) { this.context = e, this.core = n; } /** * 这里不等待node返回,因为the fuck wrapper.node 根本不返回(会卡死不知道为什么)!!! 只能手动查询判断死活 * @param peer * @param filePath * @param fileName */ async sendOnlineFile(e, n, r) { if (!Yf.existsSync(n)) throw new Error(`[SnowCat] 文件不存在: ${n}`); const i = r || cS.basename(n), o = Yf.statSync(n).size.toString(), a = [{ elementType: 23, elementId: "", fileElement: { fileName: i, filePath: n, fileSize: o } }], s = this.context.session.getMsgService(), c = Math.floor(Date.now() / 1e3) - 2; s.sendMsg("0", e, a, /* @__PURE__ */ new Map()).catch((p) => { }); const u = 10; let d = 0; for (; d < u; ) { await bp(1e3), d++; try { const m = ((await s.getOnlineFileMsgs(e))?.msgList || []).find((h) => parseInt(h.msgTime) < c ? !1 : !!h.elements.find((x) => { if (x.elementType !== 23 || !x.fileElement) return !1; const g = x.fileElement.fileName === i, b = Kh(x.fileElement.filePath) === Kh(n); return g && b; })); if (m) { const h = m.elements.find((y) => y.elementType === 23); return this.context.logger.log("[OnlineFile] 在线文件发送成功!"), { result: rc.OK, errMsg: "", msgId: m.msgId, elementId: h?.elementId || "" }; } } catch { } } return this.context.logger.logError("[OnlineFile] 在线文件发送失败!!!"), { result: rc.ERROR, errMsg: "[SnowCat] Send Online File Timeout: Message not found in history." }; } /** * 发送在线文件夹 * @param peer * @param folderPath * @param folderName */ async sendOnlineFolder(e, n, r) { const i = r || cS.basename(n); if (!Yf.existsSync(n)) return { result: rc.ERROR, errMsg: `Folder not found: ${n}` }; if (!Yf.statSync(n).isDirectory()) return { result: rc.ERROR, errMsg: `Path is not a directory: ${n}` }; const o = { elementType: 30, elementId: "", fileElement: { fileName: i, filePath: n, fileSize: "" } }, a = this.context.session.getMsgService(), s = Math.floor(Date.now() / 1e3) - 2; a.sendMsg("0", e, [o], /* @__PURE__ */ new Map()).catch((d) => { }); const c = 10; let u = 0; for (; u < c; ) { await bp(1e3), u++; try { const f = ((await a.getOnlineFileMsgs(e))?.msgList || []).find((m) => parseInt(m.msgTime) < s ? !1 : !!m.elements.find((y) => { if (y.elementType !== 30 || !y.fileElement) return !1; const x = y.fileElement.fileName === i, g = Kh(y.fileElement.filePath) === Kh(n); return x && g; })); if (f) { const m = f.elements.find((h) => h.elementType === 30); return this.context.logger.log("[OnlineFile] 在线文件夹发送成功!"), { result: rc.OK, errMsg: "", msgId: f.msgId, elementId: m?.elementId || "" }; } } catch { } } return this.context.logger.logError("[OnlineFile] 在线文件发送失败!!!"), { result: rc.ERROR, errMsg: "[SnowCat] Send Online Folder Timeout: Message not found in history." }; } /** * 获取好友的在线文件消息 * @param peer */ async getOnlineFileMsg(e) { return await this.context.session.getMsgService().getOnlineFileMsgs(e); } /** * 取消在线文件的发送 * @param peer * @param msgId */ async cancelMyOnlineFileMsg(e, n) { await this.context.session.getMsgService().cancelSendMsg(e, n); } /** * 拒绝接收在线文件 * @param peer * @param msgId * @param elementId */ async refuseOnlineFileMsg(e, n, r) { const i = this.context.session.getMsgService(), o = { msgId: n, peerUid: e.peerUid, chatType: 1, elementId: r, downloadType: 1, downSourceType: 1 }; await i.refuseGetRichMediaElement(o); } /** * 接收在线文件/文件夹 * @param peer * @param msgId * @param elementId * @constructor */ async receiveOnlineFileOrFolder(e, n, r) { const i = this.context.session.getMsgService(), o = { msgId: n, peerUid: e.peerUid, chatType: 1, elementId: r, downSourceType: 1, downloadType: 1 }; return await i.getRichMediaElement(o); } /** * 在线文件/文件夹转离线 * @param peer * @param msgId */ async switchFileToOffline(e, n) { await this.context.session.getMsgService().switchToOfflineSendMsg(e, n); } } var PM = /* @__PURE__ */ ((t) => (t[t.KUPLOADSCENEUNKNOWN = 0] = "KUPLOADSCENEUNKNOWN", t[t.KUPLOADSCENEFLOATWINDOWRIGHTCLICKMENU = 1] = "KUPLOADSCENEFLOATWINDOWRIGHTCLICKMENU", t[t.KUPLOADSCENEFLOATWINDOWDRAG = 2] = "KUPLOADSCENEFLOATWINDOWDRAG", t[t.KUPLOADSCENEFLOATWINDOWFILESELECTOR = 3] = "KUPLOADSCENEFLOATWINDOWFILESELECTOR", t[t.KUPLOADSCENEFLOATWINDOWSHORTCUTKEYCTRLCV = 4] = "KUPLOADSCENEFLOATWINDOWSHORTCUTKEYCTRLCV", t[t.KUPLOADSCENEH5LAUNCHCLIENTRIGHTCLICKMENU = 5] = "KUPLOADSCENEH5LAUNCHCLIENTRIGHTCLICKMENU", t[t.KUPLOADSCENEH5LAUNCHCLIENTDRAG = 6] = "KUPLOADSCENEH5LAUNCHCLIENTDRAG", t[t.KUPLOADSCENEH5LAUNCHCLIENTFILESELECTOR = 7] = "KUPLOADSCENEH5LAUNCHCLIENTFILESELECTOR", t[t.KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV = 8] = "KUPLOADSCENEH5LAUNCHCLIENTSHORTCUTKEYCTRLCV", t[t.KUPLOADSCENEAIODRAG = 9] = "KUPLOADSCENEAIODRAG", t[t.KUPLOADSCENEAIOFILESELECTOR = 10] = "KUPLOADSCENEAIOFILESELECTOR", t[t.KUPLOADSCENEAIOSHORTCUTKEYCTRLCV = 11] = "KUPLOADSCENEAIOSHORTCUTKEYCTRLCV", t))(PM || {}); class gX { context; core; constructor(e, n) { this.context = e, this.core = n; } /** * 发起闪传上传任务 * @param fileListToUpload 上传文件绝对路径的列表,可以是文件夹!! * @param thumbnailPath * @param filesetName */ async createFlashTransferUploadTask(e, n, r) { const i = this.context.session.getFlashTransferService(), o = Date.now(), a = this.core.selfInfo, s = { screen: 1, // 1 name: r, uploaders: [{ uin: a.uin, uid: a.uid, sendEntrance: "", nickname: a.nick }], coverPath: n, paths: e, excludePaths: [], expireLeftTime: 0, isNeedDelDeviceInfo: !1, isNeedDelLocation: !1, coverOriginalInfos: [ { path: e[0] || "", thumbnailPath: n } ], uploadSceneType: PM.KUPLOADSCENEAIOFILESELECTOR, // 不知道怎么枚举 先硬编码吧 (PC QQ 10) detectPrivacyInfoResult: { exists: !1, allDetectResults: /* @__PURE__ */ new Map() } }, c = await i.createFlashTransferUploadTask(o, s); return c.result === 0 ? (this.context.logger.log("[Flash] 发起闪传任务成功"), c) : (this.context.logger.logError("[Flash] 发起闪传上传任务失败!!"), c); } /** * 下载闪传文件集 * @param fileSetId */ async downloadFileSetBySetId(e) { const r = await this.context.session.getFlashTransferService().startFileSetDownload(e, 1, { isIncludeCompressInnerFiles: !1 }); return r.result === 0 ? this.context.logger.log("[Flash] 成功开始下载文件集") : this.context.logger.logError("[Flash] 尝试下载文件集失败!"), r; } /** * 获取闪传的外链分享 * @param fileSetId */ async getShareLinkBySetId(e) { const r = await this.context.session.getFlashTransferService().getShareLinkReq(e); return r.result === 0 ? this.context.logger.log("[Flash] 获取闪传外链分享成功:", r.shareLink) : this.context.logger.logError("[Flash] 获取闪传外链失败!!"), r; } /** * 从分享外链获取文件集id * @param shareCode */ async fromShareLinkFindSetId(e) { const r = await this.context.session.getFlashTransferService().getFileSetIdByCode(e); return r.result === 0 ? this.context.logger.log("[Flash] 获取shareCode的文件集Id成功!") : this.context.logger.logError("[Flash] 获取文件集ID失败!!"), r; } /** * 获取fileSet的文件结构信息 (未来可能需要深度遍历) * == 注意返回结构和其它的不同,没有GeneralCallResult!!! == * @param fileSetId */ async getFileListBySetId(e) { const n = this.context.session.getFlashTransferService(), r = { seq: 0, fileSetId: e, isUseCache: !1, sceneType: 1, // 硬编码 reqInfos: [ { count: 18, // 18 ?? paginationInfo: {}, parentId: "", reqIndexPath: "", reqDepth: 1, filterCondition: { fileCategory: 0, filterType: 0 }, sortConditions: [ { sortField: 0, sortOrder: 0 } ], isNeedPhysicalInfoReady: !1 } ] }, i = await n.getFileList(r); return i.rsp.result === 0 ? (this.context.logger.log("[Flash] 获取fileSet文件信息成功!"), i.rsp) : (this.context.logger.logError(`[Flash] 获取文件信息失败:ErrMsg: ${i.rsp.errMs}`), i.rsp); } /** * 获取闪传文件集合信息 * @param fileSetId */ async getFileSetIndoBySetId(e) { const n = this.context.session.getFlashTransferService(), r = { fileSetId: e }, i = await n.getFileSet(r); return i.result === 0 ? this.context.logger.log("[Flash] 获取闪传文件集信息成功!") : this.context.logger.logError("[Flash] 获取闪传文件信息失败!!"), i; } /** * 发送闪传消息(私聊/群聊) * @param fileSetId * @param peer */ async sendFlashMessage(e, n) { const r = this.context.session.getFlashTransferService(), i = { destUid: n.peerUid, destType: n.chatType // destUin: peer.peerUin, }, o = { fileSetId: e, targets: [i] }, a = await r.sendFlashTransferMsg(o); return a.errCode === 0 ? this.context.logger.log("[Flash] 消息发送成功") : this.context.logger.logError(`[Flash] 消息发送失败!!原因:${a.errMsg}`), a; } /** * 获取闪传文件集中某个文件的下载URL(外链) * @param fileSetId * @param options */ async getFileTransUrl(e, n) { const r = this.context.session.getFlashTransferService(), i = await this.getFileListBySetId(e), { fileName: o, fileIndex: a } = n; let s, c; const u = i.fileLists; e: for (const d of u) { const p = d.fileList; for (let f = 0; f < p.length; f++) { if (c = p[f], o !== void 0 && c.name === o) { s = c; break e; } if (a !== void 0 && f === a) { s = c; break e; } } } return s === void 0 ? (this.context.logger.logError("[Flash] 未找到对应文件!!"), { result: -1, errMsg: "未找到对应文件", transferUrl: "" }) : (this.context.logger.log("[Flash] 找到对应文件,准备尝试获取传输链接"), { result: 0, errMsg: "", transferUrl: (await r.startFileTransferUrl(s)).url }); } async createFileThumbnail(e) { const r = this.context.session.getMsgService().getFileThumbSavePathForSend(750, !0), i = await this.core.util.createThumbnailImage( "flashtransfer", e, r, { width: 520, height: 520 }, "jpeg", null ); return i.result === 0 && (this.context.logger.log("获取缩略图成功!!"), i.targetPath = r), i; } } const DM = 1024, os = 4096, x8 = 16, w8 = 32, yX = 16, bX = 48, vX = 4e3, xX = 2, wX = 58, SX = Buffer.from("SQLite header 3\0"), _X = Buffer.from("SQLite format 3\0"); function EX(t, e) { const n = B3(t, e, vX, w8, "sha512"), r = Buffer.alloc(e.length); for (let o = 0; o < e.length; o++) r[o] = e[o] ^ wX; const i = B3(n, r, xX, w8, "sha512"); return { encKey: n, hmacKey: i }; } function AX(t, e, n = 0) { const r = t.subarray(n), i = r.length - bX, o = r.subarray(0, i), a = r.subarray(i, i + yX), s = i7("aes-256-cbc", e, a); return s.setAutoPadding(!1), Buffer.concat([s.update(o), s.final()]); } function OM(t) { return t.length < DM + os ? !1 : t.subarray(0, 16).equals(SX); } function xE(t, e) { if (!OM(t)) return null; const n = t.subarray(DM), r = Math.floor(n.length / os); if (r === 0) return null; const i = n.subarray(0, x8), { encKey: o } = EX(e, i), a = Buffer.alloc(r * os); let s = 0; for (let c = 1; c <= r; c++) { const u = (c - 1) * os, d = n.subarray(u, u + os), f = AX(d, o, c === 1 ? x8 : 0); c === 1 ? (_X.copy(a, 0), f.copy(a, 16), a.writeUInt16BE(os, 16), s = os) : (f.copy(a, s), s += os); } return a; } function wE(t, e, n) { const r = qe.readFileSync(t), i = xE(r, e); if (!i) return null; if (!n) { const o = t.lastIndexOf("."); n = o > 0 ? t.substring(0, o) + "_decrypted" + t.substring(o) : t + "_decrypted"; } return qe.writeFileSync(n, i), n; } let Su = null, S8 = !1; async function IX() { if (S8) return Su; S8 = !0; try { return Su = (await import("node:sqlite")).DatabaseSync, Su; } catch { return Su = null, null; } } function FM() { if (!Su) throw new Error( "node:sqlite 不可用。请使用 Node.js 22+ 并添加 --experimental-sqlite 标志,或调用 checkSqliteAvailable() 检查可用性。" ); return Su; } async function CX() { return await IX() !== null; } class Pm { db; _closed = !1; filePath; readOnly; constructor(e, n = !1) { const r = FM(); this.db = new r(e, { readOnly: n }), this.filePath = e, this.readOnly = n; } /** 数据库是否已关闭 */ get closed() { return this._closed; } ensureOpen() { if (this._closed) throw new Error("数据库已关闭"); } /** * 执行 SELECT 查询,返回所有结果行 * @param sql SQL 语句 * @param params 绑定参数 (位置参数数组 或 命名参数对象) */ query(e, n) { this.ensureOpen(); const r = this.db.prepare(e); return n ? Array.isArray(n) ? r.all(...n) : r.all(n) : r.all(); } /** * 执行 SELECT 查询,仅返回第一行 * @param sql SQL 语句 * @param params 绑定参数 */ queryOne(e, n) { this.ensureOpen(); const r = this.db.prepare(e); return n ? Array.isArray(n) ? r.get(...n) : r.get(n) : r.get(); } /** * 执行非查询 SQL (INSERT/UPDATE/DELETE/CREATE 等) * @param sql SQL 语句 * @param params 绑定参数 * @returns 受影响的行数信息 */ execute(e, n) { this.ensureOpen(); const r = this.db.prepare(e); return n ? Array.isArray(n) ? r.run(...n) : r.run(n) : r.run(); } /** 列出所有表的信息 */ listTables() { return this.ensureOpen(), MM(this.db); } /** 获取指定表的列信息 */ getTableColumns(e) { return this.ensureOpen(), this.db.prepare(`PRAGMA table_info([${e}])`).all().map((r) => ({ cid: r.cid, name: r.name, type: r.type, notnull: r.notnull === 1, pk: r.pk === 1 })); } /** 获取表的行数 */ getRowCount(e) { return this.ensureOpen(), this.db.prepare(`SELECT count(*) as cnt FROM [${e}]`).get()?.cnt ?? 0; } /** 关闭数据库连接 */ close() { this._closed || (this.db.close(), this._closed = !0); } } function TX(t, e = !0) { return new Pm(t, e); } function kX(t, e, n, r = !0) { const i = xe.basename(t); if (n) { const c = xe.join(n, i); if (qe.existsSync(c)) return new Pm(c, r); qe.mkdirSync(n, { recursive: !0 }); const u = wE(t, e, c); if (!u) throw new Error(`解密失败: ${t}`); return new Pm(u, r); } const o = xe.join(gt.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`), a = qe.readFileSync(t), s = xE(a, e); if (!s) throw new Error(`解密失败: ${t}`); return qe.writeFileSync(o, s), new Pm(o, r); } function MM(t) { const e = [], n = t.prepare( "SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY name" ).all(); for (const { name: r, type: i } of n) { const o = []; try { const s = t.prepare(`PRAGMA table_info([${r}])`).all(); for (const c of s) o.push({ cid: c.cid, name: c.name, type: c.type, notnull: c.notnull === 1, pk: c.pk === 1 }); } catch { } let a = 0; try { a = t.prepare(`SELECT count(*) as cnt FROM [${r}]`).get()?.cnt ?? 0; } catch { a = -1; } e.push({ name: r, type: i, rowCount: a, columns: o }); } return e; } function OS(t) { const e = FM(), n = new e(t, { readOnly: !0 }); try { return MM(n); } finally { n.close(); } } function NX(t) { const e = xe.join(gt.tmpdir(), `napcat_db_${Date.now()}_${Math.random().toString(36).slice(2)}.db`); try { return qe.writeFileSync(e, t), OS(e); } finally { try { qe.unlinkSync(e); } catch { } } } function RM(t, e, n) { const r = xe.basename(t), i = { filename: r, sourcePath: t, success: !1, tables: [] }; try { if (n?.cacheDir) { const a = xe.join(n.cacheDir, r); if (i.cachePath = a, n?.skipExistingCache !== !1 && qe.existsSync(a)) return i.tables = OS(a), i.success = !0, i; } const o = qe.readFileSync(t); if (!OM(o)) return i.error = "Not an encrypted NTQQ database", i; if (n?.cacheDir) { qe.mkdirSync(n.cacheDir, { recursive: !0 }); const a = wE(t, e, i.cachePath); if (!a) return i.error = "Decryption failed", i; i.cachePath = a, i.tables = OS(a); } else { const a = xE(o, e); if (!a) return i.error = "Decryption returned null", i; i.tables = NX(a); } i.success = !0; } catch (o) { i.error = o instanceof Error ? o.message : String(o); } return i; } function PX(t, e, n) { const r = []; if (!qe.existsSync(t)) return r; const i = qe.readdirSync(t).filter((o) => o.endsWith(".db")).sort(); for (const o of i) { const a = xe.join(t, o), s = RM(a, e, n); r.push(s); } return r; } function DX(t) { const e = []; let n = 0, r = 0; for (const i of t) { if (i.success) { r++; const o = i.cachePath ? ` → ${i.cachePath}` : ""; e.push(`=== ${i.filename} (${i.tables.length} tables)${o} ===`); for (const a of i.tables) { n++; const s = a.columns.map((c) => `${c.name}:${c.type || "?"}`).join(", "); e.push(` ${a.name}: ${a.rowCount} rows [${s}]`); } } else e.push(`=== ${i.filename}: SKIP (${i.error}) ===`); e.push(""); } return e.push(`Summary: ${r}/${t.length} databases decrypted, ${n} total tables`), e.join(` `); } class OX { context; core; constructor(e, n) { this.context = e, this.core = n; } /** node:sqlite 是否可用 */ async isSqliteAvailable() { return CX(); } /** 获取当前账号的 nt_db 目录 */ getNtDbDir() { return xe.resolve(this.core.dataPath, this.core.selfInfo.uin, "nt_qq", "nt_db"); } /** * 获取解密缓存目录 * 默认: <SnowCatDataPath>/db_<uin>/ * 可通过 customDir 完全自定义 */ getDefaultCacheDir(e) { return e || xe.resolve(this.core.SnowCatDataPath, `db_${this.core.selfInfo.uin}`); } /** 当前是否已获取到数据库 passphrase */ hasPassphrase() { return !!this.core.dbPassphrase; } /** 获取 passphrase Buffer,未获取时返回 null */ getPassphraseBuffer() { return this.core.dbPassphrase ? Buffer.from(this.core.dbPassphrase) : null; } // ======================== SQLite 数据库操作 ======================== /** * 打开一个已解密的 SQLite 数据库文件 * @param filePath 解密后 .db 文件路径 * @param readOnly 是否只读 (默认 true) * @returns DatabaseHandle 实例,使用完毕后需调用 .close() */ openDecryptedDb(e, n = !0) { return TX(e, n); } /** * 解密并打开一个 NTQQ 加密数据库 * @param dbName 数据库文件名 (如 'nt_msg.db') 或完整路径 * @param readOnly 是否只读 (默认 true) * @param cacheDir 自定义缓存目录,默认 db_<uin> * @returns DatabaseHandle 实例,使用完毕后需调用 .close() */ openDatabase(e, n = !0, r) { const i = this.getPassphraseBuffer(); if (!i) return null; const o = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), a = this.getDefaultCacheDir(r); return kX(o, i, a, n); } /** * 对加密数据库执行查询并自动关闭连接 * @param dbName 数据库文件名或完整路径 * @param sql SQL 查询语句 * @param params 绑定参数 * @returns 查询结果行数组,passphrase 不可用时返回 null */ query(e, n, r) { const i = this.openDatabase(e); if (!i) return null; try { return i.query(n, r); } finally { i.close(); } } /** * 对加密数据库执行查询,仅返回第一行 * @param dbName 数据库文件名或完整路径 * @param sql SQL 查询语句 * @param params 绑定参数 */ queryOne(e, n, r) { const i = this.openDatabase(e); if (!i) return null; try { return i.queryOne(n, r); } finally { i.close(); } } /** * 对加密数据库执行非查询 SQL (INSERT/UPDATE/DELETE 等) 并自动关闭 * @param dbName 数据库文件名或完整路径 * @param sql SQL 语句 * @param params 绑定参数 */ execute(e, n, r) { const i = this.openDatabase(e, !1); if (!i) return null; try { return i.execute(n, r); } finally { i.close(); } } // ======================== 批量扫描 ======================== /** * 读取单个加密数据库的表信息 * @param dbName 数据库文件名 (如 'nt_msg.db'),或完整路径 * @param cacheDir 自定义缓存目录,默认 db_<uin> * @param options 其他选项 */ readDatabase(e, n, r) { const i = this.getPassphraseBuffer(); if (!i) return null; const o = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), a = this.getDefaultCacheDir(n); return RM(o, i, { cacheDir: a, ...r }); } /** * 扫描所有加密数据库 * @param cacheDir 自定义缓存目录,默认 db_<uin> * @param options 其他选项 */ scanDatabases(e, n) { const r = this.getPassphraseBuffer(); if (!r) return []; const i = this.getDefaultCacheDir(e); return PX(this.getNtDbDir(), r, { cacheDir: i, ...n }); } /** * 仅解密数据库文件(不读取表信息,不需要 node:sqlite) * @param dbName 数据库文件名或完整路径 * @param outputPath 输出路径,默认保存到 db_<uin>/<dbName> */ decryptDatabase(e, n) { const r = this.getPassphraseBuffer(); if (!r) return null; const i = xe.isAbsolute(e) ? e : xe.resolve(this.getNtDbDir(), e), o = n ?? xe.resolve(this.getDefaultCacheDir(), xe.basename(e)); return wE(i, r, o); } /** 格式化扫描结果为可读字符串 */ formatResults(e) { return DX(e); } } class FX { context; core; constructor(e, n) { this.context = e, this.core = n; } async createCollection(e, n, r, i, o) { return this.context.session.getCollectionService().createNewCollectionItem({ commInfo: { bid: 1, category: 2, author: { type: 1, numId: e, strId: r, groupId: "0", groupName: "", uid: n }, customGroupId: "0", createTime: Date.now().toString(), sequence: Date.now().toString() }, richMediaSummary: { originalUri: "", publisher: "", richMediaVersion: 0, subTitle: "", title: "", brief: i, picList: [], contentType: 1 }, richMediaContent: { rawData: o, bizDataList: [], picList: [], fileList: [] }, need_share_url: !1 }); } async getAllCollection(e = 0, n = 50) { return this.context.session.getCollectionService().getCollectionItemList({ category: e, groupId: -1, forceSync: !0, forceFromDb: !1, timeStamp: "0", count: n, searchDown: !0 }); } } var _a = /* @__PURE__ */ ((t) => (t[t.KUNKNOWN = 0] = "KUNKNOWN", t[t.KANDROID = 1] = "KANDROID", t[t.KIOS = 2] = "KIOS", t[t.KWINDOWS = 3] = "KWINDOWS", t[t.KMAC = 4] = "KMAC", t[t.KLINUX = 5] = "KLINUX", t))(_a || {}), BM = /* @__PURE__ */ ((t) => (t[t.KNOSETONIOS = 0] = "KNOSETONIOS", t[t.KSUPPORTGOOGLEPUSH = 99] = "KSUPPORTGOOGLEPUSH", t[t.KSUPPORTHMS = 3] = "KSUPPORTHMS", t[t.KSUPPORTOPPOPUSH = 4] = "KSUPPORTOPPOPUSH", t[t.KSUPPORTTPNS = 2] = "KSUPPORTTPNS", t[t.KSUPPORTVIVOPUSH = 5] = "KSUPPORTVIVOPUSH", t[t.KUNSUPPORTANDROIDPUSH = 1] = "KUNSUPPORTANDROIDPUSH", t))(BM || {}); let FS; try { FS = gt.hostname(); } catch { FS = "SnowCat"; } const MX = gt.homedir(), _8 = gt.platform(); gt.arch(); const ag = gt.release(), UM = FS; xe.join(MX, "Downloads"); const E8 = gt.type(); class RX { WrapperSession; // WrapperSession listenerManager = /* @__PURE__ */ new Map(); // ListenerName-Unique -> Listener实例 EventTask = /* @__PURE__ */ new Map(); // tasks ListenerMainName -> ListenerSubName-> uuid -> {timeout,createtime,func} constructor(e) { this.WrapperSession = e; } createProxyDispatch(e) { const n = this.dispatcherListener.bind(this); return new Proxy( {}, { get(r, i, o) { return typeof r[i] > "u" ? (...a) => { n(e, i, ...a).then(); } : Reflect.get(r, i, o); } } ); } createEventFunction(e) { const n = e.split("/"); if (n.length > 1) { const r = "get" + (n[0]?.replace("NodeIKernel", "") ?? ""), i = n[1], o = this.WrapperSession[r]?.(); if (!o || !i) return; let a = o[i]; return a = a?.bind(o), a || void 0; } } createListenerFunction(e, n = "") { const r = this.listenerManager.get(e + n); if (!r) { const i = this.createProxyDispatch(e), o = /^NodeIKernel(.*?)Listener$/.exec(e)[1], a = `NodeIKernel${o}Service/addKernel${o}Listener`; return this.createEventFunction(a)(i), this.listenerManager.set(e + n, i), i; } return r; } // 统一回调清理事件 async dispatcherListener(e, n, ...r) { this.EventTask.get(e)?.get(n)?.forEach((i, o) => { if (i.createtime + i.timeout < Date.now()) { this.EventTask.get(e)?.get(n)?.delete(o); return; } i?.checker?.(...r) && i.func(...r); }); } async callNoListenerEvent(e, ...n) { return this.createEventFunction(e)(...n); } async registerListen(e, n, r = 1, i = 5e3) { return new Promise((o, a) => { const s = e.split("/"), c = s[0] ?? "", u = s[1] ?? "", d = Xo(); let p = 0, f; function m() { p === 0 ? a(new Error(" ListenerName:" + e + " timeout")) : o(f); } const h = setTimeout(m, i), y = { timeout: i, createtime: Date.now(), checker: n, func: (...x) => { p++, f = x, p >= r && (clearTimeout(h), m()); } }; this.EventTask.get(c) || this.EventTask.set(c, /* @__PURE__ */ new Map()), this.EventTask.get(c)?.get(u) || this.EventTask.get(c)?.set(u, /* @__PURE__ */ new Map()), this.EventTask.get(c)?.get(u)?.set(d, y), this.createListenerFunction(c); }); } async callNormalEventV2(e, n, r, i = () => !0, o = () => !0, a = 1, s = 5e3) { const c = Xo(); let u = 0, d, p = {}; function f(x, g) { u === 0 ? g( new Error( "Timeout: NTEvent serviceAndMethod:" + e + " ListenerName:" + n + ` EventRet: ` + JSON.stringify(p, null, 4) + ` ` ) ) : x([p, ...d]); } const m = n.split("/"), h = m[0] ?? "", y = m[1] ?? ""; return new Promise( (x, g) => { const b = setTimeout(() => f(x, g), s), S = { timeout: s, createtime: Date.now(), checker: o, func: (...U) => { u++, d = U, u >= a && (clearTimeout(b), f(x, g)); } }; this.EventTask.get(h) || this.EventTask.set(h, /* @__PURE__ */ new Map()), this.EventTask.get(h)?.get(y) || this.EventTask.get(h)?.set(y, /* @__PURE__ */ new Map()), this.EventTask.get(h)?.get(y)?.set(c, S), this.createListenerFunction(h); const E = this.createEventFunction(e)(...r), T = (U) => { p = U, !i(p) && b.hasRef() && (clearTimeout(b), g( new Error( "EventChecker Failed: NTEvent serviceAndMethod:" + e + " ListenerName:" + n + ` EventRet: ` + JSON.stringify(p, null, 4) + ` ` ) )); }; E instanceof Promise ? E.then((U) => { T(U); }).catch(g) : T(E); } ); } } function BX(t, e, n) { return new Proxy(e, { get(r, i, o) { const a = Reflect.get(r, i, o); if (typeof a != "function") return a; const s = i; return function(...c) { const u = `${t}/${s}`; try { const d = n.createEventFunction(u); if (d) return d(...c); } catch { } return a.apply(e, c); }; } }); } function UX(t, e) { const n = /* @__PURE__ */ new Map(); return new Proxy(t, { get(r, i, o) { const a = i; if (typeof a == "string" && a.startsWith("get") && a.endsWith("Service")) { const c = `NodeIKernel${a.slice(3)}`; return function() { if (n.has(c)) return n.get(c); const d = Reflect.get(r, i, o).call(r); if (LX(c)) { const p = BX( c, d, e ); return n.set(c, p), p; } return n.set(c, d), d; }; } return Reflect.get(r, i, o); } }); } function LX(t) { return [ "NodeIKernelAvatarService", "NodeIKernelBuddyService", "NodeIKernelFileAssistantService", "NodeIKernelGroupService", "NodeIKernelLoginService", "NodeIKernelMsgService", "NodeIKernelOnlineStatusService", "NodeIKernelProfileLikeService", "NodeIKernelProfileService", "NodeIKernelTicketService", "NodeIKernelStorageCleanService", "NodeIKernelRobotService", "NodeIKernelRichMediaService", "NodeIKernelDbToolsService", "NodeIKernelTipOffService", "NodeIKernelSearchService", "NodeIKernelCollectionService" ].includes(t); } var QX = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/, jX = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/, $X = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/, Gx = { Space_Separator: QX, ID_Start: jX, ID_Continue: $X }, hn = { isSpaceSeparator(t) { return typeof t == "string" && Gx.Space_Separator.test(t); }, isIdStartChar(t) { return typeof t == "string" && (t >= "a" && t <= "z" || t >= "A" && t <= "Z" || t === "$" || t === "_" || Gx.ID_Start.test(t)); }, isIdContinueChar(t) { return typeof t == "string" && (t >= "a" && t <= "z" || t >= "A" && t <= "Z" || t >= "0" && t <= "9" || t === "$" || t === "_" || t === "‌" || t === "‍" || Gx.ID_Continue.test(t)); }, isDigit(t) { return typeof t == "string" && /[0-9]/.test(t); }, isHexDigit(t) { return typeof t == "string" && /[0-9A-Fa-f]/.test(t); } }; let MS, Mr, wa, sg, _s, po, Kn, SE, op; var GX = function(e, n) { MS = String(e), Mr = "start", wa = [], sg = 0, _s = 1, po = 0, Kn = void 0, SE = void 0, op = void 0; do Kn = qX(), WX[Mr](); while (Kn.type !== "eof"); return typeof n == "function" ? RS({ "": op }, "", n) : op; }; function RS(t, e, n) { const r = t[e]; if (r != null && typeof r == "object") if (Array.isArray(r)) for (let i = 0; i < r.length; i++) { const o = String(i), a = RS(r, o, n); a === void 0 ? delete r[o] : Object.defineProperty(r, o, { value: a, writable: !0, enumerable: !0, configurable: !0 }); } else for (const i in r) { const o = RS(r, i, n); o === void 0 ? delete r[i] : Object.defineProperty(r, i, { value: o, writable: !0, enumerable: !0, configurable: !0 }); } return n.call(t, e, r); } let dt, st, vd, ga, _t; function qX() { for (dt = "default", st = "", vd = !1, ga = 1; ; ) { _t = ka(); const t = LM[dt](); if (t) return t; } } function ka() { if (MS[sg]) return String.fromCodePoint(MS.codePointAt(sg)); } function be() { const t = ka(); return t === ` ` ? (_s++, po = 0) : t ? po += t.length : po++, t && (sg += t.length), t; } const LM = { default() { switch (_t) { case " ": case "\v": case "\f": case " ": case " ": case "\uFEFF": case ` `: case "\r": case "\u2028": case "\u2029": be(); return; case "/": be(), dt = "comment"; return; case void 0: return be(), Jt("eof"); } if (hn.isSpaceSeparator(_t)) { be(); return; } return LM[Mr](); }, comment() { switch (_t) { case "*": be(), dt = "multiLineComment"; return; case "/": be(), dt = "singleLineComment"; return; } throw Xt(be()); }, multiLineComment() { switch (_t) { case "*": be(), dt = "multiLineCommentAsterisk"; return; case void 0: throw Xt(be()); } be(); }, multiLineCommentAsterisk() { switch (_t) { case "*": be(); return; case "/": be(), dt = "default"; return; case void 0: throw Xt(be()); } be(), dt = "multiLineComment"; }, singleLineComment() { switch (_t) { case ` `: case "\r": case "\u2028": case "\u2029": be(), dt = "default"; return; case void 0: return be(), Jt("eof"); } be(); }, value() { switch (_t) { case "{": case "[": return Jt("punctuator", be()); case "n": return be(), Xs("ull"), Jt("null", null); case "t": return be(), Xs("rue"), Jt("boolean", !0); case "f": return be(), Xs("alse"), Jt("boolean", !1); case "-": case "+": be() === "-" && (ga = -1), dt = "sign"; return; case ".": st = be(), dt = "decimalPointLeading"; return; case "0": st = be(), dt = "zero"; return; case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": st = be(), dt = "decimalInteger"; return; case "I": return be(), Xs("nfinity"), Jt("numeric", 1 / 0); case "N": return be(), Xs("aN"), Jt("numeric", NaN); case '"': case "'": vd = be() === '"', st = "", dt = "string"; return; } throw Xt(be()); }, identifierNameStartEscape() { if (_t !== "u") throw Xt(be()); be(); const t = BS(); switch (t) { case "$": case "_": break; default: if (!hn.isIdStartChar(t)) throw A8(); break; } st += t, dt = "identifierName"; }, identifierName() { switch (_t) { case "$": case "_": case "‌": case "‍": st += be(); return; case "\\": be(), dt = "identifierNameEscape"; return; } if (hn.isIdContinueChar(_t)) { st += be(); return; } return Jt("identifier", st); }, identifierNameEscape() { if (_t !== "u") throw Xt(be()); be(); const t = BS(); switch (t) { case "$": case "_": case "‌": case "‍": break; default: if (!hn.isIdContinueChar(t)) throw A8(); break; } st += t, dt = "identifierName"; }, sign() { switch (_t) { case ".": st = be(), dt = "decimalPointLeading"; return; case "0": st = be(), dt = "zero"; return; case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": st = be(), dt = "decimalInteger"; return; case "I": return be(), Xs("nfinity"), Jt("numeric", ga * (1 / 0)); case "N": return be(), Xs("aN"), Jt("numeric", NaN); } throw Xt(be()); }, zero() { switch (_t) { case ".": st += be(), dt = "decimalPoint"; return; case "e": case "E": st += be(), dt = "decimalExponent"; return; case "x": case "X": st += be(), dt = "hexadecimal"; return; } return Jt("numeric", ga * 0); }, decimalInteger() { switch (_t) { case ".": st += be(), dt = "decimalPoint"; return; case "e": case "E": st += be(), dt = "decimalExponent"; return; } if (hn.isDigit(_t)) { st += be(); return; } return Jt("numeric", ga * Number(st)); }, decimalPointLeading() { if (hn.isDigit(_t)) { st += be(), dt = "decimalFraction"; return; } throw Xt(be()); }, decimalPoint() { switch (_t) { case "e": case "E": st += be(), dt = "decimalExponent"; return; } if (hn.isDigit(_t)) { st += be(), dt = "decimalFraction"; return; } return Jt("numeric", ga * Number(st)); }, decimalFraction() { switch (_t) { case "e": case "E": st += be(), dt = "decimalExponent"; return; } if (hn.isDigit(_t)) { st += be(); return; } return Jt("numeric", ga * Number(st)); }, decimalExponent() { switch (_t) { case "+": case "-": st += be(), dt = "decimalExponentSign"; return; } if (hn.isDigit(_t)) { st += be(), dt = "decimalExponentInteger"; return; } throw Xt(be()); }, decimalExponentSign() { if (hn.isDigit(_t)) { st += be(), dt = "decimalExponentInteger"; return; } throw Xt(be()); }, decimalExponentInteger() { if (hn.isDigit(_t)) { st += be(); return; } return Jt("numeric", ga * Number(st)); }, hexadecimal() { if (hn.isHexDigit(_t)) { st += be(), dt = "hexadecimalInteger"; return; } throw Xt(be()); }, hexadecimalInteger() { if (hn.isHexDigit(_t)) { st += be(); return; } return Jt("numeric", ga * Number(st)); }, string() { switch (_t) { case "\\": be(), st += zX(); return; case '"': if (vd) return be(), Jt("string", st); st += be(); return; case "'": if (!vd) return be(), Jt("string", st); st += be(); return; case ` `: case "\r": throw Xt(be()); case "\u2028": case "\u2029": KX(_t); break; case void 0: throw Xt(be()); } st += be(); }, start() { switch (_t) { case "{": case "[": return Jt("punctuator", be()); } dt = "value"; }, beforePropertyName() { switch (_t) { case "$": case "_": st = be(), dt = "identifierName"; return; case "\\": be(), dt = "identifierNameStartEscape"; return; case "}": return Jt("punctuator", be()); case '"': case "'": vd = be() === '"', dt = "string"; return; } if (hn.isIdStartChar(_t)) { st += be(), dt = "identifierName"; return; } throw Xt(be()); }, afterPropertyName() { if (_t === ":") return Jt("punctuator", be()); throw Xt(be()); }, beforePropertyValue() { dt = "value"; }, afterPropertyValue() { switch (_t) { case ",": case "}": return Jt("punctuator", be()); } throw Xt(be()); }, beforeArrayValue() { if (_t === "]") return Jt("punctuator", be()); dt = "value"; }, afterArrayValue() { switch (_t) { case ",": case "]": return Jt("punctuator", be()); } throw Xt(be()); }, end() { throw Xt(be()); } }; function Jt(t, e) { return { type: t, value: e, line: _s, column: po }; } function Xs(t) { for (const e of t) { if (ka() !== e) throw Xt(be()); be(); } } function zX() { switch (ka()) { case "b": return be(), "\b"; case "f": return be(), "\f"; case "n": return be(), ` `; case "r": return be(), "\r"; case "t": return be(), " "; case "v": return be(), "\v"; case "0": if (be(), hn.isDigit(ka())) throw Xt(be()); return "\0"; case "x": return be(), HX(); case "u": return be(), BS(); case ` `: case "\u2028": case "\u2029": return be(), ""; case "\r": return be(), ka() === ` ` && be(), ""; case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": throw Xt(be()); case void 0: throw Xt(be()); } return be(); } function HX() { let t = "", e = ka(); if (!hn.isHexDigit(e) || (t += be(), e = ka(), !hn.isHexDigit(e))) throw Xt(be()); return t += be(), String.fromCodePoint(parseInt(t, 16)); } function BS() { let t = "", e = 4; for (; e-- > 0; ) { const n = ka(); if (!hn.isHexDigit(n)) throw Xt(be()); t += be(); } return String.fromCodePoint(parseInt(t, 16)); } const WX = { start() { if (Kn.type === "eof") throw Zs(); qx(); }, beforePropertyName() { switch (Kn.type) { case "identifier": case "string": SE = Kn.value, Mr = "afterPropertyName"; return; case "punctuator": Vh(); return; case "eof": throw Zs(); } }, afterPropertyName() { if (Kn.type === "eof") throw Zs(); Mr = "beforePropertyValue"; }, beforePropertyValue() { if (Kn.type === "eof") throw Zs(); qx(); }, beforeArrayValue() { if (Kn.type === "eof") throw Zs(); if (Kn.type === "punctuator" && Kn.value === "]") { Vh(); return; } qx(); }, afterPropertyValue() { if (Kn.type === "eof") throw Zs(); switch (Kn.value) { case ",": Mr = "beforePropertyName"; return; case "}": Vh(); } }, afterArrayValue() { if (Kn.type === "eof") throw Zs(); switch (Kn.value) { case ",": Mr = "beforeArrayValue"; return; case "]": Vh(); } }, end() { } }; function qx() { let t; switch (Kn.type) { case "punctuator": switch (Kn.value) { case "{": t = {}; break; case "[": t = []; break; } break; case "null": case "boolean": case "numeric": case "string": t = Kn.value; break; } if (op === void 0) op = t; else { const e = wa[wa.length - 1]; Array.isArray(e) ? e.push(t) : Object.defineProperty(e, SE, { value: t, writable: !0, enumerable: !0, configurable: !0 }); } if (t !== null && typeof t == "object") wa.push(t), Array.isArray(t) ? Mr = "beforeArrayValue" : Mr = "beforePropertyName"; else { const e = wa[wa.length - 1]; e == null ? Mr = "end" : Array.isArray(e) ? Mr = "afterArrayValue" : Mr = "afterPropertyValue"; } } function Vh() { wa.pop(); const t = wa[wa.length - 1]; t == null ? Mr = "end" : Array.isArray(t) ? Mr = "afterArrayValue" : Mr = "afterPropertyValue"; } function Xt(t) { return cg(t === void 0 ? `JSON5: invalid end of input at ${_s}:${po}` : `JSON5: invalid character '${QM(t)}' at ${_s}:${po}`); } function Zs() { return cg(`JSON5: invalid end of input at ${_s}:${po}`); } function A8() { return po -= 5, cg(`JSON5: invalid identifier character at ${_s}:${po}`); } function KX(t) { console.warn(`JSON5: '${QM(t)}' in strings is not valid ECMAScript; consider escaping`); } function QM(t) { const e = { "'": "\\'", '"': '\\"', "\\": "\\\\", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t", "\v": "\\v", "\0": "\\0", "\u2028": "\\u2028", "\u2029": "\\u2029" }; if (e[t]) return e[t]; if (t < " ") { const n = t.charCodeAt(0).toString(16); return "\\x" + ("00" + n).substring(n.length); } return t; } function cg(t) { const e = new SyntaxError(t); return e.lineNumber = _s, e.columnNumber = po, e; } var VX = function(e, n, r) { const i = []; let o = "", a, s, c = "", u; if (n != null && typeof n == "object" && !Array.isArray(n) && (r = n.space, u = n.quote, n = n.replacer), typeof n == "function") s = n; else if (Array.isArray(n)) { a = []; for (const y of n) { let x; typeof y == "string" ? x = y : (typeof y == "number" || y instanceof String || y instanceof Number) && (x = String(y)), x !== void 0 && a.indexOf(x) < 0 && a.push(x); } } return r instanceof Number ? r = Number(r) : r instanceof String && (r = String(r)), typeof r == "number" ? r > 0 && (r = Math.min(10, Math.floor(r)), c = " ".substr(0, r)) : typeof r == "string" && (c = r.substr(0, 10)), d("", { "": e }); function d(y, x) { let g = x[y]; switch (g != null && (typeof g.toJSON5 == "function" ? g = g.toJSON5(y) : typeof g.toJSON == "function" && (g = g.toJSON(y))), s && (g = s.call(x, y, g)), g instanceof Number ? g = Number(g) : g instanceof String ? g = String(g) : g instanceof Boolean && (g = g.valueOf()), g) { case null: return "null"; case !0: return "true"; case !1: return "false"; } if (typeof g == "string") return p(g); if (typeof g == "number") return String(g); if (typeof g == "object") return Array.isArray(g) ? h(g) : f(g); } function p(y) { const x = { "'": 0.1, '"': 0.2 }, g = { "'": "\\'", '"': '\\"', "\\": "\\\\", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t", "\v": "\\v", "\0": "\\0", "\u2028": "\\u2028", "\u2029": "\\u2029" }; let b = ""; for (let E = 0; E < y.length; E++) { const T = y[E]; switch (T) { case "'": case '"': x[T]++, b += T; continue; case "\0": if (hn.isDigit(y[E + 1])) { b += "\\x00"; continue; } } if (g[T]) { b += g[T]; continue; } if (T < " ") { let U = T.charCodeAt(0).toString(16); b += "\\x" + ("00" + U).substring(U.length); continue; } b += T; } const S = u || Object.keys(x).reduce((E, T) => x[E] < x[T] ? E : T); return b = b.replace(new RegExp(S, "g"), g[S]), S + b + S; } function f(y) { if (i.indexOf(y) >= 0) throw TypeError("Converting circular structure to JSON5"); i.push(y); let x = o; o = o + c; let g = a || Object.keys(y), b = []; for (const E of g) { const T = d(E, y); if (T !== void 0) { let U = m(E) + ":"; c !== "" && (U += " "), U += T, b.push(U); } } let S; if (b.length === 0) S = "{}"; else { let E; if (c === "") E = b.join(","), S = "{" + E + "}"; else { let T = `, ` + o; E = b.join(T), S = `{ ` + o + E + `, ` + x + "}"; } } return i.pop(), o = x, S; } function m(y) { if (y.length === 0) return p(y); const x = String.fromCodePoint(y.codePointAt(0)); if (!hn.isIdStartChar(x)) return p(y); for (let g = x.length; g < y.length; g++) if (!hn.isIdContinueChar(String.fromCodePoint(y.codePointAt(g)))) return p(y); return y; } function h(y) { if (i.indexOf(y) >= 0) throw TypeError("Converting circular structure to JSON5"); i.push(y); let x = o; o = o + c; let g = []; for (let S = 0; S < y.length; S++) { const E = d(String(S), y); g.push(E !== void 0 ? E : "null"); } let b; if (g.length === 0) b = "[]"; else if (c === "") b = "[" + g.join(",") + "]"; else { let S = `, ` + o, E = g.join(S); b = `[ ` + o + E + `, ` + x + "]"; } return i.pop(), o = x, b; } }; const YX = { parse: GX, stringify: VX }; var Gi = YX; function jM(t) { return Mt(t) && globalThis.Symbol.asyncIterator in t; } function $M(t) { return Mt(t) && globalThis.Symbol.iterator in t; } function GM(t) { return t instanceof globalThis.Promise; } function wl(t) { return t instanceof Date && globalThis.Number.isFinite(t.getTime()); } function JX(t) { return t instanceof globalThis.Map; } function XX(t) { return t instanceof globalThis.Set; } function ZX(t) { return globalThis.ArrayBuffer.isView(t); } function _E(t) { return t instanceof globalThis.Uint8Array; } function ft(t, e) { return e in t; } function Mt(t) { return t !== null && typeof t == "object"; } function zt(t) { return globalThis.Array.isArray(t) && !globalThis.ArrayBuffer.isView(t); } function ii(t) { return t === void 0; } function af(t) { return t === null; } function Sl(t) { return typeof t == "boolean"; } function et(t) { return typeof t == "number"; } function qM(t) { return globalThis.Number.isInteger(t); } function Ui(t) { return typeof t == "bigint"; } function qt(t) { return typeof t == "string"; } function N0(t) { return typeof t == "function"; } function sf(t) { return typeof t == "symbol"; } function EE(t) { return Ui(t) || Sl(t) || af(t) || et(t) || qt(t) || sf(t) || ii(t); } var In; (function(t) { t.InstanceMode = "default", t.ExactOptionalPropertyTypes = !1, t.AllowArrayObject = !1, t.AllowNaN = !1, t.AllowNullVoid = !1; function e(a, s) { return t.ExactOptionalPropertyTypes ? s in a : a[s] !== void 0; } t.IsExactOptionalProperty = e; function n(a) { const s = Mt(a); return t.AllowArrayObject ? s : s && !zt(a); } t.IsObjectLike = n; function r(a) { return n(a) && !(a instanceof Date) && !(a instanceof Uint8Array); } t.IsRecordLike = r; function i(a) { return t.AllowNaN ? et(a) : Number.isFinite(a); } t.IsNumberLike = i; function o(a) { const s = ii(a); return t.AllowNullVoid ? s || a === null : s; } t.IsVoidLike = o; })(In || (In = {})); const zM = /* @__PURE__ */ new Map(); function AE(t) { return zM.has(t); } function IE(t) { return zM.get(t); } const HM = /* @__PURE__ */ new Map(); function Uu(t) { return HM.has(t); } function CE(t) { return HM.get(t); } function eZ(t) { return kn(t) && !oi(t) && !uf(t) && Symbol.asyncIterator in t; } function oi(t) { return Array.isArray(t); } function WM(t) { return typeof t == "bigint"; } function cf(t) { return typeof t == "boolean"; } function TE(t) { return t instanceof globalThis.Date; } function tZ(t) { return typeof t == "function"; } function nZ(t) { return kn(t) && !oi(t) && !uf(t) && Symbol.iterator in t; } function rZ(t) { return t === null; } function ea(t) { return typeof t == "number"; } function kn(t) { return typeof t == "object" && t !== null; } function KM(t) { return t instanceof globalThis.RegExp; } function xn(t) { return typeof t == "string"; } function iZ(t) { return typeof t == "symbol"; } function uf(t) { return t instanceof globalThis.Uint8Array; } function _n(t) { return t === void 0; } function oZ(t) { return globalThis.Object.freeze(t).map((e) => ug(e)); } function aZ(t) { const e = {}; for (const n of Object.getOwnPropertyNames(t)) e[n] = ug(t[n]); for (const n of Object.getOwnPropertySymbols(t)) e[n] = ug(t[n]); return globalThis.Object.freeze(e); } function ug(t) { return oi(t) ? oZ(t) : TE(t) ? t : uf(t) ? t : KM(t) ? t : kn(t) ? aZ(t) : t; } function sZ(t) { return t.map((e) => lg(e)); } function cZ(t) { return new Date(t.getTime()); } function uZ(t) { return new Uint8Array(t); } function lZ(t) { return new RegExp(t.source, t.flags); } function dZ(t) { const e = {}; for (const n of Object.getOwnPropertyNames(t)) e[n] = lg(t[n]); for (const n of Object.getOwnPropertySymbols(t)) e[n] = lg(t[n]); return e; } function lg(t) { return oi(t) ? sZ(t) : TE(t) ? cZ(t) : uf(t) ? uZ(t) : KM(t) ? lZ(t) : kn(t) ? dZ(t) : t; } function bi(t) { return lg(t); } function Pe(t, e) { const n = e !== void 0 ? { ...e, ...t } : t; switch (In.InstanceMode) { case "freeze": return ug(n); case "clone": return bi(n); default: return n; } } const Vr = Symbol.for("TypeBox.Transform"), lf = Symbol.for("TypeBox.Readonly"), ja = Symbol.for("TypeBox.Optional"), P0 = Symbol.for("TypeBox.Hint"), Ae = Symbol.for("TypeBox.Kind"); function pZ(t = {}) { return Pe({ [Ae]: t[Ae] ?? "Unsafe" }, t); } class wn extends Error { constructor(e) { super(e); } } function wr(t) { return Pe({ [Ae]: "MappedResult", properties: t }); } function fZ(t, e) { const { [e]: n, ...r } = t; return r; } function vi(t, e) { return e.reduce((n, r) => fZ(n, r), t); } function kE(t, e) { return Pe({ [Ae]: "Array", type: "array", items: t }, e); } function NE(t, e) { return Pe({ [Ae]: "AsyncIterator", type: "AsyncIterator", items: t }, e); } function PE(t, e, n) { return Pe({ [Ae]: "Constructor", type: "Constructor", parameters: t, returns: e }, n); } function df(t, e, n) { return Pe({ [Ae]: "Function", type: "Function", parameters: t, returns: e }, n); } function jn(t, e, n) { return Pe({ [Ae]: "Computed", target: t, parameters: e }, n); } function cn(t) { return Pe({ [Ae]: "Never", not: {} }, t); } function DE(t) { return kn(t) && t[lf] === "Readonly"; } function Rs(t) { return kn(t) && t[ja] === "Optional"; } function VM(t) { return Et(t, "Any"); } function YM(t) { return Et(t, "Argument"); } function _l(t) { return Et(t, "Array"); } function D0(t) { return Et(t, "AsyncIterator"); } function O0(t) { return Et(t, "BigInt"); } function pf(t) { return Et(t, "Boolean"); } function El(t) { return Et(t, "Computed"); } function Al(t) { return Et(t, "Constructor"); } function hZ(t) { return Et(t, "Date"); } function Il(t) { return Et(t, "Function"); } function Cl(t) { return Et(t, "Integer"); } function Vi(t) { return Et(t, "Intersect"); } function F0(t) { return Et(t, "Iterator"); } function Et(t, e) { return kn(t) && Ae in t && t[Ae] === e; } function JM(t) { return cf(t) || ea(t) || xn(t); } function Lc(t) { return Et(t, "Literal"); } function Qc(t) { return Et(t, "MappedKey"); } function Ai(t) { return Et(t, "MappedResult"); } function ff(t) { return Et(t, "Never"); } function mZ(t) { return Et(t, "Not"); } function OE(t) { return Et(t, "Null"); } function Tl(t) { return Et(t, "Number"); } function Oo(t) { return Et(t, "Object"); } function M0(t) { return Et(t, "Promise"); } function R0(t) { return Et(t, "Record"); } function ei(t) { return Et(t, "Ref"); } function XM(t) { return Et(t, "RegExp"); } function hf(t) { return Et(t, "String"); } function FE(t) { return Et(t, "Symbol"); } function jc(t) { return Et(t, "TemplateLiteral"); } function gZ(t) { return Et(t, "This"); } function Kt(t) { return kn(t) && Vr in t; } function $c(t) { return Et(t, "Tuple"); } function mf(t) { return Et(t, "Undefined"); } function sr(t) { return Et(t, "Union"); } function yZ(t) { return Et(t, "Uint8Array"); } function bZ(t) { return Et(t, "Unknown"); } function vZ(t) { return Et(t, "Unsafe"); } function xZ(t) { return Et(t, "Void"); } function kl(t) { return kn(t) && Ae in t && xn(t[Ae]); } function Rr(t) { return VM(t) || YM(t) || _l(t) || pf(t) || O0(t) || D0(t) || El(t) || Al(t) || hZ(t) || Il(t) || Cl(t) || Vi(t) || F0(t) || Lc(t) || Qc(t) || Ai(t) || ff(t) || mZ(t) || OE(t) || Tl(t) || Oo(t) || M0(t) || R0(t) || ei(t) || XM(t) || hf(t) || FE(t) || jc(t) || gZ(t) || $c(t) || mf(t) || sr(t) || yZ(t) || bZ(t) || vZ(t) || xZ(t) || kl(t); } function wZ(t) { return Pe(vi(t, [ja])); } function SZ(t) { return Pe({ ...t, [ja]: "Optional" }); } function _Z(t, e) { return e === !1 ? wZ(t) : SZ(t); } function Bs(t, e) { const n = e ?? !0; return Ai(t) ? IZ(t, n) : _Z(t, n); } function EZ(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = Bs(t[r], e); return n; } function AZ(t, e) { return EZ(t.properties, e); } function IZ(t, e) { const n = AZ(t, e); return wr(n); } function US(t, e = {}) { const n = t.every((i) => Oo(i)), r = Rr(e.unevaluatedProperties) ? { unevaluatedProperties: e.unevaluatedProperties } : {}; return Pe(e.unevaluatedProperties === !1 || Rr(e.unevaluatedProperties) || n ? { ...r, [Ae]: "Intersect", type: "object", allOf: t } : { ...r, [Ae]: "Intersect", allOf: t }, e); } function CZ(t) { return t.every((e) => Rs(e)); } function TZ(t) { return vi(t, [ja]); } function I8(t) { return t.map((e) => Rs(e) ? TZ(e) : e); } function kZ(t, e) { return CZ(t) ? Bs(US(I8(t), e)) : US(I8(t), e); } function ZM(t, e = {}) { if (t.length === 1) return Pe(t[0], e); if (t.length === 0) return cn(e); if (t.some((n) => Kt(n))) throw new Error("Cannot intersect transform types"); return kZ(t, e); } function Us(t, e) { if (t.length === 1) return Pe(t[0], e); if (t.length === 0) return cn(e); if (t.some((n) => Kt(n))) throw new Error("Cannot intersect transform types"); return US(t, e); } function LS(t, e) { return Pe({ [Ae]: "Union", anyOf: t }, e); } function NZ(t) { return t.some((e) => Rs(e)); } function C8(t) { return t.map((e) => Rs(e) ? PZ(e) : e); } function PZ(t) { return vi(t, [ja]); } function DZ(t, e) { return NZ(t) ? Bs(LS(C8(t), e)) : LS(C8(t), e); } function Nl(t, e) { return t.length === 1 ? Pe(t[0], e) : t.length === 0 ? cn(e) : DZ(t, e); } function Sr(t, e) { return t.length === 0 ? cn(e) : t.length === 1 ? Pe(t[0], e) : LS(t, e); } class T8 extends wn { } function OZ(t) { return t.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")"); } function ME(t, e, n) { return t[e] === n && t.charCodeAt(e - 1) !== 92; } function Ea(t, e) { return ME(t, e, "("); } function vp(t, e) { return ME(t, e, ")"); } function eR(t, e) { return ME(t, e, "|"); } function FZ(t) { if (!(Ea(t, 0) && vp(t, t.length - 1))) return !1; let e = 0; for (let n = 0; n < t.length; n++) if (Ea(t, n) && (e += 1), vp(t, n) && (e -= 1), e === 0 && n !== t.length - 1) return !1; return !0; } function MZ(t) { return t.slice(1, t.length - 1); } function RZ(t) { let e = 0; for (let n = 0; n < t.length; n++) if (Ea(t, n) && (e += 1), vp(t, n) && (e -= 1), eR(t, n) && e === 0) return !0; return !1; } function BZ(t) { for (let e = 0; e < t.length; e++) if (Ea(t, e)) return !0; return !1; } function UZ(t) { let [e, n] = [0, 0]; const r = []; for (let o = 0; o < t.length; o++) if (Ea(t, o) && (e += 1), vp(t, o) && (e -= 1), eR(t, o) && e === 0) { const a = t.slice(n, o); a.length > 0 && r.push(Lu(a)), n = o + 1; } const i = t.slice(n); return i.length > 0 && r.push(Lu(i)), r.length === 0 ? { type: "const", const: "" } : r.length === 1 ? r[0] : { type: "or", expr: r }; } function LZ(t) { function e(i, o) { if (!Ea(i, o)) throw new T8("TemplateLiteralParser: Index must point to open parens"); let a = 0; for (let s = o; s < i.length; s++) if (Ea(i, s) && (a += 1), vp(i, s) && (a -= 1), a === 0) return [o, s]; throw new T8("TemplateLiteralParser: Unclosed group parens in expression"); } function n(i, o) { for (let a = o; a < i.length; a++) if (Ea(i, a)) return [o, a]; return [o, i.length]; } const r = []; for (let i = 0; i < t.length; i++) if (Ea(t, i)) { const [o, a] = e(t, i), s = t.slice(o, a + 1); r.push(Lu(s)), i = a; } else { const [o, a] = n(t, i), s = t.slice(o, a); s.length > 0 && r.push(Lu(s)), i = a - 1; } return r.length === 0 ? { type: "const", const: "" } : r.length === 1 ? r[0] : { type: "and", expr: r }; } function Lu(t) { return FZ(t) ? Lu(MZ(t)) : RZ(t) ? UZ(t) : BZ(t) ? LZ(t) : { type: "const", const: OZ(t) }; } function RE(t) { return Lu(t.slice(1, t.length - 1)); } class QZ extends wn { } function jZ(t) { return t.type === "or" && t.expr.length === 2 && t.expr[0].type === "const" && t.expr[0].const === "0" && t.expr[1].type === "const" && t.expr[1].const === "[1-9][0-9]*"; } function $Z(t) { return t.type === "or" && t.expr.length === 2 && t.expr[0].type === "const" && t.expr[0].const === "true" && t.expr[1].type === "const" && t.expr[1].const === "false"; } function GZ(t) { return t.type === "const" && t.const === ".*"; } function xp(t) { return jZ(t) || GZ(t) ? !1 : $Z(t) ? !0 : t.type === "and" ? t.expr.every((e) => xp(e)) : t.type === "or" ? t.expr.every((e) => xp(e)) : t.type === "const" ? !0 : (() => { throw new QZ("Unknown expression type"); })(); } function tR(t) { const e = RE(t.pattern); return xp(e); } class qZ extends wn { } function* nR(t) { if (t.length === 1) return yield* t[0]; for (const e of t[0]) for (const n of nR(t.slice(1))) yield `${e}${n}`; } function* zZ(t) { return yield* nR(t.expr.map((e) => [...B0(e)])); } function* HZ(t) { for (const e of t.expr) yield* B0(e); } function* WZ(t) { return yield t.const; } function* B0(t) { return t.type === "and" ? yield* zZ(t) : t.type === "or" ? yield* HZ(t) : t.type === "const" ? yield* WZ(t) : (() => { throw new qZ("Unknown expression"); })(); } function BE(t) { const e = RE(t.pattern); return xp(e) ? [...B0(e)] : []; } function Cn(t, e) { return Pe({ [Ae]: "Literal", const: t, type: typeof t }, e); } function rR(t) { return Pe({ [Ae]: "Boolean", type: "boolean" }, t); } function UE(t) { return Pe({ [Ae]: "BigInt", type: "bigint" }, t); } function Gc(t) { return Pe({ [Ae]: "Number", type: "number" }, t); } function vc(t) { return Pe({ [Ae]: "String", type: "string" }, t); } function* KZ(t) { const e = t.trim().replace(/"|'/g, ""); return e === "boolean" ? yield rR() : e === "number" ? yield Gc() : e === "bigint" ? yield UE() : e === "string" ? yield vc() : yield (() => { const n = e.split("|").map((r) => Cn(r.trim())); return n.length === 0 ? cn() : n.length === 1 ? n[0] : Nl(n); })(); } function* VZ(t) { if (t[1] !== "{") { const e = Cn("$"), n = QS(t.slice(1)); return yield* [e, ...n]; } for (let e = 2; e < t.length; e++) if (t[e] === "}") { const n = KZ(t.slice(2, e)), r = QS(t.slice(e + 1)); return yield* [...n, ...r]; } yield Cn(t); } function* QS(t) { for (let e = 0; e < t.length; e++) if (t[e] === "$") { const n = Cn(t.slice(0, e)), r = VZ(t.slice(e)); return yield* [n, ...r]; } yield Cn(t); } function YZ(t) { return [...QS(t)]; } const JZ = "(true|false)", Dm = "(0|[1-9][0-9]*)", iR = "(.*)", XZ = "(?!.*)", Qu = `^${Dm}$`, ju = `^${iR}$`, ZZ = `^${XZ}$`; class eee extends wn { } function tee(t) { return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function oR(t, e) { return jc(t) ? t.pattern.slice(1, t.pattern.length - 1) : sr(t) ? `(${t.anyOf.map((n) => oR(n, e)).join("|")})` : Tl(t) ? `${e}${Dm}` : Cl(t) ? `${e}${Dm}` : O0(t) ? `${e}${Dm}` : hf(t) ? `${e}${iR}` : Lc(t) ? `${e}${tee(t.const.toString())}` : pf(t) ? `${e}${JZ}` : (() => { throw new eee(`Unexpected Kind '${t[Ae]}'`); })(); } function k8(t) { return `^${t.map((e) => oR(e, "")).join("")}$`; } function dg(t) { const n = BE(t).map((r) => Cn(r)); return Nl(n); } function aR(t, e) { const n = xn(t) ? k8(YZ(t)) : k8(t); return Pe({ [Ae]: "TemplateLiteral", type: "string", pattern: n }, e); } function nee(t) { return BE(t).map((n) => n.toString()); } function ree(t) { const e = []; for (const n of t) e.push(...Ls(n)); return e; } function iee(t) { return [t.toString()]; } function Ls(t) { return [...new Set(jc(t) ? nee(t) : sr(t) ? ree(t.anyOf) : Lc(t) ? iee(t.const) : Tl(t) ? ["[number]"] : Cl(t) ? ["[number]"] : [])]; } function oee(t, e, n) { const r = {}; for (const i of Object.getOwnPropertyNames(e)) r[i] = U0(t, Ls(e[i]), n); return r; } function aee(t, e, n) { return oee(t, e.properties, n); } function see(t, e, n) { const r = aee(t, e, n); return wr(r); } function sR(t, e) { return t.map((n) => cR(n, e)); } function cee(t) { return t.filter((e) => !ff(e)); } function uee(t, e) { return ZM(cee(sR(t, e))); } function lee(t) { return t.some((e) => ff(e)) ? [] : t; } function dee(t, e) { return Nl(lee(sR(t, e))); } function pee(t, e) { return e in t ? t[e] : e === "[number]" ? Nl(t) : cn(); } function fee(t, e) { return e === "[number]" ? t : cn(); } function hee(t, e) { return e in t ? t[e] : cn(); } function cR(t, e) { return Vi(t) ? uee(t.allOf, e) : sr(t) ? dee(t.anyOf, e) : $c(t) ? pee(t.items ?? [], e) : _l(t) ? fee(t.items, e) : Oo(t) ? hee(t.properties, e) : cn(); } function LE(t, e) { return e.map((n) => cR(t, n)); } function N8(t, e) { return Nl(LE(t, e)); } function U0(t, e, n) { if (ei(t) || ei(e)) { const r = "Index types using Ref parameters require both Type and Key to be of TSchema"; if (!Rr(t) || !Rr(e)) throw new wn(r); return jn("Index", [t, e]); } return Ai(e) ? see(t, e, n) : Qc(e) ? bee(t, e, n) : Pe(Rr(e) ? N8(t, Ls(e)) : N8(t, e), n); } function mee(t, e, n) { return { [e]: U0(t, [e], bi(n)) }; } function gee(t, e, n) { return e.reduce((r, i) => ({ ...r, ...mee(t, i, n) }), {}); } function yee(t, e, n) { return gee(t, e.keys, n); } function bee(t, e, n) { const r = yee(t, e, n); return wr(r); } function QE(t, e) { return Pe({ [Ae]: "Iterator", type: "Iterator", items: t }, e); } function vee(t) { return globalThis.Object.keys(t).filter((e) => !Rs(t[e])); } function xee(t, e) { const n = vee(t), r = n.length > 0 ? { [Ae]: "Object", type: "object", required: n, properties: t } : { [Ae]: "Object", type: "object", properties: t }; return Pe(r, e); } var or = xee; function uR(t, e) { return Pe({ [Ae]: "Promise", type: "Promise", item: t }, e); } function wee(t) { return Pe(vi(t, [lf])); } function See(t) { return Pe({ ...t, [lf]: "Readonly" }); } function _ee(t, e) { return e === !1 ? wee(t) : See(t); } function Qs(t, e) { const n = e ?? !0; return Ai(t) ? Iee(t, n) : _ee(t, n); } function Eee(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = Qs(t[r], e); return n; } function Aee(t, e) { return Eee(t.properties, e); } function Iee(t, e) { const n = Aee(t, e); return wr(n); } function Pl(t, e) { return Pe(t.length > 0 ? { [Ae]: "Tuple", type: "array", items: t, additionalItems: !1, minItems: t.length, maxItems: t.length } : { [Ae]: "Tuple", type: "array", minItems: t.length, maxItems: t.length }, e); } function Cee(t, e) { return t.includes(e); } function Tee(t) { return [...new Set(t)]; } function kee(t, e) { return t.filter((n) => e.includes(n)); } function Nee(t, e) { return t.reduce((n, r) => kee(n, r), e); } function Pee(t) { return t.length === 1 ? t[0] : t.length > 1 ? Nee(t.slice(1), t[0]) : []; } function Dee(t) { const e = []; for (const n of t) e.push(...n); return e; } function lR(t, e) { return t in e ? Oi(t, e[t]) : wr(e); } function Oee(t) { return { [t]: Cn(t) }; } function Fee(t) { const e = {}; for (const n of t) e[n] = Cn(n); return e; } function Mee(t, e) { return Cee(e, t) ? Oee(t) : Fee(e); } function Ree(t, e) { const n = Mee(t, e); return lR(t, n); } function cd(t, e) { return e.map((n) => Oi(t, n)); } function Bee(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(e)) n[r] = Oi(t, e[r]); return n; } function Oi(t, e) { const n = { ...e }; return ( // unevaluated modifier types Rs(e) ? Bs(Oi(t, vi(e, [ja]))) : DE(e) ? Qs(Oi(t, vi(e, [lf]))) : ( // unevaluated mapped types Ai(e) ? lR(t, e.properties) : Qc(e) ? Ree(t, e.keys) : ( // unevaluated types Al(e) ? PE(cd(t, e.parameters), Oi(t, e.returns), n) : Il(e) ? df(cd(t, e.parameters), Oi(t, e.returns), n) : D0(e) ? NE(Oi(t, e.items), n) : F0(e) ? QE(Oi(t, e.items), n) : Vi(e) ? Us(cd(t, e.allOf), n) : sr(e) ? Sr(cd(t, e.anyOf), n) : $c(e) ? Pl(cd(t, e.items ?? []), n) : Oo(e) ? or(Bee(t, e.properties), n) : _l(e) ? kE(Oi(t, e.items), n) : M0(e) ? uR(Oi(t, e.item), n) : e ) ) ); } function Uee(t, e) { const n = {}; for (const r of t) n[r] = Oi(r, e); return n; } function Lee(t, e, n) { const r = Rr(t) ? Ls(t) : t, i = e({ [Ae]: "MappedKey", keys: r }), o = Uee(r, i); return or(o, n); } function Dl(...t) { const [e, n] = typeof t[0] == "string" ? [t[0], t[1]] : [t[0].$id, t[1]]; if (typeof e != "string") throw new wn("Ref: $ref must be a string"); return Pe({ [Ae]: "Ref", $ref: e }, n); } function dR(t) { const e = []; for (const n of t) e.push(js(n)); return e; } function Qee(t) { const e = dR(t); return Dee(e); } function jee(t) { const e = dR(t); return Pee(e); } function $ee(t) { return t.map((e, n) => n.toString()); } function Gee(t) { return ["[number]"]; } function qee(t) { return globalThis.Object.getOwnPropertyNames(t); } function zee(t) { return jS ? globalThis.Object.getOwnPropertyNames(t).map((n) => n[0] === "^" && n[n.length - 1] === "$" ? n.slice(1, n.length - 1) : n) : []; } function js(t) { return Vi(t) ? Qee(t.allOf) : sr(t) ? jee(t.anyOf) : $c(t) ? $ee(t.items ?? []) : _l(t) ? Gee(t.items) : Oo(t) ? qee(t.properties) : R0(t) ? zee(t.patternProperties) : []; } let jS = !1; function $u(t) { jS = !0; const e = js(t); return jS = !1, `^(${e.map((r) => `(${r})`).join("|")})$`; } function Hee(t, e) { return jn("KeyOf", [jn(t, e)]); } function Wee(t) { return jn("KeyOf", [Dl(t)]); } function Kee(t, e) { const n = js(t), r = Vee(n), i = Nl(r); return Pe(i, e); } function Vee(t) { return t.map((e) => e === "[number]" ? Gc() : Cn(e)); } function jE(t, e) { return El(t) ? Hee(t.target, t.parameters) : ei(t) ? Wee(t.$ref) : Ai(t) ? Xee(t, e) : Kee(t, e); } function Yee(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = jE(t[r], bi(e)); return n; } function Jee(t, e) { return Yee(t.properties, e); } function Xee(t, e) { const n = Jee(t, e); return wr(n); } function pR(t) { const e = js(t), n = LE(t, e); return e.map((r, i) => [e[i], n[i]]); } function Zee(t) { return t.allOf.every((e) => Ol(e)); } function ete(t) { return t.anyOf.some((e) => Ol(e)); } function tte(t) { return !Ol(t.not); } function Ol(t) { return t[Ae] === "Intersect" ? Zee(t) : t[Ae] === "Union" ? ete(t) : t[Ae] === "Not" ? tte(t) : t[Ae] === "Undefined"; } function nte(t) { switch (t.errorType) { case le.ArrayContains: return "Expected array to contain at least one matching value"; case le.ArrayMaxContains: return `Expected array to contain no more than ${t.schema.maxContains} matching values`; case le.ArrayMinContains: return `Expected array to contain at least ${t.schema.minContains} matching values`; case le.ArrayMaxItems: return `Expected array length to be less or equal to ${t.schema.maxItems}`; case le.ArrayMinItems: return `Expected array length to be greater or equal to ${t.schema.minItems}`; case le.ArrayUniqueItems: return "Expected array elements to be unique"; case le.Array: return "Expected array"; case le.AsyncIterator: return "Expected AsyncIterator"; case le.BigIntExclusiveMaximum: return `Expected bigint to be less than ${t.schema.exclusiveMaximum}`; case le.BigIntExclusiveMinimum: return `Expected bigint to be greater than ${t.schema.exclusiveMinimum}`; case le.BigIntMaximum: return `Expected bigint to be less or equal to ${t.schema.maximum}`; case le.BigIntMinimum: return `Expected bigint to be greater or equal to ${t.schema.minimum}`; case le.BigIntMultipleOf: return `Expected bigint to be a multiple of ${t.schema.multipleOf}`; case le.BigInt: return "Expected bigint"; case le.Boolean: return "Expected boolean"; case le.DateExclusiveMinimumTimestamp: return `Expected Date timestamp to be greater than ${t.schema.exclusiveMinimumTimestamp}`; case le.DateExclusiveMaximumTimestamp: return `Expected Date timestamp to be less than ${t.schema.exclusiveMaximumTimestamp}`; case le.DateMinimumTimestamp: return `Expected Date timestamp to be greater or equal to ${t.schema.minimumTimestamp}`; case le.DateMaximumTimestamp: return `Expected Date timestamp to be less or equal to ${t.schema.maximumTimestamp}`; case le.DateMultipleOfTimestamp: return `Expected Date timestamp to be a multiple of ${t.schema.multipleOfTimestamp}`; case le.Date: return "Expected Date"; case le.Function: return "Expected function"; case le.IntegerExclusiveMaximum: return `Expected integer to be less than ${t.schema.exclusiveMaximum}`; case le.IntegerExclusiveMinimum: return `Expected integer to be greater than ${t.schema.exclusiveMinimum}`; case le.IntegerMaximum: return `Expected integer to be less or equal to ${t.schema.maximum}`; case le.IntegerMinimum: return `Expected integer to be greater or equal to ${t.schema.minimum}`; case le.IntegerMultipleOf: return `Expected integer to be a multiple of ${t.schema.multipleOf}`; case le.Integer: return "Expected integer"; case le.IntersectUnevaluatedProperties: return "Unexpected property"; case le.Intersect: return "Expected all values to match"; case le.Iterator: return "Expected Iterator"; case le.Literal: return `Expected ${typeof t.schema.const == "string" ? `'${t.schema.const}'` : t.schema.const}`; case le.Never: return "Never"; case le.Not: return "Value should not match"; case le.Null: return "Expected null"; case le.NumberExclusiveMaximum: return `Expected number to be less than ${t.schema.exclusiveMaximum}`; case le.NumberExclusiveMinimum: return `Expected number to be greater than ${t.schema.exclusiveMinimum}`; case le.NumberMaximum: return `Expected number to be less or equal to ${t.schema.maximum}`; case le.NumberMinimum: return `Expected number to be greater or equal to ${t.schema.minimum}`; case le.NumberMultipleOf: return `Expected number to be a multiple of ${t.schema.multipleOf}`; case le.Number: return "Expected number"; case le.Object: return "Expected object"; case le.ObjectAdditionalProperties: return "Unexpected property"; case le.ObjectMaxProperties: return `Expected object to have no more than ${t.schema.maxProperties} properties`; case le.ObjectMinProperties: return `Expected object to have at least ${t.schema.minProperties} properties`; case le.ObjectRequiredProperty: return "Expected required property"; case le.Promise: return "Expected Promise"; case le.RegExp: return "Expected string to match regular expression"; case le.StringFormatUnknown: return `Unknown format '${t.schema.format}'`; case le.StringFormat: return `Expected string to match '${t.schema.format}' format`; case le.StringMaxLength: return `Expected string length less or equal to ${t.schema.maxLength}`; case le.StringMinLength: return `Expected string length greater or equal to ${t.schema.minLength}`; case le.StringPattern: return `Expected string to match '${t.schema.pattern}'`; case le.String: return "Expected string"; case le.Symbol: return "Expected symbol"; case le.TupleLength: return `Expected tuple to have ${t.schema.maxItems || 0} elements`; case le.Tuple: return "Expected tuple"; case le.Uint8ArrayMaxByteLength: return `Expected byte length less or equal to ${t.schema.maxByteLength}`; case le.Uint8ArrayMinByteLength: return `Expected byte length greater or equal to ${t.schema.minByteLength}`; case le.Uint8Array: return "Expected Uint8Array"; case le.Undefined: return "Expected undefined"; case le.Union: return "Expected union value"; case le.Void: return "Expected void"; case le.Kind: return `Expected kind '${t.schema[Ae]}'`; default: return "Unknown error type"; } } let rte = nte; function ite() { return rte; } class ote extends wn { constructor(e) { super(`Unable to dereference schema with $id '${e.$ref}'`), this.schema = e; } } function ate(t, e) { const n = e.find((r) => r.$id === t.$ref); if (n === void 0) throw new ote(t); return nn(n, e); } function $a(t, e) { return !qt(t.$id) || e.some((n) => n.$id === t.$id) || e.push(t), e; } function nn(t, e) { return t[Ae] === "This" || t[Ae] === "Ref" ? ate(t, e) : t; } class ste extends wn { constructor(e) { super("Unable to hash value"), this.value = e; } } var xi; (function(t) { t[t.Undefined = 0] = "Undefined", t[t.Null = 1] = "Null", t[t.Boolean = 2] = "Boolean", t[t.Number = 3] = "Number", t[t.String = 4] = "String", t[t.Object = 5] = "Object", t[t.Array = 6] = "Array", t[t.Date = 7] = "Date", t[t.Uint8Array = 8] = "Uint8Array", t[t.Symbol = 9] = "Symbol", t[t.BigInt = 10] = "BigInt"; })(xi || (xi = {})); let _u = BigInt("14695981039346656037"); const [cte, ute] = [BigInt("1099511628211"), BigInt( "18446744073709551616" /* 2 ^ 64 */ )], lte = Array.from({ length: 256 }).map((t, e) => BigInt(e)), fR = new Float64Array(1), hR = new DataView(fR.buffer), mR = new Uint8Array(fR.buffer); function* dte(t) { const e = t === 0 ? 1 : Math.ceil(Math.floor(Math.log2(t) + 1) / 8); for (let n = 0; n < e; n++) yield t >> 8 * (e - 1 - n) & 255; } function pte(t) { kr(xi.Array); for (const e of t) Gu(e); } function fte(t) { kr(xi.Boolean), kr(t ? 1 : 0); } function hte(t) { kr(xi.BigInt), hR.setBigInt64(0, t); for (const e of mR) kr(e); } function mte(t) { kr(xi.Date), Gu(t.getTime()); } function gte(t) { kr(xi.Null); } function yte(t) { kr(xi.Number), hR.setFloat64(0, t); for (const e of mR) kr(e); } function bte(t) { kr(xi.Object); for (const e of globalThis.Object.getOwnPropertyNames(t).sort()) Gu(e), Gu(t[e]); } function vte(t) { kr(xi.String); for (let e = 0; e < t.length; e++) for (const n of dte(t.charCodeAt(e))) kr(n); } function xte(t) { kr(xi.Symbol), Gu(t.description); } function wte(t) { kr(xi.Uint8Array); for (let e = 0; e < t.length; e++) kr(t[e]); } function Ste(t) { return kr(xi.Undefined); } function Gu(t) { if (zt(t)) return pte(t); if (Sl(t)) return fte(t); if (Ui(t)) return hte(t); if (wl(t)) return mte(t); if (af(t)) return gte(); if (et(t)) return yte(t); if (Mt(t)) return bte(t); if (qt(t)) return vte(t); if (sf(t)) return xte(t); if (_E(t)) return wte(t); if (ii(t)) return Ste(); throw new ste(t); } function kr(t) { _u = _u ^ lte[t], _u = _u * cte % ute; } function $E(t) { return _u = BigInt("14695981039346656037"), Gu(t), _u; } function wp(t) { return Pe({ [Ae]: "Any" }, t); } function L0(t) { return Pe({ [Ae]: "Unknown" }, t); } const _te = [ "Argument", "Any", "Array", "AsyncIterator", "BigInt", "Boolean", "Computed", "Constructor", "Date", "Enum", "Function", "Integer", "Intersect", "Iterator", "Literal", "MappedKey", "MappedResult", "Not", "Null", "Number", "Object", "Promise", "Record", "Ref", "RegExp", "String", "Symbol", "TemplateLiteral", "This", "Tuple", "Undefined", "Union", "Uint8Array", "Unknown", "Void" ]; function gR(t) { try { return new RegExp(t), !0; } catch { return !1; } } function GE(t) { if (!xn(t)) return !1; for (let e = 0; e < t.length; e++) { const n = t.charCodeAt(e); if (n >= 7 && n <= 13 || n === 27 || n === 127) return !1; } return !0; } function yR(t) { return qE(t) || sn(t); } function ud(t) { return _n(t) || WM(t); } function $t(t) { return _n(t) || ea(t); } function qE(t) { return _n(t) || cf(t); } function Bt(t) { return _n(t) || xn(t); } function Ete(t) { return _n(t) || xn(t) && GE(t) && gR(t); } function Ate(t) { return _n(t) || xn(t) && GE(t); } function bR(t) { return _n(t) || sn(t); } function pg(t) { return kn(t) && t[ja] === "Optional"; } function bo(t) { return At(t, "Any") && Bt(t.$id); } function Ite(t) { return At(t, "Argument") && ea(t.index); } function qc(t) { return At(t, "Array") && t.type === "array" && Bt(t.$id) && sn(t.items) && $t(t.minItems) && $t(t.maxItems) && qE(t.uniqueItems) && bR(t.contains) && $t(t.minContains) && $t(t.maxContains); } function zE(t) { return At(t, "AsyncIterator") && t.type === "AsyncIterator" && Bt(t.$id) && sn(t.items); } function Q0(t) { return At(t, "BigInt") && t.type === "bigint" && Bt(t.$id) && ud(t.exclusiveMaximum) && ud(t.exclusiveMinimum) && ud(t.maximum) && ud(t.minimum) && ud(t.multipleOf); } function zc(t) { return At(t, "Boolean") && t.type === "boolean" && Bt(t.$id); } function Cte(t) { return At(t, "Computed") && xn(t.target) && oi(t.parameters) && t.parameters.every((e) => sn(e)); } function j0(t) { return At(t, "Constructor") && t.type === "Constructor" && Bt(t.$id) && oi(t.parameters) && t.parameters.every((e) => sn(e)) && sn(t.returns); } function $0(t) { return At(t, "Date") && t.type === "Date" && Bt(t.$id) && $t(t.exclusiveMaximumTimestamp) && $t(t.exclusiveMinimumTimestamp) && $t(t.maximumTimestamp) && $t(t.minimumTimestamp) && $t(t.multipleOfTimestamp); } function G0(t) { return At(t, "Function") && t.type === "Function" && Bt(t.$id) && oi(t.parameters) && t.parameters.every((e) => sn(e)) && sn(t.returns); } function Ga(t) { return At(t, "Integer") && t.type === "integer" && Bt(t.$id) && $t(t.exclusiveMaximum) && $t(t.exclusiveMinimum) && $t(t.maximum) && $t(t.minimum) && $t(t.multipleOf); } function vR(t) { return kn(t) && Object.entries(t).every(([e, n]) => GE(e) && sn(n)); } function Hc(t) { return At(t, "Intersect") && !(xn(t.type) && t.type !== "object") && oi(t.allOf) && t.allOf.every((e) => sn(e) && !Ote(e)) && Bt(t.type) && (qE(t.unevaluatedProperties) || bR(t.unevaluatedProperties)) && Bt(t.$id); } function HE(t) { return At(t, "Iterator") && t.type === "Iterator" && Bt(t.$id) && sn(t.items); } function At(t, e) { return kn(t) && Ae in t && t[Ae] === e; } function xR(t) { return $s(t) && xn(t.const); } function wR(t) { return $s(t) && ea(t.const); } function SR(t) { return $s(t) && cf(t.const); } function $s(t) { return At(t, "Literal") && Bt(t.$id) && Tte(t.const); } function Tte(t) { return cf(t) || ea(t) || xn(t); } function kte(t) { return At(t, "MappedKey") && oi(t.keys) && t.keys.every((e) => ea(e) || xn(e)); } function Nte(t) { return At(t, "MappedResult") && vR(t.properties); } function Gs(t) { return At(t, "Never") && kn(t.not) && Object.getOwnPropertyNames(t.not).length === 0; } function qu(t) { return At(t, "Not") && sn(t.not); } function WE(t) { return At(t, "Null") && t.type === "null" && Bt(t.$id); } function Yr(t) { return At(t, "Number") && t.type === "number" && Bt(t.$id) && $t(t.exclusiveMaximum) && $t(t.exclusiveMinimum) && $t(t.maximum) && $t(t.minimum) && $t(t.multipleOf); } function un(t) { return At(t, "Object") && t.type === "object" && Bt(t.$id) && vR(t.properties) && yR(t.additionalProperties) && $t(t.minProperties) && $t(t.maxProperties); } function KE(t) { return At(t, "Promise") && t.type === "Promise" && Bt(t.$id) && sn(t.item); } function yr(t) { return At(t, "Record") && t.type === "object" && Bt(t.$id) && yR(t.additionalProperties) && kn(t.patternProperties) && ((e) => { const n = Object.getOwnPropertyNames(e.patternProperties); return n.length === 1 && gR(n[0]) && kn(e.patternProperties) && sn(e.patternProperties[n[0]]); })(t); } function Pte(t) { return At(t, "Ref") && Bt(t.$id) && xn(t.$ref); } function Sp(t) { return At(t, "RegExp") && Bt(t.$id) && xn(t.source) && xn(t.flags) && $t(t.maxLength) && $t(t.minLength); } function vo(t) { return At(t, "String") && t.type === "string" && Bt(t.$id) && $t(t.minLength) && $t(t.maxLength) && Ete(t.pattern) && Ate(t.format); } function _p(t) { return At(t, "Symbol") && t.type === "symbol" && Bt(t.$id); } function Ep(t) { return At(t, "TemplateLiteral") && t.type === "string" && xn(t.pattern) && t.pattern[0] === "^" && t.pattern[t.pattern.length - 1] === "$"; } function Dte(t) { return At(t, "This") && Bt(t.$id) && xn(t.$ref); } function Ote(t) { return kn(t) && Vr in t; } function q0(t) { return At(t, "Tuple") && t.type === "array" && Bt(t.$id) && ea(t.minItems) && ea(t.maxItems) && t.minItems === t.maxItems && // empty (_n(t.items) && _n(t.additionalItems) && t.minItems === 0 || oi(t.items) && t.items.every((e) => sn(e))); } function xc(t) { return At(t, "Undefined") && t.type === "undefined" && Bt(t.$id); } function Pa(t) { return At(t, "Union") && Bt(t.$id) && kn(t) && oi(t.anyOf) && t.anyOf.every((e) => sn(e)); } function gf(t) { return At(t, "Uint8Array") && t.type === "Uint8Array" && Bt(t.$id) && $t(t.minByteLength) && $t(t.maxByteLength); } function xo(t) { return At(t, "Unknown") && Bt(t.$id); } function Fte(t) { return At(t, "Unsafe"); } function z0(t) { return At(t, "Void") && t.type === "void" && Bt(t.$id); } function Mte(t) { return kn(t) && Ae in t && xn(t[Ae]) && !_te.includes(t[Ae]); } function sn(t) { return kn(t) && (bo(t) || Ite(t) || qc(t) || zc(t) || Q0(t) || zE(t) || Cte(t) || j0(t) || $0(t) || G0(t) || Ga(t) || Hc(t) || HE(t) || $s(t) || kte(t) || Nte(t) || Gs(t) || qu(t) || WE(t) || Yr(t) || un(t) || KE(t) || yr(t) || Pte(t) || Sp(t) || vo(t) || _p(t) || Ep(t) || Dte(t) || q0(t) || xc(t) || Pa(t) || gf(t) || xo(t) || Fte(t) || z0(t) || Mte(t)); } class Rte extends wn { } var pe; (function(t) { t[t.Union = 0] = "Union", t[t.True = 1] = "True", t[t.False = 2] = "False"; })(pe || (pe = {})); function qi(t) { return t === pe.False ? t : pe.True; } function Fl(t) { throw new Rte(t); } function Dn(t) { return Gs(t) || Hc(t) || Pa(t) || xo(t) || bo(t); } function On(t, e) { return Gs(e) ? AR() : Hc(e) ? H0(t, e) : Pa(e) ? YE(t, e) : xo(e) ? kR() : bo(e) ? VE() : Fl("StructuralRight"); } function VE(t, e) { return pe.True; } function Bte(t, e) { return Hc(e) ? H0(t, e) : Pa(e) && e.anyOf.some((n) => bo(n) || xo(n)) ? pe.True : Pa(e) ? pe.Union : xo(e) || bo(e) ? pe.True : pe.Union; } function Ute(t, e) { return xo(t) ? pe.False : bo(t) ? pe.Union : Gs(t) ? pe.True : pe.False; } function Lte(t, e) { return un(e) && W0(e) ? pe.True : Dn(e) ? On(t, e) : qc(e) ? qi(Rt(t.items, e.items)) : pe.False; } function Qte(t, e) { return Dn(e) ? On(t, e) : zE(e) ? qi(Rt(t.items, e.items)) : pe.False; } function jte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : Q0(e) ? pe.True : pe.False; } function _R(t, e) { return SR(t) || zc(t) ? pe.True : pe.False; } function $te(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : zc(e) ? pe.True : pe.False; } function Gte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : j0(e) ? t.parameters.length > e.parameters.length ? pe.False : t.parameters.every((n, r) => qi(Rt(e.parameters[r], n)) === pe.True) ? qi(Rt(t.returns, e.returns)) : pe.False : pe.False; } function qte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : $0(e) ? pe.True : pe.False; } function zte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : G0(e) ? t.parameters.length > e.parameters.length ? pe.False : t.parameters.every((n, r) => qi(Rt(e.parameters[r], n)) === pe.True) ? qi(Rt(t.returns, e.returns)) : pe.False : pe.False; } function ER(t, e) { return $s(t) && ea(t.const) || Yr(t) || Ga(t) ? pe.True : pe.False; } function Hte(t, e) { return Ga(e) || Yr(e) ? pe.True : Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : pe.False; } function H0(t, e) { return e.allOf.every((n) => Rt(t, n) === pe.True) ? pe.True : pe.False; } function Wte(t, e) { return t.allOf.some((n) => Rt(n, e) === pe.True) ? pe.True : pe.False; } function Kte(t, e) { return Dn(e) ? On(t, e) : HE(e) ? qi(Rt(t.items, e.items)) : pe.False; } function Vte(t, e) { return $s(e) && e.const === t.const ? pe.True : Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : vo(e) ? TR(t) : Yr(e) ? IR(t) : Ga(e) ? ER(t) : zc(e) ? _R(t) : pe.False; } function AR(t, e) { return pe.False; } function Yte(t, e) { return pe.True; } function P8(t) { let [e, n] = [t, 0]; for (; qu(e); ) e = e.not, n += 1; return n % 2 === 0 ? e : L0(); } function Jte(t, e) { return qu(t) ? Rt(P8(t), e) : qu(e) ? Rt(t, P8(e)) : Fl("Invalid fallthrough for Not"); } function Xte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : WE(e) ? pe.True : pe.False; } function IR(t, e) { return wR(t) || Yr(t) || Ga(t) ? pe.True : pe.False; } function Zte(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : Ga(e) || Yr(e) ? pe.True : pe.False; } function ti(t, e) { return Object.getOwnPropertyNames(t.properties).length === e; } function D8(t) { return W0(t); } function O8(t) { return ti(t, 0) || ti(t, 1) && "description" in t.properties && Pa(t.properties.description) && t.properties.description.anyOf.length === 2 && (vo(t.properties.description.anyOf[0]) && xc(t.properties.description.anyOf[1]) || vo(t.properties.description.anyOf[1]) && xc(t.properties.description.anyOf[0])); } function zx(t) { return ti(t, 0); } function F8(t) { return ti(t, 0); } function ene(t) { return ti(t, 0); } function tne(t) { return ti(t, 0); } function nne(t) { return W0(t); } function rne(t) { const e = Gc(); return ti(t, 0) || ti(t, 1) && "length" in t.properties && qi(Rt(t.properties.length, e)) === pe.True; } function ine(t) { return ti(t, 0); } function W0(t) { const e = Gc(); return ti(t, 0) || ti(t, 1) && "length" in t.properties && qi(Rt(t.properties.length, e)) === pe.True; } function one(t) { const e = df([wp()], wp()); return ti(t, 0) || ti(t, 1) && "then" in t.properties && qi(Rt(t.properties.then, e)) === pe.True; } function CR(t, e) { return Rt(t, e) === pe.False || pg(t) && !pg(e) ? pe.False : pe.True; } function Pr(t, e) { return xo(t) ? pe.False : bo(t) ? pe.Union : Gs(t) || xR(t) && D8(e) || wR(t) && zx(e) || SR(t) && F8(e) || _p(t) && O8(e) || Q0(t) && ene(e) || vo(t) && D8(e) || _p(t) && O8(e) || Yr(t) && zx(e) || Ga(t) && zx(e) || zc(t) && F8(e) || gf(t) && nne(e) || $0(t) && tne(e) || j0(t) && ine(e) || G0(t) && rne(e) ? pe.True : yr(t) && vo($S(t)) ? e[P0] === "Record" ? pe.True : pe.False : yr(t) && Yr($S(t)) ? ti(e, 0) ? pe.True : pe.False : pe.False; } function ane(t, e) { return Dn(e) ? On(t, e) : yr(e) ? Yi(t, e) : un(e) ? (() => { for (const n of Object.getOwnPropertyNames(e.properties)) { if (!(n in t.properties) && !pg(e.properties[n])) return pe.False; if (pg(e.properties[n])) return pe.True; if (CR(t.properties[n], e.properties[n]) === pe.False) return pe.False; } return pe.True; })() : pe.False; } function sne(t, e) { return Dn(e) ? On(t, e) : un(e) && one(e) ? pe.True : KE(e) ? qi(Rt(t.item, e.item)) : pe.False; } function $S(t) { return Qu in t.patternProperties ? Gc() : ju in t.patternProperties ? vc() : Fl("Unknown record key pattern"); } function GS(t) { return Qu in t.patternProperties ? t.patternProperties[Qu] : ju in t.patternProperties ? t.patternProperties[ju] : Fl("Unable to get record value schema"); } function Yi(t, e) { const [n, r] = [$S(e), GS(e)]; return xR(t) && Yr(n) && qi(Rt(t, r)) === pe.True ? pe.True : gf(t) && Yr(n) || vo(t) && Yr(n) || qc(t) && Yr(n) ? Rt(t, r) : un(t) ? (() => { for (const i of Object.getOwnPropertyNames(t.properties)) if (CR(r, t.properties[i]) === pe.False) return pe.False; return pe.True; })() : pe.False; } function cne(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Rt(GS(t), GS(e)) : pe.False; } function une(t, e) { const n = Sp(t) ? vc() : t, r = Sp(e) ? vc() : e; return Rt(n, r); } function TR(t, e) { return $s(t) && xn(t.const) || vo(t) ? pe.True : pe.False; } function lne(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : vo(e) ? pe.True : pe.False; } function dne(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : _p(e) ? pe.True : pe.False; } function pne(t, e) { return Ep(t) ? Rt(dg(t), e) : Ep(e) ? Rt(t, dg(e)) : Fl("Invalid fallthrough for TemplateLiteral"); } function fne(t, e) { return qc(e) && t.items !== void 0 && t.items.every((n) => Rt(n, e.items) === pe.True); } function hne(t, e) { return Gs(t) ? pe.True : xo(t) ? pe.False : bo(t) ? pe.Union : pe.False; } function mne(t, e) { return Dn(e) ? On(t, e) : un(e) && W0(e) || qc(e) && fne(t, e) ? pe.True : q0(e) ? _n(t.items) && !_n(e.items) || !_n(t.items) && _n(e.items) ? pe.False : _n(t.items) && !_n(e.items) || t.items.every((n, r) => Rt(n, e.items[r]) === pe.True) ? pe.True : pe.False : pe.False; } function gne(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : gf(e) ? pe.True : pe.False; } function yne(t, e) { return Dn(e) ? On(t, e) : un(e) ? Pr(t, e) : yr(e) ? Yi(t, e) : z0(e) ? xne(t) : xc(e) ? pe.True : pe.False; } function YE(t, e) { return e.anyOf.some((n) => Rt(t, n) === pe.True) ? pe.True : pe.False; } function bne(t, e) { return t.anyOf.every((n) => Rt(n, e) === pe.True) ? pe.True : pe.False; } function kR(t, e) { return pe.True; } function vne(t, e) { return Gs(e) ? AR() : Hc(e) ? H0(t, e) : Pa(e) ? YE(t, e) : bo(e) ? VE() : vo(e) ? TR(t) : Yr(e) ? IR(t) : Ga(e) ? ER(t) : zc(e) ? _R(t) : qc(e) ? Ute(t) : q0(e) ? hne(t) : un(e) ? Pr(t, e) : xo(e) ? pe.True : pe.False; } function xne(t, e) { return xc(t) || xc(t) ? pe.True : pe.False; } function wne(t, e) { return Hc(e) ? H0(t, e) : Pa(e) ? YE(t, e) : xo(e) ? kR() : bo(e) ? VE() : un(e) ? Pr(t, e) : z0(e) ? pe.True : pe.False; } function Rt(t, e) { return ( // resolvable Ep(t) || Ep(e) ? pne(t, e) : Sp(t) || Sp(e) ? une(t, e) : qu(t) || qu(e) ? Jte(t, e) : ( // standard bo(t) ? Bte(t, e) : qc(t) ? Lte(t, e) : Q0(t) ? jte(t, e) : zc(t) ? $te(t, e) : zE(t) ? Qte(t, e) : j0(t) ? Gte(t, e) : $0(t) ? qte(t, e) : G0(t) ? zte(t, e) : Ga(t) ? Hte(t, e) : Hc(t) ? Wte(t, e) : HE(t) ? Kte(t, e) : $s(t) ? Vte(t, e) : Gs(t) ? Yte() : WE(t) ? Xte(t, e) : Yr(t) ? Zte(t, e) : un(t) ? ane(t, e) : yr(t) ? cne(t, e) : vo(t) ? lne(t, e) : _p(t) ? dne(t, e) : q0(t) ? mne(t, e) : KE(t) ? sne(t, e) : gf(t) ? gne(t, e) : xc(t) ? yne(t, e) : Pa(t) ? bne(t, e) : xo(t) ? vne(t, e) : z0(t) ? wne(t, e) : Fl(`Unknown left type operand '${t[Ae]}'`) ) ); } function yf(t, e) { return Rt(t, e); } function Sne(t, e, n, r, i) { const o = {}; for (const a of globalThis.Object.getOwnPropertyNames(t)) o[a] = JE(t[a], e, n, r, bi(i)); return o; } function _ne(t, e, n, r, i) { return Sne(t.properties, e, n, r, i); } function Ene(t, e, n, r, i) { const o = _ne(t, e, n, r, i); return wr(o); } function Ane(t, e, n, r) { const i = yf(t, e); return i === pe.Union ? Sr([n, r]) : i === pe.True ? n : r; } function JE(t, e, n, r, i) { return Ai(t) ? Ene(t, e, n, r, i) : Qc(t) ? Pe(kne(t, e, n, r, i)) : Pe(Ane(t, e, n, r), i); } function Ine(t, e, n, r, i) { return { [t]: JE(Cn(t), e, n, r, bi(i)) }; } function Cne(t, e, n, r, i) { return t.reduce((o, a) => ({ ...o, ...Ine(a, e, n, r, i) }), {}); } function Tne(t, e, n, r, i) { return Cne(t.keys, e, n, r, i); } function kne(t, e, n, r, i) { const o = Tne(t, e, n, r, i); return wr(o); } class Nne extends wn { constructor(e) { super("Unknown type"), this.schema = e; } } function Pne(t) { return t[Ae] === "Any" || t[Ae] === "Unknown"; } function wt(t) { return t !== void 0; } function Dne(t, e, n) { return !0; } function One(t, e, n) { return !0; } function Fne(t, e, n) { if (!zt(n) || wt(t.minItems) && !(n.length >= t.minItems) || wt(t.maxItems) && !(n.length <= t.maxItems)) return !1; for (const o of n) if (!nr(t.items, e, o)) return !1; if (t.uniqueItems === !0 && !(function() { const o = /* @__PURE__ */ new Set(); for (const a of n) { const s = $E(a); if (o.has(s)) return !1; o.add(s); } return !0; })()) return !1; if (!(wt(t.contains) || et(t.minContains) || et(t.maxContains))) return !0; const r = wt(t.contains) ? t.contains : cn(), i = n.reduce((o, a) => nr(r, e, a) ? o + 1 : o, 0); return !(i === 0 || et(t.minContains) && i < t.minContains || et(t.maxContains) && i > t.maxContains); } function Mne(t, e, n) { return jM(n); } function Rne(t, e, n) { return !(!Ui(n) || wt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || wt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || wt(t.maximum) && !(n <= t.maximum) || wt(t.minimum) && !(n >= t.minimum) || wt(t.multipleOf) && n % t.multipleOf !== BigInt(0)); } function Bne(t, e, n) { return Sl(n); } function Une(t, e, n) { return nr(t.returns, e, n.prototype); } function Lne(t, e, n) { return !(!wl(n) || wt(t.exclusiveMaximumTimestamp) && !(n.getTime() < t.exclusiveMaximumTimestamp) || wt(t.exclusiveMinimumTimestamp) && !(n.getTime() > t.exclusiveMinimumTimestamp) || wt(t.maximumTimestamp) && !(n.getTime() <= t.maximumTimestamp) || wt(t.minimumTimestamp) && !(n.getTime() >= t.minimumTimestamp) || wt(t.multipleOfTimestamp) && n.getTime() % t.multipleOfTimestamp !== 0); } function Qne(t, e, n) { return N0(n); } function jne(t, e, n) { const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref]; return nr(i, [...e, ...r], n); } function $ne(t, e, n) { return !(!qM(n) || wt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || wt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || wt(t.maximum) && !(n <= t.maximum) || wt(t.minimum) && !(n >= t.minimum) || wt(t.multipleOf) && n % t.multipleOf !== 0); } function Gne(t, e, n) { const r = t.allOf.every((i) => nr(i, e, n)); if (t.unevaluatedProperties === !1) { const i = new RegExp($u(t)), o = Object.getOwnPropertyNames(n).every((a) => i.test(a)); return r && o; } else if (Rr(t.unevaluatedProperties)) { const i = new RegExp($u(t)), o = Object.getOwnPropertyNames(n).every((a) => i.test(a) || nr(t.unevaluatedProperties, e, n[a])); return r && o; } else return r; } function qne(t, e, n) { return $M(n); } function zne(t, e, n) { return n === t.const; } function Hne(t, e, n) { return !1; } function Wne(t, e, n) { return !nr(t.not, e, n); } function Kne(t, e, n) { return af(n); } function Vne(t, e, n) { return !(!In.IsNumberLike(n) || wt(t.exclusiveMaximum) && !(n < t.exclusiveMaximum) || wt(t.exclusiveMinimum) && !(n > t.exclusiveMinimum) || wt(t.minimum) && !(n >= t.minimum) || wt(t.maximum) && !(n <= t.maximum) || wt(t.multipleOf) && n % t.multipleOf !== 0); } function Yne(t, e, n) { if (!In.IsObjectLike(n) || wt(t.minProperties) && !(Object.getOwnPropertyNames(n).length >= t.minProperties) || wt(t.maxProperties) && !(Object.getOwnPropertyNames(n).length <= t.maxProperties)) return !1; const r = Object.getOwnPropertyNames(t.properties); for (const i of r) { const o = t.properties[i]; if (t.required && t.required.includes(i)) { if (!nr(o, e, n[i]) || (Ol(o) || Pne(o)) && !(i in n)) return !1; } else if (In.IsExactOptionalProperty(n, i) && !nr(o, e, n[i])) return !1; } if (t.additionalProperties === !1) { const i = Object.getOwnPropertyNames(n); return t.required && t.required.length === r.length && i.length === r.length ? !0 : i.every((o) => r.includes(o)); } else return typeof t.additionalProperties == "object" ? Object.getOwnPropertyNames(n).every((o) => r.includes(o) || nr(t.additionalProperties, e, n[o])) : !0; } function Jne(t, e, n) { return GM(n); } function Xne(t, e, n) { if (!In.IsRecordLike(n) || wt(t.minProperties) && !(Object.getOwnPropertyNames(n).length >= t.minProperties) || wt(t.maxProperties) && !(Object.getOwnPropertyNames(n).length <= t.maxProperties)) return !1; const [r, i] = Object.entries(t.patternProperties)[0], o = new RegExp(r), a = Object.entries(n).every(([u, d]) => o.test(u) ? nr(i, e, d) : !0), s = typeof t.additionalProperties == "object" ? Object.entries(n).every(([u, d]) => o.test(u) ? !0 : nr(t.additionalProperties, e, d)) : !0, c = t.additionalProperties === !1 ? Object.getOwnPropertyNames(n).every((u) => o.test(u)) : !0; return a && s && c; } function Zne(t, e, n) { return nr(nn(t, e), e, n); } function ere(t, e, n) { const r = new RegExp(t.source, t.flags); return wt(t.minLength) && !(n.length >= t.minLength) || wt(t.maxLength) && !(n.length <= t.maxLength) ? !1 : r.test(n); } function tre(t, e, n) { return !qt(n) || wt(t.minLength) && !(n.length >= t.minLength) || wt(t.maxLength) && !(n.length <= t.maxLength) || wt(t.pattern) && !new RegExp(t.pattern).test(n) ? !1 : wt(t.format) ? AE(t.format) ? IE(t.format)(n) : !1 : !0; } function nre(t, e, n) { return sf(n); } function rre(t, e, n) { return qt(n) && new RegExp(t.pattern).test(n); } function ire(t, e, n) { return nr(nn(t, e), e, n); } function ore(t, e, n) { if (!zt(n) || t.items === void 0 && n.length !== 0 || n.length !== t.maxItems) return !1; if (!t.items) return !0; for (let r = 0; r < t.items.length; r++) if (!nr(t.items[r], e, n[r])) return !1; return !0; } function are(t, e, n) { return ii(n); } function sre(t, e, n) { return t.anyOf.some((r) => nr(r, e, n)); } function cre(t, e, n) { return !(!_E(n) || wt(t.maxByteLength) && !(n.length <= t.maxByteLength) || wt(t.minByteLength) && !(n.length >= t.minByteLength)); } function ure(t, e, n) { return !0; } function lre(t, e, n) { return In.IsVoidLike(n); } function dre(t, e, n) { return Uu(t[Ae]) ? CE(t[Ae])(t, n) : !1; } function nr(t, e, n) { const r = wt(t.$id) ? $a(t, e) : e, i = t; switch (i[Ae]) { case "Any": return Dne(); case "Argument": return One(); case "Array": return Fne(i, r, n); case "AsyncIterator": return Mne(i, r, n); case "BigInt": return Rne(i, r, n); case "Boolean": return Bne(i, r, n); case "Constructor": return Une(i, r, n); case "Date": return Lne(i, r, n); case "Function": return Qne(i, r, n); case "Import": return jne(i, r, n); case "Integer": return $ne(i, r, n); case "Intersect": return Gne(i, r, n); case "Iterator": return qne(i, r, n); case "Literal": return zne(i, r, n); case "Never": return Hne(); case "Not": return Wne(i, r, n); case "Null": return Kne(i, r, n); case "Number": return Vne(i, r, n); case "Object": return Yne(i, r, n); case "Promise": return Jne(i, r, n); case "Record": return Xne(i, r, n); case "Ref": return Zne(i, r, n); case "RegExp": return ere(i, r, n); case "String": return tre(i, r, n); case "Symbol": return nre(i, r, n); case "TemplateLiteral": return rre(i, r, n); case "This": return ire(i, r, n); case "Tuple": return ore(i, r, n); case "Undefined": return are(i, r, n); case "Union": return sre(i, r, n); case "Uint8Array": return cre(i, r, n); case "Unknown": return ure(); case "Void": return lre(i, r, n); default: if (!Uu(i[Ae])) throw new Nne(i); return dre(i, r, n); } } function Vt(...t) { return t.length === 3 ? nr(t[0], t[1], t[2]) : nr(t[0], [], t[1]); } var le; (function(t) { t[t.ArrayContains = 0] = "ArrayContains", t[t.ArrayMaxContains = 1] = "ArrayMaxContains", t[t.ArrayMaxItems = 2] = "ArrayMaxItems", t[t.ArrayMinContains = 3] = "ArrayMinContains", t[t.ArrayMinItems = 4] = "ArrayMinItems", t[t.ArrayUniqueItems = 5] = "ArrayUniqueItems", t[t.Array = 6] = "Array", t[t.AsyncIterator = 7] = "AsyncIterator", t[t.BigIntExclusiveMaximum = 8] = "BigIntExclusiveMaximum", t[t.BigIntExclusiveMinimum = 9] = "BigIntExclusiveMinimum", t[t.BigIntMaximum = 10] = "BigIntMaximum", t[t.BigIntMinimum = 11] = "BigIntMinimum", t[t.BigIntMultipleOf = 12] = "BigIntMultipleOf", t[t.BigInt = 13] = "BigInt", t[t.Boolean = 14] = "Boolean", t[t.DateExclusiveMaximumTimestamp = 15] = "DateExclusiveMaximumTimestamp", t[t.DateExclusiveMinimumTimestamp = 16] = "DateExclusiveMinimumTimestamp", t[t.DateMaximumTimestamp = 17] = "DateMaximumTimestamp", t[t.DateMinimumTimestamp = 18] = "DateMinimumTimestamp", t[t.DateMultipleOfTimestamp = 19] = "DateMultipleOfTimestamp", t[t.Date = 20] = "Date", t[t.Function = 21] = "Function", t[t.IntegerExclusiveMaximum = 22] = "IntegerExclusiveMaximum", t[t.IntegerExclusiveMinimum = 23] = "IntegerExclusiveMinimum", t[t.IntegerMaximum = 24] = "IntegerMaximum", t[t.IntegerMinimum = 25] = "IntegerMinimum", t[t.IntegerMultipleOf = 26] = "IntegerMultipleOf", t[t.Integer = 27] = "Integer", t[t.IntersectUnevaluatedProperties = 28] = "IntersectUnevaluatedProperties", t[t.Intersect = 29] = "Intersect", t[t.Iterator = 30] = "Iterator", t[t.Kind = 31] = "Kind", t[t.Literal = 32] = "Literal", t[t.Never = 33] = "Never", t[t.Not = 34] = "Not", t[t.Null = 35] = "Null", t[t.NumberExclusiveMaximum = 36] = "NumberExclusiveMaximum", t[t.NumberExclusiveMinimum = 37] = "NumberExclusiveMinimum", t[t.NumberMaximum = 38] = "NumberMaximum", t[t.NumberMinimum = 39] = "NumberMinimum", t[t.NumberMultipleOf = 40] = "NumberMultipleOf", t[t.Number = 41] = "Number", t[t.ObjectAdditionalProperties = 42] = "ObjectAdditionalProperties", t[t.ObjectMaxProperties = 43] = "ObjectMaxProperties", t[t.ObjectMinProperties = 44] = "ObjectMinProperties", t[t.ObjectRequiredProperty = 45] = "ObjectRequiredProperty", t[t.Object = 46] = "Object", t[t.Promise = 47] = "Promise", t[t.RegExp = 48] = "RegExp", t[t.StringFormatUnknown = 49] = "StringFormatUnknown", t[t.StringFormat = 50] = "StringFormat", t[t.StringMaxLength = 51] = "StringMaxLength", t[t.StringMinLength = 52] = "StringMinLength", t[t.StringPattern = 53] = "StringPattern", t[t.String = 54] = "String", t[t.Symbol = 55] = "Symbol", t[t.TupleLength = 56] = "TupleLength", t[t.Tuple = 57] = "Tuple", t[t.Uint8ArrayMaxByteLength = 58] = "Uint8ArrayMaxByteLength", t[t.Uint8ArrayMinByteLength = 59] = "Uint8ArrayMinByteLength", t[t.Uint8Array = 60] = "Uint8Array", t[t.Undefined = 61] = "Undefined", t[t.Union = 62] = "Union", t[t.Void = 63] = "Void"; })(le || (le = {})); class pre extends wn { constructor(e) { super("Unknown type"), this.schema = e; } } function ba(t) { return t.replace(/~/g, "~0").replace(/\//g, "~1"); } function xt(t) { return t !== void 0; } class XE { constructor(e) { this.iterator = e; } [Symbol.iterator]() { return this.iterator; } /** Returns the first value error or undefined if no errors */ First() { const e = this.iterator.next(); return e.done ? void 0 : e.value; } } function De(t, e, n, r, i = []) { return { type: t, schema: e, path: n, value: r, message: ite()({ errorType: t, path: n, schema: e, value: r, errors: i }), errors: i }; } function* fre(t, e, n, r) { } function* hre(t, e, n, r) { } function* mre(t, e, n, r) { if (!zt(r)) return yield De(le.Array, t, n, r); xt(t.minItems) && !(r.length >= t.minItems) && (yield De(le.ArrayMinItems, t, n, r)), xt(t.maxItems) && !(r.length <= t.maxItems) && (yield De(le.ArrayMaxItems, t, n, r)); for (let a = 0; a < r.length; a++) yield* rr(t.items, e, `${n}/${a}`, r[a]); if (t.uniqueItems === !0 && !(function() { const a = /* @__PURE__ */ new Set(); for (const s of r) { const c = $E(s); if (a.has(c)) return !1; a.add(c); } return !0; })() && (yield De(le.ArrayUniqueItems, t, n, r)), !(xt(t.contains) || xt(t.minContains) || xt(t.maxContains))) return; const i = xt(t.contains) ? t.contains : cn(), o = r.reduce((a, s, c) => rr(i, e, `${n}${c}`, s).next().done === !0 ? a + 1 : a, 0); o === 0 && (yield De(le.ArrayContains, t, n, r)), et(t.minContains) && o < t.minContains && (yield De(le.ArrayMinContains, t, n, r)), et(t.maxContains) && o > t.maxContains && (yield De(le.ArrayMaxContains, t, n, r)); } function* gre(t, e, n, r) { jM(r) || (yield De(le.AsyncIterator, t, n, r)); } function* yre(t, e, n, r) { if (!Ui(r)) return yield De(le.BigInt, t, n, r); xt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield De(le.BigIntExclusiveMaximum, t, n, r)), xt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield De(le.BigIntExclusiveMinimum, t, n, r)), xt(t.maximum) && !(r <= t.maximum) && (yield De(le.BigIntMaximum, t, n, r)), xt(t.minimum) && !(r >= t.minimum) && (yield De(le.BigIntMinimum, t, n, r)), xt(t.multipleOf) && r % t.multipleOf !== BigInt(0) && (yield De(le.BigIntMultipleOf, t, n, r)); } function* bre(t, e, n, r) { Sl(r) || (yield De(le.Boolean, t, n, r)); } function* vre(t, e, n, r) { yield* rr(t.returns, e, n, r.prototype); } function* xre(t, e, n, r) { if (!wl(r)) return yield De(le.Date, t, n, r); xt(t.exclusiveMaximumTimestamp) && !(r.getTime() < t.exclusiveMaximumTimestamp) && (yield De(le.DateExclusiveMaximumTimestamp, t, n, r)), xt(t.exclusiveMinimumTimestamp) && !(r.getTime() > t.exclusiveMinimumTimestamp) && (yield De(le.DateExclusiveMinimumTimestamp, t, n, r)), xt(t.maximumTimestamp) && !(r.getTime() <= t.maximumTimestamp) && (yield De(le.DateMaximumTimestamp, t, n, r)), xt(t.minimumTimestamp) && !(r.getTime() >= t.minimumTimestamp) && (yield De(le.DateMinimumTimestamp, t, n, r)), xt(t.multipleOfTimestamp) && r.getTime() % t.multipleOfTimestamp !== 0 && (yield De(le.DateMultipleOfTimestamp, t, n, r)); } function* wre(t, e, n, r) { N0(r) || (yield De(le.Function, t, n, r)); } function* Sre(t, e, n, r) { const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref]; yield* rr(o, [...e, ...i], n, r); } function* _re(t, e, n, r) { if (!qM(r)) return yield De(le.Integer, t, n, r); xt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield De(le.IntegerExclusiveMaximum, t, n, r)), xt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield De(le.IntegerExclusiveMinimum, t, n, r)), xt(t.maximum) && !(r <= t.maximum) && (yield De(le.IntegerMaximum, t, n, r)), xt(t.minimum) && !(r >= t.minimum) && (yield De(le.IntegerMinimum, t, n, r)), xt(t.multipleOf) && r % t.multipleOf !== 0 && (yield De(le.IntegerMultipleOf, t, n, r)); } function* Ere(t, e, n, r) { let i = !1; for (const o of t.allOf) for (const a of rr(o, e, n, r)) i = !0, yield a; if (i) return yield De(le.Intersect, t, n, r); if (t.unevaluatedProperties === !1) { const o = new RegExp($u(t)); for (const a of Object.getOwnPropertyNames(r)) o.test(a) || (yield De(le.IntersectUnevaluatedProperties, t, `${n}/${a}`, r)); } if (typeof t.unevaluatedProperties == "object") { const o = new RegExp($u(t)); for (const a of Object.getOwnPropertyNames(r)) if (!o.test(a)) { const s = rr(t.unevaluatedProperties, e, `${n}/${a}`, r[a]).next(); s.done || (yield s.value); } } } function* Are(t, e, n, r) { $M(r) || (yield De(le.Iterator, t, n, r)); } function* Ire(t, e, n, r) { r !== t.const && (yield De(le.Literal, t, n, r)); } function* Cre(t, e, n, r) { yield De(le.Never, t, n, r); } function* Tre(t, e, n, r) { rr(t.not, e, n, r).next().done === !0 && (yield De(le.Not, t, n, r)); } function* kre(t, e, n, r) { af(r) || (yield De(le.Null, t, n, r)); } function* Nre(t, e, n, r) { if (!In.IsNumberLike(r)) return yield De(le.Number, t, n, r); xt(t.exclusiveMaximum) && !(r < t.exclusiveMaximum) && (yield De(le.NumberExclusiveMaximum, t, n, r)), xt(t.exclusiveMinimum) && !(r > t.exclusiveMinimum) && (yield De(le.NumberExclusiveMinimum, t, n, r)), xt(t.maximum) && !(r <= t.maximum) && (yield De(le.NumberMaximum, t, n, r)), xt(t.minimum) && !(r >= t.minimum) && (yield De(le.NumberMinimum, t, n, r)), xt(t.multipleOf) && r % t.multipleOf !== 0 && (yield De(le.NumberMultipleOf, t, n, r)); } function* Pre(t, e, n, r) { if (!In.IsObjectLike(r)) return yield De(le.Object, t, n, r); xt(t.minProperties) && !(Object.getOwnPropertyNames(r).length >= t.minProperties) && (yield De(le.ObjectMinProperties, t, n, r)), xt(t.maxProperties) && !(Object.getOwnPropertyNames(r).length <= t.maxProperties) && (yield De(le.ObjectMaxProperties, t, n, r)); const i = Array.isArray(t.required) ? t.required : [], o = Object.getOwnPropertyNames(t.properties), a = Object.getOwnPropertyNames(r); for (const s of i) a.includes(s) || (yield De(le.ObjectRequiredProperty, t.properties[s], `${n}/${ba(s)}`, void 0)); if (t.additionalProperties === !1) for (const s of a) o.includes(s) || (yield De(le.ObjectAdditionalProperties, t, `${n}/${ba(s)}`, r[s])); if (typeof t.additionalProperties == "object") for (const s of a) o.includes(s) || (yield* rr(t.additionalProperties, e, `${n}/${ba(s)}`, r[s])); for (const s of o) { const c = t.properties[s]; t.required && t.required.includes(s) ? (yield* rr(c, e, `${n}/${ba(s)}`, r[s]), Ol(t) && !(s in r) && (yield De(le.ObjectRequiredProperty, c, `${n}/${ba(s)}`, void 0))) : In.IsExactOptionalProperty(r, s) && (yield* rr(c, e, `${n}/${ba(s)}`, r[s])); } } function* Dre(t, e, n, r) { GM(r) || (yield De(le.Promise, t, n, r)); } function* Ore(t, e, n, r) { if (!In.IsRecordLike(r)) return yield De(le.Object, t, n, r); xt(t.minProperties) && !(Object.getOwnPropertyNames(r).length >= t.minProperties) && (yield De(le.ObjectMinProperties, t, n, r)), xt(t.maxProperties) && !(Object.getOwnPropertyNames(r).length <= t.maxProperties) && (yield De(le.ObjectMaxProperties, t, n, r)); const [i, o] = Object.entries(t.patternProperties)[0], a = new RegExp(i); for (const [s, c] of Object.entries(r)) a.test(s) && (yield* rr(o, e, `${n}/${ba(s)}`, c)); if (typeof t.additionalProperties == "object") for (const [s, c] of Object.entries(r)) a.test(s) || (yield* rr(t.additionalProperties, e, `${n}/${ba(s)}`, c)); if (t.additionalProperties === !1) { for (const [s, c] of Object.entries(r)) if (!a.test(s)) return yield De(le.ObjectAdditionalProperties, t, `${n}/${ba(s)}`, c); } } function* Fre(t, e, n, r) { yield* rr(nn(t, e), e, n, r); } function* Mre(t, e, n, r) { if (!qt(r)) return yield De(le.String, t, n, r); if (xt(t.minLength) && !(r.length >= t.minLength) && (yield De(le.StringMinLength, t, n, r)), xt(t.maxLength) && !(r.length <= t.maxLength) && (yield De(le.StringMaxLength, t, n, r)), !new RegExp(t.source, t.flags).test(r)) return yield De(le.RegExp, t, n, r); } function* Rre(t, e, n, r) { if (!qt(r)) return yield De(le.String, t, n, r); xt(t.minLength) && !(r.length >= t.minLength) && (yield De(le.StringMinLength, t, n, r)), xt(t.maxLength) && !(r.length <= t.maxLength) && (yield De(le.StringMaxLength, t, n, r)), qt(t.pattern) && (new RegExp(t.pattern).test(r) || (yield De(le.StringPattern, t, n, r))), qt(t.format) && (AE(t.format) ? IE(t.format)(r) || (yield De(le.StringFormat, t, n, r)) : yield De(le.StringFormatUnknown, t, n, r)); } function* Bre(t, e, n, r) { sf(r) || (yield De(le.Symbol, t, n, r)); } function* Ure(t, e, n, r) { if (!qt(r)) return yield De(le.String, t, n, r); new RegExp(t.pattern).test(r) || (yield De(le.StringPattern, t, n, r)); } function* Lre(t, e, n, r) { yield* rr(nn(t, e), e, n, r); } function* Qre(t, e, n, r) { if (!zt(r)) return yield De(le.Tuple, t, n, r); if (t.items === void 0 && r.length !== 0) return yield De(le.TupleLength, t, n, r); if (r.length !== t.maxItems) return yield De(le.TupleLength, t, n, r); if (t.items) for (let i = 0; i < t.items.length; i++) yield* rr(t.items[i], e, `${n}/${i}`, r[i]); } function* jre(t, e, n, r) { ii(r) || (yield De(le.Undefined, t, n, r)); } function* $re(t, e, n, r) { if (Vt(t, e, r)) return; const i = t.anyOf.map((o) => new XE(rr(o, e, n, r))); yield De(le.Union, t, n, r, i); } function* Gre(t, e, n, r) { if (!_E(r)) return yield De(le.Uint8Array, t, n, r); xt(t.maxByteLength) && !(r.length <= t.maxByteLength) && (yield De(le.Uint8ArrayMaxByteLength, t, n, r)), xt(t.minByteLength) && !(r.length >= t.minByteLength) && (yield De(le.Uint8ArrayMinByteLength, t, n, r)); } function* qre(t, e, n, r) { } function* zre(t, e, n, r) { In.IsVoidLike(r) || (yield De(le.Void, t, n, r)); } function* Hre(t, e, n, r) { CE(t[Ae])(t, r) || (yield De(le.Kind, t, n, r)); } function* rr(t, e, n, r) { const i = xt(t.$id) ? [...e, t] : e, o = t; switch (o[Ae]) { case "Any": return yield* fre(); case "Argument": return yield* hre(); case "Array": return yield* mre(o, i, n, r); case "AsyncIterator": return yield* gre(o, i, n, r); case "BigInt": return yield* yre(o, i, n, r); case "Boolean": return yield* bre(o, i, n, r); case "Constructor": return yield* vre(o, i, n, r); case "Date": return yield* xre(o, i, n, r); case "Function": return yield* wre(o, i, n, r); case "Import": return yield* Sre(o, i, n, r); case "Integer": return yield* _re(o, i, n, r); case "Intersect": return yield* Ere(o, i, n, r); case "Iterator": return yield* Are(o, i, n, r); case "Literal": return yield* Ire(o, i, n, r); case "Never": return yield* Cre(o, i, n, r); case "Not": return yield* Tre(o, i, n, r); case "Null": return yield* kre(o, i, n, r); case "Number": return yield* Nre(o, i, n, r); case "Object": return yield* Pre(o, i, n, r); case "Promise": return yield* Dre(o, i, n, r); case "Record": return yield* Ore(o, i, n, r); case "Ref": return yield* Fre(o, i, n, r); case "RegExp": return yield* Mre(o, i, n, r); case "String": return yield* Rre(o, i, n, r); case "Symbol": return yield* Bre(o, i, n, r); case "TemplateLiteral": return yield* Ure(o, i, n, r); case "This": return yield* Lre(o, i, n, r); case "Tuple": return yield* Qre(o, i, n, r); case "Undefined": return yield* jre(o, i, n, r); case "Union": return yield* $re(o, i, n, r); case "Uint8Array": return yield* Gre(o, i, n, r); case "Unknown": return yield* qre(); case "Void": return yield* zre(o, i, n, r); default: if (!Uu(o[Ae])) throw new pre(t); return yield* Hre(o, i, n, r); } } function NR(...t) { const e = t.length === 3 ? rr(t[0], t[1], "", t[2]) : rr(t[0], [], "", t[1]); return new XE(e); } class Wre extends wn { constructor(e, n, r) { super("Unable to decode value as it does not match the expected schema"), this.schema = e, this.value = n, this.error = r; } } class Kre extends wn { constructor(e, n, r, i) { super(i instanceof Error ? i.message : "Unknown error"), this.schema = e, this.path = n, this.value = r, this.error = i; } } function tn(t, e, n) { try { return Kt(t) ? t[Vr].Decode(n) : n; } catch (r) { throw new Kre(t, e, n, r); } } function Vre(t, e, n, r) { return zt(r) ? tn(t, n, r.map((i, o) => Fo(t.items, e, `${n}/${o}`, i))) : tn(t, n, r); } function Yre(t, e, n, r) { if (!Mt(r) || EE(r)) return tn(t, n, r); const i = pR(t), o = i.map((d) => d[0]), a = { ...r }; for (const [d, p] of i) d in a && (a[d] = Fo(p, e, `${n}/${d}`, a[d])); if (!Kt(t.unevaluatedProperties)) return tn(t, n, a); const s = Object.getOwnPropertyNames(a), c = t.unevaluatedProperties, u = { ...a }; for (const d of s) o.includes(d) || (u[d] = tn(c, `${n}/${d}`, u[d])); return tn(t, n, u); } function Jre(t, e, n, r) { const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref], a = Fo(o, [...e, ...i], n, r); return tn(t, n, a); } function Xre(t, e, n, r) { return tn(t, n, Fo(t.not, e, n, r)); } function Zre(t, e, n, r) { if (!Mt(r)) return tn(t, n, r); const i = js(t), o = { ...r }; for (const u of i) ft(o, u) && (ii(o[u]) && (!mf(t.properties[u]) || In.IsExactOptionalProperty(o, u)) || (o[u] = Fo(t.properties[u], e, `${n}/${u}`, o[u]))); if (!Rr(t.additionalProperties)) return tn(t, n, o); const a = Object.getOwnPropertyNames(o), s = t.additionalProperties, c = { ...o }; for (const u of a) i.includes(u) || (c[u] = tn(s, `${n}/${u}`, c[u])); return tn(t, n, c); } function eie(t, e, n, r) { if (!Mt(r)) return tn(t, n, r); const i = Object.getOwnPropertyNames(t.patternProperties)[0], o = new RegExp(i), a = { ...r }; for (const d of Object.getOwnPropertyNames(r)) o.test(d) && (a[d] = Fo(t.patternProperties[i], e, `${n}/${d}`, a[d])); if (!Rr(t.additionalProperties)) return tn(t, n, a); const s = Object.getOwnPropertyNames(a), c = t.additionalProperties, u = { ...a }; for (const d of s) o.test(d) || (u[d] = tn(c, `${n}/${d}`, u[d])); return tn(t, n, u); } function tie(t, e, n, r) { const i = nn(t, e); return tn(t, n, Fo(i, e, n, r)); } function nie(t, e, n, r) { const i = nn(t, e); return tn(t, n, Fo(i, e, n, r)); } function rie(t, e, n, r) { return zt(r) && zt(t.items) ? tn(t, n, t.items.map((i, o) => Fo(i, e, `${n}/${o}`, r[o]))) : tn(t, n, r); } function iie(t, e, n, r) { for (const i of t.anyOf) { if (!Vt(i, e, r)) continue; const o = Fo(i, e, n, r); return tn(t, n, o); } return tn(t, n, r); } function Fo(t, e, n, r) { const i = $a(t, e), o = t; switch (t[Ae]) { case "Array": return Vre(o, i, n, r); case "Import": return Jre(o, i, n, r); case "Intersect": return Yre(o, i, n, r); case "Not": return Xre(o, i, n, r); case "Object": return Zre(o, i, n, r); case "Record": return eie(o, i, n, r); case "Ref": return tie(o, i, n, r); case "Symbol": return tn(o, n, r); case "This": return nie(o, i, n, r); case "Tuple": return rie(o, i, n, r); case "Union": return iie(o, i, n, r); default: return tn(o, n, r); } } function PR(t, e, n) { return Fo(t, e, "", n); } class oie extends wn { constructor(e, n, r) { super("The encoded value does not match the expected schema"), this.schema = e, this.value = n, this.error = r; } } class aie extends wn { constructor(e, n, r, i) { super(`${i instanceof Error ? i.message : "Unknown error"}`), this.schema = e, this.path = n, this.value = r, this.error = i; } } function gr(t, e, n) { try { return Kt(t) ? t[Vr].Encode(n) : n; } catch (r) { throw new aie(t, e, n, r); } } function sie(t, e, n, r) { const i = gr(t, n, r); return zt(i) ? i.map((o, a) => wo(t.items, e, `${n}/${a}`, o)) : i; } function cie(t, e, n, r) { const i = globalThis.Object.values(t.$defs), o = t.$defs[t.$ref], a = gr(t, n, r); return wo(o, [...e, ...i], n, a); } function uie(t, e, n, r) { const i = gr(t, n, r); if (!Mt(r) || EE(r)) return i; const o = pR(t), a = o.map((p) => p[0]), s = { ...i }; for (const [p, f] of o) p in s && (s[p] = wo(f, e, `${n}/${p}`, s[p])); if (!Kt(t.unevaluatedProperties)) return s; const c = Object.getOwnPropertyNames(s), u = t.unevaluatedProperties, d = { ...s }; for (const p of c) a.includes(p) || (d[p] = gr(u, `${n}/${p}`, d[p])); return d; } function lie(t, e, n, r) { return gr(t.not, n, gr(t, n, r)); } function die(t, e, n, r) { const i = gr(t, n, r); if (!Mt(i)) return i; const o = js(t), a = { ...i }; for (const d of o) ft(a, d) && (ii(a[d]) && (!mf(t.properties[d]) || In.IsExactOptionalProperty(a, d)) || (a[d] = wo(t.properties[d], e, `${n}/${d}`, a[d]))); if (!Rr(t.additionalProperties)) return a; const s = Object.getOwnPropertyNames(a), c = t.additionalProperties, u = { ...a }; for (const d of s) o.includes(d) || (u[d] = gr(c, `${n}/${d}`, u[d])); return u; } function pie(t, e, n, r) { const i = gr(t, n, r); if (!Mt(r)) return i; const o = Object.getOwnPropertyNames(t.patternProperties)[0], a = new RegExp(o), s = { ...i }; for (const p of Object.getOwnPropertyNames(r)) a.test(p) && (s[p] = wo(t.patternProperties[o], e, `${n}/${p}`, s[p])); if (!Rr(t.additionalProperties)) return s; const c = Object.getOwnPropertyNames(s), u = t.additionalProperties, d = { ...s }; for (const p of c) a.test(p) || (d[p] = gr(u, `${n}/${p}`, d[p])); return d; } function fie(t, e, n, r) { const i = nn(t, e), o = wo(i, e, n, r); return gr(t, n, o); } function hie(t, e, n, r) { const i = nn(t, e), o = wo(i, e, n, r); return gr(t, n, o); } function mie(t, e, n, r) { const i = gr(t, n, r); return zt(t.items) ? t.items.map((o, a) => wo(o, e, `${n}/${a}`, i[a])) : []; } function gie(t, e, n, r) { for (const i of t.anyOf) { if (!Vt(i, e, r)) continue; const o = wo(i, e, n, r); return gr(t, n, o); } for (const i of t.anyOf) { const o = wo(i, e, n, r); if (Vt(t, e, o)) return gr(t, n, o); } return gr(t, n, r); } function wo(t, e, n, r) { const i = $a(t, e), o = t; switch (t[Ae]) { case "Array": return sie(o, i, n, r); case "Import": return cie(o, i, n, r); case "Intersect": return uie(o, i, n, r); case "Not": return lie(o, i, n, r); case "Object": return die(o, i, n, r); case "Record": return pie(o, i, n, r); case "Ref": return fie(o, i, n, r); case "This": return hie(o, i, n, r); case "Tuple": return mie(o, i, n, r); case "Union": return gie(o, i, n, r); default: return gr(o, n, r); } } function DR(t, e, n) { return wo(t, e, "", n); } function yie(t, e) { return Kt(t) || Gn(t.items, e); } function bie(t, e) { return Kt(t) || Gn(t.items, e); } function vie(t, e) { return Kt(t) || Gn(t.returns, e) || t.parameters.some((n) => Gn(n, e)); } function xie(t, e) { return Kt(t) || Gn(t.returns, e) || t.parameters.some((n) => Gn(n, e)); } function wie(t, e) { return Kt(t) || Kt(t.unevaluatedProperties) || t.allOf.some((n) => Gn(n, e)); } function Sie(t, e) { const n = globalThis.Object.getOwnPropertyNames(t.$defs).reduce((i, o) => [...i, t.$defs[o]], []), r = t.$defs[t.$ref]; return Kt(t) || Gn(r, [...n, ...e]); } function _ie(t, e) { return Kt(t) || Gn(t.items, e); } function Eie(t, e) { return Kt(t) || Gn(t.not, e); } function Aie(t, e) { return Kt(t) || Object.values(t.properties).some((n) => Gn(n, e)) || Rr(t.additionalProperties) && Gn(t.additionalProperties, e); } function Iie(t, e) { return Kt(t) || Gn(t.item, e); } function Cie(t, e) { const n = Object.getOwnPropertyNames(t.patternProperties)[0], r = t.patternProperties[n]; return Kt(t) || Gn(r, e) || Rr(t.additionalProperties) && Kt(t.additionalProperties); } function Tie(t, e) { return Kt(t) ? !0 : Gn(nn(t, e), e); } function kie(t, e) { return Kt(t) ? !0 : Gn(nn(t, e), e); } function Nie(t, e) { return Kt(t) || !ii(t.items) && t.items.some((n) => Gn(n, e)); } function Pie(t, e) { return Kt(t) || t.anyOf.some((n) => Gn(n, e)); } function Gn(t, e) { const n = $a(t, e), r = t; if (t.$id && qS.has(t.$id)) return !1; switch (t.$id && qS.add(t.$id), t[Ae]) { case "Array": return yie(r, n); case "AsyncIterator": return bie(r, n); case "Constructor": return vie(r, n); case "Function": return xie(r, n); case "Import": return Sie(r, n); case "Intersect": return wie(r, n); case "Iterator": return _ie(r, n); case "Not": return Eie(r, n); case "Object": return Aie(r, n); case "Promise": return Iie(r, n); case "Record": return Cie(r, n); case "Ref": return Tie(r, n); case "This": return kie(r, n); case "Tuple": return Nie(r, n); case "Union": return Pie(r, n); default: return Kt(t); } } const qS = /* @__PURE__ */ new Set(); function zS(t, e) { return qS.clear(), Gn(t, e); } class Die { constructor(e, n, r, i) { this.schema = e, this.references = n, this.checkFunc = r, this.code = i, this.hasTransform = zS(e, n); } /** Returns the generated assertion code used to validate this type. */ Code() { return this.code; } /** Returns the schema type used to validate */ Schema() { return this.schema; } /** Returns reference types used to validate */ References() { return this.references; } /** Returns an iterator for each error in this value. */ Errors(e) { return NR(this.schema, this.references, e); } /** Returns true if the value matches the compiled type. */ Check(e) { return this.checkFunc(e); } /** Decodes a value or throws if error */ Decode(e) { if (!this.checkFunc(e)) throw new Wre(this.schema, e, this.Errors(e).First()); return this.hasTransform ? PR(this.schema, this.references, e) : e; } /** Encodes a value or throws if error */ Encode(e) { const n = this.hasTransform ? DR(this.schema, this.references, e) : e; if (!this.checkFunc(n)) throw new oie(this.schema, e, this.Errors(e).First()); return n; } } var Sa; (function(t) { function e(o) { return o === 36; } t.DollarSign = e; function n(o) { return o === 95; } t.IsUnderscore = n; function r(o) { return o >= 65 && o <= 90 || o >= 97 && o <= 122; } t.IsAlpha = r; function i(o) { return o >= 48 && o <= 57; } t.IsNumeric = i; })(Sa || (Sa = {})); var fg; (function(t) { function e(o) { return o.length === 0 ? !1 : Sa.IsNumeric(o.charCodeAt(0)); } function n(o) { if (e(o)) return !1; for (let a = 0; a < o.length; a++) { const s = o.charCodeAt(a); if (!(Sa.IsAlpha(s) || Sa.IsNumeric(s) || Sa.DollarSign(s) || Sa.IsUnderscore(s))) return !1; } return !0; } function r(o) { return o.replace(/'/g, "\\'"); } function i(o, a) { return n(a) ? `${o}.${a}` : `${o}['${r(a)}']`; } t.Encode = i; })(fg || (fg = {})); var HS; (function(t) { function e(n) { const r = []; for (let i = 0; i < n.length; i++) { const o = n.charCodeAt(i); Sa.IsNumeric(o) || Sa.IsAlpha(o) ? r.push(n.charAt(i)) : r.push(`_${o}_`); } return r.join("").replace(/__/g, "_"); } t.Encode = e; })(HS || (HS = {})); var WS; (function(t) { function e(n) { return n.replace(/'/g, "\\'"); } t.Escape = e; })(WS || (WS = {})); class Oie extends wn { constructor(e) { super("Unknown type"), this.schema = e; } } class M8 extends wn { constructor(e) { super("Preflight validation check failed to guard for the given schema"), this.schema = e; } } var oc; (function(t) { function e(a, s, c) { return In.ExactOptionalPropertyTypes ? `('${s}' in ${a} ? ${c} : true)` : `(${fg.Encode(a, s)} !== undefined ? ${c} : true)`; } t.IsExactOptionalProperty = e; function n(a) { return In.AllowArrayObject ? `(typeof ${a} === 'object' && ${a} !== null)` : `(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}))`; } t.IsObjectLike = n; function r(a) { return In.AllowArrayObject ? `(typeof ${a} === 'object' && ${a} !== null && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))` : `(typeof ${a} === 'object' && ${a} !== null && !Array.isArray(${a}) && !(${a} instanceof Date) && !(${a} instanceof Uint8Array))`; } t.IsRecordLike = r; function i(a) { return In.AllowNaN ? `typeof ${a} === 'number'` : `Number.isFinite(${a})`; } t.IsNumberLike = i; function o(a) { return In.AllowNullVoid ? `(${a} === undefined || ${a} === null)` : `${a} === undefined`; } t.IsVoidLike = o; })(oc || (oc = {})); var zu; (function(t) { function e(P) { return P[Ae] === "Any" || P[Ae] === "Unknown"; } function* n(P, j, W) { yield "true"; } function* r(P, j, W) { yield "true"; } function* i(P, j, W) { yield `Array.isArray(${W})`; const [se, ce] = [O("value", "any"), O("acc", "number")]; et(P.maxItems) && (yield `${W}.length <= ${P.maxItems}`), et(P.minItems) && (yield `${W}.length >= ${P.minItems}`); const oe = C(P.items, j, "value"); if (yield `((array) => { for(const ${se} of array) if(!(${oe})) { return false }; return true; })(${W})`, sn(P.contains) || et(P.minContains) || et(P.maxContains)) { const we = sn(P.contains) ? P.contains : cn(), Me = C(we, j, "value"), He = et(P.minContains) ? [`(count >= ${P.minContains})`] : [], We = et(P.maxContains) ? [`(count <= ${P.maxContains})`] : [], Xe = `const count = value.reduce((${ce}, ${se}) => ${Me} ? acc + 1 : acc, 0)`, Ye = ["(count > 0)", ...He, ...We].join(" && "); yield `((${se}) => { ${Xe}; return ${Ye}})(${W})`; } P.uniqueItems === !0 && (yield `((${se}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${W})`); } function* o(P, j, W) { yield `(typeof value === 'object' && Symbol.asyncIterator in ${W})`; } function* a(P, j, W) { yield `(typeof ${W} === 'bigint')`, Ui(P.exclusiveMaximum) && (yield `${W} < BigInt(${P.exclusiveMaximum})`), Ui(P.exclusiveMinimum) && (yield `${W} > BigInt(${P.exclusiveMinimum})`), Ui(P.maximum) && (yield `${W} <= BigInt(${P.maximum})`), Ui(P.minimum) && (yield `${W} >= BigInt(${P.minimum})`), Ui(P.multipleOf) && (yield `(${W} % BigInt(${P.multipleOf})) === 0`); } function* s(P, j, W) { yield `(typeof ${W} === 'boolean')`; } function* c(P, j, W) { yield* N(P.returns, j, `${W}.prototype`); } function* u(P, j, W) { yield `(${W} instanceof Date) && Number.isFinite(${W}.getTime())`, et(P.exclusiveMaximumTimestamp) && (yield `${W}.getTime() < ${P.exclusiveMaximumTimestamp}`), et(P.exclusiveMinimumTimestamp) && (yield `${W}.getTime() > ${P.exclusiveMinimumTimestamp}`), et(P.maximumTimestamp) && (yield `${W}.getTime() <= ${P.maximumTimestamp}`), et(P.minimumTimestamp) && (yield `${W}.getTime() >= ${P.minimumTimestamp}`), et(P.multipleOfTimestamp) && (yield `(${W}.getTime() % ${P.multipleOfTimestamp}) === 0`); } function* d(P, j, W) { yield `(typeof ${W} === 'function')`; } function* p(P, j, W) { const se = globalThis.Object.getOwnPropertyNames(P.$defs).reduce((ce, oe) => [...ce, P.$defs[oe]], []); yield* N(Dl(P.$ref), [...j, ...se], W); } function* f(P, j, W) { yield `Number.isInteger(${W})`, et(P.exclusiveMaximum) && (yield `${W} < ${P.exclusiveMaximum}`), et(P.exclusiveMinimum) && (yield `${W} > ${P.exclusiveMinimum}`), et(P.maximum) && (yield `${W} <= ${P.maximum}`), et(P.minimum) && (yield `${W} >= ${P.minimum}`), et(P.multipleOf) && (yield `(${W} % ${P.multipleOf}) === 0`); } function* m(P, j, W) { const se = P.allOf.map((ce) => C(ce, j, W)).join(" && "); if (P.unevaluatedProperties === !1) { const ce = k(`${new RegExp($u(P))};`), oe = `Object.getOwnPropertyNames(${W}).every(key => ${ce}.test(key))`; yield `(${se} && ${oe})`; } else if (sn(P.unevaluatedProperties)) { const ce = k(`${new RegExp($u(P))};`), oe = `Object.getOwnPropertyNames(${W}).every(key => ${ce}.test(key) || ${C(P.unevaluatedProperties, j, `${W}[key]`)})`; yield `(${se} && ${oe})`; } else yield `(${se})`; } function* h(P, j, W) { yield `(typeof value === 'object' && Symbol.iterator in ${W})`; } function* y(P, j, W) { typeof P.const == "number" || typeof P.const == "boolean" ? yield `(${W} === ${P.const})` : yield `(${W} === '${WS.Escape(P.const)}')`; } function* x(P, j, W) { yield "false"; } function* g(P, j, W) { yield `(!${C(P.not, j, W)})`; } function* b(P, j, W) { yield `(${W} === null)`; } function* S(P, j, W) { yield oc.IsNumberLike(W), et(P.exclusiveMaximum) && (yield `${W} < ${P.exclusiveMaximum}`), et(P.exclusiveMinimum) && (yield `${W} > ${P.exclusiveMinimum}`), et(P.maximum) && (yield `${W} <= ${P.maximum}`), et(P.minimum) && (yield `${W} >= ${P.minimum}`), et(P.multipleOf) && (yield `(${W} % ${P.multipleOf}) === 0`); } function* E(P, j, W) { yield oc.IsObjectLike(W), et(P.minProperties) && (yield `Object.getOwnPropertyNames(${W}).length >= ${P.minProperties}`), et(P.maxProperties) && (yield `Object.getOwnPropertyNames(${W}).length <= ${P.maxProperties}`); const se = Object.getOwnPropertyNames(P.properties); for (const ce of se) { const oe = fg.Encode(W, ce), we = P.properties[ce]; if (P.required && P.required.includes(ce)) yield* N(we, j, oe), (Ol(we) || e(we)) && (yield `('${ce}' in ${W})`); else { const Me = C(we, j, oe); yield oc.IsExactOptionalProperty(W, ce, Me); } } if (P.additionalProperties === !1) if (P.required && P.required.length === se.length) yield `Object.getOwnPropertyNames(${W}).length === ${se.length}`; else { const ce = `[${se.map((oe) => `'${oe}'`).join(", ")}]`; yield `Object.getOwnPropertyNames(${W}).every(key => ${ce}.includes(key))`; } if (typeof P.additionalProperties == "object") { const ce = C(P.additionalProperties, j, `${W}[key]`), oe = `[${se.map((we) => `'${we}'`).join(", ")}]`; yield `(Object.getOwnPropertyNames(${W}).every(key => ${oe}.includes(key) || ${ce}))`; } } function* T(P, j, W) { yield `${W} instanceof Promise`; } function* U(P, j, W) { yield oc.IsRecordLike(W), et(P.minProperties) && (yield `Object.getOwnPropertyNames(${W}).length >= ${P.minProperties}`), et(P.maxProperties) && (yield `Object.getOwnPropertyNames(${W}).length <= ${P.maxProperties}`); const [se, ce] = Object.entries(P.patternProperties)[0], oe = k(`${new RegExp(se)}`), we = C(ce, j, "value"), Me = sn(P.additionalProperties) ? C(P.additionalProperties, j, W) : P.additionalProperties === !1 ? "false" : "true", He = `(${oe}.test(key) ? ${we} : ${Me})`; yield `(Object.entries(${W}).every(([key, value]) => ${He}))`; } function* q(P, j, W) { const se = nn(P, j); if (L.functions.has(P.$ref)) return yield `${Q(P.$ref)}(${W})`; yield* N(se, j, W); } function* Y(P, j, W) { const se = k(`${new RegExp(P.source, P.flags)};`); yield `(typeof ${W} === 'string')`, et(P.maxLength) && (yield `${W}.length <= ${P.maxLength}`), et(P.minLength) && (yield `${W}.length >= ${P.minLength}`), yield `${se}.test(${W})`; } function* H(P, j, W) { yield `(typeof ${W} === 'string')`, et(P.maxLength) && (yield `${W}.length <= ${P.maxLength}`), et(P.minLength) && (yield `${W}.length >= ${P.minLength}`), P.pattern !== void 0 && (yield `${k(`${new RegExp(P.pattern)};`)}.test(${W})`), P.format !== void 0 && (yield `format('${P.format}', ${W})`); } function* G(P, j, W) { yield `(typeof ${W} === 'symbol')`; } function* J(P, j, W) { yield `(typeof ${W} === 'string')`, yield `${k(`${new RegExp(P.pattern)};`)}.test(${W})`; } function* B(P, j, W) { yield `${Q(P.$ref)}(${W})`; } function* D(P, j, W) { if (yield `Array.isArray(${W})`, P.items === void 0) return yield `${W}.length === 0`; yield `(${W}.length === ${P.maxItems})`; for (let se = 0; se < P.items.length; se++) yield `${C(P.items[se], j, `${W}[${se}]`)}`; } function* X(P, j, W) { yield `${W} === undefined`; } function* V(P, j, W) { yield `(${P.anyOf.map((ce) => C(ce, j, W)).join(" || ")})`; } function* K(P, j, W) { yield `${W} instanceof Uint8Array`, et(P.maxByteLength) && (yield `(${W}.length <= ${P.maxByteLength})`), et(P.minByteLength) && (yield `(${W}.length >= ${P.minByteLength})`); } function* $(P, j, W) { yield "true"; } function* _(P, j, W) { yield oc.IsVoidLike(W); } function* I(P, j, W) { const se = L.instances.size; L.instances.set(se, P), yield `kind('${P[Ae]}', ${se}, ${W})`; } function* N(P, j, W, se = !0) { const ce = qt(P.$id) ? [...j, P] : j, oe = P; if (se && qt(P.$id)) { const we = Q(P.$id); if (L.functions.has(we)) return yield `${we}(${W})`; { L.functions.set(we, "<deferred>"); const Me = M(we, P, j, "value", !1); return L.functions.set(we, Me), yield `${we}(${W})`; } } switch (oe[Ae]) { case "Any": return yield* n(); case "Argument": return yield* r(); case "Array": return yield* i(oe, ce, W); case "AsyncIterator": return yield* o(oe, ce, W); case "BigInt": return yield* a(oe, ce, W); case "Boolean": return yield* s(oe, ce, W); case "Constructor": return yield* c(oe, ce, W); case "Date": return yield* u(oe, ce, W); case "Function": return yield* d(oe, ce, W); case "Import": return yield* p(oe, ce, W); case "Integer": return yield* f(oe, ce, W); case "Intersect": return yield* m(oe, ce, W); case "Iterator": return yield* h(oe, ce, W); case "Literal": return yield* y(oe, ce, W); case "Never": return yield* x(); case "Not": return yield* g(oe, ce, W); case "Null": return yield* b(oe, ce, W); case "Number": return yield* S(oe, ce, W); case "Object": return yield* E(oe, ce, W); case "Promise": return yield* T(oe, ce, W); case "Record": return yield* U(oe, ce, W); case "Ref": return yield* q(oe, ce, W); case "RegExp": return yield* Y(oe, ce, W); case "String": return yield* H(oe, ce, W); case "Symbol": return yield* G(oe, ce, W); case "TemplateLiteral": return yield* J(oe, ce, W); case "This": return yield* B(oe, ce, W); case "Tuple": return yield* D(oe, ce, W); case "Undefined": return yield* X(oe, ce, W); case "Union": return yield* V(oe, ce, W); case "Uint8Array": return yield* K(oe, ce, W); case "Unknown": return yield* $(); case "Void": return yield* _(oe, ce, W); default: if (!Uu(oe[Ae])) throw new Oie(P); return yield* I(oe, ce, W); } } const L = { language: "javascript", // target language functions: /* @__PURE__ */ new Map(), // local functions variables: /* @__PURE__ */ new Map(), // local variables instances: /* @__PURE__ */ new Map() // exterior kind instances }; function C(P, j, W, se = !0) { return `(${[...N(P, j, W, se)].join(" && ")})`; } function Q(P) { return `check_${HS.Encode(P)}`; } function k(P) { const j = `local_${L.variables.size}`; return L.variables.set(j, `const ${j} = ${P}`), j; } function M(P, j, W, se, ce = !0) { const [oe, we] = [` `, (Xe) => "".padStart(Xe, " ")], Me = O("value", "any"), He = A("boolean"), We = [...N(j, W, se, ce)].map((Xe) => `${we(4)}${Xe}`).join(` &&${oe}`); return `function ${P}(${Me})${He} {${oe}${we(2)}return (${oe}${We}${oe}${we(2)}) }`; } function O(P, j) { const W = L.language === "typescript" ? `: ${j}` : ""; return `${P}${W}`; } function A(P) { return L.language === "typescript" ? `: ${P}` : ""; } function F(P, j, W) { const se = M("check", P, j, "value"), ce = O("value", "any"), oe = A("boolean"), we = [...L.functions.values()], Me = [...L.variables.values()], He = qt(P.$id) ? `return function check(${ce})${oe} { return ${Q(P.$id)}(value) }` : `return ${se}`; return [...Me, ...we, He].join(` `); } function Z(...P) { const j = { language: "javascript" }, [W, se, ce] = P.length === 2 && zt(P[1]) ? [P[0], P[1], j] : P.length === 2 && !zt(P[1]) ? [P[0], [], P[1]] : P.length === 3 ? [P[0], P[1], P[2]] : P.length === 1 ? [P[0], [], j] : [null, [], j]; if (L.language = ce.language, L.variables.clear(), L.functions.clear(), L.instances.clear(), !sn(W)) throw new M8(W); for (const oe of se) if (!sn(oe)) throw new M8(oe); return F(W, se); } t.Code = Z; function ee(P, j = []) { const W = Z(P, j, { language: "javascript" }), se = globalThis.Function("kind", "format", "hash", W), ce = new Map(L.instances); function oe(We, Xe, Ye) { if (!Uu(We) || !ce.has(Xe)) return !1; const it = CE(We), ze = ce.get(Xe); return it(ze, Ye); } function we(We, Xe) { return AE(We) ? IE(We)(Xe) : !1; } function Me(We) { return $E(We); } const He = se(oe, we, Me); return new Die(P, j, He, W); } t.Compile = ee; })(zu || (zu = {})); var Fie = function(t, e, n, r, i) { if (r === "m") throw new TypeError("Private method is not writable"); if (r === "a" && !i) throw new TypeError("Private accessor was defined without a setter"); if (typeof e == "function" ? t !== e || !i : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return r === "a" ? i.call(t, n) : i ? i.value = n : e.set(t, n), n; }, OR = function(t, e, n, r) { if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter"); if (typeof e == "function" ? t !== e || !r : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return n === "m" ? r : n === "a" ? r.call(t) : r ? r.value : e.get(t); }, KS, hg, FR; class Mie extends wn { constructor(e) { const n = e.First(); super(n === void 0 ? "Invalid Value" : n.message), KS.add(this), hg.set(this, void 0), Fie(this, hg, e, "f"), this.error = n; } /** Returns an iterator for each error in this value. */ Errors() { return new XE(OR(this, KS, "m", FR).call(this)); } } hg = /* @__PURE__ */ new WeakMap(), KS = /* @__PURE__ */ new WeakSet(), FR = function* () { this.error && (yield this.error), yield* OR(this, hg, "f"); }; function R8(t, e, n) { if (!Vt(t, e, n)) throw new Mie(NR(t, e, n)); } function Rie(...t) { return t.length === 3 ? R8(t[0], t[1], t[2]) : R8(t[0], [], t[1]); } function Bie(t) { const e = {}; for (const n of Object.getOwnPropertyNames(t)) e[n] = ar(t[n]); for (const n of Object.getOwnPropertySymbols(t)) e[n] = ar(t[n]); return e; } function Uie(t) { return t.map((e) => ar(e)); } function Lie(t) { return t.slice(); } function Qie(t) { return new Map(ar([...t.entries()])); } function jie(t) { return new Set(ar([...t.entries()])); } function $ie(t) { return new Date(t.toISOString()); } function ar(t) { if (zt(t)) return Uie(t); if (wl(t)) return $ie(t); if (ZX(t)) return Lie(t); if (JX(t)) return Qie(t); if (XX(t)) return jie(t); if (Mt(t)) return Bie(t); if (EE(t)) return t; throw new Error("ValueClone: Unable to clone value"); } class So extends wn { constructor(e, n) { super(n), this.schema = e; } } function It(t) { return N0(t) ? t() : ar(t); } function Gie(t, e) { return ft(t, "default") ? It(t.default) : {}; } function qie(t, e) { return {}; } function zie(t, e) { if (t.uniqueItems === !0 && !ft(t, "default")) throw new So(t, "Array with the uniqueItems constraint requires a default value"); if ("contains" in t && !ft(t, "default")) throw new So(t, "Array with the contains constraint requires a default value"); return "default" in t ? It(t.default) : t.minItems !== void 0 ? Array.from({ length: t.minItems }).map((n) => wi(t.items, e)) : []; } function Hie(t, e) { return ft(t, "default") ? It(t.default) : (async function* () { })(); } function Wie(t, e) { return ft(t, "default") ? It(t.default) : BigInt(0); } function Kie(t, e) { return ft(t, "default") ? It(t.default) : !1; } function Vie(t, e) { if (ft(t, "default")) return It(t.default); { const n = wi(t.returns, e); return typeof n == "object" && !Array.isArray(n) ? class { constructor() { for (const [r, i] of Object.entries(n)) { const o = this; o[r] = i; } } } : class { }; } } function Yie(t, e) { return ft(t, "default") ? It(t.default) : t.minimumTimestamp !== void 0 ? new Date(t.minimumTimestamp) : /* @__PURE__ */ new Date(); } function Jie(t, e) { return ft(t, "default") ? It(t.default) : () => wi(t.returns, e); } function Xie(t, e) { const n = globalThis.Object.values(t.$defs), r = t.$defs[t.$ref]; return wi(r, [...e, ...n]); } function Zie(t, e) { return ft(t, "default") ? It(t.default) : t.minimum !== void 0 ? t.minimum : 0; } function eoe(t, e) { if (ft(t, "default")) return It(t.default); { const n = t.allOf.reduce((r, i) => { const o = wi(i, e); return typeof o == "object" ? { ...r, ...o } : o; }, {}); if (!Vt(t, e, n)) throw new So(t, "Intersect produced invalid value. Consider using a default value."); return n; } } function toe(t, e) { return ft(t, "default") ? It(t.default) : (function* () { })(); } function noe(t, e) { return ft(t, "default") ? It(t.default) : t.const; } function roe(t, e) { if (ft(t, "default")) return It(t.default); throw new So(t, "Never types cannot be created. Consider using a default value."); } function ioe(t, e) { if (ft(t, "default")) return It(t.default); throw new So(t, "Not types must have a default value"); } function ooe(t, e) { return ft(t, "default") ? It(t.default) : null; } function aoe(t, e) { return ft(t, "default") ? It(t.default) : t.minimum !== void 0 ? t.minimum : 0; } function soe(t, e) { if (ft(t, "default")) return It(t.default); { const n = new Set(t.required), r = {}; for (const [i, o] of Object.entries(t.properties)) n.has(i) && (r[i] = wi(o, e)); return r; } } function coe(t, e) { return ft(t, "default") ? It(t.default) : Promise.resolve(wi(t.item, e)); } function uoe(t, e) { return ft(t, "default") ? It(t.default) : {}; } function loe(t, e) { return ft(t, "default") ? It(t.default) : wi(nn(t, e), e); } function doe(t, e) { if (ft(t, "default")) return It(t.default); throw new So(t, "RegExp types cannot be created. Consider using a default value."); } function poe(t, e) { if (t.pattern !== void 0) { if (ft(t, "default")) return It(t.default); throw new So(t, "String types with patterns must specify a default value"); } else if (t.format !== void 0) { if (ft(t, "default")) return It(t.default); throw new So(t, "String types with formats must specify a default value"); } else return ft(t, "default") ? It(t.default) : t.minLength !== void 0 ? Array.from({ length: t.minLength }).map(() => " ").join("") : ""; } function foe(t, e) { return ft(t, "default") ? It(t.default) : "value" in t ? Symbol.for(t.value) : Symbol(); } function hoe(t, e) { if (ft(t, "default")) return It(t.default); if (!tR(t)) throw new So(t, "Can only create template literals that produce a finite variants. Consider using a default value."); return BE(t)[0]; } function moe(t, e) { if (MR++ > _oe) throw new So(t, "Cannot create recursive type as it appears possibly infinite. Consider using a default."); return ft(t, "default") ? It(t.default) : wi(nn(t, e), e); } function goe(t, e) { return ft(t, "default") ? It(t.default) : t.items === void 0 ? [] : Array.from({ length: t.minItems }).map((n, r) => wi(t.items[r], e)); } function yoe(t, e) { if (ft(t, "default")) return It(t.default); } function boe(t, e) { if (ft(t, "default")) return It(t.default); if (t.anyOf.length === 0) throw new Error("ValueCreate.Union: Cannot create Union with zero variants"); return wi(t.anyOf[0], e); } function voe(t, e) { return ft(t, "default") ? It(t.default) : t.minByteLength !== void 0 ? new Uint8Array(t.minByteLength) : new Uint8Array(0); } function xoe(t, e) { return ft(t, "default") ? It(t.default) : {}; } function woe(t, e) { if (ft(t, "default")) return It(t.default); } function Soe(t, e) { if (ft(t, "default")) return It(t.default); throw new Error("User defined types must specify a default value"); } function wi(t, e) { const n = $a(t, e), r = t; switch (r[Ae]) { case "Any": return Gie(r); case "Argument": return qie(); case "Array": return zie(r, n); case "AsyncIterator": return Hie(r); case "BigInt": return Wie(r); case "Boolean": return Kie(r); case "Constructor": return Vie(r, n); case "Date": return Yie(r); case "Function": return Jie(r, n); case "Import": return Xie(r, n); case "Integer": return Zie(r); case "Intersect": return eoe(r, n); case "Iterator": return toe(r); case "Literal": return noe(r); case "Never": return roe(r); case "Not": return ioe(r); case "Null": return ooe(r); case "Number": return aoe(r); case "Object": return soe(r, n); case "Promise": return coe(r, n); case "Record": return uoe(r); case "Ref": return loe(r, n); case "RegExp": return doe(r); case "String": return poe(r); case "Symbol": return foe(r); case "TemplateLiteral": return hoe(r); case "This": return moe(r, n); case "Tuple": return goe(r, n); case "Undefined": return yoe(r); case "Union": return boe(r, n); case "Uint8Array": return voe(r); case "Unknown": return xoe(r); case "Void": return woe(r); default: if (!Uu(r[Ae])) throw new So(r, "Unknown type"); return Soe(r); } } const _oe = 512; let MR = 0; function qs(...t) { return MR = 0, t.length === 2 ? wi(t[0], t[1]) : wi(t[0], []); } class RR extends wn { constructor(e, n) { super(n), this.schema = e; } } function BR(t, e, n) { if (t[Ae] === "Object" && typeof n == "object" && !af(n)) { const r = t, i = Object.getOwnPropertyNames(n); return Object.entries(r.properties).reduce((a, [s, c]) => { const u = c[Ae] === "Literal" && c.const === n[s] ? 100 : 0, d = Vt(c, e, n[s]) ? 10 : 0, p = i.includes(s) ? 1 : 0; return a + (u + d + p); }, 0); } else if (t[Ae] === "Union") { const i = t.anyOf.map((o) => nn(o, e)).map((o) => BR(o, e, n)); return Math.max(...i); } else return Vt(t, e, n) ? 1 : 0; } function Eoe(t, e, n) { const r = t.anyOf.map((a) => nn(a, e)); let [i, o] = [r[0], 0]; for (const a of r) { const s = BR(a, e, n); s > o && (i = a, o = s); } return i; } function Aoe(t, e, n) { if ("default" in t) return typeof n == "function" ? t.default : ar(t.default); { const r = Eoe(t, e, n); return LR(r, e, n); } } function Ioe(t, e, n) { return Vt(t, e, n) ? ar(n) : qs(t, e); } function Coe(t, e, n) { return Vt(t, e, n) ? n : qs(t, e); } function Toe(t, e, n) { if (Vt(t, e, n)) return ar(n); const r = zt(n) ? ar(n) : qs(t, e), i = et(t.minItems) && r.length < t.minItems ? [...r, ...Array.from({ length: t.minItems - r.length }, () => null)] : r, a = (et(t.maxItems) && i.length > t.maxItems ? i.slice(0, t.maxItems) : i).map((c) => _o(t.items, e, c)); if (t.uniqueItems !== !0) return a; const s = [...new Set(a)]; if (!Vt(t, e, s)) throw new RR(t, "Array cast produced invalid data due to uniqueItems constraint"); return s; } function koe(t, e, n) { if (Vt(t, e, n)) return qs(t, e); const r = new Set(t.returns.required || []), i = function() { }; for (const [o, a] of Object.entries(t.returns.properties)) !r.has(o) && n.prototype[o] === void 0 || (i.prototype[o] = _o(a, e, n.prototype[o])); return i; } function Noe(t, e, n) { const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref]; return _o(i, [...e, ...r], n); } function UR(t, e) { return Mt(t) && !Mt(e) || !Mt(t) && Mt(e) ? t : !Mt(t) || !Mt(e) ? e : globalThis.Object.getOwnPropertyNames(t).reduce((n, r) => { const i = r in e ? UR(t[r], e[r]) : t[r]; return { ...n, [r]: i }; }, {}); } function Poe(t, e, n) { if (Vt(t, e, n)) return n; const r = qs(t, e), i = UR(r, n); return Vt(t, e, i) ? i : r; } function Doe(t, e, n) { throw new RR(t, "Never types cannot be cast"); } function Ooe(t, e, n) { if (Vt(t, e, n)) return n; if (n === null || typeof n != "object") return qs(t, e); const r = new Set(t.required || []), i = {}; for (const [o, a] of Object.entries(t.properties)) !r.has(o) && n[o] === void 0 || (i[o] = _o(a, e, n[o])); if (typeof t.additionalProperties == "object") { const o = Object.getOwnPropertyNames(t.properties); for (const a of Object.getOwnPropertyNames(n)) o.includes(a) || (i[a] = _o(t.additionalProperties, e, n[a])); } return i; } function Foe(t, e, n) { if (Vt(t, e, n)) return ar(n); if (n === null || typeof n != "object" || Array.isArray(n) || n instanceof Date) return qs(t, e); const r = Object.getOwnPropertyNames(t.patternProperties)[0], i = t.patternProperties[r], o = {}; for (const [a, s] of Object.entries(n)) o[a] = _o(i, e, s); return o; } function Moe(t, e, n) { return _o(nn(t, e), e, n); } function Roe(t, e, n) { return _o(nn(t, e), e, n); } function Boe(t, e, n) { return Vt(t, e, n) ? ar(n) : zt(n) ? t.items === void 0 ? [] : t.items.map((r, i) => _o(r, e, n[i])) : qs(t, e); } function Uoe(t, e, n) { return Vt(t, e, n) ? ar(n) : Aoe(t, e, n); } function _o(t, e, n) { const r = qt(t.$id) ? $a(t, e) : e, i = t; switch (t[Ae]) { // -------------------------------------------------------------- // Structural // -------------------------------------------------------------- case "Array": return Toe(i, r, n); case "Constructor": return koe(i, r, n); case "Import": return Noe(i, r, n); case "Intersect": return Poe(i, r, n); case "Never": return Doe(i); case "Object": return Ooe(i, r, n); case "Record": return Foe(i, r, n); case "Ref": return Moe(i, r, n); case "This": return Roe(i, r, n); case "Tuple": return Boe(i, r, n); case "Union": return Uoe(i, r, n); // -------------------------------------------------------------- // DefaultClone // -------------------------------------------------------------- case "Date": case "Symbol": case "Uint8Array": return Ioe(t, e, n); // -------------------------------------------------------------- // Default // -------------------------------------------------------------- default: return Coe(i, r, n); } } function LR(...t) { return t.length === 3 ? _o(t[0], t[1], t[2]) : _o(t[0], [], t[1]); } function Loe(t) { return kl(t) && t[Ae] !== "Unsafe"; } function Qoe(t, e, n) { return zt(n) ? n.map((r) => ni(t.items, e, r)) : n; } function joe(t, e, n) { const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref]; return ni(i, [...e, ...r], n); } function $oe(t, e, n) { const r = t.unevaluatedProperties, o = t.allOf.map((s) => ni(s, e, ar(n))).reduce((s, c) => Mt(c) ? { ...s, ...c } : c, {}); if (!Mt(n) || !Mt(o) || !kl(r)) return o; const a = js(t); for (const s of Object.getOwnPropertyNames(n)) a.includes(s) || Vt(r, e, n[s]) && (o[s] = ni(r, e, n[s])); return o; } function Goe(t, e, n) { if (!Mt(n) || zt(n)) return n; const r = t.additionalProperties; for (const i of Object.getOwnPropertyNames(n)) { if (ft(t.properties, i)) { n[i] = ni(t.properties[i], e, n[i]); continue; } if (kl(r) && Vt(r, e, n[i])) { n[i] = ni(r, e, n[i]); continue; } delete n[i]; } return n; } function qoe(t, e, n) { if (!Mt(n)) return n; const r = t.additionalProperties, i = Object.getOwnPropertyNames(n), [o, a] = Object.entries(t.patternProperties)[0], s = new RegExp(o); for (const c of i) { if (s.test(c)) { n[c] = ni(a, e, n[c]); continue; } if (kl(r) && Vt(r, e, n[c])) { n[c] = ni(r, e, n[c]); continue; } delete n[c]; } return n; } function zoe(t, e, n) { return ni(nn(t, e), e, n); } function Hoe(t, e, n) { return ni(nn(t, e), e, n); } function Woe(t, e, n) { if (!zt(n)) return n; if (ii(t.items)) return []; const r = Math.min(n.length, t.items.length); for (let i = 0; i < r; i++) n[i] = ni(t.items[i], e, n[i]); return n.length > r ? n.slice(0, r) : n; } function Koe(t, e, n) { for (const r of t.anyOf) if (Loe(r) && Vt(r, e, n)) return ni(r, e, n); return n; } function ni(t, e, n) { const r = qt(t.$id) ? $a(t, e) : e, i = t; switch (i[Ae]) { case "Array": return Qoe(i, r, n); case "Import": return joe(i, r, n); case "Intersect": return $oe(i, r, n); case "Object": return Goe(i, r, n); case "Record": return qoe(i, r, n); case "Ref": return zoe(i, r, n); case "This": return Hoe(i, r, n); case "Tuple": return Woe(i, r, n); case "Union": return Koe(i, r, n); default: return n; } } function Voe(...t) { return t.length === 3 ? ni(t[0], t[1], t[2]) : ni(t[0], [], t[1]); } function K0(t) { return qt(t) && !isNaN(t) && !isNaN(parseFloat(t)); } function Yoe(t) { return Ui(t) || Sl(t) || et(t); } function bf(t) { return t === !0 || et(t) && t === 1 || Ui(t) && t === BigInt("1") || qt(t) && (t.toLowerCase() === "true" || t === "1"); } function vf(t) { return t === !1 || et(t) && (t === 0 || Object.is(t, -0)) || Ui(t) && t === BigInt("0") || qt(t) && (t.toLowerCase() === "false" || t === "0" || t === "-0"); } function Joe(t) { return qt(t) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t); } function Xoe(t) { return qt(t) && /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t); } function Zoe(t) { return qt(t) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(t); } function eae(t) { return qt(t) && /^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(t); } function tae(t) { return qt(t) && /^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(t); } function nae(t, e) { const n = jR(t); return n === e ? n : t; } function rae(t, e) { const n = $R(t); return n === e ? n : t; } function iae(t, e) { const n = QR(t); return n === e ? n : t; } function oae(t, e) { return qt(t.const) ? nae(e, t.const) : et(t.const) ? rae(e, t.const) : Sl(t.const) ? iae(e, t.const) : e; } function QR(t) { return bf(t) ? !0 : vf(t) ? !1 : t; } function aae(t) { const e = (n) => n.split(".")[0]; return K0(t) ? BigInt(e(t)) : et(t) ? BigInt(Math.trunc(t)) : vf(t) ? BigInt(0) : bf(t) ? BigInt(1) : t; } function jR(t) { return sf(t) && t.description !== void 0 ? t.description.toString() : Yoe(t) ? t.toString() : t; } function $R(t) { return K0(t) ? parseFloat(t) : bf(t) ? 1 : vf(t) ? 0 : t; } function sae(t) { return K0(t) ? parseInt(t) : et(t) ? Math.trunc(t) : bf(t) ? 1 : vf(t) ? 0 : t; } function cae(t) { return qt(t) && t.toLowerCase() === "null" ? null : t; } function uae(t) { return qt(t) && t === "undefined" ? void 0 : t; } function lae(t) { return wl(t) ? t : et(t) ? new Date(t) : bf(t) ? /* @__PURE__ */ new Date(1) : vf(t) ? /* @__PURE__ */ new Date(0) : K0(t) ? new Date(parseInt(t)) : Xoe(t) ? /* @__PURE__ */ new Date(`1970-01-01T${t}.000Z`) : Joe(t) ? /* @__PURE__ */ new Date(`1970-01-01T${t}`) : eae(t) ? /* @__PURE__ */ new Date(`${t}.000Z`) : Zoe(t) ? new Date(t) : tae(t) ? /* @__PURE__ */ new Date(`${t}T00:00:00.000Z`) : t; } function dae(t, e, n) { return (zt(n) ? n : [n]).map((i) => Eo(t.items, e, i)); } function pae(t, e, n) { return aae(n); } function fae(t, e, n) { return QR(n); } function hae(t, e, n) { return lae(n); } function mae(t, e, n) { const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref]; return Eo(i, [...e, ...r], n); } function gae(t, e, n) { return sae(n); } function yae(t, e, n) { return t.allOf.reduce((r, i) => Eo(i, e, r), n); } function bae(t, e, n) { return oae(t, n); } function vae(t, e, n) { return cae(n); } function xae(t, e, n) { return $R(n); } function wae(t, e, n) { if (!Mt(n) || zt(n)) return n; for (const r of Object.getOwnPropertyNames(t.properties)) ft(n, r) && (n[r] = Eo(t.properties[r], e, n[r])); return n; } function Sae(t, e, n) { if (!(Mt(n) && !zt(n))) return n; const i = Object.getOwnPropertyNames(t.patternProperties)[0], o = t.patternProperties[i]; for (const [a, s] of Object.entries(n)) n[a] = Eo(o, e, s); return n; } function _ae(t, e, n) { return Eo(nn(t, e), e, n); } function Eae(t, e, n) { return jR(n); } function Aae(t, e, n) { return qt(n) || et(n) ? Symbol(n) : n; } function Iae(t, e, n) { return Eo(nn(t, e), e, n); } function Cae(t, e, n) { return zt(n) && !ii(t.items) ? n.map((i, o) => o < t.items.length ? Eo(t.items[o], e, i) : i) : n; } function Tae(t, e, n) { return uae(n); } function kae(t, e, n) { for (const r of t.anyOf) if (Vt(r, e, n)) return n; for (const r of t.anyOf) { const i = Eo(r, e, ar(n)); if (Vt(r, e, i)) return i; } return n; } function Eo(t, e, n) { const r = $a(t, e), i = t; switch (t[Ae]) { case "Array": return dae(i, r, n); case "BigInt": return pae(i, r, n); case "Boolean": return fae(i, r, n); case "Date": return hae(i, r, n); case "Import": return mae(i, r, n); case "Integer": return gae(i, r, n); case "Intersect": return yae(i, r, n); case "Literal": return bae(i, r, n); case "Null": return vae(i, r, n); case "Number": return xae(i, r, n); case "Object": return wae(i, r, n); case "Record": return Sae(i, r, n); case "Ref": return _ae(i, r, n); case "String": return Eae(i, r, n); case "Symbol": return Aae(i, r, n); case "This": return Iae(i, r, n); case "Tuple": return Cae(i, r, n); case "Undefined": return Tae(i, r, n); case "Union": return kae(i, r, n); default: return n; } } function Nae(...t) { return t.length === 3 ? Eo(t[0], t[1], t[2]) : Eo(t[0], [], t[1]); } function qa(t, e) { const n = ft(t, "default") ? t.default : void 0, r = N0(n) ? n() : ar(n); return ii(e) ? r : Mt(e) && Mt(r) ? Object.assign(r, e) : e; } function VS(t) { return kl(t) && "default" in t; } function Pae(t, e, n) { if (zt(n)) { for (let i = 0; i < n.length; i++) n[i] = Br(t.items, e, n[i]); return n; } const r = qa(t, n); if (!zt(r)) return r; for (let i = 0; i < r.length; i++) r[i] = Br(t.items, e, r[i]); return r; } function Dae(t, e, n) { return wl(n) ? n : qa(t, n); } function Oae(t, e, n) { const r = globalThis.Object.values(t.$defs), i = t.$defs[t.$ref]; return Br(i, [...e, ...r], n); } function Fae(t, e, n) { const r = qa(t, n); return t.allOf.reduce((i, o) => { const a = Br(o, e, r); return Mt(a) ? { ...i, ...a } : a; }, {}); } function Mae(t, e, n) { const r = qa(t, n); if (!Mt(r)) return r; const i = Object.getOwnPropertyNames(t.properties); for (const o of i) { const a = Br(t.properties[o], e, r[o]); ii(a) || (r[o] = Br(t.properties[o], e, r[o])); } if (!VS(t.additionalProperties)) return r; for (const o of Object.getOwnPropertyNames(r)) i.includes(o) || (r[o] = Br(t.additionalProperties, e, r[o])); return r; } function Rae(t, e, n) { const r = qa(t, n); if (!Mt(r)) return r; const i = t.additionalProperties, [o, a] = Object.entries(t.patternProperties)[0], s = new RegExp(o); for (const c of Object.getOwnPropertyNames(r)) s.test(c) && VS(a) && (r[c] = Br(a, e, r[c])); if (!VS(i)) return r; for (const c of Object.getOwnPropertyNames(r)) s.test(c) || (r[c] = Br(i, e, r[c])); return r; } function Bae(t, e, n) { return Br(nn(t, e), e, qa(t, n)); } function Uae(t, e, n) { return Br(nn(t, e), e, n); } function Lae(t, e, n) { const r = qa(t, n); if (!zt(r) || ii(t.items)) return r; const [i, o] = [t.items, Math.max(t.items.length, r.length)]; for (let a = 0; a < o; a++) a < i.length && (r[a] = Br(i[a], e, r[a])); return r; } function Qae(t, e, n) { const r = qa(t, n); for (const i of t.anyOf) { const o = Br(i, e, ar(r)); if (Vt(i, e, o)) return o; } return r; } function Br(t, e, n) { const r = $a(t, e), i = t; switch (i[Ae]) { case "Array": return Pae(i, r, n); case "Date": return Dae(i, r, n); case "Import": return Oae(i, r, n); case "Intersect": return Fae(i, r, n); case "Object": return Mae(i, r, n); case "Record": return Rae(i, r, n); case "Ref": return Bae(i, r, n); case "This": return Uae(i, r, n); case "Tuple": return Lae(i, r, n); case "Union": return Qae(i, r, n); default: return qa(i, n); } } function jae(...t) { return t.length === 3 ? Br(t[0], t[1], t[2]) : Br(t[0], [], t[1]); } class GR extends wn { constructor(e) { super(e); } } var YS; (function(t) { const e = /* @__PURE__ */ new Map([ ["Assert", (o, a, s) => (Rie(o, a, s), s)], ["Cast", (o, a, s) => LR(o, a, s)], ["Clean", (o, a, s) => Voe(o, a, s)], ["Clone", (o, a, s) => ar(s)], ["Convert", (o, a, s) => Nae(o, a, s)], ["Decode", (o, a, s) => zS(o, a) ? PR(o, a, s) : s], ["Default", (o, a, s) => jae(o, a, s)], ["Encode", (o, a, s) => zS(o, a) ? DR(o, a, s) : s] ]); function n(o) { e.delete(o); } t.Delete = n; function r(o, a) { e.set(o, a); } t.Set = r; function i(o) { return e.get(o); } t.Get = i; })(YS || (YS = {})); const B8 = [ "Clone", "Clean", "Default", "Convert", "Assert", "Decode" ]; function $ae(t, e, n, r) { return t.reduce((i, o) => { const a = YS.Get(o); if (ii(a)) throw new GR(`Unable to find Parse operation '${o}'`); return a(e, n, i); }, r); } function wc(...t) { const [e, n, r, i] = t.length === 4 ? [t[0], t[1], t[2], t[3]] : t.length === 3 ? zt(t[0]) ? [t[0], t[1], [], t[2]] : [B8, t[0], t[1], t[2]] : t.length === 2 ? [B8, t[0], [], t[1]] : (() => { throw new GR("Invalid Arguments"); })(); return $ae(e, n, r, i); } class ZE { name; core; configPath; configData = {}; configSchema; validate; constructor(e, n, r, i) { this.name = e, this.core = n, this.configPath = r, this.configSchema = i, this.validate = zu.Compile(i), qe.mkdirSync(this.configPath, { recursive: !0 }), this.read(); } getConfigPath(e) { const n = e ? `${this.name}_${e}.json` : `${this.name}.json`; return xe.join(this.configPath, n); } read() { const e = this.getConfigPath(this.core.selfInfo.uin), n = this.getConfigPath(); return qe.existsSync(e) ? this.loadConfig(e) : (qe.existsSync(n) && (this.configData = this.loadConfig(n)), this.save(), this.configData); } loadConfig(e) { try { let r = Gi.parse(qe.readFileSync(e, "utf-8")); if (r = wc(this.configSchema, r), !this.validate.Check(r)) throw new Error([...this.validate.Errors(r)].map((i) => i.message).join(", ")); return this.configData = r, this.core.context.logger.logDebug(`[Core] [Config] 配置文件${e}加载`, this.configData), this.configData; } catch (n) { return this.handleError(n, "读取配置文件时发生错误"), {}; } } save(e = this.configData) { const n = this.getConfigPath(this.core.selfInfo.uin); let r = e; if (r = wc(this.configSchema, r), !this.validate.Check(r)) throw new Error([...this.validate.Errors(r)].map((i) => i.message).join(", ")); this.configData = r; try { qe.writeFileSync(n, JSON.stringify(this.configData, null, 2)); } catch (i) { this.handleError(i, `保存配置文件 ${n} 时发生错误:`); } } handleError(e, n) { e instanceof SyntaxError ? this.core.context.logger.logError("[Core] [Config] 操作配置文件格式错误,请检查配置文件:", e.message) : this.core.context.logger.logError(`[Core] [Config] ${n}:`, e.message); } } function eA(t, e) { return bi(e === void 0 ? t : { ...e, ...t }); } function Gae(t) { return Pe({ [Ae]: "Argument", index: t }); } function qae(t, e) { return jn("Awaited", [jn(t, e)]); } function zae(t) { return jn("Awaited", [Dl(t)]); } function Hae(t) { return Us(qR(t)); } function Wae(t) { return Sr(qR(t)); } function Kae(t) { return V0(t); } function qR(t) { return t.map((e) => V0(e)); } function V0(t, e) { return Pe(El(t) ? qae(t.target, t.parameters) : Vi(t) ? Hae(t.allOf) : sr(t) ? Wae(t.anyOf) : M0(t) ? Kae(t.item) : ei(t) ? zae(t.$ref) : t, e); } function Vae(t) { const e = []; for (const n of t) e.push(...js(n)); return Tee(e); } function Yae(t) { return t.filter((e) => !ff(e)); } function Jae(t, e) { const n = []; for (const r of t) n.push(...LE(r, [e])); return Yae(n); } function Xae(t, e) { const n = {}; for (const r of e) n[r] = ZM(Jae(t, r)); return n; } function Zae(t, e) { const n = Vae(t), r = Xae(t, n); return or(r, e); } function zR(t) { return Pe({ [Ae]: "Date", type: "Date" }, t); } function HR(t) { return Pe({ [Ae]: "Null", type: "null" }, t); } function WR(t) { return Pe({ [Ae]: "Symbol", type: "symbol" }, t); } function KR(t) { return Pe({ [Ae]: "Undefined", type: "undefined" }, t); } function VR(t) { return Pe({ [Ae]: "Uint8Array", type: "Uint8Array" }, t); } function ese(t) { return t.map((e) => tA(e, !1)); } function tse(t) { const e = {}; for (const n of globalThis.Object.getOwnPropertyNames(t)) e[n] = Qs(tA(t[n], !1)); return e; } function Yh(t, e) { return e === !0 ? t : Qs(t); } function tA(t, e) { return eZ(t) || nZ(t) ? Yh(wp(), e) : oi(t) ? Qs(Pl(ese(t))) : uf(t) ? VR() : TE(t) ? zR() : kn(t) ? Yh(or(tse(t)), e) : tZ(t) ? Yh(df([], L0()), e) : _n(t) ? KR() : rZ(t) ? HR() : iZ(t) ? WR() : WM(t) ? UE() : ea(t) || cf(t) || xn(t) ? Cn(t) : or({}); } function nse(t, e) { return Pe(tA(t, !0), e); } function rse(t, e) { return Al(t) ? Pl(t.parameters, e) : cn(e); } function ise(t, e) { if (_n(t)) throw new Error("Enum undefined or empty"); const n = globalThis.Object.getOwnPropertyNames(t).filter((o) => isNaN(o)).map((o) => t[o]), i = [...new Set(n)].map((o) => Cn(o)); return Sr(i, { ...e, [P0]: "Enum" }); } function ose(t, e) { return nA(dg(t), e); } function ase(t, e) { const n = t.filter((r) => yf(r, e) === pe.False); return n.length === 1 ? n[0] : Sr(n); } function nA(t, e, n = {}) { return jc(t) ? Pe(ose(t, e), n) : Ai(t) ? Pe(use(t, e), n) : Pe(sr(t) ? ase(t.anyOf, e) : yf(t, e) !== pe.False ? cn() : t, n); } function sse(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = nA(t[r], e); return n; } function cse(t, e) { return sse(t.properties, e); } function use(t, e) { const n = cse(t, e); return wr(n); } function lse(t, e) { return rA(dg(t), e); } function dse(t, e) { const n = t.filter((r) => yf(r, e) !== pe.False); return n.length === 1 ? n[0] : Sr(n); } function rA(t, e, n) { return jc(t) ? Pe(lse(t, e), n) : Ai(t) ? Pe(hse(t, e), n) : Pe(sr(t) ? dse(t.anyOf, e) : yf(t, e) !== pe.False ? t : cn(), n); } function pse(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = rA(t[r], e); return n; } function fse(t, e) { return pse(t.properties, e); } function hse(t, e) { const n = fse(t, e); return wr(n); } function mse(t, e) { return Al(t) ? Pe(t.returns, e) : cn(e); } function YR(t) { return Qs(Bs(t)); } function Wc(t, e, n) { return Pe({ [Ae]: "Record", type: "object", patternProperties: { [t]: e } }, n); } function iA(t, e, n) { const r = {}; for (const i of t) r[i] = e; return or(r, { ...n, [P0]: "Record" }); } function gse(t, e, n) { return tR(t) ? iA(Ls(t), e, n) : Wc(t.pattern, e, n); } function yse(t, e, n) { return iA(Ls(Sr(t)), e, n); } function bse(t, e, n) { return iA([t.toString()], e, n); } function vse(t, e, n) { return Wc(t.source, e, n); } function xse(t, e, n) { const r = _n(t.pattern) ? ju : t.pattern; return Wc(r, e, n); } function wse(t, e, n) { return Wc(ju, e, n); } function Sse(t, e, n) { return Wc(ZZ, e, n); } function _se(t, e, n) { return or({ true: e, false: e }, n); } function Ese(t, e, n) { return Wc(Qu, e, n); } function Ase(t, e, n) { return Wc(Qu, e, n); } function JR(t, e, n = {}) { return sr(t) ? yse(t.anyOf, e, n) : jc(t) ? gse(t, e, n) : Lc(t) ? bse(t.const, e, n) : pf(t) ? _se(t, e, n) : Cl(t) ? Ese(t, e, n) : Tl(t) ? Ase(t, e, n) : XM(t) ? vse(t, e, n) : hf(t) ? xse(t, e, n) : VM(t) ? wse(t, e, n) : ff(t) ? Sse(t, e, n) : cn(n); } function oA(t) { return globalThis.Object.getOwnPropertyNames(t.patternProperties)[0]; } function Ise(t) { const e = oA(t); return e === ju ? vc() : e === Qu ? Gc() : vc({ pattern: e }); } function XR(t) { return t.patternProperties[oA(t)]; } function Cse(t, e) { return e.parameters = xf(t, e.parameters), e.returns = Ao(t, e.returns), e; } function Tse(t, e) { return e.parameters = xf(t, e.parameters), e.returns = Ao(t, e.returns), e; } function kse(t, e) { return e.allOf = xf(t, e.allOf), e; } function Nse(t, e) { return e.anyOf = xf(t, e.anyOf), e; } function Pse(t, e) { return _n(e.items) || (e.items = xf(t, e.items)), e; } function Dse(t, e) { return e.items = Ao(t, e.items), e; } function Ose(t, e) { return e.items = Ao(t, e.items), e; } function Fse(t, e) { return e.items = Ao(t, e.items), e; } function Mse(t, e) { return e.item = Ao(t, e.item), e; } function Rse(t, e) { const n = Qse(t, e.properties); return { ...e, ...or(n) }; } function Bse(t, e) { const n = Ao(t, Ise(e)), r = Ao(t, XR(e)), i = JR(n, r); return { ...e, ...i }; } function Use(t, e) { return e.index in t ? t[e.index] : L0(); } function Lse(t, e) { const n = DE(e), r = Rs(e), i = Ao(t, e); return n && r ? YR(i) : n && !r ? Qs(i) : !n && r ? Bs(i) : i; } function Qse(t, e) { return globalThis.Object.getOwnPropertyNames(e).reduce((n, r) => ({ ...n, [r]: Lse(t, e[r]) }), {}); } function xf(t, e) { return e.map((n) => Ao(t, n)); } function Ao(t, e) { return Al(e) ? Cse(t, e) : Il(e) ? Tse(t, e) : Vi(e) ? kse(t, e) : sr(e) ? Nse(t, e) : $c(e) ? Pse(t, e) : _l(e) ? Dse(t, e) : D0(e) ? Ose(t, e) : F0(e) ? Fse(t, e) : M0(e) ? Mse(t, e) : Oo(e) ? Rse(t, e) : R0(e) ? Bse(t, e) : YM(e) ? Use(t, e) : e; } function jse(t, e) { return Ao(e, eA(t)); } function $se(t) { return Pe({ [Ae]: "Integer", type: "integer" }, t); } function Gse(t, e, n) { return { [t]: Ml(Cn(t), e, bi(n)) }; } function qse(t, e, n) { return t.reduce((i, o) => ({ ...i, ...Gse(o, e, n) }), {}); } function zse(t, e, n) { return qse(t.keys, e, n); } function Hse(t, e, n) { const r = zse(t, e, n); return wr(r); } function Wse(t) { const [e, n] = [t.slice(0, 1), t.slice(1)]; return [e.toLowerCase(), n].join(""); } function Kse(t) { const [e, n] = [t.slice(0, 1), t.slice(1)]; return [e.toUpperCase(), n].join(""); } function Vse(t) { return t.toUpperCase(); } function Yse(t) { return t.toLowerCase(); } function Jse(t, e, n) { const r = RE(t.pattern); if (!xp(r)) return { ...t, pattern: ZR(t.pattern, e) }; const a = [...B0(r)].map((u) => Cn(u)), s = eB(a, e), c = Sr(s); return aR([c], n); } function ZR(t, e) { return typeof t == "string" ? e === "Uncapitalize" ? Wse(t) : e === "Capitalize" ? Kse(t) : e === "Uppercase" ? Vse(t) : e === "Lowercase" ? Yse(t) : t : t.toString(); } function eB(t, e) { return t.map((n) => Ml(n, e)); } function Ml(t, e, n = {}) { return ( // Intrinsic-Mapped-Inference Qc(t) ? Hse(t, e, n) : ( // Standard-Inference jc(t) ? Jse(t, e, n) : sr(t) ? Sr(eB(t.anyOf, e), n) : Lc(t) ? Cn(ZR(t.const, e), n) : ( // Default Type Pe(t, n) ) ) ); } function Xse(t, e = {}) { return Ml(t, "Capitalize", e); } function Zse(t, e = {}) { return Ml(t, "Lowercase", e); } function ece(t, e = {}) { return Ml(t, "Uncapitalize", e); } function tce(t, e = {}) { return Ml(t, "Uppercase", e); } function nce(t, e, n) { const r = {}; for (const i of globalThis.Object.getOwnPropertyNames(t)) r[i] = Y0(t[i], e, bi(n)); return r; } function rce(t, e, n) { return nce(t.properties, e, n); } function ice(t, e, n) { const r = rce(t, e, n); return wr(r); } function oce(t, e) { return t.map((n) => aA(n, e)); } function ace(t, e) { return t.map((n) => aA(n, e)); } function sce(t, e) { const { [e]: n, ...r } = t; return r; } function cce(t, e) { return e.reduce((n, r) => sce(n, r), t); } function uce(t, e, n) { const r = vi(t, [Vr, "$id", "required", "properties"]), i = cce(n, e); return or(i, r); } function lce(t) { const e = t.reduce((n, r) => JM(r) ? [...n, Cn(r)] : n, []); return Sr(e); } function aA(t, e) { return Vi(t) ? Us(oce(t.allOf, e)) : sr(t) ? Sr(ace(t.anyOf, e)) : Oo(t) ? uce(t, e, t.properties) : or({}); } function Y0(t, e, n) { const r = oi(e) ? lce(e) : e, i = Rr(e) ? Ls(e) : e, o = ei(t), a = ei(e); return Ai(t) ? ice(t, i, n) : Qc(e) ? hce(t, e, n) : o && a ? jn("Omit", [t, r], n) : !o && a ? jn("Omit", [t, r], n) : o && !a ? jn("Omit", [t, r], n) : Pe({ ...aA(t, i), ...n }); } function dce(t, e, n) { return { [e]: Y0(t, [e], bi(n)) }; } function pce(t, e, n) { return e.reduce((r, i) => ({ ...r, ...dce(t, i, n) }), {}); } function fce(t, e, n) { return pce(t, e.keys, n); } function hce(t, e, n) { const r = fce(t, e, n); return wr(r); } function mce(t, e, n) { const r = {}; for (const i of globalThis.Object.getOwnPropertyNames(t)) r[i] = J0(t[i], e, bi(n)); return r; } function gce(t, e, n) { return mce(t.properties, e, n); } function yce(t, e, n) { const r = gce(t, e, n); return wr(r); } function bce(t, e) { return t.map((n) => sA(n, e)); } function vce(t, e) { return t.map((n) => sA(n, e)); } function xce(t, e) { const n = {}; for (const r of e) r in t && (n[r] = t[r]); return n; } function wce(t, e, n) { const r = vi(t, [Vr, "$id", "required", "properties"]), i = xce(n, e); return or(i, r); } function Sce(t) { const e = t.reduce((n, r) => JM(r) ? [...n, Cn(r)] : n, []); return Sr(e); } function sA(t, e) { return Vi(t) ? Us(bce(t.allOf, e)) : sr(t) ? Sr(vce(t.anyOf, e)) : Oo(t) ? wce(t, e, t.properties) : or({}); } function J0(t, e, n) { const r = oi(e) ? Sce(e) : e, i = Rr(e) ? Ls(e) : e, o = ei(t), a = ei(e); return Ai(t) ? yce(t, i, n) : Qc(e) ? Ice(t, e, n) : o && a ? jn("Pick", [t, r], n) : !o && a ? jn("Pick", [t, r], n) : o && !a ? jn("Pick", [t, r], n) : Pe({ ...sA(t, i), ...n }); } function _ce(t, e, n) { return { [e]: J0(t, [e], bi(n)) }; } function Ece(t, e, n) { return e.reduce((r, i) => ({ ...r, ..._ce(t, i, n) }), {}); } function Ace(t, e, n) { return Ece(t, e.keys, n); } function Ice(t, e, n) { const r = Ace(t, e, n); return wr(r); } function Cce(t, e) { return jn("Partial", [jn(t, e)]); } function Tce(t) { return jn("Partial", [Dl(t)]); } function kce(t) { const e = {}; for (const n of globalThis.Object.getOwnPropertyNames(t)) e[n] = Bs(t[n]); return e; } function Nce(t, e) { const n = vi(t, [Vr, "$id", "required", "properties"]), r = kce(e); return or(r, n); } function U8(t) { return t.map((e) => tB(e)); } function tB(t) { return ( // Mappable El(t) ? Cce(t.target, t.parameters) : ei(t) ? Tce(t.$ref) : Vi(t) ? Us(U8(t.allOf)) : sr(t) ? Sr(U8(t.anyOf)) : Oo(t) ? Nce(t, t.properties) : ( // Intrinsic O0(t) || pf(t) || Cl(t) || Lc(t) || OE(t) || Tl(t) || hf(t) || FE(t) || mf(t) ? t : ( // Passthrough or({}) ) ) ); } function cA(t, e) { return Ai(t) ? Oce(t, e) : Pe({ ...tB(t), ...e }); } function Pce(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = cA(t[r], bi(e)); return n; } function Dce(t, e) { return Pce(t.properties, e); } function Oce(t, e) { const n = Dce(t, e); return wr(n); } function Fce(t, e) { return jn("Required", [jn(t, e)]); } function Mce(t) { return jn("Required", [Dl(t)]); } function Rce(t) { const e = {}; for (const n of globalThis.Object.getOwnPropertyNames(t)) e[n] = vi(t[n], [ja]); return e; } function Bce(t, e) { const n = vi(t, [Vr, "$id", "required", "properties"]), r = Rce(e); return or(r, n); } function L8(t) { return t.map((e) => nB(e)); } function nB(t) { return ( // Mappable El(t) ? Fce(t.target, t.parameters) : ei(t) ? Mce(t.$ref) : Vi(t) ? Us(L8(t.allOf)) : sr(t) ? Sr(L8(t.anyOf)) : Oo(t) ? Bce(t, t.properties) : ( // Intrinsic O0(t) || pf(t) || Cl(t) || Lc(t) || OE(t) || Tl(t) || hf(t) || FE(t) || mf(t) ? t : ( // Passthrough or({}) ) ) ); } function uA(t, e) { return Ai(t) ? Qce(t, e) : Pe({ ...nB(t), ...e }); } function Uce(t, e) { const n = {}; for (const r of globalThis.Object.getOwnPropertyNames(t)) n[r] = uA(t[r], e); return n; } function Lce(t, e) { return Uce(t.properties, e); } function Qce(t, e) { const n = Lce(t, e); return wr(n); } function jce(t, e) { return e.map((n) => ei(n) ? lA(t, n.$ref) : Si(t, n)); } function lA(t, e) { return e in t ? ei(t[e]) ? lA(t, t[e].$ref) : Si(t, t[e]) : cn(); } function $ce(t) { return V0(t[0]); } function Gce(t) { return U0(t[0], t[1]); } function qce(t) { return jE(t[0]); } function zce(t) { return cA(t[0]); } function Hce(t) { return Y0(t[0], t[1]); } function Wce(t) { return J0(t[0], t[1]); } function Kce(t) { return uA(t[0]); } function Vce(t, e, n) { const r = jce(t, n); return e === "Awaited" ? $ce(r) : e === "Index" ? Gce(r) : e === "KeyOf" ? qce(r) : e === "Partial" ? zce(r) : e === "Omit" ? Hce(r) : e === "Pick" ? Wce(r) : e === "Required" ? Kce(r) : cn(); } function Yce(t, e) { return kE(Si(t, e)); } function Jce(t, e) { return NE(Si(t, e)); } function Xce(t, e, n) { return PE(wf(t, e), Si(t, n)); } function Zce(t, e, n) { return df(wf(t, e), Si(t, n)); } function eue(t, e) { return Us(wf(t, e)); } function tue(t, e) { return QE(Si(t, e)); } function nue(t, e) { return or(globalThis.Object.keys(e).reduce((n, r) => ({ ...n, [r]: Si(t, e[r]) }), {})); } function rue(t, e) { const [n, r] = [Si(t, XR(e)), oA(e)], i = eA(e); return i.patternProperties[r] = n, i; } function iue(t, e) { return ei(e) ? { ...lA(t, e.$ref), [Vr]: e[Vr] } : e; } function oue(t, e) { return Pl(wf(t, e)); } function aue(t, e) { return Sr(wf(t, e)); } function wf(t, e) { return e.map((n) => Si(t, n)); } function Si(t, e) { return ( // Modifiers Rs(e) ? Pe(Si(t, vi(e, [ja])), e) : DE(e) ? Pe(Si(t, vi(e, [lf])), e) : ( // Transform Kt(e) ? Pe(iue(t, e), e) : ( // Types _l(e) ? Pe(Yce(t, e.items), e) : D0(e) ? Pe(Jce(t, e.items), e) : El(e) ? Pe(Vce(t, e.target, e.parameters)) : Al(e) ? Pe(Xce(t, e.parameters, e.returns), e) : Il(e) ? Pe(Zce(t, e.parameters, e.returns), e) : Vi(e) ? Pe(eue(t, e.allOf), e) : F0(e) ? Pe(tue(t, e.items), e) : Oo(e) ? Pe(nue(t, e.properties), e) : R0(e) ? Pe(rue(t, e)) : $c(e) ? Pe(oue(t, e.items || []), e) : sr(e) ? Pe(aue(t, e.anyOf), e) : e ) ) ); } function sue(t, e) { return e in t ? Si(t, t[e]) : cn(); } function cue(t) { return globalThis.Object.getOwnPropertyNames(t).reduce((e, n) => ({ ...e, [n]: sue(t, n) }), {}); } class uue { constructor(e) { const n = cue(e), r = this.WithIdentifiers(n); this.$defs = r; } /** `[Json]` Imports a Type by Key. */ Import(e, n) { const r = { ...this.$defs, [e]: Pe(this.$defs[e], n) }; return Pe({ [Ae]: "Import", $defs: r, $ref: e }); } // prettier-ignore WithIdentifiers(e) { return globalThis.Object.getOwnPropertyNames(e).reduce((n, r) => ({ ...n, [r]: { ...e[r], $id: r } }), {}); } } function lue(t) { return new uue(t); } function due(t, e) { return Pe({ [Ae]: "Not", not: t }, e); } function pue(t, e) { return Il(t) ? Pl(t.parameters, e) : cn(); } let fue = 0; function hue(t, e = {}) { _n(e.$id) && (e.$id = `T${fue++}`); const n = eA(t({ [Ae]: "This", $ref: `${e.$id}` })); return n.$id = e.$id, Pe({ [P0]: "Recursive", ...n }, e); } function mue(t, e) { const n = xn(t) ? new globalThis.RegExp(t) : t; return Pe({ [Ae]: "RegExp", type: "RegExp", source: n.source, flags: n.flags }, e); } function gue(t) { return Vi(t) ? t.allOf : sr(t) ? t.anyOf : $c(t) ? t.items ?? [] : []; } function yue(t) { return gue(t); } function bue(t, e) { return Il(t) ? Pe(t.returns, e) : cn(e); } class vue { constructor(e) { this.schema = e; } Decode(e) { return new xue(this.schema, e); } } class xue { constructor(e, n) { this.schema = e, this.decode = n; } EncodeTransform(e, n) { const o = { Encode: (a) => n[Vr].Encode(e(a)), Decode: (a) => this.decode(n[Vr].Decode(a)) }; return { ...n, [Vr]: o }; } EncodeSchema(e, n) { const r = { Decode: this.decode, Encode: e }; return { ...n, [Vr]: r }; } Encode(e) { return Kt(this.schema) ? this.EncodeTransform(e, this.schema) : this.EncodeSchema(e, this.schema); } } function wue(t) { return new vue(t); } function Sue(t) { return Pe({ [Ae]: "Void", type: "void" }, t); } const _ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Any: wp, Argument: Gae, Array: kE, AsyncIterator: NE, Awaited: V0, BigInt: UE, Boolean: rR, Capitalize: Xse, Composite: Zae, Const: nse, Constructor: PE, ConstructorParameters: rse, Date: zR, Enum: ise, Exclude: nA, Extends: JE, Extract: rA, Function: df, Index: U0, InstanceType: mse, Instantiate: jse, Integer: $se, Intersect: Us, Iterator: QE, KeyOf: jE, Literal: Cn, Lowercase: Zse, Mapped: Lee, Module: lue, Never: cn, Not: due, Null: HR, Number: Gc, Object: or, Omit: Y0, Optional: Bs, Parameters: pue, Partial: cA, Pick: J0, Promise: uR, Readonly: Qs, ReadonlyOptional: YR, Record: JR, Recursive: hue, Ref: Dl, RegExp: mue, Required: uA, Rest: yue, ReturnType: bue, String: vc, Symbol: WR, TemplateLiteral: aR, Transform: wue, Tuple: Pl, Uint8Array: VR, Uncapitalize: ece, Undefined: KR, Union: Sr, Unknown: L0, Unsafe: pZ, Uppercase: tce, Void: Sue }, Symbol.toStringTag, { value: "Module" })), l = _ue, Eue = l.Object({ hook: l.Boolean({ default: !0 }), window: l.Boolean({ default: !0 }), module: l.Boolean({ default: !0 }), process: l.Boolean({ default: !0 }), container: l.Boolean({ default: !0 }), js: l.Boolean({ default: !0 }) }), dA = l.Object({ fileLog: l.Boolean({ default: !1 }), consoleLog: l.Boolean({ default: !0 }), fileLogLevel: l.String({ default: "debug" }), consoleLogLevel: l.String({ default: "info" }), packetBackend: l.String({ default: "auto" }), packetServer: l.String({ default: "" }), o3HookMode: l.Number({ default: 0 }), autoTimeSync: l.Boolean({ default: !0 }), bypass: l.Optional(Eue) }); function Aue(t) { let e = {}; try { const n = xe.join(t, "napcat.json"); qe.existsSync(n) && (e = Gi.parse(qe.readFileSync(n, "utf-8"))); } catch { } return e = wc(dA, e), e; } class Iue extends ZE { constructor(e, n, r) { super("napcat", e, n, r); } } class Cue { onNTSessionCreate(e) { } onGProSessionCreate(e) { } onSessionInitComplete(e) { } onOpentelemetryInit(e) { } onUserOnlineResult(e) { } onGetSelfTinyId(e) { } } class Tue { onLoginConnected() { } onLoginDisConnected(...e) { } onLoginConnecting(...e) { } onQRCodeGetPicture(e) { } onQRCodeLoginPollingStarted(...e) { } onQRCodeSessionUserScaned(...e) { } onQRCodeLoginSucceed(e) { } onQRCodeSessionFailed(...e) { } onLoginFailed(...e) { } onLogoutSucceed(...e) { } onLogoutFailed(...e) { } onUserLoggedIn(...e) { } onQRCodeSessionQuickLoginFailed(...e) { } onPasswordLoginFailed(...e) { } OnConfirmUnusualDeviceFailed(...e) { } onQQLoginNumLimited(...e) { } onLoginState(...e) { } onLoginRecordUpdate(...e) { } } class rB { onAddSendMsg(e) { } onBroadcastHelperDownloadComplete(e) { } onBroadcastHelperProgressUpdate(e) { } onChannelFreqLimitInfoUpdate(e, n, r) { } onContactUnreadCntUpdate(e) { } onCustomWithdrawConfigUpdate(e) { } onDraftUpdate(e, n, r) { } onEmojiDownloadComplete(e) { } onEmojiResourceUpdate(e) { } onFeedEventUpdate(e) { } onFileMsgCome(e) { } onFirstViewDirectMsgUpdate(e) { } onFirstViewGroupGuildMapping(e) { } onGrabPasswordRedBag(e, n, r, i, o) { } onGroupFileInfoAdd(e) { } onGroupFileInfoUpdate(e) { } onGroupGuildUpdate(e) { } onGroupTransferInfoAdd(e) { } onGroupTransferInfoUpdate(e) { } onGuildInteractiveUpdate(e) { } onGuildMsgAbFlagChanged(e) { } onGuildNotificationAbstractUpdate(e) { } onHitCsRelatedEmojiResult(e) { } onHitEmojiKeywordResult(e) { } onHitRelatedEmojiResult(e) { } onImportOldDbProgressUpdate(e) { } onInputStatusPush(e) { } onKickedOffLine(e) { } onLineDev(e) { } onLogLevelChanged(e) { } onMsgAbstractUpdate(e) { } onMsgBoxChanged(e) { } onMsgDelete(e, n) { } onMsgEventListUpdate(e) { } onMsgInfoListAdd(e) { } onMsgInfoListUpdate(e) { } onMsgQRCodeStatusChanged(e) { } onMsgRecall(e, n, r) { } onMsgSecurityNotify(e) { } onMsgSettingUpdate(e) { } onNtFirstViewMsgSyncEnd() { } onNtMsgSyncEnd() { } onNtMsgSyncStart() { } // 9.9.37-54395 新增:联系人未读同步回调,等价 onNtMsgSyncEnd 时机 onNtMsgSyncContactUnread(...e) { return this.onNtMsgSyncEnd(); } onReadFeedEventUpdate(e) { } onRecvGroupGuildFlag(e) { } onRecvMsg(e) { } onRecvMsgSvrRspTransInfo(e, n, r, i, o, a) { } onRecvOnlineFileMsg(e) { } onRecvS2CMsg(e) { } onRecvSysMsg(e) { } onRecvUDCFlag(e) { } onRichMediaDownloadComplete(e) { } onRichMediaProgerssUpdate(e) { } onRichMediaUploadComplete(e) { } onSearchGroupFileInfoUpdate(e) { } onSendMsgError(e, n, r, i) { } onSysMsgNotification(e, n, r, i) { } onTempChatInfoUpdate(e) { } onUnreadCntAfterFirstView(e) { } onUnreadCntUpdate(e) { } onUserChannelTabStatusChanged(e) { } onUserOnlineStatusChanged(e) { } onUserTabStatusChanged(e) { } onlineStatusBigIconDownloadPush(e, n, r) { } onlineStatusSmallIconDownloadPush(e, n, r) { } // 第一次发现于Linux onUserSecQualityChanged(...e) { } onMsgWithRichLinkInfoUpdate(...e) { } onRedTouchChanged(...e) { } // 第一次发现于Win 9.9.9-23159 onBroadcastHelperProgerssUpdate(...e) { } } class kue { onGroupListInited(e) { } // 发现于Win 9.9.9 23159 onGroupMemberLevelInfoChange(...e) { } onGetGroupBulletinListResult(...e) { } onGroupAllInfoChange(...e) { } // 9.9.37-54395 新增:群通知类回调改为 List 形态,兼容映射到旧回调 onGroupAllInfoListChange(...e) { return this.onGroupAllInfoChange(...e); } onGroupDetailInfoListChange(...e) { return this.onGroupDetailInfoChange(...e); } onGroupAIOSlotInfoChange(...e) { } onGroupNotifiesUpdatedV2(...e) { return this.onGroupNotifiesUpdated(...e); } onGroupNotifiesUnreadCountUpdatedV2(...e) { return this.onGroupNotifiesUnreadCountUpdated(...e); } onGroupBulletinChange(...e) { } onGroupBulletinRemindNotify(...e) { } onGroupArkInviteStateResult(...e) { } onGroupBulletinRichMediaDownloadComplete(...e) { } onGroupConfMemberChange(...e) { } onGroupDetailInfoChange(e) { } onGroupExtListUpdate(...e) { } onGroupFirstBulletinNotify(...e) { } onGroupListUpdate(e, n) { } onGroupNotifiesUpdated(e, n) { } onGroupBulletinRichMediaProgressUpdate(...e) { } onGroupNotifiesUnreadCountUpdated(...e) { } onGroupSingleScreenNotifies(e, n, r) { } onGroupsMsgMaskResult(...e) { } onGroupStatisticInfoChange(...e) { } onJoinGroupNotify(...e) { } onJoinGroupNoVerifyFlag(...e) { } onMemberInfoChange(e, n, r) { } onMemberListChange(e) { } onSearchMemberChange(...e) { } onShutUpMemberListChanged(e, n) { } } class Nue { onBuddyListChangedV2(e) { } onAddBuddyNeedVerify(e) { } onAddMeSettingChanged(e) { } onAvatarUrlUpdated(e) { } onBlockChanged(e) { } onBuddyDetailInfoChange(e) { } onBuddyInfoChange(e) { } onBuddyListChange(e) { } onBuddyRemarkUpdated(e) { } onBuddyReqChange(e) { } onBuddyReqUnreadCntChange(e) { } onCheckBuddySettingResult(e) { } onDelBatchBuddyInfos(e) { } onDoubtBuddyReqChange(e) { } onDoubtBuddyReqUnreadNumChange(e) { } onNickUpdated(e) { } onSmartInfos(e) { } onSpacePermissionInfos(e) { } } class Pue { onUserDetailInfoChanged(e) { } onProfileSimpleChanged(...e) { } onProfileDetailInfoChanged(e) { } onStatusUpdate(...e) { } onSelfStatusChanged(...e) { } onStrangerRemarkChanged(...e) { } onMemberListChange(...e) { } onMemberInfoChange(...e) { } onGroupListUpdate(...e) { } onGroupAllInfoChange(...e) { } onGroupDetailInfoChange(...e) { } onGroupConfMemberChange(...e) { } onGroupExtListUpdate(...e) { } onGroupNotifiesUpdated(...e) { } onGroupNotifiesUnreadCountUpdated(...e) { } onGroupMemberLevelInfoChange(...e) { } onGroupBulletinChange(...e) { } } function Due(t) { return { get(e, n, r) { return typeof e[n] > "u" ? (...i) => { t.logDebug(`${e.constructor.name} has no method ${n}`); } : Reflect.get(e, n, r); } }; } function Nu(t, e) { return new Proxy(t, Due(e)); } class pA { emitter = new y7(); on(e, n) { return this.emitter.on(e, n), () => this.off(e, n); } once(e, n) { this.emitter.once(e, n); } off(e, n) { this.emitter.off(e, n); } emit(e, n) { this.emitter.emit(e, n); } } const Oue = new pA(), Hx = Date.now.bind(Date); function Fue(t) { const e = Hx(), n = t(), r = Hx(), i = parseInt(n, 10); if (isNaN(i) || i <= 0) return 0; const o = Math.round(i - (e + r) / 2); return Math.abs(o) > 5e3 && (Date.now = () => Hx() + o), o; } const Mue = { "9.9.15-28060": { appid: 537246092, qua: "V1_WIN_NQ_9.9.15_28060_GW_B" }, "9.9.15-28131": { appid: 537246092, qua: "V1_WIN_NQ_9.9.15_28131_GW_B" }, "3.2.12-28060": { appid: 537246140, qua: "V1_LNX_NQ_3.2.12_28060_GW_B" }, "3.2.12-28131": { appid: 537246140, qua: "V1_LNX_NQ_3.2.12_28131_GW_B" }, "6.9.55-28131": { appid: 537246115, qua: "V1_MAC_NQ_6.9.55_28131_GW_B" }, "9.9.15-28327": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28327_GW_B" }, "3.2.12-28327": { appid: 537249393, qua: "V1_LNX_NQ_3.2.12_28327_GW_B" }, "9.9.15-28418": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28418_GW_B" }, "3.2.12-28418": { appid: 537249393, qua: "V1_LNX_NQ_3.2.12_28418_GW_B" }, "6.9.56-28418": { appid: 537249367, qua: "V1_MAC_NQ_6.9.56_28418_GW_B" }, "9.9.15-28498": { appid: 537249321, qua: "V1_WIN_NQ_9.9.15_28498_GW_B" }, "3.2.13-28788": { appid: 537249787, qua: "V1_LNX_NQ_3.2.13_28788_GW_B" }, "9.9.16-28788": { appid: 537249739, qua: "V1_WIN_NQ_9.9.16_28788_GW_B" }, "9.9.16-28971": { appid: 537249775, qua: "V1_WIN_NQ_9.9.16_28971_GW_B" }, "3.2.13-28971": { appid: 537249848, qua: "V1_LNX_NQ_3.2.13_28971_GW_B" }, "6.9.58-28971": { appid: 537249826, qua: "V1_MAC_NQ_6.9.58_28971_GW_B" }, "9.9.16-29271": { appid: 537249813, qua: "V1_WIN_NQ_9.9.16_29271_GW_B" }, "3.2.13-29271": { appid: 537249913, qua: "V1_LNX_NQ_3.2.13_29271_GW_B" }, "6.9.59-29271": { appid: 537249863, qua: "V1_MAC_NQ_6.9.59_29271_GW_B" }, "9.9.16-29456": { appid: 537249875, qua: "V1_WIN_NQ_9.9.16_29456_GW_B" }, "3.2.13-29456": { appid: 537249996, qua: "V1_LNX_NQ_3.2.13_29456_GW_B" }, "6.9.59-29456": { appid: 537249961, qua: "V1_MAC_NQ_6.9.59_29456_GW_B" }, "9.9.16-29927": { appid: 537255812, qua: "V1_WIN_NQ_9.9.16_29927_GW_B" }, "3.2.13-29927": { appid: 537255847, qua: "V1_LNX_NQ_3.2.13_29927_GW_B" }, "6.9.61-29927": { appid: 537255836, qua: "V1_MAC_NQ_6.9.61_29927_GW_B" }, "9.9.17-30366": { appid: 537258389, qua: "V1_WIN_NQ_9.9.17_30366_GW_B" }, "3.2.15-30366": { appid: 537258413, qua: "V1_LNX_NQ_3.2.15_30366_GW_B" }, "6.9.62-30366": { appid: 537258401, qua: "V1_MAC_NQ_6.9.62_30366_GW_B" }, "9.9.17-30483": { appid: 537258439, qua: "V1_WIN_NQ_9.9.17_30483_GW_B" }, "6.9.62-30483": { appid: 537258463, qua: "V1_MAC_NQ_6.9.62_30483_GW_B" }, "3.2.15-30483": { appid: 537258474, qua: "V1_LNX_NQ_3.2.15_30483_GW_B" }, "9.9.17-30594": { appid: 537258439, qua: "V1_WIN_NQ_9.9.17_30594_GW_B" }, "6.9.62-30594": { appid: 537258463, qua: "V1_MAC_NQ_6.9.62_30594_GW_B" }, "3.2.15-30594": { appid: 537258474, qua: "V1_LNX_NQ_3.2.15_30594_GW_B" }, "9.9.17-30851": { appid: 537263796, qua: "V1_WIN_NQ_9.9.17_30851_GW_B" }, "3.2.15-30851": { appid: 537263831, qua: "V1_LNX_NQ_3.2.15_30851_GW_B" }, "6.9.63-30851": { appid: 537263820, qua: "V1_MAC_NQ_6.9.63_30851_GW_B" }, "9.9.17-30899": { appid: 537263796, qua: "V1_WIN_NQ_9.9.17_30899_GW_B" }, "3.2.15-30899": { appid: 537263831, qua: "V1_LNX_NQ_3.2.15_30899_GW_B" }, "6.9.63-30899": { appid: 537263820, qua: "V1_MAC_NQ_6.9.63_30899_GW_B" }, "9.9.17-31219": { appid: 537266450, qua: "V1_WIN_NQ_9.9.17_31219_GW_B" }, "9.9.17-31245": { appid: 537266450, qua: "V1_WIN_NQ_9.9.17_31245_GW_B" }, "3.2.15-31245": { appid: 537266485, qua: "V1_LNX_NQ_3.2.15_31245_GW_B" }, "6.9.63-31245": { appid: 537266474, qua: "V1_MAC_NQ_6.9.63_31245_GW_B" }, "3.2.15-31363": { appid: 537266535, qua: "V1_LNX_NQ_3.2.15_31363_GW_B" }, "6.9.65-31363": { appid: 537266524, qua: "V1_MAC_NQ_6.9.65_31363_GW_B" }, "9.9.17-31363": { appid: 537266500, qua: "V1_WIN_NQ_9.9.17_31363_GW_B" }, "3.2.16-32690": { appid: 537271229, qua: "V1_LNX_NQ_3.2.16_32690_GW_B" }, "9.9.18-32690": { appid: 537271194, qua: "V1_WIN_NQ_9.9.18_32690_GW_B" }, "6.9.66-32690": { appid: 537271218, qua: "V1_MAC_NQ_6.9.66_32690_GW_B" }, "3.2.16-32721": { appid: 537271229, qua: "V1_LNX_NQ_3.2.16_32721_GW_B" }, "9.9.18-32793": { appid: 537271244, qua: "V1_WIN_NQ_9.9.18_32793_GW_B" }, "3.2.16-32793": { appid: 537271279, qua: "V1_LNX_NQ_3.2.16_32793_GW_B" }, "3.2.16-32869": { appid: 537271329, qua: "V1_LNX_NQ_3.2.16_32869_GW_B" }, "9.9.18-32869": { appid: 537271294, qua: "V1_WIN_NQ_9.9.18_32869_GW_B" }, "3.2.16-33139": { appid: 537273909, qua: "V1_LNX_NQ_3.2.16_33139_GW_B" }, "9.9.18-33139": { appid: 537273874, qua: "V1_WIN_NQ_9.9.18_33139_GW_B" }, "9.9.18-33800": { appid: 537273974, qua: "V1_WIN_NQ_9.9.18_33800_GW_B" }, "3.2.16-33800": { appid: 537274009, qua: "V1_LNX_NQ_3.2.16_33800_GW_B" }, "9.9.19-34231": { appid: 537279209, qua: "V1_WIN_NQ_9.9.19_34231_GW_B" }, "3.2.17-34231": { appid: 537279245, qua: "V1_LNX_NQ_3.2.17_34231_GW_B" }, "9.9.19-34362": { appid: 537279260, qua: "V1_WIN_NQ_9.9.19_34362_GW_B" }, "3.2.17-34362": { appid: 537279296, qua: "V1_LNX_NQ_3.2.17_34362_GW_B" }, "9.9.19-34467": { appid: 537282256, qua: "V1_WIN_NQ_9.9.19_34467_GW_B" }, "3.2.17-34467": { appid: 537282292, qua: "V1_LNX_NQ_3.2.17_34467_GW_B" }, "9.9.19-34566": { appid: 537282307, qua: "V1_WIN_NQ_9.9.19_34566_GW_B" }, "3.2.17-34566": { appid: 537282343, qua: "V1_LNX_NQ_3.2.17_34566_GW_B" }, "3.2.17-34606": { appid: 537282343, qua: "V1_LNX_NQ_3.2.17_34606_GW_B" }, "9.9.19-34606": { appid: 537282307, qua: "V1_WIN_NQ_9.9.19_34606_GW_B" }, "9.9.19-34740": { appid: 537290691, qua: "V1_WIN_NQ_9.9.19_34740_GW_B" }, "3.2.17-34740": { appid: 537290727, qua: "V1_LNX_NQ_3.2.17_34740_GW_B" }, "9.9.19-34958": { appid: 537290742, qua: "V1_WIN_NQ_9.9.19_34958_GW_B" }, "3.2.17-35184": { appid: 537291084, qua: "V1_LNX_NQ_3.2.17_35184_GW_B" }, "9.9.19-35184": { appid: 537291048, qua: "V1_WIN_NQ_9.9.19_35184_GW_B" }, "3.2.17-35341": { appid: 537291383, qua: "V1_LNX_NQ_3.2.17_35341_GW_B" }, "9.9.19-35341": { appid: 537291347, qua: "V1_WIN_NQ_9.9.19_35341_GW_B" }, "9.9.19-35469": { appid: 537291398, qua: "V1_WIN_NQ_9.9.19_35469_GW_B" }, "3.2.18-35951": { appid: 537296013, qua: "V1_LNX_NQ_3.2.18_35951_GW_B" }, "9.9.20-35951": { appid: 537295977, qua: "V1_WIN_NQ_9.9.20_35951_GW_B" }, "3.2.18-36580": { appid: 537298509, qua: "V1_LNX_NQ_3.2.18_36580_GW_B" }, "9.9.20-36580": { appid: 537298473, qua: "V1_WIN_NQ_9.9.20_36580_GW_B" }, "9.9.20-37012": { appid: 537304071, qua: "V1_WIN_NQ_9.9.20_37012_GW_B" }, "3.2.18-37012": { appid: 537304107, qua: "V1_LNX_NQ_3.2.18_37012_GW_B" }, "3.2.18-37051": { appid: 537304158, qua: "V1_LNX_NQ_3.2.18_37051_GW_B" }, "9.9.20-37051": { appid: 537304122, qua: "V1_WIN_NQ_9.9.20_37051_GW_B" }, "9.9.20-37475": { appid: 537304173, qua: "V1_WIN_NQ_9.9.20_37475_GW_B" }, "3.2.18-37475": { appid: 537304210, qua: "V1_LNX_NQ_3.2.18_37475_GW_B" }, "9.9.20-37625": { appid: 537304224, qua: "V1_WIN_NQ_9.9.20_37625_GW_B" }, "3.2.18-37625": { appid: 537304261, qua: "V1_LNX_NQ_3.2.18_37625_GW_B" }, "9.9.21-38503": { appid: 537307604, qua: "V1_WIN_NQ_9.9.21_38503_GW_B" }, "3.2.19-38503": { appid: 537307640, qua: "V1_LNX_NQ_3.2.19_38503_GW_B" }, "3.2.19-38626": { appid: 537307691, qua: "V1_LNX_NQ_3.2.19_38626_GW_B" }, "9.9.21-38711": { appid: 537307655, qua: "V1_WIN_NQ_9.9.21_38626_GW_B" }, "9.9.21-38960": { appid: 537313855, qua: "V1_WIN_NQ_9.9.21_38960_GW_B" }, "3.2.19-38960": { appid: 537313891, qua: "V1_LNX_NQ_3.2.19_38960_GW_B" }, "3.2.19-39038": { appid: 537313942, qua: "V1_LNX_NQ_3.2.19_39038_GW_B" }, "9.9.21-39038": { appid: 537313906, qua: "V1_WIN_NQ_9.9.21_39038_GW_B" }, "9.9.22-40362": { appid: 537314212, qua: "V1_WIN_NQ_9.9.22_40362_GW_B" }, "3.2.20-40768": { appid: 537319840, qua: "V1_LNX_NQ_3.2.20_40768_GW_B" }, "9.9.22-40768": { appid: 537319804, qua: "V1_WIN_NQ_9.9.22_40768_GW_B" }, "6.9.82-40768": { appid: 537319829, qua: "V1_MAC_NQ_6.9.82_40768_GW_B" }, "3.2.20-40824": { appid: 537319840, qua: "V1_LNX_NQ_3.2.20_40824_GW_B" }, "9.9.22-40824": { appid: 537319804, qua: "V1_WIN_NQ_9.9.22_40824_GW_B" }, "6.9.82-40824": { appid: 537319829, qua: "V1_MAC_NQ_6.9.82_40824_GW_B" }, "6.9.82-40990": { appid: 537319880, qua: "V1_MAC_NQ_6.9.82_40990_GW_B" }, "9.9.22-40990": { appid: 537319855, qua: "V1_WIN_NQ_9.9.22.40990_GW_B" }, "3.2.20-40990": { appid: 537319891, qua: "V1_LNX_NQ_3.2.20_40990_GW_B" }, "9.9.23-41679": { appid: 537320110, qua: "V1_WIN_NQ_9.9.23_41679_GW_B" }, "6.9.83-41679": { appid: 537320135, qua: "V1_MAC_NQ_6.9.83_41679_GW_B" }, "9.9.23-41785": { appid: 537320110, qua: "V1_WIN_NQ_9.9.23_41785_GW_B" }, "6.9.83-41785": { appid: 537320135, qua: "V1_MAC_NQ_6.9.83_41785_GW_B" }, "9.9.23-41857": { appid: 537320161, qua: "V1_WIN_NQ_9.9.23_41857_GW_B" }, "3.2.21-41857": { appid: 537320197, qua: "V1_LNX_NQ_3.2.21_41857_GW_B" }, "6.9.83-41857": { appid: 537320186, qua: "V1_MAC_NQ_6.9.83_41857_GW_B" }, "3.2.21-42086": { appid: 537320248, qua: "V1_LNX_NQ_3.2.21_42086_GW_B" }, "9.9.23-42086": { appid: 537320212, qua: "V1_WIN_NQ_9.9.23_42086_GW_B" }, "6.9.85-42086": { appid: 537320237, qua: "V1_MAC_NQ_6.9.85_42086_GW_B" }, "9.9.23-42430": { appid: 537320212, qua: "V1_WIN_NQ_9.9.23_42430_GW_B" }, "9.9.25-42744": { appid: 537328470, qua: "V1_WIN_NQ_9.9.23_42744_GW_B" }, "6.9.86-42744": { appid: 537328495, qua: "V1_MAC_NQ_6.9.85_42744_GW_B" }, "9.9.25-42905": { appid: 537328521, qua: "V1_WIN_NQ_9.9.25_42905_GW_B" }, "6.9.86-42905": { appid: 537328546, qua: "V1_MAC_NQ_6.9.86_42905_GW_B" }, "3.2.22-42941": { appid: 537328659, qua: "V1_LNX_NQ_3.2.22_42941_GW_B" }, "9.9.25-42941": { appid: 537328623, qua: "V1_WIN_NQ_9.9.25_42941_GW_B" }, "6.9.86-42941": { appid: 537328648, qua: "V1_MAC_NQ_6.9.86_42941_GW_B" }, "9.9.26-44175": { appid: 537336450, qua: "V1_WIN_NQ_9.9.26_44175_GW_B" }, "9.9.26-44343": { appid: 537336603, qua: "V1_WIN_NQ_9.9.26_44343_GW_B" }, "3.2.23-44343": { appid: 537336639, qua: "V1_LNX_NQ_3.2.23_44343_GW_B" }, "9.9.26-44498": { appid: 537337416, qua: "V1_WIN_NQ_9.9.26_44498_GW_B" }, "9.9.26-44725": { appid: 537337569, qua: "V1_WIN_NQ_9.9.26_44725_GW_B" }, "9.9.27-45627": { appid: 537340060, qua: "V1_WIN_NQ_9.9.27_45627_GW_B" }, "6.9.88-44725": { appid: 537337594, qua: "V1_MAC_NQ_6.9.88_44725_GW_B" }, "3.2.25-45758": { appid: 537340249, qua: "V1_LNX_NQ_3.2.25_45758_GW_B" }, "9.9.27-45758": { appid: 537340213, qua: "V1_WIN_NQ_9.9.27_45758_GW_B" }, "3.2.26-46494": { appid: 537345891, qua: "V1_LNX_NQ_3.2.26_46494_GW_B" }, "9.9.28-46494": { appid: 537345855, qua: "V1_WIN_NQ_9.9.28_46494_GW_B" }, "6.9.90-46494": { appid: 537345879, qua: "V1_MAC_NQ_6.9.90_46494_GW_B" }, "3.2.26-46928": { appid: 537345994, qua: "V1_LNX_NQ_3.2.26_46928_GW_B" }, "9.9.28-46928": { appid: 537345957, qua: "V1_WIN_NQ_9.9.28_46928_GW_B" }, "3.2.27-47354": { appid: 537346908, qua: "V1_LNX_NQ_3.2.27_47354_GW_B" }, "9.9.29-47354": { appid: 537346872, qua: "V1_WIN_NQ_9.9.29_47354_GW_B" }, "6.9.93-47354": { appid: 537346896, qua: "V1_MAC_NQ_6.9.93_47354_GW_B" }, "9.9.30-48517": { appid: 537352474, qua: "V1_WIN_NQ_9.9.30_48517_GW_B" }, "3.2.28-48517": { appid: 537352510, qua: "V1_LNX_NQ_3.2.28_48517_GW_B" }, "9.9.30-48762": { appid: 537352525, qua: "V1_WIN_NQ_9.9.30_48762_GW_B" }, "9.9.31-49599": { appid: 537355779, qua: "V1_WIN_NQ_9.9.31_49599_GW_B" }, "9.9.31-49738": { appid: 537355830, qua: "V1_WIN_NQ_9.9.31_49738_GW_B" }, "3.2.29-49738": { appid: 537355867, qua: "V1_LNX_NQ_3.2.29_49738_GW_B" }, "9.9.32-50828": { appid: 537358739, qua: "V1_WIN_NQ_9.9.32_50828_GW_B" }, "3.2.30-50828": { appid: 537358775, qua: "V1_LNX_NQ_3.2.30_50828_GW_B" }, "9.9.32-50969": { appid: 537376308, qua: "V1_WIN_NQ_9.9.32_50969_GW_B" }, "3.2.30-50969": { appid: 537376344, qua: "V1_LNX_NQ_3.2.30_50969_GW_B" }, "3.2.30-50969-arm64": { appid: 537376345, qua: "V1_LNX_NQ_3.2.30_50969_GW_B" }, "9.9.33-52230": { appid: 537379411, qua: "V1_WIN_NQ_9.9.33_52230_GW_B" }, "3.2.32-52194": { appid: 537379447, qua: "V1_LNX_NQ_3.2.32_52194_GW_B" }, "3.2.32-52194-arm64": { appid: 537379448, qua: "V1_LNX_NQ_3.2.32_52194_GW_B" }, "9.9.35-52892": { appid: 537382819, qua: "V1_WIN_NQ_9.9.35_52892_GW_B" }, "3.2.33-52892": { appid: 537382855, qua: "V1_LNX_NQ_3.2.33_52892_GW_B" }, "3.2.33-52892-arm64": { appid: 537382856, qua: "V1_LNX_NQ_3.2.33_52892_GW_B" } }; class Rue { QQMainPath; QQPackageInfoPath; QQVersionConfigPath; isQuickUpdate; QQVersionConfig; QQPackageInfo; QQVersionAppid; QQVersionQua; context; constructor(e) { this.context = e, this.QQMainPath = process.execPath, process.platform === "darwin" && xe.basename(this.QQMainPath) === "QQ Helper" && (this.QQMainPath = xe.resolve(xe.dirname(this.QQMainPath), "../../../../", "MacOS", "QQ")), this.QQVersionConfigPath = A$(this.QQMainPath), this.isQuickUpdate = !!this.QQVersionConfigPath, this.QQVersionConfig = this.isQuickUpdate ? JSON.parse(qe.readFileSync(this.QQVersionConfigPath).toString()) : _$(), this.QQPackageInfoPath = E$(this.QQMainPath, this.QQVersionConfig?.curVersion), this.QQPackageInfo = JSON.parse(qe.readFileSync(this.QQPackageInfoPath).toString()); const { appid: n, qua: r } = this.getAppidV2(); this.QQVersionAppid = n, this.QQVersionQua = r; } // 基础函数 getQQBuildStr() { return this.QQVersionConfig?.curVersion.split("-")[1] ?? this.QQPackageInfo?.buildVersion; } getFullQQVersion() { const e = this.isQuickUpdate ? this.QQVersionConfig?.curVersion : this.QQPackageInfo?.version; if (!e) throw new Error("QQ版本获取失败"); return e; } requireMinNTQQBuild(e) { const n = +(this.getQQBuildStr() ?? "0"); if (n === 0) throw new Error("QQBuildStr获取失败"); return n >= parseInt(e); } // 此方法不要直接使用 getQUAFallback() { const e = { win32: `V1_WIN_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B`, darwin: `V1_MAC_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B`, linux: `V1_LNX_${this.getFullQQVersion()}_${this.getQQBuildStr()}_GW_B` }; return e[_8] ?? e.win32; } getAppIdFallback() { return { win32: "537246092", darwin: "537246140", linux: "537246140" }[_8] ?? "537246092"; } getAppidV2() { const e = Mue, n = this.getFullQQVersion(); if (n) { const r = e[`${n}-${process.arch}`] ?? e[n]; if (r) return r; } try { const r = this.getAppidV2ByMajor(n); if (r) return this.context.logger.log("[QQ版本兼容性检测] 当前版本Appid未内置 通过Major获取 为了更好的性能请尝试更新NapCat"), { appid: r, qua: this.getQUAFallback() }; } catch { this.context.logger.log("[QQ版本兼容性检测] 通过Major 获取Appid异常 请检测NapCat/QQNT是否正常"); } return this.context.logger.log("[QQ版本兼容性检测] 获取Appid异常 请检测NapCat/QQNT是否正常"), this.context.logger.log(`[QQ版本兼容性检测] ${n} 版本兼容性不佳,可能会导致一些功能无法正常使用`), { appid: this.getAppIdFallback(), qua: this.getQUAFallback() }; } getAppidV2ByMajor(e) { if (!this.QQMainPath) throw new Error("QQMainPath未定义 无法通过Major获取Appid"); const n = Uue(this.QQMainPath, e), r = I$(n); return r || C$(n); } } var fA = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Shell = 1] = "Shell", t[t.Framework = 2] = "Framework", t))(fA || {}); function Bue(t, e) { if (process.env.NAPCAT_WRAPPER_PATH) { const o = process.env.NAPCAT_WRAPPER_PATH, a = { exports: {} }; return process.dlopen(a, o), a.exports; } if (!t) throw new Error("无法加载Wrapper,execPath未定义"); let n; gt.platform() === "darwin" ? n = xe.resolve(xe.dirname(t), "../Resources/app") : gt.platform() === "linux" ? n = xe.resolve(xe.dirname(t), "./resources/app") : n = xe.resolve(xe.dirname(t), `./versions/${e}/`); let r = xe.resolve(n, "wrapper.node"); qe.existsSync(r) || (r = xe.join(n, "./resources/app/wrapper.node")), qe.existsSync(r) || (r = xe.join(xe.dirname(t), `./resources/app/versions/${e}/wrapper.node`)); const i = { exports: {} }; return process.dlopen(i, r), process.env.NAPCAT_WRAPPER_PATH = r, i.exports; } function Uue(t, e) { let n; gt.platform() === "darwin" ? n = xe.resolve(xe.dirname(t), "../Resources/app") : gt.platform() === "linux" ? n = xe.resolve(xe.dirname(t), "./resources/app") : n = xe.resolve(xe.dirname(t), `./versions/${e}/`); let r = xe.resolve(n, "major.node"); return qe.existsSync(r) || (r = xe.join(n, "./resources/app/major.node")), qe.existsSync(r) || (r = xe.join(xe.dirname(t), `./resources/app/versions/${e}/major.node`)), r; } class X0 { context; eventWrapper; event = Oue; SnowCatDataPath = ""; SnowCatTempPath = ""; apis; // runtime info, not readonly selfInfo; util; configLoader; /** 数据库 passphrase,由 OidbSvcTrpcTcp.0xcde_2 包获取 */ dbPassphrase; // 通过构造器递过去的 runtime info 应该尽量少 constructor(e, n) { if (this.selfInfo = n, this.eventWrapper = new RX(e.session), process.env.NAPCAT_SESSION_PROXY === "1") { const r = UX(e.session, this.eventWrapper); this.context = { ...e, session: r }; } else this.context = e; this.util = this.context.wrapper.NodeQQNTWrapperUtil, this.configLoader = new Iue(this, this.context.pathWrapper.configPath, dA), this.apis = { FileApi: new R$(this.context, this), SystemApi: new nq(this.context, this), CollectionApi: new FX(this.context, this), PacketApi: new hX(this.context, this), WebApi: new tq(this.context, this), FriendApi: new U$(this.context, this), MsgApi: new H$(this.context, this), UserApi: new W$(this.context, this), GroupApi: new z$(this.context, this), FlashApi: new gX(this.context, this), OnlineApi: new mX(this.context, this), DatabaseApi: new OX(this.context, this) }, Eu.bind(X0).toConstantValue(this), Eu.bind(pA).toConstantValue(this.event), iB.forEach((r, i) => { Eu.bind(r).toSelf(), this.context.packetHandler.onCmd(i, ({ seq: o, hex_data: a }) => Eu.get(r).handler(o, a)); }); } async initCore() { if (this.SnowCatDataPath = xe.join(this.dataPath, "SnowCat"), qe.mkdirSync(this.SnowCatDataPath, { recursive: !0 }), this.SnowCatTempPath = xe.join(this.SnowCatDataPath, "temp"), qe.existsSync(this.SnowCatTempPath) || qe.mkdirSync(this.SnowCatTempPath, { recursive: !0 }), process.env.NAPCAT_DISABLE_TIME_SYNC === "1" || !this.configLoader.configData.autoTimeSync) this.context.logger.log("[ServerTime] 自动对时已禁用"); else { const e = () => { try { const r = Fue(() => this.context.session.getMSFService().getServerTime()); Math.abs(r) > 5e3 ? this.context.logger.logWarn(`[ServerTime] 本地时间与服务器时间偏差 ${(r / 1e3).toFixed(1)}s,已自动矫正`) : this.context.logger.log(`[ServerTime] 时间同步完成,偏差 ${r}ms`); } catch (r) { this.context.logger.logError("[ServerTime] 时间矫正失败", r); } }; e(), setInterval(e, 36e5).unref(); } for (const e in this.apis) { const n = this.apis[e]; "initApi" in n && typeof n.initApi == "function" && await n.initApi(); } this.initNapCatCoreListeners().then().catch((e) => this.context.logger.logError(e)), this.context.logger.setFileLogEnabled( this.configLoader.configData.fileLog ), this.context.logger.setConsoleLogEnabled( this.configLoader.configData.consoleLog ), this.context.logger.setFileAndConsoleLogLevel( this.configLoader.configData.fileLogLevel, this.configLoader.configData.consoleLogLevel ); } get dataPath() { let e = this.context.wrapper.NodeQQNTWrapperUtil.getNTUserDataInfoConfig(); return e || (e = xe.resolve(gt.homedir(), "./.config/QQ"), qe.mkdirSync(e, { recursive: !0 })), e; } // Renamed from 'InitDataListener' async initNapCatCoreListeners() { const e = new rB(); e.onRecvOnlineFileMsg = (r) => { r.forEach((i) => this.context.logger.logMessage(i, this.selfInfo)); }, e.onKickedOffLine = (r) => { const i = `[KickedOffLine] [${r.tipsTitle}] ${r.tipsDesc}`; this.context.logger.logError(i), this.selfInfo.online = !1, this.event.emit("KickedOffLine", i); }, e.onRecvMsg = (r) => { r.forEach((i) => this.context.logger.logMessage(i, this.selfInfo)); }, e.onAddSendMsg = (r) => { this.context.logger.logMessage(r, this.selfInfo); }, this.context.session.getMsgService().addKernelMsgListener( Nu(e, this.context.logger) ); const n = new Pue(); n.onProfileDetailInfoChanged = (r) => { r.uid === this.selfInfo.uid && Object.assign(this.selfInfo, r); }, n.onSelfStatusChanged = (r) => { r.status === 20 ? (this.selfInfo.online = !1, this.context.logger.log("账号状态变更为离线")) : this.selfInfo.online = !0; }, this.context.session.getProfileService().addKernelProfileListener( Nu(n, this.context.logger) ); } } async function Lue(t, e, n, r, i, o) { const a = xe.join(o, "SnowCat", "temp"); qe.mkdirSync(a, { recursive: !0 }); const c = { win32: _a.KWINDOWS, darwin: _a.KMAC, linux: _a.KLINUX }[gt.platform()] ?? _a.KWINDOWS; return { selfUin: r, selfUid: i, desktopPathConfig: { account_path: o // 可以通过NodeQQNTWrapperUtil().getNTUserDataInfoConfig()获取 }, clientVer: n, a2: "", d2: "", d2Key: "", machineId: "", platform: c, // 3是Windows? platVer: ag, // 系统版本号, 应该可以固定 appid: e, rdeliveryConfig: { appKey: "", systemId: 0, appId: "", logicEnvironment: "", platform: c, language: "", sdkVersion: "", userId: "", appVersion: "", osVersion: "", bundleId: "", serverUrl: "", fixedAfterHitKeys: [""] }, defaultFileDownloadPath: a, deviceInfo: { guid: t, buildVer: n, localId: 2052, devName: UM, devType: E8, vendorName: "", osVer: ag, vendorOsName: E8, setMute: !1, vendorType: BM.KNOSETONIOS }, deviceConfig: '{"appearance":{"isSplitViewMode":true},"msg":{}}' }; } const Eu = new LQ(), iB = /* @__PURE__ */ new Map(); class Que { get core() { return Eu.get(X0); } get event() { return Eu.get(pA); } } function jue(t) { return function(e) { return eQ()(e), iB.set(t, e), e; }; } var $ue = Object.getOwnPropertyDescriptor, Gue = (t, e, n, r) => { for (var i = r > 1 ? void 0 : r ? $ue(e, n) : e, o = t.length - 1, a; o >= 0; o--) (a = t[o]) && (i = a(i) || i); return i; }; let Q8 = class extends Que { async handler(t, e) { const n = new he(lF).decode(Buffer.from(e, "hex")); if (n.message.contentHead.type === 732 && n.message.contentHead.subType === 16) { const r = n.message.body?.msgContent?.slice(7); if (!r) return; const i = new he(dF).decode(r); if ((i.field13 ?? 0) === 35) { const o = i.groupUin?.toString() ?? "", a = i.groupReactionData?.data?.data?.groupReactionDataContent?.operatorUid ?? "", s = i.groupReactionData?.data?.data?.groupReactionDataContent?.type ?? 0, c = i.groupReactionData?.data?.data?.groupReactionTarget?.seq?.toString() ?? "", u = i.groupReactionData?.data?.data?.groupReactionDataContent?.code ?? "", d = i.groupReactionData?.data?.data?.groupReactionDataContent?.count ?? 0, p = await this.core.apis.UserApi.getUinByUidV2(a); this.event.emit("event:emoji_like", { groupId: o, senderUin: p, emojiId: u, msgSeq: c, isAdd: s === 1, count: d }); } } } }; Q8 = Gue([ jue("trpc.msg.olpush.OlPushService.MsgPush") ], Q8); const re = { TestAutoRegister01: "test_auto_register_01", TestAutoRegister02: "test_auto_register_02", // 所有 Normal Stream Api 表示并未流传输 表示与流传输有关 CleanStreamTempFile: "clean_stream_temp_file", // 所有 Upload/Download Stream Api 应当 _stream 结尾 TestDownloadStream: "test_download_stream", UploadFileStream: "upload_file_stream", DownloadFileStream: "download_file_stream", DownloadFileRecordStream: "download_file_record_stream", DownloadFileImageStream: "download_file_image_stream", DelGroupAlbumMedia: "del_group_album_media", SetGroupAlbumMediaLike: "set_group_album_media_like", CancelGroupAlbumMediaLike: "cancel_group_album_media_like", DoGroupAlbumComment: "do_group_album_comment", GetGroupAlbumMediaList: "get_group_album_media_list", UploadImageToQunAlbum: "upload_image_to_qun_album", GetQunAlbumList: "get_qun_album_list", SetGroupTodo: "set_group_todo", CompleteGroupTodo: "complete_group_todo", CancelGroupTodo: "cancel_group_todo", SetGroupKickMembers: "set_group_kick_members", SetGroupRobotAddOption: "set_group_robot_add_option", SetGroupAddOption: "set_group_add_option", SetGroupSearch: "set_group_search", // new extends 完全差异OneBot类别 GetDoubtFriendsAddRequest: "get_doubt_friends_add_request", SetDoubtFriendsAddRequest: "set_doubt_friends_add_request", // napcat GetRkeyEx: "get_rkey", GetRkeyServer: "get_rkey_server", SetGroupRemark: "set_group_remark", SetGroupMemberInvitePolicy: "set_group_member_invite_policy", SetGroupMemberPermissions: "set_group_member_permissions", SetGroupNewMemberHistoryVisibility: "set_group_new_member_history_visibility", NapCat_GetPrivateFileUrl: "get_private_file_url", ClickInlineKeyboardButton: "click_inline_keyboard_button", GetUnidirectionalFriendList: "get_unidirectional_friend_list", // onebot 11 SendPrivateMsg: "send_private_msg", SendGroupMsg: "send_group_msg", SendMsg: "send_msg", DeleteMsg: "delete_msg", GetMsg: "get_msg", GoCQHTTP_GetForwardMsg: "get_forward_msg", SendLike: "send_like", SetGroupKick: "set_group_kick", SetGroupBan: "set_group_ban", // SetGroupAnoymousBan : 'set_group_anonymous_ban', SetGroupWholeBan: "set_group_whole_ban", SetGroupAdmin: "set_group_admin", // SetGroupAnoymous : 'set_group_anonymous', SetGroupCard: "set_group_card", SetGroupName: "set_group_name", SetGroupLeave: "set_group_leave", SetSpecialTitle: "set_group_special_title", SetFriendAddRequest: "set_friend_add_request", SetFriendRemark: "set_friend_remark", SetGroupAddRequest: "set_group_add_request", GetLoginInfo: "get_login_info", GoCQHTTP_GetStrangerInfo: "get_stranger_info", GetFriendList: "get_friend_list", GetGroupInfo: "get_group_info", GetGroupList: "get_group_list", GetGroupMemberInfo: "get_group_member_info", GetGroupMemberList: "get_group_member_list", GetGroupHonorInfo: "get_group_honor_info", GetCookies: "get_cookies", GetCSRF: "get_csrf_token", GetCredentials: "get_credentials", GetRecord: "get_record", GetImage: "get_image", CanSendImage: "can_send_image", CanSendRecord: "can_send_record", GetStatus: "get_status", GetVersionInfo: "get_version_info", Reboot: "set_restart", CleanCache: "clean_cache", Exit: "bot_exit", // go-cqhttp SetQQProfile: "set_qq_profile", // QidianGetAccountInfo : 'qidian_get_account_info', GoCQHTTP_GetModelShow: "_get_model_show", GoCQHTTP_SetModelShow: "_set_model_show", GetOnlineClient: "get_online_clients", // GetUnidirectionalFriendList : 'get_unidirectional_friend_list', GoCQHTTP_DeleteFriend: "delete_friend", // DeleteUnidirectionalFriendList : 'delete_unidirectional_friend', GoCQHTTP_MarkMsgAsRead: "mark_msg_as_read", GoCQHTTP_SendGroupForwardMsg: "send_group_forward_msg", GoCQHTTP_SendPrivateForwardMsg: "send_private_forward_msg", GoCQHTTP_GetGroupMsgHistory: "get_group_msg_history", OCRImage: "ocr_image", IOCRImage: ".ocr_image", GetGroupSystemMsg: "get_group_system_msg", GoCQHTTP_GetEssenceMsg: "get_essence_msg_list", GoCQHTTP_GetGroupAtAllRemain: "get_group_at_all_remain", SetGroupPortrait: "set_group_portrait", SetEssenceMsg: "set_essence_msg", DelEssenceMsg: "delete_essence_msg", GoCQHTTP_SendGroupNotice: "_send_group_notice", GoCQHTTP_GetGroupNotice: "_get_group_notice", GoCQHTTP_UploadGroupFile: "upload_group_file", GOCQHTTP_DeleteGroupFile: "delete_group_file", GoCQHTTP_CreateGroupFileFolder: "create_group_file_folder", GoCQHTTP_DeleteGroupFileFolder: "delete_group_folder", GoCQHTTP_GetGroupFileSystemInfo: "get_group_file_system_info", GoCQHTTP_GetGroupRootFiles: "get_group_root_files", GoCQHTTP_GetGroupFilesByFolder: "get_group_files_by_folder", GOCQHTTP_GetGroupFileUrl: "get_group_file_url", GOCQHTTP_UploadPrivateFile: "upload_private_file", // GOCQHTTP_ReloadEventFilter : 'reload_event_filter', GoCQHTTP_DownloadFile: "download_file", GoCQHTTP_CheckUrlSafely: "check_url_safely", GoCQHTTP_GetWordSlices: ".get_word_slices", GoCQHTTP_HandleQuickAction: ".handle_quick_operation", // 以下为扩展napcat扩展 Unknown: "unknown", SetDiyOnlineStatus: "set_diy_online_status", SharePeer: "ArkSharePeer", // @deprecated ShareGroupEx: "ArkShareGroup", // @deprecated // 标准化接口 SendGroupArkShare: "send_group_ark_share", SendArkShare: "send_ark_share", // RebootNormal : 'reboot_normal', //无快速登录重新启动 GetRobotUinRange: "get_robot_uin_range", SetOnlineStatus: "set_online_status", GetFriendsWithCategory: "get_friends_with_category", SetQQAvatar: "set_qq_avatar", GetFile: "get_file", ForwardFriendSingleMsg: "forward_friend_single_msg", ForwardGroupSingleMsg: "forward_group_single_msg", TranslateEnWordToZn: "translate_en2zh", FetchPttText: "fetch_ptt_text", SetMsgEmojiLike: "set_msg_emoji_like", GoCQHTTP_SendForwardMsg: "send_forward_msg", MarkPrivateMsgAsRead: "mark_private_msg_as_read", MarkGroupMsgAsRead: "mark_group_msg_as_read", GetFriendMsgHistory: "get_friend_msg_history", CreateCollection: "create_collection", GetCollectionList: "get_collection_list", SetLongNick: "set_self_longnick", GetRecentContact: "get_recent_contact", _MarkAllMsgAsRead: "_mark_all_as_read", GetProfileLike: "get_profile_like", FetchCustomFace: "fetch_custom_face", FetchCustomFaceDetail: "fetch_custom_face_detail", AddCustomFace: "add_custom_face", DeleteCustomFace: "delete_custom_face", SetCustomFaceDesc: "set_custom_face_desc", FetchEmojiLike: "fetch_emoji_like", GetEmojiLikes: "get_emoji_likes", SetInputStatus: "set_input_status", GetGroupInfoEx: "get_group_info_ex", GetGroupShareLink: "get_group_share_link", GetGroupDetailInfo: "get_group_detail_info", GetGroupIgnoreAddRequest: "get_group_ignore_add_request", DelGroupNotice: "_del_group_notice", FriendPoke: "friend_poke", GroupPoke: "group_poke", GetPacketStatus: "nc_get_packet_status", GetUserStatus: "nc_get_user_status", GetRkey: "nc_get_rkey", GetGroupShutList: "get_group_shut_list", MoveGroupFile: "move_group_file", TransGroupFile: "trans_group_file", RenameGroupFile: "rename_group_file", GetGuildList: "get_guild_list", GetGuildProfile: "get_guild_service_profile", GetGroupIgnoredNotifies: "get_group_ignored_notifies", SetGroupSign: "set_group_sign", SendGroupSign: "send_group_sign", SendPacket: "send_packet", GetMiniAppArk: "get_mini_app_ark", // UploadForwardMsg : "upload_forward_msg", GetAiRecord: "get_ai_record", GetAiCharacters: "get_ai_characters", SendGroupAiRecord: "send_group_ai_record", GetClientkey: "get_clientkey", SendPoke: "send_poke", // Flash (闪传) 扩展 CreateFlashTask: "create_flash_task", SendFlashMsg: "send_flash_msg", // 因为不可能手动构造element,所以不走sendMsg GetShareLink: "get_share_link", DownloadFileset: "download_fileset", GetFilesetInfo: "get_fileset_info", GetFlashFileList: "get_flash_file_list", GetFlashFileUrl: "get_flash_file_url", GetFilesetId: "get_fileset_id", // Online File (在线文件) 扩展 SendOnlineFile: "send_online_file", SendOnlineFolder: "send_online_folder", GetOnlineFileMessages: "get_online_file_msg", ReceiveOnlineFile: "receive_online_file", RefuseOnlineFile: "refuse_online_file", CancelOnlineFile: "cancel_online_file", GetGroupSignedList: "get_group_signed_list", // QQ 空间扩展 SendQzoneMsg: "send_qzone_msg", DeleteQzoneMsg: "delete_qzone_msg", // SnowCat · qzone Web 线扩展(SnowLuma 移植) GetQzoneMsgList: "get_qzone_msg_list", GetQzoneMsgDetail: "get_qzone_msg_detail", SetQzoneLike: "set_qzone_like", CommentQzoneMsg: "comment_qzone", ReplyQzoneComment: "reply_qzone_comment", GetQzoneProfile: "get_qzone_profile", SetQzoneProfile: "set_qzone_profile", SetQzoneBlack: "set_qzone_ban", SetQzoneMsgRight: "set_qzone_msg_right", SendQzoneMsgFull: "send_qzone_msg_full", GetQzoneFeeds: "get_qzone_feeds", // SnowCat · qzone 公共空间(空友)扩展(SnowLuma 移植) GetQzonePublicCapabilities: "get_qzone_public_capabilities", GetQzonePublicFeeds: "get_qzone_public_feeds", GetQzonePublicFeedDetail: "get_qzone_public_feed_detail", GetQzonePublicComments: "get_qzone_public_comments", GetQzonePublicReplies: "get_qzone_public_replies", SetQzonePublicUpvote: "set_qzone_public_upvote", SetQzonePublicLike: "set_qzone_public_like", SetQzonePublicCommentLike: "set_qzone_public_comment_like", CommentQzonePublicFeed: "comment_qzone_public_feed", ReplyQzonePublicFeed: "reply_qzone_public_feed", DeleteQzonePublicComment: "delete_qzone_public_comment", DeleteQzonePublicReply: "delete_qzone_public_reply", SetQzonePublicFollow: "set_qzone_public_follow", ForwardQzonePublicFeed: "forward_qzone_public_feed", // SnowCat · 第三批(SnowLuma 移植):群相册补/群管补/自定义表情/杂项 GetGroupAlbumList: "get_group_album_list", GetGroupAlbumMediaListOnly: "get_group_album_media_list_web", GetMsgEmojiLikes: "get_msg_emoji_likes", FetchSysFaces: "fetch_sys_faces", GetFriendDress: "get_friend_dress" }; var Jr = /* @__PURE__ */ ((t) => (t.Stream = "stream", t.Response = "response", t.Reset = "reset", t.Error = "error", t))(Jr || {}); const que = { Common: { errors: [ { code: 1400, description: "请求参数错误或业务逻辑执行失败" }, { code: 1401, description: "权限不足" }, { code: 1404, description: "资源不存在" } ] } }; class jt { static createResponse(e, n, r, i = "", o = null, a = !1) { return { status: n, retcode: r, data: e, message: i, wording: i, echo: o, stream: a ? "stream-action" : "normal-action" }; } static res(e, n, r, i = "", o = null, a = !1) { return this.createResponse(e, n, r, i, o, a); } static ok(e, n = null, r = !1) { return this.createResponse(e, "ok", 0, "", n, r); } static error(e, n, r = null, i = !1) { return this.createResponse(i ? { type: Jr.Error, data_type: "error" } : null, "failed", n, e, r, i); } } class ie { actionName = re.Unknown; core; validate = void 0; payloadSchema = void 0; returnSchema = void 0; payloadExample = void 0; returnExample = void 0; actionSummary = ""; actionDescription = ""; actionTags = []; obContext; useStream = !1; errorExamples = que.Common.errors; constructor(e, n) { this.obContext = e, this.core = n; } async check(e) { if (!this.payloadSchema) return { valid: !0 }; try { this.validate = zu.Compile(this.payloadSchema); let n = e; n = wc(this.payloadSchema, n), typeof e == "object" && e !== null && n !== null && Object.assign(e, n); } catch (n) { return { valid: !1, message: `Schema compilation error: ${n.message}` }; } if (this.validate && !this.validate.Check(e)) { const r = [...this.validate.Errors(e)].map((i) => `Key: ${i.path.split("/").slice(1).join(".")}, Message: ${i.message}`); return { valid: !1, message: r.length > 0 ? r.join(` `) : "未知错误" }; } return { valid: !0 }; } async handle(e, n, r, i = { send: async () => { } }, o) { const a = await this.check(e); if (!a.valid) return jt.error(a.message, 400); try { const s = await this._handle(e, n, r, i); return jt.ok(s, o, this.useStream); } catch (s) { return this.core.context.logger.logError("发生错误", s), jt.error(s.message.toString() || s?.stack?.toString() || "未知错误,可能操作超时", 200, o, this.useStream); } } async websocketHandle(e, n, r, i, o = { send: async () => { } }) { const a = await this.check(e); if (!a.valid) return jt.error(a.message, 1400, n, this.useStream); try { const s = await this._handle(e, r, i, o); return jt.ok(s, n, this.useStream); } catch (s) { return this.core.context.logger.logError("发生错误", s), jt.error((s.message.toString() || s.stack?.toString()) ?? "Error", 1200, n, this.useStream); } } } const oB = []; function aB(t) { oB.push(t); } var zue = Object.getOwnPropertyDescriptor, Hue = (t, e, n, r) => { for (var i = r > 1 ? void 0 : r ? zue(e, n) : e, o = t.length - 1, a; o >= 0; o--) (a = t[o]) && (i = a(i) || i); return i; }; let j8 = class extends ie { actionName = re.TestAutoRegister01; payloadSchema = l.Object({}); returnSchema = l.String({ description: "测试返回内容" }); async _handle(t) { return "AutoRegister Router Test"; } }; j8 = Hue([ aB ], j8); var Wue = Object.getOwnPropertyDescriptor, Kue = (t, e, n, r) => { for (var i = r > 1 ? void 0 : r ? Wue(e, n) : e, o = t.length - 1, a; o >= 0; o--) (a = t[o]) && (i = a(i) || i); return i; }; let $8 = class extends ie { actionName = re.TestAutoRegister02; payloadSchema = l.Object({}); returnSchema = l.String({ description: "测试返回内容" }); async _handle(t) { return "AutoRegister Router Test"; } }; $8 = Kue([ aB ], $8); class Vue { onMSFStatusChange(e, n) { } onMSFSsoError(e, n) { } getGroupCode(e) { } // onSendMsfReply (_seq: string, _cmd: string, _uk1: number, _uk2: string, _rsp: { // ssoRetCode: 0, // trpcRetCode: 0, // trpcFuncCode: 0, // errorMsg: '', // pbBuffer: Uint8Array, // transInfoMap: Map<unknown, unknown>; // }) { // console.log('[NodeIDependsAdapter] onSendMsfReply', _seq, _cmd, _uk1, _uk2, Buffer.from(_rsp.pbBuffer).toString('hex')); // } } class Yue { dispatchRequest(e) { } dispatchCall(e) { } dispatchCallWithJson(e) { } } class Jue { onLog(...e) { } onGetSrvCalTime(...e) { } onShowErrUITips(...e) { } fixPicImgType(...e) { } getAppSetting(...e) { } onInstallFinished(...e) { } onUpdateGeneralFlag(...e) { } onGetOfflineMsg(...e) { } } class sB { binaryPath; logsPath; configPath; cachePath; staticPath; pluginPath; constructor(e = fl(Mc(import.meta.url))) { this.binaryPath = e; let n; process.env.NAPCAT_WORKDIR ? n = process.env.NAPCAT_WORKDIR : Ln.platform() === "darwin" ? n = ve.join(Ln.homedir(), "Library", "Application Support", "QQ", "SnowCat") : n = this.binaryPath, this.logsPath = ve.join(n, "logs"), this.configPath = ve.join(n, "config"), this.pluginPath = ve.join(n, "plugins"), this.cachePath = ve.join(n, "cache"), this.staticPath = ve.join(this.binaryPath, "static"), fe.existsSync(this.logsPath) || fe.mkdirSync(this.logsPath, { recursive: !0 }), fe.existsSync(this.configPath) || fe.mkdirSync(this.configPath, { recursive: !0 }), fe.existsSync(this.cachePath) || fe.mkdirSync(this.cachePath, { recursive: !0 }); } } const Xue = 1, Zue = 2, cB = 4, ele = 8, Pi = { MODE_NUMBER: Xue, MODE_ALPHA_NUM: Zue, MODE_8BIT_BYTE: cB, MODE_KANJI: ele }; class tle { mode; data; constructor(e) { this.mode = cB, this.data = e; } getLength() { return this.data.length; } write(e) { for (let n = 0; n < this.data.length; n++) e.put(this.data.charCodeAt(n), 8); } } const Yn = { glog(t) { if (t < 1) throw new Error("glog(" + t + ")"); return Yn.LOG_TABLE[t]; }, gexp(t) { for (; t < 0; ) t += 255; for (; t >= 256; ) t -= 255; return Yn.EXP_TABLE[t]; }, EXP_TABLE: new Array(256).fill(0), LOG_TABLE: new Array(256).fill(0) }; for (let t = 0; t < 8; t++) Yn.EXP_TABLE[t] = 1 << t; for (let t = 8; t < 256; t++) Yn.EXP_TABLE[t] = Yn.EXP_TABLE[t - 4] ^ Yn.EXP_TABLE[t - 5] ^ Yn.EXP_TABLE[t - 6] ^ Yn.EXP_TABLE[t - 8]; for (let t = 0; t < 255; t++) Yn.LOG_TABLE[Yn.EXP_TABLE[t]] = t; class Hu { num; constructor(e, n) { if (e.length === void 0) throw new Error(e.length + "/" + n); let r = 0; for (; r < e.length && e[r] === 0; ) r++; this.num = new Array(e.length - r + n); for (let i = 0; i < e.length - r; i++) this.num[i] = e[i + r]; } get(e) { return this.num[e]; } getLength() { return this.num.length; } multiply(e) { const n = new Array(this.getLength() + e.getLength() - 1); for (let r = 0; r < this.getLength(); r++) for (let i = 0; i < e.getLength(); i++) n[r + i] ^= Yn.gexp(Yn.glog(this.get(r)) + Yn.glog(e.get(i))); return new Hu(n, 0); } mod(e) { if (this.getLength() - e.getLength() < 0) return this; const n = Yn.glog(this.get(0)) - Yn.glog(e.get(0)), r = new Array(this.getLength()); for (let i = 0; i < this.getLength(); i++) r[i] = this.get(i); for (let i = 0; i < e.getLength(); i++) r[i] ^= Yn.gexp(Yn.glog(e.get(i)) + n); return new Hu(r, 0).mod(e); } } const ns = { PATTERN000: 0, PATTERN001: 1, PATTERN010: 2, PATTERN011: 3, PATTERN100: 4, PATTERN101: 5, PATTERN110: 6, PATTERN111: 7 }, nle = [ [], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170] ], Wx = 1335, Kx = 7973, rle = 21522; function ile(t) { let e = t << 10; for (; ps(e) - ps(Wx) >= 0; ) e ^= Wx << ps(e) - ps(Wx); return (t << 10 | e) ^ rle; } function ole(t) { let e = t << 12; for (; ps(e) - ps(Kx) >= 0; ) e ^= Kx << ps(e) - ps(Kx); return t << 12 | e; } function ps(t) { let e = 0; for (; t !== 0; ) e++, t >>>= 1; return e; } function ale(t) { return nle[t - 1]; } function sle(t, e, n) { switch (t) { case ns.PATTERN000: return (e + n) % 2 === 0; case ns.PATTERN001: return e % 2 === 0; case ns.PATTERN010: return n % 3 === 0; case ns.PATTERN011: return (e + n) % 3 === 0; case ns.PATTERN100: return (Math.floor(e / 2) + Math.floor(n / 3)) % 2 === 0; case ns.PATTERN101: return e * n % 2 + e * n % 3 === 0; case ns.PATTERN110: return (e * n % 2 + e * n % 3) % 2 === 0; case ns.PATTERN111: return (e * n % 3 + (e + n) % 2) % 2 === 0; default: throw new Error("bad maskPattern:" + t); } } function cle(t) { let e = new Hu([1], 0); for (let n = 0; n < t; n++) e = e.multiply(new Hu([1, Yn.gexp(n)], 0)); return e; } function G8(t, e) { if (e >= 1 && e < 10) switch (t) { case Pi.MODE_NUMBER: return 10; case Pi.MODE_ALPHA_NUM: return 9; case Pi.MODE_8BIT_BYTE: return 8; case Pi.MODE_KANJI: return 8; default: throw new Error("mode:" + t); } else if (e < 27) switch (t) { case Pi.MODE_NUMBER: return 12; case Pi.MODE_ALPHA_NUM: return 11; case Pi.MODE_8BIT_BYTE: return 16; case Pi.MODE_KANJI: return 10; default: throw new Error("mode:" + t); } else if (e < 41) switch (t) { case Pi.MODE_NUMBER: return 14; case Pi.MODE_ALPHA_NUM: return 13; case Pi.MODE_8BIT_BYTE: return 16; case Pi.MODE_KANJI: return 12; default: throw new Error("mode:" + t); } else throw new Error("type:" + e); } function ule(t) { const e = t.getModuleCount(); let n = 0; for (let o = 0; o < e; o++) for (let a = 0; a < e; a++) { let s = 0; const c = t.isDark(o, a); for (let u = -1; u <= 1; u++) if (!(o + u < 0 || e <= o + u)) for (let d = -1; d <= 1; d++) a + d < 0 || e <= a + d || u === 0 && d === 0 || c === t.isDark(o + u, a + d) && s++; s > 5 && (n += 3 + s - 5); } for (let o = 0; o < e - 1; o++) for (let a = 0; a < e - 1; a++) { let s = 0; t.isDark(o, a) && s++, t.isDark(o + 1, a) && s++, t.isDark(o, a + 1) && s++, t.isDark(o + 1, a + 1) && s++, (s === 0 || s === 4) && (n += 3); } for (let o = 0; o < e; o++) for (let a = 0; a < e - 6; a++) t.isDark(o, a) && !t.isDark(o, a + 1) && t.isDark(o, a + 2) && t.isDark(o, a + 3) && t.isDark(o, a + 4) && !t.isDark(o, a + 5) && t.isDark(o, a + 6) && (n += 40); for (let o = 0; o < e; o++) for (let a = 0; a < e - 6; a++) t.isDark(a, o) && !t.isDark(a + 1, o) && t.isDark(a + 2, o) && t.isDark(a + 3, o) && t.isDark(a + 4, o) && !t.isDark(a + 5, o) && t.isDark(a + 6, o) && (n += 40); let r = 0; for (let o = 0; o < e; o++) for (let a = 0; a < e; a++) t.isDark(a, o) && r++; const i = Math.abs(100 * r / e / e - 50) / 5; return n += i * 10, n; } const Au = { L: 1, M: 0, Q: 3, H: 2 }; class xd { totalCount; dataCount; constructor(e, n) { this.totalCount = e, this.dataCount = n; } static RS_BLOCK_TABLE = [ // L // M // Q // H // 1 [1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], // 2 [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], // 3 [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], // 4 [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], // 5 [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], // 6 [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], // 7 [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], // 8 [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], // 9 [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], // 10 [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], // 11 [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], // 12 [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], // 13 [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], // 14 [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], // 15 [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], // 16 [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], // 17 [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], // 18 [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], // 19 [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], // 20 [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], // 21 [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], // 22 [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], // 23 [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], // 24 [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], // 25 [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], // 26 [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], // 27 [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], // 28 [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], // 29 [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], // 30 [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], // 31 [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], // 32 [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], // 33 [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], // 34 [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], // 35 [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], // 36 [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], // 37 [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], // 38 [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], // 39 [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], // 40 [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16] ]; } function q8(t, e) { const n = lle(t, e); if (n === void 0) throw new Error(`bad rs block @ typeNumber: ${t} / errorCorrectLevel: ${e}`); const r = n.length / 3, i = []; for (let o = 0; o < r; o++) { const a = n[o * 3 + 0], s = n[o * 3 + 1], c = n[o * 3 + 2]; if (a === void 0) throw new Error(`count is undefined for typeNumber: ${t} / errorCorrectLevel: ${e}`); for (let u = 0; u < a; u++) i.push(new xd(s, c)); } return i; } function lle(t, e) { switch (e) { case Au.L: return xd.RS_BLOCK_TABLE[(t - 1) * 4 + 0]; case Au.M: return xd.RS_BLOCK_TABLE[(t - 1) * 4 + 1]; case Au.Q: return xd.RS_BLOCK_TABLE[(t - 1) * 4 + 2]; case Au.H: return xd.RS_BLOCK_TABLE[(t - 1) * 4 + 3]; default: return; } } class z8 { buffer; length; constructor() { this.buffer = [], this.length = 0; } get(e) { const n = Math.floor(e / 8); return (this.buffer[n] >>> 7 - e % 8 & 1) === 1; } put(e, n) { for (let r = 0; r < n; r++) this.putBit((e >>> n - r - 1 & 1) === 1); } getLengthInBits() { return this.length; } putBit(e) { const n = Math.floor(this.length / 8); this.buffer.length <= n && this.buffer.push(0), e && (this.buffer[n] |= 128 >>> this.length % 8), this.length++; } } class Iu { typeNumber; errorCorrectLevel; modules; moduleCount; dataCache; dataList; static PAD0 = 236; static PAD1 = 17; constructor(e, n) { this.typeNumber = e, this.errorCorrectLevel = n, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = []; } addData(e) { const n = new tle(e); this.dataList.push(n), this.dataCache = null; } isDark(e, n) { if (e < 0 || this.moduleCount <= e || n < 0 || this.moduleCount <= n) throw new Error(`${e},${n}`); if (this.modules === null || this.modules[e] === null || this.modules[e][n] === null) throw new Error(`Module at (${e},${n}) is null`); return this.modules[e][n]; } getModuleCount() { return this.moduleCount; } make() { if (this.typeNumber < 1) { let e = 1; for (e = 1; e < 40; e++) { const n = q8(e, this.errorCorrectLevel), r = new z8(); let i = 0; for (let o = 0; o < n.length; o++) i += n[o].dataCount; for (let o = 0; o < this.dataList.length; o++) { const a = this.dataList[o]; r.put(a.mode, 4), r.put(a.getLength(), G8(a.mode, e)), a.write(r); } if (r.getLengthInBits() <= i * 8) break; } this.typeNumber = e; } this.makeImpl(!1, this.getBestMaskPattern()); } makeImpl(e, n) { this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount); for (let r = 0; r < this.moduleCount; r++) { this.modules[r] = new Array(this.moduleCount); for (let i = 0; i < this.moduleCount; i++) this.modules[r][i] = null; } this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(e, n), this.typeNumber >= 7 && this.setupTypeNumber(e), this.dataCache === null && (this.dataCache = Iu.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, n); } setupPositionProbePattern(e, n) { for (let r = -1; r <= 7; r++) if (!(e + r <= -1 || this.moduleCount <= e + r)) for (let i = -1; i <= 7; i++) n + i <= -1 || this.moduleCount <= n + i || (r >= 0 && r <= 6 && (i === 0 || i === 6) || i >= 0 && i <= 6 && (r === 0 || r === 6) || r >= 2 && r <= 4 && i >= 2 && i <= 4 ? this.modules[e + r][n + i] = !0 : this.modules[e + r][n + i] = !1); } getBestMaskPattern() { let e = 0, n = 0; for (let r = 0; r < 8; r++) { this.makeImpl(!0, r); const i = ule(this); (r === 0 || e > i) && (e = i, n = r); } return n; } createMovieClip(e, n, r) { const i = e.createEmptyMovieClip(n, r), o = 1; this.make(); for (let a = 0; a < this.modules.length; a++) { const s = a * o; for (let c = 0; c < this.modules[a].length; c++) { const u = c * o; this.modules[a][c] && (i.beginFill(0, 100), i.moveTo(u, s), i.lineTo(u + o, s), i.lineTo(u + o, s + o), i.lineTo(u, s + o), i.endFill()); } } return i; } setupTimingPattern() { for (let e = 8; e < this.moduleCount - 8; e++) this.modules[e][6] === null && (this.modules[e][6] = e % 2 === 0); for (let e = 8; e < this.moduleCount - 8; e++) this.modules[6][e] === null && (this.modules[6][e] = e % 2 === 0); } setupPositionAdjustPattern() { const e = ale(this.typeNumber); for (let n = 0; n < e.length; n++) for (let r = 0; r < e.length; r++) { const i = e[n], o = e[r]; if (this.modules[i][o] === null) for (let a = -2; a <= 2; a++) for (let s = -2; s <= 2; s++) Math.abs(a) === 2 || Math.abs(s) === 2 || a === 0 && s === 0 ? this.modules[i + a][o + s] = !0 : this.modules[i + a][o + s] = !1; } } setupTypeNumber(e) { const n = ole(this.typeNumber); let r; for (let i = 0; i < 18; i++) r = !e && (n >> i & 1) === 1, this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = r; for (let i = 0; i < 18; i++) r = !e && (n >> i & 1) === 1, this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = r; } setupTypeInfo(e, n) { const r = this.errorCorrectLevel << 3 | n, i = ile(r); let o; for (let a = 0; a < 15; a++) o = !e && (i >> a & 1) === 1, a < 6 ? this.modules[a][8] = o : a < 8 ? this.modules[a + 1][8] = o : this.modules[this.moduleCount - 15 + a][8] = o; for (let a = 0; a < 15; a++) o = !e && (i >> a & 1) === 1, a < 8 ? this.modules[8][this.moduleCount - a - 1] = o : a < 9 ? this.modules[8][15 - a - 1 + 1] = o : this.modules[8][15 - a - 1] = o; this.modules[this.moduleCount - 8][8] = !e; } mapData(e, n) { let r = -1, i = this.moduleCount - 1, o = 7, a = 0; for (let s = this.moduleCount - 1; s > 0; s -= 2) for (s === 6 && s--; ; ) { for (let c = 0; c < 2; c++) if (this.modules[i][s - c] === null) { let u = !1; a < e.length && (u = ((e[a] ?? 0) >>> o & 1) === 1), sle(n, i, s - c) && (u = !u), this.modules[i][s - c] = u, o--, o === -1 && (a++, o = 7); } if (i += r, i < 0 || this.moduleCount <= i) { i -= r, r = -r; break; } } } static createData(e, n, r) { const i = q8(e, n), o = new z8(); for (let s = 0; s < r.length; s++) { const c = r[s]; o.put(c.mode, 4), o.put(c.getLength(), G8(c.mode, e)), c.write(o); } let a = 0; for (let s = 0; s < i.length; s++) a += i[s].dataCount; if (o.getLengthInBits() > a * 8) throw new Error(`code length overflow. (${o.getLengthInBits()} > ${a * 8})`); for (o.getLengthInBits() + 4 <= a * 8 && o.put(0, 4); o.getLengthInBits() % 8 !== 0; ) o.putBit(!1); for (; !(o.getLengthInBits() >= a * 8 || (o.put(Iu.PAD0, 8), o.getLengthInBits() >= a * 8)); ) o.put(Iu.PAD1, 8); return Iu.createBytes(o, i); } static createBytes(e, n) { let r = 0, i = 0, o = 0; const a = new Array(n.length), s = new Array(n.length); for (let p = 0; p < n.length; p++) { const f = n[p].dataCount, m = n[p].totalCount - f; i = Math.max(i, f), o = Math.max(o, m), a[p] = new Array(f); for (let g = 0; g < a[p].length; g++) a[p][g] = 255 & e.buffer[g + r]; r += f; const h = cle(m), x = new Hu(a[p], h.getLength() - 1).mod(h); s[p] = new Array(h.getLength() - 1); for (let g = 0; g < s[p].length; g++) { const b = g + x.getLength() - s[p].length; s[p][g] = b >= 0 ? x.get(b) : 0; } } let c = 0; for (let p = 0; p < n.length; p++) c += n[p].totalCount; const u = new Array(c); let d = 0; for (let p = 0; p < i; p++) for (let f = 0; f < n.length; f++) p < a[f].length && (u[d++] = a[f][p]); for (let p = 0; p < o; p++) for (let f = 0; f < n.length; f++) p < s[f].length && (u[d++] = s[f][p]); return u; } } const dle = "\x1B[40m \x1B[0m", Om = "\x1B[47m \x1B[0m", ple = (t) => t ? dle : Om, Vx = (t) => ({ times: (e) => new Array(e + 1).join(t) }), fle = (t, e) => { const n = new Array(t); for (let r = 0; r < t; r++) n[r] = e; return n; }, hle = { error: Au.L, generate(t, e, n) { typeof e == "function" && (n = e, e = {}); const r = new Iu(-1, this.error); r.addData(t), r.make(); let i = ""; if (e && e.small) { const s = r.getModuleCount(), c = r.modules ? r.modules.slice() : [], u = s % 2 === 1; u && c.push(fle(s, !1)); const d = { WHITE_ALL: "█", WHITE_BLACK: "▀", BLACK_WHITE: "▄", BLACK_ALL: " " }, p = Vx(d.BLACK_WHITE).times(s + 2), f = Vx(d.WHITE_BLACK).times(s + 2); i += p + ` `; for (let m = 0; m < s; m += 2) { i += d.WHITE_ALL; for (let h = 0; h < s; h++) c[m]?.[h] === !1 && c[m + 1]?.[h] === !1 ? i += d.WHITE_ALL : c[m]?.[h] === !1 && c[m + 1]?.[h] === !0 ? i += d.WHITE_BLACK : c[m]?.[h] === !0 && c[m + 1]?.[h] === !1 ? i += d.BLACK_WHITE : i += d.BLACK_ALL; i += d.WHITE_ALL + ` `; } u || (i += f); } else { const o = Vx(Om).times(r.getModuleCount() + 2); i += o + ` `, r.modules && r.modules.forEach((a) => { i += Om, i += a.map(ple).join(""), i += Om + ` `; }), i += o; } n ? n(i) : console.log(i); }, setErrorLevel(t) { this.error = Au[t] || this.error; } }, mle = l.Object({ name: l.String({ default: "http-server" }), enable: l.Boolean({ default: !1 }), port: l.Number({ default: 3e3 }), host: l.String({ default: "127.0.0.1" }), enableCors: l.Boolean({ default: !0 }), enableWebsocket: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }) }), gle = l.Object({ name: l.String({ default: "http-sse-server" }), enable: l.Boolean({ default: !1 }), port: l.Number({ default: 3e3 }), host: l.String({ default: "127.0.0.1" }), enableCors: l.Boolean({ default: !0 }), enableWebsocket: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }), reportSelfMessage: l.Boolean({ default: !1 }) }), yle = l.Object({ name: l.String({ default: "http-client" }), enable: l.Boolean({ default: !1 }), url: l.String({ default: "http://localhost:8080" }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }) }), ble = l.Object({ name: l.String({ default: "websocket-server" }), enable: l.Boolean({ default: !1 }), host: l.String({ default: "127.0.0.1" }), port: l.Number({ default: 3001 }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), token: l.String({ default: "" }), enableForcePushEvent: l.Boolean({ default: !0 }), debug: l.Boolean({ default: !1 }), heartInterval: l.Number({ default: 3e4 }) }), vle = l.Object({ name: l.String({ default: "websocket-client" }), enable: l.Boolean({ default: !1 }), url: l.String({ default: "ws://localhost:8082" }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), reconnectInterval: l.Number({ default: 5e3 }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }), heartInterval: l.Number({ default: 3e4 }), verifyCertificate: l.Optional(l.Boolean({ default: !0 })) }), xle = l.Object({ name: l.String({ default: "plugin" }), enable: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), debug: l.Boolean({ default: !1 }) }), wle = l.Object({ name: l.String({ default: "mcp-server" }), enable: l.Boolean({ default: !1 }), host: l.String({ default: "127.0.0.1" }), port: l.Number({ default: 3002 }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }) }), Sle = l.Object({ httpServers: l.Array(mle, { default: [] }), httpSseServers: l.Array(gle, { default: [] }), httpClients: l.Array(yle, { default: [] }), websocketServers: l.Array(ble, { default: [] }), websocketClients: l.Array(vle, { default: [] }), mcpServers: l.Optional(l.Array(wle, { default: [] })), plugins: l.Array(xle, { default: [] }) }, { default: {} }), _le = l.Object({ baseTimeout: l.Number({ default: 1e4 }), uploadSpeedKBps: l.Number({ default: 256 }), downloadSpeedKBps: l.Number({ default: 256 }), maxTimeout: l.Number({ default: 18e5 }) }, { default: {} }), Ele = l.Object({ network: Sle, musicSignUrl: l.String({ default: "" }), enableLocalFile2Url: l.Boolean({ default: !1 }), parseMultMsg: l.Boolean({ default: !1 }), imageDownloadProxy: l.String({ default: "" }), timeout: _le }); function hA(t, e, n) { return Math.min( t.baseTimeout + e / 1024 / Math.max(n, 1) * 1e3, t.maxTimeout ); } function Ale(t, e) { return Math.min(e, t.maxTimeout); } class Ile extends ZE { constructor(e, n, r) { super("onebot11", e, n, r); } } function uB(t, e) { for (const n in e) if (Object.prototype.hasOwnProperty.call(e, n)) { if (e[n] === void 0) continue; t[n] !== void 0 && typeof t[n] == "object" && !Array.isArray(t[n]) && typeof e[n] == "object" && !Array.isArray(e[n]) ? t[n] = uB({ ...t[n] }, e[n]) : t[n] = e[n]; } return t; } const Cle = l.Object( { dark: l.Record(l.String(), l.String()), light: l.Record(l.String(), l.String()), fontMode: l.String({ default: "system" }) }, { default: { fontMode: "system", dark: { "--heroui-background": "0 0% 0%", "--heroui-foreground-50": "240 5.88% 10%", "--heroui-foreground-100": "240 3.7% 15.88%", "--heroui-foreground-200": "240 5.26% 26.08%", "--heroui-foreground-300": "240 5.2% 33.92%", "--heroui-foreground-400": "240 3.83% 46.08%", "--heroui-foreground-500": "240 5.03% 64.9%", "--heroui-foreground-600": "240 4.88% 83.92%", "--heroui-foreground-700": "240 5.88% 90%", "--heroui-foreground-800": "240 4.76% 95.88%", "--heroui-foreground-900": "0 0% 98.04%", "--heroui-foreground": "210 5.56% 92.94%", "--heroui-focus": "212.01999999999998 100% 46.67%", "--heroui-overlay": "0 0% 0%", "--heroui-divider": "0 0% 100%", "--heroui-divider-opacity": "0.15", "--heroui-content1": "240 5.88% 10%", "--heroui-content1-foreground": "0 0% 98.04%", "--heroui-content2": "240 3.7% 15.88%", "--heroui-content2-foreground": "240 4.76% 95.88%", "--heroui-content3": "240 5.26% 26.08%", "--heroui-content3-foreground": "240 5.88% 90%", "--heroui-content4": "240 5.2% 33.92%", "--heroui-content4-foreground": "240 4.88% 83.92%", "--heroui-default-50": "240 5.88% 10%", "--heroui-default-100": "240 3.7% 15.88%", "--heroui-default-200": "240 5.26% 26.08%", "--heroui-default-300": "240 5.2% 33.92%", "--heroui-default-400": "240 3.83% 46.08%", "--heroui-default-500": "240 5.03% 64.9%", "--heroui-default-600": "240 4.88% 83.92%", "--heroui-default-700": "240 5.88% 90%", "--heroui-default-800": "240 4.76% 95.88%", "--heroui-default-900": "0 0% 98.04%", "--heroui-default-foreground": "0 0% 100%", "--heroui-default": "240 5.26% 26.08%", "--heroui-danger-50": "301.89 82.61% 22.55%", "--heroui-danger-100": "308.18 76.39% 28.24%", "--heroui-danger-200": "313.85 70.65% 36.08%", "--heroui-danger-300": "319.73 65.64% 44.51%", "--heroui-danger-400": "325.82 69.62% 53.53%", "--heroui-danger-500": "331.82 75% 65.49%", "--heroui-danger-600": "337.84 83.46% 73.92%", "--heroui-danger-700": "343.42 90.48% 83.53%", "--heroui-danger-800": "350.53 90.48% 91.76%", "--heroui-danger-900": "324 90.91% 95.69%", "--heroui-danger-foreground": "0 0% 100%", "--heroui-danger": "325.82 69.62% 53.53%", "--heroui-primary-50": "340 84.91% 10.39%", "--heroui-primary-100": "339.33 86.54% 20.39%", "--heroui-primary-200": "339.11 85.99% 30.78%", "--heroui-primary-300": "339 86.54% 40.78%", "--heroui-primary-400": "339.2 90.36% 51.18%", "--heroui-primary-500": "339 90% 60.78%", "--heroui-primary-600": "339.11 90.6% 70.78%", "--heroui-primary-700": "339.33 90% 80.39%", "--heroui-primary-800": "340 91.84% 90.39%", "--heroui-primary-900": "339.13 92% 95.1%", "--heroui-primary-foreground": "0 0% 100%", "--heroui-primary": "339.2 90.36% 51.18%", "--heroui-secondary-50": "270 66.67% 9.41%", "--heroui-secondary-100": "270 66.67% 18.82%", "--heroui-secondary-200": "270 66.67% 28.24%", "--heroui-secondary-300": "270 66.67% 37.65%", "--heroui-secondary-400": "270 66.67% 47.06%", "--heroui-secondary-500": "270 59.26% 57.65%", "--heroui-secondary-600": "270 59.26% 68.24%", "--heroui-secondary-700": "270 59.26% 78.82%", "--heroui-secondary-800": "270 59.26% 89.41%", "--heroui-secondary-900": "270 61.54% 94.9%", "--heroui-secondary-foreground": "0 0% 100%", "--heroui-secondary": "270 59.26% 57.65%", "--heroui-success-50": "145.71 77.78% 8.82%", "--heroui-success-100": "146.2 79.78% 17.45%", "--heroui-success-200": "145.79 79.26% 26.47%", "--heroui-success-300": "146.01 79.89% 35.1%", "--heroui-success-400": "145.96 79.46% 43.92%", "--heroui-success-500": "146.01 62.45% 55.1%", "--heroui-success-600": "145.79 62.57% 66.47%", "--heroui-success-700": "146.2 61.74% 77.45%", "--heroui-success-800": "145.71 61.4% 88.82%", "--heroui-success-900": "146.67 64.29% 94.51%", "--heroui-success-foreground": "0 0% 0%", "--heroui-success": "145.96 79.46% 43.92%", "--heroui-warning-50": "37.14 75% 10.98%", "--heroui-warning-100": "37.14 75% 21.96%", "--heroui-warning-200": "36.96 73.96% 33.14%", "--heroui-warning-300": "37.01 74.22% 44.12%", "--heroui-warning-400": "37.03 91.27% 55.1%", "--heroui-warning-500": "37.01 91.26% 64.12%", "--heroui-warning-600": "36.96 91.24% 73.14%", "--heroui-warning-700": "37.14 91.3% 81.96%", "--heroui-warning-800": "37.14 91.3% 90.98%", "--heroui-warning-900": "54.55 91.67% 95.29%", "--heroui-warning-foreground": "0 0% 0%", "--heroui-warning": "37.03 91.27% 55.1%", "--heroui-code-background": "240 5.56% 7.06%", "--heroui-strong": "190.14 94.67% 44.12%", "--heroui-code-mdx": "190.14 94.67% 44.12%", "--heroui-divider-weight": "1px", "--heroui-disabled-opacity": ".5", "--heroui-font-size-tiny": "0.75rem", "--heroui-font-size-small": "0.875rem", "--heroui-font-size-medium": "1rem", "--heroui-font-size-large": "1.125rem", "--heroui-line-height-tiny": "1rem", "--heroui-line-height-small": "1.25rem", "--heroui-line-height-medium": "1.5rem", "--heroui-line-height-large": "1.75rem", "--heroui-radius-small": "8px", "--heroui-radius-medium": "12px", "--heroui-radius-large": "14px", "--heroui-border-width-small": "1px", "--heroui-border-width-medium": "2px", "--heroui-border-width-large": "3px", "--heroui-box-shadow-small": "0px 0px 5px 0px rgba(0, 0, 0, .05), 0px 2px 10px 0px rgba(0, 0, 0, .2), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)", "--heroui-box-shadow-medium": "0px 0px 15px 0px rgba(0, 0, 0, .06), 0px 2px 30px 0px rgba(0, 0, 0, .22), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)", "--heroui-box-shadow-large": "0px 0px 30px 0px rgba(0, 0, 0, .07), 0px 30px 60px 0px rgba(0, 0, 0, .26), inset 0px 0px 1px 0px hsla(0, 0%, 100%, .15)", "--heroui-hover-opacity": ".9" }, light: { "--heroui-background": "0 0% 100%", "--heroui-foreground-50": "240 5.88% 95%", "--heroui-foreground-100": "240 3.7% 90%", "--heroui-foreground-200": "240 5.26% 80%", "--heroui-foreground-300": "240 5.2% 70%", "--heroui-foreground-400": "240 3.83% 60%", "--heroui-foreground-500": "240 5.03% 50%", "--heroui-foreground-600": "240 4.88% 40%", "--heroui-foreground-700": "240 5.88% 30%", "--heroui-foreground-800": "240 4.76% 20%", "--heroui-foreground-900": "0 0% 10%", "--heroui-foreground": "210 5.56% 7.06%", "--heroui-focus": "212.01999999999998 100% 53.33%", "--heroui-overlay": "0 0% 100%", "--heroui-divider": "0 0% 0%", "--heroui-divider-opacity": "0.85", "--heroui-content1": "240 5.88% 95%", "--heroui-content1-foreground": "0 0% 10%", "--heroui-content2": "240 3.7% 90%", "--heroui-content2-foreground": "240 4.76% 20%", "--heroui-content3": "240 5.26% 80%", "--heroui-content3-foreground": "240 5.88% 30%", "--heroui-content4": "240 5.2% 70%", "--heroui-content4-foreground": "240 4.88% 40%", "--heroui-default-50": "240 5.88% 95%", "--heroui-default-100": "240 3.7% 90%", "--heroui-default-200": "240 5.26% 80%", "--heroui-default-300": "240 5.2% 70%", "--heroui-default-400": "240 3.83% 60%", "--heroui-default-500": "240 5.03% 50%", "--heroui-default-600": "240 4.88% 40%", "--heroui-default-700": "240 5.88% 30%", "--heroui-default-800": "240 4.76% 20%", "--heroui-default-900": "0 0% 10%", "--heroui-default-foreground": "0 0% 0%", "--heroui-default": "240 5.26% 80%", "--heroui-danger-50": "324 90.91% 95.69%", "--heroui-danger-100": "350.53 90.48% 91.76%", "--heroui-danger-200": "343.42 90.48% 83.53%", "--heroui-danger-300": "337.84 83.46% 73.92%", "--heroui-danger-400": "331.82 75% 65.49%", "--heroui-danger-500": "325.82 69.62% 53.53%", "--heroui-danger-600": "319.73 65.64% 44.51%", "--heroui-danger-700": "313.85 70.65% 36.08%", "--heroui-danger-800": "308.18 76.39% 28.24%", "--heroui-danger-900": "301.89 82.61% 22.55%", "--heroui-danger-foreground": "0 0% 100%", "--heroui-danger": "325.82 69.62% 53.53%", "--heroui-primary-50": "339.13 92% 95.1%", "--heroui-primary-100": "340 91.84% 90.39%", "--heroui-primary-200": "339.33 90% 80.39%", "--heroui-primary-300": "339.11 90.6% 70.78%", "--heroui-primary-400": "339 90% 60.78%", "--heroui-primary-500": "339.2 90.36% 51.18%", "--heroui-primary-600": "339 86.54% 40.78%", "--heroui-primary-700": "339.11 85.99% 30.78%", "--heroui-primary-800": "339.33 86.54% 20.39%", "--heroui-primary-900": "340 84.91% 10.39%", "--heroui-primary-foreground": "0 0% 100%", "--heroui-primary": "339.2 90.36% 51.18%", "--heroui-secondary-50": "270 61.54% 94.9%", "--heroui-secondary-100": "270 59.26% 89.41%", "--heroui-secondary-200": "270 59.26% 78.82%", "--heroui-secondary-300": "270 59.26% 68.24%", "--heroui-secondary-400": "270 59.26% 57.65%", "--heroui-secondary-500": "270 66.67% 47.06%", "--heroui-secondary-600": "270 66.67% 37.65%", "--heroui-secondary-700": "270 66.67% 28.24%", "--heroui-secondary-800": "270 66.67% 18.82%", "--heroui-secondary-900": "270 66.67% 9.41%", "--heroui-secondary-foreground": "0 0% 100%", "--heroui-secondary": "270 66.67% 47.06%", "--heroui-success-50": "146.67 64.29% 94.51%", "--heroui-success-100": "145.71 61.4% 88.82%", "--heroui-success-200": "146.2 61.74% 77.45%", "--heroui-success-300": "145.79 62.57% 66.47%", "--heroui-success-400": "146.01 62.45% 55.1%", "--heroui-success-500": "145.96 79.46% 43.92%", "--heroui-success-600": "146.01 79.89% 35.1%", "--heroui-success-700": "145.79 79.26% 26.47%", "--heroui-success-800": "146.2 79.78% 17.45%", "--heroui-success-900": "145.71 77.78% 8.82%", "--heroui-success-foreground": "0 0% 0%", "--heroui-success": "145.96 79.46% 43.92%", "--heroui-warning-50": "54.55 91.67% 95.29%", "--heroui-warning-100": "37.14 91.3% 90.98%", "--heroui-warning-200": "37.14 91.3% 81.96%", "--heroui-warning-300": "36.96 91.24% 73.14%", "--heroui-warning-400": "37.01 91.26% 64.12%", "--heroui-warning-500": "37.03 91.27% 55.1%", "--heroui-warning-600": "37.01 74.22% 44.12%", "--heroui-warning-700": "36.96 73.96% 33.14%", "--heroui-warning-800": "37.14 75% 21.96%", "--heroui-warning-900": "37.14 75% 10.98%", "--heroui-warning-foreground": "0 0% 0%", "--heroui-warning": "37.03 91.27% 55.1%", "--heroui-code-background": "221.25 17.39% 18.04%", "--heroui-strong": "316.95 100% 65.29%", "--heroui-code-mdx": "316.95 100% 65.29%", "--heroui-divider-weight": "1px", "--heroui-disabled-opacity": ".5", "--heroui-font-size-tiny": "0.75rem", "--heroui-font-size-small": "0.875rem", "--heroui-font-size-medium": "1rem", "--heroui-font-size-large": "1.125rem", "--heroui-line-height-tiny": "1rem", "--heroui-line-height-small": "1.25rem", "--heroui-line-height-medium": "1.5rem", "--heroui-line-height-large": "1.75rem", "--heroui-radius-small": "8px", "--heroui-radius-medium": "12px", "--heroui-radius-large": "14px", "--heroui-border-width-small": "1px", "--heroui-border-width-medium": "2px", "--heroui-border-width-large": "3px", "--heroui-box-shadow-small": "0px 0px 5px 0px rgba(0, 0, 0, .02), 0px 2px 10px 0px rgba(0, 0, 0, .06), 0px 0px 1px 0px rgba(0, 0, 0, .3)", "--heroui-box-shadow-medium": "0px 0px 15px 0px rgba(0, 0, 0, .03), 0px 2px 30px 0px rgba(0, 0, 0, .08), 0px 0px 1px 0px rgba(0, 0, 0, .3)", "--heroui-box-shadow-large": "0px 0px 30px 0px rgba(0, 0, 0, .04), 0px 30px 60px 0px rgba(0, 0, 0, .12), 0px 0px 1px 0px rgba(0, 0, 0, .3)", "--heroui-hover-opacity": ".8" } } } ), Tle = (t) => DD(t) === 6 ? `[${t}]` : t, H8 = (t, e, n = "/", r, i = "http") => { const o = new URL(`${i}://${Tle(t)}`); if (o.port = e, o.pathname = n, r) for (const a in r) o.searchParams.set(a, r[a]); return decodeURIComponent(o.toString()); }, lB = (t = 8) => o7(36).toString("hex").slice(0, t), W8 = l.Object({ host: l.String({ default: "::" }), port: l.Number({ default: 6099 }), token: l.String({ default: lB(12) }), loginRate: l.Number({ default: 10 }), autoLoginAccount: l.String({ default: "" }), theme: Cle, // 是否关闭WebUI disableWebUI: l.Boolean({ default: !1 }), // 网络访问控制模式: 'none' | 'whitelist' | 'blacklist' accessControlMode: l.Union([ l.Literal("none"), l.Literal("whitelist"), l.Literal("blacklist") ], { default: "none" }), // IP白名单列表 ipWhitelist: l.Array(l.String(), { default: [] }), // IP黑名单列表 ipBlacklist: l.Array(l.String(), { default: [] }), // 是否启用 X-Forwarded-For 获取真实IP enableXForwardedFor: l.Boolean({ default: !1 }), // 是否启用双因素认证(2FA) enable2FA: l.Boolean({ default: !1 }), // TOTP 密钥 totpSecret: l.String({ default: "" }) }); class kle { WebUiConfigData = void 0; validateAndApplyDefaults(e) { let n = e; return n = wc(W8, n), zu.Compile(W8).Check(n), n; } async ensureConfigFileExists(e) { await Wn.access(e, Ks.F_OK).then(() => !0).catch(() => !1) || await Wn.writeFile(e, JSON.stringify(this.validateAndApplyDefaults({}), null, 4)); } async readAndValidateConfig(e) { const n = await Wn.readFile(e, "utf-8"); return this.validateAndApplyDefaults(JSON.parse(n)); } async writeConfig(e, n) { await Wn.access(e, Ks.W_OK).then(() => !0).catch(() => !1) ? await Wn.writeFile(e, JSON.stringify(n, null, 4)) : console.warn(`文件: ${e} 没有写入权限, 配置的更改部分可能会在重启后还原.`); } async GetWebUIConfig() { if (this.WebUiConfigData) return this.WebUiConfigData; try { const e = Bn(lt.configPath, "./webui.json"); await this.ensureConfigFileExists(e); const n = await this.readAndValidateConfig(e); return this.WebUiConfigData = { ...n, // 首次读取内存中是没有token的,需要进行一层兜底 token: Na() || n.token }, this.WebUiConfigData; } catch (e) { console.log("读取配置文件失败", e); const n = this.validateAndApplyDefaults({}); return this.WebUiConfigData = { ...n, token: Na() || n.token }, this.WebUiConfigData; } } async UpdateWebUIConfig(e) { const n = Bn(lt.configPath, "./webui.json"), r = await this.GetRawWebUIConfig(), i = uB({ ...r }, e), o = this.validateAndApplyDefaults(i); await this.writeConfig(n, o), this.WebUiConfigData = o; } /** * 获取配置文件中实际存储的配置(不被内存token覆盖) * 主要用于配置更新和特殊场景 */ async GetRawWebUIConfig() { if (this.WebUiConfigData) return this.WebUiConfigData; try { const e = Bn(lt.configPath, "./webui.json"); await this.ensureConfigFileExists(e); const n = await this.readAndValidateConfig(e); return this.WebUiConfigData = n, this.WebUiConfigData; } catch (e) { return console.log("读取配置文件失败", e), this.validateAndApplyDefaults({}); } } async UpdateToken(e, n) { if ((Na() || (await this.GetWebUIConfig()).token) !== e) throw new Error("旧 token 不匹配"); await this.UpdateWebUIConfig({ token: n }); } // 获取日志文件夹路径 async GetLogsPath() { return Bn(lt.logsPath); } // 获取日志列表 async GetLogsList() { const e = Bn(lt.logsPath); return await Wn.access(e, Ks.F_OK).then(() => !0).catch(() => !1) ? (await Wn.readdir(e)).filter((r) => r.endsWith(".log")).map((r) => r.replace(".log", "")) : []; } // 获取指定日志文件内容 async GetLogContent(e) { const n = Bn(lt.logsPath, `${e}.log`); return await Wn.access(n, Ks.R_OK).then(() => !0).catch(() => !1) ? await Wn.readFile(n, "utf-8") : ""; } // 获取字体文件夹内的字体列表 async GetFontList() { const e = Bn(lt.configPath, "./fonts"); return await Wn.access(e, Ks.F_OK).then(() => !0).catch(() => !1) ? (await Wn.readdir(e)).filter((r) => r.endsWith(".ttf")) : []; } // 判断字体是否存在(支持多种格式) async CheckWebUIFontExist() { const e = await this.GetWebUIFontPath(); return e ? await Wn.access(e, Ks.F_OK).then(() => !0).catch(() => !1) : !1; } // 获取webui字体文件路径(支持多种格式) async GetWebUIFontPath() { const e = Bn(lt.configPath, "./fonts"), n = [".woff", ".woff2", ".ttf", ".otf"]; for (const r of n) { const i = Bn(e, `webui${r}`); if (await Wn.access(i, Ks.F_OK).then(() => !0).catch(() => !1)) return i; } return null; } // 同步版本,用于 multer 配置 GetWebUIFontPathSync() { return Bn(lt.configPath, "./fonts/webui.woff"); } getAutoLoginAccount() { return this.WebUiConfigData?.autoLoginAccount; } // 获取自动登录账号 async GetAutoLoginAccount() { return (await this.GetWebUIConfig()).autoLoginAccount; } // 更新自动登录账号 async UpdateAutoLoginAccount(e) { await this.UpdateWebUIConfig({ autoLoginAccount: e }); } // 获取主题内容 async GetTheme() { return (await this.GetWebUIConfig()).theme; } // 更新主题内容 async UpdateTheme(e) { await this.UpdateWebUIConfig({ theme: e }); } // 获取是否禁用WebUI async GetDisableWebUI() { return (await this.GetWebUIConfig()).disableWebUI; } // 更新是否禁用WebUI async UpdateDisableWebUI(e) { await this.UpdateWebUIConfig({ disableWebUI: e }); } // 获取访问控制模式 async GetAccessControlMode() { return (await this.GetWebUIConfig()).accessControlMode; } // 更新访问控制模式 async UpdateAccessControlMode(e) { await this.UpdateWebUIConfig({ accessControlMode: e }); } // 获取IP白名单 async GetIpWhitelist() { return (await this.GetWebUIConfig()).ipWhitelist; } // 更新IP白名单 async UpdateIpWhitelist(e) { await this.UpdateWebUIConfig({ ipWhitelist: e }); } // 获取IP黑名单 async GetIpBlacklist() { return (await this.GetWebUIConfig()).ipBlacklist; } // 更新IP黑名单 async UpdateIpBlacklist(e) { await this.UpdateWebUIConfig({ ipBlacklist: e }); } // 获取是否启用 X-Forwarded-For async GetEnableXForwardedFor() { return (await this.GetWebUIConfig()).enableXForwardedFor || !1; } // 更新是否启用 X-Forwarded-For async UpdateEnableXForwardedFor(e) { await this.UpdateWebUIConfig({ enableXForwardedFor: e }); } } var cu = { exports: {} }, ec = { exports: {} }, Jh = {}; /*! * media-typer * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ var K8; function Nle() { if (K8) return Jh; K8 = 1; var t = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g, e = /^[\u0020-\u007e\u0080-\u00ff]+$/, n = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/, r = /\\([\u0000-\u007f])/g, i = /([\\"])/g, o = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/, a = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/, s = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/; Jh.format = c, Jh.parse = u; function c(m) { if (!m || typeof m != "object") throw new TypeError("argument obj is required"); var h = m.parameters, y = m.subtype, x = m.suffix, g = m.type; if (!g || !a.test(g)) throw new TypeError("invalid type"); if (!y || !o.test(y)) throw new TypeError("invalid subtype"); var b = g + "/" + y; if (x) { if (!a.test(x)) throw new TypeError("invalid suffix"); b += "+" + x; } if (h && typeof h == "object") for (var S, E = Object.keys(h).sort(), T = 0; T < E.length; T++) { if (S = E[T], !n.test(S)) throw new TypeError("invalid parameter name"); b += "; " + S + "=" + p(h[S]); } return b; } function u(m) { if (!m) throw new TypeError("argument string is required"); if (typeof m == "object" && (m = d(m)), typeof m != "string") throw new TypeError("argument string is required to be a string"); var h = m.indexOf(";"), y = h !== -1 ? m.substr(0, h) : m, x, g, b = f(y), S = {}, E; for (t.lastIndex = h; g = t.exec(m); ) { if (g.index !== h) throw new TypeError("invalid parameter format"); h += g[0].length, x = g[1].toLowerCase(), E = g[2], E[0] === '"' && (E = E.substr(1, E.length - 2).replace(r, "$1")), S[x] = E; } if (h !== -1 && h !== m.length) throw new TypeError("invalid parameter format"); return b.parameters = S, b; } function d(m) { if (typeof m.getHeader == "function") return m.getHeader("content-type"); if (typeof m.headers == "object") return m.headers && m.headers["content-type"]; } function p(m) { var h = String(m); if (n.test(h)) return h; if (h.length > 0 && !e.test(h)) throw new TypeError("invalid parameter value"); return '"' + h.replace(i, "\\$1") + '"'; } function f(m) { var h = s.exec(m.toLowerCase()); if (!h) throw new TypeError("invalid media type"); var y = h[1], x = h[2], g, b = x.lastIndexOf("+"); b !== -1 && (g = x.substr(b + 1), x = x.substr(0, b)); var S = { type: y, subtype: x, suffix: g }; return S; } return Jh; } var Yx = {}; const Ple = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/3gpp-ims+xml": { source: "iana", compressible: !0 }, "application/3gpphal+json": { source: "iana", compressible: !0 }, "application/3gpphalforms+json": { source: "iana", compressible: !0 }, "application/a2l": { source: "iana" }, "application/ace+cbor": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: !0 }, "application/alto-costmap+json": { source: "iana", compressible: !0 }, "application/alto-costmapfilter+json": { source: "iana", compressible: !0 }, "application/alto-directory+json": { source: "iana", compressible: !0 }, "application/alto-endpointcost+json": { source: "iana", compressible: !0 }, "application/alto-endpointcostparams+json": { source: "iana", compressible: !0 }, "application/alto-endpointprop+json": { source: "iana", compressible: !0 }, "application/alto-endpointpropparams+json": { source: "iana", compressible: !0 }, "application/alto-error+json": { source: "iana", compressible: !0 }, "application/alto-networkmap+json": { source: "iana", compressible: !0 }, "application/alto-networkmapfilter+json": { source: "iana", compressible: !0 }, "application/alto-updatestreamcontrol+json": { source: "iana", compressible: !0 }, "application/alto-updatestreamparams+json": { source: "iana", compressible: !0 }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/at+jwt": { source: "iana" }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: !0, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: !0, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: !0, extensions: ["atomdeleted"] }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: !0, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: !0, extensions: ["dwd"] }, "application/atsc-dynamic-event-message": { source: "iana" }, "application/atsc-held+xml": { source: "iana", compressible: !0, extensions: ["held"] }, "application/atsc-rdt+json": { source: "iana", compressible: !0 }, "application/atsc-rsat+xml": { source: "iana", compressible: !0, extensions: ["rsat"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: !0 }, "application/bacnet-xdd+zip": { source: "iana", compressible: !1 }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: !1, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/calendar+json": { source: "iana", compressible: !0 }, "application/calendar+xml": { source: "iana", compressible: !0, extensions: ["xcs"] }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/captive+json": { source: "iana", compressible: !0 }, "application/cbor": { source: "iana" }, "application/cbor-seq": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: !0 }, "application/ccxml+xml": { source: "iana", compressible: !0, extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana", compressible: !0, extensions: ["cdfx"] }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: !0 }, "application/cellml+xml": { source: "iana", compressible: !0 }, "application/cfw": { source: "iana" }, "application/city+json": { source: "iana", compressible: !0 }, "application/clr": { source: "iana" }, "application/clue+xml": { source: "iana", compressible: !0 }, "application/clue_info+xml": { source: "iana", compressible: !0 }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: !0 }, "application/coap-group+json": { source: "iana", compressible: !0 }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: !0 }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: !0, extensions: ["cpl"] }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: !0 }, "application/cstadata+xml": { source: "iana", compressible: !0 }, "application/csvm+json": { source: "iana", compressible: !0 }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: !0 }, "application/dash+xml": { source: "iana", compressible: !0, extensions: ["mpd"] }, "application/dash-patch+xml": { source: "iana", compressible: !0, extensions: ["mpp"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: !0, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: !0 }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: !0 }, "application/dicom+xml": { source: "iana", compressible: !0 }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: !0 }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: !0, extensions: ["dbk"] }, "application/dots+cbor": { source: "iana" }, "application/dskpp+xml": { source: "iana", compressible: !0 }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", compressible: !0, extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: !0, extensions: ["es", "ecma"] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: !1 }, "application/edifact": { source: "iana", compressible: !1 }, "application/efi": { source: "iana" }, "application/elm+json": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/elm+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.control+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: !0 }, "application/emma+xml": { source: "iana", compressible: !0, extensions: ["emma"] }, "application/emotionml+xml": { source: "iana", compressible: !0, extensions: ["emotionml"] }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: !0 }, "application/epub+zip": { source: "iana", compressible: !1, extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/expect-ct-report+json": { source: "iana", compressible: !0 }, "application/express": { source: "iana", extensions: ["exp"] }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana", compressible: !0, extensions: ["fdt"] }, "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/fido.trusted-apps+json": { compressible: !0 }, "application/fits": { source: "iana" }, "application/flexfec": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: !1 }, "application/framework-attributes+xml": { source: "iana", compressible: !0 }, "application/geo+json": { source: "iana", compressible: !0, extensions: ["geojson"] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geoxacml+xml": { source: "iana", compressible: !0 }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: !0, extensions: ["gml"] }, "application/gpx+xml": { source: "apache", compressible: !0, extensions: ["gpx"] }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: !1, extensions: ["gz"] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: !0 }, "application/hjson": { extensions: ["hjson"] }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana", compressible: !0 }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: !0 }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: !0, extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: !0, extensions: ["its"] }, "application/java-archive": { source: "apache", compressible: !1, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: !1, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: !1, extensions: ["class"] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["js", "mjs"] }, "application/jf2feed+json": { source: "iana", compressible: !0 }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: !0 }, "application/jrd+json": { source: "iana", compressible: !0 }, "application/jscalendar+json": { source: "iana", compressible: !0 }, "application/json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: !0 }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: !0, extensions: ["jsonml"] }, "application/jwk+json": { source: "iana", compressible: !0 }, "application/jwk-set+json": { source: "iana", compressible: !0 }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: !0 }, "application/kpml-response+xml": { source: "iana", compressible: !0 }, "application/ld+json": { source: "iana", compressible: !0, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana", compressible: !0, extensions: ["lgr"] }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana", compressible: !0 }, "application/lost+xml": { source: "iana", compressible: !0, extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana", compressible: !0 }, "application/lpf+zip": { source: "iana", compressible: !1 }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: !0, extensions: ["mads"] }, "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", compressible: !0, extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", compressible: !0, extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana", compressible: !0 }, "application/mathml-presentation+xml": { source: "iana", compressible: !0 }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: !0 }, "application/mbms-deregister+xml": { source: "iana", compressible: !0 }, "application/mbms-envelope+xml": { source: "iana", compressible: !0 }, "application/mbms-msk+xml": { source: "iana", compressible: !0 }, "application/mbms-msk-response+xml": { source: "iana", compressible: !0 }, "application/mbms-protection-description+xml": { source: "iana", compressible: !0 }, "application/mbms-reception-report+xml": { source: "iana", compressible: !0 }, "application/mbms-register+xml": { source: "iana", compressible: !0 }, "application/mbms-register-response+xml": { source: "iana", compressible: !0 }, "application/mbms-schedule+xml": { source: "iana", compressible: !0 }, "application/mbms-user-service-description+xml": { source: "iana", compressible: !0 }, "application/mbox": { source: "iana", extensions: ["mbox"] }, "application/media-policy-dataset+xml": { source: "iana", compressible: !0, extensions: ["mpf"] }, "application/media_control+xml": { source: "iana", compressible: !0 }, "application/mediaservercontrol+xml": { source: "iana", compressible: !0, extensions: ["mscml"] }, "application/merge-patch+json": { source: "iana", compressible: !0 }, "application/metalink+xml": { source: "apache", compressible: !0, extensions: ["metalink"] }, "application/metalink4+xml": { source: "iana", compressible: !0, extensions: ["meta4"] }, "application/mets+xml": { source: "iana", compressible: !0, extensions: ["mets"] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mipc": { source: "iana" }, "application/missing-blocks+cbor-seq": { source: "iana" }, "application/mmt-aei+xml": { source: "iana", compressible: !0, extensions: ["maei"] }, "application/mmt-usd+xml": { source: "iana", compressible: !0, extensions: ["musd"] }, "application/mods+xml": { source: "iana", compressible: !0, extensions: ["mods"] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: ["m21", "mp21"] }, "application/mp4": { source: "iana", extensions: ["mp4s", "m4p"] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana", compressible: !0 }, "application/mrb-publish+xml": { source: "iana", compressible: !0 }, "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/msword": { source: "iana", compressible: !1, extensions: ["doc", "dot"] }, "application/mud+json": { source: "iana", compressible: !0 }, "application/multipart-core": { source: "iana" }, "application/mxf": { source: "iana", extensions: ["mxf"] }, "application/n-quads": { source: "iana", extensions: ["nq"] }, "application/n-triples": { source: "iana", extensions: ["nt"] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana", charset: "US-ASCII" }, "application/news-groupinfo": { source: "iana", charset: "US-ASCII" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana", compressible: !0 }, "application/node": { source: "iana", extensions: ["cjs"] }, "application/nss": { source: "iana" }, "application/oauth-authz-req+jwt": { source: "iana" }, "application/oblivious-dns-message": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: !1, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] }, "application/oda": { source: "iana", extensions: ["oda"] }, "application/odm+xml": { source: "iana", compressible: !0 }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", compressible: !0, extensions: ["opf"] }, "application/ogg": { source: "iana", compressible: !1, extensions: ["ogx"] }, "application/omdoc+xml": { source: "apache", compressible: !0, extensions: ["omdoc"] }, "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] }, "application/opc-nodeset+xml": { source: "iana", compressible: !0 }, "application/oscore": { source: "iana" }, "application/oxps": { source: "iana", extensions: ["oxps"] }, "application/p21": { source: "iana" }, "application/p21+zip": { source: "iana", compressible: !1 }, "application/p2p-overlay+xml": { source: "iana", compressible: !0, extensions: ["relo"] }, "application/parityfec": { source: "iana" }, "application/passport": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", compressible: !0, extensions: ["xer"] }, "application/pdf": { source: "iana", compressible: !1, extensions: ["pdf"] }, "application/pdx": { source: "iana" }, "application/pem-certificate-chain": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: !1, extensions: ["pgp"] }, "application/pgp-keys": { source: "iana", extensions: ["asc"] }, "application/pgp-signature": { source: "iana", extensions: ["asc", "sig"] }, "application/pics-rules": { source: "apache", extensions: ["prf"] }, "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/pkcs10": { source: "iana", extensions: ["p10"] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] }, "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] }, "application/pkcs8": { source: "iana", extensions: ["p8"] }, "application/pkcs8-encrypted": { source: "iana" }, "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] }, "application/pkix-cert": { source: "iana", extensions: ["cer"] }, "application/pkix-crl": { source: "iana", extensions: ["crl"] }, "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] }, "application/pkixcmp": { source: "iana", extensions: ["pki"] }, "application/pls+xml": { source: "iana", compressible: !0, extensions: ["pls"] }, "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/postscript": { source: "iana", compressible: !0, extensions: ["ai", "eps", "ps"] }, "application/ppsp-tracker+json": { source: "iana", compressible: !0 }, "application/problem+json": { source: "iana", compressible: !0 }, "application/problem+xml": { source: "iana", compressible: !0 }, "application/provenance+xml": { source: "iana", compressible: !0, extensions: ["provx"] }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: ["cww"] }, "application/prs.cyn": { source: "iana", charset: "7-BIT" }, "application/prs.hpub+zip": { source: "iana", compressible: !1 }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.xsf+xml": { source: "iana", compressible: !0 }, "application/pskc+xml": { source: "iana", compressible: !0, extensions: ["pskcxml"] }, "application/pvd+json": { source: "iana", compressible: !0 }, "application/qsig": { source: "iana" }, "application/raml+yaml": { compressible: !0, extensions: ["raml"] }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: !0 }, "application/rdf+xml": { source: "iana", compressible: !0, extensions: ["rdf", "owl"] }, "application/reginfo+xml": { source: "iana", compressible: !0, extensions: ["rif"] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] }, "application/remote-printing": { source: "iana" }, "application/reputon+json": { source: "iana", compressible: !0 }, "application/resource-lists+xml": { source: "iana", compressible: !0, extensions: ["rl"] }, "application/resource-lists-diff+xml": { source: "iana", compressible: !0, extensions: ["rld"] }, "application/rfc+xml": { source: "iana", compressible: !0 }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana", compressible: !0 }, "application/rls-services+xml": { source: "iana", compressible: !0, extensions: ["rs"] }, "application/route-apd+xml": { source: "iana", compressible: !0, extensions: ["rapd"] }, "application/route-s-tsid+xml": { source: "iana", compressible: !0, extensions: ["sls"] }, "application/route-usd+xml": { source: "iana", compressible: !0, extensions: ["rusd"] }, "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] }, "application/rpki-manifest": { source: "iana", extensions: ["mft"] }, "application/rpki-publication": { source: "iana" }, "application/rpki-roa": { source: "iana", extensions: ["roa"] }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", compressible: !0, extensions: ["rsd"] }, "application/rss+xml": { source: "apache", compressible: !0, extensions: ["rss"] }, "application/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana", compressible: !0 }, "application/samlmetadata+xml": { source: "iana", compressible: !0 }, "application/sarif+json": { source: "iana", compressible: !0 }, "application/sarif-external-properties+json": { source: "iana", compressible: !0 }, "application/sbe": { source: "iana" }, "application/sbml+xml": { source: "iana", compressible: !0, extensions: ["sbml"] }, "application/scaip+xml": { source: "iana", compressible: !0 }, "application/scim+json": { source: "iana", compressible: !0 }, "application/scvp-cv-request": { source: "iana", extensions: ["scq"] }, "application/scvp-cv-response": { source: "iana", extensions: ["scs"] }, "application/scvp-vp-request": { source: "iana", extensions: ["spq"] }, "application/scvp-vp-response": { source: "iana", extensions: ["spp"] }, "application/sdp": { source: "iana", extensions: ["sdp"] }, "application/secevent+jwt": { source: "iana" }, "application/senml+cbor": { source: "iana" }, "application/senml+json": { source: "iana", compressible: !0 }, "application/senml+xml": { source: "iana", compressible: !0, extensions: ["senmlx"] }, "application/senml-etch+cbor": { source: "iana" }, "application/senml-etch+json": { source: "iana", compressible: !0 }, "application/senml-exi": { source: "iana" }, "application/sensml+cbor": { source: "iana" }, "application/sensml+json": { source: "iana", compressible: !0 }, "application/sensml+xml": { source: "iana", compressible: !0, extensions: ["sensmlx"] }, "application/sensml-exi": { source: "iana" }, "application/sep+xml": { source: "iana", compressible: !0 }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", compressible: !0, extensions: ["shf"] }, "application/sieve": { source: "iana", extensions: ["siv", "sieve"] }, "application/simple-filter+xml": { source: "iana", compressible: !0 }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/sipc": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "iana" }, "application/smil+xml": { source: "iana", compressible: !0, extensions: ["smi", "smil"] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: !0 }, "application/sparql-query": { source: "iana", extensions: ["rq"] }, "application/sparql-results+xml": { source: "iana", compressible: !0, extensions: ["srx"] }, "application/spdx+json": { source: "iana", compressible: !0 }, "application/spirits-event+xml": { source: "iana", compressible: !0 }, "application/sql": { source: "iana" }, "application/srgs": { source: "iana", extensions: ["gram"] }, "application/srgs+xml": { source: "iana", compressible: !0, extensions: ["grxml"] }, "application/sru+xml": { source: "iana", compressible: !0, extensions: ["sru"] }, "application/ssdl+xml": { source: "apache", compressible: !0, extensions: ["ssdl"] }, "application/ssml+xml": { source: "iana", compressible: !0, extensions: ["ssml"] }, "application/stix+json": { source: "iana", compressible: !0 }, "application/swid+xml": { source: "iana", compressible: !0, extensions: ["swidtag"] }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: !0 }, "application/taxii+json": { source: "iana", compressible: !0 }, "application/td+json": { source: "iana", compressible: !0 }, "application/tei+xml": { source: "iana", compressible: !0, extensions: ["tei", "teicorpus"] }, "application/tetra_isi": { source: "iana" }, "application/thraud+xml": { source: "iana", compressible: !0, extensions: ["tfi"] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: ["tsd"] }, "application/tlsrpt+gzip": { source: "iana" }, "application/tlsrpt+json": { source: "iana", compressible: !0 }, "application/tnauthlist": { source: "iana" }, "application/token-introspection+jwt": { source: "iana" }, "application/toml": { compressible: !0, extensions: ["toml"] }, "application/trickle-ice-sdpfrag": { source: "iana" }, "application/trig": { source: "iana", extensions: ["trig"] }, "application/ttml+xml": { source: "iana", compressible: !0, extensions: ["ttml"] }, "application/tve-trigger": { source: "iana" }, "application/tzif": { source: "iana" }, "application/tzif-leap": { source: "iana" }, "application/ubjson": { compressible: !1, extensions: ["ubj"] }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana", compressible: !0 }, "application/urc-ressheet+xml": { source: "iana", compressible: !0, extensions: ["rsheet"] }, "application/urc-targetdesc+xml": { source: "iana", compressible: !0, extensions: ["td"] }, "application/urc-uisocketdesc+xml": { source: "iana", compressible: !0 }, "application/vcard+json": { source: "iana", compressible: !0 }, "application/vcard+xml": { source: "iana", compressible: !0 }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: !0, extensions: ["1km"] }, "application/vnd.3gpp-prose+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-v2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.5gnas": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.gtpc": { source: "iana" }, "application/vnd.3gpp.interworking-data": { source: "iana" }, "application/vnd.3gpp.lpp": { source: "iana" }, "application/vnd.3gpp.mc-signalling-ear": { source: "iana" }, "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-payload": { source: "iana" }, "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-signalling": { source: "iana" }, "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-affiliation-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.ngap": { source: "iana" }, "application/vnd.3gpp.pfcp": { source: "iana" }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] }, "application/vnd.3gpp.s1ap": { source: "iana" }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] }, "application/vnd.acucobol": { source: "iana", extensions: ["acu"] }, "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: !1, extensions: ["air"] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] }, "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", compressible: !0, extensions: ["xdp"] }, "application/vnd.adobe.xfdf": { source: "iana", extensions: ["xfdf"] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.afpc.afplinedata": { source: "iana" }, "application/vnd.afpc.afplinedata-pagedef": { source: "iana" }, "application/vnd.afpc.cmoca-cmresource": { source: "iana" }, "application/vnd.afpc.foca-charset": { source: "iana" }, "application/vnd.afpc.foca-codedfont": { source: "iana" }, "application/vnd.afpc.foca-codepage": { source: "iana" }, "application/vnd.afpc.modca": { source: "iana" }, "application/vnd.afpc.modca-cmtable": { source: "iana" }, "application/vnd.afpc.modca-formdef": { source: "iana" }, "application/vnd.afpc.modca-mediummap": { source: "iana" }, "application/vnd.afpc.modca-objectcontainer": { source: "iana" }, "application/vnd.afpc.modca-overlay": { source: "iana" }, "application/vnd.afpc.modca-pagesegment": { source: "iana" }, "application/vnd.age": { source: "iana", extensions: ["age"] }, "application/vnd.ah-barcode": { source: "iana" }, "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] }, "application/vnd.amadeus+json": { source: "iana", compressible: !0 }, "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] }, "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] }, "application/vnd.amundsen.maze+xml": { source: "iana", compressible: !0 }, "application/vnd.android.ota": { source: "iana" }, "application/vnd.android.package-archive": { source: "apache", compressible: !1, extensions: ["apk"] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] }, "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] }, "application/vnd.apache.arrow.file": { source: "iana" }, "application/vnd.apache.arrow.stream": { source: "iana" }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: !0 }, "application/vnd.aplextor.warrp+json": { source: "iana", compressible: !0 }, "application/vnd.apothekende.reservation+json": { source: "iana", compressible: !0 }, "application/vnd.apple.installer+xml": { source: "iana", compressible: !0, extensions: ["mpkg"] }, "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] }, "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] }, "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] }, "application/vnd.apple.pkpass": { compressible: !1, extensions: ["pkpass"] }, "application/vnd.arastra.swi": { source: "iana" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] }, "application/vnd.artisan+json": { source: "iana", compressible: !0 }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] }, "application/vnd.audiograph": { source: "iana", extensions: ["aep"] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avalon+json": { source: "iana", compressible: !0 }, "application/vnd.avistar+xml": { source: "iana", compressible: !0 }, "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: !0, extensions: ["bmml"] }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.banana-accounting": { source: "iana" }, "application/vnd.bbf.usp.error": { source: "iana" }, "application/vnd.bbf.usp.msg": { source: "iana" }, "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: !0 }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: !0 }, "application/vnd.bint.med-content": { source: "iana" }, "application/vnd.biopax.rdf+xml": { source: "iana", compressible: !0 }, "application/vnd.blink-idb-value-wrapper": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: ["bmi"] }, "application/vnd.bpf": { source: "iana" }, "application/vnd.bpf3": { source: "iana" }, "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] }, "application/vnd.byu.uapi+json": { source: "iana", compressible: !0 }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.capasystems-pg+json": { source: "iana", compressible: !0 }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", compressible: !0, extensions: ["cdxml"] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] }, "application/vnd.ciedi": { source: "iana" }, "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana", compressible: !0, extensions: ["csl"] }, "application/vnd.claymore": { source: "iana", extensions: ["cla"] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] }, "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collabio.xodocuments.document": { source: "iana" }, "application/vnd.collabio.xodocuments.document-template": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: !0 }, "application/vnd.collection.doc+json": { source: "iana", compressible: !0 }, "application/vnd.collection.next+json": { source: "iana", compressible: !0 }, "application/vnd.comicbook+zip": { source: "iana", compressible: !1 }, "application/vnd.comicbook-rar": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: ["csp"] }, "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: !0 }, "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] }, "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: !0, extensions: ["wbs"] }, "application/vnd.cryptii.pipe+json": { source: "iana", compressible: !0 }, "application/vnd.crypto-shade-file": { source: "iana" }, "application/vnd.cryptomator.encrypted": { source: "iana" }, "application/vnd.cryptomator.vault": { source: "iana" }, "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] }, "application/vnd.ctct.ws+xml": { source: "iana", compressible: !0 }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: ["car"] }, "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: !0 }, "application/vnd.cybank": { source: "iana" }, "application/vnd.cyclonedx+json": { source: "iana", compressible: !0 }, "application/vnd.cyclonedx+xml": { source: "iana", compressible: !0 }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: !1 }, "application/vnd.d3m-dataset": { source: "iana" }, "application/vnd.d3m-problem": { source: "iana" }, "application/vnd.dart": { source: "iana", compressible: !0, extensions: ["dart"] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] }, "application/vnd.datapackage+json": { source: "iana", compressible: !0 }, "application/vnd.dataresource+json": { source: "iana", compressible: !0 }, "application/vnd.dbf": { source: "iana", extensions: ["dbf"] }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] }, "application/vnd.dece.ttml+xml": { source: "iana", compressible: !0, extensions: ["uvt", "uvvt"] }, "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] }, "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] }, "application/vnd.desmume.movie": { source: "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana", compressible: !0 }, "application/vnd.dna": { source: "iana", extensions: ["dna"] }, "application/vnd.document+json": { source: "iana", compressible: !0 }, "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] }, "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] }, "application/vnd.drive+json": { source: "iana", compressible: !0 }, "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] }, "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: ["geo"] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecip.rlp": { source: "iana" }, "application/vnd.eclipse.ditto+json": { source: "iana", compressible: !0 }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.efi.img": { source: "iana" }, "application/vnd.efi.iso": { source: "iana" }, "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: !0 }, "application/vnd.enliven": { source: "iana", extensions: ["nml"] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana", compressible: !0 }, "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] }, "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] }, "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] }, "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] }, "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana", compressible: !1 }, "application/vnd.eszigno3+xml": { source: "iana", compressible: !0, extensions: ["es3", "et3"] }, "application/vnd.etsi.aoc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.cug+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mcid+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.pstn+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.sci+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.simservs+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: !0 }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.evolv.ecig.profile": { source: "iana" }, "application/vnd.evolv.ecig.settings": { source: "iana" }, "application/vnd.evolv.ecig.theme": { source: "iana" }, "application/vnd.exstream-empower+zip": { source: "iana", compressible: !1 }, "application/vnd.exstream-package": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] }, "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: !1 }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "iana", extensions: ["fdf"] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] }, "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.ficlab.flb+zip": { source: "iana", compressible: !1 }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: ["gph"] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] }, "application/vnd.frogans.fnc": { source: "iana", extensions: ["fnc"] }, "application/vnd.frogans.ltf": { source: "iana", extensions: ["ltf"] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] }, "application/vnd.fujifilm.fb.docuworks": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" }, "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: !0 }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.futoin+cbor": { source: "iana" }, "application/vnd.futoin+json": { source: "iana", compressible: !0 }, "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] }, "application/vnd.gentics.grd+json": { source: "iana", compressible: !0 }, "application/vnd.geo+json": { source: "iana", compressible: !0 }, "application/vnd.geocube+xml": { source: "iana", compressible: !0 }, "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] }, "application/vnd.geogebra.slides": { source: "iana" }, "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] }, "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] }, "application/vnd.geonext": { source: "iana", extensions: ["gxt"] }, "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] }, "application/vnd.geospace": { source: "iana", extensions: ["g3w"] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: ["gmx"] }, "application/vnd.google-apps.document": { compressible: !1, extensions: ["gdoc"] }, "application/vnd.google-apps.presentation": { compressible: !1, extensions: ["gslides"] }, "application/vnd.google-apps.spreadsheet": { compressible: !1, extensions: ["gsheet"] }, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: !0, extensions: ["kml"] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: !1, extensions: ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { source: "iana", compressible: !0 }, "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: !1 }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: !0 }, "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: ["gac"] }, "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] }, "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] }, "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] }, "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] }, "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] }, "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] }, "application/vnd.hal+json": { source: "iana", compressible: !0 }, "application/vnd.hal+xml": { source: "iana", compressible: !0, extensions: ["hal"] }, "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: !0, extensions: ["zmm"] }, "application/vnd.hbci": { source: "iana", extensions: ["hbci"] }, "application/vnd.hc+json": { source: "iana", compressible: !0 }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: !0 }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] }, "application/vnd.hl7cda+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] }, "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] }, "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] }, "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] }, "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] }, "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] }, "application/vnd.hyper+json": { source: "iana", compressible: !0 }, "application/vnd.hyper-item+json": { source: "iana", compressible: !0 }, "application/vnd.hyperdrive+json": { source: "iana", compressible: !0 }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "iana" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] }, "application/vnd.ibm.modcap": { source: "iana", extensions: ["afp", "listafp", "list3820"] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] }, "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: ["igl"] }, "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: !1 }, "application/vnd.imagemeter.image+zip": { source: "iana", compressible: !1 }, "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] }, "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: !0 }, "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: !0 }, "application/vnd.informix-visionary": { source: "iana" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana", compressible: !0 }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] }, "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] }, "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] }, "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: !0 }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] }, "application/vnd.irepository.package+xml": { source: "iana", compressible: !0, extensions: ["irp"] }, "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] }, "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] }, "application/vnd.iso11783-10+zip": { source: "iana", compressible: !1 }, "application/vnd.jam": { source: "iana", extensions: ["jam"] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] }, "application/vnd.jisp": { source: "iana", extensions: ["jisp"] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] }, "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] }, "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] }, "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] }, "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] }, "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] }, "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] }, "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] }, "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] }, "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] }, "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] }, "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] }, "application/vnd.las": { source: "iana" }, "application/vnd.las.las+json": { source: "iana", compressible: !0 }, "application/vnd.las.las+xml": { source: "iana", compressible: !0, extensions: ["lasxml"] }, "application/vnd.laszip": { source: "iana" }, "application/vnd.leap+json": { source: "iana", compressible: !0 }, "application/vnd.liberty-request+xml": { source: "iana", compressible: !0 }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: !0, extensions: ["lbe"] }, "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: !1 }, "application/vnd.loom": { source: "iana" }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] }, "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] }, "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] }, "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] }, "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] }, "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] }, "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] }, "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: !0 }, "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: !1 }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: ["mcd"] }, "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: ["mwf"] }, "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] }, "application/vnd.micro+json": { source: "iana", compressible: !0 }, "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] }, "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: !0 }, "application/vnd.mif": { source: "iana", extensions: ["mif"] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] }, "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] }, "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] }, "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] }, "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] }, "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] }, "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] }, "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] }, "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: !0, extensions: ["xul"] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: !1, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] }, "application/vnd.ms-fontobject": { source: "iana", compressible: !0, extensions: ["eot"] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] }, "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] }, "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] }, "application/vnd.ms-office.activex+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] }, "application/vnd.ms-opentype": { source: "apache", compressible: !0 }, "application/vnd.ms-outlook": { compressible: !1, extensions: ["msg"] }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] }, "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-powerpoint": { source: "iana", compressible: !1, extensions: ["ppt", "pps", "pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: !0 }, "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] }, "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] }, "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: !1, extensions: ["xps"] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: ["mseq"] }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: ["mus"] }, "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] }, "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] }, "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: !0 }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: !0 }, "application/vnd.nebumind.line": { source: "iana" }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] }, "application/vnd.nimn": { source: "iana" }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] }, "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] }, "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: !0, extensions: ["ac"] }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: ["n-gage"] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] }, "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] }, "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] }, "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] }, "application/vnd.oasis.opendocument.database": { source: "iana", extensions: ["odb"] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: !1, extensions: ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: !1, extensions: ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: !1, extensions: ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: !1, extensions: ["odt"] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] }, "application/vnd.obn": { source: "iana" }, "application/vnd.ocf+cbor": { source: "iana" }, "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: !0 }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", compressible: !0, extensions: ["dd2"] }, "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+cbor": { source: "iana" }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: !0 }, "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.onepagertamp": { source: "iana" }, "application/vnd.onepagertamx": { source: "iana" }, "application/vnd.onepagertat": { source: "iana" }, "application/vnd.onepagertatp": { source: "iana" }, "application/vnd.onepagertatx": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana", compressible: !0, extensions: ["obgx"] }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] }, "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: !0, extensions: ["osm"] }, "application/vnd.opentimestamps.ots": { source: "iana" }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: !1, extensions: ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: !1, extensions: ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: !1, extensions: ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: !0 }, "application/vnd.oracle.resource+json": { source: "iana", compressible: !0 }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] }, "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: !0 }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: !0 }, "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos.xml": { source: "iana" }, "application/vnd.patentdive": { source: "iana" }, "application/vnd.patientecommsdoc": { source: "iana" }, "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: ["str"] }, "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: ["efif"] }, "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] }, "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: !0 }, "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] }, "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] }, "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] }, "application/vnd.psfs": { source: "iana" }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: !0 }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: !0 }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana", extensions: ["rar"] }, "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] }, "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: !0, extensions: ["musicxml"] }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.resilient.logic": { source: "iana" }, "application/vnd.restful+json": { source: "iana", compressible: !0 }, "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] }, "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] }, "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] }, "application/vnd.route66.link66+xml": { source: "iana", compressible: !0, extensions: ["link66"] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] }, "application/vnd.sar": { source: "iana" }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: ["see"] }, "application/vnd.seis+json": { source: "iana", compressible: !0 }, "application/vnd.sema": { source: "iana", extensions: ["sema"] }, "application/vnd.semd": { source: "iana", extensions: ["semd"] }, "application/vnd.semf": { source: "iana", extensions: ["semf"] }, "application/vnd.shade-save-file": { source: "iana" }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] }, "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] }, "application/vnd.shootproof+json": { source: "iana", compressible: !0 }, "application/vnd.shopkick+json": { source: "iana", compressible: !0 }, "application/vnd.shp": { source: "iana" }, "application/vnd.shx": { source: "iana" }, "application/vnd.sigrok.session": { source: "iana" }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] }, "application/vnd.siren+json": { source: "iana", compressible: !0 }, "application/vnd.smaf": { source: "iana", extensions: ["mmf"] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] }, "application/vnd.snesdev-page-table": { source: "iana" }, "application/vnd.software602.filler.form+xml": { source: "iana", compressible: !0, extensions: ["fo"] }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", compressible: !0, extensions: ["sdkm", "sdkd"] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] }, "application/vnd.sqlite3": { source: "iana" }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] }, "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] }, "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] }, "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] }, "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] }, "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana", compressible: !0, extensions: ["wadl"] }, "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] }, "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] }, "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] }, "application/vnd.svd": { source: "iana", extensions: ["svd"] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.sycle+xml": { source: "iana", compressible: !0 }, "application/vnd.syft+json": { source: "iana", compressible: !0 }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] }, "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xsm"] }, "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] }, "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xdm"] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["ddf"] }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tableschema+json": { source: "iana", compressible: !0 }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] }, "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: !0 }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: !0 }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] }, "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] }, "application/vnd.trueapp": { source: "iana", extensions: ["tra"] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] }, "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] }, "application/vnd.umajin": { source: "iana", extensions: ["umj"] }, "application/vnd.unity": { source: "iana", extensions: ["unityweb"] }, "application/vnd.uoml+xml": { source: "iana", compressible: !0, extensions: ["uoml"] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: ["vcx"] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: !0 }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.veritone.aion+json": { source: "iana", compressible: !0 }, "application/vnd.veryant.thin": { source: "iana" }, "application/vnd.ves.encrypted": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw"] }, "application/vnd.visionary": { source: "iana", extensions: ["vis"] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: ["vsf"] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] }, "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] }, "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] }, "application/vnd.wfa.dpp": { source: "iana" }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] }, "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] }, "application/vnd.wqd": { source: "iana", extensions: ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana", compressible: !0 }, "application/vnd.wv.ssp+xml": { source: "iana", compressible: !0 }, "application/vnd.xacml+json": { source: "iana", compressible: !0 }, "application/vnd.xara": { source: "iana", extensions: ["xar"] }, "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana", compressible: !0 }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: !0, extensions: ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] }, "application/vnd.youtube.yt": { source: "iana" }, "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] }, "application/vnd.zzazz.deck+xml": { source: "iana", compressible: !0, extensions: ["zaz"] }, "application/voicexml+xml": { source: "iana", compressible: !0, extensions: ["vxml"] }, "application/voucher-cms+json": { source: "iana", compressible: !0 }, "application/vq-rtcpxr": { source: "iana" }, "application/wasm": { source: "iana", compressible: !0, extensions: ["wasm"] }, "application/watcherinfo+xml": { source: "iana", compressible: !0, extensions: ["wif"] }, "application/webpush-options+json": { source: "iana", compressible: !0 }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: ["wgt"] }, "application/winhlp": { source: "apache", extensions: ["hlp"] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", compressible: !0, extensions: ["wsdl"] }, "application/wspolicy+xml": { source: "iana", compressible: !0, extensions: ["wspolicy"] }, "application/x-7z-compressed": { source: "apache", compressible: !1, extensions: ["7z"] }, "application/x-abiword": { source: "apache", extensions: ["abw"] }, "application/x-ace-compressed": { source: "apache", extensions: ["ace"] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] }, "application/x-arj": { compressible: !1, extensions: ["arj"] }, "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] }, "application/x-authorware-map": { source: "apache", extensions: ["aam"] }, "application/x-authorware-seg": { source: "apache", extensions: ["aas"] }, "application/x-bcpio": { source: "apache", extensions: ["bcpio"] }, "application/x-bdoc": { compressible: !1, extensions: ["bdoc"] }, "application/x-bittorrent": { source: "apache", extensions: ["torrent"] }, "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] }, "application/x-bzip": { source: "apache", compressible: !1, extensions: ["bz"] }, "application/x-bzip2": { source: "apache", compressible: !1, extensions: ["bz2", "boz"] }, "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] }, "application/x-cdlink": { source: "apache", extensions: ["vcd"] }, "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] }, "application/x-chat": { source: "apache", extensions: ["chat"] }, "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] }, "application/x-chrome-extension": { extensions: ["crx"] }, "application/x-cocoa": { source: "nginx", extensions: ["cco"] }, "application/x-compress": { source: "apache" }, "application/x-conference": { source: "apache", extensions: ["nsc"] }, "application/x-cpio": { source: "apache", extensions: ["cpio"] }, "application/x-csh": { source: "apache", extensions: ["csh"] }, "application/x-deb": { compressible: !1 }, "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] }, "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] }, "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] }, "application/x-doom": { source: "apache", extensions: ["wad"] }, "application/x-dtbncx+xml": { source: "apache", compressible: !0, extensions: ["ncx"] }, "application/x-dtbook+xml": { source: "apache", compressible: !0, extensions: ["dtb"] }, "application/x-dtbresource+xml": { source: "apache", compressible: !0, extensions: ["res"] }, "application/x-dvi": { source: "apache", compressible: !1, extensions: ["dvi"] }, "application/x-envoy": { source: "apache", extensions: ["evy"] }, "application/x-eva": { source: "apache", extensions: ["eva"] }, "application/x-font-bdf": { source: "apache", extensions: ["bdf"] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] }, "application/x-font-pcf": { source: "apache", extensions: ["pcf"] }, "application/x-font-snf": { source: "apache", extensions: ["snf"] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: ["arc"] }, "application/x-futuresplash": { source: "apache", extensions: ["spl"] }, "application/x-gca-compressed": { source: "apache", extensions: ["gca"] }, "application/x-glulx": { source: "apache", extensions: ["ulx"] }, "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] }, "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] }, "application/x-gtar": { source: "apache", extensions: ["gtar"] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: ["hdf"] }, "application/x-httpd-php": { compressible: !0, extensions: ["php"] }, "application/x-install-instructions": { source: "apache", extensions: ["install"] }, "application/x-iso9660-image": { source: "apache", extensions: ["iso"] }, "application/x-iwork-keynote-sffkey": { extensions: ["key"] }, "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] }, "application/x-iwork-pages-sffpages": { extensions: ["pages"] }, "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] }, "application/x-java-jnlp-file": { source: "apache", compressible: !1, extensions: ["jnlp"] }, "application/x-javascript": { compressible: !0 }, "application/x-keepass2": { extensions: ["kdbx"] }, "application/x-latex": { source: "apache", compressible: !1, extensions: ["latex"] }, "application/x-lua-bytecode": { extensions: ["luac"] }, "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] }, "application/x-makeself": { source: "nginx", extensions: ["run"] }, "application/x-mie": { source: "apache", extensions: ["mie"] }, "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] }, "application/x-mpegurl": { compressible: !1 }, "application/x-ms-application": { source: "apache", extensions: ["application"] }, "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] }, "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] }, "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] }, "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] }, "application/x-msaccess": { source: "apache", extensions: ["mdb"] }, "application/x-msbinder": { source: "apache", extensions: ["obd"] }, "application/x-mscardfile": { source: "apache", extensions: ["crd"] }, "application/x-msclip": { source: "apache", extensions: ["clp"] }, "application/x-msdos-program": { extensions: ["exe"] }, "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] }, "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] }, "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] }, "application/x-msmoney": { source: "apache", extensions: ["mny"] }, "application/x-mspublisher": { source: "apache", extensions: ["pub"] }, "application/x-msschedule": { source: "apache", extensions: ["scd"] }, "application/x-msterminal": { source: "apache", extensions: ["trm"] }, "application/x-mswrite": { source: "apache", extensions: ["wri"] }, "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] }, "application/x-ns-proxy-autoconfig": { compressible: !0, extensions: ["pac"] }, "application/x-nzb": { source: "apache", extensions: ["nzb"] }, "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] }, "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] }, "application/x-pkcs12": { source: "apache", compressible: !1, extensions: ["p12", "pfx"] }, "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] }, "application/x-pki-message": { source: "iana" }, "application/x-rar-compressed": { source: "apache", compressible: !1, extensions: ["rar"] }, "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] }, "application/x-research-info-systems": { source: "apache", extensions: ["ris"] }, "application/x-sea": { source: "nginx", extensions: ["sea"] }, "application/x-sh": { source: "apache", compressible: !0, extensions: ["sh"] }, "application/x-shar": { source: "apache", extensions: ["shar"] }, "application/x-shockwave-flash": { source: "apache", compressible: !1, extensions: ["swf"] }, "application/x-silverlight-app": { source: "apache", extensions: ["xap"] }, "application/x-sql": { source: "apache", extensions: ["sql"] }, "application/x-stuffit": { source: "apache", compressible: !1, extensions: ["sit"] }, "application/x-stuffitx": { source: "apache", extensions: ["sitx"] }, "application/x-subrip": { source: "apache", extensions: ["srt"] }, "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] }, "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] }, "application/x-t3vm-image": { source: "apache", extensions: ["t3"] }, "application/x-tads": { source: "apache", extensions: ["gam"] }, "application/x-tar": { source: "apache", compressible: !0, extensions: ["tar"] }, "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] }, "application/x-tex": { source: "apache", extensions: ["tex"] }, "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] }, "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] }, "application/x-tgif": { source: "apache", extensions: ["obj"] }, "application/x-ustar": { source: "apache", extensions: ["ustar"] }, "application/x-virtualbox-hdd": { compressible: !0, extensions: ["hdd"] }, "application/x-virtualbox-ova": { compressible: !0, extensions: ["ova"] }, "application/x-virtualbox-ovf": { compressible: !0, extensions: ["ovf"] }, "application/x-virtualbox-vbox": { compressible: !0, extensions: ["vbox"] }, "application/x-virtualbox-vbox-extpack": { compressible: !1, extensions: ["vbox-extpack"] }, "application/x-virtualbox-vdi": { compressible: !0, extensions: ["vdi"] }, "application/x-virtualbox-vhd": { compressible: !0, extensions: ["vhd"] }, "application/x-virtualbox-vmdk": { compressible: !0, extensions: ["vmdk"] }, "application/x-wais-source": { source: "apache", extensions: ["src"] }, "application/x-web-app-manifest+json": { compressible: !0, extensions: ["webapp"] }, "application/x-www-form-urlencoded": { source: "iana", compressible: !0 }, "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] }, "application/x-x509-ca-ra-cert": { source: "iana" }, "application/x-x509-next-ca-cert": { source: "iana" }, "application/x-xfig": { source: "apache", extensions: ["fig"] }, "application/x-xliff+xml": { source: "apache", compressible: !0, extensions: ["xlf"] }, "application/x-xpinstall": { source: "apache", compressible: !1, extensions: ["xpi"] }, "application/x-xz": { source: "apache", extensions: ["xz"] }, "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana", compressible: !0 }, "application/xaml+xml": { source: "apache", compressible: !0, extensions: ["xaml"] }, "application/xcap-att+xml": { source: "iana", compressible: !0, extensions: ["xav"] }, "application/xcap-caps+xml": { source: "iana", compressible: !0, extensions: ["xca"] }, "application/xcap-diff+xml": { source: "iana", compressible: !0, extensions: ["xdf"] }, "application/xcap-el+xml": { source: "iana", compressible: !0, extensions: ["xel"] }, "application/xcap-error+xml": { source: "iana", compressible: !0 }, "application/xcap-ns+xml": { source: "iana", compressible: !0, extensions: ["xns"] }, "application/xcon-conference-info+xml": { source: "iana", compressible: !0 }, "application/xcon-conference-info-diff+xml": { source: "iana", compressible: !0 }, "application/xenc+xml": { source: "iana", compressible: !0, extensions: ["xenc"] }, "application/xhtml+xml": { source: "iana", compressible: !0, extensions: ["xhtml", "xht"] }, "application/xhtml-voice+xml": { source: "apache", compressible: !0 }, "application/xliff+xml": { source: "iana", compressible: !0, extensions: ["xlf"] }, "application/xml": { source: "iana", compressible: !0, extensions: ["xml", "xsl", "xsd", "rng"] }, "application/xml-dtd": { source: "iana", compressible: !0, extensions: ["dtd"] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana", compressible: !0 }, "application/xmpp+xml": { source: "iana", compressible: !0 }, "application/xop+xml": { source: "iana", compressible: !0, extensions: ["xop"] }, "application/xproc+xml": { source: "apache", compressible: !0, extensions: ["xpl"] }, "application/xslt+xml": { source: "iana", compressible: !0, extensions: ["xsl", "xslt"] }, "application/xspf+xml": { source: "apache", compressible: !0, extensions: ["xspf"] }, "application/xv+xml": { source: "iana", compressible: !0, extensions: ["mxml", "xhvml", "xvml", "xvm"] }, "application/yang": { source: "iana", extensions: ["yang"] }, "application/yang-data+json": { source: "iana", compressible: !0 }, "application/yang-data+xml": { source: "iana", compressible: !0 }, "application/yang-patch+json": { source: "iana", compressible: !0 }, "application/yang-patch+xml": { source: "iana", compressible: !0 }, "application/yin+xml": { source: "iana", compressible: !0, extensions: ["yin"] }, "application/zip": { source: "iana", compressible: !1, extensions: ["zip"] }, "application/zlib": { source: "iana" }, "application/zstd": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: !1, extensions: ["3gpp"] }, "audio/3gpp2": { source: "iana" }, "audio/aac": { source: "iana" }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: ["adp"] }, "audio/amr": { source: "iana", extensions: ["amr"] }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: !1, extensions: ["au", "snd"] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/flexfec": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: !1 }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/melp": { source: "iana" }, "audio/melp1200": { source: "iana" }, "audio/melp2400": { source: "iana" }, "audio/melp600": { source: "iana" }, "audio/mhas": { source: "iana" }, "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] }, "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] }, "audio/mp3": { compressible: !1, extensions: ["mp3"] }, "audio/mp4": { source: "iana", compressible: !1, extensions: ["m4a", "mp4a"] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: !1, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: !1, extensions: ["oga", "ogg", "spx", "opus"] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: ["s3m"] }, "audio/scip": { source: "iana" }, "audio/silk": { source: "apache", extensions: ["sil"] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sofa": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tetra_acelp": { source: "iana" }, "audio/tetra_acelp_bb": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/tsvcis": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/usac": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] }, "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: ["dra"] }, "audio/vnd.dts": { source: "iana", extensions: ["dts"] }, "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] }, "audio/vnd.dts.uhd": { source: "iana" }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.presonus.multitrack": { source: "iana" }, "audio/vnd.qcelp": { source: "iana" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: ["rip"] }, "audio/vnd.rn-realaudio": { compressible: !1 }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: !1 }, "audio/vorbis": { source: "iana", compressible: !1 }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: !1, extensions: ["wav"] }, "audio/wave": { compressible: !1, extensions: ["wav"] }, "audio/webm": { source: "apache", compressible: !1, extensions: ["weba"] }, "audio/x-aac": { source: "apache", compressible: !1, extensions: ["aac"] }, "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] }, "audio/x-caf": { source: "apache", compressible: !1, extensions: ["caf"] }, "audio/x-flac": { source: "apache", extensions: ["flac"] }, "audio/x-m4a": { source: "nginx", extensions: ["m4a"] }, "audio/x-matroska": { source: "apache", extensions: ["mka"] }, "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] }, "audio/x-ms-wax": { source: "apache", extensions: ["wax"] }, "audio/x-ms-wma": { source: "apache", extensions: ["wma"] }, "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] }, "audio/x-realaudio": { source: "nginx", extensions: ["ra"] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: ["wav"] }, "audio/xm": { source: "apache", extensions: ["xm"] }, "chemical/x-cdx": { source: "apache", extensions: ["cdx"] }, "chemical/x-cif": { source: "apache", extensions: ["cif"] }, "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] }, "chemical/x-cml": { source: "apache", extensions: ["cml"] }, "chemical/x-csml": { source: "apache", extensions: ["csml"] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: ["xyz"] }, "font/collection": { source: "iana", extensions: ["ttc"] }, "font/otf": { source: "iana", compressible: !0, extensions: ["otf"] }, "font/sfnt": { source: "iana" }, "font/ttf": { source: "iana", compressible: !0, extensions: ["ttf"] }, "font/woff": { source: "iana", extensions: ["woff"] }, "font/woff2": { source: "iana", extensions: ["woff2"] }, "image/aces": { source: "iana", extensions: ["exr"] }, "image/apng": { compressible: !1, extensions: ["apng"] }, "image/avci": { source: "iana", extensions: ["avci"] }, "image/avcs": { source: "iana", extensions: ["avcs"] }, "image/avif": { source: "iana", compressible: !1, extensions: ["avif"] }, "image/bmp": { source: "iana", compressible: !0, extensions: ["bmp"] }, "image/cgm": { source: "iana", extensions: ["cgm"] }, "image/dicom-rle": { source: "iana", extensions: ["drle"] }, "image/emf": { source: "iana", extensions: ["emf"] }, "image/fits": { source: "iana", extensions: ["fits"] }, "image/g3fax": { source: "iana", extensions: ["g3"] }, "image/gif": { source: "iana", compressible: !1, extensions: ["gif"] }, "image/heic": { source: "iana", extensions: ["heic"] }, "image/heic-sequence": { source: "iana", extensions: ["heics"] }, "image/heif": { source: "iana", extensions: ["heif"] }, "image/heif-sequence": { source: "iana", extensions: ["heifs"] }, "image/hej2k": { source: "iana", extensions: ["hej2"] }, "image/hsj2": { source: "iana", extensions: ["hsj2"] }, "image/ief": { source: "iana", extensions: ["ief"] }, "image/jls": { source: "iana", extensions: ["jls"] }, "image/jp2": { source: "iana", compressible: !1, extensions: ["jp2", "jpg2"] }, "image/jpeg": { source: "iana", compressible: !1, extensions: ["jpeg", "jpg", "jpe"] }, "image/jph": { source: "iana", extensions: ["jph"] }, "image/jphc": { source: "iana", extensions: ["jhc"] }, "image/jpm": { source: "iana", compressible: !1, extensions: ["jpm"] }, "image/jpx": { source: "iana", compressible: !1, extensions: ["jpx", "jpf"] }, "image/jxr": { source: "iana", extensions: ["jxr"] }, "image/jxra": { source: "iana", extensions: ["jxra"] }, "image/jxrs": { source: "iana", extensions: ["jxrs"] }, "image/jxs": { source: "iana", extensions: ["jxs"] }, "image/jxsc": { source: "iana", extensions: ["jxsc"] }, "image/jxsi": { source: "iana", extensions: ["jxsi"] }, "image/jxss": { source: "iana", extensions: ["jxss"] }, "image/ktx": { source: "iana", extensions: ["ktx"] }, "image/ktx2": { source: "iana", extensions: ["ktx2"] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: !1 }, "image/png": { source: "iana", compressible: !1, extensions: ["png"] }, "image/prs.btif": { source: "iana", extensions: ["btif"] }, "image/prs.pti": { source: "iana", extensions: ["pti"] }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: ["sgi"] }, "image/svg+xml": { source: "iana", compressible: !0, extensions: ["svg", "svgz"] }, "image/t38": { source: "iana", extensions: ["t38"] }, "image/tiff": { source: "iana", compressible: !1, extensions: ["tif", "tiff"] }, "image/tiff-fx": { source: "iana", extensions: ["tfx"] }, "image/vnd.adobe.photoshop": { source: "iana", compressible: !0, extensions: ["psd"] }, "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] }, "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "image/vnd.dwg": { source: "iana", extensions: ["dwg"] }, "image/vnd.dxf": { source: "iana", extensions: ["dxf"] }, "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] }, "image/vnd.fpx": { source: "iana", extensions: ["fpx"] }, "image/vnd.fst": { source: "iana", extensions: ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana", compressible: !0, extensions: ["ico"] }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-dds": { compressible: !0, extensions: ["dds"] }, "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] }, "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] }, "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] }, "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] }, "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] }, "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] }, "image/vnd.xiff": { source: "iana", extensions: ["xif"] }, "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] }, "image/webp": { source: "apache", extensions: ["webp"] }, "image/wmf": { source: "iana", extensions: ["wmf"] }, "image/x-3ds": { source: "apache", extensions: ["3ds"] }, "image/x-cmu-raster": { source: "apache", extensions: ["ras"] }, "image/x-cmx": { source: "apache", extensions: ["cmx"] }, "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] }, "image/x-icon": { source: "apache", compressible: !0, extensions: ["ico"] }, "image/x-jng": { source: "nginx", extensions: ["jng"] }, "image/x-mrsid-image": { source: "apache", extensions: ["sid"] }, "image/x-ms-bmp": { source: "nginx", compressible: !0, extensions: ["bmp"] }, "image/x-pcx": { source: "apache", extensions: ["pcx"] }, "image/x-pict": { source: "apache", extensions: ["pic", "pct"] }, "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] }, "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] }, "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] }, "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] }, "image/x-rgb": { source: "apache", extensions: ["rgb"] }, "image/x-tga": { source: "apache", extensions: ["tga"] }, "image/x-xbitmap": { source: "apache", extensions: ["xbm"] }, "image/x-xcf": { compressible: !1 }, "image/x-xpixmap": { source: "apache", extensions: ["xpm"] }, "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana", extensions: ["disposition-notification"] }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana", extensions: ["u8msg"] }, "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] }, "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] }, "message/global-headers": { source: "iana", extensions: ["u8hdr"] }, "message/http": { source: "iana", compressible: !1 }, "message/imdn+xml": { source: "iana", compressible: !0 }, "message/news": { source: "iana" }, "message/partial": { source: "iana", compressible: !1 }, "message/rfc822": { source: "iana", compressible: !0, extensions: ["eml", "mime"] }, "message/s-http": { source: "iana" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "iana" }, "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] }, "model/3mf": { source: "iana", extensions: ["3mf"] }, "model/e57": { source: "iana" }, "model/gltf+json": { source: "iana", compressible: !0, extensions: ["gltf"] }, "model/gltf-binary": { source: "iana", compressible: !0, extensions: ["glb"] }, "model/iges": { source: "iana", compressible: !1, extensions: ["igs", "iges"] }, "model/mesh": { source: "iana", compressible: !1, extensions: ["msh", "mesh", "silo"] }, "model/mtl": { source: "iana", extensions: ["mtl"] }, "model/obj": { source: "iana", extensions: ["obj"] }, "model/step": { source: "iana" }, "model/step+xml": { source: "iana", compressible: !0, extensions: ["stpx"] }, "model/step+zip": { source: "iana", compressible: !1, extensions: ["stpz"] }, "model/step-xml+zip": { source: "iana", compressible: !1, extensions: ["stpxz"] }, "model/stl": { source: "iana", extensions: ["stl"] }, "model/vnd.collada+xml": { source: "iana", compressible: !0, extensions: ["dae"] }, "model/vnd.dwf": { source: "iana", extensions: ["dwf"] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: ["gdl"] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: ["gtw"] }, "model/vnd.moml+xml": { source: "iana", compressible: !0 }, "model/vnd.mts": { source: "iana", extensions: ["mts"] }, "model/vnd.opengex": { source: "iana", extensions: ["ogex"] }, "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] }, "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] }, "model/vnd.pytha.pyox": { source: "iana" }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] }, "model/vnd.usdz+zip": { source: "iana", compressible: !1, extensions: ["usdz"] }, "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] }, "model/vnd.vtu": { source: "iana", extensions: ["vtu"] }, "model/vrml": { source: "iana", compressible: !1, extensions: ["wrl", "vrml"] }, "model/x3d+binary": { source: "apache", compressible: !1, extensions: ["x3db", "x3dbz"] }, "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] }, "model/x3d+vrml": { source: "apache", compressible: !1, extensions: ["x3dv", "x3dvz"] }, "model/x3d+xml": { source: "iana", compressible: !0, extensions: ["x3d", "x3dz"] }, "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] }, "multipart/alternative": { source: "iana", compressible: !1 }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: !1 }, "multipart/form-data": { source: "iana", compressible: !1 }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana" }, "multipart/multilingual": { source: "iana" }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: !1 }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: !1 }, "multipart/vnd.bint.med-plus": { source: "iana" }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: !0, extensions: ["appcache", "manifest"] }, "text/calendar": { source: "iana", extensions: ["ics", "ifb"] }, "text/calender": { compressible: !0 }, "text/cmd": { compressible: !0 }, "text/coffeescript": { extensions: ["coffee", "litcoffee"] }, "text/cql": { source: "iana" }, "text/cql-expression": { source: "iana" }, "text/cql-identifier": { source: "iana" }, "text/css": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["css"] }, "text/csv": { source: "iana", compressible: !0, extensions: ["csv"] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "iana" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fhirpath": { source: "iana" }, "text/flexfec": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/gff3": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/html": { source: "iana", compressible: !0, extensions: ["html", "htm", "shtml"] }, "text/jade": { extensions: ["jade"] }, "text/javascript": { source: "iana", compressible: !0 }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: !0, extensions: ["jsx"] }, "text/less": { compressible: !0, extensions: ["less"] }, "text/markdown": { source: "iana", compressible: !0, extensions: ["markdown", "md"] }, "text/mathml": { source: "nginx", extensions: ["mml"] }, "text/mdx": { compressible: !0, extensions: ["mdx"] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["n3"] }, "text/parameters": { source: "iana", charset: "UTF-8" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: !0, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] }, "text/provenance-notation": { source: "iana", charset: "UTF-8" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] }, "text/prs.prop.logic": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: !0, extensions: ["rtx"] }, "text/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] }, "text/shaclc": { source: "iana" }, "text/shex": { source: "iana", extensions: ["shex"] }, "text/slim": { extensions: ["slim", "slm"] }, "text/spdx": { source: "iana", extensions: ["spdx"] }, "text/strings": { source: "iana" }, "text/stylus": { extensions: ["stylus", "styl"] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: !0, extensions: ["tsv"] }, "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] }, "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: !0, extensions: ["uri", "uris", "urls"] }, "text/vcard": { source: "iana", compressible: !0, extensions: ["vcard"] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: ["curl"] }, "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] }, "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] }, "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] }, "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" }, "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] }, "text/vnd.ficlab.flt": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: ["fly"] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] }, "text/vnd.gml": { source: "iana" }, "text/vnd.graphviz": { source: "iana", extensions: ["gv"] }, "text/vnd.hans": { source: "iana" }, "text/vnd.hgl": { source: "iana" }, "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] }, "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.senx.warpscript": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "iana" }, "text/vnd.sosi": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] }, "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] }, "text/vtt": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["vtt"] }, "text/x-asm": { source: "apache", extensions: ["s", "asm"] }, "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] }, "text/x-component": { source: "nginx", extensions: ["htc"] }, "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] }, "text/x-gwt-rpc": { compressible: !0 }, "text/x-handlebars-template": { extensions: ["hbs"] }, "text/x-java-source": { source: "apache", extensions: ["java"] }, "text/x-jquery-tmpl": { compressible: !0 }, "text/x-lua": { extensions: ["lua"] }, "text/x-markdown": { compressible: !0, extensions: ["mkd"] }, "text/x-nfo": { source: "apache", extensions: ["nfo"] }, "text/x-opml": { source: "apache", extensions: ["opml"] }, "text/x-org": { compressible: !0, extensions: ["org"] }, "text/x-pascal": { source: "apache", extensions: ["p", "pas"] }, "text/x-processing": { compressible: !0, extensions: ["pde"] }, "text/x-sass": { extensions: ["sass"] }, "text/x-scss": { extensions: ["scss"] }, "text/x-setext": { source: "apache", extensions: ["etx"] }, "text/x-sfv": { source: "apache", extensions: ["sfv"] }, "text/x-suse-ymp": { compressible: !0, extensions: ["ymp"] }, "text/x-uuencode": { source: "apache", extensions: ["uu"] }, "text/x-vcalendar": { source: "apache", extensions: ["vcs"] }, "text/x-vcard": { source: "apache", extensions: ["vcf"] }, "text/xml": { source: "iana", compressible: !0, extensions: ["xml"] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { compressible: !0, extensions: ["yaml", "yml"] }, "video/1d-interleaved-parityfec": { source: "iana" }, "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] }, "video/3gpp-tt": { source: "iana" }, "video/3gpp2": { source: "iana", extensions: ["3g2"] }, "video/av1": { source: "iana" }, "video/bmpeg": { source: "iana" }, "video/bt656": { source: "iana" }, "video/celb": { source: "iana" }, "video/dv": { source: "iana" }, "video/encaprtp": { source: "iana" }, "video/ffv1": { source: "iana" }, "video/flexfec": { source: "iana" }, "video/h261": { source: "iana", extensions: ["h261"] }, "video/h263": { source: "iana", extensions: ["h263"] }, "video/h263-1998": { source: "iana" }, "video/h263-2000": { source: "iana" }, "video/h264": { source: "iana", extensions: ["h264"] }, "video/h264-rcdo": { source: "iana" }, "video/h264-svc": { source: "iana" }, "video/h265": { source: "iana" }, "video/iso.segment": { source: "iana", extensions: ["m4s"] }, "video/jpeg": { source: "iana", extensions: ["jpgv"] }, "video/jpeg2000": { source: "iana" }, "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] }, "video/jxsv": { source: "iana" }, "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] }, "video/mp1s": { source: "iana" }, "video/mp2p": { source: "iana" }, "video/mp2t": { source: "iana", extensions: ["ts"] }, "video/mp4": { source: "iana", compressible: !1, extensions: ["mp4", "mp4v", "mpg4"] }, "video/mp4v-es": { source: "iana" }, "video/mpeg": { source: "iana", compressible: !1, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] }, "video/mpeg4-generic": { source: "iana" }, "video/mpv": { source: "iana" }, "video/nv": { source: "iana" }, "video/ogg": { source: "iana", compressible: !1, extensions: ["ogv"] }, "video/parityfec": { source: "iana" }, "video/pointer": { source: "iana" }, "video/quicktime": { source: "iana", compressible: !1, extensions: ["qt", "mov"] }, "video/raptorfec": { source: "iana" }, "video/raw": { source: "iana" }, "video/rtp-enc-aescm128": { source: "iana" }, "video/rtploopback": { source: "iana" }, "video/rtx": { source: "iana" }, "video/scip": { source: "iana" }, "video/smpte291": { source: "iana" }, "video/smpte292m": { source: "iana" }, "video/ulpfec": { source: "iana" }, "video/vc1": { source: "iana" }, "video/vc2": { source: "iana" }, "video/vnd.cctv": { source: "iana" }, "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] }, "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] }, "video/vnd.dece.mp4": { source: "iana" }, "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] }, "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] }, "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] }, "video/vnd.directv.mpeg": { source: "iana" }, "video/vnd.directv.mpeg-tts": { source: "iana" }, "video/vnd.dlna.mpeg-tts": { source: "iana" }, "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] }, "video/vnd.fvt": { source: "iana", extensions: ["fvt"] }, "video/vnd.hns.video": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.ttsavc": { source: "iana" }, "video/vnd.iptvforum.ttsmpeg2": { source: "iana" }, "video/vnd.motorola.video": { source: "iana" }, "video/vnd.motorola.videop": { source: "iana" }, "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] }, "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { source: "iana" }, "video/vnd.nokia.mp4vr": { source: "iana" }, "video/vnd.nokia.videovoip": { source: "iana" }, "video/vnd.objectvideo": { source: "iana" }, "video/vnd.radgamettools.bink": { source: "iana" }, "video/vnd.radgamettools.smacker": { source: "iana" }, "video/vnd.sealed.mpeg1": { source: "iana" }, "video/vnd.sealed.mpeg4": { source: "iana" }, "video/vnd.sealed.swf": { source: "iana" }, "video/vnd.sealedmedia.softseal.mov": { source: "iana" }, "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] }, "video/vnd.vivo": { source: "iana", extensions: ["viv"] }, "video/vnd.youtube.yt": { source: "iana" }, "video/vp8": { source: "iana" }, "video/vp9": { source: "iana" }, "video/webm": { source: "apache", compressible: !1, extensions: ["webm"] }, "video/x-f4v": { source: "apache", extensions: ["f4v"] }, "video/x-fli": { source: "apache", extensions: ["fli"] }, "video/x-flv": { source: "apache", compressible: !1, extensions: ["flv"] }, "video/x-m4v": { source: "apache", extensions: ["m4v"] }, "video/x-matroska": { source: "apache", compressible: !1, extensions: ["mkv", "mk3d", "mks"] }, "video/x-mng": { source: "apache", extensions: ["mng"] }, "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] }, "video/x-ms-vob": { source: "apache", extensions: ["vob"] }, "video/x-ms-wm": { source: "apache", extensions: ["wm"] }, "video/x-ms-wmv": { source: "apache", compressible: !1, extensions: ["wmv"] }, "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] }, "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] }, "video/x-msvideo": { source: "apache", extensions: ["avi"] }, "video/x-sgi-movie": { source: "apache", extensions: ["movie"] }, "video/x-smv": { source: "apache", extensions: ["smv"] }, "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] }, "x-shader/x-fragment": { compressible: !0 }, "x-shader/x-vertex": { compressible: !0 } }; /*! * mime-db * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed */ var Jx, V8; function Dle() { return V8 || (V8 = 1, Jx = Ple), Jx; } /*! * mime-types * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ var Y8; function Ole() { return Y8 || (Y8 = 1, (function(t) { var e = Dle(), n = ve.extname, r = /^\s*([^;\s]*)(?:;|\s|$)/, i = /^text\//i; t.charset = o, t.charsets = { lookup: o }, t.contentType = a, t.extension = s, t.extensions = /* @__PURE__ */ Object.create(null), t.lookup = c, t.types = /* @__PURE__ */ Object.create(null), u(t.extensions, t.types); function o(d) { if (!d || typeof d != "string") return !1; var p = r.exec(d), f = p && e[p[1].toLowerCase()]; return f && f.charset ? f.charset : p && i.test(p[1]) ? "UTF-8" : !1; } function a(d) { if (!d || typeof d != "string") return !1; var p = d.indexOf("/") === -1 ? t.lookup(d) : d; if (!p) return !1; if (p.indexOf("charset") === -1) { var f = t.charset(p); f && (p += "; charset=" + f.toLowerCase()); } return p; } function s(d) { if (!d || typeof d != "string") return !1; var p = r.exec(d), f = p && t.extensions[p[1].toLowerCase()]; return !f || !f.length ? !1 : f[0]; } function c(d) { if (!d || typeof d != "string") return !1; var p = n("x." + d).toLowerCase().substr(1); return p && t.types[p] || !1; } function u(d, p) { var f = ["nginx", "apache", void 0, "iana"]; Object.keys(e).forEach(function(h) { var y = e[h], x = y.extensions; if (!(!x || !x.length)) { d[h] = x; for (var g = 0; g < x.length; g++) { var b = x[g]; if (p[b]) { var S = f.indexOf(e[p[b]].source), E = f.indexOf(y.source); if (p[b] !== "application/octet-stream" && (S > E || S === E && p[b].substr(0, 12) === "application/")) continue; } p[b] = h; } } }); } })(Yx)), Yx; } /*! * type-is * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ var J8; function dB() { if (J8) return ec.exports; J8 = 1; var t = Nle(), e = Ole(); ec.exports = i, ec.exports.is = n, ec.exports.hasBody = r, ec.exports.normalize = o, ec.exports.match = a; function n(u, d) { var p, f = d, m = c(u); if (!m) return !1; if (f && !Array.isArray(f)) for (f = new Array(arguments.length - 1), p = 0; p < f.length; p++) f[p] = arguments[p + 1]; if (!f || !f.length) return m; var h; for (p = 0; p < f.length; p++) if (a(o(h = f[p]), m)) return h[0] === "+" || h.indexOf("*") !== -1 ? m : h; return !1; } function r(u) { return u.headers["transfer-encoding"] !== void 0 || !isNaN(u.headers["content-length"]); } function i(u, d) { var p = d; if (!r(u)) return null; if (arguments.length > 2) { p = new Array(arguments.length - 1); for (var f = 0; f < p.length; f++) p[f] = arguments[f + 1]; } var m = u.headers["content-type"]; return n(m, p); } function o(u) { if (typeof u != "string") return !1; switch (u) { case "urlencoded": return "application/x-www-form-urlencoded"; case "multipart": return "multipart/*"; } return u[0] === "+" ? "*/*" + u : u.indexOf("/") === -1 ? e.lookup(u) : u; } function a(u, d) { if (u === !1) return !1; var p = d.split("/"), f = u.split("/"); return p.length !== 2 || f.length !== 2 || f[0] !== "*" && f[0] !== p[0] ? !1 : f[1].substr(0, 2) === "*+" ? f[1].length <= p[1].length + 1 && f[1].substr(1) === p[1].substr(1 - f[1].length) : !(f[1] !== "*" && f[1] !== p[1]); } function s(u) { var d = t.parse(u); return d.parameters = void 0, t.format(d); } function c(u) { if (!u) return null; try { return s(u); } catch { return null; } } return ec.exports; } var Xx, X8; function mA() { if (X8) return Xx; X8 = 1; function t(m) { if (m.length === 0) return; const h = /* @__PURE__ */ Object.create(null); let y = 0; for (; y < m.length; ++y) { const S = m.charCodeAt(y); if (c[S] !== 1) { if (S !== 47 || y === 0) return; break; } } if (y === m.length) return; const x = m.slice(0, y).toLowerCase(), g = ++y; for (; y < m.length; ++y) { const S = m.charCodeAt(y); if (c[S] !== 1) { if (y === g || e(m, y, h) === void 0) return; break; } } if (y === g) return; const b = m.slice(g, y).toLowerCase(); return { type: x, subtype: b, params: h }; } function e(m, h, y) { for (; h < m.length; ) { for (; h < m.length; ++h) { const E = m.charCodeAt(h); if (E !== 32 && E !== 9) break; } if (h === m.length) break; if (m.charCodeAt(h++) !== 59) return; for (; h < m.length; ++h) { const E = m.charCodeAt(h); if (E !== 32 && E !== 9) break; } if (h === m.length) return; let x; const g = h; for (; h < m.length; ++h) { const E = m.charCodeAt(h); if (c[E] !== 1) { if (E !== 61) return; break; } } if (h === m.length || (x = m.slice(g, h), ++h, h === m.length)) return; let b = "", S; if (m.charCodeAt(h) === 34) { S = ++h; let E = !1; for (; h < m.length; ++h) { const T = m.charCodeAt(h); if (T === 92) { E ? (S = h, E = !1) : (b += m.slice(S, h), E = !0); continue; } if (T === 34) { if (E) { S = h, E = !1; continue; } b += m.slice(S, h); break; } if (E && (S = h - 1, E = !1), u[T] !== 1) return; } if (h === m.length) return; ++h; } else { for (S = h; h < m.length; ++h) { const E = m.charCodeAt(h); if (c[E] !== 1) { if (h === S) return; break; } } b = m.slice(S, h); } x = x.toLowerCase(), y[x] === void 0 && (y[x] = b); } return y; } function n(m, h) { if (m.length === 0) return; const y = /* @__PURE__ */ Object.create(null); let x = 0; for (; x < m.length; ++x) { const b = m.charCodeAt(x); if (c[b] !== 1) { if (r(m, x, y, h) === void 0) return; break; } } return { type: m.slice(0, x).toLowerCase(), params: y }; } function r(m, h, y, x) { for (; h < m.length; ) { for (; h < m.length; ++h) { const U = m.charCodeAt(h); if (U !== 32 && U !== 9) break; } if (h === m.length) break; if (m.charCodeAt(h++) !== 59) return; for (; h < m.length; ++h) { const U = m.charCodeAt(h); if (U !== 32 && U !== 9) break; } if (h === m.length) return; let g; const b = h; for (; h < m.length; ++h) { const U = m.charCodeAt(h); if (c[U] !== 1) { if (U === 61) break; return; } } if (h === m.length) return; let S = "", E, T; if (g = m.slice(b, h), g.charCodeAt(g.length - 1) === 42) { const U = ++h; for (; h < m.length; ++h) { const Y = m.charCodeAt(h); if (d[Y] !== 1) { if (Y !== 39) return; break; } } if (h === m.length) return; for (T = m.slice(U, h), ++h; h < m.length && m.charCodeAt(h) !== 39; ++h) ; if (h === m.length || (++h, h === m.length)) return; E = h; let q = 0; for (; h < m.length; ++h) { const Y = m.charCodeAt(h); if (p[Y] !== 1) { if (Y === 37) { let H, G; if (h + 2 < m.length && (H = f[m.charCodeAt(h + 1)]) !== -1 && (G = f[m.charCodeAt(h + 2)]) !== -1) { const J = (H << 4) + G; S += m.slice(E, h), S += String.fromCharCode(J), h += 2, E = h + 1, J >= 128 ? q = 2 : q === 0 && (q = 1); continue; } return; } break; } } if (S += m.slice(E, h), S = a(S, T, q), S === void 0) return; } else { if (++h, h === m.length) return; if (m.charCodeAt(h) === 34) { E = ++h; let U = !1; for (; h < m.length; ++h) { const q = m.charCodeAt(h); if (q === 92) { U ? (E = h, U = !1) : (S += m.slice(E, h), U = !0); continue; } if (q === 34) { if (U) { E = h, U = !1; continue; } S += m.slice(E, h); break; } if (U && (E = h - 1, U = !1), u[q] !== 1) return; } if (h === m.length) return; ++h; } else { for (E = h; h < m.length; ++h) { const U = m.charCodeAt(h); if (c[U] !== 1) { if (h === E) return; break; } } S = m.slice(E, h); } if (S = x(S, 2), S === void 0) return; } g = g.toLowerCase(), y[g] === void 0 && (y[g] = S); } return y; } function i(m) { let h; for (; ; ) switch (m) { case "utf-8": case "utf8": return o.utf8; case "latin1": case "ascii": // TODO: Make these a separate, strict decoder? case "us-ascii": case "iso-8859-1": case "iso8859-1": case "iso88591": case "iso_8859-1": case "windows-1252": case "iso_8859-1:1987": case "cp1252": case "x-cp1252": return o.latin1; case "utf16le": case "utf-16le": case "ucs2": case "ucs-2": return o.utf16le; case "base64": return o.base64; default: if (h === void 0) { h = !0, m = m.toLowerCase(); continue; } return o.other.bind(m); } } const o = { utf8: (m, h) => { if (m.length === 0) return ""; if (typeof m == "string") { if (h < 2) return m; m = Buffer.from(m, "latin1"); } return m.utf8Slice(0, m.length); }, latin1: (m, h) => m.length === 0 ? "" : typeof m == "string" ? m : m.latin1Slice(0, m.length), utf16le: (m, h) => m.length === 0 ? "" : (typeof m == "string" && (m = Buffer.from(m, "latin1")), m.ucs2Slice(0, m.length)), base64: (m, h) => m.length === 0 ? "" : (typeof m == "string" && (m = Buffer.from(m, "latin1")), m.base64Slice(0, m.length)), other: (m, h) => { if (m.length === 0) return ""; typeof m == "string" && (m = Buffer.from(m, "latin1")); try { return new TextDecoder(this).decode(m); } catch { } } }; function a(m, h, y) { const x = i(h); if (x) return x(m, y); } function s(m) { if (typeof m != "string") return ""; for (let h = m.length - 1; h >= 0; --h) switch (m.charCodeAt(h)) { case 47: // '/' case 92: return m = m.slice(h + 1), m === ".." || m === "." ? "" : m; } return m === ".." || m === "." ? "" : m; } const c = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], u = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], d = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], p = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], f = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ]; return Xx = { basename: s, convertToUTF8: a, getDecoder: i, parseContentType: t, parseDisposition: n }, Xx; } var Zx, Z8; function Fle() { if (Z8) return Zx; Z8 = 1; function t(i, o, a, s, c) { for (let u = 0; u < c; ++u) if (i[o + u] !== a[s + u]) return !1; return !0; } class e { constructor(o, a) { if (typeof a != "function") throw new Error("Missing match callback"); if (typeof o == "string") o = Buffer.from(o); else if (!Buffer.isBuffer(o)) throw new Error(`Expected Buffer for needle, got ${typeof o}`); const s = o.length; if (this.maxMatches = 1 / 0, this.matches = 0, this._cb = a, this._lookbehindSize = 0, this._needle = o, this._bufPos = 0, this._lookbehind = Buffer.allocUnsafe(s), this._occ = [ s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s ], s > 1) for (let c = 0; c < s - 1; ++c) this._occ[o[c]] = s - 1 - c; } reset() { this.matches = 0, this._lookbehindSize = 0, this._bufPos = 0; } push(o, a) { let s; Buffer.isBuffer(o) || (o = Buffer.from(o, "latin1")); const c = o.length; for (this._bufPos = a || 0; s !== c && this.matches < this.maxMatches; ) s = n(this, o); return s; } destroy() { const o = this._lookbehindSize; o && this._cb(!1, this._lookbehind, 0, o, !1), this.reset(); } } function n(i, o) { const a = o.length, s = i._needle, c = s.length; let u = -i._lookbehindSize; const d = c - 1, p = s[d], f = a - c, m = i._occ, h = i._lookbehind; if (u < 0) { for (; u < 0 && u <= f; ) { const x = u + d, g = x < 0 ? h[i._lookbehindSize + x] : o[x]; if (g === p && r(i, o, u, d)) return i._lookbehindSize = 0, ++i.matches, u > -i._lookbehindSize ? i._cb(!0, h, 0, i._lookbehindSize + u, !1) : i._cb(!0, void 0, 0, 0, !0), i._bufPos = u + c; u += m[g]; } for (; u < 0 && !r(i, o, u, a - u); ) ++u; if (u < 0) { const x = i._lookbehindSize + u; return x > 0 && i._cb(!1, h, 0, x, !1), i._lookbehindSize -= x, h.copy(h, 0, x, i._lookbehindSize), h.set(o, i._lookbehindSize), i._lookbehindSize += a, i._bufPos = a, a; } i._cb(!1, h, 0, i._lookbehindSize, !1), i._lookbehindSize = 0; } u += i._bufPos; const y = s[0]; for (; u <= f; ) { const x = o[u + d]; if (x === p && o[u] === y && t(s, 0, o, u, d)) return ++i.matches, u > 0 ? i._cb(!0, o, i._bufPos, u, !0) : i._cb(!0, void 0, 0, 0, !0), i._bufPos = u + c; u += m[x]; } for (; u < a; ) { if (o[u] !== y || !t(o, u, s, 0, a - u)) { ++u; continue; } o.copy(h, 0, u, a), i._lookbehindSize = a - u; break; } return u > 0 && i._cb(!1, o, i._bufPos, u < a ? u : a, !0), i._bufPos = a, a; } function r(i, o, a, s) { const c = i._lookbehind, u = i._lookbehindSize, d = i._needle; for (let p = 0; p < s; ++p, ++a) if ((a < 0 ? c[u + a] : o[a]) !== d[p]) return !1; return !0; } return Zx = e, Zx; } var ew, eN; function Mle() { if (eN) return ew; eN = 1; const { Readable: t, Writable: e } = mr, n = Fle(), { basename: r, convertToUTF8: i, getDecoder: o, parseContentType: a, parseDisposition: s } = mA(), c = Buffer.from(`\r `), u = Buffer.from("\r"), d = Buffer.from("-"); function p() { } const f = 2e3, m = 16 * 1024, h = 0, y = 1, x = 2; class g { constructor(B) { this.header = /* @__PURE__ */ Object.create(null), this.pairCount = 0, this.byteCount = 0, this.state = h, this.name = "", this.value = "", this.crlf = 0, this.cb = B; } reset() { this.header = /* @__PURE__ */ Object.create(null), this.pairCount = 0, this.byteCount = 0, this.state = h, this.name = "", this.value = "", this.crlf = 0; } push(B, D, X) { let V = D; for (; D < X; ) switch (this.state) { case h: { let K = !1; for (; D < X; ++D) { if (this.byteCount === m) return -1; ++this.byteCount; const $ = B[D]; if (H[$] !== 1) { if ($ !== 58 || (this.name += B.latin1Slice(V, D), this.name.length === 0)) return -1; ++D, K = !0, this.state = y; break; } } if (!K) { this.name += B.latin1Slice(V, D); break; } } case y: { let K = !1; for (; D < X; ++D) { if (this.byteCount === m) return -1; ++this.byteCount; const $ = B[D]; if ($ !== 32 && $ !== 9) { V = D, K = !0, this.state = x; break; } } if (!K) break; } case x: switch (this.crlf) { case 0: for (; D < X; ++D) { if (this.byteCount === m) return -1; ++this.byteCount; const K = B[D]; if (G[K] !== 1) { if (K !== 13) return -1; ++this.crlf; break; } } this.value += B.latin1Slice(V, D++); break; case 1: if (this.byteCount === m || (++this.byteCount, B[D++] !== 10)) return -1; ++this.crlf; break; case 2: { if (this.byteCount === m) return -1; ++this.byteCount; const K = B[D]; K === 32 || K === 9 ? (V = D, this.crlf = 0) : (++this.pairCount < f && (this.name = this.name.toLowerCase(), this.header[this.name] === void 0 ? this.header[this.name] = [this.value] : this.header[this.name].push(this.value)), K === 13 ? (++this.crlf, ++D) : (V = D, this.crlf = 0, this.state = h, this.name = "", this.value = "")); break; } case 3: { if (this.byteCount === m || (++this.byteCount, B[D++] !== 10)) return -1; const K = this.header; return this.reset(), this.cb(K), D; } } break; } return D; } } class b extends t { constructor(B, D) { super(B), this.truncated = !1, this._readcb = null, this.once("end", () => { if (this._read(), --D._fileEndsLeft === 0 && D._finalcb) { const X = D._finalcb; D._finalcb = null, process.nextTick(X); } }); } _read(B) { const D = this._readcb; D && (this._readcb = null, D()); } } const S = { push: (J, B) => { }, destroy: () => { } }; function E(J, B) { const D = J._writecb; J._writecb = null, D && D(); } function T(J, B) { return J; } class U extends e { constructor(B) { const D = { autoDestroy: !0, emitClose: !0, highWaterMark: typeof B.highWaterMark == "number" ? B.highWaterMark : void 0 }; if (super(D), !B.conType.params || typeof B.conType.params.boundary != "string") throw new Error("Multipart: Boundary not found"); const X = B.conType.params.boundary, V = typeof B.defParamCharset == "string" && B.defParamCharset ? o(B.defParamCharset) : T, K = B.defCharset || "utf8", $ = B.preservePath, _ = { autoDestroy: !0, emitClose: !0, highWaterMark: typeof B.fileHwm == "number" ? B.fileHwm : void 0 }, I = B.limits, N = I && typeof I.fieldSize == "number" ? I.fieldSize : 1 * 1024 * 1024, L = I && typeof I.fileSize == "number" ? I.fileSize : 1 / 0, C = I && typeof I.files == "number" ? I.files : 1 / 0, Q = I && typeof I.fields == "number" ? I.fields : 1 / 0, k = I && typeof I.parts == "number" ? I.parts : 1 / 0; let M = -1, O = 0, A = 0, F = !1; this._fileEndsLeft = 0, this._fileStream = void 0, this._complete = !1; let Z = 0, ee, P = 0, j, W, se, ce, oe = !1, we = !1, Me = !1; this._hparser = null; const He = new g((Ye) => { this._hparser = null, F = !1, se = "text/plain", j = K, W = "7bit", ce = void 0, oe = !1; let it; if (!Ye["content-disposition"]) { F = !0; return; } const ze = s( Ye["content-disposition"][0], V ); if (!ze || ze.type !== "form-data") { F = !0; return; } if (ze.params && (ze.params.name && (ce = ze.params.name), ze.params["filename*"] ? it = ze.params["filename*"] : ze.params.filename && (it = ze.params.filename), it !== void 0 && !$ && (it = r(it))), Ye["content-type"]) { const Ft = a(Ye["content-type"][0]); Ft && (se = `${Ft.type}/${Ft.subtype}`, Ft.params && typeof Ft.params.charset == "string" && (j = Ft.params.charset.toLowerCase())); } if (Ye["content-transfer-encoding"] && (W = Ye["content-transfer-encoding"][0].toLowerCase()), se === "application/octet-stream" || it !== void 0) { if (A === C) { we || (we = !0, this.emit("filesLimit")), F = !0; return; } if (++A, this.listenerCount("file") === 0) { F = !0; return; } Z = 0, this._fileStream = new b(_, this), ++this._fileEndsLeft, this.emit( "file", ce, this._fileStream, { filename: it, encoding: W, mimeType: se } ); } else { if (O === Q) { Me || (Me = !0, this.emit("fieldsLimit")), F = !0; return; } if (++O, this.listenerCount("field") === 0) { F = !0; return; } ee = [], P = 0; } }); let We = 0; const Xe = (Ye, it, ze, Ft, Or) => { e: for (; it; ) { if (this._hparser !== null) { const ut = this._hparser.push(it, ze, Ft); if (ut === -1) { this._hparser = null, He.reset(), this.emit("error", new Error("Malformed part header")); break; } ze = ut; } if (ze === Ft) break; if (We !== 0) { if (We === 1) { switch (it[ze]) { case 45: We = 2, ++ze; break; case 13: We = 3, ++ze; break; default: We = 0; } if (ze === Ft) return; } if (We === 2) { if (We = 0, it[ze] === 45) { this._complete = !0, this._bparser = S; return; } const ut = this._writecb; this._writecb = p, Xe(!1, d, 0, 1, !1), this._writecb = ut; } else if (We === 3) if (We = 0, it[ze] === 10) { if (++ze, M >= k || (this._hparser = He, ze === Ft)) break; continue e; } else { const ut = this._writecb; this._writecb = p, Xe(!1, u, 0, 1, !1), this._writecb = ut; } } if (!F) { if (this._fileStream) { let ut; const lr = Math.min(Ft - ze, L - Z); Or ? ut = it.slice(ze, ze + lr) : (ut = Buffer.allocUnsafe(lr), it.copy(ut, 0, ze, ze + lr)), Z += ut.length, Z === L ? (ut.length > 0 && this._fileStream.push(ut), this._fileStream.emit("limit"), this._fileStream.truncated = !0, F = !0) : this._fileStream.push(ut) || (this._writecb && (this._fileStream._readcb = this._writecb), this._writecb = null); } else if (ee !== void 0) { let ut; const lr = Math.min( Ft - ze, N - P ); Or ? ut = it.slice(ze, ze + lr) : (ut = Buffer.allocUnsafe(lr), it.copy(ut, 0, ze, ze + lr)), P += lr, ee.push(ut), P === N && (F = !0, oe = !0); } } break; } if (Ye) { if (We = 1, this._fileStream) this._fileStream.push(null), this._fileStream = null; else if (ee !== void 0) { let ut; switch (ee.length) { case 0: ut = ""; break; case 1: ut = i(ee[0], j, 0); break; default: ut = i( Buffer.concat(ee, P), j, 0 ); } ee = void 0, P = 0, this.emit( "field", ce, ut, { nameTruncated: !1, valueTruncated: oe, encoding: W, mimeType: se } ); } ++M === k && this.emit("partsLimit"); } }; this._bparser = new n(`\r --${X}`, Xe), this._writecb = null, this._finalcb = null, this.write(c); } static detect(B) { return B.type === "multipart" && B.subtype === "form-data"; } _write(B, D, X) { this._writecb = X, this._bparser.push(B, 0), this._writecb && E(this); } _destroy(B, D) { this._hparser = null, this._bparser = S, B || (B = Y(this)); const X = this._fileStream; X && (this._fileStream = null, X.destroy(B)), D(B); } _final(B) { if (this._bparser.destroy(), !this._complete) return B(new Error("Unexpected end of form")); this._fileEndsLeft ? this._finalcb = q.bind(null, this, B) : q(this, B); } } function q(J, B, D) { if (D) return B(D); D = Y(J), B(D); } function Y(J) { if (J._hparser) return new Error("Malformed part header"); const B = J._fileStream; if (B && (J._fileStream = null, B.destroy(new Error("Unexpected end of file"))), !J._complete) return new Error("Unexpected end of form"); } const H = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], G = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ]; return ew = U, ew; } var tw, tN; function Rle() { if (tN) return tw; tN = 1; const { Writable: t } = mr, { getDecoder: e } = mA(); class n extends t { constructor(c) { const u = { autoDestroy: !0, emitClose: !0, highWaterMark: typeof c.highWaterMark == "number" ? c.highWaterMark : void 0 }; super(u); let d = c.defCharset || "utf8"; c.conType.params && typeof c.conType.params.charset == "string" && (d = c.conType.params.charset), this.charset = d; const p = c.limits; this.fieldSizeLimit = p && typeof p.fieldSize == "number" ? p.fieldSize : 1 * 1024 * 1024, this.fieldsLimit = p && typeof p.fields == "number" ? p.fields : 1 / 0, this.fieldNameSizeLimit = p && typeof p.fieldNameSize == "number" ? p.fieldNameSize : 100, this._inKey = !0, this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, this._fields = 0, this._key = "", this._val = "", this._byte = -2, this._lastPos = 0, this._encode = 0, this._decoder = e(d); } static detect(c) { return c.type === "application" && c.subtype === "x-www-form-urlencoded"; } _write(c, u, d) { if (this._fields >= this.fieldsLimit) return d(); let p = 0; const f = c.length; if (this._lastPos = 0, this._byte !== -2) { if (p = r(this, c, p, f), p === -1) return d(new Error("Malformed urlencoded form")); if (p >= f) return d(); this._inKey ? ++this._bytesKey : ++this._bytesVal; } e: for (; p < f; ) if (this._inKey) { for (p = i(this, c, p, f); p < f; ) { switch (c[p]) { case 61: this._lastPos < p && (this._key += c.latin1Slice(this._lastPos, p)), this._lastPos = ++p, this._key = this._decoder(this._key, this._encode), this._encode = 0, this._inKey = !1; continue e; case 38: if (this._lastPos < p && (this._key += c.latin1Slice(this._lastPos, p)), this._lastPos = ++p, this._key = this._decoder(this._key, this._encode), this._encode = 0, this._bytesKey > 0 && this.emit( "field", this._key, "", { nameTruncated: this._keyTrunc, valueTruncated: !1, encoding: this.charset, mimeType: "text/plain" } ), this._key = "", this._val = "", this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, ++this._fields >= this.fieldsLimit) return this.emit("fieldsLimit"), d(); continue; case 43: this._lastPos < p && (this._key += c.latin1Slice(this._lastPos, p)), this._key += " ", this._lastPos = p + 1; break; case 37: if (this._encode === 0 && (this._encode = 1), this._lastPos < p && (this._key += c.latin1Slice(this._lastPos, p)), this._lastPos = p + 1, this._byte = -1, p = r(this, c, p + 1, f), p === -1) return d(new Error("Malformed urlencoded form")); if (p >= f) return d(); ++this._bytesKey, p = i(this, c, p, f); continue; } ++p, ++this._bytesKey, p = i(this, c, p, f); } this._lastPos < p && (this._key += c.latin1Slice(this._lastPos, p)); } else { for (p = o(this, c, p, f); p < f; ) { switch (c[p]) { case 38: if (this._lastPos < p && (this._val += c.latin1Slice(this._lastPos, p)), this._lastPos = ++p, this._inKey = !0, this._val = this._decoder(this._val, this._encode), this._encode = 0, (this._bytesKey > 0 || this._bytesVal > 0) && this.emit( "field", this._key, this._val, { nameTruncated: this._keyTrunc, valueTruncated: this._valTrunc, encoding: this.charset, mimeType: "text/plain" } ), this._key = "", this._val = "", this._keyTrunc = !1, this._valTrunc = !1, this._bytesKey = 0, this._bytesVal = 0, ++this._fields >= this.fieldsLimit) return this.emit("fieldsLimit"), d(); continue e; case 43: this._lastPos < p && (this._val += c.latin1Slice(this._lastPos, p)), this._val += " ", this._lastPos = p + 1; break; case 37: if (this._encode === 0 && (this._encode = 1), this._lastPos < p && (this._val += c.latin1Slice(this._lastPos, p)), this._lastPos = p + 1, this._byte = -1, p = r(this, c, p + 1, f), p === -1) return d(new Error("Malformed urlencoded form")); if (p >= f) return d(); ++this._bytesVal, p = o(this, c, p, f); continue; } ++p, ++this._bytesVal, p = o(this, c, p, f); } this._lastPos < p && (this._val += c.latin1Slice(this._lastPos, p)); } d(); } _final(c) { if (this._byte !== -2) return c(new Error("Malformed urlencoded form")); (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) && (this._inKey ? this._key = this._decoder(this._key, this._encode) : this._val = this._decoder(this._val, this._encode), this.emit( "field", this._key, this._val, { nameTruncated: this._keyTrunc, valueTruncated: this._valTrunc, encoding: this.charset, mimeType: "text/plain" } )), c(); } } function r(s, c, u, d) { if (u >= d) return d; if (s._byte === -1) { const p = a[c[u++]]; if (p === -1) return -1; if (p >= 8 && (s._encode = 2), u < d) { const f = a[c[u++]]; if (f === -1) return -1; s._inKey ? s._key += String.fromCharCode((p << 4) + f) : s._val += String.fromCharCode((p << 4) + f), s._byte = -2, s._lastPos = u; } else s._byte = p; } else { const p = a[c[u++]]; if (p === -1) return -1; s._inKey ? s._key += String.fromCharCode((s._byte << 4) + p) : s._val += String.fromCharCode((s._byte << 4) + p), s._byte = -2, s._lastPos = u; } return u; } function i(s, c, u, d) { if (s._bytesKey > s.fieldNameSizeLimit) { for (s._keyTrunc || s._lastPos < u && (s._key += c.latin1Slice(s._lastPos, u - 1)), s._keyTrunc = !0; u < d; ++u) { const p = c[u]; if (p === 61 || p === 38) break; ++s._bytesKey; } s._lastPos = u; } return u; } function o(s, c, u, d) { if (s._bytesVal > s.fieldSizeLimit) { for (s._valTrunc || s._lastPos < u && (s._val += c.latin1Slice(s._lastPos, u - 1)), s._valTrunc = !0; u < d && c[u] !== 38; ++u) ++s._bytesVal; s._lastPos = u; } return u; } const a = [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ]; return tw = n, tw; } var nw, nN; function Ble() { if (nN) return nw; nN = 1; const { parseContentType: t } = mA(); function e(r) { const i = r.headers, o = t(i["content-type"]); if (!o) throw new Error("Malformed content type"); for (const a of n) { if (!a.detect(o)) continue; const c = { limits: r.limits, headers: i, conType: o, highWaterMark: void 0, fileHwm: void 0, defCharset: void 0, defParamCharset: void 0, preservePath: !1 }; return r.highWaterMark && (c.highWaterMark = r.highWaterMark), r.fileHwm && (c.fileHwm = r.fileHwm), c.defCharset = r.defCharset, c.defParamCharset = r.defParamCharset, c.preservePath = r.preservePath, new a(c); } throw new Error(`Unsupported content type: ${i["content-type"]}`); } const n = [ Mle(), Rle() ].filter(function(r) { return typeof r.detect == "function"; }); return nw = (r) => { if ((typeof r != "object" || r === null) && (r = {}), typeof r.headers != "object" || r.headers === null || typeof r.headers["content-type"] != "string") throw new Error("Missing Content-Type"); return e(r); }, nw; } var rw, rN; function Ule() { if (rN) return rw; rN = 1; var t = /^[^\[]*/, e = /^\[(\d+)\]/, n = /^\[([^\]]+)\]/; function r(i) { function o() { return [{ type: "object", key: i, last: !0 }]; } var a = t.exec(i)[0]; if (!a) return o(); for (var s = i.length, c = a.length, u = { type: "object", key: a }, d = [u]; c < s; ) { var p; if (i[c] === "[" && i[c + 1] === "]") { if (c += 2, u.append = !0, c !== s) return o(); continue; } if (p = e.exec(i.substring(c)), p !== null) { c += p[0].length, u.nextType = "array", u = { type: "array", key: parseInt(p[1], 10) }, d.push(u); continue; } if (p = n.exec(i.substring(c)), p !== null) { c += p[0].length, u.nextType = "object", u = { type: "object", key: p[1] }, d.push(u); continue; } return o(); } return u.last = !0, d; } return rw = r, rw; } var iw, iN; function Lle() { if (iN) return iw; iN = 1; function t(r) { return r === void 0 ? "undefined" : Array.isArray(r) ? "array" : typeof r == "object" ? "object" : "scalar"; } function e(r, i, o, a) { switch (t(o)) { case "undefined": i.append ? r[i.key] = [a] : r[i.key] = a; break; case "array": r[i.key].push(a); break; case "object": return e(o, { key: "" }, o[""], a); case "scalar": r[i.key] = [r[i.key], a]; break; } return r; } function n(r, i, o, a) { if (i.last) return e(r, i, o, a); var s; switch (t(o)) { case "undefined": return i.nextType === "array" ? r[i.key] = [] : r[i.key] = /* @__PURE__ */ Object.create(null), r[i.key]; case "object": return r[i.key]; case "array": return i.nextType === "array" ? o : (s = /* @__PURE__ */ Object.create(null), r[i.key] = s, o.forEach(function(c, u) { c !== void 0 && (s["" + u] = c); }), s); case "scalar": return s = /* @__PURE__ */ Object.create(null), s[""] = o, r[i.key] = s, s; } } return iw = n, iw; } var ow, oN; function Qle() { if (oN) return ow; oN = 1; var t = Ule(), e = Lle(); function n(r, i, o) { var a = t(i); a.reduce(function(s, c) { return e(s, c, s[c.key], o); }, r); } return ow = n, ow; } var aw, aN; function jle() { if (aN) return aw; aN = 1; var t = Qa.EventEmitter; function e() { t.call(this), this.value = 0; } return e.prototype = Object.create(t.prototype), e.prototype.increment = function() { this.value++; }, e.prototype.decrement = function() { --this.value === 0 && this.emit("zero"); }, e.prototype.isZero = function() { return this.value === 0; }, e.prototype.onceZero = function(r) { if (this.isZero()) return r(); this.once("zero", r); }, aw = e, aw; } var sw, sN; function pB() { if (sN) return sw; sN = 1; var t = Pn, e = { LIMIT_PART_COUNT: "Too many parts", LIMIT_FILE_SIZE: "File too large", LIMIT_FILE_COUNT: "Too many files", LIMIT_FIELD_KEY: "Field name too long", LIMIT_FIELD_VALUE: "Field value too long", LIMIT_FIELD_COUNT: "Too many fields", LIMIT_UNEXPECTED_FILE: "Unexpected field", MISSING_FIELD_NAME: "Field name missing" }; function n(r, i) { Error.captureStackTrace(this, this.constructor), this.name = this.constructor.name, this.message = e[r], this.code = r, i && (this.field = i); } return t.inherits(n, Error), sw = n, sw; } /* object-assign (c) Sindre Sorhus @license MIT */ var cw, cN; function fB() { if (cN) return cw; cN = 1; var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, n = Object.prototype.propertyIsEnumerable; function r(o) { if (o == null) throw new TypeError("Object.assign cannot be called with null or undefined"); return Object(o); } function i() { try { if (!Object.assign) return !1; var o = new String("abc"); if (o[5] = "de", Object.getOwnPropertyNames(o)[0] === "5") return !1; for (var a = {}, s = 0; s < 10; s++) a["_" + String.fromCharCode(s)] = s; var c = Object.getOwnPropertyNames(a).map(function(d) { return a[d]; }); if (c.join("") !== "0123456789") return !1; var u = {}; return "abcdefghijklmnopqrst".split("").forEach(function(d) { u[d] = d; }), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst"; } catch { return !1; } } return cw = i() ? Object.assign : function(o, a) { for (var s, c = r(o), u, d = 1; d < arguments.length; d++) { s = Object(arguments[d]); for (var p in s) e.call(s, p) && (c[p] = s[p]); if (t) { u = t(s); for (var f = 0; f < u.length; f++) n.call(s, u[f]) && (c[u[f]] = s[u[f]]); } } return c; }, cw; } var uw, uN; function $le() { if (uN) return uw; uN = 1; var t = fB(); function e(r, i) { var o = r.indexOf(i); ~o && r.splice(o, 1); } function n(r, i) { switch (this.strategy = r, this.req = i, r) { case "NONE": break; case "VALUE": break; case "ARRAY": i.files = []; break; case "OBJECT": i.files = /* @__PURE__ */ Object.create(null); break; default: throw new Error("Unknown file strategy: " + r); } } return n.prototype.insertPlaceholder = function(r) { var i = { fieldname: r.fieldname }; switch (this.strategy) { case "NONE": break; case "VALUE": break; case "ARRAY": this.req.files.push(i); break; case "OBJECT": this.req.files[r.fieldname] ? this.req.files[r.fieldname].push(i) : this.req.files[r.fieldname] = [i]; break; } return i; }, n.prototype.removePlaceholder = function(r) { switch (this.strategy) { case "NONE": break; case "VALUE": break; case "ARRAY": e(this.req.files, r); break; case "OBJECT": this.req.files[r.fieldname].length === 1 ? delete this.req.files[r.fieldname] : e(this.req.files[r.fieldname], r); break; } }, n.prototype.replacePlaceholder = function(r, i) { if (this.strategy === "VALUE") { this.req.file = i; return; } delete r.fieldname, t(r, i); }, uw = n, uw; } var lw, lN; function Gle() { if (lN) return lw; lN = 1; function t(e, n, r) { var i = e.length, o = []; if (i === 0) return r(null, o); function a(s) { var c = e[s]; n(c, function(u) { u && (u.file = c, u.field = c.fieldname, o.push(u)), s < i - 1 ? a(s + 1) : r(null, o); }); } a(0); } return lw = t, lw; } var dw, dN; function qle() { if (dN) return dw; dN = 1; var t = dB(), e = Ble(), n = OF(), r = Qle(), i = jle(), o = pB(), a = $le(), s = Gle(); function c(d) { d.on("readable", () => { for (; d.read() !== null; ) ; }); } function u(d) { return function(f, m, h) { if (!t(f, ["multipart"])) return h(); var y = d(), x = y.limits, g = y.storage, b = y.fileFilter, S = y.fileStrategy, E = y.preservePath; f.body = /* @__PURE__ */ Object.create(null), f.on("error", function(K) { X(K); }); var T; try { T = e({ headers: f.headers, limits: x, preservePath: E }); } catch (K) { return h(K); } var U = new a(S, f), q = !1, Y = !1, H = !1, G = new i(), J = []; function B(K) { q || (q = !0, f.unpipe(T), c(f), f.resume(), setImmediate(() => { T.removeAllListeners(); }), h(K)); } function D() { Y && G.isZero() && !H && B(); } function X(K) { H || (H = !0, G.onceZero(function() { function $(_, I) { g._removeFile(f, _, I); } s(J, $, function(_, I) { if (_) return B(_); K.storageErrors = I, B(K); }); })); } function V(K, $) { X(new o(K, $)); } T.on("field", function(K, $, { nameTruncated: _, valueTruncated: I }) { if (K == null) return V("MISSING_FIELD_NAME"); if (_) return V("LIMIT_FIELD_KEY"); if (I) return V("LIMIT_FIELD_VALUE", K); if (x && Object.prototype.hasOwnProperty.call(x, "fieldNameSize") && K.length > x.fieldNameSize) return V("LIMIT_FIELD_KEY"); r(f.body, K, $); }), T.on("file", function(K, $, { filename: _, encoding: I, mimeType: N }) { var L = !1; if ($.on("error", function(k) { L && G.decrement(), X(k); }), K == null) return V("MISSING_FIELD_NAME"); if (!_) return $.resume(); if (x && Object.prototype.hasOwnProperty.call(x, "fieldNameSize") && K.length > x.fieldNameSize) return V("LIMIT_FIELD_KEY"); var C = { fieldname: K, originalname: _, encoding: I, mimetype: N }, Q = U.insertPlaceholder(C); b(f, C, function(k, M) { if (k) return U.removePlaceholder(Q), X(k); if (!M) return U.removePlaceholder(Q), $.resume(); var O = !1; L = !0, G.increment(), Object.defineProperty(C, "stream", { configurable: !0, enumerable: !1, value: $ }), $.on("limit", function() { O = !0, V("LIMIT_FILE_SIZE", K); }), g._handleFile(f, C, function(A, F) { if (O) return U.removePlaceholder(Q), J.push(n(C, F)), G.decrement(); if (A) return U.removePlaceholder(Q), G.decrement(), X(A); var Z = n(C, F); U.replacePlaceholder(Q, Z), J.push(Z), G.decrement(), D(); }); }); }), T.on("error", function(K) { X(K); }), T.on("partsLimit", function() { V("LIMIT_PART_COUNT"); }), T.on("filesLimit", function() { V("LIMIT_FILE_COUNT"); }), T.on("fieldsLimit", function() { V("LIMIT_FIELD_COUNT"); }), T.on("close", function() { Y = !0, D(); }), f.pipe(T); }; } return dw = u, dw; } var pw, pN; function zle() { if (pN) return pw; pN = 1; var t = fe, e = Ln, n = ve, r = Ri, i = SF(); function o(c, u, d) { r.randomBytes(16, function(p, f) { d(p, p ? void 0 : f.toString("hex")); }); } function a(c, u, d) { d(null, e.tmpdir()); } function s(c) { this.getFilename = c.filename || o, typeof c.destination == "string" ? (i.sync(c.destination), this.getDestination = function(u, d, p) { p(null, c.destination); }) : this.getDestination = c.destination || a; } return s.prototype._handleFile = function(u, d, p) { var f = this; f.getDestination(u, d, function(m, h) { if (m) return p(m); f.getFilename(u, d, function(y, x) { if (y) return p(y); var g = n.join(h, x), b = t.createWriteStream(g); d.stream.pipe(b), b.on("error", p), b.on("finish", function() { p(null, { destination: h, filename: x, path: g, size: b.bytesWritten }); }); }); }); }, s.prototype._removeFile = function(u, d, p) { var f = d.path; delete d.destination, delete d.filename, delete d.path, t.unlink(f, p); }, pw = function(c) { return new s(c); }, pw; } var fw, fN; function Hle() { if (fN) return fw; fN = 1; var t = Object.prototype.toString, e = typeof Buffer < "u" && typeof Buffer.alloc == "function" && typeof Buffer.allocUnsafe == "function" && typeof Buffer.from == "function"; function n(a) { return t.call(a).slice(8, -1) === "ArrayBuffer"; } function r(a, s, c) { s >>>= 0; var u = a.byteLength - s; if (u < 0) throw new RangeError("'offset' is out of bounds"); if (c === void 0) c = u; else if (c >>>= 0, c > u) throw new RangeError("'length' is out of bounds"); return e ? Buffer.from(a.slice(s, s + c)) : new Buffer(new Uint8Array(a.slice(s, s + c))); } function i(a, s) { if ((typeof s != "string" || s === "") && (s = "utf8"), !Buffer.isEncoding(s)) throw new TypeError('"encoding" must be a valid string encoding'); return e ? Buffer.from(a, s) : new Buffer(a, s); } function o(a, s, c) { if (typeof a == "number") throw new TypeError('"value" argument must not be a number'); return n(a) ? r(a, s, c) : typeof a == "string" ? i(a, s) : e ? Buffer.from(a) : new Buffer(a); } return fw = o, fw; } var hw = {}, hN; function Wle() { return hN || (hN = 1, (function(t) { var e = void 0, n = 1e5, r = /* @__PURE__ */ (function() { var N = Object.prototype.toString, L = Object.prototype.hasOwnProperty; return { // Class returns internal [[Class]] property, used to avoid cross-frame instanceof issues: Class: function(C) { return N.call(C).replace(/^\[object *|\]$/g, ""); }, HasProperty: function(C, Q) { return Q in C; }, HasOwnProperty: function(C, Q) { return L.call(C, Q); }, IsCallable: function(C) { return typeof C == "function"; }, ToInt32: function(C) { return C >> 0; }, ToUint32: function(C) { return C >>> 0; } }; })(), i = Math.LN2, o = Math.abs, a = Math.floor, s = Math.log, c = Math.min, u = Math.pow, d = Math.round; function p(N) { if (m && f) { var L = m(N), C; for (C = 0; C < L.length; C += 1) f(N, L[C], { value: N[L[C]], writable: !1, enumerable: !1, configurable: !1 }); } } var f; Object.defineProperty && (function() { try { return Object.defineProperty({}, "x", {}), !0; } catch { return !1; } })() ? f = Object.defineProperty : f = function(N, L, C) { if (!N === Object(N)) throw new TypeError("Object.defineProperty called on non-object"); return r.HasProperty(C, "get") && Object.prototype.__defineGetter__ && Object.prototype.__defineGetter__.call(N, L, C.get), r.HasProperty(C, "set") && Object.prototype.__defineSetter__ && Object.prototype.__defineSetter__.call(N, L, C.set), r.HasProperty(C, "value") && (N[L] = C.value), N; }; var m = Object.getOwnPropertyNames || function(N) { if (N !== Object(N)) throw new TypeError("Object.getOwnPropertyNames called on non-object"); var L = [], C; for (C in N) r.HasOwnProperty(N, C) && L.push(C); return L; }; function h(N) { if (!f) return; if (N.length > n) throw new RangeError("Array too large for polyfill"); function L(Q) { f(N, Q, { get: function() { return N._getter(Q); }, set: function(k) { N._setter(Q, k); }, enumerable: !0, configurable: !1 }); } var C; for (C = 0; C < N.length; C += 1) L(C); } function y(N, L) { var C = 32 - L; return N << C >> C; } function x(N, L) { var C = 32 - L; return N << C >>> C; } function g(N) { return [N & 255]; } function b(N) { return y(N[0], 8); } function S(N) { return [N & 255]; } function E(N) { return x(N[0], 8); } function T(N) { return N = d(Number(N)), [N < 0 ? 0 : N > 255 ? 255 : N & 255]; } function U(N) { return [N >> 8 & 255, N & 255]; } function q(N) { return y(N[0] << 8 | N[1], 16); } function Y(N) { return [N >> 8 & 255, N & 255]; } function H(N) { return x(N[0] << 8 | N[1], 16); } function G(N) { return [N >> 24 & 255, N >> 16 & 255, N >> 8 & 255, N & 255]; } function J(N) { return y(N[0] << 24 | N[1] << 16 | N[2] << 8 | N[3], 32); } function B(N) { return [N >> 24 & 255, N >> 16 & 255, N >> 8 & 255, N & 255]; } function D(N) { return x(N[0] << 24 | N[1] << 16 | N[2] << 8 | N[3], 32); } function X(N, L, C) { var Q = (1 << L - 1) - 1, k, M, O, A, F, Z, ee; function P(j) { var W = a(j), se = j - W; return se < 0.5 ? W : se > 0.5 || W % 2 ? W + 1 : W; } for (N !== N ? (M = (1 << L) - 1, O = u(2, C - 1), k = 0) : N === 1 / 0 || N === -1 / 0 ? (M = (1 << L) - 1, O = 0, k = N < 0 ? 1 : 0) : N === 0 ? (M = 0, O = 0, k = 1 / N === -1 / 0 ? 1 : 0) : (k = N < 0, N = o(N), N >= u(2, 1 - Q) ? (M = c(a(s(N) / i), 1023), O = P(N / u(2, M) * u(2, C)), O / u(2, C) >= 2 && (M = M + 1, O = 1), M > Q ? (M = (1 << L) - 1, O = 0) : (M = M + Q, O = O - u(2, C))) : (M = 0, O = P(N / u(2, 1 - Q - C)))), F = [], A = C; A; A -= 1) F.push(O % 2 ? 1 : 0), O = a(O / 2); for (A = L; A; A -= 1) F.push(M % 2 ? 1 : 0), M = a(M / 2); for (F.push(k ? 1 : 0), F.reverse(), Z = F.join(""), ee = []; Z.length; ) ee.push(parseInt(Z.substring(0, 8), 2)), Z = Z.substring(8); return ee; } function V(N, L, C) { var Q = [], k, M, O, A, F, Z, ee, P; for (k = N.length; k; k -= 1) for (O = N[k - 1], M = 8; M; M -= 1) Q.push(O % 2 ? 1 : 0), O = O >> 1; return Q.reverse(), A = Q.join(""), F = (1 << L - 1) - 1, Z = parseInt(A.substring(0, 1), 2) ? -1 : 1, ee = parseInt(A.substring(1, 1 + L), 2), P = parseInt(A.substring(1 + L), 2), ee === (1 << L) - 1 ? P !== 0 ? NaN : Z * (1 / 0) : ee > 0 ? Z * u(2, ee - F) * (1 + P / u(2, C)) : P !== 0 ? Z * u(2, -(F - 1)) * (P / u(2, C)) : Z < 0 ? -0 : 0; } function K(N) { return V(N, 11, 52); } function $(N) { return X(N, 11, 52); } function _(N) { return V(N, 8, 23); } function I(N) { return X(N, 8, 23); } (function() { var N = function(W) { if (W = r.ToInt32(W), W < 0) throw new RangeError("ArrayBuffer size is not a small enough positive integer"); this.byteLength = W, this._bytes = [], this._bytes.length = W; var se; for (se = 0; se < this.byteLength; se += 1) this._bytes[se] = 0; p(this); }; t.ArrayBuffer = t.ArrayBuffer || N; var L = function() { }; function C(j, W, se) { var ce; return ce = function(oe, we, Me) { var He, We, Xe, Ye; if (!arguments.length || typeof arguments[0] == "number") { if (this.length = r.ToInt32(arguments[0]), Me < 0) throw new RangeError("ArrayBufferView size is not a small enough positive integer"); this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0; } else if (typeof arguments[0] == "object" && arguments[0].constructor === ce) for (He = arguments[0], this.length = He.length, this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0, Xe = 0; Xe < this.length; Xe += 1) this._setter(Xe, He._getter(Xe)); else if (typeof arguments[0] == "object" && !(arguments[0] instanceof N || r.Class(arguments[0]) === "ArrayBuffer")) for (We = arguments[0], this.length = r.ToUint32(We.length), this.byteLength = this.length * this.BYTES_PER_ELEMENT, this.buffer = new N(this.byteLength), this.byteOffset = 0, Xe = 0; Xe < this.length; Xe += 1) Ye = We[Xe], this._setter(Xe, Number(Ye)); else if (typeof arguments[0] == "object" && (arguments[0] instanceof N || r.Class(arguments[0]) === "ArrayBuffer")) { if (this.buffer = oe, this.byteOffset = r.ToUint32(we), this.byteOffset > this.buffer.byteLength) throw new RangeError("byteOffset out of range"); if (this.byteOffset % this.BYTES_PER_ELEMENT) throw new RangeError("ArrayBuffer length minus the byteOffset is not a multiple of the element size."); if (arguments.length < 3) { if (this.byteLength = this.buffer.byteLength - this.byteOffset, this.byteLength % this.BYTES_PER_ELEMENT) throw new RangeError("length of buffer minus byteOffset not a multiple of the element size"); this.length = this.byteLength / this.BYTES_PER_ELEMENT; } else this.length = r.ToUint32(Me), this.byteLength = this.length * this.BYTES_PER_ELEMENT; if (this.byteOffset + this.byteLength > this.buffer.byteLength) throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); } else throw new TypeError("Unexpected argument type(s)"); this.constructor = ce, p(this), h(this); }, ce.prototype = new L(), ce.prototype.BYTES_PER_ELEMENT = j, ce.prototype._pack = W, ce.prototype._unpack = se, ce.BYTES_PER_ELEMENT = j, ce.prototype._getter = function(oe) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); if (oe = r.ToUint32(oe), oe >= this.length) return e; var we = [], Me, He; for (Me = 0, He = this.byteOffset + oe * this.BYTES_PER_ELEMENT; Me < this.BYTES_PER_ELEMENT; Me += 1, He += 1) we.push(this.buffer._bytes[He]); return this._unpack(we); }, ce.prototype.get = ce.prototype._getter, ce.prototype._setter = function(oe, we) { if (arguments.length < 2) throw new SyntaxError("Not enough arguments"); if (oe = r.ToUint32(oe), oe >= this.length) return e; var Me = this._pack(we), He, We; for (He = 0, We = this.byteOffset + oe * this.BYTES_PER_ELEMENT; He < this.BYTES_PER_ELEMENT; He += 1, We += 1) this.buffer._bytes[We] = Me[He]; }, ce.prototype.set = function(oe, we) { if (arguments.length < 1) throw new SyntaxError("Not enough arguments"); var Me, He, We, Xe, Ye, it, ze, Ft, Or, ut; if (typeof arguments[0] == "object" && arguments[0].constructor === this.constructor) { if (Me = arguments[0], We = r.ToUint32(arguments[1]), We + Me.length > this.length) throw new RangeError("Offset plus length of array is out of range"); if (Ft = this.byteOffset + We * this.BYTES_PER_ELEMENT, Or = Me.length * this.BYTES_PER_ELEMENT, Me.buffer === this.buffer) { for (ut = [], Ye = 0, it = Me.byteOffset; Ye < Or; Ye += 1, it += 1) ut[Ye] = Me.buffer._bytes[it]; for (Ye = 0, ze = Ft; Ye < Or; Ye += 1, ze += 1) this.buffer._bytes[ze] = ut[Ye]; } else for (Ye = 0, it = Me.byteOffset, ze = Ft; Ye < Or; Ye += 1, it += 1, ze += 1) this.buffer._bytes[ze] = Me.buffer._bytes[it]; } else if (typeof arguments[0] == "object" && typeof arguments[0].length < "u") { if (He = arguments[0], Xe = r.ToUint32(He.length), We = r.ToUint32(arguments[1]), We + Xe > this.length) throw new RangeError("Offset plus length of array is out of range"); for (Ye = 0; Ye < Xe; Ye += 1) it = He[Ye], this._setter(We + Ye, Number(it)); } else throw new TypeError("Unexpected argument type(s)"); }, ce.prototype.subarray = function(oe, we) { function Me(We, Xe, Ye) { return We < Xe ? Xe : We > Ye ? Ye : We; } oe = r.ToInt32(oe), we = r.ToInt32(we), arguments.length < 1 && (oe = 0), arguments.length < 2 && (we = this.length), oe < 0 && (oe = this.length + oe), we < 0 && (we = this.length + we), oe = Me(oe, 0, this.length), we = Me(we, 0, this.length); var He = we - oe; return He < 0 && (He = 0), new this.constructor( this.buffer, this.byteOffset + oe * this.BYTES_PER_ELEMENT, He ); }, ce; } var Q = C(1, g, b), k = C(1, S, E), M = C(1, T, E), O = C(2, U, q), A = C(2, Y, H), F = C(4, G, J), Z = C(4, B, D), ee = C(4, I, _), P = C(8, $, K); t.Int8Array = t.Int8Array || Q, t.Uint8Array = t.Uint8Array || k, t.Uint8ClampedArray = t.Uint8ClampedArray || M, t.Int16Array = t.Int16Array || O, t.Uint16Array = t.Uint16Array || A, t.Int32Array = t.Int32Array || F, t.Uint32Array = t.Uint32Array || Z, t.Float32Array = t.Float32Array || ee, t.Float64Array = t.Float64Array || P; })(), (function() { function N(M, O) { return r.IsCallable(M.get) ? M.get(O) : M[O]; } var L = (function() { var M = new t.Uint16Array([4660]), O = new t.Uint8Array(M.buffer); return N(O, 0) === 18; })(), C = function(O, A, F) { if (arguments.length === 0) O = new t.ArrayBuffer(0); else if (!(O instanceof t.ArrayBuffer || r.Class(O) === "ArrayBuffer")) throw new TypeError("TypeError"); if (this.buffer = O || new t.ArrayBuffer(0), this.byteOffset = r.ToUint32(A), this.byteOffset > this.buffer.byteLength) throw new RangeError("byteOffset out of range"); if (arguments.length < 3 ? this.byteLength = this.buffer.byteLength - this.byteOffset : this.byteLength = r.ToUint32(F), this.byteOffset + this.byteLength > this.buffer.byteLength) throw new RangeError("byteOffset and length reference an area beyond the end of the buffer"); p(this); }; function Q(M) { return function(O, A) { if (O = r.ToUint32(O), O + M.BYTES_PER_ELEMENT > this.byteLength) throw new RangeError("Array index out of range"); O += this.byteOffset; var F = new t.Uint8Array(this.buffer, O, M.BYTES_PER_ELEMENT), Z = [], ee; for (ee = 0; ee < M.BYTES_PER_ELEMENT; ee += 1) Z.push(N(F, ee)); return !!A == !!L && Z.reverse(), N(new M(new t.Uint8Array(Z).buffer), 0); }; } C.prototype.getUint8 = Q(t.Uint8Array), C.prototype.getInt8 = Q(t.Int8Array), C.prototype.getUint16 = Q(t.Uint16Array), C.prototype.getInt16 = Q(t.Int16Array), C.prototype.getUint32 = Q(t.Uint32Array), C.prototype.getInt32 = Q(t.Int32Array), C.prototype.getFloat32 = Q(t.Float32Array), C.prototype.getFloat64 = Q(t.Float64Array); function k(M) { return function(O, A, F) { if (O = r.ToUint32(O), O + M.BYTES_PER_ELEMENT > this.byteLength) throw new RangeError("Array index out of range"); var Z = new M([A]), ee = new t.Uint8Array(Z.buffer), P = [], j, W; for (j = 0; j < M.BYTES_PER_ELEMENT; j += 1) P.push(N(ee, j)); !!F == !!L && P.reverse(), W = new t.Uint8Array(this.buffer, O, M.BYTES_PER_ELEMENT), W.set(P); }; } C.prototype.setUint8 = k(t.Uint8Array), C.prototype.setInt8 = k(t.Int8Array), C.prototype.setUint16 = k(t.Uint16Array), C.prototype.setInt16 = k(t.Int16Array), C.prototype.setUint32 = k(t.Uint32Array), C.prototype.setInt32 = k(t.Int32Array), C.prototype.setFloat32 = k(t.Float32Array), C.prototype.setFloat64 = k(t.Float64Array), t.DataView = t.DataView || C; })(); })(hw)), hw; } var mw, mN; function Kle() { if (mN) return mw; mN = 1; var t = Uc().Writable, e = Do(), n = Hle(); if (typeof Uint8Array > "u") var r = Wle().Uint8Array; else var r = Uint8Array; function i(p, f) { if (!(this instanceof i)) return new i(p, f); typeof p == "function" && (f = p, p = {}), p || (p = {}); var m = p.encoding, h = !1; m ? (m = String(m).toLowerCase(), (m === "u8" || m === "uint8") && (m = "uint8array")) : h = !0, t.call(this, { objectMode: !0 }), this.encoding = m, this.shouldInferEncoding = h, f && this.on("finish", function() { f(this.getBody()); }), this.body = []; } mw = i, e(i, t), i.prototype._write = function(p, f, m) { this.body.push(p), m(); }, i.prototype.inferEncoding = function(p) { var f = p === void 0 ? this.body[0] : p; return Buffer.isBuffer(f) ? "buffer" : typeof Uint8Array < "u" && f instanceof Uint8Array ? "uint8array" : Array.isArray(f) ? "array" : typeof f == "string" ? "string" : Object.prototype.toString.call(f) === "[object Object]" ? "object" : "buffer"; }, i.prototype.getBody = function() { return !this.encoding && this.body.length === 0 ? [] : (this.shouldInferEncoding && (this.encoding = this.inferEncoding()), this.encoding === "array" ? u(this.body) : this.encoding === "string" ? s(this.body) : this.encoding === "buffer" ? c(this.body) : this.encoding === "uint8array" ? d(this.body) : this.body); }; function o(p) { return /Array\]$/.test(Object.prototype.toString.call(p)); } function a(p) { return typeof p == "string" || o(p) || p && typeof p.subarray == "function"; } function s(p) { for (var f = [], m = 0; m < p.length; m++) { var h = p[m]; typeof h == "string" || Buffer.isBuffer(h) ? f.push(h) : a(h) ? f.push(n(h)) : f.push(n(String(h))); } return Buffer.isBuffer(p[0]) ? (f = Buffer.concat(f), f = f.toString("utf8")) : f = f.join(""), f; } function c(p) { for (var f = [], m = 0; m < p.length; m++) { var h = p[m]; Buffer.isBuffer(h) ? f.push(h) : a(h) ? f.push(n(h)) : f.push(n(String(h))); } return Buffer.concat(f); } function u(p) { for (var f = [], m = 0; m < p.length; m++) f.push.apply(f, p[m]); return f; } function d(p) { for (var f = 0, m = 0; m < p.length; m++) typeof p[m] == "string" && (p[m] = n(p[m])), f += p[m].length; for (var h = new r(f), m = 0, y = 0; m < p.length; m++) for (var x = p[m], g = 0; g < x.length; g++) h[y++] = x[g]; return h; } return mw; } var gw, gN; function Vle() { if (gN) return gw; gN = 1; var t = Kle(); function e(n) { } return e.prototype._handleFile = function(r, i, o) { i.stream.pipe(t({ encoding: "buffer" }, function(a) { o(null, { buffer: a, size: a.length }); })); }, e.prototype._removeFile = function(r, i, o) { delete i.buffer, o(null); }, gw = function(n) { return new e(); }, gw; } var yN; function Yle() { if (yN) return cu.exports; yN = 1; var t = qle(), e = zle(), n = Vle(), r = pB(); function i(s, c, u) { u(null, !0); } function o(s) { s.storage ? this.storage = s.storage : s.dest ? this.storage = e({ destination: s.dest }) : this.storage = n(), this.limits = s.limits, this.preservePath = s.preservePath, this.fileFilter = s.fileFilter || i; } o.prototype._makeMiddleware = function(s, c) { function u() { var d = this.fileFilter, p = /* @__PURE__ */ Object.create(null); s.forEach(function(m) { typeof m.maxCount == "number" ? p[m.name] = m.maxCount : p[m.name] = 1 / 0; }); function f(m, h, y) { if ((p[h.fieldname] || 0) <= 0) return y(new r("LIMIT_UNEXPECTED_FILE", h.fieldname)); p[h.fieldname] -= 1, d(m, h, y); } return { limits: this.limits, preservePath: this.preservePath, storage: this.storage, fileFilter: f, fileStrategy: c }; } return t(u.bind(this)); }, o.prototype.single = function(s) { return this._makeMiddleware([{ name: s, maxCount: 1 }], "VALUE"); }, o.prototype.array = function(s, c) { return this._makeMiddleware([{ name: s, maxCount: c }], "ARRAY"); }, o.prototype.fields = function(s) { return this._makeMiddleware(s, "OBJECT"); }, o.prototype.none = function() { return this._makeMiddleware([], "NONE"); }, o.prototype.any = function() { function s() { return { limits: this.limits, preservePath: this.preservePath, storage: this.storage, fileFilter: this.fileFilter, fileStrategy: "ARRAY" }; } return t(s.bind(this)); }; function a(s) { if (s === void 0) return new o({}); if (typeof s == "object" && s !== null) return new o(s); throw new TypeError("Expected object for argument options"); } return cu.exports = a, cu.exports.diskStorage = e, cu.exports.memoryStorage = n, cu.exports.MulterError = r, cu.exports; } var Jle = Yle(); const Da = /* @__PURE__ */ ra(Jle), Xle = l.Object({ name: l.String({ default: "http-server" }), enable: l.Boolean({ default: !1 }), port: l.Number({ default: 3e3 }), host: l.String({ default: "127.0.0.1" }), enableCors: l.Boolean({ default: !0 }), enableWebsocket: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }) }), Zle = l.Object({ name: l.String({ default: "http-sse-server" }), enable: l.Boolean({ default: !1 }), port: l.Number({ default: 3e3 }), host: l.String({ default: "127.0.0.1" }), enableCors: l.Boolean({ default: !0 }), enableWebsocket: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }), reportSelfMessage: l.Boolean({ default: !1 }) }), ede = l.Object({ name: l.String({ default: "http-client" }), enable: l.Boolean({ default: !1 }), url: l.String({ default: "http://localhost:8080" }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }) }), tde = l.Object({ name: l.String({ default: "websocket-server" }), enable: l.Boolean({ default: !1 }), host: l.String({ default: "127.0.0.1" }), port: l.Number({ default: 3001 }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), token: l.String({ default: "" }), enableForcePushEvent: l.Boolean({ default: !0 }), debug: l.Boolean({ default: !1 }), heartInterval: l.Number({ default: 3e4 }) }), nde = l.Object({ name: l.String({ default: "websocket-client" }), enable: l.Boolean({ default: !1 }), url: l.String({ default: "ws://localhost:8082" }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), reconnectInterval: l.Number({ default: 5e3 }), token: l.String({ default: "" }), debug: l.Boolean({ default: !1 }), heartInterval: l.Number({ default: 3e4 }) }), rde = l.Object({ name: l.String({ default: "plugin" }), enable: l.Boolean({ default: !1 }), messagePostFormat: l.String({ default: "array" }), reportSelfMessage: l.Boolean({ default: !1 }), debug: l.Boolean({ default: !1 }) }), ide = l.Object({ httpServers: l.Array(Xle, { default: [] }), httpSseServers: l.Array(Zle, { default: [] }), httpClients: l.Array(ede, { default: [] }), websocketServers: l.Array(tde, { default: [] }), websocketClients: l.Array(nde, { default: [] }), plugins: l.Array(rde, { default: [] }) }, { default: {} }), ode = l.Object({ baseTimeout: l.Number({ default: 1e4 }), uploadSpeedKBps: l.Number({ default: 256 }), downloadSpeedKBps: l.Number({ default: 256 }), maxTimeout: l.Number({ default: 18e5 }) }, { default: {} }), bN = l.Object({ network: ide, musicSignUrl: l.String({ default: "" }), enableLocalFile2Url: l.Boolean({ default: !1 }), parseMultMsg: l.Boolean({ default: !1 }), imageDownloadProxy: l.String({ default: "" }), timeout: ode }); function hB(t) { let e = t; e = wc(bN, e); const n = zu.Compile(bN); if (!n.Check(e)) { const i = [...n.Errors(e)].map((o) => o.message).join(", "); throw new Error(i); } return e; } class ade { store = /* @__PURE__ */ new Map(); set(e, n, r) { this.store.set(e, n), r && setTimeout(() => this.store.delete(e), r * 1e3); } get(e) { return this.store.get(e) ?? null; } exists(...e) { return e.filter((n) => this.store.has(n)).length; } } const ap = new ade(); var Z0 = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Shell = 1] = "Shell", t[t.Framework = 2] = "Framework", t))(Z0 || {}); const Ve = { workingEnv: Z0.Unknown, LoginCurrentTime: Date.now(), LoginCurrentRate: 0, QQLoginStatus: !1, // 已实现 但太傻了 得去那边注册个回调刷新 QQLoginPhase: "waiting_qrcode", QQQRCodeURL: "", QQLoginUin: "", QQLoginInfo: { uid: "", uin: "", nick: "" }, QQLoginError: "", QQVersion: "unknown", QQDataPath: "", OneBotContext: null, onQQLoginStatusChange: async (t) => { Ve.QQLoginStatus = t; }, onWebUiTokenChange: async (t) => { }, onRefreshQRCode: async () => { }, SnowCatHelper: { onOB11ConfigChanged: async () => { }, onQuickLoginRequested: async () => ({ result: !1, message: "" }), onPasswordLoginRequested: async () => ({ result: !1, message: "密码登录功能未初始化" }), onCaptchaLoginRequested: async () => ({ result: !1, message: "验证码登录功能未初始化" }), onNewDeviceLoginRequested: async () => ({ result: !1, message: "新设备登录功能未初始化" }), onRestartProcessRequested: async () => ({ result: !1, message: "重启功能未初始化" }), QQLoginList: [], NewQQLoginList: [] }, SnowCatVersion: gl, WebUiConfigQuickFunction: async () => { } }, de = { setWorkingEnv(t) { Ve.workingEnv = t; }, getWorkingEnv() { return Ve.workingEnv; }, setWebUiTokenChangeCallback(t) { Ve.onWebUiTokenChange = t; }, getWebUiTokenChangeCallback() { return Ve.onWebUiTokenChange; }, checkLoginRate(t, e) { const n = `login_rate:${t}`, r = ap.get(n) || 0; return r === 0 ? (ap.set(n, 1, 60), !0) : r >= e ? !1 : (ap.set(n, r + 1), !0); }, getQQLoginStatus() { return Ve.QQLoginStatus; }, setQQLoginCallback(t) { Ve.onQQLoginStatusChange = t; }, getQQLoginCallback() { return Ve.onQQLoginStatusChange; }, setQQLoginStatus(t) { Ve.QQLoginStatus = t; }, setQQLoginPhase(t) { Ve.QQLoginPhase = t; }, getQQLoginPhase() { return Ve.QQLoginPhase; }, setQQLoginQrcodeURL(t) { Ve.QQQRCodeURL = t; }, getQQLoginQrcodeURL() { return Ve.QQQRCodeURL; }, setQQLoginInfo(t) { Ve.QQLoginInfo = t, Ve.QQLoginUin = t.uin.toString(); }, getQQLoginInfo() { return Ve.QQLoginInfo; }, getQQLoginUin() { return Ve.QQLoginUin; }, getQQQuickLoginList() { return Ve.SnowCatHelper.QQLoginList; }, setQQQuickLoginList(t) { Ve.SnowCatHelper.QQLoginList = t; }, getQQNewLoginList() { return Ve.SnowCatHelper.NewQQLoginList; }, setQQNewLoginList(t) { Ve.SnowCatHelper.NewQQLoginList = t; }, setQuickLoginCall(t) { Ve.SnowCatHelper.onQuickLoginRequested = t; }, requestQuickLogin: function(t) { return Ve.SnowCatHelper.onQuickLoginRequested(t); }, setPasswordLoginCall(t) { Ve.SnowCatHelper.onPasswordLoginRequested = t; }, requestPasswordLogin: function(t, e) { return Ve.SnowCatHelper.onPasswordLoginRequested(t, e); }, setCaptchaLoginCall(t) { Ve.SnowCatHelper.onCaptchaLoginRequested = t; }, requestCaptchaLogin: function(t, e, n, r, i) { return Ve.SnowCatHelper.onCaptchaLoginRequested(t, e, n, r, i); }, setNewDeviceLoginCall(t) { Ve.SnowCatHelper.onNewDeviceLoginRequested = t; }, requestNewDeviceLogin: function(t, e, n) { return Ve.SnowCatHelper.onNewDeviceLoginRequested(t, e, n); }, setOnOB11ConfigChanged(t) { Ve.SnowCatHelper.onOB11ConfigChanged = t; }, setOB11Config: function(t) { return Ve.SnowCatHelper.onOB11ConfigChanged(t); }, GetNapCatVersion() { return Ve.SnowCatVersion; }, setQQVersion(t) { Ve.QQVersion = t; }, getQQVersion() { return Ve.QQVersion; }, setQQDataPath(t) { Ve.QQDataPath = t; }, getQQDataPath() { return Ve.QQDataPath; }, setWebUiConfigQuickFunction(t) { Ve.WebUiConfigQuickFunction = t; }, runWebUiConfigQuickFunction: async function() { await Ve.WebUiConfigQuickFunction(); }, setOneBotContext(t) { Ve.OneBotContext = t; }, getOneBotContext() { return Ve.OneBotContext; }, setRestartProcessCall(t) { Ve.SnowCatHelper.onRestartProcessRequested = t; }, requestRestartProcess: async function() { return await Ve.SnowCatHelper.onRestartProcessRequested(); }, setQQLoginError(t) { Ve.QQLoginError = t; }, getQQLoginError() { return Ve.QQLoginError; }, setRefreshQRCodeCallback(t) { Ve.onRefreshQRCode = t; }, getRefreshQRCodeCallback() { return Ve.onRefreshQRCode; }, refreshQRCode: async function() { const t = Ve.QQQRCodeURL; Ve.QQLoginError = "", Ve.QQLoginPhase = "generating_qrcode", await Ve.onRefreshQRCode(); const n = Date.now() + 1e4; for (; Date.now() < n; ) { const r = Ve.QQQRCodeURL; if (r && r !== t) return Ve.QQLoginPhase = "waiting_qrcode", r; await new Promise((i) => setTimeout(i, 50)); } throw Ve.QQLoginPhase = t ? "waiting_qrcode" : "offline", new Error("二维码刷新超时:QQ 登录服务未返回新的二维码"); } }; var Ap = /* @__PURE__ */ ((t) => (t[t.OK = 200] = "OK", t[t.BadRequest = 400] = "BadRequest", t[t.Unauthorized = 401] = "Unauthorized", t[t.Forbidden = 403] = "Forbidden", t[t.NotFound = 404] = "NotFound", t[t.InternalServerError = 500] = "InternalServerError", t))(Ap || {}), gA = /* @__PURE__ */ ((t) => (t[t.Success = 0] = "Success", t[t.Error = -1] = "Error", t))(gA || {}); const ne = (t, e = "error", n = !1) => { const r = { code: gA.Error, message: e }; if (n) { t.status(Ap.OK).send(JSON.stringify(r)); return; } t.status(Ap.OK).json(r); }, me = (t, e, n = "success", r = !1) => { const i = { code: gA.Success, data: e, message: n }; if (r) { t.status(Ap.OK).send(JSON.stringify(i)); return; } t.status(Ap.OK).json(i); }, er = (t) => t == null || t === "", sde = (t, e) => { if (!de.getQQLoginStatus()) return ne(e, "Not Login"); const r = de.getQQLoginUin(), i = Bn(lt.configPath, `./onebot11_${r}.json`); try { const o = ir(i) ? mo(i).toString() : mo(Bn(lt.configPath, "./onebot11.json")).toString(), a = hB(Gi.parse(o)); return me(e, a); } catch { return ne(e, "Config Get Error"); } }, cde = async (t, e) => { if (!de.getQQLoginStatus()) return ne(e, "Not Login"); if (er(t.body.config)) return ne(e, "config is empty"); try { const r = hB(Gi.parse(t.body.config)); return await de.setOB11Config(r), me(e, null); } catch (r) { return ne(e, "Error: " + r); } }, ude = async (t, e) => { if (!de.getQQLoginStatus()) return ne(e, "Not Login"); try { const r = lt.configPath; if (!ir(r)) return ne(e, "配置目录不存在"); const o = `config_backup_${((c) => c.toISOString().replace(/[:.]/g, "-"))(/* @__PURE__ */ new Date())}.zip`; e.setHeader("Content-Type", "application/zip"), e.setHeader("Content-Disposition", `attachment; filename="${o}"`); const a = new bl.zip.Stream(), s = CD(r, { withFileTypes: !0 }); for (const c of s) if (c.isFile()) { const u = En(r, c.name); a.addEntry(u, { relativePath: c.name }); } a.pipe(e), a.on("error", (c) => { console.error("压缩流错误:", c), e.headersSent || ne(e, "流式压缩失败"); }); } catch (r) { const i = r.message; if (console.error("导出配置失败:", r), !e.headersSent) return ne(e, `导出配置失败: ${i}`); } }; async function lde(t) { return new Promise((e, n) => { const r = /* @__PURE__ */ new Map(), i = wD.from(t), o = new bl.zip.UncompressStream(); o.on("entry", (a, s, c) => { if (a.type === "file") { const u = []; s.on("data", (d) => u.push(Buffer.from(d))), s.on("end", () => { const d = a.name.split("/").pop() || a.name; r.set(d, Buffer.concat(u)), c(); }), s.on("error", (d) => { console.error(`读取文件失败: ${a.name}`, d), c(); }); } else s.resume(), c(); }), o.on("finish", () => e(r)), o.on("error", n), i.pipe(o); }); } const dde = async (t, e) => { if (!t.file || !t.file.buffer) return ne(e, "请选择要导入的配置文件"); try { const n = lt.configPath, r = await lde(t.file.buffer); if (r.size === 0) return ne(e, "配置文件为空或格式不正确"); const i = /* @__PURE__ */ new Map(); if (ir(n)) { const o = CD(n, { withFileTypes: !0 }); for (const a of o) if (a.isFile()) { const s = En(n, a.name); i.set(a.name, mo(s)); } } for (const [o, a] of r) { const s = En(n, o); R3(s).startsWith(R3(n)) && D2(s, a); } return me(e, { message: "配置导入成功,重启后生效~", filesImported: r.size, filesBackedUp: i.size }); } catch (n) { console.error("导入配置失败:", n); const r = n.message; return ne(e, `导入配置失败: ${r}`); } }, Sf = Tr(), pde = Da({ storage: Da.memoryStorage() }); Sf.post("/GetConfig", sde); Sf.post("/SetConfig", cde); Sf.get("/ExportConfig", ude); Sf.post("/ImportConfig", pde.single("configFile"), dde); class ln { static secretKey = process.env.NAPCAT_WEBUI_JWT_SECRET_KEY || Math.random().toString(36).slice(2); static MAX_CREDENTIAL_VALID_SECONDS = 3600; static getSecretKey() { return ln.secretKey; } /** * 签名凭证方法。 * @param hash 待签名的凭证字符串。 * @returns 签名后的凭证对象。 */ static signCredential(e) { const n = { // 统一使用秒级时间戳,避免与校验逻辑出现单位不一致 CreatedTime: Math.floor(Date.now() / 1e3), HashEncoded: e }, r = JSON.stringify(n), i = Ri.createHmac("sha256", ln.secretKey).update(r, "utf8").digest("hex"); return { Data: n, Hmac: i }; } /** * 检查凭证是否被篡改的方法。 * @param credentialJson 凭证的JSON对象。 * @returns 布尔值,表示凭证是否有效。 */ static checkCredential(e) { try { const n = JSON.stringify(e.Data); return Ri.createHmac("sha256", ln.secretKey).update(n, "utf8").digest("hex") === e.Hmac; } catch { return !1; } } /** * 验证凭证在1小时内有效且token与原始token相同。 * @param token 待验证的原始token。 * @param credentialJson 已签名的凭证JSON对象。 * @returns 布尔值,表示凭证是否有效且token匹配。 */ static validateCredentialWithinOneHour(e, n) { if (!ln.checkCredential(n) || ln.isCredentialRevoked(n)) return !1; const i = Math.floor(Date.now() / 1e3), o = Math.floor(Number(n.Data.CreatedTime)), a = i - o; return a >= 0 && a <= ln.MAX_CREDENTIAL_VALID_SECONDS && n.Data.HashEncoded === ln.generatePasswordHash(e); } /** * 注销指定的Token凭证 * @param credentialJson 凭证JSON对象 * @returns void */ static revokeCredential(e) { const n = JSON.stringify(e.Data), r = Ri.createHmac("sha256", ln.secretKey).update(n, "utf8").digest("hex"); ap.set(`revoked:${r}`, !0, 3600); } /** * 检查凭证是否已被注销 * @param credentialJson 凭证JSON对象 * @returns 布尔值,表示凭证是否已被注销 */ static isCredentialRevoked(e) { const n = JSON.stringify(e.Data), r = Ri.createHmac("sha256", ln.secretKey).update(n, "utf8").digest("hex"); return ap.exists(`revoked:${r}`) > 0; } /** * 生成密码Hash * @param password 密码 * @returns 生成的Hash值 */ static generatePasswordHash(e) { return Ri.createHash("sha256").update(e + ".napcat").digest().toString("hex"); } /** * 对比密码和Hash值 * @param password 密码 * @param hash Hash值 * @returns 布尔值,表示密码是否匹配Hash值 */ static comparePasswordHash(e, n) { return this.generatePasswordHash(e) === n; } } async function fde(t, e, n) { if (t.url === "/auth/login" || t.url === "/auth/passkey/generate-authentication-options" || t.url === "/auth/passkey/verify-authentication") return n(); let r; if (t.headers?.authorization) { const i = t.headers.authorization.split(" "); if (i.length < 2) return ne(e, "Unauthorized"); r = i[1]; } else t.query.webui_token && typeof t.query.webui_token == "string" && (r = t.query.webui_token); if (r) { let i; try { i = JSON.parse(Buffer.from(r, "base64").toString("utf-8")); } catch { return ne(e, "Unauthorized"); } const o = Na(); return o ? ln.validateCredentialWithinOneHour(o, i) ? n() : ne(e, "Unauthorized") : ne(e, "Server token not initialized"); } return ne(e, "Unauthorized"); } let Xh = null, yw = null; function hde() { const t = N2(a0(import.meta.url)), e = process.platform, n = process.arch; return xe.join(t, "native", "dpapi", `${e}-${n}`, "@primno+dpapi.node"); } function mB() { if (Xh) return Xh; if (yw) throw yw; try { const t = hde(), e = { exports: {} }; return process.dlopen(e, t), Xh = e.exports, Xh; } catch (t) { throw yw = t, new Error(`Failed to load DPAPI native addon: ${t.message}`); } } process.platform; function mde(t, e, n) { return mB().protectData(t, e, n); } function gde(t, e, n) { return mB().unprotectData(t, e, n); } const yde = Buffer.from([0, 0, 0, 20]), vN = 16; function bde(t) { const e = qe.readFileSync(t); return Buffer.from(gde(e, null, "CurrentUser")); } function vde(t, e) { const n = mde(e, null, "CurrentUser"); qe.writeFileSync(t, Buffer.from(n)); } class Oa { static getRegistryPath(e) { return xe.join(e, "nt_qq", "global", "nt_data", "msf", "Registry20"); } static readGuid(e) { if (!qe.existsSync(e)) throw new Error("Registry20 file not found"); if (gt.platform() !== "win32") throw new Error("Registry20 decryption is only supported on Windows"); const n = bde(e); if (n.length < 20) throw new Error(`Decrypted data too short (got ${n.length} bytes, need 20)`); const r = n.subarray(4, 20), i = Buffer.alloc(16); for (let o = 0; o < 16; o++) { const a = r[o] ?? 0; i[o] = ~(a ^ vN) & 255; } return i.toString("hex"); } static writeGuid(e, n) { if (n.length !== 32) throw new Error("Invalid GUID length, must be 32 hex chars"); if (gt.platform() !== "win32") throw new Error("Registry20 encryption is only supported on Windows"); const r = Buffer.from(n, "hex"), i = Buffer.alloc(16); for (let s = 0; s < 16; s++) { const c = r[s] ?? 0; i[s] = vN ^ ~c & 255; } const o = Buffer.concat([yde, i]), a = xe.dirname(e); qe.existsSync(a) || qe.mkdirSync(a, { recursive: !0 }), vde(e, o); } static getBackups(e) { const n = xe.dirname(e), r = xe.basename(e); return qe.existsSync(n) ? qe.readdirSync(n).filter((i) => i.startsWith(`${r}.bak.`)).sort().reverse() : []; } static backup(e) { if (!qe.existsSync(e)) throw new Error("Registry20 does not exist"); const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T.]/g, "").slice(0, 14), r = `${e}.bak.${n}`; return qe.copyFileSync(e, r), r; } static restore(e, n) { const r = xe.dirname(e), i = xe.join(r, n); if (!qe.existsSync(i)) throw new Error("Backup file not found"); qe.copyFileSync(i, e); } static delete(e) { qe.existsSync(e) && qe.unlinkSync(e); } } function xN(t) { return t.replace(/[a-zA-Z]/g, (e) => { const n = e <= "Z" ? 65 : 97; return String.fromCharCode((e.charCodeAt(0) - n + 13) % 26 + n); }); } class gi { /** * 获取 machine-info 文件路径 */ static getMachineInfoPath(e) { return xe.join(e, "nt_qq", "global", "nt_data", "msf", "machine-info"); } /** * 从 machine-info 文件读取 MAC 地址 */ static readMac(e) { if (!qe.existsSync(e)) throw new Error("machine-info file not found"); const n = qe.readFileSync(e); if (n.length < 4) throw new Error(`machine-info data too short: ${n.length} < 4 bytes`); const r = n.readUInt32BE(0); if (r >= 18) throw new Error(`MAC string length abnormal: ${r} >= 18`); if (n.length < 4 + r) throw new Error(`machine-info data incomplete: need ${4 + r} bytes, got ${n.length}`); const i = n.subarray(4, 4 + r).toString("ascii"); return xN(i); } /** * 将 MAC 地址写入 machine-info 文件 */ static writeMac(e, n) { if (n = n.trim().toLowerCase(), !/^[0-9a-f]{2}(-[0-9a-f]{2}){5}$/.test(n)) throw new Error("Invalid MAC format, must be xx-xx-xx-xx-xx-xx"); const r = xN(n), i = r.length, o = Buffer.alloc(4 + i); o.writeUInt32BE(i, 0), o.write(r, 4, "ascii"); const a = xe.dirname(e); qe.existsSync(a) || qe.mkdirSync(a, { recursive: !0 }), qe.writeFileSync(e, o); } /** * 读取 /etc/machine-id */ static readMachineId() { const e = "/etc/machine-id"; if (!qe.existsSync(e)) throw new Error("/etc/machine-id not found"); return qe.readFileSync(e, "utf-8").trim(); } /** * 计算 Linux GUID = MD5(machine-id + MAC) */ static computeGuid(e, n) { const r = La.createHash("md5"); return r.update(e, "ascii"), r.update(n, "ascii"), r.digest("hex"); } /** * 获取备份列表 */ static getBackups(e) { const n = xe.dirname(e), r = xe.basename(e); return qe.existsSync(n) ? qe.readdirSync(n).filter((i) => i.startsWith(`${r}.bak.`)).sort().reverse() : []; } /** * 创建备份 */ static backup(e) { if (!qe.existsSync(e)) throw new Error("machine-info file does not exist"); const n = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T.]/g, "").slice(0, 14), r = `${e}.bak.${n}`; return qe.copyFileSync(e, r), r; } /** * 恢复备份 */ static restore(e, n) { const r = xe.dirname(e), i = xe.join(r, n); if (!qe.existsSync(i)) throw new Error("Backup file not found"); qe.copyFileSync(i, e); } /** * 删除 machine-info */ static delete(e) { qe.existsSync(e) && qe.unlinkSync(e); } } function gB(t, e) { return new Promise((n, r) => { const i = JSON.stringify(e), o = hl.request({ hostname: "oidb.tim.qq.com", path: `/v3/oidbinterface/oidb_0xc9e_8?uid=${encodeURIComponent(t)}&getqrcode=1&sdkappid=39998&actype=2`, method: "POST", headers: { "Content-Type": "application/json", "Content-Length": Buffer.byteLength(i), "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36", Accept: "application/json, text/plain, */*" } }, (a) => { let s = ""; a.on("data", (c) => { s += c; }), a.on("end", () => { try { n(JSON.parse(s)); } catch { r(new Error("Failed to parse oidb response")); } }); }); o.on("error", r), o.write(i), o.end(); }); } const Rl = () => { let t = de.getQQDataPath(); if (t || (t = de.getOneBotContext()?.core?.dataPath), !t) throw new Error("QQ data path not available yet"); return Oa.getRegistryPath(t); }, Kc = () => { let t = de.getQQDataPath(); if (t || (t = de.getOneBotContext()?.core?.dataPath), !t) throw new Error("QQ data path not available yet"); return gi.getMachineInfoPath(t); }, xde = async (t, e) => { if (de.getQQLoginStatus()) return ne(e, "QQ Is Logined"); const n = de.getQQLoginQrcodeURL(); return er(n) ? ne(e, "QRCode Get Error") : me(e, { qrcode: n }); }, wde = async (t, e) => { const i = de.getOneBotContext()?.core?.selfInfo?.online, o = de.getQQLoginStatus(), a = de.getQQLoginPhase(), u = { isLogin: o && i === !0, isOffline: o && i === !1, loginPhase: a, qrLoginAccepted: o && (a === "qrcode_scanned" || a === "initializing"), coreReady: o && i === !0, qrcodeurl: de.getQQLoginQrcodeURL(), loginError: de.getQQLoginError() }; return me(e, u); }, Sde = async (t, e) => { const { uin: n } = t.body; if (de.getQQLoginStatus()) return ne(e, "QQ Is Logined"); if (er(n)) return ne(e, "uin is empty"); const { result: i, message: o } = await de.requestQuickLogin(n); return i ? me(e, null) : ne(e, o); }, _de = async (t, e) => { const n = de.getQQQuickLoginList(); return me(e, n); }, Ede = async (t, e) => { const n = de.getQQNewLoginList(); return me(e, n); }, Ade = async (t, e) => { const n = de.getQQLoginInfo(), i = de.getOneBotContext()?.core?.selfInfo, o = i?.online ?? void 0, a = i?.avatarUrl ?? (i?.uin ? `https://q1.qlogo.cn/g?b=qq&nk=${i.uin}&s=100` : void 0), s = { ...n, online: o, avatarUrl: a }; return me(e, s); }, Ide = async (t, e) => { const n = Ct.getAutoLoginAccount(); return me(e, n); }, Cde = async (t, e) => { const { uin: n } = t.body; return await Ct.UpdateAutoLoginAccount(n), me(e, null); }, Tde = async (t, e) => { const r = de.getOneBotContext()?.core?.selfInfo?.online === !0; if (de.getQQLoginStatus() && r) return ne(e, "QQ Is Logined"); if (de.getQQLoginPhase() === "reconnecting") return me(e, { qrcodeurl: "", restarting: !0 }); try { const i = await de.refreshQRCode(); return me(e, { qrcodeurl: i }); } catch (i) { return ne(e, `QRCode Refresh Error: ${i.message}`); } }, kde = async (t, e) => { const { uin: n, passwordMd5: r } = t.body; if (de.getQQLoginStatus()) return ne(e, "QQ Is Logined"); if (er(n)) return ne(e, "uin is empty"); if (er(r)) return ne(e, "passwordMd5 is empty"); const { result: o, message: a, needCaptcha: s, proofWaterUrl: c, needNewDevice: u, jumpUrl: d, newDevicePullQrCodeSig: p } = await de.requestPasswordLogin(n, r); return o ? me(e, null) : s && c ? me(e, { needCaptcha: !0, proofWaterUrl: c }) : u && d ? me(e, { needNewDevice: !0, jumpUrl: d, newDevicePullQrCodeSig: p }) : ne(e, a); }, Nde = async (t, e) => { const { uin: n, passwordMd5: r, ticket: i, randstr: o, sid: a } = t.body; if (de.getQQLoginStatus()) return ne(e, "QQ Is Logined"); if (er(n) || er(r)) return ne(e, "uin or passwordMd5 is empty"); if (er(i) || er(o)) return ne(e, "captcha ticket or randstr is empty"); const { result: c, message: u, needNewDevice: d, jumpUrl: p, newDevicePullQrCodeSig: f } = await de.requestCaptchaLogin(n, r, i, o, a || ""); return c ? me(e, null) : d && p ? me(e, { needNewDevice: !0, jumpUrl: p, newDevicePullQrCodeSig: f }) : ne(e, u); }, Pde = async (t, e) => { const { uin: n, passwordMd5: r, newDevicePullQrCodeSig: i } = t.body; if (de.getQQLoginStatus()) return ne(e, "QQ Is Logined"); if (er(n) || er(r)) return ne(e, "uin or passwordMd5 is empty"); if (er(i)) return ne(e, "newDevicePullQrCodeSig is empty"); const { result: a, message: s, needNewDevice: c, jumpUrl: u, newDevicePullQrCodeSig: d } = await de.requestNewDeviceLogin(n, r, i); return a ? me(e, null) : c && u ? me(e, { needNewDevice: !0, jumpUrl: u, newDevicePullQrCodeSig: d }) : ne(e, s); }, Dde = async (t, e) => { try { const n = Rl(); try { await Oa.backup(n); } catch { } return await Oa.delete(n), me(e, { message: "Device ID reset successfully (Registry20 deleted)" }); } catch (n) { return ne(e, `Failed to reset Device ID: ${n.message}`); } }, Ode = async (t, e) => { try { const n = Rl(), r = await Oa.readGuid(n); return me(e, { guid: r }); } catch (n) { return ne(e, `Failed to get GUID: ${n.message}`); } }, Fde = async (t, e) => { const { guid: n } = t.body; if (!n || typeof n != "string" || n.length !== 32) return ne(e, "Invalid GUID format, must be 32 hex characters"); try { const r = Rl(); try { await Oa.backup(r); } catch { } return await Oa.writeGuid(r, n), me(e, { message: "GUID set successfully" }); } catch (r) { return ne(e, `Failed to set GUID: ${r.message}`); } }, Mde = async (t, e) => { try { const n = Rl(), r = Oa.getBackups(n); return me(e, r); } catch (n) { return ne(e, `Failed to get backups: ${n.message}`); } }, Rde = async (t, e) => { const { backupName: n } = t.body; if (!n) return ne(e, "Backup name is required"); try { const r = Rl(); return await Oa.restore(r, n), me(e, { message: "Restored successfully" }); } catch (r) { return ne(e, `Failed to restore: ${r.message}`); } }, Bde = async (t, e) => { try { const n = Rl(), r = await Oa.backup(n); return me(e, { message: "Backup created", path: r }); } catch (n) { return ne(e, `Failed to backup: ${n.message}`); } }, yB = async (t, e) => { try { const n = await de.requestRestartProcess(); return n.result ? me(e, { message: n.message || "Restart initiated" }) : ne(e, n.message || "Restart failed"); } catch (n) { return ne(e, `Restart error: ${n.message}`); } }, Ude = async (t, e) => me(e, { platform: gt.platform() }), Lde = async (t, e) => { try { const n = Kc(), r = gi.readMac(n); return me(e, { mac: r }); } catch (n) { return ne(e, `Failed to get MAC: ${n.message}`); } }, Qde = async (t, e) => { const { mac: n } = t.body; if (!n || typeof n != "string") return ne(e, "MAC address is required"); try { const r = Kc(); try { gi.backup(r); } catch { } return gi.writeMac(r, n), me(e, { message: "MAC set successfully" }); } catch (r) { return ne(e, `Failed to set MAC: ${r.message}`); } }, jde = async (t, e) => { try { const n = gi.readMachineId(); return me(e, { machineId: n }); } catch (n) { return ne(e, `Failed to read machine-id: ${n.message}`); } }, $de = async (t, e) => { const { mac: n, machineId: r } = t.body; try { let i = r; if (!i || typeof i != "string") try { i = gi.readMachineId(); } catch { i = ""; } let o = n; if (!o || typeof o != "string") try { const s = Kc(); o = gi.readMac(s); } catch { o = ""; } const a = gi.computeGuid(i, o); return me(e, { guid: a, machineId: i, mac: o }); } catch (i) { return ne(e, `Failed to compute GUID: ${i.message}`); } }, Gde = async (t, e) => { try { const n = Kc(), r = gi.getBackups(n); return me(e, r); } catch (n) { return ne(e, `Failed to get backups: ${n.message}`); } }, qde = async (t, e) => { try { const n = Kc(), r = gi.backup(n); return me(e, { message: "Backup created", path: r }); } catch (n) { return ne(e, `Failed to backup: ${n.message}`); } }, zde = async (t, e) => { const { backupName: n } = t.body; if (!n) return ne(e, "Backup name is required"); try { const r = Kc(); return gi.restore(r, n), me(e, { message: "Restored successfully" }); } catch (r) { return ne(e, `Failed to restore: ${r.message}`); } }, Hde = async (t, e) => { try { const n = Kc(); try { gi.backup(n); } catch { } return gi.delete(n), me(e, { message: "Device ID reset successfully (machine-info deleted)" }); } catch (n) { return ne(e, `Failed to reset Device ID: ${n.message}`); } }, Wde = async (t, e) => { const { uin: n, jumpUrl: r } = t.body; if (!n || !r) return ne(e, "uin and jumpUrl are required"); const i = new URL(r), o = i.searchParams.get("sig") || "", a = i.searchParams.get("uin-token") || ""; if (!o || !a) return ne(e, "Failed to get new device QR code: unable to extract sig/uin-token from jumpUrl"); const s = { str_dev_auth_token: o, uint32_flag: 1, uint32_url_type: 0, str_uin_token: a, str_dev_type: "Windows", str_dev_name: gt.hostname() || "DESKTOP-NAPCAT" }, c = await gB(n, s); return me(e, c); }, Kde = async (t, e) => { const { uin: n, bytesToken: r } = t.body; if (!n || !r) return ne(e, "uin and bytesToken are required"); try { const o = await gB(n, { uint32_flag: 0, bytes_token: r // base64 编码的 token }); return me(e, o); } catch (i) { return ne(e, `Failed to poll QR status: ${i.message}`); } }, Nt = Tr(); Nt.all("/GetQuickLoginList", _de); Nt.all("/GetQuickLoginListNew", Ede); Nt.post("/CheckLoginStatus", wde); Nt.post("/GetQQLoginQrcode", xde); Nt.post("/SetQuickLogin", Sde); Nt.post("/GetQQLoginInfo", Ade); Nt.post("/GetQuickLoginQQ", Ide); Nt.post("/SetQuickLoginQQ", Cde); Nt.post("/RefreshQRcode", Tde); Nt.post("/PasswordLogin", kde); Nt.post("/CaptchaLogin", Nde); Nt.post("/NewDeviceLogin", Pde); Nt.post("/GetNewDeviceQRCode", Wde); Nt.post("/PollNewDeviceQR", Kde); Nt.post("/ResetDeviceID", Dde); Nt.post("/RestartSnowCat", yB); Nt.post("/RestartNapCat", yB); Nt.post("/GetDeviceGUID", Ode); Nt.post("/SetDeviceGUID", Fde); Nt.post("/GetGUIDBackups", Mde); Nt.post("/RestoreGUIDBackup", Rde); Nt.post("/CreateGUIDBackup", Bde); Nt.post("/GetPlatformInfo", Ude); Nt.post("/GetLinuxMAC", Lde); Nt.post("/SetLinuxMAC", Qde); Nt.post("/GetLinuxMachineId", jde); Nt.post("/ComputeLinuxGUID", $de); Nt.post("/GetLinuxMachineInfoBackups", Gde); Nt.post("/CreateLinuxMachineInfoBackup", qde); Nt.post("/RestoreLinuxMachineInfoBackup", zde); Nt.post("/ResetLinuxDeviceID", Hde); const yA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", bB = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", vB = (t) => { const e = typeof Uint8Array > "u" ? [] : new Uint8Array(256), n = yA.length; for (let r = 0; r < n; r++) e[t.charCodeAt(r)] = r; return e; }, Vde = vB(yA), Yde = vB(bB), Jde = /^[-A-Za-z0-9\-_]*$/, Xde = /^[-A-Za-z0-9+/]*={0,3}$/, Nr = {}; Nr.toArrayBuffer = (t, e) => { const n = t.length; let r = t.length * 0.75, i, o = 0, a, s, c, u; t[t.length - 1] === "=" && (r--, t[t.length - 2] === "=" && r--); const d = new ArrayBuffer(r), p = new Uint8Array(d), f = e ? Yde : Vde; for (i = 0; i < n; i += 4) a = f[t.charCodeAt(i)], s = f[t.charCodeAt(i + 1)], c = f[t.charCodeAt(i + 2)], u = f[t.charCodeAt(i + 3)], p[o++] = a << 2 | s >> 4, p[o++] = (s & 15) << 4 | c >> 2, p[o++] = (c & 3) << 6 | u & 63; return d; }; Nr.fromArrayBuffer = (t, e) => { const n = new Uint8Array(t); let r, i = ""; const o = n.length, a = e ? bB : yA; for (r = 0; r < o; r += 3) i += a[n[r] >> 2], i += a[(n[r] & 3) << 4 | n[r + 1] >> 4], i += a[(n[r + 1] & 15) << 2 | n[r + 2] >> 6], i += a[n[r + 2] & 63]; const s = o % 3; return s === 2 ? i = i.substring(0, i.length - 1) + (e ? "" : "=") : s === 1 && (i = i.substring(0, i.length - 2) + (e ? "" : "==")), i; }; Nr.toString = (t, e) => new TextDecoder().decode(Nr.toArrayBuffer(t, e)); Nr.fromString = (t, e) => Nr.fromArrayBuffer(new TextEncoder().encode(t), e); Nr.validate = (t, e) => { if (!(typeof t == "string" || t instanceof String)) return !1; try { return e ? Jde.test(t) : Xde.test(t); } catch { return !1; } }; Nr.base64 = Nr; function Yo(t, e = "base64url") { const n = Nr.toArrayBuffer(t, e === "base64url"); return new Uint8Array(n); } function zi(t, e = "base64url") { const n = new Uint8Array(t); return Nr.fromArrayBuffer(n.buffer, e === "base64url"); } function Zde(t) { const e = Nr.toArrayBuffer(t, !0); return Nr.fromArrayBuffer(e); } function Ip(t) { return Nr.toString(t, !0); } function epe(t) { return Nr.validate(t, !1); } function Cp(t) { return t = bA(t), Nr.validate(t, !0); } function bA(t) { return t.replace(/=/g, ""); } function _f(t, e, n) { if (e < 24) return [e, 1]; const r = t.byteLength - n - 1, i = new DataView(t.buffer, n + 1); let o, a = 0; switch (e) { case 24: { r > 0 && (o = i.getUint8(0), a = 2); break; } case 25: { r > 1 && (o = i.getUint16(0, !1), a = 3); break; } case 26: { r > 3 && (o = i.getUint32(0, !1), a = 5); break; } case 27: { if (r > 7) { const s = i.getBigUint64(0, !1); if (s >= 24n && s <= Number.MAX_SAFE_INTEGER) return [Number(s), 9]; } break; } } if (o && o >= 24) return [o, a]; throw new Error("Length not supported or not well formed"); } const JS = 0, mg = 1, xB = 2, wB = 3, SB = 4, _B = 5, EB = 6, tpe = 7; function Aa(t, e) { const n = t << 5; if (e < 0) throw new Error("CBOR Data Item argument must not be negative"); let r; if (typeof e == "number") { if (!Number.isInteger(e)) throw new Error("CBOR Data Item argument must be an integer"); r = BigInt(e); } else r = e; if (t == mg) { if (r == 0n) throw new Error("CBOR Data Item argument cannot be zero when negative"); r = r - 1n; } if (r > 18446744073709551615n) throw new Error("CBOR number out of range"); const i = new Uint8Array(8); return new DataView(i.buffer).setBigUint64(0, r, !1), r <= 23 ? [n | i[7]] : r <= 255 ? [n | 24, i[7]] : r <= 65535 ? [n | 25, ...i.slice(6)] : r <= 4294967295 ? [ n | 26, ...i.slice(4) ] : [ n | 27, ...i ]; } class AB { /** * Wrap a value with a tag number. * When encoded, this tag will be attached to the value. * * @param tag Tag number * @param value Wrapped value */ constructor(e, n) { Object.defineProperty(this, "tagId", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), Object.defineProperty(this, "tagValue", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.tagId = e, this.tagValue = n; } /** * Read the tag number */ get tag() { return this.tagId; } /** * Read the value */ get value() { return this.tagValue; } } function IB(t, e, n) { return _f(t, e, n); } function npe(t, e, n) { const [r, i] = IB(t, e, n); return [-r - 1, i]; } function CB(t, e, n) { const [r, i] = _f(t, e, n), o = n + i; return [ new Uint8Array(t.buffer.slice(o, o + r)), i + r ]; } const rpe = new TextDecoder(); function ipe(t, e, n) { const [r, i] = CB(t, e, n); return [rpe.decode(r), i]; } function ope(t, e, n) { if (e === 0) return [[], 1]; const [r, i] = _f(t, e, n); let o = i; const a = []; for (let s = 0; s < r; s++) { if (t.byteLength - n - o <= 0) throw new Error("array is not supported or well formed"); const [u, d] = pc(t, n + o); a.push(u), o += d; } return [a, o]; } const Zh = "Map is not supported or well formed"; function ape(t, e, n) { if (e === 0) return [/* @__PURE__ */ new Map(), 1]; const [r, i] = _f(t, e, n); let o = i; const a = /* @__PURE__ */ new Map(); for (let s = 0; s < r; s++) { let c = t.byteLength - n - o; if (c <= 0) throw new Error(Zh); const [u, d] = pc(t, n + o); if (o += d, c -= d, c <= 0) throw new Error(Zh); if (typeof u != "string" && typeof u != "number") throw new Error(Zh); if (a.has(u)) throw new Error(Zh); const [p, f] = pc(t, n + o); o += f, a.set(u, p); } return [a, o]; } function spe(t, e) { if (e + 3 > t.byteLength) throw new Error("CBOR stream ended before end of Float 16"); const n = t.getUint16(e + 1, !1); if (n == 31744) return [1 / 0, 3]; if (n == 32256) return [NaN, 3]; if (n == 64512) return [-1 / 0, 3]; throw new Error("Float16 data is unsupported"); } function cpe(t, e) { if (e + 5 > t.byteLength) throw new Error("CBOR stream ended before end of Float 32"); return [t.getFloat32(e + 1, !1), 5]; } function upe(t, e) { if (e + 9 > t.byteLength) throw new Error("CBOR stream ended before end of Float 64"); return [t.getFloat64(e + 1, !1), 9]; } function lpe(t, e, n) { const [r, i] = _f(t, e, n), [o, a] = pc(t, n + i); return [new AB(r, o), i + a]; } function pc(t, e) { if (e >= t.byteLength) throw new Error("CBOR stream ended before tag value"); const n = t.getUint8(e), r = n >> 5, i = n & 31; switch (r) { case JS: return IB(t, i, e); case mg: return npe(t, i, e); case xB: return CB(t, i, e); case wB: return ipe(t, i, e); case SB: return ope(t, i, e); case _B: return ape(t, i, e); case EB: return lpe(t, i, e); case tpe: switch (i) { case 20: return [!1, 1]; case 21: return [!0, 1]; case 22: return [null, 1]; case 23: return [void 0, 1]; // 24: Simple value (value 32..255 in following byte) case 25: return spe(t, e); case 26: return cpe(t, e); case 27: return upe(t, e); } } throw new Error(`Unsupported or not well formed at ${e}`); } function dpe(t) { return t === !0 ? 245 : t === !1 ? 244 : t === null ? 246 : 247; } function ppe(t) { if (Math.fround(t) == t || !Number.isFinite(t) || Number.isNaN(t)) { const e = new Uint8Array(5); return e[0] = 250, new DataView(e.buffer).setFloat32(1, t, !1), e; } else { const e = new Uint8Array(9); return e[0] = 251, new DataView(e.buffer).setFloat64(1, t, !1), e; } } function fpe(t) { return typeof t == "number" ? Number.isSafeInteger(t) ? t < 0 ? Aa(mg, Math.abs(t)) : Aa(JS, t) : [ppe(t)] : t < 0n ? Aa(mg, t * -1n) : Aa(JS, t); } const hpe = new TextEncoder(); function mpe(t, e) { e.push(...Aa(wB, t.length)), e.push(hpe.encode(t)); } function gpe(t, e) { e.push(...Aa(xB, t.length)), e.push(t); } function ype(t, e) { e.push(...Aa(SB, t.length)); for (const n of t) Tp(n, e); } function bpe(t, e) { e.push(new Uint8Array(Aa(_B, t.size))); for (const [n, r] of t.entries()) Tp(n, e), Tp(r, e); } function vpe(t, e) { e.push(...Aa(EB, t.tag)), Tp(t.value, e); } function Tp(t, e) { if (typeof t == "boolean" || t === null || t == null) { e.push(dpe(t)); return; } if (typeof t == "number" || typeof t == "bigint") { e.push(...fpe(t)); return; } if (typeof t == "string") { mpe(t, e); return; } if (t instanceof Uint8Array) { gpe(t, e); return; } if (Array.isArray(t)) { ype(t, e); return; } if (t instanceof Map) { bpe(t, e); return; } if (t instanceof AB) { vpe(t, e); return; } throw new Error("Not implemented"); } function xpe(t, e) { if (t.byteLength === 0 || t.byteLength <= e || e < 0) throw new Error("No data"); return t instanceof Uint8Array ? pc(new DataView(t.buffer), e) : t instanceof ArrayBuffer ? pc(new DataView(t), e) : pc(t, e); } function wpe(t) { const e = []; Tp(t, e); let n = 0; for (const o of e) typeof o == "number" ? n += 1 : n += o.length; const r = new Uint8Array(n); let i = 0; for (const o of e) typeof o == "number" ? (r[i] = o, i += 1) : (r.set(o, i), i += o.length); return r; } function Wu(t) { const e = new Uint8Array(t), n = xpe(e, 0), [r] = n; return r; } function wN(t) { return wpe(t); } function Spe(t) { const e = t.get(pt.kty); return xA(e) && e === Io.OKP; } function e1(t) { const e = t.get(pt.kty); return xA(e) && e === Io.EC2; } function vA(t) { const e = t.get(pt.kty); return xA(e) && e === Io.RSA; } var pt; (function(t) { t[t.kty = 1] = "kty", t[t.alg = 3] = "alg", t[t.crv = -1] = "crv", t[t.x = -2] = "x", t[t.y = -3] = "y", t[t.n = -1] = "n", t[t.e = -2] = "e"; })(pt || (pt = {})); var Io; (function(t) { t[t.OKP = 1] = "OKP", t[t.EC2 = 2] = "EC2", t[t.RSA = 3] = "RSA"; })(Io || (Io = {})); function xA(t) { return Object.values(Io).indexOf(t) >= 0; } var ji; (function(t) { t[t.P256 = 1] = "P256", t[t.P384 = 2] = "P384", t[t.P521 = 3] = "P521", t[t.ED25519 = 6] = "ED25519", t[t.SECP256K1 = 8] = "SECP256K1"; })(ji || (ji = {})); function _pe(t) { return Object.values(ji).indexOf(t) >= 0; } var yt; (function(t) { t[t.ES256 = -7] = "ES256", t[t.EdDSA = -8] = "EdDSA", t[t.ES384 = -35] = "ES384", t[t.ES512 = -36] = "ES512", t[t.PS256 = -37] = "PS256", t[t.PS384 = -38] = "PS384", t[t.PS512 = -39] = "PS512", t[t.ES256K = -47] = "ES256K", t[t.RS256 = -257] = "RS256", t[t.RS384 = -258] = "RS384", t[t.RS512 = -259] = "RS512", t[t.RS1 = -65535] = "RS1"; })(yt || (yt = {})); function Ef(t) { return Object.values(yt).indexOf(t) >= 0; } function kp(t) { if ([yt.RS1].indexOf(t) >= 0) return "SHA-1"; if ([yt.ES256, yt.PS256, yt.RS256].indexOf(t) >= 0) return "SHA-256"; if ([yt.ES384, yt.PS384, yt.RS384].indexOf(t) >= 0) return "SHA-384"; if ([yt.ES512, yt.PS512, yt.RS512, yt.EdDSA].indexOf(t) >= 0) return "SHA-512"; throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto alg`); } let wd; function Vc() { return new Promise((e, n) => { if (wd) return e(wd); const r = Ape.stubThisGlobalThisCrypto(); return r ? (wd = r, e(wd)) : n(new Epe()); }); } class Epe extends Error { constructor() { super("An instance of the Crypto API could not be located"), this.name = "MissingWebCrypto"; } } const Ape = { stubThisGlobalThisCrypto: () => globalThis.crypto, // Make it possible to reset the `webCrypto` at the top of the file setCachedCrypto: (t) => { wd = t; } }; async function Ipe(t, e) { const n = await Vc(), r = kp(e), i = await n.subtle.digest(r, t); return new Uint8Array(i); } async function TB(t) { return (await Vc()).getRandomValues(t), t; } async function wA(t) { const e = await Vc(), { keyData: n, algorithm: r } = t; return e.subtle.importKey("jwk", n, r, !1, [ "verify" ]); } async function kB(t) { const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t, o = await Vc(), a = e.get(pt.alg), s = e.get(pt.crv), c = e.get(pt.x), u = e.get(pt.y); if (!a) throw new Error("Public key was missing alg (EC2)"); if (!s) throw new Error("Public key was missing crv (EC2)"); if (!c) throw new Error("Public key was missing x (EC2)"); if (!u) throw new Error("Public key was missing y (EC2)"); let d; if (s === ji.P256) d = "P-256"; else if (s === ji.P384) d = "P-384"; else if (s === ji.P521) d = "P-521"; else throw new Error(`Unexpected COSE crv value of ${s} (EC2)`); const p = { kty: "EC", crv: d, x: zi(c), y: zi(u), ext: !1 }, m = await wA({ keyData: p, algorithm: { /** * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll * hard-code this. */ name: "ECDSA", namedCurve: d } }); let h = kp(a); i && (h = kp(i)); const y = { name: "ECDSA", hash: { name: h } }; return o.subtle.verify(y, m, n, r); } function SN(t) { if ([yt.EdDSA].indexOf(t) >= 0) return "Ed25519"; if ([yt.ES256, yt.ES384, yt.ES512, yt.ES256K].indexOf(t) >= 0) return "ECDSA"; if ([yt.RS256, yt.RS384, yt.RS512, yt.RS1].indexOf(t) >= 0) return "RSASSA-PKCS1-v1_5"; if ([yt.PS256, yt.PS384, yt.PS512].indexOf(t) >= 0) return "RSA-PSS"; throw new Error(`Could not map COSE alg value of ${t} to a WebCrypto key alg name`); } async function NB(t) { const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t, o = await Vc(), a = e.get(pt.alg), s = e.get(pt.n), c = e.get(pt.e); if (!a) throw new Error("Public key was missing alg (RSA)"); if (!Ef(a)) throw new Error(`Public key had invalid alg ${a} (RSA)`); if (!s) throw new Error("Public key was missing n (RSA)"); if (!c) throw new Error("Public key was missing e (RSA)"); const u = { kty: "RSA", alg: "", n: zi(s), e: zi(c), ext: !1 }, d = { name: SN(a), hash: { name: kp(a) } }, p = { name: SN(a) }; if (i && (d.hash.name = kp(i)), d.name === "RSASSA-PKCS1-v1_5") d.hash.name === "SHA-256" ? u.alg = "RS256" : d.hash.name === "SHA-384" ? u.alg = "RS384" : d.hash.name === "SHA-512" ? u.alg = "RS512" : d.hash.name === "SHA-1" && (u.alg = "RS1"); else if (d.name === "RSA-PSS") { let m = 0; d.hash.name === "SHA-256" ? (u.alg = "PS256", m = 32) : d.hash.name === "SHA-384" ? (u.alg = "PS384", m = 48) : d.hash.name === "SHA-512" && (u.alg = "PS512", m = 64), p.saltLength = m; } else throw new Error(`Unexpected RSA key algorithm ${a} (${d.name})`); const f = await wA({ keyData: u, algorithm: d }); return o.subtle.verify(p, f, n, r); } function PB(t) { const e = Vg(t); return [ e.slice(0, 8), // 8 e.slice(8, 12), // 4 e.slice(12, 16), // 4 e.slice(16, 20), // 4 e.slice(20, 32) // 8 ].join("-"); } function Co(t) { let e; if (typeof t == "string") if (Cp(t)) e = Zde(t); else if (epe(t)) e = t; else throw new Error("Certificate is not a valid base64 or base64url string"); else e = zi(t, "base64"); let n = ""; for (let r = 0; r < Math.ceil(e.length / 64); r += 1) { const i = 64 * r; n += `${e.substr(i, 64)} `; } return n = `-----BEGIN CERTIFICATE----- ${n}-----END CERTIFICATE----- `, n; } function SA(t) { const e = Wu(t), n = Uint8Array.from([4]), r = e.get(pt.x), i = e.get(pt.y); if (!r) throw new Error("COSE public key was missing x"); return yi(i ? [n, r, i] : [n, r]); } function Cpe(t) { return Tpe.stubThis(Wu(t)); } const Tpe = { stubThis: (t) => t }; function DB(t) { const e = Ip(t), n = JSON.parse(e); return kpe.stubThis(n); } const kpe = { stubThis: (t) => t }; function t1(t) { return Npe.stubThis(Wu(t)); } const Npe = { stubThis: (t) => t }; async function Ppe() { const t = new Uint8Array(32); return await TB(t), Dpe.stubThis(t); } const Dpe = { stubThis: (t) => t }; /*! * MIT License * * Copyright (c) 2017-2024 Peculiar Ventures, LLC * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ const Ope = "[object ArrayBuffer]"; class Ce { static isArrayBuffer(e) { return Object.prototype.toString.call(e) === Ope; } static toArrayBuffer(e) { return this.isArrayBuffer(e) ? e : e.byteLength === e.buffer.byteLength || e.byteOffset === 0 && e.byteLength === e.buffer.byteLength ? e.buffer : this.toUint8Array(e.buffer).slice(e.byteOffset, e.byteOffset + e.byteLength).buffer; } static toUint8Array(e) { return this.toView(e, Uint8Array); } static toView(e, n) { if (e.constructor === n) return e; if (this.isArrayBuffer(e)) return new n(e); if (this.isArrayBufferView(e)) return new n(e.buffer, e.byteOffset, e.byteLength); throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'"); } static isBufferSource(e) { return this.isArrayBufferView(e) || this.isArrayBuffer(e); } static isArrayBufferView(e) { return ArrayBuffer.isView(e) || e && this.isArrayBuffer(e.buffer); } static isEqual(e, n) { const r = Ce.toUint8Array(e), i = Ce.toUint8Array(n); if (r.length !== i.byteLength) return !1; for (let o = 0; o < r.length; o++) if (r[o] !== i[o]) return !1; return !0; } static concat(...e) { let n; Array.isArray(e[0]) && !(e[1] instanceof Function) || Array.isArray(e[0]) && e[1] instanceof Function ? n = e[0] : e[e.length - 1] instanceof Function ? n = e.slice(0, e.length - 1) : n = e; let r = 0; for (const a of n) r += a.byteLength; const i = new Uint8Array(r); let o = 0; for (const a of n) { const s = this.toUint8Array(a); i.set(s, o), o += s.length; } return e[e.length - 1] instanceof Function ? this.toView(i, e[e.length - 1]) : i.buffer; } } const bw = "string", Fpe = /^[0-9a-f\s]+$/i, Mpe = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/, Rpe = /^[a-zA-Z0-9-_]+$/; class _N { static fromString(e) { const n = unescape(encodeURIComponent(e)), r = new Uint8Array(n.length); for (let i = 0; i < n.length; i++) r[i] = n.charCodeAt(i); return r.buffer; } static toString(e) { const n = Ce.toUint8Array(e); let r = ""; for (let o = 0; o < n.length; o++) r += String.fromCharCode(n[o]); return decodeURIComponent(escape(r)); } } class qo { static toString(e, n = !1) { const r = Ce.toArrayBuffer(e), i = new DataView(r); let o = ""; for (let a = 0; a < r.byteLength; a += 2) { const s = i.getUint16(a, n); o += String.fromCharCode(s); } return o; } static fromString(e, n = !1) { const r = new ArrayBuffer(e.length * 2), i = new DataView(r); for (let o = 0; o < e.length; o++) i.setUint16(o * 2, e.charCodeAt(o), n); return r; } } class Le { static isHex(e) { return typeof e === bw && Fpe.test(e); } static isBase64(e) { return typeof e === bw && Mpe.test(e); } static isBase64Url(e) { return typeof e === bw && Rpe.test(e); } static ToString(e, n = "utf8") { const r = Ce.toUint8Array(e); switch (n.toLowerCase()) { case "utf8": return this.ToUtf8String(r); case "binary": return this.ToBinary(r); case "hex": return this.ToHex(r); case "base64": return this.ToBase64(r); case "base64url": return this.ToBase64Url(r); case "utf16le": return qo.toString(r, !0); case "utf16": case "utf16be": return qo.toString(r); default: throw new Error(`Unknown type of encoding '${n}'`); } } static FromString(e, n = "utf8") { if (!e) return new ArrayBuffer(0); switch (n.toLowerCase()) { case "utf8": return this.FromUtf8String(e); case "binary": return this.FromBinary(e); case "hex": return this.FromHex(e); case "base64": return this.FromBase64(e); case "base64url": return this.FromBase64Url(e); case "utf16le": return qo.fromString(e, !0); case "utf16": case "utf16be": return qo.fromString(e); default: throw new Error(`Unknown type of encoding '${n}'`); } } static ToBase64(e) { const n = Ce.toUint8Array(e); if (typeof btoa < "u") { const r = this.ToString(n, "binary"); return btoa(r); } else return Buffer.from(n).toString("base64"); } static FromBase64(e) { const n = this.formatString(e); if (!n) return new ArrayBuffer(0); if (!Le.isBase64(n)) throw new TypeError("Argument 'base64Text' is not Base64 encoded"); return typeof atob < "u" ? this.FromBinary(atob(n)) : new Uint8Array(Buffer.from(n, "base64")).buffer; } static FromBase64Url(e) { const n = this.formatString(e); if (!n) return new ArrayBuffer(0); if (!Le.isBase64Url(n)) throw new TypeError("Argument 'base64url' is not Base64Url encoded"); return this.FromBase64(this.Base64Padding(n.replace(/\-/g, "+").replace(/\_/g, "/"))); } static ToBase64Url(e) { return this.ToBase64(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, ""); } static FromUtf8String(e, n = Le.DEFAULT_UTF8_ENCODING) { switch (n) { case "ascii": return this.FromBinary(e); case "utf8": return _N.fromString(e); case "utf16": case "utf16be": return qo.fromString(e); case "utf16le": case "usc2": return qo.fromString(e, !0); default: throw new Error(`Unknown type of encoding '${n}'`); } } static ToUtf8String(e, n = Le.DEFAULT_UTF8_ENCODING) { switch (n) { case "ascii": return this.ToBinary(e); case "utf8": return _N.toString(e); case "utf16": case "utf16be": return qo.toString(e); case "utf16le": case "usc2": return qo.toString(e, !0); default: throw new Error(`Unknown type of encoding '${n}'`); } } static FromBinary(e) { const n = e.length, r = new Uint8Array(n); for (let i = 0; i < n; i++) r[i] = e.charCodeAt(i); return r.buffer; } static ToBinary(e) { const n = Ce.toUint8Array(e); let r = ""; for (let i = 0; i < n.length; i++) r += String.fromCharCode(n[i]); return r; } static ToHex(e) { const n = Ce.toUint8Array(e); let r = ""; const i = n.length; for (let o = 0; o < i; o++) { const a = n[o]; a < 16 && (r += "0"), r += a.toString(16); } return r; } static FromHex(e) { let n = this.formatString(e); if (!n) return new ArrayBuffer(0); if (!Le.isHex(n)) throw new TypeError("Argument 'hexString' is not HEX encoded"); n.length % 2 && (n = `0${n}`); const r = new Uint8Array(n.length / 2); for (let i = 0; i < n.length; i = i + 2) { const o = n.slice(i, i + 2); r[i / 2] = parseInt(o, 16); } return r.buffer; } static ToUtf16String(e, n = !1) { return qo.toString(e, n); } static FromUtf16String(e, n = !1) { return qo.fromString(e, n); } static Base64Padding(e) { const n = 4 - e.length % 4; if (n < 4) for (let r = 0; r < n; r++) e += "="; return e; } static formatString(e) { return e?.replace(/[\n\r\t ]/g, "") || ""; } } Le.DEFAULT_UTF8_ENCODING = "utf8"; function Bpe(...t) { const e = t.map((i) => i.byteLength).reduce((i, o) => i + o), n = new Uint8Array(e); let r = 0; return t.map((i) => new Uint8Array(i)).forEach((i) => { for (const o of i) n[r++] = o; }), n.buffer; } function OB(t, e) { if (!(t && e) || t.byteLength !== e.byteLength) return !1; const n = new Uint8Array(t), r = new Uint8Array(e); for (let i = 0; i < t.byteLength; i++) if (n[i] !== r[i]) return !1; return !0; } /*! Copyright (c) Peculiar Ventures, LLC */ function Ku(t, e) { let n = 0; if (t.length === 1) return t[0]; for (let r = t.length - 1; r >= 0; r--) n += t[t.length - 1 - r] * Math.pow(2, e * r); return n; } function Sc(t, e, n = -1) { const r = n; let i = t, o = 0, a = Math.pow(2, e); for (let s = 1; s < 8; s++) { if (t < a) { let c; if (r < 0) c = new ArrayBuffer(s), o = s; else { if (r < s) return new ArrayBuffer(0); c = new ArrayBuffer(r), o = r; } const u = new Uint8Array(c); for (let d = s - 1; d >= 0; d--) { const p = Math.pow(2, d * e); u[o - d - 1] = Math.floor(i / p), i -= u[o - d - 1] * p; } return c; } a *= Math.pow(2, e); } return new ArrayBuffer(0); } function XS(...t) { let e = 0, n = 0; for (const o of t) e += o.length; const r = new ArrayBuffer(e), i = new Uint8Array(r); for (const o of t) i.set(o, n), n += o.length; return i; } function FB() { const t = new Uint8Array(this.valueHex); if (this.valueHex.byteLength >= 2) { const s = t[0] === 255 && t[1] & 128, c = t[0] === 0 && (t[1] & 128) === 0; (s || c) && this.warnings.push("Needlessly long format"); } const e = new ArrayBuffer(this.valueHex.byteLength), n = new Uint8Array(e); for (let s = 0; s < this.valueHex.byteLength; s++) n[s] = 0; n[0] = t[0] & 128; const r = Ku(n, 8), i = new ArrayBuffer(this.valueHex.byteLength), o = new Uint8Array(i); for (let s = 0; s < this.valueHex.byteLength; s++) o[s] = t[s]; return o[0] &= 127, Ku(o, 8) - r; } function Upe(t) { const e = t < 0 ? t * -1 : t; let n = 128; for (let r = 1; r < 8; r++) { if (e <= n) { if (t < 0) { const a = n - e, s = Sc(a, 8, r), c = new Uint8Array(s); return c[0] |= 128, s; } let i = Sc(e, 8, r), o = new Uint8Array(i); if (o[0] & 128) { const a = i.slice(0), s = new Uint8Array(a); i = new ArrayBuffer(i.byteLength + 1), o = new Uint8Array(i); for (let c = 0; c < a.byteLength; c++) o[c + 1] = s[c]; o[0] = 0; } return i; } n *= Math.pow(2, 8); } return new ArrayBuffer(0); } function Lpe(t, e) { if (t.byteLength !== e.byteLength) return !1; const n = new Uint8Array(t), r = new Uint8Array(e); for (let i = 0; i < n.length; i++) if (n[i] !== r[i]) return !1; return !0; } function hi(t, e) { const n = t.toString(10); if (e < n.length) return ""; const r = e - n.length, i = new Array(r); for (let a = 0; a < r; a++) i[a] = "0"; return i.join("").concat(n); } /*! * Copyright (c) 2014, GMO GlobalSign * Copyright (c) 2015-2022, Peculiar Ventures * All rights reserved. * * Author 2014-2019, Yury Strozhevsky * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, this * list of conditions and the following disclaimer in the documentation and/or * other materials provided with the distribution. * * * Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ function gg() { if (typeof BigInt > "u") throw new Error("BigInt is not defined. Your environment doesn't implement BigInt."); } function _A(t) { let e = 0, n = 0; for (let i = 0; i < t.length; i++) { const o = t[i]; e += o.byteLength; } const r = new Uint8Array(e); for (let i = 0; i < t.length; i++) { const o = t[i]; r.set(new Uint8Array(o), n), n += o.byteLength; } return r.buffer; } function za(t, e, n, r) { return e instanceof Uint8Array ? e.byteLength ? n < 0 ? (t.error = "Wrong parameter: inputOffset less than zero", !1) : r < 0 ? (t.error = "Wrong parameter: inputLength less than zero", !1) : e.byteLength - n - r < 0 ? (t.error = "End of input reached before message was fully decoded (inconsistent offset and length values)", !1) : !0 : (t.error = "Wrong parameter: inputBuffer has zero length", !1) : (t.error = "Wrong parameter: inputBuffer must be 'Uint8Array'", !1); } class n1 { constructor() { this.items = []; } write(e) { this.items.push(e); } final() { return _A(this.items); } } const ld = [new Uint8Array([1])], EN = "0123456789", vw = "name", AN = "valueHexView", Qpe = "isHexOnly", jpe = "idBlock", $pe = "tagClass", Gpe = "tagNumber", qpe = "isConstructed", zpe = "fromBER", Hpe = "toBER", Wpe = "local", zr = "", Mo = new ArrayBuffer(0), r1 = new Uint8Array(0), Np = "EndOfContent", MB = "OCTET STRING", RB = "BIT STRING"; function ia(t) { var e; return e = class extends t { get valueHex() { return this.valueHexView.slice().buffer; } set valueHex(r) { this.valueHexView = new Uint8Array(r); } constructor(...r) { var i; super(...r); const o = r[0] || {}; this.isHexOnly = (i = o.isHexOnly) !== null && i !== void 0 ? i : !1, this.valueHexView = o.valueHex ? Ce.toUint8Array(o.valueHex) : r1; } fromBER(r, i, o) { const a = r instanceof ArrayBuffer ? new Uint8Array(r) : r; if (!za(this, a, i, o)) return -1; const s = i + o; return this.valueHexView = a.subarray(i, s), this.valueHexView.length ? (this.blockLength = o, s) : (this.warnings.push("Zero buffer length"), i); } toBER(r = !1) { return this.isHexOnly ? r ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.byteLength === this.valueHexView.buffer.byteLength ? this.valueHexView.buffer : this.valueHexView.slice().buffer : (this.error = "Flag 'isHexOnly' is not set, abort", Mo); } toJSON() { return { ...super.toJSON(), isHexOnly: this.isHexOnly, valueHex: Le.ToHex(this.valueHexView) }; } }, e.NAME = "hexBlock", e; } class Yc { static blockName() { return this.NAME; } get valueBeforeDecode() { return this.valueBeforeDecodeView.slice().buffer; } set valueBeforeDecode(e) { this.valueBeforeDecodeView = new Uint8Array(e); } constructor({ blockLength: e = 0, error: n = zr, warnings: r = [], valueBeforeDecode: i = r1 } = {}) { this.blockLength = e, this.error = n, this.warnings = r, this.valueBeforeDecodeView = Ce.toUint8Array(i); } toJSON() { return { blockName: this.constructor.NAME, blockLength: this.blockLength, error: this.error, warnings: this.warnings, valueBeforeDecode: Le.ToHex(this.valueBeforeDecodeView) }; } } Yc.NAME = "baseBlock"; class Qr extends Yc { fromBER(e, n, r) { throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'"); } toBER(e, n) { throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'"); } } Qr.NAME = "valueBlock"; class BB extends ia(Yc) { constructor({ idBlock: e = {} } = {}) { var n, r, i, o; super(), e ? (this.isHexOnly = (n = e.isHexOnly) !== null && n !== void 0 ? n : !1, this.valueHexView = e.valueHex ? Ce.toUint8Array(e.valueHex) : r1, this.tagClass = (r = e.tagClass) !== null && r !== void 0 ? r : -1, this.tagNumber = (i = e.tagNumber) !== null && i !== void 0 ? i : -1, this.isConstructed = (o = e.isConstructed) !== null && o !== void 0 ? o : !1) : (this.tagClass = -1, this.tagNumber = -1, this.isConstructed = !1); } toBER(e = !1) { let n = 0; switch (this.tagClass) { case 1: n |= 0; break; case 2: n |= 64; break; case 3: n |= 128; break; case 4: n |= 192; break; default: return this.error = "Unknown tag class", Mo; } if (this.isConstructed && (n |= 32), this.tagNumber < 31 && !this.isHexOnly) { const i = new Uint8Array(1); if (!e) { let o = this.tagNumber; o &= 31, n |= o, i[0] = n; } return i.buffer; } if (!this.isHexOnly) { const i = Sc(this.tagNumber, 7), o = new Uint8Array(i), a = i.byteLength, s = new Uint8Array(a + 1); if (s[0] = n | 31, !e) { for (let c = 0; c < a - 1; c++) s[c + 1] = o[c] | 128; s[a] = o[a - 1]; } return s.buffer; } const r = new Uint8Array(this.valueHexView.byteLength + 1); if (r[0] = n | 31, !e) { const i = this.valueHexView; for (let o = 0; o < i.length - 1; o++) r[o + 1] = i[o] | 128; r[this.valueHexView.byteLength] = i[i.length - 1]; } return r.buffer; } fromBER(e, n, r) { const i = Ce.toUint8Array(e); if (!za(this, i, n, r)) return -1; const o = i.subarray(n, n + r); if (o.length === 0) return this.error = "Zero buffer length", -1; switch (o[0] & 192) { case 0: this.tagClass = 1; break; case 64: this.tagClass = 2; break; case 128: this.tagClass = 3; break; case 192: this.tagClass = 4; break; default: return this.error = "Unknown tag class", -1; } this.isConstructed = (o[0] & 32) === 32, this.isHexOnly = !1; const s = o[0] & 31; if (s !== 31) this.tagNumber = s, this.blockLength = 1; else { let c = 1, u = this.valueHexView = new Uint8Array(255), d = 255; for (; o[c] & 128; ) { if (u[c - 1] = o[c] & 127, c++, c >= o.length) return this.error = "End of input reached before message was fully decoded", -1; if (c === d) { d += 255; const f = new Uint8Array(d); for (let m = 0; m < u.length; m++) f[m] = u[m]; u = this.valueHexView = new Uint8Array(d); } } this.blockLength = c + 1, u[c - 1] = o[c] & 127; const p = new Uint8Array(c); for (let f = 0; f < c; f++) p[f] = u[f]; u = this.valueHexView = new Uint8Array(c), u.set(p), this.blockLength <= 9 ? this.tagNumber = Ku(u, 7) : (this.isHexOnly = !0, this.warnings.push("Tag too long, represented as hex-coded")); } if (this.tagClass === 1 && this.isConstructed) switch (this.tagNumber) { case 1: case 2: case 5: case 6: case 9: case 13: case 14: case 23: case 24: case 31: case 32: case 33: case 34: return this.error = "Constructed encoding used for primitive type", -1; } return n + this.blockLength; } toJSON() { return { ...super.toJSON(), tagClass: this.tagClass, tagNumber: this.tagNumber, isConstructed: this.isConstructed }; } } BB.NAME = "identificationBlock"; class UB extends Yc { constructor({ lenBlock: e = {} } = {}) { var n, r, i; super(), this.isIndefiniteForm = (n = e.isIndefiniteForm) !== null && n !== void 0 ? n : !1, this.longFormUsed = (r = e.longFormUsed) !== null && r !== void 0 ? r : !1, this.length = (i = e.length) !== null && i !== void 0 ? i : 0; } fromBER(e, n, r) { const i = Ce.toUint8Array(e); if (!za(this, i, n, r)) return -1; const o = i.subarray(n, n + r); if (o.length === 0) return this.error = "Zero buffer length", -1; if (o[0] === 255) return this.error = "Length block 0xFF is reserved by standard", -1; if (this.isIndefiniteForm = o[0] === 128, this.isIndefiniteForm) return this.blockLength = 1, n + this.blockLength; if (this.longFormUsed = !!(o[0] & 128), this.longFormUsed === !1) return this.length = o[0], this.blockLength = 1, n + this.blockLength; const a = o[0] & 127; if (a > 8) return this.error = "Too big integer", -1; if (a + 1 > o.length) return this.error = "End of input reached before message was fully decoded", -1; const s = n + 1, c = i.subarray(s, s + a); return c[a - 1] === 0 && this.warnings.push("Needlessly long encoded length"), this.length = Ku(c, 8), this.longFormUsed && this.length <= 127 && this.warnings.push("Unnecessary usage of long length form"), this.blockLength = a + 1, n + this.blockLength; } toBER(e = !1) { let n, r; if (this.length > 127 && (this.longFormUsed = !0), this.isIndefiniteForm) return n = new ArrayBuffer(1), e === !1 && (r = new Uint8Array(n), r[0] = 128), n; if (this.longFormUsed) { const i = Sc(this.length, 8); if (i.byteLength > 127) return this.error = "Too big length", Mo; if (n = new ArrayBuffer(i.byteLength + 1), e) return n; const o = new Uint8Array(i); r = new Uint8Array(n), r[0] = i.byteLength | 128; for (let a = 0; a < i.byteLength; a++) r[a + 1] = o[a]; return n; } return n = new ArrayBuffer(1), e === !1 && (r = new Uint8Array(n), r[0] = this.length), n; } toJSON() { return { ...super.toJSON(), isIndefiniteForm: this.isIndefiniteForm, longFormUsed: this.longFormUsed, length: this.length }; } } UB.NAME = "lengthBlock"; const Re = {}; class br extends Yc { constructor({ name: e = zr, optional: n = !1, primitiveSchema: r, ...i } = {}, o) { super(i), this.name = e, this.optional = n, r && (this.primitiveSchema = r), this.idBlock = new BB(i), this.lenBlock = new UB(i), this.valueBlock = o ? new o(i) : new Qr(i); } fromBER(e, n, r) { const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length); return i === -1 ? (this.error = this.valueBlock.error, i) : (this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i); } toBER(e, n) { const r = n || new n1(); n || LB(this); const i = this.idBlock.toBER(e); if (r.write(i), this.lenBlock.isIndefiniteForm) r.write(new Uint8Array([128]).buffer), this.valueBlock.toBER(e, r), r.write(new ArrayBuffer(2)); else { const o = this.valueBlock.toBER(e); this.lenBlock.length = o.byteLength; const a = this.lenBlock.toBER(e); r.write(a), r.write(o); } return n ? Mo : r.final(); } toJSON() { const e = { ...super.toJSON(), idBlock: this.idBlock.toJSON(), lenBlock: this.lenBlock.toJSON(), valueBlock: this.valueBlock.toJSON(), name: this.name, optional: this.optional }; return this.primitiveSchema && (e.primitiveSchema = this.primitiveSchema.toJSON()), e; } toString(e = "ascii") { return e === "ascii" ? this.onAsciiEncoding() : Le.ToHex(this.toBER()); } onAsciiEncoding() { const e = this.constructor.NAME, n = Le.ToHex(this.valueBlock.valueBeforeDecodeView); return `${e} : ${n}`; } isEqual(e) { if (this === e) return !0; if (!(e instanceof this.constructor)) return !1; const n = this.toBER(), r = e.toBER(); return Lpe(n, r); } } br.NAME = "BaseBlock"; function LB(t) { var e; if (t instanceof Re.Constructed) for (const n of t.valueBlock.value) LB(n) && (t.lenBlock.isIndefiniteForm = !0); return !!(!((e = t.lenBlock) === null || e === void 0) && e.isIndefiniteForm); } class EA extends br { getValue() { return this.valueBlock.value; } setValue(e) { this.valueBlock.value = e; } constructor({ value: e = zr, ...n } = {}, r) { super(n, r), e && this.fromString(e); } fromBER(e, n, r) { const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length); return i === -1 ? (this.error = this.valueBlock.error, i) : (this.fromBuffer(this.valueBlock.valueHexView), this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i); } onAsciiEncoding() { return `${this.constructor.NAME} : '${this.valueBlock.value}'`; } } EA.NAME = "BaseStringBlock"; class QB extends ia(Qr) { constructor({ isHexOnly: e = !0, ...n } = {}) { super(n), this.isHexOnly = e; } } QB.NAME = "PrimitiveValueBlock"; var jB; class Af extends br { constructor(e = {}) { super(e, QB), this.idBlock.isConstructed = !1; } } jB = Af; Re.Primitive = jB; Af.NAME = "PRIMITIVE"; function Kpe(t, e) { if (t instanceof e) return t; const n = new e(); return n.idBlock = t.idBlock, n.lenBlock = t.lenBlock, n.warnings = t.warnings, n.valueBeforeDecodeView = t.valueBeforeDecodeView, n; } function Bl(t, e = 0, n = t.length) { const r = e; let i = new br({}, Qr); const o = new Yc(); if (!za(o, t, e, n)) return i.error = o.error, { offset: -1, result: i }; if (!t.subarray(e, e + n).length) return i.error = "Zero buffer length", { offset: -1, result: i }; let s = i.idBlock.fromBER(t, e, n); if (i.idBlock.warnings.length && i.warnings.concat(i.idBlock.warnings), s === -1) return i.error = i.idBlock.error, { offset: -1, result: i }; if (e = s, n -= i.idBlock.blockLength, s = i.lenBlock.fromBER(t, e, n), i.lenBlock.warnings.length && i.warnings.concat(i.lenBlock.warnings), s === -1) return i.error = i.lenBlock.error, { offset: -1, result: i }; if (e = s, n -= i.lenBlock.blockLength, !i.idBlock.isConstructed && i.lenBlock.isIndefiniteForm) return i.error = "Indefinite length form used for primitive encoding form", { offset: -1, result: i }; let c = br; switch (i.idBlock.tagClass) { case 1: if (i.idBlock.tagNumber >= 37 && i.idBlock.isHexOnly === !1) return i.error = "UNIVERSAL 37 and upper tags are reserved by ASN.1 standard", { offset: -1, result: i }; switch (i.idBlock.tagNumber) { case 0: if (i.idBlock.isConstructed && i.lenBlock.length > 0) return i.error = "Type [UNIVERSAL 0] is reserved", { offset: -1, result: i }; c = Re.EndOfContent; break; case 1: c = Re.Boolean; break; case 2: c = Re.Integer; break; case 3: c = Re.BitString; break; case 4: c = Re.OctetString; break; case 5: c = Re.Null; break; case 6: c = Re.ObjectIdentifier; break; case 10: c = Re.Enumerated; break; case 12: c = Re.Utf8String; break; case 13: c = Re.RelativeObjectIdentifier; break; case 14: c = Re.TIME; break; case 15: return i.error = "[UNIVERSAL 15] is reserved by ASN.1 standard", { offset: -1, result: i }; case 16: c = Re.Sequence; break; case 17: c = Re.Set; break; case 18: c = Re.NumericString; break; case 19: c = Re.PrintableString; break; case 20: c = Re.TeletexString; break; case 21: c = Re.VideotexString; break; case 22: c = Re.IA5String; break; case 23: c = Re.UTCTime; break; case 24: c = Re.GeneralizedTime; break; case 25: c = Re.GraphicString; break; case 26: c = Re.VisibleString; break; case 27: c = Re.GeneralString; break; case 28: c = Re.UniversalString; break; case 29: c = Re.CharacterString; break; case 30: c = Re.BmpString; break; case 31: c = Re.DATE; break; case 32: c = Re.TimeOfDay; break; case 33: c = Re.DateTime; break; case 34: c = Re.Duration; break; default: { const u = i.idBlock.isConstructed ? new Re.Constructed() : new Re.Primitive(); u.idBlock = i.idBlock, u.lenBlock = i.lenBlock, u.warnings = i.warnings, i = u; } } break; case 2: case 3: case 4: default: c = i.idBlock.isConstructed ? Re.Constructed : Re.Primitive; } return i = Kpe(i, c), s = i.fromBER(t, e, i.lenBlock.isIndefiniteForm ? n : i.lenBlock.length), i.valueBeforeDecodeView = t.subarray(r, r + i.blockLength), { offset: s, result: i }; } function Pu(t) { if (!t.byteLength) { const e = new br({}, Qr); return e.error = "Input buffer has zero length", { offset: -1, result: e }; } return Bl(Ce.toUint8Array(t).slice(), 0, t.byteLength); } function Vpe(t, e) { return t ? 1 : e; } class vs extends Qr { constructor({ value: e = [], isIndefiniteForm: n = !1, ...r } = {}) { super(r), this.value = e, this.isIndefiniteForm = n; } fromBER(e, n, r) { const i = Ce.toUint8Array(e); if (!za(this, i, n, r)) return -1; if (this.valueBeforeDecodeView = i.subarray(n, n + r), this.valueBeforeDecodeView.length === 0) return this.warnings.push("Zero buffer length"), n; let o = n; for (; Vpe(this.isIndefiniteForm, r) > 0; ) { const a = Bl(i, o, r); if (a.offset === -1) return this.error = a.result.error, this.warnings.concat(a.result.warnings), -1; if (o = a.offset, this.blockLength += a.result.blockLength, r -= a.result.blockLength, this.value.push(a.result), this.isIndefiniteForm && a.result.constructor.NAME === Np) break; } return this.isIndefiniteForm && (this.value[this.value.length - 1].constructor.NAME === Np ? this.value.pop() : this.warnings.push("No EndOfContent block encoded")), o; } toBER(e, n) { const r = n || new n1(); for (let i = 0; i < this.value.length; i++) this.value[i].toBER(e, r); return n ? Mo : r.final(); } toJSON() { const e = { ...super.toJSON(), isIndefiniteForm: this.isIndefiniteForm, value: [] }; for (const n of this.value) e.value.push(n.toJSON()); return e; } } vs.NAME = "ConstructedValueBlock"; var $B; class Ur extends br { constructor(e = {}) { super(e, vs), this.idBlock.isConstructed = !0; } fromBER(e, n, r) { this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm; const i = this.valueBlock.fromBER(e, n, this.lenBlock.isIndefiniteForm ? r : this.lenBlock.length); return i === -1 ? (this.error = this.valueBlock.error, i) : (this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.valueBlock.error.length || (this.blockLength += this.valueBlock.blockLength), i); } onAsciiEncoding() { const e = []; for (const r of this.valueBlock.value) e.push(r.toString("ascii").split(` `).map((i) => ` ${i}`).join(` `)); const n = this.idBlock.tagClass === 3 ? `[${this.idBlock.tagNumber}]` : this.constructor.NAME; return e.length ? `${n} : ${e.join(` `)}` : `${n} :`; } } $B = Ur; Re.Constructed = $B; Ur.NAME = "CONSTRUCTED"; class GB extends Qr { fromBER(e, n, r) { return n; } toBER(e) { return Mo; } } GB.override = "EndOfContentValueBlock"; var qB; class AA extends br { constructor(e = {}) { super(e, GB), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 0; } } qB = AA; Re.EndOfContent = qB; AA.NAME = Np; var zB; class _c extends br { constructor(e = {}) { super(e, Qr), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 5; } fromBER(e, n, r) { return this.lenBlock.length > 0 && this.warnings.push("Non-zero length of value block for Null type"), this.idBlock.error.length || (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length || (this.blockLength += this.lenBlock.blockLength), this.blockLength += r, n + r > e.byteLength ? (this.error = "End of input reached before message was fully decoded (inconsistent offset and length values)", -1) : n + r; } toBER(e, n) { const r = new ArrayBuffer(2); if (!e) { const i = new Uint8Array(r); i[0] = 5, i[1] = 0; } return n && n.write(r), r; } onAsciiEncoding() { return `${this.constructor.NAME}`; } } zB = _c; Re.Null = zB; _c.NAME = "NULL"; class HB extends ia(Qr) { get value() { for (const e of this.valueHexView) if (e > 0) return !0; return !1; } set value(e) { this.valueHexView[0] = e ? 255 : 0; } constructor({ value: e, ...n } = {}) { super(n), n.valueHex ? this.valueHexView = Ce.toUint8Array(n.valueHex) : this.valueHexView = new Uint8Array(1), e && (this.value = e); } fromBER(e, n, r) { const i = Ce.toUint8Array(e); return za(this, i, n, r) ? (this.valueHexView = i.subarray(n, n + r), r > 1 && this.warnings.push("Boolean value encoded in more then 1 octet"), this.isHexOnly = !0, FB.call(this), this.blockLength = r, n + r) : -1; } toBER() { return this.valueHexView.slice(); } toJSON() { return { ...super.toJSON(), value: this.value }; } } HB.NAME = "BooleanValueBlock"; var WB; let i1 = class extends br { getValue() { return this.valueBlock.value; } setValue(e) { this.valueBlock.value = e; } constructor(e = {}) { super(e, HB), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 1; } onAsciiEncoding() { return `${this.constructor.NAME} : ${this.getValue}`; } }; WB = i1; Re.Boolean = WB; i1.NAME = "BOOLEAN"; class KB extends ia(vs) { constructor({ isConstructed: e = !1, ...n } = {}) { super(n), this.isConstructed = e; } fromBER(e, n, r) { let i = 0; if (this.isConstructed) { if (this.isHexOnly = !1, i = vs.prototype.fromBER.call(this, e, n, r), i === -1) return i; for (let o = 0; o < this.value.length; o++) { const a = this.value[o].constructor.NAME; if (a === Np) { if (this.isIndefiniteForm) break; return this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only", -1; } if (a !== MB) return this.error = "OCTET STRING may consists of OCTET STRINGs only", -1; } } else this.isHexOnly = !0, i = super.fromBER(e, n, r), this.blockLength = r; return i; } toBER(e, n) { return this.isConstructed ? vs.prototype.toBER.call(this, e, n) : e ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.slice().buffer; } toJSON() { return { ...super.toJSON(), isConstructed: this.isConstructed }; } } KB.NAME = "OctetStringValueBlock"; var IA; let fc = class extends br { constructor({ idBlock: e = {}, lenBlock: n = {}, ...r } = {}) { var i, o; (i = r.isConstructed) !== null && i !== void 0 || (r.isConstructed = !!(!((o = r.value) === null || o === void 0) && o.length)), super({ idBlock: { isConstructed: r.isConstructed, ...e }, lenBlock: { ...n, isIndefiniteForm: !!r.isIndefiniteForm }, ...r }, KB), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 4; } fromBER(e, n, r) { if (this.valueBlock.isConstructed = this.idBlock.isConstructed, this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm, r === 0) return this.idBlock.error.length === 0 && (this.blockLength += this.idBlock.blockLength), this.lenBlock.error.length === 0 && (this.blockLength += this.lenBlock.blockLength), n; if (!this.valueBlock.isConstructed) { const o = (e instanceof ArrayBuffer ? new Uint8Array(e) : e).subarray(n, n + r); try { if (o.byteLength) { const a = Bl(o, 0, o.byteLength); a.offset !== -1 && a.offset === r && (this.valueBlock.value = [a.result]); } } catch { } } return super.fromBER(e, n, r); } onAsciiEncoding() { if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length) return Ur.prototype.onAsciiEncoding.call(this); const e = this.constructor.NAME, n = Le.ToHex(this.valueBlock.valueHexView); return `${e} : ${n}`; } getValue() { if (!this.idBlock.isConstructed) return this.valueBlock.valueHexView.slice().buffer; const e = []; for (const n of this.valueBlock.value) n instanceof IA && e.push(n.valueBlock.valueHexView); return Ce.concat(e); } }; IA = fc; Re.OctetString = IA; fc.NAME = MB; class VB extends ia(vs) { constructor({ unusedBits: e = 0, isConstructed: n = !1, ...r } = {}) { super(r), this.unusedBits = e, this.isConstructed = n, this.blockLength = this.valueHexView.byteLength; } fromBER(e, n, r) { if (!r) return n; let i = -1; if (this.isConstructed) { if (i = vs.prototype.fromBER.call(this, e, n, r), i === -1) return i; for (const s of this.value) { const c = s.constructor.NAME; if (c === Np) { if (this.isIndefiniteForm) break; return this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only", -1; } if (c !== RB) return this.error = "BIT STRING may consists of BIT STRINGs only", -1; const u = s.valueBlock; if (this.unusedBits > 0 && u.unusedBits > 0) return this.error = 'Using of "unused bits" inside constructive BIT STRING allowed for least one only', -1; this.unusedBits = u.unusedBits; } return i; } const o = Ce.toUint8Array(e); if (!za(this, o, n, r)) return -1; const a = o.subarray(n, n + r); if (this.unusedBits = a[0], this.unusedBits > 7) return this.error = "Unused bits for BitString must be in range 0-7", -1; if (!this.unusedBits) { const s = a.subarray(1); try { if (s.byteLength) { const c = Bl(s, 0, s.byteLength); c.offset !== -1 && c.offset === r - 1 && (this.value = [c.result]); } } catch { } } return this.valueHexView = a.subarray(1), this.blockLength = a.length, n + r; } toBER(e, n) { if (this.isConstructed) return vs.prototype.toBER.call(this, e, n); if (e) return new ArrayBuffer(this.valueHexView.byteLength + 1); if (!this.valueHexView.byteLength) return Mo; const r = new Uint8Array(this.valueHexView.length + 1); return r[0] = this.unusedBits, r.set(this.valueHexView, 1), r.buffer; } toJSON() { return { ...super.toJSON(), unusedBits: this.unusedBits, isConstructed: this.isConstructed }; } } VB.NAME = "BitStringValueBlock"; var YB; let hc = class extends br { constructor({ idBlock: e = {}, lenBlock: n = {}, ...r } = {}) { var i, o; (i = r.isConstructed) !== null && i !== void 0 || (r.isConstructed = !!(!((o = r.value) === null || o === void 0) && o.length)), super({ idBlock: { isConstructed: r.isConstructed, ...e }, lenBlock: { ...n, isIndefiniteForm: !!r.isIndefiniteForm }, ...r }, VB), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 3; } fromBER(e, n, r) { return this.valueBlock.isConstructed = this.idBlock.isConstructed, this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm, super.fromBER(e, n, r); } onAsciiEncoding() { if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length) return Ur.prototype.onAsciiEncoding.call(this); { const e = [], n = this.valueBlock.valueHexView; for (const a of n) e.push(a.toString(2).padStart(8, "0")); const r = e.join(""), i = this.constructor.NAME, o = r.substring(0, r.length - this.valueBlock.unusedBits); return `${i} : ${o}`; } } }; YB = hc; Re.BitString = YB; hc.NAME = RB; var JB; function Ype(t, e) { const n = new Uint8Array([0]), r = new Uint8Array(t), i = new Uint8Array(e); let o = r.slice(0); const a = o.length - 1, s = i.slice(0), c = s.length - 1; let u = 0; const d = c < a ? a : c; let p = 0; for (let f = d; f >= 0; f--, p++) { switch (!0) { case p < s.length: u = o[a - p] + s[c - p] + n[0]; break; default: u = o[a - p] + n[0]; } switch (n[0] = u / 10, !0) { case p >= o.length: o = XS(new Uint8Array([u % 10]), o); break; default: o[a - p] = u % 10; } } return n[0] > 0 && (o = XS(n, o)), o; } function IN(t) { if (t >= ld.length) for (let e = ld.length; e <= t; e++) { const n = new Uint8Array([0]); let r = ld[e - 1].slice(0); for (let i = r.length - 1; i >= 0; i--) { const o = new Uint8Array([(r[i] << 1) + n[0]]); n[0] = o[0] / 10, r[i] = o[0] % 10; } n[0] > 0 && (r = XS(n, r)), ld.push(r); } return ld[t]; } function Jpe(t, e) { let n = 0; const r = new Uint8Array(t), i = new Uint8Array(e), o = r.slice(0), a = o.length - 1, s = i.slice(0), c = s.length - 1; let u, d = 0; for (let p = c; p >= 0; p--, d++) switch (u = o[a - d] - s[c - d] - n, !0) { case u < 0: n = 1, o[a - d] = u + 10; break; default: n = 0, o[a - d] = u; } if (n > 0) for (let p = a - c + 1; p >= 0; p--, d++) if (u = o[a - d] - n, u < 0) n = 1, o[a - d] = u + 10; else { n = 0, o[a - d] = u; break; } return o.slice(); } class CA extends ia(Qr) { setValueHex() { this.valueHexView.length >= 4 ? (this.warnings.push("Too big Integer for decoding, hex only"), this.isHexOnly = !0, this._valueDec = 0) : (this.isHexOnly = !1, this.valueHexView.length > 0 && (this._valueDec = FB.call(this))); } constructor({ value: e, ...n } = {}) { super(n), this._valueDec = 0, n.valueHex && this.setValueHex(), e !== void 0 && (this.valueDec = e); } set valueDec(e) { this._valueDec = e, this.isHexOnly = !1, this.valueHexView = new Uint8Array(Upe(e)); } get valueDec() { return this._valueDec; } fromDER(e, n, r, i = 0) { const o = this.fromBER(e, n, r); if (o === -1) return o; const a = this.valueHexView; return a[0] === 0 && (a[1] & 128) !== 0 ? this.valueHexView = a.subarray(1) : i !== 0 && a.length < i && (i - a.length > 1 && (i = a.length + 1), this.valueHexView = a.subarray(i - a.length)), o; } toDER(e = !1) { const n = this.valueHexView; switch (!0) { case (n[0] & 128) !== 0: { const r = new Uint8Array(this.valueHexView.length + 1); r[0] = 0, r.set(n, 1), this.valueHexView = r; } break; case (n[0] === 0 && (n[1] & 128) === 0): this.valueHexView = this.valueHexView.subarray(1); break; } return this.toBER(e); } fromBER(e, n, r) { const i = super.fromBER(e, n, r); return i === -1 || this.setValueHex(), i; } toBER(e) { return e ? new ArrayBuffer(this.valueHexView.length) : this.valueHexView.slice().buffer; } toJSON() { return { ...super.toJSON(), valueDec: this.valueDec }; } toString() { const e = this.valueHexView.length * 8 - 1; let n = new Uint8Array(this.valueHexView.length * 8 / 3), r = 0, i; const o = this.valueHexView; let a = "", s = !1; for (let c = o.byteLength - 1; c >= 0; c--) { i = o[c]; for (let u = 0; u < 8; u++) { if ((i & 1) === 1) switch (r) { case e: n = Jpe(IN(r), n), a = "-"; break; default: n = Ype(n, IN(r)); } r++, i >>= 1; } } for (let c = 0; c < n.length; c++) n[c] && (s = !0), s && (a += EN.charAt(n[c])); return s === !1 && (a += EN.charAt(0)), a; } } JB = CA; CA.NAME = "IntegerValueBlock"; Object.defineProperty(JB.prototype, "valueHex", { set: function(t) { this.valueHexView = new Uint8Array(t), this.setValueHex(); }, get: function() { return this.valueHexView.slice().buffer; } }); var sp; class Ul extends br { constructor(e = {}) { super(e, CA), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 2; } toBigInt() { return gg(), BigInt(this.valueBlock.toString()); } static fromBigInt(e) { gg(); const n = BigInt(e), r = new n1(), i = n.toString(16).replace(/^-/, ""), o = new Uint8Array(Le.FromHex(i)); if (n < 0) { const s = new Uint8Array(o.length + (o[0] & 128 ? 1 : 0)); s[0] |= 128; const u = BigInt(`0x${Le.ToHex(s)}`) + n, d = Ce.toUint8Array(Le.FromHex(u.toString(16))); d[0] |= 128, r.write(d); } else o[0] & 128 && r.write(new Uint8Array([0])), r.write(o); return new sp({ valueHex: r.final() }); } convertToDER() { const e = new sp({ valueHex: this.valueBlock.valueHexView }); return e.valueBlock.toDER(), e; } convertFromDER() { return new sp({ valueHex: this.valueBlock.valueHexView[0] === 0 ? this.valueBlock.valueHexView.subarray(1) : this.valueBlock.valueHexView }); } onAsciiEncoding() { return `${this.constructor.NAME} : ${this.valueBlock.toString()}`; } } sp = Ul; Re.Integer = sp; Ul.NAME = "INTEGER"; var XB; class o1 extends Ul { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 10; } } XB = o1; Re.Enumerated = XB; o1.NAME = "ENUMERATED"; class ZS extends ia(Qr) { constructor({ valueDec: e = -1, isFirstSid: n = !1, ...r } = {}) { super(r), this.valueDec = e, this.isFirstSid = n; } fromBER(e, n, r) { if (!r) return n; const i = Ce.toUint8Array(e); if (!za(this, i, n, r)) return -1; const o = i.subarray(n, n + r); this.valueHexView = new Uint8Array(r); for (let s = 0; s < r && (this.valueHexView[s] = o[s] & 127, this.blockLength++, (o[s] & 128) !== 0); s++) ; const a = new Uint8Array(this.blockLength); for (let s = 0; s < this.blockLength; s++) a[s] = this.valueHexView[s]; return this.valueHexView = a, (o[this.blockLength - 1] & 128) !== 0 ? (this.error = "End of input reached before message was fully decoded", -1) : (this.valueHexView[0] === 0 && this.warnings.push("Needlessly long format of SID encoding"), this.blockLength <= 8 ? this.valueDec = Ku(this.valueHexView, 7) : (this.isHexOnly = !0, this.warnings.push("Too big SID for decoding, hex only")), n + this.blockLength); } set valueBigInt(e) { gg(); let n = BigInt(e).toString(2); for (; n.length % 7; ) n = "0" + n; const r = new Uint8Array(n.length / 7); for (let i = 0; i < r.length; i++) r[i] = parseInt(n.slice(i * 7, i * 7 + 7), 2) + (i + 1 < r.length ? 128 : 0); this.fromBER(r.buffer, 0, r.length); } toBER(e) { if (this.isHexOnly) { if (e) return new ArrayBuffer(this.valueHexView.byteLength); const i = this.valueHexView, o = new Uint8Array(this.blockLength); for (let a = 0; a < this.blockLength - 1; a++) o[a] = i[a] | 128; return o[this.blockLength - 1] = i[this.blockLength - 1], o.buffer; } const n = Sc(this.valueDec, 7); if (n.byteLength === 0) return this.error = "Error during encoding SID value", Mo; const r = new Uint8Array(n.byteLength); if (!e) { const i = new Uint8Array(n), o = n.byteLength - 1; for (let a = 0; a < o; a++) r[a] = i[a] | 128; r[o] = i[o]; } return r; } toString() { let e = ""; if (this.isHexOnly) e = Le.ToHex(this.valueHexView); else if (this.isFirstSid) { let n = this.valueDec; this.valueDec <= 39 ? e = "0." : this.valueDec <= 79 ? (e = "1.", n -= 40) : (e = "2.", n -= 80), e += n.toString(); } else e = this.valueDec.toString(); return e; } toJSON() { return { ...super.toJSON(), valueDec: this.valueDec, isFirstSid: this.isFirstSid }; } } ZS.NAME = "sidBlock"; class ZB extends Qr { constructor({ value: e = zr, ...n } = {}) { super(n), this.value = [], e && this.fromString(e); } fromBER(e, n, r) { let i = n; for (; r > 0; ) { const o = new ZS(); if (i = o.fromBER(e, i, r), i === -1) return this.blockLength = 0, this.error = o.error, i; this.value.length === 0 && (o.isFirstSid = !0), this.blockLength += o.blockLength, r -= o.blockLength, this.value.push(o); } return i; } toBER(e) { const n = []; for (let r = 0; r < this.value.length; r++) { const i = this.value[r].toBER(e); if (i.byteLength === 0) return this.error = this.value[r].error, Mo; n.push(i); } return _A(n); } fromString(e) { this.value = []; let n = 0, r = 0, i = "", o = !1; do if (r = e.indexOf(".", n), r === -1 ? i = e.substring(n) : i = e.substring(n, r), n = r + 1, o) { const a = this.value[0]; let s = 0; switch (a.valueDec) { case 0: break; case 1: s = 40; break; case 2: s = 80; break; default: this.value = []; return; } const c = parseInt(i, 10); if (isNaN(c)) return; a.valueDec = c + s, o = !1; } else { const a = new ZS(); if (i > Number.MAX_SAFE_INTEGER) { gg(); const s = BigInt(i); a.valueBigInt = s; } else if (a.valueDec = parseInt(i, 10), isNaN(a.valueDec)) return; this.value.length || (a.isFirstSid = !0, o = !0), this.value.push(a); } while (r !== -1); } toString() { let e = "", n = !1; for (let r = 0; r < this.value.length; r++) { n = this.value[r].isHexOnly; let i = this.value[r].toString(); r !== 0 && (e = `${e}.`), n ? (i = `{${i}}`, this.value[r].isFirstSid ? e = `2.{${i} - 80}` : e += i) : e += i; } return e; } toJSON() { const e = { ...super.toJSON(), value: this.toString(), sidArray: [] }; for (let n = 0; n < this.value.length; n++) e.sidArray.push(this.value[n].toJSON()); return e; } } ZB.NAME = "ObjectIdentifierValueBlock"; var e9; class a1 extends br { getValue() { return this.valueBlock.toString(); } setValue(e) { this.valueBlock.fromString(e); } constructor(e = {}) { super(e, ZB), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 6; } onAsciiEncoding() { return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`; } toJSON() { return { ...super.toJSON(), value: this.getValue() }; } } e9 = a1; Re.ObjectIdentifier = e9; a1.NAME = "OBJECT IDENTIFIER"; class e_ extends ia(Yc) { constructor({ valueDec: e = 0, ...n } = {}) { super(n), this.valueDec = e; } fromBER(e, n, r) { if (r === 0) return n; const i = Ce.toUint8Array(e); if (!za(this, i, n, r)) return -1; const o = i.subarray(n, n + r); this.valueHexView = new Uint8Array(r); for (let s = 0; s < r && (this.valueHexView[s] = o[s] & 127, this.blockLength++, (o[s] & 128) !== 0); s++) ; const a = new Uint8Array(this.blockLength); for (let s = 0; s < this.blockLength; s++) a[s] = this.valueHexView[s]; return this.valueHexView = a, (o[this.blockLength - 1] & 128) !== 0 ? (this.error = "End of input reached before message was fully decoded", -1) : (this.valueHexView[0] === 0 && this.warnings.push("Needlessly long format of SID encoding"), this.blockLength <= 8 ? this.valueDec = Ku(this.valueHexView, 7) : (this.isHexOnly = !0, this.warnings.push("Too big SID for decoding, hex only")), n + this.blockLength); } toBER(e) { if (this.isHexOnly) { if (e) return new ArrayBuffer(this.valueHexView.byteLength); const i = this.valueHexView, o = new Uint8Array(this.blockLength); for (let a = 0; a < this.blockLength - 1; a++) o[a] = i[a] | 128; return o[this.blockLength - 1] = i[this.blockLength - 1], o.buffer; } const n = Sc(this.valueDec, 7); if (n.byteLength === 0) return this.error = "Error during encoding SID value", Mo; const r = new Uint8Array(n.byteLength); if (!e) { const i = new Uint8Array(n), o = n.byteLength - 1; for (let a = 0; a < o; a++) r[a] = i[a] | 128; r[o] = i[o]; } return r.buffer; } toString() { let e = ""; return this.isHexOnly ? e = Le.ToHex(this.valueHexView) : e = this.valueDec.toString(), e; } toJSON() { return { ...super.toJSON(), valueDec: this.valueDec }; } } e_.NAME = "relativeSidBlock"; class t9 extends Qr { constructor({ value: e = zr, ...n } = {}) { super(n), this.value = [], e && this.fromString(e); } fromBER(e, n, r) { let i = n; for (; r > 0; ) { const o = new e_(); if (i = o.fromBER(e, i, r), i === -1) return this.blockLength = 0, this.error = o.error, i; this.blockLength += o.blockLength, r -= o.blockLength, this.value.push(o); } return i; } toBER(e, n) { const r = []; for (let i = 0; i < this.value.length; i++) { const o = this.value[i].toBER(e); if (o.byteLength === 0) return this.error = this.value[i].error, Mo; r.push(o); } return _A(r); } fromString(e) { this.value = []; let n = 0, r = 0, i = ""; do { r = e.indexOf(".", n), r === -1 ? i = e.substring(n) : i = e.substring(n, r), n = r + 1; const o = new e_(); if (o.valueDec = parseInt(i, 10), isNaN(o.valueDec)) return !0; this.value.push(o); } while (r !== -1); return !0; } toString() { let e = "", n = !1; for (let r = 0; r < this.value.length; r++) { n = this.value[r].isHexOnly; let i = this.value[r].toString(); r !== 0 && (e = `${e}.`), n && (i = `{${i}}`), e += i; } return e; } toJSON() { const e = { ...super.toJSON(), value: this.toString(), sidArray: [] }; for (let n = 0; n < this.value.length; n++) e.sidArray.push(this.value[n].toJSON()); return e; } } t9.NAME = "RelativeObjectIdentifierValueBlock"; var n9; class TA extends br { getValue() { return this.valueBlock.toString(); } setValue(e) { this.valueBlock.fromString(e); } constructor(e = {}) { super(e, t9), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 13; } onAsciiEncoding() { return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`; } toJSON() { return { ...super.toJSON(), value: this.getValue() }; } } n9 = TA; Re.RelativeObjectIdentifier = n9; TA.NAME = "RelativeObjectIdentifier"; var r9; class fo extends Ur { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 16; } } r9 = fo; Re.Sequence = r9; fo.NAME = "SEQUENCE"; var i9; let Jo = class extends Ur { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 17; } }; i9 = Jo; Re.Set = i9; Jo.NAME = "SET"; class o9 extends ia(Qr) { constructor({ ...e } = {}) { super(e), this.isHexOnly = !0, this.value = zr; } toJSON() { return { ...super.toJSON(), value: this.value }; } } o9.NAME = "StringValueBlock"; class a9 extends o9 { } a9.NAME = "SimpleStringValueBlock"; class Ii extends EA { constructor({ ...e } = {}) { super(e, a9); } fromBuffer(e) { this.valueBlock.value = String.fromCharCode.apply(null, Ce.toUint8Array(e)); } fromString(e) { const n = e.length, r = this.valueBlock.valueHexView = new Uint8Array(n); for (let i = 0; i < n; i++) r[i] = e.charCodeAt(i); this.valueBlock.value = e; } } Ii.NAME = "SIMPLE STRING"; class s9 extends Ii { fromBuffer(e) { this.valueBlock.valueHexView = Ce.toUint8Array(e); try { this.valueBlock.value = Le.ToUtf8String(e); } catch (n) { this.warnings.push(`Error during "decodeURIComponent": ${n}, using raw string`), this.valueBlock.value = Le.ToBinary(e); } } fromString(e) { this.valueBlock.valueHexView = new Uint8Array(Le.FromUtf8String(e)), this.valueBlock.value = e; } } s9.NAME = "Utf8StringValueBlock"; var c9; class Ha extends s9 { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 12; } } c9 = Ha; Re.Utf8String = c9; Ha.NAME = "UTF8String"; class u9 extends Ii { fromBuffer(e) { this.valueBlock.value = Le.ToUtf16String(e), this.valueBlock.valueHexView = Ce.toUint8Array(e); } fromString(e) { this.valueBlock.value = e, this.valueBlock.valueHexView = new Uint8Array(Le.FromUtf16String(e)); } } u9.NAME = "BmpStringValueBlock"; var l9; class s1 extends u9 { constructor({ ...e } = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 30; } } l9 = s1; Re.BmpString = l9; s1.NAME = "BMPString"; class d9 extends Ii { fromBuffer(e) { const n = ArrayBuffer.isView(e) ? e.slice().buffer : e.slice(0), r = new Uint8Array(n); for (let i = 0; i < r.length; i += 4) r[i] = r[i + 3], r[i + 1] = r[i + 2], r[i + 2] = 0, r[i + 3] = 0; this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(n)); } fromString(e) { const n = e.length, r = this.valueBlock.valueHexView = new Uint8Array(n * 4); for (let i = 0; i < n; i++) { const o = Sc(e.charCodeAt(i), 8), a = new Uint8Array(o); if (a.length > 4) continue; const s = 4 - a.length; for (let c = a.length - 1; c >= 0; c--) r[i * 4 + c + s] = a[c]; } this.valueBlock.value = e; } } d9.NAME = "UniversalStringValueBlock"; var p9; class c1 extends d9 { constructor({ ...e } = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 28; } } p9 = c1; Re.UniversalString = p9; c1.NAME = "UniversalString"; var f9; class u1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 18; } } f9 = u1; Re.NumericString = f9; u1.NAME = "NumericString"; var h9; class l1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 19; } } h9 = l1; Re.PrintableString = h9; l1.NAME = "PrintableString"; var m9; class d1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 20; } } m9 = d1; Re.TeletexString = m9; d1.NAME = "TeletexString"; var g9; class p1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 21; } } g9 = p1; Re.VideotexString = g9; p1.NAME = "VideotexString"; var y9; class f1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 22; } } y9 = f1; Re.IA5String = y9; f1.NAME = "IA5String"; var b9; class h1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 25; } } b9 = h1; Re.GraphicString = b9; h1.NAME = "GraphicString"; var v9; class If extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 26; } } v9 = If; Re.VisibleString = v9; If.NAME = "VisibleString"; var x9; class m1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 27; } } x9 = m1; Re.GeneralString = x9; m1.NAME = "GeneralString"; var w9; class g1 extends Ii { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 29; } } w9 = g1; Re.CharacterString = w9; g1.NAME = "CharacterString"; var S9; class Cf extends If { constructor({ value: e, valueDate: n, ...r } = {}) { if (super(r), this.year = 0, this.month = 0, this.day = 0, this.hour = 0, this.minute = 0, this.second = 0, e) { this.fromString(e), this.valueBlock.valueHexView = new Uint8Array(e.length); for (let i = 0; i < e.length; i++) this.valueBlock.valueHexView[i] = e.charCodeAt(i); } n && (this.fromDate(n), this.valueBlock.valueHexView = new Uint8Array(this.toBuffer())), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 23; } fromBuffer(e) { this.fromString(String.fromCharCode.apply(null, Ce.toUint8Array(e))); } toBuffer() { const e = this.toString(), n = new ArrayBuffer(e.length), r = new Uint8Array(n); for (let i = 0; i < e.length; i++) r[i] = e.charCodeAt(i); return n; } fromDate(e) { this.year = e.getUTCFullYear(), this.month = e.getUTCMonth() + 1, this.day = e.getUTCDate(), this.hour = e.getUTCHours(), this.minute = e.getUTCMinutes(), this.second = e.getUTCSeconds(); } toDate() { return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second)); } fromString(e) { const r = /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e); if (r === null) { this.error = "Wrong input string for conversion"; return; } const i = parseInt(r[1], 10); i >= 50 ? this.year = 1900 + i : this.year = 2e3 + i, this.month = parseInt(r[2], 10), this.day = parseInt(r[3], 10), this.hour = parseInt(r[4], 10), this.minute = parseInt(r[5], 10), this.second = parseInt(r[6], 10); } toString(e = "iso") { if (e === "iso") { const n = new Array(7); return n[0] = hi(this.year < 2e3 ? this.year - 1900 : this.year - 2e3, 2), n[1] = hi(this.month, 2), n[2] = hi(this.day, 2), n[3] = hi(this.hour, 2), n[4] = hi(this.minute, 2), n[5] = hi(this.second, 2), n[6] = "Z", n.join(""); } return super.toString(e); } onAsciiEncoding() { return `${this.constructor.NAME} : ${this.toDate().toISOString()}`; } toJSON() { return { ...super.toJSON(), year: this.year, month: this.month, day: this.day, hour: this.hour, minute: this.minute, second: this.second }; } } S9 = Cf; Re.UTCTime = S9; Cf.NAME = "UTCTime"; var _9; class y1 extends Cf { constructor(e = {}) { var n; super(e), (n = this.millisecond) !== null && n !== void 0 || (this.millisecond = 0), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 24; } fromDate(e) { super.fromDate(e), this.millisecond = e.getUTCMilliseconds(); } toDate() { const e = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond); return new Date(e); } fromString(e) { let n = !1, r = "", i = "", o = 0, a, s = 0, c = 0; if (e[e.length - 1] === "Z") r = e.substring(0, e.length - 1), n = !0; else { const p = new Number(e[e.length - 1]); if (isNaN(p.valueOf())) throw new Error("Wrong input string for conversion"); r = e; } if (n) { if (r.indexOf("+") !== -1) throw new Error("Wrong input string for conversion"); if (r.indexOf("-") !== -1) throw new Error("Wrong input string for conversion"); } else { let p = 1, f = r.indexOf("+"), m = ""; if (f === -1 && (f = r.indexOf("-"), p = -1), f !== -1) { if (m = r.substring(f + 1), r = r.substring(0, f), m.length !== 2 && m.length !== 4) throw new Error("Wrong input string for conversion"); let h = parseInt(m.substring(0, 2), 10); if (isNaN(h.valueOf())) throw new Error("Wrong input string for conversion"); if (s = p * h, m.length === 4) { if (h = parseInt(m.substring(2, 4), 10), isNaN(h.valueOf())) throw new Error("Wrong input string for conversion"); c = p * h; } } } let u = r.indexOf("."); if (u === -1 && (u = r.indexOf(",")), u !== -1) { const p = new Number(`0${r.substring(u)}`); if (isNaN(p.valueOf())) throw new Error("Wrong input string for conversion"); o = p.valueOf(), i = r.substring(0, u); } else i = r; switch (!0) { case i.length === 8: if (a = /(\d{4})(\d{2})(\d{2})/ig, u !== -1) throw new Error("Wrong input string for conversion"); break; case i.length === 10: if (a = /(\d{4})(\d{2})(\d{2})(\d{2})/ig, u !== -1) { let p = 60 * o; this.minute = Math.floor(p), p = 60 * (p - this.minute), this.second = Math.floor(p), p = 1e3 * (p - this.second), this.millisecond = Math.floor(p); } break; case i.length === 12: if (a = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig, u !== -1) { let p = 60 * o; this.second = Math.floor(p), p = 1e3 * (p - this.second), this.millisecond = Math.floor(p); } break; case i.length === 14: if (a = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig, u !== -1) { const p = 1e3 * o; this.millisecond = Math.floor(p); } break; default: throw new Error("Wrong input string for conversion"); } const d = a.exec(i); if (d === null) throw new Error("Wrong input string for conversion"); for (let p = 1; p < d.length; p++) switch (p) { case 1: this.year = parseInt(d[p], 10); break; case 2: this.month = parseInt(d[p], 10); break; case 3: this.day = parseInt(d[p], 10); break; case 4: this.hour = parseInt(d[p], 10) + s; break; case 5: this.minute = parseInt(d[p], 10) + c; break; case 6: this.second = parseInt(d[p], 10); break; default: throw new Error("Wrong input string for conversion"); } if (n === !1) { const p = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); this.year = p.getUTCFullYear(), this.month = p.getUTCMonth(), this.day = p.getUTCDay(), this.hour = p.getUTCHours(), this.minute = p.getUTCMinutes(), this.second = p.getUTCSeconds(), this.millisecond = p.getUTCMilliseconds(); } } toString(e = "iso") { if (e === "iso") { const n = []; return n.push(hi(this.year, 4)), n.push(hi(this.month, 2)), n.push(hi(this.day, 2)), n.push(hi(this.hour, 2)), n.push(hi(this.minute, 2)), n.push(hi(this.second, 2)), this.millisecond !== 0 && (n.push("."), n.push(hi(this.millisecond, 3))), n.push("Z"), n.join(""); } return super.toString(e); } toJSON() { return { ...super.toJSON(), millisecond: this.millisecond }; } } _9 = y1; Re.GeneralizedTime = _9; y1.NAME = "GeneralizedTime"; var E9; class kA extends Ha { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 31; } } E9 = kA; Re.DATE = E9; kA.NAME = "DATE"; var A9; class NA extends Ha { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 32; } } A9 = NA; Re.TimeOfDay = A9; NA.NAME = "TimeOfDay"; var I9; class PA extends Ha { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 33; } } I9 = PA; Re.DateTime = I9; PA.NAME = "DateTime"; var C9; class DA extends Ha { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 34; } } C9 = DA; Re.Duration = C9; DA.NAME = "Duration"; var T9; class OA extends Ha { constructor(e = {}) { super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 14; } } T9 = OA; Re.TIME = T9; OA.NAME = "TIME"; class Ec { constructor({ name: e = zr, optional: n = !1 } = {}) { this.name = e, this.optional = n; } } class FA extends Ec { constructor({ value: e = [], ...n } = {}) { super(n), this.value = e; } } class yg extends Ec { constructor({ value: e = new Ec(), local: n = !1, ...r } = {}) { super(r), this.value = e, this.local = n; } } class Xpe { get data() { return this.dataView.slice().buffer; } set data(e) { this.dataView = Ce.toUint8Array(e); } constructor({ data: e = r1 } = {}) { this.dataView = Ce.toUint8Array(e); } fromBER(e, n, r) { const i = n + r; return this.dataView = Ce.toUint8Array(e).subarray(n, i), i; } toBER(e) { return this.dataView.slice().buffer; } } function fs(t, e, n) { if (n instanceof FA) { for (const o of n.value) if (fs(t, e, o).verified) return { verified: !0, result: t }; { const o = { verified: !1, result: { error: "Wrong values for Choice type" } }; return n.hasOwnProperty(vw) && (o.name = n.name), o; } } if (n instanceof Ec) return n.hasOwnProperty(vw) && (t[n.name] = e), { verified: !0, result: t }; if (!(t instanceof Object)) return { verified: !1, result: { error: "Wrong root object" } }; if (!(e instanceof Object)) return { verified: !1, result: { error: "Wrong ASN.1 data" } }; if (!(n instanceof Object)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (!(jpe in n)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (!(zpe in n.idBlock)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (!(Hpe in n.idBlock)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; const r = n.idBlock.toBER(!1); if (r.byteLength === 0) return { verified: !1, result: { error: "Error encoding idBlock for ASN.1 schema" } }; if (n.idBlock.fromBER(r, 0, r.byteLength) === -1) return { verified: !1, result: { error: "Error decoding idBlock for ASN.1 schema" } }; if (n.idBlock.hasOwnProperty($pe) === !1) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (n.idBlock.tagClass !== e.idBlock.tagClass) return { verified: !1, result: t }; if (n.idBlock.hasOwnProperty(Gpe) === !1) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (n.idBlock.tagNumber !== e.idBlock.tagNumber) return { verified: !1, result: t }; if (n.idBlock.hasOwnProperty(qpe) === !1) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (n.idBlock.isConstructed !== e.idBlock.isConstructed) return { verified: !1, result: t }; if (!(Qpe in n.idBlock)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; if (n.idBlock.isHexOnly !== e.idBlock.isHexOnly) return { verified: !1, result: t }; if (n.idBlock.isHexOnly) { if (!(AN in n.idBlock)) return { verified: !1, result: { error: "Wrong ASN.1 schema" } }; const o = n.idBlock.valueHexView, a = e.idBlock.valueHexView; if (o.length !== a.length) return { verified: !1, result: t }; for (let s = 0; s < o.length; s++) if (o[s] !== a[1]) return { verified: !1, result: t }; } if (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && (t[n.name] = e)), n instanceof Re.Constructed) { let o = 0, a = { verified: !1, result: { error: "Unknown error" } }, s = n.valueBlock.value.length; if (s > 0 && n.valueBlock.value[0] instanceof yg && (s = e.valueBlock.value.length), s === 0) return { verified: !0, result: t }; if (e.valueBlock.value.length === 0 && n.valueBlock.value.length !== 0) { let c = !0; for (let u = 0; u < n.valueBlock.value.length; u++) c = c && (n.valueBlock.value[u].optional || !1); return c ? { verified: !0, result: t } : (n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && delete t[n.name]), t.error = "Inconsistent object length", { verified: !1, result: t }); } for (let c = 0; c < s; c++) if (c - o >= e.valueBlock.value.length) { if (n.valueBlock.value[c].optional === !1) { const u = { verified: !1, result: t }; return t.error = "Inconsistent length between ASN.1 data and schema", n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && (delete t[n.name], u.name = n.name)), u; } } else if (n.valueBlock.value[0] instanceof yg) { if (a = fs(t, e.valueBlock.value[c], n.valueBlock.value[0].value), a.verified === !1) if (n.valueBlock.value[0].optional) o++; else return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && delete t[n.name]), a; if (vw in n.valueBlock.value[0] && n.valueBlock.value[0].name.length > 0) { let u = {}; Wpe in n.valueBlock.value[0] && n.valueBlock.value[0].local ? u = e : u = t, typeof u[n.valueBlock.value[0].name] > "u" && (u[n.valueBlock.value[0].name] = []), u[n.valueBlock.value[0].name].push(e.valueBlock.value[c]); } } else if (a = fs(t, e.valueBlock.value[c - o], n.valueBlock.value[c]), a.verified === !1) if (n.valueBlock.value[c].optional) o++; else return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && delete t[n.name]), a; if (a.verified === !1) { const c = { verified: !1, result: t }; return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && (delete t[n.name], c.name = n.name)), c; } return { verified: !0, result: t }; } if (n.primitiveSchema && AN in e.valueBlock) { const o = Bl(e.valueBlock.valueHexView); if (o.offset === -1) { const a = { verified: !1, result: o.result }; return n.name && (n.name = n.name.replace(/^\s+|\s+$/g, zr), n.name && (delete t[n.name], a.name = n.name)), a; } return fs(t, o.result, n.primitiveSchema); } return { verified: !0, result: t }; } function Zpe(t, e) { if (!(e instanceof Object)) return { verified: !1, result: { error: "Wrong ASN.1 schema type" } }; const n = Bl(Ce.toUint8Array(t)); return n.offset === -1 ? { verified: !1, result: n.result } : fs(n.result, n.result, e); } const k9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, Any: Ec, BaseBlock: br, BaseStringBlock: EA, BitString: hc, BmpString: s1, Boolean: i1, CharacterString: g1, Choice: FA, Constructed: Ur, DATE: kA, DateTime: PA, Duration: DA, EndOfContent: AA, Enumerated: o1, GeneralString: m1, GeneralizedTime: y1, GraphicString: h1, HexBlock: ia, IA5String: f1, Integer: Ul, Null: _c, NumericString: u1, ObjectIdentifier: a1, OctetString: fc, Primitive: Af, PrintableString: l1, RawData: Xpe, RelativeObjectIdentifier: TA, Repeated: yg, Sequence: fo, Set: Jo, TIME: OA, TeletexString: d1, TimeOfDay: NA, UTCTime: Cf, UniversalString: c1, Utf8String: Ha, ValueBlock: Qr, VideotexString: p1, ViewWriter: n1, VisibleString: If, compareSchema: fs, fromBER: Pu, verifySchema: Zpe }, Symbol.toStringTag, { value: "Module" })); var ye; (function(t) { t[t.Sequence = 0] = "Sequence", t[t.Set = 1] = "Set", t[t.Choice = 2] = "Choice"; })(ye || (ye = {})); var te; (function(t) { t[t.Any = 1] = "Any", t[t.Boolean = 2] = "Boolean", t[t.OctetString = 3] = "OctetString", t[t.BitString = 4] = "BitString", t[t.Integer = 5] = "Integer", t[t.Enumerated = 6] = "Enumerated", t[t.ObjectIdentifier = 7] = "ObjectIdentifier", t[t.Utf8String = 8] = "Utf8String", t[t.BmpString = 9] = "BmpString", t[t.UniversalString = 10] = "UniversalString", t[t.NumericString = 11] = "NumericString", t[t.PrintableString = 12] = "PrintableString", t[t.TeletexString = 13] = "TeletexString", t[t.VideotexString = 14] = "VideotexString", t[t.IA5String = 15] = "IA5String", t[t.GraphicString = 16] = "GraphicString", t[t.VisibleString = 17] = "VisibleString", t[t.GeneralString = 18] = "GeneralString", t[t.CharacterString = 19] = "CharacterString", t[t.UTCTime = 20] = "UTCTime", t[t.GeneralizedTime = 21] = "GeneralizedTime", t[t.DATE = 22] = "DATE", t[t.TimeOfDay = 23] = "TimeOfDay", t[t.DateTime = 24] = "DateTime", t[t.Duration = 25] = "Duration", t[t.TIME = 26] = "TIME", t[t.Null = 27] = "Null"; })(te || (te = {})); class b1 { constructor(e, n = 0) { if (this.unusedBits = 0, this.value = new ArrayBuffer(0), e) if (typeof e == "number") this.fromNumber(e); else if (Ce.isBufferSource(e)) this.unusedBits = n, this.value = Ce.toArrayBuffer(e); else throw TypeError("Unsupported type of 'params' argument for BitString"); } fromASN(e) { if (!(e instanceof hc)) throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString"); return this.unusedBits = e.valueBlock.unusedBits, this.value = e.valueBlock.valueHex, this; } toASN() { return new hc({ unusedBits: this.unusedBits, valueHex: this.value }); } toSchema(e) { return new hc({ name: e }); } toNumber() { let e = ""; const n = new Uint8Array(this.value); for (const r of n) e += r.toString(2).padStart(8, "0"); return e = e.split("").reverse().join(""), this.unusedBits && (e = e.slice(this.unusedBits).padStart(this.unusedBits, "0")), parseInt(e, 2); } fromNumber(e) { let n = e.toString(2); const r = n.length + 7 >> 3; this.unusedBits = (r << 3) - n.length; const i = new Uint8Array(r); n = n.padStart(r << 3, "0").split("").reverse().join(""); let o = 0; for (; o < r; ) i[o] = parseInt(n.slice(o << 3, (o << 3) + 8), 2), o++; this.value = i.buffer; } } class je { get byteLength() { return this.buffer.byteLength; } get byteOffset() { return 0; } constructor(e) { typeof e == "number" ? this.buffer = new ArrayBuffer(e) : Ce.isBufferSource(e) ? this.buffer = Ce.toArrayBuffer(e) : Array.isArray(e) ? this.buffer = new Uint8Array(e) : this.buffer = new ArrayBuffer(0); } fromASN(e) { if (!(e instanceof fc)) throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString"); return this.buffer = e.valueBlock.valueHex, this; } toASN() { return new fc({ valueHex: this.buffer }); } toSchema(e) { return new fc({ name: e }); } } const efe = { fromASN: (t) => t instanceof _c ? null : t.valueBeforeDecodeView, toASN: (t) => { if (t === null) return new _c(); const e = Pu(t); if (e.result.error) throw new Error(e.result.error); return e.result; } }, tfe = { fromASN: (t) => t.valueBlock.valueHexView.byteLength >= 4 ? t.valueBlock.toString() : t.valueBlock.valueDec, toASN: (t) => new Ul({ value: +t }) }, nfe = { fromASN: (t) => t.valueBlock.valueDec, toASN: (t) => new o1({ value: t }) }, en = { fromASN: (t) => t.valueBlock.valueHexView, toASN: (t) => new Ul({ valueHex: t }) }, rfe = { fromASN: (t) => t.valueBlock.valueHexView, toASN: (t) => new hc({ valueHex: t }) }, ife = { fromASN: (t) => t.valueBlock.toString(), toASN: (t) => new a1({ value: t }) }, ofe = { fromASN: (t) => t.valueBlock.value, toASN: (t) => new i1({ value: t }) }, bg = { fromASN: (t) => t.valueBlock.valueHexView, toASN: (t) => new fc({ valueHex: t }) }, afe = { fromASN: (t) => new je(t.getValue()), toASN: (t) => t.toASN() }; function Ji(t) { return { fromASN: (e) => e.valueBlock.value, toASN: (e) => new t({ value: e }) }; } const N9 = Ji(Ha), sfe = Ji(s1), cfe = Ji(c1), ufe = Ji(u1), lfe = Ji(l1), dfe = Ji(d1), pfe = Ji(p1), ffe = Ji(f1), hfe = Ji(h1), mfe = Ji(If), gfe = Ji(m1), yfe = Ji(g1), bfe = { fromASN: (t) => t.toDate(), toASN: (t) => new Cf({ valueDate: t }) }, vfe = { fromASN: (t) => t.toDate(), toASN: (t) => new y1({ valueDate: t }) }, xfe = { fromASN: () => null, toASN: () => new _c() }; function cp(t) { switch (t) { case te.Any: return efe; case te.BitString: return rfe; case te.BmpString: return sfe; case te.Boolean: return ofe; case te.CharacterString: return yfe; case te.Enumerated: return nfe; case te.GeneralString: return gfe; case te.GeneralizedTime: return vfe; case te.GraphicString: return hfe; case te.IA5String: return ffe; case te.Integer: return tfe; case te.Null: return xfe; case te.NumericString: return ufe; case te.ObjectIdentifier: return ife; case te.OctetString: return bg; case te.PrintableString: return lfe; case te.TeletexString: return dfe; case te.UTCTime: return bfe; case te.UniversalString: return cfe; case te.Utf8String: return N9; case te.VideotexString: return pfe; case te.VisibleString: return mfe; default: return null; } } function Ia(t) { return typeof t == "function" && t.prototype ? t.prototype.toASN && t.prototype.fromASN ? !0 : Ia(t.prototype) : !!(t && typeof t == "object" && "toASN" in t && "fromASN" in t); } function P9(t) { var e; if (t) { const n = Object.getPrototypeOf(t); return ((e = n?.prototype) === null || e === void 0 ? void 0 : e.constructor) === Array ? !0 : P9(n); } return !1; } function wfe(t, e) { if (!(t && e) || t.byteLength !== e.byteLength) return !1; const n = new Uint8Array(t), r = new Uint8Array(e); for (let i = 0; i < t.byteLength; i++) if (n[i] !== r[i]) return !1; return !0; } class Sfe { constructor() { this.items = /* @__PURE__ */ new WeakMap(); } has(e) { return this.items.has(e); } get(e, n = !1) { const r = this.items.get(e); if (!r) throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`); if (n && !r.schema) throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`); return r; } cache(e) { const n = this.get(e); n.schema || (n.schema = this.create(e, !0)); } createDefault(e) { const n = { type: ye.Sequence, items: {} }, r = this.findParentSchema(e); return r && (Object.assign(n, r), n.items = Object.assign({}, n.items, r.items)), n; } create(e, n) { const r = this.items.get(e) || this.createDefault(e), i = []; for (const o in r.items) { const a = r.items[o], s = n ? o : ""; let c; if (typeof a.type == "number") { const d = te[a.type], p = k9[d]; if (!p) throw new Error(`Cannot get ASN1 class by name '${d}'`); c = new p({ name: s }); } else Ia(a.type) ? c = new a.type().toSchema(s) : a.optional ? this.get(a.type).type === ye.Choice ? c = new Ec({ name: s }) : (c = this.create(a.type, !1), c.name = s) : c = new Ec({ name: s }); const u = !!a.optional || a.defaultValue !== void 0; if (a.repeated) { c.name = ""; const d = a.repeated === "set" ? Jo : fo; c = new d({ name: "", value: [new yg({ name: s, value: c })] }); } if (a.context !== null && a.context !== void 0) if (a.implicit) if (typeof a.type == "number" || Ia(a.type)) { const d = a.repeated ? Ur : Af; i.push(new d({ name: s, optional: u, idBlock: { tagClass: 3, tagNumber: a.context } })); } else { this.cache(a.type); const d = !!a.repeated; let p = d ? c : this.get(a.type, !0).schema; p = "valueBlock" in p ? p.valueBlock.value : p.value, i.push(new Ur({ name: d ? "" : s, optional: u, idBlock: { tagClass: 3, tagNumber: a.context }, value: p })); } else i.push(new Ur({ optional: u, idBlock: { tagClass: 3, tagNumber: a.context }, value: [c] })); else c.optional = u, i.push(c); } switch (r.type) { case ye.Sequence: return new fo({ value: i, name: "" }); case ye.Set: return new Jo({ value: i, name: "" }); case ye.Choice: return new FA({ value: i, name: "" }); default: throw new Error("Unsupported ASN1 type in use"); } } set(e, n) { return this.items.set(e, n), this; } findParentSchema(e) { const n = Object.getPrototypeOf(e); return n ? this.items.get(n) || this.findParentSchema(n) : null; } } const pr = new Sfe(), _e = (t) => (e) => { let n; pr.has(e) ? n = pr.get(e) : (n = pr.createDefault(e), pr.set(e, n)), Object.assign(n, t); }, z = (t) => (e, n) => { let r; pr.has(e.constructor) ? r = pr.get(e.constructor) : (r = pr.createDefault(e.constructor), pr.set(e.constructor, r)); const i = Object.assign({}, t); if (typeof i.type == "number" && !i.converter) { const o = cp(t.type); if (!o) throw new Error(`Cannot get default converter for property '${n}' of ${e.constructor.name}`); i.converter = o; } i.raw = t.raw, r.items[n] = i; }; class dd extends Error { constructor() { super(...arguments), this.schemas = []; } } class Xr { static parse(e, n) { const r = Pu(e); if (r.result.error) throw new Error(r.result.error); return this.fromASN(r.result, n); } static fromASN(e, n) { try { if (Ia(n)) return new n().fromASN(e); const r = pr.get(n); pr.cache(n); let i = r.schema; const o = this.handleChoiceTypes(e, r, n, i); if (o?.result) return o.result; o?.targetSchema && (i = o.targetSchema); const a = this.handleSequenceTypes(e, r, n, i), s = new n(); return P9(n) ? this.handleArrayTypes(e, r, n) : (this.processSchemaItems(r, a, s), s); } catch (r) { throw r instanceof dd && r.schemas.push(n.name), r; } } static handleChoiceTypes(e, n, r, i) { if (e.constructor === Ur && n.type === ye.Choice && e.idBlock.tagClass === 3) for (const o in n.items) { const a = n.items[o]; if (a.context === e.idBlock.tagNumber && a.implicit && typeof a.type == "function" && pr.has(a.type)) { const s = pr.get(a.type); if (s && s.type === ye.Sequence) { const c = new fo(); if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in c.valueBlock) { c.valueBlock.value = e.valueBlock.value; const u = this.fromASN(c, a.type), d = new r(); return d[o] = u, { result: d }; } } } } else if (e.constructor === Ur && n.type !== ye.Choice) { const o = new Ur({ idBlock: { tagClass: 3, tagNumber: e.idBlock.tagNumber }, value: n.schema.valueBlock.value }); for (const a in n.items) delete e[a]; return { targetSchema: o }; } return null; } static handleSequenceTypes(e, n, r, i) { if (n.type === ye.Sequence) { const o = fs({}, e, i); if (!o.verified) throw new dd(`Data does not match to ${r.name} ASN1 schema.${o.result.error ? ` ${o.result.error}` : ""}`); return o; } else { const o = fs({}, e, i); if (!o.verified) throw new dd(`Data does not match to ${r.name} ASN1 schema.${o.result.error ? ` ${o.result.error}` : ""}`); return o; } } static processRepeatedField(e, n, r) { let i = e.slice(n); if (i.length === 1 && i[0].constructor.name === "Sequence") { const o = i[0]; o.valueBlock && o.valueBlock.value && Array.isArray(o.valueBlock.value) && (i = o.valueBlock.value); } if (typeof r.type == "number") { const o = cp(r.type); if (!o) throw new Error(`No converter for ASN.1 type ${r.type}`); return i.filter((a) => a && a.valueBlock).map((a) => { try { return o.fromASN(a); } catch { return; } }).filter((a) => a !== void 0); } else return i.filter((o) => o && o.valueBlock).map((o) => { try { return this.fromASN(o, r.type); } catch { return; } }).filter((o) => o !== void 0); } static processPrimitiveField(e, n) { const r = cp(n.type); if (!r) throw new Error(`No converter for ASN.1 type ${n.type}`); return r.fromASN(e); } static isOptionalChoiceField(e) { return e.optional && typeof e.type == "function" && pr.has(e.type) && pr.get(e.type).type === ye.Choice; } static processOptionalChoiceField(e, n) { try { return { processed: !0, value: this.fromASN(e, n.type) }; } catch (r) { if (r instanceof dd && /Wrong values for Choice type/.test(r.message)) return { processed: !1 }; throw r; } } static handleArrayTypes(e, n, r) { if (!("value" in e.valueBlock && Array.isArray(e.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); const i = n.itemType; if (typeof i == "number") { const o = cp(i); if (!o) throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`); return r.from(e.valueBlock.value, (a) => o.fromASN(a)); } else return r.from(e.valueBlock.value, (o) => this.fromASN(o, i)); } static processSchemaItems(e, n, r) { for (const i in e.items) { const o = n.result[i]; if (!o) continue; const a = e.items[i], s = a.type; let c; typeof s == "number" || Ia(s) ? c = this.processPrimitiveSchemaItem(o, a, s) : c = this.processComplexSchemaItem(o, a, s), c && typeof c == "object" && "value" in c && "raw" in c ? (r[i] = c.value, r[`${i}Raw`] = c.raw) : r[i] = c; } } static processPrimitiveSchemaItem(e, n, r) { var i; const o = (i = n.converter) !== null && i !== void 0 ? i : Ia(r) ? new r() : null; if (!o) throw new Error("Converter is empty"); return n.repeated ? this.processRepeatedPrimitiveItem(e, n, o) : this.processSinglePrimitiveItem(e, n, r, o); } static processRepeatedPrimitiveItem(e, n, r) { if (n.implicit) { const i = n.repeated === "sequence" ? fo : Jo, o = new i(); o.valueBlock = e.valueBlock; const a = Pu(o.toBER(!1)); if (a.offset === -1) throw new Error(`Cannot parse the child item. ${a.result.error}`); if (!("value" in a.result.valueBlock && Array.isArray(a.result.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); const s = a.result.valueBlock.value; return Array.from(s, (c) => r.fromASN(c)); } else return Array.from(e, (i) => r.fromASN(i)); } static processSinglePrimitiveItem(e, n, r, i) { let o = e; if (n.implicit) { let a; if (Ia(r)) a = new r().toSchema(""); else { const s = te[r], c = k9[s]; if (!c) throw new Error(`Cannot get '${s}' class from asn1js module`); a = new c(); } a.valueBlock = o.valueBlock, o = Pu(a.toBER(!1)).result; } return i.fromASN(o); } static processComplexSchemaItem(e, n, r) { if (n.repeated) { if (!Array.isArray(e)) throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable."); return Array.from(e, (i) => this.fromASN(i, r)); } else { const i = this.handleImplicitTagging(e, n, r); if (this.isOptionalChoiceField(n)) try { return this.fromASN(i, r); } catch (o) { if (o instanceof dd && /Wrong values for Choice type/.test(o.message)) return; throw o; } else { const o = this.fromASN(i, r); return n.raw ? { value: o, raw: e.valueBeforeDecodeView } : o; } } } static handleImplicitTagging(e, n, r) { if (n.implicit && typeof n.context == "number") { const i = pr.get(r); if (i.type === ye.Sequence) { const o = new fo(); if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in o.valueBlock) return o.valueBlock.value = e.valueBlock.value, o; } else if (i.type === ye.Set) { const o = new Jo(); if ("value" in e.valueBlock && Array.isArray(e.valueBlock.value) && "value" in o.valueBlock) return o.valueBlock.value = e.valueBlock.value, o; } } return e; } } class MA { static serialize(e) { return e instanceof br ? e.toBER(!1) : this.toASN(e).toBER(!1); } static toASN(e) { if (e && typeof e == "object" && Ia(e)) return e.toASN(); if (!(e && typeof e == "object")) throw new TypeError("Parameter 1 should be type of Object."); const n = e.constructor, r = pr.get(n); pr.cache(n); let i = []; if (r.itemType) { if (!Array.isArray(e)) throw new TypeError("Parameter 1 should be type of Array."); if (typeof r.itemType == "number") { const a = cp(r.itemType); if (!a) throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`); i = e.map((s) => a.toASN(s)); } else i = e.map((a) => this.toAsnItem({ type: r.itemType }, "[]", n, a)); } else for (const a in r.items) { const s = r.items[a], c = e[a]; if (c === void 0 || s.defaultValue === c || typeof s.defaultValue == "object" && typeof c == "object" && wfe(this.serialize(s.defaultValue), this.serialize(c))) continue; const u = MA.toAsnItem(s, a, n, c); if (typeof s.context == "number") if (s.implicit) if (!s.repeated && (typeof s.type == "number" || Ia(s.type))) { const d = {}; d.valueHex = u instanceof _c ? u.valueBeforeDecodeView : u.valueBlock.toBER(), i.push(new Af({ optional: s.optional, idBlock: { tagClass: 3, tagNumber: s.context }, ...d })); } else i.push(new Ur({ optional: s.optional, idBlock: { tagClass: 3, tagNumber: s.context }, value: u.valueBlock.value })); else i.push(new Ur({ optional: s.optional, idBlock: { tagClass: 3, tagNumber: s.context }, value: [u] })); else s.repeated ? i = i.concat(u) : i.push(u); } let o; switch (r.type) { case ye.Sequence: o = new fo({ value: i }); break; case ye.Set: o = new Jo({ value: i }); break; case ye.Choice: if (!i[0]) throw new Error(`Schema '${n.name}' has wrong data. Choice cannot be empty.`); o = i[0]; break; } return o; } static toAsnItem(e, n, r, i) { let o; if (typeof e.type == "number") { const a = e.converter; if (!a) throw new Error(`Property '${n}' doesn't have converter for type ${te[e.type]} in schema '${r.name}'`); if (e.repeated) { if (!Array.isArray(i)) throw new TypeError("Parameter 'objProp' should be type of Array."); const s = Array.from(i, (u) => a.toASN(u)), c = e.repeated === "sequence" ? fo : Jo; o = new c({ value: s }); } else o = a.toASN(i); } else if (e.repeated) { if (!Array.isArray(i)) throw new TypeError("Parameter 'objProp' should be type of Array."); const a = Array.from(i, (c) => this.toASN(c)), s = e.repeated === "sequence" ? fo : Jo; o = new s({ value: a }); } else o = this.toASN(i); return o; } } class Pt extends Array { constructor(e = []) { if (typeof e == "number") super(e); else { super(); for (const n of e) this.push(n); } } } class Te { static serialize(e) { return MA.serialize(e); } static parse(e, n) { return Xr.parse(e, n); } static toString(e) { const n = Ce.isBufferSource(e) ? Ce.toArrayBuffer(e) : Te.serialize(e), r = Pu(n); if (r.offset === -1) throw new Error(`Cannot decode ASN.1 data. ${r.result.error}`); return r.result.toString(); } } var xw = { exports: {} }, CN; function _fe() { return CN || (CN = 1, (function(t) { var e, n, r, i, o, a, s, c, u, d, p, f, m, h, y, x, g, b, S, E, T, U, q, Y, H, G, J, B, D, X, V, K; (function($) { var _ = typeof $n == "object" ? $n : typeof self == "object" ? self : typeof this == "object" ? this : {}; $(I(_, I(t.exports))); function I(N, L) { return N !== _ && (typeof Object.create == "function" ? Object.defineProperty(N, "__esModule", { value: !0 }) : N.__esModule = !0), function(C, Q) { return N[C] = L ? L(C, Q) : Q; }; } })(function($) { var _ = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(C, Q) { C.__proto__ = Q; } || function(C, Q) { for (var k in Q) Object.prototype.hasOwnProperty.call(Q, k) && (C[k] = Q[k]); }; e = function(C, Q) { if (typeof Q != "function" && Q !== null) throw new TypeError("Class extends value " + String(Q) + " is not a constructor or null"); _(C, Q); function k() { this.constructor = C; } C.prototype = Q === null ? Object.create(Q) : (k.prototype = Q.prototype, new k()); }, n = Object.assign || function(C) { for (var Q, k = 1, M = arguments.length; k < M; k++) { Q = arguments[k]; for (var O in Q) Object.prototype.hasOwnProperty.call(Q, O) && (C[O] = Q[O]); } return C; }, r = function(C, Q) { var k = {}; for (var M in C) Object.prototype.hasOwnProperty.call(C, M) && Q.indexOf(M) < 0 && (k[M] = C[M]); if (C != null && typeof Object.getOwnPropertySymbols == "function") for (var O = 0, M = Object.getOwnPropertySymbols(C); O < M.length; O++) Q.indexOf(M[O]) < 0 && Object.prototype.propertyIsEnumerable.call(C, M[O]) && (k[M[O]] = C[M[O]]); return k; }, i = function(C, Q, k, M) { var O = arguments.length, A = O < 3 ? Q : M === null ? M = Object.getOwnPropertyDescriptor(Q, k) : M, F; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") A = Reflect.decorate(C, Q, k, M); else for (var Z = C.length - 1; Z >= 0; Z--) (F = C[Z]) && (A = (O < 3 ? F(A) : O > 3 ? F(Q, k, A) : F(Q, k)) || A); return O > 3 && A && Object.defineProperty(Q, k, A), A; }, o = function(C, Q) { return function(k, M) { Q(k, M, C); }; }, a = function(C, Q, k, M, O, A) { function F(He) { if (He !== void 0 && typeof He != "function") throw new TypeError("Function expected"); return He; } for (var Z = M.kind, ee = Z === "getter" ? "get" : Z === "setter" ? "set" : "value", P = !Q && C ? M.static ? C : C.prototype : null, j = Q || (P ? Object.getOwnPropertyDescriptor(P, M.name) : {}), W, se = !1, ce = k.length - 1; ce >= 0; ce--) { var oe = {}; for (var we in M) oe[we] = we === "access" ? {} : M[we]; for (var we in M.access) oe.access[we] = M.access[we]; oe.addInitializer = function(He) { if (se) throw new TypeError("Cannot add initializers after decoration has completed"); A.push(F(He || null)); }; var Me = (0, k[ce])(Z === "accessor" ? { get: j.get, set: j.set } : j[ee], oe); if (Z === "accessor") { if (Me === void 0) continue; if (Me === null || typeof Me != "object") throw new TypeError("Object expected"); (W = F(Me.get)) && (j.get = W), (W = F(Me.set)) && (j.set = W), (W = F(Me.init)) && O.unshift(W); } else (W = F(Me)) && (Z === "field" ? O.unshift(W) : j[ee] = W); } P && Object.defineProperty(P, M.name, j), se = !0; }, s = function(C, Q, k) { for (var M = arguments.length > 2, O = 0; O < Q.length; O++) k = M ? Q[O].call(C, k) : Q[O].call(C); return M ? k : void 0; }, c = function(C) { return typeof C == "symbol" ? C : "".concat(C); }, u = function(C, Q, k) { return typeof Q == "symbol" && (Q = Q.description ? "[".concat(Q.description, "]") : ""), Object.defineProperty(C, "name", { configurable: !0, value: k ? "".concat(k, " ", Q) : Q }); }, d = function(C, Q) { if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(C, Q); }, p = function(C, Q, k, M) { function O(A) { return A instanceof k ? A : new k(function(F) { F(A); }); } return new (k || (k = Promise))(function(A, F) { function Z(j) { try { P(M.next(j)); } catch (W) { F(W); } } function ee(j) { try { P(M.throw(j)); } catch (W) { F(W); } } function P(j) { j.done ? A(j.value) : O(j.value).then(Z, ee); } P((M = M.apply(C, Q || [])).next()); }); }, f = function(C, Q) { var k = { label: 0, sent: function() { if (A[0] & 1) throw A[1]; return A[1]; }, trys: [], ops: [] }, M, O, A, F = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype); return F.next = Z(0), F.throw = Z(1), F.return = Z(2), typeof Symbol == "function" && (F[Symbol.iterator] = function() { return this; }), F; function Z(P) { return function(j) { return ee([P, j]); }; } function ee(P) { if (M) throw new TypeError("Generator is already executing."); for (; F && (F = 0, P[0] && (k = 0)), k; ) try { if (M = 1, O && (A = P[0] & 2 ? O.return : P[0] ? O.throw || ((A = O.return) && A.call(O), 0) : O.next) && !(A = A.call(O, P[1])).done) return A; switch (O = 0, A && (P = [P[0] & 2, A.value]), P[0]) { case 0: case 1: A = P; break; case 4: return k.label++, { value: P[1], done: !1 }; case 5: k.label++, O = P[1], P = [0]; continue; case 7: P = k.ops.pop(), k.trys.pop(); continue; default: if (A = k.trys, !(A = A.length > 0 && A[A.length - 1]) && (P[0] === 6 || P[0] === 2)) { k = 0; continue; } if (P[0] === 3 && (!A || P[1] > A[0] && P[1] < A[3])) { k.label = P[1]; break; } if (P[0] === 6 && k.label < A[1]) { k.label = A[1], A = P; break; } if (A && k.label < A[2]) { k.label = A[2], k.ops.push(P); break; } A[2] && k.ops.pop(), k.trys.pop(); continue; } P = Q.call(C, k); } catch (j) { P = [6, j], O = 0; } finally { M = A = 0; } if (P[0] & 5) throw P[1]; return { value: P[0] ? P[1] : void 0, done: !0 }; } }, m = function(C, Q) { for (var k in C) k !== "default" && !Object.prototype.hasOwnProperty.call(Q, k) && D(Q, C, k); }, D = Object.create ? (function(C, Q, k, M) { M === void 0 && (M = k); var O = Object.getOwnPropertyDescriptor(Q, k); (!O || ("get" in O ? !Q.__esModule : O.writable || O.configurable)) && (O = { enumerable: !0, get: function() { return Q[k]; } }), Object.defineProperty(C, M, O); }) : (function(C, Q, k, M) { M === void 0 && (M = k), C[M] = Q[k]; }), h = function(C) { var Q = typeof Symbol == "function" && Symbol.iterator, k = Q && C[Q], M = 0; if (k) return k.call(C); if (C && typeof C.length == "number") return { next: function() { return C && M >= C.length && (C = void 0), { value: C && C[M++], done: !C }; } }; throw new TypeError(Q ? "Object is not iterable." : "Symbol.iterator is not defined."); }, y = function(C, Q) { var k = typeof Symbol == "function" && C[Symbol.iterator]; if (!k) return C; var M = k.call(C), O, A = [], F; try { for (; (Q === void 0 || Q-- > 0) && !(O = M.next()).done; ) A.push(O.value); } catch (Z) { F = { error: Z }; } finally { try { O && !O.done && (k = M.return) && k.call(M); } finally { if (F) throw F.error; } } return A; }, x = function() { for (var C = [], Q = 0; Q < arguments.length; Q++) C = C.concat(y(arguments[Q])); return C; }, g = function() { for (var C = 0, Q = 0, k = arguments.length; Q < k; Q++) C += arguments[Q].length; for (var M = Array(C), O = 0, Q = 0; Q < k; Q++) for (var A = arguments[Q], F = 0, Z = A.length; F < Z; F++, O++) M[O] = A[F]; return M; }, b = function(C, Q, k) { if (k || arguments.length === 2) for (var M = 0, O = Q.length, A; M < O; M++) (A || !(M in Q)) && (A || (A = Array.prototype.slice.call(Q, 0, M)), A[M] = Q[M]); return C.concat(A || Array.prototype.slice.call(Q)); }, S = function(C) { return this instanceof S ? (this.v = C, this) : new S(C); }, E = function(C, Q, k) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var M = k.apply(C, Q || []), O, A = []; return O = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), Z("next"), Z("throw"), Z("return", F), O[Symbol.asyncIterator] = function() { return this; }, O; function F(ce) { return function(oe) { return Promise.resolve(oe).then(ce, W); }; } function Z(ce, oe) { M[ce] && (O[ce] = function(we) { return new Promise(function(Me, He) { A.push([ce, we, Me, He]) > 1 || ee(ce, we); }); }, oe && (O[ce] = oe(O[ce]))); } function ee(ce, oe) { try { P(M[ce](oe)); } catch (we) { se(A[0][3], we); } } function P(ce) { ce.value instanceof S ? Promise.resolve(ce.value.v).then(j, W) : se(A[0][2], ce); } function j(ce) { ee("next", ce); } function W(ce) { ee("throw", ce); } function se(ce, oe) { ce(oe), A.shift(), A.length && ee(A[0][0], A[0][1]); } }, T = function(C) { var Q, k; return Q = {}, M("next"), M("throw", function(O) { throw O; }), M("return"), Q[Symbol.iterator] = function() { return this; }, Q; function M(O, A) { Q[O] = C[O] ? function(F) { return (k = !k) ? { value: S(C[O](F)), done: !1 } : A ? A(F) : F; } : A; } }, U = function(C) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var Q = C[Symbol.asyncIterator], k; return Q ? Q.call(C) : (C = typeof h == "function" ? h(C) : C[Symbol.iterator](), k = {}, M("next"), M("throw"), M("return"), k[Symbol.asyncIterator] = function() { return this; }, k); function M(A) { k[A] = C[A] && function(F) { return new Promise(function(Z, ee) { F = C[A](F), O(Z, ee, F.done, F.value); }); }; } function O(A, F, Z, ee) { Promise.resolve(ee).then(function(P) { A({ value: P, done: Z }); }, F); } }, q = function(C, Q) { return Object.defineProperty ? Object.defineProperty(C, "raw", { value: Q }) : C.raw = Q, C; }; var I = Object.create ? (function(C, Q) { Object.defineProperty(C, "default", { enumerable: !0, value: Q }); }) : function(C, Q) { C.default = Q; }, N = function(C) { return N = Object.getOwnPropertyNames || function(Q) { var k = []; for (var M in Q) Object.prototype.hasOwnProperty.call(Q, M) && (k[k.length] = M); return k; }, N(C); }; Y = function(C) { if (C && C.__esModule) return C; var Q = {}; if (C != null) for (var k = N(C), M = 0; M < k.length; M++) k[M] !== "default" && D(Q, C, k[M]); return I(Q, C), Q; }, H = function(C) { return C && C.__esModule ? C : { default: C }; }, G = function(C, Q, k, M) { if (k === "a" && !M) throw new TypeError("Private accessor was defined without a getter"); if (typeof Q == "function" ? C !== Q || !M : !Q.has(C)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return k === "m" ? M : k === "a" ? M.call(C) : M ? M.value : Q.get(C); }, J = function(C, Q, k, M, O) { if (M === "m") throw new TypeError("Private method is not writable"); if (M === "a" && !O) throw new TypeError("Private accessor was defined without a setter"); if (typeof Q == "function" ? C !== Q || !O : !Q.has(C)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return M === "a" ? O.call(C, k) : O ? O.value = k : Q.set(C, k), k; }, B = function(C, Q) { if (Q === null || typeof Q != "object" && typeof Q != "function") throw new TypeError("Cannot use 'in' operator on non-object"); return typeof C == "function" ? Q === C : C.has(Q); }, X = function(C, Q, k) { if (Q != null) { if (typeof Q != "object" && typeof Q != "function") throw new TypeError("Object expected."); var M, O; if (k) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); M = Q[Symbol.asyncDispose]; } if (M === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); M = Q[Symbol.dispose], k && (O = M); } if (typeof M != "function") throw new TypeError("Object not disposable."); O && (M = function() { try { O.call(this); } catch (A) { return Promise.reject(A); } }), C.stack.push({ value: Q, dispose: M, async: k }); } else k && C.stack.push({ async: !0 }); return Q; }; var L = typeof SuppressedError == "function" ? SuppressedError : function(C, Q, k) { var M = new Error(k); return M.name = "SuppressedError", M.error = C, M.suppressed = Q, M; }; V = function(C) { function Q(A) { C.error = C.hasError ? new L(A, C.error, "An error was suppressed during disposal.") : A, C.hasError = !0; } var k, M = 0; function O() { for (; k = C.stack.pop(); ) try { if (!k.async && M === 1) return M = 0, C.stack.push(k), Promise.resolve().then(O); if (k.dispose) { var A = k.dispose.call(k.value); if (k.async) return M |= 2, Promise.resolve(A).then(O, function(F) { return Q(F), O(); }); } else M |= 1; } catch (F) { Q(F); } if (M === 1) return C.hasError ? Promise.reject(C.error) : Promise.resolve(); if (C.hasError) throw C.error; } return O(); }, K = function(C, Q) { return typeof C == "string" && /^\.\.?\//.test(C) ? C.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(k, M, O, A, F) { return M ? Q ? ".jsx" : ".js" : O && (!A || !F) ? k : O + A + "." + F.toLowerCase() + "js"; }) : C; }, $("__extends", e), $("__assign", n), $("__rest", r), $("__decorate", i), $("__param", o), $("__esDecorate", a), $("__runInitializers", s), $("__propKey", c), $("__setFunctionName", u), $("__metadata", d), $("__awaiter", p), $("__generator", f), $("__exportStar", m), $("__createBinding", D), $("__values", h), $("__read", y), $("__spread", x), $("__spreadArrays", g), $("__spreadArray", b), $("__await", S), $("__asyncGenerator", E), $("__asyncDelegator", T), $("__asyncValues", U), $("__makeTemplateObject", q), $("__importStar", Y), $("__importDefault", H), $("__classPrivateFieldGet", G), $("__classPrivateFieldSet", J), $("__classPrivateFieldIn", B), $("__addDisposableResource", X), $("__disposeResources", V), $("__rewriteRelativeImportExtension", K); }); })(xw)), xw.exports; } var Efe = /* @__PURE__ */ _fe(); const Afe = /* @__PURE__ */ ra(Efe), { __extends: pCe, __assign: fCe, __rest: hCe, __decorate: R, __param: mCe, __esDecorate: gCe, __runInitializers: yCe, __propKey: bCe, __setFunctionName: vCe, __metadata: xCe, __awaiter: wCe, __generator: SCe, __exportStar: _Ce, __createBinding: ECe, __values: ACe, __read: ICe, __spread: CCe, __spreadArrays: TCe, __spreadArray: kCe, __await: NCe, __asyncGenerator: PCe, __asyncDelegator: DCe, __asyncValues: OCe, __makeTemplateObject: FCe, __importStar: MCe, __importDefault: RCe, __classPrivateFieldGet: Be, __classPrivateFieldSet: mt, __classPrivateFieldIn: BCe, __addDisposableResource: UCe, __disposeResources: LCe, __rewriteRelativeImportExtension: QCe } = Afe; class TN { static isIPv4(e) { return /^(\d{1,3}\.){3}\d{1,3}$/.test(e); } static parseIPv4(e) { const n = e.split("."); if (n.length !== 4) throw new Error("Invalid IPv4 address"); return n.map((r) => { const i = parseInt(r, 10); if (isNaN(i) || i < 0 || i > 255) throw new Error("Invalid IPv4 address part"); return i; }); } static parseIPv6(e) { const r = this.expandIPv6(e).split(":"); if (r.length !== 8) throw new Error("Invalid IPv6 address"); return r.reduce((i, o) => { const a = parseInt(o, 16); if (isNaN(a) || a < 0 || a > 65535) throw new Error("Invalid IPv6 address part"); return i.push(a >> 8 & 255), i.push(a & 255), i; }, []); } static expandIPv6(e) { if (!e.includes("::")) return e; const n = e.split("::"); if (n.length > 2) throw new Error("Invalid IPv6 address"); const r = n[0] ? n[0].split(":") : [], i = n[1] ? n[1].split(":") : [], o = 8 - (r.length + i.length); if (o < 0) throw new Error("Invalid IPv6 address"); return [...r, ...Array(o).fill("0"), ...i].join(":"); } static formatIPv6(e) { const n = []; for (let r = 0; r < 16; r += 2) n.push((e[r] << 8 | e[r + 1]).toString(16)); return this.compressIPv6(n.join(":")); } static compressIPv6(e) { const n = e.split(":"); let r = -1, i = 0, o = -1, a = 0; for (let s = 0; s < n.length; s++) n[s] === "0" ? (o === -1 && (o = s), a++) : (a > i && (r = o, i = a), o = -1, a = 0); if (a > i && (r = o, i = a), i > 1) { const s = n.slice(0, r).join(":"), c = n.slice(r + i).join(":"); return `${s}::${c}`; } return e; } static parseCIDR(e) { const [n, r] = e.split("/"), i = parseInt(r, 10); if (this.isIPv4(n)) { if (i < 0 || i > 32) throw new Error("Invalid IPv4 prefix length"); return [this.parseIPv4(n), i]; } else { if (i < 0 || i > 128) throw new Error("Invalid IPv6 prefix length"); return [this.parseIPv6(n), i]; } } static decodeIP(e) { if (e.length === 64 && parseInt(e, 16) === 0) return "::/0"; if (e.length !== 16) return e; const n = parseInt(e.slice(8), 16).toString(2).split("").reduce((i, o) => i + +o, 0); let r = e.slice(0, 8).replace(/(.{2})/g, (i) => `${parseInt(i, 16)}.`); return r = r.slice(0, -1), `${r}/${n}`; } static toString(e) { const n = new Uint8Array(e); if (n.length === 4) return Array.from(n).join("."); if (n.length === 16) return this.formatIPv6(n); if (n.length === 8 || n.length === 32) { const r = n.length / 2, i = n.slice(0, r), o = n.slice(r); if (n.every((c) => c === 0)) return n.length === 8 ? "0.0.0.0/0" : "::/0"; const s = o.reduce((c, u) => c + (u.toString(2).match(/1/g) || []).length, 0); return n.length === 8 ? `${Array.from(i).join(".")}/${s}` : `${this.formatIPv6(i)}/${s}`; } return this.decodeIP(Le.ToHex(e)); } static fromString(e) { if (e.includes("/")) { const [r, i] = this.parseCIDR(e), o = new Uint8Array(r.length); let a = i; for (let c = 0; c < o.length; c++) a >= 8 ? (o[c] = 255, a -= 8) : a > 0 && (o[c] = 255 << 8 - a, a = 0); const s = new Uint8Array(r.length * 2); return s.set(r, 0), s.set(o, r.length), s.buffer; } const n = this.isIPv4(e) ? this.parseIPv4(e) : this.parseIPv6(e); return new Uint8Array(n).buffer; } } var t_, n_, r_; let vr = class { constructor(e = {}) { Object.assign(this, e); } toString() { return this.bmpString || this.printableString || this.teletexString || this.universalString || this.utf8String || ""; } }; R([ z({ type: te.TeletexString }) ], vr.prototype, "teletexString", void 0); R([ z({ type: te.PrintableString }) ], vr.prototype, "printableString", void 0); R([ z({ type: te.UniversalString }) ], vr.prototype, "universalString", void 0); R([ z({ type: te.Utf8String }) ], vr.prototype, "utf8String", void 0); R([ z({ type: te.BmpString }) ], vr.prototype, "bmpString", void 0); vr = R([ _e({ type: ye.Choice }) ], vr); let Vu = class extends vr { constructor(e = {}) { super(e), Object.assign(this, e); } toString() { return this.ia5String || (this.anyValue ? Le.ToHex(this.anyValue) : super.toString()); } }; R([ z({ type: te.IA5String }) ], Vu.prototype, "ia5String", void 0); R([ z({ type: te.Any }) ], Vu.prototype, "anyValue", void 0); Vu = R([ _e({ type: ye.Choice }) ], Vu); class v1 { constructor(e = {}) { this.type = "", this.value = new Vu(), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], v1.prototype, "type", void 0); R([ z({ type: Vu }) ], v1.prototype, "value", void 0); let Yu = t_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, t_.prototype); } }; Yu = t_ = R([ _e({ type: ye.Set, itemType: v1 }) ], Yu); let i_ = n_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, n_.prototype); } }; i_ = n_ = R([ _e({ type: ye.Sequence, itemType: Yu }) ], i_); let Un = r_ = class extends i_ { constructor(e) { super(e), Object.setPrototypeOf(this, r_.prototype); } }; Un = r_ = R([ _e({ type: ye.Sequence }) ], Un); const Ife = { fromASN: (t) => TN.toString(bg.fromASN(t)), toASN: (t) => bg.toASN(TN.fromString(t)) }; class Pp { constructor(e = {}) { this.typeId = "", this.value = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], Pp.prototype, "typeId", void 0); R([ z({ type: te.Any, context: 0 }) ], Pp.prototype, "value", void 0); class RA { constructor(e = {}) { this.partyName = new vr(), Object.assign(this, e); } } R([ z({ type: vr, optional: !0, context: 0, implicit: !0 }) ], RA.prototype, "nameAssigner", void 0); R([ z({ type: vr, context: 1, implicit: !0 }) ], RA.prototype, "partyName", void 0); let ct = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: Pp, context: 0, implicit: !0 }) ], ct.prototype, "otherName", void 0); R([ z({ type: te.IA5String, context: 1, implicit: !0 }) ], ct.prototype, "rfc822Name", void 0); R([ z({ type: te.IA5String, context: 2, implicit: !0 }) ], ct.prototype, "dNSName", void 0); R([ z({ type: te.Any, context: 3, implicit: !0 }) ], ct.prototype, "x400Address", void 0); R([ z({ type: Un, context: 4, implicit: !1 }) ], ct.prototype, "directoryName", void 0); R([ z({ type: RA, context: 5 }) ], ct.prototype, "ediPartyName", void 0); R([ z({ type: te.IA5String, context: 6, implicit: !0 }) ], ct.prototype, "uniformResourceIdentifier", void 0); R([ z({ type: te.OctetString, context: 7, implicit: !0, converter: Ife }) ], ct.prototype, "iPAddress", void 0); R([ z({ type: te.ObjectIdentifier, context: 8, implicit: !0 }) ], ct.prototype, "registeredID", void 0); ct = R([ _e({ type: ye.Choice }) ], ct); const BA = "1.3.6.1.5.5.7", Cfe = `${BA}.1`, Ll = `${BA}.3`, x1 = `${BA}.48`, kN = `${x1}.1`, NN = `${x1}.2`, PN = `${x1}.3`, DN = `${x1}.5`, Ro = "2.5.29"; var o_; const a_ = `${Cfe}.1`; class Tf { constructor(e = {}) { this.accessMethod = "", this.accessLocation = new ct(), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], Tf.prototype, "accessMethod", void 0); R([ z({ type: ct }) ], Tf.prototype, "accessLocation", void 0); let Cu = o_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, o_.prototype); } }; Cu = o_ = R([ _e({ type: ye.Sequence, itemType: Tf }) ], Cu); const s_ = `${Ro}.35`; class UA extends je { } class cc { constructor(e = {}) { e && Object.assign(this, e); } } R([ z({ type: UA, context: 0, optional: !0, implicit: !0 }) ], cc.prototype, "keyIdentifier", void 0); R([ z({ type: ct, context: 1, optional: !0, implicit: !0, repeated: "sequence" }) ], cc.prototype, "authorityCertIssuer", void 0); R([ z({ type: te.Integer, context: 2, optional: !0, implicit: !0, converter: en }) ], cc.prototype, "authorityCertSerialNumber", void 0); const LA = `${Ro}.19`; class Dp { constructor(e = {}) { this.cA = !1, Object.assign(this, e); } } R([ z({ type: te.Boolean, defaultValue: !1 }) ], Dp.prototype, "cA", void 0); R([ z({ type: te.Integer, optional: !0 }) ], Dp.prototype, "pathLenConstraint", void 0); var c_; let Cr = c_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, c_.prototype); } }; Cr = c_ = R([ _e({ type: ye.Sequence, itemType: ct }) ], Cr); var u_; let ON = u_ = class extends Cr { constructor(e) { super(e), Object.setPrototypeOf(this, u_.prototype); } }; ON = u_ = R([ _e({ type: ye.Sequence }) ], ON); var l_; const D9 = `${Ro}.32`; let Fa = class { constructor(e = {}) { Object.assign(this, e); } toString() { return this.ia5String || this.visibleString || this.bmpString || this.utf8String || ""; } }; R([ z({ type: te.IA5String }) ], Fa.prototype, "ia5String", void 0); R([ z({ type: te.VisibleString }) ], Fa.prototype, "visibleString", void 0); R([ z({ type: te.BmpString }) ], Fa.prototype, "bmpString", void 0); R([ z({ type: te.Utf8String }) ], Fa.prototype, "utf8String", void 0); Fa = R([ _e({ type: ye.Choice }) ], Fa); class QA { constructor(e = {}) { this.organization = new Fa(), this.noticeNumbers = [], Object.assign(this, e); } } R([ z({ type: Fa }) ], QA.prototype, "organization", void 0); R([ z({ type: te.Integer, repeated: "sequence" }) ], QA.prototype, "noticeNumbers", void 0); class jA { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: QA, optional: !0 }) ], jA.prototype, "noticeRef", void 0); R([ z({ type: Fa, optional: !0 }) ], jA.prototype, "explicitText", void 0); let vg = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: te.IA5String }) ], vg.prototype, "cPSuri", void 0); R([ z({ type: jA }) ], vg.prototype, "userNotice", void 0); vg = R([ _e({ type: ye.Choice }) ], vg); class $A { constructor(e = {}) { this.policyQualifierId = "", this.qualifier = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], $A.prototype, "policyQualifierId", void 0); R([ z({ type: te.Any }) ], $A.prototype, "qualifier", void 0); class w1 { constructor(e = {}) { this.policyIdentifier = "", Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], w1.prototype, "policyIdentifier", void 0); R([ z({ type: $A, repeated: "sequence", optional: !0 }) ], w1.prototype, "policyQualifiers", void 0); let xg = l_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, l_.prototype); } }; xg = l_ = R([ _e({ type: ye.Sequence, itemType: w1 }) ], xg); let wg = class { constructor(e = 0) { this.value = e; } }; R([ z({ type: te.Integer }) ], wg.prototype, "value", void 0); wg = R([ _e({ type: ye.Choice }) ], wg); let FN = class extends wg { }; FN = R([ _e({ type: ye.Choice }) ], FN); var d_; const p_ = `${Ro}.31`; var ro; (function(t) { t[t.unused = 1] = "unused", t[t.keyCompromise = 2] = "keyCompromise", t[t.cACompromise = 4] = "cACompromise", t[t.affiliationChanged = 8] = "affiliationChanged", t[t.superseded = 16] = "superseded", t[t.cessationOfOperation = 32] = "cessationOfOperation", t[t.certificateHold = 64] = "certificateHold", t[t.privilegeWithdrawn = 128] = "privilegeWithdrawn", t[t.aACompromise = 256] = "aACompromise"; })(ro || (ro = {})); class O9 extends b1 { toJSON() { const e = [], n = this.toNumber(); return n & ro.aACompromise && e.push("aACompromise"), n & ro.affiliationChanged && e.push("affiliationChanged"), n & ro.cACompromise && e.push("cACompromise"), n & ro.certificateHold && e.push("certificateHold"), n & ro.cessationOfOperation && e.push("cessationOfOperation"), n & ro.keyCompromise && e.push("keyCompromise"), n & ro.privilegeWithdrawn && e.push("privilegeWithdrawn"), n & ro.superseded && e.push("superseded"), n & ro.unused && e.push("unused"), e; } toString() { return `[${this.toJSON().join(", ")}]`; } } let Ac = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: ct, context: 0, repeated: "sequence", implicit: !0 }) ], Ac.prototype, "fullName", void 0); R([ z({ type: Yu, context: 1, implicit: !0 }) ], Ac.prototype, "nameRelativeToCRLIssuer", void 0); Ac = R([ _e({ type: ye.Choice }) ], Ac); class Ql { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Ac, context: 0, optional: !0 }) ], Ql.prototype, "distributionPoint", void 0); R([ z({ type: O9, context: 1, optional: !0, implicit: !0 }) ], Ql.prototype, "reasons", void 0); R([ z({ type: ct, context: 2, optional: !0, repeated: "sequence", implicit: !0 }) ], Ql.prototype, "cRLIssuer", void 0); let Du = d_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, d_.prototype); } }; Du = d_ = R([ _e({ type: ye.Sequence, itemType: Ql }) ], Du); var f_; let MN = f_ = class extends Du { constructor(e) { super(e), Object.setPrototypeOf(this, f_.prototype); } }; MN = f_ = R([ _e({ type: ye.Sequence, itemType: Ql }) ], MN); class Ar { constructor(e = {}) { this.onlyContainsUserCerts = Ar.ONLY, this.onlyContainsCACerts = Ar.ONLY, this.indirectCRL = Ar.ONLY, this.onlyContainsAttributeCerts = Ar.ONLY, Object.assign(this, e); } } Ar.ONLY = !1; R([ z({ type: Ac, context: 0, optional: !0 }) ], Ar.prototype, "distributionPoint", void 0); R([ z({ type: te.Boolean, context: 1, defaultValue: Ar.ONLY, implicit: !0 }) ], Ar.prototype, "onlyContainsUserCerts", void 0); R([ z({ type: te.Boolean, context: 2, defaultValue: Ar.ONLY, implicit: !0 }) ], Ar.prototype, "onlyContainsCACerts", void 0); R([ z({ type: O9, context: 3, optional: !0, implicit: !0 }) ], Ar.prototype, "onlySomeReasons", void 0); R([ z({ type: te.Boolean, context: 4, defaultValue: Ar.ONLY, implicit: !0 }) ], Ar.prototype, "indirectCRL", void 0); R([ z({ type: te.Boolean, context: 5, defaultValue: Ar.ONLY, implicit: !0 }) ], Ar.prototype, "onlyContainsAttributeCerts", void 0); const Tfe = `${Ro}.21`; var up; (function(t) { t[t.unspecified = 0] = "unspecified", t[t.keyCompromise = 1] = "keyCompromise", t[t.cACompromise = 2] = "cACompromise", t[t.affiliationChanged = 3] = "affiliationChanged", t[t.superseded = 4] = "superseded", t[t.cessationOfOperation = 5] = "cessationOfOperation", t[t.certificateHold = 6] = "certificateHold", t[t.removeFromCRL = 8] = "removeFromCRL", t[t.privilegeWithdrawn = 9] = "privilegeWithdrawn", t[t.aACompromise = 10] = "aACompromise"; })(up || (up = {})); let Sg = class { constructor(e = up.unspecified) { this.reason = up.unspecified, this.reason = e; } toJSON() { return up[this.reason]; } toString() { return this.toJSON(); } }; R([ z({ type: te.Enumerated }) ], Sg.prototype, "reason", void 0); Sg = R([ _e({ type: ye.Choice }) ], Sg); var h_; const GA = `${Ro}.37`; let Op = h_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, h_.prototype); } }; Op = h_ = R([ _e({ type: ye.Sequence, itemType: te.ObjectIdentifier }) ], Op); const kfe = `${Ll}.1`, Nfe = `${Ll}.2`, Pfe = `${Ll}.3`, Dfe = `${Ll}.4`, Ofe = `${Ll}.8`, Ffe = `${Ll}.9`; let m_ = class { constructor(e = new ArrayBuffer(0)) { this.value = e; } }; R([ z({ type: te.Integer, converter: en }) ], m_.prototype, "value", void 0); m_ = R([ _e({ type: ye.Choice }) ], m_); const Mfe = `${Ro}.24`; let _g = class { constructor(e) { this.value = /* @__PURE__ */ new Date(), e && (this.value = e); } }; R([ z({ type: te.GeneralizedTime }) ], _g.prototype, "value", void 0); _g = R([ _e({ type: ye.Choice }) ], _g); var g_; const F9 = `${Ro}.18`; let RN = g_ = class extends Cr { constructor(e) { super(e), Object.setPrototypeOf(this, g_.prototype); } }; RN = g_ = R([ _e({ type: ye.Sequence }) ], RN); const M9 = `${Ro}.15`; var io; (function(t) { t[t.digitalSignature = 1] = "digitalSignature", t[t.nonRepudiation = 2] = "nonRepudiation", t[t.keyEncipherment = 4] = "keyEncipherment", t[t.dataEncipherment = 8] = "dataEncipherment", t[t.keyAgreement = 16] = "keyAgreement", t[t.keyCertSign = 32] = "keyCertSign", t[t.cRLSign = 64] = "cRLSign", t[t.encipherOnly = 128] = "encipherOnly", t[t.decipherOnly = 256] = "decipherOnly"; })(io || (io = {})); class ww extends b1 { toJSON() { const e = this.toNumber(), n = []; return e & io.cRLSign && n.push("crlSign"), e & io.dataEncipherment && n.push("dataEncipherment"), e & io.decipherOnly && n.push("decipherOnly"), e & io.digitalSignature && n.push("digitalSignature"), e & io.encipherOnly && n.push("encipherOnly"), e & io.keyAgreement && n.push("keyAgreement"), e & io.keyCertSign && n.push("keyCertSign"), e & io.keyEncipherment && n.push("keyEncipherment"), e & io.nonRepudiation && n.push("nonRepudiation"), n; } toString() { return `[${this.toJSON().join(", ")}]`; } } var y_; class S1 { constructor(e = {}) { this.base = new ct(), this.minimum = 0, Object.assign(this, e); } } R([ z({ type: ct }) ], S1.prototype, "base", void 0); R([ z({ type: te.Integer, context: 0, defaultValue: 0, implicit: !0 }) ], S1.prototype, "minimum", void 0); R([ z({ type: te.Integer, context: 1, optional: !0, implicit: !0 }) ], S1.prototype, "maximum", void 0); let Eg = y_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, y_.prototype); } }; Eg = y_ = R([ _e({ type: ye.Sequence, itemType: S1 }) ], Eg); class R9 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Eg, context: 0, optional: !0, implicit: !0 }) ], R9.prototype, "permittedSubtrees", void 0); R([ z({ type: Eg, context: 1, optional: !0, implicit: !0 }) ], R9.prototype, "excludedSubtrees", void 0); class B9 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: te.Integer, context: 0, implicit: !0, optional: !0, converter: en }) ], B9.prototype, "requireExplicitPolicy", void 0); R([ z({ type: te.Integer, context: 1, implicit: !0, optional: !0, converter: en }) ], B9.prototype, "inhibitPolicyMapping", void 0); var b_; class qA { constructor(e = {}) { this.issuerDomainPolicy = "", this.subjectDomainPolicy = "", Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], qA.prototype, "issuerDomainPolicy", void 0); R([ z({ type: te.ObjectIdentifier }) ], qA.prototype, "subjectDomainPolicy", void 0); let BN = b_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, b_.prototype); } }; BN = b_ = R([ _e({ type: ye.Sequence, itemType: qA }) ], BN); var v_; const zA = `${Ro}.17`; let Ag = v_ = class extends Cr { constructor(e) { super(e), Object.setPrototypeOf(this, v_.prototype); } }; Ag = v_ = R([ _e({ type: ye.Sequence }) ], Ag); let Ma = class { constructor(e = {}) { this.type = "", this.values = [], Object.assign(this, e); } }; R([ z({ type: te.ObjectIdentifier }) ], Ma.prototype, "type", void 0); R([ z({ type: te.Any, repeated: "set" }) ], Ma.prototype, "values", void 0); var x_; let UN = x_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, x_.prototype); } }; UN = x_ = R([ _e({ type: ye.Sequence, itemType: Ma }) ], UN); const U9 = `${Ro}.14`; class xs extends UA { } class L9 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: te.GeneralizedTime, context: 0, implicit: !0, optional: !0 }) ], L9.prototype, "notBefore", void 0); R([ z({ type: te.GeneralizedTime, context: 1, implicit: !0, optional: !0 }) ], L9.prototype, "notAfter", void 0); var lp; (function(t) { t[t.keyUpdateAllowed = 1] = "keyUpdateAllowed", t[t.newExtensions = 2] = "newExtensions", t[t.pKIXCertificate = 4] = "pKIXCertificate"; })(lp || (lp = {})); class Q9 extends b1 { toJSON() { const e = [], n = this.toNumber(); return n & lp.pKIXCertificate && e.push("pKIXCertificate"), n & lp.newExtensions && e.push("newExtensions"), n & lp.keyUpdateAllowed && e.push("keyUpdateAllowed"), e; } toString() { return `[${this.toJSON().join(", ")}]`; } } class j9 { constructor(e = {}) { this.entrustVers = "", this.entrustInfoFlags = new Q9(), Object.assign(this, e); } } R([ z({ type: te.GeneralString }) ], j9.prototype, "entrustVers", void 0); R([ z({ type: Q9 }) ], j9.prototype, "entrustInfoFlags", void 0); var w_; let LN = w_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, w_.prototype); } }; LN = w_ = R([ _e({ type: ye.Sequence, itemType: Tf }) ], LN); class Fe { constructor(e = {}) { this.algorithm = "", Object.assign(this, e); } isEqual(e) { return e instanceof Fe && e.algorithm == this.algorithm && (e.parameters && this.parameters && OB(e.parameters, this.parameters) || e.parameters === this.parameters); } } R([ z({ type: te.ObjectIdentifier }) ], Fe.prototype, "algorithm", void 0); R([ z({ type: te.Any, optional: !0 }) ], Fe.prototype, "parameters", void 0); class Wo { constructor(e = {}) { this.algorithm = new Fe(), this.subjectPublicKey = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Fe }) ], Wo.prototype, "algorithm", void 0); R([ z({ type: te.BitString }) ], Wo.prototype, "subjectPublicKey", void 0); let tr = class { constructor(e) { if (e) if (typeof e == "string" || typeof e == "number" || e instanceof Date) { const n = new Date(e); n.getUTCFullYear() > 2049 ? this.generalTime = n : this.utcTime = n; } else Object.assign(this, e); } getTime() { const e = this.utcTime || this.generalTime; if (!e) throw new Error("Cannot get time from CHOICE object"); return e; } }; R([ z({ type: te.UTCTime }) ], tr.prototype, "utcTime", void 0); R([ z({ type: te.GeneralizedTime }) ], tr.prototype, "generalTime", void 0); tr = R([ _e({ type: ye.Choice }) ], tr); class _1 { constructor(e) { this.notBefore = new tr(/* @__PURE__ */ new Date()), this.notAfter = new tr(/* @__PURE__ */ new Date()), e && (this.notBefore = new tr(e.notBefore), this.notAfter = new tr(e.notAfter)); } } R([ z({ type: tr }) ], _1.prototype, "notBefore", void 0); R([ z({ type: tr }) ], _1.prototype, "notAfter", void 0); var S_; let To = class $9 { constructor(e = {}) { this.extnID = "", this.critical = $9.CRITICAL, this.extnValue = new je(), Object.assign(this, e); } }; To.CRITICAL = !1; R([ z({ type: te.ObjectIdentifier }) ], To.prototype, "extnID", void 0); R([ z({ type: te.Boolean, defaultValue: To.CRITICAL }) ], To.prototype, "critical", void 0); R([ z({ type: je }) ], To.prototype, "extnValue", void 0); let Ic = S_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, S_.prototype); } }; Ic = S_ = R([ _e({ type: ye.Sequence, itemType: To }) ], Ic); var Ju; (function(t) { t[t.v1 = 0] = "v1", t[t.v2 = 1] = "v2", t[t.v3 = 2] = "v3"; })(Ju || (Ju = {})); class Xi { constructor(e = {}) { this.version = Ju.v1, this.serialNumber = new ArrayBuffer(0), this.signature = new Fe(), this.issuer = new Un(), this.validity = new _1(), this.subject = new Un(), this.subjectPublicKeyInfo = new Wo(), Object.assign(this, e); } } R([ z({ type: te.Integer, context: 0, defaultValue: Ju.v1 }) ], Xi.prototype, "version", void 0); R([ z({ type: te.Integer, converter: en }) ], Xi.prototype, "serialNumber", void 0); R([ z({ type: Fe }) ], Xi.prototype, "signature", void 0); R([ z({ type: Un }) ], Xi.prototype, "issuer", void 0); R([ z({ type: _1 }) ], Xi.prototype, "validity", void 0); R([ z({ type: Un }) ], Xi.prototype, "subject", void 0); R([ z({ type: Wo }) ], Xi.prototype, "subjectPublicKeyInfo", void 0); R([ z({ type: te.BitString, context: 1, implicit: !0, optional: !0 }) ], Xi.prototype, "issuerUniqueID", void 0); R([ z({ type: te.BitString, context: 2, implicit: !0, optional: !0 }) ], Xi.prototype, "subjectUniqueID", void 0); R([ z({ type: Ic, context: 3, optional: !0 }) ], Xi.prototype, "extensions", void 0); class ko { constructor(e = {}) { this.tbsCertificate = new Xi(), this.signatureAlgorithm = new Fe(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Xi, raw: !0 }) ], ko.prototype, "tbsCertificate", void 0); R([ z({ type: Fe }) ], ko.prototype, "signatureAlgorithm", void 0); R([ z({ type: te.BitString }) ], ko.prototype, "signatureValue", void 0); class mc { constructor(e = {}) { this.userCertificate = new ArrayBuffer(0), this.revocationDate = new tr(), Object.assign(this, e); } } R([ z({ type: te.Integer, converter: en }) ], mc.prototype, "userCertificate", void 0); R([ z({ type: tr }) ], mc.prototype, "revocationDate", void 0); R([ z({ type: To, optional: !0, repeated: "sequence" }) ], mc.prototype, "crlEntryExtensions", void 0); class Wa { constructor(e = {}) { this.signature = new Fe(), this.issuer = new Un(), this.thisUpdate = new tr(), Object.assign(this, e); } } R([ z({ type: te.Integer, optional: !0 }) ], Wa.prototype, "version", void 0); R([ z({ type: Fe }) ], Wa.prototype, "signature", void 0); R([ z({ type: Un }) ], Wa.prototype, "issuer", void 0); R([ z({ type: tr }) ], Wa.prototype, "thisUpdate", void 0); R([ z({ type: tr, optional: !0 }) ], Wa.prototype, "nextUpdate", void 0); R([ z({ type: mc, repeated: "sequence", optional: !0 }) ], Wa.prototype, "revokedCertificates", void 0); R([ z({ type: To, optional: !0, context: 0, repeated: "sequence" }) ], Wa.prototype, "crlExtensions", void 0); class E1 { constructor(e = {}) { this.tbsCertList = new Wa(), this.signatureAlgorithm = new Fe(), this.signature = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Wa, raw: !0 }) ], E1.prototype, "tbsCertList", void 0); R([ z({ type: Fe }) ], E1.prototype, "signatureAlgorithm", void 0); R([ z({ type: te.BitString }) ], E1.prototype, "signature", void 0); const QN = { "2.5.4.6": "C", "2.5.4.10": "O", "2.5.4.11": "OU", "2.5.4.3": "CN" }; function HA(t) { const e = Xr.parse(t, ko), n = e.tbsCertificate, r = { combined: "" }; n.issuer.forEach(([a]) => { const s = QN[a.type]; s && (r[s] = a.value.toString()); }), r.combined = jN(r); const i = { combined: "" }; n.subject.forEach(([a]) => { const s = QN[a.type]; s && (i[s] = a.value.toString()); }), i.combined = jN(i); let o = !1; if (n.extensions) for (const a of n.extensions) a.extnID === LA && (o = Xr.parse(a.extnValue, Dp).cA); return { issuer: r, subject: i, version: n.version, basicConstraintsCA: o, notBefore: n.validity.notBefore.getTime(), notAfter: n.validity.notAfter.getTime(), parsedCertificate: e }; } function jN(t) { const e = []; return t.C && e.push(t.C), t.O && e.push(t.O), t.OU && e.push(t.OU), t.CN && e.push(t.CN), e.join(" : "); } class jl { constructor(e = {}) { this.issuer = new Un(), this.serialNumber = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Un }) ], jl.prototype, "issuer", void 0); R([ z({ type: te.Integer, converter: en }) ], jl.prototype, "serialNumber", void 0); let Xu = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: xs, context: 0, implicit: !0 }) ], Xu.prototype, "subjectKeyIdentifier", void 0); R([ z({ type: jl }) ], Xu.prototype, "issuerAndSerialNumber", void 0); Xu = R([ _e({ type: ye.Choice }) ], Xu); var Ra; (function(t) { t[t.v0 = 0] = "v0", t[t.v1 = 1] = "v1", t[t.v2 = 2] = "v2", t[t.v3 = 3] = "v3", t[t.v4 = 4] = "v4", t[t.v5 = 5] = "v5"; })(Ra || (Ra = {})); let Fp = class extends Fe { }; Fp = R([ _e({ type: ye.Sequence }) ], Fp); let Ig = class extends Fe { }; Ig = R([ _e({ type: ye.Sequence }) ], Ig); let ta = class extends Fe { }; ta = R([ _e({ type: ye.Sequence }) ], ta); let Cg = class extends Fe { }; Cg = R([ _e({ type: ye.Sequence }) ], Cg); let $N = class extends Fe { }; $N = R([ _e({ type: ye.Sequence }) ], $N); let __ = class extends Fe { }; __ = R([ _e({ type: ye.Sequence }) ], __); let $l = class { constructor(e = {}) { this.attrType = "", this.attrValues = [], Object.assign(this, e); } }; R([ z({ type: te.ObjectIdentifier }) ], $l.prototype, "attrType", void 0); R([ z({ type: te.Any, repeated: "set" }) ], $l.prototype, "attrValues", void 0); var E_; class oa { constructor(e = {}) { this.version = Ra.v0, this.sid = new Xu(), this.digestAlgorithm = new Fp(), this.signatureAlgorithm = new Ig(), this.signature = new je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], oa.prototype, "version", void 0); R([ z({ type: Xu }) ], oa.prototype, "sid", void 0); R([ z({ type: Fp }) ], oa.prototype, "digestAlgorithm", void 0); R([ z({ type: $l, repeated: "set", context: 0, implicit: !0, optional: !0, raw: !0 }) ], oa.prototype, "signedAttrs", void 0); R([ z({ type: Ig }) ], oa.prototype, "signatureAlgorithm", void 0); R([ z({ type: je }) ], oa.prototype, "signature", void 0); R([ z({ type: $l, repeated: "set", context: 1, implicit: !0, optional: !0 }) ], oa.prototype, "unsignedAttrs", void 0); let Tg = E_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, E_.prototype); } }; Tg = E_ = R([ _e({ type: ye.Set, itemType: oa }) ], Tg); let GN = class extends oa { }; GN = R([ _e({ type: ye.Sequence }) ], GN); let qN = class extends tr { }; qN = R([ _e({ type: ye.Choice }) ], qN); class WA { constructor(e = {}) { this.acIssuer = new ct(), this.acSerial = 0, this.attrs = [], Object.assign(this, e); } } R([ z({ type: ct }) ], WA.prototype, "acIssuer", void 0); R([ z({ type: te.Integer }) ], WA.prototype, "acSerial", void 0); R([ z({ type: Ma, repeated: "sequence" }) ], WA.prototype, "attrs", void 0); var A_; let kg = A_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, A_.prototype); } }; kg = A_ = R([ _e({ type: ye.Sequence, itemType: te.ObjectIdentifier }) ], kg); class A1 { constructor(e = {}) { this.permitUnSpecified = !0, Object.assign(this, e); } } R([ z({ type: te.Integer, optional: !0 }) ], A1.prototype, "pathLenConstraint", void 0); R([ z({ type: kg, implicit: !0, context: 0, optional: !0 }) ], A1.prototype, "permittedAttrs", void 0); R([ z({ type: kg, implicit: !0, context: 1, optional: !0 }) ], A1.prototype, "excludedAttrs", void 0); R([ z({ type: te.Boolean, defaultValue: !0 }) ], A1.prototype, "permitUnSpecified", void 0); class Jc { constructor(e = {}) { this.issuer = new Cr(), this.serial = new ArrayBuffer(0), this.issuerUID = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Cr }) ], Jc.prototype, "issuer", void 0); R([ z({ type: te.Integer, converter: en }) ], Jc.prototype, "serial", void 0); R([ z({ type: te.BitString, optional: !0 }) ], Jc.prototype, "issuerUID", void 0); var I_; (function(t) { t[t.publicKey = 0] = "publicKey", t[t.publicKeyCert = 1] = "publicKeyCert", t[t.otherObjectTypes = 2] = "otherObjectTypes"; })(I_ || (I_ = {})); class Xc { constructor(e = {}) { this.digestedObjectType = I_.publicKey, this.digestAlgorithm = new Fe(), this.objectDigest = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.Enumerated }) ], Xc.prototype, "digestedObjectType", void 0); R([ z({ type: te.ObjectIdentifier, optional: !0 }) ], Xc.prototype, "otherObjectTypeID", void 0); R([ z({ type: Fe }) ], Xc.prototype, "digestAlgorithm", void 0); R([ z({ type: te.BitString }) ], Xc.prototype, "objectDigest", void 0); class I1 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Cr, optional: !0 }) ], I1.prototype, "issuerName", void 0); R([ z({ type: Jc, context: 0, implicit: !0, optional: !0 }) ], I1.prototype, "baseCertificateID", void 0); R([ z({ type: Xc, context: 1, implicit: !0, optional: !0 }) ], I1.prototype, "objectDigestInfo", void 0); let Zu = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: ct, repeated: "sequence" }) ], Zu.prototype, "v1Form", void 0); R([ z({ type: I1, context: 0, implicit: !0 }) ], Zu.prototype, "v2Form", void 0); Zu = R([ _e({ type: ye.Choice }) ], Zu); class C1 { constructor(e = {}) { this.notBeforeTime = /* @__PURE__ */ new Date(), this.notAfterTime = /* @__PURE__ */ new Date(), Object.assign(this, e); } } R([ z({ type: te.GeneralizedTime }) ], C1.prototype, "notBeforeTime", void 0); R([ z({ type: te.GeneralizedTime }) ], C1.prototype, "notAfterTime", void 0); class kf { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Jc, implicit: !0, context: 0, optional: !0 }) ], kf.prototype, "baseCertificateID", void 0); R([ z({ type: Cr, implicit: !0, context: 1, optional: !0 }) ], kf.prototype, "entityName", void 0); R([ z({ type: Xc, implicit: !0, context: 2, optional: !0 }) ], kf.prototype, "objectDigestInfo", void 0); var C_; (function(t) { t[t.v2 = 1] = "v2"; })(C_ || (C_ = {})); class Bo { constructor(e = {}) { this.version = C_.v2, this.holder = new kf(), this.issuer = new Zu(), this.signature = new Fe(), this.serialNumber = new ArrayBuffer(0), this.attrCertValidityPeriod = new C1(), this.attributes = [], Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Bo.prototype, "version", void 0); R([ z({ type: kf }) ], Bo.prototype, "holder", void 0); R([ z({ type: Zu }) ], Bo.prototype, "issuer", void 0); R([ z({ type: Fe }) ], Bo.prototype, "signature", void 0); R([ z({ type: te.Integer, converter: en }) ], Bo.prototype, "serialNumber", void 0); R([ z({ type: C1 }) ], Bo.prototype, "attrCertValidityPeriod", void 0); R([ z({ type: Ma, repeated: "sequence" }) ], Bo.prototype, "attributes", void 0); R([ z({ type: te.BitString, optional: !0 }) ], Bo.prototype, "issuerUniqueID", void 0); R([ z({ type: Ic, optional: !0 }) ], Bo.prototype, "extensions", void 0); class T1 { constructor(e = {}) { this.acinfo = new Bo(), this.signatureAlgorithm = new Fe(), this.signatureValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Bo }) ], T1.prototype, "acinfo", void 0); R([ z({ type: Fe }) ], T1.prototype, "signatureAlgorithm", void 0); R([ z({ type: te.BitString }) ], T1.prototype, "signatureValue", void 0); var Ng; (function(t) { t[t.unmarked = 1] = "unmarked", t[t.unclassified = 2] = "unclassified", t[t.restricted = 4] = "restricted", t[t.confidential = 8] = "confidential", t[t.secret = 16] = "secret", t[t.topSecret = 32] = "topSecret"; })(Ng || (Ng = {})); class T_ extends b1 { } class KA { constructor(e = {}) { this.type = "", this.value = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier, implicit: !0, context: 0 }) ], KA.prototype, "type", void 0); R([ z({ type: te.Any, implicit: !0, context: 1 }) ], KA.prototype, "value", void 0); class VA { constructor(e = {}) { this.policyId = "", this.classList = new T_(Ng.unclassified), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], VA.prototype, "policyId", void 0); R([ z({ type: T_, defaultValue: new T_(Ng.unclassified) }) ], VA.prototype, "classList", void 0); R([ z({ type: KA, repeated: "set" }) ], VA.prototype, "securityCategories", void 0); class k1 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: je }) ], k1.prototype, "cotets", void 0); R([ z({ type: te.ObjectIdentifier }) ], k1.prototype, "oid", void 0); R([ z({ type: te.Utf8String }) ], k1.prototype, "string", void 0); class G9 { constructor(e = {}) { this.values = [], Object.assign(this, e); } } R([ z({ type: Cr, implicit: !0, context: 0, optional: !0 }) ], G9.prototype, "policyAuthority", void 0); R([ z({ type: k1, repeated: "sequence" }) ], G9.prototype, "values", void 0); var k_; class N1 { constructor(e = {}) { this.targetCertificate = new Jc(), Object.assign(this, e); } } R([ z({ type: Jc }) ], N1.prototype, "targetCertificate", void 0); R([ z({ type: ct, optional: !0 }) ], N1.prototype, "targetName", void 0); R([ z({ type: Xc, optional: !0 }) ], N1.prototype, "certDigestInfo", void 0); let el = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: ct, context: 0, implicit: !0 }) ], el.prototype, "targetName", void 0); R([ z({ type: ct, context: 1, implicit: !0 }) ], el.prototype, "targetGroup", void 0); R([ z({ type: N1, context: 2, implicit: !0 }) ], el.prototype, "targetCert", void 0); el = R([ _e({ type: ye.Choice }) ], el); let N_ = k_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, k_.prototype); } }; N_ = k_ = R([ _e({ type: ye.Sequence, itemType: el }) ], N_); var P_; let zN = P_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, P_.prototype); } }; zN = P_ = R([ _e({ type: ye.Sequence, itemType: N_ }) ], zN); class q9 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Cr, implicit: !0, context: 0, optional: !0 }) ], q9.prototype, "roleAuthority", void 0); R([ z({ type: ct, implicit: !0, context: 1 }) ], q9.prototype, "roleName", void 0); class YA { constructor(e = {}) { this.service = new ct(), this.ident = new ct(), Object.assign(this, e); } } R([ z({ type: ct }) ], YA.prototype, "service", void 0); R([ z({ type: ct }) ], YA.prototype, "ident", void 0); R([ z({ type: je, optional: !0 }) ], YA.prototype, "authInfo", void 0); var D_; class JA { constructor(e = {}) { this.otherCertFormat = "", this.otherCert = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], JA.prototype, "otherCertFormat", void 0); R([ z({ type: te.Any }) ], JA.prototype, "otherCert", void 0); let tl = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: ko }) ], tl.prototype, "certificate", void 0); R([ z({ type: T1, context: 2, implicit: !0 }) ], tl.prototype, "v2AttrCert", void 0); R([ z({ type: JA, context: 3, implicit: !0 }) ], tl.prototype, "other", void 0); tl = R([ _e({ type: ye.Choice }) ], tl); let Pg = D_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, D_.prototype); } }; Pg = D_ = R([ _e({ type: ye.Set, itemType: tl }) ], Pg); class Gl { constructor(e = {}) { this.contentType = "", this.content = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], Gl.prototype, "contentType", void 0); R([ z({ type: te.Any, context: 0 }) ], Gl.prototype, "content", void 0); let Mp = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: je }) ], Mp.prototype, "single", void 0); R([ z({ type: te.Any }) ], Mp.prototype, "any", void 0); Mp = R([ _e({ type: ye.Choice }) ], Mp); class P1 { constructor(e = {}) { this.eContentType = "", Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], P1.prototype, "eContentType", void 0); R([ z({ type: Mp, context: 0, optional: !0 }) ], P1.prototype, "eContent", void 0); let Rp = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: je, context: 0, implicit: !0, optional: !0 }) ], Rp.prototype, "value", void 0); R([ z({ type: je, converter: afe, context: 0, implicit: !0, optional: !0, repeated: "sequence" }) ], Rp.prototype, "constructedValue", void 0); Rp = R([ _e({ type: ye.Choice }) ], Rp); class Nf { constructor(e = {}) { this.contentType = "", this.contentEncryptionAlgorithm = new Cg(), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], Nf.prototype, "contentType", void 0); R([ z({ type: Cg }) ], Nf.prototype, "contentEncryptionAlgorithm", void 0); R([ z({ type: Rp, optional: !0 }) ], Nf.prototype, "encryptedContent", void 0); class D1 { constructor(e = {}) { this.keyAttrId = "", Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], D1.prototype, "keyAttrId", void 0); R([ z({ type: te.Any, optional: !0 }) ], D1.prototype, "keyAttr", void 0); var O_; class O1 { constructor(e = {}) { this.subjectKeyIdentifier = new xs(), Object.assign(this, e); } } R([ z({ type: xs }) ], O1.prototype, "subjectKeyIdentifier", void 0); R([ z({ type: te.GeneralizedTime, optional: !0 }) ], O1.prototype, "date", void 0); R([ z({ type: D1, optional: !0 }) ], O1.prototype, "other", void 0); let nl = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: O1, context: 0, implicit: !0, optional: !0 }) ], nl.prototype, "rKeyId", void 0); R([ z({ type: jl, optional: !0 }) ], nl.prototype, "issuerAndSerialNumber", void 0); nl = R([ _e({ type: ye.Choice }) ], nl); class XA { constructor(e = {}) { this.rid = new nl(), this.encryptedKey = new je(), Object.assign(this, e); } } R([ z({ type: nl }) ], XA.prototype, "rid", void 0); R([ z({ type: je }) ], XA.prototype, "encryptedKey", void 0); let Dg = O_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, O_.prototype); } }; Dg = O_ = R([ _e({ type: ye.Sequence, itemType: XA }) ], Dg); class ZA { constructor(e = {}) { this.algorithm = new Fe(), this.publicKey = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Fe }) ], ZA.prototype, "algorithm", void 0); R([ z({ type: te.BitString }) ], ZA.prototype, "publicKey", void 0); let Cc = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: xs, context: 0, implicit: !0, optional: !0 }) ], Cc.prototype, "subjectKeyIdentifier", void 0); R([ z({ type: ZA, context: 1, implicit: !0, optional: !0 }) ], Cc.prototype, "originatorKey", void 0); R([ z({ type: jl, optional: !0 }) ], Cc.prototype, "issuerAndSerialNumber", void 0); Cc = R([ _e({ type: ye.Choice }) ], Cc); class ql { constructor(e = {}) { this.version = Ra.v3, this.originator = new Cc(), this.keyEncryptionAlgorithm = new ta(), this.recipientEncryptedKeys = new Dg(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], ql.prototype, "version", void 0); R([ z({ type: Cc, context: 0 }) ], ql.prototype, "originator", void 0); R([ z({ type: je, context: 1, optional: !0 }) ], ql.prototype, "ukm", void 0); R([ z({ type: ta }) ], ql.prototype, "keyEncryptionAlgorithm", void 0); R([ z({ type: Dg }) ], ql.prototype, "recipientEncryptedKeys", void 0); let rl = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: xs, context: 0, implicit: !0 }) ], rl.prototype, "subjectKeyIdentifier", void 0); R([ z({ type: jl }) ], rl.prototype, "issuerAndSerialNumber", void 0); rl = R([ _e({ type: ye.Choice }) ], rl); class Pf { constructor(e = {}) { this.version = Ra.v0, this.rid = new rl(), this.keyEncryptionAlgorithm = new ta(), this.encryptedKey = new je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Pf.prototype, "version", void 0); R([ z({ type: rl }) ], Pf.prototype, "rid", void 0); R([ z({ type: ta }) ], Pf.prototype, "keyEncryptionAlgorithm", void 0); R([ z({ type: je }) ], Pf.prototype, "encryptedKey", void 0); class Df { constructor(e = {}) { this.keyIdentifier = new je(), Object.assign(this, e); } } R([ z({ type: je }) ], Df.prototype, "keyIdentifier", void 0); R([ z({ type: te.GeneralizedTime, optional: !0 }) ], Df.prototype, "date", void 0); R([ z({ type: D1, optional: !0 }) ], Df.prototype, "other", void 0); class Of { constructor(e = {}) { this.version = Ra.v4, this.kekid = new Df(), this.keyEncryptionAlgorithm = new ta(), this.encryptedKey = new je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Of.prototype, "version", void 0); R([ z({ type: Df }) ], Of.prototype, "kekid", void 0); R([ z({ type: ta }) ], Of.prototype, "keyEncryptionAlgorithm", void 0); R([ z({ type: je }) ], Of.prototype, "encryptedKey", void 0); class Ff { constructor(e = {}) { this.version = Ra.v0, this.keyEncryptionAlgorithm = new ta(), this.encryptedKey = new je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Ff.prototype, "version", void 0); R([ z({ type: __, context: 0, optional: !0 }) ], Ff.prototype, "keyDerivationAlgorithm", void 0); R([ z({ type: ta }) ], Ff.prototype, "keyEncryptionAlgorithm", void 0); R([ z({ type: je }) ], Ff.prototype, "encryptedKey", void 0); class e3 { constructor(e = {}) { this.oriType = "", this.oriValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], e3.prototype, "oriType", void 0); R([ z({ type: te.Any }) ], e3.prototype, "oriValue", void 0); let Es = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: Pf, optional: !0 }) ], Es.prototype, "ktri", void 0); R([ z({ type: ql, context: 1, implicit: !0, optional: !0 }) ], Es.prototype, "kari", void 0); R([ z({ type: Of, context: 2, implicit: !0, optional: !0 }) ], Es.prototype, "kekri", void 0); R([ z({ type: Ff, context: 3, implicit: !0, optional: !0 }) ], Es.prototype, "pwri", void 0); R([ z({ type: e3, context: 4, implicit: !0, optional: !0 }) ], Es.prototype, "ori", void 0); Es = R([ _e({ type: ye.Choice }) ], Es); var F_; let Og = F_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, F_.prototype); } }; Og = F_ = R([ _e({ type: ye.Set, itemType: Es }) ], Og); var M_; class F1 { constructor(e = {}) { this.otherRevInfoFormat = "", this.otherRevInfo = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], F1.prototype, "otherRevInfoFormat", void 0); R([ z({ type: te.Any }) ], F1.prototype, "otherRevInfo", void 0); let Fg = class { constructor(e = {}) { this.other = new F1(), Object.assign(this, e); } }; R([ z({ type: F1, context: 1, implicit: !0 }) ], Fg.prototype, "other", void 0); Fg = R([ _e({ type: ye.Choice }) ], Fg); let Mg = M_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, M_.prototype); } }; Mg = M_ = R([ _e({ type: ye.Set, itemType: Fg }) ], Mg); class t3 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: Pg, context: 0, implicit: !0, optional: !0 }) ], t3.prototype, "certs", void 0); R([ z({ type: Mg, context: 1, implicit: !0, optional: !0 }) ], t3.prototype, "crls", void 0); var R_; let B_ = R_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, R_.prototype); } }; B_ = R_ = R([ _e({ type: ye.Set, itemType: $l }) ], B_); class Mf { constructor(e = {}) { this.version = Ra.v0, this.recipientInfos = new Og(), this.encryptedContentInfo = new Nf(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Mf.prototype, "version", void 0); R([ z({ type: t3, context: 0, implicit: !0, optional: !0 }) ], Mf.prototype, "originatorInfo", void 0); R([ z({ type: Og }) ], Mf.prototype, "recipientInfos", void 0); R([ z({ type: Nf }) ], Mf.prototype, "encryptedContentInfo", void 0); R([ z({ type: B_, context: 1, implicit: !0, optional: !0 }) ], Mf.prototype, "unprotectedAttrs", void 0); const Rfe = "1.2.840.113549.1.7.2"; var U_; let Rg = U_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, U_.prototype); } }; Rg = U_ = R([ _e({ type: ye.Set, itemType: Fp }) ], Rg); class zl { constructor(e = {}) { this.version = Ra.v0, this.digestAlgorithms = new Rg(), this.encapContentInfo = new P1(), this.signerInfos = new Tg(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], zl.prototype, "version", void 0); R([ z({ type: Rg }) ], zl.prototype, "digestAlgorithms", void 0); R([ z({ type: P1 }) ], zl.prototype, "encapContentInfo", void 0); R([ z({ type: Pg, context: 0, implicit: !0, optional: !0 }) ], zl.prototype, "certificates", void 0); R([ z({ type: Mg, context: 1, implicit: !0, optional: !0 }) ], zl.prototype, "crls", void 0); R([ z({ type: Tg }) ], zl.prototype, "signerInfos", void 0); const il = "1.2.840.10045.2.1", n3 = "1.2.840.10045.4.1", z9 = "1.2.840.10045.4.3.1", r3 = "1.2.840.10045.4.3.2", i3 = "1.2.840.10045.4.3.3", o3 = "1.2.840.10045.4.3.4", L_ = "1.2.840.10045.3.1.7", Q_ = "1.3.132.0.34", HN = "1.3.132.0.35"; function Rf(t) { return new Fe({ algorithm: t }); } const Bfe = Rf(n3); Rf(z9); const Ufe = Rf(r3), Lfe = Rf(i3), Qfe = Rf(o3); let Bp = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: te.ObjectIdentifier }) ], Bp.prototype, "fieldType", void 0); R([ z({ type: te.Any }) ], Bp.prototype, "parameters", void 0); Bp = R([ _e({ type: ye.Sequence }) ], Bp); class jfe extends je { } let ol = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: te.OctetString }) ], ol.prototype, "a", void 0); R([ z({ type: te.OctetString }) ], ol.prototype, "b", void 0); R([ z({ type: te.BitString, optional: !0 }) ], ol.prototype, "seed", void 0); ol = R([ _e({ type: ye.Sequence }) ], ol); var j_; (function(t) { t[t.ecpVer1 = 1] = "ecpVer1"; })(j_ || (j_ = {})); let Ba = class { constructor(e = {}) { this.version = j_.ecpVer1, Object.assign(this, e); } }; R([ z({ type: te.Integer }) ], Ba.prototype, "version", void 0); R([ z({ type: Bp }) ], Ba.prototype, "fieldID", void 0); R([ z({ type: ol }) ], Ba.prototype, "curve", void 0); R([ z({ type: jfe }) ], Ba.prototype, "base", void 0); R([ z({ type: te.Integer, converter: en }) ], Ba.prototype, "order", void 0); R([ z({ type: te.Integer, optional: !0 }) ], Ba.prototype, "cofactor", void 0); Ba = R([ _e({ type: ye.Sequence }) ], Ba); let Ua = class { constructor(e = {}) { Object.assign(this, e); } }; R([ z({ type: te.ObjectIdentifier }) ], Ua.prototype, "namedCurve", void 0); R([ z({ type: te.Null }) ], Ua.prototype, "implicitCurve", void 0); R([ z({ type: Ba }) ], Ua.prototype, "specifiedCurve", void 0); Ua = R([ _e({ type: ye.Choice }) ], Ua); class M1 { constructor(e = {}) { this.version = 1, this.privateKey = new je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], M1.prototype, "version", void 0); R([ z({ type: je }) ], M1.prototype, "privateKey", void 0); R([ z({ type: Ua, context: 0, optional: !0 }) ], M1.prototype, "parameters", void 0); R([ z({ type: te.BitString, context: 1, optional: !0 }) ], M1.prototype, "publicKey", void 0); class Up { constructor(e = {}) { this.r = new ArrayBuffer(0), this.s = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.Integer, converter: en }) ], Up.prototype, "r", void 0); R([ z({ type: te.Integer, converter: en }) ], Up.prototype, "s", void 0); const ai = "1.2.840.113549.1.1", As = `${ai}.1`, $fe = `${ai}.7`, Gfe = `${ai}.9`, dp = `${ai}.10`, qfe = `${ai}.2`, zfe = `${ai}.4`, Bg = `${ai}.5`, Hfe = `${ai}.14`, $_ = `${ai}.11`, Ug = `${ai}.12`, Lg = `${ai}.13`, H9 = `${ai}.15`, W9 = `${ai}.16`, Qg = "1.3.14.3.2.26", K9 = "2.16.840.1.101.3.4.2.4", jg = "2.16.840.1.101.3.4.2.1", $g = "2.16.840.1.101.3.4.2.2", Gg = "2.16.840.1.101.3.4.2.3", Wfe = "2.16.840.1.101.3.4.2.5", Kfe = "2.16.840.1.101.3.4.2.6", Vfe = "1.2.840.113549.2.2", Yfe = "1.2.840.113549.2.5", R1 = `${ai}.8`; function qn(t) { return new Fe({ algorithm: t, parameters: null }); } qn(Vfe); qn(Yfe); const Tc = qn(Qg); qn(K9); qn(jg); qn($g); qn(Gg); qn(Wfe); qn(Kfe); const V9 = new Fe({ algorithm: R1, parameters: Te.serialize(Tc) }), Y9 = new Fe({ algorithm: Gfe, parameters: Te.serialize(bg.toASN(new Uint8Array([ 218, 57, 163, 238, 94, 107, 75, 13, 50, 85, 191, 239, 149, 96, 24, 144, 175, 216, 7, 9 ]).buffer)) }); qn(As); qn(qfe); qn(zfe); qn(Bg); qn(H9); qn(W9); qn(Ug); qn(Lg); qn(H9); qn(W9); class B1 { constructor(e = {}) { this.hashAlgorithm = new Fe(Tc), this.maskGenAlgorithm = new Fe({ algorithm: R1, parameters: Te.serialize(Tc) }), this.pSourceAlgorithm = new Fe(Y9), Object.assign(this, e); } } R([ z({ type: Fe, context: 0, defaultValue: Tc }) ], B1.prototype, "hashAlgorithm", void 0); R([ z({ type: Fe, context: 1, defaultValue: V9 }) ], B1.prototype, "maskGenAlgorithm", void 0); R([ z({ type: Fe, context: 2, defaultValue: Y9 }) ], B1.prototype, "pSourceAlgorithm", void 0); new Fe({ algorithm: $fe, parameters: Te.serialize(new B1()) }); class kc { constructor(e = {}) { this.hashAlgorithm = new Fe(Tc), this.maskGenAlgorithm = new Fe({ algorithm: R1, parameters: Te.serialize(Tc) }), this.saltLength = 20, this.trailerField = 1, Object.assign(this, e); } } R([ z({ type: Fe, context: 0, defaultValue: Tc }) ], kc.prototype, "hashAlgorithm", void 0); R([ z({ type: Fe, context: 1, defaultValue: V9 }) ], kc.prototype, "maskGenAlgorithm", void 0); R([ z({ type: te.Integer, context: 2, defaultValue: 20 }) ], kc.prototype, "saltLength", void 0); R([ z({ type: te.Integer, context: 3, defaultValue: 1 }) ], kc.prototype, "trailerField", void 0); new Fe({ algorithm: dp, parameters: Te.serialize(new kc()) }); class U1 { constructor(e = {}) { this.digestAlgorithm = new Fe(), this.digest = new je(), Object.assign(this, e); } } R([ z({ type: Fe }) ], U1.prototype, "digestAlgorithm", void 0); R([ z({ type: je }) ], U1.prototype, "digest", void 0); var G_; class L1 { constructor(e = {}) { this.prime = new ArrayBuffer(0), this.exponent = new ArrayBuffer(0), this.coefficient = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.Integer, converter: en }) ], L1.prototype, "prime", void 0); R([ z({ type: te.Integer, converter: en }) ], L1.prototype, "exponent", void 0); R([ z({ type: te.Integer, converter: en }) ], L1.prototype, "coefficient", void 0); let q_ = G_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, G_.prototype); } }; q_ = G_ = R([ _e({ type: ye.Sequence, itemType: L1 }) ], q_); class aa { constructor(e = {}) { this.version = 0, this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), this.privateExponent = new ArrayBuffer(0), this.prime1 = new ArrayBuffer(0), this.prime2 = new ArrayBuffer(0), this.exponent1 = new ArrayBuffer(0), this.exponent2 = new ArrayBuffer(0), this.coefficient = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], aa.prototype, "version", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "modulus", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "publicExponent", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "privateExponent", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "prime1", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "prime2", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "exponent1", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "exponent2", void 0); R([ z({ type: te.Integer, converter: en }) ], aa.prototype, "coefficient", void 0); R([ z({ type: q_, optional: !0 }) ], aa.prototype, "otherPrimeInfos", void 0); class Q1 { constructor(e = {}) { this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.Integer, converter: en }) ], Q1.prototype, "modulus", void 0); R([ z({ type: te.Integer, converter: en }) ], Q1.prototype, "publicExponent", void 0); var z_; (function(t) { t[t.Transient = 0] = "Transient", t[t.Singleton = 1] = "Singleton", t[t.ResolutionScoped = 2] = "ResolutionScoped", t[t.ContainerScoped = 3] = "ContainerScoped"; })(z_ || (z_ = {})); const Gr = z_; var Sw = { exports: {} }; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var WN; function Jfe() { return WN || (WN = 1, (function(t) { var e, n, r, i, o, a, s, c, u, d, p, f, m, h, y, x, g, b, S, E, T, U, q; (function(Y) { var H = typeof $n == "object" ? $n : typeof self == "object" ? self : typeof this == "object" ? this : {}; Y(G(H, G(t.exports))); function G(J, B) { return J !== H && (typeof Object.create == "function" ? Object.defineProperty(J, "__esModule", { value: !0 }) : J.__esModule = !0), function(D, X) { return J[D] = B ? B(D, X) : X; }; } })(function(Y) { var H = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(G, J) { G.__proto__ = J; } || function(G, J) { for (var B in J) J.hasOwnProperty(B) && (G[B] = J[B]); }; e = function(G, J) { H(G, J); function B() { this.constructor = G; } G.prototype = J === null ? Object.create(J) : (B.prototype = J.prototype, new B()); }, n = Object.assign || function(G) { for (var J, B = 1, D = arguments.length; B < D; B++) { J = arguments[B]; for (var X in J) Object.prototype.hasOwnProperty.call(J, X) && (G[X] = J[X]); } return G; }, r = function(G, J) { var B = {}; for (var D in G) Object.prototype.hasOwnProperty.call(G, D) && J.indexOf(D) < 0 && (B[D] = G[D]); if (G != null && typeof Object.getOwnPropertySymbols == "function") for (var X = 0, D = Object.getOwnPropertySymbols(G); X < D.length; X++) J.indexOf(D[X]) < 0 && Object.prototype.propertyIsEnumerable.call(G, D[X]) && (B[D[X]] = G[D[X]]); return B; }, i = function(G, J, B, D) { var X = arguments.length, V = X < 3 ? J : D === null ? D = Object.getOwnPropertyDescriptor(J, B) : D, K; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") V = Reflect.decorate(G, J, B, D); else for (var $ = G.length - 1; $ >= 0; $--) (K = G[$]) && (V = (X < 3 ? K(V) : X > 3 ? K(J, B, V) : K(J, B)) || V); return X > 3 && V && Object.defineProperty(J, B, V), V; }, o = function(G, J) { return function(B, D) { J(B, D, G); }; }, a = function(G, J) { if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(G, J); }, s = function(G, J, B, D) { function X(V) { return V instanceof B ? V : new B(function(K) { K(V); }); } return new (B || (B = Promise))(function(V, K) { function $(N) { try { I(D.next(N)); } catch (L) { K(L); } } function _(N) { try { I(D.throw(N)); } catch (L) { K(L); } } function I(N) { N.done ? V(N.value) : X(N.value).then($, _); } I((D = D.apply(G, J || [])).next()); }); }, c = function(G, J) { var B = { label: 0, sent: function() { if (V[0] & 1) throw V[1]; return V[1]; }, trys: [], ops: [] }, D, X, V, K; return K = { next: $(0), throw: $(1), return: $(2) }, typeof Symbol == "function" && (K[Symbol.iterator] = function() { return this; }), K; function $(I) { return function(N) { return _([I, N]); }; } function _(I) { if (D) throw new TypeError("Generator is already executing."); for (; B; ) try { if (D = 1, X && (V = I[0] & 2 ? X.return : I[0] ? X.throw || ((V = X.return) && V.call(X), 0) : X.next) && !(V = V.call(X, I[1])).done) return V; switch (X = 0, V && (I = [I[0] & 2, V.value]), I[0]) { case 0: case 1: V = I; break; case 4: return B.label++, { value: I[1], done: !1 }; case 5: B.label++, X = I[1], I = [0]; continue; case 7: I = B.ops.pop(), B.trys.pop(); continue; default: if (V = B.trys, !(V = V.length > 0 && V[V.length - 1]) && (I[0] === 6 || I[0] === 2)) { B = 0; continue; } if (I[0] === 3 && (!V || I[1] > V[0] && I[1] < V[3])) { B.label = I[1]; break; } if (I[0] === 6 && B.label < V[1]) { B.label = V[1], V = I; break; } if (V && B.label < V[2]) { B.label = V[2], B.ops.push(I); break; } V[2] && B.ops.pop(), B.trys.pop(); continue; } I = J.call(G, B); } catch (N) { I = [6, N], X = 0; } finally { D = V = 0; } if (I[0] & 5) throw I[1]; return { value: I[0] ? I[1] : void 0, done: !0 }; } }, q = function(G, J, B, D) { D === void 0 && (D = B), G[D] = J[B]; }, u = function(G, J) { for (var B in G) B !== "default" && !J.hasOwnProperty(B) && (J[B] = G[B]); }, d = function(G) { var J = typeof Symbol == "function" && Symbol.iterator, B = J && G[J], D = 0; if (B) return B.call(G); if (G && typeof G.length == "number") return { next: function() { return G && D >= G.length && (G = void 0), { value: G && G[D++], done: !G }; } }; throw new TypeError(J ? "Object is not iterable." : "Symbol.iterator is not defined."); }, p = function(G, J) { var B = typeof Symbol == "function" && G[Symbol.iterator]; if (!B) return G; var D = B.call(G), X, V = [], K; try { for (; (J === void 0 || J-- > 0) && !(X = D.next()).done; ) V.push(X.value); } catch ($) { K = { error: $ }; } finally { try { X && !X.done && (B = D.return) && B.call(D); } finally { if (K) throw K.error; } } return V; }, f = function() { for (var G = [], J = 0; J < arguments.length; J++) G = G.concat(p(arguments[J])); return G; }, m = function() { for (var G = 0, J = 0, B = arguments.length; J < B; J++) G += arguments[J].length; for (var D = Array(G), X = 0, J = 0; J < B; J++) for (var V = arguments[J], K = 0, $ = V.length; K < $; K++, X++) D[X] = V[K]; return D; }, h = function(G) { return this instanceof h ? (this.v = G, this) : new h(G); }, y = function(G, J, B) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var D = B.apply(G, J || []), X, V = []; return X = {}, K("next"), K("throw"), K("return"), X[Symbol.asyncIterator] = function() { return this; }, X; function K(C) { D[C] && (X[C] = function(Q) { return new Promise(function(k, M) { V.push([C, Q, k, M]) > 1 || $(C, Q); }); }); } function $(C, Q) { try { _(D[C](Q)); } catch (k) { L(V[0][3], k); } } function _(C) { C.value instanceof h ? Promise.resolve(C.value.v).then(I, N) : L(V[0][2], C); } function I(C) { $("next", C); } function N(C) { $("throw", C); } function L(C, Q) { C(Q), V.shift(), V.length && $(V[0][0], V[0][1]); } }, x = function(G) { var J, B; return J = {}, D("next"), D("throw", function(X) { throw X; }), D("return"), J[Symbol.iterator] = function() { return this; }, J; function D(X, V) { J[X] = G[X] ? function(K) { return (B = !B) ? { value: h(G[X](K)), done: X === "return" } : V ? V(K) : K; } : V; } }, g = function(G) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var J = G[Symbol.asyncIterator], B; return J ? J.call(G) : (G = typeof d == "function" ? d(G) : G[Symbol.iterator](), B = {}, D("next"), D("throw"), D("return"), B[Symbol.asyncIterator] = function() { return this; }, B); function D(V) { B[V] = G[V] && function(K) { return new Promise(function($, _) { K = G[V](K), X($, _, K.done, K.value); }); }; } function X(V, K, $, _) { Promise.resolve(_).then(function(I) { V({ value: I, done: $ }); }, K); } }, b = function(G, J) { return Object.defineProperty ? Object.defineProperty(G, "raw", { value: J }) : G.raw = J, G; }, S = function(G) { if (G && G.__esModule) return G; var J = {}; if (G != null) for (var B in G) Object.hasOwnProperty.call(G, B) && (J[B] = G[B]); return J.default = G, J; }, E = function(G) { return G && G.__esModule ? G : { default: G }; }, T = function(G, J) { if (!J.has(G)) throw new TypeError("attempted to get private field on non-instance"); return J.get(G); }, U = function(G, J, B) { if (!J.has(G)) throw new TypeError("attempted to set private field on non-instance"); return J.set(G, B), B; }, Y("__extends", e), Y("__assign", n), Y("__rest", r), Y("__decorate", i), Y("__param", o), Y("__metadata", a), Y("__awaiter", s), Y("__generator", c), Y("__exportStar", u), Y("__createBinding", q), Y("__values", d), Y("__read", p), Y("__spread", f), Y("__spreadArrays", m), Y("__await", h), Y("__asyncGenerator", y), Y("__asyncDelegator", x), Y("__asyncValues", g), Y("__makeTemplateObject", b), Y("__importStar", S), Y("__importDefault", E), Y("__classPrivateFieldGet", T), Y("__classPrivateFieldSet", U); }); })(Sw)), Sw.exports; } var Xfe = /* @__PURE__ */ Jfe(); const Zfe = /* @__PURE__ */ ra(Xfe), { __extends: a3, __assign: X6e, __rest: Z6e, __decorate: eTe, __param: tTe, __metadata: nTe, __awaiter: ehe, __generator: the, __exportStar: rTe, __createBinding: iTe, __values: em, __read: H_, __spread: ac, __spreadArrays: oTe, __await: aTe, __asyncGenerator: sTe, __asyncDelegator: cTe, __asyncValues: uTe, __makeTemplateObject: lTe, __importStar: dTe, __importDefault: pTe, __classPrivateFieldGet: fTe, __classPrivateFieldSet: hTe } = Zfe; var nhe = "injectionTokens"; function rhe(t) { var e = Reflect.getMetadata("design:paramtypes", t) || [], n = Reflect.getOwnMetadata(nhe, t) || {}; return Object.keys(n).forEach(function(r) { e[+r] = n[r]; }), e; } function J9(t) { return !!t.useClass; } function W_(t) { return !!t.useFactory; } var X9 = (function() { function t(e) { this.wrap = e, this.reflectMethods = [ "get", "getPrototypeOf", "setPrototypeOf", "getOwnPropertyDescriptor", "defineProperty", "has", "set", "deleteProperty", "apply", "construct", "ownKeys" ]; } return t.prototype.createProxy = function(e) { var n = this, r = {}, i = !1, o, a = function() { return i || (o = e(n.wrap()), i = !0), o; }; return new Proxy(r, this.createHandler(a)); }, t.prototype.createHandler = function(e) { var n = {}, r = function(i) { n[i] = function() { for (var o = [], a = 0; a < arguments.length; a++) o[a] = arguments[a]; o[0] = e(); var s = Reflect[i]; return s.apply(void 0, ac(o)); }; }; return this.reflectMethods.forEach(r), n; }, t; })(); function uu(t) { return typeof t == "string" || typeof t == "symbol"; } function ihe(t) { return typeof t == "object" && "token" in t && "multiple" in t; } function KN(t) { return typeof t == "object" && "token" in t && "transform" in t; } function ohe(t) { return typeof t == "function" || t instanceof X9; } function Fm(t) { return !!t.useToken; } function Mm(t) { return t.useValue != null; } function ahe(t) { return J9(t) || Mm(t) || Fm(t) || W_(t); } var s3 = (function() { function t() { this._registryMap = /* @__PURE__ */ new Map(); } return t.prototype.entries = function() { return this._registryMap.entries(); }, t.prototype.getAll = function(e) { return this.ensure(e), this._registryMap.get(e); }, t.prototype.get = function(e) { this.ensure(e); var n = this._registryMap.get(e); return n[n.length - 1] || null; }, t.prototype.set = function(e, n) { this.ensure(e), this._registryMap.get(e).push(n); }, t.prototype.setAll = function(e, n) { this._registryMap.set(e, n); }, t.prototype.has = function(e) { return this.ensure(e), this._registryMap.get(e).length > 0; }, t.prototype.clear = function() { this._registryMap.clear(); }, t.prototype.ensure = function(e) { this._registryMap.has(e) || this._registryMap.set(e, []); }, t; })(), she = (function(t) { a3(e, t); function e() { return t !== null && t.apply(this, arguments) || this; } return e; })(s3), tm = /* @__PURE__ */ (function() { function t() { this.scopedResolutions = /* @__PURE__ */ new Map(); } return t; })(); function che(t, e) { if (t === null) return "at position #" + e; var n = t.split(",")[e].trim(); return '"' + n + '" at position #' + e; } function uhe(t, e, n) { return n === void 0 && (n = " "), ac([t], e.message.split(` `).map(function(r) { return n + r; })).join(` `); } function lhe(t, e, n) { var r = H_(t.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), i = r[1], o = i === void 0 ? null : i, a = che(o, e); return uhe("Cannot inject the dependency " + a + ' of "' + t.name + '" constructor. Reason:', n); } function dhe(t) { if (typeof t.dispose != "function") return !1; var e = t.dispose; return !(e.length > 0); } var phe = (function(t) { a3(e, t); function e() { return t !== null && t.apply(this, arguments) || this; } return e; })(s3), fhe = (function(t) { a3(e, t); function e() { return t !== null && t.apply(this, arguments) || this; } return e; })(s3), hhe = /* @__PURE__ */ (function() { function t() { this.preResolution = new phe(), this.postResolution = new fhe(); } return t; })(), Z9 = /* @__PURE__ */ new Map(), mhe = (function() { function t(e) { this.parent = e, this._registry = new she(), this.interceptors = new hhe(), this.disposed = !1, this.disposables = /* @__PURE__ */ new Set(); } return t.prototype.register = function(e, n, r) { r === void 0 && (r = { lifecycle: Gr.Transient }), this.ensureNotDisposed(); var i; if (ahe(n) ? i = n : i = { useClass: n }, Fm(i)) for (var o = [e], a = i; a != null; ) { var s = a.useToken; if (o.includes(s)) throw new Error("Token registration cycle detected! " + ac(o, [s]).join(" -> ")); o.push(s); var c = this._registry.get(s); c && Fm(c.provider) ? a = c.provider : a = null; } if ((r.lifecycle === Gr.Singleton || r.lifecycle == Gr.ContainerScoped || r.lifecycle == Gr.ResolutionScoped) && (Mm(i) || W_(i))) throw new Error('Cannot use lifecycle "' + Gr[r.lifecycle] + '" with ValueProviders or FactoryProviders'); return this._registry.set(e, { provider: i, options: r }), this; }, t.prototype.registerType = function(e, n) { return this.ensureNotDisposed(), uu(n) ? this.register(e, { useToken: n }) : this.register(e, { useClass: n }); }, t.prototype.registerInstance = function(e, n) { return this.ensureNotDisposed(), this.register(e, { useValue: n }); }, t.prototype.registerSingleton = function(e, n) { if (this.ensureNotDisposed(), uu(e)) { if (uu(n)) return this.register(e, { useToken: n }, { lifecycle: Gr.Singleton }); if (n) return this.register(e, { useClass: n }, { lifecycle: Gr.Singleton }); throw new Error('Cannot register a type name as a singleton without a "to" token'); } var r = e; return n && !uu(n) && (r = n), this.register(e, { useClass: r }, { lifecycle: Gr.Singleton }); }, t.prototype.resolve = function(e, n, r) { n === void 0 && (n = new tm()), r === void 0 && (r = !1), this.ensureNotDisposed(); var i = this.getRegistration(e); if (!i && uu(e)) { if (r) return; throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"'); } if (this.executePreResolutionInterceptor(e, "Single"), i) { var o = this.resolveRegistration(i, n); return this.executePostResolutionInterceptor(e, o, "Single"), o; } if (ohe(e)) { var o = this.construct(e, n); return this.executePostResolutionInterceptor(e, o, "Single"), o; } throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function."); }, t.prototype.executePreResolutionInterceptor = function(e, n) { var r, i; if (this.interceptors.preResolution.has(e)) { var o = []; try { for (var a = em(this.interceptors.preResolution.getAll(e)), s = a.next(); !s.done; s = a.next()) { var c = s.value; c.options.frequency != "Once" && o.push(c), c.callback(e, n); } } catch (u) { r = { error: u }; } finally { try { s && !s.done && (i = a.return) && i.call(a); } finally { if (r) throw r.error; } } this.interceptors.preResolution.setAll(e, o); } }, t.prototype.executePostResolutionInterceptor = function(e, n, r) { var i, o; if (this.interceptors.postResolution.has(e)) { var a = []; try { for (var s = em(this.interceptors.postResolution.getAll(e)), c = s.next(); !c.done; c = s.next()) { var u = c.value; u.options.frequency != "Once" && a.push(u), u.callback(e, n, r); } } catch (d) { i = { error: d }; } finally { try { c && !c.done && (o = s.return) && o.call(s); } finally { if (i) throw i.error; } } this.interceptors.postResolution.setAll(e, a); } }, t.prototype.resolveRegistration = function(e, n) { if (this.ensureNotDisposed(), e.options.lifecycle === Gr.ResolutionScoped && n.scopedResolutions.has(e)) return n.scopedResolutions.get(e); var r = e.options.lifecycle === Gr.Singleton, i = e.options.lifecycle === Gr.ContainerScoped, o = r || i, a; return Mm(e.provider) ? a = e.provider.useValue : Fm(e.provider) ? a = o ? e.instance || (e.instance = this.resolve(e.provider.useToken, n)) : this.resolve(e.provider.useToken, n) : J9(e.provider) ? a = o ? e.instance || (e.instance = this.construct(e.provider.useClass, n)) : this.construct(e.provider.useClass, n) : W_(e.provider) ? a = e.provider.useFactory(this) : a = this.construct(e.provider, n), e.options.lifecycle === Gr.ResolutionScoped && n.scopedResolutions.set(e, a), a; }, t.prototype.resolveAll = function(e, n, r) { var i = this; n === void 0 && (n = new tm()), r === void 0 && (r = !1), this.ensureNotDisposed(); var o = this.getAllRegistrations(e); if (!o && uu(e)) { if (r) return []; throw new Error('Attempted to resolve unregistered dependency token: "' + e.toString() + '"'); } if (this.executePreResolutionInterceptor(e, "All"), o) { var a = o.map(function(c) { return i.resolveRegistration(c, n); }); return this.executePostResolutionInterceptor(e, a, "All"), a; } var s = [this.construct(e, n)]; return this.executePostResolutionInterceptor(e, s, "All"), s; }, t.prototype.isRegistered = function(e, n) { return n === void 0 && (n = !1), this.ensureNotDisposed(), this._registry.has(e) || n && (this.parent || !1) && this.parent.isRegistered(e, !0); }, t.prototype.reset = function() { this.ensureNotDisposed(), this._registry.clear(), this.interceptors.preResolution.clear(), this.interceptors.postResolution.clear(); }, t.prototype.clearInstances = function() { var e, n; this.ensureNotDisposed(); try { for (var r = em(this._registry.entries()), i = r.next(); !i.done; i = r.next()) { var o = H_(i.value, 2), a = o[0], s = o[1]; this._registry.setAll(a, s.filter(function(c) { return !Mm(c.provider); }).map(function(c) { return c.instance = void 0, c; })); } } catch (c) { e = { error: c }; } finally { try { i && !i.done && (n = r.return) && n.call(r); } finally { if (e) throw e.error; } } }, t.prototype.createChildContainer = function() { var e, n; this.ensureNotDisposed(); var r = new t(this); try { for (var i = em(this._registry.entries()), o = i.next(); !o.done; o = i.next()) { var a = H_(o.value, 2), s = a[0], c = a[1]; c.some(function(u) { var d = u.options; return d.lifecycle === Gr.ContainerScoped; }) && r._registry.setAll(s, c.map(function(u) { return u.options.lifecycle === Gr.ContainerScoped ? { provider: u.provider, options: u.options } : u; })); } } catch (u) { e = { error: u }; } finally { try { o && !o.done && (n = i.return) && n.call(i); } finally { if (e) throw e.error; } } return r; }, t.prototype.beforeResolution = function(e, n, r) { r === void 0 && (r = { frequency: "Always" }), this.interceptors.preResolution.set(e, { callback: n, options: r }); }, t.prototype.afterResolution = function(e, n, r) { r === void 0 && (r = { frequency: "Always" }), this.interceptors.postResolution.set(e, { callback: n, options: r }); }, t.prototype.dispose = function() { return ehe(this, void 0, void 0, function() { var e; return the(this, function(n) { switch (n.label) { case 0: return this.disposed = !0, e = [], this.disposables.forEach(function(r) { var i = r.dispose(); i && e.push(i); }), [4, Promise.all(e)]; case 1: return n.sent(), [2]; } }); }); }, t.prototype.getRegistration = function(e) { return this.isRegistered(e) ? this._registry.get(e) : this.parent ? this.parent.getRegistration(e) : null; }, t.prototype.getAllRegistrations = function(e) { return this.isRegistered(e) ? this._registry.getAll(e) : this.parent ? this.parent.getAllRegistrations(e) : null; }, t.prototype.construct = function(e, n) { var r = this; if (e instanceof X9) return e.createProxy(function(o) { return r.resolve(o, n); }); var i = (function() { var o = Z9.get(e); if (!o || o.length === 0) { if (e.length === 0) return new e(); throw new Error('TypeInfo not known for "' + e.name + '"'); } var a = o.map(r.resolveParams(n, e)); return new (e.bind.apply(e, ac([void 0], a)))(); })(); return dhe(i) && this.disposables.add(i), i; }, t.prototype.resolveParams = function(e, n) { var r = this; return function(i, o) { var a, s, c; try { return ihe(i) ? KN(i) ? i.multiple ? (a = r.resolve(i.transform)).transform.apply(a, ac([r.resolveAll(i.token, new tm(), i.isOptional)], i.transformArgs)) : (s = r.resolve(i.transform)).transform.apply(s, ac([r.resolve(i.token, e, i.isOptional)], i.transformArgs)) : i.multiple ? r.resolveAll(i.token, new tm(), i.isOptional) : r.resolve(i.token, e, i.isOptional) : KN(i) ? (c = r.resolve(i.transform, e)).transform.apply(c, ac([r.resolve(i.token, e)], i.transformArgs)) : r.resolve(i, e); } catch (u) { throw new Error(lhe(n, o, u)); } }; }, t.prototype.ensureNotDisposed = function() { if (this.disposed) throw new Error("This container has been disposed, you cannot interact with a disposed container"); }, t; })(), xr = new mhe(); function j1(t) { return function(e) { Z9.set(e, rhe(e)); }; } if (typeof Reflect > "u" || !Reflect.getMetadata) throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`); var K_; class $1 { constructor(e = {}) { this.attrId = "", this.attrValues = [], Object.assign(e); } } R([ z({ type: te.ObjectIdentifier }) ], $1.prototype, "attrId", void 0); R([ z({ type: te.Any, repeated: "set" }) ], $1.prototype, "attrValues", void 0); let VN = K_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, K_.prototype); } }; VN = K_ = R([ _e({ type: ye.Sequence, itemType: $1 }) ], VN); var V_; let YN = V_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, V_.prototype); } }; YN = V_ = R([ _e({ type: ye.Sequence, itemType: Gl }) ], YN); class eU { constructor(e = {}) { this.certId = "", this.certValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], eU.prototype, "certId", void 0); R([ z({ type: te.Any, context: 0 }) ], eU.prototype, "certValue", void 0); class tU { constructor(e = {}) { this.crlId = "", this.crltValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], tU.prototype, "crlId", void 0); R([ z({ type: te.Any, context: 0 }) ], tU.prototype, "crltValue", void 0); class nU extends je { } let G1 = class { constructor(e = {}) { this.encryptionAlgorithm = new Fe(), this.encryptedData = new nU(), Object.assign(this, e); } }; R([ z({ type: Fe }) ], G1.prototype, "encryptionAlgorithm", void 0); R([ z({ type: nU }) ], G1.prototype, "encryptedData", void 0); var Y_, J_; (function(t) { t[t.v1 = 0] = "v1"; })(J_ || (J_ = {})); class rU extends je { } let X_ = Y_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, Y_.prototype); } }; X_ = Y_ = R([ _e({ type: ye.Sequence, itemType: Ma }) ], X_); class Bf { constructor(e = {}) { this.version = J_.v1, this.privateKeyAlgorithm = new Fe(), this.privateKey = new rU(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Bf.prototype, "version", void 0); R([ z({ type: Fe }) ], Bf.prototype, "privateKeyAlgorithm", void 0); R([ z({ type: rU }) ], Bf.prototype, "privateKey", void 0); R([ z({ type: X_, implicit: !0, context: 0, optional: !0 }) ], Bf.prototype, "attributes", void 0); let JN = class extends Bf { }; JN = R([ _e({ type: ye.Sequence }) ], JN); let XN = class extends G1 { }; XN = R([ _e({ type: ye.Sequence }) ], XN); class iU { constructor(e = {}) { this.secretTypeId = "", this.secretValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], iU.prototype, "secretTypeId", void 0); R([ z({ type: te.Any, context: 0 }) ], iU.prototype, "secretValue", void 0); class Uf { constructor(e = {}) { this.mac = new U1(), this.macSalt = new je(), this.iterations = 1, Object.assign(this, e); } } R([ z({ type: U1 }) ], Uf.prototype, "mac", void 0); R([ z({ type: je }) ], Uf.prototype, "macSalt", void 0); R([ z({ type: te.Integer, defaultValue: 1 }) ], Uf.prototype, "iterations", void 0); class q1 { constructor(e = {}) { this.version = 3, this.authSafe = new Gl(), this.macData = new Uf(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], q1.prototype, "version", void 0); R([ z({ type: Gl }) ], q1.prototype, "authSafe", void 0); R([ z({ type: Uf, optional: !0 }) ], q1.prototype, "macData", void 0); var Z_; class z1 { constructor(e = {}) { this.bagId = "", this.bagValue = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: te.ObjectIdentifier }) ], z1.prototype, "bagId", void 0); R([ z({ type: te.Any, context: 0 }) ], z1.prototype, "bagValue", void 0); R([ z({ type: $1, repeated: "set", optional: !0 }) ], z1.prototype, "bagAttributes", void 0); let ZN = Z_ = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, Z_.prototype); } }; ZN = Z_ = R([ _e({ type: ye.Sequence, itemType: z1 }) ], ZN); var e2, t2, n2; const oU = "1.2.840.113549.1.9", aU = `${oU}.7`, c3 = `${oU}.14`; let qg = class extends vr { constructor(e = {}) { super(e); } toString() { return this.ia5String || super.toString(); } }; R([ z({ type: te.IA5String }) ], qg.prototype, "ia5String", void 0); qg = R([ _e({ type: ye.Choice }) ], qg); let e5 = class extends Gl { }; e5 = R([ _e({ type: ye.Sequence }) ], e5); let t5 = class extends q1 { }; t5 = R([ _e({ type: ye.Sequence }) ], t5); let n5 = class extends G1 { }; n5 = R([ _e({ type: ye.Sequence }) ], n5); let r2 = class { constructor(e = "") { this.value = e; } toString() { return this.value; } }; R([ z({ type: te.IA5String }) ], r2.prototype, "value", void 0); r2 = R([ _e({ type: ye.Choice }) ], r2); let r5 = class extends qg { }; r5 = R([ _e({ type: ye.Choice }) ], r5); let i5 = class extends vr { }; i5 = R([ _e({ type: ye.Choice }) ], i5); let i2 = class { constructor(e = /* @__PURE__ */ new Date()) { this.value = e; } }; R([ z({ type: te.GeneralizedTime }) ], i2.prototype, "value", void 0); i2 = R([ _e({ type: ye.Choice }) ], i2); let o5 = class extends vr { }; o5 = R([ _e({ type: ye.Choice }) ], o5); let o2 = class { constructor(e = "M") { this.value = e; } toString() { return this.value; } }; R([ z({ type: te.PrintableString }) ], o2.prototype, "value", void 0); o2 = R([ _e({ type: ye.Choice }) ], o2); let zg = class { constructor(e = "") { this.value = e; } toString() { return this.value; } }; R([ z({ type: te.PrintableString }) ], zg.prototype, "value", void 0); zg = R([ _e({ type: ye.Choice }) ], zg); let a5 = class extends zg { }; a5 = R([ _e({ type: ye.Choice }) ], a5); let s5 = class extends vr { }; s5 = R([ _e({ type: ye.Choice }) ], s5); let a2 = class { constructor(e = "") { this.value = e; } toString() { return this.value; } }; R([ z({ type: te.ObjectIdentifier }) ], a2.prototype, "value", void 0); a2 = R([ _e({ type: ye.Choice }) ], a2); let c5 = class extends tr { }; c5 = R([ _e({ type: ye.Choice }) ], c5); let s2 = class { constructor(e = 0) { this.value = e; } toString() { return this.value.toString(); } }; R([ z({ type: te.Integer }) ], s2.prototype, "value", void 0); s2 = R([ _e({ type: ye.Choice }) ], s2); let u5 = class extends oa { }; u5 = R([ _e({ type: ye.Sequence }) ], u5); let Hg = class extends vr { }; Hg = R([ _e({ type: ye.Choice }) ], Hg); let l5 = e2 = class extends Ic { constructor(e) { super(e), Object.setPrototypeOf(this, e2.prototype); } }; l5 = e2 = R([ _e({ type: ye.Sequence }) ], l5); let d5 = t2 = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, t2.prototype); } }; d5 = t2 = R([ _e({ type: ye.Set, itemType: $l }) ], d5); let c2 = class { constructor(e = "") { this.value = e; } toString() { return this.value; } }; R([ z({ type: te.BmpString }) ], c2.prototype, "value", void 0); c2 = R([ _e({ type: ye.Choice }) ], c2); let u2 = class extends Fe { }; u2 = R([ _e({ type: ye.Sequence }) ], u2); let p5 = n2 = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, n2.prototype); } }; p5 = n2 = R([ _e({ type: ye.Sequence, itemType: u2 }) ], p5); var l2; let Wg = l2 = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, l2.prototype); } }; Wg = l2 = R([ _e({ type: ye.Sequence, itemType: Ma }) ], Wg); class Hl { constructor(e = {}) { this.version = 0, this.subject = new Un(), this.subjectPKInfo = new Wo(), this.attributes = new Wg(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Hl.prototype, "version", void 0); R([ z({ type: Un }) ], Hl.prototype, "subject", void 0); R([ z({ type: Wo }) ], Hl.prototype, "subjectPKInfo", void 0); R([ z({ type: Wg, implicit: !0, context: 0, optional: !0 }) ], Hl.prototype, "attributes", void 0); class Lp { constructor(e = {}) { this.certificationRequestInfo = new Hl(), this.signatureAlgorithm = new Fe(), this.signature = new ArrayBuffer(0), Object.assign(this, e); } } R([ z({ type: Hl, raw: !0 }) ], Lp.prototype, "certificationRequestInfo", void 0); R([ z({ type: Fe }) ], Lp.prototype, "signatureAlgorithm", void 0); R([ z({ type: te.BitString }) ], Lp.prototype, "signature", void 0); /*! * MIT License * * Copyright (c) Peculiar Ventures. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */ const Lf = "crypto.algorithm"; class ghe { getAlgorithms() { return xr.resolveAll(Lf); } toAsnAlgorithm(e) { ({ ...e }); for (const n of this.getAlgorithms()) { const r = n.toAsnAlgorithm(e); if (r) return r; } if (/^[0-9.]+$/.test(e.name)) { const n = new Fe({ algorithm: e.name }); if ("parameters" in e) { const r = e; n.parameters = r.parameters; } return n; } throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm"); } toWebAlgorithm(e) { for (const r of this.getAlgorithms()) { const i = r.toWebAlgorithm(e); if (i) return i; } return { name: e.algorithm, parameters: e.parameters }; } } const Nc = "crypto.algorithmProvider"; xr.registerSingleton(Nc, ghe); var Rm; const si = "1.3.36.3.3.2.8.1.1", f5 = `${si}.1`, h5 = `${si}.2`, m5 = `${si}.3`, g5 = `${si}.4`, y5 = `${si}.5`, b5 = `${si}.6`, v5 = `${si}.7`, x5 = `${si}.8`, w5 = `${si}.9`, S5 = `${si}.10`, _5 = `${si}.11`, E5 = `${si}.12`, A5 = `${si}.13`, I5 = `${si}.14`, C5 = "brainpoolP160r1", T5 = "brainpoolP160t1", k5 = "brainpoolP192r1", N5 = "brainpoolP192t1", P5 = "brainpoolP224r1", D5 = "brainpoolP224t1", O5 = "brainpoolP256r1", F5 = "brainpoolP256t1", M5 = "brainpoolP320r1", R5 = "brainpoolP320t1", B5 = "brainpoolP384r1", U5 = "brainpoolP384t1", L5 = "brainpoolP512r1", Q5 = "brainpoolP512t1", rn = "ECDSA"; let Qp = Rm = class { toAsnAlgorithm(e) { switch (e.name.toLowerCase()) { case rn.toLowerCase(): if ("hash" in e) switch ((typeof e.hash == "string" ? e.hash : e.hash.name).toLowerCase()) { case "sha-1": return Bfe; case "sha-256": return Ufe; case "sha-384": return Lfe; case "sha-512": return Qfe; } else if ("namedCurve" in e) { let n = ""; switch (e.namedCurve) { case "P-256": n = L_; break; case "K-256": n = Rm.SECP256K1; break; case "P-384": n = Q_; break; case "P-521": n = HN; break; case C5: n = f5; break; case T5: n = h5; break; case k5: n = m5; break; case N5: n = g5; break; case P5: n = y5; break; case D5: n = b5; break; case O5: n = v5; break; case F5: n = x5; break; case M5: n = w5; break; case R5: n = S5; break; case B5: n = _5; break; case U5: n = E5; break; case L5: n = A5; break; case Q5: n = I5; break; } if (n) return new Fe({ algorithm: il, parameters: Te.serialize(new Ua({ namedCurve: n })) }); } } return null; } toWebAlgorithm(e) { switch (e.algorithm) { case n3: return { name: rn, hash: { name: "SHA-1" } }; case r3: return { name: rn, hash: { name: "SHA-256" } }; case i3: return { name: rn, hash: { name: "SHA-384" } }; case o3: return { name: rn, hash: { name: "SHA-512" } }; case il: { if (!e.parameters) throw new TypeError("Cannot get required parameters from EC algorithm"); switch (Te.parse(e.parameters, Ua).namedCurve) { case L_: return { name: rn, namedCurve: "P-256" }; case Rm.SECP256K1: return { name: rn, namedCurve: "K-256" }; case Q_: return { name: rn, namedCurve: "P-384" }; case HN: return { name: rn, namedCurve: "P-521" }; case f5: return { name: rn, namedCurve: C5 }; case h5: return { name: rn, namedCurve: T5 }; case m5: return { name: rn, namedCurve: k5 }; case g5: return { name: rn, namedCurve: N5 }; case y5: return { name: rn, namedCurve: P5 }; case b5: return { name: rn, namedCurve: D5 }; case v5: return { name: rn, namedCurve: O5 }; case x5: return { name: rn, namedCurve: F5 }; case w5: return { name: rn, namedCurve: M5 }; case S5: return { name: rn, namedCurve: R5 }; case _5: return { name: rn, namedCurve: B5 }; case E5: return { name: rn, namedCurve: U5 }; case A5: return { name: rn, namedCurve: L5 }; case I5: return { name: rn, namedCurve: Q5 }; } } } return null; } }; Qp.SECP256K1 = "1.3.132.0.10"; Qp = Rm = R([ j1() ], Qp); xr.registerSingleton(Lf, Qp); const sU = Symbol("name"), cU = Symbol("value"); class kt { constructor(e, n = {}, r = "") { this[sU] = e, this[cU] = r; for (const i in n) this[i] = n[i]; } } kt.NAME = sU; kt.VALUE = cU; class yhe { static toTextObject(e) { const n = new kt("Algorithm Identifier", {}, zs.toString(e.algorithm)); if (e.parameters) switch (e.algorithm) { case il: { const r = new Qp().toWebAlgorithm(e); r && "namedCurve" in r ? n["Named Curve"] = r.namedCurve : n.Parameters = e.parameters; break; } default: n.Parameters = e.parameters; } return n; } } class zs { static toString(e) { const n = this.items[e]; return n || e; } } zs.items = { [Qg]: "sha1", [K9]: "sha224", [jg]: "sha256", [$g]: "sha384", [Gg]: "sha512", [As]: "rsaEncryption", [Bg]: "sha1WithRSAEncryption", [Hfe]: "sha224WithRSAEncryption", [$_]: "sha256WithRSAEncryption", [Ug]: "sha384WithRSAEncryption", [Lg]: "sha512WithRSAEncryption", [il]: "ecPublicKey", [n3]: "ecdsaWithSHA1", [z9]: "ecdsaWithSHA224", [r3]: "ecdsaWithSHA256", [i3]: "ecdsaWithSHA384", [o3]: "ecdsaWithSHA512", [kfe]: "TLS WWW server authentication", [Nfe]: "TLS WWW client authentication", [Pfe]: "Code Signing", [Dfe]: "E-mail Protection", [Ofe]: "Time Stamping", [Ffe]: "OCSP Signing", [Rfe]: "Signed Data" }; class Pc { static serialize(e) { return this.serializeObj(e).join(` `); } static pad(e = 0) { return "".padStart(2 * e, " "); } static serializeObj(e, n = 0) { const r = []; let i = this.pad(n++), o = ""; const a = e[kt.VALUE]; a && (o = ` ${a}`), r.push(`${i}${e[kt.NAME]}:${o}`), i = this.pad(n); for (const s in e) { if (typeof s == "symbol") continue; const c = e[s], u = s ? `${s}: ` : ""; if (typeof c == "string" || typeof c == "number" || typeof c == "boolean") r.push(`${i}${u}${c}`); else if (c instanceof Date) r.push(`${i}${u}${c.toUTCString()}`); else if (Array.isArray(c)) for (const d of c) d[kt.NAME] = s, r.push(...this.serializeObj(d, n)); else if (c instanceof kt) c[kt.NAME] = s, r.push(...this.serializeObj(c, n)); else if (Ce.isBufferSource(c)) s ? (r.push(`${i}${u}`), r.push(...this.serializeBufferSource(c, n + 1))) : r.push(...this.serializeBufferSource(c, n)); else if ("toTextObject" in c) { const d = c.toTextObject(); d[kt.NAME] = s, r.push(...this.serializeObj(d, n)); } else throw new TypeError("Cannot serialize data in text format. Unsupported type."); } return r; } static serializeBufferSource(e, n = 0) { const r = this.pad(n), i = Ce.toUint8Array(e), o = []; for (let a = 0; a < i.length; ) { const s = []; for (let c = 0; c < 16 && a < i.length; c++) { c === 8 && s.push(""); const u = i[a++].toString(16).padStart(2, "0"); s.push(u); } o.push(`${r}${s.join(" ")}`); } return o; } static serializeAlgorithm(e) { return this.algorithmSerializer.toTextObject(e); } } Pc.oidSerializer = zs; Pc.algorithmSerializer = yhe; var fu; class Ka { get rawData() { return Be(this, fu, "f") || mt(this, fu, Te.serialize(this.asn), "f"), Be(this, fu, "f"); } constructor(...e) { fu.set(this, void 0), Ce.isBufferSource(e[0]) ? (this.asn = Te.parse(e[0], e[1]), mt(this, fu, Ce.toArrayBuffer(e[0]), "f"), this.onInit(this.asn)) : (this.asn = e[0], this.onInit(this.asn)); } equal(e) { return e instanceof Ka ? OB(e.rawData, this.rawData) : !1; } toString(e = "text") { switch (e) { case "asn": return Te.toString(this.rawData); case "text": return Pc.serialize(this.toTextObject()); case "hex": return Le.ToHex(this.rawData); case "base64": return Le.ToBase64(this.rawData); case "base64url": return Le.ToBase64Url(this.rawData); default: throw TypeError("Argument 'format' is unsupported value"); } } getTextName() { return this.constructor.NAME; } toTextObject() { const e = this.toTextObjectEmpty(); return e[""] = this.rawData, e; } toTextObjectEmpty(e) { return new kt(this.getTextName(), {}, e); } } fu = /* @__PURE__ */ new WeakMap(); Ka.NAME = "ASN"; class Ci extends Ka { constructor(...e) { let n; Ce.isBufferSource(e[0]) ? n = Ce.toArrayBuffer(e[0]) : n = Te.serialize(new To({ extnID: e[0], critical: e[1], extnValue: new je(Ce.toArrayBuffer(e[2])) })), super(n, To); } onInit(e) { this.type = e.extnID, this.critical = e.critical, this.value = e.extnValue.buffer; } toTextObject() { const e = this.toTextObjectWithoutValue(); return e[""] = this.value, e; } toTextObjectWithoutValue() { const e = this.toTextObjectEmpty(this.critical ? "critical" : void 0); return e[kt.NAME] === Ci.NAME && (e[kt.NAME] = zs.toString(this.type)), e; } } var uU; class hs { static isCryptoKeyPair(e) { return e && e.privateKey && e.publicKey; } static isCryptoKey(e) { return e && e.usages && e.type && e.algorithm && e.extractable !== void 0; } constructor() { this.items = /* @__PURE__ */ new Map(), this[uU] = "CryptoProvider", typeof self < "u" && typeof crypto < "u" ? this.set(hs.DEFAULT, crypto) : typeof global < "u" && global.crypto && global.crypto.subtle && this.set(hs.DEFAULT, global.crypto); } clear() { this.items.clear(); } delete(e) { return this.items.delete(e); } forEach(e, n) { return this.items.forEach(e, n); } has(e) { return this.items.has(e); } get size() { return this.items.size; } entries() { return this.items.entries(); } keys() { return this.items.keys(); } values() { return this.items.values(); } [Symbol.iterator]() { return this.items[Symbol.iterator](); } get(e = hs.DEFAULT) { const n = this.items.get(e.toLowerCase()); if (!n) throw new Error(`Cannot get Crypto by name '${e}'`); return n; } set(e, n) { if (typeof e == "string") { if (!n) throw new TypeError("Argument 'value' is required"); this.items.set(e.toLowerCase(), n); } else this.items.set(hs.DEFAULT, e); return this; } } uU = Symbol.toStringTag; hs.DEFAULT = "default"; const Jn = new hs(), bhe = /^[0-2](?:\.[1-9][0-9]*)+$/; function vhe(t) { return new RegExp(bhe).test(t); } class lU { constructor(e = {}) { this.items = {}; for (const n in e) this.register(n, e[n]); } get(e) { return this.items[e] || null; } findId(e) { return vhe(e) ? e : this.get(e); } register(e, n) { this.items[e] = n, this.items[n] = e; } } const ri = new lU(); ri.register("CN", "2.5.4.3"); ri.register("L", "2.5.4.7"); ri.register("ST", "2.5.4.8"); ri.register("O", "2.5.4.10"); ri.register("OU", "2.5.4.11"); ri.register("C", "2.5.4.6"); ri.register("DC", "0.9.2342.19200300.100.1.25"); ri.register("E", "1.2.840.113549.1.9.1"); ri.register("G", "2.5.4.42"); ri.register("I", "2.5.4.43"); ri.register("SN", "2.5.4.4"); ri.register("T", "2.5.4.12"); function xhe(t, e) { return `\\${Le.ToHex(Le.FromUtf8String(e)).toUpperCase()}`; } function whe(t) { return t.replace(/([,+"\\<>;])/g, "\\$1").replace(/^([ #])/, "\\$1").replace(/([ ]$)/, "\\$1").replace(/([\r\n\t])/, xhe); } class Is { static isASCII(e) { for (let n = 0; n < e.length; n++) if (e.charCodeAt(n) > 255) return !1; return !0; } static isPrintableString(e) { return /^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e); } constructor(e, n = {}) { this.extraNames = new lU(), this.asn = new Un(); for (const r in n) if (Object.prototype.hasOwnProperty.call(n, r)) { const i = n[r]; this.extraNames.register(r, i); } typeof e == "string" ? this.asn = this.fromString(e) : e instanceof Un ? this.asn = e : Ce.isBufferSource(e) ? this.asn = Te.parse(e, Un) : this.asn = this.fromJSON(e); } getField(e) { const n = this.extraNames.findId(e) || ri.findId(e), r = []; for (const i of this.asn) for (const o of i) o.type === n && r.push(o.value.toString()); return r; } getName(e) { return this.extraNames.get(e) || ri.get(e); } toString() { return this.asn.map((e) => e.map((n) => { const r = this.getName(n.type) || n.type, i = n.value.anyValue ? `#${Le.ToHex(n.value.anyValue)}` : whe(n.value.toString()); return `${r}=${i}`; }).join("+")).join(", "); } toJSON() { var e; const n = []; for (const r of this.asn) { const i = {}; for (const o of r) { const a = this.getName(o.type) || o.type; (e = i[a]) !== null && e !== void 0 || (i[a] = []), i[a].push(o.value.anyValue ? `#${Le.ToHex(o.value.anyValue)}` : o.value.toString()); } n.push(i); } return n; } fromString(e) { const n = new Un(), r = /(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g; let i = null, o = ","; for (; i = r.exec(`${e},`); ) { let [, a, s] = i; const c = s[s.length - 1]; (c === "," || c === "+") && (s = s.slice(0, s.length - 1), i[3] = c); const u = i[3]; a = this.getTypeOid(a); const d = this.createAttribute(a, s); o === "+" ? n[n.length - 1].push(d) : n.push(new Yu([d])), o = u; } return n; } fromJSON(e) { const n = new Un(); for (const r of e) { const i = new Yu(); for (const o in r) { const a = this.getTypeOid(o), s = r[o]; for (const c of s) { const u = this.createAttribute(a, c); i.push(u); } } n.push(i); } return n; } getTypeOid(e) { if (/[\d.]+/.test(e) || (e = this.getName(e) || ""), !e) throw new Error(`Cannot get OID for name type '${e}'`); return e; } createAttribute(e, n) { const r = new v1({ type: e }); if (typeof n == "object") for (const i in n) switch (i) { case "ia5String": r.value.ia5String = n[i]; break; case "utf8String": r.value.utf8String = n[i]; break; case "universalString": r.value.universalString = n[i]; break; case "bmpString": r.value.bmpString = n[i]; break; case "printableString": r.value.printableString = n[i]; break; } else if (n[0] === "#") r.value.anyValue = Le.FromHex(n.slice(1)); else { const i = this.processStringValue(n); e === this.getName("E") || e === this.getName("DC") ? r.value.ia5String = i : Is.isPrintableString(i) ? r.value.printableString = i : r.value.utf8String = i; } return r; } processStringValue(e) { const n = /"(.*?[^\\])?"/.exec(e); return n && (e = n[1]), e.replace(/\\0a/ig, ` `).replace(/\\0d/ig, "\r").replace(/\\0g/ig, " ").replace(/\\(.)/g, "$1"); } toArrayBuffer() { return Te.serialize(this.asn); } async getThumbprint(...e) { var n; let r, i = "SHA-1"; return e.length >= 1 && !(!((n = e[0]) === null || n === void 0) && n.subtle) ? (i = e[0] || i, r = e[1] || Jn.get()) : r = e[0] || Jn.get(), await r.subtle.digest(i, this.toArrayBuffer()); } } const dU = "Cannot initialize GeneralName from ASN.1 data.", j5 = `${dU} Unsupported string format in use.`, She = `${dU} Value doesn't match to GUID regular expression.`, $5 = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i, G5 = "1.3.6.1.4.1.311.25.1", q5 = "1.3.6.1.4.1.311.20.2.3", _w = "dns", Ew = "dn", Aw = "email", Iw = "ip", Cw = "url", Tw = "guid", kw = "upn", nm = "id"; class ms extends Ka { constructor(...e) { let n; if (e.length === 2) switch (e[0]) { case Ew: { const r = new Is(e[1]).toArrayBuffer(), i = Te.parse(r, Un); n = new ct({ directoryName: i }); break; } case _w: n = new ct({ dNSName: e[1] }); break; case Aw: n = new ct({ rfc822Name: e[1] }); break; case Tw: { const r = new RegExp($5, "i").exec(e[1]); if (!r) throw new Error("Cannot parse GUID value. Value doesn't match to regular expression"); const i = r.slice(1).map((o, a) => a < 3 ? Le.ToHex(new Uint8Array(Le.FromHex(o)).reverse()) : o).join(""); n = new ct({ otherName: new Pp({ typeId: G5, value: Te.serialize(new je(Le.FromHex(i))) }) }); break; } case Iw: n = new ct({ iPAddress: e[1] }); break; case nm: n = new ct({ registeredID: e[1] }); break; case kw: { n = new ct({ otherName: new Pp({ typeId: q5, value: Te.serialize(N9.toASN(e[1])) }) }); break; } case Cw: n = new ct({ uniformResourceIdentifier: e[1] }); break; default: throw new Error("Cannot create GeneralName. Unsupported type of the name"); } else Ce.isBufferSource(e[0]) ? n = Te.parse(e[0], ct) : n = e[0]; super(n); } onInit(e) { if (e.dNSName != null) this.type = _w, this.value = e.dNSName; else if (e.rfc822Name != null) this.type = Aw, this.value = e.rfc822Name; else if (e.iPAddress != null) this.type = Iw, this.value = e.iPAddress; else if (e.uniformResourceIdentifier != null) this.type = Cw, this.value = e.uniformResourceIdentifier; else if (e.registeredID != null) this.type = nm, this.value = e.registeredID; else if (e.directoryName != null) this.type = Ew, this.value = new Is(e.directoryName).toString(); else if (e.otherName != null) if (e.otherName.typeId === G5) { this.type = Tw; const n = Te.parse(e.otherName.value, je), r = new RegExp($5, "i").exec(Le.ToHex(n)); if (!r) throw new Error(She); this.value = r.slice(1).map((i, o) => o < 3 ? Le.ToHex(new Uint8Array(Le.FromHex(i)).reverse()) : i).join("-"); } else if (e.otherName.typeId === q5) this.type = kw, this.value = Te.parse(e.otherName.value, vr).toString(); else throw new Error(j5); else throw new Error(j5); } toJSON() { return { type: this.type, value: this.value }; } toTextObject() { let e; switch (this.type) { case Ew: case _w: case Tw: case Iw: case nm: case kw: case Cw: e = this.type.toUpperCase(); break; case Aw: e = "Email"; break; default: throw new Error("Unsupported GeneralName type"); } let n = this.value; return this.type === nm && (n = zs.toString(n)), new kt(e, void 0, n); } } class Dc extends Ka { constructor(e) { let n; if (e instanceof Cr) n = e; else if (Array.isArray(e)) { const r = []; for (const i of e) if (i instanceof ct) r.push(i); else { const o = Te.parse(new ms(i.type, i.value).rawData, ct); r.push(o); } n = new Cr(r); } else if (Ce.isBufferSource(e)) n = Te.parse(e, Cr); else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments"); super(n); } onInit(e) { const n = []; for (const r of e) { let i = null; try { i = new ms(r); } catch { continue; } n.push(i); } this.items = n; } toJSON() { return this.items.map((e) => e.toJSON()); } toTextObject() { const e = super.toTextObjectEmpty(); for (const n of this.items) { const r = n.toTextObject(); let i = e[r[kt.NAME]]; Array.isArray(i) || (i = [], e[r[kt.NAME]] = i), i.push(r); } return e; } } Dc.NAME = "GeneralNames"; const pp = "-{5}", jp = "\\n", _he = `[^${jp}]+`, Ehe = `${pp}BEGIN (${_he}(?=${pp}))${pp}`, Ahe = `${pp}END \\1${pp}`, al = "\\n", Ihe = `[^:${jp}]+`, Che = `(?:[^${jp}]+${al}(?: +[^${jp}]+${al})*)`, The = "[a-zA-Z0-9=+/]+", khe = `(?:${The}${al})+`, z5 = `${Ehe}${al}(?:((?:${Ihe}: ${Che})+))?${al}?(${khe})${Ahe}`; class Kr { static isPem(e) { return typeof e == "string" && new RegExp(z5, "g").test(e.replace(/\r/g, "")); } static decodeWithHeaders(e) { e = e.replace(/\r/g, ""); const n = new RegExp(z5, "g"), r = []; let i = null; for (; i = n.exec(e); ) { const o = i[3].replace(new RegExp(`[${jp}]+`, "g"), ""), a = { type: i[1], headers: [], rawData: Le.FromBase64(o) }, s = i[2]; if (s) { const c = s.split(new RegExp(al, "g")); let u = null; for (const d of c) { const [p, f] = d.split(/:(.*)/); if (f === void 0) { if (!u) throw new Error("Cannot parse PEM string. Incorrect header value"); u.value += p.trim(); } else u && a.headers.push(u), u = { key: p, value: f.trim() }; } u && a.headers.push(u); } r.push(a); } return r; } static decode(e) { return this.decodeWithHeaders(e).map((r) => r.rawData); } static decodeFirst(e) { const n = this.decode(e); if (!n.length) throw new RangeError("PEM string doesn't contain any objects"); return n[0]; } static encode(e, n) { if (Array.isArray(e)) { const r = new Array(); return n ? e.forEach((i) => { if (!Ce.isBufferSource(i)) throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource"); r.push(this.encodeStruct({ type: n, rawData: Ce.toArrayBuffer(i) })); }) : e.forEach((i) => { if (!("type" in i)) throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut"); r.push(this.encodeStruct(i)); }), r.join(` `); } else { if (!n) throw new Error("Required argument 'tag' is missed"); return this.encodeStruct({ type: n, rawData: Ce.toArrayBuffer(e) }); } } static encodeStruct(e) { var n; const r = e.type.toLocaleUpperCase(), i = []; if (i.push(`-----BEGIN ${r}-----`), !((n = e.headers) === null || n === void 0) && n.length) { for (const u of e.headers) i.push(`${u.key}: ${u.value}`); i.push(""); } const o = Le.ToBase64(e.rawData); let a, s = 0; const c = Array(); for (; s < o.length && (o.length - s < 64 ? a = o.substring(s) : (a = o.substring(s, s + 64), s += 64), a.length !== 0); ) if (c.push(a), a.length < 64) break; return i.push(...c), i.push(`-----END ${r}-----`), i.join(` `); } } Kr.CertificateTag = "CERTIFICATE"; Kr.CrlTag = "CRL"; Kr.CertificateRequestTag = "CERTIFICATE REQUEST"; Kr.PublicKeyTag = "PUBLIC KEY"; Kr.PrivateKeyTag = "PRIVATE KEY"; class No extends Ka { static isAsnEncoded(e) { return Ce.isBufferSource(e) || typeof e == "string"; } static toArrayBuffer(e) { if (typeof e == "string") { if (Kr.isPem(e)) return Kr.decode(e)[0]; if (Le.isHex(e)) return Le.FromHex(e); if (Le.isBase64(e)) return Le.FromBase64(e); if (Le.isBase64Url(e)) return Le.FromBase64Url(e); throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url"); } else { const n = Ce.toUint8Array(e); if (n.length > 0 && n[0] === 48) return Ce.toArrayBuffer(e); const r = Le.ToBinary(e); if (Kr.isPem(r)) return Kr.decode(r)[0]; if (Le.isHex(r)) return Le.FromHex(r); if (Le.isBase64(r)) return Le.FromBase64(r); if (Le.isBase64Url(r)) return Le.FromBase64Url(r); throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url"); } } constructor(...e) { No.isAsnEncoded(e[0]) ? super(No.toArrayBuffer(e[0]), e[1]) : super(e[0]); } toString(e = "pem") { switch (e) { case "pem": return Kr.encode(this.rawData, this.tag); default: return super.toString(e); } } } class ho extends No { static async create(e, n = Jn.get()) { if (e instanceof ho) return e; if (hs.isCryptoKey(e)) { if (e.type !== "public") throw new TypeError("Public key is required"); const r = await n.subtle.exportKey("spki", e); return new ho(r); } else { if (e.publicKey) return e.publicKey; if (Ce.isBufferSource(e)) return new ho(e); throw new TypeError("Unsupported PublicKeyType"); } } constructor(e) { No.isAsnEncoded(e) ? super(e, Wo) : super(e), this.tag = Kr.PublicKeyTag; } async export(...e) { let n, r = ["verify"], i = { hash: "SHA-256", ...this.algorithm }; e.length > 1 ? (i = e[0] || i, r = e[1] || r, n = e[2] || Jn.get()) : n = e[0] || Jn.get(); let o = this.rawData; const a = Te.parse(this.rawData, Wo); return a.algorithm.algorithm === dp && (o = Nhe(a, o)), n.subtle.importKey("spki", o, i, !0, r); } onInit(e) { const n = xr.resolve(Nc), r = this.algorithm = n.toWebAlgorithm(e.algorithm); switch (e.algorithm.algorithm) { case As: { const i = Te.parse(e.subjectPublicKey, Q1), o = Ce.toUint8Array(i.modulus); r.publicExponent = Ce.toUint8Array(i.publicExponent), r.modulusLength = (o[0] ? o : o.slice(1)).byteLength << 3; break; } } } async getThumbprint(...e) { var n; let r, i = "SHA-1"; return e.length >= 1 && !(!((n = e[0]) === null || n === void 0) && n.subtle) ? (i = e[0] || i, r = e[1] || Jn.get()) : r = e[0] || Jn.get(), await r.subtle.digest(i, this.rawData); } async getKeyIdentifier(...e) { let n, r = "SHA-1"; e.length === 1 ? typeof e[0] == "string" ? (r = e[0], n = Jn.get()) : n = e[0] : e.length === 2 ? (r = e[0], n = e[1]) : n = Jn.get(); const i = Te.parse(this.rawData, Wo); return await n.subtle.digest(r, i.subjectPublicKey); } toTextObject() { const e = this.toTextObjectEmpty(), n = Te.parse(this.rawData, Wo); switch (e.Algorithm = Pc.serializeAlgorithm(n.algorithm), n.algorithm.algorithm) { case il: e["EC Point"] = n.subjectPublicKey; break; case As: default: e["Raw Data"] = n.subjectPublicKey; } return e; } } function Nhe(t, e) { return t.algorithm = new Fe({ algorithm: As, parameters: null }), e = Te.serialize(t), e; } class sl extends Ci { static async create(e, n = !1, r = Jn.get()) { if ("name" in e && "serialNumber" in e) return new sl(e, n); const o = await (await ho.create(e, r)).getKeyIdentifier(r); return new sl(Le.ToHex(o), n); } constructor(...e) { if (Ce.isBufferSource(e[0])) super(e[0]); else if (typeof e[0] == "string") { const n = new cc({ keyIdentifier: new UA(Le.FromHex(e[0])) }); super(s_, e[1], Te.serialize(n)); } else { const n = e[0], r = n.name instanceof Dc ? Te.parse(n.name.rawData, Cr) : n.name, i = new cc({ authorityCertIssuer: r, authorityCertSerialNumber: Le.FromHex(n.serialNumber) }); super(s_, e[1], Te.serialize(i)); } } onInit(e) { super.onInit(e); const n = Te.parse(e.extnValue, cc); n.keyIdentifier && (this.keyId = Le.ToHex(n.keyIdentifier)), (n.authorityCertIssuer || n.authorityCertSerialNumber) && (this.certId = { name: n.authorityCertIssuer || [], serialNumber: n.authorityCertSerialNumber ? Le.ToHex(n.authorityCertSerialNumber) : "" }); } toTextObject() { const e = this.toTextObjectWithoutValue(), n = Te.parse(this.value, cc); return n.authorityCertIssuer && (e["Authority Issuer"] = new Dc(n.authorityCertIssuer).toTextObject()), n.authorityCertSerialNumber && (e["Authority Serial Number"] = n.authorityCertSerialNumber), n.keyIdentifier && (e[""] = n.keyIdentifier), e; } } sl.NAME = "Authority Key Identifier"; class pU extends Ci { constructor(...e) { if (Ce.isBufferSource(e[0])) { super(e[0]); const n = Te.parse(this.value, Dp); this.ca = n.cA, this.pathLength = n.pathLenConstraint; } else { const n = new Dp({ cA: e[0], pathLenConstraint: e[1] }); super(LA, e[2], Te.serialize(n)), this.ca = e[0], this.pathLength = e[1]; } } toTextObject() { const e = this.toTextObjectWithoutValue(); return this.ca && (e.CA = this.ca), this.pathLength !== void 0 && (e["Path Length"] = this.pathLength), e; } } pU.NAME = "Basic Constraints"; var H5; (function(t) { t.serverAuth = "1.3.6.1.5.5.7.3.1", t.clientAuth = "1.3.6.1.5.5.7.3.2", t.codeSigning = "1.3.6.1.5.5.7.3.3", t.emailProtection = "1.3.6.1.5.5.7.3.4", t.timeStamping = "1.3.6.1.5.5.7.3.8", t.ocspSigning = "1.3.6.1.5.5.7.3.9"; })(H5 || (H5 = {})); class fU extends Ci { constructor(...e) { if (Ce.isBufferSource(e[0])) { super(e[0]); const n = Te.parse(this.value, Op); this.usages = n.map((r) => r); } else { const n = new Op(e[0]); super(GA, e[1], Te.serialize(n)), this.usages = e[0]; } } toTextObject() { const e = this.toTextObjectWithoutValue(); return e[""] = this.usages.map((n) => zs.toString(n)).join(", "), e; } } fU.NAME = "Extended Key Usages"; var W5; (function(t) { t[t.digitalSignature = 1] = "digitalSignature", t[t.nonRepudiation = 2] = "nonRepudiation", t[t.keyEncipherment = 4] = "keyEncipherment", t[t.dataEncipherment = 8] = "dataEncipherment", t[t.keyAgreement = 16] = "keyAgreement", t[t.keyCertSign = 32] = "keyCertSign", t[t.cRLSign = 64] = "cRLSign", t[t.encipherOnly = 128] = "encipherOnly", t[t.decipherOnly = 256] = "decipherOnly"; })(W5 || (W5 = {})); class hU extends Ci { constructor(...e) { if (Ce.isBufferSource(e[0])) { super(e[0]); const n = Te.parse(this.value, ww); this.usages = n.toNumber(); } else { const n = new ww(e[0]); super(M9, e[1], Te.serialize(n)), this.usages = e[0]; } } toTextObject() { const e = this.toTextObjectWithoutValue(), n = Te.parse(this.value, ww); return e[""] = n.toJSON().join(", "), e; } } hU.NAME = "Key Usages"; class Qf extends Ci { static async create(e, n = !1, r = Jn.get()) { const o = await (await ho.create(e, r)).getKeyIdentifier(r); return new Qf(Le.ToHex(o), n); } constructor(...e) { if (Ce.isBufferSource(e[0])) { super(e[0]); const n = Te.parse(this.value, xs); this.keyId = Le.ToHex(n); } else { const n = typeof e[0] == "string" ? Le.FromHex(e[0]) : e[0], r = new xs(n); super(U9, e[1], Te.serialize(r)), this.keyId = Le.ToHex(n); } } toTextObject() { const e = this.toTextObjectWithoutValue(), n = Te.parse(this.value, xs); return e[""] = n, e; } } Qf.NAME = "Subject Key Identifier"; class mU extends Ci { constructor(...e) { Ce.isBufferSource(e[0]) ? super(e[0]) : super(zA, e[1], new Dc(e[0] || []).rawData); } onInit(e) { super.onInit(e); const n = Te.parse(e.extnValue, Ag); this.names = new Dc(n); } toTextObject() { const e = this.toTextObjectWithoutValue(), n = this.names.toTextObject(); for (const r in n) e[r] = n[r]; return e; } } mU.NAME = "Subject Alternative Name"; class jr { static register(e, n) { this.items.set(e, n); } static create(e) { const n = new Ci(e), r = this.items.get(n.type); return r ? new r(e) : n; } } jr.items = /* @__PURE__ */ new Map(); class gU extends Ci { constructor(...e) { var n; if (Ce.isBufferSource(e[0])) { super(e[0]); const r = Te.parse(this.value, xg); this.policies = r.map((i) => i.policyIdentifier); } else { const r = e[0], i = (n = e[1]) !== null && n !== void 0 ? n : !1, o = new xg(r.map((a) => new w1({ policyIdentifier: a }))); super(D9, i, Te.serialize(o)), this.policies = r; } } toTextObject() { const e = this.toTextObjectWithoutValue(); return e.Policy = this.policies.map((n) => new kt("", {}, zs.toString(n))), e; } } gU.NAME = "Certificate Policies"; jr.register(D9, gU); class u3 extends Ci { constructor(...e) { var n; if (Ce.isBufferSource(e[0])) super(e[0]); else if (Array.isArray(e[0]) && typeof e[0][0] == "string") { const i = e[0].map((a) => new Ql({ distributionPoint: new Ac({ fullName: [new ct({ uniformResourceIdentifier: a })] }) })), o = new Du(i); super(p_, e[1], Te.serialize(o)); } else { const r = new Du(e[0]); super(p_, e[1], Te.serialize(r)); } (n = this.distributionPoints) !== null && n !== void 0 || (this.distributionPoints = []); } onInit(e) { super.onInit(e); const n = Te.parse(e.extnValue, Du); this.distributionPoints = n; } toTextObject() { const e = this.toTextObjectWithoutValue(); return e["Distribution Point"] = this.distributionPoints.map((n) => { var r; const i = {}; return n.distributionPoint && (i[""] = (r = n.distributionPoint.fullName) === null || r === void 0 ? void 0 : r.map((o) => new ms(o).toString()).join(", ")), n.reasons && (i.Reasons = n.reasons.toString()), n.cRLIssuer && (i["CRL Issuer"] = n.cRLIssuer.map((o) => o.toString()).join(", ")), i; }), e; } } u3.NAME = "CRL Distribution Points"; class yU extends Ci { constructor(...e) { var n, r, i, o; if (Ce.isBufferSource(e[0])) super(e[0]); else if (e[0] instanceof Cu) { const a = new Cu(e[0]); super(a_, e[1], Te.serialize(a)); } else { const a = e[0], s = new Cu(); im(s, a, kN, "ocsp"), im(s, a, NN, "caIssuers"), im(s, a, PN, "timeStamping"), im(s, a, DN, "caRepository"), super(a_, e[1], Te.serialize(s)); } (n = this.ocsp) !== null && n !== void 0 || (this.ocsp = []), (r = this.caIssuers) !== null && r !== void 0 || (this.caIssuers = []), (i = this.timeStamping) !== null && i !== void 0 || (this.timeStamping = []), (o = this.caRepository) !== null && o !== void 0 || (this.caRepository = []); } onInit(e) { super.onInit(e), this.ocsp = [], this.caIssuers = [], this.timeStamping = [], this.caRepository = [], Te.parse(e.extnValue, Cu).forEach((r) => { switch (r.accessMethod) { case kN: this.ocsp.push(new ms(r.accessLocation)); break; case NN: this.caIssuers.push(new ms(r.accessLocation)); break; case PN: this.timeStamping.push(new ms(r.accessLocation)); break; case DN: this.caRepository.push(new ms(r.accessLocation)); break; } }); } toTextObject() { const e = this.toTextObjectWithoutValue(); return this.ocsp.length && rm(e, "OCSP", this.ocsp), this.caIssuers.length && rm(e, "CA Issuers", this.caIssuers), this.timeStamping.length && rm(e, "Time Stamping", this.timeStamping), this.caRepository.length && rm(e, "CA Repository", this.caRepository), e; } } yU.NAME = "Authority Info Access"; function rm(t, e, n) { if (n.length === 1) t[e] = n[0].toTextObject(); else { const r = new kt(""); n.forEach((i, o) => { const a = i.toTextObject(), s = `${a[kt.NAME]} ${o + 1}`; let c = r[s]; Array.isArray(c) || (c = [], r[s] = c), c.push(a); }), t[e] = r; } } function im(t, e, n, r) { const i = e[r]; i && (Array.isArray(i) ? i : [i]).forEach((a) => { typeof a == "string" && (a = new ms("url", a)), t.push(new Tf({ accessMethod: n, accessLocation: Te.parse(a.rawData, ct) })); }); } class bU extends Ci { constructor(...e) { Ce.isBufferSource(e[0]) ? super(e[0]) : super(F9, e[1], new Dc(e[0] || []).rawData); } onInit(e) { super.onInit(e); const n = Te.parse(e.extnValue, Cr); this.names = new Dc(n); } toTextObject() { const e = this.toTextObjectWithoutValue(), n = this.names.toTextObject(); for (const r in n) e[r] = n[r]; return e; } } bU.NAME = "Issuer Alternative Name"; class Wl extends Ka { constructor(...e) { let n; if (Ce.isBufferSource(e[0])) n = Ce.toArrayBuffer(e[0]); else { const r = e[0], i = Array.isArray(e[1]) ? e[1].map((o) => Ce.toArrayBuffer(o)) : []; n = Te.serialize(new Ma({ type: r, values: i })); } super(n, Ma); } onInit(e) { this.type = e.type, this.values = e.values; } toTextObject() { const e = this.toTextObjectWithoutValue(); return e.Value = this.values.map((n) => new kt("", { "": n })), e; } toTextObjectWithoutValue() { const e = this.toTextObjectEmpty(); return e[kt.NAME] === Wl.NAME && (e[kt.NAME] = zs.toString(this.type)), e; } } Wl.NAME = "Attribute"; class vU extends Wl { constructor(...e) { var n; if (Ce.isBufferSource(e[0])) super(e[0]); else { const r = new Hg({ printableString: e[0] }); super(aU, [Te.serialize(r)]); } (n = this.password) !== null && n !== void 0 || (this.password = ""); } onInit(e) { if (super.onInit(e), this.values[0]) { const n = Te.parse(this.values[0], Hg); this.password = n.toString(); } } toTextObject() { const e = this.toTextObjectWithoutValue(); return e[kt.VALUE] = this.password, e; } } vU.NAME = "Challenge Password"; class l3 extends Wl { constructor(...e) { var n; if (Ce.isBufferSource(e[0])) super(e[0]); else { const r = e[0], i = new Ic(); for (const o of r) i.push(Te.parse(o.rawData, To)); super(c3, [Te.serialize(i)]); } (n = this.items) !== null && n !== void 0 || (this.items = []); } onInit(e) { if (super.onInit(e), this.values[0]) { const n = Te.parse(this.values[0], Ic); this.items = n.map((r) => jr.create(Te.serialize(r))); } } toTextObject() { const e = this.toTextObjectWithoutValue(), n = this.items.map((r) => r.toTextObject()); for (const r of n) e[r[kt.NAME]] = r; return e; } } l3.NAME = "Extensions"; class H1 { static register(e, n) { this.items.set(e, n); } static create(e) { const n = new Wl(e), r = this.items.get(n.type); return r ? new r(e) : n; } } H1.items = /* @__PURE__ */ new Map(); const jf = "crypto.signatureFormatter"; class Phe { toAsnSignature(e, n) { return Ce.toArrayBuffer(n); } toWebSignature(e, n) { return Ce.toArrayBuffer(n); } } var Bm; let d2 = Bm = class { static createPssParams(e, n) { const r = Bm.getHashAlgorithm(e); return r ? new kc({ hashAlgorithm: r, maskGenAlgorithm: new Fe({ algorithm: R1, parameters: Te.serialize(r) }), saltLength: n }) : null; } static getHashAlgorithm(e) { const n = xr.resolve(Nc); return typeof e == "string" ? n.toAsnAlgorithm({ name: e }) : typeof e == "object" && e && "name" in e ? n.toAsnAlgorithm(e) : null; } toAsnAlgorithm(e) { switch (e.name.toLowerCase()) { case "rsassa-pkcs1-v1_5": if ("hash" in e) { let n; if (typeof e.hash == "string") n = e.hash; else if (e.hash && typeof e.hash == "object" && "name" in e.hash && typeof e.hash.name == "string") n = e.hash.name.toUpperCase(); else throw new Error("Cannot get hash algorithm name"); switch (n.toLowerCase()) { case "sha-1": return new Fe({ algorithm: Bg, parameters: null }); case "sha-256": return new Fe({ algorithm: $_, parameters: null }); case "sha-384": return new Fe({ algorithm: Ug, parameters: null }); case "sha-512": return new Fe({ algorithm: Lg, parameters: null }); } } else return new Fe({ algorithm: As, parameters: null }); break; case "rsa-pss": if ("hash" in e) { if (!("saltLength" in e && typeof e.saltLength == "number")) throw new Error("Cannot get 'saltLength' from 'alg' argument"); const n = Bm.createPssParams(e.hash, e.saltLength); if (!n) throw new Error("Cannot create PSS parameters"); return new Fe({ algorithm: dp, parameters: Te.serialize(n) }); } else return new Fe({ algorithm: dp, parameters: null }); } return null; } toWebAlgorithm(e) { switch (e.algorithm) { case As: return { name: "RSASSA-PKCS1-v1_5" }; case Bg: return { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-1" } }; case $_: return { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-256" } }; case Ug: return { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-384" } }; case Lg: return { name: "RSASSA-PKCS1-v1_5", hash: { name: "SHA-512" } }; case dp: if (e.parameters) { const n = Te.parse(e.parameters, kc); return { name: "RSA-PSS", hash: xr.resolve(Nc).toWebAlgorithm(n.hashAlgorithm), saltLength: n.saltLength }; } else return { name: "RSA-PSS" }; } return null; } }; d2 = Bm = R([ j1() ], d2); xr.registerSingleton(Lf, d2); let p2 = class { toAsnAlgorithm(e) { switch (e.name.toLowerCase()) { case "sha-1": return new Fe({ algorithm: Qg }); case "sha-256": return new Fe({ algorithm: jg }); case "sha-384": return new Fe({ algorithm: $g }); case "sha-512": return new Fe({ algorithm: Gg }); } return null; } toWebAlgorithm(e) { switch (e.algorithm) { case Qg: return { name: "SHA-1" }; case jg: return { name: "SHA-256" }; case $g: return { name: "SHA-384" }; case Gg: return { name: "SHA-512" }; } return null; } }; p2 = R([ j1() ], p2); xr.registerSingleton(Lf, p2); class Li { addPadding(e, n) { const r = Ce.toUint8Array(n), i = new Uint8Array(e); return i.set(r, e - r.length), i.buffer; } removePadding(e, n = !1) { let r = Ce.toUint8Array(e); for (let i = 0; i < r.length; i++) if (r[i]) { r = r.slice(i); break; } if (n && r[0] > 127) { const i = new Uint8Array(r.length + 1); return i.set(r, 1), i.buffer; } return r.buffer; } toAsnSignature(e, n) { if (e.name === "ECDSA") { const r = e.namedCurve, i = Li.namedCurveSize.get(r) || Li.defaultNamedCurveSize, o = new Up(), a = Ce.toUint8Array(n); return o.r = this.removePadding(a.slice(0, i), !0), o.s = this.removePadding(a.slice(i, i + i), !0), Te.serialize(o); } return null; } toWebSignature(e, n) { if (e.name === "ECDSA") { const r = Te.parse(n, Up), i = e.namedCurve, o = Li.namedCurveSize.get(i) || Li.defaultNamedCurveSize, a = this.addPadding(o, this.removePadding(r.r)), s = this.addPadding(o, this.removePadding(r.s)); return Bpe(a, s); } return null; } } Li.namedCurveSize = /* @__PURE__ */ new Map(); Li.defaultNamedCurveSize = 32; const Nw = "1.3.101.110", K5 = "1.3.101.111", Pw = "1.3.101.112", V5 = "1.3.101.113"; let f2 = class { toAsnAlgorithm(e) { let n = null; switch (e.name.toLowerCase()) { case "ed25519": n = Pw; break; case "x25519": n = Nw; break; case "eddsa": switch (e.namedCurve.toLowerCase()) { case "ed25519": n = Pw; break; case "ed448": n = V5; break; } break; case "ecdh-es": switch (e.namedCurve.toLowerCase()) { case "x25519": n = Nw; break; case "x448": n = K5; break; } } return n ? new Fe({ algorithm: n }) : null; } toWebAlgorithm(e) { switch (e.algorithm) { case Pw: return { name: "Ed25519" }; case V5: return { name: "EdDSA", namedCurve: "Ed448" }; case Nw: return { name: "X25519" }; case K5: return { name: "ECDH-ES", namedCurve: "X448" }; } return null; } }; f2 = R([ j1() ], f2); xr.registerSingleton(Lf, f2); var Sd, _d, Ed, Ad, Id, Cd, Td, hu; class Dhe extends No { get subjectName() { return Be(this, _d, "f") || mt(this, _d, new Is(this.asn.certificationRequestInfo.subject), "f"), Be(this, _d, "f"); } get subject() { return Be(this, Ed, "f") || mt(this, Ed, this.subjectName.toString(), "f"), Be(this, Ed, "f"); } get signatureAlgorithm() { if (!Be(this, Ad, "f")) { const e = xr.resolve(Nc); mt(this, Ad, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); } return Be(this, Ad, "f"); } get signature() { return Be(this, Id, "f") || mt(this, Id, this.asn.signature, "f"), Be(this, Id, "f"); } get publicKey() { return Be(this, Cd, "f") || mt(this, Cd, new ho(this.asn.certificationRequestInfo.subjectPKInfo), "f"), Be(this, Cd, "f"); } get attributes() { return Be(this, Td, "f") || mt(this, Td, this.asn.certificationRequestInfo.attributes.map((e) => H1.create(Te.serialize(e))), "f"), Be(this, Td, "f"); } get extensions() { if (!Be(this, hu, "f")) { mt(this, hu, [], "f"); const e = this.getAttribute(c3); e instanceof l3 && mt(this, hu, e.items, "f"); } return Be(this, hu, "f"); } get tbs() { return Be(this, Sd, "f") || mt(this, Sd, this.asn.certificationRequestInfoRaw || Te.serialize(this.asn.certificationRequestInfo), "f"), Be(this, Sd, "f"); } constructor(e) { const n = No.isAsnEncoded(e) ? [e, Lp] : [e]; super(n[0], n[1]), Sd.set(this, void 0), _d.set(this, void 0), Ed.set(this, void 0), Ad.set(this, void 0), Id.set(this, void 0), Cd.set(this, void 0), Td.set(this, void 0), hu.set(this, void 0), this.tag = Kr.CertificateRequestTag; } onInit(e) { } getAttribute(e) { for (const n of this.attributes) if (n.type === e) return n; return null; } getAttributes(e) { return this.attributes.filter((n) => n.type === e); } getExtension(e) { for (const n of this.extensions) if (n.type === e) return n; return null; } getExtensions(e) { return this.extensions.filter((n) => n.type === e); } async verify(e = Jn.get()) { const n = { ...this.publicKey.algorithm, ...this.signatureAlgorithm }, r = await this.publicKey.export(n, ["verify"], e), i = xr.resolveAll(jf).reverse(); let o = null; for (const s of i) if (o = s.toWebSignature(n, this.signature), o) break; if (!o) throw Error("Cannot convert WebCrypto signature value to ASN.1 format"); return await e.subtle.verify(this.signatureAlgorithm, r, o, this.tbs); } toTextObject() { const e = this.toTextObjectEmpty(), n = Te.parse(this.rawData, Lp), r = n.certificationRequestInfo, i = new kt("", { Version: `${Ju[r.version]} (${r.version})`, Subject: this.subject, "Subject Public Key Info": this.publicKey }); if (this.attributes.length) { const o = new kt(""); for (const a of this.attributes) { const s = a.toTextObject(); o[s[kt.NAME]] = s; } i.Attributes = o; } return e.Data = i, e.Signature = new kt("", { Algorithm: Pc.serializeAlgorithm(n.signatureAlgorithm), "": n.signature }), e; } } Sd = /* @__PURE__ */ new WeakMap(), _d = /* @__PURE__ */ new WeakMap(), Ed = /* @__PURE__ */ new WeakMap(), Ad = /* @__PURE__ */ new WeakMap(), Id = /* @__PURE__ */ new WeakMap(), Cd = /* @__PURE__ */ new WeakMap(), Td = /* @__PURE__ */ new WeakMap(), hu = /* @__PURE__ */ new WeakMap(); Dhe.NAME = "PKCS#10 Certificate Request"; var kd, Nd, Pd, Dd, Od, Fd, Md, Rd, Bd, Ud, mu, Ld; class Kg extends No { get publicKey() { return Be(this, Ld, "f") || mt(this, Ld, new ho(this.asn.tbsCertificate.subjectPublicKeyInfo), "f"), Be(this, Ld, "f"); } get serialNumber() { if (!Be(this, Nd, "f")) { const e = this.asn.tbsCertificate; let n = new Uint8Array(e.serialNumber); n.length > 1 && n[0] === 0 && n[1] > 127 && (n = n.slice(1)), mt(this, Nd, Le.ToHex(n), "f"); } return Be(this, Nd, "f"); } get subjectName() { return Be(this, Pd, "f") || mt(this, Pd, new Is(this.asn.tbsCertificate.subject), "f"), Be(this, Pd, "f"); } get subject() { return Be(this, Dd, "f") || mt(this, Dd, this.subjectName.toString(), "f"), Be(this, Dd, "f"); } get issuerName() { return Be(this, Od, "f") || mt(this, Od, new Is(this.asn.tbsCertificate.issuer), "f"), Be(this, Od, "f"); } get issuer() { return Be(this, Fd, "f") || mt(this, Fd, this.issuerName.toString(), "f"), Be(this, Fd, "f"); } get notBefore() { if (!Be(this, Md, "f")) { const e = this.asn.tbsCertificate.validity.notBefore.utcTime || this.asn.tbsCertificate.validity.notBefore.generalTime; if (!e) throw new Error("Cannot get 'notBefore' value"); mt(this, Md, e, "f"); } return Be(this, Md, "f"); } get notAfter() { if (!Be(this, Rd, "f")) { const e = this.asn.tbsCertificate.validity.notAfter.utcTime || this.asn.tbsCertificate.validity.notAfter.generalTime; if (!e) throw new Error("Cannot get 'notAfter' value"); mt(this, Rd, e, "f"); } return Be(this, Rd, "f"); } get signatureAlgorithm() { if (!Be(this, Bd, "f")) { const e = xr.resolve(Nc); mt(this, Bd, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); } return Be(this, Bd, "f"); } get signature() { return Be(this, Ud, "f") || mt(this, Ud, this.asn.signatureValue, "f"), Be(this, Ud, "f"); } get extensions() { return Be(this, mu, "f") || (mt(this, mu, [], "f"), this.asn.tbsCertificate.extensions && mt(this, mu, this.asn.tbsCertificate.extensions.map((e) => jr.create(Te.serialize(e))), "f")), Be(this, mu, "f"); } get tbs() { return Be(this, kd, "f") || mt(this, kd, this.asn.tbsCertificateRaw || Te.serialize(this.asn.tbsCertificate), "f"), Be(this, kd, "f"); } constructor(e) { const n = No.isAsnEncoded(e) ? [e, ko] : [e]; super(n[0], n[1]), kd.set(this, void 0), Nd.set(this, void 0), Pd.set(this, void 0), Dd.set(this, void 0), Od.set(this, void 0), Fd.set(this, void 0), Md.set(this, void 0), Rd.set(this, void 0), Bd.set(this, void 0), Ud.set(this, void 0), mu.set(this, void 0), Ld.set(this, void 0), this.tag = Kr.CertificateTag; } onInit(e) { } getExtension(e) { for (const n of this.extensions) if (typeof e == "string") { if (n.type === e) return n; } else if (n instanceof e) return n; return null; } getExtensions(e) { return this.extensions.filter((n) => typeof e == "string" ? n.type === e : n instanceof e); } async verify(e = {}, n = Jn.get()) { let r, i; const o = e.publicKey; try { if (!o) r = { ...this.publicKey.algorithm, ...this.signatureAlgorithm }, i = await this.publicKey.export(r, ["verify"], n); else if ("publicKey" in o) r = { ...o.publicKey.algorithm, ...this.signatureAlgorithm }, i = await o.publicKey.export(r, ["verify"], n); else if (o instanceof ho) r = { ...o.algorithm, ...this.signatureAlgorithm }, i = await o.export(r, ["verify"], n); else if (Ce.isBufferSource(o)) { const u = new ho(o); r = { ...u.algorithm, ...this.signatureAlgorithm }, i = await u.export(r, ["verify"], n); } else r = { ...o.algorithm, ...this.signatureAlgorithm }, i = o; } catch { return !1; } const a = xr.resolveAll(jf).reverse(); let s = null; for (const u of a) if (s = u.toWebSignature(r, this.signature), s) break; if (!s) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); const c = await n.subtle.verify(this.signatureAlgorithm, i, s, this.tbs); if (e.signatureOnly) return c; { const d = (e.date || /* @__PURE__ */ new Date()).getTime(); return c && this.notBefore.getTime() < d && d < this.notAfter.getTime(); } } async getThumbprint(...e) { let n, r = "SHA-1"; return e[0] && (e[0].subtle ? n = e[0] : (r = e[0] || r, n = e[1])), n ?? (n = Jn.get()), await n.subtle.digest(r, this.rawData); } async isSelfSigned(e = Jn.get()) { return this.subject === this.issuer && await this.verify({ signatureOnly: !0 }, e); } toTextObject() { const e = this.toTextObjectEmpty(), n = Te.parse(this.rawData, ko), r = n.tbsCertificate, i = new kt("", { Version: `${Ju[r.version]} (${r.version})`, "Serial Number": r.serialNumber, "Signature Algorithm": Pc.serializeAlgorithm(r.signature), Issuer: this.issuer, Validity: new kt("", { "Not Before": r.validity.notBefore.getTime(), "Not After": r.validity.notAfter.getTime() }), Subject: this.subject, "Subject Public Key Info": this.publicKey }); if (r.issuerUniqueID && (i["Issuer Unique ID"] = r.issuerUniqueID), r.subjectUniqueID && (i["Subject Unique ID"] = r.subjectUniqueID), this.extensions.length) { const o = new kt(""); for (const a of this.extensions) { const s = a.toTextObject(); o[s[kt.NAME]] = s; } i.Extensions = o; } return e.Data = i, e.Signature = new kt("", { Algorithm: Pc.serializeAlgorithm(n.signatureAlgorithm), "": n.signatureValue }), e; } } kd = /* @__PURE__ */ new WeakMap(), Nd = /* @__PURE__ */ new WeakMap(), Pd = /* @__PURE__ */ new WeakMap(), Dd = /* @__PURE__ */ new WeakMap(), Od = /* @__PURE__ */ new WeakMap(), Fd = /* @__PURE__ */ new WeakMap(), Md = /* @__PURE__ */ new WeakMap(), Rd = /* @__PURE__ */ new WeakMap(), Bd = /* @__PURE__ */ new WeakMap(), Ud = /* @__PURE__ */ new WeakMap(), mu = /* @__PURE__ */ new WeakMap(), Ld = /* @__PURE__ */ new WeakMap(); Kg.NAME = "Certificate"; function xU(t, e = Jn.get()) { const n = Ce.toUint8Array(Le.FromHex(t || "")); let r = n && n.length && n.some((o) => o > 0) ? new Uint8Array(n) : void 0; r || (r = e.getRandomValues(new Uint8Array(16))); let i = 0; for (; i < r.length - 1 && r[i] === 0; ) i++; if (r = r.slice(i), r[0] > 127) { const o = new Uint8Array(r.length + 1); o[0] = 0, o.set(r, 1), r = o; } return r.buffer; } var Qd, jd, gu, yu, bu, Y5; (function(t) { t[t.unspecified = 0] = "unspecified", t[t.keyCompromise = 1] = "keyCompromise", t[t.cACompromise = 2] = "cACompromise", t[t.affiliationChanged = 3] = "affiliationChanged", t[t.superseded = 4] = "superseded", t[t.cessationOfOperation = 5] = "cessationOfOperation", t[t.certificateHold = 6] = "certificateHold", t[t.removeFromCRL = 8] = "removeFromCRL", t[t.privilegeWithdrawn = 9] = "privilegeWithdrawn", t[t.aACompromise = 10] = "aACompromise"; })(Y5 || (Y5 = {})); class J5 extends Ka { get serialNumber() { return Be(this, Qd, "f") || mt(this, Qd, Le.ToHex(this.asn.userCertificate), "f"), Be(this, Qd, "f"); } get revocationDate() { return Be(this, jd, "f") || mt(this, jd, this.asn.revocationDate.getTime(), "f"), Be(this, jd, "f"); } get reason() { return Be(this, gu, "f") === void 0 && this.extensions, Be(this, gu, "f"); } get invalidity() { return Be(this, yu, "f") === void 0 && this.extensions, Be(this, yu, "f"); } get extensions() { return Be(this, bu, "f") || (mt(this, bu, [], "f"), this.asn.crlEntryExtensions && mt(this, bu, this.asn.crlEntryExtensions.map((e) => { const n = jr.create(Te.serialize(e)); switch (n.type) { case Tfe: Be(this, gu, "f") === void 0 && mt(this, gu, Te.parse(n.value, Sg).reason, "f"); break; case Mfe: Be(this, yu, "f") === void 0 && mt(this, yu, Te.parse(n.value, _g).value, "f"); break; } return n; }), "f")), Be(this, bu, "f"); } constructor(...e) { let n; if (Ce.isBufferSource(e[0]) ? n = Ce.toArrayBuffer(e[0]) : typeof e[0] == "string" ? n = Te.serialize(new mc({ userCertificate: xU(e[0]), revocationDate: new tr(e[1]), crlEntryExtensions: e[2] })) : e[0] instanceof mc && (n = e[0]), !n) throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments."); super(n, mc), Qd.set(this, void 0), jd.set(this, void 0), gu.set(this, void 0), yu.set(this, void 0), bu.set(this, void 0); } onInit(e) { } } Qd = /* @__PURE__ */ new WeakMap(), jd = /* @__PURE__ */ new WeakMap(), gu = /* @__PURE__ */ new WeakMap(), yu = /* @__PURE__ */ new WeakMap(), bu = /* @__PURE__ */ new WeakMap(); var $d, Gd, qd, zd, Hd, Wd, vu; class Ohe extends No { get version() { return this.asn.tbsCertList.version; } get signatureAlgorithm() { if (!Be(this, Gd, "f")) { const e = xr.resolve(Nc); mt(this, Gd, e.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); } return Be(this, Gd, "f"); } get signature() { return this.asn.signature; } get issuer() { return this.issuerName.toString(); } get issuerName() { return Be(this, qd, "f") || mt(this, qd, new Is(this.asn.tbsCertList.issuer), "f"), Be(this, qd, "f"); } get thisUpdate() { if (!Be(this, zd, "f")) { const e = this.asn.tbsCertList.thisUpdate.getTime(); if (!e) throw new Error("Cannot get 'thisUpdate' value"); mt(this, zd, e, "f"); } return Be(this, zd, "f"); } get nextUpdate() { var e; return Be(this, Hd, "f") === void 0 && mt(this, Hd, ((e = this.asn.tbsCertList.nextUpdate) === null || e === void 0 ? void 0 : e.getTime()) || void 0, "f"), Be(this, Hd, "f"); } get entries() { var e; return Be(this, Wd, "f") || mt(this, Wd, ((e = this.asn.tbsCertList.revokedCertificates) === null || e === void 0 ? void 0 : e.map((n) => new J5(n))) || [], "f"), Be(this, Wd, "f"); } get extensions() { return Be(this, vu, "f") || (mt(this, vu, [], "f"), this.asn.tbsCertList.crlExtensions && mt(this, vu, this.asn.tbsCertList.crlExtensions.map((e) => jr.create(Te.serialize(e))), "f")), Be(this, vu, "f"); } get tbs() { return Be(this, $d, "f") || mt(this, $d, this.asn.tbsCertListRaw || Te.serialize(this.asn.tbsCertList), "f"), Be(this, $d, "f"); } get tbsCertListSignatureAlgorithm() { return this.asn.tbsCertList.signature; } get certListSignatureAlgorithm() { return this.asn.signatureAlgorithm; } constructor(e) { super(e, No.isAsnEncoded(e) ? E1 : void 0), this.tag = Kr.CrlTag, $d.set(this, void 0), Gd.set(this, void 0), qd.set(this, void 0), zd.set(this, void 0), Hd.set(this, void 0), Wd.set(this, void 0), vu.set(this, void 0); } onInit(e) { } getExtension(e) { for (const n of this.extensions) if (typeof e == "string") { if (n.type === e) return n; } else if (n instanceof e) return n; return null; } getExtensions(e) { return this.extensions.filter((n) => typeof e == "string" ? n.type === e : n instanceof e); } async verify(e, n = Jn.get()) { if (!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm)) throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch"); let r, i; const o = e.publicKey; try { o instanceof Kg ? (r = { ...o.publicKey.algorithm, ...o.signatureAlgorithm }, i = await o.publicKey.export(r, ["verify"])) : o instanceof ho ? (r = { ...o.algorithm, ...this.signatureAlgorithm }, i = await o.export(r, ["verify"])) : (r = { ...o.algorithm, ...this.signatureAlgorithm }, i = o); } catch { return !1; } const a = xr.resolveAll(jf).reverse(); let s = null; for (const c of a) if (s = c.toWebSignature(r, this.signature), s) break; if (!s) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); return await n.subtle.verify(this.signatureAlgorithm, i, s, this.tbs); } async getThumbprint(...e) { let n, r = "SHA-1"; return e[0] && (e[0].subtle ? n = e[0] : (r = e[0] || r, n = e[1])), n ?? (n = Jn.get()), await n.subtle.digest(r, this.rawData); } findRevoked(e) { const n = typeof e == "string" ? e : e.serialNumber, r = xU(n); for (const i of this.asn.tbsCertList.revokedCertificates || []) if (Ce.isEqual(i.userCertificate, r)) return new J5(Te.serialize(i)); return null; } } $d = /* @__PURE__ */ new WeakMap(), Gd = /* @__PURE__ */ new WeakMap(), qd = /* @__PURE__ */ new WeakMap(), zd = /* @__PURE__ */ new WeakMap(), Hd = /* @__PURE__ */ new WeakMap(), Wd = /* @__PURE__ */ new WeakMap(), vu = /* @__PURE__ */ new WeakMap(); jr.register(LA, pU); jr.register(GA, fU); jr.register(M9, hU); jr.register(U9, Qf); jr.register(s_, sl); jr.register(zA, mU); jr.register(p_, u3); jr.register(a_, yU); jr.register(F9, bU); H1.register(aU, vU); H1.register(c3, l3); xr.registerSingleton(jf, Phe); xr.registerSingleton(jf, Li); Li.namedCurveSize.set("P-256", 32); Li.namedCurveSize.set("K-256", 32); Li.namedCurveSize.set("P-384", 48); Li.namedCurveSize.set("P-521", 66); function wU(t) { return Fhe.stubThis(t); } const Fhe = { stubThis: (t) => globalThis.fetch(t) }, X5 = {}; async function Mhe(t) { const { extensions: e } = t; if (!e) return !1; let n, r, i; e.forEach((p) => { p instanceof sl ? n = p : p instanceof Qf ? r = p : p instanceof u3 && (i = p); }); let o; if (n && n.keyId ? o = n.keyId : r && (o = r.keyId), o) { const p = X5[o]; if (p) { const f = /* @__PURE__ */ new Date(); if (!p.nextUpdate || p.nextUpdate > f) return p.revokedCerts.indexOf(t.serialNumber) >= 0; } } const a = i?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier; if (!a) return !1; let s; try { s = await (await wU(a)).arrayBuffer(); } catch { return !1; } let c; try { c = new Ohe(s); } catch { return !1; } const u = { revokedCerts: [], nextUpdate: void 0 }; c.nextUpdate && (u.nextUpdate = c.nextUpdate); const d = c.entries; if (d) { for (const p of d) { const f = p.serialNumber; u.revokedCerts.push(f); } return o && (X5[o] = u), u.revokedCerts.indexOf(t.serialNumber) >= 0; } return !1; } function Rhe(t) { let e; try { e = Wu(t); } catch (n) { const r = n; throw new Error(`Error decoding authenticator extensions: ${r.message}`); } return SU(e); } function SU(t) { const e = {}; for (const [n, r] of t) r instanceof Map ? e[n] = SU(r) : e[n] = r; return e; } function _U(t) { if (t.byteLength < 37) throw new Error(`Authenticator data was ${t.byteLength} bytes, expected at least 37 bytes`); let e = 0; const n = Yg(t), r = t.slice(e, e += 32), i = t.slice(e, e += 1), o = i[0], a = { up: !!(o & 1), // User Presence uv: !!(o & 4), // User Verified be: !!(o & 8), // Backup Eligibility bs: !!(o & 16), // Backup State at: !!(o & 64), // Attested Credential Data Present ed: !!(o & 128), // Extension Data Present flagsInt: o }, s = t.slice(e, e + 4), c = n.getUint32(e, !1); e += 4; let u, d, p; if (a.at) { u = t.slice(e, e += 16); const h = n.getUint16(e); e += 2, d = t.slice(e, e += h); const y = Ghe("a301634f4b500327206745643235353139"), x = t.slice(e, e + y.byteLength); let g = !1; lo(y, x) && (g = !0, t[e] = 164); const b = Wu(t.slice(e)), S = Uint8Array.from( /** * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps * with discrete keys and properties with known types per pair, and CBOR libs typically parse * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be * generalized as "a Map with numbers for keys and either numbers or bytes for values" though. * If this presumption falls apart then other parts of verification later on will fail so we * should be safe doing this here. */ wN(b) ); g && (t[e] = 163), p = S, e += S.byteLength; } let f, m; if (a.ed) { const h = Wu(t.slice(e)); m = Uint8Array.from(wN(h)), f = Rhe(m), e += m.byteLength; } if (t.byteLength > e) throw new Error("Leftover bytes detected while parsing authenticator data"); return Bhe.stubThis({ rpIdHash: r, flagsBuf: i, flags: a, counter: c, counterBuf: s, aaguid: u, credentialID: d, credentialPublicKey: p, extensionsData: f, extensionsDataBuffer: m }); } const Bhe = { stubThis: (t) => t }; function Oc(t, e = -7) { return typeof t == "string" && (t = $f(t)), Ipe(t, e); } async function Hs(t, e = []) { if (e.length === 0) return !0; const n = await Vc(), r = t.map((s) => new Kg(s)); for (let s = 0; s < r.length; s++) { const c = r[s], u = t[s]; try { await Z5(c); } catch { throw new Error(`Found revoked certificate in x5c: ${u}`); } try { eP(c.notBefore, c.notAfter); } catch { throw new Error(`Found certificate out of validity period in x5c: ${u}`); } } const i = e.map((s) => { try { return new Kg(s); } catch (c) { const u = c; throw new Error(`Could not parse trust anchor certificate: ${s}`, { cause: u }); } }), o = []; for (let s = 0; s < i.length; s++) { const c = i[s]; try { await Z5(c); } catch { continue; } try { eP(c.notBefore, c.notAfter); } catch { continue; } o.push(c); } if (o.length === 0) throw new Error("No specified trust anchor was valid for verifying x5c"); let a = !1; for (const s of i) try { const c = r.concat([s]); if (new Set(c).size !== c.length) throw new Error("Invalid certificate path: found duplicate certificates"); for (let u = 0; u < c.length - 1; u++) { const d = c[u], p = c[u + 1]; if (!await d.verify({ publicKey: p.publicKey, signatureOnly: !0 }, n)) throw new om(); if (p.subject === p.issuer) { if (!await p.verify({ publicKey: p.publicKey, signatureOnly: !0 }, n)) throw new om(); break; } } a = !1; break; } catch (c) { if (c instanceof om) a = !0; else throw new Error("Unexpected error while validating certificate path", { cause: c }); } if (a) throw new om(); return !0; } async function Z5(t) { if (await Mhe(t)) throw new Error("Found revoked certificate in certificate path"); } function eP(t, e) { const n = new Date(Date.now()); if (t > n || e < n) throw new Error("Certificate is not yet valid or expired"); } class om extends Error { constructor() { super("Subject issuer did not match issuer subject"), this.name = "InvalidSubjectAndIssuer"; } } function tP(t) { let e; if (t === "1.2.840.10045.4.3.2") e = yt.ES256; else if (t === "1.2.840.10045.4.3.3") e = yt.ES384; else if (t === "1.2.840.10045.4.3.4") e = yt.ES512; else if (t === "1.2.840.113549.1.1.11") e = yt.RS256; else if (t === "1.2.840.113549.1.1.12") e = yt.RS384; else if (t === "1.2.840.113549.1.1.13") e = yt.RS512; else if (t === "1.2.840.113549.1.1.5") e = yt.RS1; else throw new Error(`Unable to map X.509 signature algorithm ${t} to a COSE algorithm`); return e; } function EU(t) { let e = /* @__PURE__ */ new Map(); const n = Xr.parse(t, ko), { tbsCertificate: r } = n, { subjectPublicKeyInfo: i, signature: o } = r, a = o.algorithm, s = i.algorithm.algorithm; if (s === il) { if (!i.algorithm.parameters) throw new Error("Certificate public key was missing parameters (EC2)"); const c = Xr.parse(new Uint8Array(i.algorithm.parameters), Ua); let u = -999; const { namedCurve: d } = c; if (d === L_) u = ji.P256; else if (d === Q_) u = ji.P384; else throw new Error(`Certificate public key contained unexpected namedCurve ${d} (EC2)`); const p = new Uint8Array(i.subjectPublicKey); let f, m; if (p[0] === 4) { let y = 1; const x = (p.length - 1) / 2; f = p.slice(y, y += x), m = p.slice(y); } else throw new Error('TODO: Figure out how to handle public keys in "compressed form"'); const h = /* @__PURE__ */ new Map(); h.set(pt.kty, Io.EC2), h.set(pt.alg, tP(a)), h.set(pt.crv, u), h.set(pt.x, f), h.set(pt.y, m), e = h; } else if (s === As) { const c = Xr.parse(i.subjectPublicKey, Q1), u = /* @__PURE__ */ new Map(); u.set(pt.kty, Io.RSA), u.set(pt.alg, tP(a)), u.set(pt.n, new Uint8Array(c.modulus)), u.set(pt.e, new Uint8Array(c.publicExponent)), e = u; } else throw new Error(`Certificate public key contained unexpected algorithm ID ${s}`); return e; } function Fc(t) { const { signature: e, data: n, credentialPublicKey: r, x509Certificate: i, hashAlgorithm: o } = t; if (!i && !r) throw new Error('Must declare either "leafCert" or "credentialPublicKey"'); if (i && r) throw new Error('Must not declare both "leafCert" and "credentialPublicKey"'); let a = /* @__PURE__ */ new Map(); return r ? a = t1(r) : i && (a = EU(i)), Uhe.stubThis($he({ cosePublicKey: a, signature: e, data: n, shaHashOverride: o })); } const Uhe = { stubThis: (t) => t }; async function Lhe(t) { const { cosePublicKey: e, signature: n, data: r } = t, i = await Vc(), o = e.get(pt.alg), a = e.get(pt.crv), s = e.get(pt.x); if (!o) throw new Error("Public key was missing alg (OKP)"); if (!Ef(o)) throw new Error(`Public key had invalid alg ${o} (OKP)`); if (!a) throw new Error("Public key was missing crv (OKP)"); if (!s) throw new Error("Public key was missing x (OKP)"); let c; if (a === ji.ED25519) c = "Ed25519"; else throw new Error(`Unexpected COSE crv value of ${a} (OKP)`); const u = { kty: "OKP", crv: c, alg: "EdDSA", x: zi(s), ext: !1 }, p = await wA({ keyData: u, algorithm: { name: c, namedCurve: c } }), f = { name: c }; return i.subtle.verify(f, p, n, r); } function Qhe(t, e) { const n = Xr.parse(t, Up), r = new Uint8Array(n.r), i = new Uint8Array(n.s), o = jhe(e), a = nP(r, o), s = nP(i, o); return yi([ a, s ]); } function jhe(t) { switch (t) { case ji.P256: return 32; case ji.P384: return 48; case ji.P521: return 66; default: throw new Error(`Unexpected COSE crv value of ${t} (EC2)`); } } function nP(t, e) { let n; if (t.length < e) n = new Uint8Array(e), n.set(t, e - t.length); else if (t.length === e) n = t; else if (t.length === e + 1 && t[0] === 0 && (t[1] & 128) === 128) n = t.subarray(1); else throw new Error(`Invalid signature component length ${t.length}, expected ${e}`); return n; } function $he(t) { const { cosePublicKey: e, signature: n, data: r, shaHashOverride: i } = t; if (e1(e)) { const a = e.get(pt.crv); if (!_pe(a)) throw new Error(`unknown COSE curve ${a}`); const s = Qhe(n, a); return kB({ cosePublicKey: e, signature: s, data: r, shaHashOverride: i }); } else { if (vA(e)) return NB({ cosePublicKey: e, signature: n, data: r, shaHashOverride: i }); if (Spe(e)) return Lhe({ cosePublicKey: e, signature: n, data: r }); } const o = e.get(pt.kty); throw new Error(`Signature verification with public key of kty ${o} is not supported by this method`); } function lo(t, e) { return t.length != e.length ? !1 : t.every((n, r) => n === e[r]); } function Vg(t) { return Array.from(t, (n) => n.toString(16).padStart(2, "0")).join(""); } function Ghe(t) { if (!(t.length !== 0 && t.length % 2 === 0 && !/[^a-fA-F0-9]/u.test(t))) throw new Error("Invalid hex string"); const n = t.match(/.{1,2}/g) ?? []; return Uint8Array.from(n.map((r) => parseInt(r, 16))); } function yi(t) { let e = 0; const n = t.reduce((i, o) => i + o.length, 0), r = new Uint8Array(n); return t.forEach((i) => { r.set(i, e), e += i.length; }), r; } function qhe(t) { return new globalThis.TextDecoder("utf-8").decode(t); } function $f(t) { return new globalThis.TextEncoder().encode(t); } function zhe(t) { return Uint8Array.from(t.split("").map((e) => e.charCodeAt(0))); } function Yg(t) { return new DataView(t.buffer, t.byteOffset, t.length); } async function AU() { const t = new Uint8Array(32); return await TB(t), Hhe.stubThis(t); } const Hhe = { stubThis: (t) => t }, Whe = [ // EdDSA (In first position to encourage authenticators to use this over ES256) -8, // ECDSA w/ SHA-256 -7, // ECDSA w/ SHA-512 -36, // RSASSA-PSS w/ SHA-256 -37, // RSASSA-PSS w/ SHA-384 -38, // RSASSA-PSS w/ SHA-512 -39, // RSASSA-PKCS1-v1_5 w/ SHA-256 -257, // RSASSA-PKCS1-v1_5 w/ SHA-384 -258, // RSASSA-PKCS1-v1_5 w/ SHA-512 -259, // RSASSA-PKCS1-v1_5 w/ SHA-1 (Deprecated; here for legacy support) -65535 ], Khe = { residentKey: "preferred", userVerification: "preferred" }, Vhe = [-8, -7, -257]; async function Yhe(t) { const { rpName: e, rpID: n, userName: r, userID: i, challenge: o = await AU(), userDisplayName: a = "", timeout: s = 6e4, attestationType: c = "none", excludeCredentials: u = [], authenticatorSelection: d = Khe, extensions: p, supportedAlgorithmIDs: f = Vhe, preferredAuthenticatorType: m } = t, h = f.map((b) => ({ alg: b, type: "public-key" })); d.residentKey === void 0 ? d.requireResidentKey && (d.residentKey = "required") : d.requireResidentKey = d.residentKey === "required"; let y = o; if (typeof y == "string" && (y = $f(y)), typeof i == "string") throw new Error("String values for `userID` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids"); let x = i; x || (x = await Ppe()); const g = []; return m && (m === "securityKey" ? (g.push("security-key"), d.authenticatorAttachment = "cross-platform") : m === "localDevice" ? (g.push("client-device"), d.authenticatorAttachment = "platform") : m === "remoteDevice" && (g.push("hybrid"), d.authenticatorAttachment = "cross-platform")), { challenge: zi(y), rp: { name: e, id: n }, user: { id: zi(x), name: r, displayName: a }, pubKeyCredParams: h, timeout: s, attestation: c, excludeCredentials: u.map((b) => { if (!Cp(b.id)) throw new Error(`excludeCredential id "${b.id}" is not a valid base64url string`); return { ...b, id: bA(b.id), type: "public-key" }; }), authenticatorSelection: d, extensions: { ...p, credProps: !0 }, hints: g }; } function IU({ be: t, bs: e }) { const n = e; let r = "singleDevice"; if (t && (r = "multiDevice"), r === "singleDevice" && n) throw new Jhe("Single-device credential indicated that it was backed up, which should be impossible."); return { credentialDeviceType: r, credentialBackedUp: n }; } class Jhe extends Error { constructor(e) { super(e), this.name = "InvalidBackupFlags"; } } async function CU(t, e) { try { return await Promise.any(e.map((r) => new Promise((i, o) => { Oc(zhe(r)).then((a) => { lo(t, a) ? i(r) : o(); }); }))); } catch (n) { throw n.name === "AggregateError" ? new Xhe() : n; } } class Xhe extends Error { constructor() { super("Unexpected RP ID hash"), this.name = "UnexpectedRPIDHash"; } } const Zhe = `-----BEGIN CERTIFICATE----- MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- `, eme = `-----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um AGMCAwEAAaOBpjCBozAdBgNVHQ4EFgQUNmHhAHyIBQlRi0RsR/8aTMnqTxIwHwYD VR0jBBgwFoAUNmHhAHyIBQlRi0RsR/8aTMnqTxIwDwYDVR0TAQH/BAUwAwEB/zAO BgNVHQ8BAf8EBAMCAYYwQAYDVR0fBDkwNzA1oDOgMYYvaHR0cHM6Ly9hbmRyb2lk Lmdvb2dsZWFwaXMuY29tL2F0dGVzdGF0aW9uL2NybC8wDQYJKoZIhvcNAQELBQAD ggIBACDIw41L3KlXG0aMiS//cqrG+EShHUGo8HNsw30W1kJtjn6UBwRM6jnmiwfB Pb8VA91chb2vssAtX2zbTvqBJ9+LBPGCdw/E53Rbf86qhxKaiAHOjpvAy5Y3m00m qC0w/Zwvju1twb4vhLaJ5NkUJYsUS7rmJKHHBnETLi8GFqiEsqTWpG/6ibYCv7rY DBJDcR9W62BW9jfIoBQcxUCUJouMPH25lLNcDc1ssqvC2v7iUgI9LeoM1sNovqPm QUiG9rHli1vXxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u JU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD CdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy ZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD qwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1 wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk -----END CERTIFICATE----- `, tme = `-----BEGIN CERTIFICATE----- MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu XKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U h6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno L/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok QBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA D32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI mMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW Fua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91 oeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH ex0SdDrx+tWUDqG8At2JHA== -----END CERTIFICATE----- `, nme = ` -----BEGIN CERTIFICATE----- MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBTNNZe5cuf8oiq+jV0itTG zWVhSTjOBEk2FQvh11J3o3lna0o7rd8RFHnN00q4hi6TapFhh4qaw/iG6Xg+xOan 63niLWIC5GOPFgPeYXM9+nBb3zZzC8ABypYuCusWCmt6Tn3+Pjbz3MTVhRGXuT/T QH4KGFY4PhvzAyXwdjTOCXID+aHud4RLcSySr0Fq/L+R8TWalvM1wJJPhyRjqRCJ erGtfBagiALzvhnmY7U1qFcS0NCnKjoO7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL Zez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a 0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH 7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b HQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2 Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7 mD/vFDkzF+wm7cyWpQpCVQ== -----END CERTIFICATE----- `, rme = ` -----BEGIN CERTIFICATE----- MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQB8cMqTllHc8U+qCrOlg3H7 174lmaCsbo/bJ0C17JEgMLb4kvrqsXZs01U3mB/qABg/1t5Pd5AORHARs1hhqGIC W/nKMav574f9rZN4PC2ZlufGXb7sIdJpGiO9ctRhiLuYuly10JccUZGEHpHSYM2G tkgYbZba6lsCPYAAP83cyDV+1aOkTf1RCp/lM0PKvmxYN10RYsK631jrleGdcdkx oSK//mSQbgcWnmAEZrzHoF1/0gso1HZgIn0YLzVhLSA/iXCX4QT2h3J5z3znluKG 1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF mr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz lHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw n6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn w1IdYIg2Wxg7yHcQZemFQg== -----END CERTIFICATE----- `, ime = `-----BEGIN CERTIFICATE----- MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49 AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/ pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk 2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3 jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B 1bWeT0vT -----END CERTIFICATE----- `, ome = `-----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH WD9f -----END CERTIFICATE----- `; class ame { constructor() { Object.defineProperty(this, "pemCertificates", { enumerable: !0, configurable: !0, writable: !0, value: void 0 }), this.pemCertificates = /* @__PURE__ */ new Map(); } setRootCertificates(e) { const { identifier: n, certificates: r } = e, i = []; for (const o of r) o instanceof Uint8Array ? i.push(Co(o)) : i.push(o); this.pemCertificates.set(n, i); } getRootCertificates(e) { const { identifier: n } = e; return this.pemCertificates.get(n) ?? []; } } const Kl = new ame(); Kl.setRootCertificates({ identifier: "android-key", certificates: [ eme, tme, nme, rme ] }); Kl.setRootCertificates({ identifier: "android-safetynet", certificates: [Zhe] }); Kl.setRootCertificates({ identifier: "apple", certificates: [ime] }); Kl.setRootCertificates({ identifier: "mds", certificates: [ome] }); async function sme(t) { const { attStmt: e, clientDataHash: n, rpIdHash: r, credentialID: i, credentialPublicKey: o, aaguid: a, rootCertificates: s } = t, c = Uint8Array.from([0]), u = SA(o), d = yi([ c, r, n, i, u ]), p = e.get("sig"), f = e.get("x5c"); if (!f) throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)"); if (!p) throw new Error("No attestation signature provided in attestation statement (FIDOU2F)"); const m = Number.parseInt(Vg(a), 16); if (m !== 0) throw new Error(`AAGUID "${m}" was not expected value`); try { await Hs(f.map(Co), s); } catch (h) { const y = h; throw new Error(`${y.message} (FIDOU2F)`); } return Fc({ signature: p, data: d, x509Certificate: f[0], hashAlgorithm: yt.ES256 }); } const rP = "1.3.6.1.4.1.45724.1.1.4"; function TU(t, e) { if (!t) return !0; const n = t.find((a) => a.extnID === rP); if (!n) return !0; const r = Xr.parse(n.extnValue, je), i = new Uint8Array(r.buffer); if (!lo(e, i)) { const a = Vg(i), s = Vg(e); throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${rP}) value of "${a}" was present but not equal to attestation statement AAGUID value of "${s}"`); } return !0; } function cme(t) { return (e, ...n) => { }; } function ume(t) { const e = t.replace("-----BEGIN CERTIFICATE-----", "").replace("-----END CERTIFICATE-----", "").replace(/[\n ]/g, ""); return Yo(e, "base64"); } function lme(t) { const e = t.split("."); return [ JSON.parse(Ip(e[0])), JSON.parse(Ip(e[1])), e[2] ]; } function dme(t, e) { const [n, r, i] = t.split("."), o = EU(e), a = $f(`${n}.${r}`), s = Yo(i); if (e1(o)) return kB({ data: a, signature: s, cosePublicKey: o, shaHashOverride: yt.ES256 }); if (vA(o)) return NB({ data: a, signature: s, cosePublicKey: o }); const c = o.get(pt.kty); throw new Error(`JWT verification with public key of kty ${c} is not supported by this method`); } const pme = "https://mds.fidoalliance.org/"; var pi; (function(t) { t[t.DISABLED = 0] = "DISABLED", t[t.REFRESHING = 1] = "REFRESHING", t[t.READY = 2] = "READY"; })(pi || (pi = {})); const lu = cme(); class fme { constructor() { Object.defineProperty(this, "mdsCache", { enumerable: !0, configurable: !0, writable: !0, value: {} }), Object.defineProperty(this, "statementCache", { enumerable: !0, configurable: !0, writable: !0, value: {} }), Object.defineProperty(this, "state", { enumerable: !0, configurable: !0, writable: !0, value: pi.DISABLED }), Object.defineProperty(this, "verificationMode", { enumerable: !0, configurable: !0, writable: !0, value: "strict" }); } async initialize(e = {}) { const { mdsServers: n = [pme], statements: r, verificationMode: i } = e; if (this.setState(pi.REFRESHING), r?.length) { let o = 0; r.forEach((a) => { a.aaguid && (this.statementCache[a.aaguid] = { entry: { metadataStatement: a, statusReports: [], timeOfLastStatusChange: "1970-01-01" }, url: "" }, o += 1); }), lu(`Cached ${o} local statements`); } if (n?.length) { const o = Object.keys(this.statementCache).length; let a = n.length; for (const u of n) try { await this.downloadBlob({ url: u, no: 0, nextUpdate: /* @__PURE__ */ new Date(0) }); } catch (d) { lu(`Could not download BLOB from ${u}:`, d), a -= 1; } const c = Object.keys(this.statementCache).length - o; lu(`Cached ${c} statements from ${a} metadata server(s)`); } i && (this.verificationMode = i), this.setState(pi.READY); } async getStatement(e) { if (this.state === pi.DISABLED || !e) return; e instanceof Uint8Array && (e = PB(e)), await this.pauseUntilReady(); const n = this.statementCache[e]; if (!n) { if (this.verificationMode === "strict") throw new Error(`No metadata statement found for aaguid "${e}"`); return; } if (n.url) { const i = this.mdsCache[n.url]; if (/* @__PURE__ */ new Date() > i.nextUpdate) try { this.setState(pi.REFRESHING), await this.downloadBlob(i); } finally { this.setState(pi.READY); } } const { entry: r } = n; for (const i of r.statusReports) { const { status: o } = i; if (o === "USER_VERIFICATION_BYPASS" || o === "ATTESTATION_KEY_COMPROMISE" || o === "USER_KEY_REMOTE_COMPROMISE" || o === "USER_KEY_PHYSICAL_COMPROMISE") throw new Error(`Detected compromised aaguid "${e}"`); } return r.metadataStatement; } /** * Download and process the latest BLOB from MDS */ async downloadBlob(e) { const { url: n, no: r } = e, o = await (await wU(n)).text(), a = lme(o), s = a[0], c = a[1]; if (c.no <= r) throw new Error(`Latest BLOB no. "${c.no}" is not greater than previous ${r}`); const u = s.x5c.map(Co); try { const y = Kl.getRootCertificates({ identifier: "mds" }); await Hs(u, y); } catch (y) { const x = y; throw new Error("BLOB certificate path could not be validated", { cause: x }); } const d = u[0]; if (!await dme(o, ume(d))) throw new Error("BLOB signature could not be verified"); for (const y of c.entries) y.aaguid && (this.statementCache[y.aaguid] = { entry: y, url: n }); const [f, m, h] = c.nextUpdate.split("-"); this.mdsCache[n] = { ...e, // Store the payload `no` to make sure we're getting the next BLOB in the sequence no: c.no, // Convert the nextUpdate property into a Date so we can determine when to re-download nextUpdate: new Date( parseInt(f, 10), // Months need to be zero-indexed parseInt(m, 10) - 1, parseInt(h, 10) ) }; } /** * A helper method to pause execution until the service is ready */ pauseUntilReady() { return this.state === pi.READY ? new Promise((n) => { n(); }) : new Promise((n, r) => { let a = 700; const s = globalThis.setInterval(() => { a < 1 ? (clearInterval(s), r(`State did not become ready in ${7e4 / 1e3} seconds`)) : this.state === pi.READY && (clearInterval(s), n()), a -= 1; }, 100); }); } /** * Report service status on change */ setState(e) { this.state = e, e === pi.DISABLED ? lu("MetadataService is DISABLED") : e === pi.REFRESHING ? lu("MetadataService is REFRESHING") : e === pi.READY && lu("MetadataService is READY"); } } const W1 = new fme(); async function K1({ statement: t, credentialPublicKey: e, x5c: n, attestationStatementAlg: r }) { const { authenticationAlgorithms: i, authenticatorGetInfo: o, attestationRootCertificates: a } = t, s = /* @__PURE__ */ new Set(); i.forEach((x) => { const g = iP[x]; g && s.add(g); }); const c = t1(e), u = c.get(pt.kty), d = c.get(pt.alg); if (!u) throw new Error("Credential public key was missing kty"); if (!d) throw new Error("Credential public key was missing alg"); if (!u) throw new Error("Credential public key was missing kty"); const p = { kty: u, alg: d }; if (e1(c)) { const x = c.get(pt.crv); p.crv = x; } let f = !1; for (const x of s) if (x.alg === p.alg && x.kty === p.kty && ((x.kty === Io.EC2 || x.kty === Io.OKP) && (x.crv, p.crv), f = !0), f) break; if (!f) { const x = i.map((S) => `'${S}' (COSE info: ${oP(iP[S])})`), g = JSON.stringify(x, null, 2).replace(/"/g, ""), b = oP(p); throw new Error(`Public key parameters ${b} did not match any of the following metadata algorithms: ${g}`); } if (r !== void 0 && o?.algorithms !== void 0) { const x = o.algorithms.map((g) => g.alg); if (x.indexOf(r) < 0) throw new Error(`Attestation statement alg ${r} did not match one of ${x}`); } const m = n.map(Co), h = a.map(Co); let y = !1; if (m.length === 1 && h.indexOf(m[0]) >= 0 && (y = !0), !y) try { await Hs(m, h); } catch (x) { const g = x; throw new Error(`Could not validate certificate path with any metadata root certificates: ${g.message}`); } return !0; } const iP = { secp256r1_ecdsa_sha256_raw: { kty: 2, alg: -7, crv: 1 }, secp256r1_ecdsa_sha256_der: { kty: 2, alg: -7, crv: 1 }, rsassa_pss_sha256_raw: { kty: 3, alg: -37 }, rsassa_pss_sha256_der: { kty: 3, alg: -37 }, secp256k1_ecdsa_sha256_raw: { kty: 2, alg: -47, crv: 8 }, secp256k1_ecdsa_sha256_der: { kty: 2, alg: -47, crv: 8 }, rsassa_pss_sha384_raw: { kty: 3, alg: -38 }, rsassa_pkcsv15_sha256_raw: { kty: 3, alg: -257 }, rsassa_pkcsv15_sha384_raw: { kty: 3, alg: -258 }, rsassa_pkcsv15_sha512_raw: { kty: 3, alg: -259 }, rsassa_pkcsv15_sha1_raw: { kty: 3, alg: -65535 }, secp384r1_ecdsa_sha384_raw: { kty: 2, alg: -35, crv: 2 }, secp512r1_ecdsa_sha256_raw: { kty: 2, alg: -36, crv: 3 }, ed25519_eddsa_sha512_raw: { kty: 1, alg: -8, crv: 6 } }; function oP(t) { const { kty: e, alg: n, crv: r } = t; let i = ""; return e !== Io.RSA ? i = `{ kty: ${e}, alg: ${n}, crv: ${r} }` : i = `{ kty: ${e}, alg: ${n} }`, i; } async function hme(t) { const { attStmt: e, clientDataHash: n, authData: r, credentialPublicKey: i, aaguid: o, rootCertificates: a } = t, s = e.get("sig"), c = e.get("x5c"), u = e.get("alg"); if (!s) throw new Error("No attestation signature provided in attestation statement (Packed)"); if (!u) throw new Error("Attestation statement did not contain alg (Packed)"); if (!Ef(u)) throw new Error(`Attestation statement contained invalid alg ${u} (Packed)`); const d = yi([r, n]); let p = !1; if (c) { const { subject: f, basicConstraintsCA: m, version: h, notBefore: y, notAfter: x, parsedCertificate: g } = HA(c[0]), { OU: b, CN: S, O: E, C: T } = f; if (b !== "Authenticator Attestation") throw new Error('Certificate OU was not "Authenticator Attestation" (Packed|Full)'); if (!S) throw new Error("Certificate CN was empty (Packed|Full)"); if (!E) throw new Error("Certificate O was empty (Packed|Full)"); if (!T || T.length !== 2) throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)"); if (m) throw new Error("Certificate basic constraints CA was not `false` (Packed|Full)"); if (h !== 2) throw new Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)"); let U = /* @__PURE__ */ new Date(); if (y > U) throw new Error(`Certificate not good before "${y.toString()}" (Packed|Full)`); if (U = /* @__PURE__ */ new Date(), x < U) throw new Error(`Certificate not good after "${x.toString()}" (Packed|Full)`); try { await TU(g.tbsCertificate.extensions, o); } catch (Y) { const H = Y; throw new Error(`${H.message} (Packed|Full)`); } const q = await W1.getStatement(o); if (q) { if (q.attestationTypes.indexOf("basic_full") < 0) throw new Error("Metadata does not indicate support for full attestations (Packed|Full)"); try { await K1({ statement: q, credentialPublicKey: i, x5c: c, attestationStatementAlg: u }); } catch (Y) { const H = Y; throw new Error(`${H.message} (Packed|Full)`); } } else try { await Hs(c.map(Co), a); } catch (Y) { const H = Y; throw new Error(`${H.message} (Packed|Full)`); } p = await Fc({ signature: s, data: d, x509Certificate: c[0] }); } else p = await Fc({ signature: s, data: d, credentialPublicKey: i, hashAlgorithm: u }); return p; } async function mme(t) { const { attStmt: e, clientDataHash: n, authData: r, aaguid: i, rootCertificates: o, verifyTimestampMS: a = !0, credentialPublicKey: s, attestationSafetyNetEnforceCTSCheck: c } = t, u = e.get("alg"), d = e.get("response"); if (!e.get("ver")) throw new Error("No ver value in attestation (SafetyNet)"); if (!d) throw new Error("No response was included in attStmt by authenticator (SafetyNet)"); const m = qhe(d).split("."), h = JSON.parse(Ip(m[0])), y = JSON.parse(Ip(m[1])), x = m[2], { nonce: g, ctsProfileMatch: b, timestampMs: S } = y; if (a) { let X = Date.now(); if (S > Date.now()) throw new Error(`Payload timestamp "${S}" was later than "${X}" (SafetyNet)`); const V = S + 60 * 1e3; if (X = Date.now(), V < X) throw new Error(`Payload timestamp "${V}" has expired (SafetyNet)`); } const E = yi([r, n]), T = await Oc(E), U = zi(T, "base64"); if (g !== U) throw new Error("Could not verify payload nonce (SafetyNet)"); if (c && !b) throw new Error("Could not verify device integrity (SafetyNet)"); const q = Yo(h.x5c[0], "base64"), Y = HA(q), { subject: H } = Y; if (H.CN !== "attest.android.com") throw new Error('Certificate common name was not "attest.android.com" (SafetyNet)'); const G = await W1.getStatement(i); if (G) try { await K1({ statement: G, credentialPublicKey: s, x5c: h.x5c, attestationStatementAlg: u }); } catch (X) { const V = X; throw new Error(`${V.message} (SafetyNet)`); } else try { await Hs(h.x5c.map(Co), o); } catch (X) { const V = X; throw new Error(`${V.message} (SafetyNet)`); } const J = $f(`${m[0]}.${m[1]}`), B = Yo(x); return await Fc({ signature: B, data: J, x509Certificate: q }); } const gme = { 196: "TPM_ST_RSP_COMMAND", 32768: "TPM_ST_NULL", 32769: "TPM_ST_NO_SESSIONS", 32770: "TPM_ST_SESSIONS", 32788: "TPM_ST_ATTEST_NV", 32789: "TPM_ST_ATTEST_COMMAND_AUDIT", 32790: "TPM_ST_ATTEST_SESSION_AUDIT", 32791: "TPM_ST_ATTEST_CERTIFY", 32792: "TPM_ST_ATTEST_QUOTE", 32793: "TPM_ST_ATTEST_TIME", 32794: "TPM_ST_ATTEST_CREATION", 32801: "TPM_ST_CREATION", 32802: "TPM_ST_VERIFIED", 32803: "TPM_ST_AUTH_SECRET", 32804: "TPM_ST_HASHCHECK", 32805: "TPM_ST_AUTH_SIGNED", 32809: "TPM_ST_FU_MANIFEST" }, as = { 0: "TPM_ALG_ERROR", 1: "TPM_ALG_RSA", 4: "TPM_ALG_SHA", // @ts-ignore 2300 4: "TPM_ALG_SHA1", 5: "TPM_ALG_HMAC", 6: "TPM_ALG_AES", 7: "TPM_ALG_MGF1", 8: "TPM_ALG_KEYEDHASH", 10: "TPM_ALG_XOR", 11: "TPM_ALG_SHA256", 12: "TPM_ALG_SHA384", 13: "TPM_ALG_SHA512", 16: "TPM_ALG_NULL", 18: "TPM_ALG_SM3_256", 19: "TPM_ALG_SM4", 20: "TPM_ALG_RSASSA", 21: "TPM_ALG_RSAES", 22: "TPM_ALG_RSAPSS", 23: "TPM_ALG_OAEP", 24: "TPM_ALG_ECDSA", 25: "TPM_ALG_ECDH", 26: "TPM_ALG_ECDAA", 27: "TPM_ALG_SM2", 28: "TPM_ALG_ECSCHNORR", 29: "TPM_ALG_ECMQV", 32: "TPM_ALG_KDF1_SP800_56A", 33: "TPM_ALG_KDF2", 34: "TPM_ALG_KDF1_SP800_108", 35: "TPM_ALG_ECC", 37: "TPM_ALG_SYMCIPHER", 38: "TPM_ALG_CAMELLIA", 64: "TPM_ALG_CTR", 65: "TPM_ALG_OFB", 66: "TPM_ALG_CBC", 67: "TPM_ALG_CFB", 68: "TPM_ALG_ECB" }, yme = { 0: "TPM_ECC_NONE", 1: "TPM_ECC_NIST_P192", 2: "TPM_ECC_NIST_P224", 3: "TPM_ECC_NIST_P256", 4: "TPM_ECC_NIST_P384", 5: "TPM_ECC_NIST_P521", 16: "TPM_ECC_BN_P256", 17: "TPM_ECC_BN_P638", 32: "TPM_ECC_SM2_P256" }, bme = { "id:414D4400": { name: "AMD", id: "AMD" }, "id:414E5400": { name: "Ant Group", id: "ANT" }, "id:41544D4C": { name: "Atmel", id: "ATML" }, "id:4252434D": { name: "Broadcom", id: "BRCM" }, "id:4353434F": { name: "Cisco", id: "CSCO" }, "id:464C5953": { name: "Flyslice Technologies", id: "FLYS" }, "id:524F4343": { name: "Fuzhou Rockchip", id: "ROCC" }, "id:474F4F47": { name: "Google", id: "GOOG" }, "id:48504900": { name: "HPI", id: "HPI" }, "id:48504500": { name: "HPE", id: "HPE" }, "id:48495349": { name: "Huawei", id: "HISI" }, "id:49424d00": { name: "IBM", id: "IBM" }, "id:49424D00": { name: "IBM", id: "IBM" }, // Same ID for IBM as above, except the "D" is capitalized as per TPM spec "id:49465800": { name: "Infineon", id: "IFX" }, "id:494E5443": { name: "Intel", id: "INTC" }, "id:4C454E00": { name: "Lenovo", id: "LEN" }, "id:4D534654": { name: "Microsoft", id: "MSFT" }, "id:4E534D20": { name: "National Semiconductor", id: "NSM" }, "id:4E545A00": { name: "Nationz", id: "NTZ" }, "id:4E534700": { name: "NSING", id: "NSG" }, "id:4E544300": { name: "Nuvoton Technology", id: "NTC" }, "id:51434F4D": { name: "Qualcomm", id: "QCOM" }, "id:534D534E": { name: "Samsung", id: "SMSN" }, "id:53454345": { name: "SecEdge", id: "SECE" }, "id:534E5300": { name: "Sinosun", id: "SNS" }, "id:534D5343": { name: "SMSC", id: "SMSC" }, "id:53544D20": { name: "STMicroelectronics", id: "STM" }, "id:54584E00": { name: "Texas Instruments", id: "TXN" }, "id:57454300": { name: "Winbond", id: "WEC" }, "id:5345414C": { name: "Wisekey", id: "SEAL" }, "id:FFFFF1D0": { name: "FIDO Alliance", id: "FIDO" } // FIDO Conformance }, vme = { TPM_ECC_NIST_P256: 1, // p256 TPM_ECC_NIST_P384: 2, // p384 TPM_ECC_NIST_P521: 3, // p521 TPM_ECC_BN_P256: 1, // p256 TPM_ECC_SM2_P256: 1 // p256 }; function xme(t) { let e = 0; const n = Yg(t), r = n.getUint32(e); e += 4; const i = n.getUint16(e); e += 2; const o = gme[i], a = n.getUint16(e); e += 2; const s = t.slice(e, e += a), c = n.getUint16(e); e += 2; const u = t.slice(e, e += c), d = t.slice(e, e += 8), p = n.getUint32(e); e += 4; const f = n.getUint32(e); e += 4; const m = !!t.slice(e, e += 1), h = { clock: d, resetCount: p, restartCount: f, safe: m }, y = t.slice(e, e += 8), x = n.getUint16(e); e += 2; const g = t.slice(e, e += x), b = Yg(g), S = n.getUint16(e); e += 2; const E = t.slice(e, e += S), T = { nameAlg: as[b.getUint16(0)], nameAlgBuffer: g.slice(0, 2), name: g, qualifiedName: E }; return { magic: r, type: o, qualifiedSigner: s, extraData: u, clockInfo: h, firmwareVersion: y, attested: T }; } function wme(t) { let e = 0; const n = Yg(t), r = as[n.getUint16(e)]; e += 2; const i = as[n.getUint16(e)]; e += 2; const o = n.getUint32(e); e += 4; const a = { fixedTPM: !!(o & 1), stClear: !!(o & 2), fixedParent: !!(o & 8), sensitiveDataOrigin: !!(o & 16), userWithAuth: !!(o & 32), adminWithPolicy: !!(o & 64), noDA: !!(o & 512), encryptedDuplication: !!(o & 1024), restricted: !!(o & 32768), decrypt: !!(o & 65536), signOrEncrypt: !!(o & 131072) }, s = n.getUint16(e); e += 2; const c = t.slice(e, e += s), u = {}; let d = Uint8Array.from([]); if (r === "TPM_ALG_RSA") { const p = as[n.getUint16(e)]; e += 2; const f = as[n.getUint16(e)]; e += 2; const m = n.getUint16(e); e += 2; const h = n.getUint32(e); e += 4, u.rsa = { symmetric: p, scheme: f, keyBits: m, exponent: h }; const y = n.getUint16(e); e += 2, d = t.slice(e, e += y); } else if (r === "TPM_ALG_ECC") { const p = as[n.getUint16(e)]; e += 2; const f = as[n.getUint16(e)]; e += 2; const m = yme[n.getUint16(e)]; e += 2; const h = as[n.getUint16(e)]; e += 2, u.ecc = { symmetric: p, scheme: f, curveID: m, kdf: h }; const y = n.getUint16(e); e += 2; const x = t.slice(e, e += y), g = n.getUint16(e); e += 2; const b = t.slice(e, e += g); d = yi([x, b]); } else throw new Error(`Unexpected type "${r}" (TPM)`); return { type: r, nameAlg: i, objectAttributes: a, authPolicy: c, parameters: u, unique: d }; } async function Sme(t) { const { aaguid: e, attStmt: n, authData: r, credentialPublicKey: i, clientDataHash: o, rootCertificates: a } = t, s = n.get("ver"), c = n.get("sig"), u = n.get("alg"), d = n.get("x5c"), p = n.get("pubArea"), f = n.get("certInfo"); if (s !== "2.0") throw new Error(`Unexpected ver "${s}", expected "2.0" (TPM)`); if (!c) throw new Error("No attestation signature provided in attestation statement (TPM)"); if (!u) throw new Error("Attestation statement did not contain alg (TPM)"); if (!Ef(u)) throw new Error(`Attestation statement contained invalid alg ${u} (TPM)`); if (!d) throw new Error("No attestation certificate provided in attestation statement (TPM)"); if (!p) throw new Error("Attestation statement did not contain pubArea (TPM)"); if (!f) throw new Error("Attestation statement did not contain certInfo (TPM)"); const m = wme(p), { unique: h, type: y, parameters: x } = m, g = t1(i); if (y === "TPM_ALG_RSA") { if (!vA(g)) throw new Error(`Credential public key with kty ${g.get(pt.kty)} did not match ${y}`); const M = g.get(pt.n), O = g.get(pt.e); if (!M) throw new Error("COSE public key missing n (TPM|RSA)"); if (!O) throw new Error("COSE public key missing e (TPM|RSA)"); if (!lo(h, M)) throw new Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)"); if (!x.rsa) throw new Error("Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)"); const A = O, F = x.rsa.exponent || 65537, Z = A[0] + (A[1] << 8) + (A[2] << 16); if (F !== Z) throw new Error(`Unexpected public key exp ${Z}, expected ${F} (TPM|RSA)`); } else if (y === "TPM_ALG_ECC") { if (!e1(g)) throw new Error(`Credential public key with kty ${g.get(pt.kty)} did not match ${y}`); const M = g.get(pt.crv), O = g.get(pt.x), A = g.get(pt.y); if (!M) throw new Error("COSE public key missing crv (TPM|ECC)"); if (!O) throw new Error("COSE public key missing x (TPM|ECC)"); if (!A) throw new Error("COSE public key missing y (TPM|ECC)"); if (!lo(h, yi([O, A]))) throw new Error("PubArea unique is not same as public key x and y (TPM|ECC)"); if (!x.ecc) throw new Error("Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)"); const F = x.ecc.curveID, Z = vme[F]; if (Z !== M) throw new Error(`Public area key curve ID "${F}" mapped to "${Z}" which did not match public key crv of "${M}" (TPM|ECC)`); } else throw new Error(`Unsupported pubArea.type "${y}"`); const b = xme(f), { magic: S, type: E, attested: T, extraData: U } = b; if (S !== 4283712327) throw new Error(`Unexpected magic value "${S}", expected "0xff544347" (TPM)`); if (E !== "TPM_ST_ATTEST_CERTIFY") throw new Error(`Unexpected type "${E}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`); const q = await Oc(p, Eme(T.nameAlg)), Y = yi([ T.nameAlgBuffer, q ]); if (!lo(T.name, Y)) throw new Error("Attested name comparison failed (TPM)"); const H = yi([r, o]), G = await Oc(H, u); if (!lo(U, G)) throw new Error("CertInfo extra data did not equal hashed attestation (TPM)"); if (d.length < 1) throw new Error("No certificates present in x5c array (TPM)"); const J = HA(d[0]), { basicConstraintsCA: B, version: D, subject: X, notAfter: V, notBefore: K } = J; if (B) throw new Error("Certificate basic constraints CA was not `false` (TPM)"); if (D !== 2) throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)"); if (X.combined.length > 0) throw new Error("Certificate subject was not empty (TPM)"); let $ = /* @__PURE__ */ new Date(); if (K > $) throw new Error(`Certificate not good before "${K.toString()}" (TPM)`); if ($ = /* @__PURE__ */ new Date(), V < $) throw new Error(`Certificate not good after "${V.toString()}" (TPM)`); const _ = Xr.parse(d[0], ko); if (!_.tbsCertificate.extensions) throw new Error("Certificate was missing extensions (TPM)"); let I, N; if (_.tbsCertificate.extensions.forEach((M) => { M.extnID === zA ? I = Xr.parse(M.extnValue, Ag) : M.extnID === GA && (N = Xr.parse(M.extnValue, Op)); }), !I) throw new Error("Certificate did not contain subjectAltName extension (TPM)"); if (!I[0].directoryName?.[0].length) throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)"); const { tcgAtTpmManufacturer: L, tcgAtTpmModel: C, tcgAtTpmVersion: Q } = _me(I[0].directoryName); if (!L || !C || !Q) throw new Error("Certificate contained incomplete subjectAltName data (TPM)"); if (!N) throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)"); if (!bme[L]) throw new Error(`Could not match TPM manufacturer "${L}" (TPM)`); if (N[0] !== "2.23.133.8.3") throw new Error(`Unexpected extKeyUsage "${N[0]}", expected "2.23.133.8.3" (TPM)`); try { await TU(_.tbsCertificate.extensions, e); } catch (M) { const O = M; throw new Error(`${O.message} (TPM)`); } const k = await W1.getStatement(e); if (k) try { await K1({ statement: k, credentialPublicKey: i, x5c: d, attestationStatementAlg: u }); } catch (M) { const O = M; throw new Error(`${O.message} (TPM)`); } else try { await Hs(d.map(Co), a); } catch (M) { const O = M; throw new Error(`${O.message} (TPM)`); } return Fc({ signature: c, data: f, x509Certificate: d[0], hashAlgorithm: u }); } function _me(t) { const e = "2.23.133.2.1", n = "2.23.133.2.2", r = "2.23.133.2.3"; let i, o, a; return t.forEach((s) => { s.forEach((c) => { c.type === e ? i = c.value.toString() : c.type === n ? o = c.value.toString() : c.type === r && (a = c.value.toString()); }); }), { tcgAtTpmManufacturer: i, tcgAtTpmModel: o, tcgAtTpmVersion: a }; } function Eme(t) { if (t === "TPM_ALG_SHA256") return yt.ES256; if (t === "TPM_ALG_SHA384") return yt.ES384; if (t === "TPM_ALG_SHA512") return yt.ES512; throw new Error(`Unexpected TPM attested name alg ${t}`); } var h2; const Ame = "1.3.6.1.4.1.11129.2.1.17"; var m2; (function(t) { t[t.verified = 0] = "verified", t[t.selfSigned = 1] = "selfSigned", t[t.unverified = 2] = "unverified", t[t.failed = 3] = "failed"; })(m2 || (m2 = {})); class Gf { constructor(e = {}) { this.verifiedBootKey = new je(), this.deviceLocked = !1, this.verifiedBootState = m2.verified, Object.assign(this, e); } } R([ z({ type: je }) ], Gf.prototype, "verifiedBootKey", void 0); R([ z({ type: te.Boolean }) ], Gf.prototype, "deviceLocked", void 0); R([ z({ type: te.Enumerated }) ], Gf.prototype, "verifiedBootState", void 0); R([ z({ type: je, optional: !0 }) ], Gf.prototype, "verifiedBootHash", void 0); let cl = h2 = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, h2.prototype); } }; cl = h2 = R([ _e({ type: ye.Set, itemType: te.Integer }) ], cl); class Je { constructor(e = {}) { Object.assign(this, e); } } R([ z({ context: 1, type: cl, optional: !0 }) ], Je.prototype, "purpose", void 0); R([ z({ context: 2, type: te.Integer, optional: !0 }) ], Je.prototype, "algorithm", void 0); R([ z({ context: 3, type: te.Integer, optional: !0 }) ], Je.prototype, "keySize", void 0); R([ z({ context: 5, type: cl, optional: !0 }) ], Je.prototype, "digest", void 0); R([ z({ context: 6, type: cl, optional: !0 }) ], Je.prototype, "padding", void 0); R([ z({ context: 10, type: te.Integer, optional: !0 }) ], Je.prototype, "ecCurve", void 0); R([ z({ context: 200, type: te.Integer, optional: !0 }) ], Je.prototype, "rsaPublicExponent", void 0); R([ z({ context: 203, type: cl, optional: !0 }) ], Je.prototype, "mgfDigest", void 0); R([ z({ context: 303, type: te.Null, optional: !0 }) ], Je.prototype, "rollbackResistance", void 0); R([ z({ context: 305, type: te.Null, optional: !0 }) ], Je.prototype, "earlyBootOnly", void 0); R([ z({ context: 400, type: te.Integer, optional: !0 }) ], Je.prototype, "activeDateTime", void 0); R([ z({ context: 401, type: te.Integer, optional: !0 }) ], Je.prototype, "originationExpireDateTime", void 0); R([ z({ context: 402, type: te.Integer, optional: !0 }) ], Je.prototype, "usageExpireDateTime", void 0); R([ z({ context: 405, type: te.Integer, optional: !0 }) ], Je.prototype, "usageCountLimit", void 0); R([ z({ context: 503, type: te.Null, optional: !0 }) ], Je.prototype, "noAuthRequired", void 0); R([ z({ context: 504, type: te.Integer, optional: !0 }) ], Je.prototype, "userAuthType", void 0); R([ z({ context: 505, type: te.Integer, optional: !0 }) ], Je.prototype, "authTimeout", void 0); R([ z({ context: 506, type: te.Null, optional: !0 }) ], Je.prototype, "allowWhileOnBody", void 0); R([ z({ context: 507, type: te.Null, optional: !0 }) ], Je.prototype, "trustedUserPresenceRequired", void 0); R([ z({ context: 508, type: te.Null, optional: !0 }) ], Je.prototype, "trustedConfirmationRequired", void 0); R([ z({ context: 509, type: te.Null, optional: !0 }) ], Je.prototype, "unlockedDeviceRequired", void 0); R([ z({ context: 600, type: te.Null, optional: !0 }) ], Je.prototype, "allApplications", void 0); R([ z({ context: 601, type: je, optional: !0 }) ], Je.prototype, "applicationId", void 0); R([ z({ context: 701, type: te.Integer, optional: !0 }) ], Je.prototype, "creationDateTime", void 0); R([ z({ context: 702, type: te.Integer, optional: !0 }) ], Je.prototype, "origin", void 0); R([ z({ context: 703, type: te.Null, optional: !0 }) ], Je.prototype, "rollbackResistant", void 0); R([ z({ context: 704, type: Gf, optional: !0 }) ], Je.prototype, "rootOfTrust", void 0); R([ z({ context: 705, type: te.Integer, optional: !0 }) ], Je.prototype, "osVersion", void 0); R([ z({ context: 706, type: te.Integer, optional: !0 }) ], Je.prototype, "osPatchLevel", void 0); R([ z({ context: 709, type: je, optional: !0 }) ], Je.prototype, "attestationApplicationId", void 0); R([ z({ context: 710, type: je, optional: !0 }) ], Je.prototype, "attestationIdBrand", void 0); R([ z({ context: 711, type: je, optional: !0 }) ], Je.prototype, "attestationIdDevice", void 0); R([ z({ context: 712, type: je, optional: !0 }) ], Je.prototype, "attestationIdProduct", void 0); R([ z({ context: 713, type: je, optional: !0 }) ], Je.prototype, "attestationIdSerial", void 0); R([ z({ context: 714, type: je, optional: !0 }) ], Je.prototype, "attestationIdImei", void 0); R([ z({ context: 715, type: je, optional: !0 }) ], Je.prototype, "attestationIdMeid", void 0); R([ z({ context: 716, type: je, optional: !0 }) ], Je.prototype, "attestationIdManufacturer", void 0); R([ z({ context: 717, type: je, optional: !0 }) ], Je.prototype, "attestationIdModel", void 0); R([ z({ context: 718, type: te.Integer, optional: !0 }) ], Je.prototype, "vendorPatchLevel", void 0); R([ z({ context: 719, type: te.Integer, optional: !0 }) ], Je.prototype, "bootPatchLevel", void 0); R([ z({ context: 720, type: te.Null, optional: !0 }) ], Je.prototype, "deviceUniqueAttestation", void 0); R([ z({ context: 723, type: je, optional: !0 }) ], Je.prototype, "attestationIdSecondImei", void 0); R([ z({ context: 724, type: je, optional: !0 }) ], Je.prototype, "moduleHash", void 0); var Cs; (function(t) { t[t.software = 0] = "software", t[t.trustedEnvironment = 1] = "trustedEnvironment", t[t.strongBox = 2] = "strongBox"; })(Cs || (Cs = {})); var $p; (function(t) { t[t.KM2 = 1] = "KM2", t[t.KM3 = 2] = "KM3", t[t.KM4 = 3] = "KM4", t[t.KM4_1 = 4] = "KM4_1", t[t.keyMint1 = 100] = "keyMint1", t[t.keyMint2 = 200] = "keyMint2", t[t.keyMint3 = 300] = "keyMint3", t[t.keyMint4 = 400] = "keyMint4"; })($p || ($p = {})); class sa { constructor(e = {}) { this.attestationVersion = $p.KM4, this.attestationSecurityLevel = Cs.software, this.keymasterVersion = 0, this.keymasterSecurityLevel = Cs.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new Je(), this.teeEnforced = new Je(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], sa.prototype, "attestationVersion", void 0); R([ z({ type: te.Enumerated }) ], sa.prototype, "attestationSecurityLevel", void 0); R([ z({ type: te.Integer }) ], sa.prototype, "keymasterVersion", void 0); R([ z({ type: te.Enumerated }) ], sa.prototype, "keymasterSecurityLevel", void 0); R([ z({ type: je }) ], sa.prototype, "attestationChallenge", void 0); R([ z({ type: je }) ], sa.prototype, "uniqueId", void 0); R([ z({ type: Je }) ], sa.prototype, "softwareEnforced", void 0); R([ z({ type: Je }) ], sa.prototype, "teeEnforced", void 0); class ca { constructor(e = {}) { this.attestationVersion = $p.keyMint4, this.attestationSecurityLevel = Cs.software, this.keyMintVersion = 0, this.keyMintSecurityLevel = Cs.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new Je(), this.hardwareEnforced = new Je(), Object.assign(this, e); } toLegacyKeyDescription() { return new sa({ attestationVersion: this.attestationVersion, attestationSecurityLevel: this.attestationSecurityLevel, keymasterVersion: this.keyMintVersion, keymasterSecurityLevel: this.keyMintSecurityLevel, attestationChallenge: this.attestationChallenge, uniqueId: this.uniqueId, softwareEnforced: this.softwareEnforced, teeEnforced: this.hardwareEnforced }); } static fromLegacyKeyDescription(e) { return new ca({ attestationVersion: e.attestationVersion, attestationSecurityLevel: e.attestationSecurityLevel, keyMintVersion: e.keymasterVersion, keyMintSecurityLevel: e.keymasterSecurityLevel, attestationChallenge: e.attestationChallenge, uniqueId: e.uniqueId, softwareEnforced: e.softwareEnforced, hardwareEnforced: e.teeEnforced }); } } R([ z({ type: te.Integer }) ], ca.prototype, "attestationVersion", void 0); R([ z({ type: te.Enumerated }) ], ca.prototype, "attestationSecurityLevel", void 0); R([ z({ type: te.Integer }) ], ca.prototype, "keyMintVersion", void 0); R([ z({ type: te.Enumerated }) ], ca.prototype, "keyMintSecurityLevel", void 0); R([ z({ type: je }) ], ca.prototype, "attestationChallenge", void 0); R([ z({ type: je }) ], ca.prototype, "uniqueId", void 0); R([ z({ type: Je }) ], ca.prototype, "softwareEnforced", void 0); R([ z({ type: Je }) ], ca.prototype, "hardwareEnforced", void 0); var g2; let y2 = class extends Je { }; y2 = R([ _e({ type: ye.Choice }) ], y2); let ul = g2 = class extends Pt { constructor(e) { super(e), Object.setPrototypeOf(this, g2.prototype); } findProperty(e) { const n = this.find((r) => e in r); if (n) return n[e]; } }; ul = g2 = R([ _e({ type: ye.Sequence, itemType: y2 }) ], ul); class Va { get keyMintVersion() { return this.keymasterVersion; } set keyMintVersion(e) { this.keymasterVersion = e; } get keyMintSecurityLevel() { return this.keymasterSecurityLevel; } set keyMintSecurityLevel(e) { this.keymasterSecurityLevel = e; } get hardwareEnforced() { return this.teeEnforced; } set hardwareEnforced(e) { this.teeEnforced = e; } constructor(e = {}) { this.attestationVersion = $p.KM4, this.attestationSecurityLevel = Cs.software, this.keymasterVersion = 0, this.keymasterSecurityLevel = Cs.software, this.attestationChallenge = new je(), this.uniqueId = new je(), this.softwareEnforced = new ul(), this.teeEnforced = new ul(), Object.assign(this, e); } } R([ z({ type: te.Integer }) ], Va.prototype, "attestationVersion", void 0); R([ z({ type: te.Enumerated }) ], Va.prototype, "attestationSecurityLevel", void 0); R([ z({ type: te.Integer }) ], Va.prototype, "keymasterVersion", void 0); R([ z({ type: te.Enumerated }) ], Va.prototype, "keymasterSecurityLevel", void 0); R([ z({ type: je }) ], Va.prototype, "attestationChallenge", void 0); R([ z({ type: je }) ], Va.prototype, "uniqueId", void 0); R([ z({ type: ul }) ], Va.prototype, "softwareEnforced", void 0); R([ z({ type: ul }) ], Va.prototype, "teeEnforced", void 0); let aP = class extends Va { constructor(e = {}) { "keymasterVersion" in e && !("keyMintVersion" in e) && (e.keyMintVersion = e.keymasterVersion), "keymasterSecurityLevel" in e && !("keyMintSecurityLevel" in e) && (e.keyMintSecurityLevel = e.keymasterSecurityLevel), "teeEnforced" in e && !("hardwareEnforced" in e) && (e.hardwareEnforced = e.teeEnforced), super(e); } }; aP = R([ _e({ type: ye.Sequence }) ], aP); class d3 { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: te.OctetString }) ], d3.prototype, "packageName", void 0); R([ z({ type: te.Integer }) ], d3.prototype, "version", void 0); class kU { constructor(e = {}) { Object.assign(this, e); } } R([ z({ type: d3, repeated: "set" }) ], kU.prototype, "packageInfos", void 0); R([ z({ type: te.OctetString, repeated: "set" }) ], kU.prototype, "signatureDigests", void 0); async function Ime(t) { const { authData: e, clientDataHash: n, attStmt: r, credentialPublicKey: i, aaguid: o, rootCertificates: a } = t, s = r.get("x5c"), c = r.get("sig"), u = r.get("alg"); if (!s) throw new Error("No attestation certificate provided in attestation statement (Android Key)"); if (!c) throw new Error("No attestation signature provided in attestation statement (Android Key)"); if (!u) throw new Error("Attestation statement did not contain alg (Android Key)"); if (!Ef(u)) throw new Error(`Attestation statement contained invalid alg ${u} (Android Key)`); const d = Xr.parse(s[0], ko), p = new Uint8Array(d.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey), f = SA(i); if (!lo(f, p)) throw new Error("Credential public key does not equal leaf cert public key (Android Key)"); const m = d.tbsCertificate.extensions?.find((E) => E.extnID === Ame); if (!m) throw new Error("Certificate did not contain extKeyStore (Android Key)"); const h = Xr.parse(m.extnValue, sa), { attestationChallenge: y, teeEnforced: x, softwareEnforced: g } = h; if (!lo(new Uint8Array(y.buffer), n)) throw new Error("Attestation challenge was not equal to client data hash (Android Key)"); if (x.allApplications !== void 0) throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)'); if (g.allApplications !== void 0) throw new Error('teeEnforced contained "allApplications [600]" tag (Android Key)'); const b = await W1.getStatement(o); if (b) try { await K1({ statement: b, credentialPublicKey: i, x5c: s, attestationStatementAlg: u }); } catch (E) { const T = E; throw new Error(`${T.message} (Android Key)`, { cause: T }); } else { const E = s.slice(0, -1).map(Co), T = s.slice(-1).map(Co); try { await Hs(E, T); } catch (U) { const q = U; throw new Error(`${q.message} (Android Key)`, { cause: q }); } if (a.length > 0 && a.indexOf(T[0]) < 0) throw new Error("x5c root certificate was not a known root certificate (Android Key)"); } const S = yi([e, n]); return Fc({ signature: c, data: S, x509Certificate: s[0], hashAlgorithm: u }); } async function Cme(t) { const { attStmt: e, authData: n, clientDataHash: r, credentialPublicKey: i, rootCertificates: o } = t, a = e.get("x5c"); if (!a) throw new Error("No attestation certificate provided in attestation statement (Apple)"); try { await Hs(a.map(Co), o); } catch (x) { const g = x; throw new Error(`${g.message} (Apple)`); } const s = Xr.parse(a[0], ko), { extensions: c, subjectPublicKeyInfo: u } = s.tbsCertificate; if (!c) throw new Error("credCert missing extensions (Apple)"); const d = c.find((x) => x.extnID === "1.2.840.113635.100.8.2"); if (!d) throw new Error('credCert missing "1.2.840.113635.100.8.2" extension (Apple)'); const p = yi([n, r]), f = await Oc(p), m = new Uint8Array(d.extnValue.buffer).slice(6); if (!lo(f, m)) throw new Error("credCert nonce was not expected value (Apple)"); const h = SA(i), y = new Uint8Array(u.subjectPublicKey); if (!lo(h, y)) throw new Error("Credential public key does not equal credCert public key (Apple)"); return !0; } async function Tme(t) { const { response: e, expectedChallenge: n, expectedOrigin: r, expectedRPID: i, expectedType: o, requireUserPresence: a = !0, requireUserVerification: s = !0, supportedAlgorithmIDs: c = Whe, attestationSafetyNetEnforceCTSCheck: u = !0 } = t, { id: d, rawId: p, type: f, response: m } = e; if (!d) throw new Error("Missing credential ID"); if (d !== p) throw new Error("Credential ID was not base64url-encoded"); if (f !== "public-key") throw new Error(`Unexpected credential type ${f}, expected "public-key"`); const h = DB(m.clientDataJSON), { type: y, origin: x, challenge: g, tokenBinding: b } = h; if (Array.isArray(o)) { if (!o.includes(y)) { const M = o.join(", "); throw new Error(`Unexpected registration response type "${y}", expected one of: ${M}`); } } else if (o) { if (y !== o) throw new Error(`Unexpected registration response type "${y}", expected "${o}"`); } else if (y !== "webauthn.create") throw new Error(`Unexpected registration response type: ${y}`); if (typeof n == "function") { if (!await n(g)) throw new Error(`Custom challenge verifier returned false for registration response challenge "${g}"`); } else if (g !== n) throw new Error(`Unexpected registration response challenge "${g}", expected "${n}"`); if (Array.isArray(r)) { if (!r.includes(x)) throw new Error(`Unexpected registration response origin "${x}", expected one of: ${r.join(", ")}`); } else if (x !== r) throw new Error(`Unexpected registration response origin "${x}", expected "${r}"`); if (b) { if (typeof b != "object") throw new Error(`Unexpected value for TokenBinding "${b}"`); if (["present", "supported", "not-supported"].indexOf(b.status) < 0) throw new Error(`Unexpected tokenBinding.status value of "${b.status}"`); } const S = Yo(m.attestationObject), E = Cpe(S), T = E.get("fmt"), U = E.get("authData"), q = E.get("attStmt"), Y = _U(U), { aaguid: H, rpIdHash: G, flags: J, credentialID: B, counter: D, credentialPublicKey: X, extensionsData: V } = Y; let K; if (i) { let M = []; typeof i == "string" ? M = [i] : M = i, K = await CU(G, M); } if (a && !J.up) throw new Error("User presence was required, but user was not present"); if (s && !J.uv) throw new Error("User verification was required, but user could not be verified"); if (!B) throw new Error("No credential ID was provided by authenticator"); if (!X) throw new Error("No public key was provided by authenticator"); if (!H) throw new Error("No AAGUID was present during registration"); const _ = t1(X).get(pt.alg); if (typeof _ != "number") throw new Error("Credential public key was missing numeric alg"); if (!c.includes(_)) { const M = c.join(", "); throw new Error(`Unexpected public key alg "${_}", expected one of "${M}"`); } const I = await Oc(Yo(m.clientDataJSON)), N = Kl.getRootCertificates({ identifier: T }), L = { aaguid: H, attStmt: q, authData: U, clientDataHash: I, credentialID: B, credentialPublicKey: X, rootCertificates: N, rpIdHash: G, attestationSafetyNetEnforceCTSCheck: u }; let C = !1; if (T === "fido-u2f") C = await sme(L); else if (T === "packed") C = await hme(L); else if (T === "android-safetynet") C = await mme(L); else if (T === "android-key") C = await Ime(L); else if (T === "tpm") C = await Sme(L); else if (T === "apple") C = await Cme(L); else if (T === "none") { if (q.size > 0) throw new Error("None attestation had unexpected attestation statement"); C = !0; } else throw new Error(`Unsupported Attestation Format: ${T}`); if (!C) return { verified: !1 }; const { credentialDeviceType: Q, credentialBackedUp: k } = IU(J); return { verified: !0, registrationInfo: { fmt: T, aaguid: PB(H), credentialType: f, credential: { id: zi(B), publicKey: X, counter: D, transports: e.response.transports }, attestationObject: S, userVerified: J.uv, credentialDeviceType: Q, credentialBackedUp: k, origin: h.origin, rpID: K, authenticatorExtensionResults: V } }; } async function kme(t) { const { allowCredentials: e, challenge: n = await AU(), timeout: r = 6e4, userVerification: i = "preferred", extensions: o, rpID: a } = t; let s = n; return typeof s == "string" && (s = $f(s)), { rpId: a, challenge: zi(s), allowCredentials: e?.map((c) => { if (!Cp(c.id)) throw new Error(`allowCredential id "${c.id}" is not a valid base64url string`); return { ...c, id: bA(c.id), type: "public-key" }; }), timeout: r, userVerification: i, extensions: o }; } async function Nme(t) { const { response: e, expectedChallenge: n, expectedOrigin: r, expectedRPID: i, expectedType: o, credential: a, requireUserVerification: s = !0, advancedFIDOConfig: c } = t, { id: u, rawId: d, type: p, response: f } = e; if (!u) throw new Error("Missing credential ID"); if (u !== d) throw new Error("Credential ID was not base64url-encoded"); if (p !== "public-key") throw new Error(`Unexpected credential type ${p}, expected "public-key"`); if (!e) throw new Error("Credential missing response"); if (typeof f?.clientDataJSON != "string") throw new Error("Credential response clientDataJSON was not a string"); const m = DB(f.clientDataJSON), { type: h, origin: y, challenge: x, tokenBinding: g } = m; if (Array.isArray(o)) { if (!o.includes(h)) { const K = o.join(", "); throw new Error(`Unexpected authentication response type "${h}", expected one of: ${K}`); } } else if (o) { if (h !== o) throw new Error(`Unexpected authentication response type "${h}", expected "${o}"`); } else if (h !== "webauthn.get") throw new Error(`Unexpected authentication response type: ${h}`); if (typeof n == "function") { if (!await n(x)) throw new Error(`Custom challenge verifier returned false for registration response challenge "${x}"`); } else if (x !== n) throw new Error(`Unexpected authentication response challenge "${x}", expected "${n}"`); if (Array.isArray(r)) { if (!r.includes(y)) { const K = r.join(", "); throw new Error(`Unexpected authentication response origin "${y}", expected one of: ${K}`); } } else if (y !== r) throw new Error(`Unexpected authentication response origin "${y}", expected "${r}"`); if (!Cp(f.authenticatorData)) throw new Error("Credential response authenticatorData was not a base64url string"); if (!Cp(f.signature)) throw new Error("Credential response signature was not a base64url string"); if (f.userHandle && typeof f.userHandle != "string") throw new Error("Credential response userHandle was not a string"); if (g) { if (typeof g != "object") throw new Error("ClientDataJSON tokenBinding was not an object"); if (["present", "supported", "notSupported"].indexOf(g.status) < 0) throw new Error(`Unexpected tokenBinding status ${g.status}`); } const b = Yo(f.authenticatorData), S = _U(b), { rpIdHash: E, flags: T, counter: U, extensionsData: q } = S; let Y = []; typeof i == "string" ? Y = [i] : Y = i; const H = await CU(E, Y); if (c !== void 0) { const { userVerification: K } = c; if (K === "required" && !T.uv) throw new Error("User verification required, but user could not be verified"); } else { if (!T.up) throw new Error("User not present during authentication"); if (s && !T.uv) throw new Error("User verification required, but user could not be verified"); } const G = await Oc(Yo(f.clientDataJSON)), J = yi([b, G]), B = Yo(f.signature); if ((U > 0 || a.counter > 0) && U <= a.counter) throw new Error(`Response counter value ${U} was lower than expected ${a.counter}`); const { credentialDeviceType: D, credentialBackedUp: X } = IU(T); return { verified: await Fc({ signature: B, data: J, credentialPublicKey: a.publicKey }), authenticationInfo: { newCounter: U, credentialID: a.id, userVerified: T.uv, credentialDeviceType: D, credentialBackedUp: X, authenticatorExtensionResults: q, origin: m.origin, rpID: H } }; } const Pme = "SnowCat WebUI"; class Gp { static getPasskeyFilePath() { return ve.join(lt.configPath, "passkey.json"); } // 内存中存储临时挑战数据 static challenges = /* @__PURE__ */ new Map(); static async ensurePasskeyFile() { try { const e = this.getPasskeyFilePath(); await cs.mkdir(ve.dirname(e), { recursive: !0 }); try { await cs.access(e); } catch { await cs.writeFile(e, JSON.stringify({}, null, 2)); } } catch { } } static async getAllPasskeys() { await this.ensurePasskeyFile(); try { const e = this.getPasskeyFilePath(), n = await cs.readFile(e, "utf-8"), r = JSON.parse(n); return typeof r == "object" && r !== null ? r : {}; } catch (e) { return console.error("Failed to read passkey file:", e), {}; } } static async saveAllPasskeys(e) { await this.ensurePasskeyFile(); const n = this.getPasskeyFilePath(); await cs.writeFile(n, JSON.stringify(e, null, 2)); } static async getUserPasskeys(e) { return (await this.getAllPasskeys())[e] || []; } // 持久性存储用户的passkey到统一配置文件 static async setUserPasskeys(e, n) { const r = await this.getAllPasskeys(); n.length > 0 ? r[e] = n : delete r[e], await this.saveAllPasskeys(r); } static async generateRegistrationOptions(e, n, r) { const i = await this.getUserPasskeys(e), o = await Yhe({ rpName: Pme, rpID: r, userID: new TextEncoder().encode(e), userName: n, attestationType: "none", excludeCredentials: i.map((a) => ({ id: a.id, type: "public-key", transports: a.transports })), // Temporarily simplify authenticatorSelection - remove residentKey to avoid conflicts authenticatorSelection: { userVerification: "preferred" } }); return this.challenges.set(`reg_${e}`, o.challenge), setTimeout(() => { this.challenges.delete(`reg_${e}`); }, 3e5), o; } static async verifyRegistration(e, n, r, i) { const o = this.challenges.get(`reg_${e}`); if (!o) throw new Error("Challenge not found or expired"); const a = await Tme({ response: n, expectedChallenge: o, expectedOrigin: r, expectedRPID: i }); if (a.verified && a.registrationInfo) { const { registrationInfo: s } = a, c = { id: s.credential.id, publicKey: zi(s.credential.publicKey), counter: s.credential.counter || 0, transports: n.response.transports }, u = await this.getUserPasskeys(e); u.push(c), await this.setUserPasskeys(e, u), this.challenges.delete(`reg_${e}`); } return a; } static async generateAuthenticationOptions(e, n) { const r = await this.getUserPasskeys(e), i = await kme({ rpID: n, allowCredentials: r.map((o) => ({ id: o.id, type: "public-key", transports: o.transports })), userVerification: "preferred" }); return this.challenges.set(`auth_${e}`, i.challenge), setTimeout(() => { this.challenges.delete(`auth_${e}`); }, 3e5), i; } static async verifyAuthentication(e, n, r, i) { const o = this.challenges.get(`auth_${e}`); if (!o) throw new Error("Challenge not found or expired"); const a = await this.getUserPasskeys(e), s = a.find((u) => u.id === n.id); if (!s) throw new Error("Passkey not found"); const c = await Nme({ response: n, expectedChallenge: o, expectedOrigin: r, expectedRPID: i, credential: { id: s.id, publicKey: Yo(s.publicKey), counter: s.counter } }); return c.verified && c.authenticationInfo && (s.counter = c.authenticationInfo.newCounter, await this.setUserPasskeys(e, a), this.challenges.delete(`auth_${e}`)), c; } static async hasPasskeys(e) { return (await this.getUserPasskeys(e)).length > 0; } } class qp { /** * 生成随机密钥(Base32格式) * @param length 密钥长度(字节),默认16字节 * @returns Base32编码的密钥 */ static generateSecret(e = 16) { const n = Ri.randomBytes(e); return this.toBase32(n); } /** * 验证一次性密码 * @param secret Base32编码的密钥 * @param code 用户输入的验证码 * @param timeStep 时间步长(秒),默认30秒 * @param window 允许的时间窗口(前后各多少个时间步长),默认1 * @returns 是否验证通过 */ static verifyTotp(e, n, r = 30, i = 1) { const o = Math.floor(Date.now() / 1e3 / r); for (let a = -i; a <= i; a++) if (this.generateHotp(e, o + a) === n) return !0; return !1; } /** * 生成 HOTP (HMAC-based One-Time Password) * @param secret Base32编码的密钥 * @param counter 计数器 * @returns 6位数字验证码 */ static generateHotp(e, n) { const r = this.base32ToBytes(e), i = Buffer.alloc(8); let o = n; for (let g = 7; g >= 0; g--) i[g] = o & 255, o = Math.floor(o / 256); const a = Ri.createHmac("sha1", r); a.update(i); const s = a.digest(), c = s.length, u = s[c - 1]; if (u === void 0) return "000000"; const d = u & 15, p = s[d] ?? 0, f = s[d + 1] ?? 0, m = s[d + 2] ?? 0, h = s[d + 3] ?? 0; return (((p & 127) << 24 | (f & 255) << 16 | (m & 255) << 8 | h & 255) % 1e6).toString().padStart(6, "0"); } /** * 生成 QR Code URL * @param secret Base32编码的密钥 * @param account 账户名称 * @param issuer 发行方名称 * @returns otpauth:// URL */ static generateQrCodeUrl(e, n, r) { const i = encodeURIComponent(r); return `otpauth://totp/${encodeURIComponent(`${r}:${n}`)}?secret=${e}&issuer=${i}&algorithm=SHA1&digits=6&period=30`; } /** * 将字节数组转换为 Base32 编码 * @param buffer 字节数组 * @returns Base32编码字符串 */ static toBase32(e) { const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; let r = ""; for (let i = 0; i < e.length; i += 5) { const o = e[i] ?? 0, a = e[i + 1] ?? 0, s = e[i + 2] ?? 0, c = e[i + 3] ?? 0, u = e[i + 4] ?? 0; r += n[o >> 3 & 31], r += n[(o << 2 | a >> 6) & 31], r += n[a >> 1 & 31], r += n[(a << 4 | s >> 4) & 31], r += n[(s << 1 | c >> 7) & 31], r += n[c >> 2 & 31], r += n[(c << 3 | u >> 5) & 31], r += n[u & 31]; } return r.replace(/=+$/, ""); } /** * 将 Base32 字符串转换为字节数组 * @param base32 Base32编码字符串 * @returns 字节数组 */ static base32ToBytes(e) { const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", r = e.toUpperCase().replace(/=+$/, ""), i = []; let o = 0, a = 0; for (const s of r) { const c = n.indexOf(s); c !== -1 && (o = o << 5 | c, a += 5, a >= 8 && (i.push(o >> a - 8 & 255), a -= 8)); } return Buffer.from(i); } } const Dme = async (t, e) => { const n = await Ct.GetWebUIConfig(), { hash: r, totpCode: i } = t.body, o = t.ip || t.socket.remoteAddress || ""; if (er(r)) return ne(e, "token is empty"); if (!de.checkLoginRate(o, n.loginRate)) return ne(e, "login rate limit"); const a = Na(); if (!a) return ne(e, "Server token not initialized"); if (!ln.comparePasswordHash(a, r)) return ne(e, "token is invalid"); if (n.enable2FA && n.totpSecret) { if (!i) return me(e, { require2FA: !0, message: "Please enter your authenticator code" }); if (!qp.verifyTotp(n.totpSecret, i)) return ne(e, "Invalid or expired code"); const c = Buffer.from(JSON.stringify(ln.signCredential(r))).toString("base64"); return me(e, { Credential: c, require2FA: !1 }); } const s = Buffer.from(JSON.stringify(ln.signCredential(r))).toString("base64"); return me(e, { Credential: s }); }, Ome = async (t, e) => { const n = t.headers.authorization; try { const r = n?.split(" ")[1], i = JSON.parse(Buffer.from(r, "base64").toString()); return ln.revokeCredential(i), me(e, "Logged out successfully"); } catch { return ne(e, "Logout failed"); } }, Fme = async (t, e) => { const n = t.headers.authorization; try { const r = n?.split(" ")[1], i = JSON.parse(Buffer.from(r, "base64").toString()); if (ln.isCredentialRevoked(i)) return ne(e, "Token has been revoked"); const o = Na(); return o ? ln.validateCredentialWithinOneHour(o, i) ? me(e, null) : ne(e, "Authorization Failed") : ne(e, "Server token not initialized"); } catch { return ne(e, "Authorization Failed"); } }, Mme = async (t, e) => { const { oldToken: n, newToken: r } = t.body, i = t.headers.authorization; if (er(r)) return ne(e, "newToken is empty"); if (er(n)) return ne(e, "oldToken is required"); if (n === r) return ne(e, "新密码不能与旧密码相同"); if (r.length < 6) return ne(e, "新密码至少需要6个字符"); if (!/[a-zA-Z]/.test(r)) return ne(e, "新密码必须包含字母"); if (!/[0-9]/.test(r)) return ne(e, "新密码必须包含数字"); try { if (i) { const a = i.split(" ")[1], s = JSON.parse(Buffer.from(a, "base64").toString()); ln.revokeCredential(s); } const o = Na(); return o ? o !== n ? ne(e, "旧 token 不匹配") : (await Ct.UpdateWebUIConfig({ token: r }), nL(r), me(e, "Token updated successfully")) : ne(e, "Server token not initialized"); } catch (o) { return ne(e, `Failed to update token: ${o.message}`); } }, Rme = async (t, e) => { try { const n = "snowcat-user", r = "SnowCat User", o = (t.get("host") || "localhost").split(":")[0] || "localhost", a = o === "127.0.0.1" || o === "localhost" ? "localhost" : o, s = await Gp.generateRegistrationOptions(n, r, a); return me(e, s); } catch (n) { return ne(e, `Failed to generate registration options: ${n.message}`); } }, Bme = async (t, e) => { try { const { response: n } = t.body; if (!n) return ne(e, "Response is required"); const r = t.get("origin") || t.protocol + "://" + t.get("host"), o = (t.get("host") || "localhost").split(":")[0] || "localhost", a = o === "127.0.0.1" || o === "localhost" ? "localhost" : o; return (await Gp.verifyRegistration("snowcat-user", n, r, a)).verified ? me(e, { verified: !0 }) : ne(e, "Registration failed"); } catch (n) { return ne(e, `Registration verification failed: ${n.message}`); } }, Ume = async (t, e) => { try { const n = "snowcat-user"; if (!await Gp.hasPasskeys(n)) return ne(e, "No passkeys registered"); const i = (t.get("host") || "localhost").split(":")[0] || "localhost", o = i === "127.0.0.1" || i === "localhost" ? "localhost" : i, a = await Gp.generateAuthenticationOptions(n, o); return me(e, a); } catch (n) { return ne(e, `Failed to generate authentication options: ${n.message}`); } }, Lme = async (t, e) => { try { const { response: n } = t.body; if (!n) return ne(e, "Response is required"); const r = await Ct.GetWebUIConfig(), i = t.ip || t.socket.remoteAddress || ""; if (!de.checkLoginRate(i, r.loginRate)) return ne(e, "login rate limit"); const o = t.get("origin") || t.protocol + "://" + t.get("host"), s = (t.get("host") || "localhost").split(":")[0] || "localhost", c = s === "127.0.0.1" || s === "localhost" ? "localhost" : s; if ((await Gp.verifyAuthentication("snowcat-user", n, o, c)).verified) { const p = Na(); if (!p) return ne(e, "Server token not initialized"); const f = Buffer.from(JSON.stringify(ln.signCredential(ln.generatePasswordHash(p)))).toString("base64"); return me(e, { Credential: f }); } else return ne(e, "Authentication failed"); } catch (n) { return ne(e, `Authentication verification failed: ${n.message}`); } }, Qme = async (t, e) => { try { const n = await Ct.GetWebUIConfig(); return me(e, { enable2FA: n.enable2FA || !1, hasSecret: !!n.totpSecret }); } catch (n) { return ne(e, `获取2FA状态失败: ${n.message}`); } }, jme = async (t, e) => { try { const n = qp.generateSecret(), r = qp.generateQrCodeUrl(n, "SnowCat WebUI", "SnowCat"); return me(e, { secret: n, qrCodeUrl: r }); } catch (n) { return ne(e, `Failed to generate 2FA secret: ${n.message}`); } }, $me = async (t, e) => { try { const { secret: n, totpCode: r } = t.body; return !n || !r ? ne(e, "secret and totpCode are required") : qp.verifyTotp(n, r) ? (await Ct.UpdateWebUIConfig({ enable2FA: !0, totpSecret: n }), me(e, { message: "2FA enabled" })) : ne(e, "Invalid code"); } catch (n) { return ne(e, `Failed to enable 2FA: ${n.message}`); } }, Gme = async (t, e) => { try { const { totpCode: n } = t.body; if (!n) return ne(e, "totpCode is required to disable 2FA"); const r = await Ct.GetWebUIConfig(); return r.totpSecret ? qp.verifyTotp(r.totpSecret, n) ? (await Ct.UpdateWebUIConfig({ enable2FA: !1, totpSecret: "" }), me(e, { message: "2FA disabled" })) : ne(e, "Invalid code") : ne(e, "2FA is not enabled"); } catch (n) { return ne(e, `Failed to disable 2FA: ${n.message}`); } }, Ti = Tr(); Ti.post("/login", Dme); Ti.post("/check", Fme); Ti.post("/logout", Ome); Ti.post("/update_token", Mme); Ti.post("/passkey/generate-registration-options", Rme); Ti.post("/passkey/verify-registration", Bme); Ti.post("/passkey/generate-authentication-options", Ume); Ti.post("/passkey/verify-authentication", Lme); Ti.get("/2fa/status", Qme); Ti.post("/2fa/generate-secret", jme); Ti.post("/2fa/enable", $me); Ti.post("/2fa/disable", Gme); class b2 { _listeners = []; _event; get event() { return this._event || (this._event = (e) => (this._listeners.push(e), { dispose: () => { for (let r = 0; r < this._listeners.length; r++) if (this._listeners[r] === e) { this._listeners.splice(r, 1); return; } } })), this._event; } fire(e) { const n = []; for (let r = 0; r < this._listeners.length; r++) n.push(this._listeners[r]); for (let r = 0; r < n.length; r++) n[r].call(void 0, e); } } const v2 = 80, x2 = 24, qme = "", zme = ""; class NU { _socket; // HACK: This is unsafe _pid = 0; _fd = 0; _pty; _file; // HACK: This is unsafe _name; // HACK: This is unsafe _cols = 0; _rows = 0; _readable = !1; _writable = !1; _internalee; _flowControlPause; _flowControlResume; handleFlowControl; _onData = new b2(); get onData() { return this._onData.event; } _onExit = new b2(); get onExit() { return this._onExit.event; } get pid() { return this._pid; } get cols() { return this._cols; } get rows() { return this._rows; } constructor(e) { this._internalee = new h7(), this.handleFlowControl = !!e?.handleFlowControl, this._flowControlPause = e?.flowControlPause || qme, this._flowControlResume = e?.flowControlResume || zme, e && (this._checkType("name", e.name ? e.name : void 0, "string"), this._checkType("cols", e.cols ? e.cols : void 0, "number"), this._checkType("rows", e.rows ? e.rows : void 0, "number"), this._checkType("cwd", e.cwd ? e.cwd : void 0, "string"), this._checkType("env", e.env ? e.env : void 0, "object"), this._checkType("uid", e.uid ? e.uid : void 0, "number"), this._checkType("gid", e.gid ? e.gid : void 0, "number"), this._checkType("encoding", e.encoding ? e.encoding : void 0, "string")); } write(e) { if (this.handleFlowControl) { if (e === this._flowControlPause) { this.pause(); return; } if (e === this._flowControlResume) { this.resume(); return; } } this._write(e); } _forwardEvents() { this.on("data", (e) => this._onData.fire(e)), this.on("exit", (e, n) => this._onExit.fire({ exitCode: e, signal: n })); } _checkType(e, n, r, i = !1) { if (n !== void 0) { if (i && Array.isArray(n)) { n.forEach((o, a) => { if (typeof o !== r) throw new Error(`${e}[${a}] must be a ${r} (not a ${typeof o[a]})`); }); return; } if (typeof n !== r) throw new Error(`${e} must be a ${r} (not a ${typeof n})`); } } /** See net.Socket.end */ end(e) { this._socket.end(e); } /** See stream.Readable.pipe */ pipe(e, n) { return this._socket.pipe(e, n); } /** See net.Socket.pause */ pause() { return this._socket.pause(); } /** See net.Socket.resume */ resume() { return this._socket.resume(); } /** See net.Socket.setEncoding */ setEncoding(e) { this._socket._decoder && delete this._socket._decoder, e && this._socket.setEncoding(e); } addListener(e, n) { this.on(e, n); } on(e, n) { if (e === "close") { this._internalee.on("close", n); return; } this._socket.on(e, n); } emit(e, ...n) { return e === "close" ? this._internalee.emit.apply(this._internalee, arguments) : this._socket.emit.apply(this._socket, arguments); } listeners(e) { return this._socket.listeners(e); } removeListener(e, n) { this._socket.removeListener(e, n); } removeAllListeners(e) { this._socket.removeAllListeners(e); } once(e, n) { this._socket.once(e, n); } _close() { this._socket.readable = !1, this.write = () => { }, this.end = () => { }, this._writable = !1, this._readable = !1; } _parseEnv(e) { const n = Object.keys(e || {}), r = []; for (let i = 0; i < n.length; i++) n[i] !== void 0 && r.push(n[i] + "=" + e[n[i]]); return r; } } var PU = /* @__PURE__ */ ((t) => (t[t.READY = 1] = "READY", t))(PU || {}); function Hme(t) { return `${t}-worker`; } const Wme = 1e3; class Kme { constructor(e) { this._conoutPipeName = e; const n = { conoutPipeName: e }, r = fl(a0(import.meta.url)); this._worker = new v7(qm(r, "worker/conoutSocketWorker.mjs"), { workerData: n }), this._worker.on("message", (i) => { switch (i) { case PU.READY: this._onReady.fire(); return; default: console.warn("Unexpected ConoutWorkerMessage", i); } }); } _worker; _drainTimeout; _isDisposed = !1; _onReady = new b2(); get onReady() { return this._onReady.event; } dispose() { this._isDisposed || (this._isDisposed = !0, this._drainDataAndClose()); } connectSocket(e) { e.connect(Hme(this._conoutPipeName)); } _drainDataAndClose() { this._drainTimeout && clearTimeout(this._drainTimeout), this._drainTimeout = setTimeout(() => this._destroySocket(), Wme); } async _destroySocket() { await this._worker.terminate(); } } let Dw, Ow; const Vme = 1e3; class Yme { constructor(e, n, r, i, o, a, s, c, u = !1, d = !1) { this._useConpty = c, this._useConptyDll = u, (this._useConpty === void 0 || this._useConpty === !0) && (this._useConpty = this._getWindowsBuildNumber() >= 18309), this._useConpty ? Dw || (Dw = S2("./native/pty/" + process.platform + "." + process.arch + "/conpty.node")) : Ow || (Ow = S2("./native/pty/" + process.platform + "." + process.arch + "/pty.node")), this._ptyNative = this._useConpty ? Dw : Ow, i = nt.resolve(i); const p = DU(e, n); let f; this._useConpty ? f = this._ptyNative.startProcess(e, o, a, s, this._generatePipeName(), d, this._useConptyDll) : (f = this._ptyNative.startProcess(e, p, r, i, o, a, s), this._pid = f.pid, this._innerPid = f.innerPid), this._fd = f.fd, this._pty = f.pty, this._outSocket = new L3(), this._outSocket.setEncoding("utf8"), this._conoutSocketWorker = new Kme(f.conout), this._conoutSocketWorker.onReady(() => { this._conoutSocketWorker.connectSocket(this._outSocket); }), this._outSocket.on("connect", () => { this._outSocket.emit("ready_datapipe"); }); const m = Ie.openSync(f.conin, "w"); if (this._inSocket = new L3({ fd: m, readable: !1, writable: !0 }), this._inSocket.setEncoding("utf8"), this._useConpty) { const h = this._ptyNative.connect(this._pty, p, i, r, (y) => this._$onProcessExit(y)); this._innerPid = h.pid; } } _inSocket; _outSocket; _pid = 0; _innerPid = 0; _closeTimeout; _exitCode; _conoutSocketWorker; _fd; _pty; _ptyNative; get inSocket() { return this._inSocket; } get outSocket() { return this._outSocket; } get fd() { return this._fd; } get innerPid() { return this._innerPid; } get pty() { return this._pty; } resize(e, n) { if (this._useConpty) { if (this._exitCode !== void 0) throw new Error("Cannot resize a pty that has already exited"); this._ptyNative.resize(this._pty, e, n, this._useConptyDll); return; } this._ptyNative.resize(this._pid, e, n); } clear() { this._useConpty && this._ptyNative.clear(this._pty, this._useConptyDll); } kill() { if (this._inSocket.readable = !1, this._outSocket.readable = !1, this._useConpty) this._getConsoleProcessList().then((e) => { e.forEach((n) => { try { process.kill(n); } catch { } }), this._ptyNative.kill(this._pty, this._useConptyDll); }); else { const e = this._ptyNative.getProcessList(this._pid); this._ptyNative.kill(this._pid, this._innerPid), e.forEach((n) => { try { process.kill(n); } catch { } }); } this._conoutSocketWorker.dispose(); } _getConsoleProcessList() { const e = fl(Mc(import.meta.url)); return new Promise((n) => { const r = l7(nt.join(e, "conpty_console_list_agent"), [this._innerPid.toString()]); r.on("message", (o) => { clearTimeout(i), n(o.consoleProcessList); }); const i = setTimeout(() => { r.kill(), n([this._innerPid]); }, 5e3); }); } get exitCode() { if (this._useConpty) return this._exitCode; const e = this._ptyNative.getExitCode(this._innerPid); return e === -1 ? void 0 : e; } _getWindowsBuildNumber() { const e = gs.release(); if (e.length > 50) return 0; const n = /^(\d{1,5})\.(\d{1,5})\.(\d{1,10})/.exec(e); let r = 0; return n && n.length === 4 && (r = parseInt(n[3])), r; } _generatePipeName() { return `conpty-${Math.random() * 1e7}`; } /** * Triggered from the native side when a contpy process exits. */ _$onProcessExit(e) { this._exitCode = e, this._flushDataAndCleanUp(), this._outSocket.on("data", () => this._flushDataAndCleanUp()); } _flushDataAndCleanUp() { this._closeTimeout && clearTimeout(this._closeTimeout), this._closeTimeout = setTimeout(() => this._cleanUpProcess(), Vme); } _cleanUpProcess() { this._inSocket.readable = !1, this._outSocket.readable = !1, this._outSocket.destroy(); } } function DU(t, e) { if (Jme(e)) return e.length === 0 ? t : `${DU(t, [])} ${e}`; const n = [t]; Array.prototype.push.apply(n, e); let r = ""; for (let i = 0; i < n.length; i++) { i > 0 && (r += " "); const o = n[i], a = Xme(o[0] !== '"', o[o.length - 1] !== '"'), s = o[0] !== '"' && o[o.length - 1] !== '"', c = o === "" || (o.indexOf(" ") !== -1 || o.indexOf(" ") !== -1) && o.length > 1 && (a || s); c && (r += '"'); let u = 0; for (let d = 0; d < o.length; d++) { const p = o[d]; p === "\\" ? u++ : p === '"' ? (r += am("\\", u * 2 + 1), r += '"', u = 0) : (r += am("\\", u), u = 0, r += p); } c ? (r += am("\\", u * 2), r += '"') : r += am("\\", u); } return r; } function Jme(t) { return typeof t == "string"; } function am(t, e) { let n = ""; for (let r = 0; r < e; r++) n += t; return n; } function Xme(t, e) { return t && !e || !t && e; } function OU(t, ...e) { return e.forEach((n) => Object.keys(n).forEach((r) => t[r] = n[r])), t; } const Zme = "cmd.exe", ege = "Windows Shell"; class tge extends NU { _isReady; _deferreds; _agent; constructor(e, n, r) { super(r), this._checkType("args", n, "string", !0), n = n || [], e = e || Zme, r = r || {}, r.env = r.env || process.env, r.encoding && console.warn("Setting encoding on Windows is not supported"); const i = OU({}, r.env); this._cols = r.cols || v2, this._rows = r.rows || x2; const o = r.cwd || process.cwd(), a = r.name || i.TERM || ege, s = this._parseEnv(i); this._isReady = !1, this._deferreds = [], this._agent = new Yme(e, n, s, o, this._cols, this._rows, !1, r.useConpty, r.useConptyDll, r.conptyInheritCursor), this._socket = this._agent.outSocket, this._pid = this._agent.innerPid, this._fd = this._agent.fd, this._pty = this._agent.pty, this._socket.on("ready_datapipe", () => { ["connect", "data", "end", "timeout", "drain"].forEach((c) => { this._socket.on(c, () => { !this._isReady && c === "data" && (this._isReady = !0, this._deferreds.forEach((u) => { u.run(); }), this._deferreds = []); }); }), this._socket.on("error", (c) => { if (this._close(), !(c.code && (~c.code.indexOf("errno 5") || ~c.code.indexOf("EIO"))) && this.listeners("error").length < 2) throw c; }), this._socket.on("close", () => { this.emit("exit", this._agent.exitCode), this._close(); }); }), this._file = e, this._name = a, this._readable = !0, this._writable = !0, this._forwardEvents(); } _write(e) { this._defer(this._doWrite, e); } _doWrite(e) { this._agent.inSocket.write(e); } /** * openpty */ static open(e) { throw new Error("open() not supported on windows, use Fork() instead."); } /** * TTY */ resize(e, n) { if (e <= 0 || n <= 0 || isNaN(e) || isNaN(n) || e === 1 / 0 || n === 1 / 0) throw new Error("resizing must be done using positive cols and rows"); this._deferNoArgs(() => { this._agent.resize(e, n), this._cols = e, this._rows = n; }); } clear() { this._deferNoArgs(() => { this._agent.clear(); }); } destroy() { this._deferNoArgs(() => { this.kill(); }); } kill(e) { this._deferNoArgs(() => { if (e) throw new Error("Signals not supported on windows."); this._close(), this._agent.kill(); }); } // @ts-expect-error - This is a private method that is not part of the public API. // eslint-disable-next-line @typescript-eslint/no-unused-vars _deferNoArgs(e) { if (this._isReady) { e.call(this); return; } this._deferreds.push({ run: () => e.call(this) }); } _defer(e, n) { if (this._isReady) { e.call(this, n); return; } this._deferreds.push({ run: () => e.call(this, n) }); } get process() { return this._name; } get master() { throw new Error("master is not supported on Windows"); } get slave() { throw new Error("slave is not supported on Windows"); } } function nge() { let t; try { t = S2("./native/pty/" + process.platform + "." + process.arch + "/pty.node"); } catch { t = void 0; } return t; } let Fw; const pd = new Proxy({}, { get(t, e) { return Fw || (Fw = nge()), Fw[e]; } }); let Ts; Ts = "../build/Release/spawn-helper"; const rge = nt.dirname(Mc(import.meta.url)); Ts = nt.resolve(rge, Ts); Ts = Ts.replace("app.asar", "app.asar.unpacked"); Ts = Ts.replace("node_modules.asar", "node_modules.asar.unpacked"); const ige = "sh", oge = "xterm", age = 200; class p3 extends NU { _fd; _pty; _file; _name; _readable; _writable; _boundClose = !1; _emittedClose = !1; _master; _slave; get master() { return this._master; } get slave() { return this._slave; } constructor(e, n, r) { if (super(r), typeof n == "string") throw new Error("args as a string is not supported on unix."); n = n || [], e = e || ige, r = r || {}, r.env = r.env || process.env, this._cols = r.cols || v2, this._rows = r.rows || x2; const i = r.uid ?? -1, o = r.gid ?? -1, a = OU({}, r.env); r.env === process.env && this._sanitizeEnv(a); const s = r.cwd || process.cwd(); a.PWD = s; const c = r.name || a.TERM || oge; a.TERM = c; const u = this._parseEnv(a), d = r.encoding === void 0 ? "utf8" : r.encoding, p = (m, h) => { if (!this._emittedClose) { if (this._boundClose) return; this._boundClose = !0; let y = setTimeout(() => { y = null, this._socket.destroy(); }, age); this.once("close", () => { y !== null && clearTimeout(y), this.emit("exit", m, h); }); return; } this.emit("exit", m, h); }, f = pd.fork(e, n, u, s, this._cols, this._rows, i, o, d === "utf8", Ts, p); this._socket = new oy.ReadStream(f.fd), d !== null && this._socket.setEncoding(d), this._socket.on("error", (m) => { if (!(m.code && ~m.code.indexOf("EAGAIN")) && (this._close(), this._emittedClose || (this._emittedClose = !0, this.emit("close")), !(m.code && (~m.code.indexOf("errno 5") || ~m.code.indexOf("EIO"))) && this.listeners("error").length < 2)) throw m; }), this._pid = f.pid, this._fd = f.fd, this._pty = f.pty, this._file = e, this._name = c, this._readable = !0, this._writable = !0, this._socket.on("close", () => { this._emittedClose || (this._emittedClose = !0, this._close(), this.emit("close")); }), this._forwardEvents(); } _write(e) { this._socket.write(e); } /* Accessors */ get fd() { return this._fd; } get ptsName() { return this._pty; } /** * openpty */ static open(e) { const n = Object.create(p3.prototype); e = e || {}, arguments.length > 1 && (e = { cols: arguments[1], rows: arguments[2] }); const r = e.cols || v2, i = e.rows || x2, o = e.encoding === void 0 ? "utf8" : e.encoding, a = pd.open(r, i); return n._master = new oy.ReadStream(a.master), o !== null && n._master.setEncoding(o), n._master.resume(), n._slave = new oy.ReadStream(a.slave), o !== null && n._slave.setEncoding(o), n._slave.resume(), n._socket = n._master, n._pid = -1, n._fd = a.master, n._pty = a.pty, n._file = process.argv[0] || "node", n._name = process.env.TERM || "", n._readable = !0, n._writable = !0, n._socket.on("error", (s) => { if (n._close(), n.listeners("error").length < 2) throw s; }), n._socket.on("close", () => { n._close(); }), n; } destroy() { this._close(), this._socket.once("close", () => { this.kill("SIGHUP"); }), this._socket.destroy(); } kill(e) { try { process.kill(this.pid, e || "SIGHUP"); } catch { } } /** * Gets the name of the process. */ get process() { if (process.platform === "darwin") { const e = pd.process(this._fd); return e !== "kernel_task" ? e : this._file; } return pd.process(this._fd, this._pty) || this._file; } /** * TTY */ resize(e, n) { if (e <= 0 || n <= 0 || isNaN(e) || isNaN(n) || e === 1 / 0 || n === 1 / 0) throw new Error("resizing must be done using positive cols and rows"); pd.resize(this._fd, e, n), this._cols = e, this._rows = n; } clear() { } _sanitizeEnv(e) { delete e.TMUX, delete e.TMUX_PANE, delete e.STY, delete e.WINDOW, delete e.WINDOWID, delete e.TERMCAP, delete e.COLUMNS, delete e.LINES; } } let w2; process.platform === "win32" ? w2 = tge : w2 = p3; function sge(t, e, n) { return new w2(t, e, n); } function S2(t) { const e = { exports: {} }, n = N2(a0(import.meta.url)); return process.dlopen(e, xe.join(n, t)), e.exports; } class cge { terminals = /* @__PURE__ */ new Map(); wss = null; initialize(e, n, r, i) { i?.log("[SnowCat] [WebUi] terminal websocket initialized"), this.wss = new hp({ noServer: !0, verifyClient: async (o, a) => { const s = new URL(o.req.url || "", "ws://localhost"), c = s.searchParams.get("token"), u = s.searchParams.get("id"); if (!c || !u) { a(!1, 401, "Unauthorized"); return; } let d; try { d = JSON.parse(Buffer.from(c, "base64").toString("utf-8")); } catch { a(!1, 401, "Unauthorized"); return; } const p = await Ct.GetWebUIConfig(); if (!ln.validateCredentialWithinOneHour(p.token, d)) { a(!1, 401, "Unauthorized"); return; } a(!0); } }), this.wss.handleUpgrade(e, n, r, (o) => { this.wss?.emit("connection", o, e); }), this.wss.on("connection", async (o, a) => { i?.log("建立终端连接"); try { const c = new URL(a.url || "", "ws://localhost").searchParams.get("id"), u = this.terminals.get(c); if (!u) { o.close(); return; } u.sockets.add(o), u.lastAccess = Date.now(), o.readyState === Er.OPEN && o.send(JSON.stringify({ type: "output", data: u.buffer })), o.on("message", (d) => { if (u) { let p; Array.isArray(d) ? p = Buffer.concat(d).toString() : p = d.toString(); const f = JSON.parse(p); f.type === "input" && u.pty.write(f.data), f.type === "resize" && u.pty.resize(f.cols, f.rows); } }), o.on("close", () => { u.sockets.delete(o), u.sockets.size === 0 && !u.isClosing && (u.isClosing = !0, Ln.platform() === "win32" ? process.kill(u.pty.pid) : u.pty.kill()); }); } catch (s) { console.error("WebSocket authentication failed:", s), o.close(); } }); } // 修改:新增 cols 和 rows 参数,同步 xterm 尺寸,防止错位 createTerminal(e, n) { const r = Xo(), i = Ln.platform() === "win32" ? "powershell.exe" : "bash", o = sge(i, [], { name: "xterm-256color", cols: e, // 使用客户端传入的 cols rows: n, // 使用客户端传入的 rows cwd: process.cwd(), env: { ...process.env, LANG: Ln.platform() === "win32" ? "chcp 65001" : "zh_CN.UTF-8", TERM: "xterm-256color" } }), a = { pty: o, lastAccess: Date.now(), sockets: /* @__PURE__ */ new Set(), isClosing: !1, buffer: "" // 初始化终端内容缓存 }; return o.onData((s) => { a.buffer += s, a.sockets.forEach((c) => { c.readyState === Er.OPEN && c.send(JSON.stringify({ type: "output", data: s })); }); }), o.onExit(() => { this.closeTerminal(r); }), this.terminals.set(r, a), { id: r, instance: a }; } closeTerminal(e) { const n = this.terminals.get(e); n && (n.isClosing || (n.isClosing = !0, Ln.platform() === "win32" ? process.kill(n.pty.pid) : n.pty.kill()), n.sockets.forEach((r) => r.close()), this.terminals.delete(e)); } getTerminal(e) { return this.terminals.get(e); } getTerminalList() { return Array.from(this.terminals.keys()).map((e) => ({ id: e, lastAccess: this.terminals.get(e).lastAccess })); } } const V1 = new cge(), uge = process.platform === "darwin", FU = (t) => t.replace(/token=[\w\d]+/gi, "token=***"), lge = async (t, e) => { const n = t.query.id; if (!n || typeof n != "string") return ne(e, "ID不能为空"); if (n.includes("..")) return ne(e, "ID不合法"); const r = await Ct.GetLogContent(n), i = FU(r); return me(e, i); }, dge = async (t, e) => { const n = await Ct.GetLogsList(); return me(e, n); }, pge = async (t, e) => { e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Connection", "keep-alive"); const n = (r) => { try { const i = FU(r); e.write(`data: ${i} `); } catch (i) { console.error("向客户端写入日志数据时出错:", i); } }; E2.subscribe(n), t.on("close", () => { E2.unsubscribe(n); }); }, fge = async (t, e) => { if (uge) return ne(e, "MacOS不支持终端"); try { const { cols: n, rows: r } = t.body, { id: i } = V1.createTerminal(n, r); return me(e, { id: i }); } catch (n) { return console.error("Failed to create terminal:", n), ne(e, "创建终端失败"); } }, hge = (t, e) => { const n = V1.getTerminalList(); return me(e, n); }, mge = (t, e) => { const n = t.params.id; return n ? (V1.closeTerminal(n), me(e, {})) : ne(e, "ID不能为空"); }, Zc = Tr(); Zc.get("/GetLog", lge); Zc.get("/GetLogList", dge); Zc.get("/GetLogRealTime", pge); Zc.get("/terminal/list", hge); Zc.post("/terminal/create", fge); Zc.post("/terminal/:id/close", mge); const MU = (t, e) => { const n = de.GetNapCatVersion(); me(e, { version: n }); }, gge = async (t, e) => { try { const n = await T$(); me(e, n); } catch { me(e, null, "latest tag unavailable"); } }, yge = async (t, e) => { try { const n = parseInt(t.query.page) || 1, r = parseInt(t.query.pageSize) || 20, i = t.query.type, o = (t.query.search || "").toLowerCase().trim(), a = t.query.mirror; let s = [], c = [], u = ""; a && (u = a); const d = !i || i === "all" || i === "release", p = i === "action" || i === "all"; if (d) try { const b = await qO(a); a || (u = b.mirror), s = b.tags.map((S) => { const E = /-(alpha|beta|rc|dev|pre|snapshot)/i.test(S); return { tag: S, type: E ? "prerelease" : "release" }; }), s.sort((S, E) => -BO(S.tag, E.tag)); } catch { s = []; } if (p) try { const { artifacts: b, mirror: S } = await S$("DandanLLab", "SnowCatQQ", "build.yml", "main", 10, a), T = de.getWorkingEnv() === Z0.Framework ? "NapCat.Framework" : "NapCat.Shell"; !a && S && (u = S), c = b.filter((U) => U && U.name === T).map((U) => ({ tag: `action-${U.id}`, type: "action", artifactId: U.id, artifactName: U.name, createdAt: U.created_at, expiresAt: U.expires_at, size: U.size_in_bytes, workflowRunId: U.workflow_run_id, headSha: U.head_sha, workflowTitle: U.workflow_title })); } catch { c = []; } let f = [...c, ...s]; o && (f = f.filter((b) => { const S = b.tag.toLowerCase().includes(o), E = b.artifactName?.toLowerCase().includes(o), T = b.workflowTitle?.toLowerCase().includes(o), U = b.headSha?.toLowerCase().includes(o); return S || E || T || U; })); const m = f.length, h = Math.ceil(m / r), y = (n - 1) * r, x = y + r, g = f.slice(y, x); me(e, { versions: g, pagination: { page: n, pageSize: r, total: m, totalPages: h }, mirror: u }); } catch { e.status(500).json({ error: "Failed to fetch releases" }); } }, bge = (t, e) => { const n = de.getQQVersion(); me(e, n); }, vge = async (t, e) => { const n = await Ct.GetTheme(); me(e, n); }, xge = async (t, e) => { const { theme: n } = t.body; await Ct.UpdateTheme(n), me(e, { message: "更新成功" }); }, wge = (t, e) => { const n = UO(); me(e, { mirrors: n.fileMirrors }); }, RU = (t, e) => { try { const n = ve.join(lt.binaryPath, "napcat.mjs"); if (!fe.existsSync(n)) { me(e, { hash: null, file: "napcat.mjs", algorithm: "sha512", available: !1 }); return; } const r = fe.readFileSync(n), i = Ri.createHash("sha512").update(r).digest("hex"); me(e, { hash: i, file: "napcat.mjs", algorithm: "sha512", available: !0 }); } catch (n) { ne(e, `无法计算 napcat.mjs 的 hash:${n.message}`); } }, Sge = async (t, e) => { e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Connection", "keep-alive"); const n = (r) => { try { e.write(`data: ${JSON.stringify(r)} `); } catch (i) { console.error(`An error occurred when writing sendStatus data to client: ${i}`); } }; A2.on("statusUpdate", n), t.on("close", () => { A2.off("statusUpdate", n), e.end(); }); }, _ge = async (t, e) => { let { url: n } = t.query; if (n && typeof n == "string") { n = decodeURIComponent(n); const r = await ht.HttpGetText(n); return me(e, r); } else return ne(e, "url参数不合法"); }, ki = Tr(); ki.get("/QQVersion", bge); ki.get("/GetSnowCatVersion", MU); ki.get("/GetNapCatVersion", MU); ki.get("/getLatestTag", gge); ki.get("/getAllReleases", yge); ki.get("/getMirrors", wge); ki.get("/GetSysStatusRealTime", Sge); ki.get("/proxy", _ge); ki.get("/Theme", vge); ki.post("/SetTheme", xge); ki.get("/GetSnowCatFileHash", RU); ki.get("/GetNapCatFileHash", RU); var sP = [ "draft-6", "draft-7", "draft-8" ], Y1 = (t, e) => { let n; if (t) { const r = Math.ceil((t.getTime() - Date.now()) / 1e3); n = Math.max(0, r); } else e && (n = Math.ceil(e / 1e3)); return n; }, Ege = (t) => { const e = Wp("sha256"); e.update(t); const n = e.digest("hex").slice(0, 12); return x7.from(n).toString("base64"); }, Age = (t, e) => { t.headersSent || (t.setHeader("X-RateLimit-Limit", e.limit.toString()), t.setHeader("X-RateLimit-Remaining", e.remaining.toString()), e.resetTime instanceof Date && (t.setHeader("Date", (/* @__PURE__ */ new Date()).toUTCString()), t.setHeader( "X-RateLimit-Reset", Math.ceil(e.resetTime.getTime() / 1e3).toString() ))); }, Ige = (t, e, n) => { if (t.headersSent) return; const r = Math.ceil(n / 1e3), i = Y1(e.resetTime); t.setHeader("RateLimit-Policy", `${e.limit};w=${r}`), t.setHeader("RateLimit-Limit", e.limit.toString()), t.setHeader("RateLimit-Remaining", e.remaining.toString()), i && t.setHeader("RateLimit-Reset", i.toString()); }, Cge = (t, e, n) => { if (t.headersSent) return; const r = Math.ceil(n / 1e3), i = Y1(e.resetTime, n); t.setHeader("RateLimit-Policy", `${e.limit};w=${r}`), t.setHeader( "RateLimit", `limit=${e.limit}, remaining=${e.remaining}, reset=${i}` ); }, Tge = (t, e, n, r, i) => { if (t.headersSent) return; const o = Math.ceil(n / 1e3), a = Y1(e.resetTime, n), s = Ege(i), c = `q=${e.limit}; w=${o}; pk=:${s}:`, u = `r=${e.remaining}; t=${a}`; t.append("RateLimit-Policy", `"${r}"; ${c}`), t.append("RateLimit", `"${r}"; ${u}`); }, kge = (t, e, n) => { if (t.headersSent) return; const r = Y1(e.resetTime, n); t.setHeader("Retry-After", r.toString()); }, li = class extends Error { /** * The code must be a string, in snake case and all capital, that starts with * the substring `ERR_ERL_`. * * The message must be a string, starting with an uppercase character, * describing the issue in detail. */ constructor(t, e) { const n = `https://express-rate-limit.github.io/${t}/`; super(`${e} See ${n} for more information.`), this.name = this.constructor.name, this.code = t, this.help = n; } }, Um = class extends li { }, cP = /* @__PURE__ */ new Set(), uP = /* @__PURE__ */ new WeakMap(), Nge = { // eslint-disable-next-line @typescript-eslint/consistent-type-assertions enabled: { default: !0 }, // Should be EnabledValidations type, but that's a circular reference disable() { for (const t of Object.keys(this.enabled)) this.enabled[t] = !1; }, /** * Checks whether the IP address is valid, and that it does not have a port * number in it. * * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_invalid_ip_address. * * @param ip {string | undefined} - The IP address provided by Express as request.ip. * * @returns {void} */ ip(t) { if (t === void 0) throw new li( "ERR_ERL_UNDEFINED_IP_ADDRESS", "An undefined 'request.ip' was detected. This might indicate a misconfiguration or the connection being destroyed prematurely." ); if (!DD(t)) throw new li( "ERR_ERL_INVALID_IP_ADDRESS", `An invalid 'request.ip' (${t}) was detected. Consider passing a custom 'keyGenerator' function to the rate limiter.` ); }, /** * Makes sure the trust proxy setting is not set to `true`. * * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_permissive_trust_proxy. * * @param request {Request} - The Express request object. * * @returns {void} */ trustProxy(t) { if (t.app.get("trust proxy") === !0) throw new li( "ERR_ERL_PERMISSIVE_TRUST_PROXY", "The Express 'trust proxy' setting is true, which allows anyone to trivially bypass IP-based rate limiting." ); }, /** * Makes sure the trust proxy setting is set in case the `X-Forwarded-For` * header is present. * * See https://github.com/express-rate-limit/express-rate-limit/wiki/Error-Codes#err_erl_unset_trust_proxy. * * @param request {Request} - The Express request object. * * @returns {void} */ xForwardedForHeader(t) { if (t.headers["x-forwarded-for"] && t.app.get("trust proxy") === !1) throw new li( "ERR_ERL_UNEXPECTED_X_FORWARDED_FOR", "The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users." ); }, /** * Ensures totalHits value from store is a positive integer. * * @param hits {any} - The `totalHits` returned by the store. */ positiveHits(t) { if (typeof t != "number" || t < 1 || t !== Math.round(t)) throw new li( "ERR_ERL_INVALID_HITS", `The totalHits value returned from the store must be a positive integer, got ${t}` ); }, /** * Ensures a single store instance is not used with multiple express-rate-limit instances */ unsharedStore(t) { if (cP.has(t)) { const e = t?.localKeys ? "" : " (with a unique prefix)"; throw new li( "ERR_ERL_STORE_REUSE", `A Store instance must not be shared across multiple rate limiters. Create a new instance of ${t.constructor.name}${e} for each limiter instead.` ); } cP.add(t); }, /** * Ensures a given key is incremented only once per request. * * @param request {Request} - The Express request object. * @param store {Store} - The store class. * @param key {string} - The key used to store the client's hit count. * * @returns {void} */ singleCount(t, e, n) { let r = uP.get(t); r || (r = /* @__PURE__ */ new Map(), uP.set(t, r)); const i = e.localKeys ? e : e.constructor.name; let o = r.get(i); o || (o = [], r.set(i, o)); const a = `${e.prefix ?? ""}${n}`; if (o.includes(a)) throw new li( "ERR_ERL_DOUBLE_COUNT", `The hit count for ${n} was incremented more than once for a single request.` ); o.push(a); }, /** * Warns the user that the behaviour for `max: 0` / `limit: 0` is * changing in the next major release. * * @param limit {number} - The maximum number of hits per client. * * @returns {void} */ limit(t) { if (t === 0) throw new Um( "WRN_ERL_MAX_ZERO", "Setting limit or max to 0 disables rate limiting in express-rate-limit v6 and older, but will cause all requests to be blocked in v7" ); }, /** * Warns the user that the `draft_polli_ratelimit_headers` option is deprecated * and will be removed in the next major release. * * @param draft_polli_ratelimit_headers {any | undefined} - The now-deprecated setting that was used to enable standard headers. * * @returns {void} */ draftPolliHeaders(t) { if (t) throw new Um( "WRN_ERL_DEPRECATED_DRAFT_POLLI_HEADERS", "The draft_polli_ratelimit_headers configuration option is deprecated and has been removed in express-rate-limit v7, please set standardHeaders: 'draft-6' instead." ); }, /** * Warns the user that the `onLimitReached` option is deprecated and * will be removed in the next major release. * * @param onLimitReached {any | undefined} - The maximum number of hits per client. * * @returns {void} */ onLimitReached(t) { if (t) throw new Um( "WRN_ERL_DEPRECATED_ON_LIMIT_REACHED", "The onLimitReached configuration option is deprecated and has been removed in express-rate-limit v7." ); }, /** * Warns the user when an invalid/unsupported version of the draft spec is passed. * * @param version {any | undefined} - The version passed by the user. * * @returns {void} */ headersDraftVersion(t) { if (typeof t != "string" || // @ts-expect-error This is fine. If version is not in the array, it will just return false. !sP.includes(t)) { const e = sP.join(", "); throw new li( "ERR_ERL_HEADERS_UNSUPPORTED_DRAFT_VERSION", `standardHeaders: only the following versions of the IETF draft specification are supported: ${e}.` ); } }, /** * Warns the user when the selected headers option requires a reset time but * the store does not provide one. * * @param resetTime {Date | undefined} - The timestamp when the client's hit count will be reset. * * @returns {void} */ headersResetTime(t) { if (!t) throw new li( "ERR_ERL_HEADERS_NO_RESET", "standardHeaders: 'draft-7' requires a 'resetTime', but the store did not provide one. The 'windowMs' value will be used instead, which may cause clients to wait longer than necessary." ); }, /** * Checks the options.validate setting to ensure that only recognized * validations are enabled or disabled. * * If any unrecognized values are found, an error is logged that * includes the list of supported vaidations. */ validationsConfig() { const t = Object.keys(this).filter( (e) => !["enabled", "disable"].includes(e) ); t.push("default"); for (const e of Object.keys(this.enabled)) if (!t.includes(e)) throw new li( "ERR_ERL_UNKNOWN_VALIDATION", `options.validate.${e} is not recognized. Supported validate options are: ${t.join( ", " )}.` ); }, /** * Checks to see if the instance was created inside of a request handler, * which would prevent it from working correctly, with the default memory * store (or any other store with localKeys.) */ creationStack(t) { const { stack: e } = new Error( "express-rate-limit validation check (set options.validate.creationStack=false to disable)" ); if (e?.includes("Layer.handle [as handle_request]")) throw t.localKeys ? new li( "ERR_ERL_CREATED_IN_REQUEST_HANDLER", "express-rate-limit instance should be created at app initialization, not when responding to a request." ) : new li( "ERR_ERL_CREATED_IN_REQUEST_HANDLER", "express-rate-limit instance should *usually* be created at app initialization, not when responding to a request." ); } }, Pge = (t) => { let e; typeof t == "boolean" ? e = { default: t } : e = { default: !0, ...t }; const n = { enabled: e }; for (const [r, i] of Object.entries(Nge)) typeof i == "function" && (n[r] = (...o) => { if (e[r] ?? e.default) try { i.apply( n, o ); } catch (a) { a instanceof Um ? console.warn(a) : console.error(a); } }); return n; }, Dge = class { constructor() { this.previous = /* @__PURE__ */ new Map(), this.current = /* @__PURE__ */ new Map(), this.localKeys = !0; } /** * Method that initializes the store. * * @param options {Options} - The options used to setup the middleware. */ init(t) { this.windowMs = t.windowMs, this.interval && clearInterval(this.interval), this.interval = setInterval(() => { this.clearExpired(); }, this.windowMs), this.interval.unref && this.interval.unref(); } /** * Method to fetch a client's hit count and reset time. * * @param key {string} - The identifier for a client. * * @returns {ClientRateLimitInfo | undefined} - The number of hits and reset time for that client. * * @public */ async get(t) { return this.current.get(t) ?? this.previous.get(t); } /** * Method to increment a client's hit counter. * * @param key {string} - The identifier for a client. * * @returns {ClientRateLimitInfo} - The number of hits and reset time for that client. * * @public */ async increment(t) { const e = this.getClient(t), n = Date.now(); return e.resetTime.getTime() <= n && this.resetClient(e, n), e.totalHits++, e; } /** * Method to decrement a client's hit counter. * * @param key {string} - The identifier for a client. * * @public */ async decrement(t) { const e = this.getClient(t); e.totalHits > 0 && e.totalHits--; } /** * Method to reset a client's hit counter. * * @param key {string} - The identifier for a client. * * @public */ async resetKey(t) { this.current.delete(t), this.previous.delete(t); } /** * Method to reset everyone's hit counter. * * @public */ async resetAll() { this.current.clear(), this.previous.clear(); } /** * Method to stop the timer (if currently running) and prevent any memory * leaks. * * @public */ shutdown() { clearInterval(this.interval), this.resetAll(); } /** * Recycles a client by setting its hit count to zero, and reset time to * `windowMs` milliseconds from now. * * NOT to be confused with `#resetKey()`, which removes a client from both the * `current` and `previous` maps. * * @param client {Client} - The client to recycle. * @param now {number} - The current time, to which the `windowMs` is added to get the `resetTime` for the client. * * @return {Client} - The modified client that was passed in, to allow for chaining. */ resetClient(t, e = Date.now()) { return t.totalHits = 0, t.resetTime.setTime(e + this.windowMs), t; } /** * Retrieves or creates a client, given a key. Also ensures that the client being * returned is in the `current` map. * * @param key {string} - The key under which the client is (or is to be) stored. * * @returns {Client} - The requested client. */ getClient(t) { if (this.current.has(t)) return this.current.get(t); let e; return this.previous.has(t) ? (e = this.previous.get(t), this.previous.delete(t)) : (e = { totalHits: 0, resetTime: /* @__PURE__ */ new Date() }, this.resetClient(e)), this.current.set(t, e), e; } /** * Move current clients to previous, create a new map for current. * * This function is called every `windowMs`. */ clearExpired() { this.previous = this.current, this.current = /* @__PURE__ */ new Map(); } }, Oge = (t) => ( // Check that `incr` exists but `increment` does not - store authors might want // to keep both around for backwards compatibility. typeof t.incr == "function" && typeof t.increment != "function" ), Fge = (t) => { if (!Oge(t)) return t; const e = t; class n { async increment(i) { return new Promise((o, a) => { e.incr( i, (s, c, u) => { s && a(s), o({ totalHits: c, resetTime: u }); } ); }); } async decrement(i) { return e.decrement(i); } async resetKey(i) { return e.resetKey(i); } /* istanbul ignore next */ async resetAll() { if (typeof e.resetAll == "function") return e.resetAll(); } } return new n(); }, Mge = (t) => { const { validations: e, ...n } = t; return { ...n, validate: e.enabled }; }, Rge = (t) => { const e = {}; for (const n of Object.keys(t)) { const r = n; t[r] !== void 0 && (e[r] = t[r]); } return e; }, Bge = (t) => { const e = Rge(t), n = Pge(e?.validate ?? !0); n.validationsConfig(), n.draftPolliHeaders( // @ts-expect-error see the note above. e.draft_polli_ratelimit_headers ), n.onLimitReached(e.onLimitReached); let r = e.standardHeaders ?? !1; r === !0 && (r = "draft-6"); const i = { windowMs: 60 * 1e3, limit: t.max ?? 5, // `max` is deprecated, but support it anyways. message: "Too many requests, please try again later.", statusCode: 429, legacyHeaders: t.headers ?? !0, identifier(o, a) { let s = ""; const c = i.requestPropertyName, { limit: u } = o[c], d = i.windowMs / 1e3, p = i.windowMs / (1e3 * 60), f = i.windowMs / (1e3 * 60 * 60), m = i.windowMs / (1e3 * 60 * 60 * 24); return d < 60 ? s = `${d}sec` : p < 60 ? s = `${p}min` : f < 24 ? s = `${f}hr${f > 1 ? "s" : ""}` : s = `${m}day${m > 1 ? "s" : ""}`, `${u}-in-${s}`; }, requestPropertyName: "rateLimit", skipFailedRequests: !1, skipSuccessfulRequests: !1, requestWasSuccessful: (o, a) => a.statusCode < 400, skip: (o, a) => !1, keyGenerator(o, a) { return n.ip(o.ip), n.trustProxy(o), n.xForwardedForHeader(o), o.ip; }, async handler(o, a, s, c) { a.status(i.statusCode); const u = typeof i.message == "function" ? await i.message( o, a ) : i.message; a.writableEnded || a.send(u); }, passOnStoreError: !1, // Allow the default options to be overridden by the passed options. ...e, // `standardHeaders` is resolved into a draft version above, use that. standardHeaders: r, // Note that this field is declared after the user's options are spread in, // so that this field doesn't get overridden with an un-promisified store! store: Fge(e.store ?? new Dge()), // Print an error to the console if a few known misconfigurations are detected. validations: n }; if (typeof i.store.increment != "function" || typeof i.store.decrement != "function" || typeof i.store.resetKey != "function" || i.store.resetAll !== void 0 && typeof i.store.resetAll != "function" || i.store.init !== void 0 && typeof i.store.init != "function") throw new TypeError( "An invalid store was passed. Please ensure that the store is a class that implements the `Store` interface." ); return i; }, Uge = (t) => async (e, n, r) => { try { await Promise.resolve(t(e, n, r)).catch(r); } catch (i) { r(i); } }, Lge = (t) => { const e = Bge(t ?? {}), n = Mge(e); e.validations.creationStack(e.store), e.validations.unsharedStore(e.store), typeof e.store.init == "function" && e.store.init(n); const r = Uge( async (o, a, s) => { if (await e.skip(o, a)) { s(); return; } const u = o, d = await e.keyGenerator(o, a); let p = 0, f; try { const x = await e.store.increment(d); p = x.totalHits, f = x.resetTime; } catch (x) { if (e.passOnStoreError) { console.error( "express-rate-limit: error from store, allowing request without rate-limiting.", x ), s(); return; } throw x; } e.validations.positiveHits(p), e.validations.singleCount(o, e.store, d); const h = await (typeof e.limit == "function" ? e.limit(o, a) : e.limit); e.validations.limit(h); const y = { limit: h, used: p, remaining: Math.max(h - p, 0), resetTime: f }; if (Object.defineProperty(y, "current", { configurable: !1, enumerable: !1, value: p }), u[e.requestPropertyName] = y, e.legacyHeaders && !a.headersSent && Age(a, y), e.standardHeaders && !a.headersSent) switch (e.standardHeaders) { case "draft-6": { Ige(a, y, e.windowMs); break; } case "draft-7": { e.validations.headersResetTime(y.resetTime), Cge(a, y, e.windowMs); break; } case "draft-8": { const g = await (typeof e.identifier == "function" ? e.identifier(o, a) : e.identifier); e.validations.headersResetTime(y.resetTime), Tge(a, y, e.windowMs, g, d); break; } default: { e.validations.headersDraftVersion(e.standardHeaders); break; } } if (e.skipFailedRequests || e.skipSuccessfulRequests) { let x = !1; const g = async () => { x || (await e.store.decrement(d), x = !0); }; e.skipFailedRequests && (a.on("finish", async () => { await e.requestWasSuccessful(o, a) || await g(); }), a.on("close", async () => { a.writableEnded || await g(); }), a.on("error", async () => { await g(); })), e.skipSuccessfulRequests && a.on("finish", async () => { await e.requestWasSuccessful(o, a) && await g(); }); } if (e.validations.disable(), p > h) { (e.legacyHeaders || e.standardHeaders) && kge(a, y, e.windowMs), e.handler(o, a, s, n); return; } s(); } ), i = () => { throw new Error("The current store does not support the get/getKey method"); }; return r.resetKey = e.store.resetKey.bind(e.store), r.getKey = typeof e.store.get == "function" ? e.store.get.bind(e.store) : i, r; }, Qge = Lge; const BU = [".woff", ".woff2", ".ttf", ".otf"], jge = (t) => { try { if (!fe.existsSync(t)) return; const e = fe.readdirSync(t); for (const n of e) { const r = ve.extname(n).toLowerCase(), i = ve.basename(n, r); if (BU.includes(r) && (i === "webui" || i === "CustomFont")) try { fe.unlinkSync(ve.join(t, n)); } catch (o) { console.error(`Failed to delete old font file ${n}:`, o); } } } catch (e) { console.error("Failed to clean old font files:", e); } }, $ge = Da.diskStorage({ destination: (t, e, n) => { try { const r = ve.dirname(Ct.GetWebUIFontPathSync()); fe.mkdirSync(r, { recursive: !0 }), jge(r), n(null, r); } catch (r) { n(new Error(`创建字体目录失败:${r.message}`), ""); } }, filename: (t, e, n) => { const r = ve.extname(e.originalname).toLowerCase(); n(null, `CustomFont${r}`); } }), Gge = Da({ storage: $ge, fileFilter: (t, e, n) => { const r = ve.extname(e.originalname).toLowerCase(); if (!BU.includes(r)) { n(new Error("只支持 WOFF/WOFF2/TTF/OTF 格式的字体文件")); return; } n(null, !0); }, limits: { fileSize: 40 * 1024 * 1024 // 限制40MB } }).single("file"), qge = (t, e) => new Promise((n, r) => { Gge(t, e, (i) => i ? r(i) : n(!0)); }), zge = process.platform === "win32", lP = (t) => { try { return Buffer.from(t, "binary").toString("utf8"); } catch { return t; } }, Hge = (t) => Da.diskStorage({ destination: (e, n, r) => { try { const i = lP(n.originalname); if (!t) return r(new Error("上传路径不能为空"), ""); if (zge && t === "\\") return r(new Error("根目录不允许上传文件"), ""); if (i.includes("/") || i.includes("\\")) { const o = ve.join(t, ve.dirname(i)); fe.mkdirSync(o, { recursive: !0 }), r(null, o); } else r(null, t); } catch (i) { r(i, ""); } }, filename: (e, n, r) => { try { const i = lP(n.originalname), o = ve.basename(i), a = ve.join(t, i); if (fe.existsSync(a)) { const s = ve.extname(o), c = ve.basename(o, s); r(null, `${c}-${Xo()}${s}`); } else r(null, o); } catch (i) { r(i, ""); } } }), Wge = (t) => Da({ storage: Hge(t), limits: { fileSize: 104857600, // 100MB 文件大小限制 files: 20, // 最多同时上传20个文件 fieldSize: 1048576, // 1MB 字段大小限制 fields: 10 // 最多10个字段 } }).array("files"), Kge = (t, e) => { const n = t.query.path || ""; return new Promise((r, i) => { Wge(n)(t, e, (o) => o ? o.code === "LIMIT_FILE_SIZE" ? i(new Error("文件大小超过限制(最大100MB)")) : o.code === "LIMIT_FILE_COUNT" ? i(new Error("文件数量超过限制(最多20个文件)")) : o.code === "LIMIT_FIELD_VALUE" ? i(new Error("字段值大小超过限制")) : o.code === "LIMIT_FIELD_COUNT" ? i(new Error("字段数量超过限制")) : i(o) : r(!0)); }); }, zp = Ln.platform() === "win32", f3 = (t) => Array.isArray(t) ? String(t[0] || "") : String(t || ""), Vge = async () => { if (!zp) return ["/"]; const t = []; for (let e = 65; e <= 90; e++) { const n = String.fromCharCode(e); try { await Lt.access(`${n}:\\`), t.push(`${n}:`); } catch { continue; } } return t.length > 0 ? t : ["C:"]; }, Lr = (t) => { if (!t) return zp ? process.env.USERPROFILE || "C:\\" : "/"; const e = t.replace(/[\x01-\x1f\x7f]/g, ""); if (zp && /^[A-Z]:[\\/]*$/i.test(e)) return e.slice(0, 2) + "\\"; if (dP(e)) throw new Error("Invalid path: path traversal detected"); const n = ve.resolve(e); if (dP(n)) throw new Error("Invalid path: path traversal detected after normalization"); return n.replace(/[\\/]+/g, ve.sep); }, dP = (t) => { let e = t; try { e = decodeURIComponent(t); } catch { } const n = e.replace(/\\/g, "/"); return [ /\.\.\//, // ../ 模式 /\/\.\./, // /.. 模式 /^\.\./, // 以.. 开头 /\.\.$/, // 以.. 结尾 /\.\.\\/, // ..\ 模式(Windows) /\\\.\./, // \.. 模式(Windows) /%2e%2e/i, // URL编码的.. /%252e%252e/i, // 双重URL编码的.. // eslint-disable-next-line no-control-regex /\.\.\x00/, // null字节攻击 /\0/ // null字节 ].some((i) => i.test(n)); }, Yge = /* @__PURE__ */ new Set(["pagefile.sys", "swapfile.sys", "hiberfil.sys", "System Volume Information"]), UU = (t) => { if (!t.includes("webui.json")) return !1; const e = ve.resolve(lt.configPath, "webui.json").replace(/\\/g, "/"); return ve.resolve(t).replace(/\\/g, "/") === e; }, Jge = (t) => { try { const e = JSON.parse(t); return e.token && (e.token = "******"), JSON.stringify(e, null, 4); } catch { return t; } }, LU = async (t, e) => { try { return (await Lt.stat(t)).isDirectory() === e; } catch { return !1; } }, Xge = async (t, e) => { try { const n = f3(t.query.path) || (zp ? process.env.USERPROFILE || "C:\\" : "/"); let r; try { r = Lr(n); } catch { return ne(e, "无效的文件路径"); } const i = t.query.onlyDirectory === "true"; if (zp && (!n || n === "/" || n === "\\")) { const s = await Vge(), c = await Promise.all( s.map(async (u) => { try { const d = await Lt.stat(`${u}\\`); return { name: u, isDirectory: !0, size: 0, mtime: d.mtime }; } catch { return { name: u, isDirectory: !0, size: 0, mtime: /* @__PURE__ */ new Date() }; } }) ); return me(e, c); } const o = await Lt.readdir(r); let a = []; for (const s of o) if (!Yge.has(s)) try { const c = ve.join(r, s), u = await Lt.stat(c); a.push({ name: s, isDirectory: u.isDirectory(), size: u.size, mtime: u.mtime }); } catch { continue; } return i && (a = a.filter((s) => s.isDirectory)), me(e, a); } catch (n) { return console.error("读取目录失败:", n), ne(e, "读取目录失败"); } }, Zge = async (t, e) => { try { const { path: n } = t.body; let r; try { r = Lr(n); } catch { return ne(e, "无效的文件路径"); } return ve.isAbsolute(r) ? await LU(r, !0) ? ne(e, "同名目录已存在") : (await Lt.mkdir(r, { recursive: !0 }), me(e, !0)) : ne(e, "路径必须是绝对路径"); } catch { return ne(e, "创建目录失败"); } }, e0e = async (t, e) => { try { const { path: n } = t.body; let r; try { r = Lr(n); } catch { return ne(e, "无效的文件路径"); } return ve.isAbsolute(r) ? ((await Lt.stat(r)).isDirectory() ? await Lt.rm(r, { recursive: !0 }) : await Lt.unlink(r), me(e, !0)) : ne(e, "路径必须是绝对路径"); } catch { return ne(e, "删除失败"); } }, t0e = async (t, e) => { try { const { paths: n } = t.body; for (const r of n) { let i; try { i = Lr(r); } catch { return ne(e, "无效的文件路径"); } if (!ve.isAbsolute(i)) return ne(e, "路径必须是绝对路径"); (await Lt.stat(i)).isDirectory() ? await Lt.rm(i, { recursive: !0 }) : await Lt.unlink(i); } return me(e, !0); } catch { return ne(e, "批量删除失败"); } }, n0e = async (t, e) => { try { let n; try { n = Lr(f3(t.query.path)); } catch { return ne(e, "无效的文件路径"); } if (!ve.isAbsolute(n)) return ne(e, "路径必须是绝对路径"); let r = await Lt.readFile(n, "utf-8"); return UU(n) && (r = Jge(r)), me(e, r); } catch { return ne(e, "读取文件失败"); } }, r0e = async (t, e) => { try { const { path: n, content: r } = t.body; let i; try { i = Lr(n); } catch { return ne(e, "无效的文件路径"); } if (!ve.isAbsolute(i)) return ne(e, "路径必须是绝对路径"); let o = r; if (UU(i)) try { const a = JSON.parse(r), s = Na(); s && (a.token = s, o = JSON.stringify(a, null, 4)); } catch { return ne(e, "写入的WebUI配置文件内容格式错误,必须是合法的JSON"); } return await Lt.writeFile(i, o, "utf-8"), me(e, !0); } catch { return ne(e, "写入文件失败"); } }, i0e = async (t, e) => { try { const { path: n } = t.body; let r; try { r = Lr(n); } catch { return ne(e, "无效的文件路径"); } return ve.isAbsolute(r) ? await LU(r, !1) ? ne(e, "同名文件已存在") : (await Lt.writeFile(r, "", "utf-8"), me(e, !0)) : ne(e, "路径必须是绝对路径"); } catch { return ne(e, "创建文件失败"); } }, o0e = async (t, e) => { try { const { oldPath: n, newPath: r } = t.body; let i, o; try { i = Lr(n), o = Lr(r); } catch { return ne(e, "无效的文件路径"); } return !ve.isAbsolute(i) || !ve.isAbsolute(o) ? ne(e, "路径必须是绝对路径") : (await Lt.rename(i, o), me(e, !0)); } catch { return ne(e, "重命名失败"); } }, a0e = async (t, e) => { try { const { sourcePath: n, targetPath: r } = t.body; let i, o; try { i = Lr(n), o = Lr(r); } catch { return ne(e, "无效的文件路径"); } return !ve.isAbsolute(i) || !ve.isAbsolute(o) ? ne(e, "路径必须是绝对路径") : (await Lt.rename(i, o), me(e, !0)); } catch { return ne(e, "移动失败"); } }, s0e = async (t, e) => { try { const { items: n } = t.body; for (const { sourcePath: r, targetPath: i } of n) { let o, a; try { o = Lr(r), a = Lr(i); } catch { return ne(e, "无效的文件路径"); } if (!ve.isAbsolute(o) || !ve.isAbsolute(a)) return ne(e, "路径必须是绝对路径"); await Lt.rename(o, a); } return me(e, !0); } catch { return ne(e, "批量移动失败"); } }, c0e = async (t, e) => { try { let n; try { n = Lr(f3(t.query.path)); } catch { return ne(e, "无效的文件路径"); } if (!n) return ne(e, "参数错误"); if (!ve.isAbsolute(n)) return ne(e, "路径必须是绝对路径"); const r = await Lt.stat(n); e.setHeader("Content-Type", "application/octet-stream"); let i = ve.basename(n); if (r.isDirectory()) { i = ve.basename(n) + ".zip", e.setHeader("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(i)}`); const a = new p7(); bl.zip.compressDir(n, a).catch((s) => { console.error("压缩目录失败:", s), e.end(); }), a.pipe(e); return; } e.setHeader("Content-Length", r.size), e.setHeader("Content-Disposition", `attachment; filename*=UTF-8''${encodeURIComponent(i)}`), fe.createReadStream(n).pipe(e); } catch { return ne(e, "下载失败"); } }, u0e = async (t, e) => { try { const { paths: n } = t.body; if (!n || !Array.isArray(n) || n.length === 0) return ne(e, "参数错误"); e.setHeader("Content-Type", "application/octet-stream"), e.setHeader("Content-Disposition", "attachment; filename=files.zip"); const r = new bl.zip.Stream(); for (const i of n) { let o; try { o = Lr(i); } catch { return ne(e, "无效的文件路径"); } if (!ve.isAbsolute(o)) return ne(e, "路径必须是绝对路径"); if ((await Lt.stat(o)).isDirectory()) r.addEntry(o, { relativePath: "" }); else { const s = ve.basename(o); r.addEntry(o, { relativePath: s }); } } r.pipe(e), e.on("finish", () => { r.destroy(); }); } catch { return ne(e, "下载失败"); } }, l0e = async (t, e) => { try { return await Kge(t, e), me(e, !0, "文件上传成功", !0); } catch (n) { let r = "文件上传失败"; if (n instanceof Da.MulterError) switch (n.code) { case "LIMIT_FILE_SIZE": r = "文件大小超过限制(40MB)"; break; case "LIMIT_UNEXPECTED_FILE": r = "无效的文件上传字段"; break; default: r = `上传错误: ${n.message}`; } else n instanceof Error && (r = n.message); return ne(e, r, !0); } }, d0e = async (t, e) => { try { return await qge(t, e), me(e, !0, "字体文件上传成功", !0); } catch (n) { let r = "字体文件上传失败"; if (n instanceof Da.MulterError) switch (n.code) { case "LIMIT_FILE_SIZE": r = "字体文件大小超过限制(40MB)"; break; case "LIMIT_UNEXPECTED_FILE": r = "无效的文件上传字段"; break; default: r = `上传错误: ${n.message}`; } else n instanceof Error && (r = n.message); return ne(e, r, !0); } }, p0e = async (t, e) => { try { const n = await Ct.GetWebUIFontPath(); return !await Ct.CheckWebUIFontExist() || !n || await Lt.unlink(n), me(e, !0); } catch { return ne(e, "删除字体文件失败"); } }, f0e = async (t, e) => { try { const n = await Ct.CheckWebUIFontExist(); return me(e, n); } catch { return ne(e, "检查字体文件失败"); } }, cr = Tr(), h0e = Qge({ windowMs: 60 * 1e3, // 1分钟内 max: 60, // 最大60个请求 validate: { xForwardedForHeader: !1 } }); cr.use(h0e); cr.get("/list", Xge); cr.post("/mkdir", Zge); cr.post("/delete", e0e); cr.get("/read", n0e); cr.post("/write", r0e); cr.post("/create", i0e); cr.post("/batchDelete", t0e); cr.post("/rename", o0e); cr.post("/move", a0e); cr.post("/batchMove", s0e); cr.post("/download", c0e); cr.post("/batchDownload", u0e); cr.post("/upload", l0e); cr.post("/font/upload/webui", d0e); cr.post("/font/delete/webui", p0e); cr.get("/font/exists/webui", f0e); const m0e = async (t, e) => { try { const n = await Ct.GetWebUIConfig(); return me(e, { host: n.host, port: n.port, loginRate: n.loginRate, disableWebUI: n.disableWebUI, accessControlMode: n.accessControlMode || "none", ipWhitelist: n.ipWhitelist || [], ipBlacklist: n.ipBlacklist || [], enableXForwardedFor: n.enableXForwardedFor || !1 }); } catch (n) { const r = n.message; return ne(e, `获取WebUI配置失败: ${r}`); } }, g0e = async (t, e) => { try { const n = await Ct.GetDisableWebUI(); return me(e, n); } catch (n) { const r = n.message; return ne(e, `获取WebUI禁用状态失败: ${r}`); } }, y0e = async (t, e) => { try { const { disable: n } = t.body; return typeof n != "boolean" ? ne(e, "disable参数必须是布尔值") : (await Ct.UpdateDisableWebUI(n), me(e, null)); } catch (n) { const r = n.message; return ne(e, `更新WebUI禁用状态失败: ${r}`); } }, b0e = async (t, e) => { try { const n = await Ct.GetWebUIConfig(); let r; if (n.enableXForwardedFor) { const o = t.headers["x-forwarded-for"]; typeof o == "string" ? r = o.split(",")[0]?.trim() || "" : Array.isArray(o) && o.length > 0 ? r = o[0] || "" : r = t.ip || t.socket.remoteAddress || ""; } else r = t.ip || t.socket.remoteAddress || ""; let i = r; if (r.startsWith("::ffff:")) { const o = r.substring(7); /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(o) && (i = o); } return me(e, { ip: i }); } catch (n) { const r = n.message; return ne(e, `获取客户端IP失败: ${r}`); } }, v0e = async (t, e) => { try { const { host: n, port: r, loginRate: i, disableWebUI: o, accessControlMode: a, ipWhitelist: s, ipBlacklist: c, enableXForwardedFor: u } = t.body, d = {}; if (n !== void 0) { if (er(n)) return ne(e, "host不能为空"); d.host = n; } if (r !== void 0) { if (!Number.isInteger(r) || r < 1 || r > 65535) return ne(e, "port必须是1-65535之间的整数"); d.port = r; } if (i !== void 0) { if (!Number.isInteger(i) || i < 1) return ne(e, "loginRate必须是大于0的整数"); d.loginRate = i; } if (o !== void 0) { if (typeof o != "boolean") return ne(e, "disableWebUI必须是布尔值"); d.disableWebUI = o; } if (a !== void 0) { if (!["none", "whitelist", "blacklist"].includes(a)) return ne(e, "accessControlMode必须是none、whitelist或blacklist"); d.accessControlMode = a; } if (s !== void 0) { if (!Array.isArray(s)) return ne(e, "ipWhitelist必须是数组"); d.ipWhitelist = s; } if (c !== void 0) { if (!Array.isArray(c)) return ne(e, "ipBlacklist必须是数组"); d.ipBlacklist = c; } if (u !== void 0) { if (typeof u != "boolean") return ne(e, "enableXForwardedFor必须是布尔值"); d.enableXForwardedFor = u; } return await Ct.UpdateWebUIConfig(d), me(e, null); } catch (n) { const r = n.message; return ne(e, `更新WebUI配置失败: ${r}`); } }, x0e = async (t, e) => { try { const n = En(lt.configPath, "cert.pem"), r = En(lt.configPath, "key.pem"), i = ir(n), o = ir(r); let a = "", s = ""; return i && (a = await Fu.readFile(n, "utf-8")), o && (s = await Fu.readFile(r, "utf-8")), me(e, { enabled: i && o, certExists: i, keyExists: o, certContent: a, keyContent: s }); } catch (n) { const r = n.message; return ne(e, `获取SSL状态失败: ${r}`); } }, w0e = async (t, e) => { try { const { cert: n, key: r } = t.body; if (er(n) || er(r)) return ne(e, "cert和key内容不能为空"); if (!n.includes("-----BEGIN CERTIFICATE-----") || !n.includes("-----END CERTIFICATE-----")) return ne(e, "cert格式不正确,应为PEM格式的证书"); if (!r.includes("-----BEGIN") || !r.includes("KEY-----")) return ne(e, "key格式不正确,应为PEM格式的私钥"); const i = En(lt.configPath, "cert.pem"), o = En(lt.configPath, "key.pem"); return await Fu.writeFile(i, n, "utf-8"), await Fu.writeFile(o, r, "utf-8"), me(e, { message: "SSL证书保存成功,重启后生效" }); } catch (n) { const r = n.message; return ne(e, `保存SSL证书失败: ${r}`); } }, S0e = async (t, e) => { try { const n = En(lt.configPath, "cert.pem"), r = En(lt.configPath, "key.pem"); return ir(n) && await Fu.unlink(n), ir(r) && await Fu.unlink(r), me(e, { message: "SSL证书已删除,重启后生效" }); } catch (n) { const r = n.message; return ne(e, `删除SSL证书失败: ${r}`); } }, Ya = Tr(); Ya.get("/GetConfig", m0e); Ya.post("/UpdateConfig", v0e); Ya.get("/GetDisableWebUI", g0e); Ya.post("/UpdateDisableWebUI", y0e); Ya.get("/GetClientIP", b0e); Ya.get("/GetSSLStatus", x0e); Ya.post("/UploadSSLCert", w0e); Ya.post("/DeleteSSLCert", S0e); const _0e = [ "NapCatWinBootMain.exe", "NapCatWinBootHook.dll", "quickLoginExample.bat" ], E0e = /* @__PURE__ */ new Set([ nt.normalize("config/napcat.json") ]); function QU(t, e = t) { const n = [], r = Ie.readdirSync(t); for (const i of r) { const o = nt.join(t, i), a = nt.relative(e, o), s = Ie.lstatSync(o); s.isSymbolicLink() || (s.isDirectory() ? n.push(...QU(o, e)) : s.isFile() && n.push({ sourcePath: o, relativePath: a })); } return n; } async function jU(t, e) { Wt?.log("[SnowCat Update] Starting download from:", t); const n = Ie.createWriteStream(e); return new Promise((r, i) => { P2.get(t, { headers: { "User-Agent": "NapCat-WebUI" } }, (a) => { if (Wt?.log("[SnowCat Update] Response status:", a.statusCode), Wt?.log("[SnowCat Update] Content-Type:", a.headers["content-type"]), a.statusCode === 302 || a.statusCode === 301) { Wt?.log("[SnowCat Update] Following redirect to:", a.headers.location), n.close(), Ie.unlinkSync(e), jU(a.headers.location, e).then(r).catch(i); return; } if (a.statusCode !== 200) { n.close(), Ie.unlinkSync(e), i(new Error(`HTTP ${a.statusCode}: ${a.statusMessage}`)); return; } a.pipe(n), n.on("finish", () => { n.close(), Wt?.log("[SnowCat Update] Download completed"), r(); }); }).on("error", (a) => { Wt?.logError("[SnowCat Update] Download error:", a), n.close(), Ie.unlink(e, () => { }), i(a); }); }); } const A0e = async (t, e) => { try { const { targetVersion: n, force: r, mirror: i } = t.body, o = de.getWorkingEnv() === Z0.Framework ? "NapCat.Framework.zip" : "NapCat.Shell.zip", a = n || "latest"; Wt?.log(`[SnowCat Update] Target version: ${a}`); const s = a.startsWith("action-"); let c, u; if (s) { const x = parseInt(a.replace("action-", "")); if (isNaN(x)) throw new Error(`Invalid action version format: ${a}`); Wt?.log(`[SnowCat Update] Downloading action artifact from run: ${x}`); const g = o.replace(".zip", ""), b = `https://nightly.link/DandanLLab/SnowCatQQ/actions/runs/${x}/${g}.zip`; u = a, Wt?.log(`[SnowCat Update] Action artifact URL: ${b}`); try { c = await wS(b, { validateContent: !0, minFileSize: 1024 * 1024, timeout: 1e4, customMirror: i }), Wt?.log(`[SnowCat Update] Using download URL: ${c}`); } catch { Wt?.logWarn("[SnowCat Update] All nightly.link mirrors failed, using original URL"), c = b; } } else { const x = await y$("DandanLLab", "SnowCatQQ", a, { assetNames: [o, "NapCat.Framework.zip", "NapCat.Shell.zip"], fetchChangelog: !1, // 不需要 changelog,避免 API 调用 mirror: i }), g = x.assets.find((b) => b.name === o); if (!g) throw new Error(`未找到${o}文件`); u = x.tag_name, c = await wS(g.browser_download_url, { validateContent: !0, // 验证 Content-Type 和状态码 minFileSize: 1024 * 1024, // 最小 1MB,确保不是错误页面 timeout: 1e4, // 10秒超时 customMirror: i }); } const d = de.GetNapCatVersion(); if (Wt?.log(`[SnowCat Update] Current version: ${d}, Target version: ${u}`), !r && d && !s) { const x = (Y) => { const H = Y.match(/^v?(\d+)\.(\d+)\.(\d+)/); return H ? [parseInt(H[1] || "0"), parseInt(H[2] || "0"), parseInt(H[3] || "0")] : [0, 0, 0]; }, [g, b, S] = x(d), [E, T, U] = x(u); (E < g || E === g && T < b || E === g && T === b && U < S) && Wt?.log(`[SnowCat Update] Downgrade from ${d} to ${u}, force=${r}`); } Wt?.log(`[SnowCat Update] Updating to version: ${u}`); const p = nt.join(lt.binaryPath, "./temp"); Ie.existsSync(p) || Ie.mkdirSync(p, { recursive: !0 }), Wt?.log(`[SnowCat Update] Using download URL: ${c}`); const f = nt.join(p, "snowcat-latest.zip"); Wt?.log("[SnowCat Update] Saving to:", f), await jU(c, f); const m = Ie.statSync(f); Wt?.log("[SnowCat Update] Downloaded file size:", m.size, "bytes"); const h = nt.join(p, "snowcat-extract"); Wt?.log("[SnowCat Update] Extracting to:", h), await bl.zip.uncompress(f, h); const y = h; try { const x = QU(y), g = [], b = nt.resolve(lt.binaryPath); for (const E of x) { const T = nt.resolve(lt.binaryPath, E.relativePath); if (!T.startsWith(b + nt.sep)) { Wt?.logWarn(`[SnowCat Update] Skipping suspicious path: ${E.relativePath}`); continue; } const U = nt.normalize(E.relativePath); if (_0e.includes(nt.basename(E.relativePath))) { Wt?.log(`[SnowCat Update] Skipping update for ${E.relativePath}`); continue; } if (E0e.has(U) && Ie.existsSync(T)) { Wt?.log(`[SnowCat Update] Preserving existing user config: ${E.relativePath}`); continue; } try { const q = nt.dirname(T); Ie.existsSync(q) || Ie.mkdirSync(q, { recursive: !0 }), Ie.existsSync(T) && Ie.unlinkSync(T), Ie.copyFileSync(E.sourcePath, T); } catch (q) { Wt?.logError(`[SnowCat Update] Failed to update ${T}, will retry on next startup:`, q), g.push({ sourcePath: E.sourcePath, targetPath: T }); } } if (g.length > 0) { const E = { version: u, updateTime: (/* @__PURE__ */ new Date()).toISOString(), files: g, changelog: "" }, T = nt.join(lt.configPath, "snowcat-update.json"); Ie.writeFileSync(T, JSON.stringify(E, null, 2)), Wt?.log(`[SnowCat Update] Update config saved for ${g.length} failed files: ${T}`); } const S = g.length > 0 ? `更新完成,重启应用以应用剩余${g.length}个文件的更新` : "更新完成"; me(e, { status: "completed", message: S, newVersion: u, failedFilesCount: g.length }); } catch (x) { Wt?.logError("[SnowCat Update] 更新失败:", x), ne(e, "更新失败: " + (x instanceof Error ? x.message : "未知错误")); } } catch (n) { Wt?.logError("[SnowCat Update] 更新失败:", n), ne(e, "更新失败: " + n.message); } }; async function I0e(t, e) { const n = nt.join(t.configPath, "snowcat-update.json"); if (Ie.existsSync(n)) try { e.log("[SnowCat Update] Applying pending updates..."); const r = JSON.parse(Ie.readFileSync(n, "utf8")), i = []; for (const o of r.files) try { if (!Ie.existsSync(o.sourcePath)) { e.logWarn(`[SnowCat Update] Source file not found: ${o.sourcePath}`); continue; } const a = nt.dirname(o.targetPath); Ie.existsSync(a) || Ie.mkdirSync(a, { recursive: !0 }), Ie.existsSync(o.targetPath) && Ie.unlinkSync(o.targetPath), Ie.copyFileSync(o.sourcePath, o.targetPath), e.log(`[SnowCat Update] Updated ${nt.basename(o.targetPath)} on startup`); } catch (a) { e.logError(`[SnowCat Update] Failed to update ${o.targetPath} on startup:`, a), i.push(o); } if (i.length > 0) { const o = { ...r, files: i }; Ie.writeFileSync(n, JSON.stringify(o, null, 2)), e.log(`[SnowCat Update] ${i.length} files still pending update`); } else Ie.unlinkSync(n), e.log("[SnowCat Update] All pending updates applied successfully"); } catch (r) { e.logError("[SnowCat Update] Failed to apply pending updates:", r); } } const h3 = Tr(); h3.post("/update", A0e); var ll = /* @__PURE__ */ ((t) => (t.META = "meta_event", t.REQUEST = "request", t.NOTICE = "notice", t.MESSAGE = "message", t.MESSAGE_SENT = "message_sent", t))(ll || {}); class m3 { time = Math.floor(Date.now() / 1e3); self_id; constructor(e) { this.self_id = parseInt(e.selfInfo.uin); } } class $U extends m3 { post_type = ll.META; } var qf = /* @__PURE__ */ ((t) => (t.ENABLE = "enable", t.DISABLE = "disable", t.CONNECT = "connect", t))(qf || {}); class J1 extends $U { meta_event_type = "lifecycle"; sub_type; constructor(e, n) { super(e), this.sub_type = n; } } class eu { name; isEnable = !1; config; logger; core; obContext; actions; constructor(e, n, r, i, o) { this.name = e, this.config = structuredClone(n), this.core = r, this.obContext = i, this.actions = o, this.logger = r.context.logger; } get isActive() { return this.isEnable; } } class pP extends eu { async onEvent(e) { this.emitEventAsync(e).catch((n) => this.logger.logError("[OneBot] [Http Client] 新消息事件HTTP上报返回快速操作失败", n)); } async emitEventAsync(e) { if (!this.isEnable) return; const n = { "Content-Type": "application/json", "x-self-id": this.core.selfInfo.uin }, r = JSON.stringify(e); if (this.config.token) { const a = HL("sha1", this.config.token); a.update(r), n["x-signature"] = "sha1=" + a.digest("hex"); } const i = await ht.HttpGetText(this.config.url, "POST", r, n), o = i ? Gi.parse(i) : {}; await this.obContext.apis.QuickActionApi.handleQuickOperation(e, o); } open() { this.isEnable = !0; } close() { this.isEnable = !1; } async reload(e) { const n = this.isEnable, r = this.config.url; return this.config = e, e.enable && !n ? (this.open(), Gt.NetWorkOpen) : !e.enable && n ? (this.close(), Gt.NetWorkClose) : r !== e.url ? Gt.NetWorkReload : Gt.Normal; } } class Jg extends $U { meta_event_type = "heartbeat"; status; interval; constructor(e, n, r, i) { super(e), this.interval = n, this.status = { online: r, good: i }; } } class fP extends eu { connection = null; heartbeatRef = null; firstConnectDelayed = !1; get isActive() { return this.isEnable && !!this.connection && this.connection.readyState === Er.OPEN; } async onEvent(e) { this.connection && this.connection.readyState === Er.OPEN && this.connection.send(JSON.stringify(e)); } async open() { if (!this.connection) { this.config.heartInterval > 0 && (this.heartbeatRef = setInterval(() => { this.connection && this.connection.readyState === Er.OPEN && this.connection.send(JSON.stringify(new Jg(this.core, this.config.heartInterval, this.core.selfInfo.online ?? !0, !0))); }, this.config.heartInterval)), this.isEnable = !0; try { await this.tryConnect(); } catch (e) { this.logger.logError("[OneBot] [WebSocket Client] TryConnect Error , info -> ", e); } } } close() { if (!this.isEnable) { this.logger.logDebug("Cannot close a closed WebSocket connection"); return; } this.isEnable = !1, this.connection && (this.connection.close(), this.connection = null), this.heartbeatRef && (clearInterval(this.heartbeatRef), this.heartbeatRef = null); } async checkStateAndReply(e) { return new Promise((n, r) => { this.connection && this.connection.readyState === Er.OPEN ? (this.connection.send(JSON.stringify(e)), n()) : r(new Error("WebSocket is not open")); }); } async tryConnect() { if (!this.connection && this.isEnable) { let e = !1; if (!this.firstConnectDelayed && (this.firstConnectDelayed = !0, await new Promise((r) => setTimeout(r, 3e3)), !this.isEnable)) return; const n = { maxPayload: 50 * 1024 * 1024, // 50 MB handshakeTimeout: 2e3, perMessageDeflate: !1, headers: { "X-Self-ID": this.core.selfInfo.uin, Authorization: `Bearer ${this.config.token}`, "x-client-role": "Universal", // 为koishi adpter适配 "User-Agent": "OneBot/11" } }; this.config.verifyCertificate !== void 0 && (n.rejectUnauthorized = this.config.verifyCertificate), this.connection = new Er(this.config.url, n), this.connection.on("pong", () => { }), this.connection.on("open", () => { try { this.connectEvent(this.core).catch((r) => this.logger.logError("[OneBot] [WebSocket Client] 发送连接生命周期失败", r)); } catch (r) { this.logger.logError("[OneBot] [WebSocket Client] 发送连接生命周期失败", r); } }), this.connection.on("message", (r) => { this.handleMessage(r); }), this.connection.once("close", () => { e || (this.logger.logError(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接意外关闭`), this.logger.logError(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1e3)} 秒后尝试重新连接`), this.isEnable && (this.connection = null, setTimeout(() => this.tryConnect(), this.config.reconnectInterval))); }), this.connection.on("error", (r) => { e = !0, this.logger.logError(`[OneBot] [WebSocket Client] 反向WebSocket (${this.config.url}) 连接错误`, r), this.logger.logError(`[OneBot] [WebSocket Client] 在 ${Math.floor(this.config.reconnectInterval / 1e3)} 秒后尝试重新连接`), this.isEnable && (this.connection = null, setTimeout(() => this.tryConnect(), this.config.reconnectInterval)); }); } } async connectEvent(e) { try { await this.checkStateAndReply(new J1(e, qf.CONNECT)); } catch (n) { this.logger.logError("[OneBot] [WebSocket Client] 发送生命周期失败", n); } } async handleMessage(e) { let n = { action: re.Unknown, params: {} }, r; try { n = Gi.parse(e.toString()), r = n.echo, this.logger.logDebug("[OneBot] [WebSocket Client] 收到正向Websocket消息", n); } catch { await this.checkStateAndReply(jt.error("json解析失败,请检查数据格式", 1400, r)); return; } n.params = n?.params ? n.params : {}; const i = this.actions.get(n.action); if (!i) { this.logger.logError("[OneBot] [WebSocket Client] 发生错误", "不支持的Api " + n.action), await this.checkStateAndReply(jt.error("不支持的Api " + n.action, 1404, r)); return; } const o = await i.websocketHandle(n.params, r ?? "", this.name, this.config, { send: async (a) => { await this.checkStateAndReply({ ...jt.ok(a, r ?? "", !0) }); } }); await this.checkStateAndReply({ ...o }); } async reload(e) { const n = this.isEnable, r = this.config.url, i = this.config.heartInterval; return this.config = e, e.enable && !n ? (this.open(), Gt.NetWorkOpen) : !e.enable && n ? (this.close(), Gt.NetWorkClose) : r !== e.url ? (this.close(), e.enable && this.open(), Gt.NetWorkReload) : i !== e.heartInterval ? (this.heartbeatRef && (clearInterval(this.heartbeatRef), this.heartbeatRef = null), e.heartInterval > 0 && this.isEnable && (this.heartbeatRef = setInterval(() => { this.connection && this.connection.readyState === Er.OPEN && this.connection.send(JSON.stringify(new Jg(this.core, e.heartInterval, this.core.selfInfo.online ?? !0, !0))); }, e.heartInterval)), Gt.NetWorkReload) : Gt.Normal; } } var Mw = { exports: {} }, sm = { exports: {} }; /*! * vary * Copyright(c) 2014-2017 Douglas Christopher Wilson * MIT Licensed */ var hP; function GU() { if (hP) return sm.exports; hP = 1, sm.exports = r, sm.exports.append = e; var t = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/; function e(i, o) { if (typeof i != "string") throw new TypeError("header argument is required"); if (!o) throw new TypeError("field argument is required"); for (var a = Array.isArray(o) ? o : n(String(o)), s = 0; s < a.length; s++) if (!t.test(a[s])) throw new TypeError("field argument contains an invalid header name"); if (i === "*") return i; var c = i, u = n(i.toLowerCase()); if (a.indexOf("*") !== -1 || u.indexOf("*") !== -1) return "*"; for (var d = 0; d < a.length; d++) { var p = a[d].toLowerCase(); u.indexOf(p) === -1 && (u.push(p), c = c ? c + ", " + a[d] : a[d]); } return c; } function n(i) { for (var o = 0, a = [], s = 0, c = 0, u = i.length; c < u; c++) switch (i.charCodeAt(c)) { case 32: s === o && (s = o = c + 1); break; case 44: a.push(i.substring(s, o)), s = o = c + 1; break; default: o = c + 1; break; } return a.push(i.substring(s, o)), a; } function r(i, o) { if (!i || !i.getHeader || !i.setHeader) throw new TypeError("res argument is required"); var a = i.getHeader("Vary") || "", s = Array.isArray(a) ? a.join(", ") : String(a); (a = e(s, o)) && i.setHeader("Vary", a); } return sm.exports; } var mP; function C0e() { return mP || (mP = 1, (function() { var t = fB(), e = GU(), n = { origin: "*", methods: "GET,HEAD,PUT,PATCH,POST,DELETE", preflightContinue: !1, optionsSuccessStatus: 204 }; function r(h) { return typeof h == "string" || h instanceof String; } function i(h, y) { if (Array.isArray(y)) { for (var x = 0; x < y.length; ++x) if (i(h, y[x])) return !0; return !1; } else return r(y) ? h === y : y instanceof RegExp ? y.test(h) : !!y; } function o(h, y) { var x = y.headers.origin, g = [], b; return !h.origin || h.origin === "*" ? g.push([{ key: "Access-Control-Allow-Origin", value: "*" }]) : r(h.origin) ? (g.push([{ key: "Access-Control-Allow-Origin", value: h.origin }]), g.push([{ key: "Vary", value: "Origin" }])) : (b = i(x, h.origin), g.push([{ key: "Access-Control-Allow-Origin", value: b ? x : !1 }]), g.push([{ key: "Vary", value: "Origin" }])), g; } function a(h) { var y = h.methods; return y.join && (y = h.methods.join(",")), { key: "Access-Control-Allow-Methods", value: y }; } function s(h) { return h.credentials === !0 ? { key: "Access-Control-Allow-Credentials", value: "true" } : null; } function c(h, y) { var x = h.allowedHeaders || h.headers, g = []; return x ? x.join && (x = x.join(",")) : (x = y.headers["access-control-request-headers"], g.push([{ key: "Vary", value: "Access-Control-Request-Headers" }])), x && x.length && g.push([{ key: "Access-Control-Allow-Headers", value: x }]), g; } function u(h) { var y = h.exposedHeaders; if (y) y.join && (y = y.join(",")); else return null; return y && y.length ? { key: "Access-Control-Expose-Headers", value: y } : null; } function d(h) { var y = (typeof h.maxAge == "number" || h.maxAge) && h.maxAge.toString(); return y && y.length ? { key: "Access-Control-Max-Age", value: y } : null; } function p(h, y) { for (var x = 0, g = h.length; x < g; x++) { var b = h[x]; b && (Array.isArray(b) ? p(b, y) : b.key === "Vary" && b.value ? e(y, b.value) : b.value && y.setHeader(b.key, b.value)); } } function f(h, y, x, g) { var b = [], S = y.method && y.method.toUpperCase && y.method.toUpperCase(); S === "OPTIONS" ? (b.push(o(h, y)), b.push(s(h)), b.push(a(h)), b.push(c(h, y)), b.push(d(h)), b.push(u(h)), p(b, x), h.preflightContinue ? g() : (x.statusCode = h.optionsSuccessStatus, x.setHeader("Content-Length", "0"), x.end())) : (b.push(o(h, y)), b.push(s(h)), b.push(u(h)), p(b, x), g()); } function m(h) { var y = null; return typeof h == "function" ? y = h : y = function(x, g) { g(null, h); }, function(g, b, S) { y(g, function(E, T) { if (E) S(E); else { var U = t({}, n, T), q = null; U.origin && typeof U.origin == "function" ? q = U.origin : U.origin && (q = function(Y, H) { H(null, U.origin); }), q ? q(g.headers.origin, function(Y, H) { Y || !H ? S(Y) : (U.origin = H, f(U, g, b, S)); }) : S(); } }); }; } Mw.exports = m; })()), Mw.exports; } var T0e = C0e(); const qU = /* @__PURE__ */ ra(T0e); var cm = { exports: {} }; /*! * ee-first * Copyright(c) 2014 Jonathan Ong * MIT Licensed */ var Rw, gP; function k0e() { if (gP) return Rw; gP = 1, Rw = t; function t(n, r) { if (!Array.isArray(n)) throw new TypeError("arg must be an array of [ee, events...] arrays"); for (var i = [], o = 0; o < n.length; o++) { var a = n[o]; if (!Array.isArray(a) || a.length < 2) throw new TypeError("each array member must be [ee, events...]"); for (var s = a[0], c = 1; c < a.length; c++) { var u = a[c], d = e(u, p); s.on(u, d), i.push({ ee: s, event: u, fn: d }); } } function p() { f(), r.apply(null, arguments); } function f() { for (var h, y = 0; y < i.length; y++) h = i[y], h.ee.removeListener(h.event, h.fn); } function m(h) { r = h; } return m.cancel = f, m; } function e(n, r) { return function(o) { for (var a = new Array(arguments.length), s = this, c = n === "error" ? o : null, u = 0; u < a.length; u++) a[u] = arguments[u]; r(c, s, n, a); }; } return Rw; } /*! * on-finished * Copyright(c) 2013 Jonathan Ong * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ var yP; function N0e() { if (yP) return cm.exports; yP = 1, cm.exports = r, cm.exports.isFinished = i; var t = u(), e = k0e(), n = typeof setImmediate == "function" ? setImmediate : function(p) { process.nextTick(p.bind.apply(p, arguments)); }; function r(p, f) { return i(p) !== !1 ? (n(f, null, p), p) : (a(p, d(f)), p); } function i(p) { var f = p.socket; if (typeof p.finished == "boolean") return !!(p.finished || f && !f.writable); if (typeof p.complete == "boolean") return !!(p.upgrade || !f || !f.readable || p.complete && !p.readable); } function o(p, f) { var m, h, y = !1; function x(b) { m.cancel(), h.cancel(), y = !0, f(b); } m = h = e([[p, "end", "finish"]], x); function g(b) { p.removeListener("socket", g), !y && m === h && (h = e([[b, "error", "close"]], x)); } if (p.socket) { g(p.socket); return; } p.on("socket", g), p.socket === void 0 && c(p, g); } function a(p, f) { var m = p.__onFinished; (!m || !m.queue) && (m = p.__onFinished = s(p), o(p, m)), m.queue.push(f); } function s(p) { function f(m) { if (p.__onFinished === f && (p.__onFinished = null), !!f.queue) { var h = f.queue; f.queue = null; for (var y = 0; y < h.length; y++) h[y](m, p); } } return f.queue = [], f; } function c(p, f) { var m = p.assignSocket; typeof m == "function" && (p.assignSocket = function(y) { m.call(this, y), f(y); }); } function u() { try { return require("async_hooks"); } catch { return {}; } } function d(p) { var f; return t.AsyncResource && (f = new t.AsyncResource(p.name || "bound-anonymous-fn")), !f || !f.runInAsyncScope ? p : f.runInAsyncScope.bind(f, p, null); } return cm.exports; } var P0e = N0e(), D0e = dB(); const O0e = /* @__PURE__ */ ra(D0e); class _2 extends eu { app; server; wsServer; wsClients = []; heartbeatIntervalId = null; wsClientWithEvent = []; get isActive() { return this.isEnable && this.wsClientWithEvent.length > 0; } async onEvent(e) { const n = this.wsClientWithEvent.map((r) => new Promise((i, o) => { r.readyState === Er.OPEN ? (r.send(JSON.stringify(e)), i()) : o(new Error("WebSocket is not open")); })); await Promise.allSettled(n); } open() { try { if (this.isEnable) { this.core.context.logger.logError("Cannot open a closed HTTP server"); return; } this.isEnable || (this.initializeServer(), this.isEnable = !0); } catch (e) { this.core.context.logger.logError(`[OneBot] [HTTP Server Adapter] Boot Error: ${e}`); } } async close() { this.isEnable = !1, this.server?.close(), this.app = void 0, this.stopHeartbeat(), this.wsClients.forEach((e) => e.close()), this.wsClients = [], this.wsClientWithEvent = [], this.wsServer?.close(); } initializeServer() { this.app = ys(), this.server = Ds.createServer(this.app), this.config.enableWebsocket && (this.wsServer = new hp({ server: this.server }), this.createWSServer(this.wsServer)), this.app.use(qU()), this.app.use(ys.urlencoded({ extended: !0, limit: "5000mb" })), this.app.use((e, n, r) => { if (P0e.isFinished(e)) { r(); return; } if (!O0e.hasBody(e)) { r(); return; } e.headers["content-type"] = "application/json"; let i = ""; e.on("data", (o) => { i += o; }), e.on("end", () => { try { e.body = { ...Gi.parse(i || "{}"), ...e.body }, r(); } catch { n.status(400).send("Invalid JSON"); } }), e.on("error", () => n.status(400).send("Invalid JSON")); }), this.app.use((e, n, r) => this.authorize(this.config.token, e, n, r)), this.app.use(async (e, n) => { await this.handleRequest(e, n); }), this.server.listen(this.config.port, this.config.host, () => { this.core.context.logger.log(`[OneBot] [HTTP Server Adapter] Start On ${this.config.host}:${this.config.port}`); }); } authorize(e, n, r, i) { if (!e || e.length === 0) return i(); const o = n.headers.authorization?.split("Bearer ").pop() || "", a = n.query.access_token; return (typeof a == "string" && a !== "" ? a : o) === e ? i() : r.status(403).send(JSON.stringify({ message: "token verify failed!" })); } createWSServer(e) { e.on("connection", async (n, r) => { if (!this.isEnable) { n.close(); return; } if (!this.authorizeWS(this.config.token, n, r)) return; const i = r.url?.indexOf("?") !== -1 ? r.url?.substring(0, r.url?.indexOf("?")) : r.url, o = i === "/api" || i === "/api/"; o || this.connectEvent(this.core, n), n.on("error", (a) => this.logger.log("[OneBot] [HTTP WebSocket] Client Error:", a.message)), n.on("message", (a) => { this.handleWSMessage(n, a).then().catch((s) => this.logger.logError(s)); }), n.on("pong", () => { }), n.once("close", () => { const a = this.wsClients.indexOf(n); a !== -1 && this.wsClients.splice(a, 1); const s = this.wsClientWithEvent.indexOf(n); s !== -1 && this.wsClientWithEvent.splice(s, 1), this.wsClientWithEvent.length === 0 && this.stopHeartbeat(); }), o || this.wsClientWithEvent.push(n), this.wsClients.push(n), this.wsClientWithEvent.length > 0 && this.startHeartbeat(); }).on("error", (n) => this.logger.log("[OneBot] [HTTP WebSocket] Server Error:", n.message)); } connectEvent(e, n) { try { this.checkStateAndReply(new J1(e, qf.CONNECT), n).catch((r) => this.logger.logError("[OneBot] [HTTP WebSocket] 发送生命周期失败", r)); } catch (r) { this.logger.logError("[OneBot] [HTTP WebSocket] 发送生命周期失败", r); } } startHeartbeat() { this.heartbeatIntervalId || (this.heartbeatIntervalId = setInterval(() => { this.wsClientWithEvent.forEach((e) => { e.readyState === Er.OPEN && e.send(JSON.stringify(new Jg(this.core, 3e4, this.core.selfInfo.online ?? !0, !0))); }); }, 3e4)); } stopHeartbeat() { this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null); } authorizeWS(e, n, r) { if (!e || e.length === 0) return !0; const o = new MD(r?.url || "", `http://${r.headers.host}`).searchParams.get("access_token"), a = r.headers.authorization?.split("Bearer ").pop() || ""; return (typeof o == "string" && o !== "" ? o : a) === e ? !0 : (n.send(JSON.stringify(jt.res(null, "failed", 1403, "token验证失败"))), n.close(), !1); } async checkStateAndReply(e, n) { return await new Promise((r, i) => { n.readyState === Er.OPEN ? (n.send(JSON.stringify(e)), r()) : i(new Error("WebSocket is not open")); }); } async handleWSMessage(e, n) { let r = { action: re.Unknown, params: {} }, i; try { r = Gi.parse(n.toString()), i = r.echo; } catch { await this.checkStateAndReply(jt.error("json解析失败,请检查数据格式", 1400, i), e); return; } r.params = r?.params ? r.params : {}; const o = this.actions.get(r.action); if (!o) { this.logger.logError("[OneBot] [HTTP WebSocket] 发生错误", "不支持的API " + r.action), await this.checkStateAndReply(jt.error("不支持的API " + r.action, 1404, i), e); return; } const a = await o.websocketHandle(r.params, i ?? "", this.name, this.config, { send: async (s) => { await this.checkStateAndReply({ ...jt.ok(s, i ?? "", !0) }, e); } }); await this.checkStateAndReply({ ...a }, e); } async httpApiRequest(e, n, r = !1) { let i = e.body; if (e.method === "GET" ? i = e.query : e.query && (i = { ...e.body, ...e.query }), e.path === "" || e.path === "/") { const u = jt.ok({}); return u.message = "NapCat4 Is Running", n.json(u); } const o = e.path.split("/")[1], s = i.echo ?? Math.random().toString(36).substring(2, 15), c = this.actions.get(o); if (c) { const u = c.useStream; try { const d = await c.handle(i, this.name, this.config, { send: r ? async (p) => { await this.onEvent({ ...jt.ok(p, s, !0) }); } : async (p) => new Promise((m, h) => { n.write(JSON.stringify({ ...jt.ok(p, s, !0) }) + `\r \r `, () => { m(); }); }) }, s); return u ? (n.write(JSON.stringify({ ...d }) + `\r \r `), n.end()) : n.json(d); } catch (d) { return n.json(jt.error(d?.stack?.toString() || d?.message || "Error Handle", 200, s)); } } else return n.json(jt.error("不支持的Api " + o, 200, s)); } async handleRequest(e, n) { if (!this.isEnable) { this.core.context.logger.log("[OneBot] [HTTP Server Adapter] Server is closed"), n.json(jt.error("Server is closed", 200)); return; } this.httpApiRequest(e, n); } async reload(e) { const n = this.isEnable, r = this.config.port, i = this.config.host, o = this.config.enableWebsocket; return this.config = e, e.enable && !n ? (this.open(), Gt.NetWorkOpen) : !e.enable && n ? (this.close(), Gt.NetWorkClose) : r !== e.port || i !== e.host || o !== e.enableWebsocket ? (this.close(), e.enable && this.open(), Gt.NetWorkReload) : Gt.Normal; } } class bP extends eu { wsServer; wsClients = []; heartbeatIntervalId = null; wsClientWithEvent = []; get isActive() { return this.isEnable && this.wsClientWithEvent.length > 0; } constructor(e, n, r, i, o) { super(e, n, r, i, o), this.wsServer = new hp({ port: this.config.port, host: this.config.host === "0.0.0.0" ? "" : this.config.host, maxPayload: 50 * 1024 * 1024 // 50 MB }), this.createServer(this.wsServer); } createServer(e) { e.on("connection", async (n, r) => { if (!this.isEnable) { n.close(); return; } if (!this.authorize(this.config.token, n, r)) return; const i = r.url?.indexOf("?") !== -1 ? r.url?.substring(0, r.url?.indexOf("?")) : r.url, o = i === "/api" || i === "/api/"; o || this.connectEvent(this.core, n), n.on("error", (a) => this.logger.log("[OneBot] [WebSocket Server] Client Error:", a.message)), n.on("message", (a) => { this.handleMessage(n, a).then().catch((s) => this.logger.logError(s)); }), n.on("pong", () => { }), n.once("close", () => { const a = this.wsClients.indexOf(n); a !== -1 && this.wsClients.splice(a, 1); const s = this.wsClientWithEvent.indexOf(n); s !== -1 && this.wsClientWithEvent.splice(s, 1), this.wsClientWithEvent.length === 0 && this.stopHeartbeat(); }), o || this.wsClientWithEvent.push(n), this.wsClients.push(n), this.wsClientWithEvent.length > 0 && this.startHeartbeat(); }).on("error", (n) => this.logger.log("[OneBot] [WebSocket Server] Server Error:", n.message)); } connectEvent(e, n) { try { this.checkStateAndReply(new J1(e, qf.CONNECT), n).catch((r) => this.logger.logError("[OneBot] [WebSocket Server] 发送生命周期失败", r)); } catch (r) { this.logger.logError("[OneBot] [WebSocket Server] 发送生命周期失败", r); } } async onEvent(e) { const n = this.wsClientWithEvent.map((r) => new Promise((i, o) => { r.readyState === Er.OPEN ? (r.send(JSON.stringify(e)), i()) : o(new Error("WebSocket is not open")); })); await Promise.allSettled(n); } open() { if (this.isEnable) { this.logger.logError("[OneBot] [WebSocket Server] Cannot open a opened WebSocket server"); return; } const e = this.wsServer?.address(); this.logger.log("[OneBot] [WebSocket Server] Server Started", typeof e == "string" ? e : e?.address + ":" + e?.port), this.isEnable = !0; } async close() { this.isEnable = !1, this.wsServer?.close((e) => { e ? this.logger.logError("[OneBot] [WebSocket Server] Error closing server:", e.message) : this.logger.log("[OneBot] [WebSocket Server] Server Closed"); }), this.stopHeartbeat(), this.wsClients.forEach((e) => e.close()), this.wsClients = [], this.wsClientWithEvent = []; } startHeartbeat() { this.heartbeatIntervalId || this.config.heartInterval <= 0 || (this.heartbeatIntervalId = setInterval(() => { this.wsClientWithEvent.forEach((e) => { e.readyState === Er.OPEN && e.send(JSON.stringify(new Jg(this.core, this.config.heartInterval, this.core.selfInfo.online ?? !0, !0))); }); }, this.config.heartInterval)); } stopHeartbeat() { this.heartbeatIntervalId && (clearInterval(this.heartbeatIntervalId), this.heartbeatIntervalId = null); } authorize(e, n, r) { if (!e || e.length === 0) return !0; const o = new MD(r?.url || "", `http://${r.headers.host}`).searchParams.get("access_token"), a = r.headers.authorization?.split("Bearer ").pop() || ""; return (typeof o == "string" && o !== "" ? o : a) === e ? !0 : (n.send(JSON.stringify(jt.res(null, "failed", 1403, "token验证失败"))), n.close(), !1); } async checkStateAndReply(e, n) { return await new Promise((r, i) => { n.readyState === Er.OPEN ? (n.send(JSON.stringify(e)), r()) : i(new Error("WebSocket is not open")); }); } async handleMessage(e, n) { let r = { action: re.Unknown, params: {} }, i; try { r = Gi.parse(n.toString()), i = r.echo; } catch { await this.checkStateAndReply(jt.error("json解析失败,请检查数据格式", 1400, i), e); return; } r.params = r?.params ? r.params : {}; const o = this.actions.get(r.action); if (!o) { this.logger.logError("[OneBot] [WebSocket Client] 发生错误", "不支持的API " + r.action), await this.checkStateAndReply(jt.error("不支持的API " + r.action, 1404, i), e); return; } const a = await o.websocketHandle(r.params, i ?? "", this.name, this.config, { send: async (s) => { await this.checkStateAndReply({ ...jt.ok(s, i ?? "", !0) }, e); } }); await this.checkStateAndReply({ ...a }, e); } async reload(e) { const n = this.isEnable, r = this.config.port, i = this.config.host, o = this.config.heartInterval; return this.config = e, e.enable && !n ? (this.open(), Gt.NetWorkOpen) : !e.enable && n ? (this.close(), Gt.NetWorkClose) : r !== e.port || i !== e.host ? (this.close(), this.wsServer = new hp({ port: e.port, host: e.host === "0.0.0.0" ? "" : e.host, maxPayload: 50 * 1024 * 1024 // 50 MB }), this.createServer(this.wsServer), e.enable && this.open(), Gt.NetWorkReload) : o !== e.heartInterval ? (this.stopHeartbeat(), e.heartInterval > 0 && this.isEnable && this.wsClientWithEvent.length > 0 && this.startHeartbeat(), Gt.NetWorkReload) : Gt.Normal; } } var Gt = /* @__PURE__ */ ((t) => (t[t.Normal = 0] = "Normal", t[t.ConfigChange = 1] = "ConfigChange", t[t.NetWorkReload = 2] = "NetWorkReload", t[t.NetWorkClose = 3] = "NetWorkClose", t[t.NetWorkOpen = 4] = "NetWorkOpen", t))(Gt || {}); class F0e { adapters = /* @__PURE__ */ new Map(); async openAllAdapters() { return Promise.all(Array.from(this.adapters.values()).map((e) => e.open())); } async emitEvent(e) { return Promise.all(Array.from(this.adapters.values()).map(async (n) => { if (n.isActive) return await n.onEvent(e); })); } async emitEvents(e) { return Promise.all(e.map((n) => this.emitEvent(n))); } async emitEventByName(e, n) { return Promise.all(e.map(async (r) => { const i = this.adapters.get(r); if (i && i.isActive) return await i.onEvent(n); })); } async emitEventByNames(e) { return Promise.all(Array.from(e.entries()).map(async ([n, r]) => { const i = this.adapters.get(n); if (i && i.isActive) return await i.onEvent(r); })); } registerAdapter(e) { this.adapters.set(e.name, e); } async registerAdapterAndOpen(e) { this.registerAdapter(e), await e.open(); } async closeSomeAdapters(e) { for (const n of e) this.adapters.delete(n.name), await n.close(); } async closeSomeAdaterWhenOpen(e) { for (const n of e) this.adapters.delete(n.name), n.isEnable && await n.close(); } findSomeAdapter(e) { return this.adapters.get(e); } async closeAdapterByPredicate(e) { const n = Array.from(this.adapters.values()).filter(e); await this.closeSomeAdapters(n); } async closeAllAdapters() { await Promise.all(Array.from(this.adapters.values()).map((e) => e.close())), this.adapters.clear(); } async readloadAdapter(e, n) { const r = this.adapters.get(e); r && await r.reload(n); } async readloadSomeAdapters(e) { await Promise.all(Array.from(e.entries()).map(([n, r]) => this.readloadAdapter(n, r))); } hasActiveAdapters() { return Array.from(this.adapters.values()).some((e) => e.isActive); } async getAllConfig() { return Array.from(this.adapters.values()).map((e) => e.config); } } const Vl = Tr(), Xg = "debug-primary"; Vl.get("/schemas", async (t, e) => { try { const n = de.getOneBotContext(); if (!n) return ne(e, "OneBot 未初始化"); const r = {}; for (const i in re) { const o = re[i]; if (o === re.Unknown) continue; const a = n.actions.get(o); if (a) { const s = a; r[o] = { description: s.actionSummary || s.actionDescription, payload: s.payloadSchema, response: s.returnSchema, payloadExample: s.payloadExample, tags: s.actionTags }; } } me(e, r); } catch (n) { ne(e, n.message); } }); class M0e extends eu { token; wsClients = []; wsClientWithEvent = []; lastActivityTime = Date.now(); inactivityTimer = null; INACTIVITY_TIMEOUT = 300 * 1e3; // 5分钟不活跃 get isActive() { return this.isEnable && this.wsClientWithEvent.length > 0; } constructor(e, n, r, i) { const o = { enable: !0, name: `debug-${e}`, host: "127.0.0.1", port: 0, messagePostFormat: "array", reportSelfMessage: !0, token: "", enableForcePushEvent: !0, debug: !0, heartInterval: 0 }; super(`debug-${e}`, o, n, r, i), this.token = Math.random().toString(36).substring(2) + Math.random().toString(36).substring(2), this.isEnable = !1, this.startInactivityCheck(); } async open() { if (this.isEnable) { this.logger.logError("[Debug] Cannot open an already opened adapter"); return; } this.logger.log("[Debug] Adapter opened:", this.name), this.isEnable = !0; } async close() { this.isEnable && (this.logger.log("[Debug] Adapter closing:", this.name), this.isEnable = !1, this.inactivityTimer && (clearInterval(this.inactivityTimer), this.inactivityTimer = null), this.wsClients.forEach((e) => { try { e.removeAllListeners(), e.close(); } catch (n) { this.logger.logError("[Debug] 关闭 WebSocket 失败:", n); } }), this.wsClients = [], this.wsClientWithEvent = []); } async reload(e) { return Gt.NetWorkReload; } async onEvent(e) { this.updateActivity(); const n = JSON.stringify(e); this.wsClientWithEvent.forEach((r) => { if (r.readyState === Er.OPEN) try { r.send(n); } catch (i) { this.logger.logError("[Debug] 发送事件失败:", i); } }); } async callApi(e, n) { this.updateActivity(); const r = this.actions.get(e); if (!r) throw new Error(`不支持的 API: ${e}`); return await r.handle(n, this.name, this.config); } async handleMessage(e, n) { this.updateActivity(); let r = { action: re.Unknown, params: {} }, i; try { r = Gi.parse(n.toString()), i = r.echo; } catch { this.sendToClient(e, jt.error("json解析失败,请检查数据格式", 1400, i)); return; } r.params = r?.params || {}; const o = this.actions.get(r.action); if (!o) { this.logger.logError("[Debug] 不支持的API:", r.action), this.sendToClient(e, jt.error("不支持的API " + r.action, 1404, i)); return; } try { const a = await o.websocketHandle(r.params, i ?? "", this.name, this.config, { send: async (s) => { this.sendToClient(e, jt.ok(s, i ?? "", !0)); } }); this.sendToClient(e, a); } catch (a) { const s = a; this.logger.logError("[Debug] 处理消息失败:", s), this.sendToClient(e, jt.error(s.message || "内部错误", 1200, i)); } } sendToClient(e, n) { if (e.readyState === Er.OPEN) try { e.send(JSON.stringify(n)); } catch (r) { this.logger.logError("[Debug] 发送消息失败:", r); } } async addWsClient(e) { this.wsClientWithEvent.push(e), this.wsClients.push(e), this.updateActivity(), this.sendToClient(e, new J1(this.core, qf.CONNECT)), e.on("error", (n) => this.logger.log("[Debug] WebSocket Error:", n.message)), e.on("message", (n) => { this.handleMessage(e, n).catch((r) => { this.logger.logError("[Debug] handleMessage error:", r); }); }), e.on("ping", () => e.pong()), e.once("close", () => this.removeWsClient(e)); } removeWsClient(e) { const n = this.wsClients.indexOf(e); n !== -1 && this.wsClients.splice(n, 1); const r = this.wsClientWithEvent.indexOf(e); r !== -1 && this.wsClientWithEvent.splice(r, 1); } updateActivity() { this.lastActivityTime = Date.now(); } startInactivityCheck() { this.inactivityTimer = setInterval(() => { if (Date.now() - this.lastActivityTime > this.INACTIVITY_TIMEOUT && this.wsClients.length === 0) { this.logger.log(`[Debug] Adapter ${this.name} 不活跃,自动关闭`); const n = de.getOneBotContext(); n && (ks.removeAdapter(this.name), n.networkManager.closeSomeAdapters([this]).catch((r) => { this.logger.logError("[Debug] 自动关闭适配器失败:", r); })); } }, 3e4); } validateToken(e) { return this.token === e; } } class R0e { currentAdapter = null; getOrCreateAdapter() { if (this.currentAdapter) return this.currentAdapter.updateActivity(), this.currentAdapter; const e = de.getOneBotContext(); if (!e) throw new Error("OneBot 未初始化,无法创建调试适配器"); const n = new M0e("primary", e.core, e, e.actions); return this.currentAdapter = n, e.networkManager.registerAdapterAndOpen(n).catch((r) => { console.error("[Debug] 注册适配器失败:", r); }), n; } getAdapter(e) { if (this.currentAdapter && this.currentAdapter.name === e) return this.currentAdapter; } removeAdapter(e) { this.currentAdapter && this.currentAdapter.name === e && (this.currentAdapter = null); } } const ks = new R0e(); Vl.post("/create", async (t, e) => { try { const n = ks.getOrCreateAdapter(); me(e, { adapterName: n.name, token: n.token, message: "调试适配器已就绪" }); } catch (n) { ne(e, n.message); } }); const zU = async (t, e) => { try { const n = t.params.adapterName || t.body.adapterName || Xg; let r = ks.getAdapter(n); if (!r && n === Xg && (r = ks.getOrCreateAdapter()), !r) return ne(e, "调试适配器不存在"); const { action: i, params: o } = t.body, a = await r.callApi(i, o || {}); me(e, a); } catch (n) { ne(e, n.message); } }; Vl.post("/call/:adapterName", zU); Vl.post("/call", zU); Vl.post("/close/:adapterName", async (t, e) => { try { const { adapterName: n } = t.params; if (!n) return ne(e, "缺少 adapterName 参数"); const r = ks.getAdapter(n); if (!r) return ne(e, "调试适配器不存在"); ks.removeAdapter(n); const i = de.getOneBotContext(); i && await i.networkManager.closeSomeAdapters([r]), me(e, { message: "调试适配器已关闭" }); } catch (n) { ne(e, n.message); } }); function B0e(t, e, n) { const r = new URL(t.url || "", `http://${t.headers.host}`); let i = r.searchParams.get("adapterName"); const o = r.searchParams.get("token") || r.searchParams.get("access_token"); if (i || (i = Xg), !o) { console.log("[Debug] WebSocket 连接被拒绝: 缺少 Token"), e.write(`HTTP/1.1 401 Unauthorized\r \r `), e.destroy(); return; } let a = ks.getAdapter(i); if (!a && i === Xg) try { a = ks.getOrCreateAdapter(); } catch (c) { console.log("[Debug] WebSocket 连接被拒绝: 无法创建适配器", c), e.write(`HTTP/1.1 500 Internal Server Error\r \r `), e.destroy(); return; } if (!a) { console.log("[Debug] WebSocket 连接被拒绝: 适配器不存在"), e.write(`HTTP/1.1 404 Not Found\r \r `), e.destroy(); return; } if (!a.validateToken(o)) { console.log("[Debug] WebSocket 连接被拒绝: Token 无效"), e.write(`HTTP/1.1 403 Forbidden\r \r `), e.destroy(); return; } new hp({ noServer: !0 }).handleUpgrade(t, e, n, (c) => { a.addWsClient(c).catch((u) => { console.error("[Debug] 添加 WebSocket 客户端失败:", u), c.close(); }); }); } async function U0e(t, e) { try { const n = await de.requestRestartProcess(); return n.result ? me(e, { message: n.message || "进程重启请求已发送" }) : ne(e, n.message || "进程重启失败"); } catch (n) { return ne(e, "重启进程时发生错误: " + n.message); } } const HU = Tr(); HU.post("/Restart", U0e); class vP { static text(e, n, r, i, o) { return { key: e, type: "string", label: n, default: r, description: i, reactive: o }; } static number(e, n, r, i, o) { return { key: e, type: "number", label: n, default: r, description: i, reactive: o }; } static boolean(e, n, r, i, o) { return { key: e, type: "boolean", label: n, default: r, description: i, reactive: o }; } static select(e, n, r, i, o, a) { return { key: e, type: "select", label: n, options: r, default: i, description: o, reactive: a }; } static multiSelect(e, n, r, i, o, a) { return { key: e, type: "multi-select", label: n, options: r, default: i, description: o, reactive: a }; } static html(e) { return { key: `_html_${Math.random().toString(36).slice(2)}`, type: "html", label: "", default: e }; } static plainText(e) { return { key: `_text_${Math.random().toString(36).slice(2)}`, type: "text", label: "", default: e }; } static combine(...e) { return e; } } const xP = _D(import.meta.url), L0e = /* @__PURE__ */ new Set([ "snowcat-plugin-builtin", "snowcat-plugin-cleaner", "snowcat-plugin-ssqq", "snowcat-plugin-qce" ]), Q0e = [ "发卡", "卡密", "卡网", "自动发卡", "寄售", "代刷", "刷单", "跑分", "四件套", "洗钱", "黑产", "灰产", "博彩", "赌博", "菠菜", "涉黄", "色情", "收款码", "代付", "担保交易", "第三方支付", "USDT" ], j0e = /* @__PURE__ */ new Set([".js", ".mjs", ".cjs", ".ts"]), $0e = /* @__PURE__ */ new Set(["data", "node_modules", ".git"]), G0e = 5 * 1024 * 1024; class q0e { constructor(e, n, r) { this.pluginPath = e, this.configPath = n, this.logger = r; } /** * 加载插件状态配置 */ loadPluginStatusConfig() { if (fe.existsSync(this.configPath)) try { return JSON.parse(fe.readFileSync(this.configPath, "utf-8")); } catch (e) { this.logger.logWarn("[PluginLoader] Error parsing plugins.json", e); } return {}; } /** * 保存插件状态配置 */ savePluginStatusConfig(e) { try { fe.writeFileSync(this.configPath, JSON.stringify(e, null, 2), "utf-8"); } catch (n) { this.logger.logError("[PluginLoader] Error saving plugins.json", n); } } /** * 扫描插件目录,收集所有有效插件条目(异步版本,验证模块有效性) * 只有包含有效 plugin_init 函数的插件才会被收集 */ async scanPlugins() { const e = []; if (!fe.existsSync(this.pluginPath)) return this.logger.logWarn(`[PluginLoader] Plugin directory does not exist: ${this.pluginPath}`), fe.mkdirSync(this.pluginPath, { recursive: !0 }), e; const n = fe.readdirSync(this.pluginPath, { withFileTypes: !0 }), r = this.loadPluginStatusConfig(); for (const i of n) { if (!i.isDirectory()) continue; const o = this.scanDirectoryPlugin(i.name, r); if (!o) continue; if (!o.entryPath) { this.logger.logWarn(`[PluginLoader] Skipping ${i.name}: no entry file found`); continue; } if (!o.enable) { e.push(o); continue; } const a = await this.validatePluginEntry(o.entryPath); if (!a.valid) { this.logger.logWarn(`[PluginLoader] Skipping ${i.name}: ${a.error}`); continue; } e.push(o); } return e; } /** * 扫描单个目录插件 */ scanDirectoryPlugin(e, n) { const r = ve.join(this.pluginPath, e); try { let i; const o = ve.join(r, "package.json"); if (fe.existsSync(o)) try { const f = fe.readFileSync(o, "utf-8"); i = JSON.parse(f); } catch (f) { this.logger.logWarn(`[PluginLoader] Invalid package.json in ${e}:`, f); } const a = i?.name || e, s = this.getRejectReason(a, r); if (s) return this.logger.logWarn(`[PluginLoader] Rejected ${a} (${e}): ${s}`), null; const c = this.findEntryFile(r, i), u = c ? ve.join(r, c) : void 0, d = n[a] ?? a === "snowcat-plugin-builtin", p = { id: a, fileId: e, name: i?.name, version: i?.version, description: i?.description, author: i?.author, pluginPath: r, entryPath: u, packageJson: i, enable: d, loaded: !1, runtime: { status: "unloaded" } }; return u || (p.runtime = { status: "error", error: `No valid entry file found for plugin directory: ${e}` }), p; } catch (i) { return { id: e, // 使用目录名作为 ID fileId: e, pluginPath: ve.join(this.pluginPath, e), enable: n[e] ?? e === "snowcat-plugin-builtin", loaded: !1, runtime: { status: "error", error: i.message || "Unknown error during scan" } }; } } /** * 查找插件目录的入口文件 */ findEntryFile(e, n) { const r = [ n?.main, "index.mjs", "index.js", "main.mjs", "main.js" ].filter(Boolean); for (const i of r) { const o = ve.resolve(e), a = ve.resolve(e, i); if (!(a !== o && !a.startsWith(o + ve.sep)) && fe.existsSync(a) && fe.statSync(a).isFile()) return i; } return null; } /** 是否为白名单内的官方插件 */ isOfficialPlugin(e) { return L0e.has(e); } /** * 判断插件是否应被拒绝(非官方 / 命中敏感词)。 * @returns 拒绝原因;通过校验返回 null */ getRejectReason(e, n) { const r = this.scanSensitiveWords(n); return this.isOfficialPlugin(e) ? null : r ? `sensitive keyword "${r}"` : "not in official plugin whitelist"; } /** * 递归扫描插件目录内源码是否命中敏感词(黑灰产 / 支付发卡)。 * @returns 命中的敏感词;未命中返回 null */ scanSensitiveWords(e) { const n = (r) => { let i; try { i = fe.readdirSync(r, { withFileTypes: !0 }); } catch { return null; } for (const o of i) { if (o.isDirectory()) { if ($0e.has(o.name)) continue; const s = n(ve.join(r, o.name)); if (s) return s; continue; } if (!o.isFile() || !j0e.has(ve.extname(o.name).toLowerCase())) continue; const a = ve.join(r, o.name); try { if (fe.statSync(a).size > G0e) continue; const s = fe.readFileSync(a, "utf-8"); for (const c of Q0e) if (s.includes(c)) return c; } catch { } } return null; }; return n(e); } /** * 动态导入模块 */ async importModule(e) { return await import(`${`file://${e.replace(/\\/g, "/")}`}?t=${Date.now()}`); } /** * 加载插件模块 */ async loadPluginModule(e) { if (!e.entryPath) return e.runtime = { status: "error", error: "No entry path specified" }, null; try { const n = await this.importModule(e.entryPath); return this.isValidPluginModule(n) ? n : (e.runtime = { status: "error", error: "Invalid plugin module: missing plugin_init function" }, null); } catch (n) { return e.runtime = { status: "error", error: n.message || "Failed to import module" }, null; } } /** * 检查模块是否为有效的插件模块 */ isValidPluginModule(e) { return e && typeof e.plugin_init == "function"; } /** * 验证插件入口文件是否包含有效的 plugin_init 函数 * 用于扫描阶段快速验证 */ async validatePluginEntry(e) { try { const n = await this.importModule(e); return this.isValidPluginModule(n) ? { valid: !0 } : { valid: !1, error: "Missing plugin_init function" }; } catch (n) { return { valid: !1, error: n.message || "Failed to import module" }; } } /** * 重新扫描单个插件 */ rescanPlugin(e) { const n = this.loadPluginStatusConfig(); return this.scanDirectoryPlugin(e, n); } /** * 通过 ID 查找插件目录名 */ findPluginDirById(e) { if (!fe.existsSync(this.pluginPath)) return null; const n = fe.readdirSync(this.pluginPath, { withFileTypes: !0 }); for (const r of n) { if (!r.isDirectory()) continue; const i = ve.join(this.pluginPath, r.name, "package.json"); if (fe.existsSync(i)) try { if (JSON.parse(fe.readFileSync(i, "utf-8")).name === e) return r.name; } catch { } if (r.name === e) return r.name; } return null; } /** * 清除插件文件的 require 缓存 * 用于确保卸载插件时清理 CJS 模块缓存 */ clearCache(e) { try { const n = ve.resolve(e); Object.keys(xP.cache).forEach((r) => { r.startsWith(n) && (delete xP.cache[r], this.logger.logDebug(`[PluginLoader] Cleared cache for: ${r}`)); }); } catch (n) { this.logger.logError("[PluginLoader] Error clearing module cache:", n); } } } function z0e(t) { return { path: t.path, method: t.method, query: t.query, body: t.body, headers: t.headers, params: t.params, raw: t }; } function H0e(t) { const e = { status(n) { return t.status(n), e; }, json(n) { t.json(n); }, send(n) { t.send(n); }, setHeader(n, r) { return t.setHeader(n, r), e; }, sendFile(n) { t.sendFile(n); }, redirect(n) { t.redirect(n); }, raw: t }; return e; } class W0e { constructor(e, n) { this.pluginId = e, this.pluginPath = n; } apiRoutes = []; apiNoAuthRoutes = []; pageDefinitions = []; staticRoutes = []; memoryStaticRoutes = []; // ==================== API 路由注册 ==================== api(e, n, r) { this.apiRoutes.push({ method: e, path: n, handler: r }); } get(e, n) { this.api("get", e, n); } post(e, n) { this.api("post", e, n); } put(e, n) { this.api("put", e, n); } delete(e, n) { this.api("delete", e, n); } // ==================== 无认证 API 路由注册 ==================== apiNoAuth(e, n, r) { this.apiNoAuthRoutes.push({ method: e, path: n, handler: r }); } getNoAuth(e, n) { this.apiNoAuth("get", e, n); } postNoAuth(e, n) { this.apiNoAuth("post", e, n); } putNoAuth(e, n) { this.apiNoAuth("put", e, n); } deleteNoAuth(e, n) { this.apiNoAuth("delete", e, n); } // ==================== 页面注册 ==================== page(e) { this.pageDefinitions.push(e); } pages(e) { this.pageDefinitions.push(...e); } // ==================== 静态资源 ==================== static(e, n) { const r = ve.isAbsolute(n) ? n : ve.join(this.pluginPath, n); this.staticRoutes.push({ urlPath: e, localPath: r }); } staticOnMem(e, n) { this.memoryStaticRoutes.push({ urlPath: e, files: n }); } // ==================== 构建路由 ==================== /** * 构建 Express Router(用于 API 路由) * 注意:静态资源路由不在此处挂载,由 webui-backend 直接在不需要鉴权的路径下处理 */ buildApiRouter() { const e = Tr(); for (const n of this.apiRoutes) { const r = this.wrapHandler(n.handler); switch (n.method) { case "get": e.get(n.path, r); break; case "post": e.post(n.path, r); break; case "put": e.put(n.path, r); break; case "delete": e.delete(n.path, r); break; case "patch": e.patch(n.path, r); break; case "all": e.all(n.path, r); break; } } return e; } /** * 包装处理器,添加错误处理和请求/响应包装 */ wrapHandler(e) { return async (n, r, i) => { try { const o = z0e(n), a = H0e(r); await e(o, a, i); } catch (o) { console.error(`[Plugin: ${this.pluginId}] Route error:`, o), r.headersSent || r.status(500).json({ code: -1, message: `Plugin error: ${o.message || "Unknown error"}` }); } }; } // ==================== 查询方法 ==================== /** * 检查是否有注册的 API 路由(需要认证) */ hasApiRoutes() { return this.apiRoutes.length > 0; } /** * 检查是否有注册的无认证 API 路由 */ hasApiNoAuthRoutes() { return this.apiNoAuthRoutes.length > 0; } /** * 构建无认证 Express Router(用于 /plugin/{pluginId}/api/ 路径) */ buildApiNoAuthRouter() { const e = Tr(); for (const n of this.apiNoAuthRoutes) { const r = this.wrapHandler(n.handler); switch (n.method) { case "get": e.get(n.path, r); break; case "post": e.post(n.path, r); break; case "put": e.put(n.path, r); break; case "delete": e.delete(n.path, r); break; case "patch": e.patch(n.path, r); break; case "all": e.all(n.path, r); break; } } return e; } /** * 检查是否有注册的静态资源路由 */ hasStaticRoutes() { return this.staticRoutes.length > 0 || this.memoryStaticRoutes.length > 0; } /** * 检查是否有注册的页面 */ hasPages() { return this.pageDefinitions.length > 0; } /** * 获取所有注册的页面定义 */ getPages() { return [...this.pageDefinitions]; } /** * 获取插件 ID */ getPluginId() { return this.pluginId; } /** * 获取插件路径 */ getPluginPath() { return this.pluginPath; } /** * 获取所有注册的静态路由 */ getStaticRoutes() { return [...this.staticRoutes]; } /** * 获取所有注册的内存静态路由 */ getMemoryStaticRoutes() { return [...this.memoryStaticRoutes]; } /** * 清空路由(用于插件卸载) */ clear() { this.apiRoutes = [], this.apiNoAuthRoutes = [], this.pageDefinitions = [], this.staticRoutes = [], this.memoryStaticRoutes = []; } } class WU extends eu { pluginPath; configPath; loader; /** 插件注册表: ID -> 插件条目 */ plugins = /* @__PURE__ */ new Map(); /** 插件路由注册表: ID -> 路由注册器 */ pluginRouters = /* @__PURE__ */ new Map(); SnowCatConfig = vP; get isActive() { return this.isEnable && this.getLoadedPlugins().length > 0; } constructor(e, n, r, i) { const o = { name: e, messagePostFormat: "array", reportSelfMessage: !0, enable: !0, debug: !0 }; super(e, o, n, r, i), this.pluginPath = this.core.context.pathWrapper.pluginPath, this.configPath = ve.join(this.core.context.pathWrapper.configPath, "plugins.json"), this.loader = new q0e(this.pluginPath, this.configPath, this.logger); } // ==================== 插件状态配置 ==================== getPluginConfig() { return this.loader.loadPluginStatusConfig(); } savePluginConfig(e) { this.loader.savePluginStatusConfig(e); } // ==================== 插件扫描与加载 ==================== /** * 扫描并加载所有插件 */ async scanAndLoadPlugins() { const e = await this.loader.scanPlugins(); this.plugins.clear(); for (const r of e) this.plugins.set(r.id, r); this.logger.log(`[PluginManager] Scanned ${this.plugins.size} plugins`); for (const r of this.plugins.values()) r.enable && r.runtime.status !== "error" && await this.loadPlugin(r); const n = this.getLoadedPlugins().length; this.logger.log(`[PluginManager] Loaded ${n} plugins`); } /** * 加载单个插件 */ async loadPlugin(e) { if (e.loaded) return !0; if (e.runtime.status === "error") return !1; const n = await this.loader.loadPluginModule(e); if (!n) return !1; const r = this.createPluginContext(e); try { return await n.plugin_init(r), e.loaded = !0, e.runtime = { status: "loaded", module: n, context: r }, this.logger.log(`[PluginManager] Initialized plugin: ${e.id}${e.version ? ` v${e.version}` : ""}`), !0; } catch (i) { return e.loaded = !1, e.runtime = { status: "error", error: i.message || "Initialization failed" }, this.logger.logError(`[PluginManager] Error initializing plugin ${e.id}:`, i), !1; } } /** * 卸载单个插件 */ async unloadPlugin(e) { if (!e.loaded || e.runtime.status !== "loaded") return; const { module: n, context: r } = e.runtime; if (n && r && typeof n.plugin_cleanup == "function") try { await n.plugin_cleanup(r), this.logger.log(`[PluginManager] Cleaned up plugin: ${e.id}`); } catch (o) { this.logger.logError(`[PluginManager] Error cleaning up plugin ${e.id}:`, o); } const i = this.pluginRouters.get(e.id); i && (i.clear(), this.pluginRouters.delete(e.id)), this.loader.clearCache(e.pluginPath), e.loaded = !1, e.runtime = { status: "unloaded" }, this.logger.log(`[PluginManager] Unloaded plugin: ${e.id}`); } /** * 创建插件上下文 */ createPluginContext(e) { const n = ve.join(this.core.context.pathWrapper.configPath, "plugins", e.id), r = ve.join(n, "config.json"); fe.existsSync(n) || fe.mkdirSync(n, { recursive: !0 }); const i = `[Plugin: ${e.id}]`, o = this.logger, a = { log: (...u) => o.log(i, ...u), debug: (...u) => o.logDebug(i, ...u), info: (...u) => o.log(i, ...u), warn: (...u) => o.logWarn(i, ...u), error: (...u) => o.logError(i, ...u) }, s = new W0e(e.id, e.pluginPath); this.pluginRouters.set(e.id, s); const c = (u) => { const d = this.plugins.get(u); if (!(!d || !d.loaded || d.runtime.status !== "loaded")) return d.runtime.module; }; return { core: this.core, oneBot: this.obContext, actions: this.actions, pluginName: e.id, pluginPath: e.pluginPath, dataPath: n, configPath: r, SnowCatConfig: vP, adapterName: this.name, pluginManager: this, logger: a, router: s, getPluginExports: c }; } // ==================== 公共 API ==================== /** * 获取插件目录路径 */ getPluginPath() { return this.pluginPath; } /** * 获取所有插件条目 */ getAllPlugins() { return Array.from(this.plugins.values()); } /** * 获取已加载的插件列表 */ getLoadedPlugins() { return Array.from(this.plugins.values()).filter((e) => e.loaded); } /** * 通过 ID 获取插件信息 */ getPluginInfo(e) { return this.plugins.get(e); } /** * 获取插件路由注册器 */ getPluginRouter(e) { return this.pluginRouters.get(e); } /** * 获取所有插件路由注册器 */ getAllPluginRouters() { return this.pluginRouters; } /** * 设置插件状态(启用/禁用) */ async setPluginStatus(e, n) { const r = this.getPluginConfig(); r[e] = n, this.savePluginConfig(r); const i = this.plugins.get(e); i && (i.enable = n, n && !i.loaded ? await this.loadPlugin(i) : !n && i.loaded && await this.unloadPlugin(i)); } /** * 通过 ID 加载插件 */ async loadPluginById(e) { let n = this.plugins.get(e); if (!n) { const r = this.loader.findPluginDirById(e); if (!r) return this.logger.logWarn(`[PluginManager] Plugin ${e} not found in filesystem`), !1; const i = this.loader.rescanPlugin(r); if (!i) return !1; this.plugins.set(i.id, i), n = i; } return n.enable ? await this.loadPlugin(n) : (this.logger.log(`[PluginManager] Skipping loading disabled plugin: ${e}`), !1); } /** * 卸载插件(仅从内存卸载) */ async unregisterPlugin(e) { const n = this.plugins.get(e); n && await this.unloadPlugin(n); } /** * 卸载并删除插件 */ async uninstallPlugin(e, n = !1) { const r = this.plugins.get(e); if (!r) throw new Error(`Plugin ${e} not found`); const i = r.pluginPath, o = ve.join(this.core.context.pathWrapper.configPath, "plugins", e); r.loaded && await this.unloadPlugin(r), this.plugins.delete(e), fe.existsSync(i) && fe.rmSync(i, { recursive: !0, force: !0 }), n && fe.existsSync(o) && fe.rmSync(o, { recursive: !0, force: !0 }); } /** * 重载指定插件 */ async reloadPlugin(e) { const n = this.plugins.get(e); if (!n) return this.logger.logWarn(`[PluginManager] Plugin ${e} not found`), !1; try { await this.unloadPlugin(n); const r = this.loader.rescanPlugin(n.fileId); return r ? (this.plugins.set(r.id, r), r.enable && await this.loadPlugin(r), this.logger.log(`[PluginManager] Plugin ${e} reloaded successfully`), !0) : !1; } catch (r) { return this.logger.logError(`[PluginManager] Error reloading plugin ${e}:`, r), !1; } } /** * 加载目录插件(用于新安装的插件) */ async loadDirectoryPlugin(e) { const n = this.loader.rescanPlugin(e); if (n) { if (this.plugins.has(n.id)) { this.logger.logWarn(`[PluginManager] Plugin ${n.id} already exists`); return; } this.plugins.set(n.id, n), n.enable && n.runtime.status !== "error" && await this.loadPlugin(n); } } /** * 获取插件数据目录路径 */ getPluginDataPath(e) { return ve.join(this.core.context.pathWrapper.configPath, "plugins", e); } /** * 获取插件配置文件路径 */ getPluginConfigPath(e) { return ve.join(this.getPluginDataPath(e), "config.json"); } // ==================== 事件处理 ==================== async onEvent(e) { if (this.isEnable) try { await Promise.allSettled( this.getLoadedPlugins().map( (n) => this.callPluginEventHandler(n, e) ) ); } catch (n) { this.logger.logError("[PluginManager] Error handling event:", n); } } /** * 调用插件的事件处理方法 */ async callPluginEventHandler(e, n) { if (e.runtime.status !== "loaded" || !e.runtime.module || !e.runtime.context) return; const { module: r, context: i } = e.runtime; try { typeof r.plugin_onevent == "function" && await r.plugin_onevent(i, n), n.message_type && typeof r.plugin_onmessage == "function" && await r.plugin_onmessage(i, n); } catch (o) { this.logger.logError(`[PluginManager] Error calling plugin ${e.id} event handler:`, o); } } // ==================== 生命周期 ==================== async open() { this.isEnable || (this.logger.log("[PluginManager] Opening plugin manager..."), this.isEnable = !0, await this.scanAndLoadPlugins(), this.logger.log(`[PluginManager] Plugin manager opened with ${this.getLoadedPlugins().length} plugins loaded`)); } async close() { if (this.isEnable) { this.logger.log("[PluginManager] Closing plugin manager..."), this.isEnable = !1; for (const e of this.plugins.values()) e.loaded && await this.unloadPlugin(e); this.logger.log("[PluginManager] Plugin manager closed"); } } async reload() { return this.logger.log("[PluginManager] Reloading plugin manager..."), await this.close(), await this.open(), this.logger.log("[PluginManager] Plugin manager reloaded"), Gt.Normal; } } function K0e(t, e, n) { if (n) { const i = ve.join(e, n); if (fe.existsSync(i)) return `/api/Plugin/Icon/${encodeURIComponent(t)}`; } const r = ve.join(lt.configPath, "plugins", t, "icon.png"); if (fe.existsSync(r)) return `/api/Plugin/Icon/${encodeURIComponent(t)}`; } function V0e(t, e, n) { if (n) { const i = ve.join(e, n); if (fe.existsSync(i)) return i; } const r = ve.join(lt.configPath, "plugins", t, "icon.png"); if (fe.existsSync(r)) return r; } const Ws = () => { const t = de.getOneBotContext(); return t ? t.networkManager.findSomeAdapter("plugin_manager") : null; }, Y0e = () => de.getOneBotContext(), J0e = async (t, e) => { const n = Y0e(); if (!n) return ne(e, "OneBot context not found"); if (n.networkManager.findSomeAdapter("plugin_manager")) return ne(e, "插件管理器已经注册"); try { const i = lt.pluginPath; fe.existsSync(i) || fe.mkdirSync(i, { recursive: !0 }); const o = new WU( "plugin_manager", n.core, n, n.actions ); return await n.networkManager.registerAdapterAndOpen(o), me(e, { message: "插件管理器注册成功" }); } catch (i) { return ne(e, "注册插件管理器失败: " + i.message); } }, X0e = async (t, e) => { const n = Ws(); if (!n) return me(e, { plugins: [], pluginManagerNotFound: !0, extensionPages: [] }); const r = n.getAllPlugins(), i = [], o = []; for (const a of r) { let s; a.enable ? a.loaded ? s = "active" : s = "stopped" : s = "disabled"; const c = n.getPluginRouter(a.id), u = c?.hasPages() ?? !1; if (i.push({ name: a.packageJson?.plugin || a.name || "", // 优先显示 package.json 的 plugin 字段 id: a.id, // 包名,用于 API 操作 version: a.version || "0.0.0", description: a.packageJson?.description || "", author: a.packageJson?.author || "", status: s, hasConfig: !!(a.runtime.module?.plugin_config_schema || a.runtime.module?.plugin_config_ui), hasPages: u, homepage: a.packageJson?.homepage, repository: typeof a.packageJson?.repository == "string" ? a.packageJson.repository : a.packageJson?.repository?.url, icon: K0e(a.id, a.pluginPath, a.packageJson?.icon) }), u && c) { const d = c.getPages(); for (const p of d) o.push({ pluginId: a.id, pluginName: a.packageJson?.plugin || a.name || a.id, path: p.path, title: p.title, icon: p.icon, description: p.description }); } } return me(e, { plugins: i, pluginManagerNotFound: !1, extensionPages: o }); }, Z0e = async (t, e) => { const { enable: n, id: r } = t.body; if (!r) return ne(e, "Plugin id is required"); const i = Ws(); if (!i) return ne(e, "Plugin Manager not found"); try { if (await i.setPluginStatus(r, n), n) { const o = i.getPluginInfo(r); if (!o || !o.loaded) return ne(e, "Plugin load failed: " + r); } return me(e, { message: "Status updated successfully" }); } catch (o) { return ne(e, "Failed to update status: " + o.message); } }, e1e = async (t, e) => { const { id: n, cleanData: r } = t.body; if (!n) return ne(e, "Plugin id is required"); const i = Ws(); if (!i) return ne(e, "Plugin Manager not found"); try { return await i.uninstallPlugin(n, r), me(e, { message: "Uninstalled successfully" }); } catch (o) { return ne(e, "Failed to uninstall: " + o.message); } }, t1e = async (t, e) => { const n = t.query.id; if (!n) return ne(e, "Plugin id is required"); const r = Ws(); if (!r) return ne(e, "Plugin Manager not found"); const i = r.getPluginInfo(n); if (!i) return ne(e, "Plugin not loaded"); let o = {}; if (i.runtime.module?.plugin_get_config && i.runtime.context) try { o = await i.runtime.module?.plugin_get_config(i.runtime.context); } catch { } else try { const c = i.runtime.context?.configPath || r.getPluginConfigPath(n); fe.existsSync(c) && (o = JSON.parse(fe.readFileSync(c, "utf-8"))); } catch { } const a = i.runtime.module?.plugin_config_schema || i.runtime.module?.plugin_config_ui || [], s = !!(i.runtime.module?.plugin_config_controller || i.runtime.module?.plugin_on_config_change); return me(e, { schema: a, config: o, supportReactive: s }); }, Kd = /* @__PURE__ */ new Map(), n1e = (t, e) => { const n = t.query.id, r = t.query.config; if (!n) { e.status(400).json({ error: "Plugin id is required" }); return; } const i = Ws(); if (!i) { e.status(400).json({ error: "Plugin Manager not found" }); return; } const o = i.getPluginInfo(n); if (!o) { e.status(400).json({ error: "Plugin not loaded" }); return; } e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.setHeader("X-Accel-Buffering", "no"), e.flushHeaders(); const a = `${n}_${Date.now()}_${Math.random().toString(36).slice(2)}`; let s = {}; if (r) try { s = JSON.parse(r); } catch { } const c = (p, f) => { e.write(`event: ${p} `), e.write(`data: ${JSON.stringify(f)} `); }, u = { updateSchema: (p) => { c("schema", { type: "full", schema: p }); }, updateField: (p, f) => { c("schema", { type: "updateField", key: p, field: f }); }, removeField: (p) => { c("schema", { type: "removeField", key: p }); }, addField: (p, f) => { c("schema", { type: "addField", field: p, afterKey: f }); }, showField: (p) => { c("schema", { type: "showField", key: p }); }, hideField: (p) => { c("schema", { type: "hideField", key: p }); }, getCurrentConfig: () => s }; Kd.set(a, { res: e, currentConfig: s }), c("connected", { sessionId: a }), (async () => { let p; if (o.runtime.module?.plugin_config_controller && o.runtime.context) try { const m = await o.runtime.module.plugin_config_controller( o.runtime.context, u, s ); typeof m == "function" && (p = m); } catch (m) { c("error", { message: m.message }); } const f = Kd.get(a); f && (f.cleanup = p); })(); const d = setInterval(() => { c("ping", { time: Date.now() }); }, 3e4); t.on("close", () => { clearInterval(d); const p = Kd.get(a); if (p?.cleanup) try { p.cleanup(); } catch { } Kd.delete(a); }); }, r1e = async (t, e) => { const { id: n, sessionId: r, key: i, value: o, currentConfig: a } = t.body; if (!n || !r || !i) return ne(e, "Missing required parameters"); const s = Ws(); if (!s) return ne(e, "Plugin Manager not found"); const c = s.getPluginInfo(n); if (!c) return ne(e, "Plugin not loaded"); const u = Kd.get(r); if (!u) return ne(e, "Session not found"); if (u.currentConfig = a || {}, c.runtime.module?.plugin_on_config_change) { const d = { updateSchema: (p) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "full", schema: p })} `); }, updateField: (p, f) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "updateField", key: p, field: f })} `); }, removeField: (p) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "removeField", key: p })} `); }, addField: (p, f) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "addField", field: p, afterKey: f })} `); }, showField: (p) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "showField", key: p })} `); }, hideField: (p) => { u.res.write(`event: schema `), u.res.write(`data: ${JSON.stringify({ type: "hideField", key: p })} `); }, getCurrentConfig: () => u.currentConfig }; try { c.runtime.context && await c.runtime.module.plugin_on_config_change( c.runtime.context, d, i, o, a || {} ); } catch (p) { u.res.write(`event: error `), u.res.write(`data: ${JSON.stringify({ message: p.message })} `); } } return me(e, { message: "Change processed" }); }, i1e = async (t, e) => { const { id: n, config: r } = t.body; if (!n || !r) return ne(e, "Plugin id and config required"); const i = Ws(); if (!i) return ne(e, "Plugin Manager not found"); const o = i.getPluginInfo(n); if (!o) return ne(e, "Plugin not loaded"); if (o.runtime.module?.plugin_set_config && o.runtime.context) try { return await o.runtime.module.plugin_set_config(o.runtime.context, r), me(e, { message: "Config updated" }); } catch (a) { return ne(e, "Error updating config: " + a.message); } else if (o.runtime.module?.plugin_config_schema || o.runtime.module?.plugin_config_ui || o.runtime.module?.plugin_config_controller) try { const a = o.runtime.context?.configPath || i.getPluginConfigPath(n), s = ve.dirname(a); return fe.existsSync(s) || fe.mkdirSync(s, { recursive: !0 }), fe.writeFileSync(a, JSON.stringify(r, null, 2), "utf-8"), await i.reloadPlugin(n), me(e, { message: "Config saved and plugin reloaded" }); } catch (a) { return ne(e, "Error saving config: " + a.message); } else return ne(e, "Plugin does not support config update"); }, o1e = async (t, e) => { const n = t.params.pluginId; if (!n) return ne(e, "Plugin ID is required"); const r = Ws(); if (!r) return ne(e, "Plugin Manager not found"); const i = r.getPluginInfo(n); if (!i) return ne(e, "Plugin not found"); const o = V0e(n, i.pluginPath, i.packageJson?.icon); return o ? e.sendFile(o) : e.status(404).json({ code: -1, message: "Icon not found" }); }, Zg = () => { const t = de.getOneBotContext(); return t ? t.networkManager.findSomeAdapter("plugin_manager") : null; }, a1e = [ "https://raw.githubusercontent.com/DandanLLab/snowcat-plugin-index/main/plugins.v4.json" ], X1 = () => lt.pluginPath; function Z1(t) { if (typeof t != "string") throw new Error("Invalid plugin ID"); const e = nt.basename(t); if (!/^[a-zA-Z0-9._-]+$/.test(e) || e !== t) throw new Error("Invalid plugin ID format"); return e; } let um = null, wP = 0; const s1e = 600 * 1e3; async function ey(t = !1) { const e = Date.now(); if (!t && um && e - wP < s1e) return um; const n = []; for (const r of a1e) for (const i of f0) try { const o = i ? `${i}/${r.replace("https://raw.githubusercontent.com/", "")}` : r, a = await fetch(o, { headers: { "User-Agent": "NapCat-WebUI" }, signal: AbortSignal.timeout(1e4) // 10秒超时 }); if (!a.ok) throw new Error(`HTTP ${a.status}: ${a.statusText}`); return um = await a.json(), wP = e, um; } catch (o) { const a = `Failed to fetch from ${r} via mirror: ${o.message}`; console.warn(a), n.push(a); } throw new Error(`All plugin sources failed: ${n.join(` `)}`); } async function KU(t, e, n, r, i = 12e4) { try { let o; /^https:\/\/github\.com\/[^/]+\/[^/]+\/releases\/download\//.test(t) ? (console.log(`Detected GitHub Release URL: ${t}`), console.log(`Custom mirror: ${n || "auto"}`), o = await wS(t, { validateContent: !1, // 不验证内容,只检查状态码和 Content-Type timeout: 5e3, // 每个镜像测试5秒超时 useFastMirrors: !1, // 不使用快速镜像列表(避免测速阻塞) customMirror: n || void 0 // 使用用户选择的镜像 }), console.log(`Selected download URL: ${o}`)) : (console.log(`Direct download URL: ${t}`), o = t), console.log(`Starting download from: ${o}`); const s = nt.dirname(e); Ie.existsSync(s) || (Ie.mkdirSync(s, { recursive: !0 }), console.log(`Created directory: ${s}`)); const c = await fetch(o, { headers: { "User-Agent": "NapCat-WebUI" }, signal: AbortSignal.timeout(i) // 使用传入的超时时间 }); if (!c.ok) throw new Error(`HTTP ${c.status}: ${c.statusText}`); if (!c.body) throw new Error("Response body is null"); const u = Number(c.headers.get("content-length")) || 0; r && r(0, 0, u, 0); let d = 0, p = Date.now(), f = 0; const m = async function* (y) { for await (const x of y) { d += x.length; const g = Date.now(), b = g - p; if (b >= 500 || u && d === u) { const S = u ? Math.round(d / u * 100) : 0, E = (d - f) / (b / 1e3); r && r(S, d, u, E), p = g, f = d; } yield x; } }, h = xD(e); await F2(m(c.body), h), console.log(`Successfully downloaded to: ${e}`); } catch (o) { throw Ie.existsSync(e) && Ie.unlinkSync(e), new Error(`Download failed: ${o.message}`); } } async function VU(t, e) { const n = Z1(e), r = X1(), i = nt.join(r, n), o = nt.join(i, "data"), a = nt.join(r, `${n}.data.backup`); console.log(`[extractPlugin] PLUGINS_DIR: ${r}`), console.log(`[extractPlugin] pluginId: ${n}`), console.log(`[extractPlugin] Target directory: ${i}`), console.log(`[extractPlugin] Zip file: ${t}`), Ie.existsSync(r) || (Ie.mkdirSync(r, { recursive: !0 }), console.log(`[extractPlugin] Created plugins root directory: ${r}`)); let s = !1; Ie.existsSync(i) && (Ie.existsSync(o) && (console.log(`[extractPlugin] Backing up data directory: ${o}`), Ie.existsSync(a) && Ie.rmSync(a, { recursive: !0, force: !0 }), Ie.renameSync(o, a), s = !0), console.log(`[extractPlugin] Directory exists, removing: ${i}`), Ie.rmSync(i, { recursive: !0, force: !0 })), Ie.mkdirSync(i, { recursive: !0 }), console.log(`[extractPlugin] Created directory: ${i}`); try { await bl.zip.uncompress(t, i), console.log(`[extractPlugin] Plugin extracted to: ${i}`), s && Ie.existsSync(a) && (Ie.existsSync(o) && Ie.rmSync(o, { recursive: !0, force: !0 }), console.log(`[extractPlugin] Restoring data directory: ${o}`), Ie.renameSync(a, o)); } catch (u) { throw s && Ie.existsSync(a) && (console.log("[extractPlugin] Extract failed, restoring data directory"), Ie.existsSync(i) || Ie.mkdirSync(i, { recursive: !0 }), Ie.existsSync(o) && Ie.rmSync(o, { recursive: !0, force: !0 }), Ie.renameSync(a, o)), u; } const c = Ie.readdirSync(i); console.log("[extractPlugin] Extracted files:", c); } async function YU(t, e) { const n = X1(), r = nt.join(n, t), i = nt.join(lt.configPath, "plugins", t), o = nt.join(r, "package.json"); if (Ie.existsSync(o)) try { const s = JSON.parse(Ie.readFileSync(o, "utf-8")); if (s.icon) { const c = nt.join(r, s.icon); if (Ie.existsSync(c)) return; } } catch { } if (Ie.existsSync(nt.join(i, "icon.png"))) return; let a; if (e.downloadUrl) try { const s = new URL(e.downloadUrl); if (s.hostname === "github.com" || s.hostname === "www.github.com") { const c = s.pathname.split("/").filter(Boolean); c.length >= 1 && (a = `https://github.com/${c[0]}.png?size=128`); } } catch { } if (!a && e.homepage) try { const s = new URL(e.homepage); if (s.hostname === "github.com" || s.hostname === "www.github.com") { const c = s.pathname.split("/").filter(Boolean); c.length >= 1 && (a = `https://github.com/${c[0]}.png?size=128`); } } catch { } if (a) try { Ie.existsSync(i) || Ie.mkdirSync(i, { recursive: !0 }); const s = await fetch(a, { headers: { "User-Agent": "NapCat-WebUI" }, signal: AbortSignal.timeout(15e3), redirect: "follow" }); if (!s.ok || !s.body) return; const c = nt.join(i, "icon.png"), u = xD(c); await F2(s.body, u), console.log(`[cachePluginIcon] Cached icon for ${t} at ${c}`); } catch (s) { console.warn(`[cachePluginIcon] Failed to cache icon for ${t}:`, s.message); } } const c1e = async (t, e) => { try { const n = t.query.forceRefresh === "true", r = await ey(n); return me(e, r); } catch (n) { return ne(e, "Failed to fetch plugin store list: " + n.message); } }, u1e = async (t, e) => { try { const n = Z1(t.params.id), i = (await ey()).plugins.find((o) => o.id === n); return i ? me(e, i) : ne(e, "Plugin not found"); } catch (n) { return ne(e, "Failed to fetch plugin detail: " + n.message); } }, l1e = async (t, e) => { try { const { id: n, mirror: r } = t.body; if (!n) return ne(e, "Plugin ID is required"); const i = Z1(n), a = (await ey()).plugins.find((d) => d.id === i); if (!a) return ne(e, "Plugin not found in store"); const s = Zg(); if (s) { const d = s.getPluginInfo(i); if (d && d.version === a.version) return ne(e, "该插件已安装且版本相同,无需重复安装"); } const c = X1(), u = nt.join(c, `${i}.temp.zip`); try { await KU(a.downloadUrl, u, r, void 0, 3e5), await VU(u, i), Ie.unlinkSync(u); const d = Zg(); d && (d.getPluginInfo(i) ? await d.reloadPlugin(i) : await d.loadPluginById(i)); try { await YU(i, a); } catch (p) { console.warn(`[InstallPlugin] Failed to cache icon for ${i}, skipping:`, p.message); } return me(e, { message: "Plugin installed successfully", plugin: a, installPath: nt.join(c, i) }); } catch (d) { throw Ie.existsSync(u) && Ie.unlinkSync(u), d; } } catch (n) { return ne(e, "Failed to install plugin: " + n.message); } }, d1e = async (t, e) => { const { id: n, mirror: r } = t.query; if (!n || typeof n != "string") { e.status(400).json({ error: "Plugin ID is required" }); return; } let i; try { i = Z1(n); } catch (a) { e.status(400).json({ error: a.message }); return; } e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.flushHeaders(); const o = (a, s, c) => { e.write(`data: ${JSON.stringify({ message: a, progress: s, ...c })} `); }; try { o("正在获取插件信息...", 10); const s = (await ey()).plugins.find((p) => p.id === i); if (!s) { o("错误: 插件不存在", 0), e.write(`data: ${JSON.stringify({ error: "Plugin not found in store" })} `), e.end(); return; } const c = Zg(); if (c) { const p = c.getPluginInfo(i); if (p && p.version === s.version) { o("错误: 该插件已安装且版本相同", 0), e.write(`data: ${JSON.stringify({ error: "该插件已安装且版本相同,无需重复安装" })} `), e.end(); return; } } o(`找到插件: ${s.name} v${s.version}`, 20), o(`下载地址: ${s.downloadUrl}`, 25), r && typeof r == "string" && o(`使用镜像: ${r}`, 28); const u = X1(), d = nt.join(u, `${i}.temp.zip`); try { o("正在下载插件...", 30), await KU(s.downloadUrl, d, r, (f, m, h, y) => { const x = 30 + Math.round(f * 0.5), g = (m / 1024 / 1024).toFixed(1), b = h ? (h / 1024 / 1024).toFixed(1) : "?", S = (y / 1024 / 1024).toFixed(2), E = h > 0 && y > 0 ? Math.round((h - m) / y) : -1; o(`正在下载插件... ${f}%`, x, { downloaded: m, total: h, speed: y, eta: E, downloadedStr: `${g}MB`, totalStr: `${b}MB`, speedStr: `${S}MB/s` }); }, 3e5), o("下载完成,正在解压...", 85), await VU(d, i), o("解压完成,正在清理...", 95), Ie.unlinkSync(d); const p = Zg(); p && (p.getPluginInfo(i) ? (o("正在刷新插件信息...", 95), await p.reloadPlugin(i)) : (o("正在注册插件...", 95), await p.loadPluginById(i))), o("安装成功!", 100), YU(i, s).catch((f) => { console.warn(`[cachePluginIcon] Failed to cache icon for ${i}:`, f.message); }), e.write(`data: ${JSON.stringify({ success: !0, message: "Plugin installed successfully", plugin: s, installPath: nt.join(u, i) })} `), e.end(); } catch (p) { Ie.existsSync(d) && Ie.unlinkSync(d), o(`错误: ${p.message}`, 0), e.write(`data: ${JSON.stringify({ error: p.message })} `), e.end(); } } catch (a) { o(`错误: ${a.message}`, 0), e.write(`data: ${JSON.stringify({ error: a.message })} `), e.end(); } }, SP = ve.join(Ln.tmpdir(), "snowcat-plugin-uploads"); fe.existsSync(SP) || fe.mkdirSync(SP, { recursive: !0 }); const Dr = Tr(); Dr.get("/List", X0e); Dr.post("/SetStatus", Z0e); Dr.post("/Uninstall", e1e); Dr.get("/Config", t1e); Dr.post("/Config", i1e); Dr.get("/Config/SSE", n1e); Dr.post("/Config/Change", r1e); Dr.post("/RegisterManager", J0e); Dr.get("/Icon/:pluginId", o1e); Dr.get("/Store/List", c1e); Dr.get("/Store/Detail/:id", u1e); Dr.post("/Store/Install", l1e); Dr.get("/Store/Install/SSE", d1e); Dr.use("/ext/:pluginId", (t, e, n) => { const { pluginId: r } = t.params; if (!r) { e.status(400).json({ code: -1, message: "Plugin ID is required" }); return; } const i = de.getOneBotContext(); if (!i) { e.status(503).json({ code: -1, message: "OneBot context not available" }); return; } const o = i.networkManager.findSomeAdapter("plugin_manager"); if (!o) { e.status(503).json({ code: -1, message: "Plugin manager not available" }); return; } const a = o.getPluginRouter(r); if (!a || !a.hasApiRoutes()) { e.status(404).json({ code: -1, message: `Plugin '${r}' has no registered API routes` }); return; } a.buildApiRouter()(t, e, n); }); Dr.get("/page/:pluginId/:pagePath", (t, e) => { const { pluginId: n, pagePath: r } = t.params; if (!n) { e.status(400).json({ code: -1, message: "Plugin ID is required" }); return; } const i = de.getOneBotContext(); if (!i) { e.status(503).json({ code: -1, message: "OneBot context not available" }); return; } const o = i.networkManager.findSomeAdapter("plugin_manager"); if (!o) { e.status(503).json({ code: -1, message: "Plugin manager not available" }); return; } const a = o.getPluginRouter(n); if (!a || !a.hasPages()) { e.status(404).json({ code: -1, message: `Plugin '${n}' has no registered pages` }); return; } const c = a.getPages().find((p) => p.path === "/" + r || p.path === r); if (!c) { e.status(404).json({ code: -1, message: `Page '${r}' not found in plugin '${n}'` }); return; } const u = a.getPluginPath(); if (!u) { e.status(500).json({ code: -1, message: "Plugin path not available" }); return; } const d = ve.join(u, c.htmlFile); if (!fe.existsSync(d)) { e.status(404).json({ code: -1, message: `HTML file not found: ${c.htmlFile}` }); return; } e.sendFile(d); }); async function JU(t, e, n = 5e3) { const r = t ? Ru(e, t) : e, i = Date.now(); return new Promise((o) => { try { const a = new URL(r), s = a.protocol === "https:", u = (s ? hl : Ds).request({ hostname: a.hostname, port: a.port || (s ? 443 : 80), path: a.pathname + a.search, method: "HEAD", timeout: n, headers: { "User-Agent": "NapCat-Mirror-Test" } }, (d) => { const p = d.statusCode || 0, f = p >= 200 && p < 400; o({ mirror: t || "https://github.com", latency: Date.now() - i, success: f }); }); u.on("error", (d) => { o({ mirror: t || "https://github.com", latency: Date.now() - i, success: !1, error: d.message }); }), u.on("timeout", () => { u.destroy(), o({ mirror: t || "https://github.com", latency: n, success: !1, error: "Timeout" }); }), u.end(); } catch (a) { o({ mirror: t || "https://github.com", latency: Date.now() - i, success: !1, error: a.message }); } }); } const p1e = async (t, e) => { try { const n = UO(); return me(e, { fileMirrors: J2.filter((r) => r), rawMirrors: f0, customMirror: n.customMirror, timeout: n.timeout }); } catch (n) { return ne(e, n.message); } }, f1e = async (t, e) => { try { const { mirror: n } = t.body; return l$(n || ""), u$(), me(e, { message: "Mirror set successfully" }); } catch (n) { return ne(e, n.message); } }, h1e = async (t, e) => { const { type: n = "file" } = t.query; e.setHeader("Content-Type", "text/event-stream"), e.setHeader("Cache-Control", "no-cache"), e.setHeader("Connection", "keep-alive"), e.flushHeaders(); const r = (i) => { e.write(`data: ${JSON.stringify(i)} `); }; try { let i, o; n === "raw" ? (i = f0, o = "https://raw.githubusercontent.com/DandanLLab/SnowCatQQ/main/README.md") : (i = J2.filter((d) => d), o = "https://github.com/DandanLLab/SnowCatQQ/releases/latest"), i.includes("") || (i = ["", ...i]), r({ type: "start", total: i.length, message: `开始测试 ${i.length} 个镜像源...` }); const a = [], s = 5e3; for (let d = 0; d < i.length; d++) { const p = i[d] ?? "", f = p || "https://github.com (原始)"; r({ type: "testing", index: d, total: i.length, mirror: f, message: `正在测试: ${f}` }); const m = await JU(p, o, s); a.push(m), r({ type: "result", index: d, total: i.length, result: { ...m, mirror: m.mirror || "https://github.com (原始)" } }); } const c = a.filter((d) => d.success).sort((d, p) => d.latency - p.latency), u = a.filter((d) => !d.success); r({ type: "complete", results: c, failed: u, fastest: c[0] || null, message: `测试完成!${c.length} 个可用,${u.length} 个失败` }), e.end(); } catch (i) { r({ type: "error", error: i.message }), e.end(); } }, m1e = async (t, e) => { try { const { mirror: n, type: r = "file" } = t.body; let i; r === "raw" ? i = "https://raw.githubusercontent.com/DandanLLab/SnowCatQQ/main/README.md" : i = "https://github.com/DandanLLab/SnowCatQQ/releases/latest"; const o = await JU(n || "", i, 5e3); return me(e, o); } catch (n) { return ne(e, n.message); } }, zf = Tr(); zf.get("/List", p1e); zf.post("/SetCustom", f1e); zf.get("/Test/SSE", h1e); zf.post("/Test", m1e); function e0() { return wc(dA, {}); } function g1e() { return Bn(lt.configPath, "./napcat.json"); } function XU() { const t = g1e(); try { if (ir(t)) { const e = mo(t, "utf-8"); return { ...e0(), ...Gi.parse(e) }; } } catch { } return { ...e0() }; } function y1e(t) { const e = Bn(lt.configPath, "./napcat.json"); TD(lt.configPath, { recursive: !0 }), D2(e, JSON.stringify(t, null, 2), "utf-8"); } const b1e = (t, e) => { try { const n = XU(); return me(e, n); } catch (n) { return ne(e, "Config Get Error: " + n.message); } }, v1e = (t, e) => { try { const n = t.body; if (!n || typeof n != "object") return ne(e, "config is empty or invalid"); const i = { ...XU(), ...n }; if (i.bypass && typeof i.bypass == "object") { const o = i.bypass, a = ["hook", "window", "module", "process", "container", "js"]; for (const s of a) if (s in o && typeof o[s] != "boolean") return ne(e, `bypass.${s} must be boolean`); } return y1e(i), me(e, null); } catch (n) { return ne(e, "Config Set Error: " + n.message); } }; function ZU(t) { const e = Bn(lt.configPath, `./napcat_${t}.json`), n = Bn(lt.configPath, "./napcat.json"), r = ir(e) ? e : n; try { if (ir(r)) { const i = mo(r, "utf-8"); return { ...e0(), ...Gi.parse(i) }; } } catch { } return { ...e0() }; } function x1e(t, e) { const n = Bn(lt.configPath, `./napcat_${t}.json`); TD(lt.configPath, { recursive: !0 }), D2(n, JSON.stringify(e, null, 2), "utf-8"); } const w1e = (t, e) => { try { if (!de.getQQLoginStatus()) return ne(e, "Not Login"); const r = de.getQQLoginUin(); return me(e, ZU(r)); } catch (n) { return ne(e, "Config Get Error: " + n.message); } }, S1e = (t, e) => { try { if (!de.getQQLoginStatus()) return ne(e, "Not Login"); const r = de.getQQLoginUin(), i = t.body; if (!i || typeof i != "object") return ne(e, "config is empty or invalid"); const a = { ...ZU(r), ...i }; return x1e(r, a), me(e, null); } catch (n) { return ne(e, "Config Set Error: " + n.message); } }, Hf = Tr(); Hf.get("/GetConfig", b1e); Hf.post("/SetConfig", v1e); Hf.get("/GetUinConfig", w1e); Hf.post("/SetUinConfig", S1e); const _r = Tr(); _r.use(fde); _r.all("/test", (t, e) => me(e)); _r.use("/base", ki); _r.use("/auth", Ti); _r.use("/QQLogin", Nt); _r.use("/OB11Config", Sf); _r.use("/Log", Zc); _r.use("/File", cr); _r.use("/WebUIConfig", Ya); _r.use("/UpdateSnowCat", h3); _r.use("/UpdateNapCat", h3); _r.use("/Debug", Vl); _r.use("/Process", HU); _r.use("/Plugin", Dr); _r.use("/Mirror", zf); _r.use("/SnowCatConfig", Hf); function _P(t) { if (t.startsWith("::ffff:")) { const e = t.substring(7); if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(e)) return e; } return t; } function EP(t) { return t.includes(":"); } function _1e(t, e) { const n = _P(t), r = _P(e); return n === r ? !0 : EP(n) || EP(r) ? r.includes("/") ? A1e(n, r) : !1 : r.includes("*") ? new RegExp("^" + r.replace(/\./g, "\\.").replace(/\*/g, "\\d+") + "$").test(n) : r.includes("/") ? E1e(n, r) : !1; } function E1e(t, e) { const n = e.split("/"); if (n.length !== 2) return !1; const r = n[0], i = n[1]; if (!r || !i) return !1; const o = parseInt(i); if (isNaN(o) || o < 0 || o > 32) return !1; const a = o === 0 ? 0 : ~(2 ** (32 - o) - 1), s = AP(t), c = AP(r); return s === null || c === null ? !1 : (s & a) === (c & a); } function AP(t) { const e = t.split("."); if (e.length !== 4) return null; const n = e.map((r) => parseInt(r)); return n.some((r) => isNaN(r) || r < 0 || r > 255) ? null : ((n[0] || 0) << 24) + ((n[1] || 0) << 16) + ((n[2] || 0) << 8) + (n[3] || 0); } function A1e(t, e) { const n = e.split("/"); if (n.length !== 2) return !1; const r = n[0], i = n[1]; if (!r || !i) return !1; const o = parseInt(i); if (isNaN(o) || o < 0 || o > 128) return !1; try { const a = IP(t), s = IP(r); if (!a || !s) return !1; let c = o; for (let u = 0; u < 8 && !(c <= 0); u++) { const d = a[u] ?? 0, p = s[u] ?? 0; if (c >= 16) { if (d !== p) return !1; c -= 16; } else { const f = 65535 << 16 - c & 65535; if ((d & f) !== (p & f)) return !1; break; } } return !0; } catch { return !1; } } function IP(t) { try { let e = t; const n = e.match(/::ffff:(\d+\.\d+\.\d+\.\d+)$/i); if (n && n[1]) { const o = n[1].split(".").map((a) => parseInt(a)); if (o.length === 4 && o.every((a) => a >= 0 && a <= 255)) { const a = (o[0] ?? 0) << 8 | (o[1] ?? 0), s = (o[2] ?? 0) << 8 | (o[3] ?? 0); e = `::ffff:${a.toString(16)}:${s.toString(16)}`; } } if (e.includes("::")) { const i = e.split("::"); if (i.length > 2) return null; const o = i[0] ? i[0].split(":") : [], a = i[1] ? i[1].split(":") : [], s = 8 - o.length - a.length; return s < 0 ? null : [ ...o, ...Array(s).fill("0"), ...a ].map((u) => parseInt(u || "0", 16)); } const r = e.split(":"); return r.length !== 8 ? null : r.map((i) => parseInt(i || "0", 16)); } catch { return null; } } function CP(t, e) { return e.some((n) => _1e(t, n)); } const I1e = async (t, e, n) => { const r = await Ct.GetWebUIConfig(); let i; if (r.enableXForwardedFor) { const a = t.headers["x-forwarded-for"]; typeof a == "string" ? i = a.split(",")[0]?.trim() || "" : Array.isArray(a) && a.length > 0 ? i = a[0] || "" : i = t.ip || t.socket.remoteAddress || ""; } else i = t.ip || t.socket.remoteAddress || ""; if (r.accessControlMode === "whitelist") { if (!CP(i, r.ipWhitelist || [])) { e.status(403).json({ error: "访问被拒绝:IP不在白名单中" }); return; } } else if (r.accessControlMode === "blacklist" && CP(i, r.ipBlacklist || [])) { e.status(403).json({ error: "访问被拒绝:IP在黑名单中" }); return; } const o = t.headers.origin || "*"; if (e.header("Access-Control-Allow-Origin", o), e.header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS"), e.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization"), e.header("Access-Control-Allow-Credentials", "true"), t.method === "OPTIONS") { e.sendStatus(204); return; } n(); }; var lm = { exports: {} }, dm = { exports: {} }, pm = { exports: {} }, TP; function C1e() { if (TP) return pm.exports; TP = 1, pm.exports = o, pm.exports.preferredCharsets = o; var t = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function e(u) { for (var d = u.split(","), p = 0, f = 0; p < d.length; p++) { var m = n(d[p].trim(), p); m && (d[f++] = m); } return d.length = f, d; } function n(u, d) { var p = t.exec(u); if (!p) return null; var f = p[1], m = 1; if (p[2]) for (var h = p[2].split(";"), y = 0; y < h.length; y++) { var x = h[y].trim().split("="); if (x[0] === "q") { m = parseFloat(x[1]); break; } } return { charset: f, q: m, i: d }; } function r(u, d, p) { for (var f = { o: -1, q: 0, s: 0 }, m = 0; m < d.length; m++) { var h = i(u, d[m], p); h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h); } return f; } function i(u, d, p) { var f = 0; if (d.charset.toLowerCase() === u.toLowerCase()) f |= 1; else if (d.charset !== "*") return null; return { i: p, o: d.i, q: d.q, s: f }; } function o(u, d) { var p = e(u === void 0 ? "*" : u || ""); if (!d) return p.filter(c).sort(a).map(s); var f = d.map(function(h, y) { return r(h, p, y); }); return f.filter(c).sort(a).map(function(h) { return d[f.indexOf(h)]; }); } function a(u, d) { return d.q - u.q || d.s - u.s || u.o - d.o || u.i - d.i || 0; } function s(u) { return u.charset; } function c(u) { return u.q > 0; } return pm.exports; } var fm = { exports: {} }, kP; function T1e() { if (kP) return fm.exports; kP = 1, fm.exports = o, fm.exports.preferredEncodings = o; var t = /^\s*([^\s;]+)\s*(?:;(.*))?$/; function e(u) { for (var d = u.split(","), p = !1, f = 1, m = 0, h = 0; m < d.length; m++) { var y = n(d[m].trim(), m); y && (d[h++] = y, p = p || i("identity", y), f = Math.min(f, y.q || 1)); } return p || (d[h++] = { encoding: "identity", q: f, i: m }), d.length = h, d; } function n(u, d) { var p = t.exec(u); if (!p) return null; var f = p[1], m = 1; if (p[2]) for (var h = p[2].split(";"), y = 0; y < h.length; y++) { var x = h[y].trim().split("="); if (x[0] === "q") { m = parseFloat(x[1]); break; } } return { encoding: f, q: m, i: d }; } function r(u, d, p) { for (var f = { encoding: u, o: -1, q: 0, s: 0 }, m = 0; m < d.length; m++) { var h = i(u, d[m], p); h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h); } return f; } function i(u, d, p) { var f = 0; if (d.encoding.toLowerCase() === u.toLowerCase()) f |= 1; else if (d.encoding !== "*") return null; return { encoding: u, i: p, o: d.i, q: d.q, s: f }; } function o(u, d, p) { var f = e(u || ""), m = p ? function(x, g) { if (x.q !== g.q) return g.q - x.q; var b = p.indexOf(x.encoding), S = p.indexOf(g.encoding); return b === -1 && S === -1 ? g.s - x.s || x.o - g.o || x.i - g.i : b !== -1 && S !== -1 ? b - S : b === -1 ? 1 : -1; } : a; if (!d) return f.filter(c).sort(m).map(s); var h = d.map(function(x, g) { return r(x, f, g); }); return h.filter(c).sort(m).map(function(x) { return d[h.indexOf(x)]; }); } function a(u, d) { return d.q - u.q || d.s - u.s || u.o - d.o || u.i - d.i; } function s(u) { return u.encoding; } function c(u) { return u.q > 0; } return fm.exports; } var hm = { exports: {} }, NP; function k1e() { if (NP) return hm.exports; NP = 1, hm.exports = o, hm.exports.preferredLanguages = o; var t = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; function e(u) { for (var d = u.split(","), p = 0, f = 0; p < d.length; p++) { var m = n(d[p].trim(), p); m && (d[f++] = m); } return d.length = f, d; } function n(u, d) { var p = t.exec(u); if (!p) return null; var f = p[1], m = p[2], h = f; m && (h += "-" + m); var y = 1; if (p[3]) for (var x = p[3].split(";"), g = 0; g < x.length; g++) { var b = x[g].split("="); b[0] === "q" && (y = parseFloat(b[1])); } return { prefix: f, suffix: m, q: y, i: d, full: h }; } function r(u, d, p) { for (var f = { o: -1, q: 0, s: 0 }, m = 0; m < d.length; m++) { var h = i(u, d[m], p); h && (f.s - h.s || f.q - h.q || f.o - h.o) < 0 && (f = h); } return f; } function i(u, d, p) { var f = n(u); if (!f) return null; var m = 0; if (d.full.toLowerCase() === f.full.toLowerCase()) m |= 4; else if (d.prefix.toLowerCase() === f.full.toLowerCase()) m |= 2; else if (d.full.toLowerCase() === f.prefix.toLowerCase()) m |= 1; else if (d.full !== "*") return null; return { i: p, o: d.i, q: d.q, s: m }; } function o(u, d) { var p = e(u === void 0 ? "*" : u || ""); if (!d) return p.filter(c).sort(a).map(s); var f = d.map(function(h, y) { return r(h, p, y); }); return f.filter(c).sort(a).map(function(h) { return d[f.indexOf(h)]; }); } function a(u, d) { return d.q - u.q || d.s - u.s || u.o - d.o || u.i - d.i || 0; } function s(u) { return u.full; } function c(u) { return u.q > 0; } return hm.exports; } var mm = { exports: {} }, PP; function N1e() { if (PP) return mm.exports; PP = 1, mm.exports = o, mm.exports.preferredMediaTypes = o; var t = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; function e(m) { for (var h = p(m), y = 0, x = 0; y < h.length; y++) { var g = n(h[y].trim(), y); g && (h[x++] = g); } return h.length = x, h; } function n(m, h) { var y = t.exec(m); if (!y) return null; var x = /* @__PURE__ */ Object.create(null), g = 1, b = y[2], S = y[1]; if (y[3]) for (var E = f(y[3]).map(d), T = 0; T < E.length; T++) { var U = E[T], q = U[0].toLowerCase(), Y = U[1], H = Y && Y[0] === '"' && Y[Y.length - 1] === '"' ? Y.slice(1, -1) : Y; if (q === "q") { g = parseFloat(H); break; } x[q] = H; } return { type: S, subtype: b, params: x, q: g, i: h }; } function r(m, h, y) { for (var x = { o: -1, q: 0, s: 0 }, g = 0; g < h.length; g++) { var b = i(m, h[g], y); b && (x.s - b.s || x.q - b.q || x.o - b.o) < 0 && (x = b); } return x; } function i(m, h, y) { var x = n(m), g = 0; if (!x) return null; if (h.type.toLowerCase() == x.type.toLowerCase()) g |= 4; else if (h.type != "*") return null; if (h.subtype.toLowerCase() == x.subtype.toLowerCase()) g |= 2; else if (h.subtype != "*") return null; var b = Object.keys(h.params); if (b.length > 0) if (b.every(function(S) { return h.params[S] == "*" || (h.params[S] || "").toLowerCase() == (x.params[S] || "").toLowerCase(); })) g |= 1; else return null; return { i: y, o: h.i, q: h.q, s: g }; } function o(m, h) { var y = e(m === void 0 ? "*/*" : m || ""); if (!h) return y.filter(c).sort(a).map(s); var x = h.map(function(b, S) { return r(b, y, S); }); return x.filter(c).sort(a).map(function(b) { return h[x.indexOf(b)]; }); } function a(m, h) { return h.q - m.q || h.s - m.s || m.o - h.o || m.i - h.i || 0; } function s(m) { return m.type + "/" + m.subtype; } function c(m) { return m.q > 0; } function u(m) { for (var h = 0, y = 0; (y = m.indexOf('"', y)) !== -1; ) h++, y++; return h; } function d(m) { var h = m.indexOf("="), y, x; return h === -1 ? y = m : (y = m.slice(0, h), x = m.slice(h + 1)), [y, x]; } function p(m) { for (var h = m.split(","), y = 1, x = 0; y < h.length; y++) u(h[x]) % 2 == 0 ? h[++x] = h[y] : h[x] += "," + h[y]; return h.length = x + 1, h; } function f(m) { for (var h = m.split(";"), y = 1, x = 0; y < h.length; y++) u(h[x]) % 2 == 0 ? h[++x] = h[y] : h[x] += ";" + h[y]; h.length = x + 1; for (var y = 0; y < h.length; y++) h[y] = h[y].trim(); return h; } return mm.exports; } /*! * negotiator * Copyright(c) 2012 Federico Romero * Copyright(c) 2012-2014 Isaac Z. Schlueter * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ var DP; function P1e() { if (DP) return dm.exports; DP = 1; var t = C1e(), e = T1e(), n = k1e(), r = N1e(); dm.exports = i, dm.exports.Negotiator = i; function i(o) { if (!(this instanceof i)) return new i(o); this.request = o; } return i.prototype.charset = function(a) { var s = this.charsets(a); return s && s[0]; }, i.prototype.charsets = function(a) { return t(this.request.headers["accept-charset"], a); }, i.prototype.encoding = function(a, s) { var c = this.encodings(a, s); return c && c[0]; }, i.prototype.encodings = function(a, s) { return e(this.request.headers["accept-encoding"], a, s); }, i.prototype.language = function(a) { var s = this.languages(a); return s && s[0]; }, i.prototype.languages = function(a) { return n(this.request.headers["accept-language"], a); }, i.prototype.mediaType = function(a) { var s = this.mediaTypes(a); return s && s[0]; }, i.prototype.mediaTypes = function(a) { return r(this.request.headers.accept, a); }, i.prototype.preferredCharset = i.prototype.charset, i.prototype.preferredCharsets = i.prototype.charsets, i.prototype.preferredEncoding = i.prototype.encoding, i.prototype.preferredEncodings = i.prototype.encodings, i.prototype.preferredLanguage = i.prototype.language, i.prototype.preferredLanguages = i.prototype.languages, i.prototype.preferredMediaType = i.prototype.mediaType, i.prototype.preferredMediaTypes = i.prototype.mediaTypes, dm.exports; } var fd = { exports: {} }; /*! * bytes * Copyright(c) 2012-2014 TJ Holowaychuk * Copyright(c) 2015 Jed Watson * MIT Licensed */ var OP; function D1e() { if (OP) return fd.exports; OP = 1, fd.exports = i, fd.exports.format = o, fd.exports.parse = a; var t = /\B(?=(\d{3})+(?!\d))/g, e = /(?:\.0*|(\.[^0]+)0+)$/, n = { b: 1, kb: 1024, mb: 1 << 20, gb: 1 << 30, tb: Math.pow(1024, 4), pb: Math.pow(1024, 5) }, r = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; function i(s, c) { return typeof s == "string" ? a(s) : typeof s == "number" ? o(s, c) : null; } function o(s, c) { if (!Number.isFinite(s)) return null; var u = Math.abs(s), d = c && c.thousandsSeparator || "", p = c && c.unitSeparator || "", f = c && c.decimalPlaces !== void 0 ? c.decimalPlaces : 2, m = !!(c && c.fixedDecimals), h = c && c.unit || ""; (!h || !n[h.toLowerCase()]) && (u >= n.pb ? h = "PB" : u >= n.tb ? h = "TB" : u >= n.gb ? h = "GB" : u >= n.mb ? h = "MB" : u >= n.kb ? h = "KB" : h = "B"); var y = s / n[h.toLowerCase()], x = y.toFixed(f); return m || (x = x.replace(e, "$1")), d && (x = x.split(".").map(function(g, b) { return b === 0 ? g.replace(t, d) : g; }).join(".")), x + p + h; } function a(s) { if (typeof s == "number" && !isNaN(s)) return s; if (typeof s != "string") return null; var c = r.exec(s), u, d = "b"; return c ? (u = parseFloat(c[1]), d = c[4].toLowerCase()) : (u = parseInt(s, 10), d = "b"), isNaN(u) ? null : Math.floor(n[d] * u); } return fd.exports; } const O1e = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/3gpp-ims+xml": { source: "iana", compressible: !0 }, "application/3gpphal+json": { source: "iana", compressible: !0 }, "application/3gpphalforms+json": { source: "iana", compressible: !0 }, "application/a2l": { source: "iana" }, "application/ace+cbor": { source: "iana" }, "application/ace+json": { source: "iana", compressible: !0 }, "application/ace-groupcomm+cbor": { source: "iana" }, "application/ace-trl+cbor": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: !0 }, "application/aif+cbor": { source: "iana" }, "application/aif+json": { source: "iana", compressible: !0 }, "application/alto-cdni+json": { source: "iana", compressible: !0 }, "application/alto-cdnifilter+json": { source: "iana", compressible: !0 }, "application/alto-costmap+json": { source: "iana", compressible: !0 }, "application/alto-costmapfilter+json": { source: "iana", compressible: !0 }, "application/alto-directory+json": { source: "iana", compressible: !0 }, "application/alto-endpointcost+json": { source: "iana", compressible: !0 }, "application/alto-endpointcostparams+json": { source: "iana", compressible: !0 }, "application/alto-endpointprop+json": { source: "iana", compressible: !0 }, "application/alto-endpointpropparams+json": { source: "iana", compressible: !0 }, "application/alto-error+json": { source: "iana", compressible: !0 }, "application/alto-networkmap+json": { source: "iana", compressible: !0 }, "application/alto-networkmapfilter+json": { source: "iana", compressible: !0 }, "application/alto-propmap+json": { source: "iana", compressible: !0 }, "application/alto-propmapparams+json": { source: "iana", compressible: !0 }, "application/alto-tips+json": { source: "iana", compressible: !0 }, "application/alto-tipsparams+json": { source: "iana", compressible: !0 }, "application/alto-updatestreamcontrol+json": { source: "iana", compressible: !0 }, "application/alto-updatestreamparams+json": { source: "iana", compressible: !0 }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/appinstaller": { compressible: !1, extensions: ["appinstaller"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/appx": { compressible: !1, extensions: ["appx"] }, "application/appxbundle": { compressible: !1, extensions: ["appxbundle"] }, "application/at+jwt": { source: "iana" }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: !0, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: !0, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: !0, extensions: ["atomdeleted"] }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: !0, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: !0, extensions: ["dwd"] }, "application/atsc-dynamic-event-message": { source: "iana" }, "application/atsc-held+xml": { source: "iana", compressible: !0, extensions: ["held"] }, "application/atsc-rdt+json": { source: "iana", compressible: !0 }, "application/atsc-rsat+xml": { source: "iana", compressible: !0, extensions: ["rsat"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: !0 }, "application/automationml-aml+xml": { source: "iana", compressible: !0, extensions: ["aml"] }, "application/automationml-amlx+zip": { source: "iana", compressible: !1, extensions: ["amlx"] }, "application/bacnet-xdd+zip": { source: "iana", compressible: !1 }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: !1, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/bufr": { source: "iana" }, "application/c2pa": { source: "iana" }, "application/calendar+json": { source: "iana", compressible: !0 }, "application/calendar+xml": { source: "iana", compressible: !0, extensions: ["xcs"] }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/captive+json": { source: "iana", compressible: !0 }, "application/cbor": { source: "iana" }, "application/cbor-seq": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: !0 }, "application/ccxml+xml": { source: "iana", compressible: !0, extensions: ["ccxml"] }, "application/cda+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/cdfx+xml": { source: "iana", compressible: !0, extensions: ["cdfx"] }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/ce+cbor": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: !0 }, "application/cellml+xml": { source: "iana", compressible: !0 }, "application/cfw": { source: "iana" }, "application/cid-edhoc+cbor-seq": { source: "iana" }, "application/city+json": { source: "iana", compressible: !0 }, "application/city+json-seq": { source: "iana" }, "application/clr": { source: "iana" }, "application/clue+xml": { source: "iana", compressible: !0 }, "application/clue_info+xml": { source: "iana", compressible: !0 }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: !0 }, "application/coap-eap": { source: "iana" }, "application/coap-group+json": { source: "iana", compressible: !0 }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/concise-problem-details+cbor": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: !0 }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cose-x509": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: !0, extensions: ["cpl"] }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: !0 }, "application/cstadata+xml": { source: "iana", compressible: !0 }, "application/csvm+json": { source: "iana", compressible: !0 }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwl": { source: "iana", extensions: ["cwl"] }, "application/cwl+json": { source: "iana", compressible: !0 }, "application/cwl+yaml": { source: "iana" }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: !0 }, "application/dash+xml": { source: "iana", compressible: !0, extensions: ["mpd"] }, "application/dash-patch+xml": { source: "iana", compressible: !0, extensions: ["mpp"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: !0, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: !0 }, "application/dicom": { source: "iana", extensions: ["dcm"] }, "application/dicom+json": { source: "iana", compressible: !0 }, "application/dicom+xml": { source: "iana", compressible: !0 }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: !0 }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: !0, extensions: ["dbk"] }, "application/dots+cbor": { source: "iana" }, "application/dpop+jwt": { source: "iana" }, "application/dskpp+xml": { source: "iana", compressible: !0 }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", compressible: !0, extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/eat+cwt": { source: "iana" }, "application/eat+jwt": { source: "iana" }, "application/eat-bun+cbor": { source: "iana" }, "application/eat-bun+json": { source: "iana", compressible: !0 }, "application/eat-ucs+cbor": { source: "iana" }, "application/eat-ucs+json": { source: "iana", compressible: !0 }, "application/ecmascript": { source: "apache", compressible: !0, extensions: ["ecma"] }, "application/edhoc+cbor-seq": { source: "iana" }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: !1 }, "application/edifact": { source: "iana", compressible: !1 }, "application/efi": { source: "iana" }, "application/elm+json": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/elm+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.control+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.legacyesn+json": { source: "iana", compressible: !0 }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: !0 }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: !0 }, "application/emma+xml": { source: "iana", compressible: !0, extensions: ["emma"] }, "application/emotionml+xml": { source: "iana", compressible: !0, extensions: ["emotionml"] }, "application/encaprtp": { source: "iana" }, "application/entity-statement+jwt": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: !0 }, "application/epub+zip": { source: "iana", compressible: !1, extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/expect-ct-report+json": { source: "iana", compressible: !0 }, "application/express": { source: "iana", extensions: ["exp"] }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdf": { source: "iana", extensions: ["fdf"] }, "application/fdt+xml": { source: "iana", compressible: !0, extensions: ["fdt"] }, "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/fido.trusted-apps+json": { compressible: !0 }, "application/fits": { source: "iana" }, "application/flexfec": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: !1 }, "application/framework-attributes+xml": { source: "iana", compressible: !0 }, "application/geo+json": { source: "iana", compressible: !0, extensions: ["geojson"] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geopose+json": { source: "iana", compressible: !0 }, "application/geoxacml+json": { source: "iana", compressible: !0 }, "application/geoxacml+xml": { source: "iana", compressible: !0 }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: !0, extensions: ["gml"] }, "application/gnap-binding-jws": { source: "iana" }, "application/gnap-binding-jwsd": { source: "iana" }, "application/gnap-binding-rotation-jws": { source: "iana" }, "application/gnap-binding-rotation-jwsd": { source: "iana" }, "application/gpx+xml": { source: "apache", compressible: !0, extensions: ["gpx"] }, "application/grib": { source: "iana" }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: !1, extensions: ["gz"] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: !0 }, "application/hjson": { extensions: ["hjson"] }, "application/hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana", compressible: !0 }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: !0 }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: !0, extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: !0, extensions: ["its"] }, "application/java-archive": { source: "iana", compressible: !1, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: !1, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: !1, extensions: ["class"] }, "application/javascript": { source: "apache", charset: "UTF-8", compressible: !0, extensions: ["js"] }, "application/jf2feed+json": { source: "iana", compressible: !0 }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: !0 }, "application/jrd+json": { source: "iana", compressible: !0 }, "application/jscalendar+json": { source: "iana", compressible: !0 }, "application/jscontact+json": { source: "iana", compressible: !0 }, "application/json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: !0 }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: !0, extensions: ["jsonml"] }, "application/jsonpath": { source: "iana" }, "application/jwk+json": { source: "iana", compressible: !0 }, "application/jwk-set+json": { source: "iana", compressible: !0 }, "application/jwk-set+jwt": { source: "iana" }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: !0 }, "application/kpml-response+xml": { source: "iana", compressible: !0 }, "application/ld+json": { source: "iana", compressible: !0, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana", compressible: !0, extensions: ["lgr"] }, "application/link-format": { source: "iana" }, "application/linkset": { source: "iana" }, "application/linkset+json": { source: "iana", compressible: !0 }, "application/load-control+xml": { source: "iana", compressible: !0 }, "application/logout+jwt": { source: "iana" }, "application/lost+xml": { source: "iana", compressible: !0, extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana", compressible: !0 }, "application/lpf+zip": { source: "iana", compressible: !1 }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: !0, extensions: ["mads"] }, "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", compressible: !0, extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", compressible: !0, extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana", compressible: !0 }, "application/mathml-presentation+xml": { source: "iana", compressible: !0 }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: !0 }, "application/mbms-deregister+xml": { source: "iana", compressible: !0 }, "application/mbms-envelope+xml": { source: "iana", compressible: !0 }, "application/mbms-msk+xml": { source: "iana", compressible: !0 }, "application/mbms-msk-response+xml": { source: "iana", compressible: !0 }, "application/mbms-protection-description+xml": { source: "iana", compressible: !0 }, "application/mbms-reception-report+xml": { source: "iana", compressible: !0 }, "application/mbms-register+xml": { source: "iana", compressible: !0 }, "application/mbms-register-response+xml": { source: "iana", compressible: !0 }, "application/mbms-schedule+xml": { source: "iana", compressible: !0 }, "application/mbms-user-service-description+xml": { source: "iana", compressible: !0 }, "application/mbox": { source: "iana", extensions: ["mbox"] }, "application/media-policy-dataset+xml": { source: "iana", compressible: !0, extensions: ["mpf"] }, "application/media_control+xml": { source: "iana", compressible: !0 }, "application/mediaservercontrol+xml": { source: "iana", compressible: !0, extensions: ["mscml"] }, "application/merge-patch+json": { source: "iana", compressible: !0 }, "application/metalink+xml": { source: "apache", compressible: !0, extensions: ["metalink"] }, "application/metalink4+xml": { source: "iana", compressible: !0, extensions: ["meta4"] }, "application/mets+xml": { source: "iana", compressible: !0, extensions: ["mets"] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mipc": { source: "iana" }, "application/missing-blocks+cbor-seq": { source: "iana" }, "application/mmt-aei+xml": { source: "iana", compressible: !0, extensions: ["maei"] }, "application/mmt-usd+xml": { source: "iana", compressible: !0, extensions: ["musd"] }, "application/mods+xml": { source: "iana", compressible: !0, extensions: ["mods"] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: ["m21", "mp21"] }, "application/mp4": { source: "iana", extensions: ["mp4", "mpg4", "mp4s", "m4p"] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana", compressible: !0 }, "application/mrb-publish+xml": { source: "iana", compressible: !0 }, "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/msix": { compressible: !1, extensions: ["msix"] }, "application/msixbundle": { compressible: !1, extensions: ["msixbundle"] }, "application/msword": { source: "iana", compressible: !1, extensions: ["doc", "dot"] }, "application/mud+json": { source: "iana", compressible: !0 }, "application/multipart-core": { source: "iana" }, "application/mxf": { source: "iana", extensions: ["mxf"] }, "application/n-quads": { source: "iana", extensions: ["nq"] }, "application/n-triples": { source: "iana", extensions: ["nt"] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana", charset: "US-ASCII" }, "application/news-groupinfo": { source: "iana", charset: "US-ASCII" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana", compressible: !0 }, "application/node": { source: "iana", extensions: ["cjs"] }, "application/nss": { source: "iana" }, "application/oauth-authz-req+jwt": { source: "iana" }, "application/oblivious-dns-message": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: !0, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] }, "application/oda": { source: "iana", extensions: ["oda"] }, "application/odm+xml": { source: "iana", compressible: !0 }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", compressible: !0, extensions: ["opf"] }, "application/ogg": { source: "iana", compressible: !1, extensions: ["ogx"] }, "application/ohttp-keys": { source: "iana" }, "application/omdoc+xml": { source: "apache", compressible: !0, extensions: ["omdoc"] }, "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg", "one", "onea"] }, "application/opc-nodeset+xml": { source: "iana", compressible: !0 }, "application/oscore": { source: "iana" }, "application/oxps": { source: "iana", extensions: ["oxps"] }, "application/p21": { source: "iana" }, "application/p21+zip": { source: "iana", compressible: !1 }, "application/p2p-overlay+xml": { source: "iana", compressible: !0, extensions: ["relo"] }, "application/parityfec": { source: "iana" }, "application/passport": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", compressible: !0, extensions: ["xer"] }, "application/pdf": { source: "iana", compressible: !1, extensions: ["pdf"] }, "application/pdx": { source: "iana" }, "application/pem-certificate-chain": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: !1, extensions: ["pgp"] }, "application/pgp-keys": { source: "iana", extensions: ["asc"] }, "application/pgp-signature": { source: "iana", extensions: ["sig", "asc"] }, "application/pics-rules": { source: "apache", extensions: ["prf"] }, "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/pkcs10": { source: "iana", extensions: ["p10"] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] }, "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] }, "application/pkcs8": { source: "iana", extensions: ["p8"] }, "application/pkcs8-encrypted": { source: "iana" }, "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] }, "application/pkix-cert": { source: "iana", extensions: ["cer"] }, "application/pkix-crl": { source: "iana", extensions: ["crl"] }, "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] }, "application/pkixcmp": { source: "iana", extensions: ["pki"] }, "application/pls+xml": { source: "iana", compressible: !0, extensions: ["pls"] }, "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/postscript": { source: "iana", compressible: !0, extensions: ["ai", "eps", "ps"] }, "application/ppsp-tracker+json": { source: "iana", compressible: !0 }, "application/private-token-issuer-directory": { source: "iana" }, "application/private-token-request": { source: "iana" }, "application/private-token-response": { source: "iana" }, "application/problem+json": { source: "iana", compressible: !0 }, "application/problem+xml": { source: "iana", compressible: !0 }, "application/provenance+xml": { source: "iana", compressible: !0, extensions: ["provx"] }, "application/provided-claims+jwt": { source: "iana" }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: ["cww"] }, "application/prs.cyn": { source: "iana", charset: "7-BIT" }, "application/prs.hpub+zip": { source: "iana", compressible: !1 }, "application/prs.implied-document+xml": { source: "iana", compressible: !0 }, "application/prs.implied-executable": { source: "iana" }, "application/prs.implied-object+json": { source: "iana", compressible: !0 }, "application/prs.implied-object+json-seq": { source: "iana" }, "application/prs.implied-object+yaml": { source: "iana" }, "application/prs.implied-structure": { source: "iana" }, "application/prs.mayfile": { source: "iana" }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.vcfbzip2": { source: "iana" }, "application/prs.xsf+xml": { source: "iana", compressible: !0, extensions: ["xsf"] }, "application/pskc+xml": { source: "iana", compressible: !0, extensions: ["pskcxml"] }, "application/pvd+json": { source: "iana", compressible: !0 }, "application/qsig": { source: "iana" }, "application/raml+yaml": { compressible: !0, extensions: ["raml"] }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: !0 }, "application/rdf+xml": { source: "iana", compressible: !0, extensions: ["rdf", "owl"] }, "application/reginfo+xml": { source: "iana", compressible: !0, extensions: ["rif"] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] }, "application/remote-printing": { source: "apache" }, "application/reputon+json": { source: "iana", compressible: !0 }, "application/resolve-response+jwt": { source: "iana" }, "application/resource-lists+xml": { source: "iana", compressible: !0, extensions: ["rl"] }, "application/resource-lists-diff+xml": { source: "iana", compressible: !0, extensions: ["rld"] }, "application/rfc+xml": { source: "iana", compressible: !0 }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana", compressible: !0 }, "application/rls-services+xml": { source: "iana", compressible: !0, extensions: ["rs"] }, "application/route-apd+xml": { source: "iana", compressible: !0, extensions: ["rapd"] }, "application/route-s-tsid+xml": { source: "iana", compressible: !0, extensions: ["sls"] }, "application/route-usd+xml": { source: "iana", compressible: !0, extensions: ["rusd"] }, "application/rpki-checklist": { source: "iana" }, "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] }, "application/rpki-manifest": { source: "iana", extensions: ["mft"] }, "application/rpki-publication": { source: "iana" }, "application/rpki-roa": { source: "iana", extensions: ["roa"] }, "application/rpki-signed-tal": { source: "iana" }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", compressible: !0, extensions: ["rsd"] }, "application/rss+xml": { source: "apache", compressible: !0, extensions: ["rss"] }, "application/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana", compressible: !0 }, "application/samlmetadata+xml": { source: "iana", compressible: !0 }, "application/sarif+json": { source: "iana", compressible: !0 }, "application/sarif-external-properties+json": { source: "iana", compressible: !0 }, "application/sbe": { source: "iana" }, "application/sbml+xml": { source: "iana", compressible: !0, extensions: ["sbml"] }, "application/scaip+xml": { source: "iana", compressible: !0 }, "application/scim+json": { source: "iana", compressible: !0 }, "application/scvp-cv-request": { source: "iana", extensions: ["scq"] }, "application/scvp-cv-response": { source: "iana", extensions: ["scs"] }, "application/scvp-vp-request": { source: "iana", extensions: ["spq"] }, "application/scvp-vp-response": { source: "iana", extensions: ["spp"] }, "application/sdp": { source: "iana", extensions: ["sdp"] }, "application/secevent+jwt": { source: "iana" }, "application/senml+cbor": { source: "iana" }, "application/senml+json": { source: "iana", compressible: !0 }, "application/senml+xml": { source: "iana", compressible: !0, extensions: ["senmlx"] }, "application/senml-etch+cbor": { source: "iana" }, "application/senml-etch+json": { source: "iana", compressible: !0 }, "application/senml-exi": { source: "iana" }, "application/sensml+cbor": { source: "iana" }, "application/sensml+json": { source: "iana", compressible: !0 }, "application/sensml+xml": { source: "iana", compressible: !0, extensions: ["sensmlx"] }, "application/sensml-exi": { source: "iana" }, "application/sep+xml": { source: "iana", compressible: !0 }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", compressible: !0, extensions: ["shf"] }, "application/sieve": { source: "iana", extensions: ["siv", "sieve"] }, "application/simple-filter+xml": { source: "iana", compressible: !0 }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/sipc": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "apache" }, "application/smil+xml": { source: "iana", compressible: !0, extensions: ["smi", "smil"] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: !0 }, "application/sparql-query": { source: "iana", extensions: ["rq"] }, "application/sparql-results+xml": { source: "iana", compressible: !0, extensions: ["srx"] }, "application/spdx+json": { source: "iana", compressible: !0 }, "application/spirits-event+xml": { source: "iana", compressible: !0 }, "application/sql": { source: "iana", extensions: ["sql"] }, "application/srgs": { source: "iana", extensions: ["gram"] }, "application/srgs+xml": { source: "iana", compressible: !0, extensions: ["grxml"] }, "application/sru+xml": { source: "iana", compressible: !0, extensions: ["sru"] }, "application/ssdl+xml": { source: "apache", compressible: !0, extensions: ["ssdl"] }, "application/sslkeylogfile": { source: "iana" }, "application/ssml+xml": { source: "iana", compressible: !0, extensions: ["ssml"] }, "application/st2110-41": { source: "iana" }, "application/stix+json": { source: "iana", compressible: !0 }, "application/stratum": { source: "iana" }, "application/swid+cbor": { source: "iana" }, "application/swid+xml": { source: "iana", compressible: !0, extensions: ["swidtag"] }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: !0 }, "application/taxii+json": { source: "iana", compressible: !0 }, "application/td+json": { source: "iana", compressible: !0 }, "application/tei+xml": { source: "iana", compressible: !0, extensions: ["tei", "teicorpus"] }, "application/tetra_isi": { source: "iana" }, "application/thraud+xml": { source: "iana", compressible: !0, extensions: ["tfi"] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: ["tsd"] }, "application/tlsrpt+gzip": { source: "iana" }, "application/tlsrpt+json": { source: "iana", compressible: !0 }, "application/tm+json": { source: "iana", compressible: !0 }, "application/tnauthlist": { source: "iana" }, "application/toc+cbor": { source: "iana" }, "application/token-introspection+jwt": { source: "iana" }, "application/toml": { source: "iana", compressible: !0, extensions: ["toml"] }, "application/trickle-ice-sdpfrag": { source: "iana" }, "application/trig": { source: "iana", extensions: ["trig"] }, "application/trust-chain+json": { source: "iana", compressible: !0 }, "application/trust-mark+jwt": { source: "iana" }, "application/trust-mark-delegation+jwt": { source: "iana" }, "application/ttml+xml": { source: "iana", compressible: !0, extensions: ["ttml"] }, "application/tve-trigger": { source: "iana" }, "application/tzif": { source: "iana" }, "application/tzif-leap": { source: "iana" }, "application/ubjson": { compressible: !1, extensions: ["ubj"] }, "application/uccs+cbor": { source: "iana" }, "application/ujcs+json": { source: "iana", compressible: !0 }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana", compressible: !0 }, "application/urc-ressheet+xml": { source: "iana", compressible: !0, extensions: ["rsheet"] }, "application/urc-targetdesc+xml": { source: "iana", compressible: !0, extensions: ["td"] }, "application/urc-uisocketdesc+xml": { source: "iana", compressible: !0 }, "application/vc": { source: "iana" }, "application/vc+cose": { source: "iana" }, "application/vc+jwt": { source: "iana" }, "application/vcard+json": { source: "iana", compressible: !0 }, "application/vcard+xml": { source: "iana", compressible: !0 }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: !0, extensions: ["1km"] }, "application/vnd.1ob": { source: "iana" }, "application/vnd.3gpp-prose+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc3a+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc3ach+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-prose-pc8+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp-v2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.5gnas": { source: "iana" }, "application/vnd.3gpp.5gsa2x": { source: "iana" }, "application/vnd.3gpp.5gsa2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.5gsv2x": { source: "iana" }, "application/vnd.3gpp.5gsv2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.crs+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.current-location-discovery+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.gtpc": { source: "iana" }, "application/vnd.3gpp.interworking-data": { source: "iana" }, "application/vnd.3gpp.lpp": { source: "iana" }, "application/vnd.3gpp.mc-signalling-ear": { source: "iana" }, "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-msgstore-ctrl-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-payload": { source: "iana" }, "application/vnd.3gpp.mcdata-regroup+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-signalling": { source: "iana" }, "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-regroup+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-regroup+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.ngap": { source: "iana" }, "application/vnd.3gpp.pfcp": { source: "iana" }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] }, "application/vnd.3gpp.pinapp-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.s1ap": { source: "iana" }, "application/vnd.3gpp.seal-group-doc+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-location-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-mbms-usage-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-network-qos-management-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-ue-config-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-unicast-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.seal-user-profile-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp.v2x": { source: "iana" }, "application/vnd.3gpp.vae-info+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] }, "application/vnd.acm.addressxfer+json": { source: "iana", compressible: !0 }, "application/vnd.acm.chatbot+json": { source: "iana", compressible: !0 }, "application/vnd.acucobol": { source: "iana", extensions: ["acu"] }, "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: !1, extensions: ["air"] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] }, "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", compressible: !0, extensions: ["xdp"] }, "application/vnd.adobe.xfdf": { source: "apache", extensions: ["xfdf"] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.afpc.afplinedata": { source: "iana" }, "application/vnd.afpc.afplinedata-pagedef": { source: "iana" }, "application/vnd.afpc.cmoca-cmresource": { source: "iana" }, "application/vnd.afpc.foca-charset": { source: "iana" }, "application/vnd.afpc.foca-codedfont": { source: "iana" }, "application/vnd.afpc.foca-codepage": { source: "iana" }, "application/vnd.afpc.modca": { source: "iana" }, "application/vnd.afpc.modca-cmtable": { source: "iana" }, "application/vnd.afpc.modca-formdef": { source: "iana" }, "application/vnd.afpc.modca-mediummap": { source: "iana" }, "application/vnd.afpc.modca-objectcontainer": { source: "iana" }, "application/vnd.afpc.modca-overlay": { source: "iana" }, "application/vnd.afpc.modca-pagesegment": { source: "iana" }, "application/vnd.age": { source: "iana", extensions: ["age"] }, "application/vnd.ah-barcode": { source: "apache" }, "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] }, "application/vnd.amadeus+json": { source: "iana", compressible: !0 }, "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] }, "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] }, "application/vnd.amundsen.maze+xml": { source: "iana", compressible: !0 }, "application/vnd.android.ota": { source: "iana" }, "application/vnd.android.package-archive": { source: "apache", compressible: !1, extensions: ["apk"] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] }, "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] }, "application/vnd.apache.arrow.file": { source: "iana" }, "application/vnd.apache.arrow.stream": { source: "iana" }, "application/vnd.apache.parquet": { source: "iana" }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.apexlang": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: !0 }, "application/vnd.aplextor.warrp+json": { source: "iana", compressible: !0 }, "application/vnd.apothekende.reservation+json": { source: "iana", compressible: !0 }, "application/vnd.apple.installer+xml": { source: "iana", compressible: !0, extensions: ["mpkg"] }, "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] }, "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] }, "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] }, "application/vnd.apple.pkpass": { compressible: !1, extensions: ["pkpass"] }, "application/vnd.arastra.swi": { source: "apache" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] }, "application/vnd.artisan+json": { source: "iana", compressible: !0 }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] }, "application/vnd.audiograph": { source: "iana", extensions: ["aep"] }, "application/vnd.autodesk.fbx": { extensions: ["fbx"] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avalon+json": { source: "iana", compressible: !0 }, "application/vnd.avistar+xml": { source: "iana", compressible: !0 }, "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: !0, extensions: ["bmml"] }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.banana-accounting": { source: "iana" }, "application/vnd.bbf.usp.error": { source: "iana" }, "application/vnd.bbf.usp.msg": { source: "iana" }, "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: !0 }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: !0 }, "application/vnd.belightsoft.lhzd+zip": { source: "iana", compressible: !1 }, "application/vnd.belightsoft.lhzl+zip": { source: "iana", compressible: !1 }, "application/vnd.bint.med-content": { source: "iana" }, "application/vnd.biopax.rdf+xml": { source: "iana", compressible: !0 }, "application/vnd.blink-idb-value-wrapper": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: ["bmi"] }, "application/vnd.bpf": { source: "iana" }, "application/vnd.bpf3": { source: "iana" }, "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] }, "application/vnd.byu.uapi+json": { source: "iana", compressible: !0 }, "application/vnd.bzip3": { source: "iana" }, "application/vnd.c3voc.schedule+xml": { source: "iana", compressible: !0 }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.capasystems-pg+json": { source: "iana", compressible: !0 }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", compressible: !0, extensions: ["cdxml"] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] }, "application/vnd.ciedi": { source: "iana" }, "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana", compressible: !0, extensions: ["csl"] }, "application/vnd.claymore": { source: "iana", extensions: ["cla"] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] }, "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] }, "application/vnd.cncf.helm.chart.content.v1.tar+gzip": { source: "iana" }, "application/vnd.cncf.helm.chart.provenance.v1.prov": { source: "iana" }, "application/vnd.cncf.helm.config.v1+json": { source: "iana", compressible: !0 }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collabio.xodocuments.document": { source: "iana" }, "application/vnd.collabio.xodocuments.document-template": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: !0 }, "application/vnd.collection.doc+json": { source: "iana", compressible: !0 }, "application/vnd.collection.next+json": { source: "iana", compressible: !0 }, "application/vnd.comicbook+zip": { source: "iana", compressible: !1 }, "application/vnd.comicbook-rar": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: ["csp"] }, "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: !0 }, "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] }, "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: !0, extensions: ["wbs"] }, "application/vnd.cryptii.pipe+json": { source: "iana", compressible: !0 }, "application/vnd.crypto-shade-file": { source: "iana" }, "application/vnd.cryptomator.encrypted": { source: "iana" }, "application/vnd.cryptomator.vault": { source: "iana" }, "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] }, "application/vnd.ctct.ws+xml": { source: "iana", compressible: !0 }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: ["car"] }, "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: !0 }, "application/vnd.cybank": { source: "iana" }, "application/vnd.cyclonedx+json": { source: "iana", compressible: !0 }, "application/vnd.cyclonedx+xml": { source: "iana", compressible: !0 }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: !1 }, "application/vnd.d3m-dataset": { source: "iana" }, "application/vnd.d3m-problem": { source: "iana" }, "application/vnd.dart": { source: "iana", compressible: !0, extensions: ["dart"] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] }, "application/vnd.datalog": { source: "iana" }, "application/vnd.datapackage+json": { source: "iana", compressible: !0 }, "application/vnd.dataresource+json": { source: "iana", compressible: !0 }, "application/vnd.dbf": { source: "iana", extensions: ["dbf"] }, "application/vnd.dcmp+xml": { source: "iana", compressible: !0, extensions: ["dcmp"] }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] }, "application/vnd.dece.ttml+xml": { source: "iana", compressible: !0, extensions: ["uvt", "uvvt"] }, "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] }, "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] }, "application/vnd.desmume.movie": { source: "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana", compressible: !0 }, "application/vnd.dna": { source: "iana", extensions: ["dna"] }, "application/vnd.document+json": { source: "iana", compressible: !0 }, "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] }, "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] }, "application/vnd.drive+json": { source: "iana", compressible: !0 }, "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] }, "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: !0 }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: ["geo"] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecip.rlp": { source: "iana" }, "application/vnd.eclipse.ditto+json": { source: "iana", compressible: !0 }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.efi.img": { source: "iana" }, "application/vnd.efi.iso": { source: "iana" }, "application/vnd.eln+zip": { source: "iana", compressible: !1 }, "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: !0 }, "application/vnd.enliven": { source: "iana", extensions: ["nml"] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana", compressible: !0 }, "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] }, "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] }, "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] }, "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] }, "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.erofs": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana", compressible: !1 }, "application/vnd.eszigno3+xml": { source: "iana", compressible: !0, extensions: ["es3", "et3"] }, "application/vnd.etsi.aoc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: !1 }, "application/vnd.etsi.cug+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mcid+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.pstn+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.sci+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.simservs+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana", compressible: !0 }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: !0 }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.evolv.ecig.profile": { source: "iana" }, "application/vnd.evolv.ecig.settings": { source: "iana" }, "application/vnd.evolv.ecig.theme": { source: "iana" }, "application/vnd.exstream-empower+zip": { source: "iana", compressible: !1 }, "application/vnd.exstream-package": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] }, "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: !1 }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "apache", extensions: ["fdf"] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] }, "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] }, "application/vnd.fdsn.stationxml+xml": { source: "iana", charset: "XML-BASED", compressible: !0 }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.ficlab.flb+zip": { source: "iana", compressible: !1 }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: ["gph"] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] }, "application/vnd.freelog.comic": { source: "iana" }, "application/vnd.frogans.fnc": { source: "apache", extensions: ["fnc"] }, "application/vnd.frogans.ltf": { source: "apache", extensions: ["ltf"] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] }, "application/vnd.fujifilm.fb.docuworks": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" }, "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: !0 }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.futoin+cbor": { source: "iana" }, "application/vnd.futoin+json": { source: "iana", compressible: !0 }, "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] }, "application/vnd.ga4gh.passport+jwt": { source: "iana" }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] }, "application/vnd.genozip": { source: "iana" }, "application/vnd.gentics.grd+json": { source: "iana", compressible: !0 }, "application/vnd.gentoo.catmetadata+xml": { source: "iana", compressible: !0 }, "application/vnd.gentoo.ebuild": { source: "iana" }, "application/vnd.gentoo.eclass": { source: "iana" }, "application/vnd.gentoo.gpkg": { source: "iana" }, "application/vnd.gentoo.manifest": { source: "iana" }, "application/vnd.gentoo.pkgmetadata+xml": { source: "iana", compressible: !0 }, "application/vnd.gentoo.xpak": { source: "iana" }, "application/vnd.geo+json": { source: "apache", compressible: !0 }, "application/vnd.geocube+xml": { source: "apache", compressible: !0 }, "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] }, "application/vnd.geogebra.pinboard": { source: "iana" }, "application/vnd.geogebra.slides": { source: "iana", extensions: ["ggs"] }, "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] }, "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] }, "application/vnd.geonext": { source: "iana", extensions: ["gxt"] }, "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] }, "application/vnd.geospace": { source: "iana", extensions: ["g3w"] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: ["gmx"] }, "application/vnd.gnu.taler.exchange+json": { source: "iana", compressible: !0 }, "application/vnd.gnu.taler.merchant+json": { source: "iana", compressible: !0 }, "application/vnd.google-apps.audio": {}, "application/vnd.google-apps.document": { compressible: !1, extensions: ["gdoc"] }, "application/vnd.google-apps.drawing": { compressible: !1, extensions: ["gdraw"] }, "application/vnd.google-apps.drive-sdk": { compressible: !1 }, "application/vnd.google-apps.file": {}, "application/vnd.google-apps.folder": { compressible: !1 }, "application/vnd.google-apps.form": { compressible: !1, extensions: ["gform"] }, "application/vnd.google-apps.fusiontable": {}, "application/vnd.google-apps.jam": { compressible: !1, extensions: ["gjam"] }, "application/vnd.google-apps.mail-layout": {}, "application/vnd.google-apps.map": { compressible: !1, extensions: ["gmap"] }, "application/vnd.google-apps.photo": {}, "application/vnd.google-apps.presentation": { compressible: !1, extensions: ["gslides"] }, "application/vnd.google-apps.script": { compressible: !1, extensions: ["gscript"] }, "application/vnd.google-apps.shortcut": {}, "application/vnd.google-apps.site": { compressible: !1, extensions: ["gsite"] }, "application/vnd.google-apps.spreadsheet": { compressible: !1, extensions: ["gsheet"] }, "application/vnd.google-apps.unknown": {}, "application/vnd.google-apps.video": {}, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: !0, extensions: ["kml"] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: !1, extensions: ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { source: "apache", compressible: !0 }, "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: !1 }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: !0, extensions: ["xdcf"] }, "application/vnd.gpxsee.map+xml": { source: "iana", compressible: !0 }, "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: ["gac"] }, "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] }, "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] }, "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] }, "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] }, "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] }, "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] }, "application/vnd.hal+json": { source: "iana", compressible: !0 }, "application/vnd.hal+xml": { source: "iana", compressible: !0, extensions: ["hal"] }, "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: !0, extensions: ["zmm"] }, "application/vnd.hbci": { source: "iana", extensions: ["hbci"] }, "application/vnd.hc+json": { source: "iana", compressible: !0 }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: !0 }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] }, "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] }, "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] }, "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] }, "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] }, "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] }, "application/vnd.hsl": { source: "iana" }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] }, "application/vnd.hyper+json": { source: "iana", compressible: !0 }, "application/vnd.hyper-item+json": { source: "iana", compressible: !0 }, "application/vnd.hyperdrive+json": { source: "iana", compressible: !0 }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "apache" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] }, "application/vnd.ibm.modcap": { source: "apache", extensions: ["afp", "listafp", "list3820"] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] }, "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: ["igl"] }, "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: !1 }, "application/vnd.imagemeter.image+zip": { source: "iana", compressible: !1 }, "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] }, "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: !0 }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: !0 }, "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: !0 }, "application/vnd.informix-visionary": { source: "apache" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana", compressible: !0 }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] }, "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] }, "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] }, "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] }, "application/vnd.ipfs.ipns-record": { source: "iana" }, "application/vnd.ipld.car": { source: "iana" }, "application/vnd.ipld.dag-cbor": { source: "iana" }, "application/vnd.ipld.dag-json": { source: "iana" }, "application/vnd.ipld.raw": { source: "iana" }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: !0 }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: !0 }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] }, "application/vnd.irepository.package+xml": { source: "iana", compressible: !0, extensions: ["irp"] }, "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] }, "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] }, "application/vnd.iso11783-10+zip": { source: "iana", compressible: !1 }, "application/vnd.jam": { source: "iana", extensions: ["jam"] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] }, "application/vnd.jisp": { source: "iana", extensions: ["jisp"] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] }, "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] }, "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] }, "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] }, "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] }, "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] }, "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] }, "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] }, "application/vnd.kdl": { source: "iana" }, "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] }, "application/vnd.keyman.kmp+zip": { source: "iana", compressible: !1 }, "application/vnd.keyman.kmx": { source: "iana" }, "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] }, "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] }, "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] }, "application/vnd.las": { source: "iana" }, "application/vnd.las.las+json": { source: "iana", compressible: !0 }, "application/vnd.las.las+xml": { source: "iana", compressible: !0, extensions: ["lasxml"] }, "application/vnd.laszip": { source: "iana" }, "application/vnd.ldev.productlicensing": { source: "iana" }, "application/vnd.leap+json": { source: "iana", compressible: !0 }, "application/vnd.liberty-request+xml": { source: "iana", compressible: !0 }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: !0, extensions: ["lbe"] }, "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: !1 }, "application/vnd.loom": { source: "iana" }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] }, "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] }, "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] }, "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] }, "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] }, "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] }, "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] }, "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: !0 }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: !0 }, "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: !1 }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: ["mcd"] }, "application/vnd.mdl": { source: "iana" }, "application/vnd.mdl-mbsdf": { source: "iana" }, "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] }, "application/vnd.medicalholodeck.recordxr": { source: "iana" }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mermaid": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: ["mwf"] }, "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] }, "application/vnd.micro+json": { source: "iana", compressible: !0 }, "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] }, "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: !0 }, "application/vnd.mif": { source: "iana", extensions: ["mif"] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] }, "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] }, "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] }, "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] }, "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] }, "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] }, "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] }, "application/vnd.modl": { source: "iana" }, "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] }, "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: !0, extensions: ["xul"] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: !1, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] }, "application/vnd.ms-fontobject": { source: "iana", compressible: !0, extensions: ["eot"] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] }, "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] }, "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] }, "application/vnd.ms-office.activex+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] }, "application/vnd.ms-opentype": { source: "apache", compressible: !0 }, "application/vnd.ms-outlook": { compressible: !1, extensions: ["msg"] }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] }, "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-powerpoint": { source: "iana", compressible: !1, extensions: ["ppt", "pps", "pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: !0 }, "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: !0 }, "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-visio.viewer": { extensions: ["vdx"] }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] }, "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] }, "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: !1, extensions: ["xps"] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: ["mseq"] }, "application/vnd.msgpack": { source: "iana" }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: ["mus"] }, "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] }, "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] }, "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: !0 }, "application/vnd.nato.bindingdataobject+cbor": { source: "iana" }, "application/vnd.nato.bindingdataobject+json": { source: "iana", compressible: !0 }, "application/vnd.nato.bindingdataobject+xml": { source: "iana", compressible: !0, extensions: ["bdo"] }, "application/vnd.nato.openxmlformats-package.iepd+zip": { source: "iana", compressible: !1 }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: !0 }, "application/vnd.nebumind.line": { source: "iana" }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] }, "application/vnd.nimn": { source: "iana" }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] }, "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] }, "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: !0, extensions: ["ac"] }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { source: "apache", extensions: ["n-gage"] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana", compressible: !0 }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] }, "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] }, "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] }, "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oai.workflows": { source: "iana" }, "application/vnd.oai.workflows+json": { source: "iana", compressible: !0 }, "application/vnd.oai.workflows+yaml": { source: "iana" }, "application/vnd.oasis.opendocument.base": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] }, "application/vnd.oasis.opendocument.database": { source: "apache", extensions: ["odb"] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: !1, extensions: ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: !1, extensions: ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: !1, extensions: ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: !1, extensions: ["odt"] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] }, "application/vnd.oasis.opendocument.text-master-template": { source: "iana" }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] }, "application/vnd.obn": { source: "iana" }, "application/vnd.ocf+cbor": { source: "iana" }, "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: !0 }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: !0 }, "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "apache", compressible: !0 }, "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "apache", compressible: !0 }, "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", compressible: !0, extensions: ["dd2"] }, "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+cbor": { source: "iana" }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: !0 }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: !0 }, "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: !0 }, "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.onepagertamp": { source: "iana" }, "application/vnd.onepagertamx": { source: "iana" }, "application/vnd.onepagertat": { source: "iana" }, "application/vnd.onepagertatp": { source: "iana" }, "application/vnd.onepagertatx": { source: "iana" }, "application/vnd.onvif.metadata": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana", compressible: !0, extensions: ["obgx"] }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] }, "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: !0, extensions: ["osm"] }, "application/vnd.opentimestamps.ots": { source: "iana" }, "application/vnd.openvpi.dspx+json": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: !1, extensions: ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: !1, extensions: ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: !1, extensions: ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: !0 }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: !0 }, "application/vnd.oracle.resource+json": { source: "iana", compressible: !0 }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] }, "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: !0 }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: !0 }, "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos.xml": { source: "iana" }, "application/vnd.patentdive": { source: "iana" }, "application/vnd.patientecommsdoc": { source: "iana" }, "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: ["str"] }, "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: ["efif"] }, "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] }, "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: !0 }, "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] }, "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] }, "application/vnd.procrate.brushset": { extensions: ["brushset"] }, "application/vnd.procreate.brush": { extensions: ["brush"] }, "application/vnd.procreate.dream": { extensions: ["drm"] }, "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] }, "application/vnd.psfs": { source: "iana" }, "application/vnd.pt.mundusmundi": { source: "iana" }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: !0, extensions: ["xhtm"] }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: !0 }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: !0 }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana", extensions: ["rar"] }, "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] }, "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: !0, extensions: ["musicxml"] }, "application/vnd.relpipe": { source: "iana" }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.resilient.logic": { source: "iana" }, "application/vnd.restful+json": { source: "iana", compressible: !0 }, "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] }, "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] }, "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] }, "application/vnd.route66.link66+xml": { source: "iana", compressible: !0, extensions: ["link66"] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] }, "application/vnd.sar": { source: "iana" }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: ["see"] }, "application/vnd.seis+json": { source: "iana", compressible: !0 }, "application/vnd.sema": { source: "iana", extensions: ["sema"] }, "application/vnd.semd": { source: "iana", extensions: ["semd"] }, "application/vnd.semf": { source: "iana", extensions: ["semf"] }, "application/vnd.shade-save-file": { source: "iana" }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] }, "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] }, "application/vnd.shootproof+json": { source: "iana", compressible: !0 }, "application/vnd.shopkick+json": { source: "iana", compressible: !0 }, "application/vnd.shp": { source: "iana" }, "application/vnd.shx": { source: "iana" }, "application/vnd.sigrok.session": { source: "iana" }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] }, "application/vnd.siren+json": { source: "iana", compressible: !0 }, "application/vnd.sketchometry": { source: "iana" }, "application/vnd.smaf": { source: "iana", extensions: ["mmf"] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] }, "application/vnd.smintio.portals.archive": { source: "iana" }, "application/vnd.snesdev-page-table": { source: "iana" }, "application/vnd.software602.filler.form+xml": { source: "iana", compressible: !0, extensions: ["fo"] }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", compressible: !0, extensions: ["sdkm", "sdkd"] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] }, "application/vnd.sqlite3": { source: "iana" }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] }, "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] }, "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] }, "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] }, "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] }, "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana", compressible: !0, extensions: ["wadl"] }, "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] }, "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] }, "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] }, "application/vnd.svd": { source: "iana", extensions: ["svd"] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.sybyl.mol2": { source: "iana" }, "application/vnd.sycle+xml": { source: "iana", compressible: !0 }, "application/vnd.syft+json": { source: "iana", compressible: !0 }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] }, "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xsm"] }, "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] }, "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["xdm"] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["ddf"] }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: !0 }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tableschema+json": { source: "iana", compressible: !0 }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] }, "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: !0 }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: !0 }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] }, "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] }, "application/vnd.trueapp": { source: "iana", extensions: ["tra"] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] }, "application/vnd.uic.osdm+json": { source: "iana", compressible: !0 }, "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] }, "application/vnd.umajin": { source: "iana", extensions: ["umj"] }, "application/vnd.unity": { source: "iana", extensions: ["unityweb"] }, "application/vnd.uoml+xml": { source: "iana", compressible: !0, extensions: ["uoml", "uo"] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: ["vcx"] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: !0 }, "application/vnd.veraison.tsm-report+cbor": { source: "iana" }, "application/vnd.veraison.tsm-report+json": { source: "iana", compressible: !0 }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.veritone.aion+json": { source: "iana", compressible: !0 }, "application/vnd.veryant.thin": { source: "iana" }, "application/vnd.ves.encrypted": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw", "vsdx", "vtx"] }, "application/vnd.visionary": { source: "iana", extensions: ["vis"] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vocalshaper.vsp4": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: ["vsf"] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] }, "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] }, "application/vnd.wasmflow.wafl": { source: "iana" }, "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] }, "application/vnd.wfa.dpp": { source: "iana" }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] }, "application/vnd.wordlift": { source: "iana" }, "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] }, "application/vnd.wqd": { source: "iana", extensions: ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana", compressible: !0 }, "application/vnd.wv.ssp+xml": { source: "iana", compressible: !0 }, "application/vnd.xacml+json": { source: "iana", compressible: !0 }, "application/vnd.xara": { source: "iana", extensions: ["xar"] }, "application/vnd.xarin.cpj": { source: "iana" }, "application/vnd.xecrets-encrypted": { source: "iana" }, "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana", compressible: !0 }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: !0, extensions: ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] }, "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] }, "application/vnd.zzazz.deck+xml": { source: "iana", compressible: !0, extensions: ["zaz"] }, "application/voicexml+xml": { source: "iana", compressible: !0, extensions: ["vxml"] }, "application/voucher-cms+json": { source: "iana", compressible: !0 }, "application/voucher-jws+json": { source: "iana", compressible: !0 }, "application/vp": { source: "iana" }, "application/vp+cose": { source: "iana" }, "application/vp+jwt": { source: "iana" }, "application/vq-rtcpxr": { source: "iana" }, "application/wasm": { source: "iana", compressible: !0, extensions: ["wasm"] }, "application/watcherinfo+xml": { source: "iana", compressible: !0, extensions: ["wif"] }, "application/webpush-options+json": { source: "iana", compressible: !0 }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: ["wgt"] }, "application/winhlp": { source: "apache", extensions: ["hlp"] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", compressible: !0, extensions: ["wsdl"] }, "application/wspolicy+xml": { source: "iana", compressible: !0, extensions: ["wspolicy"] }, "application/x-7z-compressed": { source: "apache", compressible: !1, extensions: ["7z"] }, "application/x-abiword": { source: "apache", extensions: ["abw"] }, "application/x-ace-compressed": { source: "apache", extensions: ["ace"] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] }, "application/x-arj": { compressible: !1, extensions: ["arj"] }, "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] }, "application/x-authorware-map": { source: "apache", extensions: ["aam"] }, "application/x-authorware-seg": { source: "apache", extensions: ["aas"] }, "application/x-bcpio": { source: "apache", extensions: ["bcpio"] }, "application/x-bdoc": { compressible: !1, extensions: ["bdoc"] }, "application/x-bittorrent": { source: "apache", extensions: ["torrent"] }, "application/x-blender": { extensions: ["blend"] }, "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] }, "application/x-bzip": { source: "apache", compressible: !1, extensions: ["bz"] }, "application/x-bzip2": { source: "apache", compressible: !1, extensions: ["bz2", "boz"] }, "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] }, "application/x-cdlink": { source: "apache", extensions: ["vcd"] }, "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] }, "application/x-chat": { source: "apache", extensions: ["chat"] }, "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] }, "application/x-chrome-extension": { extensions: ["crx"] }, "application/x-cocoa": { source: "nginx", extensions: ["cco"] }, "application/x-compress": { source: "apache" }, "application/x-compressed": { extensions: ["rar"] }, "application/x-conference": { source: "apache", extensions: ["nsc"] }, "application/x-cpio": { source: "apache", extensions: ["cpio"] }, "application/x-csh": { source: "apache", extensions: ["csh"] }, "application/x-deb": { compressible: !1 }, "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] }, "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] }, "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] }, "application/x-doom": { source: "apache", extensions: ["wad"] }, "application/x-dtbncx+xml": { source: "apache", compressible: !0, extensions: ["ncx"] }, "application/x-dtbook+xml": { source: "apache", compressible: !0, extensions: ["dtb"] }, "application/x-dtbresource+xml": { source: "apache", compressible: !0, extensions: ["res"] }, "application/x-dvi": { source: "apache", compressible: !1, extensions: ["dvi"] }, "application/x-envoy": { source: "apache", extensions: ["evy"] }, "application/x-eva": { source: "apache", extensions: ["eva"] }, "application/x-font-bdf": { source: "apache", extensions: ["bdf"] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] }, "application/x-font-pcf": { source: "apache", extensions: ["pcf"] }, "application/x-font-snf": { source: "apache", extensions: ["snf"] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: ["arc"] }, "application/x-futuresplash": { source: "apache", extensions: ["spl"] }, "application/x-gca-compressed": { source: "apache", extensions: ["gca"] }, "application/x-glulx": { source: "apache", extensions: ["ulx"] }, "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] }, "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] }, "application/x-gtar": { source: "apache", extensions: ["gtar"] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: ["hdf"] }, "application/x-httpd-php": { compressible: !0, extensions: ["php"] }, "application/x-install-instructions": { source: "apache", extensions: ["install"] }, "application/x-ipynb+json": { compressible: !0, extensions: ["ipynb"] }, "application/x-iso9660-image": { source: "apache", extensions: ["iso"] }, "application/x-iwork-keynote-sffkey": { extensions: ["key"] }, "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] }, "application/x-iwork-pages-sffpages": { extensions: ["pages"] }, "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] }, "application/x-java-jnlp-file": { source: "apache", compressible: !1, extensions: ["jnlp"] }, "application/x-javascript": { compressible: !0 }, "application/x-keepass2": { extensions: ["kdbx"] }, "application/x-latex": { source: "apache", compressible: !1, extensions: ["latex"] }, "application/x-lua-bytecode": { extensions: ["luac"] }, "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] }, "application/x-makeself": { source: "nginx", extensions: ["run"] }, "application/x-mie": { source: "apache", extensions: ["mie"] }, "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] }, "application/x-mpegurl": { compressible: !1 }, "application/x-ms-application": { source: "apache", extensions: ["application"] }, "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] }, "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] }, "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] }, "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] }, "application/x-msaccess": { source: "apache", extensions: ["mdb"] }, "application/x-msbinder": { source: "apache", extensions: ["obd"] }, "application/x-mscardfile": { source: "apache", extensions: ["crd"] }, "application/x-msclip": { source: "apache", extensions: ["clp"] }, "application/x-msdos-program": { extensions: ["exe"] }, "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] }, "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] }, "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] }, "application/x-msmoney": { source: "apache", extensions: ["mny"] }, "application/x-mspublisher": { source: "apache", extensions: ["pub"] }, "application/x-msschedule": { source: "apache", extensions: ["scd"] }, "application/x-msterminal": { source: "apache", extensions: ["trm"] }, "application/x-mswrite": { source: "apache", extensions: ["wri"] }, "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] }, "application/x-ns-proxy-autoconfig": { compressible: !0, extensions: ["pac"] }, "application/x-nzb": { source: "apache", extensions: ["nzb"] }, "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] }, "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] }, "application/x-pkcs12": { source: "apache", compressible: !1, extensions: ["p12", "pfx"] }, "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] }, "application/x-pki-message": { source: "iana" }, "application/x-rar-compressed": { source: "apache", compressible: !1, extensions: ["rar"] }, "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] }, "application/x-research-info-systems": { source: "apache", extensions: ["ris"] }, "application/x-sea": { source: "nginx", extensions: ["sea"] }, "application/x-sh": { source: "apache", compressible: !0, extensions: ["sh"] }, "application/x-shar": { source: "apache", extensions: ["shar"] }, "application/x-shockwave-flash": { source: "apache", compressible: !1, extensions: ["swf"] }, "application/x-silverlight-app": { source: "apache", extensions: ["xap"] }, "application/x-sql": { source: "apache", extensions: ["sql"] }, "application/x-stuffit": { source: "apache", compressible: !1, extensions: ["sit"] }, "application/x-stuffitx": { source: "apache", extensions: ["sitx"] }, "application/x-subrip": { source: "apache", extensions: ["srt"] }, "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] }, "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] }, "application/x-t3vm-image": { source: "apache", extensions: ["t3"] }, "application/x-tads": { source: "apache", extensions: ["gam"] }, "application/x-tar": { source: "apache", compressible: !0, extensions: ["tar"] }, "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] }, "application/x-tex": { source: "apache", extensions: ["tex"] }, "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] }, "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] }, "application/x-tgif": { source: "apache", extensions: ["obj"] }, "application/x-ustar": { source: "apache", extensions: ["ustar"] }, "application/x-virtualbox-hdd": { compressible: !0, extensions: ["hdd"] }, "application/x-virtualbox-ova": { compressible: !0, extensions: ["ova"] }, "application/x-virtualbox-ovf": { compressible: !0, extensions: ["ovf"] }, "application/x-virtualbox-vbox": { compressible: !0, extensions: ["vbox"] }, "application/x-virtualbox-vbox-extpack": { compressible: !1, extensions: ["vbox-extpack"] }, "application/x-virtualbox-vdi": { compressible: !0, extensions: ["vdi"] }, "application/x-virtualbox-vhd": { compressible: !0, extensions: ["vhd"] }, "application/x-virtualbox-vmdk": { compressible: !0, extensions: ["vmdk"] }, "application/x-wais-source": { source: "apache", extensions: ["src"] }, "application/x-web-app-manifest+json": { compressible: !0, extensions: ["webapp"] }, "application/x-www-form-urlencoded": { source: "iana", compressible: !0 }, "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] }, "application/x-x509-ca-ra-cert": { source: "iana" }, "application/x-x509-next-ca-cert": { source: "iana" }, "application/x-xfig": { source: "apache", extensions: ["fig"] }, "application/x-xliff+xml": { source: "apache", compressible: !0, extensions: ["xlf"] }, "application/x-xpinstall": { source: "apache", compressible: !1, extensions: ["xpi"] }, "application/x-xz": { source: "apache", extensions: ["xz"] }, "application/x-zip-compressed": { extensions: ["zip"] }, "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana", compressible: !0 }, "application/xaml+xml": { source: "apache", compressible: !0, extensions: ["xaml"] }, "application/xcap-att+xml": { source: "iana", compressible: !0, extensions: ["xav"] }, "application/xcap-caps+xml": { source: "iana", compressible: !0, extensions: ["xca"] }, "application/xcap-diff+xml": { source: "iana", compressible: !0, extensions: ["xdf"] }, "application/xcap-el+xml": { source: "iana", compressible: !0, extensions: ["xel"] }, "application/xcap-error+xml": { source: "iana", compressible: !0 }, "application/xcap-ns+xml": { source: "iana", compressible: !0, extensions: ["xns"] }, "application/xcon-conference-info+xml": { source: "iana", compressible: !0 }, "application/xcon-conference-info-diff+xml": { source: "iana", compressible: !0 }, "application/xenc+xml": { source: "iana", compressible: !0, extensions: ["xenc"] }, "application/xfdf": { source: "iana", extensions: ["xfdf"] }, "application/xhtml+xml": { source: "iana", compressible: !0, extensions: ["xhtml", "xht"] }, "application/xhtml-voice+xml": { source: "apache", compressible: !0 }, "application/xliff+xml": { source: "iana", compressible: !0, extensions: ["xlf"] }, "application/xml": { source: "iana", compressible: !0, extensions: ["xml", "xsl", "xsd", "rng"] }, "application/xml-dtd": { source: "iana", compressible: !0, extensions: ["dtd"] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana", compressible: !0 }, "application/xmpp+xml": { source: "iana", compressible: !0 }, "application/xop+xml": { source: "iana", compressible: !0, extensions: ["xop"] }, "application/xproc+xml": { source: "apache", compressible: !0, extensions: ["xpl"] }, "application/xslt+xml": { source: "iana", compressible: !0, extensions: ["xsl", "xslt"] }, "application/xspf+xml": { source: "apache", compressible: !0, extensions: ["xspf"] }, "application/xv+xml": { source: "iana", compressible: !0, extensions: ["mxml", "xhvml", "xvml", "xvm"] }, "application/yaml": { source: "iana" }, "application/yang": { source: "iana", extensions: ["yang"] }, "application/yang-data+cbor": { source: "iana" }, "application/yang-data+json": { source: "iana", compressible: !0 }, "application/yang-data+xml": { source: "iana", compressible: !0 }, "application/yang-patch+json": { source: "iana", compressible: !0 }, "application/yang-patch+xml": { source: "iana", compressible: !0 }, "application/yang-sid+json": { source: "iana", compressible: !0 }, "application/yin+xml": { source: "iana", compressible: !0, extensions: ["yin"] }, "application/zip": { source: "iana", compressible: !1, extensions: ["zip"] }, "application/zip+dotlottie": { extensions: ["lottie"] }, "application/zlib": { source: "iana" }, "application/zstd": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: !1, extensions: ["3gpp"] }, "audio/3gpp2": { source: "iana" }, "audio/aac": { source: "iana", extensions: ["adts", "aac"] }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: ["adp"] }, "audio/amr": { source: "iana", extensions: ["amr"] }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: !1, extensions: ["au", "snd"] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/flac": { source: "iana" }, "audio/flexfec": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: !1 }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/matroska": { source: "iana" }, "audio/melp": { source: "iana" }, "audio/melp1200": { source: "iana" }, "audio/melp2400": { source: "iana" }, "audio/melp600": { source: "iana" }, "audio/mhas": { source: "iana" }, "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] }, "audio/midi-clip": { source: "iana" }, "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] }, "audio/mp3": { compressible: !1, extensions: ["mp3"] }, "audio/mp4": { source: "iana", compressible: !1, extensions: ["m4a", "mp4a", "m4b"] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: !1, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: !1, extensions: ["oga", "ogg", "spx", "opus"] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: ["s3m"] }, "audio/scip": { source: "iana" }, "audio/silk": { source: "apache", extensions: ["sil"] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sofa": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tetra_acelp": { source: "iana" }, "audio/tetra_acelp_bb": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/tsvcis": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/usac": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] }, "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: ["dra"] }, "audio/vnd.dts": { source: "iana", extensions: ["dts"] }, "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] }, "audio/vnd.dts.uhd": { source: "iana" }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.presonus.multitrack": { source: "iana" }, "audio/vnd.qcelp": { source: "apache" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: ["rip"] }, "audio/vnd.rn-realaudio": { compressible: !1 }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: !1 }, "audio/vorbis": { source: "iana", compressible: !1 }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: !1, extensions: ["wav"] }, "audio/wave": { compressible: !1, extensions: ["wav"] }, "audio/webm": { source: "apache", compressible: !1, extensions: ["weba"] }, "audio/x-aac": { source: "apache", compressible: !1, extensions: ["aac"] }, "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] }, "audio/x-caf": { source: "apache", compressible: !1, extensions: ["caf"] }, "audio/x-flac": { source: "apache", extensions: ["flac"] }, "audio/x-m4a": { source: "nginx", extensions: ["m4a"] }, "audio/x-matroska": { source: "apache", extensions: ["mka"] }, "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] }, "audio/x-ms-wax": { source: "apache", extensions: ["wax"] }, "audio/x-ms-wma": { source: "apache", extensions: ["wma"] }, "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] }, "audio/x-realaudio": { source: "nginx", extensions: ["ra"] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: ["wav"] }, "audio/xm": { source: "apache", extensions: ["xm"] }, "chemical/x-cdx": { source: "apache", extensions: ["cdx"] }, "chemical/x-cif": { source: "apache", extensions: ["cif"] }, "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] }, "chemical/x-cml": { source: "apache", extensions: ["cml"] }, "chemical/x-csml": { source: "apache", extensions: ["csml"] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: ["xyz"] }, "font/collection": { source: "iana", extensions: ["ttc"] }, "font/otf": { source: "iana", compressible: !0, extensions: ["otf"] }, "font/sfnt": { source: "iana" }, "font/ttf": { source: "iana", compressible: !0, extensions: ["ttf"] }, "font/woff": { source: "iana", extensions: ["woff"] }, "font/woff2": { source: "iana", extensions: ["woff2"] }, "image/aces": { source: "iana", extensions: ["exr"] }, "image/apng": { source: "iana", compressible: !1, extensions: ["apng"] }, "image/avci": { source: "iana", extensions: ["avci"] }, "image/avcs": { source: "iana", extensions: ["avcs"] }, "image/avif": { source: "iana", compressible: !1, extensions: ["avif"] }, "image/bmp": { source: "iana", compressible: !0, extensions: ["bmp", "dib"] }, "image/cgm": { source: "iana", extensions: ["cgm"] }, "image/dicom-rle": { source: "iana", extensions: ["drle"] }, "image/dpx": { source: "iana", extensions: ["dpx"] }, "image/emf": { source: "iana", extensions: ["emf"] }, "image/fits": { source: "iana", extensions: ["fits"] }, "image/g3fax": { source: "iana", extensions: ["g3"] }, "image/gif": { source: "iana", compressible: !1, extensions: ["gif"] }, "image/heic": { source: "iana", extensions: ["heic"] }, "image/heic-sequence": { source: "iana", extensions: ["heics"] }, "image/heif": { source: "iana", extensions: ["heif"] }, "image/heif-sequence": { source: "iana", extensions: ["heifs"] }, "image/hej2k": { source: "iana", extensions: ["hej2"] }, "image/ief": { source: "iana", extensions: ["ief"] }, "image/j2c": { source: "iana" }, "image/jaii": { source: "iana", extensions: ["jaii"] }, "image/jais": { source: "iana", extensions: ["jais"] }, "image/jls": { source: "iana", extensions: ["jls"] }, "image/jp2": { source: "iana", compressible: !1, extensions: ["jp2", "jpg2"] }, "image/jpeg": { source: "iana", compressible: !1, extensions: ["jpg", "jpeg", "jpe"] }, "image/jph": { source: "iana", extensions: ["jph"] }, "image/jphc": { source: "iana", extensions: ["jhc"] }, "image/jpm": { source: "iana", compressible: !1, extensions: ["jpm", "jpgm"] }, "image/jpx": { source: "iana", compressible: !1, extensions: ["jpx", "jpf"] }, "image/jxl": { source: "iana", extensions: ["jxl"] }, "image/jxr": { source: "iana", extensions: ["jxr"] }, "image/jxra": { source: "iana", extensions: ["jxra"] }, "image/jxrs": { source: "iana", extensions: ["jxrs"] }, "image/jxs": { source: "iana", extensions: ["jxs"] }, "image/jxsc": { source: "iana", extensions: ["jxsc"] }, "image/jxsi": { source: "iana", extensions: ["jxsi"] }, "image/jxss": { source: "iana", extensions: ["jxss"] }, "image/ktx": { source: "iana", extensions: ["ktx"] }, "image/ktx2": { source: "iana", extensions: ["ktx2"] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: !1, extensions: ["jfif"] }, "image/png": { source: "iana", compressible: !1, extensions: ["png"] }, "image/prs.btif": { source: "iana", extensions: ["btif", "btf"] }, "image/prs.pti": { source: "iana", extensions: ["pti"] }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: ["sgi"] }, "image/svg+xml": { source: "iana", compressible: !0, extensions: ["svg", "svgz"] }, "image/t38": { source: "iana", extensions: ["t38"] }, "image/tiff": { source: "iana", compressible: !1, extensions: ["tif", "tiff"] }, "image/tiff-fx": { source: "iana", extensions: ["tfx"] }, "image/vnd.adobe.photoshop": { source: "iana", compressible: !0, extensions: ["psd"] }, "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] }, "image/vnd.clip": { source: "iana" }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] }, "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "image/vnd.dwg": { source: "iana", extensions: ["dwg"] }, "image/vnd.dxf": { source: "iana", extensions: ["dxf"] }, "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] }, "image/vnd.fpx": { source: "iana", extensions: ["fpx"] }, "image/vnd.fst": { source: "iana", extensions: ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana", compressible: !0, extensions: ["ico"] }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-dds": { compressible: !0, extensions: ["dds"] }, "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] }, "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] }, "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] }, "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] }, "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] }, "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] }, "image/vnd.xiff": { source: "iana", extensions: ["xif"] }, "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] }, "image/webp": { source: "iana", extensions: ["webp"] }, "image/wmf": { source: "iana", extensions: ["wmf"] }, "image/x-3ds": { source: "apache", extensions: ["3ds"] }, "image/x-adobe-dng": { extensions: ["dng"] }, "image/x-cmu-raster": { source: "apache", extensions: ["ras"] }, "image/x-cmx": { source: "apache", extensions: ["cmx"] }, "image/x-emf": { source: "iana" }, "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] }, "image/x-icon": { source: "apache", compressible: !0, extensions: ["ico"] }, "image/x-jng": { source: "nginx", extensions: ["jng"] }, "image/x-mrsid-image": { source: "apache", extensions: ["sid"] }, "image/x-ms-bmp": { source: "nginx", compressible: !0, extensions: ["bmp"] }, "image/x-pcx": { source: "apache", extensions: ["pcx"] }, "image/x-pict": { source: "apache", extensions: ["pic", "pct"] }, "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] }, "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] }, "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] }, "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] }, "image/x-rgb": { source: "apache", extensions: ["rgb"] }, "image/x-tga": { source: "apache", extensions: ["tga"] }, "image/x-wmf": { source: "iana" }, "image/x-xbitmap": { source: "apache", extensions: ["xbm"] }, "image/x-xcf": { compressible: !1 }, "image/x-xpixmap": { source: "apache", extensions: ["xpm"] }, "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] }, "message/bhttp": { source: "iana" }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana", extensions: ["disposition-notification"] }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana", extensions: ["u8msg"] }, "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] }, "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] }, "message/global-headers": { source: "iana", extensions: ["u8hdr"] }, "message/http": { source: "iana", compressible: !1 }, "message/imdn+xml": { source: "iana", compressible: !0 }, "message/mls": { source: "iana" }, "message/news": { source: "apache" }, "message/ohttp-req": { source: "iana" }, "message/ohttp-res": { source: "iana" }, "message/partial": { source: "iana", compressible: !1 }, "message/rfc822": { source: "iana", compressible: !0, extensions: ["eml", "mime", "mht", "mhtml"] }, "message/s-http": { source: "apache" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "apache" }, "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] }, "model/3mf": { source: "iana", extensions: ["3mf"] }, "model/e57": { source: "iana" }, "model/gltf+json": { source: "iana", compressible: !0, extensions: ["gltf"] }, "model/gltf-binary": { source: "iana", compressible: !0, extensions: ["glb"] }, "model/iges": { source: "iana", compressible: !1, extensions: ["igs", "iges"] }, "model/jt": { source: "iana", extensions: ["jt"] }, "model/mesh": { source: "iana", compressible: !1, extensions: ["msh", "mesh", "silo"] }, "model/mtl": { source: "iana", extensions: ["mtl"] }, "model/obj": { source: "iana", extensions: ["obj"] }, "model/prc": { source: "iana", extensions: ["prc"] }, "model/step": { source: "iana", extensions: ["step", "stp", "stpnc", "p21", "210"] }, "model/step+xml": { source: "iana", compressible: !0, extensions: ["stpx"] }, "model/step+zip": { source: "iana", compressible: !1, extensions: ["stpz"] }, "model/step-xml+zip": { source: "iana", compressible: !1, extensions: ["stpxz"] }, "model/stl": { source: "iana", extensions: ["stl"] }, "model/u3d": { source: "iana", extensions: ["u3d"] }, "model/vnd.bary": { source: "iana", extensions: ["bary"] }, "model/vnd.cld": { source: "iana", extensions: ["cld"] }, "model/vnd.collada+xml": { source: "iana", compressible: !0, extensions: ["dae"] }, "model/vnd.dwf": { source: "iana", extensions: ["dwf"] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: ["gdl"] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: ["gtw"] }, "model/vnd.moml+xml": { source: "iana", compressible: !0 }, "model/vnd.mts": { source: "iana", extensions: ["mts"] }, "model/vnd.opengex": { source: "iana", extensions: ["ogex"] }, "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] }, "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] }, "model/vnd.pytha.pyox": { source: "iana", extensions: ["pyo", "pyox"] }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] }, "model/vnd.usda": { source: "iana", extensions: ["usda"] }, "model/vnd.usdz+zip": { source: "iana", compressible: !1, extensions: ["usdz"] }, "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] }, "model/vnd.vtu": { source: "iana", extensions: ["vtu"] }, "model/vrml": { source: "iana", compressible: !1, extensions: ["wrl", "vrml"] }, "model/x3d+binary": { source: "apache", compressible: !1, extensions: ["x3db", "x3dbz"] }, "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] }, "model/x3d+vrml": { source: "apache", compressible: !1, extensions: ["x3dv", "x3dvz"] }, "model/x3d+xml": { source: "iana", compressible: !0, extensions: ["x3d", "x3dz"] }, "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] }, "multipart/alternative": { source: "iana", compressible: !1 }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: !1 }, "multipart/form-data": { source: "iana", compressible: !1 }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana" }, "multipart/multilingual": { source: "iana" }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: !1 }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: !1 }, "multipart/vnd.bint.med-plus": { source: "iana" }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: !0, extensions: ["appcache", "manifest"] }, "text/calendar": { source: "iana", extensions: ["ics", "ifb"] }, "text/calender": { compressible: !0 }, "text/cmd": { compressible: !0 }, "text/coffeescript": { extensions: ["coffee", "litcoffee"] }, "text/cql": { source: "iana" }, "text/cql-expression": { source: "iana" }, "text/cql-identifier": { source: "iana" }, "text/css": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["css"] }, "text/csv": { source: "iana", compressible: !0, extensions: ["csv"] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "apache" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fhirpath": { source: "iana" }, "text/flexfec": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/gff3": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/hl7v2": { source: "iana" }, "text/html": { source: "iana", compressible: !0, extensions: ["html", "htm", "shtml"] }, "text/jade": { extensions: ["jade"] }, "text/javascript": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["js", "mjs"] }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: !0, extensions: ["jsx"] }, "text/less": { compressible: !0, extensions: ["less"] }, "text/markdown": { source: "iana", compressible: !0, extensions: ["md", "markdown"] }, "text/mathml": { source: "nginx", extensions: ["mml"] }, "text/mdx": { compressible: !0, extensions: ["mdx"] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["n3"] }, "text/parameters": { source: "iana", charset: "UTF-8" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: !0, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] }, "text/provenance-notation": { source: "iana", charset: "UTF-8" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] }, "text/prs.prop.logic": { source: "iana" }, "text/prs.texi": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: !0, extensions: ["rtx"] }, "text/rtf": { source: "iana", compressible: !0, extensions: ["rtf"] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] }, "text/shaclc": { source: "iana" }, "text/shex": { source: "iana", extensions: ["shex"] }, "text/slim": { extensions: ["slim", "slm"] }, "text/spdx": { source: "iana", extensions: ["spdx"] }, "text/strings": { source: "iana" }, "text/stylus": { extensions: ["stylus", "styl"] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: !0, extensions: ["tsv"] }, "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] }, "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: !0, extensions: ["uri", "uris", "urls"] }, "text/vcard": { source: "iana", compressible: !0, extensions: ["vcard"] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: ["curl"] }, "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] }, "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] }, "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] }, "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" }, "text/vnd.exchangeable": { source: "iana" }, "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] }, "text/vnd.ficlab.flt": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: ["fly"] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] }, "text/vnd.gml": { source: "iana" }, "text/vnd.graphviz": { source: "iana", extensions: ["gv"] }, "text/vnd.hans": { source: "iana" }, "text/vnd.hgl": { source: "iana" }, "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] }, "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.senx.warpscript": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "apache" }, "text/vnd.sosi": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] }, "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" }, "text/vnd.vcf": { source: "iana" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] }, "text/vnd.zoo.kcl": { source: "iana" }, "text/vtt": { source: "iana", charset: "UTF-8", compressible: !0, extensions: ["vtt"] }, "text/wgsl": { source: "iana", extensions: ["wgsl"] }, "text/x-asm": { source: "apache", extensions: ["s", "asm"] }, "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] }, "text/x-component": { source: "nginx", extensions: ["htc"] }, "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] }, "text/x-gwt-rpc": { compressible: !0 }, "text/x-handlebars-template": { extensions: ["hbs"] }, "text/x-java-source": { source: "apache", extensions: ["java"] }, "text/x-jquery-tmpl": { compressible: !0 }, "text/x-lua": { extensions: ["lua"] }, "text/x-markdown": { compressible: !0, extensions: ["mkd"] }, "text/x-nfo": { source: "apache", extensions: ["nfo"] }, "text/x-opml": { source: "apache", extensions: ["opml"] }, "text/x-org": { compressible: !0, extensions: ["org"] }, "text/x-pascal": { source: "apache", extensions: ["p", "pas"] }, "text/x-processing": { compressible: !0, extensions: ["pde"] }, "text/x-sass": { extensions: ["sass"] }, "text/x-scss": { extensions: ["scss"] }, "text/x-setext": { source: "apache", extensions: ["etx"] }, "text/x-sfv": { source: "apache", extensions: ["sfv"] }, "text/x-suse-ymp": { compressible: !0, extensions: ["ymp"] }, "text/x-uuencode": { source: "apache", extensions: ["uu"] }, "text/x-vcalendar": { source: "apache", extensions: ["vcs"] }, "text/x-vcard": { source: "apache", extensions: ["vcf"] }, "text/xml": { source: "iana", compressible: !0, extensions: ["xml"] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { compressible: !0, extensions: ["yaml", "yml"] }, "video/1d-interleaved-parityfec": { source: "iana" }, "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] }, "video/3gpp-tt": { source: "iana" }, "video/3gpp2": { source: "iana", extensions: ["3g2"] }, "video/av1": { source: "iana" }, "video/bmpeg": { source: "iana" }, "video/bt656": { source: "iana" }, "video/celb": { source: "iana" }, "video/dv": { source: "iana" }, "video/encaprtp": { source: "iana" }, "video/evc": { source: "iana" }, "video/ffv1": { source: "iana" }, "video/flexfec": { source: "iana" }, "video/h261": { source: "iana", extensions: ["h261"] }, "video/h263": { source: "iana", extensions: ["h263"] }, "video/h263-1998": { source: "iana" }, "video/h263-2000": { source: "iana" }, "video/h264": { source: "iana", extensions: ["h264"] }, "video/h264-rcdo": { source: "iana" }, "video/h264-svc": { source: "iana" }, "video/h265": { source: "iana" }, "video/h266": { source: "iana" }, "video/iso.segment": { source: "iana", extensions: ["m4s"] }, "video/jpeg": { source: "iana", extensions: ["jpgv"] }, "video/jpeg2000": { source: "iana" }, "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] }, "video/jxsv": { source: "iana" }, "video/lottie+json": { source: "iana", compressible: !0 }, "video/matroska": { source: "iana" }, "video/matroska-3d": { source: "iana" }, "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] }, "video/mp1s": { source: "iana" }, "video/mp2p": { source: "iana" }, "video/mp2t": { source: "iana", extensions: ["ts", "m2t", "m2ts", "mts"] }, "video/mp4": { source: "iana", compressible: !1, extensions: ["mp4", "mp4v", "mpg4"] }, "video/mp4v-es": { source: "iana" }, "video/mpeg": { source: "iana", compressible: !1, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] }, "video/mpeg4-generic": { source: "iana" }, "video/mpv": { source: "iana" }, "video/nv": { source: "iana" }, "video/ogg": { source: "iana", compressible: !1, extensions: ["ogv"] }, "video/parityfec": { source: "iana" }, "video/pointer": { source: "iana" }, "video/quicktime": { source: "iana", compressible: !1, extensions: ["qt", "mov"] }, "video/raptorfec": { source: "iana" }, "video/raw": { source: "iana" }, "video/rtp-enc-aescm128": { source: "iana" }, "video/rtploopback": { source: "iana" }, "video/rtx": { source: "iana" }, "video/scip": { source: "iana" }, "video/smpte291": { source: "iana" }, "video/smpte292m": { source: "iana" }, "video/ulpfec": { source: "iana" }, "video/vc1": { source: "iana" }, "video/vc2": { source: "iana" }, "video/vnd.cctv": { source: "iana" }, "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] }, "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] }, "video/vnd.dece.mp4": { source: "iana" }, "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] }, "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] }, "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] }, "video/vnd.directv.mpeg": { source: "iana" }, "video/vnd.directv.mpeg-tts": { source: "iana" }, "video/vnd.dlna.mpeg-tts": { source: "iana" }, "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] }, "video/vnd.fvt": { source: "iana", extensions: ["fvt"] }, "video/vnd.hns.video": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.ttsavc": { source: "iana" }, "video/vnd.iptvforum.ttsmpeg2": { source: "iana" }, "video/vnd.motorola.video": { source: "iana" }, "video/vnd.motorola.videop": { source: "iana" }, "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] }, "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { source: "iana" }, "video/vnd.nokia.mp4vr": { source: "iana" }, "video/vnd.nokia.videovoip": { source: "iana" }, "video/vnd.objectvideo": { source: "iana" }, "video/vnd.planar": { source: "iana" }, "video/vnd.radgamettools.bink": { source: "iana" }, "video/vnd.radgamettools.smacker": { source: "apache" }, "video/vnd.sealed.mpeg1": { source: "iana" }, "video/vnd.sealed.mpeg4": { source: "iana" }, "video/vnd.sealed.swf": { source: "iana" }, "video/vnd.sealedmedia.softseal.mov": { source: "iana" }, "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] }, "video/vnd.vivo": { source: "iana", extensions: ["viv"] }, "video/vnd.youtube.yt": { source: "iana" }, "video/vp8": { source: "iana" }, "video/vp9": { source: "iana" }, "video/webm": { source: "apache", compressible: !1, extensions: ["webm"] }, "video/x-f4v": { source: "apache", extensions: ["f4v"] }, "video/x-fli": { source: "apache", extensions: ["fli"] }, "video/x-flv": { source: "apache", compressible: !1, extensions: ["flv"] }, "video/x-m4v": { source: "apache", extensions: ["m4v"] }, "video/x-matroska": { source: "apache", compressible: !1, extensions: ["mkv", "mk3d", "mks"] }, "video/x-mng": { source: "apache", extensions: ["mng"] }, "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] }, "video/x-ms-vob": { source: "apache", extensions: ["vob"] }, "video/x-ms-wm": { source: "apache", extensions: ["wm"] }, "video/x-ms-wmv": { source: "apache", compressible: !1, extensions: ["wmv"] }, "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] }, "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] }, "video/x-msvideo": { source: "apache", extensions: ["avi"] }, "video/x-sgi-movie": { source: "apache", extensions: ["movie"] }, "video/x-smv": { source: "apache", extensions: ["smv"] }, "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] }, "x-shader/x-fragment": { compressible: !0 }, "x-shader/x-vertex": { compressible: !0 } }; /*! * mime-db * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015-2022 Douglas Christopher Wilson * MIT Licensed */ var Bw, FP; function F1e() { return FP || (FP = 1, Bw = O1e), Bw; } /*! * compressible * Copyright(c) 2013 Jonathan Ong * Copyright(c) 2014 Jeremiah Senkpiel * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ var Uw, MP; function M1e() { if (MP) return Uw; MP = 1; var t = F1e(), e = /^text\/|\+(?:json|text|xml)$/i, n = /^\s*([^;\s]*)(?:;|\s|$)/; Uw = r; function r(i) { if (!i || typeof i != "string") return !1; var o = n.exec(i), a = o && o[1].toLowerCase(), s = t[a]; return s && s.compressible !== void 0 ? s.compressible : e.test(a) || void 0; } return Uw; } var gm = { exports: {} }, ym = { exports: {} }, Lw, RP; function R1e() { if (RP) return Lw; RP = 1; var t = 1e3, e = t * 60, n = e * 60, r = n * 24, i = r * 365.25; Lw = function(u, d) { d = d || {}; var p = typeof u; if (p === "string" && u.length > 0) return o(u); if (p === "number" && isNaN(u) === !1) return d.long ? s(u) : a(u); throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(u) ); }; function o(u) { if (u = String(u), !(u.length > 100)) { var d = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( u ); if (d) { var p = parseFloat(d[1]), f = (d[2] || "ms").toLowerCase(); switch (f) { case "years": case "year": case "yrs": case "yr": case "y": return p * i; case "days": case "day": case "d": return p * r; case "hours": case "hour": case "hrs": case "hr": case "h": return p * n; case "minutes": case "minute": case "mins": case "min": case "m": return p * e; case "seconds": case "second": case "secs": case "sec": case "s": return p * t; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return p; default: return; } } } } function a(u) { return u >= r ? Math.round(u / r) + "d" : u >= n ? Math.round(u / n) + "h" : u >= e ? Math.round(u / e) + "m" : u >= t ? Math.round(u / t) + "s" : u + "ms"; } function s(u) { return c(u, r, "day") || c(u, n, "hour") || c(u, e, "minute") || c(u, t, "second") || u + " ms"; } function c(u, d, p) { if (!(u < d)) return u < d * 1.5 ? Math.floor(u / d) + " " + p : Math.ceil(u / d) + " " + p + "s"; } return Lw; } var BP; function B1e() { return BP || (BP = 1, (function(t, e) { e = t.exports = i.debug = i.default = i, e.coerce = c, e.disable = a, e.enable = o, e.enabled = s, e.humanize = R1e(), e.names = [], e.skips = [], e.formatters = {}; var n; function r(u) { var d = 0, p; for (p in u) d = (d << 5) - d + u.charCodeAt(p), d |= 0; return e.colors[Math.abs(d) % e.colors.length]; } function i(u) { function d() { if (d.enabled) { var p = d, f = +/* @__PURE__ */ new Date(), m = f - (n || f); p.diff = m, p.prev = n, p.curr = f, n = f; for (var h = new Array(arguments.length), y = 0; y < h.length; y++) h[y] = arguments[y]; h[0] = e.coerce(h[0]), typeof h[0] != "string" && h.unshift("%O"); var x = 0; h[0] = h[0].replace(/%([a-zA-Z%])/g, function(b, S) { if (b === "%%") return b; x++; var E = e.formatters[S]; if (typeof E == "function") { var T = h[x]; b = E.call(p, T), h.splice(x, 1), x--; } return b; }), e.formatArgs.call(p, h); var g = d.log || e.log || console.log.bind(console); g.apply(p, h); } } return d.namespace = u, d.enabled = e.enabled(u), d.useColors = e.useColors(), d.color = r(u), typeof e.init == "function" && e.init(d), d; } function o(u) { e.save(u), e.names = [], e.skips = []; for (var d = (typeof u == "string" ? u : "").split(/[\s,]+/), p = d.length, f = 0; f < p; f++) d[f] && (u = d[f].replace(/\*/g, ".*?"), u[0] === "-" ? e.skips.push(new RegExp("^" + u.substr(1) + "$")) : e.names.push(new RegExp("^" + u + "$"))); } function a() { e.enable(""); } function s(u) { var d, p; for (d = 0, p = e.skips.length; d < p; d++) if (e.skips[d].test(u)) return !1; for (d = 0, p = e.names.length; d < p; d++) if (e.names[d].test(u)) return !0; return !1; } function c(u) { return u instanceof Error ? u.stack || u.message : u; } })(ym, ym.exports)), ym.exports; } var UP; function U1e() { return UP || (UP = 1, (function(t, e) { e = t.exports = B1e(), e.log = i, e.formatArgs = r, e.save = o, e.load = a, e.useColors = n, e.storage = typeof chrome < "u" && typeof chrome.storage < "u" ? chrome.storage.local : s(), e.colors = [ "lightseagreen", "forestgreen", "goldenrod", "dodgerblue", "darkorchid", "crimson" ]; function n() { return typeof window < "u" && window.process && window.process.type === "renderer" ? !0 : typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773 typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } e.formatters.j = function(c) { try { return JSON.stringify(c); } catch (u) { return "[UnexpectedJSONParseError]: " + u.message; } }; function r(c) { var u = this.useColors; if (c[0] = (u ? "%c" : "") + this.namespace + (u ? " %c" : " ") + c[0] + (u ? "%c " : " ") + "+" + e.humanize(this.diff), !!u) { var d = "color: " + this.color; c.splice(1, 0, d, "color: inherit"); var p = 0, f = 0; c[0].replace(/%[a-zA-Z%]/g, function(m) { m !== "%%" && (p++, m === "%c" && (f = p)); }), c.splice(f, 0, d); } } function i() { return typeof console == "object" && console.log && Function.prototype.apply.call(console.log, console, arguments); } function o(c) { try { c == null ? e.storage.removeItem("debug") : e.storage.debug = c; } catch { } } function a() { var c; try { c = e.storage.debug; } catch { } return !c && typeof process < "u" && "env" in process && (c = process.env.DEBUG), c; } e.enable(a()); function s() { try { return window.localStorage; } catch { } } })(gm, gm.exports)), gm.exports; } /*! * on-headers * Copyright(c) 2014 Douglas Christopher Wilson * MIT Licensed */ var Qw, LP; function L1e() { if (LP) return Qw; LP = 1, Qw = i; var t = Ds, e = typeof t.ServerResponse.prototype.appendHeader == "function", n = e ? u : d; function r(p, f) { var m = !1; return function(y) { var x = s.apply(this, arguments); return m || (m = !0, f.call(this), typeof x[0] == "number" && this.statusCode !== x[0] && (x[0] = this.statusCode, x.length = 1)), p.apply(this, x); }; } function i(p, f) { if (!p) throw new TypeError("argument res is required"); if (typeof f != "function") throw new TypeError("argument listener must be a function"); p.writeHead = r(p.writeHead, f); } function o(p, f) { if (f.length && Array.isArray(f[0])) c(p, f); else { if (f.length % 2 !== 0) throw new TypeError("headers array is malformed"); n(p, f); } } function a(p, f) { for (var m = Object.keys(f), h = 0; h < m.length; h++) { var y = m[h]; y && p.setHeader(y, f[y]); } } function s(p) { var f = arguments.length, m = f > 1 && typeof arguments[1] == "string" ? 2 : 1, h = f >= m + 1 ? arguments[m] : void 0; this.statusCode = p, Array.isArray(h) ? o(this, h) : h && a(this, h); for (var y = new Array(Math.min(f, m)), x = 0; x < y.length; x++) y[x] = arguments[x]; return y; } function c(p, f) { for (var m, h = 0; h < f.length; h++) m = f[h][0], m && p.setHeader(m, f[h][1]); } function u(p, f) { for (var m = 0; m < f.length; m += 2) p.removeHeader(f[m]); for (var h, y = 0; y < f.length; y += 2) h = f[y], h && p.appendHeader(h, f[y + 1]); } function d(p, f) { for (var m, h = 0; h < f.length; h += 2) m = f[h], m && p.setHeader(m, f[h + 1]); } return Qw; } /*! * compression * Copyright(c) 2010 Sencha Inc. * Copyright(c) 2011 TJ Holowaychuk * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ var QP; function Q1e() { if (QP) return lm.exports; QP = 1; var t = P1e(), e = S0().Buffer, n = D1e(), r = M1e(), i = U1e()("compression"), o = L1e(), a = GU(), s = ml; lm.exports = m, lm.exports.filter = x; var c = "createBrotliCompress" in s, u = /(?:^|,)\s*?no-transform\s*?(?:,|$)/, d = c ? ["br", "gzip", "deflate", "identity"] : ["gzip", "deflate", "identity"], p = c ? ["br", "gzip"] : ["gzip"], f = ["gzip", "deflate", "identity", "br"]; function m(E) { var T = E || {}, U = {}; if (c) { Object.assign(U, T.brotli); var q = {}; q[s.constants.BROTLI_PARAM_QUALITY] = 4, U.params = Object.assign(q, U.params); } var Y = T.filter || x, H = n.parse(T.threshold), G = T.enforceEncoding || "identity"; return H == null && (H = 1024), function(B, D, X) { var V = !1, K, $ = [], _, I = D.end, N = D.on, L = D.write; D.flush = function() { _ && _.flush(); }, D.write = function(k, M) { return V ? !1 : (S(D) || this.writeHead(this.statusCode), _ ? _.write(b(k, M)) : L.call(this, k, M)); }, D.end = function(k, M) { return V ? !1 : (S(D) || (this.getHeader("Content-Length") || (K = y(k, M)), this.writeHead(this.statusCode)), _ ? (V = !0, k ? _.end(b(k, M)) : _.end()) : I.call(this, k, M)); }, D.on = function(k, M) { return !$ || k !== "drain" ? N.call(this, k, M) : _ ? _.on(k, M) : ($.push([k, M]), this); }; function C(Q) { i("no compression: %s", Q), h(D, N, $), $ = null; } o(D, function() { if (!Y(B, D)) { C("filtered"); return; } if (!g(B, D)) { C("no transform"); return; } if (a(D, "Accept-Encoding"), Number(D.getHeader("Content-Length")) < H || K < H) { C("size below threshold"); return; } var k = D.getHeader("Content-Encoding") || "identity"; if (k !== "identity") { C("already encoded"); return; } if (B.method === "HEAD") { C("HEAD request"); return; } var M = new t(B), O = M.encoding(d, p); if (!B.headers["accept-encoding"] && f.indexOf(G) !== -1 && (O = G), !O || O === "identity") { C("not acceptable"); return; } i("%s compression", O), _ = O === "gzip" ? s.createGzip(T) : O === "br" ? s.createBrotliCompress(U) : s.createDeflate(T), h(_, _.on, $), D.setHeader("Content-Encoding", O), D.removeHeader("Content-Length"), _.on("data", function(F) { L.call(D, F) === !1 && _.pause(); }), _.on("end", function() { I.call(D); }), N.call(D, "drain", function() { _.resume(); }); }), X(); }; } function h(E, T, U) { for (var q = 0; q < U.length; q++) T.apply(E, U[q]); } function y(E, T) { return E ? e.isBuffer(E) ? E.length : e.byteLength(E, T) : 0; } function x(E, T) { var U = T.getHeader("Content-Type"); return U === void 0 || !r(U) ? (i("%s not compressible", U), !1) : !0; } function g(E, T) { var U = T.getHeader("Cache-Control"); return !U || !u.test(U); } function b(E, T) { return e.isBuffer(E) ? E : e.from(E, T); } function S(E) { return typeof E.headersSent != "boolean" ? !!E._header : E.headersSent; } return lm.exports; } var j1e = Q1e(); const jP = /* @__PURE__ */ ra(j1e), $1e = a0(import.meta.url), $P = N2($1e), zn = ys(); let Ct, lt, E2, A2, Wt = null; const GP = 100; let eL = 6099, I2 = null, tL = ""; function nL(t) { tL = t; } function Na() { return tL; } function G1e(t) { I2 = t; } async function q1e(t) { try { await W1e(t.host); const e = parseInt(process.env.NAPCAT_WEBUI_PREFERRED_PORT || "", 10); let n; if (e > 0) try { n = await Lm(e, t.host, 0, !0); } catch { n = await Lm(t.port, t.host); } else n = await Lm(t.port, t.host); return [t.host, n, t.token]; } catch (e) { return console.log("host或port不可用", e), ["", 0, ND()]; } } async function z1e(t) { try { const e = En(lt.configPath, "cert.pem"), n = En(lt.configPath, "key.pem"); if (ir(e) && ir(n)) { const r = mo(e, "utf8"), i = mo(n, "utf8"); return t.log("[SnowCat] [WebUi] 找到SSL证书,将启用HTTPS模式"), { cert: r, key: i }; } return null; } catch (e) { return t.log("[SnowCat] [WebUi] 检查SSL证书时出错: " + e), null; } } async function H1e(t, e, n, r) { lt = e, E2 = n, A2 = r, Wt = t, Ct = new kle(); let i = await Ct.GetWebUIConfig(); if (i.disableWebUI) { t.log("[SnowCat] [WebUi] WebUI is disabled by configuration."); return; } if (process.env.NAPCAT_WEBUI_SECRET_KEY && i.token !== process.env.NAPCAT_WEBUI_SECRET_KEY) await Ct.UpdateWebUIConfig({ token: process.env.NAPCAT_WEBUI_SECRET_KEY }), t.log(`[SnowCat] [WebUi] 检测到环境变量配置,已更新 WebUI Token 为 ${process.env.NAPCAT_WEBUI_SECRET_KEY}`), i = await Ct.GetWebUIConfig(); else if (i.token === "napcat" || !i.token) { const f = lB(8); await Ct.UpdateWebUIConfig({ token: f }), t.log("[SnowCat] [WebUi] 检测到默认密码,已自动更新为安全密码"), G1e(f), t.log("[SnowCat] [WebUi] 新密码将在QQ登录成功后发送给用户"), i = await Ct.GetWebUIConfig(); } nL(i.token); const [o, a, s] = await q1e(i); if (eL = a, a === 0) { t.log("[SnowCat] [WebUi] Current WebUi is not run."); return; } de.setWebUiConfigQuickFunction( async () => { const f = process.env.NAPCAT_QUICK_ACCOUNT || Ct.getAutoLoginAccount(), m = () => { const y = process.env.NAPCAT_QUICK_PASSWORD_MD5?.trim(); if (y) { if (/^[a-fA-F0-9]{32}$/.test(y)) return y.toLowerCase(); console.log("[SnowCat] [WebUi] NAPCAT_QUICK_PASSWORD_MD5 格式无效(需为 32 位 MD5)"); } const x = process.env.NAPCAT_QUICK_PASSWORD; if (typeof x == "string" && x.length > 0) return console.log("[SnowCat] [WebUi] 检测到 NAPCAT_QUICK_PASSWORD,已在内存中计算 MD5 用于回退登录"), Wp("md5").update(x, "utf8").digest("hex"); }; if (!f) return; const h = m(); try { const { result: y, message: x } = await de.requestQuickLogin(f); if (y) { console.log(`[SnowCat] [WebUi] 自动快速登录成功: ${f}`); return; } console.log(`[SnowCat] [WebUi] 自动快速登录失败: ${x || "未知错误"}`); } catch (y) { console.log("[SnowCat] [WebUi] 自动快速登录异常:" + y); } if (!h) { console.log(`[SnowCat] [WebUi] QQ ${f} 未配置回退密码环境变量,建议优先使用 ACCOUNT + NAPCAT_QUICK_PASSWORD(NAPCAT_QUICK_PASSWORD_MD5 作为备用),保持二维码登录兜底`); return; } try { const { result: y, message: x, needCaptcha: g, needNewDevice: b } = await de.requestPasswordLogin(f, h); if (y) { console.log(`[SnowCat] [WebUi] 自动密码回退登录成功: ${f}`); return; } if (g) { console.log(`[SnowCat] [WebUi] 自动密码回退登录需要验证码,请在登录页面继续完成: ${f}`); return; } if (b) { console.log(`[SnowCat] [WebUi] 自动密码回退登录需要新设备验证,请在登录页面继续完成: ${f}`); return; } console.log(`[SnowCat] [WebUi] 自动密码回退登录失败: ${x || "未知错误"}`); } catch (y) { console.log("[SnowCat] [WebUi] 自动密码回退登录异常:" + y); } } ), zn.use(ys.json()), zn.use(jP({ level: 6, // 压缩级别 1-9,6 是性能和压缩率的平衡点 threshold: 1024, // 只压缩大于 1KB 的响应 filter: (f, m) => f.headers.accept === "text/event-stream" ? !1 : jP.filter(f, m) })), zn.use(I1e), zn.use("/webui/fonts/CustomFont.woff", async (f, m) => { const h = await Ct.GetWebUIFontPath(); h ? m.sendFile(h) : m.status(404).send("Custom font not found"); }), zn.use("/files/theme.css", async (f, m) => { const h = await Ct.GetTheme(), y = h.fontMode || "system"; let x = ""; y === "aacute" ? x += ` @font-face { font-family: 'Aa偷吃可爱长大的'; src: url('/webui/fonts/AaCute.woff') format('woff'); font-display: swap; } ` : y === "custom" && (x += ` @font-face { font-family: 'CustomFont'; src: url('/webui/fonts/CustomFont.woff') format('woff'); font-display: swap; } `), x += ':root, .light, [data-theme="light"] {'; for (const g in h.light) x += `${g}: ${h.light[g]};`; y === "aacute" ? (x += "--font-family-base: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;") : y === "custom" ? (x += "--font-family-base: 'CustomFont', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'CustomFont', var(--font-family-fallbacks) !important;") : (x += "--font-family-base: var(--font-family-fallbacks) !important;", x += '--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;'), x += "}", x += '.dark, [data-theme="dark"] {'; for (const g in h.dark) x += `${g}: ${h.dark[g]};`; y === "aacute" ? (x += "--font-family-base: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'Aa偷吃可爱长大的', var(--font-family-fallbacks) !important;") : y === "custom" ? (x += "--font-family-base: 'CustomFont', var(--font-family-fallbacks) !important;", x += "--font-family-mono: 'CustomFont', var(--font-family-fallbacks) !important;") : (x += "--font-family-base: var(--font-family-fallbacks) !important;", x += '--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;'), x += "}", m.send(x); }), zn.get("/webui/sw.js", async (f, m) => { try { let h = Bn($P, "static", "sw_template.js"); ir(h) || (h = Bn($P, "src", "assets", "sw_template.js")); let y = mo(h, "utf-8"); y = y.replace("{{VERSION}}", gl), m.header("Content-Type", "application/javascript"), m.header("Service-Worker-Allowed", "/webui/"), m.header("Cache-Control", "no-cache, no-store, must-revalidate"), m.send(y); } catch (h) { console.error("[SnowCat] [WebUi] Error generating sw.js", h), m.status(500).send("Error generating service worker"); } }), zn.use("/webui", ys.static(e.staticPath, { maxAge: "1d" })), zn.use("/plugin/:pluginId/mem", async (f, m) => { const { pluginId: h } = f.params; if (!h) return m.status(400).json({ code: -1, message: "Plugin ID is required" }); const y = de.getOneBotContext(); if (!y) return m.status(503).json({ code: -1, message: "OneBot context not available" }); const x = y.networkManager.findSomeAdapter("plugin_manager"); if (!x) return m.status(503).json({ code: -1, message: "Plugin manager not available" }); const b = x.getPluginRouter(h)?.getMemoryStaticRoutes() || []; for (const { urlPath: S, files: E } of b) { const T = S.startsWith("/") ? S : "/" + S; if (f.path.startsWith(T)) { const U = "/" + (f.path.substring(T.length).replace(/^\//, "") || ""), q = E.find((Y) => "/" + Y.path.replace(/^\//, "") === U); if (q) try { const Y = typeof q.content == "function" ? await q.content() : q.content; return m.setHeader("Content-Type", q.contentType || "application/octet-stream"), m.send(Y); } catch (Y) { return console.error(`[Plugin: ${h}] Error serving memory file:`, Y), m.status(500).json({ code: -1, message: "Error serving memory file" }); } } } return m.status(404).json({ code: -1, message: "Memory file not found" }); }), zn.use("/plugin/:pluginId/api", (f, m, h) => { const { pluginId: y } = f.params; if (!y) return m.status(400).json({ code: -1, message: "Plugin ID is required" }); const x = de.getOneBotContext(); if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" }); const g = x.networkManager.findSomeAdapter("plugin_manager"); if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" }); const b = g.getPluginRouter(y); return !b || !b.hasApiNoAuthRoutes() ? m.status(404).json({ code: -1, message: `Plugin '${y}' has no registered no-auth API routes` }) : b.buildApiNoAuthRouter()(f, m, h); }), zn.get("/plugin/:pluginId/page/:pagePath", (f, m) => { const { pluginId: h, pagePath: y } = f.params; if (!h) return m.status(400).json({ code: -1, message: "Plugin ID is required" }); const x = de.getOneBotContext(); if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" }); const g = x.networkManager.findSomeAdapter("plugin_manager"); if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" }); const b = g.getPluginRouter(h); if (!b || !b.hasPages()) return m.status(404).json({ code: -1, message: `Plugin '${h}' has no registered pages` }); const E = b.getPages().find((q) => q.path === "/" + y || q.path === y); if (!E) return m.status(404).json({ code: -1, message: `Page '${y}' not found in plugin '${h}'` }); const T = b.getPluginPath(); if (!T) return m.status(500).json({ code: -1, message: "Plugin path not available" }); const U = En(T, E.htmlFile); return ir(U) ? m.sendFile(U) : m.status(404).json({ code: -1, message: `HTML file not found: ${E.htmlFile}` }); }), zn.use("/plugin/:pluginId/files", (f, m, h) => { const { pluginId: y } = f.params; if (!y) return m.status(400).json({ code: -1, message: "Plugin ID is required" }); const x = de.getOneBotContext(); if (!x) return m.status(503).json({ code: -1, message: "OneBot context not available" }); const g = x.networkManager.findSomeAdapter("plugin_manager"); if (!g) return m.status(503).json({ code: -1, message: "Plugin manager not available" }); const S = g.getPluginRouter(y)?.getStaticRoutes() || []; for (const { urlPath: E, localPath: T } of S) { const U = E.startsWith("/") ? E : "/" + E; if (f.path.startsWith(U) || f.path === U.slice(0, -1)) { const q = ys.static(T, { maxAge: "1d" }), Y = f.url; return f.url = "/" + (f.path.substring(U.length).replace(/^\//, "") || ""), q(f, m, (H) => { f.url = Y, H ? h(H) : h(); }); } } m.status(404).json({ code: -1, message: "Static resource not found" }); }); const c = await z1e(t), d = !!c && c ? YL(c, zn) : JL(zn); d.on("upgrade", (f, m, h) => { new URL(f.url || "", `http://${f.headers.host}`).pathname.startsWith("/api/Debug/ws") ? B0e(f, m, h) : V1.initialize(f, m, h, t); }), zn.use("/api", _r); const p = En(e.staticPath, "index.html"); zn.all(/\/webui\/(.*)/, (f, m) => { m.sendFile(p); }), zn.all("/", (f, m) => { m.status(301).header("Location", "/webui").send(); }), zn.use((f, m, h, y) => { if (f instanceof Da.MulterError) return ne(h, f.message, !0); y(f); }), zn.use((f, m, h, y) => { ne(h, "An unknown error occurred.", !0); }), d.listen(a, o, async () => { const f = { token: s }; t.log(`[SnowCat] [WebUi] WebUi Token: ${s}`), t.log( `[SnowCat] [WebUi] WebUi User Panel Url: ${H8("127.0.0.1", a.toString(), "/webui", f)}` ), o !== "" && t.log( `[SnowCat] [WebUi] WebUi User Panel Url: ${H8(o, a.toString(), "/webui", f)}` ); }); } async function W1e(t) { return new Promise((e, n) => { try { const r = PD.createServer(); r.on("listening", () => { r.close(), e(t); }), r.on("error", (i) => { i.code === "EADDRNOTAVAIL" ? n(new Error("主机地址验证失败,可能为非本机地址")) : n(new Error(`遇到错误: ${i.code}`)); }), r.listen(0, t); } catch (r) { n(new Error(`服务器启动时发生错误: ${r}`)); } }); } async function Lm(t, e, n = 0, r = !1) { return new Promise((i, o) => { try { const a = PD.createServer(); a.on("listening", () => { a.close(), i(t); }), a.on("error", (s) => { s.code === "EADDRINUSE" ? r ? o(new Error(`端口 ${t} 已被占用`)) : n < GP ? i(Lm(t + 1, e, n + 1, !1)) : o(new Error(`端口尝试失败,达到最大尝试次数: ${GP}`)) : o(new Error(`遇到错误: ${s.code}`)); }), a.listen(t, e); } catch (a) { o(new Error(`服务器启动时发生错误: ${a}`)); } }); } class Ja extends m3 { post_type = ll.NOTICE; } class rL extends Ja { notice_type = "notify"; sub_type = "poke"; target_id = 0; user_id = 0; } class K1e extends rL { raw_info; sender_id; // raw_message nb等框架标准为string constructor(e, n, r, i, o) { super(e), this.target_id = i, this.user_id = n, this.sender_id = r, this.raw_info = o; } } class V1e extends rL { group_id; raw_info; // raw_message nb等框架标准为string constructor(e, n, r, i, o) { super(e), this.group_id = n, this.target_id = i, this.user_id = r, this.raw_info = o; } } class Y1e { obContext; core; constructor(e, n) { this.obContext = e, this.core = n; } // 使用前预先判断 busiId 1061 async parsePrivatePokeEvent(e, n) { const i = JSON.parse(e.jsonGrayTipElement.jsonStr).items, o = i.filter((a) => a.uid); if (o.length === 2 && o[0]?.uid && o[1]?.uid) return new K1e( this.core, n, parseInt(await this.core.apis.UserApi.getUinByUidV2(o[0].uid)), parseInt(await this.core.apis.UserApi.getUinByUidV2(o[1].uid)), i ); } } class Uo extends Ja { group_id; user_id; constructor(e, n, r) { super(e), this.group_id = n, this.user_id = r; } } class J1e extends Uo { notice_type = "group_ban"; operator_id; duration; sub_type; constructor(e, n, r, i, o, a) { super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.duration = o, this.sub_type = a; } } var jw = {}, $w = {}, qP; function g3() { return qP || (qP = 1, (function(t) { const e = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", n = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", r = "[" + e + "][" + n + "]*", i = new RegExp("^" + r + "$"), o = function(s, c) { const u = []; let d = c.exec(s); for (; d; ) { const p = []; p.startIndex = c.lastIndex - d[0].length; const f = d.length; for (let m = 0; m < f; m++) p.push(d[m]); u.push(p), d = c.exec(s); } return u; }, a = function(s) { const c = i.exec(s); return !(c === null || typeof c > "u"); }; t.isExist = function(s) { return typeof s < "u"; }, t.isEmptyObject = function(s) { return Object.keys(s).length === 0; }, t.merge = function(s, c, u) { if (c) { const d = Object.keys(c), p = d.length; for (let f = 0; f < p; f++) u === "strict" ? s[d[f]] = [c[d[f]]] : s[d[f]] = c[d[f]]; } }, t.getValue = function(s) { return t.isExist(s) ? s : ""; }, t.isName = a, t.getAllMatches = o, t.nameRegexp = r; })($w)), $w; } var zP; function iL() { if (zP) return jw; zP = 1; const t = g3(), e = { allowBooleanAttributes: !1, //A tag can have attributes without any value unpairedTags: [] }; jw.validate = function(g, b) { b = Object.assign({}, e, b); const S = []; let E = !1, T = !1; g[0] === "\uFEFF" && (g = g.substr(1)); for (let U = 0; U < g.length; U++) if (g[U] === "<" && g[U + 1] === "?") { if (U += 2, U = r(g, U), U.err) return U; } else if (g[U] === "<") { let q = U; if (U++, g[U] === "!") { U = i(g, U); continue; } else { let Y = !1; g[U] === "/" && (Y = !0, U++); let H = ""; for (; U < g.length && g[U] !== ">" && g[U] !== " " && g[U] !== " " && g[U] !== ` ` && g[U] !== "\r"; U++) H += g[U]; if (H = H.trim(), H[H.length - 1] === "/" && (H = H.substring(0, H.length - 1), U--), !h(H)) { let B; return H.trim().length === 0 ? B = "Invalid space after '<'." : B = "Tag '" + H + "' is an invalid name.", f("InvalidTag", B, y(g, U)); } const G = s(g, U); if (G === !1) return f("InvalidAttr", "Attributes for '" + H + "' have open quote.", y(g, U)); let J = G.value; if (U = G.index, J[J.length - 1] === "/") { const B = U - J.length; J = J.substring(0, J.length - 1); const D = u(J, b); if (D === !0) E = !0; else return f(D.err.code, D.err.msg, y(g, B + D.err.line)); } else if (Y) if (G.tagClosed) { if (J.trim().length > 0) return f("InvalidTag", "Closing tag '" + H + "' can't have attributes or invalid starting.", y(g, q)); if (S.length === 0) return f("InvalidTag", "Closing tag '" + H + "' has not been opened.", y(g, q)); { const B = S.pop(); if (H !== B.tagName) { let D = y(g, B.tagStartPos); return f( "InvalidTag", "Expected closing tag '" + B.tagName + "' (opened in line " + D.line + ", col " + D.col + ") instead of closing tag '" + H + "'.", y(g, q) ); } S.length == 0 && (T = !0); } } else return f("InvalidTag", "Closing tag '" + H + "' doesn't have proper closing.", y(g, U)); else { const B = u(J, b); if (B !== !0) return f(B.err.code, B.err.msg, y(g, U - J.length + B.err.line)); if (T === !0) return f("InvalidXml", "Multiple possible root nodes found.", y(g, U)); b.unpairedTags.indexOf(H) !== -1 || S.push({ tagName: H, tagStartPos: q }), E = !0; } for (U++; U < g.length; U++) if (g[U] === "<") if (g[U + 1] === "!") { U++, U = i(g, U); continue; } else if (g[U + 1] === "?") { if (U = r(g, ++U), U.err) return U; } else break; else if (g[U] === "&") { const B = p(g, U); if (B == -1) return f("InvalidChar", "char '&' is not expected.", y(g, U)); U = B; } else if (T === !0 && !n(g[U])) return f("InvalidXml", "Extra text at the end", y(g, U)); g[U] === "<" && U--; } } else { if (n(g[U])) continue; return f("InvalidChar", "char '" + g[U] + "' is not expected.", y(g, U)); } if (E) { if (S.length == 1) return f("InvalidTag", "Unclosed tag '" + S[0].tagName + "'.", y(g, S[0].tagStartPos)); if (S.length > 0) return f("InvalidXml", "Invalid '" + JSON.stringify(S.map((U) => U.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); } else return f("InvalidXml", "Start tag expected.", 1); return !0; }; function n(g) { return g === " " || g === " " || g === ` ` || g === "\r"; } function r(g, b) { const S = b; for (; b < g.length; b++) if (g[b] == "?" || g[b] == " ") { const E = g.substr(S, b - S); if (b > 5 && E === "xml") return f("InvalidXml", "XML declaration allowed only at the start of the document.", y(g, b)); if (g[b] == "?" && g[b + 1] == ">") { b++; break; } else continue; } return b; } function i(g, b) { if (g.length > b + 5 && g[b + 1] === "-" && g[b + 2] === "-") { for (b += 3; b < g.length; b++) if (g[b] === "-" && g[b + 1] === "-" && g[b + 2] === ">") { b += 2; break; } } else if (g.length > b + 8 && g[b + 1] === "D" && g[b + 2] === "O" && g[b + 3] === "C" && g[b + 4] === "T" && g[b + 5] === "Y" && g[b + 6] === "P" && g[b + 7] === "E") { let S = 1; for (b += 8; b < g.length; b++) if (g[b] === "<") S++; else if (g[b] === ">" && (S--, S === 0)) break; } else if (g.length > b + 9 && g[b + 1] === "[" && g[b + 2] === "C" && g[b + 3] === "D" && g[b + 4] === "A" && g[b + 5] === "T" && g[b + 6] === "A" && g[b + 7] === "[") { for (b += 8; b < g.length; b++) if (g[b] === "]" && g[b + 1] === "]" && g[b + 2] === ">") { b += 2; break; } } return b; } const o = '"', a = "'"; function s(g, b) { let S = "", E = "", T = !1; for (; b < g.length; b++) { if (g[b] === o || g[b] === a) E === "" ? E = g[b] : E !== g[b] || (E = ""); else if (g[b] === ">" && E === "") { T = !0; break; } S += g[b]; } return E !== "" ? !1 : { value: S, index: b, tagClosed: T }; } const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); function u(g, b) { const S = t.getAllMatches(g, c), E = {}; for (let T = 0; T < S.length; T++) { if (S[T][1].length === 0) return f("InvalidAttr", "Attribute '" + S[T][2] + "' has no space in starting.", x(S[T])); if (S[T][3] !== void 0 && S[T][4] === void 0) return f("InvalidAttr", "Attribute '" + S[T][2] + "' is without value.", x(S[T])); if (S[T][3] === void 0 && !b.allowBooleanAttributes) return f("InvalidAttr", "boolean attribute '" + S[T][2] + "' is not allowed.", x(S[T])); const U = S[T][2]; if (!m(U)) return f("InvalidAttr", "Attribute '" + U + "' is an invalid name.", x(S[T])); if (!E.hasOwnProperty(U)) E[U] = 1; else return f("InvalidAttr", "Attribute '" + U + "' is repeated.", x(S[T])); } return !0; } function d(g, b) { let S = /\d/; for (g[b] === "x" && (b++, S = /[\da-fA-F]/); b < g.length; b++) { if (g[b] === ";") return b; if (!g[b].match(S)) break; } return -1; } function p(g, b) { if (b++, g[b] === ";") return -1; if (g[b] === "#") return b++, d(g, b); let S = 0; for (; b < g.length; b++, S++) if (!(g[b].match(/\w/) && S < 20)) { if (g[b] === ";") break; return -1; } return b; } function f(g, b, S) { return { err: { code: g, msg: b, line: S.line || S, col: S.col } }; } function m(g) { return t.isName(g); } function h(g) { return t.isName(g); } function y(g, b) { const S = g.substring(0, b).split(/\r?\n/); return { line: S.length, // column number is last line's length + 1, because column numbering starts at 1: col: S[S.length - 1].length + 1 }; } function x(g) { return g.startIndex + g[1].length; } return jw; } var bm = {}, HP; function X1e() { if (HP) return bm; HP = 1; const t = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, removeNSPrefix: !1, // remove NS from tag name or attribute name if true allowBooleanAttributes: !1, //a tag can have attributes without any value //ignoreRootElement : false, parseTagValue: !0, parseAttributeValue: !1, trimValues: !0, //Trim string values of tag and attributes cdataPropName: !1, numberParseOptions: { hex: !0, leadingZeros: !0, eNotation: !0 }, tagValueProcessor: function(n, r) { return r; }, attributeValueProcessor: function(n, r) { return r; }, stopNodes: [], //nested tags will not be parsed even for errors alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(n, r, i) { return n; } // skipEmptyListItem: false }, e = function(n) { return Object.assign({}, t, n); }; return bm.buildOptions = e, bm.defaultOptions = t, bm; } var Gw, WP; function Z1e() { if (WP) return Gw; WP = 1; class t { constructor(n) { this.tagname = n, this.child = [], this[":@"] = {}; } add(n, r) { n === "__proto__" && (n = "#__proto__"), this.child.push({ [n]: r }); } addChild(n) { n.tagname === "__proto__" && (n.tagname = "#__proto__"), n[":@"] && Object.keys(n[":@"]).length > 0 ? this.child.push({ [n.tagname]: n.child, ":@": n[":@"] }) : this.child.push({ [n.tagname]: n.child }); } } return Gw = t, Gw; } var qw, KP; function eye() { if (KP) return qw; KP = 1; const t = g3(); function e(u, d) { const p = {}; if (u[d + 3] === "O" && u[d + 4] === "C" && u[d + 5] === "T" && u[d + 6] === "Y" && u[d + 7] === "P" && u[d + 8] === "E") { d = d + 9; let f = 1, m = !1, h = !1, y = ""; for (; d < u.length; d++) if (u[d] === "<" && !h) { if (m && i(u, d)) { d += 7; let x, g; [x, g, d] = n(u, d + 1), g.indexOf("&") === -1 && (p[c(x)] = { regx: RegExp(`&${x};`, "g"), val: g }); } else if (m && o(u, d)) d += 8; else if (m && a(u, d)) d += 8; else if (m && s(u, d)) d += 9; else if (r) h = !0; else throw new Error("Invalid DOCTYPE"); f++, y = ""; } else if (u[d] === ">") { if (h ? u[d - 1] === "-" && u[d - 2] === "-" && (h = !1, f--) : f--, f === 0) break; } else u[d] === "[" ? m = !0 : y += u[d]; if (f !== 0) throw new Error("Unclosed DOCTYPE"); } else throw new Error("Invalid Tag instead of DOCTYPE"); return { entities: p, i: d }; } function n(u, d) { let p = ""; for (; d < u.length && u[d] !== "'" && u[d] !== '"'; d++) p += u[d]; if (p = p.trim(), p.indexOf(" ") !== -1) throw new Error("External entites are not supported"); const f = u[d++]; let m = ""; for (; d < u.length && u[d] !== f; d++) m += u[d]; return [p, m, d]; } function r(u, d) { return u[d + 1] === "!" && u[d + 2] === "-" && u[d + 3] === "-"; } function i(u, d) { return u[d + 1] === "!" && u[d + 2] === "E" && u[d + 3] === "N" && u[d + 4] === "T" && u[d + 5] === "I" && u[d + 6] === "T" && u[d + 7] === "Y"; } function o(u, d) { return u[d + 1] === "!" && u[d + 2] === "E" && u[d + 3] === "L" && u[d + 4] === "E" && u[d + 5] === "M" && u[d + 6] === "E" && u[d + 7] === "N" && u[d + 8] === "T"; } function a(u, d) { return u[d + 1] === "!" && u[d + 2] === "A" && u[d + 3] === "T" && u[d + 4] === "T" && u[d + 5] === "L" && u[d + 6] === "I" && u[d + 7] === "S" && u[d + 8] === "T"; } function s(u, d) { return u[d + 1] === "!" && u[d + 2] === "N" && u[d + 3] === "O" && u[d + 4] === "T" && u[d + 5] === "A" && u[d + 6] === "T" && u[d + 7] === "I" && u[d + 8] === "O" && u[d + 9] === "N"; } function c(u) { if (t.isName(u)) return u; throw new Error(`Invalid entity name ${u}`); } return qw = e, qw; } var zw, VP; function tye() { if (VP) return zw; VP = 1; const t = /^[-+]?0x[a-fA-F0-9]+$/, e = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, n = { hex: !0, // oct: false, leadingZeros: !0, decimalPoint: ".", eNotation: !0 //skipLike: /regex/ }; function r(a, s = {}) { if (s = Object.assign({}, n, s), !a || typeof a != "string") return a; let c = a.trim(); if (s.skipLike !== void 0 && s.skipLike.test(c)) return a; if (a === "0") return 0; if (s.hex && t.test(c)) return o(c, 16); if (c.search(/[eE]/) !== -1) { const u = c.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/); if (u) { if (s.leadingZeros) c = (u[1] || "") + u[3]; else if (!(u[2] === "0" && u[3][0] === ".")) return a; return s.eNotation ? Number(c) : a; } else return a; } else { const u = e.exec(c); if (u) { const d = u[1], p = u[2]; let f = i(u[3]); if (!s.leadingZeros && p.length > 0 && d && c[2] !== ".") return a; if (!s.leadingZeros && p.length > 0 && !d && c[1] !== ".") return a; if (s.leadingZeros && p === a) return 0; { const m = Number(c), h = "" + m; return h.search(/[eE]/) !== -1 ? s.eNotation ? m : a : c.indexOf(".") !== -1 ? h === "0" && f === "" || h === f || d && h === "-" + f ? m : a : p ? f === h || d + f === h ? m : a : c === h || c === d + h ? m : a; } } else return a; } } function i(a) { return a && a.indexOf(".") !== -1 && (a = a.replace(/0+$/, ""), a === "." ? a = "0" : a[0] === "." ? a = "0" + a : a[a.length - 1] === "." && (a = a.substr(0, a.length - 1))), a; } function o(a, s) { if (parseInt) return parseInt(a, s); if (Number.parseInt) return Number.parseInt(a, s); if (window && window.parseInt) return window.parseInt(a, s); throw new Error("parseInt, Number.parseInt, window.parseInt are not supported"); } return zw = r, zw; } var Hw, YP; function oL() { if (YP) return Hw; YP = 1; function t(e) { return typeof e == "function" ? e : Array.isArray(e) ? (n) => { for (const r of e) if (typeof r == "string" && n === r || r instanceof RegExp && r.test(n)) return !0; } : () => !1; } return Hw = t, Hw; } var Ww, JP; function nye() { if (JP) return Ww; JP = 1; const t = g3(), e = Z1e(), n = eye(), r = tye(), i = oL(); class o { constructor(U) { this.options = U, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, // "lt" : { regex: /&(lt|#60);/g, val: "<" }, // "gt" : { regex: /&(gt|#62);/g, val: ">" }, // "amp" : { regex: /&(amp|#38);/g, val: "&" }, // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, // "apos" : { regex: /&(apos|#39);/g, val: "'" }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (q, Y) => String.fromCharCode(Number.parseInt(Y, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (q, Y) => String.fromCharCode(Number.parseInt(Y, 16)) } }, this.addExternalEntities = a, this.parseXml = p, this.parseTextData = s, this.resolveNameSpace = c, this.buildAttributesMap = d, this.isItStopNode = y, this.replaceEntitiesValue = m, this.readStopNodeData = S, this.saveTextToParentTag = h, this.addChild = f, this.ignoreAttributesFn = i(this.options.ignoreAttributes); } } function a(T) { const U = Object.keys(T); for (let q = 0; q < U.length; q++) { const Y = U[q]; this.lastEntities[Y] = { regex: new RegExp("&" + Y + ";", "g"), val: T[Y] }; } } function s(T, U, q, Y, H, G, J) { if (T !== void 0 && (this.options.trimValues && !Y && (T = T.trim()), T.length > 0)) { J || (T = this.replaceEntitiesValue(T)); const B = this.options.tagValueProcessor(U, T, q, H, G); return B == null ? T : typeof B != typeof T || B !== T ? B : this.options.trimValues ? E(T, this.options.parseTagValue, this.options.numberParseOptions) : T.trim() === T ? E(T, this.options.parseTagValue, this.options.numberParseOptions) : T; } } function c(T) { if (this.options.removeNSPrefix) { const U = T.split(":"), q = T.charAt(0) === "/" ? "/" : ""; if (U[0] === "xmlns") return ""; U.length === 2 && (T = q + U[1]); } return T; } const u = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); function d(T, U, q) { if (this.options.ignoreAttributes !== !0 && typeof T == "string") { const Y = t.getAllMatches(T, u), H = Y.length, G = {}; for (let J = 0; J < H; J++) { const B = this.resolveNameSpace(Y[J][1]); if (this.ignoreAttributesFn(B, U)) continue; let D = Y[J][4], X = this.options.attributeNamePrefix + B; if (B.length) if (this.options.transformAttributeName && (X = this.options.transformAttributeName(X)), X === "__proto__" && (X = "#__proto__"), D !== void 0) { this.options.trimValues && (D = D.trim()), D = this.replaceEntitiesValue(D); const V = this.options.attributeValueProcessor(B, D, U); V == null ? G[X] = D : typeof V != typeof D || V !== D ? G[X] = V : G[X] = E( D, this.options.parseAttributeValue, this.options.numberParseOptions ); } else this.options.allowBooleanAttributes && (G[X] = !0); } if (!Object.keys(G).length) return; if (this.options.attributesGroupName) { const J = {}; return J[this.options.attributesGroupName] = G, J; } return G; } } const p = function(T) { T = T.replace(/\r\n?/g, ` `); const U = new e("!xml"); let q = U, Y = "", H = ""; for (let G = 0; G < T.length; G++) if (T[G] === "<") if (T[G + 1] === "/") { const B = g(T, ">", G, "Closing Tag is not closed."); let D = T.substring(G + 2, B).trim(); if (this.options.removeNSPrefix) { const K = D.indexOf(":"); K !== -1 && (D = D.substr(K + 1)); } this.options.transformTagName && (D = this.options.transformTagName(D)), q && (Y = this.saveTextToParentTag(Y, q, H)); const X = H.substring(H.lastIndexOf(".") + 1); if (D && this.options.unpairedTags.indexOf(D) !== -1) throw new Error(`Unpaired tag can not be used as closing tag: </${D}>`); let V = 0; X && this.options.unpairedTags.indexOf(X) !== -1 ? (V = H.lastIndexOf(".", H.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : V = H.lastIndexOf("."), H = H.substring(0, V), q = this.tagsNodeStack.pop(), Y = "", G = B; } else if (T[G + 1] === "?") { let B = b(T, G, !1, "?>"); if (!B) throw new Error("Pi Tag is not closed."); if (Y = this.saveTextToParentTag(Y, q, H), !(this.options.ignoreDeclaration && B.tagName === "?xml" || this.options.ignorePiTags)) { const D = new e(B.tagName); D.add(this.options.textNodeName, ""), B.tagName !== B.tagExp && B.attrExpPresent && (D[":@"] = this.buildAttributesMap(B.tagExp, H, B.tagName)), this.addChild(q, D, H); } G = B.closeIndex + 1; } else if (T.substr(G + 1, 3) === "!--") { const B = g(T, "-->", G + 4, "Comment is not closed."); if (this.options.commentPropName) { const D = T.substring(G + 4, B - 2); Y = this.saveTextToParentTag(Y, q, H), q.add(this.options.commentPropName, [{ [this.options.textNodeName]: D }]); } G = B; } else if (T.substr(G + 1, 2) === "!D") { const B = n(T, G); this.docTypeEntities = B.entities, G = B.i; } else if (T.substr(G + 1, 2) === "![") { const B = g(T, "]]>", G, "CDATA is not closed.") - 2, D = T.substring(G + 9, B); Y = this.saveTextToParentTag(Y, q, H); let X = this.parseTextData(D, q.tagname, H, !0, !1, !0, !0); X == null && (X = ""), this.options.cdataPropName ? q.add(this.options.cdataPropName, [{ [this.options.textNodeName]: D }]) : q.add(this.options.textNodeName, X), G = B + 2; } else { let B = b(T, G, this.options.removeNSPrefix), D = B.tagName; const X = B.rawTagName; let V = B.tagExp, K = B.attrExpPresent, $ = B.closeIndex; this.options.transformTagName && (D = this.options.transformTagName(D)), q && Y && q.tagname !== "!xml" && (Y = this.saveTextToParentTag(Y, q, H, !1)); const _ = q; if (_ && this.options.unpairedTags.indexOf(_.tagname) !== -1 && (q = this.tagsNodeStack.pop(), H = H.substring(0, H.lastIndexOf("."))), D !== U.tagname && (H += H ? "." + D : D), this.isItStopNode(this.options.stopNodes, H, D)) { let I = ""; if (V.length > 0 && V.lastIndexOf("/") === V.length - 1) D[D.length - 1] === "/" ? (D = D.substr(0, D.length - 1), H = H.substr(0, H.length - 1), V = D) : V = V.substr(0, V.length - 1), G = B.closeIndex; else if (this.options.unpairedTags.indexOf(D) !== -1) G = B.closeIndex; else { const L = this.readStopNodeData(T, X, $ + 1); if (!L) throw new Error(`Unexpected end of ${X}`); G = L.i, I = L.tagContent; } const N = new e(D); D !== V && K && (N[":@"] = this.buildAttributesMap(V, H, D)), I && (I = this.parseTextData(I, D, H, !0, K, !0, !0)), H = H.substr(0, H.lastIndexOf(".")), N.add(this.options.textNodeName, I), this.addChild(q, N, H); } else { if (V.length > 0 && V.lastIndexOf("/") === V.length - 1) { D[D.length - 1] === "/" ? (D = D.substr(0, D.length - 1), H = H.substr(0, H.length - 1), V = D) : V = V.substr(0, V.length - 1), this.options.transformTagName && (D = this.options.transformTagName(D)); const I = new e(D); D !== V && K && (I[":@"] = this.buildAttributesMap(V, H, D)), this.addChild(q, I, H), H = H.substr(0, H.lastIndexOf(".")); } else { const I = new e(D); this.tagsNodeStack.push(q), D !== V && K && (I[":@"] = this.buildAttributesMap(V, H, D)), this.addChild(q, I, H), q = I; } Y = "", G = $; } } else Y += T[G]; return U.child; }; function f(T, U, q) { const Y = this.options.updateTag(U.tagname, q, U[":@"]); Y === !1 || (typeof Y == "string" && (U.tagname = Y), T.addChild(U)); } const m = function(T) { if (this.options.processEntities) { for (let U in this.docTypeEntities) { const q = this.docTypeEntities[U]; T = T.replace(q.regx, q.val); } for (let U in this.lastEntities) { const q = this.lastEntities[U]; T = T.replace(q.regex, q.val); } if (this.options.htmlEntities) for (let U in this.htmlEntities) { const q = this.htmlEntities[U]; T = T.replace(q.regex, q.val); } T = T.replace(this.ampEntity.regex, this.ampEntity.val); } return T; }; function h(T, U, q, Y) { return T && (Y === void 0 && (Y = U.child.length === 0), T = this.parseTextData( T, U.tagname, q, !1, U[":@"] ? Object.keys(U[":@"]).length !== 0 : !1, Y ), T !== void 0 && T !== "" && U.add(this.options.textNodeName, T), T = ""), T; } function y(T, U, q) { const Y = "*." + q; for (const H in T) { const G = T[H]; if (Y === G || U === G) return !0; } return !1; } function x(T, U, q = ">") { let Y, H = ""; for (let G = U; G < T.length; G++) { let J = T[G]; if (Y) J === Y && (Y = ""); else if (J === '"' || J === "'") Y = J; else if (J === q[0]) if (q[1]) { if (T[G + 1] === q[1]) return { data: H, index: G }; } else return { data: H, index: G }; else J === " " && (J = " "); H += J; } } function g(T, U, q, Y) { const H = T.indexOf(U, q); if (H === -1) throw new Error(Y); return H + U.length - 1; } function b(T, U, q, Y = ">") { const H = x(T, U + 1, Y); if (!H) return; let G = H.data; const J = H.index, B = G.search(/\s/); let D = G, X = !0; B !== -1 && (D = G.substring(0, B), G = G.substring(B + 1).trimStart()); const V = D; if (q) { const K = D.indexOf(":"); K !== -1 && (D = D.substr(K + 1), X = D !== H.data.substr(K + 1)); } return { tagName: D, tagExp: G, closeIndex: J, attrExpPresent: X, rawTagName: V }; } function S(T, U, q) { const Y = q; let H = 1; for (; q < T.length; q++) if (T[q] === "<") if (T[q + 1] === "/") { const G = g(T, ">", q, `${U} is not closed`); if (T.substring(q + 2, G).trim() === U && (H--, H === 0)) return { tagContent: T.substring(Y, q), i: G }; q = G; } else if (T[q + 1] === "?") q = g(T, "?>", q + 1, "StopNode is not closed."); else if (T.substr(q + 1, 3) === "!--") q = g(T, "-->", q + 3, "StopNode is not closed."); else if (T.substr(q + 1, 2) === "![") q = g(T, "]]>", q, "StopNode is not closed.") - 2; else { const G = b(T, q, ">"); G && ((G && G.tagName) === U && G.tagExp[G.tagExp.length - 1] !== "/" && H++, q = G.closeIndex); } } function E(T, U, q) { if (U && typeof T == "string") { const Y = T.trim(); return Y === "true" ? !0 : Y === "false" ? !1 : r(T, q); } else return t.isExist(T) ? T : ""; } return Ww = o, Ww; } var Kw = {}, XP; function rye() { if (XP) return Kw; XP = 1; function t(o, a) { return e(o, a); } function e(o, a, s) { let c; const u = {}; for (let d = 0; d < o.length; d++) { const p = o[d], f = n(p); let m = ""; if (s === void 0 ? m = f : m = s + "." + f, f === a.textNodeName) c === void 0 ? c = p[f] : c += "" + p[f]; else { if (f === void 0) continue; if (p[f]) { let h = e(p[f], a, m); const y = i(h, a); p[":@"] ? r(h, p[":@"], m, a) : Object.keys(h).length === 1 && h[a.textNodeName] !== void 0 && !a.alwaysCreateTextNode ? h = h[a.textNodeName] : Object.keys(h).length === 0 && (a.alwaysCreateTextNode ? h[a.textNodeName] = "" : h = ""), u[f] !== void 0 && u.hasOwnProperty(f) ? (Array.isArray(u[f]) || (u[f] = [u[f]]), u[f].push(h)) : a.isArray(f, m, y) ? u[f] = [h] : u[f] = h; } } } return typeof c == "string" ? c.length > 0 && (u[a.textNodeName] = c) : c !== void 0 && (u[a.textNodeName] = c), u; } function n(o) { const a = Object.keys(o); for (let s = 0; s < a.length; s++) { const c = a[s]; if (c !== ":@") return c; } } function r(o, a, s, c) { if (a) { const u = Object.keys(a), d = u.length; for (let p = 0; p < d; p++) { const f = u[p]; c.isArray(f, s + "." + f, !0, !0) ? o[f] = [a[f]] : o[f] = a[f]; } } } function i(o, a) { const { textNodeName: s } = a, c = Object.keys(o).length; return !!(c === 0 || c === 1 && (o[s] || typeof o[s] == "boolean" || o[s] === 0)); } return Kw.prettify = t, Kw; } var Vw, ZP; function iye() { if (ZP) return Vw; ZP = 1; const { buildOptions: t } = X1e(), e = nye(), { prettify: n } = rye(), r = iL(); class i { constructor(a) { this.externalEntities = {}, this.options = t(a); } /** * Parse XML dats to JS object * @param {string|Buffer} xmlData * @param {boolean|Object} validationOption */ parse(a, s) { if (typeof a != "string") if (a.toString) a = a.toString(); else throw new Error("XML data is accepted in String or Bytes[] form."); if (s) { s === !0 && (s = {}); const d = r.validate(a, s); if (d !== !0) throw Error(`${d.err.msg}:${d.err.line}:${d.err.col}`); } const c = new e(this.options); c.addExternalEntities(this.externalEntities); const u = c.parseXml(a); return this.options.preserveOrder || u === void 0 ? u : n(u, this.options); } /** * Add Entity which is not by default supported by this library * @param {string} key * @param {string} value */ addEntity(a, s) { if (s.indexOf("&") !== -1) throw new Error("Entity value can't have '&'"); if (a.indexOf("&") !== -1 || a.indexOf(";") !== -1) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); if (s === "&") throw new Error("An entity with value '&' is not permitted"); this.externalEntities[a] = s; } } return Vw = i, Vw; } var Yw, eD; function oye() { if (eD) return Yw; eD = 1; const t = ` `; function e(s, c) { let u = ""; return c.format && c.indentBy.length > 0 && (u = t), n(s, c, "", u); } function n(s, c, u, d) { let p = "", f = !1; for (let m = 0; m < s.length; m++) { const h = s[m], y = r(h); if (y === void 0) continue; let x = ""; if (u.length === 0 ? x = y : x = `${u}.${y}`, y === c.textNodeName) { let T = h[y]; o(x, c) || (T = c.tagValueProcessor(y, T), T = a(T, c)), f && (p += d), p += T, f = !1; continue; } else if (y === c.cdataPropName) { f && (p += d), p += `<![CDATA[${h[y][0][c.textNodeName]}]]>`, f = !1; continue; } else if (y === c.commentPropName) { p += d + `<!--${h[y][0][c.textNodeName]}-->`, f = !0; continue; } else if (y[0] === "?") { const T = i(h[":@"], c), U = y === "?xml" ? "" : d; let q = h[y][0][c.textNodeName]; q = q.length !== 0 ? " " + q : "", p += U + `<${y}${q}${T}?>`, f = !0; continue; } let g = d; g !== "" && (g += c.indentBy); const b = i(h[":@"], c), S = d + `<${y}${b}`, E = n(h[y], c, x, g); c.unpairedTags.indexOf(y) !== -1 ? c.suppressUnpairedNode ? p += S + ">" : p += S + "/>" : (!E || E.length === 0) && c.suppressEmptyNode ? p += S + "/>" : E && E.endsWith(">") ? p += S + `>${E}${d}</${y}>` : (p += S + ">", E && d !== "" && (E.includes("/>") || E.includes("</")) ? p += d + c.indentBy + E + d : p += E, p += `</${y}>`), f = !0; } return p; } function r(s) { const c = Object.keys(s); for (let u = 0; u < c.length; u++) { const d = c[u]; if (s.hasOwnProperty(d) && d !== ":@") return d; } } function i(s, c) { let u = ""; if (s && !c.ignoreAttributes) for (let d in s) { if (!s.hasOwnProperty(d)) continue; let p = c.attributeValueProcessor(d, s[d]); p = a(p, c), p === !0 && c.suppressBooleanAttributes ? u += ` ${d.substr(c.attributeNamePrefix.length)}` : u += ` ${d.substr(c.attributeNamePrefix.length)}="${p}"`; } return u; } function o(s, c) { s = s.substr(0, s.length - c.textNodeName.length - 1); let u = s.substr(s.lastIndexOf(".") + 1); for (let d in c.stopNodes) if (c.stopNodes[d] === s || c.stopNodes[d] === "*." + u) return !0; return !1; } function a(s, c) { if (s && s.length > 0 && c.processEntities) for (let u = 0; u < c.entities.length; u++) { const d = c.entities[u]; s = s.replace(d.regex, d.val); } return s; } return Yw = e, Yw; } var Jw, tD; function aye() { if (tD) return Jw; tD = 1; const t = oye(), e = oL(), n = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(s, c) { return c; }, attributeValueProcessor: function(s, c) { return c; }, preserveOrder: !1, commentPropName: !1, unpairedTags: [], entities: [ { regex: new RegExp("&", "g"), val: "&" }, //it must be on top { regex: new RegExp(">", "g"), val: ">" }, { regex: new RegExp("<", "g"), val: "<" }, { regex: new RegExp("'", "g"), val: "'" }, { regex: new RegExp('"', "g"), val: """ } ], processEntities: !0, stopNodes: [], // transformTagName: false, // transformAttributeName: false, oneListGroup: !1 }; function r(s) { this.options = Object.assign({}, n, s), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() { return !1; } : (this.ignoreAttributesFn = e(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = a), this.processTextOrObjNode = i, this.options.format ? (this.indentate = o, this.tagEndChar = `> `, this.newLine = ` `) : (this.indentate = function() { return ""; }, this.tagEndChar = ">", this.newLine = ""); } r.prototype.build = function(s) { return this.options.preserveOrder ? t(s, this.options) : (Array.isArray(s) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (s = { [this.options.arrayNodeName]: s }), this.j2x(s, 0, []).val); }, r.prototype.j2x = function(s, c, u) { let d = "", p = ""; const f = u.join("."); for (let m in s) if (Object.prototype.hasOwnProperty.call(s, m)) if (typeof s[m] > "u") this.isAttribute(m) && (p += ""); else if (s[m] === null) this.isAttribute(m) || m === this.options.cdataPropName ? p += "" : m[0] === "?" ? p += this.indentate(c) + "<" + m + "?" + this.tagEndChar : p += this.indentate(c) + "<" + m + "/" + this.tagEndChar; else if (s[m] instanceof Date) p += this.buildTextValNode(s[m], m, "", c); else if (typeof s[m] != "object") { const h = this.isAttribute(m); if (h && !this.ignoreAttributesFn(h, f)) d += this.buildAttrPairStr(h, "" + s[m]); else if (!h) if (m === this.options.textNodeName) { let y = this.options.tagValueProcessor(m, "" + s[m]); p += this.replaceEntitiesValue(y); } else p += this.buildTextValNode(s[m], m, "", c); } else if (Array.isArray(s[m])) { const h = s[m].length; let y = "", x = ""; for (let g = 0; g < h; g++) { const b = s[m][g]; if (!(typeof b > "u")) if (b === null) m[0] === "?" ? p += this.indentate(c) + "<" + m + "?" + this.tagEndChar : p += this.indentate(c) + "<" + m + "/" + this.tagEndChar; else if (typeof b == "object") if (this.options.oneListGroup) { const S = this.j2x(b, c + 1, u.concat(m)); y += S.val, this.options.attributesGroupName && b.hasOwnProperty(this.options.attributesGroupName) && (x += S.attrStr); } else y += this.processTextOrObjNode(b, m, c, u); else if (this.options.oneListGroup) { let S = this.options.tagValueProcessor(m, b); S = this.replaceEntitiesValue(S), y += S; } else y += this.buildTextValNode(b, m, "", c); } this.options.oneListGroup && (y = this.buildObjectNode(y, m, x, c)), p += y; } else if (this.options.attributesGroupName && m === this.options.attributesGroupName) { const h = Object.keys(s[m]), y = h.length; for (let x = 0; x < y; x++) d += this.buildAttrPairStr(h[x], "" + s[m][h[x]]); } else p += this.processTextOrObjNode(s[m], m, c, u); return { attrStr: d, val: p }; }, r.prototype.buildAttrPairStr = function(s, c) { return c = this.options.attributeValueProcessor(s, "" + c), c = this.replaceEntitiesValue(c), this.options.suppressBooleanAttributes && c === "true" ? " " + s : " " + s + '="' + c + '"'; }; function i(s, c, u, d) { const p = this.j2x(s, u + 1, d.concat(c)); return s[this.options.textNodeName] !== void 0 && Object.keys(s).length === 1 ? this.buildTextValNode(s[this.options.textNodeName], c, p.attrStr, u) : this.buildObjectNode(p.val, c, p.attrStr, u); } r.prototype.buildObjectNode = function(s, c, u, d) { if (s === "") return c[0] === "?" ? this.indentate(d) + "<" + c + u + "?" + this.tagEndChar : this.indentate(d) + "<" + c + u + this.closeTag(c) + this.tagEndChar; { let p = "</" + c + this.tagEndChar, f = ""; return c[0] === "?" && (f = "?", p = ""), (u || u === "") && s.indexOf("<") === -1 ? this.indentate(d) + "<" + c + u + f + ">" + s + p : this.options.commentPropName !== !1 && c === this.options.commentPropName && f.length === 0 ? this.indentate(d) + `<!--${s}-->` + this.newLine : this.indentate(d) + "<" + c + u + f + this.tagEndChar + s + this.indentate(d) + p; } }, r.prototype.closeTag = function(s) { let c = ""; return this.options.unpairedTags.indexOf(s) !== -1 ? this.options.suppressUnpairedNode || (c = "/") : this.options.suppressEmptyNode ? c = "/" : c = `></${s}`, c; }, r.prototype.buildTextValNode = function(s, c, u, d) { if (this.options.cdataPropName !== !1 && c === this.options.cdataPropName) return this.indentate(d) + `<![CDATA[${s}]]>` + this.newLine; if (this.options.commentPropName !== !1 && c === this.options.commentPropName) return this.indentate(d) + `<!--${s}-->` + this.newLine; if (c[0] === "?") return this.indentate(d) + "<" + c + u + "?" + this.tagEndChar; { let p = this.options.tagValueProcessor(c, s); return p = this.replaceEntitiesValue(p), p === "" ? this.indentate(d) + "<" + c + u + this.closeTag(c) + this.tagEndChar : this.indentate(d) + "<" + c + u + ">" + p + "</" + c + this.tagEndChar; } }, r.prototype.replaceEntitiesValue = function(s) { if (s && s.length > 0 && this.options.processEntities) for (let c = 0; c < this.options.entities.length; c++) { const u = this.options.entities[c]; s = s.replace(u.regex, u.val); } return s; }; function o(s) { return this.options.indentBy.repeat(s); } function a(s) { return s.startsWith(this.options.attributeNamePrefix) && s !== this.options.textNodeName ? s.substr(this.attrPrefixLen) : !1; } return Jw = r, Jw; } var Xw, nD; function sye() { if (nD) return Xw; nD = 1; const t = iL(), e = iye(), n = aye(); return Xw = { XMLParser: e, XMLValidator: t, XMLBuilder: n }, Xw; } var cye = sye(); const uye = /* @__PURE__ */ ra(cye); class lye extends Uo { notice_type = "group_msg_emoji_like"; message_id; likes; is_add; message_seq; constructor(e, n, r, i, o, a, s) { super(e, n, r), this.group_id = n, this.user_id = r, this.message_id = i, this.likes = o, this.is_add = a; } } class dye extends Uo { notice_type = "group_card"; card_new; card_old; constructor(e, n, r, i, o) { super(e, n, r), this.group_id = n, this.user_id = r, this.card_new = i, this.card_old = o; } } class pye extends Uo { notice_type = "essence"; message_id; sender_id; operator_id; sub_type = "add"; constructor(e, n, r, i, o) { super(e, n, i), this.group_id = n, this.operator_id = o, this.message_id = r, this.sender_id = i; } } class fye extends Uo { notice_type = "notify"; sub_type = "title"; title; constructor(e, n, r, i) { super(e, n, r), this.group_id = n, this.user_id = r, this.title = i; } } class hye extends Ja { notice_type = "notify"; sub_type = "gray_tip"; group_id; user_id; // 真实发送者QQ(如果是伪造的灰条,这就是攻击者) message_id; // 消息ID,可用于撤回 busi_id; // 业务ID content; // 灰条内容(JSON字符串) raw_info; // 原始信息 constructor(e, n, r, i, o, a, s) { super(e), this.group_id = n, this.user_id = r, this.message_id = i, this.busi_id = o, this.content = a, this.raw_info = s; } } class mye extends Uo { notice_type = "group_upload"; file; constructor(e, n, r, i) { super(e, n, r), this.group_id = n, this.user_id = r, this.file = i; } } class gye extends Uo { notice_type = "notify"; sub_type = "group_name"; name_new; constructor(e, n, r, i) { super(e, n, r), this.name_new = i; } } class yye { constructor(e, n = 30 * 1e3 * 60, r = 10) { this.maxCapacity = e, this.ttl = n, this.cleanupCount = r; } cache = /* @__PURE__ */ new Map(); keyList = /* @__PURE__ */ new Set(); operationCount = 0; put(e, n) { const r = Date.now(), i = { value: n, timestamp: r, frequency: 1 }; this.cache.set(e, i), this.keyList.add(e), this.operationCount++, this.keyList.size > this.maxCapacity && this.evict(), this.operationCount >= this.cleanupCount && this.cleanup(this.cleanupCount); } get(e) { const n = this.cache.get(e); if (n && Date.now() - n.timestamp < this.ttl) return n.timestamp = Date.now(), n.frequency++, this.operationCount++, this.operationCount >= this.cleanupCount && this.cleanup(this.cleanupCount), n.value; this.deleteKey(e); } cleanup(e) { const n = Date.now(); let r = 0; for (const i of this.keyList) { if (r >= e) break; const o = this.cache.get(i); o && n - o.timestamp >= this.ttl && (this.deleteKey(i), r++); } this.operationCount = 0; } deleteKey(e) { this.cache.delete(e), this.keyList.delete(e); } evict() { for (; this.keyList.size > this.maxCapacity; ) { let e, n = 1 / 0; for (const r of this.keyList) { const i = this.cache.get(r); i && i.frequency < n && (n = i.frequency, e = r); } e !== void 0 && this.deleteKey(e); } } } class bye { cache; constructor(e) { this.cache = new yye(5e3, e); } encode(e, n = "", r) { const i = r || Xo().replace(/-/g, "") + n; return this.cache.put(i, e), i; } decode(e) { return this.cache.get(e); } } class vye { manager; constructor(e = 864e5) { this.manager = new bye(e); } encodeModelId(e, n, r, i = "", o = "", a) { return this.manager.encode({ peer: e, modelId: n, fileId: r, fileUUID: i }, o, a); } decodeModelId(e) { return this.manager.decode(e); } encode(e, n, r, i = "", o) { return this.manager.encode({ peer: e, msgId: n, elementId: r, fileUUID: i }, "", o); } decode(e) { return this.manager.decode(e); } } const on = new vye(); class Qm extends Uo { notice_type = "group_increase"; operator_id; sub_type; constructor(e, n, r, i, o = "approve") { super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.sub_type = o; } } class xye { obContext; core; constructor(e, n) { this.obContext = e, this.core = n; } async parseGroupBanEvent(e, n) { const r = n?.groupElement; if (!r?.shutUp) return; const i = r.shutUp.member.uid, o = r.shutUp.admin.uid; let a, s = parseInt(r.shutUp.duration); const c = s > 0 ? "ban" : "lift_ban"; i ? a = (await this.core.apis.GroupApi.getGroupMember(e, i))?.uin ?? "" : (a = "0", s > 0 && (s = -1)), await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e, i); const u = (await this.core.apis.GroupApi.getGroupMember(e, o))?.uin; if (a && u) return new J1e( this.core, parseInt(e), parseInt(a), parseInt(u), s, c ); } async parseGroupEmojiLikeEventByGrayTip(e, n) { if (this.core.apis.PacketApi.packetStatus === !0) return; const r = new uye.XMLParser({ ignoreAttributes: !1, attributeNamePrefix: "" }).parse(n.xmlElement.content); this.core.context.logger.logDebug("收到表情回应我的消息", r); const i = r.gtip.qq.jp, o = r.gtip.url.msgseq, a = r.gtip.face.id; return await this.createGroupEmojiLikeEvent(e, i, o, a, !0, 1); } async createGroupEmojiLikeEvent(e, n, r, i, o = !0, a = 1) { const s = { chatType: ke.KCHATTYPEGROUP, guildId: "", peerUid: e }, c = (await this.core.apis.MsgApi.queryFirstMsgBySeq(s, r)).msgList; if (c.length < 1) return; const u = c[0]; if (!u) { this.core.context.logger.logError("解析表情回应消息失败: 未找到回应消息"); return; } return new lye( this.core, parseInt(e), parseInt(n), ot.createUniqueMsgId({ chatType: ke.KCHATTYPEGROUP, guildId: "", peerUid: e }, u.msgId), [{ emoji_id: i, count: a }], o, r ); } async parseCardChangedEvent(e) { if (e.senderUin && e.senderUin !== "0") { const n = await this.core.apis.GroupApi.getGroupMember(e.peerUid, e.senderUin); if (n && n.cardName !== e.sendMemberName) { const r = e.sendMemberName ?? "", i = new dye(this.core, parseInt(e.peerUid), parseInt(e.senderUin), r, n.cardName); return n.cardName = r, i; } n && n.nick !== e.sendNickName && await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e.peerUid, e.senderUid); } } async registerParseGroupReactEvent() { this.obContext.core.context.packetHandler.onCmd("trpc.msg.olpush.OlPushService.MsgPush", async (e) => { const n = new he(lF).decode(Buffer.from(e.hex_data, "hex")); if (n.message.contentHead.type === 732 && n.message.contentHead.subType === 16) { const r = n.message.body?.msgContent?.slice(7); if (!r) return; const i = new he(dF).decode(r); if ((i.field13 ?? 0) === 35) { const o = i.groupUin?.toString() ?? "", a = i.groupReactionData?.data?.data?.groupReactionDataContent?.operatorUid ?? "", s = i.groupReactionData?.data?.data?.groupReactionDataContent?.type ?? 0, c = i.groupReactionData?.data?.data?.groupReactionTarget?.seq?.toString() ?? "", u = i.groupReactionData?.data?.data?.groupReactionDataContent?.code ?? "", d = await this.core.apis.UserApi.getUinByUidV2(a), p = await this.createGroupEmojiLikeEvent( o, d, c, u, s === 1, 1 ); p && this.obContext.networkManager.emitEvent(p); } } }); } async registerParseGroupReactEventByCore() { this.core.event.on("event:emoji_like", async (e) => { const n = await this.createGroupEmojiLikeEvent( e.groupId, e.senderUin, e.msgSeq, e.emojiId, e.isAdd, e.count ); n && this.obContext.networkManager.emitEvent(n); }); } async parsePaiYiPai(e, n) { const i = JSON.parse(n).items, o = i.filter((a) => a.uid); if (o.length === 2 && o[0]?.uid && o[1]?.uid) return new V1e( this.core, parseInt(e.peerUid), +await this.core.apis.UserApi.getUinByUidV2(o[0].uid), +await this.core.apis.UserApi.getUinByUidV2(o[1].uid), i ); } async parseOtherJsonEvent(e, n, r) { let i; try { i = JSON.parse(n.jsonStr); } catch (a) { r.logger.logWarn("灰条消息JSON解析失败", n.jsonStr, a); return; } const o = i.items?.[i.items.length - 1]?.txt; if (await this.core.apis.GroupApi.refreshGroupMemberCachePartial(e.peerUid, e.senderUid), o === "头衔") { const a = i.items?.[1]?.param?.[0], s = i.items?.[3]?.txt; if (r.logger.logDebug("收到群成员新头衔消息", i), a == null || s == null) { r.logger.logWarn("收到格式异常的群成员新头衔灰条消息", i); return; } return new fye( this.core, +e.peerUid, +a, s ); } else if (o === "移出") r.logger.logDebug("收到机器人被踢消息", i); else { r.logger.logWarn("收到未知的灰条消息", i); const a = Number(e.senderUin) || 0; if (a !== 0) { const s = { chatType: ke.KCHATTYPEGROUP, guildId: "", peerUid: e.peerUid }, c = ot.createUniqueMsgId(s, e.msgId); return new hye( this.core, +e.peerUin, a, c, n.busiId, n.jsonStr, { msgSeq: e.msgSeq, msgTime: e.msgTime, msgId: e.msgId, json: i } ); } } } async parseEssenceMsg(e, n) { const r = JSON.parse(n), i = new URL(r.items[0].jp).searchParams, o = i.get("msgSeq"), a = i.get("groupCode"); if (!a) return; const s = { guildId: "", chatType: ke.KCHATTYPEGROUP, peerUid: a }, c = await this.core.apis.MsgApi.getMsgsBySeqAndCount(s, o.toString(), 1, !0, !0), d = (await this.core.apis.WebApi.getGroupEssenceMsgAll(a)).flatMap((p) => p.data.msg_list).find((p) => p.msg_seq.toString() === o); if (c.msgList[0]) return new pye( this.core, parseInt(e.peerUid), ot.getShortIdByMsgId(c.msgList[0].msgId), parseInt(c.msgList[0].senderUin ?? await this.core.apis.UserApi.getUinByUidV2(c.msgList[0].senderUid)), parseInt(d?.add_digest_uin ?? "0") ); } async parseGroupUploadFileEvene(e, n, r) { return new mye( this.core, parseInt(e.peerUid), parseInt(e.senderUin || ""), { id: on.encode({ chatType: ke.KCHATTYPEGROUP, peerUid: e.peerUid }, e.msgId, r.elementId, r?.fileElement?.fileUuid, n.fileMd5 ?? n.fileUuid), name: n.fileName, size: parseInt(n.fileSize), busid: n.fileBizId ?? 0 } ); } async parseGroupElement(e, n, r) { if (n.type === wm.KGROUPNAMEMODIFIED) return this.core.context.logger.logDebug("收到群名称变更事件", n), new gye( this.core, parseInt(e.peerUid), parseInt(await this.core.apis.UserApi.getUinByUidV2(n.memberUid)), n.groupName ); if (n.type === wm.KSHUTUP) return await this.parseGroupBanEvent(e.peerUid, r); if (n.type === wm.KMEMBERADD && n.memberUid === this.core.selfInfo.uid) return await this.core.apis.GroupApi.refreshGroupMemberCache(e.peerUid, !0), new Qm( this.core, parseInt(e.peerUid), +this.core.selfInfo.uin, n.adminUid ? +await this.core.apis.UserApi.getUinByUidV2(n.adminUid) : 0, "approve" ); } async parseSelfInviteEvent(e, n, r) { return new Qm( this.core, parseInt(e.peerUid), +r, +n, "invite" ); } async parse51TypeEvent(e, n) { if (n.jsonGrayTipElement.jsonStr) { const r = JSON.parse(n.jsonGrayTipElement.jsonStr); if (r.items.length === 1 && r.items[0]?.txt.endsWith("加入群")) { const i = structuredClone(this.core.apis.GroupApi.groupMemberCache.get(e.peerUid)); if (!i) return; const o = await this.core.apis.GroupApi.refreshGroupMemberCache(e.peerUid, !0); if (!o) return; const s = Array.from(o.values()).find((c) => i.get(c.uid) === void 0); return s ? new Qm( this.core, +e.peerUid, +s.uin, 0, "invite" ) : void 0; } } } async parseGrayTipElement(e, n) { if (n.subElementType === ep.GRAYTIP_ELEMENT_SUBTYPE_GROUP) return await this.parseGroupElement(e, n.groupElement, n); if (n.subElementType === ep.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) { if (n.xmlElement?.templId === "10382") return await this.obContext.apis.GroupApi.parseGroupEmojiLikeEventByGrayTip(e.peerUid, n); } else if (n.subElementType === ep.GRAYTIP_ELEMENT_SUBTYPE_JSON) return n.jsonGrayTipElement.busiId === "1061" ? await this.parsePaiYiPai(e, n.jsonGrayTipElement.jsonStr) : n.jsonGrayTipElement.busiId === xO.AIO_GROUP_ESSENCE_MSG_TIP.toString() ? await this.parseEssenceMsg(e, n.jsonGrayTipElement.jsonStr) : n.jsonGrayTipElement.busiId === "51" ? await this.parse51TypeEvent(e, n) : (console.log("Unknown JSON event:", n.jsonGrayTipElement, JSON.stringify(n)), await this.parseOtherJsonEvent(e, n.jsonGrayTipElement, this.core.context)); } } class wye extends Ja { notice_type = "notify"; sub_type = "profile_like"; operator_id; operator_nick; times; time; constructor(e, n, r, i, o) { super(e), this.operator_id = n, this.operator_nick = r, this.times = i, this.time = o; } } const Sye = { txt: v(1, w.STRING), uin: v(3, w.INT64), nickname: v(5, w.STRING) }, _ye = { times: v(1, w.INT32), time: v(2, w.INT32), detail: v(3, () => Sye) }, Eye = { msg: v(14, () => _ye) }, Aye = { msgType: v(1, w.INT32), subType: v(2, w.INT32), content: v(203, () => Eye) }; v(1, w.UINT32), v(2, w.STRING), v(5, w.UINT32), v(6, w.STRING, !0); v(1, w.UINT32), v(2, w.UINT32), v(3, w.UINT32), v(5, w.UINT32), v(6, w.UINT32), v(12, w.UINT64), v(13, w.UINT32); v(2, w.BYTES); function Iye(t) { return new he(Aye).decode(t); } class Cye { obContext; core; constructor(e, n) { this.obContext = e, this.core = n; } async parseLikeEvent(e) { const n = Iye(e); if (n?.msgType !== 0 || n?.subType !== 203) return; this.core.context.logger.logDebug("收到点赞通知消息"); const r = n.content.msg; if (!r) return; const i = r.detail; if (!i) return; const o = i.txt.match(/\d+/) ?? "0"; return new wye( this.core, Number(i.uin), i.nickname, parseInt(o[0], 10), r.time ); } } const Tye = /* @__PURE__ */ JSON.parse('[{"QSid":"392","QDes":"/龙年快乐","IQLid":"392","AQLid":"392","EMCode":"10392","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"38"},{"QSid":"393","QDes":"/新年中龙","IQLid":"393","AQLid":"393","EMCode":"10393","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"39"},{"QSid":"364","QDes":"/超级赞","IQLid":"364","AQLid":"364","EMCode":"10364","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"366","QDes":"/芒狗","IQLid":"366","AQLid":"366","EMCode":"10366","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"362","QDes":"/好兄弟","IQLid":"362","AQLid":"362","EMCode":"10362","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"397","QDes":"/抛媚眼","IQLid":"397","AQLid":"397","EMCode":"10397","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"396","QDes":"/狼狗","IQLid":"396","AQLid":"396","EMCode":"10396","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"360","QDes":"/亲亲","IQLid":"360","AQLid":"360","EMCode":"10360","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"361","QDes":"/狗狗笑哭","IQLid":"361","AQLid":"361","EMCode":"10361","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"363","QDes":"/狗狗可怜","IQLid":"363","AQLid":"363","EMCode":"10363","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"365","QDes":"/狗狗生气","IQLid":"365","AQLid":"365","EMCode":"10365","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"367","QDes":"/狗狗疑问","IQLid":"367","AQLid":"367","EMCode":"10367","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"2","AniStickerPackName":"汪汪"},{"QSid":"399","QDes":"/tui","IQLid":"399","AQLid":"399","EMCode":"10399","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"398","QDes":"/超级ok","IQLid":"398","AQLid":"398","EMCode":"10398","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"373","QDes":"/忙","IQLid":"373","AQLid":"373","EMCode":"10373","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"370","QDes":"/祝贺","IQLid":"370","AQLid":"370","EMCode":"10370","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"375","QDes":"/超级鼓掌","IQLid":"375","AQLid":"375","EMCode":"10375","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"368","QDes":"/奥特笑哭","IQLid":"368","AQLid":"368","EMCode":"10368","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"369","QDes":"/彩虹","IQLid":"369","AQLid":"369","EMCode":"10369","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"371","QDes":"/冒泡","IQLid":"371","AQLid":"371","EMCode":"10371","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"372","QDes":"/气呼呼","IQLid":"372","AQLid":"372","EMCode":"10372","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"374","QDes":"/波波流泪","IQLid":"374","AQLid":"374","EMCode":"10374","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"6","AniStickerPackName":"噗噗星人"},{"QSid":"382","QDes":"/emo","IQLid":"382","AQLid":"382","EMCode":"10382","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"383","QDes":"/企鹅爱心","IQLid":"383","AQLid":"383","EMCode":"10383","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"401","QDes":"/超级转圈","IQLid":"401","AQLid":"401","EMCode":"10401","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"400","QDes":"/快乐","IQLid":"400","AQLid":"400","EMCode":"10400","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"380","QDes":"/真棒","IQLid":"380","AQLid":"380","EMCode":"10380","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"381","QDes":"/路过","IQLid":"381","AQLid":"381","EMCode":"10381","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"379","QDes":"/企鹅流泪","IQLid":"379","AQLid":"379","EMCode":"10379","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"376","QDes":"/跺脚","IQLid":"376","AQLid":"376","EMCode":"10376","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"378","QDes":"/企鹅笑哭","IQLid":"378","AQLid":"378","EMCode":"10378","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"377","QDes":"/嗨","IQLid":"377","AQLid":"377","EMCode":"10377","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"5","AniStickerPackName":"企鹅"},{"QSid":"403","QDes":"/出去玩","IQLid":"403","AQLid":"403","EMCode":"10403","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"402","QDes":"/别说话","IQLid":"402","AQLid":"402","EMCode":"10402","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"390","QDes":"/太头秃","IQLid":"390","AQLid":"390","EMCode":"10390","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"391","QDes":"/太沧桑","IQLid":"391","AQLid":"391","EMCode":"10391","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"388","QDes":"/太头疼","IQLid":"388","AQLid":"388","EMCode":"10388","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"389","QDes":"/太赞了","IQLid":"389","AQLid":"389","EMCode":"10389","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"386","QDes":"/呜呜呜","IQLid":"386","AQLid":"386","EMCode":"10386","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"385","QDes":"/太气了","IQLid":"385","AQLid":"385","EMCode":"10385","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"384","QDes":"/晚安","IQLid":"384","AQLid":"384","EMCode":"10384","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"387","QDes":"/太好笑","IQLid":"387","AQLid":"387","EMCode":"10387","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"4","AniStickerPackName":"QQ黄脸"},{"QSid":"413","QDes":"/摇起来","IQLid":"413","AQLid":"413","EMCode":"10413","QHide":"1","AniStickerType":1,"AniStickerId":"1","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"405","QDes":"/好运来","IQLid":"405","AQLid":"405","EMCode":"10405","QHide":"1","AniStickerType":1,"AniStickerId":"2","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"404","QDes":"/闪亮登场","IQLid":"404","AQLid":"404","EMCode":"10404","QHide":"1","AniStickerType":1,"AniStickerId":"3","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"406","QDes":"/姐是女王","IQLid":"406","AQLid":"406","EMCode":"10406","QHide":"1","AniStickerType":1,"AniStickerId":"4","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"410","QDes":"/么么哒","IQLid":"410","AQLid":"410","EMCode":"10410","QHide":"1","AniStickerType":1,"AniStickerId":"5","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"411","QDes":"/一起嗨","IQLid":"411","AQLid":"411","EMCode":"10411","QHide":"1","AniStickerType":1,"AniStickerId":"6","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"407","QDes":"/我听听","IQLid":"407","AQLid":"407","EMCode":"10407","QHide":"1","AniStickerType":1,"AniStickerId":"7","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"408","QDes":"/臭美","IQLid":"408","AQLid":"408","EMCode":"10408","QHide":"1","AniStickerType":1,"AniStickerId":"8","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"412","QDes":"/开心","IQLid":"412","AQLid":"412","EMCode":"10412","QHide":"1","AniStickerType":1,"AniStickerId":"9","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"409","QDes":"/送你花花","IQLid":"409","AQLid":"409","EMCode":"10409","QHide":"1","AniStickerType":1,"AniStickerId":"10","AniStickerPackId":"3","AniStickerPackName":"喜花妮"},{"QSid":"394","QDes":"/新年大龙","IQLid":"394","AQLid":"394","EMCode":"10394","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"40"},{"QSid":"14","QDes":"/微笑","IQLid":"23","AQLid":"23","EMCode":"100"},{"QSid":"1","QDes":"/撇嘴","IQLid":"40","AQLid":"40","EMCode":"101"},{"QSid":"2","QDes":"/色","IQLid":"19","AQLid":"19","EMCode":"102"},{"QSid":"3","QDes":"/发呆","IQLid":"43","AQLid":"43","EMCode":"103"},{"QSid":"4","QDes":"/得意","IQLid":"21","AQLid":"21","EMCode":"104"},{"QSid":"6","QDes":"/害羞","IQLid":"20","AQLid":"20","EMCode":"106"},{"QSid":"7","QDes":"/闭嘴","IQLid":"104","AQLid":"106","EMCode":"107"},{"QSid":"8","QDes":"/睡","IQLid":"35","AQLid":"35","EMCode":"108"},{"QSid":"9","QDes":"/大哭","IQLid":"10","AQLid":"10","EMCode":"109"},{"QSid":"5","QDes":"/流泪","IQLid":"9","AQLid":"9","EMCode":"105","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"16"},{"QSid":"10","QDes":"/尴尬","IQLid":"25","AQLid":"25","EMCode":"110"},{"QSid":"11","QDes":"/发怒","IQLid":"24","AQLid":"24","EMCode":"111"},{"QSid":"12","QDes":"/调皮","IQLid":"1","AQLid":"1","EMCode":"112"},{"QSid":"13","QDes":"/呲牙","IQLid":"0","AQLid":"0","EMCode":"113"},{"QSid":"0","QDes":"/惊讶","IQLid":"33","AQLid":"33","EMCode":"114"},{"QSid":"15","QDes":"/难过","IQLid":"32","AQLid":"32","EMCode":"115"},{"QSid":"16","QDes":"/酷","IQLid":"12","AQLid":"12","EMCode":"116"},{"QSid":"96","QDes":"/冷汗","IQLid":"27","AQLid":"27","EMCode":"117"},{"QSid":"18","QDes":"/抓狂","IQLid":"13","AQLid":"13","EMCode":"118"},{"QSid":"19","QDes":"/吐","IQLid":"22","AQLid":"22","EMCode":"119"},{"QSid":"20","QDes":"/偷笑","IQLid":"3","AQLid":"3","EMCode":"120"},{"QSid":"21","QDes":"/可爱","IQLid":"18","AQLid":"18","EMCode":"121"},{"QSid":"22","QDes":"/白眼","IQLid":"30","AQLid":"30","EMCode":"122"},{"QSid":"23","QDes":"/傲慢","IQLid":"31","AQLid":"31","EMCode":"123"},{"QSid":"24","QDes":"/饥饿","IQLid":"79","AQLid":"81","EMCode":"124"},{"QSid":"25","QDes":"/困","IQLid":"80","AQLid":"82","EMCode":"125"},{"QSid":"26","QDes":"/惊恐","IQLid":"26","AQLid":"26","EMCode":"126"},{"QSid":"27","QDes":"/流汗","IQLid":"2","AQLid":"2","EMCode":"127"},{"QSid":"28","QDes":"/憨笑","IQLid":"37","AQLid":"37","EMCode":"128"},{"QSid":"29","QDes":"/悠闲","IQLid":"50","AQLid":"50","EMCode":"129"},{"QSid":"30","QDes":"/奋斗","IQLid":"42","AQLid":"42","EMCode":"130"},{"QSid":"31","QDes":"/咒骂","IQLid":"81","AQLid":"83","EMCode":"131"},{"QSid":"32","QDes":"/疑问","IQLid":"34","AQLid":"34","EMCode":"132"},{"QSid":"33","QDes":"/嘘","IQLid":"11","AQLid":"11","EMCode":"133"},{"QSid":"34","QDes":"/晕","IQLid":"49","AQLid":"49","EMCode":"134"},{"QSid":"35","QDes":"/折磨","IQLid":"82","AQLid":"84","EMCode":"135"},{"QSid":"36","QDes":"/衰","IQLid":"39","AQLid":"39","EMCode":"136"},{"QSid":"37","QDes":"/骷髅","isStatic":"1","IQLid":"76","AQLid":"78","EMCode":"137"},{"QSid":"38","QDes":"/敲打","IQLid":"5","AQLid":"5","EMCode":"138"},{"QSid":"39","QDes":"/再见","IQLid":"4","AQLid":"4","EMCode":"139"},{"QSid":"97","QDes":"/擦汗","IQLid":"6","AQLid":"6","EMCode":"140"},{"QSid":"98","QDes":"/抠鼻","IQLid":"83","AQLid":"85","EMCode":"141"},{"QSid":"99","QDes":"/鼓掌","IQLid":"84","AQLid":"86","EMCode":"142"},{"QSid":"100","QDes":"/糗大了","IQLid":"85","AQLid":"87","EMCode":"143"},{"QSid":"101","QDes":"/坏笑","IQLid":"46","AQLid":"46","EMCode":"144"},{"QSid":"102","QDes":"/左哼哼","IQLid":"86","AQLid":"88","EMCode":"145"},{"QSid":"103","QDes":"/右哼哼","IQLid":"44","AQLid":"44","EMCode":"146"},{"QSid":"104","QDes":"/哈欠","IQLid":"87","AQLid":"89","EMCode":"147"},{"QSid":"105","QDes":"/鄙视","IQLid":"48","AQLid":"48","EMCode":"148"},{"QSid":"106","QDes":"/委屈","IQLid":"14","AQLid":"14","EMCode":"149"},{"QSid":"107","QDes":"/快哭了","IQLid":"88","AQLid":"90","EMCode":"150"},{"QSid":"108","QDes":"/阴险","IQLid":"41","AQLid":"41","EMCode":"151"},{"QSid":"305","QDes":"/右亲亲","IQLid":"305","AQLid":"305","EMCode":"10305"},{"QSid":"109","QDes":"/左亲亲","IQLid":"36","AQLid":"36","EMCode":"152"},{"QSid":"110","QDes":"/吓","IQLid":"89","AQLid":"91","EMCode":"153"},{"QSid":"111","QDes":"/可怜","IQLid":"51","AQLid":"51","EMCode":"154"},{"QSid":"172","QDes":"/眨眼睛","IQLid":"142","AQLid":"164","EMCode":"242"},{"QSid":"182","QDes":"/笑哭","IQLid":"152","AQLid":"174","EMCode":"252"},{"QSid":"179","QDes":"/doge","IQLid":"149","AQLid":"171","EMCode":"249"},{"QSid":"173","QDes":"/泪奔","IQLid":"143","AQLid":"165","EMCode":"243"},{"QSid":"174","QDes":"/无奈","IQLid":"144","AQLid":"166","EMCode":"244"},{"QSid":"212","QDes":"/托腮","IQLid":"182","AQLid":"161","EMCode":"282"},{"QSid":"175","QDes":"/卖萌","IQLid":"145","AQLid":"167","EMCode":"245"},{"QSid":"178","QDes":"/斜眼笑","IQLid":"148","AQLid":"170","EMCode":"248"},{"QSid":"177","QDes":"/喷血","IQLid":"147","AQLid":"169","EMCode":"247"},{"QSid":"176","QDes":"/小纠结","IQLid":"146","AQLid":"168","EMCode":"246"},{"QSid":"183","QDes":"/我最美","IQLid":"153","AQLid":"175","EMCode":"253"},{"QSid":"262","QDes":"/脑阔疼","IQLid":"262","AQLid":"262","EMCode":"10262"},{"QSid":"263","QDes":"/沧桑","IQLid":"263","AQLid":"263","EMCode":"10263"},{"QSid":"264","QDes":"/捂脸","IQLid":"264","AQLid":"264","EMCode":"10264"},{"QSid":"265","QDes":"/辣眼睛","IQLid":"265","AQLid":"265","EMCode":"10265"},{"QSid":"266","QDes":"/哦哟","IQLid":"266","AQLid":"266","EMCode":"10266"},{"QSid":"267","QDes":"/头秃","IQLid":"267","AQLid":"267","EMCode":"10267"},{"QSid":"268","QDes":"/问号脸","IQLid":"268","AQLid":"268","EMCode":"10268"},{"QSid":"269","QDes":"/暗中观察","IQLid":"269","AQLid":"269","EMCode":"10269"},{"QSid":"270","QDes":"/emm","IQLid":"270","AQLid":"270","EMCode":"10270"},{"QSid":"271","QDes":"/吃瓜","IQLid":"271","AQLid":"271","EMCode":"10271"},{"QSid":"272","QDes":"/呵呵哒","IQLid":"272","AQLid":"272","EMCode":"10272"},{"QSid":"277","QDes":"/汪汪","IQLid":"277","AQLid":"277","EMCode":"10277"},{"QSid":"307","QDes":"/喵喵","IQLid":"307","AQLid":"307","EMCode":"10307"},{"QSid":"306","QDes":"/牛气冲天","isStatic":"1","IQLid":"306","AQLid":"306","EMCode":"10306"},{"QSid":"281","QDes":"/无眼笑","IQLid":"281","AQLid":"281","EMCode":"10281"},{"QSid":"282","QDes":"/敬礼","IQLid":"282","AQLid":"282","EMCode":"10282"},{"QSid":"283","QDes":"/狂笑","IQLid":"283","AQLid":"283","EMCode":"10283"},{"QSid":"284","QDes":"/面无表情","IQLid":"284","AQLid":"284","EMCode":"10284"},{"QSid":"285","QDes":"/摸鱼","IQLid":"285","AQLid":"285","EMCode":"10285"},{"QSid":"293","QDes":"/摸锦鲤","IQLid":"293","AQLid":"293","EMCode":"10293"},{"QSid":"286","QDes":"/魔鬼笑","IQLid":"286","AQLid":"286","EMCode":"10286"},{"QSid":"287","QDes":"/哦","IQLid":"287","AQLid":"287","EMCode":"10287"},{"QSid":"289","QDes":"/睁眼","IQLid":"289","AQLid":"289","EMCode":"10289"},{"QSid":"294","QDes":"/期待","IQLid":"294","AQLid":"294","EMCode":"10294"},{"QSid":"297","QDes":"/拜谢","IQLid":"297","AQLid":"297","EMCode":"10297"},{"QSid":"298","QDes":"/元宝","IQLid":"298","AQLid":"298","EMCode":"10298"},{"QSid":"299","QDes":"/牛啊","IQLid":"299","AQLid":"299","EMCode":"10299"},{"QSid":"300","QDes":"/胖三斤","IQLid":"300","AQLid":"300","EMCode":"10300"},{"QSid":"323","QDes":"/嫌弃","IQLid":"323","AQLid":"323","EMCode":"10323"},{"QSid":"332","QDes":"/举牌牌","IQLid":"332","AQLid":"332","EMCode":"10332"},{"QSid":"336","QDes":"/豹富","IQLid":"336","AQLid":"336","EMCode":"10336"},{"QSid":"353","QDes":"/拜托","IQLid":"353","AQLid":"353","EMCode":"10353"},{"QSid":"355","QDes":"/耶","IQLid":"355","AQLid":"355","EMCode":"10355"},{"QSid":"356","QDes":"/666","IQLid":"356","AQLid":"356","EMCode":"10356"},{"QSid":"354","QDes":"/尊嘟假嘟","IQLid":"354","AQLid":"354","EMCode":"10354"},{"QSid":"352","QDes":"/咦","IQLid":"352","AQLid":"352","EMCode":"10352"},{"QSid":"357","QDes":"/裂开","IQLid":"357","AQLid":"357","EMCode":"10357"},{"QSid":"334","QDes":"/虎虎生威","IQLid":"334","AQLid":"334","EMCode":"10334"},{"QSid":"347","QDes":"/大展宏兔","IQLid":"347","AQLid":"347","EMCode":"10347"},{"QSid":"303","QDes":"/右拜年","IQLid":"303","AQLid":"303","EMCode":"10303"},{"QSid":"302","QDes":"/左拜年","IQLid":"302","AQLid":"302","EMCode":"10302"},{"QSid":"295","QDes":"/拿到红包","IQLid":"295","AQLid":"295","EMCode":"10295"},{"QSid":"311","QDes":"/打call","IQLid":"311","AQLid":"311","EMCode":"10311","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"1"},{"QSid":"312","QDes":"/变形","IQLid":"312","AQLid":"312","EMCode":"10312","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"2"},{"QSid":"314","QDes":"/仔细分析","IQLid":"314","AQLid":"314","EMCode":"10314","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"4"},{"QSid":"317","QDes":"/菜汪","IQLid":"317","AQLid":"317","EMCode":"10317","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"7"},{"QSid":"318","QDes":"/崇拜","IQLid":"318","AQLid":"318","EMCode":"10318","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"8"},{"QSid":"319","QDes":"/比心","IQLid":"319","AQLid":"319","EMCode":"10319","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"9"},{"QSid":"320","QDes":"/庆祝","IQLid":"320","AQLid":"320","EMCode":"10320","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"10"},{"QSid":"324","QDes":"/吃糖","IQLid":"324","AQLid":"324","EMCode":"10324","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"12"},{"QSid":"325","QDes":"/惊吓","IQLid":"325","AQLid":"325","EMCode":"10325","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"14"},{"QSid":"337","QDes":"/花朵脸","IQLid":"337","AQLid":"337","EMCode":"10337","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"22"},{"QSid":"338","QDes":"/我想开了","IQLid":"338","AQLid":"338","EMCode":"10338","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"20"},{"QSid":"339","QDes":"/舔屏","IQLid":"339","AQLid":"339","EMCode":"10339","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"21"},{"QSid":"341","QDes":"/打招呼","IQLid":"341","AQLid":"341","EMCode":"10341","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"24"},{"QSid":"342","QDes":"/酸Q","IQLid":"342","AQLid":"342","EMCode":"10342","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"26"},{"QSid":"343","QDes":"/我方了","IQLid":"343","AQLid":"343","EMCode":"10343","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"27"},{"QSid":"344","QDes":"/大怨种","IQLid":"344","AQLid":"344","EMCode":"10344","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"28"},{"QSid":"345","QDes":"/红包多多","IQLid":"345","AQLid":"345","EMCode":"10345","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"29"},{"QSid":"346","QDes":"/你真棒棒","IQLid":"346","AQLid":"346","EMCode":"10346","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"25"},{"QSid":"181","QDes":"/戳一戳","IQLid":"151","AQLid":"173","EMCode":"251","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"37"},{"QSid":"74","QDes":"/太阳","isStatic":"1","IQLid":"73","AQLid":"75","EMCode":"176","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"35"},{"QSid":"75","QDes":"/月亮","isStatic":"1","IQLid":"67","AQLid":"68","EMCode":"175","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"36"},{"QSid":"351","QDes":"/敲敲","IQLid":"351","AQLid":"351","EMCode":"10351","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"30"},{"QSid":"349","QDes":"/坚强","IQLid":"349","AQLid":"349","EMCode":"10349","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"32"},{"QSid":"350","QDes":"/贴贴","IQLid":"350","AQLid":"350","EMCode":"10350","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"31"},{"QSid":"395","QDes":"/略略略","IQLid":"395","AQLid":"395","EMCode":"10395","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"41"},{"QSid":"114","QDes":"/篮球","IQLid":"90","AQLid":"92","EMCode":"158","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"13"},{"QSid":"358","QDes":"/骰子","IQLid":"358","AQLid":"358","QHide":"1","EMCode":"10358","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"33"},{"QSid":"359","QDes":"/包剪锤","IQLid":"359","AQLid":"359","QHide":"1","EMCode":"10359","AniStickerType":2,"AniStickerPackId":"1","AniStickerId":"34"},{"QSid":"326","QDes":"/生气","IQLid":"326","AQLid":"326","EMCode":"10326","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"15"},{"QSid":"53","QDes":"/蛋糕","IQLid":"59","AQLid":"59","EMCode":"168","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"17"},{"QSid":"49","QDes":"/拥抱","IQLid":"45","AQLid":"45","EMCode":"178"},{"QSid":"66","QDes":"/爱心","IQLid":"28","AQLid":"28","EMCode":"166"},{"QSid":"63","QDes":"/玫瑰","IQLid":"8","AQLid":"8","EMCode":"163"},{"QSid":"64","QDes":"/凋谢","IQLid":"57","AQLid":"57","EMCode":"164"},{"QSid":"187","QDes":"/幽灵","IQLid":"157","AQLid":"179","EMCode":"257"},{"QSid":"146","QDes":"/爆筋","IQLid":"116","AQLid":"118","EMCode":"121011"},{"QSid":"116","QDes":"/示爱","IQLid":"29","AQLid":"29","EMCode":"165"},{"QSid":"67","QDes":"/心碎","IQLid":"72","AQLid":"74","EMCode":"167"},{"QSid":"60","QDes":"/咖啡","IQLid":"66","AQLid":"66","EMCode":"160"},{"QSid":"185","QDes":"/羊驼","IQLid":"155","AQLid":"177","EMCode":"255"},{"QSid":"137","QDes":"/鞭炮","isStatic":"1","IQLid":"107","AQLid":"109","EMCode":"121002","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"18"},{"QSid":"333","QDes":"/烟花","isStatic":"1","IQLid":"333","AQLid":"333","EMCode":"10333","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"19"},{"QSid":"76","QDes":"/赞","IQLid":"52","AQLid":"52","EMCode":"179"},{"QSid":"124","QDes":"/OK","IQLid":"64","AQLid":"64","EMCode":"189"},{"QSid":"118","QDes":"/抱拳","IQLid":"56","AQLid":"56","EMCode":"183"},{"QSid":"78","QDes":"/握手","IQLid":"54","AQLid":"54","EMCode":"181"},{"QSid":"119","QDes":"/勾引","IQLid":"63","AQLid":"63","EMCode":"184"},{"QSid":"79","QDes":"/胜利","IQLid":"55","AQLid":"55","EMCode":"182"},{"QSid":"120","QDes":"/拳头","IQLid":"71","AQLid":"73","EMCode":"185"},{"QSid":"121","QDes":"/差劲","IQLid":"70","AQLid":"72","EMCode":"186"},{"QSid":"77","QDes":"/踩","IQLid":"53","AQLid":"53","EMCode":"180"},{"QSid":"123","QDes":"/NO","IQLid":"92","AQLid":"94","EMCode":"188"},{"QSid":"201","QDes":"/点赞","IQLid":"171","AQLid":"150","EMCode":"271"},{"QSid":"273","QDes":"/我酸了","isStatic":"1","IQLid":"273","AQLid":"273","EMCode":"10273"},{"QSid":"46","QDes":"/猪头","isStatic":"1","IQLid":"7","AQLid":"7","EMCode":"162"},{"QSid":"112","QDes":"/菜刀","IQLid":"17","AQLid":"17","EMCode":"155"},{"QSid":"56","QDes":"/刀","IQLid":"68","AQLid":"70","EMCode":"171"},{"QSid":"169","QDes":"/手枪","isStatic":"1","IQLid":"139","AQLid":"141","EMCode":"121034"},{"QSid":"171","QDes":"/茶","IQLid":"141","AQLid":"163","EMCode":"241"},{"QSid":"59","QDes":"/便便","IQLid":"15","AQLid":"15","EMCode":"174"},{"QSid":"144","QDes":"/喝彩","isStatic":"1","IQLid":"114","AQLid":"116","EMCode":"121009"},{"QSid":"147","QDes":"/棒棒糖","isStatic":"1","IQLid":"117","AQLid":"119","EMCode":"121012"},{"QSid":"89","QDes":"/西瓜","isStatic":"1","IQLid":"60","AQLid":"60","EMCode":"156"},{"QSid":"148","QDes":"/喝奶","isStatic":"1","IQLid":"118","AQLid":"120","QHide":"1","EMCode":"121013"},{"QSid":"55","QDes":"/炸弹","isStatic":"1","IQLid":"16","AQLid":"16","QHide":"1","EMCode":"170"},{"QSid":"41","QDes":"/发抖","isStatic":"1","IQLid":"69","AQLid":"71","EMCode":"193"},{"QSid":"125","QDes":"/转圈","IQLid":"95","AQLid":"97","EMCode":"195"},{"QSid":"42","QDes":"/爱情","IQLid":"38","AQLid":"38","EMCode":"190"},{"QSid":"43","QDes":"/跳跳","IQLid":"93","AQLid":"95","EMCode":"192"},{"QSid":"86","QDes":"/怄火","IQLid":"94","AQLid":"96","EMCode":"194"},{"QSid":"129","QDes":"/挥手","IQLid":"77","AQLid":"79","EMCode":"199"},{"QSid":"226","QDes":"/拍桌","IQLid":"196","isCMEmoji":"1","AQLid":"198","QHide":"1","EMCode":"297"},{"QSid":"85","QDes":"/飞吻","isStatic":"1","IQLid":"47","AQLid":"47","EMCode":"191"},{"QSid":"215","QDes":"/糊脸","IQLid":"185","isCMEmoji":"1","AQLid":"187","QHide":"1","EMCode":"285"},{"QSid":"214","QDes":"/啵啵","IQLid":"184","isCMEmoji":"1","AQLid":"186","QHide":"1","EMCode":"284"},{"QSid":"222","QDes":"/抱抱","IQLid":"192","isCMEmoji":"1","AQLid":"194","QHide":"1","EMCode":"292"},{"QSid":"203","QDes":"/托脸","IQLid":"173","AQLid":"152","QHide":"1","EMCode":"273"},{"QSid":"235","QDes":"/颤抖","IQLid":"205","isCMEmoji":"1","AQLid":"207","QHide":"1","EMCode":"305"},{"QSid":"241","QDes":"/生日快乐","IQLid":"211","isCMEmoji":"1","AQLid":"213","QHide":"1","EMCode":"311"},{"QSid":"237","QDes":"/偷看","IQLid":"207","isCMEmoji":"1","AQLid":"209","QHide":"1","EMCode":"307"},{"QSid":"218","QDes":"/舔一舔","IQLid":"188","isCMEmoji":"1","AQLid":"190","QHide":"1","EMCode":"288"},{"QSid":"233","QDes":"/掐一掐","IQLid":"203","isCMEmoji":"1","AQLid":"205","QHide":"1","EMCode":"303"},{"QSid":"232","QDes":"/佛系","IQLid":"202","isCMEmoji":"1","AQLid":"204","QHide":"1","EMCode":"302"},{"QSid":"238","QDes":"/扇脸","IQLid":"208","isCMEmoji":"1","AQLid":"210","QHide":"1","EMCode":"308"},{"QSid":"217","QDes":"/扯一扯","IQLid":"187","isCMEmoji":"1","AQLid":"189","QHide":"1","EMCode":"287"},{"QSid":"225","QDes":"/撩一撩","IQLid":"195","isCMEmoji":"1","AQLid":"197","QHide":"1","EMCode":"296"},{"QSid":"230","QDes":"/嘲讽","IQLid":"200","isCMEmoji":"1","AQLid":"202","QHide":"1","EMCode":"300"},{"QSid":"194","QDes":"/不开心","IQLid":"164","AQLid":"143","QHide":"1","EMCode":"264"},{"QSid":"210","QDes":"/飙泪","IQLid":"180","AQLid":"159","QHide":"1","EMCode":"280"},{"QSid":"193","QDes":"/大笑","IQLid":"163","AQLid":"185","QHide":"1","EMCode":"263"},{"QSid":"204","QDes":"/吃","IQLid":"174","AQLid":"153","QHide":"1","EMCode":"274"},{"QSid":"200","QDes":"/求求","IQLid":"170","AQLid":"149","QHide":"1","EMCode":"270"},{"QSid":"290","QDes":"/敲开心","IQLid":"290","isCMEmoji":"1","AQLid":"290","QHide":"1","EMCode":"20240"},{"QSid":"224","QDes":"/开枪","IQLid":"194","isCMEmoji":"1","AQLid":"196","QHide":"1","EMCode":"295"},{"QSid":"229","QDes":"/干杯","IQLid":"199","isCMEmoji":"1","AQLid":"201","QHide":"1","EMCode":"299"},{"QSid":"221","QDes":"/顶呱呱","IQLid":"191","isCMEmoji":"1","AQLid":"193","QHide":"1","EMCode":"291"},{"QSid":"219","QDes":"/蹭一蹭","IQLid":"189","isCMEmoji":"1","AQLid":"191","QHide":"1","EMCode":"289"},{"QSid":"227","QDes":"/拍手","IQLid":"197","isCMEmoji":"1","AQLid":"199","QHide":"1","EMCode":"294"},{"QSid":"216","QDes":"/拍头","IQLid":"186","isCMEmoji":"1","AQLid":"188","QHide":"1","EMCode":"286"},{"QSid":"231","QDes":"/哼","IQLid":"201","isCMEmoji":"1","AQLid":"203","QHide":"1","EMCode":"301"},{"QSid":"244","QDes":"/扔狗","IQLid":"214","isCMEmoji":"1","AQLid":"216","QHide":"1","EMCode":"312"},{"QSid":"223","QDes":"/暴击","IQLid":"193","isCMEmoji":"1","AQLid":"195","QHide":"1","EMCode":"293"},{"QSid":"243","QDes":"/甩头","IQLid":"213","isCMEmoji":"1","AQLid":"215","QHide":"1","EMCode":"313"},{"QSid":"211","QDes":"/我不看","IQLid":"181","AQLid":"160","QHide":"1","EMCode":"281"},{"QSid":"292","QDes":"/让我康康","IQLid":"292","isCMEmoji":"1","AQLid":"292","QHide":"1","EMCode":"20242"},{"QSid":"240","QDes":"/喷脸","IQLid":"210","isCMEmoji":"1","AQLid":"212","QHide":"1","EMCode":"310"},{"QSid":"180","QDes":"/惊喜","IQLid":"150","AQLid":"172","QHide":"1","EMCode":"250"},{"QSid":"122","QDes":"/爱你","IQLid":"65","AQLid":"65","QHide":"1","EMCode":"187"},{"QSid":"202","QDes":"/无聊","IQLid":"172","AQLid":"151","QHide":"1","EMCode":"272"},{"QSid":"278","QDes":"/汗","IQLid":"278","isCMEmoji":"1","AQLid":"278","QHide":"1","EMCode":"20237"},{"QSid":"301","QDes":"/好闪","IQLid":"301","AQLid":"301","QHide":"1","EMCode":"10301"},{"QSid":"288","QDes":"/请","IQLid":"288","AQLid":"288","QHide":"1","EMCode":"10288"},{"QSid":"322","QDes":"/拒绝","IQLid":"322","AQLid":"322","QHide":"1","EMCode":"10322"},{"QSid":"198","QDes":"/呃","IQLid":"168","AQLid":"147","QHide":"1","EMCode":"268"},{"QSid":"348","QDes":"/福萝卜","IQLid":"348","AQLid":"348","QHide":"1","EMCode":"10348"},{"QSid":"206","QDes":"/害怕","IQLid":"176","AQLid":"155","QHide":"1","EMCode":"276"},{"QSid":"239","QDes":"/原谅","IQLid":"209","isCMEmoji":"1","AQLid":"211","QHide":"1","EMCode":"309"},{"QSid":"424","QDes":"/续标识","IQLid":"424","AQLid":"424","EMCode":"10424","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"52"},{"QSid":"415","QDes":"/划龙舟","IQLid":"415","AQLid":"415","EMCode":"10415","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"43"},{"QSid":"416","QDes":"/中龙舟","IQLid":"416","AQLid":"416","EMCode":"10416","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"44"},{"QSid":"417","QDes":"/大龙舟","IQLid":"417","AQLid":"417","EMCode":"10417","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"45"},{"QSid":"425","QDes":"/求放过","IQLid":"425","AQLid":"425","EMCode":"10425","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"53"},{"QSid":"427","QDes":"/偷感","IQLid":"427","AQLid":"427","EMCode":"10427","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"55"},{"QSid":"426","QDes":"/玩火","IQLid":"426","AQLid":"426","EMCode":"10426","QHide":"0","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"54"},{"QSid":"419","QDes":"/火车","IQLid":"419","AQLid":"419","EMCode":"10419","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"47"},{"QSid":"420","QDes":"/中火车","IQLid":"420","AQLid":"420","EMCode":"10420","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"48"},{"QSid":"421","QDes":"/大火车","IQLid":"421","AQLid":"421","EMCode":"10421","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"49"},{"QSid":"429","QDes":"/蛇年快乐","IQLid":"429","AQLid":"429","EMCode":"10429","QHide":"0","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"56"},{"QSid":"430","QDes":"/蛇身","IQLid":"430","AQLid":"430","EMCode":"10430","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"57"},{"QSid":"431","QDes":"/蛇尾","IQLid":"431","AQLid":"431","EMCode":"10431","QHide":"1","AniStickerType":3,"AniStickerPackId":"1","AniStickerId":"56"},{"QSid":"428","QDes":"/收到","IQLid":"428","AQLid":"428","EMCode":"10428","QHide":"0","AniStickerType":0,"AniStickerPackId":"0","AniStickerId":"0"},{"QSid":"422","QDes":"/粽于等到你","IQLid":"422","AQLid":"422","EMCode":"10422","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"50"},{"QSid":"423","QDes":"/复兴号","IQLid":"423","AQLid":"423","EMCode":"10423","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"51"},{"QSid":"432","QDes":"/灵蛇献瑞","IQLid":"432","AQLid":"432","EMCode":"10432","QHide":"1","AniStickerType":1,"AniStickerPackId":"1","AniStickerId":"59"},{"QSid":"450","QDes":"/撇嘴","EMCode":"10450"},{"QSid":"451","QDes":"/色","EMCode":"10451"},{"QSid":"452","QDes":"/微笑","EMCode":"10452"},{"QSid":"453","QDes":"/发呆","EMCode":"10453"},{"QSid":"454","QDes":"/得意","EMCode":"10454"},{"QSid":"455","QDes":"/害羞","EMCode":"10455"},{"QSid":"456","QDes":"/闭嘴","EMCode":"10456"},{"QSid":"457","QDes":"/睡","EMCode":"10457"},{"QSid":"458","QDes":"/我吗","EMCode":"10458"},{"QSid":"459","QDes":"/优雅","EMCode":"10459"},{"QSid":"460","QDes":"/硬撑","EMCode":"10460"},{"QSid":"461","QDes":"/宕机","EMCode":"10461"},{"QSid":"462","QDes":"/无语","EMCode":"10462"},{"QSid":"463","QDes":"/新年快乐","EMCode":"10463"},{"QSid":"464","QDes":"/马上到","EMCode":"10464"},{"QSid":"465","QDes":"/拆红包","EMCode":"10465"},{"QSid":"466","QDes":"/羞羞哒","EMCode":"10466"},{"QSid":"467","QDes":"/摇花手","EMCode":"10467"},{"QSid":"468","QDes":"/失眠","EMCode":"10468"},{"QSid":"469","QDes":"/坚毅","EMCode":"10469"},{"QSid":"470","QDes":"/马到成功","EMCode":"10470"},{"QSid":"472","QDes":"/心动","EMCode":"10472"},{"QSid":"474","QDes":"/给你一拳","EMCode":"10474"},{"QSid":"475","QDes":"/干饭","EMCode":"10475"},{"QSid":"476","QDes":"/不是吧","EMCode":"10476"},{"QSid":"477","QDes":"/你懂的","EMCode":"10477"},{"QSid":"478","QDes":"/对的对的","EMCode":"10478"},{"QSid":"479","QDes":"/不对不对","EMCode":"10479"},{"QSid":"480","QDes":"/散味儿","EMCode":"10480"},{"QSid":"481","QDes":"/学习","EMCode":"10481"},{"QSid":"482","QDes":"/热化了","EMCode":"10482"},{"QSid":"483","QDes":"/略","EMCode":"10483"},{"QSid":"484","QDes":"/比爱心","EMCode":"10484"}]'), kye = { sysface: Tye }; var ss = /* @__PURE__ */ ((t) => (t.male = "male", t.female = "female", t.unknown = "unknown", t))(ss || {}), jm = /* @__PURE__ */ ((t) => (t.owner = "owner", t.admin = "admin", t.member = "member", t))(jm || {}), Ke = /* @__PURE__ */ ((t) => (t.text = "text", t.image = "image", t.music = "music", t.video = "video", t.voice = "record", t.file = "file", t.at = "at", t.reply = "reply", t.json = "json", t.face = "face", t.mface = "mface", t.markdown = "markdown", t.node = "node", t.forward = "forward", t.xml = "xml", t.poke = "poke", t.dice = "dice", t.rps = "rps", t.miniapp = "miniapp", t.contact = "contact", t.location = "location", t.onlinefile = "onlinefile", t.flashtransfer = "flashtransfer", t))(Ke || {}); const Nye = l.Object({ type: l.Literal( "text" /* text */ ), data: l.Object({ text: l.String({ description: "纯文本内容" }) }) }, { $id: "OB11MessageText", description: "纯文本消息段" }), Pye = l.Object({ type: l.Literal( "face" /* face */ ), data: l.Object({ id: l.String({ description: "表情ID" }), resultId: l.Optional(l.String({ description: "结果ID" })), chainCount: l.Optional(l.Number({ description: "连击数" })) }) }, { $id: "OB11MessageFace", description: "QQ表情消息段" }), Dye = l.Object({ type: l.Literal( "mface" /* mface */ ), data: l.Object({ emoji_package_id: l.Number({ description: "表情包ID" }), emoji_id: l.String({ description: "表情ID" }), key: l.String({ description: "表情key" }), summary: l.String({ description: "表情摘要" }) }) }, { $id: "OB11MessageMFace", description: "商城表情消息段" }), Oye = l.Object({ type: l.Literal( "at" /* at */ ), data: l.Object({ qq: l.String({ description: "QQ号或all" }), name: l.Optional(l.String({ description: "显示名称" })) }) }, { $id: "OB11MessageAt", description: "@消息段" }), Fye = l.Object({ type: l.Literal( "reply" /* reply */ ), data: l.Object({ id: l.Optional(l.String({ description: "消息ID的短ID映射" })), seq: l.Optional(l.Number({ description: "消息序列号,优先使用" })) }) }, { $id: "OB11MessageReply", description: "回复消息段" }), Wf = l.Object({ file: l.String({ description: "文件路径/URL/file:///" }), path: l.Optional(l.String({ description: "文件路径" })), url: l.Optional(l.String({ description: "文件URL" })), name: l.Optional(l.String({ description: "文件名" })), thumb: l.Optional(l.String({ description: "缩略图" })) }, { $id: "FileBaseData", description: "文件消息段基础数据" }); l.Object({ data: Wf }, { $id: "OB11MessageFileBase", description: "文件消息基础接口" }); const Mye = l.Object({ type: l.Literal( "image" /* image */ ), data: l.Intersect([ l.Omit(Wf, []), l.Object({ summary: l.Optional(l.String({ description: "图片摘要" })), sub_type: l.Optional(l.Number({ description: "图片子类型" })) }) ]) }, { $id: "OB11MessageImage", description: "图片消息段" }), Rye = l.Object({ type: l.Literal( "record" /* voice */ ), data: Wf }, { $id: "OB11MessageRecord", description: "语音消息段" }), Bye = l.Object({ type: l.Literal( "video" /* video */ ), data: Wf }, { $id: "OB11MessageVideo", description: "视频消息段" }), Uye = l.Object({ type: l.Literal( "file" /* file */ ), data: Wf }, { $id: "OB11MessageFile", description: "文件消息段" }), Lye = l.Object({ type: l.Union([ l.Literal("qq"), l.Literal("163"), l.Literal("kugou"), l.Literal("migu"), l.Literal("kuwo") ], { description: "音乐平台类型" }), id: l.Union([l.String(), l.Number()], { description: "音乐ID" }) }), Qye = l.Object({ type: l.Union([ l.Literal("qq"), l.Literal("163"), l.Literal("kugou"), l.Literal("migu"), l.Literal("kuwo"), l.Literal("custom") ], { description: "音乐平台类型" }), id: l.Undefined(), url: l.String({ description: "点击后跳转URL" }), audio: l.Optional(l.String({ description: "音频URL" })), title: l.Optional(l.String({ description: "音乐标题" })), image: l.String({ description: "封面图片URL" }), content: l.Optional(l.String({ description: "音乐简介" })) }), jye = l.Object({ type: l.Literal( "music" /* music */ ), data: Lye }, { $id: "OB11MessageIdMusic", description: "ID音乐消息段" }), $ye = l.Object({ type: l.Literal( "music" /* music */ ), data: Qye }, { $id: "OB11MessageCustomMusic", description: "自定义音乐消息段" }), Gye = l.Object({ type: l.Literal( "poke" /* poke */ ), data: l.Object({ type: l.String({ description: "戳一戳类型" }), id: l.String({ description: "戳一戳ID" }) }) }, { $id: "OB11MessagePoke", description: "戳一戳消息段" }), qye = l.Object({ type: l.Literal( "dice" /* dice */ ), data: l.Object({ result: l.Union([l.Number(), l.String()], { description: "骰子结果" }) }) }, { $id: "OB11MessageDice", description: "骰子消息段" }), zye = l.Object({ type: l.Literal( "rps" /* rps */ ), data: l.Object({ result: l.Union([l.Number(), l.String()], { description: "猜拳结果" }) }) }, { $id: "OB11MessageRPS", description: "猜拳消息段" }), Hye = l.Object({ type: l.Literal( "contact" /* contact */ ), data: l.Object({ type: l.Union([l.Literal("qq"), l.Literal("group")], { description: "联系人类型" }), id: l.String({ description: "联系人ID" }) }) }, { $id: "OB11MessageContact", description: "联系人消息段" }), Wye = l.Object({ type: l.Literal( "location" /* location */ ), data: l.Object({ lat: l.Union([l.String(), l.Number()], { description: "纬度" }), lon: l.Union([l.String(), l.Number()], { description: "经度" }), title: l.Optional(l.String({ description: "标题" })), content: l.Optional(l.String({ description: "内容" })) }) }, { $id: "OB11MessageLocation", description: "位置消息段" }), Kye = l.Object({ type: l.Literal( "json" /* json */ ), data: l.Object({ data: l.Union([l.String(), l.Object({})], { description: "JSON数据" }), config: l.Optional(l.Object({ token: l.String({ description: "token" }) })) }) }, { $id: "OB11MessageJson", description: "JSON消息段" }), Vye = l.Object({ type: l.Literal( "xml" /* xml */ ), data: l.Object({ data: l.String({ description: "XML数据" }) }) }, { $id: "OB11MessageXml", description: "XML消息段" }), Yye = l.Object({ type: l.Literal( "markdown" /* markdown */ ), data: l.Object({ content: l.String({ description: "Markdown内容" }) }) }, { $id: "OB11MessageMarkdown", description: "Markdown消息段" }), Jye = l.Object({ type: l.Literal( "miniapp" /* miniapp */ ), data: l.Object({ data: l.String({ description: "小程序数据" }) }) }, { $id: "OB11MessageMiniApp", description: "小程序消息段" }), Xye = l.Object({ type: l.Literal( "onlinefile" /* onlinefile */ ), data: l.Object({ msgId: l.String({ description: "消息ID" }), elementId: l.String({ description: "元素ID" }), fileName: l.String({ description: "文件名" }), fileSize: l.String({ description: "文件大小" }), isDir: l.Boolean({ description: "是否为目录" }) }) }, { $id: "OB11MessageOnlineFile", description: "在线文件消息段" }), Zye = l.Object({ type: l.Literal( "flashtransfer" /* flashtransfer */ ), data: l.Object({ fileSetId: l.String({ description: "文件集ID" }) }) }, { $id: "OB11MessageFlashTransfer", description: "QQ闪传消息段" }), ebe = l.Object({ type: l.Literal( "node" /* node */ ), data: l.Object({ id: l.Optional(l.String({ description: "转发消息ID" })), user_id: l.Optional(l.Union([l.Number(), l.String()], { description: "发送者QQ号" })), uin: l.Optional(l.Union([l.Number(), l.String()], { description: "发送者QQ号(兼容go-cqhttp)" })), nickname: l.String({ description: "发送者昵称" }), name: l.Optional(l.String({ description: "发送者昵称(兼容go-cqhttp)" })), // content 使用 Any 以支持循环引用,实际类型是 OB11MessageMixType content: l.Any({ description: "消息内容 (OB11MessageMixType)" }), source: l.Optional(l.String({ description: "消息来源" })), news: l.Optional(l.Array(l.Object({ text: l.String({ description: "新闻文本" }) }))), summary: l.Optional(l.String({ description: "摘要" })), prompt: l.Optional(l.String({ description: "提示" })), time: l.Optional(l.String({ description: "时间" })) }) }, { $id: "OB11MessageNode", description: "合并转发消息节点" }), tbe = l.Object({ type: l.Literal( "forward" /* forward */ ), data: l.Object({ id: l.String({ description: "合并转发ID" }), // content 使用 Any 以支持类型兼容,实际类型是 OB11Message[] content: l.Optional(l.Any({ description: "消息内容 (OB11Message[])" })) }) }, { $id: "OB11MessageForward", description: "合并转发消息段" }), C2 = l.Union([ Nye, Pye, Dye, Oye, Fye, Mye, Rye, Bye, Uye, jye, $ye, Gye, qye, zye, Hye, Wye, Kye, Vye, Yye, Jye, ebe, tbe, Xye, Zye ], { $id: "OB11MessageData", description: "OneBot 11 消息段" }), t0 = l.Union([ l.Array(C2), l.String(), C2 ], { $id: "OB11MessageMixType", description: "OneBot 11 消息混合类型" }); l.Object({ message_type: l.Optional(l.Union([l.Literal("private"), l.Literal("group")], { description: "消息类型" })), user_id: l.Optional(l.String({ description: "用户QQ号" })), group_id: l.Optional(l.String({ description: "群号" })), message: t0, messages: l.Optional(t0), auto_escape: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否作为纯文本发送" })), source: l.Optional(l.String({ description: "消息来源" })), news: l.Optional(l.Array(l.Object({ text: l.String({ description: "文本" }) }))), summary: l.Optional(l.String({ description: "摘要" })), prompt: l.Optional(l.String({ description: "提示" })), time: l.Optional(l.String({ description: "时间" })) }, { $id: "OB11PostSendMsg", description: "OneBot 11 发送消息请求" }); const nbe = l.Object({ user_id: l.Union([l.Number(), l.String()], { description: "发送者QQ号" }), nickname: l.String({ description: "发送者昵称" }), card: l.Optional(l.String({ description: "群名片" })), role: l.Optional(l.String({ description: "角色" })), sex: l.Optional(l.String({ description: "性别" })), age: l.Optional(l.Number({ description: "年龄" })), area: l.Optional(l.String({ description: "地区" })), level: l.Optional(l.String({ description: "等级" })), title: l.Optional(l.String({ description: "头衔" })) }, { $id: "OB11Sender", description: "OneBot 11 发送者信息" }); l.Object({ real_seq: l.Optional(l.String({ description: "真实序列号" })), temp_source: l.Optional(l.Number({ description: "临时会话来源" })), message_sent_type: l.Optional(l.String({ description: "消息发送类型" })), target_id: l.Optional(l.Number({ description: "目标ID" })), self_id: l.Optional(l.Number({ description: "机器人QQ号" })), time: l.Number({ description: "消息时间戳" }), message_id: l.Number({ description: "消息ID" }), message_seq: l.Number({ description: "消息序列号" }), real_id: l.Number({ description: "真实ID" }), user_id: l.Union([l.Number(), l.String()], { description: "发送者QQ号" }), group_id: l.Optional(l.Union([l.Number(), l.String()], { description: "群号" })), group_name: l.Optional(l.String({ description: "群名称" })), message_type: l.Union([l.Literal("private"), l.Literal("group")], { description: "消息类型" }), sub_type: l.Optional(l.Union([ l.Literal("friend"), l.Literal("group"), l.Literal("normal") ], { description: "消息子类型" })), sender: nbe, message: l.Union([l.Array(C2), l.String()], { description: "消息内容" }), message_format: l.Union([l.Literal("array"), l.Literal("string")], { description: "消息格式" }), raw_message: l.String({ description: "原始消息" }), font: l.Number({ description: "字体" }), post_type: l.Optional(l.String({ description: "上报类型" })), raw: l.Optional(l.Unknown({ description: "原始消息对象" })), emoji_likes_list: l.Optional(l.Array(l.Object({ emoji_id: l.String({ description: "表情ID" }), emoji_type: l.String({ description: "表情类型" }), likes_cnt: l.String({ description: "点赞数" }) }), { description: "表情点赞列表" })) }, { $id: "OB11Message", description: "OneBot 11 完整消息对象" }); class Hi { static selfInfo(e) { return { user_id: +e.uin, nickname: e.nick }; } static friends(e) { return e.map((n) => ({ birthday_year: n.baseInfo.birthday_year, birthday_month: n.baseInfo.birthday_month, birthday_day: n.baseInfo.birthday_day, user_id: parseInt(n.coreInfo.uin), age: n.baseInfo.age, phone_num: n.baseInfo.phoneNum, email: n.baseInfo.eMail, category_id: n.baseInfo.categoryId, nickname: n.coreInfo.nick ?? "", remark: n.coreInfo.remark ?? n.coreInfo.nick, sex: this.sex(n.baseInfo.sex), level: n.qqLevel && SS(n.qqLevel) || 0 })); } static friend(e) { return { birthday_year: e.baseInfo.birthday_year, birthday_month: e.baseInfo.birthday_month, birthday_day: e.baseInfo.birthday_day, user_id: parseInt(e.coreInfo.uin), age: e.baseInfo.age, phone_num: e.baseInfo.phoneNum, email: e.baseInfo.eMail, category_id: e.baseInfo.categoryId, nickname: e.coreInfo.nick ?? "", remark: e.coreInfo.remark ?? e.coreInfo.nick, sex: this.sex(e.baseInfo.sex), level: 0 }; } static groupMemberRole(e) { return { 4: jm.owner, 3: jm.admin, 2: jm.member }[e]; } static sex(e) { return e && { [md.GENDER_MALE]: ss.male, [md.GENDER_FEMALE]: ss.female, [md.GENDER_UNKOWN]: ss.unknown, [md.GENDER_PRIVACY]: ss.unknown }[e] || ss.unknown; } static groupMember(e, n) { return { group_id: +e, user_id: +n.uin, nickname: n.nick, card: n.cardName, sex: this.sex(n.sex), age: n.age ?? 0, area: "", level: n.memberRealLevel?.toString() ?? "0", qq_level: n.qqLevel && SS(n.qqLevel) || 0, join_time: +n.joinTime, last_sent_time: +n.lastSpeakTime, title_expire_time: 0, unfriendly: !1, card_changeable: !0, is_robot: n.isRobot, shut_up_timestamp: n.shutUpTime, role: this.groupMemberRole(n.role), title: n.memberSpecialTitle ?? "" }; } static group(e) { return { group_all_shut: +e.groupShutupExpireTime > 0 ? -1 : 0, group_remark: e.remarkName, group_id: +e.groupCode, group_name: e.groupName, member_count: e.memberCount, max_member_count: e.maxMember }; } static groups(e) { return e.map(this.group); } static file(e, n) { return { group_id: +e, file_id: on.encodeModelId({ chatType: 2, peerUid: e }, n.fileModelId, n.fileId, n.fileId ?? ""), file_name: n.fileName, busid: n.busId, size: +n.fileSize, file_size: +n.fileSize, upload_time: n.uploadTime, dead_time: n.deadTime, modify_time: n.modifyTime, download_times: n.downloadTimes, uploader: +n.uploaderUin, uploader_name: n.uploaderName }; } static folder(e, n) { return { group_id: +e, folder_id: n.folderId, folder: n.folderId, folder_name: n.folderName, create_time: n.createTime, creator: +n.createUin, creator_name: n.creatorName, total_file_count: n.totalFileCount }; } } const rbe = /\[CQ:(\w+)((,\w+=[^,\]]*)*)]/; function T2(t) { return String(t).replace(/[/g, "[").replace(/]/g, "]").replace(/,/g, ",").replace(/&/g, "&"); } function ibe(t) { const e = rbe.exec(t); if (!e) return null; const [, n, r] = e, i = {}; return r && r.slice(1).split(",").forEach((o) => { const a = o.indexOf("="); i[o.slice(0, a)] = T2(o.slice(a + 1)); }), { type: n, data: i, capture: e }; } function Zw(t, e) { return { type: t, data: e }; } function obe(t) { const e = []; let n; for (; n = ibe(t); ) { const { type: r, data: i, capture: o } = n; r && (o.index && e.push(Zw("text", { text: T2(t.slice(0, o.index)) })), e.push(Zw(r, i)), t = t.slice(o.index + o[0].length)); } return t && e.push(Zw("text", { text: T2(t) })), e; } function abe(t) { return t.replace(/&/g, "&").replace(/\[/g, "[").replace(/]/g, "]"); } function sbe(t) { return t.replace(/&/g, "&").replace(/\[/g, "[").replace(/]/g, "]").replace(/,/g, ","); } function cbe(t) { if (t.type === "text") return abe(t.data.text); let e = "[CQ:" + t.type; for (const n in t.data) { const r = t.data[n]; if (r !== void 0) try { let i; typeof r == "object" && r?.toString === Object.prototype.toString ? i = JSON.stringify(r) : i = r?.toString(), i && (e += `,${n}=${sbe(i)}`); } catch (i) { console.error(`Error encoding CQCode for ${n}:`, i); } } return e += "]", e; } class ube extends Ja { notice_type = "friend_add"; user_id; constructor(e, n) { super(e), this.user_id = n; } } class lbe extends Uo { notice_type = "group_decrease"; sub_type = "leave"; operator_id; constructor(e, n, r, i, o = "leave") { super(e, n, r), this.group_id = n, this.operator_id = i, this.user_id = r, this.sub_type = o; } } const rD = { adminUid: v(1, w.STRING), isPromote: v(2, w.BOOL) }, dbe = { extraDisable: v(1, () => rD), extraEnable: v(2, () => rD) }, pbe = { groupUin: v(1, w.UINT32), flag: v(2, w.UINT32), isPromote: v(3, w.BOOL), body: v(4, () => dbe) }; class fbe extends Uo { notice_type = "group_admin"; sub_type; constructor(e, n, r, i) { super(e, n, r), this.sub_type = i; } } class aL extends m3 { post_type = ll.REQUEST; } class $m extends aL { request_type = "group"; group_id; user_id; comment; flag; sub_type; constructor(e, n, r, i, o, a) { super(e), this.group_id = n, this.user_id = r, this.sub_type = i, this.comment = o, this.flag = a; } } class hbe { capacity; cache; constructor(e) { this.capacity = e, this.cache = /* @__PURE__ */ new Map(); } get(e) { const n = this.cache.get(e); return n !== void 0 && (this.cache.delete(e), this.cache.set(e, n)), n; } put(e, n) { if (this.cache.has(e)) this.cache.delete(e); else if (this.cache.size >= this.capacity) { const r = this.cache.keys().next().value; r !== void 0 && this.cache.delete(r); } this.cache.set(e, n); } resetCapacity(e) { for (this.capacity = e; this.cache.size > this.capacity; ) { const n = this.cache.keys().next().value; n !== void 0 && this.cache.delete(n); } } } class mbe { tasks = /* @__PURE__ */ new Map(); MAX_RETRIES = 3; isProcessing = !1; pendingOperations = []; /** * 执行队列中的待处理操作,确保异步安全 */ executeNextOperation() { if (this.pendingOperations.length === 0) { this.isProcessing = !1; return; } this.isProcessing = !0, this.pendingOperations.shift()?.(), setImmediate(() => this.executeNextOperation()); } /** * 安全执行操作,防止竞态条件 * @param operation 要执行的操作 */ safeExecute(e) { this.pendingOperations.push(e), this.isProcessing || this.executeNextOperation(); } /** * 检查文件是否存在 * @param filePath 文件路径 * @returns 文件是否存在 */ fileExists(e) { try { return fe.existsSync(e); } catch { return !1; } } /** * 添加文件到清理队列 * @param filePath 文件路径 * @param cleanupDelay 清理延迟时间(毫秒) */ addFile(e, n) { this.safeExecute(() => { this.tasks.has(e) && this.cancelCleanup(e); const r = { filePath: e, addedTime: Date.now(), retries: 0 }, i = setTimeout(() => { this.cleanupFile(r, n); }, n); this.tasks.set(e, { fileRecord: r, timer: i }); }); } /** * 批量添加文件到清理队列 * @param filePaths 文件路径数组 * @param cleanupDelay 清理延迟时间(毫秒) */ addFiles(e, n) { this.safeExecute(() => { for (const r of e) { if (this.tasks.has(r)) { const a = this.tasks.get(r); a && clearTimeout(a.timer); } const i = { filePath: r, addedTime: Date.now(), retries: 0 }, o = setTimeout(() => { this.cleanupFile(i, n); }, n); this.tasks.set(r, { fileRecord: i, timer: o }); } }); } /** * 清理文件 * @param record 文件记录 * @param delay 延迟时间,用于重试 */ cleanupFile(e, n) { this.safeExecute(() => { if (!this.fileExists(e.filePath)) { this.tasks.delete(e.filePath); return; } try { fe.unlinkSync(e.filePath), this.tasks.delete(e.filePath); } catch (r) { const i = r; if (i.code === "ENOENT") { this.tasks.delete(e.filePath); return; } if (i.code === "EACCES" || i.code, e.retries < this.MAX_RETRIES - 1) { e.retries++; const o = setTimeout(() => { this.cleanupFile(e, n); }, n); this.tasks.set(e.filePath, { fileRecord: e, timer: o }); } else this.tasks.delete(e.filePath); } }); } /** * 取消文件的清理任务 * @param filePath 文件路径 * @returns 是否成功取消 */ cancelCleanup(e) { let n = !1; return this.safeExecute(() => { const r = this.tasks.get(e); r && (clearTimeout(r.timer), this.tasks.delete(e), n = !0); }), n; } /** * 获取队列中的文件数量 * @returns 文件数量 */ getQueueSize() { return this.tasks.size; } /** * 获取所有待清理的文件 * @returns 文件路径数组 */ getPendingFiles() { return Array.from(this.tasks.keys()); } /** * 清空所有清理任务 */ clearAll() { this.safeExecute(() => { for (const e of this.tasks.values()) clearTimeout(e.timer); this.tasks.clear(); }); } } const gbe = new mbe(); class ybe { resourceTypes = /* @__PURE__ */ new Map(); destroyed = !1; /** * 调用资源(自动注册或复用已有配置) */ async callResource(e, n, ...r) { if (this.destroyed) throw new Error("ResourceManager has been destroyed"); let i = this.resourceTypes.get(e); if (i || (i = { config: { resourceFn: n.resourceFn, healthCheckFn: n.healthCheckFn, disableTime: n.disableTime ?? 3e4, maxRetries: n.maxRetries ?? 3, healthCheckInterval: n.healthCheckInterval ?? 6e4, maxHealthCheckFailures: n.maxHealthCheckFailures ?? 20, testArgs: n.testArgs }, isEnabled: !0, disableUntil: 0, currentRetries: 0, healthCheckFailureCount: 0, isPermanentlyDisabled: !1, lastHealthCheckTime: 0, successCount: 0, failureCount: 0 }, this.resourceTypes.set(e, i)), await this.checkAndPerformHealthCheck(i), i.isPermanentlyDisabled) throw new Error(`Resource type '${e}' is permanently disabled (success: ${i.successCount}, failure: ${i.failureCount})`); if (!this.isResourceAvailable(e)) { const o = new Date(i.disableUntil).toISOString(); throw new Error(`Resource type '${e}' is currently disabled until ${o} (success: ${i.successCount}, failure: ${i.failureCount})`); } try { const o = await n.resourceFn(...r); return this.onResourceSuccess(i), o; } catch (o) { throw this.onResourceFailure(i), o; } } /** * 检查资源类型是否可用 */ isResourceAvailable(e) { const n = this.resourceTypes.get(e); return n ? n.isPermanentlyDisabled || !n.isEnabled ? !1 : Date.now() >= n.disableUntil : !0; } /** * 获取资源类型统计信息 */ getResourceStats(e) { const n = this.resourceTypes.get(e); return n ? { successCount: n.successCount, failureCount: n.failureCount, isEnabled: n.isEnabled, isPermanentlyDisabled: n.isPermanentlyDisabled } : null; } /** * 获取所有资源类型统计 */ getAllResourceStats() { const e = /* @__PURE__ */ new Map(); for (const [n, r] of this.resourceTypes) e.set(n, { successCount: r.successCount, failureCount: r.failureCount, isEnabled: r.isEnabled, isPermanentlyDisabled: r.isPermanentlyDisabled }); return e; } /** * 注销资源类型 */ unregister(e) { return this.resourceTypes.delete(e); } /** * 销毁管理器 */ destroy() { this.destroyed || (this.resourceTypes.clear(), this.destroyed = !0); } /** * 检查并执行健康检查(如果需要) */ async checkAndPerformHealthCheck(e) { if (e.isEnabled && Date.now() >= e.disableUntil || e.isPermanentlyDisabled) return; const n = Date.now(); n < e.disableUntil || n - e.lastHealthCheckTime < e.config.healthCheckInterval || await this.performHealthCheck(e); } async performHealthCheck(e) { e.lastHealthCheckTime = Date.now(); try { let n; if (e.config.healthCheckFn) { const r = e.config.testArgs || []; n = await e.config.healthCheckFn(...r); } else { const r = e.config.testArgs || []; await e.config.resourceFn(...r), n = !0; } if (n) e.isEnabled = !0, e.disableUntil = 0, e.currentRetries = 0, e.healthCheckFailureCount = 0; else throw new Error("Health check function returned false"); } catch { e.healthCheckFailureCount++, e.healthCheckFailureCount >= e.config.maxHealthCheckFailures ? (e.isPermanentlyDisabled = !0, e.disableUntil = 0) : e.disableUntil = Date.now() + e.config.disableTime; } } onResourceSuccess(e) { e.currentRetries = 0, e.disableUntil = 0, e.healthCheckFailureCount = 0, e.successCount++; } onResourceFailure(e) { e.currentRetries++, e.failureCount++, e.currentRetries >= e.config.maxRetries && (e.disableUntil = Date.now() + e.config.disableTime, e.currentRetries = 0); } } const bbe = new ybe(); async function eS(t, e, ...n) { return bbe.callResource(t, e, ...n); } class sL extends Ja { peer_id; constructor(e, n) { super(e), this.peer_id = n; } } class iD extends sL { notice_type; sub_type; constructor(e, n) { super(e, n), this.notice_type = "online_file_receive", this.sub_type = "cancel"; } } class tS extends sL { notice_type = "online_file_send"; sub_type; constructor(e, n, r) { super(e, n), this.sub_type = r; } } function vbe(t, e) { return t in e; } class xbe { obContext; core; notifyGroupInvite = new hbe(50); // seq -> notify rawToOb11Converters = { textElement: async (e) => { if (e.atType === Hr.ATTYPEUNKNOWN) { let n = e.content; return n.indexOf(` `) === -1 && n.indexOf(`\r `) === -1 && (n = n.replace(/\r/g, ` `)), { type: Ke.text, data: { text: n } }; } else { let n = "all"; if (e.atType !== Hr.ATTYPEALL) { const { atNtUid: r, atUid: i } = e; n = !i || i === "0" ? await this.core.apis.UserApi.getUinByUidV2(r) : String(Number(i) >>> 0); } return { type: Ke.at, data: { qq: n // name: content.slice(1); } }; } }, picElement: async (e, n, r, { disableGetUrl: i }) => { try { const o = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }; return on.encode( o, n.msgId, r.elementId, e.fileUuid, e.fileName ), { type: Ke.image, data: { summary: e.summary, file: e.fileName, sub_type: e.picSubType, url: i ? e.filePath ?? "" : await this.core.apis.FileApi.getImageUrl(e), file_size: e.fileSize } }; } catch (o) { return this.core.context.logger.logError("获取图片url失败", o.stack), null; } }, fileElement: async (e, n, r, { disableGetUrl: i }) => { if (+r.elementType == 23 || +r.elementType == 30) return { type: Ke.onlinefile, data: { msgId: n.msgId, elementId: r.elementId, fileName: e.fileName, fileSize: e.fileSize, isDir: r.elementType === 30 } }; const o = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }; if (on.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileUuid), on.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileName), this.core.apis.PacketApi.packetStatus && !i) { let a; try { a = await eS( "file-url-get", { resourceFn: async () => await this.core.apis.FileApi.getFileUrl(n.chatType, n.peerUid, e.fileUuid, e.file10MMd5, 1500), healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1), testArgs: [], healthCheckInterval: 3e4, maxHealthCheckFailures: 3 } ); } catch { a = ""; } if (a) return { type: Ke.file, data: { file: e.fileName, file_id: e.fileUuid, file_size: e.fileSize, url: a } }; } return { type: Ke.file, data: { file: e.fileName, file_id: e.fileUuid, file_size: e.fileSize } }; }, faceElement: async (e) => { const n = e.faceIndex; return e.faceType === ls.Poke ? { type: Ke.poke, data: { type: e?.pokeType?.toString() ?? "0", id: n.toString() } } : n === bd.DICE ? { type: Ke.dice, data: { result: e.resultId } } : n === bd.RPS ? { type: Ke.rps, data: { result: e.resultId } } : { type: Ke.face, data: { id: e.faceIndex.toString(), raw: e, resultId: e.resultId, chainCount: e.chainCount } }; }, marketFaceElement: async (e, n, r) => { const i = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }, { emojiId: o } = e, a = o.substring(0, 2), s = `https://gxh.vip.qq.com/club/item/parcel/item/${a}/${o}/raw300.gif`, c = `${a}-${o}.gif`; return on.encode(i, n.msgId, r.elementId, "", c), { type: Ke.image, data: { summary: e.faceName, // 商城表情名称 file: c, url: s, key: e.key, emoji_id: e.emojiId, emoji_package_id: e.emojiPackageId } }; }, replyElement: async (e, n, r, { quick_reply: i }) => { const o = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }, a = (u) => ({ type: Ke.reply, data: { id: ot.createUniqueMsgId(o, u).toString() } }), s = n.records.find((u) => u.msgId === e?.sourceMsgIdInRecords); if (s && (s.peerUin === "284840486" || s.peerUin === "1094950020")) return a(s.msgId); const c = async (u, d, p, f) => { try { if (d && p) { const y = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV2( o, u, p, [d] )).msgList, x = y.find( (g) => f && g.msgRandom === f || g.msgSeq === u ); if (x) return x; if (i) { this.core.context.logger.logWarn(`快速回复,跳过方法1查询,序号: ${u}, 消息数: ${y.length}`); return; } this.core.context.logger.logWarn(`方法1查询失败,序号: ${u}, 消息数: ${y.length}`); } const m = (await this.core.apis.MsgApi.getMsgsBySeqAndCount( o, u, 1, !0, !0 )).msgList, h = m.find( (y) => f && y.msgRandom === f || y.msgSeq === u ); if (h) return h; if (this.core.context.logger.logWarn(`方法2查询失败,序号: ${u}, 消息数: ${m.length}`), d) { const y = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeqV3( o, u, [d] )).msgList, x = y.find( (g) => f && g.msgRandom === f || g.msgSeq === u ); if (x) return x; this.core.context.logger.logWarn(`方法3查询失败,序号: ${u}, 消息数: ${y.length}`); } return; } catch (m) { this.core.context.logger.logError("查询回复消息出错", m); return; } }; if (s && e.replyMsgTime && e.senderUidStr) { const u = await c( e.replayMsgSeq, e.senderUidStr, s.msgTime, s.msgRandom ); if (u) return a(u.msgId); this.core.context.logger.logError("所有查找方法均失败,获取不到带记录的引用消息", e.replayMsgSeq); } else { this.core.context.logger.logWarn("似乎是旧版客户端,尝试仅通过序号获取引用消息", e.replayMsgSeq); const u = await c(e.replayMsgSeq); if (u) return a(u.msgId); this.core.context.logger.logError("所有查找方法均失败,获取不到旧客户端的引用消息", e.replayMsgSeq); } if (this.core.apis.PacketApi.packetStatus) try { const u = +e.replayMsgSeq, p = (n.chatType === ke.KCHATTYPEGROUP ? await this.core.apis.PacketApi.pkt.operation.FetchGroupMessage(+n.peerUin, u, u) : await this.core.apis.PacketApi.pkt.operation.FetchC2CMessage(n.peerUid, u, u)).find((f) => (f.contentHead.sequence ?? 0) === u); if (p?.contentHead?.newId) { const f = String(p.contentHead.newId); return this.core.context.logger.logWarn("通过协议兜底成功获取引用消息", f), a(f); } this.core.context.logger.logWarn("协议兜底未找到匹配的引用消息"); } catch (u) { this.core.context.logger.logError("协议兜底获取引用消息失败", u.stack); } return null; }, videoElement: async (e, n, r, { disableGetUrl: i }) => { const o = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }; let a; if (n.peerUin === "284840486" || n.peerUin === "1094950020") try { a = await this.core.apis.FileApi.getVideoUrl({ chatType: n.chatType, peerUid: n.peerUid, guildId: "0" }, n.parentMsgIdList[0] ?? n.msgId, r.elementId); } catch { this.core.context.logger.logWarn("合并获取视频 URL 失败"); } else try { a = await this.core.apis.FileApi.getVideoUrl({ chatType: n.chatType, peerUid: n.peerUid, guildId: "0" }, n.msgId, r.elementId); } catch { this.core.context.logger.logWarn("获取视频 URL 失败"); } let s; if (a) { const u = a.find((d) => !!d.url); u && (s = u.url); } if (!s && !i) if (this.core.apis.PacketApi.packetStatus) try { s = await eS( "video-url-get", { resourceFn: async () => await this.core.apis.FileApi.getVideoUrlPacket(n.peerUid, e.fileUuid, 1500), healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1), testArgs: [], healthCheckInterval: 3e4, maxHealthCheckFailures: 3 } ); } catch (u) { this.core.context.logger.logError("获取视频url失败", u.stack), s = e.filePath; } else s = e.filePath; const c = on.encode(o, n.msgId, r.elementId, e.fileUuid, e.fileName); return { type: Ke.video, data: { file: c, url: s, file_size: e.fileSize } }; }, pttElement: async (e, n, r, { disableGetUrl: i }) => { const o = { chatType: n.chatType, peerUid: n.peerUid, guildId: "" }, a = on.encode(o, n.msgId, r.elementId, "", e.fileName); let s = ""; if (this.core.apis.PacketApi.packetStatus && !i) try { s = await eS( "ptt-url-get", { resourceFn: async () => await this.core.apis.FileApi.getPttUrl(n.peerUid, e.fileUuid, 1500), healthCheckFn: async () => await this.core.apis.PacketApi.pkt.operation.FetchRkey().then(() => !0).catch(() => !1), testArgs: [], healthCheckInterval: 3e4, maxHealthCheckFailures: 3 } ); } catch (c) { this.core.context.logger.logError("获取语音url失败", c.stack), s = e.filePath; } else s = e.filePath; return s ? { type: Ke.voice, data: { file: a, path: e.filePath, url: s, file_size: e.fileSize } } : { type: Ke.voice, data: { file: a, file_size: e.fileSize, path: e.filePath } }; }, multiForwardMsgElement: async (e, n, r, i) => { const o = n.parentMsgPeer ?? { chatType: n.chatType, guildId: "", peerUid: n.peerUid }; let a = await this.getMultiMessages(n, o); if (!a || a.length === 0) try { a = await this.core.apis.PacketApi.pkt.operation.FetchForwardMsg(e.resId); } catch (c) { return this.core.context.logger.logError(`Protocol FetchForwardMsg fallback failed! element = ${JSON.stringify(e)} , error=${c})`), null; } const s = { type: Ke.forward, data: { id: n.msgId } }; return i.parseMultMsg && (s.data.content = await this.parseMultiMessageContent( a, o, n.parentMsgIdList )), s; }, arkElement: async (e) => ({ type: Ke.json, data: { data: e.bytesData } }), markdownElement: async (e) => e?.mdExtInfo?.flashTransferInfo?.filesetId ? { type: Ke.flashtransfer, data: { fileSetId: e.mdExtInfo.flashTransferInfo.filesetId } } : { type: Ke.markdown, data: { content: e.content } } }; ob11ToRawConverters = { [Ke.text]: async ({ data: { text: e } }) => ({ elementType: Ee.TEXT, elementId: "", textElement: { content: e, atType: Hr.ATTYPEUNKNOWN, atUid: "", atTinyId: "", atNtUid: "" } }), [Ke.at]: async ({ data: { qq: e } }, n) => { function r(s, c, u, d) { return { elementType: Ee.TEXT, elementId: "", textElement: { content: `@${d}`, atType: u, atUid: s, atTinyId: "", atNtUid: c } }; } if (!n.peer || !e || n.peer.chatType === ke.KCHATTYPEC2C) return; if (e === "all") return r(e, e, Hr.ATTYPEALL, "全体成员"); const i = await this.core.apis.GroupApi.getGroupMember(n.peer.peerUid, e); if (i) return r(e, i.uid, Hr.ATTYPEONE, i.nick || i.cardName); const o = await this.core.apis.UserApi.getUidByUinV2(`${e}`); if (!o) throw new Error("Get Uid Error"); const a = await this.core.apis.UserApi.getUserDetailInfo(o); return r(e, o, Hr.ATTYPEONE, a.nick || ""); }, [Ke.reply]: async ({ data: { id: e, seq: n } }, r) => { let i, o; if (n) i = (await this.core.apis.MsgApi.getMsgsBySeqAndCount( r.peer, n.toString(), 1, !0, !0 )).msgList[0], o = r.peer; else if (e) { const a = ot.getMsgIdAndPeerByShortId(parseInt(e)); if (!a) { this.core.context.logger.logWarn("回复消息不存在", e); return; } i = (await this.core.apis.MsgApi.getMsgsByMsgId( a.Peer, [a.MsgId] )).msgList[0], o = a.Peer; } else { this.core.context.logger.logWarn("回复消息缺少id或seq参数"); return; } return i && o ? { elementType: Ee.REPLY, elementId: "", replyElement: { replayMsgSeq: i.msgSeq, // raw.msgSeq replayMsgId: i.msgId, // raw.msgId senderUin: i.senderUin, senderUinStr: i.senderUin, replyMsgClientSeq: i.clientSeq, _replyMsgPeer: o } } : void 0; }, [Ke.face]: async ({ data: { id: e, resultId: n, chainCount: r } }) => { const i = +e, a = kye.sysface.find((c) => c.QSid === i.toString()); if (!a) { this.core.context.logger.logError("不支持的ID", e); return; } let s = 1; return i >= 222 && (s = 2), a.AniStickerType && (s = 3), { elementType: Ee.FACE, elementId: "", faceElement: { faceIndex: i, faceType: s, faceText: a.QDes, stickerId: a.AniStickerId, stickerType: a.AniStickerType, packId: a.AniStickerPackId, sourceType: 1, resultId: n?.toString(), chainCount: r } }; }, [Ke.mface]: async ({ data: { emoji_package_id: e, emoji_id: n, key: r, summary: i } }) => ({ elementType: Ee.MFACE, elementId: "", marketFaceElement: { emojiPackageId: e, emojiId: n, key: r, faceName: i || "[商城表情]" } }), // File service [Ke.image]: async (e, n) => { const r = await this.handleOb11FileLikeMessage(e, n); return await this.obContext.apis.FileApi.createValidSendPicElement( n, r.path, e.data.summary, e.data.sub_type, r.isLocal ); }, [Ke.file]: async (e, n) => { const { path: r, fileName: i, isLocal: o } = await this.handleOb11FileLikeMessage(e, n); return await this.obContext.apis.FileApi.createValidSendFileElement(n, r, i, "", !1, o); }, [Ke.video]: async (e, n) => { const { path: r, fileName: i, isLocal: o } = await this.handleOb11FileLikeMessage(e, n); let a = e.data.thumb; if (a) { const s = await $i(this.core.SnowCatTempPath, a); s.success && (a = s.path, s.isLocal || n.deleteAfterSentFiles.push(a)); } return await this.obContext.apis.FileApi.createValidSendVideoElement(n, r, i, a, o); }, [Ke.voice]: async (e, n) => this.obContext.apis.FileApi.createValidSendPttElement( n, (await this.handleOb11FileLikeMessage(e, n)).path ), [Ke.json]: async ({ data: { data: e } }) => ({ elementType: Ee.ARK, elementId: "", arkElement: { bytesData: typeof e == "string" ? e : JSON.stringify(e), linkInfo: null, subElementType: null } }), [Ke.dice]: async () => ({ elementType: Ee.FACE, elementId: "", faceElement: { faceIndex: bd.DICE, faceType: ls.AniSticke, faceText: "[骰子]", packId: "1", stickerId: "33", sourceType: 1, stickerType: 2, surpriseId: "" // "randomType": 1, } }), [Ke.rps]: async () => ({ elementType: Ee.FACE, elementId: "", faceElement: { faceIndex: bd.RPS, faceText: "[包剪锤]", faceType: ls.AniSticke, packId: "1", stickerId: "34", sourceType: 1, stickerType: 2, surpriseId: "" // "randomType": 1, } }), // Need signing [Ke.markdown]: async ({ data: { content: e } }) => ({ elementType: Ee.MARKDOWN, elementId: "", markdownElement: { content: e } }), [Ke.music]: async ({ data: e }, n) => { const r = ["qq", "163", "kugou", "kuwo", "migu"], i = [...r, "custom"]; if (e.id !== void 0) { if (!r.includes(e.type)) { this.core.context.logger.logError(`[音乐卡片] type参数错误: "${e.type}",仅支持: ${r.join("、")}`); return; } } else { if (!i.includes(e.type)) { this.core.context.logger.logError(`[音乐卡片] type参数错误: "${e.type}",仅支持: ${i.join("、")}`); return; } if (!e.url) { this.core.context.logger.logError("[音乐卡片] 自定义音乐卡片缺少必需参数: url"); return; } if (!e.image) { this.core.context.logger.logError("[音乐卡片] 自定义音乐卡片缺少必需参数: image"); return; } } let o; if (e.id === void 0 && e.content) { const { content: s, ...c } = e; o = { singer: s, ...c }; } else o = e; let a = this.obContext.configLoader.configData.musicSignUrl; a || (a = "http://106.55.0.102:10087/"); try { let s; try { s = await ht.HttpGetJson(a, "POST", o); } catch { this.core.context.logger.logError("[音乐卡片签名] 首选地址失败,尝试备选地址..."), s = await ht.HttpGetJson( "https://ss.xingzhige.com/music_card/card", // 思思的音卡签名 "POST", o ); } return this.ob11ToRawConverters.json({ data: { data: s }, type: Ke.json }, n); } catch (s) { const c = s instanceof Error ? s.message : String(s); this.core.context.logger.logError( `[音乐卡片签名失败] 签名服务请求出错! ├─ 音乐类型: ${e.type} ├─ 音乐ID: ${e.id ?? "自定义"} ├─ 错误信息: ${c} └─ 提示: 请检查网络连接,或尝试在配置中更换其他音乐签名服务地址(musicSignUrl)` ); return; } }, [Ke.node]: async () => { }, [Ke.forward]: async ({ data: e }, n) => { const r = aE.fromResId(e.id); return this.ob11ToRawConverters.json({ data: { data: JSON.stringify(r) }, type: Ke.json }, n); }, [Ke.xml]: async () => { }, [Ke.poke]: async () => { }, [Ke.location]: async () => ({ elementType: Ee.SHARELOCATION, elementId: "", shareLocationElement: { text: "测试", ext: "" } }), [Ke.miniapp]: async () => { }, [Ke.contact]: async ({ data: { type: e = "qq", id: n } }, r) => { if (e === "qq") { const i = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(n.toString(), ""); return this.ob11ToRawConverters.json({ data: { data: i.arkMsg }, type: Ke.json }, r); } else if (e === "group") { const i = await this.core.apis.GroupApi.getGroupRecommendContactArkJson(n.toString()); return this.ob11ToRawConverters.json({ data: { data: i.arkJson }, type: Ke.json }, r); } }, // 不需要支持发送 [Ke.onlinefile]: async () => { }, [Ke.flashtransfer]: async () => { } }; constructor(e, n) { this.obContext = e, this.core = n; } /** * 解析带有JSON标记的文本 * @param text 要解析的文本 * @returns 解析后的结果数组,每个元素包含类型(text或json)和内容 */ parseTextWithJson(e) { const n = /<(\{.*?\})>/g, r = []; let i = 0, o; for (; (o = n.exec(e)) !== null; ) { o.index > i && r.push({ type: "text", content: e.substring(i, o.index) }); try { const a = JSON.parse(o[1] ?? ""); r.push({ type: "json", content: a }); } catch { r.push({ type: "text", content: o[0] }); } i = n.lastIndex; } return i < e.length && r.push({ type: "text", content: e.substring(i) }), r; } async parsePrivateMsgEvent(e, n) { if (n.subElementType === ep.GRAYTIP_ELEMENT_SUBTYPE_JSON) { if (n.jsonGrayTipElement.busiId.toString() === "1061") { const r = await this.obContext.apis.FriendApi.parsePrivatePokeEvent(n, Number(await this.core.apis.UserApi.getUinByUidV2(e.peerUid))); if (r) return r; } else if (n.jsonGrayTipElement.busiId.toString() === "19324" && e.peerUid !== "") return new ube(this.core, Number(await this.core.apis.UserApi.getUinByUidV2(e.peerUid))); } } async getMultiMessages(e, n) { if (e.parentMsgIdList = e.parentMsgIdList ?? [], e.parentMsgIdList.push(e.msgId), e.parentMsgIdList[0]) return (await this.core.apis.MsgApi.getMultiMsg( n, e.parentMsgIdList[0], e.msgId ))?.msgList; } async parseMultiMessageContent(e, n, r) { return (await Promise.all(e.map(async (o) => (o.parentMsgPeer = n, o.parentMsgIdList = r, o.id = ot.createUniqueMsgId(n, o.msgId), await this.parseMessage(o, "array", !0))))).filter((o) => o !== void 0); } async parseMessage(e, n, r = !0, i = !1, o = !1) { return n === "string" ? (await this.parseMessageV2(e, r, i, o))?.stringMsg : (await this.parseMessageV2(e, r, i, o))?.arrayMsg; } async parseMessageV2(e, n = !0, r = !1, i = !1) { if (e.senderUin === "0" || e.senderUin === "") if (e.senderUid && e.senderUid !== "" && e.senderUid !== "0") e.senderUin = await this.core.apis.UserApi.getUinByUidV2(e.senderUid); else return; if (e.peerUin === "0" || e.peerUin === "") if (e.peerUid && e.peerUid !== "" && e.peerUid !== "0") e.peerUin = await this.core.apis.UserApi.getUinByUidV2(e.peerUid); else return; const o = this.initializeMessage(e); if (this.core.selfInfo.uin === e.senderUin && (o.message_sent_type = "self"), e.chatType === ke.KCHATTYPEGROUP) await this.handleGroupMessage(o, e); else if (e.chatType === ke.KCHATTYPEC2C) await this.handlePrivateMessage(o, e); else if (e.chatType === ke.KCHATTYPETEMPC2CFROMGROUP) await this.handleTempGroupMessage(o, e); else return; const a = await this.parseMessageSegments(e, n, r, i); return o.message = a, o.raw_message = a.map((c) => cbe(c)).join("").trim(), { stringMsg: await this.convertArrayToStringMessage(o), arrayMsg: o }; } initializeMessage(e) { return { self_id: parseInt(this.core.selfInfo.uin), user_id: parseInt(e.senderUin), time: parseInt(e.msgTime) || Date.now(), message_id: e.id, message_seq: e.id, real_id: e.id, real_seq: e.msgSeq, message_type: e.chatType === ke.KCHATTYPEGROUP ? "group" : "private", sender: { user_id: +(e.senderUin ?? 0), nickname: e.sendNickName, card: e.sendMemberName ?? "" }, raw_message: "", font: 14, sub_type: "friend", message: [], message_format: "array", post_type: this.core.selfInfo.uin === e.senderUin ? ll.MESSAGE_SENT : ll.MESSAGE }; } async handleGroupMessage(e, n) { e.sub_type = "normal", e.group_id = parseInt(n.peerUin), e.group_name = n.peerName; let r = await this.core.apis.GroupApi.getGroupMember(n.peerUin, n.senderUin); r || (r = await this.core.apis.GroupApi.getGroupMember(n.peerUin, n.senderUin)), r && (e.sender.role = Hi.groupMemberRole(r.role), e.sender.nickname = r.nick); } async handlePrivateMessage(e, n) { if (e.sub_type = "friend", await this.core.apis.FriendApi.isBuddy(n.senderUid)) { const r = (await this.core.apis.UserApi.getCoreAndBaseInfo([n.senderUid])).get(n.senderUid)?.coreInfo.nick; if (r) { e.sender.nickname = r; return; } } e.sender.nickname = (await this.core.apis.UserApi.getUserDetailInfo(n.senderUid)).nick; } async handleTempGroupMessage(e, n) { e.sub_type = "group"; const r = await this.core.apis.MsgApi.getTempChatInfo(ke.KCHATTYPETEMPC2CFROMGROUP, n.senderUid); if (r.result === 0) { const i = await this.core.apis.GroupApi.getGroupMember(n.peerUin, await this.core.apis.UserApi.getUinByUidV2(n.senderUid)); e.group_id = parseInt(r.tmpChatInfo.groupCode), e.sender.nickname = i?.nick ?? i?.cardName ?? "临时会话", e.temp_source = 0; } else e.group_id = 284840486, e.temp_source = 0, e.sender.nickname = "临时会话"; } async parseMessageSegments(e, n, r = !1, i = !1) { return (await Promise.allSettled(e.elements.map( async (a) => { for (const s in a) if (vbe(s, this.rawToOb11Converters) && a[s]) { const c = this.rawToOb11Converters[s], u = await c?.( a[s], e, a, { parseMultMsg: n, disableGetUrl: r, quick_reply: i } ); return s === "faceElement" && !u ? null : u; } return null; } ))).filter((a) => a.status === "fulfilled" ? !!a.value : (this.core.context.logger.logError("消息段解析失败", a.reason), !1)).map((a) => a.value).filter((a) => a != null); } async convertArrayToStringMessage(e) { const n = structuredClone(e); return n.message_format = "string", n.message = n.raw_message, n; } async importArrayTostringMsg(e) { const n = structuredClone(e); return n.message_format = "string", n.message = n.raw_message, n; } async createSendElements(e, n, r = [], i = {}) { const o = [], a = []; for (const u of e) { if (r.includes(u.type)) continue; const d = this.ob11ToRawConverters[u.type]; if (d === void 0) throw new Error("未知的消息类型:" + u.type); const p = d( u, { peer: n, deleteAfterSentFiles: o, usePacketVideoMetadata: i.usePacketVideoMetadata } )?.catch(void 0); a.push(p); } return { sendElements: (await Promise.all(a)).filter((u) => !!u), deleteAfterSentFiles: o }; } async sendMsgWithOb11UniqueId(e, n, r, i) { if (!n.length) throw new Error("消息体无法解析, 请检查是否发送了不支持的消息类型"); const o = this.obContext.configLoader.configData.timeout; let a; if (i !== void 0 && i > 0) a = Ale(o, i); else { const s = n.reduce((c, u) => { switch (u.elementType) { case Ee.PTT: return c + +(u.pttElement.fileSize || "3000"); case Ee.FILE: return c + +(u.fileElement.fileSize || "3000"); case Ee.VIDEO: return c + +(u.videoElement.fileSize || "3000"); case Ee.PIC: return c + +(u.picElement.fileSize || "3000"); default: return c; } }, 0); a = hA(o, s, o.uploadSpeedKBps); } try { const s = await this.core.apis.MsgApi.sendMsg(e, n, a); if (!s) throw new Error("发送消息失败"); return s.id = ot.createUniqueMsgId({ chatType: e.chatType, guildId: "", peerUid: e.peerUid }, s.msgId), s; } finally { gbe.addFiles(r, a); } } async handleOb11FileLikeMessage({ data: e }, { deleteAfterSentFiles: n }) { let r = [e.url, e.file, e.path].find((i) => i && i.trim()) ?? ""; if (!r) throw this.core.context.logger.logError("文件消息缺少参数", e), new Error("文件消息缺少参数"); r = await this.handleObfuckName(r) ?? r; try { const i = this.obContext.configLoader.configData.imageDownloadProxy || void 0, { path: o, fileName: a, errMsg: s, success: c, isLocal: u } = await $i(this.core.SnowCatTempPath, r, void 0, void 0, i); if (!c) throw this.core.context.logger.logError("文件处理失败", s), new Error("文件处理失败: " + s); return u || n.push(o), { path: o, fileName: e.name ?? a, isLocal: u }; } catch (i) { throw new Error(i.message); } } async handleObfuckName(e) { const n = on.decode(e); if (n && n.msgId && n.elementId) { const { peer: r, msgId: i, elementId: o } = n, a = (await this.core.apis.MsgApi.getMsgsByMsgId(r, [i]))?.msgList.find((d) => d.msgId === i), s = a?.elements.find((d) => d.elementId === o); if (!(s?.videoElement ?? s?.fileElement ?? s?.pttElement ?? s?.picElement)) throw new Error("element not found"); let u = ""; return s?.picElement && a && (u = (await this.obContext.apis.MsgApi.rawToOb11Converters.picElement?.(s?.picElement, a, s, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !1 }))?.data.url ?? ""), s?.videoElement && a && (u = (await this.obContext.apis.MsgApi.rawToOb11Converters.videoElement?.(s?.videoElement, a, s, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !1 }))?.data.url ?? ""), u !== "" ? u : await this.core.apis.FileApi.downloadMedia(i, r.chatType, r.peerUid, o, "", ""); } } groupChangDecreseType2String(e) { switch (e) { case 130: return "leave"; case 131: return "kick"; case 3: return "kick_me"; case 129: return "disband"; default: return "kick"; } } async waitGroupNotify(e, n, r) { const i = this.core.apis.GroupApi.groupMemberCache.get(e)?.get(this.core.selfInfo.uid.toString())?.role; if ((i === 3 || i === 4) && !r) { let a; if (await this.core.eventWrapper.registerListen( "NodeIKernelGroupListener/onGroupNotifiesUpdated", (s, c) => { for (const u of c) if (u.group.groupCode === e && u.user1.uid === n) return a = u, !0; return !1; }, 1, 1e3 ).catch(() => { }), a) return a.actionUser.uid ? a.actionUser.uid : a.user2.uid; } return r; } async parseSysMessage(e) { const n = new he(yl).decode(Uint8Array.from(e)); if (n.contentHead.type === 33 && n.body?.msgContent) { const r = new he(p4).decode(n.body.msgContent); await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0); const i = await this.waitGroupNotify( r.groupUin.toString(), r.memberUid, r.operatorInfo ? new TextDecoder("utf-8").decode(r.operatorInfo) : void 0 ); return new Qm( this.core, r.groupUin, r.memberUid ? +await this.core.apis.UserApi.getUinByUidV2(r.memberUid) : 0, i ? +await this.core.apis.UserApi.getUinByUidV2(i) : 0, r.decreaseType === 131 ? "invite" : "approve" ); } else if (n.contentHead.type === 34 && n.body?.msgContent) { const r = new he(p4).decode(n.body.msgContent); let i; if (r.operatorInfo) if (r.decreaseType === 3 || Buffer.from(r.operatorInfo).toString("hex").startsWith("0a")) try { i = new he(Cz).decode(r.operatorInfo).operator?.operatorUid; } catch { try { const s = new TextDecoder("utf-8").decode(r.operatorInfo); i = [...s].every((u) => u.charCodeAt(0) >= 32 && u.charCodeAt(0) <= 126) ? s : ""; } catch { i = ""; } } else try { const a = new TextDecoder("utf-8").decode(r.operatorInfo); i = [...a].every((c) => c.charCodeAt(0) >= 32 && c.charCodeAt(0) <= 126) ? a : ""; } catch { i = ""; } const o = await this.waitGroupNotify( r.groupUin.toString(), r.memberUid, i ); return r.memberUid === this.core.selfInfo.uid ? setTimeout(() => { this.core.apis.GroupApi.groupMemberCache.delete(r.groupUin.toString()); }, 5e3) : await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0), new lbe( this.core, r.groupUin, r.memberUid ? +await this.core.apis.UserApi.getUinByUidV2(r.memberUid) : 0, o ? +await this.core.apis.UserApi.getUinByUidV2(o) : 0, this.groupChangDecreseType2String(r.decreaseType) ); } else if (n.contentHead.type === 44 && n.body?.msgContent) { const r = new he(pbe).decode(n.body.msgContent); await this.core.apis.GroupApi.refreshGroupMemberCache(r.groupUin.toString(), !0); let i = !1, o = ""; return r.body.extraEnable != null ? (o = r.body.extraEnable.adminUid, i = !0) : r.body.extraDisable != null && (o = r.body.extraDisable.adminUid, i = !1), new fbe( this.core, r.groupUin, +await this.core.apis.UserApi.getUinByUidV2(o), i ? "set" : "unset" ); } else if (n.contentHead.type === 87 && n.body?.msgContent) { const r = new he(Fz).decode(n.body.msgContent); let i = ""; try { await this.core.eventWrapper.registerListen("NodeIKernelMsgListener/onRecvMsg", (o) => { for (const a of o) if (a.senderUid === r.invitorUid && a.msgType === 11) { const s = JSON.parse(a.elements.find((f) => f.elementType === 10)?.arkElement?.bytesData ?? "").meta?.news?.jumpUrl, c = new URLSearchParams(s), u = c.get("groupcode"), d = c.get("receiveruin"); if (i = c.get("msgseq") ?? "", u === r.groupUin.toString() && d === this.core.selfInfo.uin) return !0; } return !1; }, 1, 1e3); } catch { i = ""; } return i === "" ? void 0 : (this.notifyGroupInvite.put(i, { seq: i, type: 1, group: { groupCode: r.groupUin.toString(), groupName: "" }, user1: { uid: r.invitorUid, nickName: "" }, user2: { uid: this.core.selfInfo.uid, nickName: "" }, actionUser: { uid: r.invitorUid, nickName: "" }, actionTime: Date.now().toString(), postscript: "", repeatSeqs: [], warningTips: "", invitationExt: { srcType: 1, groupCode: r.groupUin.toString(), waitStatus: 1 }, status: 1 }), new $m( this.core, +r.groupUin, +await this.core.apis.UserApi.getUinByUidV2(r.invitorUid), "invite", "", i )); } else { if (n.contentHead.type === 528 && n.contentHead.subType === 39 && n.body?.msgContent) return await this.obContext.apis.UserApi.parseLikeEvent(n.body?.msgContent); if (n.contentHead.type === 166 && n.contentHead.c2CCmd === 133 && n.body?.msgContent) { this.core.context.logger.logDebug("在线文件通道断开"); const r = n.body.msgContent[15], i = n.body.msgContent[17]; if (r === 101) { if (i === 225) return this.core.context.logger.log(`好友:${n.responseHead.fromUin}取消了在线文件的传输(或转离线)`), new iD( this.core, +n.responseHead.fromUin ); if (i === 230) return this.core.context.logger.log(`好友:${n.responseHead.fromUin}拒绝了你的在线文件传输`), new tS( this.core, +n.responseHead.fromUin, "refuse" ); } else if (r === 136) { if (i === 225) return this.core.context.logger.log(`好友:${n.responseHead.fromUin}取消了在线文件夹的传输(或转离线)`), new iD( this.core, +n.responseHead.fromUin ); if (i === 230) return this.core.context.logger.log(`好友:${n.responseHead.fromUin}拒绝了你的在线文件夹传输`), new tS( this.core, +n.responseHead.fromUin, "refuse" ); } this.core.context.logger.logDebug("未知的系统消息事件:", r, i); return; } else if (n.contentHead.type === 166 && n.contentHead.c2CCmd === 131 && n.body?.msgContent) { const r = n.body.msgContent[15]; return r === 101 ? this.core.context.logger.log("在线文件传输成功!") : r === 136 && this.core.context.logger.log("在线文件夹传输成功!"), new tS( this.core, +n.responseHead.fromUin, "receive" ); } } } } const wbe = { reconnectBaseMs: 5e3, reconnectCeilingMs: 3e5, sendJitterMinMs: 600, sendJitterMaxMs: 2400, nightJitterMultiplier: 1.8, hourlySendBudget: 120, burstBreakThreshold: 8, burstCooldownMs: 9e4 }; class Sbe { cfg; core = null; // 账号线状态 hourStamp = 0; hourCount = 0; burstCount = 0; burstUntil = 0; lastSendAt = 0; // 连接线状态 reconnectAttempt = 0; online = !0; constructor(e = {}) { this.cfg = { ...wbe, ...e }; } attach(e) { this.core = e; } get config() { return this.cfg; } // ─────────────── 连接线 ─────────────── /** 掉线时调用:登记并算下一次重连等待(指数退避)。 */ markOffline() { return this.online = !1, this.reconnectAttempt += 1, Math.min( this.cfg.reconnectBaseMs * 2 ** Math.min(this.reconnectAttempt, 6), this.cfg.reconnectCeilingMs ); } /** 重连成功时调用:归零退避。 */ markOnline() { this.online = !0, this.reconnectAttempt = 0; } get isOnline() { return this.online; } // ─────────────── 发言线 + 账号线 ─────────────── /** * 主动发言前调用:返回本次应等待的毫秒数(0=立即)。 * 组合三层:账号预算 → 熔断冷却 → 真人抖动(深夜加倍)。 */ async beforeSend() { const e = Date.now(), n = Math.floor(e / 36e5); if (this.hourStamp !== n && (this.hourStamp = n, this.hourCount = 0), this.cfg.hourlySendBudget > 0 && this.hourCount >= this.cfg.hourlySendBudget) return (n + 1) * 36e5 - e + Math.floor(Math.random() * 6e4); if (e < this.burstUntil) return this.burstUntil - e; const r = [0, 1, 2, 3, 4, 5, 6, 7], i = (/* @__PURE__ */ new Date()).getHours(), o = r.includes(i) ? this.cfg.nightJitterMultiplier : 1; let a = this.cfg.sendJitterMinMs + Math.random() * (this.cfg.sendJitterMaxMs - this.cfg.sendJitterMinMs); if (a *= o, e - this.lastSendAt < 2e3) { if (this.burstCount += 1, this.burstCount >= this.cfg.burstBreakThreshold) return this.burstUntil = e + this.cfg.burstCooldownMs, this.burstCount = 0, this.core?.context.logger.logWarn( `[SnowCat] 连发 ${this.cfg.burstBreakThreshold} 条触发熔断,冷却 ${this.cfg.burstCooldownMs / 1e3}s` ), this.cfg.burstCooldownMs; } else this.burstCount = 0; return this.hourCount += 1, this.lastSendAt = e, Math.floor(a); } /** 便捷等待:beforeSend + sleep。 */ async stableDelay() { const e = await this.beforeSend(); e > 0 && await new Promise((n) => setTimeout(n, e)); } } const y3 = new Sbe(), dl = { GetMsg: { payload: { message_id: 123456 }, response: { time: 171e7, message_type: "group", message_id: 123456, real_id: 123456, sender: { user_id: 123456789, nickname: "昵称" }, message: "hello" } }, FetchPttText: { payload: { message_id: 123456 }, response: { text: "hello" } }, SendMsg: { payload: { message_type: "group", group_id: "123456", message: "hello" }, response: { message_id: 123456 } } }, _be = l.Object({ message_type: l.Optional(l.Union([l.Literal("private"), l.Literal("group")], { description: "消息类型 (private/group)" })), user_id: l.Optional(l.String({ description: "用户QQ" })), group_id: l.Optional(l.String({ description: "群号" })), message: t0, auto_escape: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否作为纯文本发送" })), // 以下为扩展字段 source: l.Optional(l.String({ description: "合并转发来源" })), news: l.Optional(l.Array(l.Object({ text: l.String() }), { description: "合并转发新闻" })), summary: l.Optional(l.String({ description: "合并转发摘要" })), prompt: l.Optional(l.String({ description: "合并转发提示" })), timeout: l.Optional(l.Number({ description: "自定义发送超时(毫秒),覆盖自动计算值" })) }), Ebe = l.Object({ message_id: l.Number({ description: "消息ID" }), res_id: l.Optional(l.String({ description: "转发消息的 res_id" })), forward_id: l.Optional(l.String({ description: "转发消息的 forward_id" })) }); var Ns = /* @__PURE__ */ ((t) => (t[t.Normal = 0] = "Normal", t[t.Private = 1] = "Private", t[t.Group = 2] = "Group", t))(Ns || {}); function uc(t, e = !1) { return typeof t == "string" ? e ? [{ type: Ke.text, data: { text: t } }] : obe(t) : Array.isArray(t) ? t : [t]; } async function b3(t, e, n = 0) { if (!e) throw new Error("请传递请求内容"); if ((n === 2 || n === 0) && e.group_id) return { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }; if ((n === 1 || n === 0) && e.user_id) { const r = await t.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!r) { if (e.group_id) return { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString(), guildId: "" }; throw new Error("无法获取用户信息"); } return await t.apis.FriendApi.isBuddy(r) ? { chatType: ke.KCHATTYPEC2C, peerUid: r, guildId: "" } : e.group_id ? { chatType: ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: r, guildId: e.group_id.toString() } : (await t.apis.MsgApi.getTempChatInfo(ke.KCHATTYPETEMPC2CFROMGROUP, r)).tmpChatInfo?.groupCode ? { chatType: ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: r, guildId: "" } : { chatType: ke.KCHATTYPEC2C, peerUid: r, guildId: "" }; } throw n === 1 && e.group_id ? new Error("当前私聊发送,请指定 user_id 而不是 group_id") : n === 2 && e.user_id ? new Error("当前群聊发送,请指定 group_id 而不是 user_id") : new Error("请指定正确的 group_id 或 user_id"); } function Abe(t, e) { return t.filter((n) => n.type === e).length; } function nS(t) { return t.type === Ke.node; } class ty extends ie { payloadSchema = _be; returnSchema = Ebe; actionTags = ["消息接口"]; async check(e) { const n = uc(e.message), r = Abe(n, Ke.node); return r > 0 && r !== n.length ? { valid: !1, message: "转发消息不能和普通消息混在一起发送,转发需要保证message只有type为node的元素" } : { valid: !0 }; } async _handle(e) { return await y3.stableDelay(), this.base_handle(e); } async base_handle(e, n = 0) { e.message_type === "group" && (n = 2), e.message_type === "private" && (n = 1); const r = await b3(this.core, { message_type: e.message_type, user_id: e.user_id?.toString(), group_id: e.group_id?.toString() }, n), i = uc( e.message, typeof e.auto_escape == "string" ? e.auto_escape === "true" : !!e.auto_escape ), o = i.filter(nS); if (o.length > 0) { const u = this.core.apis.PacketApi.packetStatus; let d; try { d = u ? await this.handleForwardedNodesPacket(r, o, e.source, e.news, e.summary, e.prompt) : await this.handleForwardedNodes(r, o); } catch (p) { throw Error(u ? `发送伪造合并转发消息失败: ${p?.stack}` : `发送合并转发消息失败: ${p?.stack}`); } if (!d) throw Error("发送合并转发消息失败:returnMsgAndResId 为空!"); if (d.message) { const p = ot.createUniqueMsgId({ guildId: "", peerUid: r.peerUid, chatType: r.chatType }, d.message.msgId), f = d.res_id; return { message_id: p, res_id: f, forward_id: f }; } else if (d.res_id && !d.message) throw Error(`发送转发消息(res_id:${d.res_id} 失败`); } const { sendElements: a, deleteAfterSentFiles: s } = await this.obContext.apis.MsgApi.createSendElements(i, r); return { message_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(r, a, s, e.timeout)).id }; } async uploadForwardedNodesPacket(e, n, r, i, o, a, s, c = 0) { const u = [], d = [], p = []; for (const x of n) { if (c >= 3) { this.core.context.logger.logWarn("转发消息深度超过3层,将停止解析!"); break; } if (x.data.id) if (x.data.id) { const g = x.data.id, b = ot.getMsgIdAndPeerByShortId(+g) || ot.getPeerByMsgId(g); if (!b) { this.core.context.logger.logError("转发消息失败,未找到消息", g); continue; } const S = (await this.core.apis.MsgApi.getMsgsByMsgId(b.Peer, [b.MsgId])).msgList[0]; if (this.core.context.logger.logDebug(`handleForwardedNodesPacket[PureRaw] 开始转换 ${td(S)}`), S) { const E = await this.core.apis.FileApi.downloadRawMsgMedia([S]); d.push(...E); const T = this.core.apis.PacketApi.pkt.msgConverter.rawMsgToPacketMsg(S, e); for (const U of S.elements) { let q, Y; if (U.multiForwardMsgElement?.resId) q = U.multiForwardMsgElement.resId, Y = U.multiForwardMsgElement.fileName; else if (U.arkElement?.bytesData) try { const H = JSON.parse(U.arkElement.bytesData); H.app === "com.tencent.multimsg" && (q = H.meta?.detail?.resid, Y = H.meta?.detail?.uniseq || H.extra?.filename); } catch { } if (q && Y) try { const H = await this.core.apis.PacketApi.pkt.operation.FetchForwardMsgRaw(q); for (const G of H) G.actionCommand === "MultiMsg" ? p.push({ uuid: Y, actionMsgBody: G.actionData.msgBody }) : p.push({ uuid: G.actionCommand, actionMsgBody: G.actionData.msgBody }); } catch (H) { this.core.context.logger.logError(`获取合并转发内层消息失败: ${H?.stack}`); } } this.core.context.logger.logDebug(`handleForwardedNodesPacket[PureRaw] 转换为 ${td(T)}`), u.push(T); } } else this.core.context.logger.logDebug(`handleForwardedNodesPacket 跳过元素 ${td(x)}`); else { const g = uc(x.type === Ke.node ? x.data.content : x); let b; const S = g.filter(nS); if (S.length > 0) { const U = await this.uploadForwardedNodesPacket(e, S, x.data.source, x.data.news, x.data.summary, x.data.prompt, { user_id: (x.data.user_id ?? x.data.uin)?.toString() ?? s?.user_id ?? this.core.selfInfo.uin, nickname: (x.data.nickname || x.data.name) ?? s?.nickname ?? "QQ用户" }, c + 1); b = U?.finallySendElements ? [U.finallySendElements] : [], d.push(...U?.deleteAfterSentFiles || []), U?.uuid && (p.push({ uuid: U.uuid, packetMsg: U.packetMsg }), U.innerPacketMsg?.forEach((q) => { p.push(q); })); } else { const U = await this.obContext.apis.MsgApi.createSendElements( g, e, [], { usePacketVideoMetadata: !0 } ); b = U.sendElements, d.push(...U.deleteAfterSentFiles); } const E = { senderUin: Number(x.data.user_id ?? x.data.uin ?? s?.user_id) || +this.core.selfInfo.uin, senderName: (x.data.nickname || x.data.name) ?? s?.nickname ?? "QQ用户", groupId: e.chatType === ke.KCHATTYPEGROUP ? +e.peerUid : 0, time: Number(x.data.time) || Date.now(), msg: b }; this.core.context.logger.logDebug(`handleForwardedNodesPacket[SendRaw] 开始转换 ${td(E)}`); const T = this.core.apis.PacketApi.pkt.msgConverter.rawMsgWithSendMsgToPacketMsg(E); this.core.context.logger.logDebug(`handleForwardedNodesPacket[SendRaw] 转换为 ${td(T)}`), u.push(T); } } if (u.length === 0) return this.core.context.logger.logWarn("handleForwardedNodesPacket 元素为空!"), null; const f = [{ actionCommand: "MultiMsg", actionMsg: u }]; p.forEach(({ uuid: x, packetMsg: g, actionMsgBody: b }) => { f.push({ actionCommand: x, actionMsg: g, actionMsgBody: b }); }); const m = await this.core.apis.PacketApi.pkt.operation.UploadForwardMsgV2(f, e.chatType === ke.KCHATTYPEGROUP ? +e.peerUid : 0), h = crypto.randomUUID(), y = aE.fromPacketMsg(m, u, r, i, o, a, h); return { deleteAfterSentFiles: d, finallySendElements: { elementType: Ee.ARK, elementId: "", arkElement: { bytesData: JSON.stringify(y) } }, res_id: m, uuid: h, packetMsg: u, innerPacketMsg: p }; } async handleForwardedNodesPacket(e, n, r, i, o, a) { const s = await this.uploadForwardedNodesPacket(e, n, r, i, o, a), c = s?.res_id, u = s?.finallySendElements; if (!u) throw Error("转发消息失败,生成节点为空"); return { message: await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(e, [u], s.deleteAfterSentFiles || []).catch(() => { }) ?? null, res_id: c }; } async handleForwardedNodes(e, n) { const r = { chatType: ke.KCHATTYPEC2C, peerUid: this.core.selfInfo.uid }; let i = []; for (const u of n) { const d = u.data.id; if (d) { const p = ot.getMsgIdAndPeerByShortId(parseInt(d)) || ot.getPeerByMsgId(d); if (!p) { this.core.context.logger.logError("转发消息失败,未找到消息", d); continue; } i.push(p.MsgId); } else try { const p = uc(u.data.content), f = p.filter(nS); if (f.length !== 0) { if (f.length !== p.length) { this.core.context.logger.logError("子消息中包含非node消息 跳过不合法部分"); continue; } const b = await this.handleForwardedNodes(r, f); b && (i.push(b.message.msgId), ot.createUniqueMsgId(r, b.message.msgId)); continue; } const { sendElements: m } = await this.obContext.apis.MsgApi.createSendElements(p, e), h = m.filter( (b) => b.elementType !== Ee.FILE && b.elementType !== Ee.VIDEO && b.elementType !== Ee.ARK && b.elementType !== Ee.PTT ), y = m.filter( (b) => b.elementType === Ee.FILE || b.elementType === Ee.VIDEO || b.elementType === Ee.ARK || b.elementType === Ee.PTT ).map((b) => [b]), x = [h, ...y].filter((b) => b !== void 0 && b.length !== 0), g = []; for (const b of x) g.push(this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(r, b, []).catch(() => { })); (await Promise.allSettled(g)).map((b) => (b.status === "fulfilled" && b.value && (i.push(b.value.msgId), ot.createUniqueMsgId(r, b.value.msgId)), b)); } catch (p) { this.core.context.logger.logDebug("生成转发消息节点失败", p.stack); } } const o = []; let a, s = !1; for (const u of i) { const d = ot.getPeerByMsgId(u); if (!d) { this.core.context.logger.logError("转发消息失败,未找到消息", u); continue; } const p = (await this.core.apis.MsgApi.getMsgsByMsgId(d.Peer, [u])).msgList[0]; p && (a = a ?? { chatType: p.chatType, peerUid: p.peerUid }, a.peerUid !== p.peerUid && (s = !0), o.push(p)); } i = o.map((u) => u.msgId); let c = []; if (s) for (const [, u] of o.entries()) { if (u.peerUid === this.core.selfInfo.uid) { c.push(u.msgId); continue; } const d = await this.cloneMsg(u); d && c.push(d.msgId); } else c = i; if (c.length === 0) throw Error("转发消息失败,生成节点为空"); try { return this.core.context.logger.logDebug("开发转发", a, e, c), { message: await this.core.apis.MsgApi.multiForwardMsg(a, e, c) }; } catch (u) { return this.core.context.logger.logError("forward failed", u?.stack), { message: null }; } } async cloneMsg(e) { const n = { chatType: ke.KCHATTYPEC2C, peerUid: this.core.selfInfo.uid }, r = []; for (const i of e.elements) r.push(i); r.length === 0 && this.core.context.logger.logDebug("需要clone的消息无法解析,将会忽略掉", e); try { return await this.core.apis.MsgApi.sendMsg(n, r); } catch (i) { this.core.context.logger.logError(i?.stack, "克隆转发消息失败,将忽略本条消息", e); return; } } } class Ibe extends ty { actionName = re.SendMsg; actionSummary = "发送消息"; actionDescription = "发送私聊或群聊消息"; actionTags = ["消息接口"]; payloadExample = dl.SendMsg.payload; returnExample = dl.SendMsg.response; } class Cbe { obContext; core; constructor(e, n) { this.obContext = e, this.core = n; } async handleQuickOperation(e, n) { if (e.post_type === "message" && await this.handleMsg(e, n).catch((r) => this.core.context.logger.logError(r)), e.post_type === "request") { const r = e, i = e; r.request_type === "friend" ? await this.handleFriendRequest(r, n).catch((o) => this.core.context.logger.logError(o)) : i.request_type === "group" && await this.handleGroupRequest(i, n).catch((o) => this.core.context.logger.logError(o)); } } async handleMsg(e, n) { const r = n.reply, i = e.message_type === "private" ? Ns.Private : Ns.Group, o = await b3(this.core, { group_id: e.group_id?.toString(), user_id: e.user_id?.toString() }, i); if (r) { let a = []; e.message_type === "group" && (a.push({ type: "reply", data: { id: e.message_id.toString() } }), n.at_sender && a.push({ type: "at", data: { qq: e.user_id.toString() } })), a = a.concat(uc(r, n.auto_escape)); const { sendElements: s, deleteAfterSentFiles: c } = await this.obContext.apis.MsgApi.createSendElements(a, o); this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(o, s, c).then().catch((u) => this.core.context.logger.logError(u)); } } async findNotify(e) { let n = (await this.core.apis.GroupApi.getSingleScreenNotifies(!1, 100)).find((r) => r.seq === e); return n ? { doubt: !1, notify: n } : (n = (await this.core.apis.GroupApi.getSingleScreenNotifies(!0, 100)).find((r) => r.seq === e), { doubt: !0, notify: n }); } async handleGroupRequest(e, n) { const r = this.obContext.apis.MsgApi.notifyGroupInvite.get(e.flag), { doubt: i, notify: o } = r ? { doubt: !1, notify: r } : await this.findNotify(e.flag); !FI(n.approve) && o && this.core.apis.GroupApi.handleGroupRequest( i, o, n.approve ? yp.KAGREE : yp.KREFUSE, n.reason ).catch((a) => this.core.context.logger.logError(a)); } async handleFriendRequest(e, n) { const r = (await this.core.apis.FriendApi.getBuddyReq()).buddyReqs.find((i) => i.reqTime === e.flag.toString()); !FI(n.approve) && r && this.core.apis.FriendApi.handleFriendRequest(r, !!n.approve).then().catch((i) => this.core.context.logger.logError(i)); } } async function Tbe(t, e) { const n = await Lt.stat(t), r = Math.max(1, Math.floor(n.size / 1024 / 3)); return e.log("通过文件大小估算语音的时长:", r), r; } async function kbe(t, e, n) { try { const r = xe.join(e, Xo()); if (await uo.isSilk(t)) { let i = 0; try { i = await uo.getDuration(t); } catch (o) { n.log("获取语音文件时长失败, 使用文件大小推测时长", t, o.stack), i = await Tbe(t, n); } return { converted: !1, path: t, duration: i }; } else { n.log(`语音文件${t}需要转换成silk`), await uo.convertToNTSilkTct(t, r); const i = await uo.getDuration(t); return n.log(`语音文件${t}转换成功!`, r, "时长:", i), { converted: !0, path: r, duration: i }; } } catch (r) { return n.logError("convert silk failed", r), {}; } } async function Nbe(t) { const e = (await Jp(t))?.ext ?? "jpg"; return { // 'webp': PicType.NEWPIC_WEBP, gif: gp.NEWPIC_GIF // 'png': PicType.NEWPIC_APNG, // 'jpg': PicType.NEWPIC_JPEG, // 'jpeg': PicType.NEWPIC_JPEG, // 'bmp': PicType.NEWPIC_BMP, }[e] ?? gp.NEWPIC_JPEG; } const Pbe = { afs: Fr.VIDEO_FORMAT_AFS, avi: Fr.VIDEO_FORMAT_AVI, mkv: Fr.VIDEO_FORMAT_MKV, mod: Fr.VIDEO_FORMAT_MOD, mov: Fr.VIDEO_FORMAT_MOV, mp4: Fr.VIDEO_FORMAT_MP4, mts: Fr.VIDEO_FORMAT_MTS, rm: Fr.VIDEO_FORMAT_RM, rmvb: Fr.VIDEO_FORMAT_RMVB, ts: Fr.VIDEO_FORMAT_TS, wmv: Fr.VIDEO_FORMAT_WMV }; class Dbe { obContext; core; constructor(e, n) { this.obContext = e, this.core = n; } async createValidSendFileElement(e, n, r = "", i = "", o = !1, a = !1) { const { fileName: s, path: c, fileSize: u } = await this.core.apis.FileApi.uploadFile(n, Ee.FILE, 0, o); if (u === 0) throw new Error("文件异常,大小为0"); return o && e.deleteAfterSentFiles.push(c), { elementType: Ee.FILE, elementId: "", fileElement: { fileName: r || s, folderId: i, filePath: c, fileSize: u.toString() } }; } async createValidSendPicElement(e, n, r = "", i = 0, o = !1) { const { md5: a, fileName: s, path: c, fileSize: u } = await this.core.apis.FileApi.uploadFile(n, Ee.PIC, i); if (u === 0) throw new Error("文件异常,大小为0"); const d = await v0(n); return e.deleteAfterSentFiles.push(c), { elementType: Ee.PIC, elementId: "", picElement: { md5HexStr: a, fileSize: u.toString(), picWidth: d.width, picHeight: d.height, fileName: s, sourcePath: c, original: !0, picType: await Nbe(n), picSubType: i, fileUuid: "", fileSubId: "", thumbFileSize: 0, summary: r } }; } async createValidSendVideoElement(e, n, r = "", i = "", o = !1) { let a = { width: 1920, height: 1080, time: 15, format: "mp4", size: 0, filePath: n }, s = "mp4"; try { const U = (await Jp(n))?.ext; U && (s = U); } catch (U) { this.core.context.logger.logError("获取文件类型失败", U); } if (xe.extname(n).slice(1).toLowerCase() !== s.toLowerCase()) if (o) { const U = xe.join(this.core.SnowCatTempPath, `${Xo()}.${s}`); fe.copyFileSync(n, U), e.deleteAfterSentFiles.push(U), n = U; } else { const U = `${n}.${s}`; fe.copyFileSync(n, U), e.deleteAfterSentFiles.push(U), n = U; } const { fileName: d, path: p, fileSize: f, md5: m } = await this.core.apis.FileApi.uploadFile(n, Ee.VIDEO); if (e.deleteAfterSentFiles.push(p), f === 0) throw new Error("文件异常,大小为0"); const h = p.replace(`${xe.sep}Ori${xe.sep}`, `${xe.sep}Thumb${xe.sep}`); fe.mkdirSync(xe.dirname(h), { recursive: !0 }); const y = e.usePacketVideoMetadata === !0, x = y ? "jpg" : "png", g = xe.join(xe.dirname(h), `${m}_0.${x}`); try { if (y ? a = await uo.getVideoInfo(n, g) : (a = await uo.getVideoInfo(n, ""), await uo.extractLegacyVideoThumbnail(n, g)), !fe.existsSync(g)) throw this.core.context.logger.logError("获取视频缩略图失败", new Error("缩略图不存在")), new Error("获取视频缩略图失败"); } catch (U) { this.core.context.logger.logError("获取视频信息失败", U), fe.writeFileSync(g, Buffer.from(YF, "base64")); } if (i) try { await this.core.apis.FileApi.copyFile(i, g); } catch (U) { this.core.context.logger.logError("复制自定义缩略图失败", U); } e.deleteAfterSentFiles.push(g); const b = (await Lt.stat(g)).size, S = await h0(g), E = (r || d).toLocaleLowerCase().endsWith(`.${s.toLocaleLowerCase()}`) ? r || d : `${r || d}.${s}`, T = y ? { fileTime: Math.max(0, Math.round(a.time)), fileFormat: Pbe[s.toLowerCase()] ?? Fr.VIDEO_FORMAT_MP4, fileWidth: a.width, fileHeight: a.height } : { fileTime: a.time }; return { elementType: Ee.VIDEO, elementId: "", videoElement: { fileName: E, filePath: p, videoMd5: m, thumbMd5: S, ...T, thumbPath: /* @__PURE__ */ new Map([[0, g]]), thumbSize: b, thumbWidth: a.width, thumbHeight: a.height, fileSize: f.toString() } }; } async createValidSendPttElement(e, n) { const { converted: r, path: i, duration: o } = await kbe(n, this.core.SnowCatTempPath, this.core.context.logger); if (!i) throw new Error("语音转换失败, 请检查语音文件是否正常"); const { md5: a, fileName: s, path: c, fileSize: u } = await this.core.apis.FileApi.uploadFile(i, Ee.PTT); if (u === 0) throw new Error("文件异常,大小为0"); return r && Lt.unlink(i).then().catch((d) => this.core.context.logger.logError("删除临时文件失败", d)), { elementType: Ee.PTT, elementId: "", pttElement: { fileName: s, filePath: c, md5HexStr: a, fileSize: u.toString(), duration: o ?? 1, formatType: 1, voiceType: 1, voiceChangeType: 0, canConvert2Text: !0, waveAmplitudes: [ 0, 18, 9, 23, 16, 17, 16, 15, 44, 17, 24, 20, 14, 15, 17 ], fileSubId: "", playState: 1, autoConvertText: 0, storeID: 0, otherBusinessInfo: { aiVoiceType: 0 } } }; } } const Obe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }) }), Fbe = l.Object({ time: l.Number({ description: "发送时间" }), message_type: l.String({ description: "消息类型" }), message_id: l.Number({ description: "消息ID" }), real_id: l.Number({ description: "真实ID" }), message_seq: l.Number({ description: "消息序号" }), sender: l.Any({ description: "发送者" }), message: l.Any({ description: "消息内容" }), raw_message: l.String({ description: "原始消息内容" }), font: l.Number({ description: "字体" }), group_id: l.Optional(l.Union([l.Number(), l.String()], { description: "群号" })), user_id: l.Union([l.Number(), l.String()], { description: "发送者QQ号" }), emoji_likes_list: l.Optional(l.Array(l.Any(), { description: "表情回应列表" })) }, { description: "OneBot 11 消息" }); class Mbe extends ie { actionName = re.GetMsg; payloadSchema = Obe; returnSchema = Fbe; actionSummary = "获取消息"; actionDescription = "根据消息 ID 获取消息详细信息"; actionTags = ["消息接口"]; payloadExample = dl.GetMsg.payload; returnExample = dl.GetMsg.response; async _handle(e, n, r) { if (!e.message_id) throw Error("参数message_id不能为空"); const i = ot.getShortIdByMsgId(e.message_id.toString()), o = ot.getMsgIdAndPeerByShortId(i ?? +e.message_id); if (!o) throw new Error("消息不存在"); const a = { guildId: "", peerUid: o?.Peer.peerUid, chatType: o.Peer.chatType }, s = this.obContext.configLoader.configData.timeout.baseTimeout, u = (await bs( this.core.apis.MsgApi.getMsgsByMsgId(a, [o?.MsgId || e.message_id.toString()]), s ).catch((p) => { throw p instanceof Error && p.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${p.message || String(p)}`) : p; })).msgList[0]; if (!u) throw Error("消息不存在或已被撤回"); const d = await this.obContext.apis.MsgApi.parseMessage(u, r.messagePostFormat ?? "array"); if (!d) throw Error("消息为空"); d.emoji_likes_list = [], u.emojiLikesList?.forEach((p) => { d.emoji_likes_list?.push({ emoji_id: p.emojiId, emoji_type: p.emojiType, likes_cnt: p.likesCnt }); }); try { d.message_id = ot.createUniqueMsgId(a, u.msgId), d.message_seq = d.message_id, d.real_id = d.message_id; } catch { } return d; } } const v3 = l.Object({ birthday_year: l.Optional(l.Number({ description: "出生年份" })), birthday_month: l.Optional(l.Number({ description: "出生月份" })), birthday_day: l.Optional(l.Number({ description: "出生日期" })), phone_num: l.Optional(l.String({ description: "手机号" })), email: l.Optional(l.String({ description: "邮箱" })), category_id: l.Optional(l.Number({ description: "分组ID" })), user_id: l.Number({ description: "QQ号" }), nickname: l.String({ description: "昵称" }), remark: l.Optional(l.String({ description: "备注" })), sex: l.Optional(l.String({ description: "性别" })), level: l.Optional(l.Number({ description: "等级" })), age: l.Optional(l.Number({ description: "年龄" })), qid: l.Optional(l.String({ description: "QID" })), login_days: l.Optional(l.Number({ description: "登录天数" })), categoryName: l.Optional(l.String({ description: "分组名称" })), categoryId: l.Optional(l.Number({ description: "分组ID" })) }, { $id: "OB11User", description: "OneBot 11 用户信息" }), cL = l.Object({ group_all_shut: l.Number({ description: "是否全员禁言" }), group_remark: l.String({ description: "群备注" }), group_id: l.Number({ description: "群号" }), group_name: l.String({ description: "群名称" }), member_count: l.Optional(l.Number({ description: "成员人数" })), max_member_count: l.Optional(l.Number({ description: "最大成员人数" })) }, { $id: "OB11Group", description: "OneBot 11 群信息" }), Rbe = l.Object({ group_id: l.Number({ description: "群号" }), user_id: l.Number({ description: "QQ号" }), nickname: l.String({ description: "昵称" }), card: l.Optional(l.String({ description: "名片" })), sex: l.Optional(l.String({ description: "性别" })), age: l.Optional(l.Number({ description: "年龄" })), join_time: l.Optional(l.Number({ description: "入群时间戳" })), last_sent_time: l.Optional(l.Number({ description: "最后发言时间戳" })), level: l.Optional(l.String({ description: "等级" })), qq_level: l.Optional(l.Number({ description: "QQ等级" })), role: l.Optional(l.String({ description: "角色 (owner/admin/member)" })), title: l.Optional(l.String({ description: "头衔" })), area: l.Optional(l.String({ description: "地区" })), unfriendly: l.Optional(l.Boolean({ description: "是否不良记录" })), title_expire_time: l.Optional(l.Number({ description: "头衔过期时间" })), card_changeable: l.Optional(l.Boolean({ description: "是否允许修改名片" })), shut_up_timestamp: l.Optional(l.Number({ description: "禁言截止时间戳" })), is_robot: l.Optional(l.Boolean({ description: "是否为机器人" })), qage: l.Optional(l.Number({ description: "Q龄" })) }, { $id: "OB11GroupMember", description: "OneBot 11 群成员信息" }), rS = l.Object({ request_id: l.Number({ description: "请求ID" }), invitor_uin: l.Number({ description: "邀请者QQ" }), invitor_nick: l.String({ description: "邀请者昵称" }), group_id: l.Number({ description: "群号" }), group_name: l.String({ description: "群名称" }), message: l.String({ description: "附言" }), checked: l.Boolean({ description: "是否已处理" }), actor: l.Number({ description: "操作者QQ" }), requester_nick: l.String({ description: "申请者昵称" }) }, { $id: "OB11Notify", description: "OneBot 11 通知信息" }), Bbe = l.Object({ self_id: l.Number({ description: "发送者QQ号" }), user_id: l.Number({ description: "接收者QQ号" }), time: l.Number({ description: "时间戳" }), real_seq: l.String({ description: "消息序号" }), message_type: l.String({ description: "消息类型" }), sender: l.Object({ user_id: l.Number({ description: "用户QQ号" }), nickname: l.String({ description: "用户昵称" }), card: l.Optional(l.String({ description: "用户名片" })), role: l.Optional(l.String({ description: "用户角色" })) }), raw_message: l.String({ description: "原始消息" }), font: l.Number({ description: "字体大小" }), sub_type: l.String({ description: "子类型" }), message: l.Unknown({ description: "消息内容" }), message_format: l.String({ description: "消息格式" }), post_type: l.String({ description: "发布类型" }), group_id: l.Number({ description: "群号" }), group_name: l.String({ description: "群名称" }) }, { $id: "OB11LatestMessage", description: "最后一条消息" }); l.Intersect([ l.Omit(Bbe, []), l.Object({ message_id: l.Number({ description: "消息ID" }), message_seq: l.Number({ description: "消息序列号" }), emoji_likes_list: l.Array(l.Object({ emoji_id: l.String({ description: "表情符号ID" }), emoji_type: l.String({ description: "表情符号类型" }), likes_cnt: l.String({ description: "点赞数" }) })) }, { description: "OneBot 11 消息信息" }) ], { $id: "OB11ActionMessage", description: "OneBot 11 消息信息" }); const oD = { GetLoginInfo: { payload: {}, response: { user_id: 123456789, nickname: "机器人" } } }; class Ube extends ie { actionName = re.GetLoginInfo; payloadSchema = l.Object({}); returnSchema = v3; actionSummary = "获取登录号信息"; actionDescription = "获取当前登录帐号的信息"; actionTags = ["系统接口"]; payloadExample = oD.GetLoginInfo.payload; returnExample = oD.GetLoginInfo.response; async _handle() { return Hi.selfInfo(this.core.selfInfo); } } const aD = { GetFriendList: { payload: {}, response: [{ user_id: 123456789, nickname: "昵称", remark: "备注" }] } }, Lbe = l.Object({ no_cache: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否不使用缓存" })) }), Qbe = l.Array(v3, { description: "好友列表" }); class jbe extends ie { actionName = re.GetFriendList; payloadSchema = Lbe; returnSchema = Qbe; actionSummary = "获取好友列表"; actionDescription = "获取当前帐号的好友列表"; actionTags = ["用户接口"]; payloadExample = aD.GetFriendList.payload; returnExample = aD.GetFriendList.response; async _handle(e) { const n = await this.core.apis.FriendApi.getBuddyV2SimpleInfoMap(), r = typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache; return await Promise.all( Array.from(n.values()).map(async (i) => { try { const o = await this.core.apis.UserApi.getUserDetailInfo(i.coreInfo.uid, r), a = n.get(i.coreInfo.uid); a && (a.qqLevel = o.qqLevel); } catch (o) { this.core.context.logger.logError("获取好友详细信息失败", o); } }) ), Hi.friends(Array.from(n.values())); } } const at = { SetGroupMemberInvitePolicy: { payload: { group_id: "123456", policy: "require_approval" }, response: null }, SetGroupMemberPermissions: { payload: { group_id: "123456", allow_member_upload_album: !0, allow_member_temporary_session: !0, allow_member_create_group: !0 }, response: null }, SetGroupNewMemberHistoryVisibility: { payload: { group_id: "123456", visible: !0 }, response: null }, DelEssenceMsg: { payload: { message_id: 123456 }, response: null }, DelGroupNotice: { payload: { group_id: "123456", notice_id: "notice_123" }, response: null }, GetGroupDetailInfo: { payload: { group_id: "123456" }, response: { group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 } }, GetGroupEssence: { payload: { group_id: "123456" }, response: [{ message_id: 123456, sender_id: 123456, sender_nick: "昵称", operator_id: 123456, operator_nick: "昵称", operator_time: 171e7, content: "精华内容" }] }, GetGroupInfo: { payload: { group_id: "123456" }, response: { group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 } }, GetGroupList: { payload: {}, response: [{ group_id: 123456, group_name: "测试群", member_count: 100, max_member_count: 500 }] }, GetGroupMemberInfo: { payload: { group_id: "123456", user_id: "123456789" }, response: { group_id: 123456, user_id: 123456789, nickname: "昵称", card: "名片", role: "member" } }, GetGroupMemberList: { payload: { group_id: "123456" }, response: [{ group_id: 123456, user_id: 123456789, nickname: "昵称", card: "名片", role: "member" }] }, GetGroupNotice: { payload: { group_id: "123456" }, response: [{ notice_id: "notice_123", sender_id: 123456, publish_time: 171e7, message: { text: "公告内容", image: [] } }] }, SendGroupMsg: { payload: { group_id: "123456", message: "hello" }, response: { message_id: 123456 } }, SetEssenceMsg: { payload: { message_id: 123456 }, response: null }, SetGroupAddRequest: { payload: { flag: "flag_123", sub_type: "add", approve: !0 }, response: null }, SetGroupAdmin: { payload: { group_id: "123456", user_id: "123456789", enable: !0 }, response: null }, SetGroupBan: { payload: { group_id: "123456", user_id: "123456789", duration: 1800 }, response: null }, SetGroupCard: { payload: { group_id: "123456", user_id: "123456789", card: "新名片" }, response: null }, SetGroupKick: { payload: { group_id: "123456", user_id: "123456789", reject_add_request: !1 }, response: null }, SetGroupLeave: { payload: { group_id: "123456", is_dismiss: !1 }, response: null }, SetGroupName: { payload: { group_id: "123456", group_name: "新群名" }, response: null }, SetGroupWholeBan: { payload: { group_id: "123456", enable: !0 }, response: null } }, $be = l.Object({ no_cache: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否不使用缓存" })) }), Gbe = l.Array(cL, { description: "群列表" }); class qbe extends ie { actionName = re.GetGroupList; payloadSchema = $be; returnSchema = Gbe; actionSummary = "获取群列表"; actionDescription = "获取当前帐号的群聊列表"; actionTags = ["群组接口"]; payloadExample = at.GetGroupList.payload; returnExample = at.GetGroupList.response; async _handle(e) { return Hi.groups( await this.core.apis.GroupApi.getGroups( typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache ) ); } } const zbe = l.Object({ group_id: l.String({ description: "群号" }) }), Hbe = cL; class Wbe extends ie { actionName = re.GetGroupInfo; payloadSchema = zbe; returnSchema = Hbe; actionSummary = "获取群信息"; actionDescription = "获取群聊的基本信息"; actionTags = ["群组接口"]; payloadExample = at.GetGroupInfo.payload; returnExample = at.GetGroupInfo.response; async _handle(e) { const n = (await this.core.apis.GroupApi.getGroups()).find((r) => r.groupCode === e.group_id.toString()); if (!n) { const r = await this.core.apis.GroupApi.fetchGroupDetail(e.group_id.toString()); return r.ownerUid && r.ownerUin === "0" && (r.ownerUin = await this.core.apis.UserApi.getUinByUidV2(r.ownerUid)), { ...r, group_all_shut: r.shutUpAllTimestamp > 0 ? -1 : 0, group_remark: "", group_id: +e.group_id, group_name: r.groupName, member_count: r.memberNum, max_member_count: r.maxMemberNum }; } return Hi.group(n); } } const Kbe = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "QQ号" }), no_cache: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否不使用缓存" })) }), Vbe = Rbe; class Ybe extends ie { actionName = re.GetGroupMemberInfo; payloadSchema = Kbe; returnSchema = Vbe; actionSummary = "获取群成员信息"; actionDescription = "获取群聊中指定成员的信息"; actionTags = ["群组接口"]; payloadExample = at.GetGroupMemberInfo.payload; returnExample = at.GetGroupMemberInfo.response; parseBoolean(e) { return typeof e == "string" ? e === "true" : e; } async getUid(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.toString()); if (!n) throw new Error(`Uin2Uid Error: 用户ID ${e} 不存在`); return n; } async getGroupMemberInfo(e, n, r) { const o = this.core.apis.GroupApi.groupMemberCache.get(e.group_id.toString())?.get(n), [a, s] = await Promise.all([ this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), n, r), this.core.apis.UserApi.getUserDetailInfo(n, r) ]); if (!a || !o) throw new Error(`群(${e.group_id})成员${e.user_id}不存在`); return s ? { ...o, ...a, ...s } : a; } async _handle(e) { const n = this.parseBoolean(e.no_cache ?? !0), r = await this.getUid(e.user_id), i = await this.getGroupMemberInfo(e, r, n); return i || this.core.context.logger.logDebug("获取群成员详细信息失败, 只能返回基础信息"), Hi.groupMember(e.group_id.toString(), i); } } class Jbe extends ty { actionName = re.SendGroupMsg; actionSummary = "发送群消息"; actionDescription = "发送群消息"; actionTags = ["群组接口"]; payloadExample = at.SendGroupMsg.payload; returnExample = at.SendGroupMsg.response; async check(e) { return delete e.user_id, e.message_type = "group", super.check(e); } async _handle(e) { return await y3.stableDelay(), this.base_handle(e, Ns.Group); } } class Xbe extends ty { actionName = re.SendPrivateMsg; actionSummary = "发送私聊消息"; actionDescription = "发送私聊消息"; actionTags = ["消息接口"]; payloadExample = { user_id: "123456789", message: "hello" }; returnExample = { message_id: 123456 }; async check(e) { return e.message_type = "private", super.check(e); } async _handle(e) { return await y3.stableDelay(), this.base_handle(e, Ns.Private); } } const Zbe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }) }), eve = l.Null({ description: "操作结果" }); class tve extends ie { actionName = re.DeleteMsg; payloadSchema = Zbe; returnSchema = eve; actionSummary = "撤回消息"; actionDescription = "撤回已发送的消息"; actionTags = ["消息接口"]; payloadExample = { message_id: 12345 }; returnExample = null; async _handle(e) { const n = ot.getMsgIdAndPeerByShortId(Number(e.message_id)); if (n) return this.obContext.recallEventCache.set(n.MsgId, setTimeout(() => { this.obContext.recallEventCache.delete(n.MsgId); }, 5e3)), await this.core.apis.MsgApi.recallMsg(n.Peer, n.MsgId), null; throw new Error("Recall failed"); } } const nve = l.Object({ app_name: l.String({ description: "应用名称" }), protocol_version: l.String({ description: "协议版本" }), app_version: l.String({ description: "应用版本" }) }, { description: "版本信息" }); class rve extends ie { actionName = re.GetVersionInfo; returnSchema = nve; actionSummary = "获取版本信息"; actionDescription = "获取版本信息"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = { app_name: "SnowCat.Onebot", protocol_version: "v11", app_version: "1.0.0" }; async _handle() { return { app_name: "SnowCat.Onebot", protocol_version: "v11", app_version: gl }; } } const ive = l.Object({ yes: l.Boolean({ description: "是否可以发送" }) }); class uL extends ie { payloadSchema = l.Object({}); returnSchema = ive; actionTags = ["系统接口"]; async _handle() { return { yes: !0 }; } } class ove extends uL { actionName = re.CanSendRecord; actionSummary = "是否可以发送语音"; actionDescription = "检查是否可以发送语音"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = { yes: !0 }; } class ave extends uL { actionName = re.CanSendImage; actionSummary = "是否可以发送图片"; actionDescription = "检查是否可以发送图片"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = { yes: !0 }; } const sve = l.Object({ online: l.Boolean({ description: "是否在线" }), good: l.Boolean({ description: "状态是否良好" }), stat: l.Unknown({ description: "统计信息" }) }); class cve extends ie { actionName = re.GetStatus; payloadSchema = l.Object({}); returnSchema = sve; actionSummary = "获取运行状态"; actionDescription = "获取运行状态"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = { online: !0, good: !0, stat: {} }; async _handle() { return { online: !!this.core.selfInfo.online, good: !0, stat: {} }; } } class x3 extends ty { async check(e) { return e.messages && (e.message = uc(e.messages)), super.check(e); } } class uve extends x3 { actionName = re.GoCQHTTP_SendForwardMsg; actionSummary = "发送合并转发消息"; actionDescription = "发送合并转发消息"; actionTags = ["Go-CQHTTP"]; payloadExample = { group_id: "123456789", messages: [] }; returnExample = { message_id: 123456 }; async check(e) { return e.messages && (e.message = uc(e.messages)), super.check(e); } } class lve extends x3 { actionName = re.GoCQHTTP_SendPrivateForwardMsg; actionSummary = "发送私聊合并转发消息"; actionTags = ["Go-CQHTTP"]; payloadExample = { user_id: "123456789", messages: [] }; returnExample = { message_id: 123456 }; async _handle(e) { return this.base_handle(e, Ns.Private); } } class dve extends x3 { actionName = re.GoCQHTTP_SendGroupForwardMsg; actionSummary = "发送群合并转发消息"; actionTags = ["Go-CQHTTP"]; payloadExample = { group_id: "123456789", messages: [] }; returnExample = { message_id: 123456 }; async _handle(e) { return this.base_handle(e, Ns.Group); } } const rt = { GetStrangerInfo: { payload: { user_id: "123456789" }, response: { user_id: 123456789, nickname: "昵称", sex: "unknown" } }, GetGroupHonorInfo: { payload: { group_id: "123456", type: "all" }, response: { group_id: 123456, current_talkative: {}, talkative_list: [] } }, GetForwardMsg: { payload: { message_id: "123456" }, response: { messages: [] } }, GetGroupAtAllRemain: { payload: { group_id: "123456" }, response: { can_at_all: !0, remain_at_all_count_for_group: 10, remain_at_all_count_for_self: 10 } }, DeleteGroupFile: { payload: { group_id: "123456", file_id: "file_uuid_123" }, response: {} }, DeleteGroupFileFolder: { payload: { group_id: "123456", folder_id: "folder_uuid_123" }, response: {} }, DownloadFile: { payload: { url: "https://example.com/file.png", thread_count: 1, headers: "User-Agent: NapCat" }, response: { file: "/path/to/downloaded/file" } }, GetFriendMsgHistory: { payload: { user_id: "123456789", message_seq: 0, count: 20 }, response: { messages: [] } }, GetGroupFilesByFolder: { payload: { group_id: "123456", folder_id: "folder_id" }, response: { files: [], folders: [] } }, GetGroupFileSystemInfo: { payload: { group_id: "123456" }, response: { file_count: 10, limit_count: 1e4, used_space: 1024, total_space: 10737418240 } }, GetGroupMsgHistory: { payload: { group_id: "123456", message_seq: 0, count: 20 }, response: { messages: [] } }, GetGroupRootFiles: { payload: { group_id: "123456" }, response: { files: [], folders: [] } }, GetOnlineClient: { payload: { no_cache: !1 }, response: [] }, GoCQHTTPCheckUrlSafely: { payload: { url: "https://example.com" }, response: { level: 1 } }, GoCQHTTPDeleteFriend: { payload: { user_id: "123456789" }, response: {} }, GoCQHTTPGetModelShow: { payload: { model: "iPhone 13" }, response: { variants: [] } }, GoCQHTTPSetModelShow: { payload: { model: "iPhone 13", model_show: "iPhone 13" }, response: {} }, QuickAction: { payload: { context: {}, operation: {} }, response: {} }, SendGroupNotice: { payload: { group_id: "123456", content: "公告内容", image: "base64://..." }, response: {} }, SetGroupPortrait: { payload: { group_id: "123456", file: "base64://..." }, response: { result: 0, errMsg: "" } }, SetQQProfile: { payload: { nickname: "新昵称", personal_note: "个性签名" }, response: {} }, UploadGroupFile: { payload: { group_id: "123456", file: "/path/to/file", name: "test.txt" }, response: { file_id: "file_uuid_123" } }, UploadPrivateFile: { payload: { user_id: "123456789", file: "/path/to/file", name: "test.txt" }, response: { file_id: "file_uuid_123" } } }, pve = l.Object({ user_id: l.String({ description: "用户QQ" }), no_cache: l.Union([l.Boolean(), l.String()], { default: !1, description: "是否不使用缓存" }) }), fve = l.Object({ user_id: l.Number({ description: "用户QQ" }), uid: l.String({ description: "UID" }), nickname: l.String({ description: "昵称" }), age: l.Number({ description: "年龄" }), qid: l.String({ description: "QID" }), qqLevel: l.Number({ description: "QQ等级" }), sex: l.String({ description: "性别" }), long_nick: l.String({ description: "个性签名" }), reg_time: l.Number({ description: "注册时间" }), is_vip: l.Boolean({ description: "是否VIP" }), is_years_vip: l.Boolean({ description: "是否年费VIP" }), vip_level: l.Number({ description: "VIP等级" }), remark: l.String({ description: "备注" }), status: l.Number({ description: "状态" }), login_days: l.Number({ description: "登录天数" }) }, { description: "陌生人信息" }); class hve extends ie { actionName = re.GoCQHTTP_GetStrangerInfo; payloadSchema = pve; returnSchema = fve; actionSummary = "获取陌生人信息"; actionDescription = "获取指定非好友用户的信息"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetStrangerInfo.payload; returnExample = rt.GetStrangerInfo.response; async _handle(e) { const n = e.user_id.toString(), r = typeof e.no_cache == "string" ? e.no_cache === "true" : !!e.no_cache, i = await this.core.apis.UserApi.getUserDetailInfoByUin(n); let o = await this.core.apis.UserApi.getUidByUinV2(n); o || (o = i.detail.uid); const a = await this.core.apis.UserApi.getUserDetailInfo(o, r); return { ...i.detail.simpleInfo.coreInfo, ...i.detail.commonExt ?? {}, ...i.detail.simpleInfo.baseInfo, ...i.detail.simpleInfo.relationFlags ?? {}, ...i.detail.simpleInfo.status ?? {}, user_id: parseInt(i.detail.uin) ?? 0, uid: a.uid ?? o, nickname: i.detail.simpleInfo.coreInfo.nick ?? "", age: i.detail.simpleInfo.baseInfo.age ?? a.age, qid: i.detail.simpleInfo.baseInfo.qid, qqLevel: SS(i.detail.commonExt?.qqLevel ?? a.qqLevel), sex: Hi.sex(i.detail.simpleInfo.baseInfo.sex) ?? ss.unknown, long_nick: i.detail.simpleInfo.baseInfo.longNick ?? a.longNick, reg_time: i.detail.commonExt?.regTime ?? a.regTime, is_vip: i.detail.simpleInfo.vasInfo?.svipFlag ?? !1, is_years_vip: i.detail.simpleInfo.vasInfo?.yearVipFlag ?? !1, vip_level: i.detail.simpleInfo.vasInfo?.vipLevel ?? 0, remark: i.detail.simpleInfo.coreInfo.remark ?? a.remark ?? "", status: i.detail.simpleInfo.status?.status ?? a.status ?? 0, login_days: 0 // 失效 }; } } const mve = l.Object({ user_id: l.String({ description: "对方 QQ 号" }), times: l.Union([l.Number(), l.String()], { default: 1, description: "点赞次数" }) }); class gve extends ie { actionName = re.SendLike; payloadSchema = mve; returnSchema = l.Null(); actionSummary = "点赞"; actionDescription = "给指定用户点赞"; actionTags = ["用户接口"]; payloadExample = { user_id: "123456", times: 10 }; returnExample = {}; errorExamples = [ { code: 1400, description: "点赞失败(频率过快或用户不存在)" } ]; async _handle(e) { const n = e.user_id.toString(), r = await this.core.apis.UserApi.getUidByUinV2(n) ?? "", i = await this.core.apis.UserApi.like(r, +e.times); if (i.result !== 0) throw new Error(`点赞失败 ${i.errMsg}`); } } const yve = l.Object({ flag: l.String({ description: "请求flag" }), approve: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否同意" })), reason: l.Optional(l.Union([l.String({ default: " " }), l.Null()], { description: "拒绝理由" })), count: l.Optional(l.Number({ default: 100, description: "搜索通知数量" })) }), bve = l.Null({ description: "操作结果" }); class vve extends ie { actionName = re.SetGroupAddRequest; payloadSchema = yve; returnSchema = bve; actionSummary = "处理加群请求"; actionDescription = "同意或拒绝加群请求或邀请"; actionTags = ["群组接口"]; payloadExample = at.SetGroupAddRequest.payload; returnExample = at.SetGroupAddRequest.response; async _handle(e) { const n = e.flag.toString(), r = e.approve?.toString() !== "false", i = e.reason ?? " ", o = e.count, a = this.obContext.apis.MsgApi.notifyGroupInvite.get(n), { doubt: s, notify: c } = a ? { doubt: !1, notify: a } : await this.findNotify(n, o); if (!c) throw new Error("No such request"); return await this.core.apis.GroupApi.handleGroupRequest( s, c, r ? yp.KAGREE : yp.KREFUSE, i ), null; } async findNotify(e, n = 100) { let r = (await this.core.apis.GroupApi.getSingleScreenNotifies(!1, n)).find((i) => i.seq === e); return r ? { doubt: !1, notify: r } : (r = (await this.core.apis.GroupApi.getSingleScreenNotifies(!0, n)).find((i) => i.seq === e), { doubt: !0, notify: r }); } } const xve = l.Object({ group_id: l.String({ description: "群号" }), is_dismiss: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否解散" })) }), wve = l.Null({ description: "操作结果" }); class Sve extends ie { actionName = re.SetGroupLeave; payloadSchema = xve; returnSchema = wve; actionSummary = "退出群组"; actionDescription = "退出或解散指定群聊"; actionTags = ["群组接口"]; payloadExample = at.SetGroupLeave.payload; returnExample = at.SetGroupLeave.response; async _handle(e) { return await this.core.apis.GroupApi.quitGroup(e.group_id.toString()), null; } } const _ve = l.Object({ flag: l.String({ description: "加好友请求的 flag (需从上报中获取)" }), approve: l.Optional(l.Union([l.String(), l.Boolean()], { description: "是否同意请求" })), remark: l.Optional(l.String({ description: "添加后的好友备注" })) }); class Eve extends ie { actionName = re.SetFriendAddRequest; payloadSchema = _ve; returnSchema = l.Null(); actionSummary = "处理加好友请求"; actionDescription = "同意或拒绝加好友请求"; actionTags = ["用户接口"]; payloadExample = { flag: "flag_12345", approve: !0, remark: "新朋友" }; returnExample = {}; async _handle(e) { const n = e.approve?.toString() !== "false", r = (await this.core.apis.FriendApi.getBuddyReq()).buddyReqs.find((i) => i.reqTime === e.flag.toString()); if (!r) throw new Error("No such request"); await this.core.apis.FriendApi.handleFriendRequest(r, n), e.remark && await this.core.apis.FriendApi.setBuddyRemark(r.friendUid, e.remark); } } const Ave = l.Object({ group_id: l.String({ description: "群号" }), enable: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否开启全员禁言" })) }), Ive = l.Null({ description: "操作结果" }); class Cve extends ie { actionName = re.SetGroupWholeBan; payloadSchema = Ave; returnSchema = Ive; actionSummary = "全员禁言"; actionDescription = "开启或关闭指定群聊的全员禁言"; actionTags = ["群组接口"]; payloadExample = at.SetGroupWholeBan.payload; returnExample = at.SetGroupWholeBan.response; async _handle(e) { const n = e.enable?.toString() !== "false", r = await this.core.apis.GroupApi.banGroup(e.group_id.toString(), n); if (r.result !== 0) throw new Error(`SetGroupWholeBan failed: ${r.errMsg} ${r.result}`); return null; } } const Tve = l.Object({ group_id: l.String({ description: "群号" }), group_name: l.String({ description: "群名称" }) }), kve = l.Null({ description: "操作结果" }); class Nve extends ie { actionName = re.SetGroupName; payloadSchema = Tve; returnSchema = kve; actionSummary = "设置群名称"; actionDescription = "修改指定群聊的名称"; actionTags = ["群组接口"]; payloadExample = at.SetGroupName.payload; returnExample = at.SetGroupName.response; async _handle(e) { let n = await this.core.apis.GroupApi.setGroupName(e.group_id.toString(), e.group_name); if (n.result.toString() === "1287" && (n = await this.core.apis.GroupApi.setGroupName(e.group_id.toString(), e.group_name, !0)), n.result !== 0) throw new Error(`设置群名称失败 ErrCode: ${n.result} ErrMsg: ${n.errMsg}`); return null; } } const Pve = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "用户QQ" }), duration: l.Union([l.Number(), l.String()], { default: 0, description: "禁言时长(秒)" }) }), Dve = l.Null({ description: "操作结果" }); class Ove extends ie { actionName = re.SetGroupBan; payloadSchema = Pve; returnSchema = Dve; actionSummary = "群组禁言"; actionDescription = "禁言群聊中的指定成员"; actionTags = ["群组接口"]; payloadExample = at.SetGroupBan.payload; returnExample = at.SetGroupBan.response; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("uid error"); const r = (await this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), n, !0))?.role; if (r === void 0) throw new Error("user not in group"); if (r === Tu.KOWNER) throw new Error("cannot ban owner"); if (r === Tu.KADMIN) { const o = (await this.core.apis.GroupApi.getGroupMemberEx(e.group_id.toString(), this.core.selfInfo.uid, !0))?.role; if (o === void 0) throw new Error("failed to fetch bot role"); if (o !== Tu.KOWNER) throw new Error("cannot ban admin"); } const i = await this.core.apis.GroupApi.banMember( e.group_id.toString(), [{ uid: n, timeStamp: +e.duration }] ); if (i.result !== 0) throw new Error(i.errMsg); return null; } } const Fve = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "用户QQ" }), reject_add_request: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否拒绝加群请求" })) }), Mve = l.Null({ description: "操作结果" }); class Rve extends ie { actionName = re.SetGroupKick; payloadSchema = Fve; returnSchema = Mve; actionSummary = "群组踢人"; actionDescription = "将指定成员踢出群聊"; actionTags = ["群组接口"]; payloadExample = at.SetGroupKick.payload; returnExample = at.SetGroupKick.response; async _handle(e) { const n = e.reject_add_request?.toString() === "true", r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!r) throw new Error("get Uid Error"); return await this.core.apis.GroupApi.kickMember(e.group_id.toString(), [r], n), null; } } const Bve = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "用户QQ" }), enable: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否设置为管理员" })) }), Uve = l.Null({ description: "操作结果" }); class Lve extends ie { actionName = re.SetGroupAdmin; payloadSchema = Bve; returnSchema = Uve; actionSummary = "设置群管理员"; actionDescription = "设置或取消群聊中的管理员"; actionTags = ["群组接口"]; payloadExample = at.SetGroupAdmin.payload; returnExample = at.SetGroupAdmin.response; async _handle(e) { const n = typeof e.enable == "string" ? e.enable === "true" : !!e.enable, r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!r) throw new Error("get Uid Error"); return await this.core.apis.GroupApi.setMemberRole(e.group_id.toString(), r, n ? Tu.KADMIN : Tu.KMEMBER), null; } } const Qve = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "用户QQ" }), card: l.Optional(l.String({ description: "群名片" })) }), jve = l.Null({ description: "操作结果" }); class $ve extends ie { actionName = re.SetGroupCard; payloadSchema = Qve; returnSchema = jve; actionSummary = "设置群名片"; actionDescription = "设置群聊中指定成员的群名片"; actionTags = ["群组接口"]; payloadExample = at.SetGroupCard.payload; returnExample = at.SetGroupCard.response; async _handle(e) { const n = e.group_id.toString(), r = e.user_id.toString(), i = e.card || "", o = await this.core.apis.GroupApi.getGroupMember(n, r); if (!o) throw new Error(`群(${n})成员${r}不存在`); await this.core.apis.GroupApi.setMemberCard(n, o.uid, i); for (let a = 0; a < 3; a++) if (await bp(1e3), (await this.core.apis.GroupApi.refreshGroupMemberCachePartial(n, o.uid))?.cardName === i) return null; throw new Error("设置群名片未生效"); } } const na = { GetFile: { payload: { file: "file_id_123" }, response: { file: "/path/to/file", url: "http://...", file_size: 1024, file_name: "test.jpg" } }, GetGroupFileUrl: { payload: { group_id: "123456", file_id: "file_id_123", busid: 102 }, response: { url: "http://..." } }, GetImage: { payload: { file: "image_id_123" }, response: { file: "/path/to/image", url: "http://..." } }, GetPrivateFileUrl: { payload: { user_id: "123456789", file_id: "file_id_123" }, response: { url: "http://..." } }, GetRecord: { payload: { file: "record_id_123", out_format: "mp3" }, response: { file: "/path/to/record", url: "http://..." } } }, Gve = l.Object({ file: l.Optional(l.String({ description: "文件路径、URL或Base64" })), file_id: l.Optional(l.String({ description: "文件ID" })) }), qve = l.Object({ file: l.Optional(l.String({ description: "本地路径" })), url: l.Optional(l.String({ description: "下载URL" })), file_size: l.Optional(l.String({ description: "文件大小" })), file_name: l.Optional(l.String({ description: "文件名" })), base64: l.Optional(l.String({ description: "Base64编码" })) }, { description: "文件信息" }); class w3 extends ie { payloadSchema = Gve; returnSchema = qve; actionTags = ["文件接口"]; async _handle(e) { e.file ||= e.file_id || ""; const n = on.decode(e.file); if (n && n.msgId && n.elementId) { const { peer: o, msgId: a, elementId: s } = n, c = await this.core.apis.FileApi.downloadMedia(a, o.chatType, o.peerUid, s, "", ""), u = (await this.core.apis.MsgApi.getMsgsByMsgId(o, [a]))?.msgList.find((x) => x.msgId === a), d = u?.elements.find((x) => x.elementId === s), p = d?.videoElement ?? d?.fileElement ?? d?.pttElement ?? d?.picElement; if (!p) throw new Error("element not found"); const f = p.fileSize?.toString() ?? "", m = p.fileName ?? ""; let h = ""; d?.picElement && u && (h = (await this.obContext.apis.MsgApi.rawToOb11Converters.picElement?.(d?.picElement, u, d, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !0 }))?.data.url ?? ""), d?.videoElement && u && (h = (await this.obContext.apis.MsgApi.rawToOb11Converters.videoElement?.(d?.videoElement, u, d, { parseMultMsg: !1, disableGetUrl: !1, quick_reply: !0 }))?.data.url ?? ""); const y = { file: c, url: h !== "" ? h : c, file_size: f, file_name: m }; if (this.obContext.configLoader.configData.enableLocalFile2Url && c) try { y.base64 = await Lt.readFile(c, "base64"); } catch (x) { throw new Error("文件下载失败. " + x); } return y; } const r = on.decodeModelId(e.file); if (r && r.modelId) { const { peer: o, modelId: a } = r, s = await this.core.apis.FileApi.downloadFileForModelId(o, a, ""), c = { file: s, url: s, file_size: "", file_name: "" }; if (this.obContext.configLoader.configData.enableLocalFile2Url && s) try { c.base64 = await Lt.readFile(s, "base64"); } catch (u) { throw new Error("文件下载失败. " + u); } return c; } const i = await this.core.apis.FileApi.searchForFile([e.file]); if (i) { const o = parseInt(i.fileSize), a = this.obContext.configLoader.configData.timeout, s = hA(a, o, a.downloadSpeedKBps), c = await this.core.apis.FileApi.downloadFileById(i.id, o, s), u = { file: c, url: c, file_size: i.fileSize.toString(), file_name: i.fileName }; if (this.obContext.configLoader.configData.enableLocalFile2Url && c) try { u.base64 = await Lt.readFile(c, "base64"); } catch (d) { throw new Error("文件下载失败. " + d); } return u; } throw new Error("file not found"); } } class zve extends w3 { actionName = re.GetFile; actionSummary = "获取文件"; actionDescription = "获取指定文件的详细信息及下载路径"; actionTags = ["文件接口"]; payloadExample = na.GetFile.payload; returnExample = na.GetFile.response; } class Hve extends w3 { actionName = re.GetImage; actionSummary = "获取图片"; actionDescription = "获取指定图片的信息及路径"; actionTags = ["文件接口"]; payloadExample = na.GetImage.payload; returnExample = na.GetImage.response; } const Wve = ["mp3", "amr", "wma", "m4a", "spx", "ogg", "wav", "flac"], Kve = l.Object({ file: l.Optional(l.String({ description: "文件路径、URL或Base64" })), file_id: l.Optional(l.String({ description: "文件ID" })), out_format: l.String({ description: "输出格式" }) }); class Vve extends w3 { actionName = re.GetRecord; payloadSchema = Kve; actionSummary = "获取语音"; actionDescription = "获取指定语音文件的信息,并支持格式转换"; actionTags = ["文件接口"]; payloadExample = na.GetRecord.payload; returnExample = na.GetRecord.response; async _handle(e) { const n = await super._handle(e); if (e.out_format && typeof e.out_format == "string") { const r = n.file; if (!r) throw new Error("file not found"); if (!Wve.includes(e.out_format)) throw new Error("转换失败 out_format 字段可能格式不正确"); const i = `${r}.${e.out_format}`; try { await cs.access(r); try { await cs.access(i); } catch { await uo.convertAudioFmt(r, i, e.out_format); } const o = await cs.readFile(i, { encoding: "base64" }); n.file = i, n.url = i, n.base64 = o; } catch (o) { throw console.error("Error processing file:", o), o; } } return n; } } const S3 = l.Object({ user_id: l.Optional(l.Union([l.String(), l.Number()], { description: "用户QQ" })), group_id: l.Optional(l.String({ description: "群号" })), message_id: l.Optional(l.String({ description: "消息ID" })) }), _3 = l.Null({ description: "操作结果" }); class E3 extends ie { actionSummary = "标记消息已读"; actionDescription = "标记指定渠道的消息为已读"; actionTags = ["消息接口"]; payloadExample = { message_id: 12345 }; returnExample = null; async getPeer(e) { if (e.message_id) { const n = ot.getMsgIdAndPeerByShortId(+e.message_id)?.Peer; if (n) return n; const r = ot.getPeerByMsgId(e.message_id.toString())?.Peer; if (r) return r; } if (e.user_id) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error(`私聊${e.user_id}不存在`); return { chatType: await this.core.apis.FriendApi.isBuddy(n) ? ke.KCHATTYPEC2C : ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: n }; } if (!e.group_id) throw new Error("缺少参数 group_id 或 user_id"); return { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }; } async _handle(e) { const n = await this.core.apis.MsgApi.setMsgRead(await this.getPeer(e)); if (n.result !== 0) throw new Error("设置已读失败," + n.errMsg); return null; } } class Yve extends E3 { payloadSchema = S3; returnSchema = _3; actionName = re.MarkPrivateMsgAsRead; actionSummary = "标记私聊已读"; } class Jve extends E3 { payloadSchema = S3; returnSchema = _3; actionName = re.MarkGroupMsgAsRead; actionSummary = "标记群聊已读"; } class Xve extends E3 { payloadSchema = S3; returnSchema = _3; actionName = re.GoCQHTTP_MarkMsgAsRead; actionSummary = "标记消息已读 (Go-CQHTTP)"; } class Zve extends ie { actionName = re._MarkAllMsgAsRead; actionSummary = "标记所有消息已读"; actionTags = ["消息接口"]; payloadExample = {}; returnExample = null; async _handle() { return await this.core.apis.MsgApi.markAllMsgAsRead(), null; } } const exe = l.Object({ group_id: l.String({ description: "群号" }), file: l.String({ description: "资源路径或URL" }), name: l.String({ description: "文件名" }), folder: l.Optional(l.String({ description: "父目录 ID" })), folder_id: l.Optional(l.String({ description: "父目录 ID (兼容性字段)" })), // 临时扩展 upload_file: l.Boolean({ default: !0, description: "是否执行上传" }) }), txe = l.Object({ file_id: l.Union([l.String(), l.Null()], { description: "文件 ID" }) }); class nxe extends ie { actionName = re.GoCQHTTP_UploadGroupFile; payloadSchema = exe; returnSchema = txe; actionSummary = "上传群文件"; actionDescription = "上传资源路径或URL指定的文件到指定群聊的文件系统中"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.UploadGroupFile.payload; returnExample = rt.UploadGroupFile.response; async _handle(e) { let n = e.file; fe.existsSync(n) && (n = `file://${n}`); const r = await $i(this.core.SnowCatTempPath, n), i = { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }; if (!r.success) throw new Error(r.errMsg); const o = { peer: i, deleteAfterSentFiles: [] }, a = await this.obContext.apis.FileApi.createValidSendFileElement(o, r.path, e.name, e.folder ?? e.folder_id, e.upload_file, r.isLocal); return r.isLocal || o.deleteAfterSentFiles.push(r.path), { file_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(i, [a], o.deleteAfterSentFiles)).elements.find((u) => u.elementType === Ee.FILE)?.fileElement?.fileUuid || null }; } } const Nn = { OCRImage: { payload: { image: "image_id_123" }, response: { texts: [{ text: "识别内容", coordinates: [] }] } }, GetAiCharacters: { payload: { group_id: "123456" }, response: [ { type: "string", characters: [ { character_id: "id", character_name: "name", preview_url: "url" } ] } ] }, GetClientkey: { payload: {}, response: { clientkey: "abcdef123456" } }, SetQQAvatar: { payload: { file: "base64://..." }, response: null }, SetGroupKickMembers: { payload: { group_id: "123456", user_id: ["123456789"], reject_add_request: !1 }, response: null }, TranslateEnWordToZn: { payload: { words: ["hello"] }, response: { words: ["你好"] } }, SetLongNick: { payload: { longNick: "个性签名" }, response: null }, SetSpecialTitle: { payload: { group_id: "123456", user_id: "123456789", special_title: "头衔" }, response: null }, SendQzoneMsg: { payload: { content: "今天天气不错", images: [], ugc_right: 1, target_uins: [] }, response: { tid: "1234567890abcdef1234567890" } }, DeleteQzoneMsg: { payload: { tid: "1234567890abcdef1234567890" }, response: null } }, rxe = l.Object({ file: l.String({ description: "图片路径、URL或Base64" }) }), ixe = l.Null({ description: "设置结果" }); class oxe extends ie { actionName = re.SetQQAvatar; payloadSchema = rxe; returnSchema = ixe; actionSummary = "设置QQ头像"; actionDescription = "修改当前账号的QQ头像"; actionTags = ["扩展接口"]; payloadExample = Nn.SetQQAvatar.payload; returnExample = Nn.SetQQAvatar.response; async _handle(e) { const { path: n, success: r, isLocal: i } = await $i(this.core.SnowCatTempPath, e.file); if (!r) throw new Error(`头像${e.file}设置失败,file字段可能格式不正确`); if (n) { await Z2(n, 5e3); const o = await this.core.apis.UserApi.setQQAvatar(n); if (i || Wn.unlink(n).catch(() => { }), !o) throw new Error(`头像${e.file}设置失败,api无返回`); if (Number(o.result) === 1004022) throw new Error(`头像${e.file}设置失败,文件可能不是图片格式`); if (o.result !== 0) throw new Error(`头像${e.file}设置失败,未知的错误,${o.result}:${o.errMsg}`); } else throw new Error(`头像${e.file}设置失败,无法获取头像,文件可能不存在`); return null; } } const axe = l.Object({ url: l.Optional(l.String({ description: "下载链接" })), base64: l.Optional(l.String({ description: "base64数据" })), name: l.Optional(l.String({ description: "文件名" })), headers: l.Optional(l.Union([l.String(), l.Array(l.String())], { description: "请求头" })) }), sxe = l.Object({ file: l.String({ description: "文件路径" }) }, { description: "下载结果" }); class cxe extends ie { actionName = re.GoCQHTTP_DownloadFile; payloadSchema = axe; returnSchema = sxe; actionSummary = "下载文件"; actionDescription = "下载网络文件到本地临时目录"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.DownloadFile.payload; returnExample = rt.DownloadFile.response; async _handle(e) { const n = !e.name, r = e.name || Xo(); let i; if (e.base64) i = await $i(this.core.SnowCatTempPath, `base64://${e.base64}`, r); else if (e.url) { const a = this.getHeaders(e.headers); i = await $i(this.core.SnowCatTempPath, e.url, r, a); } else throw new Error("不存在任何文件, 无法下载"); if (!i.success) throw new Error(i.errMsg); const o = i.path; if (fe.existsSync(o)) { if (n) { const a = await h0(o), s = En(this.core.SnowCatTempPath, a); return fe.renameSync(o, s), { file: s }; } return { file: o }; } else throw new Error("文件写入失败, 检查权限"); } getHeaders(e) { const n = {}; if (typeof e == "string" && (e = e.split("[\\r\\n]")), Array.isArray(e)) for (const r of e) { const i = r.indexOf("="); if (i < 0) n[r] = ""; else { const o = r.substring(0, i); n[o] = r.substring(i + 1); } } return n["Content-Type"] || (n["Content-Type"] = "application/octet-stream"), n; } } const uxe = l.Object({ group_id: l.String({ description: "群号" }), message_seq: l.Optional(l.String({ description: "起始消息序号" })), count: l.Number({ default: 20, description: "获取消息数量" }), reverse_order: l.Boolean({ default: !1, description: "是否反向排序" }), disable_get_url: l.Boolean({ default: !1, description: "是否禁用获取URL" }), parse_mult_msg: l.Boolean({ default: !0, description: "是否解析合并消息" }), quick_reply: l.Boolean({ default: !1, description: "是否快速回复" }), reverseOrder: l.Boolean({ default: !1, description: "是否反向排序(旧版本兼容)" }) }), lxe = l.Object({ messages: l.Array(l.Any(), { description: "消息列表" }) }, { description: "群历史消息" }); class dxe extends ie { actionName = re.GoCQHTTP_GetGroupMsgHistory; payloadSchema = uxe; returnSchema = lxe; actionSummary = "获取群历史消息"; actionDescription = "获取指定群聊的历史聊天记录"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupMsgHistory.payload; returnExample = rt.GetGroupMsgHistory.response; async _handle(e, n, r) { const i = { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }, o = e.message_seq ? !(e.message_seq?.toString() === "" || e.message_seq?.toString() === "0") : !!e.message_seq, a = o ? ot.getMsgIdAndPeerByShortId(+e.message_seq)?.MsgId ?? e.message_seq.toString() : "0", s = o ? (await this.core.apis.MsgApi.getMsgHistory(i, a, +e.count, e.reverse_order || e.reverseOrder)).msgList : (await this.core.apis.MsgApi.getAioFirstViewLatestMsgs(i, +e.count)).msgList; if (s.length === 0) throw new Error(`消息${e.message_seq}不存在`); return await Promise.all(s.map(async (u) => { u.id = ot.createUniqueMsgId({ guildId: "", chatType: u.chatType, peerUid: u.peerUid }, u.msgId); })), { messages: (await Promise.all( s.map((u) => this.obContext.apis.MsgApi.parseMessage(u, r.messagePostFormat ?? "array", e.parse_mult_msg, e.disable_get_url, e.quick_reply)) )).filter((u) => u !== void 0) }; } } const pxe = l.Object({ message_id: l.Optional(l.String({ description: "消息ID" })), id: l.Optional(l.String({ description: "消息ID" })) }), fxe = l.Object({ messages: l.Optional(l.Array(l.Unknown(), { description: "消息列表" })) }, { description: "合并转发消息" }); function iS(t) { return typeof t != "string" && t.type === Ke.forward; } class hxe extends ie { actionName = re.GoCQHTTP_GetForwardMsg; payloadSchema = pxe; returnSchema = fxe; actionSummary = "获取合并转发消息"; actionDescription = "获取合并转发消息的具体内容"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetForwardMsg.payload; returnExample = rt.GetForwardMsg.response; createTemplateNode(e) { return { type: Ke.node, data: { user_id: e.user_id, nickname: e.sender.nickname, message: [], content: [] } }; } async parseForward(e) { const n = []; for (const r of e) { const i = this.createTemplateNode(r); for (const o of r.message) if (iS(o)) { const a = this.createTemplateNode(r); a.data.message = await this.parseForward(o.data.content ?? []), i.data.message.push(a); } else if (typeof o == "string") { const a = { type: Ke.text, data: { text: o } }; i.data.message.push(a); } else i.data.message.push(o); n.push(i); } return n; } async _handle(e) { const n = e.message_id || e.id; if (!n) throw new Error("message_id is required"); const r = (s) => ({ chatType: ke.KCHATTYPEGROUP, elements: [{ elementType: Ee.MULTIFORWARD, elementId: "", multiForwardMsgElement: { resId: s, fileName: "", xmlContent: "" } }], guildId: "", isOnlineMsg: !1, msgId: "", // TODO: no necessary msgRandom: "0", msgSeq: "", msgTime: "", msgType: us.KMSGTYPEMIX, parentMsgIdList: [], parentMsgPeer: { chatType: ke.KCHATTYPEGROUP, peerUid: "" }, peerName: "", peerUid: "284840486", peerUin: "284840486", recallTime: "0", records: [], sendNickName: "", sendRemarkName: "", senderUid: "", senderUin: "1094950020", sourceType: G2.K_DOWN_SOURCETYPE_UNKNOWN, subMsgType: 1 }), i = async (s) => { const u = (await this.obContext.apis.MsgApi.parseMessageV2(r(s), !0))?.arrayMsg?.message?.[0]; if (u && iS(u)) return { messages: u.data.content }; throw new Error("protocolFallbackLogic: 找不到相关的聊天记录"); }; if (!$O(n)) { const s = await i(n); if (s.messages) return s; throw new Error("ResId无效: 找不到相关的聊天记录"); } const o = ot.getShortIdByMsgId(n.toString()), a = ot.getMsgIdAndPeerByShortId(o ?? +n); if (a) { const s = await this.core.apis.MsgApi.getMsgHistory(a.Peer, a.MsgId, 1); if (s && s.result === 0 && s.msgList.length > 0) { const c = s.msgList[0]; if (!c) throw new Error("消息不存在或已过期"); const d = (await this.obContext.apis.MsgApi.parseMessage(c, "array", !0))?.message?.[0]; if (d && iS(d)) { const p = d.data.content; if (p) return { messages: p }; } } } throw new Error("消息已过期或者为内层消息,无法获取转发消息"); } } const mxe = l.Object({ user_id: l.String({ description: "用户QQ" }), message_seq: l.Optional(l.String({ description: "起始消息序号" })), count: l.Number({ default: 20, description: "获取消息数量" }), reverse_order: l.Boolean({ default: !1, description: "是否反向排序" }), disable_get_url: l.Boolean({ default: !1, description: "是否禁用获取URL" }), parse_mult_msg: l.Boolean({ default: !0, description: "是否解析合并消息" }), quick_reply: l.Boolean({ default: !1, description: "是否快速回复" }), reverseOrder: l.Boolean({ default: !1, description: "是否反向排序(旧版本兼容)" }) }), gxe = l.Object({ messages: l.Array(l.Any(), { description: "消息列表" }) }, { description: "好友历史消息" }); class yxe extends ie { actionName = re.GetFriendMsgHistory; payloadSchema = mxe; returnSchema = gxe; actionSummary = "获取好友历史消息"; actionDescription = "获取指定好友的历史聊天记录"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetFriendMsgHistory.payload; returnExample = rt.GetFriendMsgHistory.response; async _handle(e, n, r) { const i = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!i) throw new Error(`记录${e.user_id}不存在`); const a = { chatType: await this.core.apis.FriendApi.isBuddy(i) ? ke.KCHATTYPEC2C : ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: i }, s = e.message_seq ? !(e.message_seq?.toString() === "" || e.message_seq?.toString() === "0") : !!e.message_seq, c = s ? ot.getMsgIdAndPeerByShortId(+e.message_seq)?.MsgId ?? e.message_seq.toString() : "0", u = s ? (await this.core.apis.MsgApi.getMsgHistory(a, c, +e.count, e.reverse_order || e.reverseOrder)).msgList : (await this.core.apis.MsgApi.getAioFirstViewLatestMsgs(a, +e.count)).msgList; if (u.length === 0) throw new Error(`消息${e.message_seq}不存在`); return await Promise.all(u.map(async (p) => { p.id = ot.createUniqueMsgId({ guildId: "", chatType: p.chatType, peerUid: p.peerUid }, p.msgId); })), { messages: (await Promise.all( u.map((p) => this.obContext.apis.MsgApi.parseMessage(p, r.messagePostFormat ?? "array", e.parse_mult_msg, e.disable_get_url)) )).filter((p) => p !== void 0) }; } } const bxe = l.Object({ domain: l.String({ description: "需要获取 cookies 的域名" }) }), vxe = l.Object({ cookies: l.String({ description: "Cookies" }), bkn: l.String({ description: "CSRF Token" }) }); class xxe extends ie { actionName = re.GetCookies; payloadSchema = bxe; returnSchema = vxe; actionSummary = "获取 Cookies"; actionDescription = "获取指定域名的 Cookies"; actionTags = ["用户接口"]; payloadExample = { domain: "qun.qq.com" }; returnExample = { cookies: "uin=o123456789; skey=@abc12345;", bkn: "123456789" }; async _handle(e) { const n = await this.core.apis.UserApi.getCookies(e.domain), r = Object.entries(n).map(([o, a]) => `${o}=${a}`).join("; "); let i = ""; return e.domain.includes("qzone.qq.com") ? n?.p_skey ? i = this.core.apis.WebApi.getBknFromPSKey(n.p_skey) : i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : "" : i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : "", { cookies: r, bkn: i }; } } const wxe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }), emoji_id: l.Union([l.Number(), l.String()], { description: "表情ID" }), set: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否设置" })) }), Sxe = l.Any({ description: "操作结果" }); class _xe extends ie { actionName = re.SetMsgEmojiLike; actionSummary = "设置消息表情点赞"; actionTags = ["消息扩展"]; payloadExample = { message_id: 12345, emoji_id: "123", set: !0 }; returnExample = { result: !0 }; payloadSchema = wxe; returnSchema = Sxe; async _handle(e) { const n = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!n) throw new Error("msg not found"); if (!e.emoji_id) throw new Error("emojiId not found"); e.set = e.set ?? !0; const r = (await this.core.apis.MsgApi.getMsgsByMsgId(n.Peer, [n.MsgId])).msgList; if (!r || r.length === 0 || !r[0]?.msgSeq) throw new Error("find msg by msgid error"); return await this.core.apis.MsgApi.setEmojiLike( n.Peer, r[0].msgSeq, e.emoji_id.toString(), typeof e.set == "string" ? e.set === "true" : !!e.set ); } } const Exe = l.Array(l.Any(), { description: "机器人Uin范围列表" }); class Axe extends ie { actionName = re.GetRobotUinRange; actionSummary = "获取机器人 UIN 范围"; actionTags = ["系统扩展"]; payloadExample = {}; returnExample = [ { minUin: "12345678", maxUin: "87654321" } ]; payloadSchema = l.Object({}); returnSchema = Exe; async _handle() { return await this.core.apis.UserApi.getRobotUinRange(); } } const Ixe = l.Object({ status: l.Union([l.Number(), l.String()], { description: "在线状态" }), ext_status: l.Union([l.Number(), l.String()], { description: "扩展状态" }), battery_status: l.Union([l.Number(), l.String()], { description: "电量状态" }) }), Cxe = l.Null({ description: "设置结果" }); class Txe extends ie { actionName = re.SetOnlineStatus; payloadSchema = Ixe; returnSchema = Cxe; actionSummary = "设置在线状态"; actionDescription = kxe; actionTags = ["系统扩展"]; payloadExample = { status: 11, ext_status: 0, battery_status: 100 }; returnExample = null; async _handle(e) { if ((await this.core.apis.UserApi.setSelfOnlineStatus( +e.status, +e.ext_status, +e.battery_status )).result !== 0) throw new Error("设置在线状态失败"); return null; } } const kxe = '\n## 状态列表\n\n### 在线\n```json5;\n{ "status": 10, "ext_status": 0, "battery_status": 0; }\n```\n\n### Q我吧\n```json5;\n{ "status": 60, "ext_status": 0, "battery_status": 0; }\n```\n\n### 离开\n```json5;\n{ "status": 30, "ext_status": 0, "battery_status": 0; }\n```\n\n### 忙碌\n```json5;\n{ "status": 50, "ext_status": 0, "battery_status": 0; }\n```\n\n### 请勿打扰\n```json5;\n{ "status": 70, "ext_status": 0, "battery_status": 0; }\n```\n\n### 隐身\n```json5;\n{ "status": 40, "ext_status": 0, "battery_status": 0; }\n```\n\n### 听歌中\n```json5;\n{ "status": 10, "ext_status": 1028, "battery_status": 0; }\n```\n\n### 春日限定\n```json5;\n{ "status": 10, "ext_status": 2037, "battery_status": 0; }\n```\n\n### 一起元梦\n```json5;\n{ "status": 10, "ext_status": 2025, "battery_status": 0; }\n```\n\n### 求星搭子\n```json5;\n{ "status": 10, "ext_status": 2026, "battery_status": 0; }\n```\n\n### 被掏空\n```json5;\n{ "status": 10, "ext_status": 2014, "battery_status": 0; }\n```\n\n### 今日天气\n```json5;\n{ "status": 10, "ext_status": 1030, "battery_status": 0; }\n```\n\n### 我crash了\n```json5;\n{ "status": 10, "ext_status": 2019, "battery_status": 0; }\n```\n\n### 爱你\n```json5;\n{ "status": 10, "ext_status": 2006, "battery_status": 0; }\n```\n\n### 恋爱中\n```json5;\n{ "status": 10, "ext_status": 1051, "battery_status": 0; }\n```\n\n### 好运锦鲤\n```json5;\n{ "status": 10, "ext_status": 1071, "battery_status": 0; }\n```\n\n### 水逆退散\n```json5;\n{ "status": 10, "ext_status": 1201, "battery_status": 0; }\n```\n\n### 嗨到飞起\n```json5;\n{ "status": 10, "ext_status": 1056, "battery_status": 0; }\n```\n\n### 元气满满\n```json5;\n{ "status": 10, "ext_status": 1058, "battery_status": 0; }\n```\n\n### 宝宝认证\n```json5;\n{ "status": 10, "ext_status": 1070, "battery_status": 0; }\n```\n\n### 一言难尽\n```json5;\n{ "status": 10, "ext_status": 1063, "battery_status": 0; }\n```\n\n### 难得糊涂\n```json5;\n{ "status": 10, "ext_status": 2001, "battery_status": 0; }\n```\n\n### emo中\n```json5;\n{ "status": 10, "ext_status": 1401, "battery_status": 0; }\n```\n\n### 我太难了\n```json5;\n{ "status": 10, "ext_status": 1062, "battery_status": 0; }\n```\n\n### 我想开了\n```json5;\n{ "status": 10, "ext_status": 2013, "battery_status": 0; }\n```\n\n### 我没事\n```json5;\n{ "status": 10, "ext_status": 1052, "battery_status": 0; }\n```\n\n### 想静静\n```json5;\n{ "status": 10, "ext_status": 1061, "battery_status": 0; }\n```\n\n### 悠哉哉\n```json5;\n{ "status": 10, "ext_status": 1059, "battery_status": 0; }\n```\n\n### 去旅行\n```json5;\n{ "status": 10, "ext_status": 2015, "battery_status": 0; }\n```\n\n### 信号弱\n```json5;\n{ "status": 10, "ext_status": 1011, "battery_status": 0; }\n```\n\n### 出去浪\n```json5;\n{ "status": 10, "ext_status": 2003, "battery_status": 0; }\n```\n\n### 肝作业\n```json5;\n{ "status": 10, "ext_status": 2012, "battery_status": 0; }\n```\n\n### 学习中\n```json5;\n{ "status": 10, "ext_status": 1018, "battery_status": 0; }\n```\n\n### 搬砖中\n```json5;\n{ "status": 10, "ext_status": 2023, "battery_status": 0; }\n```\n\n### 摸鱼中\n```json5;\n{ "status": 10, "ext_status": 1300, "battery_status": 0; }\n```\n\n### 无聊中\n```json5;\n{ "status": 10, "ext_status": 1060, "battery_status": 0; }\n```\n\n### timi中\n```json5;\n{ "status": 10, "ext_status": 1027, "battery_status": 0; }\n```\n\n### 睡觉中\n```json5;\n{ "status": 10, "ext_status": 1016, "battery_status": 0; }\n```\n\n### 熬夜中\n```json5;\n{ "status": 10, "ext_status": 1032, "battery_status": 0; }\n```\n\n### 追剧中\n```json5;\n{ "status": 10, "ext_status": 1021, "battery_status": 0; }\n```\n\n### 我的电量\n```json5;\n{\n "status": 10,\n "ext_status": 1000,\n "battery_status": 0;\n}\n```\n', Nxe = l.Object({ group_id: l.String({ description: "群号" }) }), Pxe = l.Array(l.Object({ sender_id: l.Number({ description: "发送者QQ" }), publish_time: l.Number({ description: "发布时间" }), notice_id: l.String({ description: "公告ID" }), message: l.Object({ text: l.String({ description: "文本内容" }), image: l.Array(l.Any(), { description: "图片列表" }), images: l.Array(l.Any(), { description: "图片列表" }) }, { description: "公告内容" }), settings: l.Optional(l.Any({ description: "设置项" })), read_num: l.Optional(l.Number({ description: "阅读数" })) }), { description: "群公告列表" }); class Dxe extends ie { actionName = re.GoCQHTTP_GetGroupNotice; payloadSchema = Nxe; returnSchema = Pxe; actionSummary = "获取群公告"; actionDescription = "获取指定群聊中的公告列表"; actionTags = ["群组接口"]; payloadExample = at.GetGroupNotice.payload; returnExample = at.GetGroupNotice.response; async _handle(e) { const n = e.group_id.toString(), r = await this.core.apis.WebApi.getGroupNotice(n); if (!r) throw new Error("获取公告失败"); const i = []; for (const o in r.feeds) { if (!r.feeds[o]) continue; const a = r.feeds[o], s = a.msg.pics?.map((u) => ({ id: u.id, height: u.h, width: u.w })) || [], c = { notice_id: a.fid, sender_id: a.u, publish_time: a.pubt, message: { text: a.msg.text, image: s, images: s }, settings: a.settings, read_num: a.read_num }; i.push(c); } return i; } } const Oxe = l.Object({ group_id: l.String({ description: "群号" }) }), Fxe = l.Array(l.Object({ msg_seq: l.Number({ description: "消息序号" }), msg_random: l.Number({ description: "消息随机数" }), sender_id: l.Number({ description: "发送者QQ" }), sender_nick: l.String({ description: "发送者昵称" }), operator_id: l.Number({ description: "操作者QQ" }), operator_nick: l.String({ description: "操作者昵称" }), message_id: l.Number({ description: "消息ID" }), operator_time: l.Number({ description: "操作时间" }), content: l.Array(l.Any(), { description: "消息内容" }) }), { description: "精华消息列表" }); class Mxe extends ie { actionName = re.GoCQHTTP_GetEssenceMsg; payloadSchema = Oxe; returnSchema = Fxe; actionSummary = "获取群精华消息"; actionDescription = "获取指定群聊中的精华消息列表"; actionTags = ["群组接口"]; payloadExample = at.GetGroupEssence.payload; returnExample = at.GetGroupEssence.response; async msgSeqToMsgId(e, n, r) { const i = (await this.core.apis.MsgApi.getMsgsBySeqAndCount(e, n, 1, !0, !0)).msgList.find((o) => o.msgSeq === n && o.msgRandom === r); if (i) return { id: ot.createUniqueMsgId(e, i.msgId), msg: i }; } async _handle(e, n, r) { const i = (await this.core.apis.WebApi.getGroupEssenceMsgAll(e.group_id.toString())).flatMap((o) => o?.data?.msg_list).filter(Boolean); if (!i) throw new Error("获取失败"); return await Promise.all(i.map(async (o) => { const a = await this.msgSeqToMsgId({ chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }, o.msg_seq.toString(), o.msg_random.toString()); if (a) { const { id: d, msg: p } = a, f = await this.obContext.apis.MsgApi.parseMessage(p, r.messagePostFormat ?? "array"); let m = []; return f && (Array.isArray(f.message) ? m = f.message : m = [{ type: Ke.text, data: { text: f.message } }]), { msg_seq: o.msg_seq, msg_random: o.msg_random, sender_id: +o.sender_uin, sender_nick: o.sender_nick, operator_id: +o.add_digest_uin, operator_nick: o.add_digest_nick, message_id: d, operator_time: o.add_digest_time, content: m }; } const s = JSON.stringify({ msg_seq: o.msg_seq.toString(), msg_random: o.msg_random.toString(), group_id: e.group_id.toString() }), c = Ri.createHash("md5").update(s).digest(); c[0] && (c[0] &= 127); const u = c.readInt32BE(0); return this.core.apis.GroupApi.essenceLRU.set(u, s), { msg_seq: o.msg_seq, msg_random: o.msg_random, sender_id: +o.sender_uin, sender_nick: o.sender_nick, operator_id: +o.add_digest_uin, operator_nick: o.add_digest_nick, message_id: u, operator_time: o.add_digest_time, content: o.msg_content.map((d) => { if (d.msg_type === 1) return { type: Ke.text, data: { text: d?.text ?? "" } }; if (d.msg_type === 3) return { type: Ke.image, data: { file: "", url: d?.image_url } }; }).filter((d) => d !== void 0) }; })); } } const lL = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }), group_id: l.Optional(l.String({ description: "目标群号" })), user_id: l.Optional(l.String({ description: "目标用户QQ" })) }), dL = l.Null({ description: "操作结果" }); class pL extends ie { actionSummary = "转发单条消息"; actionDescription = "转发单条消息"; actionTags = ["消息接口"]; payloadExample = { message_id: 12345, group_id: "123456" }; returnExample = null; async getTargetPeer(e) { if (e.user_id) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error(`无法找到私聊对象${e.user_id}`); return { chatType: ke.KCHATTYPEC2C, peerUid: n }; } return { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }; } async _handle(e) { const n = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!n) throw new Error(`无法找到消息${e.message_id}`); const r = await this.getTargetPeer(e), i = await this.core.apis.MsgApi.forwardMsg( n.Peer, r, [n.MsgId] ); if (i.result !== 0) throw new Error(`转发消息失败 ${i.errMsg}`); return null; } } class Rxe extends pL { payloadSchema = lL; returnSchema = dL; actionName = re.ForwardFriendSingleMsg; } class Bxe extends pL { payloadSchema = lL; returnSchema = dL; actionName = re.ForwardGroupSingleMsg; } const Uxe = l.Array( l.Object({ categoryId: l.Number({ description: "分组ID" }), categoryName: l.String({ description: "分组名称" }), categoryMbCount: l.Number({ description: "分组内好友数量" }), buddyList: l.Array(v3, { description: "好友列表" }) }), { description: "带分组的好友列表" } ); class Lxe extends ie { actionName = re.GetFriendsWithCategory; payloadSchema = l.Object({}); returnSchema = Uxe; actionSummary = "获取带分组的好友列表"; actionTags = ["用户扩展"]; payloadExample = {}; returnExample = [ { categoryId: 1, categoryName: "我的好友", categoryMbCount: 1, buddyList: [] } ]; async _handle() { return (await this.core.apis.FriendApi.getBuddyV2ExWithCate()).map((n) => ({ ...n, buddyList: Hi.friends(n.buddyList) })); } } const Qxe = l.Object({ group_id: l.String({ description: "群号" }), content: l.String({ description: "公告内容" }), image: l.Optional(l.String({ description: "公告图片路径或 URL" })), pinned: l.Union([l.Number(), l.String()], { default: 0, description: "是否置顶 (0/1)" }), type: l.Union([l.Number(), l.String()], { default: 1, description: "类型 (默认为 1)" }), confirm_required: l.Union([l.Number(), l.String()], { default: 1, description: "是否需要确认 (0/1)" }), is_show_edit_card: l.Union([l.Number(), l.String()], { default: 0, description: "是否显示修改群名片引导 (0/1)" }), tip_window_type: l.Union([l.Number(), l.String()], { default: 0, description: "弹窗类型 (默认为 0)" }) }); class jxe extends ie { actionName = re.GoCQHTTP_SendGroupNotice; payloadSchema = Qxe; returnSchema = l.Null(); actionSummary = "发送群公告"; actionDescription = "在指定群聊中发布新的公告"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.SendGroupNotice.payload; returnExample = rt.SendGroupNotice.response; async _handle(e) { let n; if (e.image) { const { path: i, success: o, isLocal: a } = await $i(this.core.SnowCatTempPath, e.image); if (!o) throw new Error(`群公告${e.image}设置失败,image字段可能格式不正确`); if (!i) throw new Error(`群公告${e.image}设置失败,获取资源失败`); await Z2(i, 5e3); const s = await this.core.apis.GroupApi.uploadGroupBulletinPic(e.group_id.toString(), i); if (s.errCode !== 0) throw new Error(`群公告${e.image}设置失败,图片上传失败 , 错误信息:${s.errMsg}`); a || i0(i).catch(() => { }), n = s.picInfo; } const r = await this.core.apis.WebApi.setGroupNotice( e.group_id.toString(), e.content, +e.pinned, +e.type, +e.is_show_edit_card, +e.tip_window_type, +e.confirm_required, n?.id, n?.width, n?.height ); if (!r || r.ec !== 0) throw new Error(`设置群公告失败,错误信息:${r?.em}`); } } const $xe = l.Object({ group_id: l.String({ description: "群号" }), type: l.Optional(l.Enum(fi, { description: "荣誉类型" })) }), Gxe = l.Object({ group_id: l.Number({ description: "群号" }), current_talkative: l.Record(l.String(), l.Unknown(), { description: "当前龙王" }), talkative_list: l.Array(l.Unknown(), { description: "龙王列表" }), performer_list: l.Array(l.Unknown(), { description: "群聊之火列表" }), legend_list: l.Array(l.Unknown(), { description: "群聊炽热列表" }), emotion_list: l.Array(l.Unknown(), { description: "快乐源泉列表" }), strong_newbie_list: l.Array(l.Unknown(), { description: "冒尖小春笋列表" }) }, { description: "群荣誉信息" }); class qxe extends ie { actionName = re.GetGroupHonorInfo; payloadSchema = $xe; returnSchema = Gxe; actionSummary = "获取群荣誉信息"; actionDescription = "获取指定群聊的荣誉信息,如龙王等"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupHonorInfo.payload; returnExample = rt.GetGroupHonorInfo.response; async _handle(e) { return e.type || (e.type = fi.ALL), await this.core.apis.WebApi.getGroupHonorInfo(e.group_id.toString(), e.type); } } const zxe = l.Object({ user_id: l.String({ description: "用户ID" }), nickname: l.String({ description: "昵称" }), sex: l.Optional(l.String({ description: "性别" })), age: l.Optional(l.Number({ description: "年龄" })), card: l.Optional(l.String({ description: "群名片" })), level: l.Optional(l.String({ description: "群等级" })), role: l.Optional(l.String({ description: "群角色" })) }), Hxe = l.Object({ reply: l.Optional(t0), auto_escape: l.Optional(l.Boolean({ description: "是否作为纯文本发送" })), at_sender: l.Optional(l.Boolean({ description: "是否 @ 发送者" })), delete: l.Optional(l.Boolean({ description: "是否撤回该消息" })), kick: l.Optional(l.Boolean({ description: "是否踢出发送者" })), ban: l.Optional(l.Boolean({ description: "是否禁言发送者" })), ban_duration: l.Optional(l.Number({ description: "禁言时长" })), approve: l.Optional(l.Boolean({ description: "是否同意请求/加群" })), remark: l.Optional(l.String({ description: "好友备注" })), reason: l.Optional(l.String({ description: "拒绝理由" })) }, { description: "快速操作内容" }), Wxe = l.Object({ time: l.Number({ description: "事件发生时间" }), self_id: l.Number({ description: "收到事件的机器人 QQ 号" }), post_type: l.String({ description: "上报类型" }), message_type: l.Optional(l.String({ description: "消息类型" })), sub_type: l.Optional(l.String({ description: "消息子类型" })), user_id: l.String({ description: "发送者 QQ 号" }), group_id: l.Optional(l.String({ description: "群号" })), message_id: l.Optional(l.Number({ description: "消息 ID" })), message_seq: l.Optional(l.Number({ description: "消息序列号" })), real_id: l.Optional(l.Number({ description: "真实消息 ID" })), sender: l.Optional(zxe), message: l.Optional(l.Any({ description: "消息内容" })), message_format: l.Optional(l.String({ description: "消息格式" })), raw_message: l.Optional(l.String({ description: "原始消息内容" })), font: l.Optional(l.Number({ description: "字体" })), notice_type: l.Optional(l.String({ description: "通知类型" })), meta_event_type: l.Optional(l.String({ description: "元事件类型" })) }, { description: "事件上下文" }), Kxe = l.Object({ context: Wxe, operation: Hxe }); class Vxe extends ie { actionName = re.GoCQHTTP_HandleQuickAction; payloadSchema = Kxe; returnSchema = l.Null(); actionSummary = "处理快速操作"; actionDescription = "处理来自事件上报的快速操作请求"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.QuickAction.payload; returnExample = rt.QuickAction.response; async _handle(e) { this.obContext.apis.QuickActionApi.handleQuickOperation(e.context, e.operation).catch((n) => this.core.context.logger.logError(n)); } } const Yxe = l.Object({}, { description: "群忽略通知负载" }), Jxe = l.Object({ invited_requests: l.Array(l.Any(), { description: "邀请请求列表" }), InvitedRequest: l.Array(l.Any(), { description: "邀请请求列表" }), join_requests: l.Array(l.Any(), { description: "加入请求列表" }) }, { description: "群忽略通知结果" }); class Xxe extends ie { actionName = re.GetGroupIgnoredNotifies; payloadSchema = Yxe; returnSchema = Jxe; actionSummary = "获取群忽略通知"; actionDescription = "获取被忽略的入群申请和邀请通知"; actionTags = ["群组接口"]; payloadExample = {}; returnExample = { invited_requests: [], InvitedRequest: [], join_requests: [] }; async _handle() { const e = await this.core.apis.GroupApi.getSingleScreenNotifies(!1, 50), n = { invited_requests: [], InvitedRequest: [], join_requests: [] }, r = e.map(async (i) => { const o = i.user1?.uid ? +await this.core.apis.UserApi.getUinByUidV2(i.user1.uid) : 0, a = i.user2?.uid ? +await this.core.apis.UserApi.getUinByUidV2(i.user2.uid) : 0, s = { request_id: +i.seq, invitor_uin: o, invitor_nick: i.user1?.nickName, group_id: +i.group?.groupCode, message: i?.postscript, group_name: i.group?.groupName, checked: i.status !== dc.KUNHANDLE, actor: a, requester_nick: i.user1?.nickName }; i.type === 1 ? n.InvitedRequest.push(s) : i.type === 7 && n.join_requests.push(s); }); return await Promise.all(r), n.invited_requests = n.InvitedRequest, n; } } const Zxe = l.Object({}, { description: "在线客户端负载" }), ewe = l.Array(l.Any(), { description: "在线客户端列表" }); class twe extends ie { actionName = re.GetOnlineClient; payloadSchema = Zxe; returnSchema = ewe; actionSummary = "获取在线客户端"; actionDescription = "获取当前登录账号的在线客户端列表"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetOnlineClient.payload; returnExample = rt.GetOnlineClient.response; async _handle() { return this.core.apis.SystemApi.getOnlineDev(), await bp(500), []; } } const nwe = l.Object({ image: l.String({ description: "图片路径、URL或Base64" }) }), rwe = l.Any({ description: "OCR结果" }); class fL extends ie { payloadSchema = nwe; returnSchema = rwe; actionSummary = "图片 OCR 识别"; actionDescription = "识别图片中的文字内容(仅Windows端支持)"; actionTags = ["扩展接口"]; payloadExample = Nn.OCRImage.payload; returnExample = Nn.OCRImage.response; async _handle(e) { const { path: n, success: r, isLocal: i } = await $i(this.core.SnowCatTempPath, e.image); if (!r) throw new Error(`OCR ${e.image}失败, image字段可能格式不正确`); if (n) try { await Z2(n, 5e3); const o = await this.core.apis.SystemApi.ocrImage(n); if (!o) throw new Error(`OCR ${e.image}失败`); return o.result; } finally { i || fe.unlink(n, () => { }); } throw new Error(`OCR ${e.image}失败, 文件可能不存在`); } } class iwe extends fL { actionName = re.OCRImage; actionSummary = "图片 OCR 识别"; } class owe extends fL { actionName = re.IOCRImage; actionSummary = "图片 OCR 识别 (内部)"; } const awe = l.Object({ words: l.Array(l.String(), { description: "待翻译单词列表" }) }), swe = l.Object({ words: l.Array(l.String(), { description: "翻译结果列表" }) }, { description: "翻译结果" }); class cwe extends ie { actionName = re.TranslateEnWordToZn; payloadSchema = awe; returnSchema = swe; actionSummary = "英文单词翻译"; actionDescription = "将英文单词列表翻译为中文"; actionTags = ["扩展接口"]; payloadExample = Nn.TranslateEnWordToZn.payload; returnExample = Nn.TranslateEnWordToZn.response; async _handle(e) { const n = await this.core.apis.SystemApi.translateEnWordToZn(e.words); if (n.result !== 0) throw new Error("翻译失败"); return { words: n.words }; } } const uwe = l.Object({ nickname: l.String({ description: "昵称" }), personal_note: l.Optional(l.String({ description: "个性签名" })), sex: l.Optional(l.Union([l.Number(), l.String()], { description: "性别 (0: 未知, 1: 男, 2: 女)" })) // 传Sex值?建议传0 }); class lwe extends ie { actionName = re.SetQQProfile; payloadSchema = uwe; returnSchema = l.Any({ description: "设置结果" }); actionSummary = "设置QQ资料"; actionDescription = "修改当前账号的昵称、个性签名等资料"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.SetQQProfile.payload; returnExample = rt.SetQQProfile.response; async _handle(e) { const n = this.core.selfInfo, r = await this.core.apis.UserApi.getUserDetailInfo(n.uid); return await this.core.apis.UserApi.modifySelfProfile({ nick: e.nickname, longNick: (e?.personal_note ?? r?.longNick) || "", sex: parseInt(e?.sex ? e?.sex.toString() : r?.sex.toString()), birthday: { birthday_year: r?.birthday_year.toString(), birthday_month: r?.birthday_month.toString(), birthday_day: r?.birthday_day.toString() }, location: void 0 }); } } const dwe = l.Object({ user_id: l.Optional(l.String({ description: "QQ号" })), group_id: l.Optional(l.String({ description: "群号" })), phone_number: l.String({ default: "", description: "手机号" }) }), pwe = l.Any({ description: "分享结果" }); class hL extends ie { payloadSchema = dwe; returnSchema = pwe; actionSummary = "分享用户 (Ark)"; actionDescription = "获取用户推荐的 Ark 内容"; actionTags = ["消息扩展"]; payloadExample = { user_id: "123456", phone_number: "" }; returnExample = { ark: "..." }; async _handle(e) { if (e.group_id) return await this.core.apis.GroupApi.getGroupRecommendContactArkJson(e.group_id.toString()); if (e.user_id) return await this.core.apis.UserApi.getBuddyRecommendContactArkJson(e.user_id.toString(), e.phone_number); throw new Error("group_id or user_id is required"); } } const fwe = l.Object({ group_id: l.String({ description: "群号" }) }); class hwe extends hL { actionName = re.SharePeer; } const mwe = l.String({ description: "Ark Json内容" }); class mL extends ie { payloadSchema = fwe; returnSchema = mwe; actionSummary = "分享群 (Ark)"; actionDescription = "获取群分享的 Ark 内容"; actionTags = ["消息扩展"]; payloadExample = { group_id: "123456" }; returnExample = '{"app": "com.tencent.structmsg", ...}'; async _handle(e) { return await this.core.apis.GroupApi.getArkJsonGroupShare(e.group_id.toString()); } } class gwe extends mL { actionName = re.ShareGroupEx; } class ywe extends mL { actionName = re.SendGroupArkShare; } class bwe extends hL { actionName = re.SendArkShare; } const vwe = l.Object({ rawData: l.String({ description: "原始数据" }), brief: l.String({ description: "简要描述" }) }), xwe = l.Any({ description: "创建结果" }); class wwe extends ie { actionName = re.CreateCollection; payloadSchema = vwe; returnSchema = xwe; actionSummary = "创建收藏"; actionTags = ["扩展接口"]; payloadExample = { rawData: "收藏内容", brief: "收藏标题" }; returnExample = { result: 0, errMsg: "" }; async _handle(e) { return await this.core.apis.CollectionApi.createCollection( this.core.selfInfo.uin, this.core.selfInfo.uid, this.core.selfInfo.nick, e.brief, e.rawData ); } } const Swe = l.Object({ longNick: l.String({ description: "签名内容" }) }), _we = l.Any({ description: "设置结果" }); class Ewe extends ie { actionName = re.SetLongNick; payloadSchema = Swe; returnSchema = _we; actionSummary = "设置个性签名"; actionDescription = "修改当前登录帐号的个性签名"; actionTags = ["扩展接口"]; payloadExample = Nn.SetLongNick.payload; returnExample = Nn.SetLongNick.response; async _handle(e) { return await this.core.apis.UserApi.setLongNick(e.longNick); } } const Awe = l.Object({ message_id: l.Optional(l.Union([l.Number(), l.String()], { description: "消息ID" })), msg_seq: l.Optional(l.String({ description: "消息序号" })), msg_random: l.Optional(l.String({ description: "消息随机数" })), group_id: l.Optional(l.String({ description: "群号" })) }), Iwe = l.Any({ description: "操作结果" }); class Cwe extends ie { actionName = re.DelEssenceMsg; payloadSchema = Awe; returnSchema = Iwe; actionSummary = "移出精华消息"; actionDescription = "将一条消息从群精华消息列表中移出"; actionTags = ["群组接口"]; payloadExample = at.DelEssenceMsg.payload; returnExample = at.DelEssenceMsg.response; async _handle(e) { if (e.msg_seq && e.msg_random && e.group_id) return await this.core.apis.GroupApi.removeGroupEssenceBySeq( e.group_id, e.msg_random, e.msg_seq ); if (!e.message_id) throw new Error("必须提供 message_id 或者同时提供 msg_seq, msg_random, group_id"); const n = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!n) { const r = this.core.apis.GroupApi.essenceLRU.getValue(+e.message_id); if (!r) throw new Error("消息不存在"); const { msg_seq: i, msg_random: o, group_id: a } = JSON.parse(r); return await this.core.apis.GroupApi.removeGroupEssenceBySeq(a, i, o); } return await this.core.apis.GroupApi.removeGroupEssence( n.Peer.peerUid, n.MsgId ); } } const Twe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }) }), kwe = l.Any({ description: "操作结果" }); class Nwe extends ie { actionName = re.SetEssenceMsg; payloadSchema = Twe; returnSchema = kwe; actionSummary = "设置精华消息"; actionDescription = "将一条消息设置为群精华消息"; actionTags = ["群组接口"]; payloadExample = at.SetEssenceMsg.payload; returnExample = at.SetEssenceMsg.response; async _handle(e) { const n = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!n) throw new Error("msg not found"); return await this.core.apis.GroupApi.addGroupEssence( n.Peer.peerUid, n.MsgId ); } } const Pwe = l.Object({ count: l.Union([l.Number(), l.String()], { default: 10, description: "获取的数量" }) }), Dwe = l.Array(l.Object({ lastestMsg: l.Any({ description: "最后一条消息" }), peerUin: l.String({ description: "对象QQ" }), remark: l.String({ description: "备注" }), msgTime: l.String({ description: "消息时间" }), chatType: l.Number({ description: "聊天类型" }), msgId: l.String({ description: "消息ID" }), sendNickName: l.String({ description: "发送者昵称" }), sendMemberName: l.String({ description: "发送者群名片" }), peerName: l.String({ description: "对象名称" }) }), { description: "最近会话列表" }); class Owe extends ie { actionName = re.GetRecentContact; payloadSchema = Pwe; returnSchema = Dwe; actionSummary = "获取最近会话"; actionDescription = "获取最近会话"; actionTags = ["用户接口"]; payloadExample = { count: 10 }; returnExample = [ { peerUin: "123456", peerName: "测试", msgTime: "1734567890", msgId: "12345", lastestMsg: {} } ]; async _handle(e, n, r) { const i = await this.core.apis.UserApi.getRecentContactListSnapShot(+e.count); return await Promise.all(i.info.changedList.map(async (a) => { const s = await this.core.apis.MsgApi.getMsgsByMsgId({ chatType: a.chatType, peerUid: a.peerUid }, [a.msgId]); return s.msgList.length > 0 && s.msgList[0] ? { lastestMsg: await this.obContext.apis.MsgApi.parseMessage(s.msgList[0], r.messagePostFormat ?? "array"), peerUin: a.peerUin, remark: String(a.remark ?? ""), msgTime: a.msgTime, chatType: a.chatType, msgId: a.msgId, sendNickName: String(a.sendNickName ?? ""), sendMemberName: String(a.sendMemberName ?? ""), peerName: String(a.peerName ?? "") } : { lastestMsg: void 0, peerUin: a.peerUin, remark: String(a.remark ?? ""), msgTime: a.msgTime, chatType: a.chatType, msgId: a.msgId, sendNickName: String(a.sendNickName ?? ""), sendMemberName: String(a.sendMemberName ?? ""), peerName: String(a.peerName ?? "") }; })); } } const Fwe = l.Object({ user_id: l.Optional(l.String({ description: "QQ号" })), start: l.Union([l.Number(), l.String()], { default: 0, description: "起始位置" }), count: l.Union([l.Number(), l.String()], { default: 10, description: "获取数量" }) }), Mwe = l.Object({ uid: l.String({ description: "用户UID" }), time: l.String({ description: "时间" }), favoriteInfo: l.Object({ userInfos: l.Array(l.Any(), { description: "点赞用户信息" }), total_count: l.Number({ description: "总点赞数" }), last_time: l.Number({ description: "最后点赞时间" }), today_count: l.Number({ description: "今日点赞数" }) }), voteInfo: l.Object({ total_count: l.Number({ description: "总点赞数" }), new_count: l.Number({ description: "新增点赞数" }), new_nearby_count: l.Number({ description: "新增附近点赞数" }), last_visit_time: l.Number({ description: "最后访问时间" }), userInfos: l.Array(l.Any(), { description: "点赞用户信息" }) }) }, { description: "点赞详情" }); class Rwe extends ie { actionName = re.GetProfileLike; payloadSchema = Fwe; returnSchema = Mwe; actionSummary = "获取资料点赞"; actionTags = ["用户扩展"]; payloadExample = { user_id: "123456789", start: 0, count: 10 }; returnExample = { uid: "u_123", time: "1734567890", favoriteInfo: { userInfos: [], total_count: 10, last_time: 1734567890, today_count: 5 }, voteInfo: { total_count: 100, new_count: 2, new_nearby_count: 0, last_visit_time: 1734567890, userInfos: [] } }; async _handle(e) { const n = this.core.selfInfo.uin === e.user_id || !e.user_id, r = n || !e.user_id ? this.core.selfInfo.uid : await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()), i = n ? 2 : 1, a = (await this.core.apis.UserApi.getProfileLike(r ?? this.core.selfInfo.uid, +e.start, +e.count, i)).info.userLikeInfos[0]; if (!a) throw new Error("get info error"); for (const s of a.voteInfo.userInfos) s.uin = +(await this.core.apis.UserApi.getUinByUidV2(s.uid) ?? ""); for (const s of a.favoriteInfo.userInfos) s.uin = +(await this.core.apis.UserApi.getUinByUidV2(s.uid) ?? ""); return a; } } const Bwe = l.Object({ file: l.String({ description: "头像文件路径或 URL" }), group_id: l.String({ description: "群号" }) }), Uwe = l.Object({ result: l.Number(), errMsg: l.String() }, { description: "设置结果" }); class Lwe extends ie { actionName = re.SetGroupPortrait; payloadSchema = Bwe; returnSchema = Uwe; actionSummary = "设置群头像"; actionDescription = "修改指定群聊的头像"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.SetGroupPortrait.payload; returnExample = rt.SetGroupPortrait.response; async _handle(e) { const { path: n, success: r, isLocal: i } = await $i(this.core.SnowCatTempPath, e.file); if (!r) throw new Error(`头像${e.file}设置失败,file字段可能格式不正确`); if (n) { await k$(n, 5e3); const o = await this.core.apis.GroupApi.setGroupAvatar(e.group_id.toString(), n); if (i || Wn.unlink(n).catch(() => { }), !o) throw new Error(`头像${e.file}设置失败,api无返回`); if (Number(o.result) === 1004022) throw new Error(`头像${e.file}设置失败,文件可能不是图片格式或权限不足`); if (Number(o.result) !== 0) throw new Error(`头像${e.file}设置失败,未知的错误,${o.result}:${o.errMsg}`); return { result: Number(o.result), errMsg: o.errMsg }; } else throw new Error(`头像${e.file}设置失败,无法获取头像,文件可能不存在`); } } const Qwe = l.Object({ count: l.Union([l.Number(), l.String()], { default: 48, description: "获取数量" }) }), jwe = l.Array(l.String(), { description: "表情URL列表" }); class $we extends ie { actionName = re.FetchCustomFace; payloadSchema = Qwe; returnSchema = jwe; actionSummary = "获取自定义表情"; actionTags = ["系统扩展"]; payloadExample = { count: 10 }; returnExample = [ "http://example.com/face1.png" ]; async _handle(e) { return (await this.core.apis.MsgApi.fetchFavEmojiList(+e.count)).emojiInfoList.map((r) => r.url); } } const Gwe = l.Object({ count: l.Union([l.Number(), l.String()], { default: 48, description: "获取数量" }) }), qwe = l.Any({ description: "自定义表情详情列表" }); class zwe extends ie { actionName = re.FetchCustomFaceDetail; payloadSchema = Gwe; returnSchema = qwe; actionSummary = "获取自定义表情详情"; actionTags = ["系统扩展"]; payloadExample = { count: 10 }; returnExample = null; async _handle(e) { return (await this.core.apis.MsgApi.fetchFavEmojiList(+e.count)).emojiInfoList; } } const Hwe = l.Object({ file: l.String({ description: "本地表情文件路径" }), emoji_id: l.Optional(l.Union([l.String(), l.Number()], { description: "表情ID,未提供时传空字符串" })), package_id: l.Optional(l.Union([l.String(), l.Number()], { description: "表情包ID,未提供时传0" })), file_name: l.Optional(l.String({ description: "文件名,未提供时从file路径取basename" })), file_size: l.Optional(l.Union([l.String(), l.Number()], { description: "文件大小,未提供时读取本地文件" })), md5: l.Optional(l.String({ description: "文件MD5,未提供时读取本地文件计算" })), is_mark_face: l.Optional(l.Boolean({ description: "是否商城表情" })), is_origin: l.Optional(l.Boolean({ description: "是否原图" })) }), Wwe = l.Any({ description: "添加结果" }); class Kwe extends ie { actionName = re.AddCustomFace; payloadSchema = Hwe; returnSchema = Wwe; actionSummary = "添加自定义表情"; actionTags = ["系统扩展"]; payloadExample = { file: "C:\\Users\\Public\\face.png", is_origin: !0 }; returnExample = null; async _handle(e) { const n = await SD(e.file), r = e.md5 ?? Wp("md5").update(await qL(e.file)).digest("hex"); return await this.core.apis.MsgApi.addFavEmoji({ emojiId: e.emoji_id?.toString() ?? "", packageId: e.package_id === void 0 ? 0 : Number(e.package_id), emojiPath: e.file, fileSize: e.file_size?.toString() ?? n.size.toString(), fileName: e.file_name ?? ED(e.file), md5: r, isMarkFace: e.is_mark_face ?? !1, isOrigin: e.is_origin ?? !0 }); } } const Vwe = l.Object({ res_id: l.Optional(l.Union([ l.String({ description: "fetch_custom_face_detail返回的resId" }), l.Array(l.String({ description: "fetch_custom_face_detail返回的resId" })) ])), id: l.Optional(l.Union([ l.String({ description: "native deleteFavEmoji字符串ID,通常为resId" }), l.Array(l.String({ description: "native deleteFavEmoji字符串ID,通常为resId" })) ])), ids: l.Optional(l.Array(l.String({ description: "native deleteFavEmoji字符串ID列表,通常为resId列表" }))), md5: l.Optional(l.Union([ l.String({ description: "表情MD5,不能直接删除,请先通过fetch_custom_face_detail获取resId" }), l.Array(l.String({ description: "表情MD5,不能直接删除,请先通过fetch_custom_face_detail获取resId" })) ])) }), Ywe = l.Any({ description: "删除结果" }); class Jwe extends ie { actionName = re.DeleteCustomFace; payloadSchema = Vwe; returnSchema = Ywe; actionSummary = "删除自定义表情"; actionTags = ["系统扩展"]; payloadExample = { res_id: "2707600964_0_0_0_D8EAA70984B402EE10B0F33DB88F4173_0_0" }; returnExample = null; async _handle(e) { const n = e.ids ?? (Array.isArray(e.res_id) ? e.res_id : e.res_id ? [e.res_id] : void 0) ?? (Array.isArray(e.id) ? e.id : e.id ? [e.id] : void 0) ?? []; if (n.length === 0) throw new Error("res_id or ids is required"); return await this.core.apis.MsgApi.deleteFavEmoji(n); } } const Xwe = l.Object({ emoji_id: l.Union([l.Number(), l.String()], { description: "表情ID" }), res_id: l.String({ description: "资源ID" }), md5: l.String({ description: "表情MD5" }), desc: l.String({ description: "新的表情描述" }) }), Zwe = l.Any({ description: "修改结果" }); class eSe extends ie { actionName = re.SetCustomFaceDesc; payloadSchema = Xwe; returnSchema = Zwe; actionSummary = "修改自定义表情描述"; actionTags = ["系统扩展"]; payloadExample = { emoji_id: 1, res_id: "resource-id", md5: "d41d8cd98f00b204e9800998ecf8427e", desc: "新的描述" }; returnExample = null; async _handle(e) { return await this.core.apis.MsgApi.modifyFavEmojiDesc([{ emojiId: Number(e.emoji_id), resId: e.res_id, md5: e.md5, desc: e.desc }]); } } const tSe = l.Object({ user_id: l.String({ description: "用户 QQ" }), file: l.String({ description: "资源路径或URL" }), name: l.String({ description: "文件名" }), upload_file: l.Boolean({ default: !0, description: "是否执行上传" }) }), nSe = l.Object({ file_id: l.Union([l.String(), l.Null()], { description: "文件 ID" }) }); class rSe extends ie { actionName = re.GOCQHTTP_UploadPrivateFile; payloadSchema = tSe; returnSchema = nSe; actionSummary = "上传私聊文件"; actionDescription = "上传本地文件到指定私聊会话中"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.UploadPrivateFile.payload; returnExample = rt.UploadPrivateFile.response; async getPeer(e) { if (e.user_id) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error(`私聊${e.user_id}不存在`); return { chatType: await this.core.apis.FriendApi.isBuddy(n) ? ke.KCHATTYPEC2C : ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: n }; } throw new Error("缺少参数 user_id"); } async _handle(e) { let n = e.file; fe.existsSync(n) && (n = `file://${n}`); const r = await $i(this.core.SnowCatTempPath, n); if (!r.success) throw new Error(r.errMsg); const i = { peer: await b3(this.core, { user_id: e.user_id.toString() }, Ns.Private), deleteAfterSentFiles: [] }, o = await this.obContext.apis.FileApi.createValidSendFileElement(i, r.path, e.name, "", e.upload_file, r.isLocal); return r.isLocal || i.deleteAfterSentFiles.push(r.path), { file_id: (await this.obContext.apis.MsgApi.sendMsgWithOb11UniqueId(await this.getPeer(e), [o], i.deleteAfterSentFiles)).elements.find((c) => c.elementType === Ee.FILE)?.fileElement?.fileUuid || null }; } } const iSe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }), emojiId: l.Union([l.Number(), l.String()], { description: "表情ID" }), emojiType: l.Union([l.Number(), l.String()], { description: "表情类型" }), count: l.Union([l.Number(), l.String()], { default: 20, description: "获取数量" }), cookie: l.String({ default: "", description: "分页Cookie" }) }), oSe = l.Object({ emojiLikesList: l.Array(l.Object({ tinyId: l.String({ description: "TinyID" }), nickName: l.String({ description: "昵称" }), headUrl: l.String({ description: "头像URL" }) }), { description: "表情回应列表" }), cookie: l.String({ description: "分页Cookie" }), isLastPage: l.Boolean({ description: "是否最后一页" }), isFirstPage: l.Boolean({ description: "是否第一页" }), result: l.Number({ description: "结果状态码" }), errMsg: l.String({ description: "错 误信息" }) }, { description: "表情回应详情" }); class aSe extends ie { actionName = re.FetchEmojiLike; actionSummary = "获取表情点赞详情"; actionTags = ["消息扩展"]; payloadExample = { message_id: 12345, emojiId: "123", emojiType: 1, count: 10, cookie: "" }; returnExample = { emojiLikesList: [ { tinyId: "123456", nickName: "测试用户", headUrl: "http://example.com/avatar.png" } ], cookie: "", isLastPage: !0, isFirstPage: !0, result: 0, errMsg: "" }; payloadSchema = iSe; returnSchema = oSe; async _handle(e) { const n = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!n) throw new Error("消息不存在"); const r = (await this.core.apis.MsgApi.getMsgsByMsgId(n.Peer, [n.MsgId])).msgList[0]; if (!r) throw new Error("消息不存在"); return await this.core.apis.MsgApi.getMsgEmojiLikesList( n.Peer, r.msgSeq, e.emojiId.toString(), e.emojiType.toString(), e.cookie, +e.count ); } } const sSe = l.Object({ group_id: l.Optional(l.String({ description: "群号,短ID可不传" })), message_id: l.String({ description: "消息ID,可以传递长ID或短ID" }), emoji_id: l.String({ description: "表情ID" }), emoji_type: l.Optional(l.String({ description: "表情类型" })), count: l.Number({ default: 0, description: "数量,0代表全部" }) }), cSe = l.Object({ emoji_like_list: l.Array( l.Object({ user_id: l.String({ description: "点击者QQ号" }), nick_name: l.String({ description: "昵称?" }) }), { description: "表情回应列表" } ) }); class uSe extends ie { actionName = re.GetEmojiLikes; actionSummary = "获取消息表情点赞列表"; actionTags = ["消息扩展"]; payloadExample = { message_id: "12345", emoji_id: "123" }; returnExample = { emoji_like_list: [ { user_id: "654321", nick_name: "测试用户" } ] }; payloadSchema = sSe; returnSchema = cSe; async _handle(e) { let n, r; if (ot.isShortId(e.message_id)) { const u = ot.getMsgIdAndPeerByShortId(+e.message_id); if (!u) throw new Error("消息不存在"); n = u.Peer, r = u.MsgId; } else { if (!e.group_id) throw new Error("长ID模式下必须提供群号"); n = { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id }, r = e.message_id; } const i = (await this.core.apis.MsgApi.getMsgsByMsgId(n, [r])).msgList[0]; if (!i) throw new Error("消息不存在"); const o = e.emoji_type ?? (e.emoji_id.length > 3 ? "2" : "1"), a = []; let s = ""; const c = e.count === 0 ? 200 : Math.ceil(e.count / 15); for (let u = 0; u < c; u++) { const d = await this.core.apis.MsgApi.getMsgEmojiLikesList( n, i.msgSeq, e.emoji_id.toString(), o, s, 15 ); if (Array.isArray(d.emojiLikesList)) for (const p of d.emojiLikesList) a.push({ user_id: p.tinyId, nick_name: p.nickName }); if (d.isLastPage || !d.cookie) break; s = d.cookie; } return e.count > 0 && a.splice(e.count), { emoji_like_list: a }; } } const lSe = l.Object({ user_id: l.String({ description: "QQ号" }), event_type: l.Number({ description: "事件类型" }) }), dSe = l.Any({ description: "设置结果" }); class pSe extends ie { actionName = re.SetInputStatus; payloadSchema = lSe; returnSchema = dSe; actionSummary = "设置输入状态"; actionTags = ["系统扩展"]; payloadExample = { user_id: "123456789", event_type: 1 }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("uid is empty"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.MsgApi.sendShowInputStatusReq(r, e.event_type); } } const fSe = l.Object({ token: l.Number({ description: "CSRF Token" }) }); class hSe extends ie { actionName = re.GetCSRF; payloadSchema = l.Object({}); returnSchema = fSe; actionSummary = "获取 CSRF Token"; actionDescription = "获取 CSRF Token"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = { token: 123456789 }; async _handle() { const e = await this.core.apis.UserApi.getSKey(); if (!e) throw new Error("SKey is undefined"); return { token: +this.core.apis.WebApi.getBknFromSKey(e) }; } } const mSe = l.Object({ group_id: l.String({ description: "群号" }), notice_id: l.String({ description: "公告ID" }) }), gSe = l.Any({ description: "操作结果" }); class ySe extends ie { actionName = re.DelGroupNotice; payloadSchema = mSe; returnSchema = gSe; actionSummary = "删除群公告"; actionDescription = "删除群聊中的公告"; actionTags = ["群组接口"]; payloadExample = at.DelGroupNotice.payload; returnExample = at.DelGroupNotice.response; async _handle(e) { const n = e.group_id.toString(), r = e.notice_id; return await this.core.apis.GroupApi.deleteGroupBulletin(n, r); } } const bSe = l.Object({ group_id: l.String({ description: "群号" }) }), vSe = l.Any({ description: "群扩展信息" }); class xSe extends ie { actionName = re.GetGroupInfoEx; actionSummary = "获取群详细信息 (扩展)"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456" }; returnExample = {}; payloadSchema = bSe; returnSchema = vSe; async _handle(e) { return (await this.core.apis.GroupApi.getGroupExtFE0Info([e.group_id.toString()])).result.groupExtInfos.get(e.group_id.toString()); } } const wSe = l.Object({ group_id: l.Union([l.Number(), l.String()], { description: "群号" }), need_short_url: l.Optional(l.Union([l.Boolean(), l.String()], { default: !0, description: "是否返回短链 (qm.qq.com/q/xxx),false 返回完整 universal-share 链接" })), src_id: l.Optional(l.Union([l.Number(), l.String()], { default: 73, description: "分享来源 ID" })), additional_param: l.Optional(l.String({ default: "", description: "附加参数" })) }), SSe = l.Object({ url: l.String({ description: "群分享链接" }) }, { description: "群分享链接" }); class _Se extends ie { actionName = re.GetGroupShareLink; actionSummary = "获取群分享链接"; actionDescription = "通过 NTQQ 原生 getJoinGroupLink 获取群的 H5 分享/加群链接 (qm.qq.com/q/xxx 或 qun.qq.com/universal-share/share?...)"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", need_short_url: !0 }; returnExample = { url: "https://qm.qq.com/q/xxxxxxxxxx" }; payloadSchema = wSe; returnSchema = SSe; async _handle(e) { const n = e.need_short_url === void 0 ? !0 : e.need_short_url.toString() === "true", r = e.src_id === void 0 ? 73 : Number(e.src_id), i = await this.core.apis.GroupApi.getJoinGroupLink( e.group_id.toString(), n, r, e.additional_param ?? "" ); if (!i?.url) throw new Error(`获取群分享链接失败: ${i?.errMsg || JSON.stringify(i)}`); return { url: i.url }; } } const ESe = l.Object({ group_id: l.String({ description: "群号" }), file_id: l.String({ description: "文件ID" }) }), ASe = l.Any({ description: "删除结果" }); class ISe extends ie { actionName = re.GOCQHTTP_DeleteGroupFile; payloadSchema = ESe; returnSchema = ASe; actionSummary = "删除群文件"; actionDescription = "在群文件系统中删除指定的文件"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.DeleteGroupFile.payload; returnExample = rt.DeleteGroupFile.response; async _handle(e) { const n = on.decodeModelId(e.file_id); if (!n || !n.fileId) throw new Error("Invalid file_id"); return await this.core.apis.GroupApi.delGroupFile(e.group_id.toString(), [n.fileId]); } } const CSe = l.Object({ group_id: l.String({ description: "群号" }), // 兼容gocq 与name二选一 folder_name: l.Optional(l.String({ description: "文件夹名称" })), // 兼容gocq 与folder_name二选一 name: l.Optional(l.String({ description: "文件夹名称" })) }), TSe = l.Object({ result: l.Any({ description: "操作结果" }), groupItem: l.Any({ description: "群项信息" }) }, { description: "创建文件夹结果" }); class kSe extends ie { actionName = re.GoCQHTTP_CreateGroupFileFolder; payloadSchema = CSe; returnSchema = TSe; actionSummary = "创建群文件目录"; actionDescription = "在群文件系统中创建新的文件夹"; actionTags = ["Go-CQHTTP"]; payloadExample = { group_id: "123456789", folder_name: "新建文件夹" }; returnExample = { result: {}, groupItem: {} }; async _handle(e) { const n = e.folder_name || e.name; return (await this.core.apis.GroupApi.creatGroupFileFolder(e.group_id.toString(), n)).resultWithGroupItem; } } const NSe = l.Object({ group_id: l.String({ description: "群号" }), folder_id: l.Optional(l.String({ description: "文件夹ID" })), folder: l.Optional(l.String({ description: "文件夹ID" })) }), PSe = l.Any({ description: "删除结果" }); class DSe extends ie { actionName = re.GoCQHTTP_DeleteGroupFileFolder; payloadSchema = NSe; returnSchema = PSe; actionSummary = "删除群文件目录"; actionDescription = "在群文件系统中删除指定的文件夹"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.DeleteGroupFileFolder.payload; returnExample = rt.DeleteGroupFileFolder.response; async _handle(e) { return (await this.core.apis.GroupApi.delGroupFileFolder( e.group_id.toString(), e.folder ?? e.folder_id ?? "" )).groupFileCommonResult; } } const OSe = l.Object({ group_id: l.String({ description: "群号" }) }), FSe = l.Object({ file_count: l.Number({ description: "文件总数" }), limit_count: l.Number({ description: "文件上限" }), used_space: l.Number({ description: "已使用空间" }), total_space: l.Number({ description: "总空间" }) }, { description: "群文件系统信息" }); class MSe extends ie { actionName = re.GoCQHTTP_GetGroupFileSystemInfo; payloadSchema = OSe; returnSchema = FSe; actionSummary = "获取群文件系统信息"; actionDescription = "获取群聊文件系统的空间及状态信息"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupFileSystemInfo.payload; returnExample = rt.GetGroupFileSystemInfo.response; async _handle(e) { const n = e.group_id.toString(), [r, i] = await Promise.all([ this.core.apis.GroupApi.getGroupFileCount([n]), this.core.apis.GroupApi.getGroupFileSpace(n) ]), o = r.groupFileCounts[0]; if (o === void 0) throw new Error("Group not found"); return { file_count: o, limit_count: 1e4, // Real values from the kernel's groupSpaceResult; fall back to the old // placeholders if the field is unexpectedly absent. used_space: i?.usedSpace ?? 0, total_space: i?.totalSpace ?? 10 * 1024 * 1024 * 1024 }; } } const RSe = l.Object({ group_id: l.String({ description: "群号" }), file_count: l.Union([l.Number(), l.String()], { default: 50, description: "文件数量" }) }), BSe = l.Object({ files: l.Array(l.Any(), { description: "文件列表" }), folders: l.Array(l.Any(), { description: "文件夹列表" }) }, { description: "群根目录文件列表" }); class USe extends ie { actionName = re.GoCQHTTP_GetGroupRootFiles; payloadSchema = RSe; returnSchema = BSe; actionSummary = "获取群根目录文件列表"; actionDescription = "获取群文件根目录下的所有文件和文件夹"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupRootFiles.payload; returnExample = rt.GetGroupRootFiles.response; async _handle(e) { const n = await this.core.apis.MsgApi.getGroupFileList(e.group_id.toString(), { sortType: 1, fileCount: +e.file_count, startIndex: 0, sortOrder: 2, showOnlinedocFolder: 0 }); return { files: n.filter((r) => r.fileInfo).map((r) => Hi.file(r.peerId, r.fileInfo)), folders: n.filter((r) => r.folderInfo).map((r) => Hi.folder(r.peerId, r.folderInfo)) }; } } const LSe = l.Object({ group_id: l.String({ description: "群号" }), folder_id: l.Optional(l.String({ description: "文件夹ID" })), folder: l.Optional(l.String({ description: "文件夹ID" })), file_count: l.Union([l.Number(), l.String()], { default: 50, description: "文件数量" }) }), QSe = l.Object({ files: l.Array(l.Unknown(), { description: "文件列表" }), folders: l.Array(l.Unknown(), { description: "文件夹列表" }) }, { description: "群文件夹文件列表" }); class jSe extends ie { actionName = re.GoCQHTTP_GetGroupFilesByFolder; payloadSchema = LSe; returnSchema = QSe; actionSummary = "获取群文件夹文件列表"; actionDescription = "获取指定群文件夹下的文件及子文件夹列表"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupFilesByFolder.payload; returnExample = rt.GetGroupFilesByFolder.response; async _handle(e) { const n = await this.core.apis.MsgApi.getGroupFileList(e.group_id.toString(), { sortType: 1, fileCount: +e.file_count, startIndex: 0, sortOrder: 2, showOnlinedocFolder: 0, folderId: e.folder ?? e.folder_id ?? "" }); return { files: (Array.isArray(n) ? n : []).filter((i) => i.fileInfo).map((i) => Hi.file(i.peerId, i.fileInfo)), folders: [] }; } } const $Se = l.Object({ count: l.Union([l.Number(), l.String()], { default: 50, description: "获取的消息数量" }) }), GSe = l.Object({ invited_requests: l.Array(rS, { description: "进群邀请列表" }), InvitedRequest: l.Array(rS, { description: "进群邀请列表 (兼容)" }), join_requests: l.Array(rS, { description: "进群申请列表" }) }); class qSe extends ie { actionName = re.GetGroupSystemMsg; payloadSchema = $Se; returnSchema = GSe; actionSummary = "获取群系统消息"; actionDescription = "获取群系统消息"; actionTags = ["系统接口"]; payloadExample = { count: 50 }; returnExample = { invited_requests: [], InvitedRequest: [], join_requests: [] }; async _handle(e) { const n = await this.core.apis.GroupApi.getSingleScreenNotifies(!1, +e.count), r = { invited_requests: [], InvitedRequest: [], join_requests: [] }, i = n.map(async (o) => { const a = o.user1?.uid ? +await this.core.apis.UserApi.getUinByUidV2(o.user1.uid) : 0, s = o.user2?.uid ? +await this.core.apis.UserApi.getUinByUidV2(o.user2.uid) : 0, c = { request_id: +o.seq, invitor_uin: a, invitor_nick: o.user1?.nickName || "", group_id: +o.group?.groupCode, message: o?.postscript || "", group_name: o.group?.groupName || "", checked: o.status !== dc.KUNHANDLE, actor: s, requester_nick: o.user1?.nickName || "" }; o.type === 1 ? r.InvitedRequest.push(c) : o.type === 7 && r.join_requests.push(c); }); return await Promise.all(i), r.invited_requests = r.InvitedRequest, r; } } class ur extends ie { async check(e) { const n = await super.check(e); return n.valid ? this.core.apis.PacketApi.packetStatus ? { valid: !0 } : { valid: !1, message: "packetBackend不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!错误堆栈信息:" + this.core.apis.PacketApi.clientLogStack } : n; } } class zSe extends ie { async check(e) { const n = await super.check(e); return n.valid ? this.core.apis.PacketApi.available ? { valid: !0 } : { valid: !1, message: "packetBackend发包能力不可用,请参照文档 https://napneko.github.io/config/advanced 和启动日志检查packetBackend状态或进行配置!错误堆栈信息:" + this.core.apis.PacketApi.clientLogStack } : n; } } class HSe extends ur { actionName = re.GetPacketStatus; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "获取Packet状态"; actionDescription = "获取底层Packet服务的运行状态"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = null; async _handle() { } } const WSe = l.Object({ user_id: l.String({ description: "QQ号" }) }), KSe = l.Object({ status: l.Number({ description: "在线状态" }), ext_status: l.Number({ description: "扩展状态" }) }, { description: "用户状态" }); class VSe extends ur { actionName = re.GetUserStatus; payloadSchema = WSe; returnSchema = KSe; actionSummary = "获取用户在线状态"; actionTags = ["系统扩展"]; payloadExample = { user_id: "123456789" }; returnExample = { status: 10, ext_status: 0 }; async _handle(e) { const n = await this.core.apis.PacketApi.pkt.operation.GetStrangerStatus(+e.user_id); if (!n) throw new Error("无法获取用户状态"); return n; } } const YSe = l.Array(l.Any(), { description: "Rkey列表" }); class JSe extends ur { actionName = re.GetRkey; payloadSchema = l.Object({}); returnSchema = YSe; actionSummary = "获取 RKey"; actionTags = ["系统扩展"]; payloadExample = {}; returnExample = [ { key: "rkey_value", expired: 1734567890 } ]; async _handle() { return await this.core.apis.PacketApi.pkt.operation.FetchRkey(); } } const XSe = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.String({ description: "QQ号" }), special_title: l.String({ default: "", description: "专属头衔" }) }), ZSe = l.Void({ description: "设置结果" }); class e_e extends ur { actionName = re.SetSpecialTitle; payloadSchema = XSe; returnSchema = ZSe; actionSummary = "设置专属头衔"; actionDescription = "设置群聊中指定成员的专属头衔"; actionTags = ["扩展接口"]; payloadExample = Nn.SetSpecialTitle.payload; returnExample = Nn.SetSpecialTitle.response; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); await this.core.apis.PacketApi.pkt.operation.SetGroupSpecialTitle(+e.group_id, n, e.special_title); } } const t_e = l.Object({ group_id: l.String({ description: "群号" }) }), n_e = l.Array(l.Any(), { description: "禁言成员列表" }); class r_e extends ie { actionName = re.GetGroupShutList; payloadSchema = t_e; returnSchema = n_e; actionSummary = "获取群禁言列表"; actionTags = ["群组接口"]; payloadExample = { group_id: "123456789" }; returnExample = [ { user_id: 123456789, nickname: "禁言用户", shut_up_time: 1734567890 } ]; async _handle(e) { return await this.core.apis.GroupApi.getGroupShutUpMemberList(e.group_id.toString()); } } const i_e = l.Object({ group_id: l.String({ description: "群号" }), no_cache: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否不使用缓存" })) }), o_e = l.Array(l.Any(), { description: "群成员列表" }); class a_e extends ie { actionName = re.GetGroupMemberList; payloadSchema = i_e; returnSchema = o_e; actionSummary = "获取群成员列表"; actionDescription = "获取群聊中的所有成员列表"; actionTags = ["群组接口"]; payloadExample = at.GetGroupMemberList.payload; returnExample = at.GetGroupMemberList.response; async _handle(e) { const n = e.group_id.toString(), r = this.parseBoolean(e.no_cache ?? !1), i = await this.getGroupMembers(n, r), o = await Promise.all( Array.from(i.values()).map( (a) => Hi.groupMember(n, a) ) ); return Array.from(new Map(o.map((a) => [a.user_id, a])).values()); } parseBoolean(e) { return typeof e == "string" ? e === "true" : e; } async getGroupMembers(e, n) { const r = this.core.apis.GroupApi.groupMemberCache; let i = r.get(e); if (n || !i) { const o = this.core.apis.GroupApi.refreshGroupMemberCache(e, !0).then().catch(); if (i = r.get(e) || await o, !i) throw new Error(`Failed to get group member list for group ${e}`); } return i; } } const s_e = l.Object({ group_id: l.String({ description: "群号" }), file_id: l.String({ description: "文件ID" }) }), c_e = l.Object({ url: l.Optional(l.String({ description: "文件下载链接" })) }, { description: "群文件URL信息" }); class u_e extends ur { actionName = re.GOCQHTTP_GetGroupFileUrl; payloadSchema = s_e; returnSchema = c_e; actionSummary = "获取群文件URL"; actionDescription = "获取指定群文件的下载链接"; actionTags = ["文件接口"]; payloadExample = na.GetGroupFileUrl.payload; returnExample = na.GetGroupFileUrl.response; async _handle(e) { const n = on.decode(e.file_id) || on.decodeModelId(e.file_id); if (n?.fileUUID) return { url: await this.core.apis.PacketApi.pkt.operation.GetGroupFileUrl(+e.group_id, n.fileUUID) }; throw new Error("real fileUUID not found!"); } } const l_e = l.Object({ domain: l.String({ description: "需要获取 cookies 的域名" }) }), d_e = l.Object({ cookies: l.String({ description: "Cookies" }), token: l.Number({ description: "CSRF Token" }) }); class p_e extends ie { actionName = re.GetCredentials; payloadSchema = l_e; returnSchema = d_e; actionSummary = "获取登录凭证"; actionDescription = "获取登录凭证"; actionTags = ["系统接口"]; payloadExample = { domain: "qun.qq.com" }; returnExample = { cookies: "uin=o123456789; skey=@abc12345;", token: 123456789 }; async _handle(e) { const n = await this.core.apis.UserApi.getCookies(e.domain), r = Object.entries(n).map(([o, a]) => `${o}=${a}`).join("; "), i = n?.skey ? this.core.apis.WebApi.getBknFromCookie(n) : ""; return { cookies: r, token: +i }; } } class f_e extends ie { actionName = re.Reboot; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "重启服务"; actionDescription = "重启服务"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = null; async _handle() { const e = await de.requestRestartProcess(); if (!e.result) throw new Error(e.message || "进程重启失败"); } } const h_e = l.Object({ group_id: l.String({ description: "群号" }) }), m_e = l.Void({ description: "打卡结果" }); class gL extends ur { payloadSchema = h_e; returnSchema = m_e; actionSummary = "群打卡"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456789" }; returnExample = null; async _handle(e) { return await this.core.apis.PacketApi.pkt.operation.GroupSign(+e.group_id); } } class g_e extends gL { actionName = re.SetGroupSign; } class y_e extends gL { actionName = re.SendGroupSign; } const b_e = l.Object({ group_id: l.String({ description: "群号" }) }), v_e = l.Object({ can_at_all: l.Boolean({ description: "是否可以艾特全体" }), remain_at_all_count_for_group: l.Number({ description: "群艾特全体剩余次数" }), remain_at_all_count_for_uin: l.Number({ description: "个人艾特全体剩余次数" }) }, { description: "群艾特全体剩余次数" }); class x_e extends ie { actionName = re.GoCQHTTP_GetGroupAtAllRemain; payloadSchema = b_e; returnSchema = v_e; actionSummary = "获取群艾特全体剩余次数"; actionDescription = "获取指定群聊中艾特全体成员的剩余次数"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GetGroupAtAllRemain.payload; returnExample = rt.GetGroupAtAllRemain.response; async _handle(e) { const n = await this.core.apis.GroupApi.getGroupRemainAtTimes(e.group_id.toString()); return { can_at_all: n.atInfo.canAtAll, remain_at_all_count_for_group: n.atInfo.RemainAtAllCountForGroup, remain_at_all_count_for_uin: n.atInfo.RemainAtAllCountForUin }; } } const w_e = l.Object({ url: l.String({ description: "要检查的 URL" }) }), S_e = l.Object({ level: l.Number({ description: "安全等级 (1: 安全, 2: 未知, 3: 危险)" }) }); class sD extends ie { actionName = re.GoCQHTTP_CheckUrlSafely; payloadSchema = w_e; returnSchema = S_e; actionSummary = "检查URL安全性"; actionDescription = "检查指定URL的安全等级"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GoCQHTTPCheckUrlSafely.payload; returnExample = rt.GoCQHTTPCheckUrlSafely.response; async _handle() { return { level: 1 }; } } const __e = l.Object({ model: l.Optional(l.String({ description: "模型名称" })) }), E_e = l.Array(l.Object({ variants: l.Object({ model_show: l.String({ description: "显示名称" }), need_pay: l.Boolean({ description: "是否需要付费" }) }) }), { description: "机型显示列表" }); class A_e extends ie { actionName = re.GoCQHTTP_GetModelShow; payloadSchema = __e; returnSchema = E_e; actionSummary = "获取机型显示"; actionDescription = "获取当前账号可用的设备机型显示名称列表"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GoCQHTTPGetModelShow.payload; returnExample = rt.GoCQHTTPGetModelShow.response; async _handle(e) { return e.model || (e.model = "napcat"), [{ variants: { model_show: "napcat", need_pay: !1 } }]; } } class I_e extends ie { actionName = re.GoCQHTTP_SetModelShow; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "设置机型"; actionDescription = "设置当前账号的设备机型名称"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GoCQHTTPSetModelShow.payload; returnExample = rt.GoCQHTTPSetModelShow.response; async _handle() { } } const C_e = l.Object({ friend_id: l.Optional(l.Union([l.String(), l.Number()], { description: "好友 QQ 号" })), user_id: l.Optional(l.Union([l.String(), l.Number()], { description: "用户 QQ 号" })), temp_block: l.Optional(l.Boolean({ description: "是否加入黑名单" })), temp_both_del: l.Optional(l.Boolean({ description: "是否双向删除" })) }); class T_e extends ie { actionName = re.GoCQHTTP_DeleteFriend; payloadSchema = C_e; returnSchema = l.Any(); actionSummary = "删除好友"; actionDescription = "从好友列表中删除指定用户"; actionTags = ["Go-CQHTTP"]; payloadExample = rt.GoCQHTTPDeleteFriend.payload; returnExample = rt.GoCQHTTPDeleteFriend.response; async _handle(e) { const n = e.friend_id ?? e.user_id ?? "", r = await this.core.apis.UserApi.getUidByUinV2(n.toString()); return r ? await this.core.apis.FriendApi.isBuddy(r) ? await this.core.apis.FriendApi.delBuddy(r, e.temp_block, e.temp_both_del) : { valid: !1, message: "不是好友" } : { valid: !1, message: "好友不存在" }; } } class va { static sdkId = "V1_PC_MINISDK_99.99.99_1_APP_A"; template; static appMap = /* @__PURE__ */ new Map(); constructor(e) { this.template = e; } static get(e) { return this.appMap.get(e); } static Bili = new class extends va { constructor() { super({ sdkId: va.sdkId, appId: "1109937557", scene: 1, templateType: 1, businessType: 0, verType: 3, shareType: 0, versionId: "cfc5f7b05b44b5956502edaecf9d2240", withShareTicket: 0, iconUrl: "https://miniapp.gtimg.cn/public/appicon/51f90239b78a2e4994c11215f4c4ba15_200.jpg" }), va.appMap.set("bili", this); } }(); static WeiBo = new class extends va { constructor() { super({ sdkId: va.sdkId, appId: "1109224783", scene: 1, templateType: 1, businessType: 0, verType: 3, shareType: 0, versionId: "e482a3cc4e574d9b772e96ba6eec9ba2", withShareTicket: 0, iconUrl: "https://miniapp.gtimg.cn/public/appicon/35bbb44dc68e65194cfacfb206b8f1f7_200.jpg" }), va.appMap.set("weibo", this); } }(); } class oS { static generateReq(e, n) { return { ...e, ...n }; } static RawToSend(e) { return { ver: e.ver, prompt: e.prompt, config: e.config, app: e.appName, view: e.appView, meta: e.metaData, miniappShareOrigin: 3, miniappOpenRefer: "10002" }; } static SendToRaw(e) { return { appName: e.app, appView: e.view, ver: e.ver, desc: e.meta.detail_1.desc, prompt: e.prompt, metaData: e.meta, config: e.config }; } } const k_e = l.Union([ l.Object({ type: l.Union([l.Literal("bili"), l.Literal("weibo")], { description: "模板类型" }), title: l.String({ description: "标题" }), desc: l.String({ description: "描述" }), picUrl: l.String({ description: "图片URL" }), jumpUrl: l.String({ description: "跳转URL" }), webUrl: l.Optional(l.String({ description: "网页URL" })), rawArkData: l.Optional(l.Union([l.String()], { description: "是否返回原始Ark数据" })) }), l.Object({ title: l.String({ description: "标题" }), desc: l.String({ description: "描述" }), picUrl: l.String({ description: "图片URL" }), jumpUrl: l.String({ description: "跳转URL" }), iconUrl: l.String({ description: "图标URL" }), webUrl: l.Optional(l.String({ description: "网页URL" })), appId: l.String({ description: "小程序AppID" }), scene: l.String({ description: "场景ID" }), templateType: l.String({ description: "模板类型" }), businessType: l.String({ description: "业务类型" }), verType: l.String({ description: "版本类型" }), shareType: l.String({ description: "分享类型" }), versionId: l.String({ description: "版本ID" }), sdkId: l.String({ description: "SDK ID" }), withShareTicket: l.String({ description: "是否携带分享票据" }), rawArkData: l.Optional(l.String({ description: "是否返回原始Ark数据" })) }) ], { description: "小程序Ark参数" }), N_e = l.Object({ data: l.Any({ description: "Ark数据" }) }, { description: "获取小程序Ark结果" }); class P_e extends ur { actionName = re.GetMiniAppArk; payloadSchema = k_e; returnSchema = N_e; actionSummary = "获取小程序 Ark"; actionTags = ["系统扩展"]; payloadExample = { type: "bili", title: "测试标题", desc: "测试描述", picUrl: "http://example.com/pic.jpg", jumpUrl: "http://example.com" }; returnExample = { data: { ark: "ark_content" } }; async _handle(e) { let n; const r = { title: e.title, desc: e.desc, picUrl: e.picUrl, jumpUrl: e.jumpUrl, webUrl: e.webUrl ?? "" }; if ("type" in e) { const o = va.get(e.type)?.template; if (!o) throw new Error("未知的模板类型"); n = oS.generateReq(r, o); } else { const { appId: o, scene: a, iconUrl: s, templateType: c, businessType: u, verType: d, shareType: p, versionId: f, withShareTicket: m } = e; n = oS.generateReq( r, { sdkId: e.sdkId ?? va.sdkId, appId: o, scene: +a, iconUrl: s, templateType: +c, businessType: +u, verType: +d, shareType: +p, versionId: f, withShareTicket: +m } ); } const i = await this.core.apis.PacketApi.pkt.operation.GetMiniAppAdaptShareInfo(n); return { data: e.rawArkData === "true" ? i : oS.RawToSend(i) }; } } var A3 = /* @__PURE__ */ ((t) => (t[t.Unknown = 0] = "Unknown", t[t.Sound = 1] = "Sound", t[t.Sing = 2] = "Sing", t))(A3 || {}); const D_e = l.Object({ character: l.String({ description: "角色ID" }), group_id: l.String({ description: "群号" }), text: l.String({ description: "语音文本内容" }) }), O_e = l.String({ description: "语音URL" }); class F_e extends ur { actionName = re.GetAiRecord; payloadSchema = D_e; returnSchema = O_e; actionSummary = "获取 AI 语音"; actionDescription = "通过 AI 语音引擎获取指定文本的语音 URL"; actionTags = ["AI 扩展"]; payloadExample = { character: "ai_char_1", group_id: "123456", text: "你好" }; returnExample = "http://example.com/ai_voice.silk"; async _handle(e) { const n = await this.core.apis.PacketApi.pkt.operation.GetAiVoice(+e.group_id, e.character, e.text, A3.Sound); if (!n.msgInfoBody[0]) throw new Error("No voice data"); return await this.core.apis.PacketApi.pkt.operation.GetGroupPttUrl(+e.group_id, n.msgInfoBody[0].index); } } const M_e = l.Object({ character: l.String({ description: "角色ID" }), group_id: l.String({ description: "群号" }), text: l.String({ description: "语音文本内容" }) }), R_e = l.Object({ message_id: l.Number({ description: "消息ID" }) }, { description: "发送结果" }); class B_e extends ur { actionName = re.SendGroupAiRecord; payloadSchema = M_e; returnSchema = R_e; actionSummary = "发送群 AI 语音"; actionDescription = "发送 AI 生成的语音到指定群聊"; actionTags = ["AI 扩展"]; payloadExample = { character: "ai_char_1", group_id: "123456", text: "你好" }; returnExample = {}; async _handle(e) { return await this.core.apis.PacketApi.pkt.operation.GetAiVoice(+e.group_id, e.character, e.text, A3.Sound), { message_id: 0 // can't get message_id from GetAiVoice }; } } const U_e = l.Object({ group_id: l.String({ description: "群号" }), chat_type: l.Union([l.Number(), l.String()], { default: 1, description: "聊天类型" }) }), L_e = l.Array( l.Object({ type: l.String({ description: "角色类型" }), characters: l.Array( l.Object({ character_id: l.String({ description: "角色ID" }), character_name: l.String({ description: "角色名称" }), preview_url: l.String({ description: "预览URL" }) }), { description: "角色列表" } ) }), { description: "AI角色列表" } ); class Q_e extends ur { actionName = re.GetAiCharacters; payloadSchema = U_e; returnSchema = L_e; actionSummary = "获取AI角色列表"; actionDescription = "获取群聊中的AI角色列表"; actionTags = ["扩展接口"]; payloadExample = Nn.GetAiCharacters.payload; returnExample = Nn.GetAiCharacters.response; async _handle(e) { const n = Number(e.chat_type); return (await this.core.apis.PacketApi.pkt.operation.FetchAiVoiceList(+e.group_id, n))?.map((i) => ({ type: i.category, characters: i.voices.map((o) => ({ character_id: o.voiceId, character_name: o.voiceDisplayName, preview_url: o.voiceExampleUrl })) })) ?? []; } } const n0 = { GetGuildList: { payload: {}, response: [{ guild_id: "123456", guild_name: "测试频道" }] }, GetGuildProfile: { payload: { guild_id: "123456" }, response: { guild_id: "123456", guild_name: "测试频道", guild_display_id: "123" } } }; class j_e extends ie { actionName = re.GetGuildList; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "获取频道列表"; actionDescription = "获取当前帐号已加入的频道列表"; actionTags = ["频道接口"]; payloadExample = n0.GetGuildList.payload; returnExample = n0.GetGuildList.response; async _handle() { } } class $_e extends ie { actionName = re.GetGuildProfile; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "获取频道个人信息"; actionDescription = "获取当前帐号在频道中的个人资料"; actionTags = ["频道接口"]; payloadExample = n0.GetGuildProfile.payload; returnExample = n0.GetGuildProfile.response; async _handle() { } } const G_e = l.Object({ clientkey: l.Optional(l.String({ description: "客户端Key" })) }, { description: "获取ClientKey结果" }); class q_e extends ie { actionName = re.GetClientkey; payloadSchema = l.Object({}); returnSchema = G_e; actionSummary = "获取ClientKey"; actionDescription = "获取当前登录帐号的ClientKey"; actionTags = ["扩展接口"]; payloadExample = Nn.GetClientkey.payload; returnExample = Nn.GetClientkey.response; async _handle() { return { clientkey: (await this.core.apis.UserApi.forceFetchClientKey()).clientKey }; } } const z_e = l.Object({ cmd: l.String({ description: "命令字" }), data: l.String({ description: "十六进制数据" }), rsp: l.Union([l.String(), l.Boolean()], { default: !0, description: "是否等待响应" }) }), H_e = l.Union([l.String({ description: "响应十六进制数据" }), l.Undefined()], { description: "发包结果" }); class W_e extends ur { payloadSchema = z_e; returnSchema = H_e; actionName = re.SendPacket; actionSummary = "发送原始数据包"; actionTags = ["系统扩展"]; payloadExample = { cmd: "Example.Cmd", data: "123456", rsp: !0 }; returnExample = "123456"; async _handle(e) { const n = typeof e.rsp == "boolean" ? e.rsp : e.rsp === "true", r = Buffer.from(e.data, "hex"), i = await this.core.apis.PacketApi.pkt.operation.sendPacket({ cmd: e.cmd, data: r }, n); return typeof i == "object" ? i.toString("hex") : void 0; } } const Ps = { SendPoke: { payload: { user_id: "123456789" }, response: {} }, SetGroupTodo: { payload: { group_id: "123456", message_id: "123456789" }, response: {} }, CompleteGroupTodo: { payload: { group_id: "123456", message_id: "123456789" }, response: {} }, CancelGroupTodo: { payload: { group_id: "123456", message_id: "123456789" }, response: {} } }, K_e = l.Object({ group_id: l.Optional(l.String({ description: "群号" })), user_id: l.String({ description: "用户QQ" }), target_id: l.Optional(l.String({ description: "目标QQ" })) }); class I3 extends zSe { payloadSchema = K_e; returnSchema = l.Null(); actionSummary = "发送戳一戳"; actionDescription = "在群聊或私聊中发送戳一戳动作"; actionTags = ["核心接口"]; payloadExample = Ps.SendPoke.payload; returnExample = Ps.SendPoke.response; async _handle(e) { const n = e.target_id?.toString() || e.user_id?.toString(), r = e.group_id?.toString() || e.user_id?.toString(), i = !!e.group_id; if (!n || !r) throw new Error("请检查参数,缺少 user_id 或 group_id"); await this.core.apis.PacketApi.pkt.operation.SendPoke(i, +r, +n); } } class V_e extends I3 { actionName = re.SendPoke; } class Y_e extends I3 { actionName = re.GroupPoke; } class J_e extends I3 { actionName = re.FriendPoke; } const X_e = l.Object({ face_id: l.Union([l.Number(), l.String()], { description: "图标ID" }), // 参考 face_config.json 的 QSid face_type: l.Union([l.Number(), l.String()], { default: "1", description: "图标类型" }), wording: l.String({ default: " ", description: "状态文字内容" }) }), Z_e = l.String({ description: "错误信息(如果有)" }); class e2e extends ie { actionName = re.SetDiyOnlineStatus; payloadSchema = X_e; returnSchema = Z_e; actionSummary = "设置自定义在线状态"; actionDescription = "设置自定义在线状态"; actionTags = ["用户扩展"]; payloadExample = { face_id: "123", face_type: "1", wording: "自定义状态" }; returnExample = ""; async _handle(e) { const n = await this.core.apis.UserApi.setDiySelfOnlineStatus( e.face_id.toString(), e.wording, e.face_type.toString() ); if (n.result !== 0) throw new Error("设置在线状态失败"); return n.errMsg; } } class t2e extends ie { actionName = re.Exit; payloadSchema = l.Object({}); returnSchema = l.Object({}); actionSummary = "退出登录"; actionTags = ["系统扩展"]; payloadExample = {}; returnExample = null; async _handle() { process.exit(0); } } const n2e = l.Object({ group_id: l.String({ description: "群号" }), bot_appid: l.String({ description: "机器人AppID" }), button_id: l.String({ default: "", description: "按钮ID" }), callback_data: l.String({ default: "", description: "回调数据" }), msg_seq: l.String({ default: "10086", description: "消息序列号" }) }), r2e = l.Any({ description: "点击结果" }); class i2e extends ie { actionName = re.ClickInlineKeyboardButton; payloadSchema = n2e; returnSchema = r2e; actionSummary = "点击内联键盘按钮"; actionTags = ["消息扩展"]; payloadExample = { group_id: "123456", bot_appid: "1234567890", button_id: "btn_1", callback_data: "", msg_seq: "10086" }; returnExample = {}; async _handle(e) { return await this.core.apis.MsgApi.clickInlineKeyboardButton({ buttonId: e.button_id, peerId: e.group_id.toString(), botAppid: e.bot_appid, msgSeq: e.msg_seq, callback_data: e.callback_data, dmFlag: 0, chatType: 2 }); } } const o2e = l.Object({ file_id: l.String({ description: "文件ID" }) }), a2e = l.Object({ url: l.Optional(l.String({ description: "文件下载链接" })) }, { description: "私聊文件URL信息" }); class s2e extends ur { actionName = re.NapCat_GetPrivateFileUrl; payloadSchema = o2e; returnSchema = a2e; actionSummary = "获取私聊文件URL"; actionDescription = "获取指定私聊文件的下载链接"; actionTags = ["文件接口"]; payloadExample = na.GetPrivateFileUrl.payload; returnExample = na.GetPrivateFileUrl.response; async _handle(e) { const n = on.decode(e.file_id); if (n?.fileUUID && n.msgId) { const r = await this.core.apis.MsgApi.getMsgsByMsgId(n.peer, [n.msgId]), i = this.core.selfInfo.uid, o = r.msgList[0]?.elements.map((a) => a.fileElement?.file10MMd5)[0]; if (o) return { url: await this.core.apis.PacketApi.pkt.operation.GetPrivateFileUrl(i, n.fileUUID, o) }; } throw new Error("real fileUUID not found!"); } } var c2e = Object.defineProperty, u2e = (t, e, n) => e in t ? c2e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Vd = (t, e, n) => u2e(t, typeof e != "symbol" ? e + "" : e, n); class ws { constructor(e, n, r, i) { Vd(this, "_value"), Vd(this, "_fieldId"), Vd(this, "_opt"), Vd(this, "_callback"), this._value = n, this._fieldId = e, this._opt = r, this._callback = i; } get value() { return this._value; } set value(e) { this._value = e; } getTypeName() { return this.constructor.name; } getFieldId() { return this._fieldId; } getField(e) { return h2e(e, this); } } class l2e extends ws { getTypeName() { return "StringWrapper"; } } class d2e extends ws { getTypeName() { return "UInt32Wrapper"; } } const Rn = { UInt32Wrapper: "UInt32Wrapper", Int32Wrapper: "Int32Wrapper", Int64Wrapper: "Int64Wrapper", UInt64Wrapper: "UInt64Wrapper", StringWrapper: "StringWrapper", ArrayWrapper: "ArrayWrapper", BoolWrapper: "BoolWrapper", BytesWrapper: "BytesWrapper", DoubleWrapper: "DoubleWrapper", FloatWrapper: "FloatWrapper", Fixed64Wrapper: "Fixed64Wrapper", Fixed32Wrapper: "Fixed32Wrapper", SFixed32Wrapper: "SFixed32Wrapper", SFixed64Wrapper: "SFixed64Wrapper", SInt32Wrapper: "SInt32Wrapper", SInt64Wrapper: "SInt64Wrapper", UnknownWrapper: "UnknownWrapper" }, p2e = { [Rn.UInt32Wrapper]: w.UINT32, [Rn.Int32Wrapper]: w.INT32, [Rn.Int64Wrapper]: w.INT64, [Rn.UInt64Wrapper]: w.UINT64, [Rn.StringWrapper]: w.STRING, [Rn.BytesWrapper]: w.BYTES, [Rn.BoolWrapper]: w.BOOL, [Rn.DoubleWrapper]: w.DOUBLE, [Rn.FloatWrapper]: w.FLOAT, [Rn.Fixed64Wrapper]: w.FIXED64, [Rn.Fixed32Wrapper]: w.FIXED32, [Rn.SFixed32Wrapper]: w.SFIXED32, [Rn.SFixed64Wrapper]: w.SFIXED64, [Rn.SInt32Wrapper]: w.SINT32, [Rn.SInt64Wrapper]: w.SINT64, [Rn.UnknownWrapper]: w.BYTES }; function cD(t) { return p2e[t] || w.BYTES; } function uD(t = 0, e = !1, n = "") { return new l2e(t, n, e); } function f2e(t = 0, e = !1, n = 0) { return new d2e(t, n, e); } function h2e(t, e) { var n; const r = e.getTypeName(), i = e.getFieldId(), o = e._opt; if (r === Rn.ArrayWrapper) { const a = (n = e._callback) == null ? void 0 : n.call(e); if (a instanceof gc) return { no: i, name: t, kind: "message", T: () => new Jd(t, a.generateFields()), opt: o || !1, repeat: Wr.PACKED }; if (a instanceof ws) { const s = a.getTypeName(); return { no: i, name: t, kind: "scalar", T: cD(s), opt: o || !1, repeat: s === Rn.StringWrapper || s === Rn.BytesWrapper ? Wr.UNPACKED : Wr.PACKED }; } throw new Error("ArrayWrapper item type error"); } return { no: i, name: t, kind: "scalar", T: cD(r), opt: o || !1, repeat: Wr.NO }; } class gc { constructor() { Vd(this, "_fieldId", 0); } //默认标记类 generateFields() { const e = []; for (const n of Object.keys(this)) { const r = "_" + n, i = this[r]; i instanceof ws && e.push(i.getField(n)), i instanceof gc && e.push({ no: i._fieldId, name: n, kind: "message", T: () => new Jd(r, i.generateFields()), repeat: Wr.NO, opt: !1 }); } return e; } assignFields(e) { for (const n of Object.keys(this)) { const r = "_" + n; let i = this[r]; if (i instanceof ws) { const o = e[n]; o !== void 0 && (i.value = o); } else if (i instanceof gc) { const o = e[n]; o !== void 0 && i.assignFields(o); } else { const o = e[n]; o !== void 0 && (this[r] = o); } } } toObject() { const e = {}; for (const n of Object.keys(this)) { const r = "_" + n, i = this[r]; i && (i instanceof ws && (e[n] = i.value), i instanceof gc && (e[n] = i.toObject())); } return e; } encode() { return new Jd("message", this.generateFields()).toBinary(this.toObject()); } decode(e) { const n = new Jd("message", this.generateFields()).fromBinary(e); return this.assignFields(n), this; } then(e) { e(this); } } function m2e(t) { return new Proxy(t, { set(e, n, r) { return e[n] instanceof ws ? (e[n].value = r, !0) : (e[n] = r, !0); }, get(e, n) { if (typeof n == "string" && n.startsWith("_")) { const i = n.slice(1); if (e[i]) return e[i]; } const r = e[n]; return r instanceof ws ? r.value : r; } }); } function lD(t, e) { const n = m2e(new t()); return n._fieldId = typeof t == "number" ? t : 0, n; } const g2e = l.Array( l.Object({ uin: l.Number({ description: "QQ号" }), uid: l.String({ description: "用户UID" }), nick_name: l.String({ description: "昵称" }), age: l.Number({ description: "年龄" }), source: l.String({ description: "来源" }) }), { description: "单向好友列表" } ); class y2e extends ie { actionName = re.GetUnidirectionalFriendList; payloadSchema = l.Object({}); returnSchema = g2e; actionSummary = "获取单向好友列表"; actionTags = ["用户扩展"]; payloadExample = {}; returnExample = [ { uin: 123456789, uid: "u_123", nick_name: "单向好友", age: 20, source: "来源" } ]; async pack_data(e) { return lD(class extends gc { type = f2e(2, !1, 0); data = uD(3, !1, e); }).encode(); } async _handle() { const n = { uint64_uin: this.core.selfInfo.uin, uint64_top: 0, uint32_req_num: 99, bytes_cookies: "" }, r = await this.pack_data(JSON.stringify(n)), o = { cmd: "MQUpdateSvc_com_qq_ti.web.OidbSvc.0xe17_0", data: Buffer.from(r) }, a = await this.core.apis.PacketApi.pkt.operation.sendPacket(o, !0), s = lD(class extends gc { data = uD(4); }).decode(a); return JSON.parse(s.data).rpt_block_list.map((d) => ({ uin: d.uint64_uin, uid: d.str_uid, nick_name: Buffer.from(d.bytes_nick, "base64").toString(), age: d.uint32_age, source: Buffer.from(d.bytes_source, "base64").toString() })); } } const b2e = l.Object({ group_id: l.String({ description: "群号" }), remark: l.String({ description: "备注" }) }), v2e = l.Null({ description: "返回结果" }); class x2e extends ie { actionName = re.SetGroupRemark; payloadSchema = b2e; returnSchema = v2e; actionSummary = "设置群备注"; actionDescription = "设置群备注"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", remark: "测试群备注" }; returnExample = null; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupRemark(e.group_id, e.remark); if (n.result !== 0) throw new Error(`设置群备注失败, ${n.result}:${n.errMsg}`); return null; } } const w2e = l.Object({ group_id: l.String({ description: "群号" }), file_id: l.String({ description: "文件ID" }), current_parent_directory: l.String({ description: "当前父目录" }), target_parent_directory: l.String({ description: "目标父目录" }) }), S2e = l.Object({ ok: l.Boolean({ description: "是否成功" }) }, { description: "移动文件结果" }); class _2e extends ur { actionName = re.MoveGroupFile; actionSummary = "移动群文件"; actionTags = ["文件扩展"]; payloadExample = { group_id: "123456", file_id: "/file_id", current_parent_directory: "/current_folder_id", target_parent_directory: "/target_folder_id" }; returnExample = { ok: !0 }; payloadSchema = w2e; returnSchema = S2e; async _handle(e) { const n = on.decode(e.file_id) || on.decodeModelId(e.file_id); if (n?.fileUUID) return await this.core.apis.PacketApi.pkt.operation.MoveGroupFile(+e.group_id, n.fileUUID, e.current_parent_directory, e.target_parent_directory), { ok: !0 }; throw new Error("real fileUUID not found!"); } } const E2e = l.Object({ group_id: l.String({ description: "群号" }), file_id: l.String({ description: "文件ID" }) }), A2e = l.Object({ ok: l.Boolean({ description: "是否成功" }) }, { description: "转发文件结果" }); class I2e extends ur { actionName = re.TransGroupFile; actionSummary = "传输群文件"; actionTags = ["文件扩展"]; payloadExample = { group_id: "123456", file_id: "/file_id" }; returnExample = { ok: !0 }; payloadSchema = E2e; returnSchema = A2e; async _handle(e) { const n = on.decode(e.file_id) || on.decodeModelId(e.file_id); if (n?.fileUUID) { const r = await this.core.apis.GroupApi.transGroupFile(e.group_id.toString(), n.fileUUID); if (r.transGroupFileResult.result.retCode === 0) return { ok: !0 }; throw new Error(r.transGroupFileResult.result.retMsg); } throw new Error("real fileUUID not found!"); } } const C2e = l.Object({ group_id: l.String({ description: "群号" }), file_id: l.String({ description: "文件ID" }), current_parent_directory: l.String({ description: "当前父目录" }), new_name: l.String({ description: "新文件名" }) }), T2e = l.Object({ ok: l.Boolean({ description: "是否成功" }) }, { description: "重命名文件结果" }); class k2e extends ur { actionName = re.RenameGroupFile; actionSummary = "重命名群文件"; actionTags = ["文件扩展"]; payloadExample = { group_id: "123456", file_id: "/file_id", current_parent_directory: "/", new_name: "new_name.jpg" }; returnExample = { ok: !0 }; payloadSchema = C2e; returnSchema = T2e; async _handle(e) { const n = on.decode(e.file_id) || on.decodeModelId(e.file_id); if (n?.fileUUID) return await this.core.apis.PacketApi.pkt.operation.RenameGroupFile(+e.group_id, n.fileUUID, e.current_parent_directory, e.new_name), { ok: !0 }; throw new Error("real fileUUID not found!"); } } const N2e = l.Object({ private_rkey: l.Optional(l.String({ description: "私聊 RKey" })), group_rkey: l.Optional(l.String({ description: "群聊 RKey" })), expired_time: l.Optional(l.Number({ description: "过期时间" })), name: l.String({ description: "名称" }) }); class P2e extends ur { actionName = re.GetRkeyServer; actionSummary = "获取 RKey 服务器"; actionTags = ["系统扩展"]; payloadExample = {}; returnExample = { private_rkey: "&rkey=123456789", group_rkey: "&rkey=123456789", expired_time: 169456e4, name: "SnowCat 4" }; payloadSchema = l.Object({}); returnSchema = N2e; rkeyCache = null; expiryTime = null; async _handle() { if (this.expiryTime && this.expiryTime > Math.floor(Date.now() / 1e3) && this.rkeyCache) return this.rkeyCache; const e = await this.core.apis.PacketApi.pkt.operation.FetchRkey(), n = e.filter((i) => i.type === 10)[0], r = e.filter((i) => i.type === 20)[0]; return this.expiryTime = Math.floor(Date.now() / 1e3) + Math.min(+r.ttl.toString(), +n.ttl.toString()), this.rkeyCache = { private_rkey: n ? n.rkey : void 0, group_rkey: r ? r.rkey : void 0, expired_time: this.expiryTime, name: "SnowCat 4" }, this.rkeyCache; } } const D2e = l.Array(l.Object({ type: l.String({ description: "类型 (private/group)" }), rkey: l.String({ description: "RKey" }), created_at: l.Number({ description: "创建时间" }), ttl: l.Number({ description: "有效期" }) }), { description: "RKey 列表" }); class O2e extends ur { actionName = re.GetRkeyEx; payloadSchema = l.Object({}); returnSchema = D2e; actionSummary = "获取扩展 RKey"; actionTags = ["系统扩展"]; payloadExample = {}; returnExample = [ { type: "private", rkey: "rkey_123", created_at: 1734567890, ttl: 3600 } ]; async _handle() { return (await this.core.apis.PacketApi.pkt.operation.FetchRkey()).map((n) => ({ type: n.type === 10 ? "private" : "group", rkey: n.rkey, created_at: Number(n.time), ttl: Number(n.ttl) })); } } class F2e extends ie { actionName = re.CleanCache; payloadSchema = l.Object({}); returnSchema = l.Null(); actionSummary = "清理缓存"; actionDescription = "清理缓存"; actionTags = ["系统接口"]; payloadExample = {}; returnExample = null; async _handle() { try { const e = this.core.SnowCatTempPath, r = (await D3(e)).map(async (a) => { const s = qm(e, a); try { await O3(s), this.core.context.logger.log(`已删除文件: ${s}`); } catch (c) { this.core.context.logger.log(`删除文件 ${s} 失败: ${c.message}`); } }); await Promise.all(r); const i = ve.join(this.core.dataPath, this.core.selfInfo.uin || "10001", "nt_qq", "nt_data"), o = ["Pic", "Ptt", "Video", "File", "log"]; for (const a of o) { const s = ve.join(i, a); try { const c = await D3(s).catch(() => null); if (c) { const u = c.map(async (d) => { const p = ve.join(s, d); try { await O3(p), this.core.context.logger.log(`已删除文件: ${p}`); } catch (f) { this.core.context.logger.log(`删除文件 ${p} 失败: ${f.message}`); } }); await Promise.all(u), this.core.context.logger.log(`目录清理完成: ${s}`); } } catch (c) { this.core.context.logger.log(`清理目录 ${s} 失败: ${c.message}`); } } this.core.context.logger.log(`临时文件夹清理完成: ${e}`); } catch (e) { throw this.core.context.logger.log(`清理缓存失败: ${e.message}`), e; } } } const M2e = l.Object({ user_id: l.String({ description: "对方 QQ 号" }), remark: l.String({ description: "备注内容" }) }); class R2e extends ie { actionName = re.SetFriendRemark; payloadSchema = M2e; returnSchema = l.Null(); actionSummary = "设置好友备注"; actionDescription = "设置好友备注"; actionTags = ["用户接口"]; payloadExample = { user_id: "123456", remark: "测试备注" }; returnExample = null; errorExamples = [ { code: 1400, description: "备注设置失败(好友不存在或非法输入)" } ]; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!await this.core.apis.FriendApi.isBuddy(n)) throw new Error(`用户 ${e.user_id} 不是好友`); await this.core.apis.FriendApi.setBuddyRemark(n, e.remark); } } const B2e = l.Object({ flag: l.String({ description: "请求 flag" }), // 注意强制String 非isNumeric 不遵守则不符合设计 approve: l.Boolean({ default: !0, description: "是否同意 (强制为 true)" }) // 该字段没有语义 仅做保留 强制为True }); class U2e extends ie { actionName = re.SetDoubtFriendsAddRequest; payloadSchema = B2e; returnSchema = l.Any(); actionSummary = "处理可疑好友申请"; actionDescription = "同意或拒绝系统的可疑好友申请"; actionTags = ["系统接口"]; payloadExample = { flag: "12345", approve: !0 }; returnExample = null; async _handle(e) { return await this.core.apis.FriendApi.handleDoubtFriendRequest(e.flag); } } const dD = { GetDoubtFriendsAddRequest: { payload: { count: 10 }, response: [{ user_id: 123456789, nickname: "昵称", age: 20, sex: "male", reason: "申请理由", flag: "flag_123" }] } }, L2e = l.Object({ count: l.Number({ default: 50, description: "获取数量" }) }); class Q2e extends ie { actionName = re.GetDoubtFriendsAddRequest; payloadSchema = L2e; returnSchema = l.Any({ description: "可疑好友申请列表" }); actionSummary = "获取可疑好友申请"; actionDescription = "获取系统的可疑好友申请列表"; actionTags = ["系统接口"]; payloadExample = dD.GetDoubtFriendsAddRequest.payload; returnExample = dD.GetDoubtFriendsAddRequest.response; async _handle(e) { return await this.core.apis.FriendApi.getDoubtFriendRequest(e.count); } } const j2e = l.Object({ group_id: l.String({ description: "群号" }), add_type: l.Number({ description: "加群方式" }), group_question: l.Optional(l.String({ description: "加群问题" })), group_answer: l.Optional(l.String({ description: "加群答案" })) }), $2e = l.Null({ description: "返回结果" }); class G2e extends ie { actionName = re.SetGroupAddOption; actionSummary = "设置群加群选项"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", add_type: 1 }; returnExample = null; payloadSchema = j2e; returnSchema = $2e; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupAddOption(e.group_id, { addOption: e.add_type, groupQuestion: e.group_question, groupAnswer: e.group_answer }); if (n.result !== 0) throw new Error(`设置群添加选项失败, ${n.result}:${n.errMsg}`); return null; } } const q2e = l.Object({ group_id: l.String({ description: "群号" }), no_code_finger_open: l.Optional(l.Number({ description: "未知" })), no_finger_open: l.Optional(l.Number({ description: "未知" })) }), z2e = l.Null({ description: "返回结果" }); class H2e extends ie { actionName = re.SetGroupSearch; actionSummary = "设置群搜索选项"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456" }; returnExample = null; payloadSchema = q2e; returnSchema = z2e; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupSearch(e.group_id, { noCodeFingerOpenFlag: e.no_code_finger_open, noFingerOpenFlag: e.no_finger_open }); if (n.result !== 0) throw new Error(`设置群搜索失败, ${n.result}:${n.errMsg}`); return null; } } const W2e = l.Object({ group_id: l.String({ description: "群号" }), robot_member_switch: l.Optional(l.Number({ description: "机器人成员开关" })), robot_member_examine: l.Optional(l.Number({ description: "机器人成员审核" })) }), K2e = l.Null({ description: "返回结果" }); class V2e extends ie { actionName = re.SetGroupRobotAddOption; actionSummary = "设置群机器人加群选项"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456" }; returnExample = null; payloadSchema = W2e; returnSchema = K2e; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupRobotAddOption( e.group_id, e.robot_member_switch, e.robot_member_examine ); if (n.result !== 0) throw new Error(`设置群机器人添加选项失败, ${n.result}:${n.errMsg}`); return null; } } const Y2e = l.Object({ group_id: l.String({ description: "群号" }), user_id: l.Array(l.String(), { description: "QQ号列表" }), reject_add_request: l.Optional(l.Union([l.Boolean(), l.String()], { description: "是否拒绝加群请求" })) }), J2e = l.Null({ description: "返回结果" }); class X2e extends ie { actionName = re.SetGroupKickMembers; payloadSchema = Y2e; returnSchema = J2e; actionSummary = "批量踢出群成员"; actionDescription = "从指定群聊中批量踢出多个成员"; actionTags = ["扩展接口"]; payloadExample = Nn.SetGroupKickMembers.payload; returnExample = Nn.SetGroupKickMembers.response; async _handle(e) { const n = e.reject_add_request?.toString() === "true", r = await Promise.all(e.user_id.map(async (i) => await this.core.apis.UserApi.getUidByUinV2(i))); return await this.core.apis.GroupApi.kickMember(e.group_id.toString(), r.filter((i) => !!i), n), null; } } const Z2e = l.Object({ group_id: l.String({ description: "群号" }) }), eEe = l.Object({ group_id: l.Number({ description: "群号" }), group_name: l.String({ description: "群名称" }), member_count: l.Number({ description: "成员数量" }), max_member_count: l.Number({ description: "最大成员数量" }), group_all_shut: l.Number({ description: "全员禁言状态" }), group_remark: l.String({ description: "群备注" }) }, { description: "群详细信息" }); class tEe extends ie { actionName = re.GetGroupDetailInfo; payloadSchema = Z2e; returnSchema = eEe; actionSummary = "获取群详细信息"; actionDescription = "获取群聊的详细信息,包括成员数、最大成员数等"; actionTags = ["群组接口"]; payloadExample = at.GetGroupDetailInfo.payload; returnExample = at.GetGroupDetailInfo.response; async _handle(e) { const n = await this.core.apis.GroupApi.fetchGroupDetail(e.group_id.toString()); return { ...n, group_all_shut: n.shutUpAllTimestamp > 0 ? -1 : 0, group_remark: "", group_id: +e.group_id, group_name: n.groupName, member_count: n.memberNum, max_member_count: n.maxMemberNum }; } } const nEe = l.Array( l.Object({ request_id: l.Number({ description: "请求ID" }), invitor_uin: l.Number({ description: "邀请者QQ" }), invitor_nick: l.Optional(l.String({ description: "邀请者昵称" })), group_id: l.Number({ description: "群号" }), message: l.Optional(l.String({ description: "验证信息" })), group_name: l.Optional(l.String({ description: "群名称" })), checked: l.Boolean({ description: "是否已处理" }), actor: l.Number({ description: "处理者QQ" }), requester_nick: l.Optional(l.String({ description: "请求者昵称" })) }), { description: "群通知列表" } ); class rEe extends ie { actionName = re.GetGroupIgnoreAddRequest; payloadSchema = l.Object({}); returnSchema = nEe; actionSummary = "获取群被忽略的加群请求"; actionTags = ["群组接口"]; payloadExample = {}; returnExample = [ { request_id: 12345, invitor_uin: 123456789, invitor_nick: "邀请者", group_id: 123456789, message: "加群请求", group_name: "群名称", checked: !1, actor: 0, requester_nick: "请求者" } ]; async _handle() { const e = this.core.apis.UserApi, r = await this.core.apis.GroupApi.getSingleScreenNotifies(!0, 10), i = [], o = r.filter((a) => a.type === 7).map(async (a) => { const s = a.user1?.uid ? +await e.getUinByUidV2(a.user1.uid) : 0, c = a.user2?.uid ? +await e.getUinByUidV2(a.user2.uid) : 0; i.push({ request_id: +a.seq, invitor_uin: s, invitor_nick: a.user1?.nickName, group_id: +a.group?.groupCode, message: a?.postscript, group_name: a.group?.groupName, checked: a.status !== dc.KUNHANDLE, actor: c, requester_nick: a.user1?.nickName }); }); return await Promise.all(o), i; } } const iEe = l.Object({ category: l.String({ description: "分类ID" }), count: l.String({ default: "50", description: "获取数量" }) }), oEe = l.Any({ description: "收藏列表" }); class aEe extends ie { actionName = re.GetCollectionList; payloadSchema = iEe; returnSchema = oEe; actionSummary = "获取收藏列表"; actionTags = ["系统扩展"]; payloadExample = { category: "0", count: "50" }; returnExample = { errCode: 0, errMsg: "", collectionSearchList: { collectionItemList: [ { cid: "123456", type: 8, status: 1, author: { type: 2, numId: "123456", strId: "昵称", groupId: "123456", groupName: "群名", uid: "123456" }, bid: 1, category: 1, createTime: "1769169157000", collectTime: "1769413477691", modifyTime: "1769413477691", sequence: "1769413476735", shareUrl: "", customGroupId: 0, securityBeat: !1, summary: { textSummary: null, linkSummary: null, gallerySummary: null, audioSummary: null, videoSummary: null, fileSummary: null, locationSummary: null, richMediaSummary: { title: "", subTitle: "", brief: "text", picList: [], contentType: 1, originalUri: "", publisher: "", richMediaVersion: 0 } } } ], hasMore: !1, bottomTimeStamp: "1769413477691" } }; async _handle(e) { return await this.core.apis.CollectionApi.getAllCollection(+e.category, +e.count); } } const sEe = l.Object({ group_id: l.Union([l.String(), l.Number()], { description: "群号" }), message_id: l.Optional(l.String({ description: "消息ID" })), message_seq: l.Optional(l.String({ description: "消息Seq (可选)" })) }); class C3 extends ur { payloadSchema = sEe; returnSchema = l.Null(); actionTags = ["核心接口"]; async _handle(e) { const n = +e.group_id; if (e.message_seq) return await this.handleGroupTodo(n, e.message_seq.toString()); if (!e.message_id) throw new Error("缺少参数 message_id 或 message_seq"); const r = { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }, { MsgId: i, Peer: o } = ot.getMsgIdAndPeerByShortId(+e.message_id) ?? { Peer: r, MsgId: e.message_id.toString() }, a = (await this.core.apis.MsgApi.getMsgsByMsgId(o, [i])).msgList[0]; if (!a) throw new Error("消息不存在"); await this.handleGroupTodo(n, a.msgSeq); } } class cEe extends C3 { actionName = re.CompleteGroupTodo; actionSummary = "完成群待办"; actionDescription = "将指定消息对应的群待办标记为已完成"; payloadExample = Ps.CompleteGroupTodo.payload; returnExample = Ps.CompleteGroupTodo.response; async handleGroupTodo(e, n) { await this.core.apis.PacketApi.pkt.operation.CompleteGroupTodo(e, n); } } class uEe extends C3 { actionName = re.CancelGroupTodo; actionSummary = "取消群待办"; actionDescription = "将指定消息对应的群待办取消"; payloadExample = Ps.CancelGroupTodo.payload; returnExample = Ps.CancelGroupTodo.response; async handleGroupTodo(e, n) { await this.core.apis.PacketApi.pkt.operation.CancelGroupTodo(e, n); } } class lEe extends C3 { actionName = re.SetGroupTodo; actionSummary = "设置群待办"; actionDescription = "将指定消息设置为群待办"; payloadExample = Ps.SetGroupTodo.payload; returnExample = Ps.SetGroupTodo.response; async handleGroupTodo(e, n) { await this.core.apis.PacketApi.pkt.operation.SetGroupTodo(e, n); } } const dEe = l.Object({ group_id: l.String({ description: "群号" }), attach_info: l.Optional(l.String({ default: "", description: "附加信息(用于分页,从上一次返回结果中获取)" })) }), pEe = l.Object({ album_list: l.Array(l.Any(), { description: "群相册列表" }), attach_info: l.String({ description: "分页附加信息,传入下一次请求以获取更多数据" }), has_more: l.Boolean({ description: "是否有更多数据" }) }, { description: "群相册列表响应" }); class fEe extends ie { actionName = re.GetQunAlbumList; actionSummary = "获取群相册列表"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", attach_info: "" }; returnExample = { album_list: [ { album_id: "album_1", album_name: "测试相册", cover_url: "http://example.com/cover.jpg", create_time: 1734567890 } ], attach_info: "", has_more: !1 }; payloadSchema = dEe; returnSchema = pEe; async _handle(e) { const n = (await this.core.apis.WebApi.getAlbumListByNTQQ(e.group_id, e.attach_info)).response; return { album_list: n.album_list, attach_info: n.attach_info, has_more: n.has_more }; } } const hEe = l.Object({ group_id: l.String({ description: "群号" }), album_id: l.String({ description: "相册ID" }), album_name: l.String({ description: "相册名称" }), file: l.String({ description: "图片路径、URL或Base64" }) }), mEe = l.Any({ description: "上传结果" }); class gEe extends ie { actionName = re.UploadImageToQunAlbum; actionSummary = "上传图片到群相册"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id_1", album_name: "相册1", file: "/path/to/image.jpg" }; returnExample = { result: null }; payloadSchema = hEe; returnSchema = mEe; async _handle(e) { const n = await $i(this.core.SnowCatTempPath, e.file); try { return await this.core.apis.WebApi.uploadImageToQunAlbum(e.group_id, e.album_id, e.album_name, n.path); } finally { !n.isLocal && n.path && ir(n.path) && await i0(n.path); } } } const yEe = l.Object({ group_id: l.String({ description: "群号" }), album_id: l.String({ description: "相册 ID" }), lloc: l.String({ description: "图片 ID" }), content: l.String({ description: "评论内容" }) }); class bEe extends ie { actionName = re.DoGroupAlbumComment; actionSummary = "发表群相册评论"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id_1", lloc: "media_id_1", content: "很有意思" }; returnExample = { result: {} }; payloadSchema = yEe; returnSchema = l.Any({ description: "评论结果" }); async _handle(e) { return await this.core.apis.WebApi.doAlbumMediaPlainCommentByNTQQ( e.group_id, e.album_id, e.lloc, e.content ); } } const vEe = l.Object({ group_id: l.String({ description: "群号" }), album_id: l.String({ description: "相册ID" }), attach_info: l.Optional(l.String({ default: "", description: "附加信息(用于分页)" })) }), xEe = l.Any({ description: "相册媒体列表" }); class wEe extends ie { actionName = re.GetGroupAlbumMediaList; actionSummary = "获取群相册媒体列表"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id_1" }; returnExample = { media_list: [ { media_id: "media_id_1", url: "http://example.com/1.jpg" } ] }; payloadSchema = vEe; returnSchema = xEe; async _handle(e) { return await this.core.apis.WebApi.getAlbumMediaListByNTQQ( e.group_id, e.album_id, e.attach_info ); } } const yL = l.Object({ group_id: l.String({ description: "群号" }), album_id: l.String({ description: "相册ID" }), batch_id: l.String({ description: "batch_id" }), lloc: l.Optional(l.String({ description: "lloc,若对整个上传操作则不填" })) }), bL = l.Any({ description: "操作结果" }); class SEe extends ie { actionName = re.SetGroupAlbumMediaLike; actionSummary = "点赞群相册媒体"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id_123", batch_id: "112233", lloc: "aabbcc12213123" }; returnExample = { result: {} }; payloadSchema = yL; returnSchema = bL; async _handle(e) { return await this.core.apis.WebApi.doAlbumMediaLikeByNTQQ( e.group_id, e.album_id, e.batch_id, e.lloc, !0 // isLike = true ); } } class _Ee extends ie { actionName = re.CancelGroupAlbumMediaLike; // 注意:需要在 router/index.ts 的 ActionName 枚举中补充该定义 actionSummary = "取消点赞群相册媒体"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id", batch_id: "112233", lloc: "aabbcc" }; returnExample = { result: {} }; payloadSchema = yL; returnSchema = bL; async _handle(e) { return await this.core.apis.WebApi.doAlbumMediaLikeByNTQQ( e.group_id, e.album_id, e.batch_id, e.lloc, !1 ); } } const EEe = l.Object({ group_id: l.String({ description: "群号" }), album_id: l.String({ description: "相册ID" }), lloc: l.String({ description: "媒体ID (lloc)" }) }), AEe = l.Any({ description: "删除结果" }); class IEe extends ie { actionName = re.DelGroupAlbumMedia; actionSummary = "删除群相册媒体"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456", album_id: "album_id_1", lloc: "media_id_1" }; returnExample = { result: {} }; payloadSchema = EEe; returnSchema = AEe; async _handle(e) { return await this.core.apis.WebApi.deleteAlbumMediaByNTQQ( e.group_id, e.album_id, e.lloc ); } } class CEe extends ie { actionName = re.CleanStreamTempFile; actionSummary = "清理流式传输临时文件"; actionTags = ["流式传输扩展"]; payloadExample = {}; returnExample = { message: "success" }; payloadSchema = l.Object({}); returnSchema = l.Null(); async _handle(e) { try { const n = this.core.SnowCatTempPath, i = (await zL(n)).map(async (o) => { const a = En(n, o); try { await i0(a), this.core.context.logger.log(`已删除文件: ${a}`); } catch (s) { this.core.context.logger.log(`删除文件 ${a} 失败: ${s.message}`); } }); await Promise.all(i); } catch (n) { this.core.context.logger.log(`清理流临时文件失败: ${n.message}`); } } } class T3 extends ie { async resolveDownload(e) { const n = e || ""; let r = "", i = "", o = 0; const a = on.decode(n); if (a && a.msgId && a.elementId) { const { peer: u, msgId: d, elementId: p } = a; r = await this.core.apis.FileApi.downloadMedia(d, u.chatType, u.peerUid, p, "", ""); const m = (await this.core.apis.MsgApi.getMsgsByMsgId(u, [d]))?.msgList.find((y) => y.msgId === d)?.elements.find((y) => y.elementId === p), h = m?.videoElement ?? m?.fileElement ?? m?.pttElement ?? m?.picElement; if (!h) throw new Error("element not found"); return o = parseInt(h.fileSize?.toString() ?? "0"), i = h.fileName ?? "", { downloadPath: r, fileName: i, fileSize: o }; } const s = on.decodeModelId(n); if (s && s.modelId) { const { peer: u, modelId: d } = s; return r = await this.core.apis.FileApi.downloadFileForModelId(u, d, ""), { downloadPath: r, fileName: i, fileSize: o }; } const c = await this.core.apis.FileApi.searchForFile([n]); if (c) { const u = parseInt(c.fileSize), d = this.obContext.configLoader.configData.timeout, p = hA(d, u, d.downloadSpeedKBps); return r = await this.core.apis.FileApi.downloadFileById(c.id, u, p), o = u, i = c.fileName, { downloadPath: r, fileName: i, fileSize: o }; } throw new Error("file not found"); } async streamFileChunks(e, n, r, i) { const a = (await fe.promises.stat(n)).size, s = fe.createReadStream(n, { highWaterMark: r }); let c = 0, u = 0; for await (const d of s) { const p = d.toString("base64"); u += d.length, await e.send({ type: Jr.Stream, data_type: i, index: c, data: p, size: d.length, progress: Math.round(u / a * 100), base64_size: p.length }), c++; } return { totalChunks: c, totalBytes: u }; } } const TEe = l.Object({ file: l.Optional(l.String({ description: "文件路径或 URL" })), file_id: l.Optional(l.String({ description: "文件 ID" })), chunk_size: l.Optional(l.Number({ default: 64 * 1024, description: "分块大小 (字节)" })) // 默认64KB分块 }); class kEe extends T3 { actionName = re.DownloadFileStream; payloadSchema = TEe; returnSchema = l.Any({ description: "下载结果 (流式)" }); actionSummary = "下载文件流"; actionDescription = "以流式方式从网络或本地下载文件"; actionTags = ["流式接口"]; payloadExample = { file: "http://example.com/file.png" }; returnExample = { type: "stream", data_type: "file_info", file_name: "file.png", file_size: 1024 }; useStream = !0; async _handle(e, n, r, i) { try { e.file ||= e.file_id || ""; const o = e.chunk_size || 64 * 1024, { downloadPath: a, fileName: s, fileSize: c } = await this.resolveDownload(e.file), u = await fe.promises.stat(a), d = c || u.size; await i.send({ type: Jr.Stream, data_type: "file_info", file_name: s, file_size: d, chunk_size: o }); const { totalChunks: p, totalBytes: f } = await this.streamFileChunks(i, a, o, "file_chunk"); return { type: Jr.Response, data_type: "file_complete", total_chunks: p, total_bytes: f, message: "Download completed" }; } catch (o) { throw new Error(`Download failed: ${o.message}`); } } } const NEe = ["mp3", "amr", "wma", "m4a", "spx", "ogg", "wav", "flac"], PEe = l.Object({ file: l.Optional(l.String({ description: "文件路径或 URL" })), file_id: l.Optional(l.String({ description: "文件 ID" })), chunk_size: l.Optional(l.Number({ default: 64 * 1024, description: "分块大小 (字节)" })), // 默认64KB分块 out_format: l.Optional(l.String({ description: "输出格式" })) }); class DEe extends T3 { actionName = re.DownloadFileRecordStream; actionSummary = "下载语音文件流"; actionTags = ["流式传输扩展"]; payloadExample = { file: "record_file_id" }; returnExample = { file: "temp_record_path" }; payloadSchema = PEe; returnSchema = l.Any({ description: "下载结果 (流式)" }); useStream = !0; async _handle(e, n, r, i) { try { e.file ||= e.file_id || ""; const o = e.chunk_size || 64 * 1024, { downloadPath: a, fileName: s, fileSize: c } = await this.resolveDownload(e.file); let u = a; if (e.out_format && typeof e.out_format == "string") { if (!NEe.includes(e.out_format)) throw new Error("转换失败 out_format 字段可能格式不正确"); const h = `${a}.${e.out_format}`; try { await fe.promises.access(h), u = h; } catch { await uo.convertAudioFmt(a, h, e.out_format), u = h; } } const d = await fe.promises.stat(u), p = c || d.size; await i.send({ type: Jr.Stream, data_type: "file_info", file_name: s, file_size: p, chunk_size: o, out_format: e.out_format }); const { totalChunks: f, totalBytes: m } = await this.streamFileChunks(i, u, o, "file_chunk"); return { type: Jr.Response, data_type: "file_complete", total_chunks: f, total_bytes: m, message: "Download completed" }; } catch (o) { throw new Error(`Download failed: ${o.message}`); } } } const OEe = l.Object({ file: l.Optional(l.String({ description: "文件路径或 URL" })), file_id: l.Optional(l.String({ description: "文件 ID" })), chunk_size: l.Optional(l.Number({ default: 64 * 1024, description: "分块大小 (字节)" })) // 默认64KB分块 }); class FEe extends T3 { actionName = re.DownloadFileImageStream; actionSummary = "下载图片文件流"; actionTags = ["流式传输扩展"]; payloadExample = { file: "image_file_id" }; returnExample = { file: "temp_image_path" }; payloadSchema = OEe; returnSchema = l.Any({ description: "下载结果 (流式)" }); useStream = !0; async _handle(e, n, r, i) { try { e.file ||= e.file_id || ""; const o = e.chunk_size || 64 * 1024, { downloadPath: a, fileName: s, fileSize: c } = await this.resolveDownload(e.file), u = await fe.promises.stat(a), d = c || u.size, { width: p, height: f } = await v0(a); await i.send({ type: Jr.Stream, data_type: "file_info", file_name: s, file_size: d, chunk_size: o, width: p, height: f }); const { totalChunks: m, totalBytes: h } = await this.streamFileChunks(i, a, o, "file_chunk"); return { type: Jr.Response, data_type: "file_complete", total_chunks: m, total_bytes: h, message: "Download completed" }; } catch (o) { throw new Error(`Download failed: ${o.message}`); } } } const MEe = l.Object({ error: l.Optional(l.Boolean({ default: !1, description: "是否触发测试错误" })) }); class REe extends ie { actionName = re.TestDownloadStream; actionSummary = "测试下载流"; actionTags = ["流式传输扩展"]; payloadExample = { url: "http://example.com/file" }; returnExample = { success: !0 }; payloadSchema = MEe; returnSchema = l.Any({ description: "测试流数据" }); useStream = !0; async _handle(e, n, r, i) { for (let o = 0; o < 10; o++) await i.send({ type: Jr.Stream, data: `Index-> ${o + 1}`, data_type: "data_chunk" }), await new Promise((a) => setTimeout(a, 100)); if (e.error) throw new Error("This is a test error"); return { type: Jr.Response, data_type: "data_complete", data: "Stream transmission complete" }; } } const aS = { TIMEOUT: 600 * 1e3, // 10分钟超时 MEMORY_THRESHOLD: 10 * 1024 * 1024, // 10MB,超过使用磁盘 MEMORY_LIMIT: 100 * 1024 * 1024 // 100MB内存总限制 }, BEe = l.Object({ stream_id: l.String({ description: "流 ID" }), chunk_data: l.Optional(l.String({ description: "分块数据 (Base64)" })), chunk_index: l.Optional(l.Number({ description: "分块索引" })), total_chunks: l.Optional(l.Number({ description: "总分块数" })), file_size: l.Optional(l.Number({ description: "文件总大小" })), expected_sha256: l.Optional(l.String({ description: "期望的 SHA256" })), is_complete: l.Optional(l.Boolean({ description: "是否完成" })), filename: l.Optional(l.String({ description: "文件名" })), reset: l.Optional(l.Boolean({ description: "是否重置" })), verify_only: l.Optional(l.Boolean({ description: "是否仅验证" })), file_retention: l.Number({ default: 300 * 1e3, description: "文件保留时间 (毫秒)" }) // 默认5分钟 回收 不设置或0为不回收 }); class oo extends ie { actionName = re.UploadFileStream; payloadSchema = BEe; returnSchema = l.Any({ description: "上传结果 (流式)" }); actionSummary = "上传文件流"; actionDescription = "以流式方式上传文件数据到机器人"; actionTags = ["流式接口"]; payloadExample = { stream_id: "uuid-1234-5678", chunk_data: "SGVsbG8gV29ybGQ=", chunk_index: 0, total_chunks: 1, file_size: 11 }; returnExample = { type: "stream", stream_id: "uuid-1234-5678", status: "chunk_received", received_chunks: 1, total_chunks: 1 }; useStream = !0; static streams = /* @__PURE__ */ new Map(); static memoryUsage = 0; async _handle(e, n, r) { const { stream_id: i, reset: o, verify_only: a } = e; if (o) throw this.cleanupStream(i), new Error("Stream reset completed"); if (a) { const c = oo.streams.get(i); if (!c) throw new Error("Stream not found"); return this.getStreamStatus(c); } const s = this.getOrCreateStream(e); return e.chunk_data && e.chunk_index !== void 0 ? await this.processChunk(s, e.chunk_data, e.chunk_index) : e.is_complete || s.receivedChunks === s.totalChunks ? await this.completeStream(s) : this.getStreamStatus(s); } getOrCreateStream(e) { let n = oo.streams.get(e.stream_id); if (!n) { if (!e.total_chunks) throw new Error("total_chunks required for new stream"); n = this.createStream(e); } return n; } createStream(e) { const { stream_id: n, total_chunks: r, file_size: i, filename: o, expected_sha256: a } = e, s = this.shouldUseMemory(i); if (s && i && oo.memoryUsage + i > aS.MEMORY_LIMIT) throw new Error("Memory limit exceeded"); const c = { id: n, filename: o || `upload_${Xo()}`, totalChunks: r, receivedChunks: 0, missingChunks: new Set(Array.from({ length: r }, (u, d) => d)), fileSize: i, expectedSha256: a, useMemory: s, createdAt: Date.now(), timeoutId: this.setupTimeout(n), fileRetention: e.file_retention }; try { return s ? (c.memoryChunks = /* @__PURE__ */ new Map(), i && (oo.memoryUsage += i)) : this.setupDiskStorage(c), oo.streams.set(n, c), c; } catch (u) { if (clearTimeout(c.timeoutId), c.tempDir && fe.existsSync(c.tempDir)) try { fe.rmSync(c.tempDir, { recursive: !0, force: !0 }); } catch (d) { console.error("Failed to cleanup temp dir during creation error:", d); } throw u; } } shouldUseMemory(e) { return e !== void 0 && e <= aS.MEMORY_THRESHOLD; } setupDiskStorage(e) { const n = En(this.core.SnowCatTempPath, `upload_${e.id}`), r = En(this.core.SnowCatTempPath, e.filename); fe.mkdirSync(n, { recursive: !0 }), e.tempDir = n, e.finalPath = r; } setupTimeout(e) { return setTimeout(() => { console.log(`Stream ${e} timeout`), this.cleanupStream(e); }, aS.TIMEOUT); } async processChunk(e, n, r) { if (r < 0 || r >= e.totalChunks) throw new Error(`Invalid chunk index: ${r}`); if (!e.missingChunks.has(r)) return this.getStreamStatus(e); const i = Buffer.from(n, "base64"); if (e.useMemory) e.memoryChunks.set(r, i); else { const o = En(e.tempDir, `${r}.chunk`); await fe.promises.writeFile(o, i); } return e.missingChunks.delete(r), e.receivedChunks++, this.refreshTimeout(e), { type: Jr.Stream, stream_id: e.id, status: "chunk_received", received_chunks: e.receivedChunks, total_chunks: e.totalChunks }; } refreshTimeout(e) { clearTimeout(e.timeoutId), e.timeoutId = this.setupTimeout(e.id); } getStreamStatus(e) { return { type: Jr.Stream, stream_id: e.id, status: "file_created", received_chunks: e.receivedChunks, total_chunks: e.totalChunks }; } async completeStream(e) { const n = e.useMemory ? await this.mergeMemoryChunks(e) : await this.mergeDiskChunks(e), r = this.validateSha256(e, n), i = e.finalPath || En(this.core.SnowCatTempPath, e.filename); return await fe.promises.writeFile(i, n), this.cleanupStream(e.id, !1), e.fileRetention && e.fileRetention > 0 && setTimeout(() => { r7(i, (o) => { o && this.core.context.logger.logError(`Failed to delete retained file ${i}:`, o); }); }, e.fileRetention), { type: Jr.Response, stream_id: e.id, status: "file_complete", received_chunks: e.receivedChunks, total_chunks: e.totalChunks, file_path: i, file_size: n.length, sha256: r }; } async mergeMemoryChunks(e) { const n = []; for (let r = 0; r < e.totalChunks; r++) { const i = e.memoryChunks.get(r); if (!i) throw new Error(`Missing memory chunk ${r}`); n.push(i); } return Buffer.concat(n); } async mergeDiskChunks(e) { const n = []; for (let r = 0; r < e.totalChunks; r++) { const i = En(e.tempDir, `${r}.chunk`); if (!fe.existsSync(i)) throw new Error(`Missing chunk file ${r}`); n.push(await fe.promises.readFile(i)); } return Buffer.concat(n); } validateSha256(e, n) { if (!e.expectedSha256) return; const r = WL("sha256").update(n).digest("hex"); if (r !== e.expectedSha256) throw new Error(`SHA256 mismatch. Expected: ${e.expectedSha256}, Got: ${r}`); return r; } cleanupStream(e, n = !0) { const r = oo.streams.get(e); if (r) try { if (clearTimeout(r.timeoutId), r.useMemory && (r.fileSize && (oo.memoryUsage = Math.max(0, oo.memoryUsage - r.fileSize)), r.memoryChunks?.clear()), r.tempDir) try { fe.existsSync(r.tempDir) && (fe.rmSync(r.tempDir, { recursive: !0, force: !0 }), console.log(`Cleaned up temp directory: ${r.tempDir}`)); } catch (i) { console.error(`Failed to cleanup temp directory ${r.tempDir}:`, i); } if (n && r.finalPath) try { fe.existsSync(r.finalPath) && (fe.unlinkSync(r.finalPath), console.log(`Deleted final file: ${r.finalPath}`)); } catch (i) { console.error(`Failed to delete final file ${r.finalPath}:`, i); } } catch (i) { console.error(`Cleanup error for stream ${e}:`, i); } finally { oo.streams.delete(e), console.log(`Stream ${e} cleaned up`); } } } const UEe = [ ".mp4", ".mov", ".avi", ".wmv", ".mpeg", ".mpg", ".flv", ".mkv", ".png", ".gif", ".jpg", ".jpeg", ".webp", ".bmp" ], LEe = l.Object({ files: l.Union([ l.Array(l.String()), l.String() ], { description: "文件列表或单个文件路径" }), name: l.Optional(l.String({ description: "任务名称" })), thumb_path: l.Optional(l.String({ description: "缩略图路径" })) }); class QEe extends ie { actionName = re.CreateFlashTask; payloadSchema = LEe; returnSchema = l.Any({ description: "任务创建结果" }); actionSummary = "创建闪传任务"; actionTags = ["文件扩展"]; payloadExample = { files: "C:\\test.jpg", name: "test_task" }; returnExample = { task_id: "task_123" }; async _handle(e) { const n = Array.isArray(e.files) ? e.files : [e.files]; let r = ""; if (n.length === 1) { const a = n[0]; if (a === void 0) return {}; const s = xe.extname(a).toLowerCase(); if (UEe.includes(s)) try { const c = await this.core.apis.FlashApi.createFileThumbnail(a); c && typeof c == "object" && "result" in c && c.result === 0 && (r = c.targetPath); } catch { } } function i(a) { const s = a.replace(/[\\/]/g, xe.sep); return xe.normalize(s); } let o; return e.thumb_path !== void 0 ? o = xe.normalize(e.thumb_path) : o = i(r), await this.core.apis.FlashApi.createFlashTransferUploadTask(n, o, e.name || ""); } } const jEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }), user_id: l.Optional(l.String({ description: "用户 QQ" })), group_id: l.Optional(l.String({ description: "群号" })) }); class $Ee extends ie { actionName = re.SendFlashMsg; payloadSchema = jEe; returnSchema = l.Any({ description: "发送结果" }); actionSummary = "发送闪传消息"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123", user_id: "123456789" }; returnExample = { message_id: 123456 }; async _handle(e) { let n; if (e.group_id) n = { chatType: ke.KCHATTYPEGROUP, peerUid: e.group_id.toString() }; else if (e.user_id) { const r = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!r) throw new Error("User not found"); n = { chatType: await this.core.apis.FriendApi.isBuddy(r) ? ke.KCHATTYPEC2C : ke.KCHATTYPETEMPC2CFROMGROUP, peerUid: r }; } else throw new Error("user_id or group_id is required"); return await this.core.apis.FlashApi.sendFlashMessage(e.fileset_id, n); } } const GEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }) }); class qEe extends ie { actionName = re.GetFlashFileList; payloadSchema = GEe; returnSchema = l.Any({ description: "文件列表" }); actionSummary = "获取闪传文件列表"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123" }; returnExample = [ { file_name: "test.jpg", size: 1024 } ]; async _handle(e) { return await this.core.apis.FlashApi.getFileListBySetId(e.fileset_id); } } const zEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }), file_name: l.Optional(l.String({ description: "文件名" })), file_index: l.Optional(l.Number({ description: "文件索引" })) }); class HEe extends ie { actionName = re.GetFlashFileUrl; payloadSchema = zEe; returnSchema = l.Any({ description: "文件下载链接" }); actionSummary = "获取闪传文件链接"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123" }; returnExample = { url: "http://example.com/flash.jpg" }; async _handle(e) { return await this.core.apis.FlashApi.getFileTransUrl(e.fileset_id, { fileName: e.file_name, fileIndex: e.file_index }); } } const WEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }) }); class KEe extends ie { actionName = re.GetShareLink; payloadSchema = WEe; returnSchema = l.Any({ description: "分享链接" }); actionSummary = "获取文件分享链接"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123" }; returnExample = "http://example.com/share"; async _handle(e) { return await this.core.apis.FlashApi.getShareLinkBySetId(e.fileset_id); } } const VEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }) }); class YEe extends ie { actionName = re.GetFilesetInfo; payloadSchema = VEe; returnSchema = l.Any({ description: "文件集信息" }); actionSummary = "获取文件集信息"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123" }; returnExample = { fileset_id: "set_123", file_list: [] }; async _handle(e) { return await this.core.apis.FlashApi.getFileSetIndoBySetId(e.fileset_id); } } const JEe = l.Object({ fileset_id: l.String({ description: "文件集 ID" }) }); class XEe extends ie { actionName = re.DownloadFileset; payloadSchema = JEe; returnSchema = l.Any({ description: "下载结果" }); actionSummary = "下载文件集"; actionTags = ["文件扩展"]; payloadExample = { fileset_id: "set_123" }; returnExample = null; async _handle(e) { return await this.core.apis.FlashApi.downloadFileSetBySetId(e.fileset_id); } } const ZEe = l.Object({ user_id: l.String({ description: "用户 QQ" }) }); class eAe extends ie { actionName = re.GetOnlineFileMessages; payloadSchema = ZEe; returnSchema = l.Any({ description: "在线文件消息列表" }); actionSummary = "获取在线文件消息"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789" }; returnExample = []; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.OnlineApi.getOnlineFileMsg(r); } } const tAe = l.Object({ user_id: l.String({ description: "用户 QQ" }), file_path: l.String({ description: "本地文件路径" }), file_name: l.Optional(l.String({ description: "文件名 (可选)" })) }); class nAe extends ie { actionName = re.SendOnlineFile; payloadSchema = tAe; returnSchema = l.Any({ description: "发送结果" }); actionSummary = "发送在线文件"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789", file_path: "C:\\path\\to\\file.txt", file_name: "test.txt" }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }, i = e.file_name || ""; return await this.core.apis.OnlineApi.sendOnlineFile(r, e.file_path, i); } } const rAe = l.Object({ user_id: l.String({ description: "用户 QQ" }), folder_path: l.String({ description: "本地文件夹路径" }), folder_name: l.Optional(l.String({ description: "文件夹名称 (可选)" })) }); class iAe extends ie { actionName = re.SendOnlineFolder; payloadSchema = rAe; returnSchema = l.Any({ description: "发送结果" }); actionSummary = "发送在线文件夹"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789", folder_path: "C:\\path\\to\\folder" }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.OnlineApi.sendOnlineFolder(r, e.folder_path, e.folder_name); } } const oAe = l.Object({ user_id: l.String({ description: "用户 QQ" }), msg_id: l.String({ description: "消息 ID" }) }); class aAe extends ie { actionName = re.CancelOnlineFile; payloadSchema = oAe; returnSchema = l.Any({ description: "取消结果" }); actionSummary = "取消在线文件"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789", msg_id: "123" }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.OnlineApi.cancelMyOnlineFileMsg(r, e.msg_id); } } const sAe = l.Object({ user_id: l.String({ description: "用户 QQ" }), msg_id: l.String({ description: "消息 ID" }), element_id: l.String({ description: "元素 ID" }) }); class cAe extends ie { actionName = re.ReceiveOnlineFile; payloadSchema = sAe; returnSchema = l.Any({ description: "接收结果" }); actionSummary = "接收在线文件"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789", msg_id: "123", save_path: "C:\\save" }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.OnlineApi.receiveOnlineFileOrFolder(r, e.msg_id, e.element_id); } } const uAe = l.Object({ user_id: l.String({ description: "用户 QQ" }), msg_id: l.String({ description: "消息 ID" }), element_id: l.String({ description: "元素 ID" }) }); class lAe extends ie { actionName = re.RefuseOnlineFile; payloadSchema = uAe; returnSchema = l.Any({ description: "拒绝结果" }); actionSummary = "拒绝在线文件"; actionTags = ["文件扩展"]; payloadExample = { user_id: "123456789", msg_id: "123" }; returnExample = null; async _handle(e) { const n = await this.core.apis.UserApi.getUidByUinV2(e.user_id.toString()); if (!n) throw new Error("User not found"); const r = { chatType: ke.KCHATTYPEC2C, peerUid: n }; return await this.core.apis.OnlineApi.refuseOnlineFileMsg(r, e.msg_id, e.element_id); } } const dAe = l.Object({ share_code: l.String({ description: "分享码或分享链接" }) }); class pAe extends ie { actionName = re.GetFilesetId; payloadSchema = dAe; returnSchema = l.Object({ fileset_id: l.String({ description: "文件集 ID" }) }); actionSummary = "获取文件集 ID"; actionTags = ["文件扩展"]; payloadExample = { share_code: "123456" }; returnExample = { fileset_id: "set_123" }; async _handle(e) { const n = e.share_code.includes("=") ? e.share_code.split("=").slice(1).join("=") : e.share_code; return { fileset_id: (await this.core.apis.FlashApi.fromShareLinkFindSetId(n)).fileSetId }; } } const fAe = l.Object({ message_id: l.Union([l.Number(), l.String()], { description: "消息ID" }) }), hAe = l.Object({ text: l.String({ description: "得到的文本" }) }); class mAe extends ie { actionName = re.FetchPttText; actionSummary = "获取语音转文字结果"; actionTags = ["消息扩展"]; payloadExample = dl.FetchPttText.payload; returnExample = dl.FetchPttText.response; payloadSchema = fAe; returnSchema = hAe; async _handle(e) { if (!e.message_id) throw Error("参数message_id不能为空"); const n = ot.getShortIdByMsgId(e.message_id.toString()), r = ot.getMsgIdAndPeerByShortId(n ?? +e.message_id); if (!r) throw new Error("消息不存在"); const i = { guildId: "", peerUid: r?.Peer.peerUid, chatType: r.Peer.chatType }, o = this.obContext.configLoader.configData.timeout.baseTimeout, s = (await bs( this.core.apis.MsgApi.getMsgsByMsgId(i, [r?.MsgId || e.message_id.toString()]), o ).catch((f) => { throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${f.message || String(f)}`) : f; })).msgList[0]; if (!s) throw Error("消息不存在或已被撤回"); const c = s.elements.find( (f) => f.elementType === Ee.PTT ); if (!c) throw Error("消息中不包含语音"); const u = this.obContext.configLoader.configData.timeout.baseTimeout; await bs( this.core.context.session.getMsgService().translatePtt2Text(r.MsgId, r.Peer, c), u ).catch((f) => { throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`获取语音转文字结果失败: ${f.message || String(f)}`) : f; }); const p = (await bs( this.core.apis.MsgApi.getMsgsByMsgId(i, [r?.MsgId || e.message_id.toString()]), o ).catch((f) => { throw f instanceof Error && f.message.startsWith("PromiseTimer:") ? new Error(`消息不存在或已被撤回: ${f.message || String(f)}`) : f; })).msgList[0]; if (!p) throw Error("消息不存在或已被撤回"); for (const f of p.elements) if (f.elementType === Ee.PTT && f.pttElement?.text) return { text: f.pttElement?.text }; throw new Error("获取语音转文字结果失败"); } } const gAe = l.Object({ group_id: l.Union([l.String(), l.Number()], { description: "群号" }) }), yAe = l.Array( l.Object({ user_id: l.Number({ description: "打卡者QQ" }), nick: l.String({ description: "打卡者昵称" }), time: l.Number({ description: "打卡时间" }), rank: l.Number({ description: "打卡排名" }) }), { description: "群组今日打卡列表" } ); class bAe extends ie { actionName = re.GetGroupSignedList; actionSummary = "获取群组今日打卡列表"; actionTags = ["群组扩展"]; payloadExample = { group_id: "123456" }; returnExample = {}; payloadSchema = gAe; returnSchema = yAe; async _handle(e) { const n = await this.core.apis.WebApi.getDaySignedList(e.group_id.toString()); if (!n.response.page) throw new Error("无法获取该群组打卡列表"); return n.response.page[0]?.infos?.map((r) => ({ user_id: +r.uid, nick: r.uidGroupNick, time: +r.signedTimeStamp, rank: (r.signInRank - 1) / 2 + 1 })) ?? []; } } const pD = [1, 4, 16, 64, 128], vAe = l.Object({ content: l.String({ description: "说说正文" }), images: l.Optional(l.Array(l.String(), { description: "图片数组, 支持 file:// http(s):// base64:// , 自动上传" })), ugc_right: l.Optional(l.Union([l.Number(), l.String()], { default: 1, description: "查看权限: 1所有人可见 4好友可见 16部分好友可见 64仅自己可见 128部分好友不可见" })), target_uins: l.Optional(l.Array(l.Union([l.Number(), l.String()]), { description: "ugc_right为16/128时, 权限作用的QQ号数组" })) }), xAe = l.Object({ tid: l.String({ description: "说说Tid" }) }, { description: "发说说结果" }); class wAe extends ie { actionName = re.SendQzoneMsg; actionSummary = "发表QQ空间说说"; actionDescription = "在QQ空间(Qzone)发表说说, 支持纯文字或带(多)图, 可设置查看权限"; actionTags = ["扩展接口"]; payloadExample = Nn.SendQzoneMsg.payload; returnExample = Nn.SendQzoneMsg.response; payloadSchema = vAe; returnSchema = xAe; async _handle(e) { const n = e.ugc_right !== void 0 ? +e.ugc_right : 1; if (!pD.includes(n)) throw new Error(`ugc_right 参数不合法, 允许的值为: ${pD.join(", ")}`); const r = e.target_uins?.map((a) => +a).filter((a) => !Number.isNaN(a)); if ((n === 16 || n === 128) && (!r || r.length === 0)) throw new Error("ugc_right 为 16 或 128 时, target_uins 不能为空"); const i = [], o = []; try { for (const s of e.images ?? []) { const c = await $i(this.core.SnowCatTempPath, s); if (!c.success) throw new Error(`图片${s}处理失败, ${c.errMsg}`); c.isLocal || o.push(c.path); const u = mo(c.path).toString("base64"), d = await this.core.apis.WebApi.uploadImageToQzone(u); i.push(d); } return await this.core.apis.WebApi.publishQzoneMsg(e.content, i, n, r); } finally { for (const a of o) ir(a) && await i0(a).catch(() => { }); } } } const SAe = l.Object({ tid: l.String({ description: "说说 tid (来自 get_qzone_msg_list / send_qzone_msg)" }) }); class _Ae extends ie { actionName = re.DeleteQzoneMsg; actionSummary = "删除QQ空间说说"; actionDescription = "删除QQ空间(Qzone)的一条说说, 按 tid 删除"; actionTags = ["扩展接口"]; payloadExample = Nn.DeleteQzoneMsg.payload; returnExample = Nn.DeleteQzoneMsg.response; payloadSchema = SAe; returnSchema = l.Null(); async _handle(e) { await this.core.apis.WebApi.deleteQzoneMsg(e.tid); } } const EAe = l.Object({ target_uin: l.Optional(l.String({ description: "目标QQ号,省略=机器人自己" })), pos: l.Optional(l.Union([l.Number(), l.String()], { default: 0, description: "起始偏移" })), num: l.Optional(l.Union([l.Number(), l.String()], { default: 20, description: "每页数量" })) }); class AAe extends ie { actionName = re.GetQzoneMsgList; actionSummary = "获取说说列表"; actionDescription = "获取QQ空间说说列表(默认自己空间,可查有权限的他人空间);-10000限频自动切备路"; actionTags = ["扩展接口"]; payloadExample = { target_uin: "123456789", pos: 0, num: 20 }; returnExample = { total: 100, msglist: [{ tid: "abc123", content: "今天天气不错", time: 176e7, comment_num: 2, is_private: !1, images: ["https://..."] }] }; payloadSchema = EAe; returnSchema = l.Object({ total: l.Number(), msglist: l.Array(l.Object({ tid: l.String(), content: l.String(), time: l.Number(), comment_num: l.Number(), is_private: l.Boolean(), images: l.Array(l.String()) })) }); async _handle(e) { return this.core.apis.WebApi.getQzoneMsgList( e.target_uin, e.pos !== void 0 ? +e.pos : 0, e.num !== void 0 ? +e.num : 20 ); } } const IAe = l.Object({ target_uin: l.String({ description: "说说主人的QQ号" }), tid: l.String({ description: "说说tid" }), pos: l.Optional(l.Union([l.Number(), l.String()], { default: 0, description: "评论起始偏移" })), num: l.Optional(l.Union([l.Number(), l.String()], { default: 20, description: "评论每页数量" })) }); class CAe extends ie { actionName = re.GetQzoneMsgDetail; actionSummary = "获取说说详情"; actionDescription = "读取一条说说正文与一页评论(含内联回复)"; actionTags = ["扩展接口"]; payloadExample = { target_uin: "123456789", tid: "abc123" }; returnExample = { tid: "abc123", content: "正文", comment_num: 2, comments: [] }; payloadSchema = IAe; returnSchema = l.Object({ tid: l.String(), content: l.String(), comment_num: l.Number(), comments: l.Array(l.Any()) }); async _handle(e) { return this.core.apis.WebApi.getQzoneMsgDetail( e.target_uin, e.tid, e.pos !== void 0 ? +e.pos : 0, e.num !== void 0 ? +e.num : 20 ); } } const TAe = l.Object({ target_uin: l.String({ description: "说说主人的QQ号" }), tid: l.String({ description: "说说tid" }), like: l.Boolean({ default: !0, description: "true=点赞 false=取消赞" }), abstime: l.Optional(l.Union([l.Number(), l.String()], { default: 0, description: "目标帖发帖时间(unix秒),传真实值更稳" })) }); class kAe extends ie { actionName = re.SetQzoneLike; actionSummary = "说说点赞/取消赞"; actionDescription = "对一条说说点赞或取消赞(appid 311 mood)"; actionTags = ["扩展接口"]; payloadExample = { target_uin: "123456789", tid: "abc123", like: !0 }; returnExample = null; payloadSchema = TAe; returnSchema = l.Null(); async _handle(e) { return await this.core.apis.WebApi.setQzoneLike( e.target_uin, e.tid, e.like, e.abstime !== void 0 ? +e.abstime : 0 ), null; } } const NAe = l.Object({ host_uin: l.String({ description: "说说主人的QQ号" }), tid: l.String({ description: "说说tid" }), content: l.String({ description: "评论正文" }), richval: l.Optional(l.String({ description: "图片评论时传图片直链(与发说说的richval串不同)" })) }); class PAe extends ie { actionName = re.CommentQzoneMsg; actionSummary = "评论说说"; actionDescription = "给一条说说发评论(emotion_cgi_re_feeds)"; actionTags = ["扩展接口"]; payloadExample = { host_uin: "123456789", tid: "abc123", content: "说得好" }; returnExample = { comment_id: "999" }; payloadSchema = NAe; returnSchema = l.Object({ comment_id: l.String() }); async _handle(e) { return this.core.apis.WebApi.commentQzoneMsg( e.host_uin, e.tid, e.content, e.richval ); } } const DAe = l.Object({ host_uin: l.String({ description: "说说主人的QQ号" }), tid: l.String({ description: "说说tid" }), content: l.String({ description: "回复正文" }), comment_id: l.String({ description: "父评论id(顶层评论,回复楼中楼也传顶层)" }), comment_uin: l.String({ description: "父评论作者QQ号" }), reply_to_uin: l.Optional(l.String({ description: "楼中楼点名作者的QQ号" })), reply_to_name: l.Optional(l.String({ description: "楼中楼点名作者的昵称" })) }); class OAe extends ie { actionName = re.ReplyQzoneComment; actionSummary = "回复说说评论"; actionDescription = "在说说的评论线程里回复(独立端点;点名作者自动转@提及)"; actionTags = ["扩展接口"]; payloadExample = { host_uin: "123456789", tid: "abc123", content: "同意", comment_id: "999", comment_uin: "987654321" }; returnExample = { comment_id: "1001" }; payloadSchema = DAe; returnSchema = l.Object({ comment_id: l.String() }); async _handle(e) { const n = e.reply_to_uin && e.reply_to_name ? { uin: e.reply_to_uin, name: e.reply_to_name } : void 0; return this.core.apis.WebApi.replyQzoneComment( e.host_uin, e.tid, e.content, { commentId: e.comment_id, commentUin: e.comment_uin, ...n ? { replyTo: n } : {} } ); } } const FAe = l.Object({ target_uin: l.Optional(l.String({ description: "目标QQ号,省略=机器人自己" })) }); class MAe extends ie { actionName = re.GetQzoneProfile; actionSummary = "获取空间名称和说明"; actionDescription = "获取QQ空间名称和说明(默认当前账号,可查有权限的他人空间)"; actionTags = ["扩展接口"]; payloadExample = { target_uin: "123456789" }; returnExample = { name: "我的空间", description: "记录日常" }; payloadSchema = FAe; returnSchema = l.Object({ name: l.String(), description: l.String() }); async _handle(e) { return this.core.apis.WebApi.getQzoneProfile(e.target_uin); } } const RAe = l.Object({ name: l.Optional(l.String({ description: "空间名称,省略=不动" })), description: l.Optional(l.String({ description: "空间说明,省略=不动;空串=清空" })) }); class BAe extends ie { actionName = re.SetQzoneProfile; actionSummary = "修改空间名称和说明"; actionDescription = "修改当前账号的空间名称/说明,只动传了的字段,空串=清空"; actionTags = ["扩展接口"]; payloadExample = { name: "我的空间", description: "记录日常" }; returnExample = null; payloadSchema = RAe; returnSchema = l.Null(); async _handle(e) { return await this.core.apis.WebApi.setQzoneProfile({ ...e.name !== void 0 ? { name: e.name } : {}, ...e.description !== void 0 ? { description: e.description } : {} }), null; } } const UAe = l.Object({ target_uin: l.String({ description: "目标QQ号" }), ban: l.Boolean({ default: !0, description: "true=拉黑 false=解拉黑" }) }); class LAe extends ie { actionName = re.SetQzoneBlack; actionSummary = "空间拉黑/解拉黑"; actionDescription = "把一个用户加入/移出机器人QQ空间的黑名单"; actionTags = ["扩展接口"]; payloadExample = { target_uin: "123456789", ban: !0 }; returnExample = null; payloadSchema = UAe; returnSchema = l.Null(); async _handle(e) { return await this.core.apis.WebApi.setQzoneBlack(e.target_uin, e.ban), null; } } const fD = [1, 4, 16, 64, 128], QAe = l.Object({ tid: l.String({ description: "说说tid(自己的说说)" }), ugc_right: l.Union([l.Number(), l.String()], { description: "查看权限: 1所有人 4好友 16部分好友 64仅自己 128部分好友不可见" }), target_uins: l.Optional(l.Array(l.String(), { description: "ugc_right为16/128时权限作用的QQ号数组" })) }); class jAe extends ie { actionName = re.SetQzoneMsgRight; actionSummary = "修改说说查看权限"; actionDescription = "改一条已有说说的查看权限(内部走 msgdetail→update 两步全量重提)"; actionTags = ["扩展接口"]; payloadExample = { tid: "abc123", ugc_right: 4 }; returnExample = { ugc_right: 4 }; payloadSchema = QAe; returnSchema = l.Object({ ugc_right: l.Number() }); async _handle(e) { const n = +e.ugc_right; if (!fD.includes(n)) throw new Error(`ugc_right 参数不合法, 允许的值为: ${fD.join(", ")}`); if ((n === 16 || n === 128) && (!e.target_uins || e.target_uins.length === 0)) throw new Error("ugc_right 为 16 或 128 时, target_uins 不能为空"); return this.core.apis.WebApi.setQzoneMsgRight(e.tid, n, e.target_uins); } } const hD = [1, 4, 16, 64, 128], $Ae = l.Object({ content: l.String({ description: "说说正文" }), richvals: l.Optional(l.Array(l.String(), { description: "richval 数组(来自 uploadImageToQzone 或 get_qzone_msg_list 的图片机制),多图 自动拼接" })), ugc_right: l.Optional(l.Union([l.Number(), l.String()], { default: 1, description: "查看权限: 1所有人 4好友 16部分好友 64仅自己 128部分好友不可见" })), target_uins: l.Optional(l.Array(l.String(), { description: "ugc_right为16/128时权限作用的QQ号数组" })) }); class GAe extends ie { actionName = re.SendQzoneMsgFull; actionSummary = "发表说说(富返回)"; actionDescription = "发表QQ空间说说,返回 tid + 发布时间(send_qzone_msg 的富参版)"; actionTags = ["扩展接口"]; payloadExample = { content: "今天天气不错" }; returnExample = { tid: "abc123", time: 176e7 }; payloadSchema = $Ae; returnSchema = l.Object({ tid: l.String(), time: l.Number() }); async _handle(e) { const n = e.ugc_right !== void 0 ? +e.ugc_right : 1; if (!hD.includes(n)) throw new Error(`ugc_right 参数不合法, 允许的值为: ${hD.join(", ")}`); if ((n === 16 || n === 128) && (!e.target_uins || e.target_uins.length === 0)) throw new Error("ugc_right 为 16 或 128 时, target_uins 不能为空"); return this.core.apis.WebApi.publishQzoneMsgFull( e.content, e.richvals ?? [], n, e.target_uins ); } } const qAe = l.Object({ page_num: l.Optional(l.Union([l.Number(), l.String()], { default: 1, description: "页码(无cursor时生效)" })), count: l.Optional(l.Union([l.Number(), l.String()], { default: 10, description: "每页条数(1-50)" })), cursor: l.Optional(l.String({ description: "上次返回的 next_cursor,续翻用" })) }); class zAe extends ie { actionName = re.GetQzoneFeeds; actionSummary = "获取空间好友动态流"; actionDescription = "读取QQ空间好友动态(HTML载荷数据级解析,不执行远程内容);cursor 续翻"; actionTags = ["扩展接口"]; payloadExample = { page_num: 1, count: 10 }; returnExample = { feeds: [{ uin: 123456789, nickname: "张三", tid: "abc", content: "动态正文", images: [], like_count: 5, comment_count: 2, appid: 311, key: "k", time: 176e7, html: "", content_complete: !0 }], has_more: !0, next_cursor: "eyJ..." }; payloadSchema = qAe; returnSchema = l.Object({ feeds: l.Array(l.Any()), has_more: l.Boolean(), next_cursor: l.Union([l.String(), l.Null()]) }); async _handle(e) { return this.core.apis.WebApi.getQzoneFeeds( e.page_num !== void 0 ? +e.page_num : 1, e.count !== void 0 ? +e.count : 10, e.cursor ); } } const Zi = l.Any({ description: "完整动态对象(来自 get_qzone_public_feeds/feed_detail,原样回传)" }), Kf = l.Any({ description: "评论对象(原样回传)" }), vL = l.Optional(l.Any({ description: "回复对象(原样回传)" })), xL = l.Any({ description: "用户身份对象(详情/列表响应里的 user 形态)" }); function Ht(t) { return t.core.apis.WebApi; } const HAe = l.Object({}); class WAe extends ie { actionName = re.GetQzonePublicCapabilities; actionSummary = "查询空友入口能力"; actionDescription = "查询当前账号在 QQ 空间公共空间(空友)各入口的白名单能力"; actionTags = ["扩展接口"]; payloadExample = {}; returnExample = { entrance1: !0, entrance15: !1 }; payloadSchema = HAe; returnSchema = l.Any(); async _handle() { const e = Ht(this), { uin: n, g_tk: r, cookie: i } = await e.getQzoneAuth(); return e.getQzonePublicCapabilities(i, r, n); } } const KAe = l.Object({ cursor: l.Optional(l.String({ description: "上次返回的 next_cursor,续翻用" })) }); class VAe extends ie { actionName = re.GetQzonePublicFeeds; actionSummary = "获取空友推荐动态"; actionDescription = "读取QQ空间公共空间(空友)推荐动态流,cursor 续翻"; actionTags = ["扩展接口"]; payloadExample = {}; returnExample = { feeds: [], has_more: !1, next_cursor: null }; payloadSchema = KAe; returnSchema = l.Any(); async _handle(e) { const { uin: n, g_tk: r, cookie: i } = await Ht(this).getQzoneAuth(); return Ht(this).getQzonePublicFeeds(i, r, n, e.cursor); } } const YAe = l.Object({ feed: Zi }); class JAe extends ie { actionName = re.GetQzonePublicFeedDetail; actionSummary = "获取空友动态详情"; actionDescription = "获取一条空友推荐动态的完整详情(含评论首屏)"; actionTags = ["扩展接口"]; payloadExample = { feed: {} }; returnExample = {}; payloadSchema = YAe; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).getQzonePublicFeedDetail(r, n, e.feed); } } const XAe = l.Object({ feed: Zi, cursor: l.String({ description: "详情/上页返回的评论 attach_info" }) }); class ZAe extends ie { actionName = re.GetQzonePublicComments; actionSummary = "获取空友评论分页"; actionDescription = "分页读取一条空友动态的评论"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, cursor: "" }; returnExample = {}; payloadSchema = XAe; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).getQzonePublicComments(r, n, e.feed, e.cursor); } } const e3e = l.Object({ feed: Zi, comment: Kf, cursor: l.Optional(l.String({ description: "回复 attach_info,省略用 comment 自带" })), page_size: l.Optional(l.Union([l.Number(), l.String()], { default: 20, description: "每页条数" })) }); class t3e extends ie { actionName = re.GetQzonePublicReplies; actionSummary = "获取空友楼中楼分页"; actionDescription = "分页读取一条空友评论的楼中楼回复"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, comment: {}, cursor: "", page_size: 20 }; returnExample = {}; payloadSchema = e3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).getQzonePublicReplies( r, n, e.feed, e.comment, e.cursor ?? "", e.page_size !== void 0 ? +e.page_size : 20 ); } } const n3e = l.Object({ feed: Zi, enable: l.Boolean({ default: !0 }) }); class r3e extends ie { actionName = re.SetQzonePublicUpvote; actionSummary = "空友动态点赞/取消"; actionDescription = "对一条空友推荐动态点赞或取消点赞(UFO Upvote/Downvote)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, enable: !0 }; returnExample = {}; payloadSchema = n3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).setQzonePublicUpvote(r, n, e.feed, e.enable); } } const i3e = l.Object({ feed: Zi, enable: l.Boolean({ default: !0 }) }); class o3e extends ie { actionName = re.SetQzonePublicLike; actionSummary = "空友动态点赞(DoLike)"; actionDescription = "对一条空友动态点赞/取消赞(DoLike/UnLike,key 取 cur_like_key)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, enable: !0 }; returnExample = {}; payloadSchema = i3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).setQzonePublicLike(r, n, e.feed, e.enable); } } const a3e = l.Object({ feed: Zi, comment: Kf, reply: vL, enable: l.Boolean({ default: !0 }) }); class s3e extends ie { actionName = re.SetQzonePublicCommentLike; actionSummary = "空友评论/回复点赞"; actionDescription = "给空友评论点赞(like_type=2)或给楼中楼回复点赞(like_type=3)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, comment: {}, enable: !0 }; returnExample = {}; payloadSchema = a3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).setQzonePublicCommentLike( r, n, e.feed, e.comment, e.enable, e.reply ); } } const c3e = l.Object({ feed: Zi, user: xL, content: l.Union([l.String(), l.Array(l.Any())], { description: "评论内容:纯文本或富内容数组" }) }); class u3e extends ie { actionName = re.CommentQzonePublicFeed; actionSummary = "空友发评论"; actionDescription = "给一条空友推荐动态发评论"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, user: {}, content: "说得好" }; returnExample = {}; payloadSchema = c3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).commentQzonePublicFeed( r, n, e.feed, e.user, e.content ); } } const l3e = l.Object({ feed: Zi, user: xL, comment: Kf, content: l.Union([l.String(), l.Array(l.Any())], { description: "回复内容" }), reply: vL }); class d3e extends ie { actionName = re.ReplyQzonePublicFeed; actionSummary = "空友回复评论"; actionDescription = "在空友动态的评论线程里回复(可点名楼中楼目标)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, user: {}, comment: {}, content: "同意" }; returnExample = {}; payloadSchema = l3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).replyQzonePublicFeed( r, n, e.feed, e.user, e.comment, e.content, e.reply ); } } const p3e = l.Object({ feed: Zi, comment: Kf }); class f3e extends ie { actionName = re.DeleteQzonePublicComment; actionSummary = "删空友评论"; actionDescription = "删除一条空友动态的评论(自己的评论)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, comment: {} }; returnExample = {}; payloadSchema = p3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).deleteQzonePublicComment( r, n, e.feed, e.comment ); } } const h3e = l.Object({ feed: Zi, comment: Kf, reply: l.Any({ description: "回复对象(原样回传)" }) }); class m3e extends ie { actionName = re.DeleteQzonePublicReply; actionSummary = "删空友楼中楼"; actionDescription = "删除一条空友评论的楼中楼回复(自己的回复)"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, comment: {}, reply: {} }; returnExample = {}; payloadSchema = h3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).deleteQzonePublicReply( r, n, e.feed, e.comment, e.reply ); } } const g3e = l.Object({ feed: Zi, enable: l.Boolean({ default: !0 }) }); class y3e extends ie { actionName = re.SetQzonePublicFollow; actionSummary = "空友关注/取关"; actionDescription = "关注/取关一条空友动态的作者"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, enable: !0 }; returnExample = {}; payloadSchema = g3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).setQzonePublicFollow(r, n, e.feed, e.enable); } } const b3e = l.Object({ feed: Zi, reason: l.String({ description: "转发理由/附言" }) }); class v3e extends ie { actionName = re.ForwardQzonePublicFeed; actionSummary = "转发空友动态"; actionDescription = "转发一条空友推荐动态到自己的空间"; actionTags = ["扩展接口"]; payloadExample = { feed: {}, reason: "转发" }; returnExample = {}; payloadSchema = b3e; returnSchema = l.Any(); async _handle(e) { const { g_tk: n, cookie: r } = await Ht(this).getQzoneAuth(); return Ht(this).forwardQzonePublicFeed(r, n, e.feed, e.reason); } } const x3e = l.Object({ group_id: l.Union([l.Number(), l.String()], { description: "群号" }) }); class w3e extends ie { actionName = re.GetGroupAlbumList; actionSummary = "获取群相册列表"; actionDescription = "获取群相册列表(qzone Web 线 qun_list_album_v2)"; actionTags = ["扩展接口"]; payloadExample = { group_id: 123456789 }; returnExample = [{ id: "1", title: "相册一" }]; payloadSchema = x3e; returnSchema = l.Any(); async _handle(e) { return this.core.apis.WebApi.getAlbumList(String(e.group_id)); } } const S3e = l.Object({ group_id: l.Union([l.Number(), l.String()], { description: "群号" }), album_id: l.String({ description: "相册id(来自 get_group_album_list)" }) }); class _3e extends ie { actionName = re.GetGroupAlbumMediaListOnly; actionSummary = "获取群相册媒体列表(Web线)"; actionDescription = "经 NT AlbumService 读取群相册媒体列表(与 get_group_album_media_list 分页线并存)"; actionTags = ["扩展接口"]; payloadExample = { group_id: 123456789, album_id: "1" }; returnExample = []; payloadSchema = S3e; returnSchema = l.Any(); async _handle(e) { return this.core.apis.WebApi.getAlbumMediaListByNTQQ(String(e.group_id), e.album_id); } } const E3e = l.Object({ group_id: l.Union([l.Number(), l.String()], { description: "群号" }), message_seq: l.Union([l.Number(), l.String()], { description: "消息 seq" }), emoji_id: l.String({ description: "表情id" }), emoji_type: l.Optional(l.String({ description: "表情类型(1-2,省略按 id 长度推断)" })), cookie: l.Optional(l.String({ description: "翻页 cookie,来自上一页返回" })), count: l.Optional(l.Union([l.Number(), l.String()], { default: 20, description: "每页数量" })) }); class A3e extends ie { actionName = re.GetMsgEmojiLikes; actionSummary = "查询消息表情回应列表"; actionDescription = "查询一条群消息的表情回应(谁点了什么表情),可翻页"; actionTags = ["扩展接口"]; payloadExample = { group_id: 123456789, message_seq: 12345, emoji_id: "128077" }; returnExample = { cookie: "", likes: [] }; payloadSchema = E3e; returnSchema = l.Any(); async _handle(e) { const n = { chatType: 1, peerUin: String(e.group_id), peerUid: "", guildId: "" }; return this.core.apis.MsgApi.getMsgEmojiLikesList( n, String(e.message_seq), e.emoji_id, e.emoji_type ?? (e.emoji_id.length > 3 ? "2" : "1"), e.cookie ?? "", e.count !== void 0 ? +e.count : 20 ); } } const I3e = l.Object({ user_id: l.Optional(l.String({ description: "目标QQ号,省略=自己" })) }); class C3e extends ie { actionName = re.GetFriendDress; actionSummary = "获取用户装扮"; actionDescription = "获取好友/自己的装扮信息(挂件/气泡等,getUserDetailInfo)"; actionTags = ["扩展接口"]; payloadExample = { user_id: "123456789" }; returnExample = { dress: {} }; payloadSchema = I3e; returnSchema = l.Any(); async _handle(e) { const n = e.user_id ?? this.core.selfInfo.uin, r = n === this.core.selfInfo.uin ? this.core.selfInfo.uid : await this.core.apis.UserApi.getUidByUinV2(n); if (!r) throw new Error("用户不存在"); return { dress: await this.core.apis.UserApi.getUserDetailInfo(r) }; } } const T3e = l.Object({ count: l.Optional(l.Union([l.Number(), l.String()], { default: 50, description: "取回数量" })) }); class k3e extends ie { actionName = re.FetchSysFaces; actionSummary = "获取系统表情目录"; actionDescription = "获取 QQ 系统表情目录(占位:协议自编目录待后续批次移植,当前返回空集)"; actionTags = ["扩展接口"]; payloadExample = { count: 50 }; returnExample = { items: [], note: "sys face catalog 移植批次待排" }; payloadSchema = T3e; returnSchema = l.Any(); async _handle(e) { return { items: [], note: "sys face catalog 移植批次待排" }; } } function k3(t, e) { const n = e.find((r) => r.result.result !== 0); if (n) throw new Error( `${t}失败 Setting: ${n.setting} ErrCode: ${n.result.result} ErrMsg: ${n.result.errMsg || "未知错误"}` ); } const N3e = l.Union([ l.Literal("disabled"), l.Literal("require_approval"), l.Literal("no_approval"), l.Literal("no_approval_under_100") ], { description: "成员邀请策略:禁止、需要管理员审核、无需审核、群成员少于100人时无需审核" }), P3e = l.Object({ group_id: l.String({ description: "群号" }), policy: N3e }), D3e = l.Null({ description: "操作结果" }); class O3e extends ie { actionName = re.SetGroupMemberInvitePolicy; payloadSchema = P3e; returnSchema = D3e; actionSummary = "设置群成员邀请策略"; actionDescription = "设置是否允许群成员邀请好友进群,以及邀请是否需要管理员审核"; actionTags = ["群组接口"]; payloadExample = at.SetGroupMemberInvitePolicy.payload; returnExample = at.SetGroupMemberInvitePolicy.response; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupMemberInvitePolicy(e.group_id, e.policy); return k3("设置群成员邀请策略", n), null; } } const F3e = l.Object({ group_id: l.String({ description: "群号" }), allow_member_upload_album: l.Optional(l.Boolean({ description: "允许成员上传群相册" })), allow_member_temporary_session: l.Optional(l.Boolean({ description: "允许成员发起临时会话" })), allow_member_create_group: l.Optional(l.Boolean({ description: "允许成员发起新的群聊" })) }), M3e = l.Null({ description: "操作结果" }); class R3e extends ie { actionName = re.SetGroupMemberPermissions; payloadSchema = F3e; returnSchema = M3e; actionSummary = "设置群成员功能权限"; actionDescription = "设置群成员上传相册、发起临时会话和发起新群聊的权限;未传入的项目保持不变"; actionTags = ["群组接口"]; payloadExample = at.SetGroupMemberPermissions.payload; returnExample = at.SetGroupMemberPermissions.response; async _handle(e) { const n = { allowMemberUploadAlbum: e.allow_member_upload_album, allowMemberTemporarySession: e.allow_member_temporary_session, allowMemberCreateGroup: e.allow_member_create_group }; if (Object.values(n).every((i) => i === void 0)) throw new Error("至少需要提供一个群成员功能权限"); const r = await this.core.apis.GroupApi.setGroupMemberPermissions(e.group_id, n); return k3("设置群成员功能权限", r), null; } } const B3e = l.Object({ group_id: l.String({ description: "群号" }), visible: l.Boolean({ description: "新成员默认可见最近聊天记录" }) }), U3e = l.Null({ description: "操作结果" }); class L3e extends ie { actionName = re.SetGroupNewMemberHistoryVisibility; payloadSchema = B3e; returnSchema = U3e; actionSummary = "设置新成员历史消息可见性"; actionDescription = "设置新入群成员默认是否可以查看最近聊天记录"; actionTags = ["群组接口"]; payloadExample = at.SetGroupNewMemberHistoryVisibility.payload; returnExample = at.SetGroupNewMemberHistoryVisibility.response; async _handle(e) { const n = await this.core.apis.GroupApi.setGroupNewMemberHistoryVisibility( e.group_id, e.visible ); return k3("设置新成员历史消息可见性", n), null; } } function Q3e(t, e) { return [ new CEe(t, e), new kEe(t, e), new DEe(t, e), new FEe(t, e), new REe(t, e), new oo(t, e), new IEe(t, e), new SEe(t, e), new _Ee(t, e), new bEe(t, e), new wEe(t, e), new fEe(t, e), new gEe(t, e), new lEe(t, e), new cEe(t, e), new uEe(t, e), new tEe(t, e), new X2e(t, e), new G2e(t, e), new V2e(t, e), new H2e(t, e), new U2e(t, e), new Q2e(t, e), new R2e(t, e), new O2e(t, e), new P2e(t, e), new x2e(t, e), new xSe(t, e), new _Se(t, e), new aSe(t, e), new uSe(t, e), new mAe(t, e), new zve(t, e), new lwe(t, e), new gwe(t, e), new hwe(t, e), new ywe(t, e), new bwe(t, e), new wwe(t, e), new Ewe(t, e), new Rxe(t, e), new Bxe(t, e), new Jve(t, e), new Yve(t, e), new oxe(t, e), new cwe(t, e), new USe(t, e), new g_e(t, e), new y_e(t, e), new q_e(t, e), new _2e(t, e), new k2e(t, e), new I2e(t, e), new bAe(t, e), new wAe(t, e), new _Ae(t, e), new O3e(t, e), new R3e(t, e), new L3e(t, e), // onebot11 new gve(t, e), new Mbe(t, e), new Ube(t, e), new jbe(t, e), new qbe(t, e), new Wbe(t, e), new a_e(t, e), new Ybe(t, e), new Jbe(t, e), new Xbe(t, e), new Ibe(t, e), new tve(t, e), new vve(t, e), new Eve(t, e), new Sve(t, e), new rve(t, e), new ove(t, e), new ave(t, e), new cve(t, e), new Cve(t, e), new Ove(t, e), new Rve(t, e), new Lve(t, e), new Nve(t, e), new $ve(t, e), new Hve(t, e), new Vve(t, e), new _xe(t, e), new xxe(t, e), new Txe(t, e), new Axe(t, e), new Lxe(t, e), // 以下为go-cqhttp api new T_e(t, e), new sD(t, e), new twe(t, e), new iwe(t, e), new owe(t, e), new qxe(t, e), new jxe(t, e), new Dxe(t, e), new Mxe(t, e), new x_e(t, e), new uve(t, e), new dve(t, e), new lve(t, e), new hve(t, e), new cxe(t, e), new j_e(t, e), new Xve(t, e), new nxe(t, e), new dxe(t, e), new hxe(t, e), new yxe(t, e), new Vxe(t, e), new Xxe(t, e), new Cwe(t, e), new Nwe(t, e), new Owe(t, e), new Zve(t, e), new Rwe(t, e), new Lwe(t, e), new $we(t, e), new zwe(t, e), new Kwe(t, e), new Jwe(t, e), new eSe(t, e), new rSe(t, e), new $_e(t, e), new A_e(t, e), new I_e(t, e), new sD(t, e), new pSe(t, e), new hSe(t, e), new p_e(t, e), new ySe(t, e), new ISe(t, e), new kSe(t, e), new DSe(t, e), new MSe(t, e), new jSe(t, e), new HSe(t, e), new f_e(t, e), new Y_e(t, e), new J_e(t, e), new VSe(t, e), new JSe(t, e), new e_e(t, e), new e2e(t, e), // new UploadForwardMsg(obContext, core), new r_e(t, e), new u_e(t, e), new P_e(t, e), new F_e(t, e), new B_e(t, e), new Q_e(t, e), new W_e(t, e), new V_e(t, e), new qSe(t, e), new t2e(t, e), new i2e(t, e), new s2e(t, e), new y2e(t, e), new F2e(t, e), new rEe(t, e), new aEe(t, e), new QEe(t, e), new qEe(t, e), new HEe(t, e), new $Ee(t, e), new KEe(t, e), new YEe(t, e), new eAe(t, e), new nAe(t, e), new iAe(t, e), new cAe(t, e), new lAe(t, e), new aAe(t, e), new XEe(t, e), new pAe(t, e), // SnowCat · qzone Web 线动作组(SnowLuma 移植) new AAe(t, e), new CAe(t, e), new kAe(t, e), new PAe(t, e), new OAe(t, e), new MAe(t, e), new BAe(t, e), new LAe(t, e), new jAe(t, e), new GAe(t, e), new zAe(t, e), // SnowCat · qzone 公共空间(空友)动作组(SnowLuma 移植) new WAe(t, e), new VAe(t, e), new JAe(t, e), new ZAe(t, e), new t3e(t, e), new r3e(t, e), new o3e(t, e), new s3e(t, e), new u3e(t, e), new d3e(t, e), new f3e(t, e), new m3e(t, e), new y3e(t, e), new v3e(t, e), // SnowCat · 第三批动作组(SnowLuma 移植) new w3e(t, e), new _3e(t, e), new A3e(t, e), new k3e(t, e), new C3e(t, e) ]; } function j3e(t, e) { const n = Q3e(t, e), r = /* @__PURE__ */ new Map(); n.forEach((a) => { r.set(a.actionName, a), r.set(`${a.actionName}_async`, a), r.set(`${a.actionName}_rate_limited`, a); }), oB.forEach((a) => { const s = new a(t, e), c = s.actionName; r.set(c, s), r.set(`${c}_async`, s), r.set(`${c}_rate_limited`, s); }); function i(a) { return r.get(a); } async function o(a, s, c, u) { const d = r.get(a); if (!d) throw new Error(`Action ${String(a)} not found`); const p = await d.handle(s, c, u); if (p.status !== "ok" || !p.data) throw new Error(`Action ${String(a)} failed: ${p.message || "No data returned"}`); return p.data; } return { get: i, call: o }; } class $3e extends Ja { notice_type = "notify"; sub_type = "input_status"; status_text = "对方正在输入..."; event_type = 1; user_id = 0; group_id = 0; constructor(e, n, r, i) { super(e), this.user_id = n, this.event_type = r, this.status_text = i; } } class G3e extends aL { request_type = "friend"; user_id; comment; flag; constructor(e, n, r, i) { super(e), this.user_id = n, this.comment = r, this.flag = i; } } class q3e extends Ja { notice_type = "friend_recall"; user_id; message_id; constructor(e, n, r) { super(e), this.user_id = n, this.message_id = r; } } class z3e extends Uo { notice_type = "group_recall"; operator_id; message_id; constructor(e, n, r, i, o) { super(e, n, r), this.group_id = n, this.user_id = r, this.operator_id = i, this.message_id = o; } } class H3e extends Ja { notice_type = "bot_offline"; user_id; tag = "BotOfflineEvent"; message = "BotOfflineEvent"; constructor(e, n, r) { super(e), this.user_id = +e.selfInfo.uin, this.tag = n, this.message = r; } } class mD extends _2 { sseClients = []; get isActive() { return this.isEnable && (this.sseClients.length > 0 || super.isActive); } async handleRequest(e, n) { e.path === "/_events" ? this.createSseSupport(e, n) : super.httpApiRequest(e, n, !0); } async createSseSupport(e, n) { n.setHeader("Content-Type", "text/event-stream"), n.setHeader("Cache-Control", "no-cache"), n.setHeader("Connection", "keep-alive"), n.flushHeaders(), this.sseClients.push(n), e.on("close", () => { this.sseClients = this.sseClients.filter((r) => r !== n); }); } async onEvent(e) { super.onEvent(e); const n = []; this.sseClients.forEach((r) => { n.push(new Promise((i, o) => { r.write(`data: ${JSON.stringify(e)} `, (a) => { a ? o(a) : i(); }); })); }), await Promise.allSettled(n); } } class W3e extends eu { app; server; sseClients = []; get isActive() { return this.isEnable; } async onEvent(e) { const n = `event: ob11_event data: ${JSON.stringify(e)} `, r = this.sseClients.map((i) => new Promise((o) => { i.write(n, () => o()); })); await Promise.allSettled(r); } open() { try { if (this.isEnable) { this.core.context.logger.logError("Cannot open a closed MCP server"); return; } this.initializeServer(), this.isEnable = !0; } catch (e) { this.core.context.logger.logError(`[OneBot] [MCP Server Adapter] Boot Error: ${e}`); } } async close() { this.isEnable = !1, this.sseClients.forEach((e) => e.end()), this.sseClients = [], this.server?.close(), this.app = void 0; } async reload(e) { const n = this.isEnable, r = this.config.port, i = this.config.host, o = this.config.token; return this.config = e, e.enable && !n ? (this.open(), Gt.NetWorkOpen) : !e.enable && n ? (await this.close(), Gt.NetWorkClose) : r !== e.port || i !== e.host || o !== e.token ? (await this.close(), e.enable ? (this.open(), Gt.NetWorkOpen) : Gt.NetWorkClose) : Gt.Normal; } authOk(e) { const n = this.config.token; return n ? (e.headers.authorization ?? "") === `Bearer ${n}` : !0; } jsonRpcError(e, n, r, i) { e.json({ jsonrpc: "2.0", id: n, error: { code: r, message: i } }); } toolNameFor(e) { return e.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase(); } initializeServer() { this.app = ys(), this.server = Ds.createServer(this.app), this.app.use(qU()), this.app.use(ys.json({ limit: "50mb" })), this.app.use((e, n, r) => { if (!this.authOk(e)) { n.status(401).json({ jsonrpc: "2.0", id: null, error: { code: -32001, message: "Unauthorized" } }); return; } r(); }), this.app.get("/mcp", (e, n) => { n.setHeader("Content-Type", "text/event-stream"), n.setHeader("Cache-Control", "no-cache"), n.setHeader("Connection", "keep-alive"), n.flushHeaders(), n.write(`: stream open `), this.sseClients.push(n), e.on("close", () => { this.sseClients = this.sseClients.filter((r) => r !== n); }); }), this.app.post("/mcp", async (e, n) => { const r = e.body ?? {}, { id: i, method: o, params: a } = r; try { switch (o) { case "initialize": n.json({ jsonrpc: "2.0", id: i, result: { protocolVersion: "2025-03-26", capabilities: { tools: { listChanged: !1 } }, serverInfo: { name: "snowcat-onebot", version: "1.0.0" } } }); return; case "notifications/initialized": n.status(202).end(); return; case "ping": n.json({ jsonrpc: "2.0", id: i, result: {} }); return; case "tools/list": { const s = Object.values(re).filter((c) => c !== re.Unknown).map((c) => { const u = this.actions.get(c); return u ? { name: this.toolNameFor(c), description: `[OneBot:${c}] ${u.actionDescription || c}`, inputSchema: this.actionInputSchema(u) } : null; }).filter(Boolean); n.json({ jsonrpc: "2.0", id: i, result: { tools: s } }); return; } case "tools/call": { const s = String(a?.name ?? ""), c = a?.arguments ?? {}, u = s.split("_").map((y) => y.charAt(0).toUpperCase() + y.slice(1)).join(""), d = re[u] ?? u, p = this.actions.get(d); if (!p) { this.jsonRpcError(n, i, -32602, `Unknown tool: ${s}`); return; } const m = await p.handle(c, this.name, this.config, { send: async () => { } }), h = m.retcode === 0; n.json({ jsonrpc: "2.0", id: i, result: { content: [{ type: "text", text: JSON.stringify(m.data ?? m, null, 2) }], isError: !h } }); return; } case "resources/list": n.json({ jsonrpc: "2.0", id: i, result: { resources: [] } }); return; case "prompts/list": n.json({ jsonrpc: "2.0", id: i, result: { prompts: [] } }); return; default: this.jsonRpcError(n, i, -32601, `Method not found: ${o}`); } } catch (s) { this.core.context.logger.logError(`[OneBot] [MCP] handler error: ${s}`), this.jsonRpcError(n, i, -32603, `Internal error: ${s.message}`); } }), this.server.listen(this.config.port, this.config.host, () => { this.core.context.logger.log(`[OneBot] [MCP Server] SnowCat MCP 已启动: http://${this.config.host}:${this.config.port}/mcp(OneBot v11 全量动作)`); }); } actionInputSchema(e) { const n = e.payloadSchema; return n && typeof n == "object" && n.type === "object" ? n : { type: "object", properties: {}, additionalProperties: !0 }; } } const K3e = 1e3, V3e = 30; class Y3e { core; context; configLoader; apis; networkManager; actions; bootTime = Date.now() / 1e3; recallEventCache = /* @__PURE__ */ new Map(); reportedRecallEventCache = /* @__PURE__ */ new Map(); processingRecallEvents = /* @__PURE__ */ new Map(); constructor(e, n, r) { this.core = e, this.context = n, this.configLoader = new Ile(e, r.configPath, Ele), this.apis = { GroupApi: new xye(this, e), UserApi: new Cye(this, e), FriendApi: new Y1e(this, e), MsgApi: new xbe(this, e), QuickActionApi: new Cbe(this, e), FileApi: new Dbe(this, e) }, this.actions = j3e(this, e), this.networkManager = new F0e(); } async creatOneBotLog(e) { let n = `[network] 配置加载 `; for (const r of e.network.httpServers) n += `HTTP服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.httpSseServers) n += `HTTP-SSE服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.httpClients) n += `HTTP上报服务: ${r.url}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.websocketServers) n += `WebSocket服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.websocketClients) n += `WebSocket反向服务: ${r.url}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.mcpServers ?? []) n += `MCP服务: ${r.host}:${r.port}/mcp, : ${r.enable ? "已启动" : "未启动"} `; return n; } async InitOneBot() { const e = this.core.selfInfo, n = this.configLoader.configData; this.core.apis.UserApi.getUserDetailInfo(e.uid, !1).then(async (i) => { if (e.nick = i.nick, this.context.logger.setLogSelfInfo(e), I2) { this.context.logger.log("[SnowCat] [OneBot] 🔐 检测到待发送的WebUI Token,开始发送"); try { await this.core.apis.MsgApi.sendMsg( { chatType: ke.KCHATTYPEC2C, peerUid: e.uid, guildId: "" }, [{ elementType: Ee.TEXT, elementId: "", textElement: { content: `[SnowCat] 温馨提示: WebUI密码为默认密码,已进行强制修改 新密码: ` + I2, atType: Hr.ATTYPEUNKNOWN, atUid: "", atTinyId: "", atNtUid: "" } }], 5e3 ), this.context.logger.log("[SnowCat] [OneBot] ✅ WebUI Token 消息发送成功"); } catch (o) { this.context.logger.logError("[SnowCat] [OneBot] ❌ WebUI Token 消息发送失败:", o); } } de.getQQLoginCallback()(!0); }).catch((i) => this.context.logger.logError(i)); const r = await this.creatOneBotLog(n); this.context.logger.log(`[Notice] [OneBot11] ${r}`), ir(this.context.pathWrapper.pluginPath) && (this.context.logger.log("[Plugins] 插件目录存在,开始加载插件"), this.networkManager.registerAdapter( new WU("plugin_manager", this.core, this, this.actions) )); for (const i of n.network.httpServers) i.enable && this.networkManager.registerAdapter( new _2(i.name, i, this.core, this, this.actions) ); for (const i of n.network.httpSseServers) i.enable && this.networkManager.registerAdapter( new mD(i.name, i, this.core, this, this.actions) ); for (const i of n.network.httpClients) i.enable && this.networkManager.registerAdapter( new pP(i.name, i, this.core, this, this.actions) ); for (const i of n.network.websocketServers) i.enable && this.networkManager.registerAdapter( new bP( i.name, i, this.core, this, this.actions ) ); for (const i of n.network.websocketClients) i.enable && this.networkManager.registerAdapter( new fP( i.name, i, this.core, this, this.actions ) ); await this.networkManager.openAllAdapters(), this.initMsgListener(), this.initBuddyListener(), this.initGroupListener(), de.setQQVersion(this.core.context.basicInfoWrapper.getFullQQVersion()), de.setQQLoginInfo(e), de.setQQLoginStatus(!0), de.setOnOB11ConfigChanged(async (i) => { const o = this.configLoader.configData; this.configLoader.save(i), await this.reloadNetwork(o, i); }), this.apis.GroupApi.registerParseGroupReactEventByCore().catch( (i) => this.context.logger.logError("注册群消息反应表情失败", i) ); } async reloadNetwork(e, n) { const r = await this.creatOneBotLog(e), i = await this.creatOneBotLog(n); this.context.logger.log(`[Notice] [OneBot11] 配置变更前: ${r}`), this.context.logger.log(`[Notice] [OneBot11] 配置变更后: ${i}`), await this.handleConfigChange(e.network.httpServers, n.network.httpServers, _2), await this.handleConfigChange(e.network.httpClients, n.network.httpClients, pP), await this.handleConfigChange(e.network.httpSseServers, n.network.httpSseServers, mD), await this.handleConfigChange(e.network.websocketServers, n.network.websocketServers, bP), await this.handleConfigChange(e.network.websocketClients, n.network.websocketClients, fP), await this.handleConfigChange(e.network.mcpServers ?? [], n.network.mcpServers ?? [], W3e); } async handleConfigChange(e, n, r) { for (const i of e) if (!n.find((a) => a.name === i.name)) { const a = this.networkManager.findSomeAdapter(i.name); a && await this.networkManager.closeSomeAdaterWhenOpen([a]); } for (const i of n) { const o = this.networkManager.findSomeAdapter(i.name); if (o) await o.reload(i) === Gt.NetWorkClose && await this.networkManager.closeSomeAdaterWhenOpen([o]); else if (i.enable) { const a = new r(i.name, i, this.core, this, this.actions); await this.networkManager.registerAdapterAndOpen(a); } } } initMsgListener() { const e = new rB(); e.onRecvSysMsg = (n) => { this.apis.MsgApi.parseSysMessage(n).then((r) => { r && this.networkManager.emitEvent(r); }).catch( (r) => this.context.logger.logError( "constructSysMessage error: ", r, ` Parse Hex:`, Buffer.from(n).toString("hex") ) ); }, e.onInputStatusPush = async (n) => { const r = await this.core.apis.UserApi.getUinByUidV2(n.fromUin); this.context.logger.log(`[Notice] [输入状态] ${r} ${n.statusText}`), await this.networkManager.emitEvent( new $3e(this.core, parseInt(r), n.eventType, n.statusText) ); }, e.onRecvMsg = async (n) => { if (this.networkManager.hasActiveAdapters()) for (const r of n) { if (this.bootTime > parseInt(r.msgTime)) { this.context.logger.logDebug(`消息时间${r.msgTime}早于启动时间${this.bootTime},忽略上报`); continue; } r.id = ot.createUniqueMsgId( { chatType: r.chatType, peerUid: r.peerUid, guildId: "" }, r.msgId ), await this.emitMsg(r).catch( (i) => this.context.logger.logError("处理消息失败", i) ); } }, e.onRecvOnlineFileMsg = async (n) => { if (this.networkManager.hasActiveAdapters()) for (const r of n) { if (this.bootTime > parseInt(r.msgTime)) { this.context.logger.logDebug(`在线文件消息时间${r.msgTime}早于启动时间${this.bootTime},忽略上报`); continue; } r.id = ot.createUniqueMsgId( { chatType: r.chatType, peerUid: r.peerUid, guildId: "" }, r.msgId ), await this.emitMsg(r).catch( (i) => this.context.logger.logError("处理在线文件消息失败", i) ); } }, e.onAddSendMsg = async (n) => { try { if (n.sendStatus === tp.KSEND_STATUS_SENDING) { const [r] = await this.core.eventWrapper.registerListen("NodeIKernelMsgListener/onMsgInfoListUpdate", (o) => !!o.find( (s) => s.senderUin === this.core.selfInfo.uin && s.sendStatus !== tp.KSEND_STATUS_SENDING && s.msgId === n.msgId ), 1, 6e5), i = r.find((o) => o.msgId === n.msgId); i?.sendStatus === tp.KSEND_STATUS_SUCCESS && (i.id = ot.createUniqueMsgId( { chatType: i.chatType, peerUid: i.peerUid, guildId: "" }, i.msgId ), this.emitMsg(i)); } } catch (r) { this.context.logger.logError("处理发送消息失败", r); } }, e.onMsgInfoListUpdate = async (n) => { for (const r of n) { const i = this.getRecallElement(r); i && this.isCurrentRecallUpdate(r) && await this.handleRecallMessage(r, i); } }, e.onMsgRecall = async (n, r, i) => { const o = { chatType: n, peerUid: r, guildId: "" }; try { const a = (await this.core.apis.MsgApi.queryMsgsWithFilterExWithSeq(o, i)).msgList.find((c) => this.getRecallElement(c)), s = a && this.getRecallElement(a); a && s ? await this.handleRecallMessage(a, s) : this.context.logger.logDebug(`撤回回调暂未查询到灰条消息,等待消息更新: ${n}/${r}/${i}`); } catch (a) { this.context.logger.logError("查询撤回消息失败", a); } }, e.onKickedOffLine = async (n) => { de.setQQLoginStatus(!1); const r = new H3e(this.core, n.tipsTitle, n.tipsDesc); this.networkManager.emitEvent(r).catch((i) => this.context.logger.logError("处理Bot掉线失败", i)); }, this.context.session.getMsgService().addKernelMsgListener(Nu(e, this.context.logger)); } initBuddyListener() { const e = new Nue(); e.onBuddyReqChange = async (n) => { this.core.apis.FriendApi.clearBuddyReqUnreadCnt(); for (let r = 0; r < n.unreadNums; r++) { const i = n.buddyReqs[r]; if (i && !(i.isInitiator || i.isDecide && i.reqType !== bO.KMEINITIATORWAITPEERCONFIRM || !i.isUnread)) try { const o = await this.core.apis.UserApi.getUinByUidV2(i.friendUid); await this.networkManager.emitEvent( new G3e( this.core, +o, i.extWords, i.reqTime ) ); } catch (o) { this.context.logger.logDebug("获取加好友者QQ号失败", o); } } }, this.context.session.getBuddyService().addKernelBuddyListener(Nu(e, this.context.logger)); } initGroupListener() { const e = new kue(); e.onGroupNotifiesUpdated = async (n, r) => { if (await this.core.apis.GroupApi.clearGroupNotifiesUnreadCount(!1), !!r[0]?.type && ![ tc.SET_ADMIN, tc.CANCEL_ADMIN_NOTIFY_CANCELED, tc.CANCEL_ADMIN_NOTIFY_ADMIN ].includes(r[0]?.type)) for (const i of r) { if (parseInt(i.seq) / 1e3 / 1e3 < this.bootTime) continue; const a = i.seq; if (this.context.logger.logDebug("收到群通知", i), [tc.REQUEST_JOIN_NEED_ADMINI_STRATOR_PASS].includes(i.type) && i.status === dc.KUNHANDLE) { this.context.logger.logDebug("有加群请求"); try { const s = await this.core.apis.UserApi.getUinByUidV2(i.user1.uid), c = new $m( this.core, parseInt(i.group.groupCode), parseInt(s), "add", i.postscript, a ); this.networkManager.emitEvent(c).catch( (u) => this.context.logger.logError("处理加群请求失败", u) ); } catch (s) { this.context.logger.logError( "获取加群人QQ号失败 Uid:", i.user1.uid, s ); } } else if (i.type === tc.INVITED_BY_MEMBER && i.status === dc.KUNHANDLE) { this.context.logger.logDebug(`收到邀请我加群通知:${i}`); const s = new $m( this.core, +i.group.groupCode, +await this.core.apis.UserApi.getUinByUidV2(i.user2.uid), "invite", i.postscript, a ); this.networkManager.emitEvent(s).catch( (c) => this.context.logger.logError("处理邀请本人加群失败", c) ); } else if (i.type === tc.INVITED_NEED_ADMINI_STRATOR_PASS && i.status === dc.KUNHANDLE) { this.context.logger.logDebug(`收到群员邀请加群通知:${i}`); const s = new $m( this.core, +i.group.groupCode, +await this.core.apis.UserApi.getUinByUidV2(i.user1.uid), "add", i.postscript, a ); this.networkManager.emitEvent(s).catch( (c) => this.context.logger.logError("处理邀请本人加群失败", c) ); } } }, this.context.session.getGroupService().addKernelGroupListener(Nu(e, this.context.logger)); } async emitMsg(e) { this.context.logger.logDebug("收到新消息 RawMessage", e), await Promise.allSettled([ this.handleMsg(e), e.chatType === ke.KCHATTYPEGROUP ? this.handleGroupEvent(e) : this.handlePrivateMsgEvent(e) ]); } async handleMsg(e) { if (e.msgType !== us.KMSGTYPENULL) try { const n = await this.apis.MsgApi.parseMessageV2(e, this.configLoader.configData.parseMultMsg); if (n) { const r = this.isSelfMessage(n); if (this.context.logger.logDebug("转化为 OB11Message", n), r || e.chatType !== ke.KCHATTYPEGROUP) { const o = parseInt(e.peerUin); n.stringMsg.target_id = o, n.arrayMsg.target_id = o; } const i = /* @__PURE__ */ new Map(); for (const o of this.networkManager.adapters.values()) { if (!o.isActive) continue; const a = o.config; if (r && (!("reportSelfMessage" in a) || !a.reportSelfMessage)) continue; const s = a.messagePostFormat === "string" ? n.stringMsg : n.arrayMsg; if (a.debug) { const c = structuredClone(s); c.raw = e, i.set(o.name, c); } else i.set(o.name, s); } i.size > 0 ? this.networkManager.emitEventByNames(i) : this.networkManager.hasActiveAdapters() && this.context.logger.logDebug("没有可用的网络适配器发送消息,消息内容:", e); } } catch (n) { this.context.logger.logError("constructMessage error: ", n); } } isSelfMessage(e) { return e.stringMsg.user_id.toString() === this.core.selfInfo.uin || e.arrayMsg.user_id.toString() === this.core.selfInfo.uin; } async handleGroupEvent(e) { try { if (e.senderUin && e.senderUin !== "0") { const n = await this.apis.GroupApi.parseCardChangedEvent(e); n && await this.networkManager.emitEvent(n); } if (e.msgType === us.KMSGTYPEFILE) { const n = e.elements.find((r) => !!r.fileElement); if (n?.fileElement) { const r = await this.apis.GroupApi.parseGroupUploadFileEvene(e, n.fileElement, n); r && await this.networkManager.emitEvent(r); } } else if (e.msgType === us.KMSGTYPEGRAYTIPS) { const n = e.elements[0]?.grayTipElement; if (n) { const r = await this.apis.GroupApi.parseGrayTipElement(e, n); r && await this.networkManager.emitEvent(r); } } } catch (n) { this.context.logger.logError("constructGroupEvent error: ", n); } } async handlePrivateMsgEvent(e) { try { if (e.msgType === us.KMSGTYPEGRAYTIPS) { const n = e.elements[0]?.grayTipElement; if (n) { const r = await this.apis.MsgApi.parsePrivateMsgEvent(e, n); r && await this.networkManager.emitEvent(r); } } } catch (n) { this.context.logger.logError("constructPrivateEvent error: ", n); } } getRecallElement(e) { if (e.msgType === us.KMSGTYPEGRAYTIPS) return e.elements.find((n) => !!n.grayTipElement?.revokeElement); } isCurrentRecallUpdate(e) { const n = Number(e.recallTime); return !Number.isFinite(n) || n <= 0 ? !1 : (n > 1e10 ? n / 1e3 : n) >= this.bootTime - V3e; } getRecallEventKey(e) { return `${e.chatType}/${e.peerUid}/${e.msgId}`; } hasReportedRecallEvent(e) { return this.reportedRecallEventCache.has(e); } markRecallEventReported(e) { for (this.reportedRecallEventCache.delete(e), this.reportedRecallEventCache.set(e, !0); this.reportedRecallEventCache.size > K3e; ) { const n = this.reportedRecallEventCache.keys().next().value; if (n === void 0) break; this.reportedRecallEventCache.delete(n); } } async handleRecallMessage(e, n) { const r = n.grayTipElement?.revokeElement; if (!r) return; if (r.isSelfOperate) { const o = this.recallEventCache.get(e.msgId); o && (clearTimeout(o), this.recallEventCache.delete(e.msgId), this.context.logger.logDebug("自操作消息撤回事件")); } const i = this.getRecallEventKey(e); for (; !this.hasReportedRecallEvent(i); ) { const o = this.processingRecallEvents.get(i); if (o) { await o; continue; } const a = (async () => { try { const s = await this.emitRecallMsg(e, n); s && (await this.networkManager.emitEvent(s), this.markRecallEventReported(i)); } catch (s) { this.context.logger.logError("处理消息撤回失败", s); } })(); this.processingRecallEvents.set(i, a); try { await a; } finally { this.processingRecallEvents.get(i) === a && this.processingRecallEvents.delete(i); } return; } } async emitRecallMsg(e, n) { const r = { chatType: e.chatType, peerUid: e.peerUid, guildId: "" }, i = ot.getShortIdByMsgId(e.msgId) ?? ot.createUniqueMsgId(r, e.msgId); if (e.chatType === ke.KCHATTYPEC2C) return await this.emitFriendRecallMsg(e, i, n); if (e.chatType === ke.KCHATTYPEGROUP) return await this.emitGroupRecallMsg(e, i, n); } async emitFriendRecallMsg(e, n, r) { if (r.grayTipElement?.revokeElement.operatorUid) return new q3e( this.core, +e.senderUin, n ); } async emitGroupRecallMsg(e, n, r) { const i = r.grayTipElement?.revokeElement.operatorUid; if (!i) return; const o = await this.core.apis.UserApi.getUinByUidV2(i); return new z3e( this.core, +e.peerUin, +e.senderUin, +o, n ); } } const J3e = l.Object({ name: l.String({ default: "snowcat-ws-server" }), enable: l.Boolean({ default: !1 }), host: l.String({ default: "127.0.0.1" }), port: l.Number({ default: 6700 }), token: l.String({ default: "" }), heartInterval: l.Number({ default: 3e4 }), debug: l.Boolean({ default: !1 }) }), X3e = l.Object({ name: l.String({ default: "snowcat-ws-client" }), enable: l.Boolean({ default: !1 }), url: l.String({ default: "ws://localhost:6701" }), token: l.String({ default: "" }), reconnectInterval: l.Number({ default: 5e3 }), heartInterval: l.Number({ default: 3e4 }), debug: l.Boolean({ default: !1 }) }), Z3e = l.Object({ name: l.String({ default: "snowcat-http-server" }), enable: l.Boolean({ default: !1 }), host: l.String({ default: "127.0.0.1" }), port: l.Number({ default: 6702 }), token: l.String({ default: "" }), enableCors: l.Boolean({ default: !0 }), debug: l.Boolean({ default: !1 }) }), eIe = l.Object({ httpServers: l.Array(Z3e, { default: [] }), websocketServers: l.Array(J3e, { default: [] }), websocketClients: l.Array(X3e, { default: [] }) }, { default: {} }), tIe = l.Object({ enable: l.Boolean({ default: !1 }), // 默认关闭 network: eIe }); class nIe extends ZE { constructor(e, n) { super("napcat_protocol", e, n, tIe); } } class rIe { adapters = /* @__PURE__ */ new Map(); async openAllAdapters() { return Promise.all(Array.from(this.adapters.values()).map((e) => e.open())); } async emitEvent(e) { return Promise.all(Array.from(this.adapters.values()).map(async (n) => { if (n.isActive) return await n.onEvent(e); })); } async emitEvents(e) { return Promise.all(e.map((n) => this.emitEvent(n))); } async emitEventByName(e, n) { return Promise.all(e.map(async (r) => { const i = this.adapters.get(r); if (i && i.isActive) return await i.onEvent(n); })); } async emitEventByNames(e) { return Promise.all(Array.from(e.entries()).map(async ([n, r]) => { const i = this.adapters.get(n); if (i && i.isActive) return await i.onEvent(r); })); } registerAdapter(e) { this.adapters.set(e.name, e); } async registerAdapterAndOpen(e) { this.registerAdapter(e), await e.open(); } async closeSomeAdapters(e) { for (const n of e) this.adapters.delete(n.name), await n.close(); } async closeSomeAdapterWhenOpen(e) { for (const n of e) this.adapters.delete(n.name), n.isEnable && await n.close(); } findSomeAdapter(e) { return this.adapters.get(e); } async closeAdapterByPredicate(e) { const n = Array.from(this.adapters.values()).filter(e); await this.closeSomeAdapters(n); } async closeAllAdapters() { await Promise.all(Array.from(this.adapters.values()).map((e) => e.close())), this.adapters.clear(); } async reloadAdapter(e, n) { const r = this.adapters.get(e); r && await r.reload(n); } async reloadSomeAdapters(e) { await Promise.all(Array.from(e.entries()).map(([n, r]) => this.reloadAdapter(n, r))); } hasActiveAdapters() { return Array.from(this.adapters.values()).some((e) => e.isActive); } async getAllConfig() { return Array.from(this.adapters.values()).map((e) => e.config); } } class ny { adapter; core; constructor(e, n) { this.adapter = e, this.core = n; } } class iIe extends ny { // 消息相关 API 方法可以在这里实现 } class oIe extends ny { // 用户相关 API 方法可以在这里实现 } class aIe extends ny { // 群组相关 API 方法可以在这里实现 } class sIe extends ny { // 好友相关 API 方法可以在这里实现 } function cIe(t, e) { return /* @__PURE__ */ new Map(); } class uIe { core; context; configLoader; apis; networkManager; actions; constructor(e, n, r) { this.core = e, this.context = n, this.configLoader = new nIe(e, r.configPath), this.apis = { MsgApi: new iIe(this, e), UserApi: new oIe(this, e), GroupApi: new aIe(this, e), FriendApi: new sIe(this, e) }, this.actions = cIe(), this.networkManager = new rIe(); } // 检查协议是否启用 isEnabled() { return this.configLoader.configData.enable; } async createProtocolLog(e) { let n = `[SnowCat Protocol] 配置加载 `; if (n += `协议状态: ${e.enable ? "已启用" : "已禁用"} `, e.enable) { for (const r of e.network.httpServers) n += `HTTP服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.websocketServers) n += `WebSocket服务: ${r.host}:${r.port}, : ${r.enable ? "已启动" : "未启动"} `; for (const r of e.network.websocketClients) n += `WebSocket客户端: ${r.url}, : ${r.enable ? "已启动" : "未启动"} `; } return n; } async initProtocol() { const e = this.configLoader.configData; if (!e.enable) { this.context.logger.log("[SnowCat Protocol] 协议未启用,跳过初始化"); return; } const n = this.core.selfInfo, r = await this.createProtocolLog(e); this.context.logger.log(`[Notice] ${r}`), await this.networkManager.openAllAdapters(), this.context.logger.log(`[SnowCat Protocol] 初始化完成,Bot: ${n.uin}`); } async close() { await this.networkManager.closeAllAdapters(), this.context.logger.log("[SnowCat Protocol] 已关闭所有网络适配器"); } } class lIe { name = "onebot11"; adapter; constructor(e) { this.adapter = e; } get enabled() { return !0; } async init() { await this.adapter.InitOneBot(); } async close() { await this.adapter.networkManager.closeAllAdapters(); } getAdapter() { return this.adapter; } } class dIe { name = "snowcat-protocol"; adapter; constructor(e) { this.adapter = e; } get enabled() { return this.adapter.isEnabled(); } async init() { await this.adapter.initProtocol(); } async close() { await this.adapter.close(); } getAdapter() { return this.adapter; } } class pIe { core; context; pathWrapper; // 协议适配器实例 onebotAdapter = null; snowcatProtocolAdapter = null; // 所有已注册的适配器 adapters = /* @__PURE__ */ new Map(); constructor(e, n, r) { this.core = e, this.context = n, this.pathWrapper = r; } // 初始化所有协议适配器 async initAdapters() { this.context.logger.log("[AdapterManager] 开始初始化协议适配器..."); try { const e = new Y3e(this.core, this.context, this.pathWrapper); this.onebotAdapter = new lIe(e), this.adapters.set("onebot11", this.onebotAdapter), await this.onebotAdapter.init(), this.context.logger.log("[AdapterManager] OneBot11 适配器初始化完成"); } catch (e) { this.context.logger.logError("[AdapterManager] OneBot11 适配器初始化失败:", e); } try { const e = new uIe(this.core, this.context, this.pathWrapper); this.snowcatProtocolAdapter = new dIe(e), this.adapters.set("snowcat-protocol", this.snowcatProtocolAdapter), this.snowcatProtocolAdapter.enabled ? (await this.snowcatProtocolAdapter.init(), this.context.logger.log("[AdapterManager] SnowCat Protocol 适配器初始化完成")) : this.context.logger.log("[AdapterManager] SnowCat Protocol 适配器未启用,跳过初始化"); } catch (e) { this.context.logger.logError("[AdapterManager] SnowCat Protocol 适配器初始化失败:", e); } this.context.logger.log(`[AdapterManager] 协议适配器初始化完成,已加载 ${this.adapters.size} 个适配器`); } // 获取 OneBot11 适配器 getOneBotAdapter() { return this.onebotAdapter?.getAdapter() ?? null; } // 获取 NapCat Protocol 适配器 getNapCatProtocolAdapter() { return this.snowcatProtocolAdapter?.getAdapter() ?? null; } // 获取指定适配器 getAdapter(e) { return this.adapters.get(e); } // 获取所有已启用的适配器 getEnabledAdapters() { return Array.from(this.adapters.values()).filter((e) => e.enabled); } // 获取所有适配器 getAllAdapters() { return Array.from(this.adapters.values()); } // 关闭所有适配器 async closeAllAdapters() { this.context.logger.log("[AdapterManager] 开始关闭所有协议适配器..."); for (const [e, n] of this.adapters) try { await n.close(), this.context.logger.log(`[AdapterManager] ${e} 适配器已关闭`); } catch (r) { this.context.logger.logError(`[AdapterManager] 关闭 ${e} 适配器失败:`, r); } this.adapters.clear(), this.context.logger.log("[AdapterManager] 所有协议适配器已关闭"); } // 重新加载指定适配器 async reloadAdapter(e) { const n = this.adapters.get(e); n && (await n.close(), await n.init(), this.context.logger.log(`[AdapterManager] ${e} 适配器已重新加载`)); } } class fIe { getOnAmgomDataPiece(...e) { } } const hIe = { "3.2.12-28418-x64": { recv: "A0723E0", send: "A06EAE0" }, "9.9.15-28418-x64": { recv: "37A9004", send: "37A4BD0" }, "6.9.56-28418-x64": { send: "4471360", recv: "4473BCC" }, "6.9.56-28418-arm64": { send: "3FBDBF8", recv: "3FC0410" }, "9.9.15-28498-x64": { recv: "37A9004", send: "37A4BD0" }, "9.9.16-28788-x64": { send: "38076D0", recv: "380BB04" }, "3.2.13-28788-x64": { send: "A0CEC20", recv: "A0D2520" }, "3.2.13-28788-arm64": { send: "6E91018", recv: "6E94850" }, "9.9.16-28971-x64": { send: "38079F0", recv: "380BE24" }, "3.2.13-28971-x64": { send: "A0CEF60", recv: "A0D2860" }, "3.2.12-28971-arm64": { send: "6E91318", recv: "6E94B50" }, "6.9.58-28971-x64": { send: "449ACA0", recv: "449D50C" }, "6.9.58-28971-arm64": { send: "3FE0DB0", recv: "3FE35C8" }, "9.9.16-29271-x64": { send: "3833510", recv: "3837944" }, "3.2.13-29271-x64": { send: "A11E680", recv: "A121F80" }, "3.2.13-29271-arm64": { send: "6ECA098", recv: "6ECD8D0" }, "9.9.16-29456-x64": { send: "3835CD0", recv: "383A104" }, "3.2.13-29456-x64": { send: "A11E820", recv: "A122120" }, "3.2.13-29456-arm64": { send: "6ECA130", recv: "6ECD968" }, "6.9.59-29456-x64": { send: "44C57A0", recv: "44C800C" }, "6.9.59-29456-arm64": { send: "4005FE8", recv: "4008800" }, "9.9.16-29927-x64": { send: "3869C50", recv: "386E084" }, "3.2.13-29927-x64": { send: "A1913A0", recv: "A194CA0" }, "3.2.13-29927-arm64": { send: "6F1C7E0", recv: "6F20018" }, "6.9.61-29927-x64": { send: "44FCC60", recv: "44FF4CC" }, "6.9.61-29927-arm64": { send: "4038740", recv: "403AF58" }, "9.9.17-30366-x64": { send: "39AB0B0", recv: "39AF4E4" }, "3.2.15-30366-x64": { send: "A402380", recv: "A405C80" }, "3.2.15-30366-arm64": { send: "70C3FA8", recv: "70C77E0" }, "6.9.62-30366-x64": { send: "4669760", recv: "466BFCC" }, "6.9.62-30366-arm64": { send: "4189770", recv: "418BF88" }, "9.9.17-30483-x64": { send: "39AC1B0", recv: "39B05E4" }, "6.9.62-30483-arm64": { send: "41896B0", recv: "418bec8" }, "6.9.62-30483-x64": { send: "4669460", recv: "466BCCC" }, "3.2.15-30483-x64": { send: "A402540", recv: "A405E40" }, "3.2.15-30483-arm64": { send: "70C40E8", recv: "70C7920" }, "9.9.17-30594-x64": { send: "39AC1B0", recv: "39B05E4" }, "6.9.62-30594-arm64": { send: "41896B0", recv: "418bec8" }, "6.9.62-30594-x64": { send: "4669460", recv: "466BCCC" }, "3.2.15-30594-x64": { send: "A402540", recv: "A405E40" }, "3.2.15-30594-arm64": { send: "70C40E8", recv: "70C7920" }, "9.9.17-30851-x64": { send: "395C150", recv: "3960584" }, "3.2.15-30851-x64": { send: "A4A03E0", recv: "A4A3CE0" }, "3.2.15-30851-arm64": { send: "713A318", recv: "713DB50" }, "6.9.63-30851-x64": { send: "46C8040", recv: "46CA8AC" }, "6.9.63-30851-arm64": { send: "41DCBD8", recv: "41DF3F0" }, "9.9.17-30899-x64": { send: "395C150", recv: "3960584" }, "3.2.15-30899-x64": { send: "A4A03E0", recv: "A4A3CE0" }, "3.2.15-30899-arm64": { send: "713A318", recv: "713DB50" }, "6.9.63-30899-x64": { send: "46C8040", recv: "46CA8AC" }, "6.9.63-30899-arm64": { send: "41DCBD8", recv: "41DF3F0" }, "9.9.17-31219-x64": { send: "39C1350", recv: "39C5784" }, "9.9.17-31245-x64": { send: "39C1350", recv: "39C5784" }, "6.9.63-31245-x64": { send: "4720A40", recv: "47232AC" }, "6.9.63-31245-arm64": { send: "41DCBD8", recv: "422D4E8" }, "3.2.15-31245-x64": { send: "A550F80", recv: "A554880" }, "3.2.15-31245-arm64": { send: "71BEBB8", recv: "71C23F0" }, "9.9.17-31363-x64": { send: "39C1910", recv: "39C5d44" }, "3.2.15-31363-x64": { send: "A554500", recv: "A557E00" }, "3.2.15-31363-arm64": { send: "71BFD48", recv: "71C3580" }, "6.9.65-31363-x64": { send: "4720E80", recv: "47236EC" }, "6.9.65-31363-arm64": { send: "422CEF8", recv: "422F710" }, "9.9.18-32690-x64": { send: "39F9630", recv: "39FDE30" }, "3.2.16-32690-x64": { send: "A5E24C0", recv: "A5E5EE0" }, "3.2.16-32690-arm64": { send: "7226630", recv: "7229F60" }, "3.2.16-32721-x64": { send: "A5E24C0", recv: "A5E5EE0" }, "3.2.16-32721-arm64": { send: "7226630", recv: "7229F60" }, "9.9.18-32793-x64": { send: "39F9A30", recv: "39FE230" }, "3.2.16-32793-x64": { send: "A5E24C0", recv: "A5E5EE0" }, "3.2.16-32793-arm64": { send: "7226630", recv: "7229F60" }, "9.9.18-32869-x64": { send: "39F9A30", recv: "39FE230" }, "3.2.16-32869-x64": { send: "A5E24C0", recv: "A5E5EE0" }, "3.2.16-32869-arm64": { send: "7226630", recv: "7229F60" }, "9.9.18-33139-x64": { send: "39F5870", recv: "39FA070" }, "3.2.16-33139-x64": { send: "A634F60", recv: "A638980" }, "3.2.16-33139-arm64": { send: "7262BB0", recv: "72664E0" }, "9.9.18-33800-x64": { send: "39F5870", recv: "39FA070" }, "3.2.16-33800-x64": { send: "A634F60", recv: "A638980" }, "3.2.16-33800-arm64": { send: "7262BB0", recv: "72664E0" }, "9.9.19-34231-x64": { send: "3BD73D0", recv: "3BDBBD0" }, "3.2.17-34231-x64": { send: "AD787E0", recv: "AD7C200" }, "3.2.17-34231-arm64": { send: "770CDC0", recv: "77106F0" }, "9.9.19-34362-x64": { send: "3BD80D0", recv: "3BDC8D0" }, "9.9.19-34467-x64": { send: "3BD8690", recv: "3BDCE90" }, "9.9.19-34566-x64": { send: "3BDA110", recv: "3BDE910" }, "9.9.19-34606-x64": { send: "3BDA110", recv: "3BDE910" }, "3.2.17-34606-x64": { send: "AD7DC60", recv: "AD81680" }, "3.2.17-34606-arm64": { send: "7711270", recv: "7714BA0" }, "9.9.19-34740-x64": { send: "3BDD8D0", recv: "3BE20D0" }, "3.2.17-34740-x64": { send: "ADDF0A0", recv: "ADE2AC0" }, "3.2.17-34740-arm64": { send: "7753BB8", recv: "77574E8" }, "9.9.19-34958-x64": { send: "3BDD8D0", recv: "3BE20D0" }, "3.2.17-35184-x64": { send: "AE0DDE0", recv: "AE11800" }, "3.2.17-35184-arm64": { send: "7776028", recv: "7779958" }, "9.9.19-35184-x64": { send: "3BE5A10", recv: "3BEA210" }, "9.9.19-35341-x64": { send: "3BF1D50", recv: "3BF6550" }, "9.9.19-35469-x64": { send: "3BF1D50", recv: "3BF6550" }, "3.2.17-35341-x64": { send: "AE2F700", recv: "AE33120" }, "3.2.17-35341-arm64": { send: "778D840", recv: "7791170" }, "9.9.20-35951-x64": { send: "3034BAC", recv: "3038354" }, "3.2.18-35951-x64": { send: "AFBBB00", recv: "AFBF520" }, "9.9.20-36580-x64": { send: "30824B8", recv: "3085C5C" }, "3.2.18-36580-x64": { send: "B0853E0", recv: "B088E60" }, "3.2.18-36580-arm64": { send: "793DAC8", recv: "7941458" }, "3.2.18-37012-x64": { send: "B20F960", recv: "B2133E0" }, "3.2.18-37012-arm64": { send: "7A19E00", recv: "7A1D790" }, "9.9.20-37012-x64": { send: "30CC958", recv: "30D00FC" }, "3.2.18-37051-x64": { send: "B20F960", recv: "B2133E0" }, "3.2.18-37051-arm64": { send: "7A19E00", recv: "7A1D790" }, "9.9.20-37051-x64": { send: "30CC958", recv: "30D00FC" }, "9.9.20-37475-x64": { send: "30D30D8", recv: "30D687C" }, "3.2.18-37475-x64": { send: "B238EC0", recv: "B23C940" }, "3.2.18-37475-arm64": { send: "7A34B38", recv: "7A384C8" }, "9.9.20-37625-x64": { send: "30D39D8", recv: "30D717C" }, "3.2.18-37625-x64": { send: "B2397E0", recv: "B23D260" }, "3.2.18-37625-arm64": { send: "7A350D8", recv: "7A38A68" }, "9.9.21-38503-x64": { send: "3105F38", recv: "31096DC" }, "3.2.19-38503-x64": { send: "B2C1A60", recv: "B2C54E0" }, "3.2.19-38626-x64": { send: "B2C1BE0", recv: "B2C5660" }, "9.9.21-38626-x64": { send: "310A758", recv: "310DEFC" }, "3.2.19-38626-arm64": { send: "7A8A490", recv: "7A8DE20" }, "9.9.21-38711-x64": { send: "310A758", recv: "310DEFC" }, "3.2.19-38960-x64": { send: "B3740E0", recv: "B377B60" }, "9.9.21-38960-x64": { send: "313F7D8", recv: "3142F7C" }, "3.2.19-38960-arm64": { send: "7B01D98", recv: "7B05728" }, "3.2.19-39038-x64": { send: "B3759E0", recv: "B379460" }, "3.2.19-39038-arm64": { send: "7B025C8", recv: "7B05F58" }, "9.9.21-39038-x64": { send: "313FB58", recv: "31432FC" }, "9.9.22-40362-x64": { send: "31C0EB8", recv: "31C465C" }, "3.2.20-40768-x64": { send: "B69CFE0", recv: "B6A0A60" }, "9.9.22-40768-x64": { send: "31C1838", recv: "31C4FDC" }, "3.2.20-40768-arm64": { send: "7D49B18", recv: "7D4D4A8" }, "6.9.82-40768-arm64": { send: "202A198", recv: "202B718" }, "9.9.22-40824-x64": { send: "31C1838", recv: "31C4FDC" }, "3.2.20-40824-arm64": { send: "7D49B18", recv: "7D4D4A8" }, "6.9.82-40824-arm64": { send: "202A198", recv: "202B718" }, "3.2.20-40990-x64": { send: "B69CFE0", recv: "B6A0A60" }, "3.2.20-40990-arm64": { send: "7D49B18", recv: "7D4D4A8" }, "9.9.22-40990-x64": { send: "31C1838", recv: "31C4FDC" }, "6.9.82-40990-arm64": { send: "202A198", recv: "202B718" }, "9.9.23-41679-x64": { send: "2C94520", recv: "2C97AA0" }, "6.9.83-41679-arm64": { send: "3D718F8", recv: "3D74208" }, "9.9.23-41785-x64": { send: "2C944A0", recv: "2C97A20" }, "6.9.83-41785-arm64": { send: "3D6DA28", recv: "3D70338" }, "6.9.83-41857-arm64": { send: "3D74610", recv: "3D76F20" }, "3.2.21-41857-x64": { send: "A7B40A0", recv: "A7B7B20" }, "9.9.23-41857-x64": { send: "2C98F00", recv: "2C9C480" }, "3.2.21-41857-arm64": { send: "6B159F8", recv: "6B19388" }, "9.9.23-42086-x64": { send: "2C99800", recv: "2C9CD80" }, "3.2.21-42086-x64": { send: "A7B1060", recv: "A7B4AE0" }, "3.2.21-42086-arm64": { send: "6B13038", recv: "6B169C8" }, "9.9.23-42430-x64": { send: "2C9A4A0", recv: "2C9DA20" }, "9.9.25-42744-x64": { send: "2CD8E40", recv: "2CDC3C0" }, "6.9.86-42744-arm64": { send: "3DCC840", recv: "3DCF150" }, "9.9.25-42905-x64": { send: "2CE46A0", recv: "2CE7C20" }, "6.9.86-42905-arm64": { send: "3DD6098", recv: "3DD89A8" }, "3.2.22-42941-x64": { send: "A8AD8A0", recv: "A8B1320" }, "9.9.25-42941-x64": { send: "2CE4DA0", recv: "2CE8320" }, "3.2.22-42941-arm64": { send: "6BC95E8", recv: "6BCCF78" }, "6.9.86-42941-arm64": { send: "3DDDAD0", recv: "3DE03E0" }, "9.9.26-44175-x64": { send: "2CD84A0", recv: "2CDBA20" }, "3.2.23-44343-x64": { send: "A46F140", recv: "A472BE0" }, "9.9.26-44343-x64": { send: "2CD8EE0", recv: "2CDC460" }, "3.2.23-44343-arm64": { send: "6926F60", recv: "692A910" }, "9.9.26-44498-x64": { send: "2CDAE40", recv: "2CDE3C0" }, "9.9.26-44725-x64": { send: "2CEBB20", recv: "2CEF0A0" }, "9.9.27-45627-x64": { send: "2E59CC0", recv: "2E5D240" }, "6.9.88-44725-x64": { send: "451FE90", recv: "4522A40" }, "6.9.88-44725-arm64": { send: "3D79168", recv: "3D7BA78" }, "3.2.25-45758-x64": { send: "AAC4E00", recv: "AAC88A0" }, "9.9.27-45758-x64": { send: "2E5C4A0", recv: "2E5FA20" }, "3.2.25-45758-arm64": { send: "6D6F9A0", recv: "6D73350" }, "3.2.26-46494-x64": { send: "AB341C0", recv: "AB37C60" }, "9.9.28-46494-x64": { send: "2E77C20", recv: "2E7B1A0" }, "3.2.26-46494-arm64": { send: "6DBBBB0", recv: "6DBF560" }, "3.2.26-46928-arm64": { send: "6DBBBB0", recv: "6DBF560" }, "3.2.26-46928-x64": { send: "AB341C0", recv: "AB37C60" }, "9.9.28-46928-x64": { send: "2E77C20", recv: "2E7B1A0" }, "3.2.27-47354-x64": { send: "AB6A6C0", recv: "AB6E160" }, "3.2.27-47354-arm64": { send: "6DE1438", recv: "6DE4DE8" }, "9.9.29-47354-x64": { send: "2E84920", recv: "2E87EA0" }, "6.9.93-47354-arm64": { send: "3FD1E98", recv: "3FD47A8" }, "6.9.93-47354-x64": { send: "47CD940", recv: "47D04F0" }, "3.2.28-48517-x64": { send: "AD7C280", recv: "AD7FD20" }, "9.9.30-48517-x64": { send: "2F3B960", recv: "2F3EEE0" }, "3.2.28-48517-arm64": { send: "6F48B70", recv: "6F4C520" }, "9.9.30-48762-x64": { send: "2F3B960", recv: "2F3EEE0" }, "9.9.31-49599-x64": { send: "3082C40", recv: "30861C8" }, "9.9.31-49738-x64": { send: "3086C80", recv: "308A208" }, "3.2.29-49738-x64": { send: "B3B20A0", recv: "B3B5B40" }, "3.2.29-49738-arm64": { send: "7342800", recv: "73461B0" }, "9.9.32-50828-x64": { send: "3155200", recv: "3158788" }, "9.9.32-50828-arm64": { send: "4327764", recv: "15E3184" }, "3.2.30-50828-x64": { send: "B5D0FC0", recv: "B5D4A60" }, "9.9.32-50969-x64": { send: "31994E0", recv: "319CA68" }, "3.2.30-50969-x64": { send: "B7394C0", recv: "B73CF60" }, "3.2.30-50969-arm64": { send: "75BD1D0", recv: "75C0B80" }, "9.9.33-52230-x64": { send: "367FE18", recv: "36835CC" }, "3.2.32-52194-x64": { send: "C7DBF80", recv: "C7DFA20" }, "3.2.32-52194-arm64": { send: "80F36D0", recv: "80F7080" }, "9.9.35-52892-x64": { send: "37C30D8", recv: "37C688C" }, "3.2.33-52892-x64": { send: "CB06D60", recv: "CB0A800" }, "3.2.33-52892-arm64": { send: "832ECA0", recv: "8332650" } }, gD = hIe; class mIe { supportedPlatforms = ["win32.x64", "linux.x64", "linux.arm64", "darwin.x64", "darwin.arm64"]; MoeHooExport = { exports: {} }; logger; loaded = !1; // 统一的监听器存储 - key: 'all' | 'type:0' | 'type:1' | 'cmd:xxx' | 'exact:type:cmd' listeners = /* @__PURE__ */ new Map(); constructor({ logger: e }) { this.logger = e; try { const n = process.platform + "." + process.arch, r = ve.join(fl(Mc(import.meta.url)), "./native/packet/MoeHoo." + n + ".node"); fe.existsSync(r) || (this.logger.logWarn(`NativePacketClient: 缺失运行时文件: ${r}`), this.loaded = !1), process.dlopen(this.MoeHooExport, r, ID.dlopen.RTLD_LAZY), this.loaded = !0, this.logger.log("[PacketHandler] 加载成功"); } catch (n) { this.logger.logError("NativePacketClient 加载出错:", n), this.loaded = !1; } } /** * 添加监听器的通用方法 */ addListener(e, n, r = !1) { this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()); const i = { callback: n, once: r }; return this.listeners.get(e).add(i), () => this.removeListener(e, n); } /** * 移除监听器的通用方法 */ removeListener(e, n) { const r = this.listeners.get(e); if (!r) return !1; for (const i of r) if (i.callback === n) return r.delete(i); return !1; } // ===== 永久监听器 ===== /** 监听所有数据包 */ onAll(e) { return this.addListener("all", e); } /** 监听特定类型的数据包 (0: send, 1: recv) */ onType(e, n) { return this.addListener(`type:${e}`, n); } /** 监听所有发送的数据包 */ onSend(e) { return this.onType(0, e); } /** 监听所有接收的数据包 */ onRecv(e) { return this.onType(1, e); } /** 监听特定cmd的数据包(不限type) */ onCmd(e, n) { return this.addListener(`cmd:${e}`, n); } /** 监听特定type和cmd的数据包(精确匹配) */ onExact(e, n, r) { return this.addListener(`exact:${e}:${n}`, r); } // ===== 一次性监听器 ===== /** 一次性监听所有数据包 */ onceAll(e) { return this.addListener("all", e, !0); } /** 一次性监听特定类型的数据包 */ onceType(e, n) { return this.addListener(`type:${e}`, n, !0); } /** 一次性监听所有发送的数据包 */ onceSend(e) { return this.onceType(0, e); } /** 一次性监听所有接收的数据包 */ onceRecv(e) { return this.onceType(1, e); } /** 一次性监听特定cmd的数据包 */ onceCmd(e, n) { return this.addListener(`cmd:${e}`, n, !0); } /** 一次性监听特定type和cmd的数据包 */ onceExact(e, n, r) { return this.addListener(`exact:${e}:${n}`, r, !0); } // ===== 移除监听器 ===== /** 移除特定的全局监听器 */ off(e, n) { return this.removeListener(e, n); } /** 移除特定key下的所有监听器 */ offAll(e) { this.listeners.delete(e); } /** 移除所有监听器 */ removeAllListeners() { this.listeners.clear(); } /** * 触发监听器 - 按优先级触发: 精确匹配 > cmd匹配 > type匹配 > 全局 */ emitPacket(e, n, r, i, o) { const a = [ `exact:${e}:${r}`, // 精确匹配 `cmd:${r}`, // cmd匹配 `type:${e}`, // type匹配 "all" // 全局 ]; for (const s of a) { const c = this.listeners.get(s); if (!c) continue; const u = []; for (const d of c) try { d.callback({ type: e, uin: n, cmd: r, seq: i, hex_data: o }), d.once && u.push(d); } catch (p) { this.logger.logError("监听器回调执行出错:", p); } for (const d of u) c.delete(d); } } async init(e, n = !1) { const r = e + "-" + process.arch; try { if (!this.loaded) return this.logger.logWarn("NativePacketClient 未成功加载,无法初始化"), !1; const i = gD[r]?.send, o = gD[r]?.recv; if (!i || !o) return this.logger.logWarn(`NativePacketClient: 未找到对应版本的偏移数据: ${r}`), !1; const a = process.platform + "." + process.arch; return this.supportedPlatforms.includes(a) ? (this.MoeHooExport.exports.initHook?.(i, o, (s, c, u, d, p) => { this.emitPacket(s, c, u, d, p); }, n), this.logger.log("[PacketHandler] 初始化成功"), !0) : (this.logger.logWarn(`NativePacketClient: 不支持的平台: ${a}`), !1); } catch (i) { return this.logger.logError("NativePacketClient 初始化出错:", i), !1; } } } class gIe { supportedPlatforms = ["win32.x64", "linux.x64", "linux.arm64", "darwin.x64", "darwin.arm64"]; exports = { exports: {} }; logger; _loaded = !1; constructor({ logger: e }) { this.logger = e, this.load(); } load() { const e = process.platform + "." + process.arch; if (!this.supportedPlatforms.includes(e)) { this.logger.logWarn(`Napi2NativeLoader: 不支持的平台: ${e}`), this._loaded = !1; return; } const n = ve.join( fl(Mc(import.meta.url)), "./native/napi2native/napi2native." + e + ".node" ); if (!fe.existsSync(n)) { this.logger.logWarn(`Napi2NativeLoader: 缺失运行时文件: ${n}`), this._loaded = !1; return; } try { process.dlopen(this.exports, n, ID.dlopen.RTLD_LAZY), this._loaded = !0, this.logger.log("[Napi2NativeLoader] 加载成功"); } catch (r) { this.logger.logError("Napi2NativeLoader 加载出错:", r), this._loaded = !1; } } get loaded() { return this._loaded; } get nativeExports() { return this.exports.exports; } /** * 初始化 Hook * @param send send 偏移地址 * @param recv recv 偏移地址 * @returns 是否初始化成功 */ initHook(e, n) { if (!this._loaded) return this.logger.logWarn("Napi2NativeLoader 未成功加载,无法初始化 Hook"), !1; try { return this.nativeExports.initHook?.(e, n) ?? !1; } catch (r) { return this.logger.logError("Napi2NativeLoader initHook 出错:", r), !1; } } } class yIe { psCpuUsage = process.cpuUsage(); psCurrentTime = process.hrtime(); cpuTimes = gt.cpus().map((e) => e.times); replaceNaN(e) { return isNaN(e) ? 0 : e; } sysCpuInfo() { const e = gt.cpus().map((i) => i.times), { total: n, active: r } = e.map((i, o) => { const a = this.cpuTimes[o], s = i.user + i.nice + i.sys + i.idle + i.irq, c = (a?.user ?? 0) + (a?.nice ?? 0) + (a?.sys ?? 0) + (a?.idle ?? 0) + (a?.irq ?? 0), u = s - i.idle, d = c - (a?.idle ?? 0); return { total: s - c, active: u - d }; }).reduce((i, o) => ({ total: i.total + o.total, active: i.active + o.active }), { total: 0, active: 0 }); return this.cpuTimes = e, { usage: this.replaceNaN(r / n * 100).toFixed(2), model: gt.cpus()[0]?.model ?? "none", speed: gt.cpus()[0]?.speed ?? 0, core: gt.cpus().length }; } sysMemoryUsage() { const { total: e, free: n } = { total: gt.totalmem(), free: gt.freemem() }; return ((e - n) / 1024 / 1024).toFixed(2); } qqUsage() { const e = process.memoryUsage(), n = gt.cpus().length, r = process.cpuUsage(this.psCpuUsage), i = process.hrtime(this.psCurrentTime); this.psCpuUsage = process.cpuUsage(), this.psCurrentTime = process.hrtime(); const o = (r.user + r.system) / 1e3, a = i[0] * 1e3 + i[1] / 1e6, s = o / a / n * 100; return { cpu: this.replaceNaN(s).toFixed(2), memory: ((e.heapTotal + e.external + e.arrayBuffers) / 1024 / 1024).toFixed(2) }; } systemStatus() { const e = this.qqUsage(), n = this.sysCpuInfo(); return { cpu: { core: n.core, model: n.model, speed: (n.speed / 1e3).toFixed(2), usage: { system: n.usage, qq: e.cpu } }, memory: { total: (gt.totalmem() / 1024 / 1024).toFixed(2), usage: { system: this.sysMemoryUsage(), qq: e.memory } }, arch: `${gt.platform()} ${gt.arch()} ${gt.release()}` }; } } class bIe extends RD { statusHelper; interval = null; constructor(e = 3e3) { super(), this.statusHelper = new yIe(), this.on("newListener", (n) => { n === "statusUpdate" && this.listenerCount("statusUpdate") === 0 && this.startInterval(e); }), this.on("removeListener", (n) => { n === "statusUpdate" && this.listenerCount("statusUpdate") === 0 && this.stopInterval(); }); } startInterval(e) { this.interval ??= setInterval(() => { const n = this.statusHelper.systemStatus(); this.emit("statusUpdate", n); }, e); } stopInterval() { this.interval && (clearInterval(this.interval), this.interval = null); } } const vIe = new bIe(); function wL(t, e = 5e3) { return new Promise((n, r) => { if (Lo.platform !== "win32") return n({ disconnect: () => { } }); const o = `\\\\.\\pipe\\NapCat_${Lo.pid}`, a = setTimeout(() => { r(new Error(`连接命名管道超时: ${o}`)); }, e); try { const s = Lo.stdout.write.bind(Lo.stdout), c = b7.connect(o, () => { clearTimeout(a), c.setNoDelay(!0), t.log(`[StdOut] 已重定向到命名管道: ${o}`); const u = new f7({ highWaterMark: 1024 * 64, // 64KB 高水位线 write(p, f, m) { return c.writable ? (c.write(p, f, () => { }) ? Lo.nextTick(m) : c.once("drain", () => { m(); }), !0) : (t.log("[StdOut] 管道不可写,回退到控制台输出"), s(p, f, m)); } }); Lo.stdout.write = (p, f, m) => (typeof f == "function" && (m = f, f = void 0), u.write(p, f, m)), n({ disconnect: () => { Lo.stdout.write = s, c.end(), t.log(`已手动断开命名管道连接: ${o}`); } }); }); c.on("error", (u) => { clearTimeout(a), Lo.stdout.write = s, t.log(`连接命名管道 ${o} 时出错:`, u), r(u); }), c.on("end", () => { Lo.stdout.write = s, t.log("命名管道连接已关闭"); }), c.on("close", () => { Lo.stdout.write = s, t.log("命名管道连接已关闭"); }); } catch (s) { clearTimeout(a), t.log(`尝试连接命名管道 ${o} 时发生异常:`, s), r(s); } }); } async function xIe(t) { process.on("uncaughtException", (e) => { t.logError("[SnowCat] [Error] Unhandled Exception:", e.message); }), process.on("unhandledRejection", (e) => { t.logError("[SnowCat] [Error] unhandledRejection:", e); }); } function wIe(t) { if (Ln.platform() === "darwin") { const r = Ln.homedir(), i = ve.resolve(r, "./Library/Application Support/QQ"); return [i, ve.join(i, "global")]; } let e = t.NodeQQNTWrapperUtil.getNTUserDataInfoConfig(); e || (e = ve.resolve(Ln.homedir(), "./.config/QQ"), fe.mkdirSync(e, { recursive: !0 })); const n = ve.resolve(e, "./nt_qq/global"); return [e, n]; } function SIe() { return { win32: _a.KWINDOWS, darwin: _a.KMAC, linux: _a.KLINUX }[Ln.platform()] ?? _a.KWINDOWS; } async function _Ie(t, e, n, r, i) { t.initWithDeskTopConfig( { base_path_prefix: "", platform_type: r, app_type: 4, app_version: e.getFullQQVersion(), os_version: i, use_xlog: !1, qua: e.QQVersionQua ?? "", global_path_config: { desktopGlobalPath: n }, thumb_config: { maxSide: 324, minSide: 48, longLimit: 6, density: 2 } }, new Jue() ); } async function EIe(t, e, n, r, i) { t.initConfig({ machineId: "", appid: e.QQVersionAppid ?? "", platVer: r, commonPath: n, clientVer: e.getFullQQVersion(), hostName: i, externalVersion: !1 }); } async function AIe(t, e, n, r, i) { const o = { isLogined: !1, loginFlowInitialized: !1 }; let a; const s = new Promise((u) => { a = u; }), c = new Tue(); return c.onUserLoggedIn = (u) => { const d = `当前账号(${u})已登录,无法重复登录`; e.logError(d), de.setQQLoginError(d); }, c.onQRCodeLoginSucceed = async (u) => { o.isLogined = !0, de.setQQLoginStatus(!0), de.setQQLoginError(""); const d = de.getOneBotContext(); d?.core?.selfInfo ? (d.core.selfInfo.online = !0, de.setQQLoginPhase("ready")) : de.setQQLoginPhase("initializing"), a({ uid: u.uid, uin: u.uin, nick: "", online: !0 }); }, c.onLoginDisConnected = () => { o.isLogined = !1, de.setQQLoginStatus(!1), de.setQQLoginPhase("offline"), e.logWarn("[Core] [Login] 登录服务已断开,将允许重新获取二维码"); }, c.onLogoutSucceed = () => { o.isLogined = !1, de.setQQLoginStatus(!1), de.setQQLoginPhase("offline"); }, c.onLoginConnected = () => { kIe(t, e).then(async () => { if (!o.loginFlowInitialized) { o.loginFlowInitialized = !0, await IIe(o, e, t, r, i); return; } if (!o.isLogined) { de.setQQLoginPhase("generating_qrcode"); const u = t.getQRCodePicture(); e.logWarn("[Core] [Login] 登录服务重连完成,正在获取二维码", { requested: u, msfStatus: t.getMsfStatus() }); } }).catch((u) => e.logError(u)); }, c.onQRCodeGetPicture = ({ pngBase64QrcodeData: u, qrcodeUrl: d }) => { de.setQQLoginQrcodeURL(d), de.setQQLoginError(""), de.setQQLoginPhase("waiting_qrcode"); const p = u.replace(/^data:image\/\w+;base64,/, ""), f = Buffer.from(p, "base64"); e.logWarn("请扫描下面的二维码,然后在手Q上授权登录:"); const m = ve.join(n.cachePath, "qrcode.png"); hle.generate(d, { small: !0 }, (h) => { e.logWarn([ ` `, h, "二维码解码URL: " + d, "如果控制台二维码无法扫码,可以复制解码url到二维码生成网站生成二维码再扫码,也可以打开下方的二维码路径图片进行扫码。" ].join(` `)), fe.writeFile(m, f, {}, () => { e.logWarn("二维码已保存到", m); }); }); }, c.onQRCodeSessionUserScaned = () => { de.setQQLoginPhase("qrcode_scanned"), e.log("[Core] [Login] 二维码已被扫描,等待确认..."); }, c.onQRCodeSessionFailed = (u, d) => { o.isLogined || (e.logError("[Core] [Login] Login Error,ErrType: ", u, " ErrCode:", d), u === 1 && d === 3 && (de.setQQLoginError("二维码已过期,请刷新"), t.getQRCodePicture())); }, c.onLoginFailed = (...u) => { const d = JSON.stringify(u); e.logError("[Core] [Login] Login Error , ErrInfo: ", d), de.setQQLoginError(`登录失败: ${d}`); }, t.addKernelLoginListener(Nu(c, e)), t.connect(), await s; } async function IIe(t, e, n, r, i) { const o = () => { const s = process.env.NAPCAT_QUICK_PASSWORD_MD5?.trim(); if (s) { if (/^[a-fA-F0-9]{32}$/.test(s)) return s.toLowerCase(); e.logError("NAPCAT_QUICK_PASSWORD_MD5 格式无效(需为 32 位 MD5)"); } const c = process.env.NAPCAT_QUICK_PASSWORD; if (typeof c == "string" && c.length > 0) return e.log("检测到 NAPCAT_QUICK_PASSWORD,已在内存中计算 MD5 用于回退登录"), Wp("md5").update(c, "utf8").digest("hex"); }; de.setRefreshQRCodeCallback(async () => { t.isLogined = !1; const s = n.getMsfStatus(); if (s === 2) throw de.setQQLoginPhase("reconnecting"), new Error("QQ_LOGIN_SERVICE_RESTARTING"); const c = n.getQRCodePicture(); if (e.logWarn("[Core] [Login] 请求刷新二维码", { requested: c, msfStatus: s }), !c) throw new Error("QQ 未接受二维码刷新请求"); }), de.setQuickLoginCall(async (s) => await new Promise((c) => { s ? (e.log("正在快速登录 ", s), n.quickLoginWithUin(s).then((u) => { if (u.result === "0" && !u.loginErrorInfo?.errMsg) de.setQQLoginStatus(!0), de.setQQLoginError(""), c({ result: !0, message: "" }); else { const p = u.loginErrorInfo?.errMsg || `快速登录失败,错误码: ${u.result}`; de.setQQLoginError(p), n.getQRCodePicture(), c({ result: !1, message: p }); } }).catch((u) => { e.logError(u), de.setQQLoginError("快速登录发生错误"), n.getQRCodePicture(), c({ result: !1, message: "快速登录发生错误" }); })) : c({ result: !1, message: "快速登录失败" }); })), de.setPasswordLoginCall(async (s, c) => await new Promise((u) => { s && c ? (e.log("正在密码登录 ", s), n.passwordLogin({ uin: s, passwordMd5: c, step: 0, newDeviceLoginSig: new Uint8Array(), proofWaterSig: new Uint8Array(), proofWaterRand: new Uint8Array(), proofWaterSid: new Uint8Array(), unusualDeviceCheckSig: new Uint8Array() }).then((d) => { if (d.result === "140022008") { const p = d.loginErrorInfo?.proofWaterUrl || ""; e.log("需要验证码, proofWaterUrl: ", p), u({ result: !1, message: "需要验证码", needCaptcha: !0, proofWaterUrl: p }); } else if (d.result === "140022010") { const p = d.loginErrorInfo?.jumpUrl || "", f = d.loginErrorInfo?.newDevicePullQrCodeSig || ""; e.log("新设备需要扫码验证, jumpUrl: ", p), u({ result: !1, message: "新设备需要扫码验证", needNewDevice: !0, jumpUrl: p, newDevicePullQrCodeSig: f }); } else if (d.result === "140022011") { const p = d.loginErrorInfo?.jumpUrl || "", f = d.loginErrorInfo?.newDevicePullQrCodeSig || ""; e.log("异常设备需要验证, jumpUrl: ", p), u({ result: !1, message: "异常设备需要验证", needNewDevice: !0, jumpUrl: p, newDevicePullQrCodeSig: f }); } else if (d.result !== "0") { const p = d.loginErrorInfo?.errMsg || "密码登录失败"; de.setQQLoginError(p), n.getQRCodePicture(), u({ result: !1, message: p }); } else de.setQQLoginStatus(!0), de.setQQLoginError(""), u({ result: !0, message: "" }); }).catch((d) => { e.logError(d), de.setQQLoginError("密码登录发生错误"), n.getQRCodePicture(), u({ result: !1, message: "密码登录发生错误" }); })) : u({ result: !1, message: "密码登录失败:参数不完整" }); })); const a = async (s) => { const c = o(); if (!c) return e.log(`QQ ${s} 未配置回退密码环境变量,建议优先使用 ACCOUNT + NAPCAT_QUICK_PASSWORD(NAPCAT_QUICK_PASSWORD_MD5 作为备用),将使用二维码登录方式`), { success: !1, attempted: !1 }; e.log("正在尝试密码回退登录 ", s); const u = await de.requestPasswordLogin(s, c); if (u.result) return e.log("密码回退登录成功 ", s), { success: !0, attempted: !0 }; if (u.needCaptcha) { const d = u.proofWaterUrl ? `密码回退需要验证码,请在 WebUi 中继续完成验证:${u.proofWaterUrl}` : "密码回退需要验证码,请在 WebUi 中继续完成验证"; return e.logWarn(d), de.setQQLoginError("密码回退需要验证码,请在 WebUi 中继续完成验证"), { success: !1, attempted: !0 }; } if (u.needNewDevice) { const d = u.jumpUrl ? `密码回退需要新设备验证,请在 WebUi 中继续完成验证:${u.jumpUrl}` : "密码回退需要新设备验证,请在 WebUi 中继续完成验证"; return e.logWarn(d), de.setQQLoginError("密码回退需要新设备验证,请在 WebUi 中继续完成验证"), { success: !1, attempted: !0 }; } return e.logError("密码回退登录失败:", u.message), { success: !1, attempted: !0 }; }; if (de.setCaptchaLoginCall(async (s, c, u, d, p) => await new Promise((f) => { s && c && u ? (e.log("正在验证码登录 ", s), n.passwordLogin({ uin: s, passwordMd5: c, step: 1, newDeviceLoginSig: new Uint8Array(), proofWaterSig: new TextEncoder().encode(u), proofWaterRand: new TextEncoder().encode(d), proofWaterSid: new TextEncoder().encode(p), unusualDeviceCheckSig: new Uint8Array() }).then((m) => { if (console.log("验证码登录结果: ", m), m.result === "140022010") { const h = m.loginErrorInfo?.jumpUrl || "", y = m.loginErrorInfo?.newDevicePullQrCodeSig || ""; e.log("验证码登录后需要新设备验证, jumpUrl: ", h), f({ result: !1, message: "新设备需要扫码验证", needNewDevice: !0, jumpUrl: h, newDevicePullQrCodeSig: y }); } else if (m.result === "140022011") { const h = m.loginErrorInfo?.jumpUrl || "", y = m.loginErrorInfo?.newDevicePullQrCodeSig || ""; e.log("验证码登录后需要异常设备验证, jumpUrl: ", h), f({ result: !1, message: "异常设备需要验证", needNewDevice: !0, jumpUrl: h, newDevicePullQrCodeSig: y }); } else if (m.result !== "0") { const h = m.loginErrorInfo?.errMsg || "验证码登录失败"; de.setQQLoginError(h), n.getQRCodePicture(), f({ result: !1, message: h }); } else de.setQQLoginStatus(!0), de.setQQLoginError(""), f({ result: !0, message: "" }); }).catch((m) => { e.logError(m), de.setQQLoginError("验证码登录发生错误"), n.getQRCodePicture(), f({ result: !1, message: "验证码登录发生错误" }); })) : f({ result: !1, message: "验证码登录失败:参数不完整" }); })), de.setNewDeviceLoginCall(async (s, c, u) => await new Promise((d) => { s && c && u ? (e.log("正在新设备验证登录 ", s), n.passwordLogin({ uin: s, passwordMd5: c, step: 2, newDeviceLoginSig: new TextEncoder().encode(u), proofWaterSig: new Uint8Array(), proofWaterRand: new Uint8Array(), proofWaterSid: new Uint8Array(), unusualDeviceCheckSig: new Uint8Array() }).then((p) => { if (p.result === "140022011") { const f = p.loginErrorInfo?.jumpUrl || "", m = p.loginErrorInfo?.newDevicePullQrCodeSig || ""; e.log("新设备验证后需要异常设备验证, jumpUrl: ", f), d({ result: !1, message: "异常设备需要验证", needNewDevice: !0, jumpUrl: f, newDevicePullQrCodeSig: m }); } else if (p.result !== "0") { const f = p.loginErrorInfo?.errMsg || "新设备验证登录失败"; de.setQQLoginError(f), n.getQRCodePicture(), d({ result: !1, message: f }); } else de.setQQLoginStatus(!0), de.setQQLoginError(""), d({ result: !0, message: "" }); }).catch((p) => { e.logError(p), de.setQQLoginError("新设备验证登录发生错误"), n.getQRCodePicture(), d({ result: !1, message: "新设备验证登录发生错误" }); })) : d({ result: !1, message: "新设备验证登录失败:参数不完整" }); })), r) if (i.some((s) => s.uin === r)) e.log("正在快速登录 ", r), n.quickLoginWithUin(r).then(async (s) => { if (!(s.result === "0" && !s.loginErrorInfo?.errMsg)) { const u = s.loginErrorInfo?.errMsg || `快速登录失败,错误码: ${s.result}`; e.logError("快速登录错误:", u), de.setQQLoginError(u); const { success: d, attempted: p } = await a(r); !d && !p && !t.isLogined && n.getQRCodePicture(); } }).catch(async (s) => { e.logError("快速登录异常:", s), de.setQQLoginError("快速登录发生错误"); const { success: c, attempted: u } = await a(r); !c && !u && !t.isLogined && n.getQRCodePicture(); }); else { e.logError("快速登录失败,未找到该 QQ 历史登录记录,将尝试密码回退登录"); const { success: s, attempted: c } = await a(r); !s && !c && !t.isLogined && n.getQRCodePicture(); } else { e.log("没有 -q 指令指定快速登录,将使用二维码登录方式"), i.length > 0 && e.log(`可用于快速登录 of QQ: ${i.map((c, u) => `${u + 1}. ${c.uin} ${c.nickName}`).join(` `)}`); let s = !1; try { const c = de.getQQQuickLoginList() || []; (process.env.NAPCAT_QUICK_ACCOUNT || c.length > 0 || process.env.NAPCAT_QUICK_PASSWORD || process.env.NAPCAT_QUICK_PASSWORD_MD5) && (s = !0), await de.runWebUiConfigQuickFunction(); } catch (c) { e.logError("WebUi 快速登录失败 执行失败", c); } !s && !t.isLogined && n.getQRCodePicture(); } n.getLoginList().then((s) => { const c = s.LocalLoginInfoList.filter((u) => u.isQuickLogin); de.setQQQuickLoginList(c.map((u) => u.uin.toString())), de.setQQNewLoginList(c); }); } async function CIe(t, e, n) { return new Promise((r, i) => { const o = new Cue(); if (o.onOpentelemetryInit = (a) => { a.is_init ? r() : i(new Error("opentelemetry init failed")); }, t.init( e, new Vue(), new Yue(), o ), n) n.start(); else try { t.startNT(0); } catch { try { t.startNT(); } catch (a) { i(new Error("init failed " + a.message)); } } }); } async function TIe(t, e) { process.env.NAPCAT_PROXY_PORT ? (t.getMSFService().setNetworkProxy({ userName: "", userPwd: "", address: process.env.NAPCAT_PROXY_ADDRESS || "127.0.0.1", port: +process.env.NAPCAT_PROXY_PORT, proxyType: 2, domain: "", isSocket: !0 }), e.logWarn("已设置代理", process.env.NAPCAT_PROXY_ADDRESS, process.env.NAPCAT_PROXY_PORT)) : process.env.NAPCAT_PROXY_CLOSE && t.getMSFService().setNetworkProxy({ userName: "", userPwd: "", address: "", port: 0, proxyType: 0, domain: "", isSocket: !1 }); } async function kIe(t, e) { let n = !1; for (; !n; ) n = t.getMsfStatus() !== 3, e.log("等待网络连接..."), await bp(500); return e.log("网络已连接"), n; } async function SL() { console.log("SnowCat Shell App Loading..."); const t = new sB(), e = new TM(t.logsPath); process.env.NAPCAT_WORKER_PROCESS !== "1" && process.env.NAPCAT_DISABLE_MULTI_PROCESS !== "1" && process.env.NAPCAT_DISABLE_MULTIPROCESSING !== "1" && e.setFileLogEnabled(!1), xIe(e), await I0e(t, e); const n = new Rue({ logger: e }), r = new mIe({ logger: e }), i = new gIe({ logger: e }); await uo.init(t.binaryPath, e), process.env.NAPCAT_DISABLE_PIPE === "1" || process.env.NAPCAT_WORKER_PROCESS === "1" || await wL(e).catch((H) => e.logError("命名管道连接失败", H)); const o = Bue(n.QQMainPath, n.getFullQQVersion()), a = Aue(t.configPath); await r.init(n.getFullQQVersion(), a.o3HookMode === 1); let s; if (r.onCmd("OidbSvcTrpcTcp.0xcde_2", ({ type: H, hex_data: G }) => { if (H === 1) try { const J = Buffer.from(G, "hex"), B = new he(CS).decode(J); if (B.body && B.body.length > 0) { const D = new he(iW).decode(B.body); D.inner?.value && (s = D.inner.value, e.log("[SnowCat] 已启用数据库辅助支持能力")); } } catch (J) { e.logError("[SnowCat] [0xCDE_2] 解析失败:", J); } }), process.env.NAPCAT_ENABLE_VERBOSE_LOG === "1" && i.nativeExports.setVerbose?.(!0), process.env.NAPCAT_DISABLE_BYPASS !== "1") { const H = a.bypass ?? {}; i.nativeExports.enableAllBypasses?.(H); } else e.log("[SnowCat] Napi2NativeLoader: Bypass已通过环境变量禁用"); const c = o.NodeIO3MiscService.get(); c.addO3MiscListener(new fIe()), e.log("[SnowCat] [Core] SnowCat.Core Version: " + gl), de.setWorkingEnv(fA.Shell), H1e(e, t, CM, vIe).then().catch((H) => e.logError(H)); const u = o.NodeIQQNTWrapperEngine.get(), d = o.NodeIKernelLoginService.get(); let p, f = null; try { f = o.NodeIQQNTStartupSessionWrapper.create(), p = o.NodeIQQNTWrapperSession.getNTWrapperSession("nt_1"); } catch (H) { try { p = o.NodeIQQNTWrapperSession.create(); } catch (G) { throw e.logError("创建 StartupSession 失败", H), e.logError("创建 Session 失败", G), G; } } const [m, h] = wIe(o); de.setQQDataPath(m); const y = SIe(); if (!n.QQVersionAppid || !n.QQVersionQua) throw new Error("QQVersionAppid or QQVersionQua is not defined"); await _Ie(u, n, h, y, ag), await EIe(d, n, h, ag, UM), TIe(p, e); let x; try { const H = process.argv, G = H.findIndex((J) => J === "-q" || J === "--qq"); G !== -1 && G + 1 < H.length && (x = H[G + 1]); } catch (H) { e.logWarn("解析命令行参数失败,无法使用快速登录功能", H); } const g = (await d.getLoginList()).LocalLoginInfoList, b = (/* @__PURE__ */ new Date()).getTime().toString(); c.reportAmgomWeather("login", "a1", [b, "0", "0"]); const S = await AIe(d, e, t, x, g); typeof process.send == "function" && (process.send({ type: "login-success" }), e.log("[SnowCat] 已通知主进程登录成功")); const E = "eb1fd6ac257461580dc7438eb099f23aae04ca679f4d88f53072dc56e3bb1129"; c.setAmgomDataPiece(n.QQVersionAppid, new Uint8Array(Buffer.from(E, "hex"))); let T = d.getMachineGuid(); T = T.slice(0, 8) + "-" + T.slice(8, 12) + "-" + T.slice(12, 16) + "-" + T.slice(16, 20) + "-" + T.slice(20), c.reportAmgomWeather("login", "a6", [b, "184", "329"]); const U = await Lue( T, n.QQVersionAppid, n.getFullQQVersion(), S.uin, S.uid, m ); await CIe(p, U, f); const q = ve.resolve(m, "./NapCat/data"); if (m !== "/" && /^[a-zA-Z]:\\$/.test(m) === !1) try { fe.mkdirSync(q, { recursive: !0 }); } catch (H) { e.logError("创建accountDataPath失败", H); } e.logDebug("本账号数据/缓存目录:", q); const Y = new NIe( o, p, e, S, n, t, r, i ); s && (Y.core.dbPassphrase = s), await Y.InitNapCat(); } class NIe { core; context; constructor(e, n, r, i, o, a, s, c) { this.context = { packetHandler: s, napi2nativeLoader: c, workingEnv: fA.Shell, wrapper: e, session: n, logger: r, basicInfoWrapper: o, pathWrapper: a }, this.core = new X0(this.context, i); } async InitNapCat() { await this.core.initCore(); let e = !1; this.core.event.on("KickedOffLine", (i) => { de.setQQLoginStatus(!1), de.setQQLoginQrcodeURL(""), de.setQQLoginError(i), de.setQQLoginPhase("reconnecting"), !e && (e = !0, setTimeout(() => { de.requestRestartProcess().then((o) => { this.context.logger.logWarn("[Core] [Login] 账号被踢下线,正在重启 Worker 以重新创建 QQ 登录服务", o), o.result || (e = !1, de.setQQLoginPhase("offline"), de.setQQLoginError(`${i} 登录服务重启失败:${o.message}`)); }).catch((o) => { e = !1, de.setQQLoginPhase("offline"), de.setQQLoginError(`${i} 登录服务重启失败:${o.message}`); }); }, 3500)); }); const n = new pIe(this.core, this.context, this.context.pathWrapper); await n.initAdapters().catch((i) => this.context.logger.logError("初始化协议适配器失败", i)); const r = n.getOneBotAdapter(); r && (de.setOneBotContext(r), de.getQQLoginStatus() && de.setQQLoginPhase("ready")); } } class PIe { utilityProcess; constructor(e) { this.utilityProcess = e; } createWorker(e, n, r) { const i = this.utilityProcess.fork(e, n, r); return { get pid() { return i.pid; }, stdout: i.stdout, stderr: i.stderr, postMessage(o) { i.postMessage(o); }, kill() { return i.kill(); }, on(o, a) { i.on(o, a); }, once(o, a) { i.once(o, a); }, off(o, a) { i.off(o, a); } }; } onParentMessage(e) { process.parentPort && process.parentPort.on("message", (n) => { e(n.data); }); } sendToParent(e) { return process.parentPort ? (process.parentPort.postMessage(e), !0) : !1; } } class DIe { forkFn; constructor(e) { this.forkFn = e; } createWorker(e, n, r) { const i = this.forkFn(e, n, r); return { get pid() { return i.pid; }, stdout: i.stdout, stderr: i.stderr, postMessage(o) { i.send && i.send(o); }, kill() { return i.kill(); }, on(o, a) { i.on(o, a); }, once(o, a) { i.once(o, a); }, off(o, a) { i.off(o, a); } }; } onParentMessage(e) { process.on("message", (n) => { e(n); }); } sendToParent(e) { return process.send ? (process.send(e), !0) : !1; } } async function OIe() { if (process.env.NAPCAT_FORCE_NODE_PROCESS !== "1" && typeof process.versions.electron < "u") { const e = await import("electron"); return e.app && !e.app.isReady() && await e.app.whenReady(), { manager: new PIe(e.utilityProcess), isElectron: !0 }; } else { const { fork: e } = await import("child_process"); return { manager: new DIe(e), isElectron: !1 }; } } const _L = Mc(import.meta.url), k2 = ve.dirname(_L), FIe = new sB(), yD = ve.join(k2, "config", ".env"); if (fe.existsSync(yD)) try { fe.readFileSync(yD, "utf8").split(/\r?\n/).forEach((e) => { if (e = e.trim(), e && !e.startsWith("#")) { const n = e.split("="), r = n[0]?.trim(), i = n.slice(1).join("=").trim(); r && i && (process.env[r] = i); } }); } catch (t) { console.log("[SnowCat] Failed to load .env file:", t); } const Hp = { isWorkerProcess: process.env.NAPCAT_WORKER_PROCESS === "1", isMultiProcessDisabled: process.env.NAPCAT_DISABLE_MULTI_PROCESS === "1" || process.env.NAPCAT_DISABLE_MULTIPROCESSING === "1", isPipeDisabled: process.env.NAPCAT_DISABLE_PIPE === "1" }, an = new TM(FIe.logsPath); !Hp.isWorkerProcess && !Hp.isMultiProcessDisabled && an.setFileLogEnabled(!1); let Ou = null, Fi = null, pl = !1, Gm = !1, EL = !1; const du = [], bD = 1e4, sS = 3; function MIe() { return pl ? "UtilityProcess" : "Fork"; } function RIe() { return _L.endsWith(".mjs") ? ve.join(k2, "napcat.mjs") : ve.join(k2, "napcat.js"); } function vD(t) { try { return process.kill(t, 0), !0; } catch { return !1; } } function BIe(t) { try { process.kill(t, "SIGKILL"); } catch (e) { if (process.platform === "win32") try { require("child_process").execSync(`taskkill /F /PID ${t}`, { stdio: "ignore" }); } catch { an.logError(`[SnowCat] [Process] 强制终止进程失败: PID ${t}`); } else an.logError("[SnowCat] [Process] 强制终止进程失败:", e); } } async function UIe(t) { if (pl) try { const e = await import("electron"); if (e.app && typeof e.app.getAppMetrics == "function") { const n = e.app.getAppMetrics(), r = process.pid; for (const i of n) { const o = i.pid; if (!(o === r || t.includes(o))) try { process.kill(o, "SIGTERM"), an.log(`[SnowCat] [Process] 已清理残留进程: PID ${o} (${i.type})`); } catch { } } } } catch (e) { an.logDebug?.("[SnowCat] [Process] 清理残留进程时出错:", e); } } async function LIe(t, e) { if (Gm = !0, !Fi) { an.logWarn("[SnowCat] [Process] 没有运行中的Worker进程"), await r0(!1), Gm = !1; return; } const n = Fi.pid; if (Fi.postMessage({ type: "restart-prepare" }), await new Promise((r) => { const i = setTimeout(() => { an.logWarn("[SnowCat] [Process] Worker进程未在 5 秒内退出,尝试发送强制关闭信号"), Fi?.postMessage({ type: "shutdown" }), setTimeout(() => { an.logWarn("[SnowCat] [Process] Worker进程仍未退出,尝试 kill"), Fi?.kill(), r(); }, 2e3); }, 5e3); Fi?.once("exit", () => { clearTimeout(i), r(); }); }), n && vD(n) && (an.logWarn(`[SnowCat] [Process] 进程 ${n} 仍在运行,尝试强制杀掉`), BIe(n), await new Promise((r) => setTimeout(r, 1e3)), vD(n) && an.logError(`[SnowCat] [Process] 进程 ${n} 无法终止,可能需要手动处理`)), await new Promise((r) => setTimeout(r, 3e3)), await r0(!1, t, e), pl && Fi?.pid) { const r = [process.pid, Fi.pid]; await UIe(r); } Gm = !1; } async function r0(t = !0, e, n) { if (!Ou) throw new Error("进程管理器未初始化"); const r = RIe(), i = MIe(), o = []; if (t) { const s = process.argv.slice(2), c = s.findIndex((u) => u === "-q" || u === "--qq"); if (c !== -1 && c + 1 < s.length) { const u = s[c], d = s[c + 1]; u && d && o.push(u, d); } } const a = Ou.createWorker(r, o, { env: { ...process.env, NAPCAT_WORKER_PROCESS: "1", ...e ? { NAPCAT_WEBUI_JWT_SECRET_KEY: e } : {}, ...n ? { NAPCAT_WEBUI_PREFERRED_PORT: String(n) } : {} }, stdio: pl ? "pipe" : ["inherit", "pipe", "pipe", "ipc"], // --no-sandbox 是 Chromium 开关,仅当子进程完整引导 Electron(未设 ELECTRON_RUN_AS_NODE)时 // 才会被解析;纯 Node / Electron node 模式子进程会因 bad option 以退出码 9 拒绝启动 // (ELECTRON_RUN_AS_NODE 变量存在即触发 node 模式,与取值无关) ...!pl && process.versions.electron && process.env.ELECTRON_RUN_AS_NODE === void 0 ? { execArgv: ["--no-sandbox"] } : {} }); Fi = a, a.stdout && a.stdout.on("data", (s) => { process.stdout.write(s); }), a.stderr && a.stderr.on("data", (s) => { process.stderr.write(s); }), a.on("message", (s) => { if (typeof s == "object" && s !== null && "type" in s) { const c = s; c.type === "restart" ? LIe(c.secretKey, c.port).catch((u) => { an.logError(`[SnowCat] [${i}] 重启Worker进程失败:`, u); }) : c.type === "login-success" && an.log(`[SnowCat] [${i}] Worker进程已登录成功,切换到正常重试策略`); } }), a.on("exit", (s) => { const c = typeof s == "number" ? s : 0; if (c !== 0 && an.logError(`[SnowCat] [${i}] Worker进程退出,退出码: ${c}`), !Gm && !EL) { const u = Date.now(); for (; du.length > 0 && u - du[0] > bD; ) du.shift(); du.push(u), du.length >= sS && (an.logError(`[SnowCat] [${i}] Worker进程在 ${bD / 1e3} 秒内异常退出 ${sS} 次,主进程退出`), process.exit(1)), an.logWarn(`[SnowCat] [${i}] Worker进程意外退出 (${du.length}/${sS}),正在尝试重新拉起...`), r0(!0).catch((d) => { an.logError(`[SnowCat] [${i}] 重新拉起Worker进程失败:`, d); }); } }), await new Promise((s, c) => { const u = () => { a.off("error", d), s(); }, d = (...p) => { const f = p[0]; an.logError(`[SnowCat] [${i}] Worker进程启动失败:`, f), a.off("spawn", u), c(f); }; a.once("spawn", u), a.once("error", d); }); } async function QIe() { Hp.isPipeDisabled || await wL(an).catch( (e) => an.logError("命名管道连接失败", e) ), await r0(); const t = () => { EL = !0, Fi ? (Fi.postMessage({ type: "shutdown" }), setTimeout(() => { Fi?.kill(), process.exit(0); }, 1e3)) : process.exit(0); }; process.on("SIGINT", () => t()), process.on("SIGTERM", () => t()); } async function jIe() { if (!Ou) throw new Error("进程管理器未初始化"); const t = process.env.NAPCAT_PRELOAD_NODE_ADDON_PATH; if (t) try { const e = await import("os"); process.dlopen({ exports: {} }, t, e.constants.dlopen.RTLD_NOW | e.constants.dlopen.RTLD_GLOBAL), an.log(`[SnowCat] [Worker] 已预加载 Node Addon: ${t}`); } catch (e) { an.logError(`[SnowCat] [Worker] 预加载 Node Addon 失败: ${t}`, e); } Ou.onParentMessage((e) => { typeof e == "object" && e !== null && "type" in e && (e.type === "restart-prepare" || e.type === "shutdown") && setTimeout(() => { process.exit(0); }, 100); }), de.setRestartProcessCall(async () => { try { return Ou.sendToParent({ type: "restart", secretKey: ln.getSecretKey(), port: eL }) ? { result: !0, message: "进程重启请求已发送" } : { result: !1, message: "无法与主进程通信" }; } catch (e) { return an.logError("[SnowCat] [Process] 发送重启请求失败:", e), { result: !1, message: "发送重启请求失败: " + e.message }; } }), await SL(); } async function $Ie() { if (Hp.isMultiProcessDisabled) { await SL(); return; } const t = await OIe(); Ou = t.manager, pl = t.isElectron, Hp.isWorkerProcess ? await jIe() : await QIe(); } $Ie().catch((t) => { an.logError("[SnowCat] [Process] 启动失败:", t), process.exit(1); }); const ry = "trpc.qzone.feeds_reader.FeedsReader", Vf = "trpc.qzone.interaction_writer.InteractionWriter", GIe = "trpc.public_qzone.interaction.UFOComment", qIe = "trpc.public_qzone.relation.RelationService"; function vn(t) { return typeof t == "object" && t !== null && !Array.isArray(t); } async function ci(t, e, n, r, i, o) { const [a, s] = i.split("_"), { RequestUtil: c } = await Promise.resolve().then(() => Zj), u = await c.HttpGetJson( `https://h5.qzone.qq.com/http2rpc/gotrpc/v1/${n}/${r}?g_tk=${e}`, "POST", o, { Cookie: t, "Content-Type": "application/json", Referer: "https://h5.qzone.qq.com/pc-qzone/index.html", "x-web-qua": "V1_HT5_QZ_9.9.32_001_IDC_B", "x-oidb": JSON.stringify({ uint32_command: a, uint32_service_type: s }) } ); if (!vn(u) || u.retcode !== 0 || !vn(u.data)) { const d = vn(u) ? u.retcode : "invalid response", p = vn(u) && typeof u.message == "string" ? u.message : ""; throw new Error(`qzone public ${r} failed: retcode=${d} ${p}`.trim()); } return u.data; } function eo(t) { const e = t.cell_common; if (!vn(e) || !vn(e.union_id) || !Object.keys(e.union_id).length) throw new Error("空友动态缺少 cell_common.union_id,请使用推荐列表或详情返回的完整动态"); return { union_id: e.union_id, ...t.cell_feed_transfer === void 0 ? {} : { cell_feed_transfer: t.cell_feed_transfer } }; } function zIe(t) { const e = Buffer.from(JSON.stringify(t)).toString("base64url"); if (e.length > 65536) throw new Error("空友推荐分页游标过大"); return e; } function HIe(t, e) { if (!t || t.length > 65536 || !/^[A-Za-z0-9_-]+$/.test(t)) throw new Error("无效的空友推荐 cursor"); let n; try { const r = Buffer.from(t, "base64url"); if (r.toString("base64url") !== t) throw new Error("non-canonical encoding"); n = JSON.parse(r.toString("utf8")); } catch { throw new Error("无效的空友推荐 cursor"); } if (!vn(n) || n.version !== 1 || n.uin !== e || typeof n.refresh_id != "string" || !n.refresh_id || typeof n.attach_info != "string" || !(n.last_client_feed_union_id === null || vn(n.last_client_feed_union_id))) throw new Error("空友推荐 cursor 无效或不属于当前账号"); return { version: 1, uin: e, refresh_id: n.refresh_id, attach_info: n.attach_info, last_client_feed_union_id: n.last_client_feed_union_id }; } async function WIe(t, e, n) { const r = await ci( t, e, "trpc.public_qzone.entrance_ctrl.EntranceCtrl", "BatchEntranceWhitelist", "0x9741_0", { uins: [n], entrance_types: [1, 15] } ), i = Array.isArray(r.results) ? r.results.find( (o) => vn(o) && String(o.uin) === n ) : void 0; if (!vn(i) || !vn(i.entrances)) throw new Error("qzone public BatchEntranceWhitelist 缺少当前账号的 entrances"); return i.entrances; } async function KIe(t, e, n, r) { const i = r === void 0 ? { version: 1, uin: n, refresh_id: `${n}_${Date.now()}`, attach_info: "", last_client_feed_union_id: null } : HIe(r, n), o = await ci(t, e, ry, "GetPublicRecomFeeds", "0x9a38_0", { refresh_id: i.refresh_id, ...r === void 0 ? {} : { attach_info: i.attach_info, ...i.last_client_feed_union_id === null ? {} : { last_client_feed_union_id: i.last_client_feed_union_id } } }); if (!Array.isArray(o.feeds) || typeof o.has_more != "boolean") throw new Error("qzone public GetPublicRecomFeeds 分页响应异常"); const a = o.feeds.map((u) => { if (!vn(u) || !vn(u.feed)) throw new Error("qzone public GetPublicRecomFeeds 动态响应异常"); return u.feed; }); let s = i.last_client_feed_union_id; for (const u of a) { const d = u.cell_common; vn(d) && d.feed_type !== 3 && vn(d.union_id) && (s = d.union_id); } let c = null; if (o.has_more) { if (typeof o.attach_info != "string") throw new Error("qzone public GetPublicRecomFeeds 缺少 attach_info"); c = zIe({ ...i, attach_info: o.attach_info, last_client_feed_union_id: s }); } return { ...o, feeds: a, has_more: o.has_more, next_cursor: c }; } function VIe(t, e, n) { return ci(t, e, ry, "GetFeedDetail", "0x97b1_1", { ...eo(n), feed_action_domain_type: 3, from_page: 1 }); } function YIe(t, e, n, r) { return ci(t, e, ry, "GetComment", "0x9bfd_1", { ...eo(n), attach_info: r }); } function JIe(t, e, n, r, i, o) { return ci(t, e, ry, "GetReplies", "0x9bfe_1", { ...eo(n), cur_comment: r, comment_attach_info: "", reply_attach_info: i || r.reply_attach_info || "", page_size: o }); } async function XIe(t, e, n, r) { const i = await ci( t, e, GIe, r ? "Upvote" : "Downvote", r ? "0x9d18_1" : "0x9d19_1", eo(n) ); if (!i.upvote) throw new Error("qzone public upvote 响应缺少 upvote"); return i; } async function AL(t, e, n, r, i, o) { if (typeof r != "string" || !r) throw new Error("空友点赞目标缺少 like_key"); const a = await ci( t, e, Vf, o ? "DoLike" : "UnLike", o ? "0x9699_1" : "0x969c_1", { ...eo(n), like_key: r, like_type: i } ); if (!a.like) throw new Error("qzone public like 响应缺少 like"); return a; } function ZIe(t, e, n, r) { const i = n.cell_common; return AL(t, e, n, vn(i) ? i.cur_like_key : void 0, 1, r); } function e4e(t, e, n, r, i, o) { const a = (o ?? r).like; return AL(t, e, n, vn(a) ? a.id : void 0, o ? 3 : 2, i); } function IL(t) { return typeof t == "string" ? [{ type: 0, content: t }] : t; } async function t4e(t, e, n, r, i) { const o = await ci(t, e, Vf, "AddComment", "0x9676_1", { ...eo(n), comment: { user: r, content: IL(i) } }); if (!o.comment) throw new Error("qzone public AddComment 响应缺少 comment"); return o; } async function n4e(t, e, n, r, i, o, a) { const s = a?.user ?? i.user; if (!vn(s)) throw new Error("空友评论或回复缺少 user"); const c = await ci(t, e, Vf, "AddReply", "0x9677_1", { ...eo(n), comment: i, reply: { content: IL(o), target_user: s, user: r } }); if (!c.reply) throw new Error("qzone public AddReply 响应缺少 reply"); return c; } function r4e(t, e, n, r) { return ci(t, e, Vf, "DeleteComment", "0x9989_0", { ...eo(n), comment: r }); } function i4e(t, e, n, r, i) { return ci(t, e, Vf, "DeleteReply", "0x998a_0", { ...eo(n), comment: r, reply: i }); } async function o4e(t, e, n, r) { const i = eo(n), o = n.cell_common, a = vn(n.cell_user_info) ? n.cell_user_info.user : void 0, s = vn(a) && typeof a.uid == "string" ? a.uid.trim() : "", c = vn(a) && typeof a.uin == "string" ? a.uin.trim() : "", u = o.domain_type === 3 && !!s || !c; if (u ? !s : !c) throw new Error("空友动态缺少作者 uid/uin"); const d = i.union_id, p = await ci( t, e, qIe, r ? "Follow" : "Unfollow", r ? "0x9d1a_1" : "0x9d1b_1", { follow_from_type: 1, ...u ? { target_uid: s } : { target_uin: c }, ...d.uf_key ? { follow_feed_id: d.uf_key } : {}, ...n.cell_feed_transfer === void 0 ? {} : { cell_feed_transfer: n.cell_feed_transfer } } ); if (p.ret_code !== void 0 && p.ret_code !== null && p.ret_code !== 0 && p.ret_code !== "0") throw new Error( `qzone public follow failed: ret_code=${p.ret_code} ${p.ret_msg ?? ""}`.trim() ); return p; } function a4e(t, e, n, r) { return ci(t, e, "trpc.qzone.feeds_writer.FeedsWriter", "ForwardFeed", "0x969a_1", { ...eo(n), reason: r }); } const qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, commentQzonePublicFeed: t4e, deleteQzonePublicComment: r4e, deleteQzonePublicReply: i4e, forwardQzonePublicFeed: a4e, getQzonePublicCapabilities: WIe, getQzonePublicComments: YIe, getQzonePublicFeedDetail: VIe, getQzonePublicFeeds: KIe, getQzonePublicReplies: JIe, qzonePublicFeedParams: eo, qzonePublicRequest: ci, replyQzonePublicFeed: n4e, setQzonePublicCommentLike: e4e, setQzonePublicFollow: o4e, setQzonePublicLike: ZIe, setQzonePublicUpvote: XIe }, Symbol.toStringTag, { value: "Module" })); export { LIe as restartWorker };