docshift
Version:
Pure Client-side HTML ↔ DOCX conversion library for JavaScript
865 lines (864 loc) • 1.79 MB
JavaScript
var docshift = (() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// node_modules/docx/build/index.js
var require_build = __commonJS({
"node_modules/docx/build/index.js"(exports2, module2) {
!function(e, t) {
"object" == typeof exports2 && "object" == typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports2 ? exports2.docx = t() : e.docx = t();
}(globalThis, () => (() => {
var e = { 9742: (e2, t2) => {
"use strict";
t2.byteLength = function(e3) {
var t3 = c(e3), r3 = t3[0], n3 = t3[1];
return 3 * (r3 + n3) / 4 - n3;
}, t2.toByteArray = function(e3) {
var t3, r3, i2 = c(e3), o2 = i2[0], a2 = i2[1], u2 = new s(function(e4, t4, r4) {
return 3 * (t4 + r4) / 4 - r4;
}(0, o2, a2)), l2 = 0, h = a2 > 0 ? o2 - 4 : o2;
for (r3 = 0; r3 < h; r3 += 4) t3 = n2[e3.charCodeAt(r3)] << 18 | n2[e3.charCodeAt(r3 + 1)] << 12 | n2[e3.charCodeAt(r3 + 2)] << 6 | n2[e3.charCodeAt(r3 + 3)], u2[l2++] = t3 >> 16 & 255, u2[l2++] = t3 >> 8 & 255, u2[l2++] = 255 & t3;
return 2 === a2 && (t3 = n2[e3.charCodeAt(r3)] << 2 | n2[e3.charCodeAt(r3 + 1)] >> 4, u2[l2++] = 255 & t3), 1 === a2 && (t3 = n2[e3.charCodeAt(r3)] << 10 | n2[e3.charCodeAt(r3 + 1)] << 4 | n2[e3.charCodeAt(r3 + 2)] >> 2, u2[l2++] = t3 >> 8 & 255, u2[l2++] = 255 & t3), u2;
}, t2.fromByteArray = function(e3) {
for (var t3, n3 = e3.length, s2 = n3 % 3, i2 = [], o2 = 16383, a2 = 0, c2 = n3 - s2; a2 < c2; a2 += o2) i2.push(u(e3, a2, a2 + o2 > c2 ? c2 : a2 + o2));
return 1 === s2 ? (t3 = e3[n3 - 1], i2.push(r2[t3 >> 2] + r2[t3 << 4 & 63] + "==")) : 2 === s2 && (t3 = (e3[n3 - 2] << 8) + e3[n3 - 1], i2.push(r2[t3 >> 10] + r2[t3 >> 4 & 63] + r2[t3 << 2 & 63] + "=")), i2.join("");
};
for (var r2 = [], n2 = [], s = "undefined" != typeof Uint8Array ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", o = 0, a = i.length; o < a; ++o) r2[o] = i[o], n2[i.charCodeAt(o)] = o;
function c(e3) {
var t3 = e3.length;
if (t3 % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r3 = e3.indexOf("=");
return -1 === r3 && (r3 = t3), [r3, r3 === t3 ? 0 : 4 - r3 % 4];
}
function u(e3, t3, n3) {
for (var s2, i2, o2 = [], a2 = t3; a2 < n3; a2 += 3) s2 = (e3[a2] << 16 & 16711680) + (e3[a2 + 1] << 8 & 65280) + (255 & e3[a2 + 2]), o2.push(r2[(i2 = s2) >> 18 & 63] + r2[i2 >> 12 & 63] + r2[i2 >> 6 & 63] + r2[63 & i2]);
return o2.join("");
}
n2["-".charCodeAt(0)] = 62, n2["_".charCodeAt(0)] = 63;
}, 8764: (e2, t2, r2) => {
"use strict";
const n2 = r2(9742), s = r2(645), i = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
t2.Buffer = c, t2.SlowBuffer = function(e3) {
return +e3 != e3 && (e3 = 0), c.alloc(+e3);
}, t2.INSPECT_MAX_BYTES = 50;
const o = 2147483647;
function a(e3) {
if (e3 > o) throw new RangeError('The value "' + e3 + '" is invalid for option "size"');
const t3 = new Uint8Array(e3);
return Object.setPrototypeOf(t3, c.prototype), t3;
}
function c(e3, t3, r3) {
if ("number" == typeof e3) {
if ("string" == typeof t3) throw new TypeError('The "string" argument must be of type string. Received type number');
return h(e3);
}
return u(e3, t3, r3);
}
function u(e3, t3, r3) {
if ("string" == typeof e3) return function(e4, t4) {
if ("string" == typeof t4 && "" !== t4 || (t4 = "utf8"), !c.isEncoding(t4)) throw new TypeError("Unknown encoding: " + t4);
const r4 = 0 | m(e4, t4);
let n4 = a(r4);
const s3 = n4.write(e4, t4);
return s3 !== r4 && (n4 = n4.slice(0, s3)), n4;
}(e3, t3);
if (ArrayBuffer.isView(e3)) return function(e4) {
if (q(e4, Uint8Array)) {
const t4 = new Uint8Array(e4);
return d(t4.buffer, t4.byteOffset, t4.byteLength);
}
return p(e4);
}(e3);
if (null == e3) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e3);
if (q(e3, ArrayBuffer) || e3 && q(e3.buffer, ArrayBuffer)) return d(e3, t3, r3);
if ("undefined" != typeof SharedArrayBuffer && (q(e3, SharedArrayBuffer) || e3 && q(e3.buffer, SharedArrayBuffer))) return d(e3, t3, r3);
if ("number" == typeof e3) throw new TypeError('The "value" argument must not be of type number. Received type number');
const n3 = e3.valueOf && e3.valueOf();
if (null != n3 && n3 !== e3) return c.from(n3, t3, r3);
const s2 = function(e4) {
if (c.isBuffer(e4)) {
const t4 = 0 | f(e4.length), r4 = a(t4);
return 0 === r4.length || e4.copy(r4, 0, 0, t4), r4;
}
return void 0 !== e4.length ? "number" != typeof e4.length || Z(e4.length) ? a(0) : p(e4) : "Buffer" === e4.type && Array.isArray(e4.data) ? p(e4.data) : void 0;
}(e3);
if (s2) return s2;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof e3[Symbol.toPrimitive]) return c.from(e3[Symbol.toPrimitive]("string"), t3, r3);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e3);
}
function l2(e3) {
if ("number" != typeof e3) throw new TypeError('"size" argument must be of type number');
if (e3 < 0) throw new RangeError('The value "' + e3 + '" is invalid for option "size"');
}
function h(e3) {
return l2(e3), a(e3 < 0 ? 0 : 0 | f(e3));
}
function p(e3) {
const t3 = e3.length < 0 ? 0 : 0 | f(e3.length), r3 = a(t3);
for (let n3 = 0; n3 < t3; n3 += 1) r3[n3] = 255 & e3[n3];
return r3;
}
function d(e3, t3, r3) {
if (t3 < 0 || e3.byteLength < t3) throw new RangeError('"offset" is outside of buffer bounds');
if (e3.byteLength < t3 + (r3 || 0)) throw new RangeError('"length" is outside of buffer bounds');
let n3;
return n3 = void 0 === t3 && void 0 === r3 ? new Uint8Array(e3) : void 0 === r3 ? new Uint8Array(e3, t3) : new Uint8Array(e3, t3, r3), Object.setPrototypeOf(n3, c.prototype), n3;
}
function f(e3) {
if (e3 >= o) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + o.toString(16) + " bytes");
return 0 | e3;
}
function m(e3, t3) {
if (c.isBuffer(e3)) return e3.length;
if (ArrayBuffer.isView(e3) || q(e3, ArrayBuffer)) return e3.byteLength;
if ("string" != typeof e3) throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof e3);
const r3 = e3.length, n3 = arguments.length > 2 && true === arguments[2];
if (!n3 && 0 === r3) return 0;
let s2 = false;
for (; ; ) switch (t3) {
case "ascii":
case "latin1":
case "binary":
return r3;
case "utf8":
case "utf-8":
return V(e3).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return 2 * r3;
case "hex":
return r3 >>> 1;
case "base64":
return $(e3).length;
default:
if (s2) return n3 ? -1 : V(e3).length;
t3 = ("" + t3).toLowerCase(), s2 = true;
}
}
function w(e3, t3, r3) {
let n3 = false;
if ((void 0 === t3 || t3 < 0) && (t3 = 0), t3 > this.length) return "";
if ((void 0 === r3 || r3 > this.length) && (r3 = this.length), r3 <= 0) return "";
if ((r3 >>>= 0) <= (t3 >>>= 0)) return "";
for (e3 || (e3 = "utf8"); ; ) switch (e3) {
case "hex":
return C(this, t3, r3);
case "utf8":
case "utf-8":
return S(this, t3, r3);
case "ascii":
return R(this, t3, r3);
case "latin1":
case "binary":
return N(this, t3, r3);
case "base64":
return A(this, t3, r3);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return O(this, t3, r3);
default:
if (n3) throw new TypeError("Unknown encoding: " + e3);
e3 = (e3 + "").toLowerCase(), n3 = true;
}
}
function g(e3, t3, r3) {
const n3 = e3[t3];
e3[t3] = e3[r3], e3[r3] = n3;
}
function y(e3, t3, r3, n3, s2) {
if (0 === e3.length) return -1;
if ("string" == typeof r3 ? (n3 = r3, r3 = 0) : r3 > 2147483647 ? r3 = 2147483647 : r3 < -2147483648 && (r3 = -2147483648), Z(r3 = +r3) && (r3 = s2 ? 0 : e3.length - 1), r3 < 0 && (r3 = e3.length + r3), r3 >= e3.length) {
if (s2) return -1;
r3 = e3.length - 1;
} else if (r3 < 0) {
if (!s2) return -1;
r3 = 0;
}
if ("string" == typeof t3 && (t3 = c.from(t3, n3)), c.isBuffer(t3)) return 0 === t3.length ? -1 : b(e3, t3, r3, n3, s2);
if ("number" == typeof t3) return t3 &= 255, "function" == typeof Uint8Array.prototype.indexOf ? s2 ? Uint8Array.prototype.indexOf.call(e3, t3, r3) : Uint8Array.prototype.lastIndexOf.call(e3, t3, r3) : b(e3, [t3], r3, n3, s2);
throw new TypeError("val must be string, number or Buffer");
}
function b(e3, t3, r3, n3, s2) {
let i2, o2 = 1, a2 = e3.length, c2 = t3.length;
if (void 0 !== n3 && ("ucs2" === (n3 = String(n3).toLowerCase()) || "ucs-2" === n3 || "utf16le" === n3 || "utf-16le" === n3)) {
if (e3.length < 2 || t3.length < 2) return -1;
o2 = 2, a2 /= 2, c2 /= 2, r3 /= 2;
}
function u2(e4, t4) {
return 1 === o2 ? e4[t4] : e4.readUInt16BE(t4 * o2);
}
if (s2) {
let n4 = -1;
for (i2 = r3; i2 < a2; i2++) if (u2(e3, i2) === u2(t3, -1 === n4 ? 0 : i2 - n4)) {
if (-1 === n4 && (n4 = i2), i2 - n4 + 1 === c2) return n4 * o2;
} else -1 !== n4 && (i2 -= i2 - n4), n4 = -1;
} else for (r3 + c2 > a2 && (r3 = a2 - c2), i2 = r3; i2 >= 0; i2--) {
let r4 = true;
for (let n4 = 0; n4 < c2; n4++) if (u2(e3, i2 + n4) !== u2(t3, n4)) {
r4 = false;
break;
}
if (r4) return i2;
}
return -1;
}
function x(e3, t3, r3, n3) {
r3 = Number(r3) || 0;
const s2 = e3.length - r3;
n3 ? (n3 = Number(n3)) > s2 && (n3 = s2) : n3 = s2;
const i2 = t3.length;
let o2;
for (n3 > i2 / 2 && (n3 = i2 / 2), o2 = 0; o2 < n3; ++o2) {
const n4 = parseInt(t3.substr(2 * o2, 2), 16);
if (Z(n4)) return o2;
e3[r3 + o2] = n4;
}
return o2;
}
function v(e3, t3, r3, n3) {
return X(V(t3, e3.length - r3), e3, r3, n3);
}
function _(e3, t3, r3, n3) {
return X(function(e4) {
const t4 = [];
for (let r4 = 0; r4 < e4.length; ++r4) t4.push(255 & e4.charCodeAt(r4));
return t4;
}(t3), e3, r3, n3);
}
function E(e3, t3, r3, n3) {
return X($(t3), e3, r3, n3);
}
function T(e3, t3, r3, n3) {
return X(function(e4, t4) {
let r4, n4, s2;
const i2 = [];
for (let o2 = 0; o2 < e4.length && !((t4 -= 2) < 0); ++o2) r4 = e4.charCodeAt(o2), n4 = r4 >> 8, s2 = r4 % 256, i2.push(s2), i2.push(n4);
return i2;
}(t3, e3.length - r3), e3, r3, n3);
}
function A(e3, t3, r3) {
return 0 === t3 && r3 === e3.length ? n2.fromByteArray(e3) : n2.fromByteArray(e3.slice(t3, r3));
}
function S(e3, t3, r3) {
r3 = Math.min(e3.length, r3);
const n3 = [];
let s2 = t3;
for (; s2 < r3; ) {
const t4 = e3[s2];
let i2 = null, o2 = t4 > 239 ? 4 : t4 > 223 ? 3 : t4 > 191 ? 2 : 1;
if (s2 + o2 <= r3) {
let r4, n4, a2, c2;
switch (o2) {
case 1:
t4 < 128 && (i2 = t4);
break;
case 2:
r4 = e3[s2 + 1], 128 == (192 & r4) && (c2 = (31 & t4) << 6 | 63 & r4, c2 > 127 && (i2 = c2));
break;
case 3:
r4 = e3[s2 + 1], n4 = e3[s2 + 2], 128 == (192 & r4) && 128 == (192 & n4) && (c2 = (15 & t4) << 12 | (63 & r4) << 6 | 63 & n4, c2 > 2047 && (c2 < 55296 || c2 > 57343) && (i2 = c2));
break;
case 4:
r4 = e3[s2 + 1], n4 = e3[s2 + 2], a2 = e3[s2 + 3], 128 == (192 & r4) && 128 == (192 & n4) && 128 == (192 & a2) && (c2 = (15 & t4) << 18 | (63 & r4) << 12 | (63 & n4) << 6 | 63 & a2, c2 > 65535 && c2 < 1114112 && (i2 = c2));
}
}
null === i2 ? (i2 = 65533, o2 = 1) : i2 > 65535 && (i2 -= 65536, n3.push(i2 >>> 10 & 1023 | 55296), i2 = 56320 | 1023 & i2), n3.push(i2), s2 += o2;
}
return function(e4) {
const t4 = e4.length;
if (t4 <= I) return String.fromCharCode.apply(String, e4);
let r4 = "", n4 = 0;
for (; n4 < t4; ) r4 += String.fromCharCode.apply(String, e4.slice(n4, n4 += I));
return r4;
}(n3);
}
t2.kMaxLength = o, c.TYPED_ARRAY_SUPPORT = function() {
try {
const e3 = new Uint8Array(1), t3 = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(t3, Uint8Array.prototype), Object.setPrototypeOf(e3, t3), 42 === e3.foo();
} catch (e3) {
return false;
}
}(), c.TYPED_ARRAY_SUPPORT || "undefined" == typeof console || "function" != typeof console.error || console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."), Object.defineProperty(c.prototype, "parent", { enumerable: true, get: function() {
if (c.isBuffer(this)) return this.buffer;
} }), Object.defineProperty(c.prototype, "offset", { enumerable: true, get: function() {
if (c.isBuffer(this)) return this.byteOffset;
} }), c.poolSize = 8192, c.from = function(e3, t3, r3) {
return u(e3, t3, r3);
}, Object.setPrototypeOf(c.prototype, Uint8Array.prototype), Object.setPrototypeOf(c, Uint8Array), c.alloc = function(e3, t3, r3) {
return function(e4, t4, r4) {
return l2(e4), e4 <= 0 ? a(e4) : void 0 !== t4 ? "string" == typeof r4 ? a(e4).fill(t4, r4) : a(e4).fill(t4) : a(e4);
}(e3, t3, r3);
}, c.allocUnsafe = function(e3) {
return h(e3);
}, c.allocUnsafeSlow = function(e3) {
return h(e3);
}, c.isBuffer = function(e3) {
return null != e3 && true === e3._isBuffer && e3 !== c.prototype;
}, c.compare = function(e3, t3) {
if (q(e3, Uint8Array) && (e3 = c.from(e3, e3.offset, e3.byteLength)), q(t3, Uint8Array) && (t3 = c.from(t3, t3.offset, t3.byteLength)), !c.isBuffer(e3) || !c.isBuffer(t3)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
if (e3 === t3) return 0;
let r3 = e3.length, n3 = t3.length;
for (let s2 = 0, i2 = Math.min(r3, n3); s2 < i2; ++s2) if (e3[s2] !== t3[s2]) {
r3 = e3[s2], n3 = t3[s2];
break;
}
return r3 < n3 ? -1 : n3 < r3 ? 1 : 0;
}, c.isEncoding = function(e3) {
switch (String(e3).toLowerCase()) {
case "hex":
case "utf8":
case "utf-8":
case "ascii":
case "latin1":
case "binary":
case "base64":
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return true;
default:
return false;
}
}, c.concat = function(e3, t3) {
if (!Array.isArray(e3)) throw new TypeError('"list" argument must be an Array of Buffers');
if (0 === e3.length) return c.alloc(0);
let r3;
if (void 0 === t3) for (t3 = 0, r3 = 0; r3 < e3.length; ++r3) t3 += e3[r3].length;
const n3 = c.allocUnsafe(t3);
let s2 = 0;
for (r3 = 0; r3 < e3.length; ++r3) {
let t4 = e3[r3];
if (q(t4, Uint8Array)) s2 + t4.length > n3.length ? (c.isBuffer(t4) || (t4 = c.from(t4)), t4.copy(n3, s2)) : Uint8Array.prototype.set.call(n3, t4, s2);
else {
if (!c.isBuffer(t4)) throw new TypeError('"list" argument must be an Array of Buffers');
t4.copy(n3, s2);
}
s2 += t4.length;
}
return n3;
}, c.byteLength = m, c.prototype._isBuffer = true, c.prototype.swap16 = function() {
const e3 = this.length;
if (e3 % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let t3 = 0; t3 < e3; t3 += 2) g(this, t3, t3 + 1);
return this;
}, c.prototype.swap32 = function() {
const e3 = this.length;
if (e3 % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let t3 = 0; t3 < e3; t3 += 4) g(this, t3, t3 + 3), g(this, t3 + 1, t3 + 2);
return this;
}, c.prototype.swap64 = function() {
const e3 = this.length;
if (e3 % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let t3 = 0; t3 < e3; t3 += 8) g(this, t3, t3 + 7), g(this, t3 + 1, t3 + 6), g(this, t3 + 2, t3 + 5), g(this, t3 + 3, t3 + 4);
return this;
}, c.prototype.toString = function() {
const e3 = this.length;
return 0 === e3 ? "" : 0 === arguments.length ? S(this, 0, e3) : w.apply(this, arguments);
}, c.prototype.toLocaleString = c.prototype.toString, c.prototype.equals = function(e3) {
if (!c.isBuffer(e3)) throw new TypeError("Argument must be a Buffer");
return this === e3 || 0 === c.compare(this, e3);
}, c.prototype.inspect = function() {
let e3 = "";
const r3 = t2.INSPECT_MAX_BYTES;
return e3 = this.toString("hex", 0, r3).replace(/(.{2})/g, "$1 ").trim(), this.length > r3 && (e3 += " ... "), "<Buffer " + e3 + ">";
}, i && (c.prototype[i] = c.prototype.inspect), c.prototype.compare = function(e3, t3, r3, n3, s2) {
if (q(e3, Uint8Array) && (e3 = c.from(e3, e3.offset, e3.byteLength)), !c.isBuffer(e3)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof e3);
if (void 0 === t3 && (t3 = 0), void 0 === r3 && (r3 = e3 ? e3.length : 0), void 0 === n3 && (n3 = 0), void 0 === s2 && (s2 = this.length), t3 < 0 || r3 > e3.length || n3 < 0 || s2 > this.length) throw new RangeError("out of range index");
if (n3 >= s2 && t3 >= r3) return 0;
if (n3 >= s2) return -1;
if (t3 >= r3) return 1;
if (this === e3) return 0;
let i2 = (s2 >>>= 0) - (n3 >>>= 0), o2 = (r3 >>>= 0) - (t3 >>>= 0);
const a2 = Math.min(i2, o2), u2 = this.slice(n3, s2), l3 = e3.slice(t3, r3);
for (let e4 = 0; e4 < a2; ++e4) if (u2[e4] !== l3[e4]) {
i2 = u2[e4], o2 = l3[e4];
break;
}
return i2 < o2 ? -1 : o2 < i2 ? 1 : 0;
}, c.prototype.includes = function(e3, t3, r3) {
return -1 !== this.indexOf(e3, t3, r3);
}, c.prototype.indexOf = function(e3, t3, r3) {
return y(this, e3, t3, r3, true);
}, c.prototype.lastIndexOf = function(e3, t3, r3) {
return y(this, e3, t3, r3, false);
}, c.prototype.write = function(e3, t3, r3, n3) {
if (void 0 === t3) n3 = "utf8", r3 = this.length, t3 = 0;
else if (void 0 === r3 && "string" == typeof t3) n3 = t3, r3 = this.length, t3 = 0;
else {
if (!isFinite(t3)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
t3 >>>= 0, isFinite(r3) ? (r3 >>>= 0, void 0 === n3 && (n3 = "utf8")) : (n3 = r3, r3 = void 0);
}
const s2 = this.length - t3;
if ((void 0 === r3 || r3 > s2) && (r3 = s2), e3.length > 0 && (r3 < 0 || t3 < 0) || t3 > this.length) throw new RangeError("Attempt to write outside buffer bounds");
n3 || (n3 = "utf8");
let i2 = false;
for (; ; ) switch (n3) {
case "hex":
return x(this, e3, t3, r3);
case "utf8":
case "utf-8":
return v(this, e3, t3, r3);
case "ascii":
case "latin1":
case "binary":
return _(this, e3, t3, r3);
case "base64":
return E(this, e3, t3, r3);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return T(this, e3, t3, r3);
default:
if (i2) throw new TypeError("Unknown encoding: " + n3);
n3 = ("" + n3).toLowerCase(), i2 = true;
}
}, c.prototype.toJSON = function() {
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
};
const I = 4096;
function R(e3, t3, r3) {
let n3 = "";
r3 = Math.min(e3.length, r3);
for (let s2 = t3; s2 < r3; ++s2) n3 += String.fromCharCode(127 & e3[s2]);
return n3;
}
function N(e3, t3, r3) {
let n3 = "";
r3 = Math.min(e3.length, r3);
for (let s2 = t3; s2 < r3; ++s2) n3 += String.fromCharCode(e3[s2]);
return n3;
}
function C(e3, t3, r3) {
const n3 = e3.length;
(!t3 || t3 < 0) && (t3 = 0), (!r3 || r3 < 0 || r3 > n3) && (r3 = n3);
let s2 = "";
for (let n4 = t3; n4 < r3; ++n4) s2 += Y[e3[n4]];
return s2;
}
function O(e3, t3, r3) {
const n3 = e3.slice(t3, r3);
let s2 = "";
for (let e4 = 0; e4 < n3.length - 1; e4 += 2) s2 += String.fromCharCode(n3[e4] + 256 * n3[e4 + 1]);
return s2;
}
function k(e3, t3, r3) {
if (e3 % 1 != 0 || e3 < 0) throw new RangeError("offset is not uint");
if (e3 + t3 > r3) throw new RangeError("Trying to access beyond buffer length");
}
function L(e3, t3, r3, n3, s2, i2) {
if (!c.isBuffer(e3)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (t3 > s2 || t3 < i2) throw new RangeError('"value" argument is out of bounds');
if (r3 + n3 > e3.length) throw new RangeError("Index out of range");
}
function D(e3, t3, r3, n3, s2) {
j(t3, n3, s2, e3, r3, 7);
let i2 = Number(t3 & BigInt(4294967295));
e3[r3++] = i2, i2 >>= 8, e3[r3++] = i2, i2 >>= 8, e3[r3++] = i2, i2 >>= 8, e3[r3++] = i2;
let o2 = Number(t3 >> BigInt(32) & BigInt(4294967295));
return e3[r3++] = o2, o2 >>= 8, e3[r3++] = o2, o2 >>= 8, e3[r3++] = o2, o2 >>= 8, e3[r3++] = o2, r3;
}
function P(e3, t3, r3, n3, s2) {
j(t3, n3, s2, e3, r3, 7);
let i2 = Number(t3 & BigInt(4294967295));
e3[r3 + 7] = i2, i2 >>= 8, e3[r3 + 6] = i2, i2 >>= 8, e3[r3 + 5] = i2, i2 >>= 8, e3[r3 + 4] = i2;
let o2 = Number(t3 >> BigInt(32) & BigInt(4294967295));
return e3[r3 + 3] = o2, o2 >>= 8, e3[r3 + 2] = o2, o2 >>= 8, e3[r3 + 1] = o2, o2 >>= 8, e3[r3] = o2, r3 + 8;
}
function F(e3, t3, r3, n3, s2, i2) {
if (r3 + n3 > e3.length) throw new RangeError("Index out of range");
if (r3 < 0) throw new RangeError("Index out of range");
}
function B(e3, t3, r3, n3, i2) {
return t3 = +t3, r3 >>>= 0, i2 || F(e3, 0, r3, 4), s.write(e3, t3, r3, n3, 23, 4), r3 + 4;
}
function M(e3, t3, r3, n3, i2) {
return t3 = +t3, r3 >>>= 0, i2 || F(e3, 0, r3, 8), s.write(e3, t3, r3, n3, 52, 8), r3 + 8;
}
c.prototype.slice = function(e3, t3) {
const r3 = this.length;
(e3 = ~~e3) < 0 ? (e3 += r3) < 0 && (e3 = 0) : e3 > r3 && (e3 = r3), (t3 = void 0 === t3 ? r3 : ~~t3) < 0 ? (t3 += r3) < 0 && (t3 = 0) : t3 > r3 && (t3 = r3), t3 < e3 && (t3 = e3);
const n3 = this.subarray(e3, t3);
return Object.setPrototypeOf(n3, c.prototype), n3;
}, c.prototype.readUintLE = c.prototype.readUIntLE = function(e3, t3, r3) {
e3 >>>= 0, t3 >>>= 0, r3 || k(e3, t3, this.length);
let n3 = this[e3], s2 = 1, i2 = 0;
for (; ++i2 < t3 && (s2 *= 256); ) n3 += this[e3 + i2] * s2;
return n3;
}, c.prototype.readUintBE = c.prototype.readUIntBE = function(e3, t3, r3) {
e3 >>>= 0, t3 >>>= 0, r3 || k(e3, t3, this.length);
let n3 = this[e3 + --t3], s2 = 1;
for (; t3 > 0 && (s2 *= 256); ) n3 += this[e3 + --t3] * s2;
return n3;
}, c.prototype.readUint8 = c.prototype.readUInt8 = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 1, this.length), this[e3];
}, c.prototype.readUint16LE = c.prototype.readUInt16LE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 2, this.length), this[e3] | this[e3 + 1] << 8;
}, c.prototype.readUint16BE = c.prototype.readUInt16BE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 2, this.length), this[e3] << 8 | this[e3 + 1];
}, c.prototype.readUint32LE = c.prototype.readUInt32LE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), (this[e3] | this[e3 + 1] << 8 | this[e3 + 2] << 16) + 16777216 * this[e3 + 3];
}, c.prototype.readUint32BE = c.prototype.readUInt32BE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), 16777216 * this[e3] + (this[e3 + 1] << 16 | this[e3 + 2] << 8 | this[e3 + 3]);
}, c.prototype.readBigUInt64LE = J(function(e3) {
W(e3 >>>= 0, "offset");
const t3 = this[e3], r3 = this[e3 + 7];
void 0 !== t3 && void 0 !== r3 || K(e3, this.length - 8);
const n3 = t3 + 256 * this[++e3] + 65536 * this[++e3] + this[++e3] * 2 ** 24, s2 = this[++e3] + 256 * this[++e3] + 65536 * this[++e3] + r3 * 2 ** 24;
return BigInt(n3) + (BigInt(s2) << BigInt(32));
}), c.prototype.readBigUInt64BE = J(function(e3) {
W(e3 >>>= 0, "offset");
const t3 = this[e3], r3 = this[e3 + 7];
void 0 !== t3 && void 0 !== r3 || K(e3, this.length - 8);
const n3 = t3 * 2 ** 24 + 65536 * this[++e3] + 256 * this[++e3] + this[++e3], s2 = this[++e3] * 2 ** 24 + 65536 * this[++e3] + 256 * this[++e3] + r3;
return (BigInt(n3) << BigInt(32)) + BigInt(s2);
}), c.prototype.readIntLE = function(e3, t3, r3) {
e3 >>>= 0, t3 >>>= 0, r3 || k(e3, t3, this.length);
let n3 = this[e3], s2 = 1, i2 = 0;
for (; ++i2 < t3 && (s2 *= 256); ) n3 += this[e3 + i2] * s2;
return s2 *= 128, n3 >= s2 && (n3 -= Math.pow(2, 8 * t3)), n3;
}, c.prototype.readIntBE = function(e3, t3, r3) {
e3 >>>= 0, t3 >>>= 0, r3 || k(e3, t3, this.length);
let n3 = t3, s2 = 1, i2 = this[e3 + --n3];
for (; n3 > 0 && (s2 *= 256); ) i2 += this[e3 + --n3] * s2;
return s2 *= 128, i2 >= s2 && (i2 -= Math.pow(2, 8 * t3)), i2;
}, c.prototype.readInt8 = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 1, this.length), 128 & this[e3] ? -1 * (255 - this[e3] + 1) : this[e3];
}, c.prototype.readInt16LE = function(e3, t3) {
e3 >>>= 0, t3 || k(e3, 2, this.length);
const r3 = this[e3] | this[e3 + 1] << 8;
return 32768 & r3 ? 4294901760 | r3 : r3;
}, c.prototype.readInt16BE = function(e3, t3) {
e3 >>>= 0, t3 || k(e3, 2, this.length);
const r3 = this[e3 + 1] | this[e3] << 8;
return 32768 & r3 ? 4294901760 | r3 : r3;
}, c.prototype.readInt32LE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), this[e3] | this[e3 + 1] << 8 | this[e3 + 2] << 16 | this[e3 + 3] << 24;
}, c.prototype.readInt32BE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), this[e3] << 24 | this[e3 + 1] << 16 | this[e3 + 2] << 8 | this[e3 + 3];
}, c.prototype.readBigInt64LE = J(function(e3) {
W(e3 >>>= 0, "offset");
const t3 = this[e3], r3 = this[e3 + 7];
void 0 !== t3 && void 0 !== r3 || K(e3, this.length - 8);
const n3 = this[e3 + 4] + 256 * this[e3 + 5] + 65536 * this[e3 + 6] + (r3 << 24);
return (BigInt(n3) << BigInt(32)) + BigInt(t3 + 256 * this[++e3] + 65536 * this[++e3] + this[++e3] * 2 ** 24);
}), c.prototype.readBigInt64BE = J(function(e3) {
W(e3 >>>= 0, "offset");
const t3 = this[e3], r3 = this[e3 + 7];
void 0 !== t3 && void 0 !== r3 || K(e3, this.length - 8);
const n3 = (t3 << 24) + 65536 * this[++e3] + 256 * this[++e3] + this[++e3];
return (BigInt(n3) << BigInt(32)) + BigInt(this[++e3] * 2 ** 24 + 65536 * this[++e3] + 256 * this[++e3] + r3);
}), c.prototype.readFloatLE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), s.read(this, e3, true, 23, 4);
}, c.prototype.readFloatBE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 4, this.length), s.read(this, e3, false, 23, 4);
}, c.prototype.readDoubleLE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 8, this.length), s.read(this, e3, true, 52, 8);
}, c.prototype.readDoubleBE = function(e3, t3) {
return e3 >>>= 0, t3 || k(e3, 8, this.length), s.read(this, e3, false, 52, 8);
}, c.prototype.writeUintLE = c.prototype.writeUIntLE = function(e3, t3, r3, n3) {
e3 = +e3, t3 >>>= 0, r3 >>>= 0, n3 || L(this, e3, t3, r3, Math.pow(2, 8 * r3) - 1, 0);
let s2 = 1, i2 = 0;
for (this[t3] = 255 & e3; ++i2 < r3 && (s2 *= 256); ) this[t3 + i2] = e3 / s2 & 255;
return t3 + r3;
}, c.prototype.writeUintBE = c.prototype.writeUIntBE = function(e3, t3, r3, n3) {
e3 = +e3, t3 >>>= 0, r3 >>>= 0, n3 || L(this, e3, t3, r3, Math.pow(2, 8 * r3) - 1, 0);
let s2 = r3 - 1, i2 = 1;
for (this[t3 + s2] = 255 & e3; --s2 >= 0 && (i2 *= 256); ) this[t3 + s2] = e3 / i2 & 255;
return t3 + r3;
}, c.prototype.writeUint8 = c.prototype.writeUInt8 = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 1, 255, 0), this[t3] = 255 & e3, t3 + 1;
}, c.prototype.writeUint16LE = c.prototype.writeUInt16LE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 2, 65535, 0), this[t3] = 255 & e3, this[t3 + 1] = e3 >>> 8, t3 + 2;
}, c.prototype.writeUint16BE = c.prototype.writeUInt16BE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 2, 65535, 0), this[t3] = e3 >>> 8, this[t3 + 1] = 255 & e3, t3 + 2;
}, c.prototype.writeUint32LE = c.prototype.writeUInt32LE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 4, 4294967295, 0), this[t3 + 3] = e3 >>> 24, this[t3 + 2] = e3 >>> 16, this[t3 + 1] = e3 >>> 8, this[t3] = 255 & e3, t3 + 4;
}, c.prototype.writeUint32BE = c.prototype.writeUInt32BE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 4, 4294967295, 0), this[t3] = e3 >>> 24, this[t3 + 1] = e3 >>> 16, this[t3 + 2] = e3 >>> 8, this[t3 + 3] = 255 & e3, t3 + 4;
}, c.prototype.writeBigUInt64LE = J(function(e3, t3 = 0) {
return D(this, e3, t3, BigInt(0), BigInt("0xffffffffffffffff"));
}), c.prototype.writeBigUInt64BE = J(function(e3, t3 = 0) {
return P(this, e3, t3, BigInt(0), BigInt("0xffffffffffffffff"));
}), c.prototype.writeIntLE = function(e3, t3, r3, n3) {
if (e3 = +e3, t3 >>>= 0, !n3) {
const n4 = Math.pow(2, 8 * r3 - 1);
L(this, e3, t3, r3, n4 - 1, -n4);
}
let s2 = 0, i2 = 1, o2 = 0;
for (this[t3] = 255 & e3; ++s2 < r3 && (i2 *= 256); ) e3 < 0 && 0 === o2 && 0 !== this[t3 + s2 - 1] && (o2 = 1), this[t3 + s2] = (e3 / i2 >> 0) - o2 & 255;
return t3 + r3;
}, c.prototype.writeIntBE = function(e3, t3, r3, n3) {
if (e3 = +e3, t3 >>>= 0, !n3) {
const n4 = Math.pow(2, 8 * r3 - 1);
L(this, e3, t3, r3, n4 - 1, -n4);
}
let s2 = r3 - 1, i2 = 1, o2 = 0;
for (this[t3 + s2] = 255 & e3; --s2 >= 0 && (i2 *= 256); ) e3 < 0 && 0 === o2 && 0 !== this[t3 + s2 + 1] && (o2 = 1), this[t3 + s2] = (e3 / i2 >> 0) - o2 & 255;
return t3 + r3;
}, c.prototype.writeInt8 = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 1, 127, -128), e3 < 0 && (e3 = 255 + e3 + 1), this[t3] = 255 & e3, t3 + 1;
}, c.prototype.writeInt16LE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 2, 32767, -32768), this[t3] = 255 & e3, this[t3 + 1] = e3 >>> 8, t3 + 2;
}, c.prototype.writeInt16BE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 2, 32767, -32768), this[t3] = e3 >>> 8, this[t3 + 1] = 255 & e3, t3 + 2;
}, c.prototype.writeInt32LE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 4, 2147483647, -2147483648), this[t3] = 255 & e3, this[t3 + 1] = e3 >>> 8, this[t3 + 2] = e3 >>> 16, this[t3 + 3] = e3 >>> 24, t3 + 4;
}, c.prototype.writeInt32BE = function(e3, t3, r3) {
return e3 = +e3, t3 >>>= 0, r3 || L(this, e3, t3, 4, 2147483647, -2147483648), e3 < 0 && (e3 = 4294967295 + e3 + 1), this[t3] = e3 >>> 24, this[t3 + 1] = e3 >>> 16, this[t3 + 2] = e3 >>> 8, this[t3 + 3] = 255 & e3, t3 + 4;
}, c.prototype.writeBigInt64LE = J(function(e3, t3 = 0) {
return D(this, e3, t3, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), c.prototype.writeBigInt64BE = J(function(e3, t3 = 0) {
return P(this, e3, t3, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), c.prototype.writeFloatLE = function(e3, t3, r3) {
return B(this, e3, t3, true, r3);
}, c.prototype.writeFloatBE = function(e3, t3, r3) {
return B(this, e3, t3, false, r3);
}, c.prototype.writeDoubleLE = function(e3, t3, r3) {
return M(this, e3, t3, true, r3);
}, c.prototype.writeDoubleBE = function(e3, t3, r3) {
return M(this, e3, t3, false, r3);
}, c.prototype.copy = function(e3, t3, r3, n3) {
if (!c.isBuffer(e3)) throw new TypeError("argument should be a Buffer");
if (r3 || (r3 = 0), n3 || 0 === n3 || (n3 = this.length), t3 >= e3.length && (t3 = e3.length), t3 || (t3 = 0), n3 > 0 && n3 < r3 && (n3 = r3), n3 === r3) return 0;
if (0 === e3.length || 0 === this.length) return 0;
if (t3 < 0) throw new RangeError("targetStart out of bounds");
if (r3 < 0 || r3 >= this.length) throw new RangeError("Index out of range");
if (n3 < 0) throw new RangeError("sourceEnd out of bounds");
n3 > this.length && (n3 = this.length), e3.length - t3 < n3 - r3 && (n3 = e3.length - t3 + r3);
const s2 = n3 - r3;
return this === e3 && "function" == typeof Uint8Array.prototype.copyWithin ? this.copyWithin(t3, r3, n3) : Uint8Array.prototype.set.call(e3, this.subarray(r3, n3), t3), s2;
}, c.prototype.fill = function(e3, t3, r3, n3) {
if ("string" == typeof e3) {
if ("string" == typeof t3 ? (n3 = t3, t3 = 0, r3 = this.length) : "string" == typeof r3 && (n3 = r3, r3 = this.length), void 0 !== n3 && "string" != typeof n3) throw new TypeError("encoding must be a string");
if ("string" == typeof n3 && !c.isEncoding(n3)) throw new TypeError("Unknown encoding: " + n3);
if (1 === e3.length) {
const t4 = e3.charCodeAt(0);
("utf8" === n3 && t4 < 128 || "latin1" === n3) && (e3 = t4);
}
} else "number" == typeof e3 ? e3 &= 255 : "boolean" == typeof e3 && (e3 = Number(e3));
if (t3 < 0 || this.length < t3 || this.length < r3) throw new RangeError("Out of range index");
if (r3 <= t3) return this;
let s2;
if (t3 >>>= 0, r3 = void 0 === r3 ? this.length : r3 >>> 0, e3 || (e3 = 0), "number" == typeof e3) for (s2 = t3; s2 < r3; ++s2) this[s2] = e3;
else {
const i2 = c.isBuffer(e3) ? e3 : c.from(e3, n3), o2 = i2.length;
if (0 === o2) throw new TypeError('The value "' + e3 + '" is invalid for argument "value"');
for (s2 = 0; s2 < r3 - t3; ++s2) this[s2 + t3] = i2[s2 % o2];
}
return this;
};
const U = {};
function H(e3, t3, r3) {
U[e3] = class extends r3 {
constructor() {
super(), Object.defineProperty(this, "message", { value: t3.apply(this, arguments), writable: true, configurable: true }), this.name = `${this.name} [${e3}]`, this.stack, delete this.name;
}
get code() {
return e3;
}
set code(e4) {
Object.defineProperty(this, "code", { configurable: true, enumerable: true, value: e4, writable: true });
}
toString() {
return `${this.name} [${e3}]: ${this.message}`;
}
};
}
function z(e3) {
let t3 = "", r3 = e3.length;
const n3 = "-" === e3[0] ? 1 : 0;
for (; r3 >= n3 + 4; r3 -= 3) t3 = `_${e3.slice(r3 - 3, r3)}${t3}`;
return `${e3.slice(0, r3)}${t3}`;
}
function j(e3, t3, r3, n3, s2, i2) {
if (e3 > r3 || e3 < t3) {
const n4 = "bigint" == typeof t3 ? "n" : "";
let s3;
throw s3 = i2 > 3 ? 0 === t3 || t3 === BigInt(0) ? `>= 0${n4} and < 2${n4} ** ${8 * (i2 + 1)}${n4}` : `>= -(2${n4} ** ${8 * (i2 + 1) - 1}${n4}) and < 2 ** ${8 * (i2 + 1) - 1}${n4}` : `>= ${t3}${n4} and <= ${r3}${n4}`, new U.ERR_OUT_OF_RANGE("value", s3, e3);
}
!function(e4, t4, r4) {
W(t4, "offset"), void 0 !== e4[t4] && void 0 !== e4[t4 + r4] || K(t4, e4.length - (r4 + 1));
}(n3, s2, i2);
}
function W(e3, t3) {
if ("number" != typeof e3) throw new U.ERR_INVALID_ARG_TYPE(t3, "number", e3);
}
function K(e3, t3, r3) {
if (Math.floor(e3) !== e3) throw W(e3, r3), new U.ERR_OUT_OF_RANGE(r3 || "offset", "an integer", e3);
if (t3 < 0) throw new U.ERR_BUFFER_OUT_OF_BOUNDS();
throw new U.ERR_OUT_OF_RANGE(r3 || "offset", `>= ${r3 ? 1 : 0} and <= ${t3}`, e3);
}
H("ERR_BUFFER_OUT_OF_BOUNDS", function(e3) {
return e3 ? `${e3} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
}, RangeError), H("ERR_INVALID_ARG_TYPE", function(e3, t3) {
return `The "${e3}" argument must be of type number. Received type ${typeof t3}`;
}, TypeError), H("ERR_OUT_OF_RANGE", function(e3, t3, r3) {
let n3 = `The value of "${e3}" is out of range.`, s2 = r3;
return Number.isInteger(r3) && Math.abs(r3) > 2 ** 32 ? s2 = z(String(r3)) : "bigint" == typeof r3 && (s2 = String(r3), (r3 > BigInt(2) ** BigInt(32) || r3 < -(BigInt(2) ** BigInt(32))) && (s2 = z(s2)), s2 += "n"), n3 += ` It must be ${t3}. Received ${s2}`, n3;
}, RangeError);
const G = /[^+/0-9A-Za-z-_]/g;
function V(e3, t3) {
let r3;
t3 = t3 || 1 / 0;
const n3 = e3.length;
let s2 = null;
const i2 = [];
for (let o2 = 0; o2 < n3; ++o2) {
if (r3 = e3.charCodeAt(o2), r3 > 55295 && r3 < 57344) {
if (!s2) {
if (r3 > 56319) {
(t3 -= 3) > -1 && i2.push(239, 191, 189);
continue;
}
if (o2 + 1 === n3) {
(t3 -= 3) > -1 && i2.push(239, 191, 189);
continue;
}
s2 = r3;
continue;
}
if (r3 < 56320) {
(t3 -= 3) > -1 && i2.push(239, 191, 189), s2 = r3;
continue;
}
r3 = 65536 + (s2 - 55296 << 10 | r3 - 56320);
} else s2 && (t3 -= 3) > -1 && i2.push(239, 191, 189);
if (s2 = null, r3 < 128) {
if ((t3 -= 1) < 0) break;
i2.push(r3);
} else if (r3 < 2048) {
if ((t3 -= 2) < 0) break;
i2.push(r3 >> 6 | 192, 63 & r3 | 128);
} else if (r3 < 65536) {
if ((t3 -= 3) < 0) break;
i2.push(r3 >> 12 | 224, r3 >> 6 & 63 | 128, 63 & r3 | 128);
} else {
if (!(r3 < 1114112)) throw new Error("Invalid code point");
if ((t3 -= 4) < 0) break;
i2.push(r3 >> 18 | 240, r3 >> 12 & 63 | 128, r3 >> 6 & 63 | 128, 63 & r3 | 128);
}
}
return i2;
}
function $(e3) {
return n2.toByteArray(function(e4) {
if ((e4 = (e4 = e4.split("=")[0]).trim().replace(G, "")).length < 2) return "";
for (; e4.length % 4 != 0; ) e4 += "=";
return e4;
}(e3));
}
function X(e3, t3, r3, n3) {
let s2;
for (s2 = 0; s2 < n3 && !(s2 + r3 >= t3.length || s2 >= e3.length); ++s2) t3[s2 + r3] = e3[s2];
return s2;
}
function q(e3, t3) {
return e3 instanceof t3 || null != e3 && null != e3.constructor && null != e3.constructor.name && e3.constructor.name === t3.name;
}
function Z(e3) {
return e3 != e3;
}
const Y = function() {
const e3 = "0123456789abcdef", t3 = new Array(256);
for (let r3 = 0; r3 < 16; ++r3) {
const n3 = 16 * r3;
for (let s2 = 0; s2 < 16; ++s2) t3[n3 + s2] = e3[r3] + e3[s2];
}
return t3;
}();
function J(e3) {
return "undefined" == typeof BigInt ? Q : e3;
}
function Q() {
throw new Error("BigInt not supported");
}
}, 7187: (e2) => {
"use strict";
var t2, r2 = "object" == typeof Reflect ? Reflect : null, n2 = r2 && "function" == typeof r2.apply ? r2.apply : function(e3, t3, r3) {
return Function.prototype.apply.call(e3, t3, r3);
};
t2 = r2 && "function" == typeof r2.ownKeys ? r2.ownKeys : Object.getOwnPropertySymbols ? function(e3) {
return Object.getOwnPropertyNames(e3).concat(Object.getOwnPropertySymbols(e3));
} : function(e3) {
return Object.getOwnPropertyNames(e3);
};
var s = Number.isNaN || function(e3) {
return e3 != e3;
};
function i() {
i.init.call(this);
}
e2.exports = i, e2.exports.once = function(e3, t3) {
return new Promise(function(r3, n3) {
function s2(r4) {
e3.removeListener(t3, i2), n3(r4);
}
function i2() {
"function" == typeof e3.removeListener && e3.removeListener("error", s2), r3([].slice.call(arguments));
}
m(e3, t3, i2, { once: true }), "error" !== t3 && function(e4, t4, r4) {
"function" == typeof e4.on && m(e4, "error", t4, { once: true });
}(e3, s2);
});
}, i.EventEmitter = i, i.prototype._events = void 0, i.prototype._eventsCount = 0, i.prototype._maxListeners = void 0;
var o = 10;
function a(e3) {
if ("function" != typeof e3) throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e3);
}
function c(e3) {
return void 0 === e3._maxListeners ? i.defaultMaxListeners : e3._maxListeners;
}
function u(e3, t3, r3, n3) {
var s2, i2, o2, u2;
if (a(r3), void 0 === (i2 = e3._events) ? (i2 = e3._events = /* @__PURE__ */ Object.create(null), e3._eventsCount = 0) : (void 0 !== i2.newListener && (e3.emit("newListener", t3, r3.listener ? r3.listener : r3), i2 = e3._events), o2 = i2[t3]), void 0 === o2) o2 = i2[t3] = r3, ++e3._eventsCount;
else if ("function" == typeof o2 ? o2 = i2[t3] = n3 ? [r3, o2] : [o2, r3] : n3 ? o2.unshift(r3) : o2.push(r3), (s2 = c(e3)) > 0 && o2.length > s2 && !o2.warned) {
o2.warned = true;
var l3 = new Error("Possible EventEmitter memory leak detected. " + o2.length + " " + String(t3) + " listeners added. Use emitter.setMaxListeners() to increase limit");
l3.name = "MaxListenersExceededWarning", l3.emitter = e3, l3.type = t3, l3.count = o2.length, u2 = l3, console && console.warn && console.warn(u2);
}
return e3;
}
function l2() {
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 === arguments.length ? this.listener.call(this.target) : this.listener