@ztimson/utils 0.18.2 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter.d.ts +5 -5
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +588 -435
- package/dist/index.mjs.map +1 -1
- package/dist/misc.d.ts +4 -0
- package/dist/path-events.d.ts +135 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var c = (
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
return Array.isArray(
|
|
7
|
-
(t &&
|
|
8
|
-
}),
|
|
9
|
-
}
|
|
10
|
-
function
|
|
11
|
-
return structuredClone(
|
|
12
|
-
}
|
|
13
|
-
function
|
|
1
|
+
var ut = Object.defineProperty;
|
|
2
|
+
var at = (n, t, e) => t in n ? ut(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var c = (n, t, e) => at(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function lt(n, t = !1) {
|
|
5
|
+
if (n == null) throw new Error("Cannot clean a NULL value");
|
|
6
|
+
return Array.isArray(n) ? n = n.filter((e) => e != null) : Object.entries(n).forEach(([e, r]) => {
|
|
7
|
+
(t && r === void 0 || !t && r == null) && delete n[e];
|
|
8
|
+
}), n;
|
|
9
|
+
}
|
|
10
|
+
function Ct(n) {
|
|
11
|
+
return structuredClone(n);
|
|
12
|
+
}
|
|
13
|
+
function ft(n, ...t) {
|
|
14
14
|
return t.forEach((e) => {
|
|
15
|
-
for (const
|
|
16
|
-
e[
|
|
17
|
-
}),
|
|
18
|
-
}
|
|
19
|
-
function
|
|
20
|
-
if (!(
|
|
21
|
-
return t.split(/[.[\]]/g).filter((
|
|
22
|
-
if ((s[0] == '"' || s[0] == "'") && (s = s.slice(1, -1)), !(
|
|
15
|
+
for (const r in e)
|
|
16
|
+
e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? (n[r] || (n[r] = {}), ft(n[r], e[r])) : n[r] = e[r];
|
|
17
|
+
}), n;
|
|
18
|
+
}
|
|
19
|
+
function x(n, t, e) {
|
|
20
|
+
if (!(n == null || !t))
|
|
21
|
+
return t.split(/[.[\]]/g).filter((r) => r.length).reduce((r, s, i, o) => {
|
|
22
|
+
if ((s[0] == '"' || s[0] == "'") && (s = s.slice(1, -1)), !(r != null && r.hasOwnProperty(s))) {
|
|
23
23
|
if (e == null) return;
|
|
24
|
-
|
|
24
|
+
r[s] = {};
|
|
25
25
|
}
|
|
26
|
-
return e !== void 0 &&
|
|
27
|
-
},
|
|
26
|
+
return e !== void 0 && i == o.length - 1 ? r[s] = e : r[s];
|
|
27
|
+
}, n);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return Object.entries(
|
|
29
|
+
function Lt(n) {
|
|
30
|
+
return Object.entries(n).map(
|
|
31
31
|
([t, e]) => encodeURIComponent(t) + "=" + encodeURIComponent(e)
|
|
32
32
|
).join("&");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (typeof
|
|
36
|
-
for (const
|
|
37
|
-
const s = t ? t + "." +
|
|
38
|
-
typeof r
|
|
34
|
+
function J(n, t, e = {}) {
|
|
35
|
+
if (typeof n == "object" && !Array.isArray(n)) {
|
|
36
|
+
for (const r of Object.keys(n)) {
|
|
37
|
+
const s = t ? t + "." + r : r;
|
|
38
|
+
typeof n[r] == "object" ? J(n[r], s, e) : e[s] = n[r];
|
|
39
39
|
}
|
|
40
40
|
return e;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function vt(n) {
|
|
44
44
|
const t = new FormData();
|
|
45
|
-
return Object.entries(
|
|
45
|
+
return Object.entries(n).forEach(([e, r]) => t.append(e, r)), t;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
if (
|
|
49
|
-
if (Array.isArray(t)) return t.findIndex((s,
|
|
50
|
-
const
|
|
51
|
-
return
|
|
47
|
+
function Y(n, t, e = !1) {
|
|
48
|
+
if (n == null) return e;
|
|
49
|
+
if (Array.isArray(t)) return t.findIndex((s, i) => !Y(n[i], t[i], e)) == -1;
|
|
50
|
+
const r = typeof t;
|
|
51
|
+
return r != typeof n ? !1 : r == "object" ? Object.keys(t).find((s) => !Y(n[s], t[s], e)) == null : r == "function" ? n.toString() == t.toString() : n == t;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
const e = typeof
|
|
55
|
-
return e != "object" ||
|
|
53
|
+
function $(n, t) {
|
|
54
|
+
const e = typeof n, r = typeof t;
|
|
55
|
+
return e != "object" || n == null || r != "object" || t == null ? e == "function" && r == "function" ? n.toString() == t.toString() : n === t : Object.keys(n).length != Object.keys(t).length ? !1 : Object.keys(n).every((i) => $(n[i], t[i]));
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Nt(n, t) {
|
|
58
58
|
t.forEach((e) => {
|
|
59
|
-
Object.getOwnPropertyNames(e.prototype).forEach((
|
|
59
|
+
Object.getOwnPropertyNames(e.prototype).forEach((r) => {
|
|
60
60
|
Object.defineProperty(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Object.getOwnPropertyDescriptor(e.prototype,
|
|
61
|
+
n.prototype,
|
|
62
|
+
r,
|
|
63
|
+
Object.getOwnPropertyDescriptor(e.prototype, r) || /* @__PURE__ */ Object.create(null)
|
|
64
64
|
);
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function k(n) {
|
|
69
69
|
try {
|
|
70
|
-
return JSON.parse(
|
|
70
|
+
return JSON.parse(n);
|
|
71
71
|
} catch {
|
|
72
|
-
return
|
|
72
|
+
return n;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function It(n, t) {
|
|
76
76
|
let e = [];
|
|
77
|
-
return JSON.stringify(
|
|
77
|
+
return JSON.stringify(n, (r, s) => {
|
|
78
78
|
if (typeof s == "object" && s !== null) {
|
|
79
79
|
if (e.includes(s)) return;
|
|
80
80
|
e.push(s);
|
|
@@ -82,42 +82,42 @@ function Lt(r, t) {
|
|
|
82
82
|
return s;
|
|
83
83
|
}, t);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function Tt(n, t) {
|
|
86
|
+
return n.indexOf(t) === -1 && n.push(t), n;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return
|
|
90
|
-
...
|
|
91
|
-
...t.filter((e) => !
|
|
88
|
+
function Mt(n, t) {
|
|
89
|
+
return dt([
|
|
90
|
+
...n.filter((e) => !t.includes((r) => $(e, r))),
|
|
91
|
+
...t.filter((e) => !n.includes((r) => $(e, r)))
|
|
92
92
|
]);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function kt(n) {
|
|
95
95
|
return function(t, e) {
|
|
96
|
-
const
|
|
97
|
-
return typeof
|
|
96
|
+
const r = x(t, n), s = x(e, n);
|
|
97
|
+
return typeof r != "string" || typeof s != "string" ? 1 : r.toLowerCase().localeCompare(s.toLowerCase());
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return (e) =>
|
|
100
|
+
function Pt(n, t) {
|
|
101
|
+
return (e) => $(x(e, n), t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function ht(n, t = []) {
|
|
104
|
+
return n.forEach((e) => Array.isArray(e) ? ht(e, t) : t.push(e)), t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return function(e,
|
|
108
|
-
const s =
|
|
109
|
-
return typeof s == "number" && typeof
|
|
106
|
+
function Dt(n, t = !1) {
|
|
107
|
+
return function(e, r) {
|
|
108
|
+
const s = x(e, n), i = x(r, n);
|
|
109
|
+
return typeof s == "number" && typeof i == "number" ? (t ? -1 : 1) * (s - i) : s > i ? t ? -1 : 1 : s < i ? t ? 1 : -1 : 0;
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
for (let t =
|
|
114
|
-
|
|
115
|
-
return
|
|
112
|
+
function dt(n) {
|
|
113
|
+
for (let t = n.length - 1; t >= 0; t--)
|
|
114
|
+
n.slice(0, t).find((e) => $(e, n[t])) && n.splice(t, 1);
|
|
115
|
+
return n;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return Array.isArray(
|
|
117
|
+
function b(n) {
|
|
118
|
+
return Array.isArray(n) ? n : [n];
|
|
119
119
|
}
|
|
120
|
-
class
|
|
120
|
+
class E extends Array {
|
|
121
121
|
/** Number of elements in set */
|
|
122
122
|
get size() {
|
|
123
123
|
return this.length;
|
|
@@ -142,8 +142,8 @@ class B extends Array {
|
|
|
142
142
|
*/
|
|
143
143
|
delete(...t) {
|
|
144
144
|
t.forEach((e) => {
|
|
145
|
-
const
|
|
146
|
-
|
|
145
|
+
const r = this.indexOf(e);
|
|
146
|
+
r != -1 && this.slice(r, 1);
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
@@ -152,7 +152,7 @@ class B extends Array {
|
|
|
152
152
|
* @return {ASet<T>} Different elements
|
|
153
153
|
*/
|
|
154
154
|
difference(t) {
|
|
155
|
-
return new
|
|
155
|
+
return new E(this.filter((e) => !t.has(e)));
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* Check if set includes element
|
|
@@ -168,7 +168,7 @@ class B extends Array {
|
|
|
168
168
|
* @return {boolean} Set of common elements
|
|
169
169
|
*/
|
|
170
170
|
intersection(t) {
|
|
171
|
-
return new
|
|
171
|
+
return new E(this.filter((e) => t.has(e)));
|
|
172
172
|
}
|
|
173
173
|
/**
|
|
174
174
|
* Check if this set has no elements in common with the comparison set
|
|
@@ -200,7 +200,7 @@ class B extends Array {
|
|
|
200
200
|
* @return {ASet<T>} New set of unique elements
|
|
201
201
|
*/
|
|
202
202
|
symmetricDifference(t) {
|
|
203
|
-
return new
|
|
203
|
+
return new E([...this.difference(t), ...t.difference(this)]);
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
206
206
|
* Create joined list of elements included in this & the comparison set
|
|
@@ -208,10 +208,10 @@ class B extends Array {
|
|
|
208
208
|
* @return {ASet<T>} New set of both previous sets combined
|
|
209
209
|
*/
|
|
210
210
|
union(t) {
|
|
211
|
-
return new
|
|
211
|
+
return new E([...this, ...t]);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
class
|
|
214
|
+
class Gt {
|
|
215
215
|
/**
|
|
216
216
|
* Create new cache
|
|
217
217
|
*
|
|
@@ -229,8 +229,8 @@ class Dt {
|
|
|
229
229
|
*/
|
|
230
230
|
c(this, "values", this.all());
|
|
231
231
|
return this.key = t, this.ttl = e, new Proxy(this, {
|
|
232
|
-
get: (
|
|
233
|
-
set: (
|
|
232
|
+
get: (r, s) => s in r ? r[s] : r.store[s],
|
|
233
|
+
set: (r, s, i) => (s in r ? r[s] = i : r.store[s] = i, !0)
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
getKey(t) {
|
|
@@ -253,8 +253,8 @@ class Dt {
|
|
|
253
253
|
* @return {this}
|
|
254
254
|
*/
|
|
255
255
|
add(t, e = this.ttl) {
|
|
256
|
-
const
|
|
257
|
-
return this.set(
|
|
256
|
+
const r = this.getKey(t);
|
|
257
|
+
return this.set(r, t, e), this;
|
|
258
258
|
}
|
|
259
259
|
/**
|
|
260
260
|
* Add several rows to the cache
|
|
@@ -264,7 +264,7 @@ class Dt {
|
|
|
264
264
|
* @return {this}
|
|
265
265
|
*/
|
|
266
266
|
addAll(t, e = !0) {
|
|
267
|
-
return t.forEach((
|
|
267
|
+
return t.forEach((r) => this.add(r)), this.complete = e, this;
|
|
268
268
|
}
|
|
269
269
|
/**
|
|
270
270
|
* Delete an item from the cache
|
|
@@ -313,31 +313,31 @@ class Dt {
|
|
|
313
313
|
* @param {number | undefined} ttl Override default expiry
|
|
314
314
|
* @return {this}
|
|
315
315
|
*/
|
|
316
|
-
set(t, e,
|
|
317
|
-
return this.store[t] = e,
|
|
316
|
+
set(t, e, r = this.ttl) {
|
|
317
|
+
return this.store[t] = e, r && setTimeout(() => {
|
|
318
318
|
this.complete = !1, this.delete(t);
|
|
319
|
-
},
|
|
319
|
+
}, r), this;
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
const e =
|
|
324
|
-
|
|
325
|
-
}),
|
|
322
|
+
function Ut(n, t = !0) {
|
|
323
|
+
const e = n.reduce((r, s) => (Object.keys(t ? J(s) : s).forEach((i) => {
|
|
324
|
+
r.includes(i) || r.push(i);
|
|
325
|
+
}), r), []);
|
|
326
326
|
return [
|
|
327
327
|
e.join(","),
|
|
328
|
-
...
|
|
329
|
-
const
|
|
330
|
-
return
|
|
328
|
+
...n.map((r) => e.map((s) => {
|
|
329
|
+
const i = x(r, s), o = typeof i;
|
|
330
|
+
return o == "string" && i.includes(",") ? `"${i}"` : o == "object" ? `"${JSON.stringify(i)}"` : i;
|
|
331
331
|
}).join(","))
|
|
332
332
|
].join(`
|
|
333
333
|
`);
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class O extends Promise {
|
|
336
336
|
constructor(e) {
|
|
337
|
-
super((
|
|
338
|
-
(
|
|
339
|
-
(
|
|
340
|
-
(
|
|
337
|
+
super((r, s) => e(
|
|
338
|
+
(i) => r(i),
|
|
339
|
+
(i) => s(i),
|
|
340
|
+
(i) => this.progress = i
|
|
341
341
|
));
|
|
342
342
|
c(this, "listeners", []);
|
|
343
343
|
c(this, "_progress", 0);
|
|
@@ -346,20 +346,20 @@ class E extends Promise {
|
|
|
346
346
|
return this._progress;
|
|
347
347
|
}
|
|
348
348
|
set progress(e) {
|
|
349
|
-
e != this._progress && (this._progress = e, this.listeners.forEach((
|
|
349
|
+
e != this._progress && (this._progress = e, this.listeners.forEach((r) => r(e)));
|
|
350
350
|
}
|
|
351
351
|
static from(e) {
|
|
352
|
-
return e instanceof
|
|
352
|
+
return e instanceof O ? e : new O((r, s) => e.then((...i) => r(...i)).catch((...i) => s(...i)));
|
|
353
353
|
}
|
|
354
354
|
from(e) {
|
|
355
|
-
const
|
|
356
|
-
return this.onProgress((s) =>
|
|
355
|
+
const r = O.from(e);
|
|
356
|
+
return this.onProgress((s) => r.progress = s), r;
|
|
357
357
|
}
|
|
358
358
|
onProgress(e) {
|
|
359
359
|
return this.listeners.push(e), this;
|
|
360
360
|
}
|
|
361
|
-
then(e,
|
|
362
|
-
const s = super.then(e,
|
|
361
|
+
then(e, r) {
|
|
362
|
+
const s = super.then(e, r);
|
|
363
363
|
return this.from(s);
|
|
364
364
|
}
|
|
365
365
|
catch(e) {
|
|
@@ -369,81 +369,81 @@ class E extends Promise {
|
|
|
369
369
|
return this.from(super.finally(e));
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
|
|
374
|
-
const e = URL.createObjectURL(
|
|
375
|
-
|
|
372
|
+
function qt(n, t) {
|
|
373
|
+
n instanceof Blob || (n = new Blob(b(n)));
|
|
374
|
+
const e = URL.createObjectURL(n);
|
|
375
|
+
pt(e, t), URL.revokeObjectURL(e);
|
|
376
376
|
}
|
|
377
|
-
function
|
|
377
|
+
function pt(n, t) {
|
|
378
378
|
const e = document.createElement("a");
|
|
379
|
-
e.href =
|
|
379
|
+
e.href = n, e.download = t || n.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Ft(n = {}) {
|
|
382
382
|
return new Promise((t) => {
|
|
383
383
|
const e = document.createElement("input");
|
|
384
|
-
e.type = "file", e.accept =
|
|
384
|
+
e.type = "file", e.accept = n.accept || "*", e.style.display = "none", e.multiple = !!n.multiple, e.onblur = e.onchange = async () => {
|
|
385
385
|
t(Array.from(e.files)), e.remove();
|
|
386
386
|
}, document.body.appendChild(e), e.click();
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Yt(n, t = /* @__PURE__ */ new Date()) {
|
|
390
390
|
(typeof t == "number" || typeof t == "string") && (t = new Date(t));
|
|
391
391
|
const e = `${t.getFullYear()}-${(t.getMonth() + 1).toString().padStart(2, "0")}-${t.getDate().toString().padStart(2, "0")}_${t.getHours().toString().padStart(2, "0")}-${t.getMinutes().toString().padStart(2, "0")}-${t.getSeconds().toString().padStart(2, "0")}`;
|
|
392
|
-
return
|
|
392
|
+
return n ? n.replace("{{TIMESTAMP}}", e) : e;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
return new
|
|
396
|
-
const s = new XMLHttpRequest(),
|
|
397
|
-
|
|
394
|
+
function Ht(n) {
|
|
395
|
+
return new O((t, e, r) => {
|
|
396
|
+
const s = new XMLHttpRequest(), i = new FormData();
|
|
397
|
+
n.files.forEach((o) => i.append("file", o)), s.withCredentials = !!n.withCredentials, s.upload.addEventListener("progress", (o) => o.lengthComputable ? r(o.loaded / o.total) : null), s.addEventListener("loadend", () => t(k(s.responseText))), s.addEventListener("error", () => e(k(s.responseText))), s.addEventListener("timeout", () => e({ error: "Request timed out" })), s.open("POST", n.url), Object.entries(n.headers || {}).forEach(([o, u]) => s.setRequestHeader(o, u)), s.send(i);
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
class
|
|
400
|
+
class z {
|
|
401
401
|
constructor() {
|
|
402
402
|
c(this, "listeners", {});
|
|
403
403
|
}
|
|
404
404
|
static emit(t, ...e) {
|
|
405
|
-
(this.listeners["*"] || []).forEach((
|
|
405
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t.toString()] || []).forEach((r) => r(...e));
|
|
406
406
|
}
|
|
407
407
|
static off(t, e) {
|
|
408
|
-
const
|
|
409
|
-
this.listeners[
|
|
408
|
+
const r = t.toString();
|
|
409
|
+
this.listeners[r] = (this.listeners[r] || []).filter((s) => s === e);
|
|
410
410
|
}
|
|
411
411
|
static on(t, e) {
|
|
412
412
|
var s;
|
|
413
|
-
const
|
|
414
|
-
return this.listeners[
|
|
413
|
+
const r = t.toString();
|
|
414
|
+
return this.listeners[r] || (this.listeners[r] = []), (s = this.listeners[r]) == null || s.push(e), () => this.off(t, e);
|
|
415
415
|
}
|
|
416
416
|
static once(t, e) {
|
|
417
|
-
return new Promise((
|
|
418
|
-
const s = this.on(t, (...
|
|
419
|
-
|
|
417
|
+
return new Promise((r) => {
|
|
418
|
+
const s = this.on(t, (...i) => {
|
|
419
|
+
r(i.length == 1 ? i[0] : i), e && e(...i), s();
|
|
420
420
|
});
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
emit(t, ...e) {
|
|
424
|
-
(this.listeners["*"] || []).forEach((
|
|
424
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t] || []).forEach((r) => r(...e));
|
|
425
425
|
}
|
|
426
426
|
off(t, e) {
|
|
427
|
-
this.listeners[t] = (this.listeners[t] || []).filter((
|
|
427
|
+
this.listeners[t] = (this.listeners[t] || []).filter((r) => r === e);
|
|
428
428
|
}
|
|
429
429
|
on(t, e) {
|
|
430
|
-
var
|
|
431
|
-
return this.listeners[t] || (this.listeners[t] = []), (
|
|
430
|
+
var r;
|
|
431
|
+
return this.listeners[t] || (this.listeners[t] = []), (r = this.listeners[t]) == null || r.push(e), () => this.off(t, e);
|
|
432
432
|
}
|
|
433
433
|
once(t, e) {
|
|
434
|
-
return new Promise((
|
|
435
|
-
const s = this.on(t, (...
|
|
436
|
-
|
|
434
|
+
return new Promise((r) => {
|
|
435
|
+
const s = this.on(t, (...i) => {
|
|
436
|
+
r(i.length == 1 ? i[0] : i), e && e(...i), s();
|
|
437
437
|
});
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
c(
|
|
442
|
-
class
|
|
443
|
-
constructor(e,
|
|
441
|
+
c(z, "listeners", {});
|
|
442
|
+
class g extends Error {
|
|
443
|
+
constructor(e, r) {
|
|
444
444
|
super(e);
|
|
445
445
|
c(this, "_code");
|
|
446
|
-
|
|
446
|
+
r != null && (this._code = r);
|
|
447
447
|
}
|
|
448
448
|
get code() {
|
|
449
449
|
return this._code || this.constructor.code;
|
|
@@ -452,11 +452,11 @@ class p extends Error {
|
|
|
452
452
|
this._code = e;
|
|
453
453
|
}
|
|
454
454
|
static from(e) {
|
|
455
|
-
const
|
|
455
|
+
const r = Number(e.statusCode) ?? Number(e.code), s = new this(e.message || e.toString());
|
|
456
456
|
return Object.assign(s, {
|
|
457
457
|
stack: e.stack,
|
|
458
458
|
...e,
|
|
459
|
-
code:
|
|
459
|
+
code: r ?? void 0
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
462
|
static instanceof(e) {
|
|
@@ -466,8 +466,8 @@ class p extends Error {
|
|
|
466
466
|
return this.message || super.toString();
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
c(
|
|
470
|
-
class
|
|
469
|
+
c(g, "code", 500);
|
|
470
|
+
class K extends g {
|
|
471
471
|
constructor(t = "Bad Request") {
|
|
472
472
|
super(t);
|
|
473
473
|
}
|
|
@@ -475,8 +475,8 @@ class W extends p {
|
|
|
475
475
|
return t.constructor.code == this.code;
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
c(
|
|
479
|
-
class
|
|
478
|
+
c(K, "code", 400);
|
|
479
|
+
class Z extends g {
|
|
480
480
|
constructor(t = "Unauthorized") {
|
|
481
481
|
super(t);
|
|
482
482
|
}
|
|
@@ -484,8 +484,8 @@ class J extends p {
|
|
|
484
484
|
return t.constructor.code == this.code;
|
|
485
485
|
}
|
|
486
486
|
}
|
|
487
|
-
c(
|
|
488
|
-
class
|
|
487
|
+
c(Z, "code", 401);
|
|
488
|
+
class _ extends g {
|
|
489
489
|
constructor(t = "Payment Required") {
|
|
490
490
|
super(t);
|
|
491
491
|
}
|
|
@@ -493,8 +493,8 @@ class z extends p {
|
|
|
493
493
|
return t.constructor.code == this.code;
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
c(
|
|
497
|
-
class
|
|
496
|
+
c(_, "code", 402);
|
|
497
|
+
class V extends g {
|
|
498
498
|
constructor(t = "Forbidden") {
|
|
499
499
|
super(t);
|
|
500
500
|
}
|
|
@@ -502,8 +502,8 @@ class K extends p {
|
|
|
502
502
|
return t.constructor.code == this.code;
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
|
-
c(
|
|
506
|
-
class
|
|
505
|
+
c(V, "code", 403);
|
|
506
|
+
class X extends g {
|
|
507
507
|
constructor(t = "Not Found") {
|
|
508
508
|
super(t);
|
|
509
509
|
}
|
|
@@ -511,8 +511,8 @@ class Z extends p {
|
|
|
511
511
|
return t.constructor.code == this.code;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
c(
|
|
515
|
-
class
|
|
514
|
+
c(X, "code", 404);
|
|
515
|
+
class Q extends g {
|
|
516
516
|
constructor(t = "Method Not Allowed") {
|
|
517
517
|
super(t);
|
|
518
518
|
}
|
|
@@ -520,8 +520,8 @@ class V extends p {
|
|
|
520
520
|
return t.constructor.code == this.code;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
c(
|
|
524
|
-
class
|
|
523
|
+
c(Q, "code", 405);
|
|
524
|
+
class tt extends g {
|
|
525
525
|
constructor(t = "Not Acceptable") {
|
|
526
526
|
super(t);
|
|
527
527
|
}
|
|
@@ -529,8 +529,8 @@ class X extends p {
|
|
|
529
529
|
return t.constructor.code == this.code;
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
|
-
c(
|
|
533
|
-
class
|
|
532
|
+
c(tt, "code", 406);
|
|
533
|
+
class et extends g {
|
|
534
534
|
constructor(t = "Internal Server Error") {
|
|
535
535
|
super(t);
|
|
536
536
|
}
|
|
@@ -538,8 +538,8 @@ class Q extends p {
|
|
|
538
538
|
return t.constructor.code == this.code;
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
|
-
c(
|
|
542
|
-
class
|
|
541
|
+
c(et, "code", 500);
|
|
542
|
+
class nt extends g {
|
|
543
543
|
constructor(t = "Not Implemented") {
|
|
544
544
|
super(t);
|
|
545
545
|
}
|
|
@@ -547,8 +547,8 @@ class tt extends p {
|
|
|
547
547
|
return t.constructor.code == this.code;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
|
-
c(
|
|
551
|
-
class
|
|
550
|
+
c(nt, "code", 501);
|
|
551
|
+
class rt extends g {
|
|
552
552
|
constructor(t = "Bad Gateway") {
|
|
553
553
|
super(t);
|
|
554
554
|
}
|
|
@@ -556,8 +556,8 @@ class et extends p {
|
|
|
556
556
|
return t.constructor.code == this.code;
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
|
-
c(
|
|
560
|
-
class
|
|
559
|
+
c(rt, "code", 502);
|
|
560
|
+
class st extends g {
|
|
561
561
|
constructor(t = "Service Unavailable") {
|
|
562
562
|
super(t);
|
|
563
563
|
}
|
|
@@ -565,8 +565,8 @@ class rt extends p {
|
|
|
565
565
|
return t.constructor.code == this.code;
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
|
-
c(
|
|
569
|
-
class
|
|
568
|
+
c(st, "code", 503);
|
|
569
|
+
class it extends g {
|
|
570
570
|
constructor(t = "Gateway Timeout") {
|
|
571
571
|
super(t);
|
|
572
572
|
}
|
|
@@ -574,49 +574,49 @@ class nt extends p {
|
|
|
574
574
|
return t.constructor.code == this.code;
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
c(
|
|
578
|
-
function
|
|
579
|
-
if (
|
|
580
|
-
switch (
|
|
577
|
+
c(it, "code", 504);
|
|
578
|
+
function Wt(n, t) {
|
|
579
|
+
if (n >= 200 && n < 300) return null;
|
|
580
|
+
switch (n) {
|
|
581
581
|
case 400:
|
|
582
|
-
return new
|
|
582
|
+
return new K(t);
|
|
583
583
|
case 401:
|
|
584
|
-
return new
|
|
584
|
+
return new Z(t);
|
|
585
585
|
case 402:
|
|
586
|
-
return new
|
|
586
|
+
return new _(t);
|
|
587
587
|
case 403:
|
|
588
|
-
return new
|
|
588
|
+
return new V(t);
|
|
589
589
|
case 404:
|
|
590
|
-
return new
|
|
590
|
+
return new X(t);
|
|
591
591
|
case 405:
|
|
592
|
-
return new
|
|
592
|
+
return new Q(t);
|
|
593
593
|
case 406:
|
|
594
|
-
return new
|
|
594
|
+
return new tt(t);
|
|
595
595
|
case 500:
|
|
596
|
-
return new
|
|
596
|
+
return new et(t);
|
|
597
597
|
case 501:
|
|
598
|
-
return new
|
|
598
|
+
return new nt(t);
|
|
599
599
|
case 502:
|
|
600
|
-
return new et(t);
|
|
601
|
-
case 503:
|
|
602
600
|
return new rt(t);
|
|
601
|
+
case 503:
|
|
602
|
+
return new st(t);
|
|
603
603
|
case 504:
|
|
604
|
-
return new
|
|
604
|
+
return new it(t);
|
|
605
605
|
default:
|
|
606
|
-
return new
|
|
606
|
+
return new g(t, n);
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
const
|
|
609
|
+
const m = class m {
|
|
610
610
|
constructor(t = {}) {
|
|
611
611
|
c(this, "interceptors", {});
|
|
612
612
|
c(this, "headers", {});
|
|
613
613
|
c(this, "url");
|
|
614
|
-
this.url = t.url ?? null, this.headers = t.headers || {}, t.interceptors && t.interceptors.forEach((e) =>
|
|
614
|
+
this.url = t.url ?? null, this.headers = t.headers || {}, t.interceptors && t.interceptors.forEach((e) => m.addInterceptor(e));
|
|
615
615
|
}
|
|
616
616
|
static addInterceptor(t) {
|
|
617
|
-
const e = Object.keys(
|
|
618
|
-
return
|
|
619
|
-
|
|
617
|
+
const e = Object.keys(m.interceptors).length.toString();
|
|
618
|
+
return m.interceptors[e] = t, () => {
|
|
619
|
+
m.interceptors[e] = null;
|
|
620
620
|
};
|
|
621
621
|
}
|
|
622
622
|
addInterceptor(t) {
|
|
@@ -629,56 +629,56 @@ const w = class w {
|
|
|
629
629
|
var s;
|
|
630
630
|
if (!this.url && !t.url) throw new Error("URL needs to be set");
|
|
631
631
|
let e = ((s = t.url) != null && s.startsWith("http") ? t.url : (this.url || "") + (t.url || "")).replace(/([^:]\/)\/+/g, "$1");
|
|
632
|
-
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (
|
|
633
|
-
const
|
|
634
|
-
e += (e.includes("?") ? "&" : "?") +
|
|
632
|
+
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (i, o) => `#${t.fragment}${o}`) : e += "#" + t.fragment), t.query) {
|
|
633
|
+
const i = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((o) => ({ key: o, value: t.query[o] }));
|
|
634
|
+
e += (e.includes("?") ? "&" : "?") + i.map((o) => `${o.key}=${o.value}`).join("&");
|
|
635
635
|
}
|
|
636
|
-
const
|
|
636
|
+
const r = lt({
|
|
637
637
|
"Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
638
|
-
...
|
|
638
|
+
...m.headers,
|
|
639
639
|
...this.headers,
|
|
640
640
|
...t.headers
|
|
641
641
|
});
|
|
642
|
-
return typeof t.body == "object" && t.body != null &&
|
|
642
|
+
return typeof t.body == "object" && t.body != null && r["Content-Type"] == "application/json" && (t.body = JSON.stringify(t.body)), new O((i, o, u) => {
|
|
643
643
|
fetch(e, {
|
|
644
|
-
headers:
|
|
644
|
+
headers: r,
|
|
645
645
|
method: t.method || (t.body ? "POST" : "GET"),
|
|
646
646
|
body: t.body
|
|
647
|
-
}).then(async (
|
|
648
|
-
var
|
|
649
|
-
for (let l of [...Object.values(
|
|
650
|
-
await new Promise((
|
|
651
|
-
const
|
|
652
|
-
let
|
|
653
|
-
const
|
|
647
|
+
}).then(async (a) => {
|
|
648
|
+
var q, F;
|
|
649
|
+
for (let l of [...Object.values(m.interceptors), ...Object.values(this.interceptors)])
|
|
650
|
+
await new Promise((C) => l(a, () => C()));
|
|
651
|
+
const R = a.headers.get("Content-Length"), T = R ? parseInt(R, 10) : 0;
|
|
652
|
+
let U = 0;
|
|
653
|
+
const M = (q = a.body) == null ? void 0 : q.getReader(), ct = new ReadableStream({
|
|
654
654
|
start(l) {
|
|
655
|
-
function
|
|
656
|
-
|
|
657
|
-
if (
|
|
658
|
-
|
|
659
|
-
}).catch((
|
|
655
|
+
function C() {
|
|
656
|
+
M == null || M.read().then((A) => {
|
|
657
|
+
if (A.done) return l.close();
|
|
658
|
+
U += A.value.byteLength, u(U / T), l.enqueue(A.value), C();
|
|
659
|
+
}).catch((A) => l.error(A));
|
|
660
660
|
}
|
|
661
|
-
|
|
661
|
+
C();
|
|
662
662
|
}
|
|
663
663
|
});
|
|
664
|
-
if (
|
|
665
|
-
const l = (
|
|
666
|
-
l != null && l.includes("form") ?
|
|
664
|
+
if (a.data = new Response(ct), t.decode == null || t.decode) {
|
|
665
|
+
const l = (F = a.headers.get("Content-Type")) == null ? void 0 : F.toLowerCase();
|
|
666
|
+
l != null && l.includes("form") ? a.data = await a.data.formData() : l != null && l.includes("json") ? a.data = await a.data.json() : l != null && l.includes("text") ? a.data = await a.data.text() : l != null && l.includes("application") && (a.data = await a.data.blob());
|
|
667
667
|
}
|
|
668
|
-
|
|
668
|
+
a.ok ? i(a) : o(a);
|
|
669
669
|
});
|
|
670
670
|
});
|
|
671
671
|
}
|
|
672
672
|
};
|
|
673
|
-
c(
|
|
674
|
-
let
|
|
675
|
-
function
|
|
676
|
-
const t =
|
|
677
|
-
return
|
|
673
|
+
c(m, "interceptors", {}), c(m, "headers", {});
|
|
674
|
+
let H = m;
|
|
675
|
+
function Jt(n) {
|
|
676
|
+
const t = n.split(".")[1].replace(/-/g, "+").replace(/_/g, "/");
|
|
677
|
+
return k(decodeURIComponent(atob(t).split("").map(function(e) {
|
|
678
678
|
return "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2);
|
|
679
679
|
}).join("")));
|
|
680
680
|
}
|
|
681
|
-
const
|
|
681
|
+
const j = {
|
|
682
682
|
CLEAR: "\x1B[0m",
|
|
683
683
|
BRIGHT: "\x1B[1m",
|
|
684
684
|
DIM: "\x1B[2m",
|
|
@@ -686,7 +686,7 @@ const x = {
|
|
|
686
686
|
BLINK: "\x1B[5m",
|
|
687
687
|
REVERSE: "\x1B[7m",
|
|
688
688
|
HIDDEN: "\x1B[8m"
|
|
689
|
-
},
|
|
689
|
+
}, L = {
|
|
690
690
|
BLACK: "\x1B[30m",
|
|
691
691
|
RED: "\x1B[31m",
|
|
692
692
|
GREEN: "\x1B[32m",
|
|
@@ -703,7 +703,7 @@ const x = {
|
|
|
703
703
|
LIGHT_MAGENTA: "\x1B[95m",
|
|
704
704
|
LIGHT_CYAN: "\x1B[96m",
|
|
705
705
|
WHITE: "\x1B[97m"
|
|
706
|
-
},
|
|
706
|
+
}, zt = {
|
|
707
707
|
BLACK: "\x1B[40m",
|
|
708
708
|
RED: "\x1B[41m",
|
|
709
709
|
GREEN: "\x1B[42m",
|
|
@@ -714,198 +714,347 @@ const x = {
|
|
|
714
714
|
WHITE: "\x1B[47m",
|
|
715
715
|
GREY: "\x1B[100m"
|
|
716
716
|
};
|
|
717
|
-
var yt = /* @__PURE__ */ ((
|
|
718
|
-
const
|
|
717
|
+
var yt = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(yt || {});
|
|
718
|
+
const w = class w extends z {
|
|
719
719
|
constructor(t) {
|
|
720
720
|
super(), this.namespace = t;
|
|
721
721
|
}
|
|
722
|
-
pad(t, e,
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
const
|
|
726
|
-
return s ?
|
|
722
|
+
pad(t, e, r, s = !1) {
|
|
723
|
+
const i = t.toString(), o = e - i.length;
|
|
724
|
+
if (o <= 0) return i;
|
|
725
|
+
const u = Array(~~(o / r.length)).fill(r).join("");
|
|
726
|
+
return s ? i + u : u + i;
|
|
727
727
|
}
|
|
728
728
|
format(...t) {
|
|
729
729
|
const e = /* @__PURE__ */ new Date();
|
|
730
730
|
return `${`${e.getFullYear()}-${e.getMonth() + 1}-${e.getDate()} ${this.pad(e.getHours().toString(), 2, "0")}:${this.pad(e.getMinutes().toString(), 2, "0")}:${this.pad(e.getSeconds().toString(), 2, "0")}.${this.pad(e.getMilliseconds().toString(), 3, "0", !0)}`}${this.namespace ? ` [${this.namespace}]` : ""} ${t.join(" ")}`;
|
|
731
731
|
}
|
|
732
732
|
debug(...t) {
|
|
733
|
-
if (
|
|
733
|
+
if (w.LOG_LEVEL < 4) return;
|
|
734
734
|
const e = this.format(...t);
|
|
735
|
-
|
|
735
|
+
w.emit(4, e), console.debug(L.LIGHT_GREY + e + j.CLEAR);
|
|
736
736
|
}
|
|
737
737
|
log(...t) {
|
|
738
|
-
if (
|
|
738
|
+
if (w.LOG_LEVEL < 3) return;
|
|
739
739
|
const e = this.format(...t);
|
|
740
|
-
|
|
740
|
+
w.emit(3, e), console.log(j.CLEAR + e);
|
|
741
741
|
}
|
|
742
742
|
info(...t) {
|
|
743
|
-
if (
|
|
743
|
+
if (w.LOG_LEVEL < 2) return;
|
|
744
744
|
const e = this.format(...t);
|
|
745
|
-
|
|
745
|
+
w.emit(2, e), console.info(L.BLUE + e + j.CLEAR);
|
|
746
746
|
}
|
|
747
747
|
warn(...t) {
|
|
748
|
-
if (
|
|
748
|
+
if (w.LOG_LEVEL < 1) return;
|
|
749
749
|
const e = this.format(...t);
|
|
750
|
-
|
|
750
|
+
w.emit(1, e), console.warn(L.YELLOW + e + j.CLEAR);
|
|
751
751
|
}
|
|
752
752
|
error(...t) {
|
|
753
|
-
if (
|
|
753
|
+
if (w.LOG_LEVEL < 0) return;
|
|
754
754
|
const e = this.format(...t);
|
|
755
|
-
|
|
755
|
+
w.emit(0, e), console.error(L.RED + e + j.CLEAR);
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
|
-
c(
|
|
759
|
-
let
|
|
760
|
-
function
|
|
761
|
-
const t = (
|
|
762
|
-
let
|
|
763
|
-
const
|
|
764
|
-
s = ~~(s /
|
|
765
|
-
const
|
|
766
|
-
return s -=
|
|
767
|
-
}
|
|
768
|
-
function
|
|
769
|
-
let t =
|
|
758
|
+
c(w, "LOG_LEVEL", 4);
|
|
759
|
+
let W = w;
|
|
760
|
+
function Kt(n) {
|
|
761
|
+
const t = (u, a) => a < 1e-7 ? u : t(a, ~~(u % a)), e = n.toString().length - 2;
|
|
762
|
+
let r = Math.pow(10, e), s = n * r;
|
|
763
|
+
const i = t(s, r);
|
|
764
|
+
s = ~~(s / i), r = ~~(r / i);
|
|
765
|
+
const o = ~~(s / r);
|
|
766
|
+
return s -= o * r, `${o ? o + " " : ""}${~~s}/${~~r}`;
|
|
767
|
+
}
|
|
768
|
+
function Zt(n) {
|
|
769
|
+
let t = n.split(" ");
|
|
770
770
|
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
771
771
|
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
772
772
|
}
|
|
773
|
-
const
|
|
774
|
-
function
|
|
775
|
-
if (
|
|
776
|
-
const e = 1024,
|
|
777
|
-
return parseFloat((
|
|
773
|
+
const P = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", D = "0123456789", G = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", gt = P + D + G;
|
|
774
|
+
function _t(n, t = 2) {
|
|
775
|
+
if (n === 0) return "0 Bytes";
|
|
776
|
+
const e = 1024, r = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], s = Math.floor(Math.log(n) / Math.log(e));
|
|
777
|
+
return parseFloat((n / Math.pow(e, s)).toFixed(t)) + " " + r[s];
|
|
778
778
|
}
|
|
779
|
-
function
|
|
780
|
-
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(
|
|
781
|
-
if (!t) throw new Error(`Number cannot be parsed: ${
|
|
779
|
+
function Vt(n) {
|
|
780
|
+
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(n);
|
|
781
|
+
if (!t) throw new Error(`Number cannot be parsed: ${n}`);
|
|
782
782
|
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
783
783
|
}
|
|
784
|
-
function
|
|
785
|
-
return `${
|
|
784
|
+
function Xt(n, t, e) {
|
|
785
|
+
return `${n.slice(0, e)}${t}${n.slice(e + 1)}`;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
787
|
+
function Qt(n, t, e = " ", r = !0) {
|
|
788
|
+
return r ? n.toString().padStart(t, e) : n.toString().padEnd(t, e);
|
|
789
789
|
}
|
|
790
|
-
function
|
|
791
|
-
return Array(
|
|
790
|
+
function te(n) {
|
|
791
|
+
return Array(n).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
return Array(
|
|
793
|
+
function ee(n, t = gt) {
|
|
794
|
+
return Array(n).fill(null).map(() => {
|
|
795
795
|
const e = ~~(Math.random() * t.length);
|
|
796
796
|
return t[e];
|
|
797
797
|
}).join("");
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
if (!t && !e && !
|
|
801
|
-
return Array(
|
|
799
|
+
function ne(n, t = !1, e = !1, r = !1) {
|
|
800
|
+
if (!t && !e && !r) throw new Error("Must enable at least one: letters, numbers, symbols");
|
|
801
|
+
return Array(n).fill(null).map(() => {
|
|
802
802
|
let s;
|
|
803
803
|
do {
|
|
804
|
-
const
|
|
805
|
-
t &&
|
|
804
|
+
const i = ~~(Math.random() * 3);
|
|
805
|
+
t && i == 0 ? s = P[~~(Math.random() * P.length)] : e && i == 1 ? s = D[~~(Math.random() * D.length)] : r && i == 2 && (s = G[~~(Math.random() * G.length)]);
|
|
806
806
|
} while (!s);
|
|
807
807
|
return s;
|
|
808
808
|
}).join("");
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function re(n, t) {
|
|
811
811
|
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
812
812
|
throw new TypeError("Regular expression must be global.");
|
|
813
|
-
let e = [],
|
|
814
|
-
for (; (
|
|
815
|
-
e.push(
|
|
813
|
+
let e = [], r;
|
|
814
|
+
for (; (r = t.exec(n)) !== null; )
|
|
815
|
+
e.push(r);
|
|
816
816
|
return e;
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function se(n) {
|
|
819
819
|
const t = new RegExp(
|
|
820
820
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
821
821
|
"gm"
|
|
822
|
-
).exec(
|
|
823
|
-
if (e.port != null && (e.port = Number(e.port)),
|
|
824
|
-
const s = e.query.split("&"),
|
|
825
|
-
s.forEach((
|
|
826
|
-
const [
|
|
827
|
-
|
|
828
|
-
}), e.query =
|
|
822
|
+
).exec(n), e = (t == null ? void 0 : t.groups) ?? {}, r = e.domain.split(".");
|
|
823
|
+
if (e.port != null && (e.port = Number(e.port)), r.length > 2 && (e.domain = r.splice(-2, 2).join("."), e.subdomain = r.join(".")), e.query) {
|
|
824
|
+
const s = e.query.split("&"), i = {};
|
|
825
|
+
s.forEach((o) => {
|
|
826
|
+
const [u, a] = o.split("=");
|
|
827
|
+
i[u] = a;
|
|
828
|
+
}), e.query = i;
|
|
829
829
|
}
|
|
830
830
|
return e;
|
|
831
831
|
}
|
|
832
|
-
function
|
|
833
|
-
var t =
|
|
832
|
+
function wt(n) {
|
|
833
|
+
var t = mt(Et(St(bt(n), 8 * n.length)));
|
|
834
834
|
return t.toLowerCase();
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
for (var t, e = "0123456789ABCDEF",
|
|
838
|
-
return
|
|
836
|
+
function mt(n) {
|
|
837
|
+
for (var t, e = "0123456789ABCDEF", r = "", s = 0; s < n.length; s++) t = n.charCodeAt(s), r += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
|
838
|
+
return r;
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
for (var t = Array(
|
|
842
|
-
for (e = 0; e < 8 *
|
|
840
|
+
function bt(n) {
|
|
841
|
+
for (var t = Array(n.length >> 2), e = 0; e < t.length; e++) t[e] = 0;
|
|
842
|
+
for (e = 0; e < 8 * n.length; e += 8) t[e >> 5] |= (255 & n.charCodeAt(e / 8)) << e % 32;
|
|
843
843
|
return t;
|
|
844
844
|
}
|
|
845
|
-
function Et(
|
|
846
|
-
for (var t = "", e = 0; e < 32 *
|
|
845
|
+
function Et(n) {
|
|
846
|
+
for (var t = "", e = 0; e < 32 * n.length; e += 8) t += String.fromCharCode(n[e >> 5] >>> e % 32 & 255);
|
|
847
847
|
return t;
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
|
|
851
|
-
for (var e = 1732584193,
|
|
852
|
-
var
|
|
853
|
-
|
|
849
|
+
function St(n, t) {
|
|
850
|
+
n[t >> 5] |= 128 << t % 32, n[14 + (t + 64 >>> 9 << 4)] = t;
|
|
851
|
+
for (var e = 1732584193, r = -271733879, s = -1732584194, i = 271733878, o = 0; o < n.length; o += 16) {
|
|
852
|
+
var u = e, a = r, R = s, T = i;
|
|
853
|
+
r = p(r = p(r = p(r = p(r = d(r = d(r = d(r = d(r = h(r = h(r = h(r = h(r = f(r = f(r = f(r = f(r, s = f(s, i = f(i, e = f(e, r, s, i, n[o + 0], 7, -680876936), r, s, n[o + 1], 12, -389564586), e, r, n[o + 2], 17, 606105819), i, e, n[o + 3], 22, -1044525330), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 4], 7, -176418897), r, s, n[o + 5], 12, 1200080426), e, r, n[o + 6], 17, -1473231341), i, e, n[o + 7], 22, -45705983), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 8], 7, 1770035416), r, s, n[o + 9], 12, -1958414417), e, r, n[o + 10], 17, -42063), i, e, n[o + 11], 22, -1990404162), s = f(s, i = f(i, e = f(e, r, s, i, n[o + 12], 7, 1804603682), r, s, n[o + 13], 12, -40341101), e, r, n[o + 14], 17, -1502002290), i, e, n[o + 15], 22, 1236535329), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 1], 5, -165796510), r, s, n[o + 6], 9, -1069501632), e, r, n[o + 11], 14, 643717713), i, e, n[o + 0], 20, -373897302), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 5], 5, -701558691), r, s, n[o + 10], 9, 38016083), e, r, n[o + 15], 14, -660478335), i, e, n[o + 4], 20, -405537848), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 9], 5, 568446438), r, s, n[o + 14], 9, -1019803690), e, r, n[o + 3], 14, -187363961), i, e, n[o + 8], 20, 1163531501), s = h(s, i = h(i, e = h(e, r, s, i, n[o + 13], 5, -1444681467), r, s, n[o + 2], 9, -51403784), e, r, n[o + 7], 14, 1735328473), i, e, n[o + 12], 20, -1926607734), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 5], 4, -378558), r, s, n[o + 8], 11, -2022574463), e, r, n[o + 11], 16, 1839030562), i, e, n[o + 14], 23, -35309556), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 1], 4, -1530992060), r, s, n[o + 4], 11, 1272893353), e, r, n[o + 7], 16, -155497632), i, e, n[o + 10], 23, -1094730640), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 13], 4, 681279174), r, s, n[o + 0], 11, -358537222), e, r, n[o + 3], 16, -722521979), i, e, n[o + 6], 23, 76029189), s = d(s, i = d(i, e = d(e, r, s, i, n[o + 9], 4, -640364487), r, s, n[o + 12], 11, -421815835), e, r, n[o + 15], 16, 530742520), i, e, n[o + 2], 23, -995338651), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 0], 6, -198630844), r, s, n[o + 7], 10, 1126891415), e, r, n[o + 14], 15, -1416354905), i, e, n[o + 5], 21, -57434055), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 12], 6, 1700485571), r, s, n[o + 3], 10, -1894986606), e, r, n[o + 10], 15, -1051523), i, e, n[o + 1], 21, -2054922799), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 8], 6, 1873313359), r, s, n[o + 15], 10, -30611744), e, r, n[o + 6], 15, -1560198380), i, e, n[o + 13], 21, 1309151649), s = p(s, i = p(i, e = p(e, r, s, i, n[o + 4], 6, -145523070), r, s, n[o + 11], 10, -1120210379), e, r, n[o + 2], 15, 718787259), i, e, n[o + 9], 21, -343485551), e = S(e, u), r = S(r, a), s = S(s, R), i = S(i, T);
|
|
854
854
|
}
|
|
855
|
-
return Array(e,
|
|
855
|
+
return Array(e, r, s, i);
|
|
856
|
+
}
|
|
857
|
+
function N(n, t, e, r, s, i) {
|
|
858
|
+
return S(Ot(S(S(t, n), S(r, i)), s), e);
|
|
856
859
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
860
|
+
function f(n, t, e, r, s, i, o) {
|
|
861
|
+
return N(t & e | ~t & r, n, t, s, i, o);
|
|
859
862
|
}
|
|
860
|
-
function h(
|
|
861
|
-
return
|
|
863
|
+
function h(n, t, e, r, s, i, o) {
|
|
864
|
+
return N(t & r | e & ~r, n, t, s, i, o);
|
|
862
865
|
}
|
|
863
|
-
function
|
|
864
|
-
return
|
|
866
|
+
function d(n, t, e, r, s, i, o) {
|
|
867
|
+
return N(t ^ e ^ r, n, t, s, i, o);
|
|
865
868
|
}
|
|
866
|
-
function
|
|
867
|
-
return
|
|
869
|
+
function p(n, t, e, r, s, i, o) {
|
|
870
|
+
return N(e ^ (t | ~r), n, t, s, i, o);
|
|
868
871
|
}
|
|
869
|
-
function
|
|
870
|
-
|
|
872
|
+
function S(n, t) {
|
|
873
|
+
var e = (65535 & n) + (65535 & t);
|
|
874
|
+
return (n >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
871
875
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
874
|
-
return (r >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
876
|
+
function Ot(n, t) {
|
|
877
|
+
return n << t | n >>> 32 - t;
|
|
875
878
|
}
|
|
876
|
-
function
|
|
877
|
-
return
|
|
879
|
+
function ie(n) {
|
|
880
|
+
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(n);
|
|
878
881
|
}
|
|
879
|
-
function
|
|
880
|
-
return
|
|
882
|
+
function oe(n, t = "mp") {
|
|
883
|
+
return n ? `https://www.gravatar.com/avatar/${wt(n)}?d=${t}` : "";
|
|
884
|
+
}
|
|
885
|
+
function ce(n) {
|
|
886
|
+
return n.replace(/[.*+?^${}()|\[\]\\]/g, "\\$&");
|
|
887
|
+
}
|
|
888
|
+
function ue(n, ...t) {
|
|
889
|
+
const e = [];
|
|
890
|
+
for (let r = 0; r < n.length || r < t.length; r++)
|
|
891
|
+
n[r] && e.push(n[r]), t[r] && e.push(t[r]);
|
|
892
|
+
return new y(e.join(""));
|
|
893
|
+
}
|
|
894
|
+
function xt(n, ...t) {
|
|
895
|
+
let e = [];
|
|
896
|
+
for (let i = 0; i < n.length || i < t.length; i++)
|
|
897
|
+
n[i] && e.push(n[i]), t[i] && e.push(t[i]);
|
|
898
|
+
const [r, s] = e.join("").split(":");
|
|
899
|
+
return y.toString(r, s == null ? void 0 : s.split(""));
|
|
881
900
|
}
|
|
882
|
-
|
|
883
|
-
|
|
901
|
+
class y {
|
|
902
|
+
constructor(t) {
|
|
903
|
+
/** First directory in path */
|
|
904
|
+
c(this, "module");
|
|
905
|
+
/** Entire path, including the module & name */
|
|
906
|
+
c(this, "fullPath");
|
|
907
|
+
/** Path including the name, excluding the module */
|
|
908
|
+
c(this, "path");
|
|
909
|
+
/** Last sagment of path */
|
|
910
|
+
c(this, "name");
|
|
911
|
+
/** List of methods */
|
|
912
|
+
c(this, "methods");
|
|
913
|
+
/** All/Wildcard specified */
|
|
914
|
+
c(this, "all");
|
|
915
|
+
/** None specified */
|
|
916
|
+
c(this, "none");
|
|
917
|
+
/** Create method specified */
|
|
918
|
+
c(this, "create");
|
|
919
|
+
/** Read method specified */
|
|
920
|
+
c(this, "read");
|
|
921
|
+
/** Update method specified */
|
|
922
|
+
c(this, "update");
|
|
923
|
+
/** Delete method specified */
|
|
924
|
+
c(this, "delete");
|
|
925
|
+
var o;
|
|
926
|
+
if (typeof t == "object") return Object.assign(this, t);
|
|
927
|
+
let [e, r, s] = t.split(":");
|
|
928
|
+
s || (s = r || "*"), (e == "*" || !e && s == "*") && (e = "", s = "*");
|
|
929
|
+
let i = e.split("/").filter((u) => !!u);
|
|
930
|
+
this.module = ((o = i.splice(0, 1)[0]) == null ? void 0 : o.toLowerCase()) || "", this.fullPath = e, this.path = i.join("/"), this.name = i.pop() || "", this.methods = s.split(""), this.all = s == null ? void 0 : s.includes("*"), this.none = s == null ? void 0 : s.includes("n"), this.create = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("c"))), this.read = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("r"))), this.update = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("u"))), this.delete = !(s != null && s.includes("n")) && ((s == null ? void 0 : s.includes("*")) || (s == null ? void 0 : s.includes("w")) || (s == null ? void 0 : s.includes("d")));
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Combine multiple pathed events into one parsed object. Longest path takes precedent, but all subsequent methods are
|
|
934
|
+
* combined until a "none" is reached
|
|
935
|
+
*
|
|
936
|
+
* @param {string | PathEvent} paths PathedEvents as strings or pre-parsed
|
|
937
|
+
* @return {PathEvent} Final combined permission
|
|
938
|
+
*/
|
|
939
|
+
static combine(t) {
|
|
940
|
+
let e = !1;
|
|
941
|
+
const r = t.map((s) => new y(s)).toSorted((s, i) => {
|
|
942
|
+
const o = s.fullPath.length, u = i.fullPath.length;
|
|
943
|
+
return o < u ? 1 : o > u ? -1 : 0;
|
|
944
|
+
}).reduce((s, i) => (i.none && (e = !0), s ? (e || (i.all && (s.all = !0), (i.all || i.create) && (s.create = !0), (i.all || i.read) && (s.read = !0), (i.all || i.update) && (s.update = !0), (i.all || i.delete) && (s.delete = !0), s.methods = [...s.methods, ...i.methods]), s) : i), null);
|
|
945
|
+
return r.all && (r.methods = ["*"]), r.none && (r.methods = ["n"]), r.methods = new E(r.methods), r.raw = xt`${r.fullPath}:${r.methods}`, r;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* Squash 2 sets of paths & return true if any overlap is found
|
|
949
|
+
*
|
|
950
|
+
* @param {string | PathEvent | (string | PathEvent)[]} target Array of PathedEvents as strings or pre-parsed
|
|
951
|
+
* @param has Target must have at least one of these path
|
|
952
|
+
* @return {boolean} Whether there is any overlap
|
|
953
|
+
*/
|
|
954
|
+
static has(t, ...e) {
|
|
955
|
+
const r = b(e).map((i) => new y(i)), s = b(t).map((i) => new y(i));
|
|
956
|
+
return !!r.find((i) => {
|
|
957
|
+
if (!i.fullPath && i.all) return !0;
|
|
958
|
+
const o = s.filter((a) => i.fullPath.startsWith(a.fullPath));
|
|
959
|
+
if (!o.length) return !1;
|
|
960
|
+
const u = y.combine(o);
|
|
961
|
+
return !u.none && (u.all || new E(u.methods).intersection(new E(i.methods)).length);
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Squash 2 sets of paths & return true if the target has all paths
|
|
966
|
+
*
|
|
967
|
+
* @param {string | PathEvent | (string | PathEvent)[]} target Array of PathedEvents as strings or pre-parsed
|
|
968
|
+
* @param has Target must have all these paths
|
|
969
|
+
* @return {boolean} Whether there is any overlap
|
|
970
|
+
*/
|
|
971
|
+
static hasAll(t, ...e) {
|
|
972
|
+
return e.filter((r) => y.has(t, r)).length == e.length;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Same as `has` but raises an error if there is no overlap
|
|
976
|
+
*
|
|
977
|
+
* @param {string | string[]} target Array of PathedEvents as strings or pre-parsed
|
|
978
|
+
* @param has Target must have at least one of these path
|
|
979
|
+
*/
|
|
980
|
+
static hasFatal(t, ...e) {
|
|
981
|
+
if (!y.has(t, ...e)) throw new Error(`Requires one of: ${b(e).join(", ")}`);
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Same as `hasAll` but raises an error if the target is missing any paths
|
|
985
|
+
*
|
|
986
|
+
* @param {string | string[]} target Array of PathedEvents as strings or pre-parsed
|
|
987
|
+
* @param has Target must have all these paths
|
|
988
|
+
*/
|
|
989
|
+
static hasAllFatal(t, ...e) {
|
|
990
|
+
if (!y.hasAll(t, ...e)) throw new Error(`Requires all: ${b(e).join(", ")}`);
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Create pathed event string from its components
|
|
994
|
+
*
|
|
995
|
+
* @param {string | string[]} path Event path
|
|
996
|
+
* @param {Method} methods Event method
|
|
997
|
+
* @return {string} String representation of PathedEvent
|
|
998
|
+
*/
|
|
999
|
+
static toString(t, e) {
|
|
1000
|
+
let r = b(t).filter((s) => s != null).join("/");
|
|
1001
|
+
return e != null && e.length && (r += `:${b(e).map((s) => s.toLowerCase()).join("")}`), r == null ? void 0 : r.trim().replaceAll(/\/{2,}/g, "/").replaceAll(/(^\/|\/$)/g, "");
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Create pathed event string from its components
|
|
1005
|
+
*
|
|
1006
|
+
* @return {string} String representation of PathedEvent
|
|
1007
|
+
*/
|
|
1008
|
+
toString() {
|
|
1009
|
+
return y.toString(this.fullPath, this.methods);
|
|
1010
|
+
}
|
|
884
1011
|
}
|
|
885
|
-
|
|
886
|
-
|
|
1012
|
+
class ae {
|
|
1013
|
+
constructor() {
|
|
1014
|
+
c(this, "listeners", []);
|
|
1015
|
+
}
|
|
1016
|
+
emit(t, ...e) {
|
|
1017
|
+
const r = new y(t);
|
|
1018
|
+
this.listeners.filter((s) => y.has(s[0], t)).forEach(async (s) => s[1](r, ...e));
|
|
1019
|
+
}
|
|
1020
|
+
off(t) {
|
|
1021
|
+
this.listeners = this.listeners.filter((e) => e[1] != t);
|
|
1022
|
+
}
|
|
1023
|
+
on(t, e) {
|
|
1024
|
+
return b(t).forEach((r) => this.listeners.push([new y(r), e])), () => this.off(e);
|
|
1025
|
+
}
|
|
1026
|
+
once(t, e) {
|
|
1027
|
+
return new Promise((r) => {
|
|
1028
|
+
const s = this.on(t, (i, ...o) => {
|
|
1029
|
+
r(o.length < 2 ? o[0] : o), e && e(i, ...o), s();
|
|
1030
|
+
});
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
relayEvents(t) {
|
|
1034
|
+
t.on("*", (e, ...r) => this.emit(e, ...r));
|
|
1035
|
+
}
|
|
887
1036
|
}
|
|
888
|
-
function
|
|
889
|
-
(typeof
|
|
890
|
-
let t =
|
|
891
|
-
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${
|
|
1037
|
+
function le(n) {
|
|
1038
|
+
(typeof n == "number" || typeof n == "string") && (n = new Date(n));
|
|
1039
|
+
let t = n.getHours(), e = "AM";
|
|
1040
|
+
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${n.getFullYear()}-${(n.getMonth() + 1).toString().padStart(2, "0")}-${n.getDate().toString().padStart(2, "0")}, ${t}:${n.getMinutes().toString().padStart(2, "0")} ${e}`;
|
|
892
1041
|
}
|
|
893
|
-
function
|
|
894
|
-
return new Promise((t) => setTimeout(t,
|
|
1042
|
+
function Bt(n) {
|
|
1043
|
+
return new Promise((t) => setTimeout(t, n));
|
|
895
1044
|
}
|
|
896
|
-
async function
|
|
897
|
-
for (; await
|
|
1045
|
+
async function fe(n, t = 100) {
|
|
1046
|
+
for (; await n(); ) await Bt(t);
|
|
898
1047
|
}
|
|
899
|
-
function
|
|
900
|
-
return (
|
|
1048
|
+
function he(n) {
|
|
1049
|
+
return (n instanceof Date ? n.getTime() : n) - (/* @__PURE__ */ new Date()).getTime();
|
|
901
1050
|
}
|
|
902
|
-
function
|
|
1051
|
+
function de() {
|
|
903
1052
|
return Object.keys({});
|
|
904
1053
|
}
|
|
905
|
-
var
|
|
906
|
-
Object.defineProperty(
|
|
907
|
-
|
|
908
|
-
class
|
|
1054
|
+
var v = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, At = {}, B = {};
|
|
1055
|
+
Object.defineProperty(B, "__esModule", { value: !0 });
|
|
1056
|
+
B.persist = B.Persist = void 0;
|
|
1057
|
+
class ot {
|
|
909
1058
|
/**
|
|
910
1059
|
* @param {string} key Primary key value will be stored under
|
|
911
1060
|
* @param {PersistOptions<T>} options Configure using {@link PersistOptions}
|
|
@@ -929,11 +1078,11 @@ class st {
|
|
|
929
1078
|
/** Set value with proxy object wrapper to sync future changes */
|
|
930
1079
|
set value(t) {
|
|
931
1080
|
t == null || typeof t != "object" ? this._value = t : this._value = new Proxy(t, {
|
|
932
|
-
get: (e,
|
|
933
|
-
const
|
|
934
|
-
return this.save(),
|
|
935
|
-
} : e[
|
|
936
|
-
set: (e,
|
|
1081
|
+
get: (e, r) => typeof e[r] == "function" ? (...i) => {
|
|
1082
|
+
const o = e[r](...i);
|
|
1083
|
+
return this.save(), o;
|
|
1084
|
+
} : e[r],
|
|
1085
|
+
set: (e, r, s) => (e[r] = s, this.save(), !0)
|
|
937
1086
|
}), this.save();
|
|
938
1087
|
}
|
|
939
1088
|
/** Notify listeners of change */
|
|
@@ -985,25 +1134,25 @@ class st {
|
|
|
985
1134
|
return this.value;
|
|
986
1135
|
}
|
|
987
1136
|
}
|
|
988
|
-
|
|
989
|
-
function
|
|
1137
|
+
B.Persist = ot;
|
|
1138
|
+
function jt(n) {
|
|
990
1139
|
return (t, e) => {
|
|
991
|
-
const
|
|
1140
|
+
const r = (n == null ? void 0 : n.key) || `${t.constructor.name}.${e.toString()}`, s = new ot(r, n);
|
|
992
1141
|
Object.defineProperty(t, e, {
|
|
993
1142
|
get: function() {
|
|
994
1143
|
return s.value;
|
|
995
1144
|
},
|
|
996
|
-
set: function(
|
|
997
|
-
s.value =
|
|
1145
|
+
set: function(i) {
|
|
1146
|
+
s.value = i;
|
|
998
1147
|
}
|
|
999
1148
|
});
|
|
1000
1149
|
};
|
|
1001
1150
|
}
|
|
1002
|
-
|
|
1003
|
-
var
|
|
1004
|
-
Object.defineProperty(
|
|
1005
|
-
|
|
1006
|
-
class
|
|
1151
|
+
B.persist = jt;
|
|
1152
|
+
var I = {};
|
|
1153
|
+
Object.defineProperty(I, "__esModule", { value: !0 });
|
|
1154
|
+
I.MemoryStorage = void 0;
|
|
1155
|
+
class $t {
|
|
1007
1156
|
get length() {
|
|
1008
1157
|
return Object.keys(this).length;
|
|
1009
1158
|
}
|
|
@@ -1023,92 +1172,96 @@ class At {
|
|
|
1023
1172
|
this[t] = e;
|
|
1024
1173
|
}
|
|
1025
1174
|
}
|
|
1026
|
-
|
|
1027
|
-
(function(
|
|
1028
|
-
var t =
|
|
1029
|
-
|
|
1030
|
-
var
|
|
1031
|
-
(!
|
|
1032
|
-
return s[
|
|
1033
|
-
} }), Object.defineProperty(
|
|
1034
|
-
} : function(
|
|
1035
|
-
|
|
1036
|
-
}), e =
|
|
1037
|
-
for (var
|
|
1175
|
+
I.MemoryStorage = $t;
|
|
1176
|
+
(function(n) {
|
|
1177
|
+
var t = v && v.__createBinding || (Object.create ? function(r, s, i, o) {
|
|
1178
|
+
o === void 0 && (o = i);
|
|
1179
|
+
var u = Object.getOwnPropertyDescriptor(s, i);
|
|
1180
|
+
(!u || ("get" in u ? !s.__esModule : u.writable || u.configurable)) && (u = { enumerable: !0, get: function() {
|
|
1181
|
+
return s[i];
|
|
1182
|
+
} }), Object.defineProperty(r, o, u);
|
|
1183
|
+
} : function(r, s, i, o) {
|
|
1184
|
+
o === void 0 && (o = i), r[o] = s[i];
|
|
1185
|
+
}), e = v && v.__exportStar || function(r, s) {
|
|
1186
|
+
for (var i in r) i !== "default" && !Object.prototype.hasOwnProperty.call(s, i) && t(s, r, i);
|
|
1038
1187
|
};
|
|
1039
|
-
Object.defineProperty(
|
|
1040
|
-
})(
|
|
1188
|
+
Object.defineProperty(n, "__esModule", { value: !0 }), e(B, n), e(I, n);
|
|
1189
|
+
})(At);
|
|
1041
1190
|
export {
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1191
|
+
E as ASet,
|
|
1192
|
+
rt as BadGatewayError,
|
|
1193
|
+
K as BadRequestError,
|
|
1194
|
+
Gt as Cache,
|
|
1195
|
+
zt as CliBackground,
|
|
1196
|
+
j as CliEffects,
|
|
1197
|
+
L as CliForeground,
|
|
1198
|
+
g as CustomError,
|
|
1199
|
+
V as ForbiddenError,
|
|
1200
|
+
it as GatewayTimeoutError,
|
|
1201
|
+
H as Http,
|
|
1202
|
+
et as InternalServerError,
|
|
1203
|
+
k as JSONAttemptParse,
|
|
1204
|
+
It as JSONSanitize,
|
|
1056
1205
|
yt as LOG_LEVEL,
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
re as
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1206
|
+
W as Logger,
|
|
1207
|
+
Q as MethodNotAllowedError,
|
|
1208
|
+
tt as NotAcceptableError,
|
|
1209
|
+
X as NotFoundError,
|
|
1210
|
+
nt as NotImplementedError,
|
|
1211
|
+
ue as PE,
|
|
1212
|
+
xt as PES,
|
|
1213
|
+
y as PathEvent,
|
|
1214
|
+
ae as PathEventEmitter,
|
|
1215
|
+
_ as PaymentRequiredError,
|
|
1216
|
+
O as PromiseProgress,
|
|
1217
|
+
st as ServiceUnavailableError,
|
|
1218
|
+
z as TypedEmitter,
|
|
1219
|
+
Z as UnauthorizedError,
|
|
1220
|
+
Tt as addUnique,
|
|
1221
|
+
Mt as arrayDiff,
|
|
1222
|
+
kt as caseInsensitiveSort,
|
|
1223
|
+
lt as clean,
|
|
1224
|
+
Ut as csv,
|
|
1225
|
+
Kt as dec2Frac,
|
|
1226
|
+
Ct as deepCopy,
|
|
1227
|
+
ft as deepMerge,
|
|
1228
|
+
x as dotNotation,
|
|
1229
|
+
qt as downloadFile,
|
|
1230
|
+
pt as downloadUrl,
|
|
1231
|
+
Lt as encodeQuery,
|
|
1232
|
+
Wt as errorFromCode,
|
|
1233
|
+
ce as escapeRegex,
|
|
1234
|
+
Ft as fileBrowser,
|
|
1235
|
+
Pt as findByProp,
|
|
1236
|
+
ht as flattenArr,
|
|
1237
|
+
J as flattenObj,
|
|
1238
|
+
vt as formData,
|
|
1239
|
+
_t as formatBytes,
|
|
1240
|
+
le as formatDate,
|
|
1241
|
+
Vt as formatPhoneNumber,
|
|
1242
|
+
Zt as fracToDec,
|
|
1243
|
+
oe as gravatar,
|
|
1244
|
+
Y as includes,
|
|
1245
|
+
Xt as insertAt,
|
|
1246
|
+
$ as isEqual,
|
|
1247
|
+
Jt as jwtDecode,
|
|
1248
|
+
b as makeArray,
|
|
1249
|
+
dt as makeUnique,
|
|
1250
|
+
re as matchAll,
|
|
1251
|
+
wt as md5,
|
|
1252
|
+
Nt as mixin,
|
|
1253
|
+
Qt as pad,
|
|
1254
|
+
se as parseUrl,
|
|
1255
|
+
te as randomHex,
|
|
1256
|
+
ee as randomString,
|
|
1257
|
+
ne as randomStringBuilder,
|
|
1258
|
+
Bt as sleep,
|
|
1259
|
+
fe as sleepWhile,
|
|
1260
|
+
Dt as sortByProp,
|
|
1261
|
+
he as timeUntil,
|
|
1262
|
+
Yt as timestampFilename,
|
|
1263
|
+
de as tyoeKeys,
|
|
1264
|
+
Ht as uploadWithProgress,
|
|
1265
|
+
ie as validateEmail
|
|
1113
1266
|
};
|
|
1114
1267
|
//# sourceMappingURL=index.mjs.map
|