@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/index.mjs CHANGED
@@ -1,65 +1,65 @@
1
- var v = Object.defineProperty;
2
- var F = (n, e, t) => e in n ? v(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var u = (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 ft(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, i) => {
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 == i.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
- function dt(n) {
41
- const e = new FormData();
42
- return Object.entries(n).forEach(([t, r]) => e.append(t, r)), e;
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, 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 yt(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,58 +71,58 @@ function q(n) {
71
71
  return n;
72
72
  }
73
73
  }
74
- function pt(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
- function gt(n) {
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 mt(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 Et(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
- function wt(n) {
100
- return function(e, t) {
101
- const r = S(e, n), o = S(t, n);
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 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 xt(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 At(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
- function Bt(n) {
122
+ function Nt(n) {
123
123
  return Array.isArray(n) ? n : [n];
124
124
  }
125
- class B extends Array {
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(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 E 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
223
223
  ));
224
- u(this, "listeners", []);
225
- u(this, "_progress", 0);
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(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 E ? t : new E((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 = E.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 bt(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
- function Rt(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();
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 Ot(n) {
271
- return new E((e, t, r) => {
270
+ function $t(n) {
271
+ return new m((t, e, r) => {
272
272
  const o = new XMLHttpRequest(), s = new FormData();
273
- n.files.forEach((i) => s.append("file", i)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? r(i.loaded / i.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(([i, y]) => o.setRequestHeader(i, y)), 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
- class H {
276
+ class v {
277
277
  constructor() {
278
- u(this, "listeners", {});
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
- u(H, "listeners", {});
318
- class w extends Error {
319
- constructor(t, r) {
320
- super(t);
321
- u(this, "_code");
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(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
- u(w, "code", 500);
346
- class X extends w {
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
- u(X, "code", 400);
355
- class Q extends w {
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
- u(Q, "code", 401);
364
- class _ extends w {
365
- constructor(e = "Forbidden") {
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
- u(_, "code", 403);
373
- class tt extends w {
374
- constructor(e = "Not Found") {
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
- u(tt, "code", 404);
382
- class et extends w {
383
- constructor(e = "Internal Server Error") {
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
+ }
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
- u(et, "code", 500);
391
- const g = class g {
392
- constructor(e = {}) {
393
- u(this, "interceptors", {});
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 addInterceptor(e) {
399
- const t = Object.keys(g.interceptors).length.toString();
400
- return g.interceptors[t] = e, () => {
401
- g.interceptors[t] = null;
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(e) {
405
- const t = Object.keys(this.interceptors).length.toString();
406
- return this.interceptors[t] = e, () => {
407
- 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;
408
503
  };
409
504
  }
410
- request(e = {}) {
505
+ request(t = {}) {
411
506
  var o;
412
- if (!this.url && !e.url)
507
+ if (!this.url && !t.url)
413
508
  throw new Error("URL needs to be set");
414
- let t = ((o = e.url) != null && o.startsWith("http") ? e.url : (this.url || "") + (e.url || "")).replace(/([^:]\/)\/+/g, "$1");
415
- if (e.fragment && (t.includes("#") ? t.replace(/#.*(\?|\n)/g, (s, i) => `#${e.fragment}${i}`) : t += "#" + e.fragment), e.query) {
416
- const s = Array.isArray(e.query) ? e.query : Object.keys(e.query).map((i) => ({ key: i, value: e.query[i] }));
417
- t += (t.includes("?") ? "&" : "?") + s.map((i) => `${i.key}=${i.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("&");
418
513
  }
419
- const r = W({
420
- "Content-Type": e.body ? e.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
421
- ...g.headers,
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
- ...e.headers
518
+ ...t.headers
424
519
  });
425
- return typeof e.body == "object" && e.body != null && r["Content-Type"] == "application/json" && (e.body = JSON.stringify(e.body)), new E((s, i, y) => {
426
- 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, {
427
522
  headers: r,
428
- method: e.method || (e.body ? "POST" : "GET"),
429
- body: e.body
430
- }).then(async (c) => {
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(g.interceptors), ...Object.values(this.interceptors)])
433
- await new Promise((O) => a(c, () => O()));
434
- const R = c.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;
435
530
  let k = 0;
436
- const T = (j = c.body) == null ? void 0 : j.getReader(), Y = new ReadableStream({
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 (c.data = new Response(Y), e.decode == null || e.decode) {
449
- const a = (G = c.headers.get("Content-Type")) == null ? void 0 : G.toLowerCase();
450
- a != null && a.includes("form") ? c.data = await c.data.formData() : a != null && a.includes("json") ? c.data = await c.data.json() : a != null && a.includes("text") ? c.data = await c.data.text() : a != null && a.includes("application") && (c.data = await c.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());
451
546
  }
452
- c.ok ? s(c) : i(c);
547
+ u.ok ? s(u) : c(u);
453
548
  });
454
549
  });
455
550
  }
456
551
  };
457
- u(g, "interceptors", {}), u(g, "headers", {});
458
- let M = g;
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
- }, Lt = {
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 nt = /* @__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))(nt || {});
496
- const p = class p extends H {
497
- constructor(e) {
498
- 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;
499
594
  }
500
- pad(e, t, r, o = !1) {
501
- const s = e.toString(), i = t - s.length;
502
- if (i <= 0)
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(~~(i / r.length)).fill(r).join("");
599
+ const y = Array(~~(c / r.length)).fill(r).join("");
505
600
  return o ? s + y : y + s;
506
601
  }
507
- format(...e) {
508
- const t = /* @__PURE__ */ new Date();
509
- 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(" ")}`;
510
605
  }
511
- debug(...e) {
512
- if (p.LOG_LEVEL < 4)
606
+ debug(...t) {
607
+ if (g.LOG_LEVEL < 4)
513
608
  return;
514
- const t = this.format(...e);
515
- p.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);
516
611
  }
517
- log(...e) {
518
- if (p.LOG_LEVEL < 3)
612
+ log(...t) {
613
+ if (g.LOG_LEVEL < 3)
519
614
  return;
520
- const t = this.format(...e);
521
- p.emit(3, t), console.log(A.CLEAR + t);
615
+ const e = this.format(...t);
616
+ g.emit(3, e), console.log(A.CLEAR + e);
522
617
  }
523
- info(...e) {
524
- if (p.LOG_LEVEL < 2)
618
+ info(...t) {
619
+ if (g.LOG_LEVEL < 2)
525
620
  return;
526
- const t = this.format(...e);
527
- p.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);
528
623
  }
529
- warn(...e) {
530
- if (p.LOG_LEVEL < 1)
624
+ warn(...t) {
625
+ if (g.LOG_LEVEL < 1)
531
626
  return;
532
- const t = this.format(...e);
533
- p.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);
534
629
  }
535
- error(...e) {
536
- if (p.LOG_LEVEL < 0)
630
+ error(...t) {
631
+ if (g.LOG_LEVEL < 0)
537
632
  return;
538
- const t = this.format(...e);
539
- p.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);
540
635
  }
541
636
  };
542
- u(p, "LOG_LEVEL", 4);
543
- let P = p;
544
- function St(n) {
545
- const e = (y, c) => c < 1e-7 ? y : e(c, ~~(y % c)), t = n.toString().length - 2;
546
- let r = Math.pow(10, t), o = n * r;
547
- 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);
548
643
  o = ~~(o / s), r = ~~(r / s);
549
- const i = ~~(o / r);
550
- return o -= i * r, `${i ? i + " " : ""}${~~o}/${~~r}`;
644
+ const c = ~~(o / r);
645
+ return o -= c * r, `${c ? c + " " : ""}${~~o}/${~~r}`;
551
646
  }
552
- function Ct(n) {
553
- let e = n.split(" ");
554
- const t = e.length == 2 ? Number(e[0]) : 0;
555
- 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]);
556
651
  }
557
- function Nt(n, e) {
558
- return n.length - n.replaceAll(e, "").length;
652
+ function Ut(n, t) {
653
+ return n.length - n.replaceAll(t, "").length;
559
654
  }
560
- function Tt(n) {
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 = "~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/", rt = I + $ + D;
564
- function It(n) {
565
- const e = /(\+?1)?.*?(\d{3}).*?(\d{3}).*?(\d{4})/g.exec(n);
566
- if (!e)
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 `${e[1] ?? ""} (${e[2]}) ${e[3]}-${e[4]}`.trim();
663
+ return `${t[1] ?? ""} (${t[2]}) ${t[3]}-${t[4]}`.trim();
569
664
  }
570
- function $t(n, e, t) {
571
- 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)}`;
572
667
  }
573
- function Dt(n, e, t, r = !0) {
574
- 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;
575
670
  if (s <= 0)
576
671
  return o;
577
- const i = Array(~~(s / t.length)).fill(t).join("");
578
- return r ? i + o : o + i;
672
+ const c = Array(~~(s / e.length)).fill(e).join("");
673
+ return r ? c + o : o + c;
579
674
  }
580
- function kt(n, e = rt) {
675
+ function Ft(n, t = lt) {
581
676
  return Array(n).fill(null).map(() => {
582
- const t = ~~(Math.random() * e.length);
583
- return e[t];
677
+ const e = ~~(Math.random() * t.length);
678
+ return t[e];
584
679
  }).join("");
585
680
  }
586
- function jt(n, e = !1, t = !1, r = !1) {
587
- if (!e && !t && !r)
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
- 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)]);
594
689
  } while (!o);
595
690
  return o;
596
691
  }).join("");
597
692
  }
598
- function Gt(n, e) {
599
- 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)
600
695
  throw new TypeError("Regular expression must be global.");
601
- let t = [], r;
602
- for (; (r = e.exec(n)) !== null; )
603
- t.push(r);
604
- return t;
696
+ let e = [], r;
697
+ for (; (r = t.exec(n)) !== null; )
698
+ e.push(r);
699
+ return e;
605
700
  }
606
- function ot(n) {
607
- var e = st(ct(at(it(n), 8 * n.length)));
608
- return e.toLowerCase();
701
+ function ht(n) {
702
+ var t = ft(pt(yt(dt(n), 8 * n.length)));
703
+ return t.toLowerCase();
609
704
  }
610
- function st(n) {
611
- for (var e, t = "0123456789ABCDEF", r = "", o = 0; o < n.length; o++)
612
- e = n.charCodeAt(o), r += t.charAt(e >>> 4 & 15) + t.charAt(15 & e);
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 it(n) {
616
- for (var e = Array(n.length >> 2), t = 0; t < e.length; t++)
617
- e[t] = 0;
618
- for (t = 0; t < 8 * n.length; t += 8)
619
- e[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32;
620
- return e;
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 ct(n) {
623
- for (var e = "", t = 0; t < 32 * n.length; t += 8)
624
- e += String.fromCharCode(n[t >> 5] >>> t % 32 & 255);
625
- return e;
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 at(n, e) {
628
- n[e >> 5] |= 128 << e % 32, n[14 + (e + 64 >>> 9 << 4)] = e;
629
- for (var t = 1732584193, r = -271733879, o = -1732584194, s = 271733878, i = 0; i < n.length; i += 16) {
630
- var y = t, c = r, R = o, N = s;
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, t = l(t, r, o, s, n[i + 0], 7, -680876936), r, o, n[i + 1], 12, -389564586), t, r, n[i + 2], 17, 606105819), s, t, n[i + 3], 22, -1044525330), o = l(o, s = l(s, t = l(t, r, o, s, n[i + 4], 7, -176418897), r, o, n[i + 5], 12, 1200080426), t, r, n[i + 6], 17, -1473231341), s, t, n[i + 7], 22, -45705983), o = l(o, s = l(s, t = l(t, r, o, s, n[i + 8], 7, 1770035416), r, o, n[i + 9], 12, -1958414417), t, r, n[i + 10], 17, -42063), s, t, n[i + 11], 22, -1990404162), o = l(o, s = l(s, t = l(t, r, o, s, n[i + 12], 7, 1804603682), r, o, n[i + 13], 12, -40341101), t, r, n[i + 14], 17, -1502002290), s, t, n[i + 15], 22, 1236535329), o = h(o, s = h(s, t = h(t, r, o, s, n[i + 1], 5, -165796510), r, o, n[i + 6], 9, -1069501632), t, r, n[i + 11], 14, 643717713), s, t, n[i + 0], 20, -373897302), o = h(o, s = h(s, t = h(t, r, o, s, n[i + 5], 5, -701558691), r, o, n[i + 10], 9, 38016083), t, r, n[i + 15], 14, -660478335), s, t, n[i + 4], 20, -405537848), o = h(o, s = h(s, t = h(t, r, o, s, n[i + 9], 5, 568446438), r, o, n[i + 14], 9, -1019803690), t, r, n[i + 3], 14, -187363961), s, t, n[i + 8], 20, 1163531501), o = h(o, s = h(s, t = h(t, r, o, s, n[i + 13], 5, -1444681467), r, o, n[i + 2], 9, -51403784), t, r, n[i + 7], 14, 1735328473), s, t, n[i + 12], 20, -1926607734), o = f(o, s = f(s, t = f(t, r, o, s, n[i + 5], 4, -378558), r, o, n[i + 8], 11, -2022574463), t, r, n[i + 11], 16, 1839030562), s, t, n[i + 14], 23, -35309556), o = f(o, s = f(s, t = f(t, r, o, s, n[i + 1], 4, -1530992060), r, o, n[i + 4], 11, 1272893353), t, r, n[i + 7], 16, -155497632), s, t, n[i + 10], 23, -1094730640), o = f(o, s = f(s, t = f(t, r, o, s, n[i + 13], 4, 681279174), r, o, n[i + 0], 11, -358537222), t, r, n[i + 3], 16, -722521979), s, t, n[i + 6], 23, 76029189), o = f(o, s = f(s, t = f(t, r, o, s, n[i + 9], 4, -640364487), r, o, n[i + 12], 11, -421815835), t, r, n[i + 15], 16, 530742520), s, t, n[i + 2], 23, -995338651), o = d(o, s = d(s, t = d(t, r, o, s, n[i + 0], 6, -198630844), r, o, n[i + 7], 10, 1126891415), t, r, n[i + 14], 15, -1416354905), s, t, n[i + 5], 21, -57434055), o = d(o, s = d(s, t = d(t, r, o, s, n[i + 12], 6, 1700485571), r, o, n[i + 3], 10, -1894986606), t, r, n[i + 10], 15, -1051523), s, t, n[i + 1], 21, -2054922799), o = d(o, s = d(s, t = d(t, r, o, s, n[i + 8], 6, 1873313359), r, o, n[i + 15], 10, -30611744), t, r, n[i + 6], 15, -1560198380), s, t, n[i + 13], 21, 1309151649), o = d(o, s = d(s, t = d(t, r, o, s, n[i + 4], 6, -145523070), r, o, n[i + 11], 10, -1120210379), t, r, n[i + 2], 15, 718787259), s, t, n[i + 9], 21, -343485551), t = m(t, y), r = m(r, c), o = m(o, R), s = m(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);
632
727
  }
633
- return Array(t, r, o, s);
728
+ return Array(e, r, o, s);
634
729
  }
635
- function C(n, e, t, r, o, s) {
636
- return m(ut(m(m(e, n), m(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);
637
732
  }
638
- function l(n, e, t, r, o, s, i) {
639
- return C(e & t | ~e & r, n, e, o, s, i);
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, e, t, r, o, s, i) {
642
- return C(e & r | t & ~r, n, e, o, s, i);
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, e, t, r, o, s, i) {
645
- return C(e ^ t ^ r, n, e, o, s, i);
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, e, t, r, o, s, i) {
648
- return C(t ^ (e | ~r), n, e, o, s, i);
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 m(n, e) {
651
- var t = (65535 & n) + (65535 & e);
652
- 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;
653
748
  }
654
- function ut(n, e) {
655
- return n << e | n >>> 32 - e;
749
+ function gt(n, t) {
750
+ return n << t | n >>> 32 - t;
656
751
  }
657
- function Ut(n) {
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 qt(n, e = "mp") {
661
- return n ? `https://www.gravatar.com/avatar/${ot(n)}?d=${e}` : "";
755
+ function Jt(n, t = "mp") {
756
+ return n ? `https://www.gravatar.com/avatar/${ht(n)}?d=${t}` : "";
662
757
  }
663
- function Mt(n) {
664
- const e = new RegExp(
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), t = (e == null ? void 0 : e.groups) ?? {}, r = t.domain.split(".");
668
- 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) {
669
- const o = t.query.split("&"), s = {};
670
- o.forEach((i) => {
671
- const [y, c] = i.split("=");
672
- s[y] = c;
673
- }), t.query = 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 = {};
765
+ o.forEach((c) => {
766
+ const [y, u] = c.split("=");
767
+ s[y] = u;
768
+ }), e.query = s;
674
769
  }
675
- return t;
770
+ return e;
676
771
  }
677
- function Pt(n) {
678
- const e = n instanceof Date ? n : new Date(n);
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(e);
781
+ }).format(t);
687
782
  }
688
- function lt(n) {
689
- return new Promise((e) => setTimeout(e, n));
783
+ function wt(n) {
784
+ return new Promise((t) => setTimeout(t, n));
690
785
  }
691
- async function Ht(n, e = 100) {
786
+ async function Vt(n, t = 100) {
692
787
  for (; n(); )
693
- await lt(e);
788
+ await wt(t);
694
789
  }
695
- function Yt(n) {
790
+ function Zt(n) {
696
791
  return (n instanceof Date ? n.getTime() : n) - (/* @__PURE__ */ new Date()).getTime();
697
792
  }
698
793
  export {
699
- B as ASet,
700
- X as BadRequestError,
701
- Lt as CliBackground,
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
- w as CustomError,
705
- _ as ForbiddenError,
800
+ p as CustomError,
801
+ W as ForbiddenError,
802
+ _ as GatewayTimeoutError,
706
803
  M as Http,
707
- et as InternalServerError,
804
+ V as InternalServerError,
708
805
  q as JSONAttemptParse,
709
- pt as JSONSanitized,
710
- nt as LOG_LEVEL,
806
+ bt as JSONSanitized,
807
+ at as LOG_LEVEL,
711
808
  P as Logger,
712
- tt as NotFoundError,
713
- E as PromiseProgress,
714
- H as TypedEmitter,
715
- Q as UnauthorizedError,
716
- mt as addUnique,
717
- Et as arrayDiff,
718
- wt as caseInsensitiveSort,
719
- W as clean,
720
- Nt as countChars,
721
- Tt as createHex,
722
- St as dec2Frac,
723
- ft as deepCopy,
724
- J as deepMerge,
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
- Z as download,
727
- bt as downloadBlob,
728
- Rt as fileBrowser,
729
- At as findByProp,
730
- K as flattenArr,
731
- z as flattenObj,
732
- dt as formData,
733
- Pt as formatDate,
734
- It as formatPhoneNumber,
735
- Ct as fracToDec,
736
- qt as gravatar,
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
- $t as insertAt,
739
- b as isEqual,
740
- Bt as makeArray,
741
- V as makeUnique,
742
- Gt as matchAll,
743
- ot as md5,
744
- yt as mixin,
745
- Dt as pad,
746
- kt as randomString,
747
- jt as randomStringBuilder,
748
- lt as sleep,
749
- Ht as sleepUntil,
750
- xt as sortByProp,
751
- Yt as timeUntil,
752
- Ot as uploadWithProgress,
753
- gt as urlEncode,
754
- Mt as urlParser,
755
- Ut as validateEmail
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