@ztimson/utils 0.15.4 → 0.15.6
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/http.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +122 -115
- package/dist/index.mjs.map +1 -1
- package/dist/string.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -41,19 +41,19 @@ function xt(n) {
|
|
|
41
41
|
const t = new FormData();
|
|
42
42
|
return Object.entries(n).forEach(([e, r]) => t.append(e, r)), t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function G(n, t, e = !1) {
|
|
45
45
|
if (n == null)
|
|
46
46
|
return e;
|
|
47
47
|
if (Array.isArray(t))
|
|
48
|
-
return t.findIndex((o, s) => !
|
|
48
|
+
return t.findIndex((o, s) => !G(n[s], t[s], e)) == -1;
|
|
49
49
|
const r = typeof t;
|
|
50
|
-
return r != typeof n ? !1 : r == "object" ? Object.keys(t).find((o) => !
|
|
50
|
+
return r != typeof n ? !1 : r == "object" ? Object.keys(t).find((o) => !G(n[o], t[o], e)) == null : r == "function" ? n.toString() == t.toString() : n == t;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function b(n, t) {
|
|
53
53
|
const e = typeof n, r = typeof t;
|
|
54
|
-
return e != "object" || n == null || r != "object" || t == null ? e == "function" && r == "function" ? n.toString() == t.toString() : n === t : Object.keys(n).length != Object.keys(t).length ? !1 : Object.keys(n).every((s) =>
|
|
54
|
+
return e != "object" || n == null || r != "object" || t == null ? e == "function" && r == "function" ? n.toString() == t.toString() : n === t : Object.keys(n).length != Object.keys(t).length ? !1 : Object.keys(n).every((s) => b(n[s], t[s]));
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Bt(n, t) {
|
|
57
57
|
t.forEach((e) => {
|
|
58
58
|
Object.getOwnPropertyNames(e.prototype).forEach((r) => {
|
|
59
59
|
Object.defineProperty(
|
|
@@ -64,14 +64,14 @@ function At(n, t) {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function U(n) {
|
|
68
68
|
try {
|
|
69
69
|
return JSON.parse(n);
|
|
70
70
|
} catch {
|
|
71
71
|
return n;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function At(n, t) {
|
|
75
75
|
let e = [];
|
|
76
76
|
return JSON.parse(JSON.stringify(n, (r, o) => {
|
|
77
77
|
if (typeof o == "object" && o !== null) {
|
|
@@ -82,7 +82,7 @@ function bt(n, t) {
|
|
|
82
82
|
return o;
|
|
83
83
|
}, t));
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function bt(n) {
|
|
86
86
|
return Object.entries(n).map(
|
|
87
87
|
([t, e]) => encodeURIComponent(t) + "=" + encodeURIComponent(e)
|
|
88
88
|
).join("&");
|
|
@@ -92,8 +92,8 @@ function Rt(n, t) {
|
|
|
92
92
|
}
|
|
93
93
|
function Ot(n, t) {
|
|
94
94
|
return it([
|
|
95
|
-
...n.filter((e) => !t.includes((r) =>
|
|
96
|
-
...t.filter((e) => !n.includes((r) =>
|
|
95
|
+
...n.filter((e) => !t.includes((r) => b(e, r))),
|
|
96
|
+
...t.filter((e) => !n.includes((r) => b(e, r)))
|
|
97
97
|
]);
|
|
98
98
|
}
|
|
99
99
|
function Lt(n) {
|
|
@@ -112,17 +112,17 @@ function St(n, t = !1) {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
function Ct(n, t) {
|
|
115
|
-
return (e) =>
|
|
115
|
+
return (e) => b(e[n], t);
|
|
116
116
|
}
|
|
117
117
|
function it(n) {
|
|
118
118
|
for (let t = n.length - 1; t >= 0; t--)
|
|
119
|
-
n.slice(0, t).find((e) =>
|
|
119
|
+
n.slice(0, t).find((e) => b(e, n[t])) && n.splice(t, 1);
|
|
120
120
|
return n;
|
|
121
121
|
}
|
|
122
122
|
function Nt(n) {
|
|
123
123
|
return Array.isArray(n) ? n : [n];
|
|
124
124
|
}
|
|
125
|
-
class
|
|
125
|
+
class A extends Array {
|
|
126
126
|
/** Number of elements in set */
|
|
127
127
|
get size() {
|
|
128
128
|
return this.length;
|
|
@@ -155,7 +155,7 @@ class b extends Array {
|
|
|
155
155
|
* @return {ASet<T>} Different elements
|
|
156
156
|
*/
|
|
157
157
|
difference(t) {
|
|
158
|
-
return new
|
|
158
|
+
return new A(this.filter((e) => !t.has(e)));
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Check if set includes element
|
|
@@ -171,7 +171,7 @@ class b extends Array {
|
|
|
171
171
|
* @return {boolean} Set of common elements
|
|
172
172
|
*/
|
|
173
173
|
intersection(t) {
|
|
174
|
-
return new
|
|
174
|
+
return new A(this.filter((e) => t.has(e)));
|
|
175
175
|
}
|
|
176
176
|
/**
|
|
177
177
|
* Check if this set has no elements in common with the comparison set
|
|
@@ -203,7 +203,7 @@ class b extends Array {
|
|
|
203
203
|
* @return {ASet<T>} New set of unique elements
|
|
204
204
|
*/
|
|
205
205
|
symmetricDifference(t) {
|
|
206
|
-
return new
|
|
206
|
+
return new A([...this.difference(t), ...t.difference(this)]);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Create joined list of elements included in this & the comparison set
|
|
@@ -211,7 +211,7 @@ class b extends Array {
|
|
|
211
211
|
* @return {ASet<T>} New set of both previous sets combined
|
|
212
212
|
*/
|
|
213
213
|
union(t) {
|
|
214
|
-
return new
|
|
214
|
+
return new A([...this, ...t]);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
class m extends Promise {
|
|
@@ -251,13 +251,13 @@ class m extends Promise {
|
|
|
251
251
|
return this.from(super.finally(e));
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function at(n, t) {
|
|
255
255
|
const e = document.createElement("a");
|
|
256
256
|
e.href = n, e.download = t, document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
257
257
|
}
|
|
258
258
|
function Tt(n, t) {
|
|
259
259
|
const e = URL.createObjectURL(n);
|
|
260
|
-
|
|
260
|
+
at(e, t), URL.revokeObjectURL(e);
|
|
261
261
|
}
|
|
262
262
|
function It(n = {}) {
|
|
263
263
|
return new Promise((t) => {
|
|
@@ -270,10 +270,10 @@ function It(n = {}) {
|
|
|
270
270
|
function $t(n) {
|
|
271
271
|
return new m((t, e, r) => {
|
|
272
272
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
273
|
-
n.files.forEach((c) => s.append("file", c)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (c) => c.lengthComputable ? r(c.loaded / c.total) : null), o.addEventListener("loadend", () => t(
|
|
273
|
+
n.files.forEach((c) => s.append("file", c)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (c) => c.lengthComputable ? r(c.loaded / c.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", n.url), Object.entries(n.headers || {}).forEach(([c, y]) => o.setRequestHeader(c, y)), o.send(s);
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
class
|
|
276
|
+
class F {
|
|
277
277
|
constructor() {
|
|
278
278
|
i(this, "listeners", {});
|
|
279
279
|
}
|
|
@@ -314,7 +314,7 @@ class v {
|
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
i(
|
|
317
|
+
i(F, "listeners", {});
|
|
318
318
|
class p extends Error {
|
|
319
319
|
constructor(e, r) {
|
|
320
320
|
super(e);
|
|
@@ -343,7 +343,7 @@ class p extends Error {
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
i(p, "code", 500);
|
|
346
|
-
class
|
|
346
|
+
class v extends p {
|
|
347
347
|
constructor(t = "Bad Request") {
|
|
348
348
|
super(t);
|
|
349
349
|
}
|
|
@@ -351,8 +351,8 @@ class F extends p {
|
|
|
351
351
|
return t.constructor.code == this.code;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
i(
|
|
355
|
-
class
|
|
354
|
+
i(v, "code", 400);
|
|
355
|
+
class Y extends p {
|
|
356
356
|
constructor(t = "Unauthorized") {
|
|
357
357
|
super(t);
|
|
358
358
|
}
|
|
@@ -360,8 +360,8 @@ class H extends p {
|
|
|
360
360
|
return t.constructor.code == this.code;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
i(
|
|
364
|
-
class
|
|
363
|
+
i(Y, "code", 401);
|
|
364
|
+
class H extends p {
|
|
365
365
|
constructor(t = "Payment Required") {
|
|
366
366
|
super(t);
|
|
367
367
|
}
|
|
@@ -369,7 +369,7 @@ class Y extends p {
|
|
|
369
369
|
return t.constructor.code == this.code;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
i(
|
|
372
|
+
i(H, "code", 402);
|
|
373
373
|
class W extends p {
|
|
374
374
|
constructor(t = "Forbidden") {
|
|
375
375
|
super(t);
|
|
@@ -379,7 +379,7 @@ class W extends p {
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
i(W, "code", 403);
|
|
382
|
-
class
|
|
382
|
+
class z extends p {
|
|
383
383
|
constructor(t = "Not Found") {
|
|
384
384
|
super(t);
|
|
385
385
|
}
|
|
@@ -387,8 +387,8 @@ class J extends p {
|
|
|
387
387
|
return t.constructor.code == this.code;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
i(
|
|
391
|
-
class
|
|
390
|
+
i(z, "code", 404);
|
|
391
|
+
class J extends p {
|
|
392
392
|
constructor(t = "Method Not Allowed") {
|
|
393
393
|
super(t);
|
|
394
394
|
}
|
|
@@ -396,7 +396,7 @@ class z extends p {
|
|
|
396
396
|
return t.constructor.code == this.code;
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
|
-
i(
|
|
399
|
+
i(J, "code", 405);
|
|
400
400
|
class K extends p {
|
|
401
401
|
constructor(t = "Not Acceptable") {
|
|
402
402
|
super(t);
|
|
@@ -406,7 +406,7 @@ class K extends p {
|
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
i(K, "code", 406);
|
|
409
|
-
class
|
|
409
|
+
class Z extends p {
|
|
410
410
|
constructor(t = "Internal Server Error") {
|
|
411
411
|
super(t);
|
|
412
412
|
}
|
|
@@ -414,8 +414,8 @@ class V extends p {
|
|
|
414
414
|
return t.constructor.code == this.code;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
i(
|
|
418
|
-
class
|
|
417
|
+
i(Z, "code", 500);
|
|
418
|
+
class V extends p {
|
|
419
419
|
constructor(t = "Not Implemented") {
|
|
420
420
|
super(t);
|
|
421
421
|
}
|
|
@@ -423,7 +423,7 @@ class Z extends p {
|
|
|
423
423
|
return t.constructor.code == this.code;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
i(
|
|
426
|
+
i(V, "code", 501);
|
|
427
427
|
class X extends p {
|
|
428
428
|
constructor(t = "Bad Gateway") {
|
|
429
429
|
super(t);
|
|
@@ -456,23 +456,23 @@ function Dt(n, t) {
|
|
|
456
456
|
return null;
|
|
457
457
|
switch (n) {
|
|
458
458
|
case 400:
|
|
459
|
-
return new
|
|
459
|
+
return new v(t);
|
|
460
460
|
case 401:
|
|
461
|
-
return new H(t);
|
|
462
|
-
case 402:
|
|
463
461
|
return new Y(t);
|
|
462
|
+
case 402:
|
|
463
|
+
return new H(t);
|
|
464
464
|
case 403:
|
|
465
465
|
return new W(t);
|
|
466
466
|
case 404:
|
|
467
|
-
return new J(t);
|
|
468
|
-
case 405:
|
|
469
467
|
return new z(t);
|
|
468
|
+
case 405:
|
|
469
|
+
return new J(t);
|
|
470
470
|
case 406:
|
|
471
471
|
return new K(t);
|
|
472
472
|
case 500:
|
|
473
|
-
return new V(t);
|
|
474
|
-
case 501:
|
|
475
473
|
return new Z(t);
|
|
474
|
+
case 501:
|
|
475
|
+
return new V(t);
|
|
476
476
|
case 502:
|
|
477
477
|
return new X(t);
|
|
478
478
|
case 503:
|
|
@@ -522,36 +522,36 @@ const w = class w {
|
|
|
522
522
|
headers: r,
|
|
523
523
|
method: t.method || (t.body ? "POST" : "GET"),
|
|
524
524
|
body: t.body
|
|
525
|
-
}).then(async (
|
|
526
|
-
var
|
|
527
|
-
for (let
|
|
528
|
-
await new Promise((O) => a
|
|
529
|
-
const R =
|
|
525
|
+
}).then(async (a) => {
|
|
526
|
+
var M, j;
|
|
527
|
+
for (let u of [...Object.values(w.interceptors), ...Object.values(this.interceptors)])
|
|
528
|
+
await new Promise((O) => u(a, () => O()));
|
|
529
|
+
const R = a.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
|
|
530
530
|
let k = 0;
|
|
531
|
-
const T = (
|
|
532
|
-
start(
|
|
531
|
+
const T = (M = a.body) == null ? void 0 : M.getReader(), tt = new ReadableStream({
|
|
532
|
+
start(u) {
|
|
533
533
|
function O() {
|
|
534
534
|
T == null || T.read().then((x) => {
|
|
535
535
|
if (x.done)
|
|
536
|
-
return
|
|
537
|
-
k += x.value.byteLength, y(k / N),
|
|
538
|
-
}).catch((x) =>
|
|
536
|
+
return u.close();
|
|
537
|
+
k += x.value.byteLength, y(k / N), u.enqueue(x.value), O();
|
|
538
|
+
}).catch((x) => u.error(x));
|
|
539
539
|
}
|
|
540
540
|
O();
|
|
541
541
|
}
|
|
542
542
|
});
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
|
|
543
|
+
if (a.data = new Response(tt), t.decode == null || t.decode) {
|
|
544
|
+
const u = (j = a.headers.get("Content-Type")) == null ? void 0 : j.toLowerCase();
|
|
545
|
+
u != null && u.includes("form") ? a.data = await a.data.formData() : u != null && u.includes("json") ? a.data = await a.data.json() : u != null && u.includes("text") ? a.data = await a.data.text() : u != null && u.includes("application") && (a.data = await a.data.blob());
|
|
546
546
|
}
|
|
547
|
-
|
|
547
|
+
a.ok ? s(a) : c(a);
|
|
548
548
|
});
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
551
|
};
|
|
552
552
|
i(w, "interceptors", {}), i(w, "headers", {});
|
|
553
|
-
let
|
|
554
|
-
const
|
|
553
|
+
let q = w;
|
|
554
|
+
const B = {
|
|
555
555
|
CLEAR: "\x1B[0m",
|
|
556
556
|
BRIGHT: "\x1B[1m",
|
|
557
557
|
DIM: "\x1B[2m",
|
|
@@ -587,8 +587,8 @@ const A = {
|
|
|
587
587
|
WHITE: "\x1B[47m",
|
|
588
588
|
GREY: "\x1B[100m"
|
|
589
589
|
};
|
|
590
|
-
var
|
|
591
|
-
const g = class g extends
|
|
590
|
+
var ut = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(ut || {});
|
|
591
|
+
const g = class g extends F {
|
|
592
592
|
constructor(t) {
|
|
593
593
|
super(), this.namespace = t;
|
|
594
594
|
}
|
|
@@ -607,62 +607,68 @@ const g = class g extends v {
|
|
|
607
607
|
if (g.LOG_LEVEL < 4)
|
|
608
608
|
return;
|
|
609
609
|
const e = this.format(...t);
|
|
610
|
-
g.emit(4, e), console.debug(L.LIGHT_GREY + e +
|
|
610
|
+
g.emit(4, e), console.debug(L.LIGHT_GREY + e + B.CLEAR);
|
|
611
611
|
}
|
|
612
612
|
log(...t) {
|
|
613
613
|
if (g.LOG_LEVEL < 3)
|
|
614
614
|
return;
|
|
615
615
|
const e = this.format(...t);
|
|
616
|
-
g.emit(3, e), console.log(
|
|
616
|
+
g.emit(3, e), console.log(B.CLEAR + e);
|
|
617
617
|
}
|
|
618
618
|
info(...t) {
|
|
619
619
|
if (g.LOG_LEVEL < 2)
|
|
620
620
|
return;
|
|
621
621
|
const e = this.format(...t);
|
|
622
|
-
g.emit(2, e), console.info(L.BLUE + e +
|
|
622
|
+
g.emit(2, e), console.info(L.BLUE + e + B.CLEAR);
|
|
623
623
|
}
|
|
624
624
|
warn(...t) {
|
|
625
625
|
if (g.LOG_LEVEL < 1)
|
|
626
626
|
return;
|
|
627
627
|
const e = this.format(...t);
|
|
628
|
-
g.emit(1, e), console.warn(L.YELLOW + e +
|
|
628
|
+
g.emit(1, e), console.warn(L.YELLOW + e + B.CLEAR);
|
|
629
629
|
}
|
|
630
630
|
error(...t) {
|
|
631
631
|
if (g.LOG_LEVEL < 0)
|
|
632
632
|
return;
|
|
633
633
|
const e = this.format(...t);
|
|
634
|
-
g.emit(0, e), console.error(L.RED + e +
|
|
634
|
+
g.emit(0, e), console.error(L.RED + e + B.CLEAR);
|
|
635
635
|
}
|
|
636
636
|
};
|
|
637
637
|
i(g, "LOG_LEVEL", 4);
|
|
638
638
|
let P = g;
|
|
639
|
-
function
|
|
640
|
-
const t = (y,
|
|
639
|
+
function Mt(n) {
|
|
640
|
+
const t = (y, a) => a < 1e-7 ? y : t(a, ~~(y % a)), e = n.toString().length - 2;
|
|
641
641
|
let r = Math.pow(10, e), o = n * r;
|
|
642
642
|
const s = t(o, r);
|
|
643
643
|
o = ~~(o / s), r = ~~(r / s);
|
|
644
644
|
const c = ~~(o / r);
|
|
645
645
|
return o -= c * r, `${c ? c + " " : ""}${~~o}/${~~r}`;
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function jt(n) {
|
|
648
648
|
let t = n.split(" ");
|
|
649
649
|
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
650
650
|
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
651
651
|
}
|
|
652
|
-
function
|
|
652
|
+
function Gt(n, t) {
|
|
653
653
|
return n.length - n.replaceAll(t, "").length;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Ut(n) {
|
|
656
656
|
return Array(n).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
657
657
|
}
|
|
658
|
+
function qt(n, t = 2) {
|
|
659
|
+
if (n === 0)
|
|
660
|
+
return "0 Bytes";
|
|
661
|
+
const e = 1024, r = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], o = Math.floor(Math.log(n) / Math.log(e));
|
|
662
|
+
return parseFloat((n / Math.pow(e, o)).toFixed(t)) + " " + r[o];
|
|
663
|
+
}
|
|
658
664
|
const I = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", $ = "0123456789", D = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", lt = I + $ + D;
|
|
659
|
-
function
|
|
665
|
+
function Pt(n) {
|
|
660
666
|
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(n);
|
|
661
667
|
if (!t)
|
|
662
668
|
throw new Error(`Number cannot be parsed: ${n}`);
|
|
663
669
|
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
664
670
|
}
|
|
665
|
-
function
|
|
671
|
+
function Ft(n, t, e) {
|
|
666
672
|
return `${n.slice(0, e)}${t}${n.slice(e + 1)}`;
|
|
667
673
|
}
|
|
668
674
|
function vt(n, t, e, r = !0) {
|
|
@@ -672,7 +678,7 @@ function vt(n, t, e, r = !0) {
|
|
|
672
678
|
const c = Array(~~(s / e.length)).fill(e).join("");
|
|
673
679
|
return r ? c + o : o + c;
|
|
674
680
|
}
|
|
675
|
-
function
|
|
681
|
+
function Yt(n, t = lt) {
|
|
676
682
|
return Array(n).fill(null).map(() => {
|
|
677
683
|
const e = ~~(Math.random() * t.length);
|
|
678
684
|
return t[e];
|
|
@@ -690,7 +696,7 @@ function Ht(n, t = !1, e = !1, r = !1) {
|
|
|
690
696
|
return o;
|
|
691
697
|
}).join("");
|
|
692
698
|
}
|
|
693
|
-
function
|
|
699
|
+
function Wt(n, t) {
|
|
694
700
|
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
695
701
|
throw new TypeError("Regular expression must be global.");
|
|
696
702
|
let e = [], r;
|
|
@@ -722,8 +728,8 @@ function pt(n) {
|
|
|
722
728
|
function yt(n, t) {
|
|
723
729
|
n[t >> 5] |= 128 << t % 32, n[14 + (t + 64 >>> 9 << 4)] = t;
|
|
724
730
|
for (var e = 1732584193, r = -271733879, o = -1732584194, s = 271733878, c = 0; c < n.length; c += 16) {
|
|
725
|
-
var y = e,
|
|
726
|
-
r = d(r = d(r = d(r = d(r = f(r = f(r = f(r = f(r = h(r = h(r = h(r = h(r = l(r = l(r = l(r = l(r, o = l(o, s = l(s, e = l(e, r, o, s, n[c + 0], 7, -680876936), r, o, n[c + 1], 12, -389564586), e, r, n[c + 2], 17, 606105819), s, e, n[c + 3], 22, -1044525330), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 4], 7, -176418897), r, o, n[c + 5], 12, 1200080426), e, r, n[c + 6], 17, -1473231341), s, e, n[c + 7], 22, -45705983), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 8], 7, 1770035416), r, o, n[c + 9], 12, -1958414417), e, r, n[c + 10], 17, -42063), s, e, n[c + 11], 22, -1990404162), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 12], 7, 1804603682), r, o, n[c + 13], 12, -40341101), e, r, n[c + 14], 17, -1502002290), s, e, n[c + 15], 22, 1236535329), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 1], 5, -165796510), r, o, n[c + 6], 9, -1069501632), e, r, n[c + 11], 14, 643717713), s, e, n[c + 0], 20, -373897302), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 5], 5, -701558691), r, o, n[c + 10], 9, 38016083), e, r, n[c + 15], 14, -660478335), s, e, n[c + 4], 20, -405537848), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 9], 5, 568446438), r, o, n[c + 14], 9, -1019803690), e, r, n[c + 3], 14, -187363961), s, e, n[c + 8], 20, 1163531501), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 13], 5, -1444681467), r, o, n[c + 2], 9, -51403784), e, r, n[c + 7], 14, 1735328473), s, e, n[c + 12], 20, -1926607734), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 5], 4, -378558), r, o, n[c + 8], 11, -2022574463), e, r, n[c + 11], 16, 1839030562), s, e, n[c + 14], 23, -35309556), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 1], 4, -1530992060), r, o, n[c + 4], 11, 1272893353), e, r, n[c + 7], 16, -155497632), s, e, n[c + 10], 23, -1094730640), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 13], 4, 681279174), r, o, n[c + 0], 11, -358537222), e, r, n[c + 3], 16, -722521979), s, e, n[c + 6], 23, 76029189), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 9], 4, -640364487), r, o, n[c + 12], 11, -421815835), e, r, n[c + 15], 16, 530742520), s, e, n[c + 2], 23, -995338651), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 0], 6, -198630844), r, o, n[c + 7], 10, 1126891415), e, r, n[c + 14], 15, -1416354905), s, e, n[c + 5], 21, -57434055), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 12], 6, 1700485571), r, o, n[c + 3], 10, -1894986606), e, r, n[c + 10], 15, -1051523), s, e, n[c + 1], 21, -2054922799), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 8], 6, 1873313359), r, o, n[c + 15], 10, -30611744), e, r, n[c + 6], 15, -1560198380), s, e, n[c + 13], 21, 1309151649), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 4], 6, -145523070), r, o, n[c + 11], 10, -1120210379), e, r, n[c + 2], 15, 718787259), s, e, n[c + 9], 21, -343485551), e = E(e, y), r = E(r,
|
|
731
|
+
var y = e, a = r, R = o, N = s;
|
|
732
|
+
r = d(r = d(r = d(r = d(r = f(r = f(r = f(r = f(r = h(r = h(r = h(r = h(r = l(r = l(r = l(r = l(r, o = l(o, s = l(s, e = l(e, r, o, s, n[c + 0], 7, -680876936), r, o, n[c + 1], 12, -389564586), e, r, n[c + 2], 17, 606105819), s, e, n[c + 3], 22, -1044525330), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 4], 7, -176418897), r, o, n[c + 5], 12, 1200080426), e, r, n[c + 6], 17, -1473231341), s, e, n[c + 7], 22, -45705983), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 8], 7, 1770035416), r, o, n[c + 9], 12, -1958414417), e, r, n[c + 10], 17, -42063), s, e, n[c + 11], 22, -1990404162), o = l(o, s = l(s, e = l(e, r, o, s, n[c + 12], 7, 1804603682), r, o, n[c + 13], 12, -40341101), e, r, n[c + 14], 17, -1502002290), s, e, n[c + 15], 22, 1236535329), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 1], 5, -165796510), r, o, n[c + 6], 9, -1069501632), e, r, n[c + 11], 14, 643717713), s, e, n[c + 0], 20, -373897302), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 5], 5, -701558691), r, o, n[c + 10], 9, 38016083), e, r, n[c + 15], 14, -660478335), s, e, n[c + 4], 20, -405537848), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 9], 5, 568446438), r, o, n[c + 14], 9, -1019803690), e, r, n[c + 3], 14, -187363961), s, e, n[c + 8], 20, 1163531501), o = h(o, s = h(s, e = h(e, r, o, s, n[c + 13], 5, -1444681467), r, o, n[c + 2], 9, -51403784), e, r, n[c + 7], 14, 1735328473), s, e, n[c + 12], 20, -1926607734), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 5], 4, -378558), r, o, n[c + 8], 11, -2022574463), e, r, n[c + 11], 16, 1839030562), s, e, n[c + 14], 23, -35309556), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 1], 4, -1530992060), r, o, n[c + 4], 11, 1272893353), e, r, n[c + 7], 16, -155497632), s, e, n[c + 10], 23, -1094730640), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 13], 4, 681279174), r, o, n[c + 0], 11, -358537222), e, r, n[c + 3], 16, -722521979), s, e, n[c + 6], 23, 76029189), o = f(o, s = f(s, e = f(e, r, o, s, n[c + 9], 4, -640364487), r, o, n[c + 12], 11, -421815835), e, r, n[c + 15], 16, 530742520), s, e, n[c + 2], 23, -995338651), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 0], 6, -198630844), r, o, n[c + 7], 10, 1126891415), e, r, n[c + 14], 15, -1416354905), s, e, n[c + 5], 21, -57434055), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 12], 6, 1700485571), r, o, n[c + 3], 10, -1894986606), e, r, n[c + 10], 15, -1051523), s, e, n[c + 1], 21, -2054922799), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 8], 6, 1873313359), r, o, n[c + 15], 10, -30611744), e, r, n[c + 6], 15, -1560198380), s, e, n[c + 13], 21, 1309151649), o = d(o, s = d(s, e = d(e, r, o, s, n[c + 4], 6, -145523070), r, o, n[c + 11], 10, -1120210379), e, r, n[c + 2], 15, 718787259), s, e, n[c + 9], 21, -343485551), e = E(e, y), r = E(r, a), o = E(o, R), s = E(s, N);
|
|
727
733
|
}
|
|
728
734
|
return Array(e, r, o, s);
|
|
729
735
|
}
|
|
@@ -749,13 +755,13 @@ function E(n, t) {
|
|
|
749
755
|
function gt(n, t) {
|
|
750
756
|
return n << t | n >>> 32 - t;
|
|
751
757
|
}
|
|
752
|
-
function
|
|
758
|
+
function zt(n) {
|
|
753
759
|
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(n);
|
|
754
760
|
}
|
|
755
761
|
function Jt(n, t = "mp") {
|
|
756
762
|
return n ? `https://www.gravatar.com/avatar/${ht(n)}?d=${t}` : "";
|
|
757
763
|
}
|
|
758
|
-
function
|
|
764
|
+
function Kt(n) {
|
|
759
765
|
const t = new RegExp(
|
|
760
766
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
761
767
|
"gm"
|
|
@@ -763,13 +769,13 @@ function zt(n) {
|
|
|
763
769
|
if (e.port != null && (e.port = Number(e.port)), r.length > 2 && (e.domain = r.splice(-2, 2).join("."), e.subdomain = r.join(".")), e.query) {
|
|
764
770
|
const o = e.query.split("&"), s = {};
|
|
765
771
|
o.forEach((c) => {
|
|
766
|
-
const [y,
|
|
767
|
-
s[y] =
|
|
772
|
+
const [y, a] = c.split("=");
|
|
773
|
+
s[y] = a;
|
|
768
774
|
}), e.query = s;
|
|
769
775
|
}
|
|
770
776
|
return e;
|
|
771
777
|
}
|
|
772
|
-
function
|
|
778
|
+
function Zt(n) {
|
|
773
779
|
const t = n instanceof Date ? n : new Date(n);
|
|
774
780
|
return new Intl.DateTimeFormat("en-us", {
|
|
775
781
|
weekday: "long",
|
|
@@ -787,45 +793,45 @@ async function Vt(n, t = 100) {
|
|
|
787
793
|
for (; n(); )
|
|
788
794
|
await wt(t);
|
|
789
795
|
}
|
|
790
|
-
function
|
|
796
|
+
function Xt(n) {
|
|
791
797
|
return (n instanceof Date ? n.getTime() : n) - (/* @__PURE__ */ new Date()).getTime();
|
|
792
798
|
}
|
|
793
799
|
export {
|
|
794
|
-
|
|
800
|
+
A as ASet,
|
|
795
801
|
X as BadGatewayError,
|
|
796
|
-
|
|
802
|
+
v as BadRequestError,
|
|
797
803
|
kt as CliBackground,
|
|
798
|
-
|
|
804
|
+
B as CliEffects,
|
|
799
805
|
L as CliForeground,
|
|
800
806
|
p as CustomError,
|
|
801
807
|
W as ForbiddenError,
|
|
802
808
|
_ as GatewayTimeoutError,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
809
|
+
q as Http,
|
|
810
|
+
Z as InternalServerError,
|
|
811
|
+
U as JSONAttemptParse,
|
|
812
|
+
At as JSONSanitized,
|
|
813
|
+
ut as LOG_LEVEL,
|
|
808
814
|
P as Logger,
|
|
809
|
-
|
|
815
|
+
J as MethodNotAllowedError,
|
|
810
816
|
K as NotAcceptableError,
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
817
|
+
z as NotFoundError,
|
|
818
|
+
V as NotImplementedError,
|
|
819
|
+
H as PaymentRequiredError,
|
|
814
820
|
m as PromiseProgress,
|
|
815
821
|
Q as ServiceUnavailableError,
|
|
816
|
-
|
|
817
|
-
|
|
822
|
+
F as TypedEmitter,
|
|
823
|
+
Y as UnauthorizedError,
|
|
818
824
|
Rt as addUnique,
|
|
819
825
|
Ot as arrayDiff,
|
|
820
826
|
Lt as caseInsensitiveSort,
|
|
821
827
|
rt as clean,
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
828
|
+
Gt as countChars,
|
|
829
|
+
Ut as createHex,
|
|
830
|
+
Mt as dec2Frac,
|
|
825
831
|
mt as deepCopy,
|
|
826
832
|
ot as deepMerge,
|
|
827
833
|
S as dotNotation,
|
|
828
|
-
|
|
834
|
+
at as download,
|
|
829
835
|
Tt as downloadBlob,
|
|
830
836
|
Dt as errorFromCode,
|
|
831
837
|
It as fileBrowser,
|
|
@@ -833,28 +839,29 @@ export {
|
|
|
833
839
|
ct as flattenArr,
|
|
834
840
|
st as flattenObj,
|
|
835
841
|
xt as formData,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
842
|
+
qt as formatBytes,
|
|
843
|
+
Zt as formatDate,
|
|
844
|
+
Pt as formatPhoneNumber,
|
|
845
|
+
jt as fracToDec,
|
|
839
846
|
Jt as gravatar,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
847
|
+
G as includes,
|
|
848
|
+
Ft as insertAt,
|
|
849
|
+
b as isEqual,
|
|
843
850
|
Nt as makeArray,
|
|
844
851
|
it as makeUnique,
|
|
845
|
-
|
|
852
|
+
Wt as matchAll,
|
|
846
853
|
ht as md5,
|
|
847
|
-
|
|
854
|
+
Bt as mixin,
|
|
848
855
|
vt as pad,
|
|
849
|
-
|
|
856
|
+
Yt as randomString,
|
|
850
857
|
Ht as randomStringBuilder,
|
|
851
858
|
wt as sleep,
|
|
852
859
|
Vt as sleepUntil,
|
|
853
860
|
St as sortByProp,
|
|
854
|
-
|
|
861
|
+
Xt as timeUntil,
|
|
855
862
|
$t as uploadWithProgress,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
863
|
+
bt as urlEncode,
|
|
864
|
+
Kt as urlParser,
|
|
865
|
+
zt as validateEmail
|
|
859
866
|
};
|
|
860
867
|
//# sourceMappingURL=index.mjs.map
|