lakutata
Version:
An IoC-based universal application framework.
622 lines (574 loc) • 18 kB
JavaScript
;
const e = require("./Package.5.cjs");
require("./Package.132.cjs");
require("./Package.10.cjs");
const t = require("tty");
const r = require("util");
const s = e => e && e.__esModule ? e : {
default: e
};
const n = s(t);
const o = s(r);
var i = {
exports: {}
};
var c = {
exports: {}
};
var a = c.exports;
var u;
function l() {
if (u) return c.exports;
u = 1;
if (typeof Object.create === "function") {
c.exports = function e(t, r) {
if (r) {
t.super_ = r;
t.prototype = Object.create(r.prototype, {
constructor: {
value: t,
enumerable: false,
writable: true,
configurable: true
}
});
}
};
} else {
c.exports = function e(t, r) {
if (r) {
t.super_ = r;
var s = function() {};
s.prototype = r.prototype;
t.prototype = new s;
t.prototype.constructor = t;
}
};
}
return c.exports;
}
var f = i.exports;
var p;
function d() {
if (p) return i.exports;
p = 1;
try {
var e = require("util");
if (typeof e.inherits !== "function") throw "";
i.exports = e.inherits;
} catch (e) {
i.exports = l();
}
return i.exports;
}
var C = {
exports: {}
};
var m = {
exports: {}
};
var h;
var g;
function F() {
if (g) return h;
g = 1;
var e = 1e3;
var t = e * 60;
var r = t * 60;
var s = r * 24;
var n = s * 7;
var o = s * 365.25;
h = function(e, t) {
t = t || {};
var r = typeof e;
if (r === "string" && e.length > 0) {
return i(e);
} else if (r === "number" && isFinite(e)) {
return t.long ? a(e) : c(e);
}
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e));
};
function i(i) {
i = String(i);
if (i.length > 100) {
return;
}
var c = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);
if (!c) {
return;
}
var a = parseFloat(c[1]);
var u = (c[2] || "ms").toLowerCase();
switch (u) {
case "years":
case "year":
case "yrs":
case "yr":
case "y":
return a * o;
case "weeks":
case "week":
case "w":
return a * n;
case "days":
case "day":
case "d":
return a * s;
case "hours":
case "hour":
case "hrs":
case "hr":
case "h":
return a * r;
case "minutes":
case "minute":
case "mins":
case "min":
case "m":
return a * t;
case "seconds":
case "second":
case "secs":
case "sec":
case "s":
return a * e;
case "milliseconds":
case "millisecond":
case "msecs":
case "msec":
case "ms":
return a;
default:
return undefined;
}
}
function c(n) {
var o = Math.abs(n);
if (o >= s) {
return Math.round(n / s) + "d";
}
if (o >= r) {
return Math.round(n / r) + "h";
}
if (o >= t) {
return Math.round(n / t) + "m";
}
if (o >= e) {
return Math.round(n / e) + "s";
}
return n + "ms";
}
function a(n) {
var o = Math.abs(n);
if (o >= s) {
return u(n, o, s, "day");
}
if (o >= r) {
return u(n, o, r, "hour");
}
if (o >= t) {
return u(n, o, t, "minute");
}
if (o >= e) {
return u(n, o, e, "second");
}
return n + " ms";
}
function u(e, t, r, s) {
var n = t >= r * 1.5;
return Math.round(e / r) + " " + s + (n ? "s" : "");
}
return h;
}
var v;
var y;
function b() {
if (y) return v;
y = 1;
function e(e) {
r.debug = r;
r.default = r;
r.coerce = a;
r.disable = i;
r.enable = n;
r.enabled = c;
r.humanize = F();
r.destroy = u;
Object.keys(e).forEach((t => {
r[t] = e[t];
}));
r.names = [];
r.skips = [];
r.formatters = {};
function t(e) {
let t = 0;
for (let r = 0; r < e.length; r++) {
t = (t << 5) - t + e.charCodeAt(r);
t |= 0;
}
return r.colors[Math.abs(t) % r.colors.length];
}
r.selectColor = t;
function r(e) {
let t;
let n = null;
let o;
let i;
function c(...e) {
if (!c.enabled) {
return;
}
const s = c;
const n = Number(new Date);
const o = n - (t || n);
s.diff = o;
s.prev = t;
s.curr = n;
t = n;
e[0] = r.coerce(e[0]);
if (typeof e[0] !== "string") {
e.unshift("%O");
}
let i = 0;
e[0] = e[0].replace(/%([a-zA-Z%])/g, ((t, n) => {
if (t === "%%") {
return "%";
}
i++;
const o = r.formatters[n];
if (typeof o === "function") {
const r = e[i];
t = o.call(s, r);
e.splice(i, 1);
i--;
}
return t;
}));
r.formatArgs.call(s, e);
const a = s.log || r.log;
a.apply(s, e);
}
c.namespace = e;
c.useColors = r.useColors();
c.color = r.selectColor(e);
c.extend = s;
c.destroy = r.destroy;
Object.defineProperty(c, "enabled", {
enumerable: true,
configurable: false,
get: () => {
if (n !== null) {
return n;
}
if (o !== r.namespaces) {
o = r.namespaces;
i = r.enabled(e);
}
return i;
},
set: e => {
n = e;
}
});
if (typeof r.init === "function") {
r.init(c);
}
return c;
}
function s(e, t) {
const s = r(this.namespace + (typeof t === "undefined" ? ":" : t) + e);
s.log = this.log;
return s;
}
function n(e) {
r.save(e);
r.namespaces = e;
r.names = [];
r.skips = [];
const t = (typeof e === "string" ? e : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
for (const e of t) {
if (e[0] === "-") {
r.skips.push(e.slice(1));
} else {
r.names.push(e);
}
}
}
function o(e, t) {
let r = 0;
let s = 0;
let n = -1;
let o = 0;
while (r < e.length) {
if (s < t.length && (t[s] === e[r] || t[s] === "*")) {
if (t[s] === "*") {
n = s;
o = r;
s++;
} else {
r++;
s++;
}
} else if (n !== -1) {
s = n + 1;
o++;
r = o;
} else {
return false;
}
}
while (s < t.length && t[s] === "*") {
s++;
}
return s === t.length;
}
function i() {
const e = [ ...r.names, ...r.skips.map((e => "-" + e)) ].join(",");
r.enable("");
return e;
}
function c(e) {
for (const t of r.skips) {
if (o(e, t)) {
return false;
}
}
for (const t of r.names) {
if (o(e, t)) {
return true;
}
}
return false;
}
function a(e) {
if (e instanceof Error) {
return e.stack || e.message;
}
return e;
}
function u() {
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
r.enable(r.load());
return r;
}
v = e;
return v;
}
var w = m.exports;
var x;
function O() {
if (x) return m.exports;
x = 1;
(function(e, t) {
t.formatArgs = s;
t.save = n;
t.load = o;
t.useColors = r;
t.storage = i();
t.destroy = (() => {
let e = false;
return () => {
if (!e) {
e = true;
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
}
};
})();
t.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ];
function r() {
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
return true;
}
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
return false;
}
let e;
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (e = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(e[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
function s(t) {
t[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + t[0] + (this.useColors ? "%c " : " ") + "+" + e.exports.humanize(this.diff);
if (!this.useColors) {
return;
}
const r = "color: " + this.color;
t.splice(1, 0, r, "color: inherit");
let s = 0;
let n = 0;
t[0].replace(/%[a-zA-Z%]/g, (e => {
if (e === "%%") {
return;
}
s++;
if (e === "%c") {
n = s;
}
}));
t.splice(n, 0, r);
}
t.log = console.debug || console.log || (() => {});
function n(e) {
try {
if (e) {
t.storage.setItem("debug", e);
} else {
t.storage.removeItem("debug");
}
} catch (e) {}
}
function o() {
let e;
try {
e = t.storage.getItem("debug") || t.storage.getItem("DEBUG");
} catch (e) {}
if (!e && typeof process !== "undefined" && "env" in process) {
e = process.env.DEBUG;
}
return e;
}
function i() {
try {
return localStorage;
} catch (e) {}
}
e.exports = b()(t);
const {formatters: c} = e.exports;
c.j = function(e) {
try {
return JSON.stringify(e);
} catch (e) {
return "[UnexpectedJSONParseError]: " + e.message;
}
};
})(m, m.exports);
return m.exports;
}
var j = {
exports: {}
};
var k;
var A;
function E() {
if (A) return k;
A = 1;
"use strict";
function e() {
const e = /(Chrome|Chromium)\/(?<chromeVersion>\d+)\./.exec(navigator.userAgent);
if (!e) {
return;
}
return Number.parseInt(e.groups.chromeVersion, 10);
}
const t = e() >= 69 ? {
level: 1,
hasBasic: true,
has256: false,
has16m: false
} : false;
k = {
stdout: t,
stderr: t
};
return k;
}
var I = j.exports;
var _;
function D() {
if (_) return j.exports;
_ = 1;
(function(e, t) {
const r = n.default;
const s = o.default;
t.init = p;
t.log = u;
t.formatArgs = c;
t.save = l;
t.load = f;
t.useColors = i;
t.destroy = s.deprecate((() => {}), "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
t.colors = [ 6, 2, 3, 4, 5, 1 ];
try {
const e = E();
if (e && (e.stderr || e).level >= 2) {
t.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ];
}
} catch (e) {}
t.inspectOpts = Object.keys(process.env).filter((e => /^debug_/i.test(e))).reduce(((e, t) => {
const r = t.substring(6).toLowerCase().replace(/_([a-z])/g, ((e, t) => t.toUpperCase()));
let s = process.env[t];
if (/^(yes|on|true|enabled)$/i.test(s)) {
s = true;
} else if (/^(no|off|false|disabled)$/i.test(s)) {
s = false;
} else if (s === "null") {
s = null;
} else {
s = Number(s);
}
e[r] = s;
return e;
}), {});
function i() {
return "colors" in t.inspectOpts ? Boolean(t.inspectOpts.colors) : r.isatty(process.stderr.fd);
}
function c(t) {
const {namespace: r, useColors: s} = this;
if (s) {
const s = this.color;
const n = "[3" + (s < 8 ? s : "8;5;" + s);
const o = ` ${n};1m${r} [0m`;
t[0] = o + t[0].split("\n").join("\n" + o);
t.push(n + "m+" + e.exports.humanize(this.diff) + "[0m");
} else {
t[0] = a() + r + " " + t[0];
}
}
function a() {
if (t.inspectOpts.hideDate) {
return "";
}
return (new Date).toISOString() + " ";
}
function u(...e) {
return process.stderr.write(s.formatWithOptions(t.inspectOpts, ...e) + "\n");
}
function l(e) {
if (e) {
process.env.DEBUG = e;
} else {
delete process.env.DEBUG;
}
}
function f() {
return process.env.DEBUG;
}
function p(e) {
e.inspectOpts = {};
const r = Object.keys(t.inspectOpts);
for (let s = 0; s < r.length; s++) {
e.inspectOpts[r[s]] = t.inspectOpts[r[s]];
}
}
e.exports = b()(t);
const {formatters: d} = e.exports;
d.o = function(e) {
this.inspectOpts.colors = this.useColors;
return s.inspect(e, this.inspectOpts).split("\n").map((e => e.trim())).join(" ");
};
d.O = function(e) {
this.inspectOpts.colors = this.useColors;
return s.inspect(e, this.inspectOpts);
};
})(j, j.exports);
return j.exports;
}
var M = C.exports;
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
C.exports = O();
} else {
C.exports = D();
}
var B = C.exports;
const q = e.getDefaultExportFromCjs(B);
exports.requireInherits = d;
exports.srcExports = B;