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