@seven.io/client
Version:
Official API client for seven
1,170 lines (1,169 loc) • 989 kB
JavaScript
import { p as process$1, B as Buffer } from "./index-DoAeX2iN.js";
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, cryptoBrowserify = {}, browser$b = { exports: {} }, safeBuffer$2 = { exports: {} }, dist = {}, hasRequiredDist;
function requireDist() {
return hasRequiredDist || (hasRequiredDist = 1, (function(M) {
Object.defineProperties(M, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
var R = {}, I = {};
I.byteLength = d, I.toByteArray = w, I.fromByteArray = S;
for (var c = [], B = [], a = typeof Uint8Array < "u" ? Uint8Array : Array, g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", v = 0, p = g.length; v < p; ++v)
c[v] = g[v], B[g.charCodeAt(v)] = v;
B[45] = 62, B[95] = 63;
function y($) {
var F = $.length;
if (F % 4 > 0)
throw new Error("Invalid string. Length must be a multiple of 4");
var D = $.indexOf("=");
D === -1 && (D = F);
var z = D === F ? 0 : 4 - D % 4;
return [D, z];
}
function d($) {
var F = y($), D = F[0], z = F[1];
return (D + z) * 3 / 4 - z;
}
function b($, F, D) {
return (F + D) * 3 / 4 - D;
}
function w($) {
var F, D = y($), z = D[0], Z = D[1], Y = new a(b($, z, Z)), ee = 0, V = Z > 0 ? z - 4 : z, ne;
for (ne = 0; ne < V; ne += 4)
F = B[$.charCodeAt(ne)] << 18 | B[$.charCodeAt(ne + 1)] << 12 | B[$.charCodeAt(ne + 2)] << 6 | B[$.charCodeAt(ne + 3)], Y[ee++] = F >> 16 & 255, Y[ee++] = F >> 8 & 255, Y[ee++] = F & 255;
return Z === 2 && (F = B[$.charCodeAt(ne)] << 2 | B[$.charCodeAt(ne + 1)] >> 4, Y[ee++] = F & 255), Z === 1 && (F = B[$.charCodeAt(ne)] << 10 | B[$.charCodeAt(ne + 1)] << 4 | B[$.charCodeAt(ne + 2)] >> 2, Y[ee++] = F >> 8 & 255, Y[ee++] = F & 255), Y;
}
function _($) {
return c[$ >> 18 & 63] + c[$ >> 12 & 63] + c[$ >> 6 & 63] + c[$ & 63];
}
function q($, F, D) {
for (var z, Z = [], Y = F; Y < D; Y += 3)
z = ($[Y] << 16 & 16711680) + ($[Y + 1] << 8 & 65280) + ($[Y + 2] & 255), Z.push(_(z));
return Z.join("");
}
function S($) {
for (var F, D = $.length, z = D % 3, Z = [], Y = 16383, ee = 0, V = D - z; ee < V; ee += Y)
Z.push(q($, ee, ee + Y > V ? V : ee + Y));
return z === 1 ? (F = $[D - 1], Z.push(
c[F >> 2] + c[F << 4 & 63] + "=="
)) : z === 2 && (F = ($[D - 2] << 8) + $[D - 1], Z.push(
c[F >> 10] + c[F >> 4 & 63] + c[F << 2 & 63] + "="
)), Z.join("");
}
var P = {};
P.read = function($, F, D, z, Z) {
var Y, ee, V = Z * 8 - z - 1, ne = (1 << V) - 1, l = ne >> 1, e = -7, t = D ? Z - 1 : 0, i = D ? -1 : 1, n = $[F + t];
for (t += i, Y = n & (1 << -e) - 1, n >>= -e, e += V; e > 0; Y = Y * 256 + $[F + t], t += i, e -= 8)
;
for (ee = Y & (1 << -e) - 1, Y >>= -e, e += z; e > 0; ee = ee * 256 + $[F + t], t += i, e -= 8)
;
if (Y === 0)
Y = 1 - l;
else {
if (Y === ne)
return ee ? NaN : (n ? -1 : 1) * (1 / 0);
ee = ee + Math.pow(2, z), Y = Y - l;
}
return (n ? -1 : 1) * ee * Math.pow(2, Y - z);
}, P.write = function($, F, D, z, Z, Y) {
var ee, V, ne, l = Y * 8 - Z - 1, e = (1 << l) - 1, t = e >> 1, i = Z === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, n = z ? 0 : Y - 1, o = z ? 1 : -1, h = F < 0 || F === 0 && 1 / F < 0 ? 1 : 0;
for (F = Math.abs(F), isNaN(F) || F === 1 / 0 ? (V = isNaN(F) ? 1 : 0, ee = e) : (ee = Math.floor(Math.log(F) / Math.LN2), F * (ne = Math.pow(2, -ee)) < 1 && (ee--, ne *= 2), ee + t >= 1 ? F += i / ne : F += i * Math.pow(2, 1 - t), F * ne >= 2 && (ee++, ne /= 2), ee + t >= e ? (V = 0, ee = e) : ee + t >= 1 ? (V = (F * ne - 1) * Math.pow(2, Z), ee = ee + t) : (V = F * Math.pow(2, t - 1) * Math.pow(2, Z), ee = 0)); Z >= 8; $[D + n] = V & 255, n += o, V /= 256, Z -= 8)
;
for (ee = ee << Z | V, l += Z; l > 0; $[D + n] = ee & 255, n += o, ee /= 256, l -= 8)
;
$[D + n - o] |= h * 128;
};
(function($) {
const F = I, D = P, z = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
$.Buffer = e, $.SlowBuffer = A, $.INSPECT_MAX_BYTES = 50;
const Z = 2147483647;
$.kMaxLength = Z;
const { Uint8Array: Y, ArrayBuffer: ee, SharedArrayBuffer: V } = globalThis;
e.TYPED_ARRAY_SUPPORT = ne(), !e.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && 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."
);
function ne() {
try {
const N = new Y(1), E = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(E, Y.prototype), Object.setPrototypeOf(N, E), N.foo() === 42;
} catch {
return !1;
}
}
Object.defineProperty(e.prototype, "parent", {
enumerable: !0,
get: function() {
if (e.isBuffer(this))
return this.buffer;
}
}), Object.defineProperty(e.prototype, "offset", {
enumerable: !0,
get: function() {
if (e.isBuffer(this))
return this.byteOffset;
}
});
function l(N) {
if (N > Z)
throw new RangeError('The value "' + N + '" is invalid for option "size"');
const E = new Y(N);
return Object.setPrototypeOf(E, e.prototype), E;
}
function e(N, E, C) {
if (typeof N == "number") {
if (typeof E == "string")
throw new TypeError(
'The "string" argument must be of type string. Received type number'
);
return o(N);
}
return t(N, E, C);
}
e.poolSize = 8192;
function t(N, E, C) {
if (typeof N == "string")
return h(N, E);
if (ee.isView(N))
return f(N);
if (N == null)
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof N
);
if (xe(N, ee) || N && xe(N.buffer, ee) || typeof V < "u" && (xe(N, V) || N && xe(N.buffer, V)))
return r(N, E, C);
if (typeof N == "number")
throw new TypeError(
'The "value" argument must not be of type number. Received type number'
);
const H = N.valueOf && N.valueOf();
if (H != null && H !== N)
return e.from(H, E, C);
const J = s(N);
if (J) return J;
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof N[Symbol.toPrimitive] == "function")
return e.from(N[Symbol.toPrimitive]("string"), E, C);
throw new TypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof N
);
}
e.from = function(N, E, C) {
return t(N, E, C);
}, Object.setPrototypeOf(e.prototype, Y.prototype), Object.setPrototypeOf(e, Y);
function i(N) {
if (typeof N != "number")
throw new TypeError('"size" argument must be of type number');
if (N < 0)
throw new RangeError('The value "' + N + '" is invalid for option "size"');
}
function n(N, E, C) {
return i(N), N <= 0 ? l(N) : E !== void 0 ? typeof C == "string" ? l(N).fill(E, C) : l(N).fill(E) : l(N);
}
e.alloc = function(N, E, C) {
return n(N, E, C);
};
function o(N) {
return i(N), l(N < 0 ? 0 : m(N) | 0);
}
e.allocUnsafe = function(N) {
return o(N);
}, e.allocUnsafeSlow = function(N) {
return o(N);
};
function h(N, E) {
if ((typeof E != "string" || E === "") && (E = "utf8"), !e.isEncoding(E))
throw new TypeError("Unknown encoding: " + E);
const C = L(N, E) | 0;
let H = l(C);
const J = H.write(N, E);
return J !== C && (H = H.slice(0, J)), H;
}
function u(N) {
const E = N.length < 0 ? 0 : m(N.length) | 0, C = l(E);
for (let H = 0; H < E; H += 1)
C[H] = N[H] & 255;
return C;
}
function f(N) {
if (xe(N, Y)) {
const E = new Y(N);
return r(E.buffer, E.byteOffset, E.byteLength);
}
return u(N);
}
function r(N, E, C) {
if (E < 0 || N.byteLength < E)
throw new RangeError('"offset" is outside of buffer bounds');
if (N.byteLength < E + (C || 0))
throw new RangeError('"length" is outside of buffer bounds');
let H;
return E === void 0 && C === void 0 ? H = new Y(N) : C === void 0 ? H = new Y(N, E) : H = new Y(N, E, C), Object.setPrototypeOf(H, e.prototype), H;
}
function s(N) {
if (e.isBuffer(N)) {
const E = m(N.length) | 0, C = l(E);
return C.length === 0 || N.copy(C, 0, 0, E), C;
}
if (N.length !== void 0)
return typeof N.length != "number" || je(N.length) ? l(0) : u(N);
if (N.type === "Buffer" && Array.isArray(N.data))
return u(N.data);
}
function m(N) {
if (N >= Z)
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + Z.toString(16) + " bytes");
return N | 0;
}
function A(N) {
return +N != N && (N = 0), e.alloc(+N);
}
e.isBuffer = function(E) {
return E != null && E._isBuffer === !0 && E !== e.prototype;
}, e.compare = function(E, C) {
if (xe(E, Y) && (E = e.from(E, E.offset, E.byteLength)), xe(C, Y) && (C = e.from(C, C.offset, C.byteLength)), !e.isBuffer(E) || !e.isBuffer(C))
throw new TypeError(
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
);
if (E === C) return 0;
let H = E.length, J = C.length;
for (let fe = 0, Q = Math.min(H, J); fe < Q; ++fe)
if (E[fe] !== C[fe]) {
H = E[fe], J = C[fe];
break;
}
return H < J ? -1 : J < H ? 1 : 0;
}, e.isEncoding = function(E) {
switch (String(E).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 !0;
default:
return !1;
}
}, e.concat = function(E, C) {
if (!Array.isArray(E))
throw new TypeError('"list" argument must be an Array of Buffers');
if (E.length === 0)
return e.alloc(0);
let H;
if (C === void 0)
for (C = 0, H = 0; H < E.length; ++H)
C += E[H].length;
const J = e.allocUnsafe(C);
let fe = 0;
for (H = 0; H < E.length; ++H) {
let Q = E[H];
if (xe(Q, Y))
fe + Q.length > J.length ? (e.isBuffer(Q) || (Q = e.from(Q)), Q.copy(J, fe)) : Y.prototype.set.call(
J,
Q,
fe
);
else if (e.isBuffer(Q))
Q.copy(J, fe);
else
throw new TypeError('"list" argument must be an Array of Buffers');
fe += Q.length;
}
return J;
};
function L(N, E) {
if (e.isBuffer(N))
return N.length;
if (ee.isView(N) || xe(N, ee))
return N.byteLength;
if (typeof N != "string")
throw new TypeError(
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof N
);
const C = N.length, H = arguments.length > 2 && arguments[2] === !0;
if (!H && C === 0) return 0;
let J = !1;
for (; ; )
switch (E) {
case "ascii":
case "latin1":
case "binary":
return C;
case "utf8":
case "utf-8":
return Ue(N).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return C * 2;
case "hex":
return C >>> 1;
case "base64":
return He(N).length;
default:
if (J)
return H ? -1 : Ue(N).length;
E = ("" + E).toLowerCase(), J = !0;
}
}
e.byteLength = L;
function G(N, E, C) {
let H = !1;
if ((E === void 0 || E < 0) && (E = 0), E > this.length || ((C === void 0 || C > this.length) && (C = this.length), C <= 0) || (C >>>= 0, E >>>= 0, C <= E))
return "";
for (N || (N = "utf8"); ; )
switch (N) {
case "hex":
return Pe(this, E, C);
case "utf8":
case "utf-8":
return te(this, E, C);
case "ascii":
return se(this, E, C);
case "latin1":
case "binary":
return re(this, E, C);
case "base64":
return _e(this, E, C);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return ae(this, E, C);
default:
if (H) throw new TypeError("Unknown encoding: " + N);
N = (N + "").toLowerCase(), H = !0;
}
}
e.prototype._isBuffer = !0;
function j(N, E, C) {
const H = N[E];
N[E] = N[C], N[C] = H;
}
e.prototype.swap16 = function() {
const E = this.length;
if (E % 2 !== 0)
throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let C = 0; C < E; C += 2)
j(this, C, C + 1);
return this;
}, e.prototype.swap32 = function() {
const E = this.length;
if (E % 4 !== 0)
throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let C = 0; C < E; C += 4)
j(this, C, C + 3), j(this, C + 1, C + 2);
return this;
}, e.prototype.swap64 = function() {
const E = this.length;
if (E % 8 !== 0)
throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let C = 0; C < E; C += 8)
j(this, C, C + 7), j(this, C + 1, C + 6), j(this, C + 2, C + 5), j(this, C + 3, C + 4);
return this;
}, e.prototype.toString = function() {
const E = this.length;
return E === 0 ? "" : arguments.length === 0 ? te(this, 0, E) : G.apply(this, arguments);
}, e.prototype.toLocaleString = e.prototype.toString, e.prototype.equals = function(E) {
if (!e.isBuffer(E)) throw new TypeError("Argument must be a Buffer");
return this === E ? !0 : e.compare(this, E) === 0;
}, e.prototype.inspect = function() {
let E = "";
const C = $.INSPECT_MAX_BYTES;
return E = this.toString("hex", 0, C).replace(/(.{2})/g, "$1 ").trim(), this.length > C && (E += " ... "), "<Buffer " + E + ">";
}, z && (e.prototype[z] = e.prototype.inspect), e.prototype.compare = function(E, C, H, J, fe) {
if (xe(E, Y) && (E = e.from(E, E.offset, E.byteLength)), !e.isBuffer(E))
throw new TypeError(
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof E
);
if (C === void 0 && (C = 0), H === void 0 && (H = E ? E.length : 0), J === void 0 && (J = 0), fe === void 0 && (fe = this.length), C < 0 || H > E.length || J < 0 || fe > this.length)
throw new RangeError("out of range index");
if (J >= fe && C >= H)
return 0;
if (J >= fe)
return -1;
if (C >= H)
return 1;
if (C >>>= 0, H >>>= 0, J >>>= 0, fe >>>= 0, this === E) return 0;
let Q = fe - J, le = H - C;
const Ce = Math.min(Q, le), ue = this.slice(J, fe), ve = E.slice(C, H);
for (let Te = 0; Te < Ce; ++Te)
if (ue[Te] !== ve[Te]) {
Q = ue[Te], le = ve[Te];
break;
}
return Q < le ? -1 : le < Q ? 1 : 0;
};
function x(N, E, C, H, J) {
if (N.length === 0) return -1;
if (typeof C == "string" ? (H = C, C = 0) : C > 2147483647 ? C = 2147483647 : C < -2147483648 && (C = -2147483648), C = +C, je(C) && (C = J ? 0 : N.length - 1), C < 0 && (C = N.length + C), C >= N.length) {
if (J) return -1;
C = N.length - 1;
} else if (C < 0)
if (J) C = 0;
else return -1;
if (typeof E == "string" && (E = e.from(E, H)), e.isBuffer(E))
return E.length === 0 ? -1 : k(N, E, C, H, J);
if (typeof E == "number")
return E = E & 255, typeof Y.prototype.indexOf == "function" ? J ? Y.prototype.indexOf.call(N, E, C) : Y.prototype.lastIndexOf.call(N, E, C) : k(N, [E], C, H, J);
throw new TypeError("val must be string, number or Buffer");
}
function k(N, E, C, H, J) {
let fe = 1, Q = N.length, le = E.length;
if (H !== void 0 && (H = String(H).toLowerCase(), H === "ucs2" || H === "ucs-2" || H === "utf16le" || H === "utf-16le")) {
if (N.length < 2 || E.length < 2)
return -1;
fe = 2, Q /= 2, le /= 2, C /= 2;
}
function Ce(ve, Te) {
return fe === 1 ? ve[Te] : ve.readUInt16BE(Te * fe);
}
let ue;
if (J) {
let ve = -1;
for (ue = C; ue < Q; ue++)
if (Ce(N, ue) === Ce(E, ve === -1 ? 0 : ue - ve)) {
if (ve === -1 && (ve = ue), ue - ve + 1 === le) return ve * fe;
} else
ve !== -1 && (ue -= ue - ve), ve = -1;
} else
for (C + le > Q && (C = Q - le), ue = C; ue >= 0; ue--) {
let ve = !0;
for (let Te = 0; Te < le; Te++)
if (Ce(N, ue + Te) !== Ce(E, Te)) {
ve = !1;
break;
}
if (ve) return ue;
}
return -1;
}
e.prototype.includes = function(E, C, H) {
return this.indexOf(E, C, H) !== -1;
}, e.prototype.indexOf = function(E, C, H) {
return x(this, E, C, H, !0);
}, e.prototype.lastIndexOf = function(E, C, H) {
return x(this, E, C, H, !1);
};
function U(N, E, C, H) {
C = Number(C) || 0;
const J = N.length - C;
H ? (H = Number(H), H > J && (H = J)) : H = J;
const fe = E.length;
H > fe / 2 && (H = fe / 2);
let Q;
for (Q = 0; Q < H; ++Q) {
const le = parseInt(E.substr(Q * 2, 2), 16);
if (je(le)) return Q;
N[C + Q] = le;
}
return Q;
}
function W(N, E, C, H) {
return pe(Ue(E, N.length - C), N, C, H);
}
function K(N, E, C, H) {
return pe(ge(E), N, C, H);
}
function O(N, E, C, H) {
return pe(He(E), N, C, H);
}
function X(N, E, C, H) {
return pe(Ee(E, N.length - C), N, C, H);
}
e.prototype.write = function(E, C, H, J) {
if (C === void 0)
J = "utf8", H = this.length, C = 0;
else if (H === void 0 && typeof C == "string")
J = C, H = this.length, C = 0;
else if (isFinite(C))
C = C >>> 0, isFinite(H) ? (H = H >>> 0, J === void 0 && (J = "utf8")) : (J = H, H = void 0);
else
throw new Error(
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
);
const fe = this.length - C;
if ((H === void 0 || H > fe) && (H = fe), E.length > 0 && (H < 0 || C < 0) || C > this.length)
throw new RangeError("Attempt to write outside buffer bounds");
J || (J = "utf8");
let Q = !1;
for (; ; )
switch (J) {
case "hex":
return U(this, E, C, H);
case "utf8":
case "utf-8":
return W(this, E, C, H);
case "ascii":
case "latin1":
case "binary":
return K(this, E, C, H);
case "base64":
return O(this, E, C, H);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le":
return X(this, E, C, H);
default:
if (Q) throw new TypeError("Unknown encoding: " + J);
J = ("" + J).toLowerCase(), Q = !0;
}
}, e.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
function _e(N, E, C) {
return E === 0 && C === N.length ? F.fromByteArray(N) : F.fromByteArray(N.slice(E, C));
}
function te(N, E, C) {
C = Math.min(N.length, C);
const H = [];
let J = E;
for (; J < C; ) {
const fe = N[J];
let Q = null, le = fe > 239 ? 4 : fe > 223 ? 3 : fe > 191 ? 2 : 1;
if (J + le <= C) {
let Ce, ue, ve, Te;
switch (le) {
case 1:
fe < 128 && (Q = fe);
break;
case 2:
Ce = N[J + 1], (Ce & 192) === 128 && (Te = (fe & 31) << 6 | Ce & 63, Te > 127 && (Q = Te));
break;
case 3:
Ce = N[J + 1], ue = N[J + 2], (Ce & 192) === 128 && (ue & 192) === 128 && (Te = (fe & 15) << 12 | (Ce & 63) << 6 | ue & 63, Te > 2047 && (Te < 55296 || Te > 57343) && (Q = Te));
break;
case 4:
Ce = N[J + 1], ue = N[J + 2], ve = N[J + 3], (Ce & 192) === 128 && (ue & 192) === 128 && (ve & 192) === 128 && (Te = (fe & 15) << 18 | (Ce & 63) << 12 | (ue & 63) << 6 | ve & 63, Te > 65535 && Te < 1114112 && (Q = Te));
}
}
Q === null ? (Q = 65533, le = 1) : Q > 65535 && (Q -= 65536, H.push(Q >>> 10 & 1023 | 55296), Q = 56320 | Q & 1023), H.push(Q), J += le;
}
return ke(H);
}
const ie = 4096;
function ke(N) {
const E = N.length;
if (E <= ie)
return String.fromCharCode.apply(String, N);
let C = "", H = 0;
for (; H < E; )
C += String.fromCharCode.apply(
String,
N.slice(H, H += ie)
);
return C;
}
function se(N, E, C) {
let H = "";
C = Math.min(N.length, C);
for (let J = E; J < C; ++J)
H += String.fromCharCode(N[J] & 127);
return H;
}
function re(N, E, C) {
let H = "";
C = Math.min(N.length, C);
for (let J = E; J < C; ++J)
H += String.fromCharCode(N[J]);
return H;
}
function Pe(N, E, C) {
const H = N.length;
(!E || E < 0) && (E = 0), (!C || C < 0 || C > H) && (C = H);
let J = "";
for (let fe = E; fe < C; ++fe)
J += we[N[fe]];
return J;
}
function ae(N, E, C) {
const H = N.slice(E, C);
let J = "";
for (let fe = 0; fe < H.length - 1; fe += 2)
J += String.fromCharCode(H[fe] + H[fe + 1] * 256);
return J;
}
e.prototype.slice = function(E, C) {
const H = this.length;
E = ~~E, C = C === void 0 ? H : ~~C, E < 0 ? (E += H, E < 0 && (E = 0)) : E > H && (E = H), C < 0 ? (C += H, C < 0 && (C = 0)) : C > H && (C = H), C < E && (C = E);
const J = this.subarray(E, C);
return Object.setPrototypeOf(J, e.prototype), J;
};
function he(N, E, C) {
if (N % 1 !== 0 || N < 0) throw new RangeError("offset is not uint");
if (N + E > C) throw new RangeError("Trying to access beyond buffer length");
}
e.prototype.readUintLE = e.prototype.readUIntLE = function(E, C, H) {
E = E >>> 0, C = C >>> 0, H || he(E, C, this.length);
let J = this[E], fe = 1, Q = 0;
for (; ++Q < C && (fe *= 256); )
J += this[E + Q] * fe;
return J;
}, e.prototype.readUintBE = e.prototype.readUIntBE = function(E, C, H) {
E = E >>> 0, C = C >>> 0, H || he(E, C, this.length);
let J = this[E + --C], fe = 1;
for (; C > 0 && (fe *= 256); )
J += this[E + --C] * fe;
return J;
}, e.prototype.readUint8 = e.prototype.readUInt8 = function(E, C) {
return E = E >>> 0, C || he(E, 1, this.length), this[E];
}, e.prototype.readUint16LE = e.prototype.readUInt16LE = function(E, C) {
return E = E >>> 0, C || he(E, 2, this.length), this[E] | this[E + 1] << 8;
}, e.prototype.readUint16BE = e.prototype.readUInt16BE = function(E, C) {
return E = E >>> 0, C || he(E, 2, this.length), this[E] << 8 | this[E + 1];
}, e.prototype.readUint32LE = e.prototype.readUInt32LE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), (this[E] | this[E + 1] << 8 | this[E + 2] << 16) + this[E + 3] * 16777216;
}, e.prototype.readUint32BE = e.prototype.readUInt32BE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), this[E] * 16777216 + (this[E + 1] << 16 | this[E + 2] << 8 | this[E + 3]);
}, e.prototype.readBigUInt64LE = Se(function(E) {
E = E >>> 0, Be(E, "offset");
const C = this[E], H = this[E + 7];
(C === void 0 || H === void 0) && Le(E, this.length - 8);
const J = C + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + this[++E] * 2 ** 24, fe = this[++E] + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + H * 2 ** 24;
return BigInt(J) + (BigInt(fe) << BigInt(32));
}), e.prototype.readBigUInt64BE = Se(function(E) {
E = E >>> 0, Be(E, "offset");
const C = this[E], H = this[E + 7];
(C === void 0 || H === void 0) && Le(E, this.length - 8);
const J = C * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + this[++E], fe = this[++E] * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + H;
return (BigInt(J) << BigInt(32)) + BigInt(fe);
}), e.prototype.readIntLE = function(E, C, H) {
E = E >>> 0, C = C >>> 0, H || he(E, C, this.length);
let J = this[E], fe = 1, Q = 0;
for (; ++Q < C && (fe *= 256); )
J += this[E + Q] * fe;
return fe *= 128, J >= fe && (J -= Math.pow(2, 8 * C)), J;
}, e.prototype.readIntBE = function(E, C, H) {
E = E >>> 0, C = C >>> 0, H || he(E, C, this.length);
let J = C, fe = 1, Q = this[E + --J];
for (; J > 0 && (fe *= 256); )
Q += this[E + --J] * fe;
return fe *= 128, Q >= fe && (Q -= Math.pow(2, 8 * C)), Q;
}, e.prototype.readInt8 = function(E, C) {
return E = E >>> 0, C || he(E, 1, this.length), this[E] & 128 ? (255 - this[E] + 1) * -1 : this[E];
}, e.prototype.readInt16LE = function(E, C) {
E = E >>> 0, C || he(E, 2, this.length);
const H = this[E] | this[E + 1] << 8;
return H & 32768 ? H | 4294901760 : H;
}, e.prototype.readInt16BE = function(E, C) {
E = E >>> 0, C || he(E, 2, this.length);
const H = this[E + 1] | this[E] << 8;
return H & 32768 ? H | 4294901760 : H;
}, e.prototype.readInt32LE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), this[E] | this[E + 1] << 8 | this[E + 2] << 16 | this[E + 3] << 24;
}, e.prototype.readInt32BE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), this[E] << 24 | this[E + 1] << 16 | this[E + 2] << 8 | this[E + 3];
}, e.prototype.readBigInt64LE = Se(function(E) {
E = E >>> 0, Be(E, "offset");
const C = this[E], H = this[E + 7];
(C === void 0 || H === void 0) && Le(E, this.length - 8);
const J = this[E + 4] + this[E + 5] * 2 ** 8 + this[E + 6] * 2 ** 16 + (H << 24);
return (BigInt(J) << BigInt(32)) + BigInt(C + this[++E] * 2 ** 8 + this[++E] * 2 ** 16 + this[++E] * 2 ** 24);
}), e.prototype.readBigInt64BE = Se(function(E) {
E = E >>> 0, Be(E, "offset");
const C = this[E], H = this[E + 7];
(C === void 0 || H === void 0) && Le(E, this.length - 8);
const J = (C << 24) + // Overflow
this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + this[++E];
return (BigInt(J) << BigInt(32)) + BigInt(this[++E] * 2 ** 24 + this[++E] * 2 ** 16 + this[++E] * 2 ** 8 + H);
}), e.prototype.readFloatLE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), D.read(this, E, !0, 23, 4);
}, e.prototype.readFloatBE = function(E, C) {
return E = E >>> 0, C || he(E, 4, this.length), D.read(this, E, !1, 23, 4);
}, e.prototype.readDoubleLE = function(E, C) {
return E = E >>> 0, C || he(E, 8, this.length), D.read(this, E, !0, 52, 8);
}, e.prototype.readDoubleBE = function(E, C) {
return E = E >>> 0, C || he(E, 8, this.length), D.read(this, E, !1, 52, 8);
};
function $e(N, E, C, H, J, fe) {
if (!e.isBuffer(N)) throw new TypeError('"buffer" argument must be a Buffer instance');
if (E > J || E < fe) throw new RangeError('"value" argument is out of bounds');
if (C + H > N.length) throw new RangeError("Index out of range");
}
e.prototype.writeUintLE = e.prototype.writeUIntLE = function(E, C, H, J) {
if (E = +E, C = C >>> 0, H = H >>> 0, !J) {
const le = Math.pow(2, 8 * H) - 1;
$e(this, E, C, H, le, 0);
}
let fe = 1, Q = 0;
for (this[C] = E & 255; ++Q < H && (fe *= 256); )
this[C + Q] = E / fe & 255;
return C + H;
}, e.prototype.writeUintBE = e.prototype.writeUIntBE = function(E, C, H, J) {
if (E = +E, C = C >>> 0, H = H >>> 0, !J) {
const le = Math.pow(2, 8 * H) - 1;
$e(this, E, C, H, le, 0);
}
let fe = H - 1, Q = 1;
for (this[C + fe] = E & 255; --fe >= 0 && (Q *= 256); )
this[C + fe] = E / Q & 255;
return C + H;
}, e.prototype.writeUint8 = e.prototype.writeUInt8 = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 1, 255, 0), this[C] = E & 255, C + 1;
}, e.prototype.writeUint16LE = e.prototype.writeUInt16LE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 2, 65535, 0), this[C] = E & 255, this[C + 1] = E >>> 8, C + 2;
}, e.prototype.writeUint16BE = e.prototype.writeUInt16BE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 2, 65535, 0), this[C] = E >>> 8, this[C + 1] = E & 255, C + 2;
}, e.prototype.writeUint32LE = e.prototype.writeUInt32LE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 4, 4294967295, 0), this[C + 3] = E >>> 24, this[C + 2] = E >>> 16, this[C + 1] = E >>> 8, this[C] = E & 255, C + 4;
}, e.prototype.writeUint32BE = e.prototype.writeUInt32BE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 4, 4294967295, 0), this[C] = E >>> 24, this[C + 1] = E >>> 16, this[C + 2] = E >>> 8, this[C + 3] = E & 255, C + 4;
};
function oe(N, E, C, H, J) {
ye(E, H, J, N, C, 7);
let fe = Number(E & BigInt(4294967295));
N[C++] = fe, fe = fe >> 8, N[C++] = fe, fe = fe >> 8, N[C++] = fe, fe = fe >> 8, N[C++] = fe;
let Q = Number(E >> BigInt(32) & BigInt(4294967295));
return N[C++] = Q, Q = Q >> 8, N[C++] = Q, Q = Q >> 8, N[C++] = Q, Q = Q >> 8, N[C++] = Q, C;
}
function ce(N, E, C, H, J) {
ye(E, H, J, N, C, 7);
let fe = Number(E & BigInt(4294967295));
N[C + 7] = fe, fe = fe >> 8, N[C + 6] = fe, fe = fe >> 8, N[C + 5] = fe, fe = fe >> 8, N[C + 4] = fe;
let Q = Number(E >> BigInt(32) & BigInt(4294967295));
return N[C + 3] = Q, Q = Q >> 8, N[C + 2] = Q, Q = Q >> 8, N[C + 1] = Q, Q = Q >> 8, N[C] = Q, C + 8;
}
e.prototype.writeBigUInt64LE = Se(function(E, C = 0) {
return oe(this, E, C, BigInt(0), BigInt("0xffffffffffffffff"));
}), e.prototype.writeBigUInt64BE = Se(function(E, C = 0) {
return ce(this, E, C, BigInt(0), BigInt("0xffffffffffffffff"));
}), e.prototype.writeIntLE = function(E, C, H, J) {
if (E = +E, C = C >>> 0, !J) {
const Ce = Math.pow(2, 8 * H - 1);
$e(this, E, C, H, Ce - 1, -Ce);
}
let fe = 0, Q = 1, le = 0;
for (this[C] = E & 255; ++fe < H && (Q *= 256); )
E < 0 && le === 0 && this[C + fe - 1] !== 0 && (le = 1), this[C + fe] = (E / Q >> 0) - le & 255;
return C + H;
}, e.prototype.writeIntBE = function(E, C, H, J) {
if (E = +E, C = C >>> 0, !J) {
const Ce = Math.pow(2, 8 * H - 1);
$e(this, E, C, H, Ce - 1, -Ce);
}
let fe = H - 1, Q = 1, le = 0;
for (this[C + fe] = E & 255; --fe >= 0 && (Q *= 256); )
E < 0 && le === 0 && this[C + fe + 1] !== 0 && (le = 1), this[C + fe] = (E / Q >> 0) - le & 255;
return C + H;
}, e.prototype.writeInt8 = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 1, 127, -128), E < 0 && (E = 255 + E + 1), this[C] = E & 255, C + 1;
}, e.prototype.writeInt16LE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 2, 32767, -32768), this[C] = E & 255, this[C + 1] = E >>> 8, C + 2;
}, e.prototype.writeInt16BE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 2, 32767, -32768), this[C] = E >>> 8, this[C + 1] = E & 255, C + 2;
}, e.prototype.writeInt32LE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 4, 2147483647, -2147483648), this[C] = E & 255, this[C + 1] = E >>> 8, this[C + 2] = E >>> 16, this[C + 3] = E >>> 24, C + 4;
}, e.prototype.writeInt32BE = function(E, C, H) {
return E = +E, C = C >>> 0, H || $e(this, E, C, 4, 2147483647, -2147483648), E < 0 && (E = 4294967295 + E + 1), this[C] = E >>> 24, this[C + 1] = E >>> 16, this[C + 2] = E >>> 8, this[C + 3] = E & 255, C + 4;
}, e.prototype.writeBigInt64LE = Se(function(E, C = 0) {
return oe(this, E, C, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
}), e.prototype.writeBigInt64BE = Se(function(E, C = 0) {
return ce(this, E, C, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
});
function De(N, E, C, H, J, fe) {
if (C + H > N.length) throw new RangeError("Index out of range");
if (C < 0) throw new RangeError("Index out of range");
}
function de(N, E, C, H, J) {
return E = +E, C = C >>> 0, J || De(N, E, C, 4), D.write(N, E, C, H, 23, 4), C + 4;
}
e.prototype.writeFloatLE = function(E, C, H) {
return de(this, E, C, !0, H);
}, e.prototype.writeFloatBE = function(E, C, H) {
return de(this, E, C, !1, H);
};
function qe(N, E, C, H, J) {
return E = +E, C = C >>> 0, J || De(N, E, C, 8), D.write(N, E, C, H, 52, 8), C + 8;
}
e.prototype.writeDoubleLE = function(E, C, H) {
return qe(this, E, C, !0, H);
}, e.prototype.writeDoubleBE = function(E, C, H) {
return qe(this, E, C, !1, H);
}, e.prototype.copy = function(E, C, H, J) {
if (!e.isBuffer(E)) throw new TypeError("argument should be a Buffer");
if (H || (H = 0), !J && J !== 0 && (J = this.length), C >= E.length && (C = E.length), C || (C = 0), J > 0 && J < H && (J = H), J === H || E.length === 0 || this.length === 0) return 0;
if (C < 0)
throw new RangeError("targetStart out of bounds");
if (H < 0 || H >= this.length) throw new RangeError("Index out of range");
if (J < 0) throw new RangeError("sourceEnd out of bounds");
J > this.length && (J = this.length), E.length - C < J - H && (J = E.length - C + H);
const fe = J - H;
return this === E && typeof Y.prototype.copyWithin == "function" ? this.copyWithin(C, H, J) : Y.prototype.set.call(
E,
this.subarray(H, J),
C
), fe;
}, e.prototype.fill = function(E, C, H, J) {
if (typeof E == "string") {
if (typeof C == "string" ? (J = C, C = 0, H = this.length) : typeof H == "string" && (J = H, H = this.length), J !== void 0 && typeof J != "string")
throw new TypeError("encoding must be a string");
if (typeof J == "string" && !e.isEncoding(J))
throw new TypeError("Unknown encoding: " + J);
if (E.length === 1) {
const Q = E.charCodeAt(0);
(J === "utf8" && Q < 128 || J === "latin1") && (E = Q);
}
} else typeof E == "number" ? E = E & 255 : typeof E == "boolean" && (E = Number(E));
if (C < 0 || this.length < C || this.length < H)
throw new RangeError("Out of range index");
if (H <= C)
return this;
C = C >>> 0, H = H === void 0 ? this.length : H >>> 0, E || (E = 0);
let fe;
if (typeof E == "number")
for (fe = C; fe < H; ++fe)
this[fe] = E;
else {
const Q = e.isBuffer(E) ? E : e.from(E, J), le = Q.length;
if (le === 0)
throw new TypeError('The value "' + E + '" is invalid for argument "value"');
for (fe = 0; fe < H - C; ++fe)
this[fe + C] = Q[fe % le];
}
return this;
};
const Oe = {};
function me(N, E, C) {
Oe[N] = class extends C {
constructor() {
super(), Object.defineProperty(this, "message", {
value: E.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${N}]`, this.stack, delete this.name;
}
get code() {
return N;
}
set code(J) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: J,
writable: !0
});
}
toString() {
return `${this.name} [${N}]: ${this.message}`;
}
};
}
me(
"ERR_BUFFER_OUT_OF_BOUNDS",
function(N) {
return N ? `${N} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
},
RangeError
), me(
"ERR_INVALID_ARG_TYPE",
function(N, E) {
return `The "${N}" argument must be of type number. Received type ${typeof E}`;
},
TypeError
), me(
"ERR_OUT_OF_RANGE",
function(N, E, C) {
let H = `The value of "${N}" is out of range.`, J = C;
return Number.isInteger(C) && Math.abs(C) > 2 ** 32 ? J = Re(String(C)) : typeof C == "bigint" && (J = String(C), (C > BigInt(2) ** BigInt(32) || C < -(BigInt(2) ** BigInt(32))) && (J = Re(J)), J += "n"), H += ` It must be ${E}. Received ${J}`, H;
},
RangeError
);
function Re(N) {
let E = "", C = N.length;
const H = N[0] === "-" ? 1 : 0;
for (; C >= H + 4; C -= 3)
E = `_${N.slice(C - 3, C)}${E}`;
return `${N.slice(0, C)}${E}`;
}
function ze(N, E, C) {
Be(E, "offset"), (N[E] === void 0 || N[E + C] === void 0) && Le(E, N.length - (C + 1));
}
function ye(N, E, C, H, J, fe) {
if (N > C || N < E) {
const Q = typeof E == "bigint" ? "n" : "";
let le;
throw E === 0 || E === BigInt(0) ? le = `>= 0${Q} and < 2${Q} ** ${(fe + 1) * 8}${Q}` : le = `>= -(2${Q} ** ${(fe + 1) * 8 - 1}${Q}) and < 2 ** ${(fe + 1) * 8 - 1}${Q}`, new Oe.ERR_OUT_OF_RANGE("value", le, N);
}
ze(H, J, fe);
}
function Be(N, E) {
if (typeof N != "number")
throw new Oe.ERR_INVALID_ARG_TYPE(E, "number", N);
}
function Le(N, E, C) {
throw Math.floor(N) !== N ? (Be(N, C), new Oe.ERR_OUT_OF_RANGE("offset", "an integer", N)) : E < 0 ? new Oe.ERR_BUFFER_OUT_OF_BOUNDS() : new Oe.ERR_OUT_OF_RANGE(
"offset",
`>= 0 and <= ${E}`,
N
);
}
const be = /[^+/0-9A-Za-z-_]/g;
function Ae(N) {
if (N = N.split("=")[0], N = N.trim().replace(be, ""), N.length < 2) return "";
for (; N.length % 4 !== 0; )
N = N + "=";
return N;
}
function Ue(N, E) {
E = E || 1 / 0;
let C;
const H = N.length;
let J = null;
const fe = [];
for (let Q = 0; Q < H; ++Q) {
if (C = N.charCodeAt(Q), C > 55295 && C < 57344) {
if (!J) {
if (C > 56319) {
(E -= 3) > -1 && fe.push(239, 191, 189);
continue;
} else if (Q + 1 === H) {
(E -= 3) > -1 && fe.push(239, 191, 189);
continue;
}
J = C;
continue;
}
if (C < 56320) {
(E -= 3) > -1 && fe.push(239, 191, 189), J = C;
continue;
}
C = (J - 55296 << 10 | C - 56320) + 65536;
} else J && (E -= 3) > -1 && fe.push(239, 191, 189);
if (J = null, C < 128) {
if ((E -= 1) < 0) break;
fe.push(C);
} else if (C < 2048) {
if ((E -= 2) < 0) break;
fe.push(
C >> 6 | 192,
C & 63 | 128
);
} else if (C < 65536) {
if ((E -= 3) < 0) break;
fe.push(
C >> 12 | 224,
C >> 6 & 63 | 128,
C & 63 | 128
);
} else if (C < 1114112) {
if ((E -= 4) < 0) break;
fe.push(
C >> 18 | 240,
C >> 12 & 63 | 128,
C >> 6 & 63 | 128,
C & 63 | 128
);
} else
throw new Error("Invalid code point");
}
return fe;
}
function ge(N) {
const E = [];
for (let C = 0; C < N.length; ++C)
E.push(N.charCodeAt(C) & 255);
return E;
}
function Ee(N, E) {
let C, H, J;
const fe = [];
for (let Q = 0; Q < N.length && !((E -= 2) < 0); ++Q)
C = N.charCodeAt(Q), H = C >> 8, J = C % 256, fe.push(J), fe.push(H);
return fe;
}
function He(N) {
return F.toByteArray(Ae(N));
}
function pe(N, E, C, H) {
let J;
for (J = 0; J < H && !(J + C >= E.length || J >= N.length); ++J)
E[J + C] = N[J];
return J;
}
function xe(N, E) {
return N instanceof E || N != null && N.constructor != null && N.constructor.name != null && N.constructor.name === E.name;
}
function je(N) {
return N !== N;
}
const we = (function() {
const N = "0123456789abcdef", E = new Array(256);
for (let C = 0; C < 16; ++C) {
const H = C * 16;
for (let J = 0; J < 16; ++J)
E[H + J] = N[C] + N[J];
}
return E;
})();
function Se(N) {
return typeof BigInt > "u" ? We : N;
}
function We() {
throw new Error("BigInt not supported");
}
})(R);
const T = R.Buffer;
M.Blob = R.Blob, M.BlobOptions = R.BlobOptions, M.Buffer = R.Buffer, M.File = R.File, M.FileOptions = R.FileOptions, M.INSPECT_MAX_BYTES = R.INSPECT_MAX_BYTES, M.SlowBuffer = R.SlowBuffer, M.TranscodeEncoding = R.TranscodeEncoding, M.atob = R.atob, M.btoa = R.btoa, M.constants = R.constants, M.default = T, M.isAscii = R.isAscii, M.isUtf8 = R.isUtf8, M.kMaxLength = R.kMaxLength, M.kStringMaxLength = R.kStringMaxLength, M.resolveObjectURL = R.resolveObjectURL, M.transcode = R.transcode;
})(dist)), dist;
}
var hasRequiredSafeBuffer$2;
function requireSafeBuffer$2() {
return hasRequiredSafeBuffer$2 || (hasRequiredSafeBuffer$2 = 1, (function(M, R) {
var I = requireDist(), c = I.Buffer;
function B(g, v) {
for (var p in g)
v[p] = g[p];
}
c.from && c.alloc && c.allocUnsafe && c.allocUnsafeSlow ? M.exports = I : (B(I, R), R.Buffer = a);
function a(g, v, p) {
return c(g, v, p);
}
a.prototype = Object.create(c.prototype), B(c, a), a.from = function(g, v, p) {
if (typeof g == "number")
throw new TypeError("Argument must not be a number");
return c(g, v, p);
}, a.alloc = function(g, v, p) {
if (typeof g != "number")
throw new TypeError("Argument must be a number");
var y = c(g);
return v !== void 0 ? typeof p == "string" ? y.fill(v, p) : y.fill(v) : y.fill(0), y;
}, a.allocUnsafe = function(g) {
if (typeof g != "number")
throw new TypeError("Argument must be a number");
return c(g);
}, a.allocUnsafeSlow = function(g) {
if (typeof g != "number")
throw new TypeError("Argument must be a number");
return I.SlowBuffer(g);
};
})(safeBuffer$2, safeBuffer$2.exports)), safeBuffer$2.exports;
}
var hasRequiredBrowser$b;
function requireBrowser$b() {
if (hasRequiredBrowser$b) return browser$b.exports;
hasRequiredBrowser$b = 1;
var M = 65536, R = 4294967295;
function I() {
throw new Error(`Secure random number generation is not supported by this browser.
Use Chrome, Firefox or Internet Explorer 11`);
}
var c = requireSafeBuffer$2().Buffer, B = commonjsGlobal.crypto || commonjsGlobal.msCrypto;
B && B.getRandomValues ? browser$b.exports = a : browser$b.exports = I;
function a(g, v) {
if (g > R) throw new RangeError("requested too many random bytes");
var p = c.allocUnsafe(g);
if (g > 0)
if (g > M)
for (var y = 0; y < g; y += M)
B.getRandomValues(p.slice(y, y + M));
else
B.getRandomValues(p);
return typeof v == "function" ? process$1.nextTick(function() {
v(null, p);
}) : p;
}
return browser$b.exports;
}
var inherits_browser = { exports: {} }, hasRequiredInherits_browser;
function requireInherits_browser() {
return hasRequiredInherits_browser || (hasRequiredInherits_browser = 1, typeof Object.create == "function" ? inherits_browser.exports = function(R, I) {
I && (R.super_ = I, R.prototype = Object.create(I.prototype, {
constructor: {
value: R,
enumerable: !1,
writable: !0,
configurable: !0
}
}));
} : inherits_browser.exports = function(R, I) {
if (I) {
R.super_ = I;
var c = function() {
};
c.prototype = I.prototype, R.prototype = new c(), R.prototype.constructor = R;
}
}), inherits_browser.exports;
}
var events = { exports: {} }, hasRequiredEvents;
function requireEvents() {
if (hasRequiredEvents) return events.exports;
hasRequiredEvents = 1;
var M = typeof Reflect == "object" ? Reflect : null, R = M && typeof M.apply == "function" ? M.apply : function(z, Z, Y) {
return Function.prototype.apply.call(z, Z, Y);
}, I;
M && typeof M.ownKeys == "function" ? I = M.ownKeys : Object.getOwnPropertySymbols ? I = function(z) {
return Object.getOwnPropertyNames(z).concat(Object.getOwnPropertySymbols(z));
} : I = function(z) {
return Object.getOwnPropertyNames(z);
};
function c(D) {
console && console.warn && console.warn(D);
}
var B = Number.isNaN || function(z) {
return z !== z;
};
function a() {
a.init.call(this);
}
events.exports = a, events.exports.once = T, a.EventEmitter = a, a.prototype._events = void 0, a.prototype._eventsCount = 0, a.prototype._maxListeners = void 0;
var g = 10;
function v(D) {
if (typeof D != "function")
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof D);
}
Object.defineProperty(a, "defaultMaxListeners", {
enumerable: !0,
get: function() {
return g;
},
set: function(D) {
if (typeof D != "number" || D < 0 || B(D))
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + D + ".");
g = D;
}
}), a.init = function() {
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
}, a.prototype.setMaxListeners = function(z) {
if (typeof z != "number" || z < 0 || B(z))
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + z + ".");
return this._maxListeners = z, this;
};
function p(D) {
return D._maxListeners === void 0 ? a.defaultMaxListeners : D._maxListeners;
}
a.prototype.getMaxListeners = function() {
return p(this);
}, a.prototype.emit = function(z) {
for (var Z = [], Y = 1; Y < arguments.length; Y++) Z.push(arguments[Y]);
var ee = z === "error", V = this._events;
if (V !== void 0)
ee = ee && V.error === void 0;
else if (!ee)
return !1;
if (ee) {
var ne;
if (Z.length > 0 && (ne = Z[0]), ne instanceof Error)
throw ne;
var l = new Error("Unhandled error." + (ne ? " (" + ne.message + ")" : ""));
throw l.context = ne, l;
}
var e = V[z];
if (e === void 0)
return !1;
if (typeof e == "function")
R(e, this, Z);
else
for (var t = e.length, i = q(e, t), Y = 0; Y < t; ++Y)
R(i[Y], this, Z);
return !0;
};
function y(D, z, Z, Y) {
var ee, V, ne;