@ztimson/utils 0.16.1 → 0.16.3
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/cache.d.ts +47 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +336 -277
- package/dist/index.mjs.map +1 -1
- package/dist/time.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function ot(
|
|
5
|
-
if (
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var nt = (r, t, e) => t in r ? rt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var c = (r, t, e) => (nt(r, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
function ot(r, t = !1) {
|
|
5
|
+
if (r == null)
|
|
6
6
|
throw new Error("Cannot clean a NULL value");
|
|
7
|
-
return Array.isArray(
|
|
8
|
-
(t &&
|
|
9
|
-
}),
|
|
7
|
+
return Array.isArray(r) ? r = r.filter((e) => e != null) : Object.entries(r).forEach(([e, n]) => {
|
|
8
|
+
(t && n === void 0 || !t && n == null) && delete r[e];
|
|
9
|
+
}), r;
|
|
10
10
|
}
|
|
11
|
-
function xt(
|
|
12
|
-
return structuredClone(
|
|
11
|
+
function xt(r) {
|
|
12
|
+
return structuredClone(r);
|
|
13
13
|
}
|
|
14
|
-
function st(
|
|
14
|
+
function st(r, ...t) {
|
|
15
15
|
return t.forEach((e) => {
|
|
16
|
-
for (const
|
|
17
|
-
e[
|
|
18
|
-
}),
|
|
19
|
-
}
|
|
20
|
-
function x(
|
|
21
|
-
if (!(
|
|
22
|
-
return t.split(/[.[\]]/g).filter((
|
|
23
|
-
if ((o[0] == '"' || o[0] == "'") && (o = o.slice(1, -1)), !(
|
|
16
|
+
for (const n in e)
|
|
17
|
+
e[n] && typeof e[n] == "object" && !Array.isArray(e[n]) ? (r[n] || (r[n] = {}), st(r[n], e[n])) : r[n] = e[n];
|
|
18
|
+
}), r;
|
|
19
|
+
}
|
|
20
|
+
function x(r, t, e) {
|
|
21
|
+
if (!(r == null || !t))
|
|
22
|
+
return t.split(/[.[\]]/g).filter((n) => n.length).reduce((n, o, s, i) => {
|
|
23
|
+
if ((o[0] == '"' || o[0] == "'") && (o = o.slice(1, -1)), !(n != null && n.hasOwnProperty(o))) {
|
|
24
24
|
if (e == null)
|
|
25
25
|
return;
|
|
26
|
-
|
|
26
|
+
n[o] = {};
|
|
27
27
|
}
|
|
28
|
-
return e !== void 0 && s ==
|
|
29
|
-
},
|
|
28
|
+
return e !== void 0 && s == i.length - 1 ? n[o] = e : n[o];
|
|
29
|
+
}, r);
|
|
30
30
|
}
|
|
31
|
-
function Bt(
|
|
32
|
-
return Object.entries(
|
|
31
|
+
function Bt(r) {
|
|
32
|
+
return Object.entries(r).map(
|
|
33
33
|
([t, e]) => encodeURIComponent(t) + "=" + encodeURIComponent(e)
|
|
34
34
|
).join("&");
|
|
35
35
|
}
|
|
36
|
-
function F(
|
|
37
|
-
if (typeof
|
|
38
|
-
for (const
|
|
39
|
-
const o = t ? t + "." +
|
|
40
|
-
typeof n
|
|
36
|
+
function F(r, t, e = {}) {
|
|
37
|
+
if (typeof r == "object" && !Array.isArray(r)) {
|
|
38
|
+
for (const n of Object.keys(r)) {
|
|
39
|
+
const o = t ? t + "." + n : n;
|
|
40
|
+
typeof r[n] == "object" ? F(r[n], o, e) : e[o] = r[n];
|
|
41
41
|
}
|
|
42
42
|
return e;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function St(
|
|
45
|
+
function St(r) {
|
|
46
46
|
const t = new FormData();
|
|
47
|
-
return Object.entries(
|
|
47
|
+
return Object.entries(r).forEach(([e, n]) => t.append(e, n)), t;
|
|
48
48
|
}
|
|
49
|
-
function G(
|
|
50
|
-
if (
|
|
49
|
+
function G(r, t, e = !1) {
|
|
50
|
+
if (r == null)
|
|
51
51
|
return e;
|
|
52
52
|
if (Array.isArray(t))
|
|
53
|
-
return t.findIndex((o, s) => !G(
|
|
54
|
-
const
|
|
55
|
-
return
|
|
53
|
+
return t.findIndex((o, s) => !G(r[s], t[s], e)) == -1;
|
|
54
|
+
const n = typeof t;
|
|
55
|
+
return n != typeof r ? !1 : n == "object" ? Object.keys(t).find((o) => !G(r[o], t[o], e)) == null : n == "function" ? r.toString() == t.toString() : r == t;
|
|
56
56
|
}
|
|
57
|
-
function b(
|
|
58
|
-
const e = typeof
|
|
59
|
-
return e != "object" ||
|
|
57
|
+
function b(r, t) {
|
|
58
|
+
const e = typeof r, n = typeof t;
|
|
59
|
+
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((s) => b(r[s], t[s]));
|
|
60
60
|
}
|
|
61
|
-
function At(
|
|
61
|
+
function At(r, t) {
|
|
62
62
|
t.forEach((e) => {
|
|
63
|
-
Object.getOwnPropertyNames(e.prototype).forEach((
|
|
63
|
+
Object.getOwnPropertyNames(e.prototype).forEach((n) => {
|
|
64
64
|
Object.defineProperty(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Object.getOwnPropertyDescriptor(e.prototype,
|
|
65
|
+
r.prototype,
|
|
66
|
+
n,
|
|
67
|
+
Object.getOwnPropertyDescriptor(e.prototype, n) || /* @__PURE__ */ Object.create(null)
|
|
68
68
|
);
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function U(
|
|
72
|
+
function U(r) {
|
|
73
73
|
try {
|
|
74
|
-
return JSON.parse(
|
|
74
|
+
return JSON.parse(r);
|
|
75
75
|
} catch {
|
|
76
|
-
return
|
|
76
|
+
return r;
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
function bt(
|
|
79
|
+
function bt(r, t) {
|
|
80
80
|
let e = [];
|
|
81
|
-
return JSON.stringify(
|
|
81
|
+
return JSON.stringify(r, (n, o) => {
|
|
82
82
|
if (typeof o == "object" && o !== null) {
|
|
83
83
|
if (e.includes(o))
|
|
84
84
|
return;
|
|
@@ -87,40 +87,40 @@ function bt(n, t) {
|
|
|
87
87
|
return o;
|
|
88
88
|
}, t);
|
|
89
89
|
}
|
|
90
|
-
function Rt(
|
|
91
|
-
return
|
|
90
|
+
function Rt(r, t) {
|
|
91
|
+
return r.indexOf(t) === -1 && r.push(t), r;
|
|
92
92
|
}
|
|
93
|
-
function Ot(
|
|
94
|
-
return
|
|
95
|
-
...
|
|
96
|
-
...t.filter((e) => !
|
|
93
|
+
function Ot(r, t) {
|
|
94
|
+
return ct([
|
|
95
|
+
...r.filter((e) => !t.includes((n) => b(e, n))),
|
|
96
|
+
...t.filter((e) => !r.includes((n) => b(e, n)))
|
|
97
97
|
]);
|
|
98
98
|
}
|
|
99
|
-
function $t(
|
|
99
|
+
function $t(r) {
|
|
100
100
|
return function(t, e) {
|
|
101
|
-
const
|
|
102
|
-
return typeof
|
|
101
|
+
const n = x(t, r), o = x(e, r);
|
|
102
|
+
return typeof n != "string" || typeof o != "string" ? 1 : n.toLowerCase().localeCompare(o.toLowerCase());
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function Lt(
|
|
106
|
-
return (e) => b(x(e,
|
|
105
|
+
function Lt(r, t) {
|
|
106
|
+
return (e) => b(x(e, r), t);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return
|
|
108
|
+
function it(r, t = []) {
|
|
109
|
+
return r.forEach((e) => Array.isArray(e) ? it(e, t) : t.push(e)), t;
|
|
110
110
|
}
|
|
111
|
-
function Ct(
|
|
112
|
-
return function(e,
|
|
113
|
-
const o = x(e,
|
|
111
|
+
function Ct(r, t = !1) {
|
|
112
|
+
return function(e, n) {
|
|
113
|
+
const o = x(e, r), s = x(n, r);
|
|
114
114
|
return typeof o == "number" && typeof s == "number" ? (t ? -1 : 1) * (o - s) : o > s ? t ? -1 : 1 : o < s ? t ? 1 : -1 : 0;
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
for (let t =
|
|
119
|
-
|
|
120
|
-
return
|
|
117
|
+
function ct(r) {
|
|
118
|
+
for (let t = r.length - 1; t >= 0; t--)
|
|
119
|
+
r.slice(0, t).find((e) => b(e, r[t])) && r.splice(t, 1);
|
|
120
|
+
return r;
|
|
121
121
|
}
|
|
122
|
-
function ut(
|
|
123
|
-
return Array.isArray(
|
|
122
|
+
function ut(r) {
|
|
123
|
+
return Array.isArray(r) ? r : [r];
|
|
124
124
|
}
|
|
125
125
|
class A extends Array {
|
|
126
126
|
/** Number of elements in set */
|
|
@@ -214,47 +214,105 @@ class A extends Array {
|
|
|
214
214
|
return new A([...this, ...t]);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
class Nt extends Map {
|
|
218
|
+
/**
|
|
219
|
+
* Create new cache
|
|
220
|
+
*
|
|
221
|
+
* @param {keyof T} key Default property to use as primary key
|
|
222
|
+
* @param {number} ttl Default expiry in milliseconds
|
|
223
|
+
*/
|
|
224
|
+
constructor(e, n) {
|
|
225
|
+
super();
|
|
226
|
+
/** Whether cache is complete */
|
|
227
|
+
c(this, "complete", !1);
|
|
228
|
+
this.key = e, this.ttl = n;
|
|
229
|
+
}
|
|
230
|
+
getKey(e) {
|
|
231
|
+
return e[this.key];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Get all cached items
|
|
235
|
+
*
|
|
236
|
+
* @return {T[]} Array of items
|
|
237
|
+
*/
|
|
238
|
+
all() {
|
|
239
|
+
return Array.from(this.values());
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Add a new item to the cache. Like set, but finds key automatically
|
|
243
|
+
*
|
|
244
|
+
* @param {T} value Item to add to cache
|
|
245
|
+
* @param {number | undefined} ttl Override default expiry
|
|
246
|
+
* @return {this}
|
|
247
|
+
*/
|
|
248
|
+
add(e, n = this.ttl) {
|
|
249
|
+
const o = this.getKey(e);
|
|
250
|
+
return this.set(o, e, n), this;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Add several rows to the cache
|
|
254
|
+
*
|
|
255
|
+
* @param {T[]} rows Several items that will be cached using the default key
|
|
256
|
+
* @param complete Mark cache as complete & reliable, defaults to true
|
|
257
|
+
* @return {this}
|
|
258
|
+
*/
|
|
259
|
+
addAll(e, n = !0) {
|
|
260
|
+
return e.forEach((o) => this.add(o)), this.complete = n, this;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Add an item to the cache manually specifying the key
|
|
264
|
+
* @param {K} key Key item will be cached under
|
|
265
|
+
* @param {T} value Item to cache
|
|
266
|
+
* @param {number | undefined} ttl Override default expiry
|
|
267
|
+
* @return {this}
|
|
268
|
+
*/
|
|
269
|
+
set(e, n, o = this.ttl) {
|
|
270
|
+
return super.set(e, n), o && setTimeout(() => {
|
|
271
|
+
this.complete = !1, super.delete(e);
|
|
272
|
+
}, o), this;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function Tt(r, t = !0) {
|
|
276
|
+
const e = r.reduce((n, o) => (Object.keys(t ? F(o) : o).forEach((s) => {
|
|
277
|
+
n.includes(s) || n.push(s);
|
|
278
|
+
}), n), []);
|
|
221
279
|
return [
|
|
222
280
|
e.join(","),
|
|
223
|
-
...
|
|
224
|
-
const s = x(
|
|
225
|
-
return
|
|
281
|
+
...r.map((n) => e.map((o) => {
|
|
282
|
+
const s = x(n, o), i = typeof s;
|
|
283
|
+
return i == "string" && s.includes(",") ? `"${s}"` : i == "object" ? `"${JSON.stringify(s)}"` : s;
|
|
226
284
|
}).join(","))
|
|
227
285
|
].join(`
|
|
228
286
|
`);
|
|
229
287
|
}
|
|
230
|
-
class
|
|
288
|
+
class E extends Promise {
|
|
231
289
|
constructor(e) {
|
|
232
|
-
super((
|
|
233
|
-
(s) =>
|
|
290
|
+
super((n, o) => e(
|
|
291
|
+
(s) => n(s),
|
|
234
292
|
(s) => o(s),
|
|
235
293
|
(s) => this.progress = s
|
|
236
294
|
));
|
|
237
|
-
|
|
238
|
-
|
|
295
|
+
c(this, "listeners", []);
|
|
296
|
+
c(this, "_progress", 0);
|
|
239
297
|
}
|
|
240
298
|
get progress() {
|
|
241
299
|
return this._progress;
|
|
242
300
|
}
|
|
243
301
|
set progress(e) {
|
|
244
|
-
e != this._progress && (this._progress = e, this.listeners.forEach((
|
|
302
|
+
e != this._progress && (this._progress = e, this.listeners.forEach((n) => n(e)));
|
|
245
303
|
}
|
|
246
304
|
static from(e) {
|
|
247
|
-
return e instanceof
|
|
305
|
+
return e instanceof E ? e : new E((n, o) => e.then((...s) => n(...s)).catch((...s) => o(...s)));
|
|
248
306
|
}
|
|
249
307
|
from(e) {
|
|
250
|
-
const
|
|
251
|
-
return this.onProgress((o) =>
|
|
308
|
+
const n = E.from(e);
|
|
309
|
+
return this.onProgress((o) => n.progress = o), n;
|
|
252
310
|
}
|
|
253
311
|
onProgress(e) {
|
|
254
312
|
return this.listeners.push(e), this;
|
|
255
313
|
}
|
|
256
|
-
then(e,
|
|
257
|
-
const o = super.then(e,
|
|
314
|
+
then(e, n) {
|
|
315
|
+
const o = super.then(e, n);
|
|
258
316
|
return this.from(o);
|
|
259
317
|
}
|
|
260
318
|
catch(e) {
|
|
@@ -264,81 +322,81 @@ class m extends Promise {
|
|
|
264
322
|
return this.from(super.finally(e));
|
|
265
323
|
}
|
|
266
324
|
}
|
|
267
|
-
function
|
|
268
|
-
|
|
269
|
-
const e = URL.createObjectURL(
|
|
325
|
+
function Mt(r, t) {
|
|
326
|
+
r instanceof Blob || (r = new Blob(ut(r)));
|
|
327
|
+
const e = URL.createObjectURL(r);
|
|
270
328
|
at(e, t), URL.revokeObjectURL(e);
|
|
271
329
|
}
|
|
272
|
-
function at(
|
|
330
|
+
function at(r, t) {
|
|
273
331
|
const e = document.createElement("a");
|
|
274
|
-
e.href =
|
|
332
|
+
e.href = r, e.download = t || r.split("/").pop(), document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
275
333
|
}
|
|
276
|
-
function It(
|
|
334
|
+
function It(r = {}) {
|
|
277
335
|
return new Promise((t) => {
|
|
278
336
|
const e = document.createElement("input");
|
|
279
|
-
e.type = "file", e.accept =
|
|
337
|
+
e.type = "file", e.accept = r.accept || "*", e.style.display = "none", e.multiple = !!r.multiple, e.onblur = e.onchange = async () => {
|
|
280
338
|
t(Array.from(e.files)), e.remove();
|
|
281
339
|
}, document.body.appendChild(e), e.click();
|
|
282
340
|
});
|
|
283
341
|
}
|
|
284
|
-
function
|
|
342
|
+
function Dt(r, t = /* @__PURE__ */ new Date()) {
|
|
285
343
|
(typeof t == "number" || typeof t == "string") && (t = new Date(t));
|
|
286
344
|
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")}`;
|
|
287
|
-
return
|
|
345
|
+
return r ? r.replace("{{TIMESTAMP}}", e) : e;
|
|
288
346
|
}
|
|
289
|
-
function
|
|
290
|
-
return new
|
|
347
|
+
function jt(r) {
|
|
348
|
+
return new E((t, e, n) => {
|
|
291
349
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
292
|
-
|
|
350
|
+
r.files.forEach((i) => s.append("file", i)), o.withCredentials = !!r.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? n(i.loaded / i.total) : null), o.addEventListener("loadend", () => t(U(o.responseText))), o.addEventListener("error", () => e(U(o.responseText))), o.addEventListener("timeout", () => e({ error: "Request timed out" })), o.open("POST", r.url), Object.entries(r.headers || {}).forEach(([i, y]) => o.setRequestHeader(i, y)), o.send(s);
|
|
293
351
|
});
|
|
294
352
|
}
|
|
295
353
|
class v {
|
|
296
354
|
constructor() {
|
|
297
|
-
|
|
355
|
+
c(this, "listeners", {});
|
|
298
356
|
}
|
|
299
357
|
static emit(t, ...e) {
|
|
300
|
-
(this.listeners["*"] || []).forEach((
|
|
358
|
+
(this.listeners["*"] || []).forEach((n) => n(t, ...e)), (this.listeners[t.toString()] || []).forEach((n) => n(...e));
|
|
301
359
|
}
|
|
302
360
|
static off(t, e) {
|
|
303
|
-
const
|
|
304
|
-
this.listeners[
|
|
361
|
+
const n = t.toString();
|
|
362
|
+
this.listeners[n] = (this.listeners[n] || []).filter((o) => o === e);
|
|
305
363
|
}
|
|
306
364
|
static on(t, e) {
|
|
307
365
|
var o;
|
|
308
|
-
const
|
|
309
|
-
return this.listeners[
|
|
366
|
+
const n = t.toString();
|
|
367
|
+
return this.listeners[n] || (this.listeners[n] = []), (o = this.listeners[n]) == null || o.push(e), () => this.off(t, e);
|
|
310
368
|
}
|
|
311
369
|
static once(t, e) {
|
|
312
|
-
return new Promise((
|
|
370
|
+
return new Promise((n) => {
|
|
313
371
|
const o = this.on(t, (...s) => {
|
|
314
|
-
|
|
372
|
+
n(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
315
373
|
});
|
|
316
374
|
});
|
|
317
375
|
}
|
|
318
376
|
emit(t, ...e) {
|
|
319
|
-
(this.listeners["*"] || []).forEach((
|
|
377
|
+
(this.listeners["*"] || []).forEach((n) => n(t, ...e)), (this.listeners[t] || []).forEach((n) => n(...e));
|
|
320
378
|
}
|
|
321
379
|
off(t, e) {
|
|
322
|
-
this.listeners[t] = (this.listeners[t] || []).filter((
|
|
380
|
+
this.listeners[t] = (this.listeners[t] || []).filter((n) => n === e);
|
|
323
381
|
}
|
|
324
382
|
on(t, e) {
|
|
325
|
-
var
|
|
326
|
-
return this.listeners[t] || (this.listeners[t] = []), (
|
|
383
|
+
var n;
|
|
384
|
+
return this.listeners[t] || (this.listeners[t] = []), (n = this.listeners[t]) == null || n.push(e), () => this.off(t, e);
|
|
327
385
|
}
|
|
328
386
|
once(t, e) {
|
|
329
|
-
return new Promise((
|
|
387
|
+
return new Promise((n) => {
|
|
330
388
|
const o = this.on(t, (...s) => {
|
|
331
|
-
|
|
389
|
+
n(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
332
390
|
});
|
|
333
391
|
});
|
|
334
392
|
}
|
|
335
393
|
}
|
|
336
|
-
|
|
394
|
+
c(v, "listeners", {});
|
|
337
395
|
class p extends Error {
|
|
338
|
-
constructor(e,
|
|
396
|
+
constructor(e, n) {
|
|
339
397
|
super(e);
|
|
340
|
-
|
|
341
|
-
|
|
398
|
+
c(this, "_code");
|
|
399
|
+
n != null && (this._code = n);
|
|
342
400
|
}
|
|
343
401
|
get code() {
|
|
344
402
|
return this._code || this.constructor.code;
|
|
@@ -347,11 +405,11 @@ class p extends Error {
|
|
|
347
405
|
this._code = e;
|
|
348
406
|
}
|
|
349
407
|
static from(e) {
|
|
350
|
-
const
|
|
408
|
+
const n = Number(e.statusCode) ?? Number(e.code), o = new this(e.message || e.toString());
|
|
351
409
|
return Object.assign(o, {
|
|
352
410
|
stack: e.stack,
|
|
353
411
|
...e,
|
|
354
|
-
code:
|
|
412
|
+
code: n ?? void 0
|
|
355
413
|
});
|
|
356
414
|
}
|
|
357
415
|
static instanceof(e) {
|
|
@@ -361,7 +419,7 @@ class p extends Error {
|
|
|
361
419
|
return this.message || super.toString();
|
|
362
420
|
}
|
|
363
421
|
}
|
|
364
|
-
|
|
422
|
+
c(p, "code", 500);
|
|
365
423
|
class Y extends p {
|
|
366
424
|
constructor(t = "Bad Request") {
|
|
367
425
|
super(t);
|
|
@@ -370,7 +428,7 @@ class Y extends p {
|
|
|
370
428
|
return t.constructor.code == this.code;
|
|
371
429
|
}
|
|
372
430
|
}
|
|
373
|
-
|
|
431
|
+
c(Y, "code", 400);
|
|
374
432
|
class H extends p {
|
|
375
433
|
constructor(t = "Unauthorized") {
|
|
376
434
|
super(t);
|
|
@@ -379,7 +437,7 @@ class H extends p {
|
|
|
379
437
|
return t.constructor.code == this.code;
|
|
380
438
|
}
|
|
381
439
|
}
|
|
382
|
-
|
|
440
|
+
c(H, "code", 401);
|
|
383
441
|
class W extends p {
|
|
384
442
|
constructor(t = "Payment Required") {
|
|
385
443
|
super(t);
|
|
@@ -388,7 +446,7 @@ class W extends p {
|
|
|
388
446
|
return t.constructor.code == this.code;
|
|
389
447
|
}
|
|
390
448
|
}
|
|
391
|
-
|
|
449
|
+
c(W, "code", 402);
|
|
392
450
|
class z extends p {
|
|
393
451
|
constructor(t = "Forbidden") {
|
|
394
452
|
super(t);
|
|
@@ -397,8 +455,8 @@ class z extends p {
|
|
|
397
455
|
return t.constructor.code == this.code;
|
|
398
456
|
}
|
|
399
457
|
}
|
|
400
|
-
|
|
401
|
-
class
|
|
458
|
+
c(z, "code", 403);
|
|
459
|
+
class K extends p {
|
|
402
460
|
constructor(t = "Not Found") {
|
|
403
461
|
super(t);
|
|
404
462
|
}
|
|
@@ -406,8 +464,8 @@ class J extends p {
|
|
|
406
464
|
return t.constructor.code == this.code;
|
|
407
465
|
}
|
|
408
466
|
}
|
|
409
|
-
|
|
410
|
-
class
|
|
467
|
+
c(K, "code", 404);
|
|
468
|
+
class J extends p {
|
|
411
469
|
constructor(t = "Method Not Allowed") {
|
|
412
470
|
super(t);
|
|
413
471
|
}
|
|
@@ -415,7 +473,7 @@ class K extends p {
|
|
|
415
473
|
return t.constructor.code == this.code;
|
|
416
474
|
}
|
|
417
475
|
}
|
|
418
|
-
|
|
476
|
+
c(J, "code", 405);
|
|
419
477
|
class Z extends p {
|
|
420
478
|
constructor(t = "Not Acceptable") {
|
|
421
479
|
super(t);
|
|
@@ -424,7 +482,7 @@ class Z extends p {
|
|
|
424
482
|
return t.constructor.code == this.code;
|
|
425
483
|
}
|
|
426
484
|
}
|
|
427
|
-
|
|
485
|
+
c(Z, "code", 406);
|
|
428
486
|
class V extends p {
|
|
429
487
|
constructor(t = "Internal Server Error") {
|
|
430
488
|
super(t);
|
|
@@ -433,7 +491,7 @@ class V extends p {
|
|
|
433
491
|
return t.constructor.code == this.code;
|
|
434
492
|
}
|
|
435
493
|
}
|
|
436
|
-
|
|
494
|
+
c(V, "code", 500);
|
|
437
495
|
class X extends p {
|
|
438
496
|
constructor(t = "Not Implemented") {
|
|
439
497
|
super(t);
|
|
@@ -442,7 +500,7 @@ class X extends p {
|
|
|
442
500
|
return t.constructor.code == this.code;
|
|
443
501
|
}
|
|
444
502
|
}
|
|
445
|
-
|
|
503
|
+
c(X, "code", 501);
|
|
446
504
|
class Q extends p {
|
|
447
505
|
constructor(t = "Bad Gateway") {
|
|
448
506
|
super(t);
|
|
@@ -451,7 +509,7 @@ class Q extends p {
|
|
|
451
509
|
return t.constructor.code == this.code;
|
|
452
510
|
}
|
|
453
511
|
}
|
|
454
|
-
|
|
512
|
+
c(Q, "code", 502);
|
|
455
513
|
class _ extends p {
|
|
456
514
|
constructor(t = "Service Unavailable") {
|
|
457
515
|
super(t);
|
|
@@ -460,7 +518,7 @@ class _ extends p {
|
|
|
460
518
|
return t.constructor.code == this.code;
|
|
461
519
|
}
|
|
462
520
|
}
|
|
463
|
-
|
|
521
|
+
c(_, "code", 503);
|
|
464
522
|
class tt extends p {
|
|
465
523
|
constructor(t = "Gateway Timeout") {
|
|
466
524
|
super(t);
|
|
@@ -469,11 +527,11 @@ class tt extends p {
|
|
|
469
527
|
return t.constructor.code == this.code;
|
|
470
528
|
}
|
|
471
529
|
}
|
|
472
|
-
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
530
|
+
c(tt, "code", 504);
|
|
531
|
+
function kt(r, t) {
|
|
532
|
+
if (r >= 200 && r < 300)
|
|
475
533
|
return null;
|
|
476
|
-
switch (
|
|
534
|
+
switch (r) {
|
|
477
535
|
case 400:
|
|
478
536
|
return new Y(t);
|
|
479
537
|
case 401:
|
|
@@ -483,9 +541,9 @@ function jt(n, t) {
|
|
|
483
541
|
case 403:
|
|
484
542
|
return new z(t);
|
|
485
543
|
case 404:
|
|
486
|
-
return new J(t);
|
|
487
|
-
case 405:
|
|
488
544
|
return new K(t);
|
|
545
|
+
case 405:
|
|
546
|
+
return new J(t);
|
|
489
547
|
case 406:
|
|
490
548
|
return new Z(t);
|
|
491
549
|
case 500:
|
|
@@ -499,14 +557,14 @@ function jt(n, t) {
|
|
|
499
557
|
case 504:
|
|
500
558
|
return new tt(t);
|
|
501
559
|
default:
|
|
502
|
-
return new p(t,
|
|
560
|
+
return new p(t, r);
|
|
503
561
|
}
|
|
504
562
|
}
|
|
505
563
|
const w = class w {
|
|
506
564
|
constructor(t = {}) {
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
565
|
+
c(this, "interceptors", {});
|
|
566
|
+
c(this, "headers", {});
|
|
567
|
+
c(this, "url");
|
|
510
568
|
this.url = t.url ?? null, this.headers = t.headers || {}, t.interceptors && t.interceptors.forEach((e) => w.addInterceptor(e));
|
|
511
569
|
}
|
|
512
570
|
static addInterceptor(t) {
|
|
@@ -526,19 +584,19 @@ const w = class w {
|
|
|
526
584
|
if (!this.url && !t.url)
|
|
527
585
|
throw new Error("URL needs to be set");
|
|
528
586
|
let e = ((o = t.url) != null && o.startsWith("http") ? t.url : (this.url || "") + (t.url || "")).replace(/([^:]\/)\/+/g, "$1");
|
|
529
|
-
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (s,
|
|
530
|
-
const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((
|
|
531
|
-
e += (e.includes("?") ? "&" : "?") + s.map((
|
|
587
|
+
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (s, i) => `#${t.fragment}${i}`) : e += "#" + t.fragment), t.query) {
|
|
588
|
+
const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((i) => ({ key: i, value: t.query[i] }));
|
|
589
|
+
e += (e.includes("?") ? "&" : "?") + s.map((i) => `${i.key}=${i.value}`).join("&");
|
|
532
590
|
}
|
|
533
|
-
const
|
|
591
|
+
const n = ot({
|
|
534
592
|
"Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
535
593
|
...w.headers,
|
|
536
594
|
...this.headers,
|
|
537
595
|
...t.headers
|
|
538
596
|
});
|
|
539
|
-
return typeof t.body == "object" && t.body != null &&
|
|
597
|
+
return typeof t.body == "object" && t.body != null && n["Content-Type"] == "application/json" && (t.body = JSON.stringify(t.body)), new E((s, i, y) => {
|
|
540
598
|
fetch(e, {
|
|
541
|
-
headers:
|
|
599
|
+
headers: n,
|
|
542
600
|
method: t.method || (t.body ? "POST" : "GET"),
|
|
543
601
|
body: t.body
|
|
544
602
|
}).then(async (u) => {
|
|
@@ -563,12 +621,12 @@ const w = class w {
|
|
|
563
621
|
const a = (k = u.headers.get("Content-Type")) == null ? void 0 : k.toLowerCase();
|
|
564
622
|
a != null && a.includes("form") ? u.data = await u.data.formData() : a != null && a.includes("json") ? u.data = await u.data.json() : a != null && a.includes("text") ? u.data = await u.data.text() : a != null && a.includes("application") && (u.data = await u.data.blob());
|
|
565
623
|
}
|
|
566
|
-
u.ok ? s(u) :
|
|
624
|
+
u.ok ? s(u) : i(u);
|
|
567
625
|
});
|
|
568
626
|
});
|
|
569
627
|
}
|
|
570
628
|
};
|
|
571
|
-
|
|
629
|
+
c(w, "interceptors", {}), c(w, "headers", {});
|
|
572
630
|
let q = w;
|
|
573
631
|
const S = {
|
|
574
632
|
CLEAR: "\x1B[0m",
|
|
@@ -595,7 +653,7 @@ const S = {
|
|
|
595
653
|
LIGHT_MAGENTA: "\x1B[95m",
|
|
596
654
|
LIGHT_CYAN: "\x1B[96m",
|
|
597
655
|
WHITE: "\x1B[97m"
|
|
598
|
-
},
|
|
656
|
+
}, Gt = {
|
|
599
657
|
BLACK: "\x1B[40m",
|
|
600
658
|
RED: "\x1B[41m",
|
|
601
659
|
GREEN: "\x1B[42m",
|
|
@@ -606,16 +664,16 @@ const S = {
|
|
|
606
664
|
WHITE: "\x1B[47m",
|
|
607
665
|
GREY: "\x1B[100m"
|
|
608
666
|
};
|
|
609
|
-
var lt = /* @__PURE__ */ ((
|
|
667
|
+
var lt = /* @__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))(lt || {});
|
|
610
668
|
const g = class g extends v {
|
|
611
669
|
constructor(t) {
|
|
612
670
|
super(), this.namespace = t;
|
|
613
671
|
}
|
|
614
|
-
pad(t, e,
|
|
615
|
-
const s = t.toString(),
|
|
616
|
-
if (
|
|
672
|
+
pad(t, e, n, o = !1) {
|
|
673
|
+
const s = t.toString(), i = e - s.length;
|
|
674
|
+
if (i <= 0)
|
|
617
675
|
return s;
|
|
618
|
-
const y = Array(~~(
|
|
676
|
+
const y = Array(~~(i / n.length)).fill(n).join("");
|
|
619
677
|
return o ? s + y : y + s;
|
|
620
678
|
}
|
|
621
679
|
format(...t) {
|
|
@@ -653,163 +711,164 @@ const g = class g extends v {
|
|
|
653
711
|
g.emit(0, e), console.error($.RED + e + S.CLEAR);
|
|
654
712
|
}
|
|
655
713
|
};
|
|
656
|
-
|
|
714
|
+
c(g, "LOG_LEVEL", 4);
|
|
657
715
|
let P = g;
|
|
658
|
-
function
|
|
659
|
-
const t = (y, u) => u < 1e-7 ? y : t(u, ~~(y % u)), e =
|
|
660
|
-
let
|
|
661
|
-
const s = t(o,
|
|
662
|
-
o = ~~(o / s),
|
|
663
|
-
const
|
|
664
|
-
return o -=
|
|
665
|
-
}
|
|
666
|
-
function
|
|
667
|
-
let t =
|
|
716
|
+
function Ut(r) {
|
|
717
|
+
const t = (y, u) => u < 1e-7 ? y : t(u, ~~(y % u)), e = r.toString().length - 2;
|
|
718
|
+
let n = Math.pow(10, e), o = r * n;
|
|
719
|
+
const s = t(o, n);
|
|
720
|
+
o = ~~(o / s), n = ~~(n / s);
|
|
721
|
+
const i = ~~(o / n);
|
|
722
|
+
return o -= i * n, `${i ? i + " " : ""}${~~o}/${~~n}`;
|
|
723
|
+
}
|
|
724
|
+
function qt(r) {
|
|
725
|
+
let t = r.split(" ");
|
|
668
726
|
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
669
727
|
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
670
728
|
}
|
|
671
|
-
const T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
672
|
-
function
|
|
673
|
-
if (
|
|
729
|
+
const T = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", M = "0123456789", I = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", ft = T + M + I;
|
|
730
|
+
function Pt(r, t = 2) {
|
|
731
|
+
if (r === 0)
|
|
674
732
|
return "0 Bytes";
|
|
675
|
-
const e = 1024,
|
|
676
|
-
return parseFloat((
|
|
733
|
+
const e = 1024, n = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.floor(Math.log(r) / Math.log(e));
|
|
734
|
+
return parseFloat((r / Math.pow(e, o)).toFixed(t)) + " " + n[o];
|
|
677
735
|
}
|
|
678
|
-
function
|
|
679
|
-
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(
|
|
736
|
+
function Ft(r) {
|
|
737
|
+
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(r);
|
|
680
738
|
if (!t)
|
|
681
|
-
throw new Error(`Number cannot be parsed: ${
|
|
739
|
+
throw new Error(`Number cannot be parsed: ${r}`);
|
|
682
740
|
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
683
741
|
}
|
|
684
|
-
function
|
|
685
|
-
return `${
|
|
742
|
+
function vt(r, t, e) {
|
|
743
|
+
return `${r.slice(0, e)}${t}${r.slice(e + 1)}`;
|
|
686
744
|
}
|
|
687
|
-
function
|
|
688
|
-
return
|
|
745
|
+
function Yt(r, t, e = " ", n = !0) {
|
|
746
|
+
return n ? r.toString().padStart(t, e) : r.toString().padEnd(t, e);
|
|
689
747
|
}
|
|
690
|
-
function
|
|
691
|
-
return Array(
|
|
748
|
+
function Ht(r) {
|
|
749
|
+
return Array(r).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
692
750
|
}
|
|
693
|
-
function
|
|
694
|
-
return Array(
|
|
751
|
+
function Wt(r, t = ft) {
|
|
752
|
+
return Array(r).fill(null).map(() => {
|
|
695
753
|
const e = ~~(Math.random() * t.length);
|
|
696
754
|
return t[e];
|
|
697
755
|
}).join("");
|
|
698
756
|
}
|
|
699
|
-
function
|
|
700
|
-
if (!t && !e && !
|
|
757
|
+
function zt(r, t = !1, e = !1, n = !1) {
|
|
758
|
+
if (!t && !e && !n)
|
|
701
759
|
throw new Error("Must enable at least one: letters, numbers, symbols");
|
|
702
|
-
return Array(
|
|
760
|
+
return Array(r).fill(null).map(() => {
|
|
703
761
|
let o;
|
|
704
762
|
do {
|
|
705
763
|
const s = ~~(Math.random() * 3);
|
|
706
|
-
t && s == 0 ? o = T[~~(Math.random() * T.length)] : e && s == 1 ? o =
|
|
764
|
+
t && s == 0 ? o = T[~~(Math.random() * T.length)] : e && s == 1 ? o = M[~~(Math.random() * M.length)] : n && s == 2 && (o = I[~~(Math.random() * I.length)]);
|
|
707
765
|
} while (!o);
|
|
708
766
|
return o;
|
|
709
767
|
}).join("");
|
|
710
768
|
}
|
|
711
|
-
function
|
|
769
|
+
function Kt(r, t) {
|
|
712
770
|
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
713
771
|
throw new TypeError("Regular expression must be global.");
|
|
714
|
-
let e = [],
|
|
715
|
-
for (; (
|
|
716
|
-
e.push(
|
|
772
|
+
let e = [], n;
|
|
773
|
+
for (; (n = t.exec(r)) !== null; )
|
|
774
|
+
e.push(n);
|
|
717
775
|
return e;
|
|
718
776
|
}
|
|
719
|
-
function Jt(
|
|
777
|
+
function Jt(r) {
|
|
720
778
|
const t = new RegExp(
|
|
721
779
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
722
780
|
"gm"
|
|
723
|
-
).exec(
|
|
724
|
-
if (e.port != null && (e.port = Number(e.port)),
|
|
781
|
+
).exec(r), e = (t == null ? void 0 : t.groups) ?? {}, n = e.domain.split(".");
|
|
782
|
+
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) {
|
|
725
783
|
const o = e.query.split("&"), s = {};
|
|
726
|
-
o.forEach((
|
|
727
|
-
const [y, u] =
|
|
784
|
+
o.forEach((i) => {
|
|
785
|
+
const [y, u] = i.split("=");
|
|
728
786
|
s[y] = u;
|
|
729
787
|
}), e.query = s;
|
|
730
788
|
}
|
|
731
789
|
return e;
|
|
732
790
|
}
|
|
733
|
-
function ht(
|
|
734
|
-
var t = dt(yt(gt(pt(
|
|
791
|
+
function ht(r) {
|
|
792
|
+
var t = dt(yt(gt(pt(r), 8 * r.length)));
|
|
735
793
|
return t.toLowerCase();
|
|
736
794
|
}
|
|
737
|
-
function dt(
|
|
738
|
-
for (var t, e = "0123456789ABCDEF",
|
|
739
|
-
t =
|
|
740
|
-
return
|
|
795
|
+
function dt(r) {
|
|
796
|
+
for (var t, e = "0123456789ABCDEF", n = "", o = 0; o < r.length; o++)
|
|
797
|
+
t = r.charCodeAt(o), n += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
|
798
|
+
return n;
|
|
741
799
|
}
|
|
742
|
-
function pt(
|
|
743
|
-
for (var t = Array(
|
|
800
|
+
function pt(r) {
|
|
801
|
+
for (var t = Array(r.length >> 2), e = 0; e < t.length; e++)
|
|
744
802
|
t[e] = 0;
|
|
745
|
-
for (e = 0; e < 8 *
|
|
746
|
-
t[e >> 5] |= (255 &
|
|
803
|
+
for (e = 0; e < 8 * r.length; e += 8)
|
|
804
|
+
t[e >> 5] |= (255 & r.charCodeAt(e / 8)) << e % 32;
|
|
747
805
|
return t;
|
|
748
806
|
}
|
|
749
|
-
function yt(
|
|
750
|
-
for (var t = "", e = 0; e < 32 *
|
|
751
|
-
t += String.fromCharCode(
|
|
807
|
+
function yt(r) {
|
|
808
|
+
for (var t = "", e = 0; e < 32 * r.length; e += 8)
|
|
809
|
+
t += String.fromCharCode(r[e >> 5] >>> e % 32 & 255);
|
|
752
810
|
return t;
|
|
753
811
|
}
|
|
754
|
-
function gt(
|
|
755
|
-
|
|
756
|
-
for (var e = 1732584193,
|
|
757
|
-
var y = e, u =
|
|
758
|
-
|
|
812
|
+
function gt(r, t) {
|
|
813
|
+
r[t >> 5] |= 128 << t % 32, r[14 + (t + 64 >>> 9 << 4)] = t;
|
|
814
|
+
for (var e = 1732584193, n = -271733879, o = -1732584194, s = 271733878, i = 0; i < r.length; i += 16) {
|
|
815
|
+
var y = e, u = n, R = o, C = s;
|
|
816
|
+
n = d(n = d(n = d(n = d(n = h(n = h(n = h(n = h(n = f(n = f(n = f(n = f(n = l(n = l(n = l(n = l(n, o = l(o, s = l(s, e = l(e, n, o, s, r[i + 0], 7, -680876936), n, o, r[i + 1], 12, -389564586), e, n, r[i + 2], 17, 606105819), s, e, r[i + 3], 22, -1044525330), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 4], 7, -176418897), n, o, r[i + 5], 12, 1200080426), e, n, r[i + 6], 17, -1473231341), s, e, r[i + 7], 22, -45705983), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 8], 7, 1770035416), n, o, r[i + 9], 12, -1958414417), e, n, r[i + 10], 17, -42063), s, e, r[i + 11], 22, -1990404162), o = l(o, s = l(s, e = l(e, n, o, s, r[i + 12], 7, 1804603682), n, o, r[i + 13], 12, -40341101), e, n, r[i + 14], 17, -1502002290), s, e, r[i + 15], 22, 1236535329), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 1], 5, -165796510), n, o, r[i + 6], 9, -1069501632), e, n, r[i + 11], 14, 643717713), s, e, r[i + 0], 20, -373897302), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 5], 5, -701558691), n, o, r[i + 10], 9, 38016083), e, n, r[i + 15], 14, -660478335), s, e, r[i + 4], 20, -405537848), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 9], 5, 568446438), n, o, r[i + 14], 9, -1019803690), e, n, r[i + 3], 14, -187363961), s, e, r[i + 8], 20, 1163531501), o = f(o, s = f(s, e = f(e, n, o, s, r[i + 13], 5, -1444681467), n, o, r[i + 2], 9, -51403784), e, n, r[i + 7], 14, 1735328473), s, e, r[i + 12], 20, -1926607734), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 5], 4, -378558), n, o, r[i + 8], 11, -2022574463), e, n, r[i + 11], 16, 1839030562), s, e, r[i + 14], 23, -35309556), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 1], 4, -1530992060), n, o, r[i + 4], 11, 1272893353), e, n, r[i + 7], 16, -155497632), s, e, r[i + 10], 23, -1094730640), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 13], 4, 681279174), n, o, r[i + 0], 11, -358537222), e, n, r[i + 3], 16, -722521979), s, e, r[i + 6], 23, 76029189), o = h(o, s = h(s, e = h(e, n, o, s, r[i + 9], 4, -640364487), n, o, r[i + 12], 11, -421815835), e, n, r[i + 15], 16, 530742520), s, e, r[i + 2], 23, -995338651), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 0], 6, -198630844), n, o, r[i + 7], 10, 1126891415), e, n, r[i + 14], 15, -1416354905), s, e, r[i + 5], 21, -57434055), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 12], 6, 1700485571), n, o, r[i + 3], 10, -1894986606), e, n, r[i + 10], 15, -1051523), s, e, r[i + 1], 21, -2054922799), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 8], 6, 1873313359), n, o, r[i + 15], 10, -30611744), e, n, r[i + 6], 15, -1560198380), s, e, r[i + 13], 21, 1309151649), o = d(o, s = d(s, e = d(e, n, o, s, r[i + 4], 6, -145523070), n, o, r[i + 11], 10, -1120210379), e, n, r[i + 2], 15, 718787259), s, e, r[i + 9], 21, -343485551), e = m(e, y), n = m(n, u), o = m(o, R), s = m(s, C);
|
|
759
817
|
}
|
|
760
|
-
return Array(e,
|
|
818
|
+
return Array(e, n, o, s);
|
|
761
819
|
}
|
|
762
|
-
function L(
|
|
763
|
-
return
|
|
820
|
+
function L(r, t, e, n, o, s) {
|
|
821
|
+
return m(wt(m(m(t, r), m(n, s)), o), e);
|
|
764
822
|
}
|
|
765
|
-
function l(
|
|
766
|
-
return L(t & e | ~t &
|
|
823
|
+
function l(r, t, e, n, o, s, i) {
|
|
824
|
+
return L(t & e | ~t & n, r, t, o, s, i);
|
|
767
825
|
}
|
|
768
|
-
function f(
|
|
769
|
-
return L(t &
|
|
826
|
+
function f(r, t, e, n, o, s, i) {
|
|
827
|
+
return L(t & n | e & ~n, r, t, o, s, i);
|
|
770
828
|
}
|
|
771
|
-
function h(
|
|
772
|
-
return L(t ^ e ^
|
|
829
|
+
function h(r, t, e, n, o, s, i) {
|
|
830
|
+
return L(t ^ e ^ n, r, t, o, s, i);
|
|
773
831
|
}
|
|
774
|
-
function d(
|
|
775
|
-
return L(e ^ (t | ~
|
|
832
|
+
function d(r, t, e, n, o, s, i) {
|
|
833
|
+
return L(e ^ (t | ~n), r, t, o, s, i);
|
|
776
834
|
}
|
|
777
|
-
function
|
|
778
|
-
var e = (65535 &
|
|
779
|
-
return (
|
|
835
|
+
function m(r, t) {
|
|
836
|
+
var e = (65535 & r) + (65535 & t);
|
|
837
|
+
return (r >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
780
838
|
}
|
|
781
|
-
function wt(
|
|
782
|
-
return
|
|
839
|
+
function wt(r, t) {
|
|
840
|
+
return r << t | r >>> 32 - t;
|
|
783
841
|
}
|
|
784
|
-
function
|
|
785
|
-
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(
|
|
842
|
+
function Zt(r) {
|
|
843
|
+
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(r);
|
|
786
844
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
845
|
+
function Vt(r, t = "mp") {
|
|
846
|
+
return r ? `https://www.gravatar.com/avatar/${ht(r)}?d=${t}` : "";
|
|
789
847
|
}
|
|
790
|
-
function
|
|
791
|
-
(typeof
|
|
792
|
-
let t =
|
|
793
|
-
return t >= 12 ? (t > 12 && (t -= 12), e = "PM") : t == 0 && (t = 12), `${
|
|
848
|
+
function Xt(r) {
|
|
849
|
+
(typeof r == "number" || typeof r == "string") && (r = new Date(r));
|
|
850
|
+
let t = r.getHours(), e = "AM";
|
|
851
|
+
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}`;
|
|
794
852
|
}
|
|
795
|
-
function
|
|
796
|
-
return new Promise((t) => setTimeout(t,
|
|
853
|
+
function mt(r) {
|
|
854
|
+
return new Promise((t) => setTimeout(t, r));
|
|
797
855
|
}
|
|
798
|
-
async function
|
|
799
|
-
for (;
|
|
800
|
-
await
|
|
856
|
+
async function Qt(r, t = 100) {
|
|
857
|
+
for (; await r(); )
|
|
858
|
+
await mt(t);
|
|
801
859
|
}
|
|
802
|
-
function
|
|
803
|
-
return (
|
|
860
|
+
function _t(r) {
|
|
861
|
+
return (r instanceof Date ? r.getTime() : r) - (/* @__PURE__ */ new Date()).getTime();
|
|
804
862
|
}
|
|
805
|
-
function
|
|
863
|
+
function te() {
|
|
806
864
|
return Object.keys({});
|
|
807
865
|
}
|
|
808
866
|
export {
|
|
809
867
|
A as ASet,
|
|
810
868
|
Q as BadGatewayError,
|
|
811
869
|
Y as BadRequestError,
|
|
812
|
-
|
|
870
|
+
Nt as Cache,
|
|
871
|
+
Gt as CliBackground,
|
|
813
872
|
S as CliEffects,
|
|
814
873
|
$ as CliForeground,
|
|
815
874
|
p as CustomError,
|
|
@@ -821,12 +880,12 @@ export {
|
|
|
821
880
|
bt as JSONSanitize,
|
|
822
881
|
lt as LOG_LEVEL,
|
|
823
882
|
P as Logger,
|
|
824
|
-
|
|
883
|
+
J as MethodNotAllowedError,
|
|
825
884
|
Z as NotAcceptableError,
|
|
826
|
-
|
|
885
|
+
K as NotFoundError,
|
|
827
886
|
X as NotImplementedError,
|
|
828
887
|
W as PaymentRequiredError,
|
|
829
|
-
|
|
888
|
+
E as PromiseProgress,
|
|
830
889
|
_ as ServiceUnavailableError,
|
|
831
890
|
v as TypedEmitter,
|
|
832
891
|
H as UnauthorizedError,
|
|
@@ -834,45 +893,45 @@ export {
|
|
|
834
893
|
Ot as arrayDiff,
|
|
835
894
|
$t as caseInsensitiveSort,
|
|
836
895
|
ot as clean,
|
|
837
|
-
|
|
838
|
-
|
|
896
|
+
Tt as csv,
|
|
897
|
+
Ut as dec2Frac,
|
|
839
898
|
xt as deepCopy,
|
|
840
899
|
st as deepMerge,
|
|
841
900
|
x as dotNotation,
|
|
842
|
-
|
|
901
|
+
Mt as downloadFile,
|
|
843
902
|
at as downloadUrl,
|
|
844
903
|
Bt as encodeQuery,
|
|
845
|
-
|
|
904
|
+
kt as errorFromCode,
|
|
846
905
|
It as fileBrowser,
|
|
847
906
|
Lt as findByProp,
|
|
848
|
-
|
|
907
|
+
it as flattenArr,
|
|
849
908
|
F as flattenObj,
|
|
850
909
|
St as formData,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
910
|
+
Pt as formatBytes,
|
|
911
|
+
Xt as formatDate,
|
|
912
|
+
Ft as formatPhoneNumber,
|
|
913
|
+
qt as fracToDec,
|
|
914
|
+
Vt as gravatar,
|
|
856
915
|
G as includes,
|
|
857
|
-
|
|
916
|
+
vt as insertAt,
|
|
858
917
|
b as isEqual,
|
|
859
918
|
ut as makeArray,
|
|
860
|
-
|
|
861
|
-
|
|
919
|
+
ct as makeUnique,
|
|
920
|
+
Kt as matchAll,
|
|
862
921
|
ht as md5,
|
|
863
922
|
At as mixin,
|
|
864
|
-
|
|
923
|
+
Yt as pad,
|
|
865
924
|
Jt as parseUrl,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
925
|
+
Ht as randomHex,
|
|
926
|
+
Wt as randomString,
|
|
927
|
+
zt as randomStringBuilder,
|
|
928
|
+
mt as sleep,
|
|
929
|
+
Qt as sleepUntil,
|
|
871
930
|
Ct as sortByProp,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
931
|
+
_t as timeUntil,
|
|
932
|
+
Dt as timestampFilename,
|
|
933
|
+
te as tyoeKeys,
|
|
934
|
+
jt as uploadWithProgress,
|
|
935
|
+
Zt as validateEmail
|
|
877
936
|
};
|
|
878
937
|
//# sourceMappingURL=index.mjs.map
|