@ztimson/utils 0.15.2 → 0.15.4
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/errors.d.ts +42 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +510 -407
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var et = Object.defineProperty;
|
|
2
|
+
var nt = (n, t, e) => t in n ? et(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var i = (n, t, e) => (nt(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4
|
+
function rt(n, t = !1) {
|
|
5
5
|
if (n == null)
|
|
6
6
|
throw new Error("Cannot clean a NULL value");
|
|
7
|
-
return Array.isArray(n) ? n = n.filter((
|
|
8
|
-
(
|
|
7
|
+
return Array.isArray(n) ? n = n.filter((e) => e != null) : Object.entries(n).forEach(([e, r]) => {
|
|
8
|
+
(t && r === void 0 || !t && r == null) && delete n[e];
|
|
9
9
|
}), n;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function mt(n) {
|
|
12
12
|
return JSON.parse(JSON.stringify(n));
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
for (const r in
|
|
17
|
-
|
|
14
|
+
function ot(n, ...t) {
|
|
15
|
+
return t.forEach((e) => {
|
|
16
|
+
for (const r in e)
|
|
17
|
+
e[r] && typeof e[r] == "object" && !Array.isArray(e[r]) ? (n[r] || (n[r] = {}), ot(n[r], e[r])) : n[r] = e[r];
|
|
18
18
|
}), n;
|
|
19
19
|
}
|
|
20
|
-
function S(n,
|
|
21
|
-
if (!(n == null || !
|
|
22
|
-
return
|
|
20
|
+
function S(n, t, e) {
|
|
21
|
+
if (!(n == null || !t))
|
|
22
|
+
return t.split(/[.[\]]/g).filter((r) => r.length).reduce((r, o, s, c) => {
|
|
23
23
|
if ((o[0] == '"' || o[0] == "'") && (o = o.slice(1, -1)), !(r != null && r.hasOwnProperty(o))) {
|
|
24
|
-
if (
|
|
24
|
+
if (e == null)
|
|
25
25
|
return;
|
|
26
26
|
r[o] = {};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return e !== void 0 && s == c.length - 1 ? r[o] = e : r[o];
|
|
29
29
|
}, n);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function st(n, t, e = {}) {
|
|
32
32
|
if (typeof n == "object" && !Array.isArray(n)) {
|
|
33
33
|
for (const r of Object.keys(n)) {
|
|
34
|
-
const o =
|
|
35
|
-
typeof n[r] == "object" ?
|
|
34
|
+
const o = t ? t + "." + r : r;
|
|
35
|
+
typeof n[r] == "object" ? st(n[r], o, e) : e[o] = n[r];
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return e;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
return Object.entries(n).forEach(([
|
|
40
|
+
function xt(n) {
|
|
41
|
+
const t = new FormData();
|
|
42
|
+
return Object.entries(n).forEach(([e, r]) => t.append(e, r)), t;
|
|
43
43
|
}
|
|
44
|
-
function U(n,
|
|
44
|
+
function U(n, t, e = !1) {
|
|
45
45
|
if (n == null)
|
|
46
|
-
return
|
|
47
|
-
if (Array.isArray(
|
|
48
|
-
return
|
|
49
|
-
const r = typeof
|
|
50
|
-
return r != typeof n ? !1 : r == "object" ? Object.keys(
|
|
51
|
-
}
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
Object.getOwnPropertyNames(
|
|
46
|
+
return e;
|
|
47
|
+
if (Array.isArray(t))
|
|
48
|
+
return t.findIndex((o, s) => !U(n[s], t[s], e)) == -1;
|
|
49
|
+
const r = typeof t;
|
|
50
|
+
return r != typeof n ? !1 : r == "object" ? Object.keys(t).find((o) => !U(n[o], t[o], e)) == null : r == "function" ? n.toString() == t.toString() : n == t;
|
|
51
|
+
}
|
|
52
|
+
function B(n, t) {
|
|
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) => B(n[s], t[s]));
|
|
55
|
+
}
|
|
56
|
+
function At(n, t) {
|
|
57
|
+
t.forEach((e) => {
|
|
58
|
+
Object.getOwnPropertyNames(e.prototype).forEach((r) => {
|
|
59
59
|
Object.defineProperty(
|
|
60
60
|
n.prototype,
|
|
61
61
|
r,
|
|
62
|
-
Object.getOwnPropertyDescriptor(
|
|
62
|
+
Object.getOwnPropertyDescriptor(e.prototype, r) || /* @__PURE__ */ Object.create(null)
|
|
63
63
|
);
|
|
64
64
|
});
|
|
65
65
|
});
|
|
@@ -71,58 +71,58 @@ function q(n) {
|
|
|
71
71
|
return n;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
let
|
|
74
|
+
function bt(n, t) {
|
|
75
|
+
let e = [];
|
|
76
76
|
return JSON.parse(JSON.stringify(n, (r, o) => {
|
|
77
77
|
if (typeof o == "object" && o !== null) {
|
|
78
|
-
if (
|
|
78
|
+
if (e.includes(o))
|
|
79
79
|
return;
|
|
80
|
-
|
|
80
|
+
e.push(o);
|
|
81
81
|
}
|
|
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("&");
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
return n.indexOf(
|
|
90
|
+
function Rt(n, t) {
|
|
91
|
+
return n.indexOf(t) === -1 && n.push(t), n;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
return
|
|
95
|
-
...n.filter((
|
|
96
|
-
...
|
|
93
|
+
function Ot(n, t) {
|
|
94
|
+
return it([
|
|
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
|
-
function
|
|
100
|
-
return function(
|
|
101
|
-
const r = S(
|
|
99
|
+
function Lt(n) {
|
|
100
|
+
return function(t, e) {
|
|
101
|
+
const r = S(t, n), o = S(e, n);
|
|
102
102
|
return typeof r != "string" || typeof o != "string" ? 1 : r.toLowerCase().localeCompare(o.toLowerCase());
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
return n.forEach((
|
|
105
|
+
function ct(n, t = []) {
|
|
106
|
+
return n.forEach((e) => Array.isArray(e) ? ct(e, t) : t.push(e)), t;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
return function(
|
|
110
|
-
const o = S(
|
|
111
|
-
return typeof o == "number" && typeof s == "number" ? (
|
|
108
|
+
function St(n, t = !1) {
|
|
109
|
+
return function(e, r) {
|
|
110
|
+
const o = S(e, n), s = S(r, n);
|
|
111
|
+
return typeof o == "number" && typeof s == "number" ? (t ? -1 : 1) * (o - s) : o > s ? t ? -1 : 1 : o < s ? t ? 1 : -1 : 0;
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
return (
|
|
114
|
+
function Ct(n, t) {
|
|
115
|
+
return (e) => B(e[n], t);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
for (let
|
|
119
|
-
n.slice(0,
|
|
117
|
+
function it(n) {
|
|
118
|
+
for (let t = n.length - 1; t >= 0; t--)
|
|
119
|
+
n.slice(0, t).find((e) => B(e, n[t])) && n.splice(t, 1);
|
|
120
120
|
return n;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Nt(n) {
|
|
123
123
|
return Array.isArray(n) ? n : [n];
|
|
124
124
|
}
|
|
125
|
-
class
|
|
125
|
+
class b extends Array {
|
|
126
126
|
/** Number of elements in set */
|
|
127
127
|
get size() {
|
|
128
128
|
return this.length;
|
|
@@ -131,309 +131,404 @@ class B extends Array {
|
|
|
131
131
|
* Array to create set from, duplicate values will be removed
|
|
132
132
|
* @param {T[]} elements Elements which will be added to set
|
|
133
133
|
*/
|
|
134
|
-
constructor(
|
|
135
|
-
super(),
|
|
134
|
+
constructor(t = []) {
|
|
135
|
+
super(), t != null && t.forEach && t.forEach((e) => this.add(e));
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
138
|
* Add single element to set if unique
|
|
139
139
|
* @param {T} el Element to add
|
|
140
140
|
*/
|
|
141
|
-
add(
|
|
142
|
-
this.has(
|
|
141
|
+
add(t) {
|
|
142
|
+
this.has(t) || this.push(t);
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
145
145
|
* Delete element from set
|
|
146
146
|
* @param {T} el Element that will be deleted
|
|
147
147
|
*/
|
|
148
|
-
delete(
|
|
149
|
-
const
|
|
150
|
-
|
|
148
|
+
delete(t) {
|
|
149
|
+
const e = this.indexOf(t);
|
|
150
|
+
e != -1 && this.slice(e, 1);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* Create list of elements this set has which the comparison set does not
|
|
154
154
|
* @param {ASet<T>} set Set to compare against
|
|
155
155
|
* @return {ASet<T>} Different elements
|
|
156
156
|
*/
|
|
157
|
-
difference(
|
|
158
|
-
return new
|
|
157
|
+
difference(t) {
|
|
158
|
+
return new b(this.filter((e) => !t.has(e)));
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* Check if set includes element
|
|
162
162
|
* @param {T} el Element to look for
|
|
163
163
|
* @return {boolean} True if element was found, false otherwise
|
|
164
164
|
*/
|
|
165
|
-
has(
|
|
166
|
-
return this.indexOf(
|
|
165
|
+
has(t) {
|
|
166
|
+
return this.indexOf(t) != -1;
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
169
|
* Create list of elements this set has in common with the comparison set
|
|
170
170
|
* @param {ASet<T>} set Set to compare against
|
|
171
171
|
* @return {boolean} Set of common elements
|
|
172
172
|
*/
|
|
173
|
-
intersection(
|
|
174
|
-
return new
|
|
173
|
+
intersection(t) {
|
|
174
|
+
return new b(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
|
|
178
178
|
* @param {ASet<T>} set Set to compare against
|
|
179
179
|
* @return {boolean} True if nothing in common, false otherwise
|
|
180
180
|
*/
|
|
181
|
-
isDisjointFrom(
|
|
182
|
-
return this.intersection(
|
|
181
|
+
isDisjointFrom(t) {
|
|
182
|
+
return this.intersection(t).size == 0;
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
185
|
* Check if all elements in this set are included in the comparison set
|
|
186
186
|
* @param {ASet<T>} set Set to compare against
|
|
187
187
|
* @return {boolean} True if all elements are included, false otherwise
|
|
188
188
|
*/
|
|
189
|
-
isSubsetOf(
|
|
190
|
-
return this.findIndex((
|
|
189
|
+
isSubsetOf(t) {
|
|
190
|
+
return this.findIndex((e) => !t.has(e)) == -1;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
193
193
|
* Check if all elements from comparison set are included in this set
|
|
194
194
|
* @param {ASet<T>} set Set to compare against
|
|
195
195
|
* @return {boolean} True if all elements are included, false otherwise
|
|
196
196
|
*/
|
|
197
|
-
isSuperset(
|
|
198
|
-
return
|
|
197
|
+
isSuperset(t) {
|
|
198
|
+
return t.findIndex((e) => !this.has(e)) == -1;
|
|
199
199
|
}
|
|
200
200
|
/**
|
|
201
201
|
* Create list of elements that are only in one set but not both (XOR)
|
|
202
202
|
* @param {ASet<T>} set Set to compare against
|
|
203
203
|
* @return {ASet<T>} New set of unique elements
|
|
204
204
|
*/
|
|
205
|
-
symmetricDifference(
|
|
206
|
-
return new
|
|
205
|
+
symmetricDifference(t) {
|
|
206
|
+
return new b([...this.difference(t), ...t.difference(this)]);
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
209
209
|
* Create joined list of elements included in this & the comparison set
|
|
210
210
|
* @param {ASet<T>} set Set join
|
|
211
211
|
* @return {ASet<T>} New set of both previous sets combined
|
|
212
212
|
*/
|
|
213
|
-
union(
|
|
214
|
-
return new
|
|
213
|
+
union(t) {
|
|
214
|
+
return new b([...this, ...t]);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
class
|
|
218
|
-
constructor(
|
|
219
|
-
super((r, o) =>
|
|
217
|
+
class m extends Promise {
|
|
218
|
+
constructor(e) {
|
|
219
|
+
super((r, o) => e(
|
|
220
220
|
(s) => r(s),
|
|
221
221
|
(s) => o(s),
|
|
222
222
|
(s) => this.progress = s
|
|
223
223
|
));
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
i(this, "listeners", []);
|
|
225
|
+
i(this, "_progress", 0);
|
|
226
226
|
}
|
|
227
227
|
get progress() {
|
|
228
228
|
return this._progress;
|
|
229
229
|
}
|
|
230
|
-
set progress(
|
|
231
|
-
|
|
230
|
+
set progress(e) {
|
|
231
|
+
e != this._progress && (this._progress = e, this.listeners.forEach((r) => r(e)));
|
|
232
232
|
}
|
|
233
|
-
static from(
|
|
234
|
-
return
|
|
233
|
+
static from(e) {
|
|
234
|
+
return e instanceof m ? e : new m((r, o) => e.then((...s) => r(...s)).catch((...s) => o(...s)));
|
|
235
235
|
}
|
|
236
|
-
from(
|
|
237
|
-
const r =
|
|
236
|
+
from(e) {
|
|
237
|
+
const r = m.from(e);
|
|
238
238
|
return this.onProgress((o) => r.progress = o), r;
|
|
239
239
|
}
|
|
240
|
-
onProgress(
|
|
241
|
-
return this.listeners.push(
|
|
240
|
+
onProgress(e) {
|
|
241
|
+
return this.listeners.push(e), this;
|
|
242
242
|
}
|
|
243
|
-
then(
|
|
244
|
-
const o = super.then(
|
|
243
|
+
then(e, r) {
|
|
244
|
+
const o = super.then(e, r);
|
|
245
245
|
return this.from(o);
|
|
246
246
|
}
|
|
247
|
-
catch(
|
|
248
|
-
return this.from(super.catch(
|
|
247
|
+
catch(e) {
|
|
248
|
+
return this.from(super.catch(e));
|
|
249
249
|
}
|
|
250
|
-
finally(
|
|
251
|
-
return this.from(super.finally(
|
|
250
|
+
finally(e) {
|
|
251
|
+
return this.from(super.finally(e));
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const
|
|
256
|
-
|
|
254
|
+
function ut(n, t) {
|
|
255
|
+
const e = document.createElement("a");
|
|
256
|
+
e.href = n, e.download = t, document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const
|
|
260
|
-
|
|
258
|
+
function Tt(n, t) {
|
|
259
|
+
const e = URL.createObjectURL(n);
|
|
260
|
+
ut(e, t), URL.revokeObjectURL(e);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
return new Promise((
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}, document.body.appendChild(
|
|
262
|
+
function It(n = {}) {
|
|
263
|
+
return new Promise((t) => {
|
|
264
|
+
const e = document.createElement("input");
|
|
265
|
+
e.type = "file", e.accept = n.accept || "*", e.style.display = "none", e.multiple = !!n.multiple, e.onblur = e.onchange = async () => {
|
|
266
|
+
t(Array.from(e.files)), e.remove();
|
|
267
|
+
}, document.body.appendChild(e), e.click();
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
return new
|
|
270
|
+
function $t(n) {
|
|
271
|
+
return new m((t, e, r) => {
|
|
272
272
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
273
|
-
n.files.forEach((
|
|
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(q(o.responseText))), o.addEventListener("error", () => e(q(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 v {
|
|
277
277
|
constructor() {
|
|
278
|
-
|
|
278
|
+
i(this, "listeners", {});
|
|
279
279
|
}
|
|
280
|
-
static emit(
|
|
281
|
-
(this.listeners["*"] || []).forEach((r) => r(
|
|
280
|
+
static emit(t, ...e) {
|
|
281
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t.toString()] || []).forEach((r) => r(...e));
|
|
282
282
|
}
|
|
283
|
-
static off(
|
|
284
|
-
const r =
|
|
285
|
-
this.listeners[r] = (this.listeners[r] || []).filter((o) => o ===
|
|
283
|
+
static off(t, e) {
|
|
284
|
+
const r = t.toString();
|
|
285
|
+
this.listeners[r] = (this.listeners[r] || []).filter((o) => o === e);
|
|
286
286
|
}
|
|
287
|
-
static on(
|
|
287
|
+
static on(t, e) {
|
|
288
288
|
var o;
|
|
289
|
-
const r =
|
|
290
|
-
return this.listeners[r] || (this.listeners[r] = []), (o = this.listeners[r]) == null || o.push(
|
|
289
|
+
const r = t.toString();
|
|
290
|
+
return this.listeners[r] || (this.listeners[r] = []), (o = this.listeners[r]) == null || o.push(e), () => this.off(t, e);
|
|
291
291
|
}
|
|
292
|
-
static once(
|
|
292
|
+
static once(t, e) {
|
|
293
293
|
return new Promise((r) => {
|
|
294
|
-
const o = this.on(
|
|
295
|
-
r(s.length == 1 ? s[0] : s),
|
|
294
|
+
const o = this.on(t, (...s) => {
|
|
295
|
+
r(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
296
296
|
});
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
-
emit(
|
|
300
|
-
(this.listeners["*"] || []).forEach((r) => r(
|
|
299
|
+
emit(t, ...e) {
|
|
300
|
+
(this.listeners["*"] || []).forEach((r) => r(t, ...e)), (this.listeners[t] || []).forEach((r) => r(...e));
|
|
301
301
|
}
|
|
302
|
-
off(
|
|
303
|
-
this.listeners[
|
|
302
|
+
off(t, e) {
|
|
303
|
+
this.listeners[t] = (this.listeners[t] || []).filter((r) => r === e);
|
|
304
304
|
}
|
|
305
|
-
on(
|
|
305
|
+
on(t, e) {
|
|
306
306
|
var r;
|
|
307
|
-
return this.listeners[
|
|
307
|
+
return this.listeners[t] || (this.listeners[t] = []), (r = this.listeners[t]) == null || r.push(e), () => this.off(t, e);
|
|
308
308
|
}
|
|
309
|
-
once(
|
|
309
|
+
once(t, e) {
|
|
310
310
|
return new Promise((r) => {
|
|
311
|
-
const o = this.on(
|
|
312
|
-
r(s.length == 1 ? s[0] : s),
|
|
311
|
+
const o = this.on(t, (...s) => {
|
|
312
|
+
r(s.length == 1 ? s[0] : s), e && e(...s), o();
|
|
313
313
|
});
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
|
|
318
|
-
class
|
|
319
|
-
constructor(
|
|
320
|
-
super(
|
|
321
|
-
|
|
317
|
+
i(v, "listeners", {});
|
|
318
|
+
class p extends Error {
|
|
319
|
+
constructor(e, r) {
|
|
320
|
+
super(e);
|
|
321
|
+
i(this, "_code");
|
|
322
322
|
r != null && (this._code = r);
|
|
323
323
|
}
|
|
324
324
|
get code() {
|
|
325
325
|
return this._code || this.constructor.code;
|
|
326
326
|
}
|
|
327
|
-
set code(
|
|
328
|
-
this._code =
|
|
327
|
+
set code(e) {
|
|
328
|
+
this._code = e;
|
|
329
329
|
}
|
|
330
|
-
static from(
|
|
331
|
-
const r = Number(
|
|
330
|
+
static from(e) {
|
|
331
|
+
const r = Number(e.statusCode) ?? Number(e.code), o = new this(e.message || e.toString());
|
|
332
332
|
return Object.assign(o, {
|
|
333
|
-
stack:
|
|
334
|
-
...
|
|
333
|
+
stack: e.stack,
|
|
334
|
+
...e,
|
|
335
335
|
code: r ?? void 0
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
static instanceof(
|
|
339
|
-
return
|
|
338
|
+
static instanceof(e) {
|
|
339
|
+
return e.constructor.code != null;
|
|
340
340
|
}
|
|
341
341
|
toString() {
|
|
342
342
|
return this.message || super.toString();
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
|
|
346
|
-
class
|
|
347
|
-
constructor(
|
|
348
|
-
super(
|
|
345
|
+
i(p, "code", 500);
|
|
346
|
+
class F extends p {
|
|
347
|
+
constructor(t = "Bad Request") {
|
|
348
|
+
super(t);
|
|
349
349
|
}
|
|
350
|
-
static instanceof(
|
|
351
|
-
return
|
|
350
|
+
static instanceof(t) {
|
|
351
|
+
return t.constructor.code == this.code;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
|
|
355
|
-
class
|
|
356
|
-
constructor(
|
|
357
|
-
super(
|
|
354
|
+
i(F, "code", 400);
|
|
355
|
+
class H extends p {
|
|
356
|
+
constructor(t = "Unauthorized") {
|
|
357
|
+
super(t);
|
|
358
358
|
}
|
|
359
|
-
static instanceof(
|
|
360
|
-
return
|
|
359
|
+
static instanceof(t) {
|
|
360
|
+
return t.constructor.code == this.code;
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
|
-
|
|
364
|
-
class
|
|
365
|
-
constructor(
|
|
366
|
-
super(
|
|
363
|
+
i(H, "code", 401);
|
|
364
|
+
class Y extends p {
|
|
365
|
+
constructor(t = "Payment Required") {
|
|
366
|
+
super(t);
|
|
367
367
|
}
|
|
368
|
-
static instanceof(
|
|
369
|
-
return
|
|
368
|
+
static instanceof(t) {
|
|
369
|
+
return t.constructor.code == this.code;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
|
|
373
|
-
class
|
|
374
|
-
constructor(
|
|
375
|
-
super(
|
|
372
|
+
i(Y, "code", 402);
|
|
373
|
+
class W extends p {
|
|
374
|
+
constructor(t = "Forbidden") {
|
|
375
|
+
super(t);
|
|
376
376
|
}
|
|
377
|
-
static instanceof(
|
|
378
|
-
return
|
|
377
|
+
static instanceof(t) {
|
|
378
|
+
return t.constructor.code == this.code;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
|
|
382
|
-
class
|
|
383
|
-
constructor(
|
|
384
|
-
super(
|
|
381
|
+
i(W, "code", 403);
|
|
382
|
+
class J extends p {
|
|
383
|
+
constructor(t = "Not Found") {
|
|
384
|
+
super(t);
|
|
385
385
|
}
|
|
386
|
-
static instanceof(
|
|
387
|
-
return
|
|
386
|
+
static instanceof(t) {
|
|
387
|
+
return t.constructor.code == this.code;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
i(J, "code", 404);
|
|
391
|
+
class z extends p {
|
|
392
|
+
constructor(t = "Method Not Allowed") {
|
|
393
|
+
super(t);
|
|
394
|
+
}
|
|
395
|
+
static instanceof(t) {
|
|
396
|
+
return t.constructor.code == this.code;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
i(z, "code", 405);
|
|
400
|
+
class K extends p {
|
|
401
|
+
constructor(t = "Not Acceptable") {
|
|
402
|
+
super(t);
|
|
403
|
+
}
|
|
404
|
+
static instanceof(t) {
|
|
405
|
+
return t.constructor.code == this.code;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
i(K, "code", 406);
|
|
409
|
+
class V extends p {
|
|
410
|
+
constructor(t = "Internal Server Error") {
|
|
411
|
+
super(t);
|
|
412
|
+
}
|
|
413
|
+
static instanceof(t) {
|
|
414
|
+
return t.constructor.code == this.code;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
i(V, "code", 500);
|
|
418
|
+
class Z extends p {
|
|
419
|
+
constructor(t = "Not Implemented") {
|
|
420
|
+
super(t);
|
|
421
|
+
}
|
|
422
|
+
static instanceof(t) {
|
|
423
|
+
return t.constructor.code == this.code;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
i(Z, "code", 501);
|
|
427
|
+
class X extends p {
|
|
428
|
+
constructor(t = "Bad Gateway") {
|
|
429
|
+
super(t);
|
|
430
|
+
}
|
|
431
|
+
static instanceof(t) {
|
|
432
|
+
return t.constructor.code == this.code;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
i(X, "code", 502);
|
|
436
|
+
class Q extends p {
|
|
437
|
+
constructor(t = "Service Unavailable") {
|
|
438
|
+
super(t);
|
|
439
|
+
}
|
|
440
|
+
static instanceof(t) {
|
|
441
|
+
return t.constructor.code == this.code;
|
|
388
442
|
}
|
|
389
443
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
constructor(
|
|
393
|
-
|
|
394
|
-
u(this, "headers", {});
|
|
395
|
-
u(this, "url");
|
|
396
|
-
this.url = e.url ?? null, this.headers = e.headers || {}, e.interceptors && e.interceptors.forEach((t) => g.addInterceptor(t));
|
|
444
|
+
i(Q, "code", 503);
|
|
445
|
+
class _ extends p {
|
|
446
|
+
constructor(t = "Gateway Timeout") {
|
|
447
|
+
super(t);
|
|
397
448
|
}
|
|
398
|
-
static
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
449
|
+
static instanceof(t) {
|
|
450
|
+
return t.constructor.code == this.code;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
i(_, "code", 504);
|
|
454
|
+
function Dt(n, t) {
|
|
455
|
+
if (n >= 200 && n < 300)
|
|
456
|
+
return null;
|
|
457
|
+
switch (n) {
|
|
458
|
+
case 400:
|
|
459
|
+
return new F(t);
|
|
460
|
+
case 401:
|
|
461
|
+
return new H(t);
|
|
462
|
+
case 402:
|
|
463
|
+
return new Y(t);
|
|
464
|
+
case 403:
|
|
465
|
+
return new W(t);
|
|
466
|
+
case 404:
|
|
467
|
+
return new J(t);
|
|
468
|
+
case 405:
|
|
469
|
+
return new z(t);
|
|
470
|
+
case 406:
|
|
471
|
+
return new K(t);
|
|
472
|
+
case 500:
|
|
473
|
+
return new V(t);
|
|
474
|
+
case 501:
|
|
475
|
+
return new Z(t);
|
|
476
|
+
case 502:
|
|
477
|
+
return new X(t);
|
|
478
|
+
case 503:
|
|
479
|
+
return new Q(t);
|
|
480
|
+
case 504:
|
|
481
|
+
return new _(t);
|
|
482
|
+
default:
|
|
483
|
+
return new p(t, n);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
const w = class w {
|
|
487
|
+
constructor(t = {}) {
|
|
488
|
+
i(this, "interceptors", {});
|
|
489
|
+
i(this, "headers", {});
|
|
490
|
+
i(this, "url");
|
|
491
|
+
this.url = t.url ?? null, this.headers = t.headers || {}, t.interceptors && t.interceptors.forEach((e) => w.addInterceptor(e));
|
|
492
|
+
}
|
|
493
|
+
static addInterceptor(t) {
|
|
494
|
+
const e = Object.keys(w.interceptors).length.toString();
|
|
495
|
+
return w.interceptors[e] = t, () => {
|
|
496
|
+
w.interceptors[e] = null;
|
|
402
497
|
};
|
|
403
498
|
}
|
|
404
|
-
addInterceptor(
|
|
405
|
-
const
|
|
406
|
-
return this.interceptors[
|
|
407
|
-
this.interceptors[
|
|
499
|
+
addInterceptor(t) {
|
|
500
|
+
const e = Object.keys(this.interceptors).length.toString();
|
|
501
|
+
return this.interceptors[e] = t, () => {
|
|
502
|
+
this.interceptors[e] = null;
|
|
408
503
|
};
|
|
409
504
|
}
|
|
410
|
-
request(
|
|
505
|
+
request(t = {}) {
|
|
411
506
|
var o;
|
|
412
|
-
if (!this.url && !
|
|
507
|
+
if (!this.url && !t.url)
|
|
413
508
|
throw new Error("URL needs to be set");
|
|
414
|
-
let
|
|
415
|
-
if (
|
|
416
|
-
const s = Array.isArray(
|
|
417
|
-
|
|
509
|
+
let e = ((o = t.url) != null && o.startsWith("http") ? t.url : (this.url || "") + (t.url || "")).replace(/([^:]\/)\/+/g, "$1");
|
|
510
|
+
if (t.fragment && (e.includes("#") ? e.replace(/#.*(\?|\n)/g, (s, c) => `#${t.fragment}${c}`) : e += "#" + t.fragment), t.query) {
|
|
511
|
+
const s = Array.isArray(t.query) ? t.query : Object.keys(t.query).map((c) => ({ key: c, value: t.query[c] }));
|
|
512
|
+
e += (e.includes("?") ? "&" : "?") + s.map((c) => `${c.key}=${c.value}`).join("&");
|
|
418
513
|
}
|
|
419
|
-
const r =
|
|
420
|
-
"Content-Type":
|
|
421
|
-
...
|
|
514
|
+
const r = rt({
|
|
515
|
+
"Content-Type": t.body ? t.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
516
|
+
...w.headers,
|
|
422
517
|
...this.headers,
|
|
423
|
-
...
|
|
518
|
+
...t.headers
|
|
424
519
|
});
|
|
425
|
-
return typeof
|
|
426
|
-
fetch(
|
|
520
|
+
return typeof t.body == "object" && t.body != null && r["Content-Type"] == "application/json" && (t.body = JSON.stringify(t.body)), new m((s, c, y) => {
|
|
521
|
+
fetch(e, {
|
|
427
522
|
headers: r,
|
|
428
|
-
method:
|
|
429
|
-
body:
|
|
430
|
-
}).then(async (
|
|
523
|
+
method: t.method || (t.body ? "POST" : "GET"),
|
|
524
|
+
body: t.body
|
|
525
|
+
}).then(async (u) => {
|
|
431
526
|
var j, G;
|
|
432
|
-
for (let a of [...Object.values(
|
|
433
|
-
await new Promise((O) => a(
|
|
434
|
-
const R =
|
|
527
|
+
for (let a of [...Object.values(w.interceptors), ...Object.values(this.interceptors)])
|
|
528
|
+
await new Promise((O) => a(u, () => O()));
|
|
529
|
+
const R = u.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
|
|
435
530
|
let k = 0;
|
|
436
|
-
const T = (j =
|
|
531
|
+
const T = (j = u.body) == null ? void 0 : j.getReader(), tt = new ReadableStream({
|
|
437
532
|
start(a) {
|
|
438
533
|
function O() {
|
|
439
534
|
T == null || T.read().then((x) => {
|
|
@@ -445,17 +540,17 @@ const g = class g {
|
|
|
445
540
|
O();
|
|
446
541
|
}
|
|
447
542
|
});
|
|
448
|
-
if (
|
|
449
|
-
const a = (G =
|
|
450
|
-
a != null && a.includes("form") ?
|
|
543
|
+
if (u.data = new Response(tt), t.decode == null || t.decode) {
|
|
544
|
+
const a = (G = u.headers.get("Content-Type")) == null ? void 0 : G.toLowerCase();
|
|
545
|
+
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());
|
|
451
546
|
}
|
|
452
|
-
|
|
547
|
+
u.ok ? s(u) : c(u);
|
|
453
548
|
});
|
|
454
549
|
});
|
|
455
550
|
}
|
|
456
551
|
};
|
|
457
|
-
|
|
458
|
-
let M =
|
|
552
|
+
i(w, "interceptors", {}), i(w, "headers", {});
|
|
553
|
+
let M = w;
|
|
459
554
|
const A = {
|
|
460
555
|
CLEAR: "\x1B[0m",
|
|
461
556
|
BRIGHT: "\x1B[1m",
|
|
@@ -481,7 +576,7 @@ const A = {
|
|
|
481
576
|
LIGHT_MAGENTA: "\x1B[95m",
|
|
482
577
|
LIGHT_CYAN: "\x1B[96m",
|
|
483
578
|
WHITE: "\x1B[97m"
|
|
484
|
-
},
|
|
579
|
+
}, kt = {
|
|
485
580
|
BLACK: "\x1B[40m",
|
|
486
581
|
RED: "\x1B[41m",
|
|
487
582
|
GREEN: "\x1B[42m",
|
|
@@ -492,190 +587,190 @@ const A = {
|
|
|
492
587
|
WHITE: "\x1B[47m",
|
|
493
588
|
GREY: "\x1B[100m"
|
|
494
589
|
};
|
|
495
|
-
var
|
|
496
|
-
const
|
|
497
|
-
constructor(
|
|
498
|
-
super(), this.namespace =
|
|
590
|
+
var at = /* @__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))(at || {});
|
|
591
|
+
const g = class g extends v {
|
|
592
|
+
constructor(t) {
|
|
593
|
+
super(), this.namespace = t;
|
|
499
594
|
}
|
|
500
|
-
pad(
|
|
501
|
-
const s =
|
|
502
|
-
if (
|
|
595
|
+
pad(t, e, r, o = !1) {
|
|
596
|
+
const s = t.toString(), c = e - s.length;
|
|
597
|
+
if (c <= 0)
|
|
503
598
|
return s;
|
|
504
|
-
const y = Array(~~(
|
|
599
|
+
const y = Array(~~(c / r.length)).fill(r).join("");
|
|
505
600
|
return o ? s + y : y + s;
|
|
506
601
|
}
|
|
507
|
-
format(...
|
|
508
|
-
const
|
|
509
|
-
return `${`${
|
|
602
|
+
format(...t) {
|
|
603
|
+
const e = /* @__PURE__ */ new Date();
|
|
604
|
+
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(" ")}`;
|
|
510
605
|
}
|
|
511
|
-
debug(...
|
|
512
|
-
if (
|
|
606
|
+
debug(...t) {
|
|
607
|
+
if (g.LOG_LEVEL < 4)
|
|
513
608
|
return;
|
|
514
|
-
const
|
|
515
|
-
|
|
609
|
+
const e = this.format(...t);
|
|
610
|
+
g.emit(4, e), console.debug(L.LIGHT_GREY + e + A.CLEAR);
|
|
516
611
|
}
|
|
517
|
-
log(...
|
|
518
|
-
if (
|
|
612
|
+
log(...t) {
|
|
613
|
+
if (g.LOG_LEVEL < 3)
|
|
519
614
|
return;
|
|
520
|
-
const
|
|
521
|
-
|
|
615
|
+
const e = this.format(...t);
|
|
616
|
+
g.emit(3, e), console.log(A.CLEAR + e);
|
|
522
617
|
}
|
|
523
|
-
info(...
|
|
524
|
-
if (
|
|
618
|
+
info(...t) {
|
|
619
|
+
if (g.LOG_LEVEL < 2)
|
|
525
620
|
return;
|
|
526
|
-
const
|
|
527
|
-
|
|
621
|
+
const e = this.format(...t);
|
|
622
|
+
g.emit(2, e), console.info(L.BLUE + e + A.CLEAR);
|
|
528
623
|
}
|
|
529
|
-
warn(...
|
|
530
|
-
if (
|
|
624
|
+
warn(...t) {
|
|
625
|
+
if (g.LOG_LEVEL < 1)
|
|
531
626
|
return;
|
|
532
|
-
const
|
|
533
|
-
|
|
627
|
+
const e = this.format(...t);
|
|
628
|
+
g.emit(1, e), console.warn(L.YELLOW + e + A.CLEAR);
|
|
534
629
|
}
|
|
535
|
-
error(...
|
|
536
|
-
if (
|
|
630
|
+
error(...t) {
|
|
631
|
+
if (g.LOG_LEVEL < 0)
|
|
537
632
|
return;
|
|
538
|
-
const
|
|
539
|
-
|
|
633
|
+
const e = this.format(...t);
|
|
634
|
+
g.emit(0, e), console.error(L.RED + e + A.CLEAR);
|
|
540
635
|
}
|
|
541
636
|
};
|
|
542
|
-
|
|
543
|
-
let P =
|
|
544
|
-
function
|
|
545
|
-
const
|
|
546
|
-
let r = Math.pow(10,
|
|
547
|
-
const s =
|
|
637
|
+
i(g, "LOG_LEVEL", 4);
|
|
638
|
+
let P = g;
|
|
639
|
+
function jt(n) {
|
|
640
|
+
const t = (y, u) => u < 1e-7 ? y : t(u, ~~(y % u)), e = n.toString().length - 2;
|
|
641
|
+
let r = Math.pow(10, e), o = n * r;
|
|
642
|
+
const s = t(o, r);
|
|
548
643
|
o = ~~(o / s), r = ~~(r / s);
|
|
549
|
-
const
|
|
550
|
-
return o -=
|
|
644
|
+
const c = ~~(o / r);
|
|
645
|
+
return o -= c * r, `${c ? c + " " : ""}${~~o}/${~~r}`;
|
|
551
646
|
}
|
|
552
|
-
function
|
|
553
|
-
let
|
|
554
|
-
const
|
|
555
|
-
return
|
|
647
|
+
function Gt(n) {
|
|
648
|
+
let t = n.split(" ");
|
|
649
|
+
const e = t.length == 2 ? Number(t[0]) : 0;
|
|
650
|
+
return t = t.pop().split("/"), e + Number(t[0]) / Number(t[1]);
|
|
556
651
|
}
|
|
557
|
-
function
|
|
558
|
-
return n.length - n.replaceAll(
|
|
652
|
+
function Ut(n, t) {
|
|
653
|
+
return n.length - n.replaceAll(t, "").length;
|
|
559
654
|
}
|
|
560
|
-
function
|
|
655
|
+
function qt(n) {
|
|
561
656
|
return Array(n).fill(null).map(() => Math.round(Math.random() * 15).toString(16)).join("");
|
|
562
657
|
}
|
|
563
|
-
const I = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", $ = "0123456789", D = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/",
|
|
564
|
-
function
|
|
565
|
-
const
|
|
566
|
-
if (!
|
|
658
|
+
const I = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", $ = "0123456789", D = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", lt = I + $ + D;
|
|
659
|
+
function Mt(n) {
|
|
660
|
+
const t = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(n);
|
|
661
|
+
if (!t)
|
|
567
662
|
throw new Error(`Number cannot be parsed: ${n}`);
|
|
568
|
-
return `${
|
|
663
|
+
return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
|
|
569
664
|
}
|
|
570
|
-
function
|
|
571
|
-
return `${n.slice(0,
|
|
665
|
+
function Pt(n, t, e) {
|
|
666
|
+
return `${n.slice(0, e)}${t}${n.slice(e + 1)}`;
|
|
572
667
|
}
|
|
573
|
-
function
|
|
574
|
-
const o = n.toString(), s =
|
|
668
|
+
function vt(n, t, e, r = !0) {
|
|
669
|
+
const o = n.toString(), s = t - o.length;
|
|
575
670
|
if (s <= 0)
|
|
576
671
|
return o;
|
|
577
|
-
const
|
|
578
|
-
return r ?
|
|
672
|
+
const c = Array(~~(s / e.length)).fill(e).join("");
|
|
673
|
+
return r ? c + o : o + c;
|
|
579
674
|
}
|
|
580
|
-
function
|
|
675
|
+
function Ft(n, t = lt) {
|
|
581
676
|
return Array(n).fill(null).map(() => {
|
|
582
|
-
const
|
|
583
|
-
return e
|
|
677
|
+
const e = ~~(Math.random() * t.length);
|
|
678
|
+
return t[e];
|
|
584
679
|
}).join("");
|
|
585
680
|
}
|
|
586
|
-
function
|
|
587
|
-
if (!
|
|
681
|
+
function Ht(n, t = !1, e = !1, r = !1) {
|
|
682
|
+
if (!t && !e && !r)
|
|
588
683
|
throw new Error("Must enable at least one: letters, numbers, symbols");
|
|
589
684
|
return Array(n).fill(null).map(() => {
|
|
590
685
|
let o;
|
|
591
686
|
do {
|
|
592
687
|
const s = ~~(Math.random() * 3);
|
|
593
|
-
|
|
688
|
+
t && s == 0 ? o = I[~~(Math.random() * I.length)] : e && s == 1 ? o = $[~~(Math.random() * $.length)] : r && s == 2 && (o = D[~~(Math.random() * D.length)]);
|
|
594
689
|
} while (!o);
|
|
595
690
|
return o;
|
|
596
691
|
}).join("");
|
|
597
692
|
}
|
|
598
|
-
function
|
|
599
|
-
if (typeof
|
|
693
|
+
function Yt(n, t) {
|
|
694
|
+
if (typeof t == "string" && (t = new RegExp(t, "g")), !t.global)
|
|
600
695
|
throw new TypeError("Regular expression must be global.");
|
|
601
|
-
let
|
|
602
|
-
for (; (r =
|
|
603
|
-
|
|
604
|
-
return
|
|
696
|
+
let e = [], r;
|
|
697
|
+
for (; (r = t.exec(n)) !== null; )
|
|
698
|
+
e.push(r);
|
|
699
|
+
return e;
|
|
605
700
|
}
|
|
606
|
-
function
|
|
607
|
-
var
|
|
608
|
-
return
|
|
701
|
+
function ht(n) {
|
|
702
|
+
var t = ft(pt(yt(dt(n), 8 * n.length)));
|
|
703
|
+
return t.toLowerCase();
|
|
609
704
|
}
|
|
610
|
-
function
|
|
611
|
-
for (var
|
|
612
|
-
|
|
705
|
+
function ft(n) {
|
|
706
|
+
for (var t, e = "0123456789ABCDEF", r = "", o = 0; o < n.length; o++)
|
|
707
|
+
t = n.charCodeAt(o), r += e.charAt(t >>> 4 & 15) + e.charAt(15 & t);
|
|
613
708
|
return r;
|
|
614
709
|
}
|
|
615
|
-
function
|
|
616
|
-
for (var
|
|
617
|
-
e
|
|
618
|
-
for (
|
|
619
|
-
e
|
|
620
|
-
return
|
|
710
|
+
function dt(n) {
|
|
711
|
+
for (var t = Array(n.length >> 2), e = 0; e < t.length; e++)
|
|
712
|
+
t[e] = 0;
|
|
713
|
+
for (e = 0; e < 8 * n.length; e += 8)
|
|
714
|
+
t[e >> 5] |= (255 & n.charCodeAt(e / 8)) << e % 32;
|
|
715
|
+
return t;
|
|
621
716
|
}
|
|
622
|
-
function
|
|
623
|
-
for (var
|
|
624
|
-
|
|
625
|
-
return
|
|
717
|
+
function pt(n) {
|
|
718
|
+
for (var t = "", e = 0; e < 32 * n.length; e += 8)
|
|
719
|
+
t += String.fromCharCode(n[e >> 5] >>> e % 32 & 255);
|
|
720
|
+
return t;
|
|
626
721
|
}
|
|
627
|
-
function
|
|
628
|
-
n[
|
|
629
|
-
for (var
|
|
630
|
-
var y =
|
|
631
|
-
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,
|
|
722
|
+
function yt(n, t) {
|
|
723
|
+
n[t >> 5] |= 128 << t % 32, n[14 + (t + 64 >>> 9 << 4)] = t;
|
|
724
|
+
for (var e = 1732584193, r = -271733879, o = -1732584194, s = 271733878, c = 0; c < n.length; c += 16) {
|
|
725
|
+
var y = e, u = r, R = o, N = s;
|
|
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, u), o = E(o, R), s = E(s, N);
|
|
632
727
|
}
|
|
633
|
-
return Array(
|
|
728
|
+
return Array(e, r, o, s);
|
|
634
729
|
}
|
|
635
|
-
function C(n,
|
|
636
|
-
return
|
|
730
|
+
function C(n, t, e, r, o, s) {
|
|
731
|
+
return E(gt(E(E(t, n), E(r, s)), o), e);
|
|
637
732
|
}
|
|
638
|
-
function l(n,
|
|
639
|
-
return C(
|
|
733
|
+
function l(n, t, e, r, o, s, c) {
|
|
734
|
+
return C(t & e | ~t & r, n, t, o, s, c);
|
|
640
735
|
}
|
|
641
|
-
function h(n,
|
|
642
|
-
return C(
|
|
736
|
+
function h(n, t, e, r, o, s, c) {
|
|
737
|
+
return C(t & r | e & ~r, n, t, o, s, c);
|
|
643
738
|
}
|
|
644
|
-
function f(n,
|
|
645
|
-
return C(
|
|
739
|
+
function f(n, t, e, r, o, s, c) {
|
|
740
|
+
return C(t ^ e ^ r, n, t, o, s, c);
|
|
646
741
|
}
|
|
647
|
-
function d(n,
|
|
648
|
-
return C(
|
|
742
|
+
function d(n, t, e, r, o, s, c) {
|
|
743
|
+
return C(e ^ (t | ~r), n, t, o, s, c);
|
|
649
744
|
}
|
|
650
|
-
function
|
|
651
|
-
var
|
|
652
|
-
return (n >> 16) + (
|
|
745
|
+
function E(n, t) {
|
|
746
|
+
var e = (65535 & n) + (65535 & t);
|
|
747
|
+
return (n >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
|
|
653
748
|
}
|
|
654
|
-
function
|
|
655
|
-
return n <<
|
|
749
|
+
function gt(n, t) {
|
|
750
|
+
return n << t | n >>> 32 - t;
|
|
656
751
|
}
|
|
657
|
-
function
|
|
752
|
+
function Wt(n) {
|
|
658
753
|
return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(n);
|
|
659
754
|
}
|
|
660
|
-
function
|
|
661
|
-
return n ? `https://www.gravatar.com/avatar/${
|
|
755
|
+
function Jt(n, t = "mp") {
|
|
756
|
+
return n ? `https://www.gravatar.com/avatar/${ht(n)}?d=${t}` : "";
|
|
662
757
|
}
|
|
663
|
-
function
|
|
664
|
-
const
|
|
758
|
+
function zt(n) {
|
|
759
|
+
const t = new RegExp(
|
|
665
760
|
"(?:(?<protocol>[\\w\\d]+)\\:\\/\\/)?(?:(?<user>.+)\\@)?(?<host>(?<domain>[^:\\/\\?#@\\n]+)(?:\\:(?<port>\\d*))?)(?<path>\\/.*?)?(?:\\?(?<query>.*?))?(?:#(?<fragment>.*?))?$",
|
|
666
761
|
"gm"
|
|
667
|
-
).exec(n),
|
|
668
|
-
if (
|
|
669
|
-
const o =
|
|
670
|
-
o.forEach((
|
|
671
|
-
const [y,
|
|
672
|
-
s[y] =
|
|
673
|
-
}),
|
|
762
|
+
).exec(n), e = (t == null ? void 0 : t.groups) ?? {}, r = e.domain.split(".");
|
|
763
|
+
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
|
+
const o = e.query.split("&"), s = {};
|
|
765
|
+
o.forEach((c) => {
|
|
766
|
+
const [y, u] = c.split("=");
|
|
767
|
+
s[y] = u;
|
|
768
|
+
}), e.query = s;
|
|
674
769
|
}
|
|
675
|
-
return
|
|
770
|
+
return e;
|
|
676
771
|
}
|
|
677
|
-
function
|
|
678
|
-
const
|
|
772
|
+
function Kt(n) {
|
|
773
|
+
const t = n instanceof Date ? n : new Date(n);
|
|
679
774
|
return new Intl.DateTimeFormat("en-us", {
|
|
680
775
|
weekday: "long",
|
|
681
776
|
month: "short",
|
|
@@ -683,75 +778,83 @@ function Pt(n) {
|
|
|
683
778
|
hour: "numeric",
|
|
684
779
|
minute: "numeric",
|
|
685
780
|
hour12: !0
|
|
686
|
-
}).format(
|
|
781
|
+
}).format(t);
|
|
687
782
|
}
|
|
688
|
-
function
|
|
689
|
-
return new Promise((
|
|
783
|
+
function wt(n) {
|
|
784
|
+
return new Promise((t) => setTimeout(t, n));
|
|
690
785
|
}
|
|
691
|
-
async function
|
|
786
|
+
async function Vt(n, t = 100) {
|
|
692
787
|
for (; n(); )
|
|
693
|
-
await
|
|
788
|
+
await wt(t);
|
|
694
789
|
}
|
|
695
|
-
function
|
|
790
|
+
function Zt(n) {
|
|
696
791
|
return (n instanceof Date ? n.getTime() : n) - (/* @__PURE__ */ new Date()).getTime();
|
|
697
792
|
}
|
|
698
793
|
export {
|
|
699
|
-
|
|
700
|
-
X as
|
|
701
|
-
|
|
794
|
+
b as ASet,
|
|
795
|
+
X as BadGatewayError,
|
|
796
|
+
F as BadRequestError,
|
|
797
|
+
kt as CliBackground,
|
|
702
798
|
A as CliEffects,
|
|
703
799
|
L as CliForeground,
|
|
704
|
-
|
|
705
|
-
|
|
800
|
+
p as CustomError,
|
|
801
|
+
W as ForbiddenError,
|
|
802
|
+
_ as GatewayTimeoutError,
|
|
706
803
|
M as Http,
|
|
707
|
-
|
|
804
|
+
V as InternalServerError,
|
|
708
805
|
q as JSONAttemptParse,
|
|
709
|
-
|
|
710
|
-
|
|
806
|
+
bt as JSONSanitized,
|
|
807
|
+
at as LOG_LEVEL,
|
|
711
808
|
P as Logger,
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
809
|
+
z as MethodNotAllowedError,
|
|
810
|
+
K as NotAcceptableError,
|
|
811
|
+
J as NotFoundError,
|
|
812
|
+
Z as NotImplementedError,
|
|
813
|
+
Y as PaymentRequiredError,
|
|
814
|
+
m as PromiseProgress,
|
|
815
|
+
Q as ServiceUnavailableError,
|
|
816
|
+
v as TypedEmitter,
|
|
817
|
+
H as UnauthorizedError,
|
|
818
|
+
Rt as addUnique,
|
|
819
|
+
Ot as arrayDiff,
|
|
820
|
+
Lt as caseInsensitiveSort,
|
|
821
|
+
rt as clean,
|
|
822
|
+
Ut as countChars,
|
|
823
|
+
qt as createHex,
|
|
824
|
+
jt as dec2Frac,
|
|
825
|
+
mt as deepCopy,
|
|
826
|
+
ot as deepMerge,
|
|
725
827
|
S as dotNotation,
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
828
|
+
ut as download,
|
|
829
|
+
Tt as downloadBlob,
|
|
830
|
+
Dt as errorFromCode,
|
|
831
|
+
It as fileBrowser,
|
|
832
|
+
Ct as findByProp,
|
|
833
|
+
ct as flattenArr,
|
|
834
|
+
st as flattenObj,
|
|
835
|
+
xt as formData,
|
|
836
|
+
Kt as formatDate,
|
|
837
|
+
Mt as formatPhoneNumber,
|
|
838
|
+
Gt as fracToDec,
|
|
839
|
+
Jt as gravatar,
|
|
737
840
|
U as includes,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
841
|
+
Pt as insertAt,
|
|
842
|
+
B as isEqual,
|
|
843
|
+
Nt as makeArray,
|
|
844
|
+
it as makeUnique,
|
|
845
|
+
Yt as matchAll,
|
|
846
|
+
ht as md5,
|
|
847
|
+
At as mixin,
|
|
848
|
+
vt as pad,
|
|
849
|
+
Ft as randomString,
|
|
850
|
+
Ht as randomStringBuilder,
|
|
851
|
+
wt as sleep,
|
|
852
|
+
Vt as sleepUntil,
|
|
853
|
+
St as sortByProp,
|
|
854
|
+
Zt as timeUntil,
|
|
855
|
+
$t as uploadWithProgress,
|
|
856
|
+
Bt as urlEncode,
|
|
857
|
+
zt as urlParser,
|
|
858
|
+
Wt as validateEmail
|
|
756
859
|
};
|
|
757
860
|
//# sourceMappingURL=index.mjs.map
|