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