@oardi/ts-utils 0.0.57 → 0.0.59

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/index.mjs CHANGED
@@ -48,8 +48,8 @@ class H {
48
48
  }
49
49
  static isSafari(t = ft) {
50
50
  if (!this.isBrowserEnv()) return !1;
51
- const n = navigator.vendor && navigator.vendor.includes("Apple"), s = t.includes("safari"), y = !(t.includes("crios") || t.includes("chrome") || t.includes("android") || t.includes("opr/") || t.includes("edg"));
52
- return n && s && y;
51
+ const n = navigator.vendor && navigator.vendor.includes("Apple"), s = t.includes("safari"), m = !(t.includes("crios") || t.includes("chrome") || t.includes("android") || t.includes("opr/") || t.includes("edg"));
52
+ return n && s && m;
53
53
  }
54
54
  static isIOS(t = ft) {
55
55
  if (!this.isBrowserEnv()) return !1;
@@ -67,8 +67,8 @@ class H {
67
67
  }
68
68
  static isChrome(t = ft) {
69
69
  if (!this.isBrowserEnv()) return !1;
70
- const n = navigator.vendor && navigator.vendor.includes("Google"), s = t.includes("chrome") || t.includes("crios"), y = !this.isEdg(t) && !this.isOpera(t);
71
- return n && s && y;
70
+ const n = navigator.vendor && navigator.vendor.includes("Google"), s = t.includes("chrome") || t.includes("crios"), m = !this.isEdg(t) && !this.isOpera(t);
71
+ return n && s && m;
72
72
  }
73
73
  static isElectron(t = ft) {
74
74
  return typeof process < "u" && process.versions?.electron ? !0 : t.includes("electron");
@@ -101,14 +101,14 @@ class H {
101
101
  }
102
102
  }
103
103
  class ue {
104
- static toBlob(t, n, s = !1, y) {
105
- return new Promise((b, U) => {
104
+ static toBlob(t, n, s = !1, m) {
105
+ return new Promise((_, U) => {
106
106
  t.toBlob(
107
107
  (I) => {
108
- I ? b(I) : U(new Error("canvas.toBlob returned null"));
108
+ I ? _(I) : U(new Error("canvas.toBlob returned null"));
109
109
  },
110
110
  n,
111
- s ? y : void 0
111
+ s ? m : void 0
112
112
  );
113
113
  });
114
114
  }
@@ -126,7 +126,7 @@ function Yt() {
126
126
  ((n, s) => {
127
127
  a.exports = s();
128
128
  })(jt, function n() {
129
- var s = typeof self < "u" ? self : typeof window < "u" ? window : s !== void 0 ? s : {}, y, b = !s.document && !!s.postMessage, U = s.IS_PAPA_WORKER || !1, I = {}, K = 0, h = {};
129
+ var s = typeof self < "u" ? self : typeof window < "u" ? window : s !== void 0 ? s : {}, m, _ = !s.document && !!s.postMessage, U = s.IS_PAPA_WORKER || !1, I = {}, K = 0, h = {};
130
130
  function A(e) {
131
131
  this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(r) {
132
132
  var i = ct(r);
@@ -135,17 +135,17 @@ function Yt() {
135
135
  var u = parseInt(this._config.skipFirstNLines) || 0;
136
136
  if (this.isFirstChunk && 0 < u) {
137
137
  let E = this._config.newline;
138
- E || (g = this._config.quoteChar || '"', E = this._handle.guessLineEndings(r, g)), r = [...r.split(E).slice(u)].join(E);
138
+ E || (y = this._config.quoteChar || '"', E = this._handle.guessLineEndings(r, y)), r = [...r.split(E).slice(u)].join(E);
139
139
  }
140
- this.isFirstChunk && R(this._config.beforeFirstChunk) && (g = this._config.beforeFirstChunk(r)) !== void 0 && (r = g), this.isFirstChunk = !1, this._halted = !1;
141
- var u = this._partialLine + r, g = (this._partialLine = "", this._handle.parse(u, this._baseIndex, !this._finished));
140
+ this.isFirstChunk && R(this._config.beforeFirstChunk) && (y = this._config.beforeFirstChunk(r)) !== void 0 && (r = y), this.isFirstChunk = !1, this._halted = !1;
141
+ var u = this._partialLine + r, y = (this._partialLine = "", this._handle.parse(u, this._baseIndex, !this._finished));
142
142
  if (!this._handle.paused() && !this._handle.aborted()) {
143
- if (r = g.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), g && g.data && (this._rowCount += g.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), U) s.postMessage({ results: g, workerId: h.WORKER_ID, finished: u });
143
+ if (r = y.meta.cursor, u = (this._finished || (this._partialLine = u.substring(r - this._baseIndex), this._baseIndex = r), y && y.data && (this._rowCount += y.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), U) s.postMessage({ results: y, workerId: h.WORKER_ID, finished: u });
144
144
  else if (R(this._config.chunk) && !i) {
145
- if (this._config.chunk(g, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
146
- this._completeResults = g = void 0;
145
+ if (this._config.chunk(y, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
146
+ this._completeResults = y = void 0;
147
147
  }
148
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(g.data), this._completeResults.errors = this._completeResults.errors.concat(g.errors), this._completeResults.meta = g.meta), this._completed || !u || !R(this._config.complete) || g && g.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), u || g && g.meta.paused || this._nextChunk(), g;
148
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(y.data), this._completeResults.errors = this._completeResults.errors.concat(y.errors), this._completeResults.meta = y.meta), this._completed || !u || !R(this._config.complete) || y && y.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), u || y && y.meta.paused || this._nextChunk(), y;
149
149
  }
150
150
  this._halted = !0;
151
151
  }, this._sendError = function(r) {
@@ -154,7 +154,7 @@ function Yt() {
154
154
  }
155
155
  function j(e) {
156
156
  var r;
157
- (e = e || {}).chunkSize || (e.chunkSize = h.RemoteChunkSize), A.call(this, e), this._nextChunk = b ? function() {
157
+ (e = e || {}).chunkSize || (e.chunkSize = h.RemoteChunkSize), A.call(this, e), this._nextChunk = _ ? function() {
158
158
  this._readChunk(), this._chunkLoaded();
159
159
  } : function() {
160
160
  this._readChunk();
@@ -163,18 +163,18 @@ function Yt() {
163
163
  }, this._readChunk = function() {
164
164
  if (this._finished) this._chunkLoaded();
165
165
  else {
166
- if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials), b || (r.onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)), r.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !b), this._config.downloadRequestHeaders) {
166
+ if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials), _ || (r.onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)), r.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !_), this._config.downloadRequestHeaders) {
167
167
  var i, u = this._config.downloadRequestHeaders;
168
168
  for (i in u) r.setRequestHeader(i, u[i]);
169
169
  }
170
- var g;
171
- this._config.chunkSize && (g = this._start + this._config.chunkSize - 1, r.setRequestHeader("Range", "bytes=" + this._start + "-" + g));
170
+ var y;
171
+ this._config.chunkSize && (y = this._start + this._config.chunkSize - 1, r.setRequestHeader("Range", "bytes=" + this._start + "-" + y));
172
172
  try {
173
173
  r.send(this._config.downloadRequestBody);
174
174
  } catch (E) {
175
175
  this._chunkError(E.message);
176
176
  }
177
- b && r.status === 0 && this._chunkError();
177
+ _ && r.status === 0 && this._chunkError();
178
178
  }
179
179
  }, this._chunkLoaded = function() {
180
180
  r.readyState === 4 && (r.status < 200 || 400 <= r.status ? this._chunkError() : (this._start += this._config.chunkSize || r.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((i) => (i = i.getResponseHeader("Content-Range")) !== null ? parseInt(i.substring(i.lastIndexOf("/") + 1)) : -1)(r), this.parseChunk(r.responseText)));
@@ -185,15 +185,15 @@ function Yt() {
185
185
  function Q(e) {
186
186
  (e = e || {}).chunkSize || (e.chunkSize = h.LocalChunkSize), A.call(this, e);
187
187
  var r, i, u = typeof FileReader < "u";
188
- this.stream = function(g) {
189
- this._input = g, i = g.slice || g.webkitSlice || g.mozSlice, u ? ((r = new FileReader()).onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)) : r = new FileReaderSync(), this._nextChunk();
188
+ this.stream = function(y) {
189
+ this._input = y, i = y.slice || y.webkitSlice || y.mozSlice, u ? ((r = new FileReader()).onload = V(this._chunkLoaded, this), r.onerror = V(this._chunkError, this)) : r = new FileReaderSync(), this._nextChunk();
190
190
  }, this._nextChunk = function() {
191
191
  this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
192
192
  }, this._readChunk = function() {
193
- var g = this._input, E = (this._config.chunkSize && (E = Math.min(this._start + this._config.chunkSize, this._input.size), g = i.call(g, this._start, E)), r.readAsText(g, this._config.encoding));
193
+ var y = this._input, E = (this._config.chunkSize && (E = Math.min(this._start + this._config.chunkSize, this._input.size), y = i.call(y, this._start, E)), r.readAsText(y, this._config.encoding));
194
194
  u || this._chunkLoaded({ target: { result: E } });
195
- }, this._chunkLoaded = function(g) {
196
- this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(g.target.result);
195
+ }, this._chunkLoaded = function(y) {
196
+ this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(y.target.result);
197
197
  }, this._chunkError = function() {
198
198
  this._sendError(r.error);
199
199
  };
@@ -214,20 +214,20 @@ function Yt() {
214
214
  A.prototype.pause.apply(this, arguments), this._input.pause();
215
215
  }, this.resume = function() {
216
216
  A.prototype.resume.apply(this, arguments), this._input.resume();
217
- }, this.stream = function(g) {
218
- this._input = g, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
217
+ }, this.stream = function(y) {
218
+ this._input = y, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
219
219
  }, this._checkIsFinished = function() {
220
220
  u && r.length === 1 && (this._finished = !0);
221
221
  }, this._nextChunk = function() {
222
222
  this._checkIsFinished(), r.length ? this.parseChunk(r.shift()) : i = !0;
223
- }, this._streamData = V(function(g) {
223
+ }, this._streamData = V(function(y) {
224
224
  try {
225
- r.push(typeof g == "string" ? g : g.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(r.shift()));
225
+ r.push(typeof y == "string" ? y : y.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(r.shift()));
226
226
  } catch (E) {
227
227
  this._streamError(E);
228
228
  }
229
- }, this), this._streamError = V(function(g) {
230
- this._streamCleanUp(), this._sendError(g);
229
+ }, this), this._streamError = V(function(y) {
230
+ this._streamCleanUp(), this._sendError(y);
231
231
  }, this), this._streamEnd = V(function() {
232
232
  this._streamCleanUp(), u = !0, this._streamData("");
233
233
  }, this), this._streamCleanUp = V(function() {
@@ -235,25 +235,25 @@ function Yt() {
235
235
  }, this);
236
236
  }
237
237
  function nt(e) {
238
- var r, i, u, g, E = Math.pow(2, 53), v = -E, d = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, f = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, o = this, c = 0, l = 0, w = !1, m = !1, k = [], p = { data: [], errors: [], meta: {} };
238
+ var r, i, u, y, E = Math.pow(2, 53), v = -E, d = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, f = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, o = this, c = 0, l = 0, w = !1, g = !1, k = [], p = { data: [], errors: [], meta: {} };
239
239
  function M(S) {
240
240
  return e.skipEmptyLines === "greedy" ? S.join("").trim() === "" : S.length === 1 && S[0].length === 0;
241
241
  }
242
242
  function C() {
243
- if (p && u && (W("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + h.DefaultDelimiter + "'"), u = !1), e.skipEmptyLines && (p.data = p.data.filter(function(_) {
244
- return !M(_);
243
+ if (p && u && (W("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + h.DefaultDelimiter + "'"), u = !1), e.skipEmptyLines && (p.data = p.data.filter(function(b) {
244
+ return !M(b);
245
245
  })), Y()) {
246
- let _ = function(T, B) {
246
+ let b = function(T, B) {
247
247
  R(e.transformHeader) && (T = e.transformHeader(T, B)), k.push(T);
248
248
  };
249
249
  if (p) if (Array.isArray(p.data[0])) {
250
- for (var S = 0; Y() && S < p.data.length; S++) p.data[S].forEach(_);
250
+ for (var S = 0; Y() && S < p.data.length; S++) p.data[S].forEach(b);
251
251
  p.data.splice(0, 1);
252
- } else p.data.forEach(_);
252
+ } else p.data.forEach(b);
253
253
  }
254
- function D(_, T) {
255
- for (var B = e.header ? {} : [], L = 0; L < _.length; L++) {
256
- var F = L, $ = _[L], $ = ((it, x) => ((N) => (e.dynamicTypingFunction && e.dynamicTyping[N] === void 0 && (e.dynamicTyping[N] = e.dynamicTypingFunction(N)), (e.dynamicTyping[N] || e.dynamicTyping) === !0))(it) ? x === "true" || x === "TRUE" || x !== "false" && x !== "FALSE" && (((N) => {
254
+ function D(b, T) {
255
+ for (var B = e.header ? {} : [], L = 0; L < b.length; L++) {
256
+ var F = L, $ = b[L], $ = ((it, x) => ((N) => (e.dynamicTypingFunction && e.dynamicTyping[N] === void 0 && (e.dynamicTyping[N] = e.dynamicTypingFunction(N)), (e.dynamicTyping[N] || e.dynamicTyping) === !0))(it) ? x === "true" || x === "TRUE" || x !== "false" && x !== "FALSE" && (((N) => {
257
257
  if (d.test(N) && (N = parseFloat(N), v < N && N < E))
258
258
  return 1;
259
259
  })(x) ? parseFloat(x) : f.test(x) ? new Date(x) : x === "" ? null : x) : x)(F = e.header ? L >= k.length ? "__parsed_extra" : k[L] : F, $ = e.transform ? e.transform($, F) : $);
@@ -267,13 +267,13 @@ function Yt() {
267
267
  function Y() {
268
268
  return e.header && k.length === 0;
269
269
  }
270
- function W(S, D, O, _) {
271
- S = { type: S, code: D, message: O }, _ !== void 0 && (S.row = _), p.errors.push(S);
270
+ function W(S, D, O, b) {
271
+ S = { type: S, code: D, message: O }, b !== void 0 && (S.row = b), p.errors.push(S);
272
272
  }
273
- R(e.step) && (g = e.step, e.step = function(S) {
274
- p = S, Y() ? C() : (C(), p.data.length !== 0 && (c += S.data.length, e.preview && c > e.preview ? i.abort() : (p.data = p.data[0], g(p, o))));
273
+ R(e.step) && (y = e.step, e.step = function(S) {
274
+ p = S, Y() ? C() : (C(), p.data.length !== 0 && (c += S.data.length, e.preview && c > e.preview ? i.abort() : (p.data = p.data[0], y(p, o))));
275
275
  }), this.parse = function(S, D, O) {
276
- var _ = e.quoteChar || '"', _ = (e.newline || (e.newline = this.guessLineEndings(S, _)), u = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(S), p.meta.delimiter = e.delimiter) : ((_ = ((T, B, L, F, $) => {
276
+ var b = e.quoteChar || '"', b = (e.newline || (e.newline = this.guessLineEndings(S, b)), u = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(S), p.meta.delimiter = e.delimiter) : ((b = ((T, B, L, F, $) => {
277
277
  var it, x, N, ht;
278
278
  $ = $ || [",", " ", "|", ";", h.RECORD_SEP, h.UNIT_SEP];
279
279
  for (var gt = 0; gt < $.length; gt++) {
@@ -281,8 +281,8 @@ function Yt() {
281
281
  0 < et.data.length && (at /= et.data.length - J), (x === void 0 || Z <= x) && (ht === void 0 || ht < at) && 1.99 < at && (x = Z, it = kt, ht = at);
282
282
  }
283
283
  return { successful: !!(e.delimiter = it), bestDelimiter: it };
284
- })(S, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = _.bestDelimiter : (u = !0, e.delimiter = h.DefaultDelimiter), p.meta.delimiter = e.delimiter), ct(e));
285
- return e.preview && e.header && _.preview++, r = S, i = new mt(_), p = i.parse(r, D, O), C(), w ? { meta: { paused: !0 } } : p || { meta: { paused: !1 } };
284
+ })(S, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = b.bestDelimiter : (u = !0, e.delimiter = h.DefaultDelimiter), p.meta.delimiter = e.delimiter), ct(e));
285
+ return e.preview && e.header && b.preview++, r = S, i = new mt(b), p = i.parse(r, D, O), C(), w ? { meta: { paused: !0 } } : p || { meta: { paused: !1 } };
286
286
  }, this.paused = function() {
287
287
  return w;
288
288
  }, this.pause = function() {
@@ -290,13 +290,13 @@ function Yt() {
290
290
  }, this.resume = function() {
291
291
  o.streamer._halted ? (w = !1, o.streamer.parseChunk(r, !0)) : setTimeout(o.resume, 3);
292
292
  }, this.aborted = function() {
293
- return m;
293
+ return g;
294
294
  }, this.abort = function() {
295
- m = !0, i.abort(), p.meta.aborted = !0, R(e.complete) && e.complete(p), r = "";
296
- }, this.guessLineEndings = function(T, _) {
295
+ g = !0, i.abort(), p.meta.aborted = !0, R(e.complete) && e.complete(p), r = "";
296
+ }, this.guessLineEndings = function(T, b) {
297
297
  T = T.substring(0, 1048576);
298
- var _ = new RegExp(ut(_) + "([^]*?)" + ut(_), "gm"), O = (T = T.replace(_, "")).split("\r"), _ = T.split(`
299
- `), T = 1 < _.length && _[0].length < O[0].length;
298
+ var b = new RegExp(ut(b) + "([^]*?)" + ut(b), "gm"), O = (T = T.replace(b, "")).split("\r"), b = T.split(`
299
+ `), T = 1 < b.length && b[0].length < O[0].length;
300
300
  if (O.length === 1 || T) return `
301
301
  `;
302
302
  for (var B = 0, L = 0; L < O.length; L++) O[L][0] === `
@@ -309,56 +309,56 @@ function Yt() {
309
309
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
310
310
  }
311
311
  function mt(e) {
312
- var r = (e = e || {}).delimiter, i = e.newline, u = e.comments, g = e.step, E = e.preview, v = e.fastMode, d = null, f = !1, o = e.quoteChar == null ? '"' : e.quoteChar, c = o;
312
+ var r = (e = e || {}).delimiter, i = e.newline, u = e.comments, y = e.step, E = e.preview, v = e.fastMode, d = null, f = !1, o = e.quoteChar == null ? '"' : e.quoteChar, c = o;
313
313
  if (e.escapeChar !== void 0 && (c = e.escapeChar), (typeof r != "string" || -1 < h.BAD_DELIMITERS.indexOf(r)) && (r = ","), u === r) throw new Error("Comment character same as delimiter");
314
314
  u === !0 ? u = "#" : (typeof u != "string" || -1 < h.BAD_DELIMITERS.indexOf(u)) && (u = !1), i !== `
315
315
  ` && i !== "\r" && i !== `\r
316
316
  ` && (i = `
317
317
  `);
318
318
  var l = 0, w = !1;
319
- this.parse = function(m, k, p) {
320
- if (typeof m != "string") throw new Error("Input must be a string");
321
- var M = m.length, C = r.length, Y = i.length, W = u.length, S = R(g), D = [], O = [], _ = [], T = l = 0;
322
- if (!m) return Z();
323
- if (v || v !== !1 && m.indexOf(o) === -1) {
324
- for (var B = m.split(i), L = 0; L < B.length; L++) {
325
- if (_ = B[L], l += _.length, L !== B.length - 1) l += i.length;
319
+ this.parse = function(g, k, p) {
320
+ if (typeof g != "string") throw new Error("Input must be a string");
321
+ var M = g.length, C = r.length, Y = i.length, W = u.length, S = R(y), D = [], O = [], b = [], T = l = 0;
322
+ if (!g) return Z();
323
+ if (v || v !== !1 && g.indexOf(o) === -1) {
324
+ for (var B = g.split(i), L = 0; L < B.length; L++) {
325
+ if (b = B[L], l += b.length, L !== B.length - 1) l += i.length;
326
326
  else if (p) return Z();
327
- if (!u || _.substring(0, W) !== u) {
327
+ if (!u || b.substring(0, W) !== u) {
328
328
  if (S) {
329
- if (D = [], ht(_.split(r)), at(), w) return Z();
330
- } else ht(_.split(r));
329
+ if (D = [], ht(b.split(r)), at(), w) return Z();
330
+ } else ht(b.split(r));
331
331
  if (E && E <= L) return D = D.slice(0, E), Z(!0);
332
332
  }
333
333
  }
334
334
  return Z();
335
335
  }
336
- for (var F = m.indexOf(r, l), $ = m.indexOf(i, l), it = new RegExp(ut(c) + ut(o), "g"), x = m.indexOf(o, l); ; ) if (m[l] === o) for (x = l, l++; ; ) {
337
- if ((x = m.indexOf(o, x + 1)) === -1) return p || O.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: D.length, index: l }), st();
338
- if (x === M - 1) return st(m.substring(l, x).replace(it, o));
339
- if (o === c && m[x + 1] === c) x++;
340
- else if (o === c || x === 0 || m[x - 1] !== c) {
341
- F !== -1 && F < x + 1 && (F = m.indexOf(r, x + 1));
342
- var N = gt(($ = $ !== -1 && $ < x + 1 ? m.indexOf(i, x + 1) : $) === -1 ? F : Math.min(F, $));
343
- if (m.substr(x + 1 + N, C) === r) {
344
- _.push(m.substring(l, x).replace(it, o)), m[l = x + 1 + N + C] !== o && (x = m.indexOf(o, l)), F = m.indexOf(r, l), $ = m.indexOf(i, l);
336
+ for (var F = g.indexOf(r, l), $ = g.indexOf(i, l), it = new RegExp(ut(c) + ut(o), "g"), x = g.indexOf(o, l); ; ) if (g[l] === o) for (x = l, l++; ; ) {
337
+ if ((x = g.indexOf(o, x + 1)) === -1) return p || O.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: D.length, index: l }), st();
338
+ if (x === M - 1) return st(g.substring(l, x).replace(it, o));
339
+ if (o === c && g[x + 1] === c) x++;
340
+ else if (o === c || x === 0 || g[x - 1] !== c) {
341
+ F !== -1 && F < x + 1 && (F = g.indexOf(r, x + 1));
342
+ var N = gt(($ = $ !== -1 && $ < x + 1 ? g.indexOf(i, x + 1) : $) === -1 ? F : Math.min(F, $));
343
+ if (g.substr(x + 1 + N, C) === r) {
344
+ b.push(g.substring(l, x).replace(it, o)), g[l = x + 1 + N + C] !== o && (x = g.indexOf(o, l)), F = g.indexOf(r, l), $ = g.indexOf(i, l);
345
345
  break;
346
346
  }
347
- if (N = gt($), m.substring(x + 1 + N, x + 1 + N + Y) === i) {
348
- if (_.push(m.substring(l, x).replace(it, o)), kt(x + 1 + N + Y), F = m.indexOf(r, l), x = m.indexOf(o, l), S && (at(), w)) return Z();
347
+ if (N = gt($), g.substring(x + 1 + N, x + 1 + N + Y) === i) {
348
+ if (b.push(g.substring(l, x).replace(it, o)), kt(x + 1 + N + Y), F = g.indexOf(r, l), x = g.indexOf(o, l), S && (at(), w)) return Z();
349
349
  if (E && D.length >= E) return Z(!0);
350
350
  break;
351
351
  }
352
352
  O.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: D.length, index: l }), x++;
353
353
  }
354
354
  }
355
- else if (u && _.length === 0 && m.substring(l, l + W) === u) {
355
+ else if (u && b.length === 0 && g.substring(l, l + W) === u) {
356
356
  if ($ === -1) return Z();
357
- l = $ + Y, $ = m.indexOf(i, l), F = m.indexOf(r, l);
358
- } else if (F !== -1 && (F < $ || $ === -1)) _.push(m.substring(l, F)), l = F + C, F = m.indexOf(r, l);
357
+ l = $ + Y, $ = g.indexOf(i, l), F = g.indexOf(r, l);
358
+ } else if (F !== -1 && (F < $ || $ === -1)) b.push(g.substring(l, F)), l = F + C, F = g.indexOf(r, l);
359
359
  else {
360
360
  if ($ === -1) break;
361
- if (_.push(m.substring(l, $)), kt($ + Y), S && (at(), w)) return Z();
361
+ if (b.push(g.substring(l, $)), kt($ + Y), S && (at(), w)) return Z();
362
362
  if (E && D.length >= E) return Z(!0);
363
363
  }
364
364
  return st();
@@ -367,13 +367,13 @@ function Yt() {
367
367
  }
368
368
  function gt(J) {
369
369
  var et = 0;
370
- return et = J !== -1 && (J = m.substring(x + 1, J)) && J.trim() === "" ? J.length : et;
370
+ return et = J !== -1 && (J = g.substring(x + 1, J)) && J.trim() === "" ? J.length : et;
371
371
  }
372
372
  function st(J) {
373
- return p || (J === void 0 && (J = m.substring(l)), _.push(J), l = M, ht(_), S && at()), Z();
373
+ return p || (J === void 0 && (J = g.substring(l)), b.push(J), l = M, ht(b), S && at()), Z();
374
374
  }
375
375
  function kt(J) {
376
- l = J, ht(_), _ = [], $ = m.indexOf(i, l);
376
+ l = J, ht(b), b = [], $ = g.indexOf(i, l);
377
377
  }
378
378
  function Z(J) {
379
379
  if (e.header && !k && D.length && !f) {
@@ -393,7 +393,7 @@ function Yt() {
393
393
  return { data: D, errors: O, meta: { delimiter: r, linebreak: i, aborted: w, truncated: !!J, cursor: T + (k || 0), renamedHeaders: d } };
394
394
  }
395
395
  function at() {
396
- g(Z()), D = [], O = [];
396
+ y(Z()), D = [], O = [];
397
397
  }
398
398
  }, this.abort = function() {
399
399
  w = !0;
@@ -405,13 +405,13 @@ function Yt() {
405
405
  var r = e.data, i = I[r.workerId], u = !1;
406
406
  if (r.error) i.userError(r.error, r.file);
407
407
  else if (r.results && r.results.data) {
408
- var g = { abort: function() {
408
+ var y = { abort: function() {
409
409
  u = !0, dt(r.workerId, { data: [], errors: [], meta: { aborted: !0 } });
410
410
  }, pause: bt, resume: bt };
411
411
  if (R(i.userStep)) {
412
- for (var E = 0; E < r.results.data.length && (i.userStep({ data: r.results.data[E], errors: r.results.errors, meta: r.results.meta }, g), !u); E++) ;
412
+ for (var E = 0; E < r.results.data.length && (i.userStep({ data: r.results.data[E], errors: r.results.errors, meta: r.results.meta }, y), !u); E++) ;
413
413
  delete r.results;
414
- } else R(i.userChunk) && (i.userChunk(r.results, g, r.file), delete r.results);
414
+ } else R(i.userChunk) && (i.userChunk(r.results, y, r.file), delete r.results);
415
415
  }
416
416
  r.finished && !u && dt(r.workerId, r.results);
417
417
  }
@@ -442,17 +442,17 @@ function Yt() {
442
442
  (i = (() => {
443
443
  var u;
444
444
  return !!h.WORKERS_SUPPORTED && (u = (() => {
445
- var g = s.URL || s.webkitURL || null, E = n.toString();
446
- return h.BLOB_URL || (h.BLOB_URL = g.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", E, ")();"], { type: "text/javascript" })));
445
+ var y = s.URL || s.webkitURL || null, E = n.toString();
446
+ return h.BLOB_URL || (h.BLOB_URL = y.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", E, ")();"], { type: "text/javascript" })));
447
447
  })(), (u = new s.Worker(u)).onmessage = wt, u.id = K++, I[u.id] = u);
448
448
  })()).userStep = r.step, i.userChunk = r.chunk, i.userComplete = r.complete, i.userError = r.error, r.step = R(r.step), r.chunk = R(r.chunk), r.complete = R(r.complete), r.error = R(r.error), delete r.worker, i.postMessage({ input: e, config: r, workerId: i.id });
449
449
  }, h.unparse = function(e, r) {
450
- var i = !1, u = !0, g = ",", E = `\r
450
+ var i = !1, u = !0, y = ",", E = `\r
451
451
  `, v = '"', d = v + v, f = !1, o = null, c = !1, l = ((() => {
452
452
  if (typeof r == "object") {
453
453
  if (typeof r.delimiter != "string" || h.BAD_DELIMITERS.filter(function(k) {
454
454
  return r.delimiter.indexOf(k) !== -1;
455
- }).length || (g = r.delimiter), typeof r.quotes != "boolean" && typeof r.quotes != "function" && !Array.isArray(r.quotes) || (i = r.quotes), typeof r.skipEmptyLines != "boolean" && typeof r.skipEmptyLines != "string" || (f = r.skipEmptyLines), typeof r.newline == "string" && (E = r.newline), typeof r.quoteChar == "string" && (v = r.quoteChar), typeof r.header == "boolean" && (u = r.header), Array.isArray(r.columns)) {
455
+ }).length || (y = r.delimiter), typeof r.quotes != "boolean" && typeof r.quotes != "function" && !Array.isArray(r.quotes) || (i = r.quotes), typeof r.skipEmptyLines != "boolean" && typeof r.skipEmptyLines != "string" || (f = r.skipEmptyLines), typeof r.newline == "string" && (E = r.newline), typeof r.quoteChar == "string" && (v = r.quoteChar), typeof r.header == "boolean" && (u = r.header), Array.isArray(r.columns)) {
456
456
  if (r.columns.length === 0) throw new Error("Option columns is empty");
457
457
  o = r.columns;
458
458
  }
@@ -467,42 +467,42 @@ function Yt() {
467
467
  function w(k, p, M) {
468
468
  var C = "", Y = (typeof k == "string" && (k = JSON.parse(k)), typeof p == "string" && (p = JSON.parse(p)), Array.isArray(k) && 0 < k.length), W = !Array.isArray(p[0]);
469
469
  if (Y && u) {
470
- for (var S = 0; S < k.length; S++) 0 < S && (C += g), C += m(k[S], S);
470
+ for (var S = 0; S < k.length; S++) 0 < S && (C += y), C += g(k[S], S);
471
471
  0 < p.length && (C += E);
472
472
  }
473
473
  for (var D = 0; D < p.length; D++) {
474
- var O = (Y ? k : p[D]).length, _ = !1, T = Y ? Object.keys(p[D]).length === 0 : p[D].length === 0;
475
- if (M && !Y && (_ = M === "greedy" ? p[D].join("").trim() === "" : p[D].length === 1 && p[D][0].length === 0), M === "greedy" && Y) {
474
+ var O = (Y ? k : p[D]).length, b = !1, T = Y ? Object.keys(p[D]).length === 0 : p[D].length === 0;
475
+ if (M && !Y && (b = M === "greedy" ? p[D].join("").trim() === "" : p[D].length === 1 && p[D][0].length === 0), M === "greedy" && Y) {
476
476
  for (var B = [], L = 0; L < O; L++) {
477
477
  var F = W ? k[L] : L;
478
478
  B.push(p[D][F]);
479
479
  }
480
- _ = B.join("").trim() === "";
480
+ b = B.join("").trim() === "";
481
481
  }
482
- if (!_) {
482
+ if (!b) {
483
483
  for (var $ = 0; $ < O; $++) {
484
- 0 < $ && !T && (C += g);
484
+ 0 < $ && !T && (C += y);
485
485
  var it = Y && W ? k[$] : $;
486
- C += m(p[D][it], $);
486
+ C += g(p[D][it], $);
487
487
  }
488
488
  D < p.length - 1 && (!M || 0 < O && !T) && (C += E);
489
489
  }
490
490
  }
491
491
  return C;
492
492
  }
493
- function m(k, p) {
493
+ function g(k, p) {
494
494
  var M, C;
495
495
  return k == null ? "" : k.constructor === Date ? JSON.stringify(k).slice(1, 25) : (C = !1, c && typeof k == "string" && c.test(k) && (k = "'" + k, C = !0), M = k.toString().replace(l, d), (C = C || i === !0 || typeof i == "function" && i(k, p) || Array.isArray(i) && i[p] || ((Y, W) => {
496
496
  for (var S = 0; S < W.length; S++) if (-1 < Y.indexOf(W[S])) return !0;
497
497
  return !1;
498
- })(M, h.BAD_DELIMITERS) || -1 < M.indexOf(g) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? v + M + v : M);
498
+ })(M, h.BAD_DELIMITERS) || -1 < M.indexOf(y) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? v + M + v : M);
499
499
  }
500
500
  }, h.RECORD_SEP = "", h.UNIT_SEP = "", h.BYTE_ORDER_MARK = "\uFEFF", h.BAD_DELIMITERS = ["\r", `
501
- `, '"', h.BYTE_ORDER_MARK], h.WORKERS_SUPPORTED = !b && !!s.Worker, h.NODE_STREAM_INPUT = 1, h.LocalChunkSize = 10485760, h.RemoteChunkSize = 5242880, h.DefaultDelimiter = ",", h.Parser = mt, h.ParserHandle = nt, h.NetworkStreamer = j, h.FileStreamer = Q, h.StringStreamer = q, h.ReadableStreamStreamer = G, s.jQuery && ((y = s.jQuery).fn.parse = function(e) {
501
+ `, '"', h.BYTE_ORDER_MARK], h.WORKERS_SUPPORTED = !_ && !!s.Worker, h.NODE_STREAM_INPUT = 1, h.LocalChunkSize = 10485760, h.RemoteChunkSize = 5242880, h.DefaultDelimiter = ",", h.Parser = mt, h.ParserHandle = nt, h.NetworkStreamer = j, h.FileStreamer = Q, h.StringStreamer = q, h.ReadableStreamStreamer = G, s.jQuery && ((m = s.jQuery).fn.parse = function(e) {
502
502
  var r = e.config || {}, i = [];
503
503
  return this.each(function(E) {
504
- if (!(y(this).prop("tagName").toUpperCase() === "INPUT" && y(this).attr("type").toLowerCase() === "file" && s.FileReader) || !this.files || this.files.length === 0) return !0;
505
- for (var v = 0; v < this.files.length; v++) i.push({ file: this.files[v], inputElem: this, instanceConfig: y.extend({}, r) });
504
+ if (!(m(this).prop("tagName").toUpperCase() === "INPUT" && m(this).attr("type").toLowerCase() === "file" && s.FileReader) || !this.files || this.files.length === 0) return !0;
505
+ for (var v = 0; v < this.files.length; v++) i.push({ file: this.files[v], inputElem: this, instanceConfig: m.extend({}, r) });
506
506
  }), u(), this;
507
507
  function u() {
508
508
  if (i.length === 0) R(e.complete) && e.complete();
@@ -512,17 +512,17 @@ function Yt() {
512
512
  var c = e.before(o.file, o.inputElem);
513
513
  if (typeof c == "object") {
514
514
  if (c.action === "abort") return E = "AbortError", v = o.file, d = o.inputElem, f = c.reason, void (R(e.error) && e.error({ name: E }, v, d, f));
515
- if (c.action === "skip") return void g();
516
- typeof c.config == "object" && (o.instanceConfig = y.extend(o.instanceConfig, c.config));
517
- } else if (c === "skip") return void g();
515
+ if (c.action === "skip") return void y();
516
+ typeof c.config == "object" && (o.instanceConfig = m.extend(o.instanceConfig, c.config));
517
+ } else if (c === "skip") return void y();
518
518
  }
519
519
  var l = o.instanceConfig.complete;
520
520
  o.instanceConfig.complete = function(w) {
521
- R(l) && l(w, o.file, o.inputElem), g();
521
+ R(l) && l(w, o.file, o.inputElem), y();
522
522
  }, h.parse(o.file, o.instanceConfig);
523
523
  }
524
524
  }
525
- function g() {
525
+ function y() {
526
526
  i.splice(0, 1), u();
527
527
  }
528
528
  }), U && (s.onmessage = function(e) {
@@ -541,8 +541,8 @@ class le {
541
541
  return new Promise((n, s) => {
542
542
  Pt(t, {
543
543
  header: !0,
544
- complete: (y) => n(y),
545
- error: (y) => s(y)
544
+ complete: (m) => n(m),
545
+ error: (m) => s(m)
546
546
  });
547
547
  });
548
548
  }
@@ -558,8 +558,8 @@ class qt {
558
558
  */
559
559
  static saveAs(t, n, s = {}) {
560
560
  this.assertBrowserEnvironment();
561
- const y = s.autoBom ? this.addUtf8Bom(t) : t;
562
- this.downloadBlob(y, n);
561
+ const m = s.autoBom ? this.addUtf8Bom(t) : t;
562
+ this.downloadBlob(m, n);
563
563
  }
564
564
  static addUtf8Bom(t) {
565
565
  return this.utf8BomMimeType.test(t.type) ? new Blob(["\uFEFF", t], { type: t.type }) : t;
@@ -589,14 +589,14 @@ class qt {
589
589
  }
590
590
  }
591
591
  static clickDownloadLink(t, n, s = !0) {
592
- const y = document.body ?? document.documentElement;
593
- if (!y)
592
+ const m = document.body ?? document.documentElement;
593
+ if (!m)
594
594
  throw new Error("DownloadHelper.saveAs requires an initialized document.");
595
- const b = document.createElement("a");
595
+ const _ = document.createElement("a");
596
596
  try {
597
- b.download = n, b.href = t, s && (b.target = "_blank", b.rel = "noopener noreferrer"), b.style.display = "none", y.appendChild(b), b.click();
597
+ _.download = n, _.href = t, s && (_.target = "_blank", _.rel = "noopener noreferrer"), _.style.display = "none", m.appendChild(_), _.click();
598
598
  } finally {
599
- b.remove();
599
+ _.remove();
600
600
  }
601
601
  }
602
602
  }
@@ -624,32 +624,32 @@ class de {
624
624
  */
625
625
  static readAsText(t) {
626
626
  const n = new FileReader();
627
- return new Promise((s, y) => {
627
+ return new Promise((s, m) => {
628
628
  n.onload = () => {
629
- n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) : y(new Error("Unexpected result type"));
629
+ n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) : m(new Error("Unexpected result type"));
630
630
  }, n.onerror = () => {
631
- const b = n.error ?? new Error("FileReader error");
632
- n.onload = null, n.onerror = null, y(b);
631
+ const _ = n.error ?? new Error("FileReader error");
632
+ n.onload = null, n.onerror = null, m(_);
633
633
  }, n.readAsText(t);
634
634
  });
635
635
  }
636
636
  static readAsArrayBuffer(t) {
637
637
  const n = new FileReader();
638
- return new Promise((s, y) => {
638
+ return new Promise((s, m) => {
639
639
  n.onload = () => {
640
- n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) : y(new Error("Unexpected result type"));
640
+ n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) : m(new Error("Unexpected result type"));
641
641
  }, n.onerror = () => {
642
- const b = n.error ?? new Error("FileReader error");
643
- n.onload = null, n.onerror = null, y(b);
642
+ const _ = n.error ?? new Error("FileReader error");
643
+ n.onload = null, n.onerror = null, m(_);
644
644
  }, n.readAsArrayBuffer(t);
645
645
  });
646
646
  }
647
647
  static readAsDataUrl(t) {
648
648
  const n = new FileReader();
649
- return new Promise((s, y) => {
650
- n.onload = (b) => {
651
- s(b);
652
- }, n.onerror = (b) => y(b), n.readAsDataURL(t);
649
+ return new Promise((s, m) => {
650
+ n.onload = (_) => {
651
+ s(_);
652
+ }, n.onerror = (_) => m(_), n.readAsDataURL(t);
653
653
  });
654
654
  }
655
655
  /** usage:
@@ -659,32 +659,51 @@ class de {
659
659
  static formatFileSize(t, n = 2, s) {
660
660
  if (t === 0)
661
661
  return "0 Bytes";
662
- const y = 1024, b = ["Bytes", "KB", "MB", "GB", "TB"];
663
- let U = Math.floor(Math.log(t) / Math.log(y));
664
- s && b.includes(s) && (U = b.indexOf(s));
665
- const I = t / Math.pow(y, U);
666
- return `${parseFloat(I.toFixed(n))} ${b[U]}`;
662
+ const m = 1024, _ = ["Bytes", "KB", "MB", "GB", "TB"];
663
+ let U = Math.floor(Math.log(t) / Math.log(m));
664
+ s && _.includes(s) && (U = _.indexOf(s));
665
+ const I = t / Math.pow(m, U);
666
+ return `${parseFloat(I.toFixed(n))} ${_[U]}`;
667
+ }
668
+ static isWithinSizeLimit(t, n) {
669
+ if (!Number.isSafeInteger(n) || n < 0)
670
+ throw new RangeError("maxBytes must be a non-negative safe integer.");
671
+ return t.size <= n;
667
672
  }
668
673
  static save(t, n, s) {
669
- const y = new Blob([t], { type: s });
670
- qt.saveAs(y, n);
674
+ const m = new Blob([t], { type: s });
675
+ qt.saveAs(m, n);
671
676
  }
672
677
  }
673
678
  class he {
679
+ static hasAllowedMimeType(t, n) {
680
+ const s = t.type.trim().toLowerCase();
681
+ return s.length > 0 && n.some(
682
+ (m) => m.trim().toLowerCase() === s
683
+ );
684
+ }
674
685
  static load(t) {
675
- return new Promise((n, s) => {
676
- const y = new Image();
677
- y.onload = () => n(y), y.onerror = s, y.src = URL.createObjectURL(t);
678
- });
686
+ const n = URL.createObjectURL(t);
687
+ return this.loadSource(n).finally(() => URL.revokeObjectURL(n));
688
+ }
689
+ static async compress(t, n = 0.8, s = "image/jpeg") {
690
+ const m = await this.loadSource(t), { canvas: _ } = this.resize(m, m.width, m.height);
691
+ return _.toDataURL(s, n);
679
692
  }
680
693
  static resize(t, n, s) {
681
- let { width: y, height: b } = t;
682
- const U = n / y, I = s / b, K = Math.min(U, I, 1);
683
- y = Math.floor(y * K), b = Math.floor(b * K);
694
+ let { width: m, height: _ } = t;
695
+ const U = n / m, I = s / _, K = Math.min(U, I, 1);
696
+ m = Math.floor(m * K), _ = Math.floor(_ * K);
684
697
  const h = document.createElement("canvas");
685
- h.width = y, h.height = b;
698
+ h.width = m, h.height = _;
686
699
  const A = h.getContext("2d");
687
- return A.clearRect(0, 0, y, b), A.drawImage(t, 0, 0, y, b), { canvas: h, width: y, height: b };
700
+ return A.clearRect(0, 0, m, _), A.drawImage(t, 0, 0, m, _), { canvas: h, width: m, height: _ };
701
+ }
702
+ static loadSource(t) {
703
+ return new Promise((n, s) => {
704
+ const m = new Image();
705
+ m.onload = () => n(m), m.onerror = s, m.src = t;
706
+ });
688
707
  }
689
708
  }
690
709
  class Ct {
@@ -739,9 +758,9 @@ class X {
739
758
  args: n,
740
759
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
741
760
  };
742
- for (const y of X.listeners)
761
+ for (const m of X.listeners)
743
762
  try {
744
- if (y(s) === !1)
763
+ if (m(s) === !1)
745
764
  return;
746
765
  } catch {
747
766
  }
@@ -749,9 +768,9 @@ class X {
749
768
  }
750
769
  static onLog(t, n = !1) {
751
770
  if (n) {
752
- const s = (y) => {
771
+ const s = (m) => {
753
772
  try {
754
- return t(y);
773
+ return t(m);
755
774
  } finally {
756
775
  X.listeners.delete(s);
757
776
  }
@@ -762,8 +781,8 @@ class X {
762
781
  }
763
782
  }
764
783
  const Kt = (a, t, n) => a.localeCompare(t) * (n ? 1 : -1), Jt = (a, t) => a < t ? -1 : a === t ? 0 : 1, Qt = (a, t, n) => Jt(a, t) * (n ? 1 : -1), Vt = (a, t, n) => typeof a == "string" && typeof t == "string" ? Kt(a, t, n) : Qt(a, t, n), Zt = (a, t, n, s) => {
765
- const y = n(a), b = n(t);
766
- return Vt(y, b, s);
784
+ const m = n(a), _ = n(t);
785
+ return Vt(m, _, s);
767
786
  };
768
787
  class pe {
769
788
  static get(t) {
@@ -816,8 +835,8 @@ function P(a, t, n) {
816
835
  function me() {
817
836
  P(Array.prototype, "distinct", function(a) {
818
837
  return a ? this.filter(
819
- (n, s, y) => y.findIndex((b) => a(b, n)) === s
820
- ) : this.filter((n, s, y) => y.indexOf(n) === s);
838
+ (n, s, m) => m.findIndex((_) => a(_, n)) === s
839
+ ) : this.filter((n, s, m) => m.indexOf(n) === s);
821
840
  }), P(Array.prototype, "filterBy", function(a) {
822
841
  return this.filter((t) => a(t));
823
842
  }), P(Array.prototype, "first", function() {
@@ -839,7 +858,7 @@ function Xt() {
839
858
  (function(n, s) {
840
859
  a.exports = s();
841
860
  })(Gt, (function() {
842
- var n = 1e3, s = 6e4, y = 36e5, b = "millisecond", U = "second", I = "minute", K = "hour", h = "day", A = "week", j = "month", Q = "quarter", q = "year", G = "date", nt = "Invalid Date", ut = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, mt = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, wt = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(v) {
861
+ var n = 1e3, s = 6e4, m = 36e5, _ = "millisecond", U = "second", I = "minute", K = "hour", h = "day", A = "week", j = "month", Q = "quarter", q = "year", G = "date", nt = "Invalid Date", ut = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, mt = /\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, wt = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(v) {
843
862
  var d = ["th", "st", "nd", "rd"], f = v % 100;
844
863
  return "[" + v + (d[(f - 20) % 10] || d[f] || d[0]) + "]";
845
864
  } }, dt = function(v, d, f) {
@@ -855,13 +874,13 @@ function Xt() {
855
874
  }, a: function(v) {
856
875
  return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
857
876
  }, p: function(v) {
858
- return { M: j, y: q, w: A, d: h, D: G, h: K, m: I, s: U, ms: b, Q }[v] || String(v || "").toLowerCase().replace(/s$/, "");
877
+ return { M: j, y: q, w: A, d: h, D: G, h: K, m: I, s: U, ms: _, Q }[v] || String(v || "").toLowerCase().replace(/s$/, "");
859
878
  }, u: function(v) {
860
879
  return v === void 0;
861
880
  } }, ct = "en", V = {};
862
881
  V[ct] = wt;
863
882
  var R = "$isDayjsObject", e = function(v) {
864
- return v instanceof g || !(!v || !v[R]);
883
+ return v instanceof y || !(!v || !v[R]);
865
884
  }, r = function v(d, f, o) {
866
885
  var c;
867
886
  if (!d) return ct;
@@ -871,19 +890,19 @@ function Xt() {
871
890
  var w = d.split("-");
872
891
  if (!c && w.length > 1) return v(w[0]);
873
892
  } else {
874
- var m = d.name;
875
- V[m] = d, c = m;
893
+ var g = d.name;
894
+ V[g] = d, c = g;
876
895
  }
877
896
  return !o && c && (ct = c), c || !o && ct;
878
897
  }, i = function(v, d) {
879
898
  if (e(v)) return v.clone();
880
899
  var f = typeof d == "object" ? d : {};
881
- return f.date = v, f.args = arguments, new g(f);
900
+ return f.date = v, f.args = arguments, new y(f);
882
901
  }, u = bt;
883
902
  u.l = r, u.i = e, u.w = function(v, d) {
884
903
  return i(v, { locale: d.$L, utc: d.$u, x: d.$x, $offset: d.$offset });
885
904
  };
886
- var g = (function() {
905
+ var y = (function() {
887
906
  function v(f) {
888
907
  this.$L = r(f.locale, null, !0), this.parse(f), this.$x = this.$x || f.x || {}, this[R] = !0;
889
908
  }
@@ -897,8 +916,8 @@ function Xt() {
897
916
  if (typeof c == "string" && !/Z$/i.test(c)) {
898
917
  var w = c.match(ut);
899
918
  if (w) {
900
- var m = w[2] - 1 || 0, k = (w[7] || "0").substring(0, 3);
901
- return l ? new Date(Date.UTC(w[1], m, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k)) : new Date(w[1], m, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k);
919
+ var g = w[2] - 1 || 0, k = (w[7] || "0").substring(0, 3);
920
+ return l ? new Date(Date.UTC(w[1], g, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k)) : new Date(w[1], g, w[3] || 1, w[4] || 0, w[5] || 0, w[6] || 0, k);
902
921
  }
903
922
  }
904
923
  return new Date(c);
@@ -924,20 +943,20 @@ function Xt() {
924
943
  }, d.valueOf = function() {
925
944
  return this.$d.getTime();
926
945
  }, d.startOf = function(f, o) {
927
- var c = this, l = !!u.u(o) || o, w = u.p(f), m = function(D, O) {
928
- var _ = u.w(c.$u ? Date.UTC(c.$y, O, D) : new Date(c.$y, O, D), c);
929
- return l ? _ : _.endOf(h);
946
+ var c = this, l = !!u.u(o) || o, w = u.p(f), g = function(D, O) {
947
+ var b = u.w(c.$u ? Date.UTC(c.$y, O, D) : new Date(c.$y, O, D), c);
948
+ return l ? b : b.endOf(h);
930
949
  }, k = function(D, O) {
931
950
  return u.w(c.toDate()[D].apply(c.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), c);
932
951
  }, p = this.$W, M = this.$M, C = this.$D, Y = "set" + (this.$u ? "UTC" : "");
933
952
  switch (w) {
934
953
  case q:
935
- return l ? m(1, 0) : m(31, 11);
954
+ return l ? g(1, 0) : g(31, 11);
936
955
  case j:
937
- return l ? m(1, M) : m(0, M + 1);
956
+ return l ? g(1, M) : g(0, M + 1);
938
957
  case A:
939
958
  var W = this.$locale().weekStart || 0, S = (p < W ? p + 7 : p) - W;
940
- return m(l ? C - S : C + (6 - S), M);
959
+ return g(l ? C - S : C + (6 - S), M);
941
960
  case h:
942
961
  case G:
943
962
  return k(Y + "Hours", 0);
@@ -953,11 +972,11 @@ function Xt() {
953
972
  }, d.endOf = function(f) {
954
973
  return this.startOf(f, !1);
955
974
  }, d.$set = function(f, o) {
956
- var c, l = u.p(f), w = "set" + (this.$u ? "UTC" : ""), m = (c = {}, c[h] = w + "Date", c[G] = w + "Date", c[j] = w + "Month", c[q] = w + "FullYear", c[K] = w + "Hours", c[I] = w + "Minutes", c[U] = w + "Seconds", c[b] = w + "Milliseconds", c)[l], k = l === h ? this.$D + (o - this.$W) : o;
975
+ var c, l = u.p(f), w = "set" + (this.$u ? "UTC" : ""), g = (c = {}, c[h] = w + "Date", c[G] = w + "Date", c[j] = w + "Month", c[q] = w + "FullYear", c[K] = w + "Hours", c[I] = w + "Minutes", c[U] = w + "Seconds", c[_] = w + "Milliseconds", c)[l], k = l === h ? this.$D + (o - this.$W) : o;
957
976
  if (l === j || l === q) {
958
977
  var p = this.clone().set(G, 1);
959
- p.$d[m](k), p.init(), this.$d = p.set(G, Math.min(this.$D, p.daysInMonth())).$d;
960
- } else m && this.$d[m](k);
978
+ p.$d[g](k), p.init(), this.$d = p.set(G, Math.min(this.$D, p.daysInMonth())).$d;
979
+ } else g && this.$d[g](k);
961
980
  return this.init(), this;
962
981
  }, d.set = function(f, o) {
963
982
  return this.clone().$set(f, o);
@@ -966,31 +985,31 @@ function Xt() {
966
985
  }, d.add = function(f, o) {
967
986
  var c, l = this;
968
987
  f = Number(f);
969
- var w = u.p(o), m = function(M) {
988
+ var w = u.p(o), g = function(M) {
970
989
  var C = i(l);
971
990
  return u.w(C.date(C.date() + Math.round(M * f)), l);
972
991
  };
973
992
  if (w === j) return this.set(j, this.$M + f);
974
993
  if (w === q) return this.set(q, this.$y + f);
975
- if (w === h) return m(1);
976
- if (w === A) return m(7);
977
- var k = (c = {}, c[I] = s, c[K] = y, c[U] = n, c)[w] || 1, p = this.$d.getTime() + f * k;
994
+ if (w === h) return g(1);
995
+ if (w === A) return g(7);
996
+ var k = (c = {}, c[I] = s, c[K] = m, c[U] = n, c)[w] || 1, p = this.$d.getTime() + f * k;
978
997
  return u.w(p, this);
979
998
  }, d.subtract = function(f, o) {
980
999
  return this.add(-1 * f, o);
981
1000
  }, d.format = function(f) {
982
1001
  var o = this, c = this.$locale();
983
1002
  if (!this.isValid()) return c.invalidDate || nt;
984
- var l = f || "YYYY-MM-DDTHH:mm:ssZ", w = u.z(this), m = this.$H, k = this.$m, p = this.$M, M = c.weekdays, C = c.months, Y = c.meridiem, W = function(O, _, T, B) {
985
- return O && (O[_] || O(o, l)) || T[_].slice(0, B);
1003
+ var l = f || "YYYY-MM-DDTHH:mm:ssZ", w = u.z(this), g = this.$H, k = this.$m, p = this.$M, M = c.weekdays, C = c.months, Y = c.meridiem, W = function(O, b, T, B) {
1004
+ return O && (O[b] || O(o, l)) || T[b].slice(0, B);
986
1005
  }, S = function(O) {
987
- return u.s(m % 12 || 12, O, "0");
988
- }, D = Y || function(O, _, T) {
1006
+ return u.s(g % 12 || 12, O, "0");
1007
+ }, D = Y || function(O, b, T) {
989
1008
  var B = O < 12 ? "AM" : "PM";
990
1009
  return T ? B.toLowerCase() : B;
991
1010
  };
992
- return l.replace(mt, (function(O, _) {
993
- return _ || (function(T) {
1011
+ return l.replace(mt, (function(O, b) {
1012
+ return b || (function(T) {
994
1013
  switch (T) {
995
1014
  case "YY":
996
1015
  return String(o.$y).slice(-2);
@@ -1017,17 +1036,17 @@ function Xt() {
1017
1036
  case "dddd":
1018
1037
  return M[o.$W];
1019
1038
  case "H":
1020
- return String(m);
1039
+ return String(g);
1021
1040
  case "HH":
1022
- return u.s(m, 2, "0");
1041
+ return u.s(g, 2, "0");
1023
1042
  case "h":
1024
1043
  return S(1);
1025
1044
  case "hh":
1026
1045
  return S(2);
1027
1046
  case "a":
1028
- return D(m, k, !0);
1047
+ return D(g, k, !0);
1029
1048
  case "A":
1030
- return D(m, k, !1);
1049
+ return D(g, k, !1);
1031
1050
  case "m":
1032
1051
  return String(k);
1033
1052
  case "mm":
@@ -1047,10 +1066,10 @@ function Xt() {
1047
1066
  }, d.utcOffset = function() {
1048
1067
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1049
1068
  }, d.diff = function(f, o, c) {
1050
- var l, w = this, m = u.p(o), k = i(f), p = (k.utcOffset() - this.utcOffset()) * s, M = this - k, C = function() {
1069
+ var l, w = this, g = u.p(o), k = i(f), p = (k.utcOffset() - this.utcOffset()) * s, M = this - k, C = function() {
1051
1070
  return u.m(w, k);
1052
1071
  };
1053
- switch (m) {
1072
+ switch (g) {
1054
1073
  case q:
1055
1074
  l = C() / 12;
1056
1075
  break;
@@ -1067,7 +1086,7 @@ function Xt() {
1067
1086
  l = (M - p) / 864e5;
1068
1087
  break;
1069
1088
  case K:
1070
- l = M / y;
1089
+ l = M / m;
1071
1090
  break;
1072
1091
  case I:
1073
1092
  l = M / s;
@@ -1098,13 +1117,13 @@ function Xt() {
1098
1117
  }, d.toString = function() {
1099
1118
  return this.$d.toUTCString();
1100
1119
  }, v;
1101
- })(), E = g.prototype;
1102
- return i.prototype = E, [["$ms", b], ["$s", U], ["$m", I], ["$H", K], ["$W", h], ["$M", j], ["$y", q], ["$D", G]].forEach((function(v) {
1120
+ })(), E = y.prototype;
1121
+ return i.prototype = E, [["$ms", _], ["$s", U], ["$m", I], ["$H", K], ["$W", h], ["$M", j], ["$y", q], ["$D", G]].forEach((function(v) {
1103
1122
  E[v[1]] = function(d) {
1104
1123
  return this.$g(d, v[0], v[1]);
1105
1124
  };
1106
1125
  })), i.extend = function(v, d) {
1107
- return v.$i || (v(d, g, i), v.$i = !0), i;
1126
+ return v.$i || (v(d, y, i), v.$i = !0), i;
1108
1127
  }, i.locale = r, i.isDayjs = e, i.unix = function(v) {
1109
1128
  return i(1e3 * v);
1110
1129
  }, i.en = V[ct], i.Ls = V, i.p = {}, i;
@@ -1120,15 +1139,15 @@ function ee() {
1120
1139
  a.exports = s();
1121
1140
  })(te, (function() {
1122
1141
  var n = "day";
1123
- return function(s, y, b) {
1142
+ return function(s, m, _) {
1124
1143
  var U = function(h) {
1125
1144
  return h.add(4 - h.isoWeekday(), n);
1126
- }, I = y.prototype;
1145
+ }, I = m.prototype;
1127
1146
  I.isoWeekYear = function() {
1128
1147
  return U(this).year();
1129
1148
  }, I.isoWeek = function(h) {
1130
1149
  if (!this.$utils().u(h)) return this.add(7 * (h - this.isoWeek()), n);
1131
- var A, j, Q, q, G = U(this), nt = (A = this.isoWeekYear(), j = this.$u, Q = (j ? b.utc : b)().year(A).startOf("year"), q = 4 - Q.isoWeekday(), Q.isoWeekday() > 4 && (q += 7), Q.add(q, n));
1150
+ var A, j, Q, q, G = U(this), nt = (A = this.isoWeekYear(), j = this.$u, Q = (j ? _.utc : _)().year(A).startOf("year"), q = 4 - Q.isoWeekday(), Q.isoWeekday() > 4 && (q += 7), Q.add(q, n));
1132
1151
  return G.diff(nt, "week") + 1;
1133
1152
  }, I.isoWeekday = function(h) {
1134
1153
  return this.$utils().u(h) ? this.day() || 7 : this.day(this.day() % 7 ? h : h - 7);
@@ -1151,9 +1170,9 @@ function se() {
1151
1170
  a.exports = s();
1152
1171
  })(ie, (function() {
1153
1172
  var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
1154
- return function(s, y, b) {
1155
- var U = y.prototype, I = U.format;
1156
- b.en.formats = n, U.format = function(K) {
1173
+ return function(s, m, _) {
1174
+ var U = m.prototype, I = U.format;
1175
+ _.en.formats = n, U.format = function(K) {
1157
1176
  K === void 0 && (K = "YYYY-MM-DDTHH:mm:ssZ");
1158
1177
  var h = this.$locale().formats, A = (function(j, Q) {
1159
1178
  return j.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(q, G, nt) {