274 lines
9.5 KiB
JavaScript
274 lines
9.5 KiB
JavaScript
// @ts-nocheck
|
|
// This file is generated automatically
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// node_modules/p-defer/index.js
|
|
var require_p_defer = __commonJS({
|
|
"node_modules/p-defer/index.js"(exports, module2) {
|
|
"use strict";
|
|
module2.exports = () => {
|
|
const ret = {};
|
|
ret.promise = new Promise((resolve, reject) => {
|
|
ret.resolve = resolve;
|
|
ret.reject = reject;
|
|
});
|
|
return ret;
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/map-age-cleaner/dist/index.js
|
|
var require_dist = __commonJS({
|
|
"node_modules/map-age-cleaner/dist/index.js"(exports, module2) {
|
|
"use strict";
|
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : new P(function(resolve2) {
|
|
resolve2(result.value);
|
|
}).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
};
|
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var p_defer_1 = __importDefault(require_p_defer());
|
|
function mapAgeCleaner2(map, property = "maxAge") {
|
|
let processingKey;
|
|
let processingTimer;
|
|
let processingDeferred;
|
|
const cleanup = () => __awaiter(this, void 0, void 0, function* () {
|
|
if (processingKey !== void 0) {
|
|
return;
|
|
}
|
|
const setupTimer = (item) => __awaiter(this, void 0, void 0, function* () {
|
|
processingDeferred = p_defer_1.default();
|
|
const delay = item[1][property] - Date.now();
|
|
if (delay <= 0) {
|
|
map.delete(item[0]);
|
|
processingDeferred.resolve();
|
|
return;
|
|
}
|
|
processingKey = item[0];
|
|
processingTimer = setTimeout(() => {
|
|
map.delete(item[0]);
|
|
if (processingDeferred) {
|
|
processingDeferred.resolve();
|
|
}
|
|
}, delay);
|
|
if (typeof processingTimer.unref === "function") {
|
|
processingTimer.unref();
|
|
}
|
|
return processingDeferred.promise;
|
|
});
|
|
try {
|
|
for (const entry of map) {
|
|
yield setupTimer(entry);
|
|
}
|
|
} catch (_a) {
|
|
}
|
|
processingKey = void 0;
|
|
});
|
|
const reset = () => {
|
|
processingKey = void 0;
|
|
if (processingTimer !== void 0) {
|
|
clearTimeout(processingTimer);
|
|
processingTimer = void 0;
|
|
}
|
|
if (processingDeferred !== void 0) {
|
|
processingDeferred.reject(void 0);
|
|
processingDeferred = void 0;
|
|
}
|
|
};
|
|
const originalSet = map.set.bind(map);
|
|
map.set = (key, value) => {
|
|
if (map.has(key)) {
|
|
map.delete(key);
|
|
}
|
|
const result = originalSet(key, value);
|
|
if (processingKey && processingKey === key) {
|
|
reset();
|
|
}
|
|
cleanup();
|
|
return result;
|
|
};
|
|
cleanup();
|
|
return map;
|
|
}
|
|
exports.default = mapAgeCleaner2;
|
|
module2.exports = mapAgeCleaner2;
|
|
module2.exports.default = mapAgeCleaner2;
|
|
}
|
|
});
|
|
|
|
// node_modules/mem/dist/index.js
|
|
var dist_exports = {};
|
|
__export(dist_exports, {
|
|
default: () => mem,
|
|
memClear: () => memClear,
|
|
memDecorator: () => memDecorator
|
|
});
|
|
module.exports = __toCommonJS(dist_exports);
|
|
|
|
// node_modules/mimic-fn/index.js
|
|
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
if (property === "length" || property === "prototype") {
|
|
return;
|
|
}
|
|
if (property === "arguments" || property === "caller") {
|
|
return;
|
|
}
|
|
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
return;
|
|
}
|
|
Object.defineProperty(to, property, fromDescriptor);
|
|
};
|
|
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
};
|
|
var changePrototype = (to, from) => {
|
|
const fromPrototype = Object.getPrototypeOf(from);
|
|
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
return;
|
|
}
|
|
Object.setPrototypeOf(to, fromPrototype);
|
|
};
|
|
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
${fromBody}`;
|
|
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
var changeToString = (to, from, name) => {
|
|
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
Object.defineProperty(newToString, "name", toStringName);
|
|
Object.defineProperty(to, "toString", __spreadProps(__spreadValues({}, toStringDescriptor), { value: newToString }));
|
|
};
|
|
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
const { name } = to;
|
|
for (const property of Reflect.ownKeys(from)) {
|
|
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
}
|
|
changePrototype(to, from);
|
|
changeToString(to, from, name);
|
|
return to;
|
|
}
|
|
|
|
// node_modules/mem/dist/index.js
|
|
var import_map_age_cleaner = __toESM(require_dist(), 1);
|
|
var cacheStore = /* @__PURE__ */ new WeakMap();
|
|
function mem(fn, { cacheKey, cache = /* @__PURE__ */ new Map(), maxAge } = {}) {
|
|
if (typeof maxAge === "number") {
|
|
(0, import_map_age_cleaner.default)(cache);
|
|
}
|
|
const memoized = function(...arguments_) {
|
|
const key = cacheKey ? cacheKey(arguments_) : arguments_[0];
|
|
const cacheItem = cache.get(key);
|
|
if (cacheItem) {
|
|
return cacheItem.data;
|
|
}
|
|
const result = fn.apply(this, arguments_);
|
|
cache.set(key, {
|
|
data: result,
|
|
maxAge: maxAge ? Date.now() + maxAge : Number.POSITIVE_INFINITY
|
|
});
|
|
return result;
|
|
};
|
|
mimicFunction(memoized, fn, {
|
|
ignoreNonConfigurable: true
|
|
});
|
|
cacheStore.set(memoized, cache);
|
|
return memoized;
|
|
}
|
|
function memDecorator(options = {}) {
|
|
const instanceMap = /* @__PURE__ */ new WeakMap();
|
|
return (target, propertyKey, descriptor) => {
|
|
const input = target[propertyKey];
|
|
if (typeof input !== "function") {
|
|
throw new TypeError("The decorated value must be a function");
|
|
}
|
|
delete descriptor.value;
|
|
delete descriptor.writable;
|
|
descriptor.get = function() {
|
|
if (!instanceMap.has(this)) {
|
|
const value = mem(input, options);
|
|
instanceMap.set(this, value);
|
|
return value;
|
|
}
|
|
return instanceMap.get(this);
|
|
};
|
|
};
|
|
}
|
|
function memClear(fn) {
|
|
const cache = cacheStore.get(fn);
|
|
if (!cache) {
|
|
throw new TypeError("Can't clear a function that was not memoized!");
|
|
}
|
|
if (typeof cache.clear !== "function") {
|
|
throw new TypeError("The cache Map can't be cleared!");
|
|
}
|
|
cache.clear();
|
|
}
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
memClear,
|
|
memDecorator
|
|
});
|