parse
Version:
Parse JavaScript SDK
1,144 lines • 1.16 MB
JavaScript
(function(t) {
"function" == typeof define && define.amd ? define([], t) : t();
})((function() {
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __esmMin = (t, e) => () => (t && (e = t(t = 0)), e), __commonJSMin = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), __exportAll = (t, e) => {
let r = {};
for (var i in t) __defProp(r, i, {
get: t[i],
enumerable: !0
});
return e || __defProp(r, Symbol.toStringTag, { value: "Module" }), r;
}, __copyProps = (t, e, r, i) => {
if (e && "object" == typeof e || "function" == typeof e) for (var n, o = __getOwnPropNames(e), s = 0, a = o.length; s < a; s++) n = o[s], __hasOwnProp.call(t, n) || n === r || __defProp(t, n, {
get: ((t) => e[t]).bind(null, n),
enumerable: !(i = __getOwnPropDesc(e, n)) || i.enumerable
});
return t;
}, __toESM = (t, e, r) => (r = null != t ? __create(__getProtoOf(t)) : {}, __copyProps(!e && t && t.__esModule ? r : __defProp(r, "default", {
value: t,
enumerable: !0
}), t)), __toCommonJS = (t) => __hasOwnProp.call(t, "module.exports") ? t["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: !0 }), t), browser, process, cachedSetTimeout, cachedClearTimeout, queue, draining, currentQueue, queueIndex, browserExports, process$1;
function getDefaultExportFromCjs(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function defaultSetTimout() {
throw new Error("setTimeout has not been defined");
}
function defaultClearTimeout() {
throw new Error("clearTimeout has not been defined");
}
function runTimeout(t) {
if (cachedSetTimeout === setTimeout) return setTimeout(t, 0);
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) return cachedSetTimeout = setTimeout, setTimeout(t, 0);
try {
return cachedSetTimeout(t, 0);
} catch (e) {
try {
return cachedSetTimeout.call(null, t, 0);
} catch (e) {
return cachedSetTimeout.call(this, t, 0);
}
}
}
function runClearTimeout(t) {
if (cachedClearTimeout === clearTimeout) return clearTimeout(t);
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) return cachedClearTimeout = clearTimeout, clearTimeout(t);
try {
return cachedClearTimeout(t);
} catch (e) {
try {
return cachedClearTimeout.call(null, t);
} catch (e) {
return cachedClearTimeout.call(this, t);
}
}
}
function cleanUpNextTick() {
draining && currentQueue && (draining = !1, currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1, queue.length && drainQueue());
}
function drainQueue() {
if (!draining) {
var t = runTimeout(cleanUpNextTick);
draining = !0;
for (var e = queue.length; e;) {
for (currentQueue = queue, queue = []; ++queueIndex < e;) currentQueue && currentQueue[queueIndex].run();
queueIndex = -1, e = queue.length;
}
currentQueue = null, draining = !1, runClearTimeout(t);
}
}
function Item(t, e) {
this.fun = t, this.array = e;
}
function noop() {}
var init_dist$2 = __esmMin((() => {
process = (browser = { exports: {} }).exports = {}, function() {
try {
cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout;
} catch (t) {
cachedSetTimeout = defaultSetTimout;
}
try {
cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout;
} catch (t) {
cachedClearTimeout = defaultClearTimeout;
}
}(), queue = [], draining = !1, queueIndex = -1, process.nextTick = function(t) {
var e = new Array(arguments.length - 1);
if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) e[r - 1] = arguments[r];
queue.push(new Item(t, e)), 1 !== queue.length || draining || runTimeout(drainQueue);
}, Item.prototype.run = function() {
this.fun.apply(null, this.array);
}, process.title = "browser", process.browser = !0, process.env = {}, process.argv = [], process.version = "", process.versions = {}, process.on = noop, process.addListener = noop, process.once = noop, process.off = noop, process.removeListener = noop, process.removeAllListeners = noop, process.emit = noop, process.prependListener = noop, process.prependOnceListener = noop, process.listeners = function(t) {
return [];
}, process.binding = function(t) {
throw new Error("process.binding is not supported");
}, process.cwd = function() {
return "/";
}, process.chdir = function(t) {
throw new Error("process.chdir is not supported");
}, process.umask = function() {
return 0;
}, browserExports = browser.exports, process$1 = getDefaultExportFromCjs(browserExports);
}));
init_dist$2();
var config = {
IS_NODE: void 0 !== process$1 && !!process$1.versions && !!process$1.versions.node && !process$1.versions.electron,
REQUEST_ATTEMPT_LIMIT: 5,
REQUEST_BATCH_SIZE: 20,
REQUEST_HEADERS: {},
SERVER_URL: "https://api.parse.com/1",
LIVEQUERY_SERVER_URL: null,
ENCRYPTED_KEY: null,
VERSION: "js8.6.0",
APPLICATION_ID: null,
JAVASCRIPT_KEY: null,
MAINTENANCE_KEY: null,
MASTER_KEY: null,
USE_MASTER_KEY: !1,
PERFORM_USER_REWRITE: !0,
FORCE_REVOCABLE_SESSION: !1,
ENCRYPTED_USER: !1,
IDEMPOTENCY: !1,
ALLOW_CUSTOM_OBJECT_ID: !1,
PARSE_ERRORS: [],
NODE_LOGGING: !1
};
function requireMethods(t, e, r) {
e.forEach(((e) => {
if ("function" != typeof r[e]) throw new Error(`${t} must implement ${e}()`);
}));
}
var CoreManager = {
get: function(t) {
if (Object.hasOwn(config, t)) return config[t];
throw new Error("Configuration key not found: " + t);
},
set: function(t, e) {
config[t] = e;
},
setIfNeeded: function(t, e) {
return Object.hasOwn(config, t) || (config[t] = e), config[t];
},
setAnalyticsController(t) {
requireMethods("AnalyticsController", ["track"], t), config.AnalyticsController = t;
},
getAnalyticsController: () => config.AnalyticsController,
setCloudController(t) {
requireMethods("CloudController", [
"run",
"getJobsData",
"startJob"
], t), config.CloudController = t;
},
getCloudController: () => config.CloudController,
setConfigController(t) {
requireMethods("ConfigController", [
"current",
"get",
"save"
], t), config.ConfigController = t;
},
getConfigController: () => config.ConfigController,
setCryptoController(t) {
requireMethods("CryptoController", ["encrypt", "decrypt"], t), config.CryptoController = t;
},
getCryptoController: () => config.CryptoController,
setEventEmitter(t) {
config.EventEmitter = t;
},
getEventEmitter: () => config.EventEmitter,
setFileController(t) {
requireMethods("FileController", ["saveFile", "saveBase64"], t), config.FileController = t;
},
setEventuallyQueue(t) {
requireMethods("EventuallyQueue", [
"poll",
"save",
"destroy"
], t), config.EventuallyQueue = t;
},
getEventuallyQueue: () => config.EventuallyQueue,
getFileController: () => config.FileController,
setInstallationController(t) {
requireMethods("InstallationController", [
"currentInstallationId",
"currentInstallation",
"updateInstallationOnDisk"
], t), config.InstallationController = t;
},
getInstallationController: () => config.InstallationController,
setLiveQuery(t) {
config.LiveQuery = t;
},
getLiveQuery: () => config.LiveQuery,
setObjectController(t) {
requireMethods("ObjectController", [
"save",
"fetch",
"destroy"
], t), config.ObjectController = t;
},
getObjectController: () => config.ObjectController,
setObjectStateController(t) {
requireMethods("ObjectStateController", [
"getState",
"initializeState",
"removeState",
"getServerData",
"setServerData",
"getPendingOps",
"setPendingOp",
"pushPendingState",
"popPendingState",
"mergeFirstPendingState",
"getObjectCache",
"estimateAttribute",
"estimateAttributes",
"commitServerChanges",
"enqueueTask",
"clearAllState"
], t), config.ObjectStateController = t;
},
getObjectStateController: () => config.ObjectStateController,
setPushController(t) {
requireMethods("PushController", ["send"], t), config.PushController = t;
},
getPushController: () => config.PushController,
setQueryController(t) {
requireMethods("QueryController", ["find", "aggregate"], t), config.QueryController = t;
},
getQueryController: () => config.QueryController,
setRESTController(t) {
requireMethods("RESTController", ["request", "ajax"], t), config.RESTController = t;
},
getRESTController: () => config.RESTController,
setSchemaController(t) {
requireMethods("SchemaController", [
"get",
"create",
"update",
"delete",
"send",
"purge"
], t), config.SchemaController = t;
},
getSchemaController: () => config.SchemaController,
setSessionController(t) {
requireMethods("SessionController", ["getSession"], t), config.SessionController = t;
},
getSessionController: () => config.SessionController,
setStorageController(t) {
t.async ? requireMethods("An async StorageController", [
"getItemAsync",
"setItemAsync",
"removeItemAsync",
"getAllKeysAsync"
], t) : requireMethods("A synchronous StorageController", [
"getItem",
"setItem",
"removeItem",
"getAllKeys"
], t), config.StorageController = t;
},
setLocalDatastoreController(t) {
requireMethods("LocalDatastoreController", [
"pinWithName",
"fromPinWithName",
"unPinWithName",
"getAllContents",
"clear"
], t), config.LocalDatastoreController = t;
},
getLocalDatastoreController: () => config.LocalDatastoreController,
setLocalDatastore(t) {
config.LocalDatastore = t;
},
getLocalDatastore: () => config.LocalDatastore,
getStorageController: () => config.StorageController,
setAsyncStorage(t) {
config.AsyncStorage = t;
},
getAsyncStorage: () => config.AsyncStorage,
setWebSocketController(t) {
config.WebSocketController = t;
},
getWebSocketController: () => config.WebSocketController,
setUserController(t) {
requireMethods("UserController", [
"setCurrentUser",
"currentUser",
"currentUserAsync",
"signUp",
"logIn",
"become",
"logOut",
"me",
"requestPasswordReset",
"upgradeToRevocableSession",
"requestEmailVerification",
"verifyPassword",
"linkWith"
], t), config.UserController = t;
},
getUserController: () => config.UserController,
setLiveQueryController(t) {
requireMethods("LiveQueryController", [
"setDefaultLiveQueryClient",
"getDefaultLiveQueryClient",
"_clearCachedDefaultClient"
], t), config.LiveQueryController = t;
},
getLiveQueryController: () => config.LiveQueryController,
setHooksController(t) {
requireMethods("HooksController", [
"create",
"get",
"update",
"remove"
], t), config.HooksController = t;
},
getHooksController: () => config.HooksController,
setParseOp(t) {
config.ParseOp = t;
},
getParseOp: () => config.ParseOp,
setParseObject(t) {
config.ParseObject = t;
},
getParseObject: () => config.ParseObject,
setParseQuery(t) {
config.ParseQuery = t;
},
getParseQuery: () => config.ParseQuery,
setParseRole(t) {
config.ParseRole = t;
},
getParseRole: () => config.ParseRole,
setParseUser(t) {
config.ParseUser = t;
},
getParseUser: () => config.ParseUser
}, buffer, base64Js, lookup, revLookup, Arr, code, i, len, ieee754, Buffer$1, Blob$1, BlobOptions, Buffer$1$1, File, FileOptions, INSPECT_MAX_BYTES, SlowBuffer, TranscodeEncoding, atob, btoa, constants, isAscii, isUtf8, kMaxLength, kStringMaxLength, resolveObjectURL, transcode;
function getLens(t) {
var e = t.length;
if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
var r = t.indexOf("=");
return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4];
}
function byteLength(t) {
var e = getLens(t), r = e[0], i = e[1];
return 3 * (r + i) / 4 - i;
}
function _byteLength(t, e, r) {
return 3 * (e + r) / 4 - r;
}
function toByteArray(t) {
var e, r, i = getLens(t), n = i[0], o = i[1], s = new Arr(_byteLength(t, n, o)), a = 0, h = o > 0 ? n - 4 : n;
for (r = 0; r < h; r += 4) e = revLookup[t.charCodeAt(r)] << 18 | revLookup[t.charCodeAt(r + 1)] << 12 | revLookup[t.charCodeAt(r + 2)] << 6 | revLookup[t.charCodeAt(r + 3)], s[a++] = e >> 16 & 255, s[a++] = e >> 8 & 255, s[a++] = 255 & e;
return 2 === o && (e = revLookup[t.charCodeAt(r)] << 2 | revLookup[t.charCodeAt(r + 1)] >> 4, s[a++] = 255 & e), 1 === o && (e = revLookup[t.charCodeAt(r)] << 10 | revLookup[t.charCodeAt(r + 1)] << 4 | revLookup[t.charCodeAt(r + 2)] >> 2, s[a++] = e >> 8 & 255, s[a++] = 255 & e), s;
}
function tripletToBase64(t) {
return lookup[t >> 18 & 63] + lookup[t >> 12 & 63] + lookup[t >> 6 & 63] + lookup[63 & t];
}
function encodeChunk(t, e, r) {
for (var i, n = [], o = e; o < r; o += 3) i = (t[o] << 16 & 16711680) + (t[o + 1] << 8 & 65280) + (255 & t[o + 2]), n.push(tripletToBase64(i));
return n.join("");
}
function fromByteArray(t) {
for (var e, r = t.length, i = r % 3, n = [], o = 16383, s = 0, a = r - i; s < a; s += o) n.push(encodeChunk(t, s, s + o > a ? a : s + o));
return 1 === i ? (e = t[r - 1], n.push(lookup[e >> 2] + lookup[e << 4 & 63] + "==")) : 2 === i && (e = (t[r - 2] << 8) + t[r - 1], n.push(lookup[e >> 10] + lookup[e >> 4 & 63] + lookup[e << 2 & 63] + "=")), n.join("");
}
var init_dist$1 = __esmMin((() => {
for (buffer = {}, (base64Js = {}).byteLength = byteLength, base64Js.toByteArray = toByteArray, base64Js.fromByteArray = fromByteArray, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, i = 0, len = (code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").length; i < len; ++i) lookup[i] = code[i], revLookup[code.charCodeAt(i)] = i;
revLookup["-".charCodeAt(0)] = 62, revLookup["_".charCodeAt(0)] = 63, (ieee754 = {}).read = function(t, e, r, i, n) {
var o, s, a = 8 * n - i - 1, h = (1 << a) - 1, u = h >> 1, f = -7, l = r ? n - 1 : 0, c = r ? -1 : 1, d = t[e + l];
for (l += c, o = d & (1 << -f) - 1, d >>= -f, f += a; f > 0; o = 256 * o + t[e + l], l += c, f -= 8);
for (s = o & (1 << -f) - 1, o >>= -f, f += i; f > 0; s = 256 * s + t[e + l], l += c, f -= 8);
if (0 === o) o = 1 - u;
else {
if (o === h) return s ? NaN : Infinity * (d ? -1 : 1);
s += Math.pow(2, i), o -= u;
}
return (d ? -1 : 1) * s * Math.pow(2, o - i);
}, ieee754.write = function(t, e, r, i, n, o) {
var s, a, h, u = 8 * o - n - 1, f = (1 << u) - 1, l = f >> 1, c = 23 === n ? Math.pow(2, -24) - Math.pow(2, -77) : 0, d = i ? 0 : o - 1, p = i ? 1 : -1, m = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
for (e = Math.abs(e), isNaN(e) || e === Infinity ? (a = isNaN(e) ? 1 : 0, s = f) : (s = Math.floor(Math.log(e) / Math.LN2), e * (h = Math.pow(2, -s)) < 1 && (s--, h *= 2), (e += s + l >= 1 ? c / h : c * Math.pow(2, 1 - l)) * h >= 2 && (s++, h /= 2), s + l >= f ? (a = 0, s = f) : s + l >= 1 ? (a = (e * h - 1) * Math.pow(2, n), s += l) : (a = e * Math.pow(2, l - 1) * Math.pow(2, n), s = 0)); n >= 8; t[r + d] = 255 & a, d += p, a /= 256, n -= 8);
for (s = s << n | a, u += n; u > 0; t[r + d] = 255 & s, d += p, s /= 256, u -= 8);
t[r + d - p] |= 128 * m;
}, function(t) {
const e = base64Js, r = ieee754, i = "function" == typeof Symbol && "function" == typeof Symbol.for ? Symbol.for("nodejs.util.inspect.custom") : null;
t.Buffer = u, t.SlowBuffer = function(t) {
+t != t && (t = 0);
return u.alloc(+t);
}, t.INSPECT_MAX_BYTES = 50;
const n = 2147483647;
t.kMaxLength = n;
const { Uint8Array: o, ArrayBuffer: s, SharedArrayBuffer: a } = globalThis;
function h(t) {
if (t > n) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
const e = new o(t);
return Object.setPrototypeOf(e, u.prototype), e;
}
function u(t, e, r) {
if ("number" == typeof t) {
if ("string" == typeof e) throw new TypeError("The \"string\" argument must be of type string. Received type number");
return c(t);
}
return f(t, e, r);
}
function f(t, e, r) {
if ("string" == typeof t) return function(t, e) {
"string" == typeof e && "" !== e || (e = "utf8");
if (!u.isEncoding(e)) throw new TypeError("Unknown encoding: " + e);
const r = 0 | g(t, e);
let i = h(r);
const n = i.write(t, e);
n !== r && (i = i.slice(0, n));
return i;
}(t, e);
if (s.isView(t)) return function(t) {
if (Q(t, o)) {
const e = new o(t);
return p(e.buffer, e.byteOffset, e.byteLength);
}
return d(t);
}(t);
if (null == t) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
if (Q(t, s) || t && Q(t.buffer, s)) return p(t, e, r);
if (void 0 !== a && (Q(t, a) || t && Q(t.buffer, a))) return p(t, e, r);
if ("number" == typeof t) throw new TypeError("The \"value\" argument must not be of type number. Received type number");
const i = t.valueOf && t.valueOf();
if (null != i && i !== t) return u.from(i, e, r);
const n = function(t) {
if (u.isBuffer(t)) {
const e = 0 | m(t.length), r = h(e);
return 0 === r.length || t.copy(r, 0, 0, e), r;
}
if (void 0 !== t.length) return "number" != typeof t.length || Y(t.length) ? h(0) : d(t);
if ("Buffer" === t.type && Array.isArray(t.data)) return d(t.data);
}(t);
if (n) return n;
if ("undefined" != typeof Symbol && null != Symbol.toPrimitive && "function" == typeof t[Symbol.toPrimitive]) return u.from(t[Symbol.toPrimitive]("string"), e, r);
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
}
function l(t) {
if ("number" != typeof t) throw new TypeError("\"size\" argument must be of type number");
if (t < 0) throw new RangeError("The value \"" + t + "\" is invalid for option \"size\"");
}
function c(t) {
return l(t), h(t < 0 ? 0 : 0 | m(t));
}
function d(t) {
const e = t.length < 0 ? 0 : 0 | m(t.length), r = h(e);
for (let i = 0; i < e; i += 1) r[i] = 255 & t[i];
return r;
}
function p(t, e, r) {
if (e < 0 || t.byteLength < e) throw new RangeError("\"offset\" is outside of buffer bounds");
if (t.byteLength < e + (r || 0)) throw new RangeError("\"length\" is outside of buffer bounds");
let i;
return i = void 0 === e && void 0 === r ? new o(t) : void 0 === r ? new o(t, e) : new o(t, e, r), Object.setPrototypeOf(i, u.prototype), i;
}
function m(t) {
if (t >= n) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + n.toString(16) + " bytes");
return 0 | t;
}
function g(t, e) {
if (u.isBuffer(t)) return t.length;
if (s.isView(t) || Q(t, s)) return t.byteLength;
if ("string" != typeof t) throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof t);
const r = t.length, i = arguments.length > 2 && !0 === arguments[2];
if (!i && 0 === r) return 0;
let n = !1;
for (;;) switch (e) {
case "ascii":
case "latin1":
case "binary": return r;
case "utf8":
case "utf-8": return V(t).length;
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return 2 * r;
case "hex": return r >>> 1;
case "base64": return H(t).length;
default:
if (n) return i ? -1 : V(t).length;
e = ("" + e).toLowerCase(), n = !0;
}
}
function y(t, e, r) {
let i = !1;
if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
if ((r >>>= 0) <= (e >>>= 0)) return "";
for (t || (t = "utf8");;) switch (t) {
case "hex": return R(this, e, r);
case "utf8":
case "utf-8": return O(this, e, r);
case "ascii": return I(this, e, r);
case "latin1":
case "binary": return k(this, e, r);
case "base64": return C(this, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return q(this, e, r);
default:
if (i) throw new TypeError("Unknown encoding: " + t);
t = (t + "").toLowerCase(), i = !0;
}
}
function b(t, e, r) {
const i = t[e];
t[e] = t[r], t[r] = i;
}
function v(t, e, r, i, n) {
if (0 === t.length) return -1;
if ("string" == typeof r ? (i = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), Y(r = +r) && (r = n ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
if (n) return -1;
r = t.length - 1;
} else if (r < 0) {
if (!n) return -1;
r = 0;
}
if ("string" == typeof e && (e = u.from(e, i)), u.isBuffer(e)) return 0 === e.length ? -1 : _(t, e, r, i, n);
if ("number" == typeof e) return e &= 255, "function" == typeof o.prototype.indexOf ? n ? o.prototype.indexOf.call(t, e, r) : o.prototype.lastIndexOf.call(t, e, r) : _(t, [e], r, i, n);
throw new TypeError("val must be string, number or Buffer");
}
function _(t, e, r, i, n) {
let o, s = 1, a = t.length, h = e.length;
if (void 0 !== i && ("ucs2" === (i = String(i).toLowerCase()) || "ucs-2" === i || "utf16le" === i || "utf-16le" === i)) {
if (t.length < 2 || e.length < 2) return -1;
s = 2, a /= 2, h /= 2, r /= 2;
}
function u(t, e) {
return 1 === s ? t[e] : t.readUInt16BE(e * s);
}
if (n) {
let i = -1;
for (o = r; o < a; o++) if (u(t, o) === u(e, -1 === i ? 0 : o - i)) {
if (-1 === i && (i = o), o - i + 1 === h) return i * s;
} else -1 !== i && (o -= o - i), i = -1;
} else for (r + h > a && (r = a - h), o = r; o >= 0; o--) {
let r = !0;
for (let i = 0; i < h; i++) if (u(t, o + i) !== u(e, i)) {
r = !1;
break;
}
if (r) return o;
}
return -1;
}
function w(t, e, r, i) {
r = Number(r) || 0;
const n = t.length - r;
i ? (i = Number(i)) > n && (i = n) : i = n;
const o = e.length;
let s;
for (i > o / 2 && (i = o / 2), s = 0; s < i; ++s) {
const i = parseInt(e.substr(2 * s, 2), 16);
if (Y(i)) return s;
t[r + s] = i;
}
return s;
}
function M(t, e, r, i) {
return Z(V(e, t.length - r), t, r, i);
}
function S(t, e, r, i) {
return Z(function(t) {
const e = [];
for (let r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
return e;
}(e), t, r, i);
}
function E(t, e, r, i) {
return Z(H(e), t, r, i);
}
function A(t, e, r, i) {
return Z(function(t, e) {
let r, i, n;
const o = [];
for (let s = 0; s < t.length && !((e -= 2) < 0); ++s) r = t.charCodeAt(s), i = r >> 8, n = r % 256, o.push(n), o.push(i);
return o;
}(e, t.length - r), t, r, i);
}
function C(t, r, i) {
return 0 === r && i === t.length ? e.fromByteArray(t) : e.fromByteArray(t.slice(r, i));
}
function O(t, e, r) {
r = Math.min(t.length, r);
const i = [];
let n = e;
for (; n < r;) {
const e = t[n];
let o = null, s = e > 239 ? 4 : e > 223 ? 3 : e > 191 ? 2 : 1;
if (n + s <= r) {
let r, i, a, h;
switch (s) {
case 1:
e < 128 && (o = e);
break;
case 2:
r = t[n + 1], 128 == (192 & r) && (h = (31 & e) << 6 | 63 & r, h > 127 && (o = h));
break;
case 3:
r = t[n + 1], i = t[n + 2], 128 == (192 & r) && 128 == (192 & i) && (h = (15 & e) << 12 | (63 & r) << 6 | 63 & i, h > 2047 && (h < 55296 || h > 57343) && (o = h));
break;
case 4: r = t[n + 1], i = t[n + 2], a = t[n + 3], 128 == (192 & r) && 128 == (192 & i) && 128 == (192 & a) && (h = (15 & e) << 18 | (63 & r) << 12 | (63 & i) << 6 | 63 & a, h > 65535 && h < 1114112 && (o = h));
}
}
null === o ? (o = 65533, s = 1) : o > 65535 && (o -= 65536, i.push(o >>> 10 & 1023 | 55296), o = 56320 | 1023 & o), i.push(o), n += s;
}
return function(t) {
const e = t.length;
if (e <= P) return String.fromCharCode.apply(String, t);
let r = "", i = 0;
for (; i < e;) r += String.fromCharCode.apply(String, t.slice(i, i += P));
return r;
}(i);
}
u.TYPED_ARRAY_SUPPORT = function() {
try {
const t = new o(1), e = { foo: function() {
return 42;
} };
return Object.setPrototypeOf(e, o.prototype), Object.setPrototypeOf(t, e), 42 === t.foo();
} catch (t) {
return !1;
}
}(), u.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(u.prototype, "parent", {
enumerable: !0,
get: function() {
if (u.isBuffer(this)) return this.buffer;
}
}), Object.defineProperty(u.prototype, "offset", {
enumerable: !0,
get: function() {
if (u.isBuffer(this)) return this.byteOffset;
}
}), u.poolSize = 8192, u.from = function(t, e, r) {
return f(t, e, r);
}, Object.setPrototypeOf(u.prototype, o.prototype), Object.setPrototypeOf(u, o), u.alloc = function(t, e, r) {
return function(t, e, r) {
return l(t), t <= 0 ? h(t) : void 0 !== e ? "string" == typeof r ? h(t).fill(e, r) : h(t).fill(e) : h(t);
}(t, e, r);
}, u.allocUnsafe = function(t) {
return c(t);
}, u.allocUnsafeSlow = function(t) {
return c(t);
}, u.isBuffer = function(t) {
return null != t && !0 === t._isBuffer && t !== u.prototype;
}, u.compare = function(t, e) {
if (Q(t, o) && (t = u.from(t, t.offset, t.byteLength)), Q(e, o) && (e = u.from(e, e.offset, e.byteLength)), !u.isBuffer(t) || !u.isBuffer(e)) throw new TypeError("The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array");
if (t === e) return 0;
let r = t.length, i = e.length;
for (let n = 0, o = Math.min(r, i); n < o; ++n) if (t[n] !== e[n]) {
r = t[n], i = e[n];
break;
}
return r < i ? -1 : i < r ? 1 : 0;
}, u.isEncoding = function(t) {
switch (String(t).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;
}
}, u.concat = function(t, e) {
if (!Array.isArray(t)) throw new TypeError("\"list\" argument must be an Array of Buffers");
if (0 === t.length) return u.alloc(0);
let r;
if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;
const i = u.allocUnsafe(e);
let n = 0;
for (r = 0; r < t.length; ++r) {
let e = t[r];
if (Q(e, o)) n + e.length > i.length ? (u.isBuffer(e) || (e = u.from(e)), e.copy(i, n)) : o.prototype.set.call(i, e, n);
else {
if (!u.isBuffer(e)) throw new TypeError("\"list\" argument must be an Array of Buffers");
e.copy(i, n);
}
n += e.length;
}
return i;
}, u.byteLength = g, u.prototype._isBuffer = !0, u.prototype.swap16 = function() {
const t = this.length;
if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
for (let e = 0; e < t; e += 2) b(this, e, e + 1);
return this;
}, u.prototype.swap32 = function() {
const t = this.length;
if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
for (let e = 0; e < t; e += 4) b(this, e, e + 3), b(this, e + 1, e + 2);
return this;
}, u.prototype.swap64 = function() {
const t = this.length;
if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
for (let e = 0; e < t; e += 8) b(this, e, e + 7), b(this, e + 1, e + 6), b(this, e + 2, e + 5), b(this, e + 3, e + 4);
return this;
}, u.prototype.toString = function() {
const t = this.length;
return 0 === t ? "" : 0 === arguments.length ? O(this, 0, t) : y.apply(this, arguments);
}, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(t) {
if (!u.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
return this === t || 0 === u.compare(this, t);
}, u.prototype.inspect = function() {
let e = "";
const r = t.INSPECT_MAX_BYTES;
return e = this.toString("hex", 0, r).replace(/(.{2})/g, "$1 ").trim(), this.length > r && (e += " ... "), "<Buffer " + e + ">";
}, i && (u.prototype[i] = u.prototype.inspect), u.prototype.compare = function(t, e, r, i, n) {
if (Q(t, o) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(t)) throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof t);
if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === i && (i = 0), void 0 === n && (n = this.length), e < 0 || r > t.length || i < 0 || n > this.length) throw new RangeError("out of range index");
if (i >= n && e >= r) return 0;
if (i >= n) return -1;
if (e >= r) return 1;
if (this === t) return 0;
let s = (n >>>= 0) - (i >>>= 0), a = (r >>>= 0) - (e >>>= 0);
const h = Math.min(s, a), f = this.slice(i, n), l = t.slice(e, r);
for (let t = 0; t < h; ++t) if (f[t] !== l[t]) {
s = f[t], a = l[t];
break;
}
return s < a ? -1 : a < s ? 1 : 0;
}, u.prototype.includes = function(t, e, r) {
return -1 !== this.indexOf(t, e, r);
}, u.prototype.indexOf = function(t, e, r) {
return v(this, t, e, r, !0);
}, u.prototype.lastIndexOf = function(t, e, r) {
return v(this, t, e, r, !1);
}, u.prototype.write = function(t, e, r, i) {
if (void 0 === e) i = "utf8", r = this.length, e = 0;
else if (void 0 === r && "string" == typeof e) i = e, r = this.length, e = 0;
else {
if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
e >>>= 0, isFinite(r) ? (r >>>= 0, void 0 === i && (i = "utf8")) : (i = r, r = void 0);
}
const n = this.length - e;
if ((void 0 === r || r > n) && (r = n), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
i || (i = "utf8");
let o = !1;
for (;;) switch (i) {
case "hex": return w(this, t, e, r);
case "utf8":
case "utf-8": return M(this, t, e, r);
case "ascii":
case "latin1":
case "binary": return S(this, t, e, r);
case "base64": return E(this, t, e, r);
case "ucs2":
case "ucs-2":
case "utf16le":
case "utf-16le": return A(this, t, e, r);
default:
if (o) throw new TypeError("Unknown encoding: " + i);
i = ("" + i).toLowerCase(), o = !0;
}
}, u.prototype.toJSON = function() {
return {
type: "Buffer",
data: Array.prototype.slice.call(this._arr || this, 0)
};
};
const P = 4096;
function I(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(127 & t[n]);
return i;
}
function k(t, e, r) {
let i = "";
r = Math.min(t.length, r);
for (let n = e; n < r; ++n) i += String.fromCharCode(t[n]);
return i;
}
function R(t, e, r) {
const i = t.length;
(!e || e < 0) && (e = 0), (!r || r < 0 || r > i) && (r = i);
let n = "";
for (let i = e; i < r; ++i) n += G[t[i]];
return n;
}
function q(t, e, r) {
const i = t.slice(e, r);
let n = "";
for (let t = 0; t < i.length - 1; t += 2) n += String.fromCharCode(i[t] + 256 * i[t + 1]);
return n;
}
function T(t, e, r) {
if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
if (t + e > r) throw new RangeError("Trying to access beyond buffer length");
}
function x(t, e, r, i, n, o) {
if (!u.isBuffer(t)) throw new TypeError("\"buffer\" argument must be a Buffer instance");
if (e > n || e < o) throw new RangeError("\"value\" argument is out of bounds");
if (r + i > t.length) throw new RangeError("Index out of range");
}
function N(t, e, r, i, n) {
J(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o, o >>= 8, t[r++] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, s >>= 8, t[r++] = s, r;
}
function B(t, e, r, i, n) {
J(e, i, n, t, r, 7);
let o = Number(e & BigInt(4294967295));
t[r + 7] = o, o >>= 8, t[r + 6] = o, o >>= 8, t[r + 5] = o, o >>= 8, t[r + 4] = o;
let s = Number(e >> BigInt(32) & BigInt(4294967295));
return t[r + 3] = s, s >>= 8, t[r + 2] = s, s >>= 8, t[r + 1] = s, s >>= 8, t[r] = s, r + 8;
}
function j(t, e, r, i, n, o) {
if (r + i > t.length) throw new RangeError("Index out of range");
if (r < 0) throw new RangeError("Index out of range");
}
function L(t, e, i, n, o) {
return e = +e, i >>>= 0, o || j(t, 0, i, 4), r.write(t, e, i, n, 23, 4), i + 4;
}
function D(t, e, i, n, o) {
return e = +e, i >>>= 0, o || j(t, 0, i, 8), r.write(t, e, i, n, 52, 8), i + 8;
}
u.prototype.slice = function(t, e) {
const r = this.length;
(t = ~~t) < 0 ? (t += r) < 0 && (t = 0) : t > r && (t = r), (e = void 0 === e ? r : ~~e) < 0 ? (e += r) < 0 && (e = 0) : e > r && (e = r), e < t && (e = t);
const i = this.subarray(t, e);
return Object.setPrototypeOf(i, u.prototype), i;
}, u.prototype.readUintLE = u.prototype.readUIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return i;
}, u.prototype.readUintBE = u.prototype.readUIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t + --e], n = 1;
for (; e > 0 && (n *= 256);) i += this[t + --e] * n;
return i;
}, u.prototype.readUint8 = u.prototype.readUInt8 = function(t, e) {
return t >>>= 0, e || T(t, 1, this.length), this[t];
}, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(t, e) {
return t >>>= 0, e || T(t, 2, this.length), this[t] | this[t + 1] << 8;
}, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(t, e) {
return t >>>= 0, e || T(t, 2, this.length), this[t] << 8 | this[t + 1];
}, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3];
}, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
}, u.prototype.readBigUInt64LE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24, n = this[++t] + 256 * this[++t] + 65536 * this[++t] + r * 2 ** 24;
return BigInt(i) + (BigInt(n) << BigInt(32));
})), u.prototype.readBigUInt64BE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = e * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + this[++t], n = this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r;
return (BigInt(i) << BigInt(32)) + BigInt(n);
})), u.prototype.readIntLE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = this[t], n = 1, o = 0;
for (; ++o < e && (n *= 256);) i += this[t + o] * n;
return n *= 128, i >= n && (i -= Math.pow(2, 8 * e)), i;
}, u.prototype.readIntBE = function(t, e, r) {
t >>>= 0, e >>>= 0, r || T(t, e, this.length);
let i = e, n = 1, o = this[t + --i];
for (; i > 0 && (n *= 256);) o += this[t + --i] * n;
return n *= 128, o >= n && (o -= Math.pow(2, 8 * e)), o;
}, u.prototype.readInt8 = function(t, e) {
return t >>>= 0, e || T(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t];
}, u.prototype.readInt16LE = function(t, e) {
t >>>= 0, e || T(t, 2, this.length);
const r = this[t] | this[t + 1] << 8;
return 32768 & r ? 4294901760 | r : r;
}, u.prototype.readInt16BE = function(t, e) {
t >>>= 0, e || T(t, 2, this.length);
const r = this[t + 1] | this[t] << 8;
return 32768 & r ? 4294901760 | r : r;
}, u.prototype.readInt32LE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
}, u.prototype.readInt32BE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
}, u.prototype.readBigInt64LE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = this[t + 4] + 256 * this[t + 5] + 65536 * this[t + 6] + (r << 24);
return (BigInt(i) << BigInt(32)) + BigInt(e + 256 * this[++t] + 65536 * this[++t] + this[++t] * 2 ** 24);
})), u.prototype.readBigInt64BE = X((function(t) {
z(t >>>= 0, "offset");
const e = this[t], r = this[t + 7];
void 0 !== e && void 0 !== r || K(t, this.length - 8);
const i = (e << 24) + 65536 * this[++t] + 256 * this[++t] + this[++t];
return (BigInt(i) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + 65536 * this[++t] + 256 * this[++t] + r);
})), u.prototype.readFloatLE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), r.read(this, t, !0, 23, 4);
}, u.prototype.readFloatBE = function(t, e) {
return t >>>= 0, e || T(t, 4, this.length), r.read(this, t, !1, 23, 4);
}, u.prototype.readDoubleLE = function(t, e) {
return t >>>= 0, e || T(t, 8, this.length), r.read(this, t, !0, 52, 8);
}, u.prototype.readDoubleBE = function(t, e) {
return t >>>= 0, e || T(t, 8, this.length), r.read(this, t, !1, 52, 8);
}, u.prototype.writeUintLE = u.prototype.writeUIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) x(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = 1, o = 0;
for (this[e] = 255 & t; ++o < r && (n *= 256);) this[e + o] = t / n & 255;
return e + r;
}, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, r >>>= 0, !i) x(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
let n = r - 1, o = 1;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) this[e + n] = t / o & 255;
return e + r;
}, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 1, 255, 0), this[e] = 255 & t, e + 1;
}, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 65535, 0), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t, e + 4;
}, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, u.prototype.writeBigUInt64LE = X((function(t, e = 0) {
return N(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), u.prototype.writeBigUInt64BE = X((function(t, e = 0) {
return B(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
})), u.prototype.writeIntLE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
x(this, t, e, r, i - 1, -i);
}
let n = 0, o = 1, s = 0;
for (this[e] = 255 & t; ++n < r && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n - 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, u.prototype.writeIntBE = function(t, e, r, i) {
if (t = +t, e >>>= 0, !i) {
const i = Math.pow(2, 8 * r - 1);
x(this, t, e, r, i - 1, -i);
}
let n = r - 1, o = 1, s = 0;
for (this[e + n] = 255 & t; --n >= 0 && (o *= 256);) t < 0 && 0 === s && 0 !== this[e + n + 1] && (s = 1), this[e + n] = (t / o | 0) - s & 255;
return e + r;
}, u.prototype.writeInt8 = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1;
}, u.prototype.writeInt16LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 32767, -32768), this[e] = 255 & t, this[e + 1] = t >>> 8, e + 2;
}, u.prototype.writeInt16BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = 255 & t, e + 2;
}, u.prototype.writeInt32LE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 2147483647, -2147483648), this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
}, u.prototype.writeInt32BE = function(t, e, r) {
return t = +t, e >>>= 0, r || x(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t, e + 4;
}, u.prototype.writeBigInt64LE = X((function(t, e = 0) {
return N(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), u.prototype.writeBigInt64BE = X((function(t, e = 0) {
return B(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
})), u.prototype.writeFloatLE = function(t, e, r) {
return L(this, t, e, !0, r);
}, u.prototype.writeFloatBE = function(t, e, r) {
return L(this, t, e, !1, r);
}, u.prototype.writeDoubleLE = function(t, e, r) {
return D(this, t, e, !0, r);
}, u.prototype.writeDoubleBE = function(t, e, r) {
return D(this, t, e, !1, r);
}, u.prototype.copy = function(t, e, r, i) {
if (!u.isBuffer(t)) throw new TypeError("argument should be a Buffer");
if (r || (r = 0), i || 0 === i || (i = this.length), e >= t.length && (e = t.length), e || (e = 0), i > 0 && i < r && (i = r), i === r) return 0;
if (0 === t.length || 0 === this.length) return 0;
if (e < 0) throw new RangeError("targetStart out of bounds");
if (r < 0 || r >= this.length) throw new RangeError("Index out of range");
if (i < 0) throw new RangeError("sourceEnd out of bounds");
i > this.length && (i = this.length), t.length - e < i - r && (i = t.length - e + r);
const n = i - r;
return this === t && "function" == typeof o.prototype.copyWithin ? this.copyWithin(e, r, i) : o.prototype.set.call(t, this.subarray(r, i), e), n;
}, u.prototype.fill = function(t, e, r, i) {
if ("string" == typeof t) {
if ("string" == typeof e ? (i = e, e = 0, r = this.length) : "string" == typeof r && (i = r, r = this.length), void 0 !== i && "string" != typeof i) throw new TypeError("encoding must be a string");
if ("string" == typeof i && !u.isEncoding(i)) throw new TypeError("Unknown encoding: " + i);
if (1 === t.length) {
const e = t.charCodeAt(0);
("utf8" === i && e < 128 || "latin1" === i) && (t = e);
}
} else "number" == typeof t ? t &= 255 : "boolean" == typeof t && (t = Number(t));
if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
if (r <= e) return this;
let n;
if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), "number" == typeof t) for (n = e; n < r; ++n) this[n] = t;
else {
const o = u.isBuffer(t) ? t : u.from(t, i), s = o.length;
if (0 === s) throw new TypeError("The value \"" + t + "\" is invalid for argument \"value\"");
for (n = 0; n < r - e; ++n) this[n + e] = o[n % s];
}
return this;
};
const U = {};
function $(t, e, r) {
U[t] = class extends r {
constructor() {
super(), Object.defineProperty(this, "message", {
value: e.apply(this, arguments),
writable: !0,
configurable: !0
}), this.name = `${this.name} [${t}]`, this.stack, delete this.name;
}
get code() {
return t;
}
set code(t) {
Object.defineProperty(this, "code", {
configurable: !0,
enumerable: !0,
value: t,
writable: !0
});
}
toString() {
return `${this.name} [${t}]: ${this.message}`;
}
};
}
function F(t) {
let e = "", r = t.length;
const i = "-" === t[0] ? 1 : 0;
for (; r >= i + 4; r -= 3) e = `_${t.slice(r - 3, r)}${e}`;
return `${t.slice(0, r)}${e}`;
}
function J(t, e, r, i, n, o) {
if (t > r || t < e) {
const i = "bigint" == typeof e ? "n" : "";
let n;
throw n = o > 3 ? 0 === e || e === BigInt(0) ? `>= 0${i} and < 2${i} ** ${8 * (o + 1)}${i}` : `>= -(2${i} ** ${8 * (o + 1) - 1}${i}) and < 2 ** ${8 * (o + 1) - 1}${i}` : `>= ${e}${i} and <= ${r}${i}`, new U.ERR_OUT_OF_RANGE("value", n, t);
}
(function(t, e, r) {
z(e, "offset"), void 0 !== t[e] && void 0 !== t[e + r] || K(e, t.length - (r + 1));
})(i, n, o);
}
function z(t, e) {
if ("number" != typeof t) throw new U.ERR_INVALID_ARG_TYPE(e, "number", t);
}
function K(t, e, r) {
if (Math.floor(t) !== t) throw z(t, r), new U.ERR_OUT_OF_RANGE(r || "offset", "an integer", t);
if (e < 0) throw new U.ERR_BUFFER_OUT_OF_BOUNDS();
throw new U.ERR_OUT_OF_RANGE(r || "offset", `>= ${r ? 1 : 0} and <= ${e}`, t);
}
$("ERR_BUFFER_OUT_OF_BOUNDS", (function(t) {
return t ? `${t} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
}), RangeError), $("ERR_INVALID_ARG_TYPE", (function(t, e) {
return `The "${t}" argument must be of type number. Received type ${typeof e}`;
}), TypeError), $("ERR_OUT_OF_RANGE", (function(t, e, r) {
let i = `The value of "${t}" is out of range.`, n = r;
return Number.isInteger(r) && Math.abs(r) > 2 ** 32 ? n = F(String(r)) : "bigint" == typeof r && (n = String(r), (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) && (n = F(n)), n += "n"), i += ` It must be ${e}. Received ${n}`, i;
}), RangeError);
const W = /[^+/0-9A-Za-z-_]/g;
function V(t, e) {
let r;
e = e || Infinity;
const i = t.length;
let n = null;
const o = [];
for (let s = 0; s < i; ++s) {
if (r = t.charCodeAt(s), r > 55295 && r < 57344) {
if (!n) {
if (r > 56319) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
if (s + 1 === i) {
(e -= 3) > -1 && o.push(239, 191, 189);
continue;
}
n = r;
continue;
}
if (r < 56320) {
(e -= 3) > -1 && o.push(239, 191, 189), n = r;
continue;
}
r = 65536 + (n - 55296 << 10 | r - 56320);
} else n && (e -= 3) > -1 && o.push(239, 191, 189);
if (n = null, r < 128) {
if ((e -= 1) < 0) break;
o.push(r);
} else if (r < 2048) {
if ((e -= 2) < 0) break;
o.push(r >> 6 | 192, 63 & r | 128);
} else if (r < 65536) {
if ((e -= 3) < 0) break;
o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128);
} else {
if (!(r < 1114112)) throw new Error("Invalid code point");
if ((e -= 4) < 0) break;
o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128);
}
}
return o;
}
function H(t) {
return e.toByteArray(function(t) {
if ((t = (t = t.split("=")[0]).trim().replace(W, "")).length < 2) return "";
for (; t.length % 4 != 0;) t += "=";
return t;
}(t));
}
function Z(t, e, r, i) {
let n;
for (n = 0; n < i && !(n + r >= e.length || n >= t.length); ++n) e[n + r] = t[n];
return n;
}
function Q(t, e) {
return t instanceof e || null != t && null != t.constructor && null != t.constructor.name && t.constructor.name === e.name;
}
function Y(t) {
return t != t;
}
const G = function() {
const t = "0123456789abcdef", e = new Array(256);
for (let r = 0; r < 16; ++r) {
const i = 16 * r;
for (let n = 0; n < 16; ++n) e[i + n] = t[r] + t[n];
}
return e;
}();
function X(t) {
return "undefined" == typeof BigInt ? tt : t;
}
function tt() {
throw new Error("BigInt not supported");
}
}(buffer), Buffer$1 = buffer.Buffer, buffer.Blob, buffer.BlobOptions, buffer.Buffer, buffer.File, buffer.FileOptions, buffer.INSPECT_MAX_BYTES, buffer.SlowBuffer, buffer.TranscodeEncoding, buffer.atob, buffer.btoa, buffer.constants, buffer.isAscii, buffer.isUtf8, buffer.kMaxLength, buffer.kStringMaxLength, buffer.resolveObjectURL, buffer.transcode;
})), require_events = __commonJSMin(((t, e) => {
var r, i = "object" == typeof Reflect ? Reflect : null, n = i && "function" == typeof i.apply ? i.apply : function(t, e, r) {
return Function.prototype.apply.call(t, e, r);
};
r = i && "function" == typeof i.ownKeys ? i.ownKey