@solarpunkltd/swarm-chat-js 6.2.4 → 6.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -109,7 +109,7 @@ var li = {};
109
109
  }
110
110
  async function u(e, t = 1) {
111
111
  const n = Ts(e, t), s = [], o = n.map(async (d) => {
112
- for (const p of d) s.push(await p());
112
+ for (const m of d) s.push(await m());
113
113
  });
114
114
  return await Promise.all(o), s;
115
115
  }
@@ -218,15 +218,15 @@ var li = {};
218
218
  const o = [];
219
219
  for (; o.length < t; ) {
220
220
  const d = Yt(e, s);
221
- o.some((p) => n(p, d)) || o.push(d);
221
+ o.some((m) => n(m, d)) || o.push(d);
222
222
  }
223
223
  return o;
224
224
  }
225
225
  function Ri(e, t, n, s, o, d = Math.random) {
226
- const p = e.filter((m) => m !== t && m !== n), v = [];
227
- for (t !== null && v.push(t); p.length && v.length < s; ) {
228
- const m = a.Random.intBetween(0, p.length - 1, d);
229
- o(p[m], v) && v.push(p[m]), p.splice(m, 1);
226
+ const m = e.filter((p) => p !== t && p !== n), v = [];
227
+ for (t !== null && v.push(t); m.length && v.length < s; ) {
228
+ const p = a.Random.intBetween(0, m.length - 1, d);
229
+ o(m[p], v) && v.push(m[p]), m.splice(p, 1);
230
230
  }
231
231
  return f(v, d), { values: v, indexOfGuaranteed: t !== null ? v.indexOf(t) : -1 };
232
232
  }
@@ -242,7 +242,7 @@ var li = {};
242
242
  }
243
243
  function Ni(e, t, n) {
244
244
  if (n === void 0 && (n = Math.random()), e.length !== t.length) throw new Error("Array length mismatch");
245
- let s = t.reduce((d, p) => d + p, 0);
245
+ let s = t.reduce((d, m) => d + m, 0);
246
246
  const o = n * s;
247
247
  for (let d = 0; d < e.length - 1; d++) if (s -= t[d], o >= s) return e[d];
248
248
  return qe(e);
@@ -250,7 +250,7 @@ var li = {};
250
250
  function ji(e, t, n = Math.random) {
251
251
  const s = t.map((d) => n() * d), o = [];
252
252
  for (let d = 0; d < e.length; d++) o.push([e[d], s[d]]);
253
- return o.sort((d, p) => p[1] - d[1]).map((d) => d[0]);
253
+ return o.sort((d, m) => m[1] - d[1]).map((d) => d[0]);
254
254
  }
255
255
  function ye(e, t) {
256
256
  if (e == null) return null;
@@ -266,9 +266,9 @@ var li = {};
266
266
  const s = t.split(/\.|\[/);
267
267
  let o = e;
268
268
  for (let d = 0; d < s.length; d++) {
269
- const p = s[d], v = d < s.length - 1 && s[d + 1].includes("]"), m = p.includes("]") ? p.replace(/\[|\]/g, "") : p;
270
- if (d === s.length - 1) return o[m] = n, n;
271
- ce(o[m]) || (v ? o[m] = [] : o[m] = {}), o = o[m];
269
+ const m = s[d], v = d < s.length - 1 && s[d + 1].includes("]"), p = m.includes("]") ? m.replace(/\[|\]/g, "") : m;
270
+ if (d === s.length - 1) return o[p] = n, n;
271
+ ce(o[p]) || (v ? o[p] = [] : o[p] = {}), o = o[p];
272
272
  }
273
273
  return n;
274
274
  }
@@ -333,8 +333,8 @@ var li = {};
333
333
  return "#" + e.map((t) => t.toString(16).padStart(2, "0")).join("");
334
334
  }
335
335
  function qi(e, t, n, s) {
336
- const o = e * Math.PI / 180, d = n * Math.PI / 180, p = (n - e) * Math.PI / 180, v = (s - t) * Math.PI / 180, m = Math.sin(p / 2) * Math.sin(p / 2) + Math.cos(o) * Math.cos(d) * Math.sin(v / 2) * Math.sin(v / 2);
337
- return 6371e3 * (2 * Math.atan2(Math.sqrt(m), Math.sqrt(1 - m)));
336
+ const o = e * Math.PI / 180, d = n * Math.PI / 180, m = (n - e) * Math.PI / 180, v = (s - t) * Math.PI / 180, p = Math.sin(m / 2) * Math.sin(m / 2) + Math.cos(o) * Math.cos(d) * Math.sin(v / 2) * Math.sin(v / 2);
337
+ return 6371e3 * (2 * Math.atan2(Math.sqrt(p), Math.sqrt(1 - p)));
338
338
  }
339
339
  function Tt(e, t) {
340
340
  return Math.round(e / t) * t;
@@ -501,11 +501,11 @@ var li = {};
501
501
  if (!Un(e)) throw new TypeError(`Expected boolean${t != null && t.name ? ` for ${t.name}` : ""}, got: ` + e);
502
502
  return e;
503
503
  }
504
- function pa(e, t) {
504
+ function ma(e, t) {
505
505
  if (!Me(e)) throw new TypeError(`Expected date${t != null && t.name ? ` for ${t.name}` : ""}, got: ` + e);
506
506
  return e;
507
507
  }
508
- function ma(e) {
508
+ function pa(e) {
509
509
  return At(e) ? null : e;
510
510
  }
511
511
  function ga(e, t) {
@@ -799,23 +799,23 @@ var li = {};
799
799
  const t = ur(e), n = cr(e);
800
800
  return n ? `${t}.${n}` : t;
801
801
  }
802
- function po(e) {
802
+ function mo(e) {
803
803
  const t = ur(e), n = cr(e);
804
804
  return { basename: t, extension: n, filename: n ? `${t}.${n}` : t };
805
805
  }
806
- function mo(e, t = Math.random) {
806
+ function po(e, t = Math.random) {
807
807
  return e.replace(/\{(.+?)\}/g, (n, s) => Yt(s.split("|"), t));
808
808
  }
809
809
  function Qn(e) {
810
810
  const t = /\{(.+?)\}/, n = e.match(t);
811
811
  if (!n || !n.index) return [e];
812
812
  const s = n[1].split(","), o = e.slice(0, n.index), d = e.slice(n.index + n[0].length);
813
- let p = [];
813
+ let m = [];
814
814
  for (const v of s) {
815
- const m = Qn(o + v + d);
816
- p = p.concat(m);
815
+ const p = Qn(o + v + d);
816
+ m = m.concat(p);
817
817
  }
818
- return p;
818
+ return m;
819
819
  }
820
820
  function Je(e) {
821
821
  return e.split(
@@ -1039,21 +1039,21 @@ var li = {};
1039
1039
  function us(e, t) {
1040
1040
  const n = "=", s = t.length;
1041
1041
  let o = 0, d = 0;
1042
- const p = [];
1042
+ const m = [];
1043
1043
  for (let v = 0; v < e.length; v++) {
1044
- const m = e[v];
1045
- if (m === n) break;
1046
- const k = t.indexOf(m);
1047
- if (k === -1) throw new Error(`Invalid character: ${m}`);
1048
- d = d << Math.log2(s) | k, o += Math.log2(s), o >= 8 && (o -= 8, p.push(d >> o & 255));
1044
+ const p = e[v];
1045
+ if (p === n) break;
1046
+ const k = t.indexOf(p);
1047
+ if (k === -1) throw new Error(`Invalid character: ${p}`);
1048
+ d = d << Math.log2(s) | k, o += Math.log2(s), o >= 8 && (o -= 8, m.push(d >> o & 255));
1049
1049
  }
1050
- return new Uint8Array(p);
1050
+ return new Uint8Array(m);
1051
1051
  }
1052
1052
  function ls(e, t) {
1053
1053
  const n = t.length;
1054
1054
  let s = 0, o = 0, d = "";
1055
- for (let p = 0; p < e.length; p++)
1056
- for (o = o << 8 | e[p], s += 8; s >= Math.log2(n); ) s -= Math.log2(n), d += t[o >> s & n - 1];
1055
+ for (let m = 0; m < e.length; m++)
1056
+ for (o = o << 8 | e[m], s += 8; s >= Math.log2(n); ) s -= Math.log2(n), d += t[o >> s & n - 1];
1057
1057
  return s > 0 && (d += t[o << Math.log2(n) - s & n - 1]), d.length % 4 !== 0 && (d += "=".repeat(4 - d.length % 4)), d;
1058
1058
  }
1059
1059
  function Co(e) {
@@ -1073,9 +1073,9 @@ var li = {};
1073
1073
  if (n.length !== s.length) return null;
1074
1074
  const o = {};
1075
1075
  for (let d = 0; d < n.length; d++) {
1076
- const p = n[d];
1077
- if (p.startsWith(":")) o[p.slice(1)] = s[d];
1078
- else if (p !== s[d]) return null;
1076
+ const m = n[d];
1077
+ if (m.startsWith(":")) o[m.slice(1)] = s[d];
1078
+ else if (m !== s[d]) return null;
1079
1079
  }
1080
1080
  return o;
1081
1081
  }
@@ -1086,23 +1086,23 @@ var li = {};
1086
1086
  }
1087
1087
  function Do(e, t, n, s = Math.random) {
1088
1088
  const o = a.Arrays.shuffle(
1089
- t.map((p) => ({
1089
+ t.map((m) => ({
1090
1090
  variants: a.Arrays.shuffle(
1091
- p.variants.map((v) => v),
1091
+ m.variants.map((v) => v),
1092
1092
  s
1093
1093
  ),
1094
- avoid: p.avoid
1094
+ avoid: m.avoid
1095
1095
  })),
1096
1096
  s
1097
1097
  ), d = [];
1098
- for (const p of o) {
1099
- const v = p.variants.filter((k) => k !== p.avoid), m = v.find((k) => e.includes(k));
1100
- if (m && (Mt(d, lr(e, m, v)), d.length >= n)) break;
1098
+ for (const m of o) {
1099
+ const v = m.variants.filter((k) => k !== m.avoid), p = v.find((k) => e.includes(k));
1100
+ if (p && (Mt(d, lr(e, p, v)), d.length >= n)) break;
1101
1101
  }
1102
1102
  if (d.length < n)
1103
- for (const p of o) {
1104
- const v = p.variants.find((m) => e.includes(m));
1105
- if (v && (Mt(d, lr(e, v, p.variants)), d.length >= n)) break;
1103
+ for (const m of o) {
1104
+ const v = m.variants.find((p) => e.includes(p));
1105
+ if (v && (Mt(d, lr(e, v, m.variants)), d.length >= n)) break;
1106
1106
  }
1107
1107
  return d.slice(0, n);
1108
1108
  }
@@ -1129,9 +1129,9 @@ var li = {};
1129
1129
  function Lo(e, t, n = {}) {
1130
1130
  const s = [];
1131
1131
  let o = "", d = 0;
1132
- for (let p = 0; p < e.length; p++) {
1133
- const v = e[p], m = n[v] || 1;
1134
- if (o += v, d += m, d > t) {
1132
+ for (let m = 0; m < e.length; m++) {
1133
+ const v = e[m], p = n[v] || 1;
1134
+ if (o += v, d += p, d > t) {
1135
1135
  const { line: k, rest: M } = ds(o);
1136
1136
  s.push(k), o = M, d = M.split("").map((U) => n[U] || 1).reduce((U, je) => U + je, 0);
1137
1137
  }
@@ -1180,8 +1180,8 @@ var li = {};
1180
1180
  if (e[d + t.length + 1] === o)
1181
1181
  if (e[d + t.length + 2] === o) e = e.replace(`${s}${t}${o}${o}`, n);
1182
1182
  else {
1183
- const p = Ct(e, d + t.length + 2, ["_"]);
1184
- e = e.replace(`${s}${t}${o}${p}`, n);
1183
+ const m = Ct(e, d + t.length + 2, ["_"]);
1184
+ e = e.replace(`${s}${t}${o}${m}`, n);
1185
1185
  }
1186
1186
  else e = e.replace(`${s}${t}`, n);
1187
1187
  d = e.indexOf(`${s}${t}`, d + n.length);
@@ -1207,14 +1207,14 @@ var li = {};
1207
1207
  for (; n !== -1; ) {
1208
1208
  const s = ss(e, "[", n), o = e.indexOf(")", n);
1209
1209
  if (s !== -1 && o !== -1) {
1210
- const [d, p] = e.slice(s + 1, o).split("]("), v = t(d, p);
1210
+ const [d, m] = e.slice(s + 1, o).split("]("), v = t(d, m);
1211
1211
  e = e.slice(0, s) + v + e.slice(o + 1);
1212
1212
  }
1213
1213
  n = e.indexOf("](", n + 1);
1214
1214
  }
1215
1215
  return e;
1216
1216
  }
1217
- function ps(e, t = !0) {
1217
+ function ms(e, t = !0) {
1218
1218
  const n = Object.entries(e).filter(([s, o]) => o != null).map(([s, o]) => `${s}=${encodeURIComponent(o)}`).join("&");
1219
1219
  return n ? (t ? "?" : "") + n : "";
1220
1220
  }
@@ -1232,14 +1232,14 @@ var li = {};
1232
1232
  function Jo(e, t) {
1233
1233
  let n = null, s = -1 / 0;
1234
1234
  for (const [o, d] of Object.entries(e)) {
1235
- const p = t(d);
1236
- p > s && (s = p, n = o);
1235
+ const m = t(d);
1236
+ m > s && (s = m, n = o);
1237
1237
  }
1238
1238
  return n ? [n, e[n]] : null;
1239
1239
  }
1240
1240
  function Ko(e, t, n, s) {
1241
- const o = e.find((p) => p[t] === n), d = e.find((p) => p[t] === n + s);
1242
- o && d ? (o[t] = n + s, d[t] = n) : o && (o[t] = n + s), e.sort((p, v) => Ot(p[t]) - Ot(v[t])), e.forEach((p, v) => p[t] = v + 1);
1241
+ const o = e.find((m) => m[t] === n), d = e.find((m) => m[t] === n + s);
1242
+ o && d ? (o[t] = n + s, d[t] = n) : o && (o[t] = n + s), e.sort((m, v) => Ot(m[t]) - Ot(v[t])), e.forEach((m, v) => m[t] = v + 1);
1243
1243
  }
1244
1244
  function Yo(e) {
1245
1245
  const t = Object.keys(e);
@@ -1252,13 +1252,13 @@ var li = {};
1252
1252
  );
1253
1253
  }
1254
1254
  function Xo(e, t, n) {
1255
- return vs(e, t) + ps(n || {});
1255
+ return vs(e, t) + ms(n || {});
1256
1256
  }
1257
1257
  function ec(e, t = ",", n = '"') {
1258
1258
  const s = [];
1259
1259
  let o = "", d = !1;
1260
- const p = e.split("");
1261
- for (const v of p) v === t && !d ? (s.push(o), o = "") : v === n && (!o && !d || d) ? d = !d : o += v;
1260
+ const m = e.split("");
1261
+ for (const v of m) v === t && !d ? (s.push(o), o = "") : v === n && (!o && !d || d) ? d = !d : o += v;
1262
1262
  return s.push(o), s;
1263
1263
  }
1264
1264
  function tc(e) {
@@ -1339,7 +1339,7 @@ var li = {};
1339
1339
  const d = hr(o);
1340
1340
  return be(n) - be(o) < 7 ? s[d.day]() : s.weeks(Math.round((n.getTime() - o.getTime()) / 6048e5));
1341
1341
  }
1342
- const ms = {
1342
+ const ps = {
1343
1343
  now: () => "A few seconds",
1344
1344
  seconds: (e) => `${e} seconds`,
1345
1345
  minutes: (e) => `${e} minutes`,
@@ -1348,19 +1348,19 @@ var li = {};
1348
1348
  weeks: (e) => `${e} weeks`
1349
1349
  };
1350
1350
  function gs(e, t) {
1351
- const n = (t == null ? void 0 : t.now) ?? Date.now(), s = (t == null ? void 0 : t.labels) || ms, o = a.Types.isDate(e) ? e.getTime() : e;
1351
+ const n = (t == null ? void 0 : t.now) ?? Date.now(), s = (t == null ? void 0 : t.labels) || ps, o = a.Types.isDate(e) ? e.getTime() : e;
1352
1352
  let d = (n - o) / 1e3;
1353
1353
  return d < 10 ? s.now() : d < 120 ? s.seconds(Math.floor(d)) : (d /= 60, d < 120 ? s.minutes(Math.floor(d)) : (d /= 60, d < 48 ? s.hours(Math.floor(d)) : (d /= 24, d < 14 ? s.days(Math.floor(d)) : (d /= 7, s.weeks(Math.floor(d))))));
1354
1354
  }
1355
- function hc(e, t = ms) {
1355
+ function hc(e, t = ps) {
1356
1356
  return gs(0, { now: e * 1e3, labels: t });
1357
1357
  }
1358
- function pc(e, t, n) {
1358
+ function mc(e, t, n) {
1359
1359
  const s = ((n == null ? void 0 : n.now) ?? Date.now()) - e, o = Math.floor(s / t), d = t / ((n == null ? void 0 : n.precision) ?? 1) - Math.ceil(s % t / ((n == null ? void 0 : n.precision) ?? 1));
1360
1360
  return { cycles: o, remaining: d };
1361
1361
  }
1362
1362
  const fr = {};
1363
- function mc(e, t) {
1363
+ function pc(e, t) {
1364
1364
  return !fr[e] || Date.now() > fr[e] ? (fr[e] = Date.now() + t, !0) : !1;
1365
1365
  }
1366
1366
  const gc = { s: 1e3, m: 6e4, h: 36e5, d: 864e5 };
@@ -1369,8 +1369,8 @@ var li = {};
1369
1369
  }
1370
1370
  function vc(e, t, n, s) {
1371
1371
  s || (s = Date.now());
1372
- const o = t / n, d = s - e, p = d / t, v = p * n, m = v - d;
1373
- return { deltaMs: d, progress: o, baseTimeMs: p, totalTimeMs: v, remainingTimeMs: m };
1372
+ const o = t / n, d = s - e, m = d / t, v = m * n, p = v - d;
1373
+ return { deltaMs: d, progress: o, baseTimeMs: m, totalTimeMs: v, remainingTimeMs: p };
1374
1374
  }
1375
1375
  const wc = {
1376
1376
  0: "sunday",
@@ -1465,23 +1465,23 @@ var li = {};
1465
1465
  function Ic(e) {
1466
1466
  return e.replace(/ +/g, " ").replace(/^ /gm, "");
1467
1467
  }
1468
- const pr = {};
1468
+ const mr = {};
1469
1469
  async function Mc(e, t, n) {
1470
- const s = Date.now(), o = pr[e];
1470
+ const s = Date.now(), o = mr[e];
1471
1471
  if (o && o.validUntil > s) return o.value;
1472
- const d = await n(), p = s + t;
1473
- return pr[e] = { value: d, validUntil: p }, d;
1472
+ const d = await n(), m = s + t;
1473
+ return mr[e] = { value: d, validUntil: m }, d;
1474
1474
  }
1475
1475
  function $c(e) {
1476
- delete pr[e];
1476
+ delete mr[e];
1477
1477
  }
1478
1478
  function vs(...e) {
1479
1479
  return e.filter((t) => t).join("/").replace(new RegExp("(?<!:)\\/+", "g"), "/");
1480
1480
  }
1481
1481
  function Rc(e, t, n, s, o = !0) {
1482
- const d = e.indexOf(t), p = e.indexOf(n, d + t.length);
1483
- if (d === -1 || p === -1) throw Error("Start or end not found");
1484
- return o ? e.substring(0, d + t.length) + s + e.substring(p) : e.substring(0, d) + s + e.substring(p + n.length);
1482
+ const d = e.indexOf(t), m = e.indexOf(n, d + t.length);
1483
+ if (d === -1 || m === -1) throw Error("Start or end not found");
1484
+ return o ? e.substring(0, d + t.length) + s + e.substring(m) : e.substring(0, d) + s + e.substring(m + n.length);
1485
1485
  }
1486
1486
  function Cc(e) {
1487
1487
  let t = "p";
@@ -1545,11 +1545,11 @@ var li = {};
1545
1545
  }
1546
1546
  function Lc(e, t, n, s, o) {
1547
1547
  const d = {};
1548
- for (const p of Object.keys(t)) d[p] = [];
1548
+ for (const m of Object.keys(t)) d[m] = [];
1549
1549
  d[s] = [], o && (e = e.sort(o));
1550
- for (const p of e) {
1551
- const v = p[n], m = t[v] ? v : s;
1552
- d[m].length >= t[m] ? d[s].push(p) : d[m].push(p);
1550
+ for (const m of e) {
1551
+ const v = m[n], p = t[v] ? v : s;
1552
+ d[p].length >= t[p] ? d[s].push(m) : d[p].push(m);
1553
1553
  }
1554
1554
  return d;
1555
1555
  }
@@ -1599,11 +1599,11 @@ var li = {};
1599
1599
  function qc(e, t) {
1600
1600
  const n = (t == null ? void 0 : t.longForm) ?? !1, s = t != null && t.unit ? ` ${t.unit}` : "", o = n ? Wc : ks, d = (t == null ? void 0 : t.precision) ?? 1;
1601
1601
  if (e < le[0]) return `${e}${s}`;
1602
- for (let p = 0; p < le.length - 1; p++)
1603
- if (e < le[p + 1]) return `${(e / le[p]).toFixed(d)}${n ? " " : ""}${o[p]}${s}`;
1602
+ for (let m = 0; m < le.length - 1; m++)
1603
+ if (e < le[m + 1]) return `${(e / le[m]).toFixed(d)}${n ? " " : ""}${o[m]}${s}`;
1604
1604
  return `${(e / le[le.length - 1]).toFixed(d)}${n ? " " : ""}${o[le.length - 1]}${s}`;
1605
1605
  }
1606
- function mr(e) {
1606
+ function pr(e) {
1607
1607
  const t = parseFloat(e);
1608
1608
  if (isNaN(t)) throw Error("makeNumber got NaN for input");
1609
1609
  const n = e.replace(/^-?[0-9.]+/, "").trim(), s = ks.findIndex((o) => o.toLowerCase() === n.toLowerCase());
@@ -1684,20 +1684,20 @@ var li = {};
1684
1684
  return t;
1685
1685
  }
1686
1686
  function lu(e) {
1687
- const t = Object.keys(e), n = t.map((v) => e[v].length), s = n.reduce((v, m) => v *= m);
1687
+ const t = Object.keys(e), n = t.map((v) => e[v].length), s = n.reduce((v, p) => v *= p);
1688
1688
  let o = 1;
1689
1689
  const d = [1];
1690
1690
  for (let v = 0; v < n.length - 1; v++) o *= n[v], d.push(o);
1691
- const p = [];
1691
+ const m = [];
1692
1692
  for (let v = 0; v < s; v++) {
1693
- const m = {};
1693
+ const p = {};
1694
1694
  for (let k = 0; k < t.length; k++) {
1695
1695
  const M = e[t[k]], U = Math.floor(v / d[k]) % M.length;
1696
- m[t[k]] = M[U];
1696
+ p[t[k]] = M[U];
1697
1697
  }
1698
- p.push(m);
1698
+ m.push(p);
1699
1699
  }
1700
- return p;
1700
+ return m;
1701
1701
  }
1702
1702
  function du(e) {
1703
1703
  return Object.values(e).filter((t) => t).length;
@@ -1707,9 +1707,9 @@ var li = {};
1707
1707
  }
1708
1708
  function jt(e, t, n, s, o) {
1709
1709
  if (!ce(t)) return t;
1710
- for (const [d, p] of Object.entries(t)) {
1710
+ for (const [d, m] of Object.entries(t)) {
1711
1711
  const v = fu(n, d, s);
1712
- Array.isArray(p) ? o ? jt(e, p, v, !0, o) : e[v] = p.map((m) => jt(Array.isArray(m) ? [] : {}, m, "", !1, o)) : ce(p) ? jt(e, p, v, !1, o) : e[v] = p;
1712
+ Array.isArray(m) ? o ? jt(e, m, v, !0, o) : e[v] = m.map((p) => jt(Array.isArray(p) ? [] : {}, p, "", !1, o)) : ce(m) ? jt(e, m, v, !1, o) : e[v] = m;
1713
1713
  }
1714
1714
  return e;
1715
1715
  }
@@ -1727,7 +1727,7 @@ var li = {};
1727
1727
  ) : ve(t, n, s);
1728
1728
  return t;
1729
1729
  }
1730
- function pu(e, t, n) {
1730
+ function mu(e, t, n) {
1731
1731
  return t[e] ? t[e] : n;
1732
1732
  }
1733
1733
  function Ss(e, t) {
@@ -1738,7 +1738,7 @@ var li = {};
1738
1738
  }
1739
1739
  return n;
1740
1740
  }
1741
- function mu(e, t) {
1741
+ function pu(e, t) {
1742
1742
  const n = {};
1743
1743
  for (const s of e) {
1744
1744
  const o = t(s);
@@ -1769,9 +1769,9 @@ var li = {};
1769
1769
  return Object.values(Ss(e, t));
1770
1770
  }
1771
1771
  function wu(e, t, n, s, o) {
1772
- const d = t ? e.map(t) : e, p = {};
1773
- for (const m of d) p[m] = (p[m] || 0) + 1;
1774
- const v = s ? Os(p, o ? (m, k) => m[1] - k[1] : (m, k) => k[1] - m[1]) : p;
1772
+ const d = t ? e.map(t) : e, m = {};
1773
+ for (const p of d) m[p] = (m[p] || 0) + 1;
1774
+ const v = s ? Os(m, o ? (p, k) => p[1] - k[1] : (p, k) => k[1] - p[1]) : m;
1775
1775
  return n ? Object.keys(v) : v;
1776
1776
  }
1777
1777
  function Os(e, t) {
@@ -1781,7 +1781,7 @@ var li = {};
1781
1781
  const t = [], n = Object.keys(e), s = e[n[0]].length;
1782
1782
  for (let o = 0; o < s; o++) {
1783
1783
  const d = {};
1784
- for (const p of n) d[p] = e[p][o];
1784
+ for (const m of n) d[m] = e[m][o];
1785
1785
  t.push(d);
1786
1786
  }
1787
1787
  return t;
@@ -1917,26 +1917,26 @@ var li = {};
1917
1917
  }
1918
1918
  }
1919
1919
  function Uu(e, t, n, s, o = !1) {
1920
- const d = /* @__PURE__ */ new Map(), p = [];
1921
- e.forEach((m) => {
1922
- const k = new Du(m);
1923
- d.set(m[t], k);
1924
- }), e.forEach((m) => {
1925
- const k = d.get(m[t]);
1920
+ const d = /* @__PURE__ */ new Map(), m = [];
1921
+ e.forEach((p) => {
1922
+ const k = new Du(p);
1923
+ d.set(p[t], k);
1924
+ }), e.forEach((p) => {
1925
+ const k = d.get(p[t]);
1926
1926
  if (!k) return;
1927
- const M = m[n];
1927
+ const M = p[n];
1928
1928
  if (M) {
1929
1929
  const U = d.get(M);
1930
1930
  U && U.children.push(k);
1931
- } else p.push(k);
1931
+ } else m.push(k);
1932
1932
  });
1933
- const v = (m) => {
1934
- m.children.sort((k, M) => {
1933
+ const v = (p) => {
1934
+ p.children.sort((k, M) => {
1935
1935
  const U = k.value[s], je = M.value[s];
1936
1936
  return o ? je - U : U - je;
1937
- }), m.children.forEach(v);
1937
+ }), p.children.forEach(v);
1938
1938
  };
1939
- return p.forEach(v), p;
1939
+ return m.forEach(v), m;
1940
1940
  }
1941
1941
  function Ms(e, t) {
1942
1942
  if (Math.log2(e.length) % 1 !== 0) throw new Error("Array length must be a power of 2");
@@ -2079,10 +2079,10 @@ var li = {};
2079
2079
  ];
2080
2080
  function qu(e) {
2081
2081
  for (let t = 0; t < 24; t++) {
2082
- const n = e[0] ^ e[10] ^ e[20] ^ e[30] ^ e[40], s = e[1] ^ e[11] ^ e[21] ^ e[31] ^ e[41], o = e[2] ^ e[12] ^ e[22] ^ e[32] ^ e[42], d = e[3] ^ e[13] ^ e[23] ^ e[33] ^ e[43], p = e[4] ^ e[14] ^ e[24] ^ e[34] ^ e[44], v = e[5] ^ e[15] ^ e[25] ^ e[35] ^ e[45], m = e[6] ^ e[16] ^ e[26] ^ e[36] ^ e[46], k = e[7] ^ e[17] ^ e[27] ^ e[37] ^ e[47], M = e[8] ^ e[18] ^ e[28] ^ e[38] ^ e[48], U = e[9] ^ e[19] ^ e[29] ^ e[39] ^ e[49], je = o << 1 | d >>> 31, Il = d << 1 | o >>> 31, Xe = M ^ je, et = U ^ Il, Ml = p << 1 | v >>> 31, $l = v << 1 | p >>> 31, tt = n ^ Ml, rt = s ^ $l, Rl = m << 1 | k >>> 31, Cl = k << 1 | m >>> 31, nt = o ^ Rl, st = d ^ Cl, Nl = M << 1 | U >>> 31, jl = U << 1 | M >>> 31, it = p ^ Nl, at = v ^ jl, Dl = n << 1 | s >>> 31, Ul = s << 1 | n >>> 31, ot = m ^ Dl, ct = k ^ Ul;
2082
+ const n = e[0] ^ e[10] ^ e[20] ^ e[30] ^ e[40], s = e[1] ^ e[11] ^ e[21] ^ e[31] ^ e[41], o = e[2] ^ e[12] ^ e[22] ^ e[32] ^ e[42], d = e[3] ^ e[13] ^ e[23] ^ e[33] ^ e[43], m = e[4] ^ e[14] ^ e[24] ^ e[34] ^ e[44], v = e[5] ^ e[15] ^ e[25] ^ e[35] ^ e[45], p = e[6] ^ e[16] ^ e[26] ^ e[36] ^ e[46], k = e[7] ^ e[17] ^ e[27] ^ e[37] ^ e[47], M = e[8] ^ e[18] ^ e[28] ^ e[38] ^ e[48], U = e[9] ^ e[19] ^ e[29] ^ e[39] ^ e[49], je = o << 1 | d >>> 31, Il = d << 1 | o >>> 31, Xe = M ^ je, et = U ^ Il, Ml = m << 1 | v >>> 31, $l = v << 1 | m >>> 31, tt = n ^ Ml, rt = s ^ $l, Rl = p << 1 | k >>> 31, Cl = k << 1 | p >>> 31, nt = o ^ Rl, st = d ^ Cl, Nl = M << 1 | U >>> 31, jl = U << 1 | M >>> 31, it = m ^ Nl, at = v ^ jl, Dl = n << 1 | s >>> 31, Ul = s << 1 | n >>> 31, ot = p ^ Dl, ct = k ^ Ul;
2083
2083
  e[0] ^= Xe, e[1] ^= et, e[2] ^= tt, e[3] ^= rt, e[4] ^= nt, e[5] ^= st, e[6] ^= it, e[7] ^= at, e[8] ^= ot, e[9] ^= ct, e[10] ^= Xe, e[11] ^= et, e[12] ^= tt, e[13] ^= rt, e[14] ^= nt, e[15] ^= st, e[16] ^= it, e[17] ^= at, e[18] ^= ot, e[19] ^= ct, e[20] ^= Xe, e[21] ^= et, e[22] ^= tt, e[23] ^= rt, e[24] ^= nt, e[25] ^= st, e[26] ^= it, e[27] ^= at, e[28] ^= ot, e[29] ^= ct, e[30] ^= Xe, e[31] ^= et, e[32] ^= tt, e[33] ^= rt, e[34] ^= nt, e[35] ^= st, e[36] ^= it, e[37] ^= at, e[38] ^= ot, e[39] ^= ct, e[40] ^= Xe, e[41] ^= et, e[42] ^= tt, e[43] ^= rt, e[44] ^= nt, e[45] ^= st, e[46] ^= it, e[47] ^= at, e[48] ^= ot, e[49] ^= ct;
2084
- const Sr = e[0], Tr = e[1], Ar = e[2] << 1 | e[3] >>> 31, Or = e[3] << 1 | e[2] >>> 31, Ir = e[5] << 30 | e[4] >>> 2, Mr = e[4] << 30 | e[5] >>> 2, $r = e[6] << 28 | e[7] >>> 4, Rr = e[7] << 28 | e[6] >>> 4, Cr = e[8] << 27 | e[9] >>> 5, Nr = e[9] << 27 | e[8] >>> 5, jr = e[11] << 4 | e[10] >>> 28, Dr = e[10] << 4 | e[11] >>> 28, Ur = e[13] << 12 | e[12] >>> 20, Pr = e[12] << 12 | e[13] >>> 20, Zr = e[14] << 6 | e[15] >>> 26, Br = e[15] << 6 | e[14] >>> 26, Lr = e[17] << 23 | e[16] >>> 9, zr = e[16] << 23 | e[17] >>> 9, Vr = e[18] << 20 | e[19] >>> 12, Fr = e[19] << 20 | e[18] >>> 12, Wr = e[20] << 3 | e[21] >>> 29, Hr = e[21] << 3 | e[20] >>> 29, qr = e[22] << 10 | e[23] >>> 22, Gr = e[23] << 10 | e[22] >>> 22, Jr = e[25] << 11 | e[24] >>> 21, Kr = e[24] << 11 | e[25] >>> 21, Yr = e[26] << 25 | e[27] >>> 7, Qr = e[27] << 25 | e[26] >>> 7, Xr = e[29] << 7 | e[28] >>> 25, en = e[28] << 7 | e[29] >>> 25, tn = e[31] << 9 | e[30] >>> 23, rn = e[30] << 9 | e[31] >>> 23, nn = e[33] << 13 | e[32] >>> 19, sn = e[32] << 13 | e[33] >>> 19, an = e[34] << 15 | e[35] >>> 17, on = e[35] << 15 | e[34] >>> 17, cn = e[36] << 21 | e[37] >>> 11, un = e[37] << 21 | e[36] >>> 11, ln = e[38] << 8 | e[39] >>> 24, dn = e[39] << 8 | e[38] >>> 24, fn = e[40] << 18 | e[41] >>> 14, hn = e[41] << 18 | e[40] >>> 14, pn = e[42] << 2 | e[43] >>> 30, mn = e[43] << 2 | e[42] >>> 30, gn = e[45] << 29 | e[44] >>> 3, yn = e[44] << 29 | e[45] >>> 3, vn = e[47] << 24 | e[46] >>> 8, wn = e[46] << 24 | e[47] >>> 8, bn = e[48] << 14 | e[49] >>> 18, _n = e[49] << 14 | e[48] >>> 18;
2085
- e[0] = Sr ^ ~Ur & Jr, e[1] = Tr ^ ~Pr & Kr, e[2] = Ur ^ ~Jr & cn, e[3] = Pr ^ ~Kr & un, e[4] = Jr ^ ~cn & bn, e[5] = Kr ^ ~un & _n, e[6] = cn ^ ~bn & Sr, e[7] = un ^ ~_n & Tr, e[8] = bn ^ ~Sr & Ur, e[9] = _n ^ ~Tr & Pr, e[10] = $r ^ ~Vr & Wr, e[11] = Rr ^ ~Fr & Hr, e[12] = Vr ^ ~Wr & nn, e[13] = Fr ^ ~Hr & sn, e[14] = Wr ^ ~nn & gn, e[15] = Hr ^ ~sn & yn, e[16] = nn ^ ~gn & $r, e[17] = sn ^ ~yn & Rr, e[18] = gn ^ ~$r & Vr, e[19] = yn ^ ~Rr & Fr, e[20] = Ar ^ ~Zr & Yr, e[21] = Or ^ ~Br & Qr, e[22] = Zr ^ ~Yr & ln, e[23] = Br ^ ~Qr & dn, e[24] = Yr ^ ~ln & fn, e[25] = Qr ^ ~dn & hn, e[26] = ln ^ ~fn & Ar, e[27] = dn ^ ~hn & Or, e[28] = fn ^ ~Ar & Zr, e[29] = hn ^ ~Or & Br, e[30] = Cr ^ ~jr & qr, e[31] = Nr ^ ~Dr & Gr, e[32] = jr ^ ~qr & an, e[33] = Dr ^ ~Gr & on, e[34] = qr ^ ~an & vn, e[35] = Gr ^ ~on & wn, e[36] = an ^ ~vn & Cr, e[37] = on ^ ~wn & Nr, e[38] = vn ^ ~Cr & jr, e[39] = wn ^ ~Nr & Dr, e[40] = Ir ^ ~Lr & Xr, e[41] = Mr ^ ~zr & en, e[42] = Lr ^ ~Xr & tn, e[43] = zr ^ ~en & rn, e[44] = Xr ^ ~tn & pn, e[45] = en ^ ~rn & mn, e[46] = tn ^ ~pn & Ir, e[47] = rn ^ ~mn & Mr, e[48] = pn ^ ~Ir & Lr, e[49] = mn ^ ~Mr & zr, e[0] ^= Ns[t * 2], e[1] ^= Ns[t * 2 + 1];
2084
+ const Sr = e[0], Tr = e[1], Ar = e[2] << 1 | e[3] >>> 31, Or = e[3] << 1 | e[2] >>> 31, Ir = e[5] << 30 | e[4] >>> 2, Mr = e[4] << 30 | e[5] >>> 2, $r = e[6] << 28 | e[7] >>> 4, Rr = e[7] << 28 | e[6] >>> 4, Cr = e[8] << 27 | e[9] >>> 5, Nr = e[9] << 27 | e[8] >>> 5, jr = e[11] << 4 | e[10] >>> 28, Dr = e[10] << 4 | e[11] >>> 28, Ur = e[13] << 12 | e[12] >>> 20, Pr = e[12] << 12 | e[13] >>> 20, Zr = e[14] << 6 | e[15] >>> 26, Br = e[15] << 6 | e[14] >>> 26, Lr = e[17] << 23 | e[16] >>> 9, zr = e[16] << 23 | e[17] >>> 9, Vr = e[18] << 20 | e[19] >>> 12, Fr = e[19] << 20 | e[18] >>> 12, Wr = e[20] << 3 | e[21] >>> 29, Hr = e[21] << 3 | e[20] >>> 29, qr = e[22] << 10 | e[23] >>> 22, Gr = e[23] << 10 | e[22] >>> 22, Jr = e[25] << 11 | e[24] >>> 21, Kr = e[24] << 11 | e[25] >>> 21, Yr = e[26] << 25 | e[27] >>> 7, Qr = e[27] << 25 | e[26] >>> 7, Xr = e[29] << 7 | e[28] >>> 25, en = e[28] << 7 | e[29] >>> 25, tn = e[31] << 9 | e[30] >>> 23, rn = e[30] << 9 | e[31] >>> 23, nn = e[33] << 13 | e[32] >>> 19, sn = e[32] << 13 | e[33] >>> 19, an = e[34] << 15 | e[35] >>> 17, on = e[35] << 15 | e[34] >>> 17, cn = e[36] << 21 | e[37] >>> 11, un = e[37] << 21 | e[36] >>> 11, ln = e[38] << 8 | e[39] >>> 24, dn = e[39] << 8 | e[38] >>> 24, fn = e[40] << 18 | e[41] >>> 14, hn = e[41] << 18 | e[40] >>> 14, mn = e[42] << 2 | e[43] >>> 30, pn = e[43] << 2 | e[42] >>> 30, gn = e[45] << 29 | e[44] >>> 3, yn = e[44] << 29 | e[45] >>> 3, vn = e[47] << 24 | e[46] >>> 8, wn = e[46] << 24 | e[47] >>> 8, bn = e[48] << 14 | e[49] >>> 18, _n = e[49] << 14 | e[48] >>> 18;
2085
+ e[0] = Sr ^ ~Ur & Jr, e[1] = Tr ^ ~Pr & Kr, e[2] = Ur ^ ~Jr & cn, e[3] = Pr ^ ~Kr & un, e[4] = Jr ^ ~cn & bn, e[5] = Kr ^ ~un & _n, e[6] = cn ^ ~bn & Sr, e[7] = un ^ ~_n & Tr, e[8] = bn ^ ~Sr & Ur, e[9] = _n ^ ~Tr & Pr, e[10] = $r ^ ~Vr & Wr, e[11] = Rr ^ ~Fr & Hr, e[12] = Vr ^ ~Wr & nn, e[13] = Fr ^ ~Hr & sn, e[14] = Wr ^ ~nn & gn, e[15] = Hr ^ ~sn & yn, e[16] = nn ^ ~gn & $r, e[17] = sn ^ ~yn & Rr, e[18] = gn ^ ~$r & Vr, e[19] = yn ^ ~Rr & Fr, e[20] = Ar ^ ~Zr & Yr, e[21] = Or ^ ~Br & Qr, e[22] = Zr ^ ~Yr & ln, e[23] = Br ^ ~Qr & dn, e[24] = Yr ^ ~ln & fn, e[25] = Qr ^ ~dn & hn, e[26] = ln ^ ~fn & Ar, e[27] = dn ^ ~hn & Or, e[28] = fn ^ ~Ar & Zr, e[29] = hn ^ ~Or & Br, e[30] = Cr ^ ~jr & qr, e[31] = Nr ^ ~Dr & Gr, e[32] = jr ^ ~qr & an, e[33] = Dr ^ ~Gr & on, e[34] = qr ^ ~an & vn, e[35] = Gr ^ ~on & wn, e[36] = an ^ ~vn & Cr, e[37] = on ^ ~wn & Nr, e[38] = vn ^ ~Cr & jr, e[39] = wn ^ ~Nr & Dr, e[40] = Ir ^ ~Lr & Xr, e[41] = Mr ^ ~zr & en, e[42] = Lr ^ ~Xr & tn, e[43] = zr ^ ~en & rn, e[44] = Xr ^ ~tn & mn, e[45] = en ^ ~rn & pn, e[46] = tn ^ ~mn & Ir, e[47] = rn ^ ~pn & Mr, e[48] = mn ^ ~Ir & Lr, e[49] = pn ^ ~Mr & zr, e[0] ^= Ns[t * 2], e[1] ^= Ns[t * 2 + 1];
2086
2086
  }
2087
2087
  }
2088
2088
  function js(e) {
@@ -2159,7 +2159,7 @@ var li = {};
2159
2159
  const s = Math.min(e.length, t.length, n / 8 + 1);
2160
2160
  for (let o = 0; o < s; o++) {
2161
2161
  const d = e[o] ^ t[o];
2162
- for (let p = 0; p < 8; p++) if (d >> 7 - p & 1) return o * 8 + p;
2162
+ for (let m = 0; m < 8; m++) if (d >> 7 - m & 1) return o * 8 + m;
2163
2163
  }
2164
2164
  return n;
2165
2165
  }
@@ -2216,8 +2216,8 @@ var li = {};
2216
2216
  e = $(e, t);
2217
2217
  let [n, s] = [0n, 1n], [o, d] = [t, e];
2218
2218
  for (; d !== 0n; ) {
2219
- const p = o / d;
2220
- [n, s] = [s, n - p * s], [o, d] = [d, o - p * d];
2219
+ const m = o / d;
2220
+ [n, s] = [s, n - m * s], [o, d] = [d, o - m * d];
2221
2221
  }
2222
2222
  if (o > 1n) throw new Error("a is not invertible");
2223
2223
  return n < 0n && (n += t), n;
@@ -2241,8 +2241,8 @@ var li = {};
2241
2241
  if (n === 0n && s === 0n) return [e, t];
2242
2242
  if (e === n && t === $(-s, o)) return [0n, 0n];
2243
2243
  if (e === n && t === s) return br(e, t, o);
2244
- const d = $((s - t) * Ye(n - e, o), o), p = $(d * d - e - n, o), v = $(d * (e - p) - t, o);
2245
- return [p, v];
2244
+ const d = $((s - t) * Ye(n - e, o), o), m = $(d * d - e - n, o), v = $(d * (e - m) - t, o);
2245
+ return [m, v];
2246
2246
  }
2247
2247
  function il(e) {
2248
2248
  if (e <= 0n || e >= D) throw new Error("Invalid private key");
@@ -2271,8 +2271,8 @@ var li = {};
2271
2271
  }
2272
2272
  function xe(e, t, n, s) {
2273
2273
  let o = [0n, 0n], d = [e, t];
2274
- const p = n.toString(2);
2275
- for (const v of p)
2274
+ const m = n.toString(2);
2275
+ for (const v of m)
2276
2276
  v === "0" ? (d = Pt(o[0], o[1], d[0], d[1], s), o = br(o[0], o[1], s)) : (o = Pt(o[0], o[1], d[0], d[1], s), d = br(d[0], d[1], s));
2277
2277
  return o;
2278
2278
  }
@@ -2290,19 +2290,19 @@ var li = {};
2290
2290
  )), n <= 0n || n >= D)
2291
2291
  throw new Error("Invalid nonce");
2292
2292
  const s = $(e, D), o = xe(Dt, Ut, n, Z), d = $(o[0], D);
2293
- let p = $((s + $(d, D) * t) * Ye(n, D), D);
2294
- if (d === 0n || p === 0n) throw new Error("Invalid r or s value");
2293
+ let m = $((s + $(d, D) * t) * Ye(n, D), D);
2294
+ if (d === 0n || m === 0n) throw new Error("Invalid r or s value");
2295
2295
  let v = o[1] % 2n === 0n ? 27n : 28n;
2296
- return p > D / 2n && (p = D - p, v = v === 27n ? 28n : 27n), [d, p, v];
2296
+ return m > D / 2n && (m = D - m, v = v === 27n ? 28n : 27n), [d, m, v];
2297
2297
  }
2298
2298
  function dl(e, t, n, s) {
2299
2299
  const o = Ls($(t ** 3n + 7n, Z), Z);
2300
2300
  if (!o) throw new Error("Invalid r: does not correspond to a valid curve point");
2301
- const d = s === 27n ? 0n : 1n, p = o % 2n === d ? o : Z - o, v = $(Ne(se(e), "BE"), D), m = xe(t, p, n, Z), k = xe(Dt, Ut, v, Z), M = Pt(m[0], m[1], k[0], $(-k[1], Z), Z);
2301
+ const d = s === 27n ? 0n : 1n, m = o % 2n === d ? o : Z - o, v = $(Ne(se(e), "BE"), D), p = xe(t, m, n, Z), k = xe(Dt, Ut, v, Z), M = Pt(p[0], p[1], k[0], $(-k[1], Z), Z);
2302
2302
  return xe(M[0], M[1], Ye(t, D), Z);
2303
2303
  }
2304
2304
  function fl(e, t, n, s) {
2305
- const o = $(Ne(se(e), "BE"), D), d = Ye(s, D), p = $(o * d, D), v = $(n * d, D), m = xe(Dt, Ut, p, Z), k = xe(t[0], t[1], v, Z), M = Pt(m[0], m[1], k[0], k[1], Z);
2305
+ const o = $(Ne(se(e), "BE"), D), d = Ye(s, D), m = $(o * d, D), v = $(n * d, D), p = xe(Dt, Ut, m, Z), k = xe(t[0], t[1], v, Z), M = Pt(p[0], p[1], k[0], k[1], Z);
2306
2306
  return n === $(M[0], D);
2307
2307
  }
2308
2308
  class Vs {
@@ -2429,24 +2429,24 @@ var li = {};
2429
2429
  const o = e.findIndex((v) => v === `--${t}` || v.startsWith(`--${t}=`)), d = e[o];
2430
2430
  if (!d) return (n || {})[s || t || ""] || null;
2431
2431
  if (d.includes("=")) return d.split("=")[1];
2432
- const p = e[o + 1];
2433
- return p && !p.startsWith("-") ? p : (n || {})[s || t || ""] || null;
2432
+ const m = e[o + 1];
2433
+ return m && !m.startsWith("-") ? m : (n || {})[s || t || ""] || null;
2434
2434
  }
2435
- function pl(e, t, n, s) {
2435
+ function ml(e, t, n, s) {
2436
2436
  const o = Bt(e, t, n, s);
2437
2437
  if (!o) return null;
2438
2438
  try {
2439
- return mr(o);
2439
+ return pr(o);
2440
2440
  } catch {
2441
2441
  throw new Error(`Invalid number argument ${t}: ${o}`);
2442
2442
  }
2443
2443
  }
2444
- function ml(e, t, n, s) {
2445
- const o = e.some((m) => m.endsWith("-" + t)), d = Bt(e, t, n, s);
2444
+ function pl(e, t, n, s) {
2445
+ const o = e.some((p) => p.endsWith("-" + t)), d = Bt(e, t, n, s);
2446
2446
  if (!d && o) return !0;
2447
2447
  if (!d && !o) return null;
2448
- const p = ["true", "1", "yes", "y", "on"], v = ["false", "0", "no", "n", "off"];
2449
- if (p.includes(d.toLowerCase())) return !0;
2448
+ const m = ["true", "1", "yes", "y", "on"], v = ["false", "0", "no", "n", "off"];
2449
+ if (m.includes(d.toLowerCase())) return !0;
2450
2450
  if (v.includes(d.toLowerCase())) return !1;
2451
2451
  throw Error(`Invalid boolean argument ${t}: ${d}`);
2452
2452
  }
@@ -2458,7 +2458,7 @@ var li = {};
2458
2458
  function gl(e, t, n, s) {
2459
2459
  const o = Ws(e, t, n, s);
2460
2460
  try {
2461
- return mr(o);
2461
+ return pr(o);
2462
2462
  } catch {
2463
2463
  throw new Error(`Invalid argument ${t}: ${o}`);
2464
2464
  }
@@ -2520,9 +2520,9 @@ var li = {};
2520
2520
  return !e[t][n + 1];
2521
2521
  }
2522
2522
  function xl(e, t, n) {
2523
- var o, d, p, v, m, k, M, U;
2523
+ var o, d, m, v, p, k, M, U;
2524
2524
  const s = [];
2525
- return e[t][n] ? bl(e, t, n) || _l(e, t, n) ? [] : (!((o = e[t - 1]) != null && o[n - 1]) && Ks(e, t, n) && Qs(e, t, n) && s.push({ x: t, y: n }), !((d = e[t + 1]) != null && d[n - 1]) && Ys(e, t, n) && Qs(e, t, n) && s.push({ x: t + 1, y: n }), !((p = e[t - 1]) != null && p[n + 1]) && Ks(e, t, n) && Xs(e, t, n) && s.push({ x: t, y: n + 1 }), !((v = e[t + 1]) != null && v[n + 1]) && Ys(e, t, n) && Xs(e, t, n) && s.push({ x: t + 1, y: n + 1 }), s) : ((m = e[t - 1]) != null && m[n] && e[t][n - 1] && s.push({ x: t, y: n }), (k = e[t + 1]) != null && k[n] && e[t][n - 1] && s.push({ x: t + 1, y: n }), (M = e[t - 1]) != null && M[n] && e[t][n + 1] && s.push({ x: t, y: n + 1 }), (U = e[t + 1]) != null && U[n] && e[t][n + 1] && s.push({ x: t + 1, y: n + 1 }), s);
2525
+ return e[t][n] ? bl(e, t, n) || _l(e, t, n) ? [] : (!((o = e[t - 1]) != null && o[n - 1]) && Ks(e, t, n) && Qs(e, t, n) && s.push({ x: t, y: n }), !((d = e[t + 1]) != null && d[n - 1]) && Ys(e, t, n) && Qs(e, t, n) && s.push({ x: t + 1, y: n }), !((m = e[t - 1]) != null && m[n + 1]) && Ks(e, t, n) && Xs(e, t, n) && s.push({ x: t, y: n + 1 }), !((v = e[t + 1]) != null && v[n + 1]) && Ys(e, t, n) && Xs(e, t, n) && s.push({ x: t + 1, y: n + 1 }), s) : ((p = e[t - 1]) != null && p[n] && e[t][n - 1] && s.push({ x: t, y: n }), (k = e[t + 1]) != null && k[n] && e[t][n - 1] && s.push({ x: t + 1, y: n }), (M = e[t - 1]) != null && M[n] && e[t][n + 1] && s.push({ x: t, y: n + 1 }), (U = e[t + 1]) != null && U[n] && e[t][n + 1] && s.push({ x: t + 1, y: n + 1 }), s);
2526
2526
  }
2527
2527
  function kl(e, t, n, s) {
2528
2528
  const o = [
@@ -2532,41 +2532,41 @@ var li = {};
2532
2532
  { x: n, y: s }
2533
2533
  ];
2534
2534
  for (let d = 0; d < e.length; d++)
2535
- for (let p = 0; p < e[0].length; p++) {
2536
- const v = xl(e, d, p);
2537
- for (const m of v) o.some((k) => k.x === m.x && k.y === m.y) || o.push(m);
2535
+ for (let m = 0; m < e[0].length; m++) {
2536
+ const v = xl(e, d, m);
2537
+ for (const p of v) o.some((k) => k.x === p.x && k.y === p.y) || o.push(p);
2538
2538
  }
2539
2539
  return o.map((d) => ({ x: d.x * t, y: d.y * t }));
2540
2540
  }
2541
2541
  function El(e, t) {
2542
- const n = Qe(e, (m, k) => e[m][k] === 0 && e[m][k + 1] !== 0, "row-first").map((m) => ({
2543
- ...m,
2542
+ const n = Qe(e, (p, k) => e[p][k] === 0 && e[p][k + 1] !== 0, "row-first").map((p) => ({
2543
+ ...p,
2544
2544
  dx: 1,
2545
2545
  dy: 0
2546
- })), s = Qe(e, (m, k) => e[m][k] === 0 && e[m][k - 1] !== 0, "row-first").map((m) => ({
2547
- ...m,
2546
+ })), s = Qe(e, (p, k) => e[p][k] === 0 && e[p][k - 1] !== 0, "row-first").map((p) => ({
2547
+ ...p,
2548
2548
  dx: 1,
2549
2549
  dy: 0
2550
- })), o = Qe(e, (m, k) => {
2550
+ })), o = Qe(e, (p, k) => {
2551
2551
  var M;
2552
- return e[m][k] === 0 && ((M = e[m - 1]) == null ? void 0 : M[k]) !== 0;
2553
- }, "column-first").map((m) => ({
2554
- ...m,
2552
+ return e[p][k] === 0 && ((M = e[p - 1]) == null ? void 0 : M[k]) !== 0;
2553
+ }, "column-first").map((p) => ({
2554
+ ...p,
2555
2555
  dx: 0,
2556
2556
  dy: 1
2557
- })), d = Qe(e, (m, k) => {
2557
+ })), d = Qe(e, (p, k) => {
2558
2558
  var M;
2559
- return e[m][k] === 0 && ((M = e[m + 1]) == null ? void 0 : M[k]) !== 0;
2560
- }, "column-first").map((m) => ({
2561
- ...m,
2559
+ return e[p][k] === 0 && ((M = e[p + 1]) == null ? void 0 : M[k]) !== 0;
2560
+ }, "column-first").map((p) => ({
2561
+ ...p,
2562
2562
  dx: 0,
2563
2563
  dy: 1
2564
2564
  }));
2565
- n.forEach((m) => m.y++), d.forEach((m) => m.x++);
2566
- const p = yr([...o, ...d], (m, k) => m.x === k.x && m.y - 1 === k.y), v = yr([...s, ...n], (m, k) => m.y === k.y && m.x - 1 === k.x);
2567
- return [...p, ...v].map((m) => ({ start: m[0], end: qe(m) })).map((m) => ({
2568
- start: xr(m.start, t),
2569
- end: xr(qs(m.end, { x: m.start.dx, y: m.start.dy }), t)
2565
+ n.forEach((p) => p.y++), d.forEach((p) => p.x++);
2566
+ const m = yr([...o, ...d], (p, k) => p.x === k.x && p.y - 1 === k.y), v = yr([...s, ...n], (p, k) => p.y === k.y && p.x - 1 === k.x);
2567
+ return [...m, ...v].map((p) => ({ start: p[0], end: qe(p) })).map((p) => ({
2568
+ start: xr(p.start, t),
2569
+ end: xr(qs(p.end, { x: p.start.dx, y: p.start.dy }), t)
2570
2570
  }));
2571
2571
  }
2572
2572
  function Sl(e, t) {
@@ -2578,26 +2578,26 @@ var li = {};
2578
2578
  function ei(e, t, n, s) {
2579
2579
  const o = (s.y - n.y) * (t.x - e.x) - (s.x - n.x) * (t.y - e.y);
2580
2580
  if (o === 0) return null;
2581
- let d = e.y - n.y, p = e.x - n.x;
2582
- const v = (s.x - n.x) * d - (s.y - n.y) * p, m = (t.x - e.x) * d - (t.y - e.y) * p;
2583
- return d = v / o, p = m / o, d > 0 && d < 1 && p > 0 && p < 1 ? { x: e.x + d * (t.x - e.x), y: e.y + d * (t.y - e.y) } : null;
2581
+ let d = e.y - n.y, m = e.x - n.x;
2582
+ const v = (s.x - n.x) * d - (s.y - n.y) * m, p = (t.x - e.x) * d - (t.y - e.y) * m;
2583
+ return d = v / o, m = p / o, d > 0 && d < 1 && m > 0 && m < 1 ? { x: e.x + d * (t.x - e.x), y: e.y + d * (t.y - e.y) } : null;
2584
2584
  }
2585
2585
  function kr(e, t, n) {
2586
2586
  const s = [], o = Gs(e, n, 1e4);
2587
2587
  for (const d of t) {
2588
- const p = ei(e, o, d.start, d.end);
2589
- p && s.push(p);
2588
+ const m = ei(e, o, d.start, d.end);
2589
+ m && s.push(m);
2590
2590
  }
2591
- return s.length ? s.reduce((d, p) => {
2592
- const v = Js(e, p), m = Js(e, d);
2593
- return v < m ? p : d;
2591
+ return s.length ? s.reduce((d, m) => {
2592
+ const v = Js(e, m), p = Js(e, d);
2593
+ return v < p ? m : d;
2594
2594
  }) : null;
2595
2595
  }
2596
2596
  function Al(e, t, n) {
2597
2597
  const s = Tl(e, n), o = [];
2598
2598
  for (const d of s) {
2599
- const p = kr(e, t, d - 1e-3), v = kr(e, t, d + 1e-3);
2600
- p && o.push(p), v && o.push(v);
2599
+ const m = kr(e, t, d - 1e-3), v = kr(e, t, d + 1e-3);
2600
+ m && o.push(m), v && o.push(v);
2601
2601
  }
2602
2602
  return o;
2603
2603
  }
@@ -2709,7 +2709,7 @@ var li = {};
2709
2709
  splitBySize: gu,
2710
2710
  splitByCount: Ts,
2711
2711
  index: Ss,
2712
- indexCollection: mu,
2712
+ indexCollection: pu,
2713
2713
  onlyOrThrow: h,
2714
2714
  onlyOrNull: g,
2715
2715
  firstOrThrow: x,
@@ -2744,8 +2744,8 @@ var li = {};
2744
2744
  organiseWithLimits: Lc,
2745
2745
  tickPlaybook: hl,
2746
2746
  getArgument: Bt,
2747
- getBooleanArgument: ml,
2748
- getNumberArgument: pl,
2747
+ getBooleanArgument: pl,
2748
+ getNumberArgument: ml,
2749
2749
  requireStringArgument: Ws,
2750
2750
  requireNumberArgument: gl,
2751
2751
  bringToFront: yl,
@@ -2758,7 +2758,7 @@ var li = {};
2758
2758
  multicall: Mu,
2759
2759
  maxBy: $u
2760
2760
  }, a.System = { sleepMillis: l, forever: Li, scheduleMany: Fa, waitFor: rc, expandError: Oa, runAndSetInterval: zi }, a.Numbers = {
2761
- make: mr,
2761
+ make: pr,
2762
2762
  sum: Ha,
2763
2763
  average: qa,
2764
2764
  median: Ga,
@@ -2785,9 +2785,9 @@ var li = {};
2785
2785
  getTimestamp: fc,
2786
2786
  getTimeDelta: gs,
2787
2787
  secondsToHumanTime: hc,
2788
- countCycles: pc,
2788
+ countCycles: mc,
2789
2789
  isoDate: ac,
2790
- throttle: mc,
2790
+ throttle: pc,
2791
2791
  timeSince: yc,
2792
2792
  dateTimeSlug: oc,
2793
2793
  unixTimestamp: ic,
@@ -2834,7 +2834,7 @@ var li = {};
2834
2834
  removeEmptyValues: tu,
2835
2835
  flatten: hu,
2836
2836
  unflatten: Es,
2837
- match: pu,
2837
+ match: mu,
2838
2838
  sort: Os,
2839
2839
  map: su,
2840
2840
  mapIterable: iu,
@@ -2860,7 +2860,7 @@ var li = {};
2860
2860
  pickRandomKey: xs,
2861
2861
  mapRandomKey: Vc,
2862
2862
  fromObjectString: Fc,
2863
- toQueryString: ps,
2863
+ toQueryString: ms,
2864
2864
  parseQueryString: qo,
2865
2865
  hasKey: Go,
2866
2866
  selectMax: Jo,
@@ -2892,8 +2892,8 @@ var li = {};
2892
2892
  asFunction: fa,
2893
2893
  asInteger: nr,
2894
2894
  asBoolean: ha,
2895
- asDate: pa,
2896
- asNullableString: ma,
2895
+ asDate: ma,
2896
+ asNullableString: pa,
2897
2897
  asEmptiableString: ga,
2898
2898
  asId: ya,
2899
2899
  asTime: va,
@@ -2941,7 +2941,7 @@ var li = {};
2941
2941
  sortByFuzzyScore: io,
2942
2942
  splitOnce: or,
2943
2943
  splitAll: Yn,
2944
- randomize: mo,
2944
+ randomize: po,
2945
2945
  expand: Qn,
2946
2946
  shrinkTrim: Je,
2947
2947
  capitalize: Rt,
@@ -2953,7 +2953,7 @@ var li = {};
2953
2953
  getBasename: ur,
2954
2954
  normalizeEmail: fo,
2955
2955
  normalizeFilename: ho,
2956
- parseFilename: po,
2956
+ parseFilename: mo,
2957
2957
  camelToTitle: Xa,
2958
2958
  slugToTitle: eo,
2959
2959
  slugToCamel: to,
@@ -3102,7 +3102,15 @@ async function Tn(a, r = 3, i = 250) {
3102
3102
  });
3103
3103
  });
3104
3104
  }
3105
- class sd {
3105
+ async function sd(a, r, i = "Operation timed out") {
3106
+ return Promise.race([
3107
+ a,
3108
+ new Promise(
3109
+ (c, u) => setTimeout(() => u(new Error(i)), r)
3110
+ )
3111
+ ]);
3112
+ }
3113
+ class id {
3106
3114
  constructor() {
3107
3115
  this.events = {}, this.on = this.on.bind(this), this.off = this.off.bind(this), this.cleanAll = this.cleanAll.bind(this), this.emit = this.emit.bind(this);
3108
3116
  }
@@ -3224,7 +3232,7 @@ const _ = I.arrayToEnum([
3224
3232
  "invalid_intersection_types",
3225
3233
  "not_multiple_of",
3226
3234
  "not_finite"
3227
- ]), id = (a) => JSON.stringify(a, null, 2).replace(/"([^"]+)":/g, "$1:");
3235
+ ]), ad = (a) => JSON.stringify(a, null, 2).replace(/"([^"]+)":/g, "$1:");
3228
3236
  class V extends Error {
3229
3237
  get errors() {
3230
3238
  return this.issues;
@@ -3342,7 +3350,7 @@ const Le = (a, r) => {
3342
3350
  return { message: i };
3343
3351
  };
3344
3352
  let hi = Le;
3345
- function ad(a) {
3353
+ function od(a) {
3346
3354
  hi = a;
3347
3355
  }
3348
3356
  function zt() {
@@ -3368,7 +3376,7 @@ const Vt = (a) => {
3368
3376
  path: l,
3369
3377
  message: h
3370
3378
  };
3371
- }, od = [];
3379
+ }, cd = [];
3372
3380
  function b(a, r) {
3373
3381
  const i = zt(), c = Vt({
3374
3382
  issueData: r,
@@ -3435,7 +3443,7 @@ function Ft(a, r, i, c) {
3435
3443
  if (typeof r == "function" ? a !== r || !c : !r.has(a)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3436
3444
  return r.get(a);
3437
3445
  }
3438
- function pi(a, r, i, c, u) {
3446
+ function mi(a, r, i, c, u) {
3439
3447
  if (typeof r == "function" ? a !== r || !u : !r.has(a)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
3440
3448
  return r.set(a, i), i;
3441
3449
  }
@@ -3629,7 +3637,7 @@ class O {
3629
3637
  return X.create(this, this._def);
3630
3638
  }
3631
3639
  nullable() {
3632
- return me.create(this, this._def);
3640
+ return pe.create(this, this._def);
3633
3641
  }
3634
3642
  nullish() {
3635
3643
  return this.nullable().optional();
@@ -3699,26 +3707,26 @@ class O {
3699
3707
  return this.safeParse(null).success;
3700
3708
  }
3701
3709
  }
3702
- const cd = /^c[^\s-]{8,}$/i, ud = /^[0-9a-z]+$/, ld = /^[0-9A-HJKMNP-TV-Z]{26}$/i, dd = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, fd = /^[a-z0-9_-]{21}$/i, hd = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, pd = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, md = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, gd = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
3710
+ const ud = /^c[^\s-]{8,}$/i, ld = /^[0-9a-z]+$/, dd = /^[0-9A-HJKMNP-TV-Z]{26}$/i, fd = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, hd = /^[a-z0-9_-]{21}$/i, md = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, pd = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, gd = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, yd = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
3703
3711
  let Sn;
3704
- const yd = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, vd = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, wd = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, bd = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, _d = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, xd = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, mi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", kd = new RegExp(`^${mi}$`);
3712
+ const vd = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, wd = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, bd = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, _d = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, xd = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, kd = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, pi = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Ed = new RegExp(`^${pi}$`);
3705
3713
  function gi(a) {
3706
3714
  let r = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
3707
3715
  return a.precision ? r = `${r}\\.\\d{${a.precision}}` : a.precision == null && (r = `${r}(\\.\\d+)?`), r;
3708
3716
  }
3709
- function Ed(a) {
3717
+ function Sd(a) {
3710
3718
  return new RegExp(`^${gi(a)}$`);
3711
3719
  }
3712
3720
  function yi(a) {
3713
- let r = `${mi}T${gi(a)}`;
3721
+ let r = `${pi}T${gi(a)}`;
3714
3722
  const i = [];
3715
3723
  return i.push(a.local ? "Z?" : "Z"), a.offset && i.push("([+-]\\d{2}:?\\d{2})"), r = `${r}(${i.join("|")})`, new RegExp(`^${r}$`);
3716
3724
  }
3717
- function Sd(a, r) {
3718
- return !!((r === "v4" || !r) && yd.test(a) || (r === "v6" || !r) && wd.test(a));
3719
- }
3720
3725
  function Td(a, r) {
3721
- if (!hd.test(a))
3726
+ return !!((r === "v4" || !r) && vd.test(a) || (r === "v6" || !r) && bd.test(a));
3727
+ }
3728
+ function Ad(a, r) {
3729
+ if (!md.test(a))
3722
3730
  return !1;
3723
3731
  try {
3724
3732
  const [i] = a.split("."), c = i.replace(/-/g, "+").replace(/_/g, "/").padEnd(i.length + (4 - i.length % 4) % 4, "="), u = JSON.parse(atob(c));
@@ -3727,8 +3735,8 @@ function Td(a, r) {
3727
3735
  return !1;
3728
3736
  }
3729
3737
  }
3730
- function Ad(a, r) {
3731
- return !!((r === "v4" || !r) && vd.test(a) || (r === "v6" || !r) && bd.test(a));
3738
+ function Od(a, r) {
3739
+ return !!((r === "v4" || !r) && wd.test(a) || (r === "v6" || !r) && _d.test(a));
3732
3740
  }
3733
3741
  class q extends O {
3734
3742
  _parse(r) {
@@ -3779,43 +3787,43 @@ class q extends O {
3779
3787
  message: l.message
3780
3788
  }), c.dirty());
3781
3789
  } else if (l.kind === "email")
3782
- md.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3790
+ gd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3783
3791
  validation: "email",
3784
3792
  code: w.invalid_string,
3785
3793
  message: l.message
3786
3794
  }), c.dirty());
3787
3795
  else if (l.kind === "emoji")
3788
- Sn || (Sn = new RegExp(gd, "u")), Sn.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3796
+ Sn || (Sn = new RegExp(yd, "u")), Sn.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3789
3797
  validation: "emoji",
3790
3798
  code: w.invalid_string,
3791
3799
  message: l.message
3792
3800
  }), c.dirty());
3793
3801
  else if (l.kind === "uuid")
3794
- dd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3802
+ fd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3795
3803
  validation: "uuid",
3796
3804
  code: w.invalid_string,
3797
3805
  message: l.message
3798
3806
  }), c.dirty());
3799
3807
  else if (l.kind === "nanoid")
3800
- fd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3808
+ hd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3801
3809
  validation: "nanoid",
3802
3810
  code: w.invalid_string,
3803
3811
  message: l.message
3804
3812
  }), c.dirty());
3805
3813
  else if (l.kind === "cuid")
3806
- cd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3814
+ ud.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3807
3815
  validation: "cuid",
3808
3816
  code: w.invalid_string,
3809
3817
  message: l.message
3810
3818
  }), c.dirty());
3811
3819
  else if (l.kind === "cuid2")
3812
- ud.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3820
+ ld.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3813
3821
  validation: "cuid2",
3814
3822
  code: w.invalid_string,
3815
3823
  message: l.message
3816
3824
  }), c.dirty());
3817
3825
  else if (l.kind === "ulid")
3818
- ld.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3826
+ dd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3819
3827
  validation: "ulid",
3820
3828
  code: w.invalid_string,
3821
3829
  message: l.message
@@ -3850,11 +3858,11 @@ class q extends O {
3850
3858
  code: w.invalid_string,
3851
3859
  validation: "datetime",
3852
3860
  message: l.message
3853
- }), c.dirty()) : l.kind === "date" ? kd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3861
+ }), c.dirty()) : l.kind === "date" ? Ed.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3854
3862
  code: w.invalid_string,
3855
3863
  validation: "date",
3856
3864
  message: l.message
3857
- }), c.dirty()) : l.kind === "time" ? Ed(l).test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3865
+ }), c.dirty()) : l.kind === "time" ? Sd(l).test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3858
3866
  code: w.invalid_string,
3859
3867
  validation: "time",
3860
3868
  message: l.message
@@ -3862,23 +3870,23 @@ class q extends O {
3862
3870
  validation: "duration",
3863
3871
  code: w.invalid_string,
3864
3872
  message: l.message
3865
- }), c.dirty()) : l.kind === "ip" ? Sd(r.data, l.version) || (u = this._getOrReturnCtx(r, u), b(u, {
3873
+ }), c.dirty()) : l.kind === "ip" ? Td(r.data, l.version) || (u = this._getOrReturnCtx(r, u), b(u, {
3866
3874
  validation: "ip",
3867
3875
  code: w.invalid_string,
3868
3876
  message: l.message
3869
- }), c.dirty()) : l.kind === "jwt" ? Td(r.data, l.alg) || (u = this._getOrReturnCtx(r, u), b(u, {
3877
+ }), c.dirty()) : l.kind === "jwt" ? Ad(r.data, l.alg) || (u = this._getOrReturnCtx(r, u), b(u, {
3870
3878
  validation: "jwt",
3871
3879
  code: w.invalid_string,
3872
3880
  message: l.message
3873
- }), c.dirty()) : l.kind === "cidr" ? Ad(r.data, l.version) || (u = this._getOrReturnCtx(r, u), b(u, {
3881
+ }), c.dirty()) : l.kind === "cidr" ? Od(r.data, l.version) || (u = this._getOrReturnCtx(r, u), b(u, {
3874
3882
  validation: "cidr",
3875
3883
  code: w.invalid_string,
3876
3884
  message: l.message
3877
- }), c.dirty()) : l.kind === "base64" ? _d.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3885
+ }), c.dirty()) : l.kind === "base64" ? xd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3878
3886
  validation: "base64",
3879
3887
  code: w.invalid_string,
3880
3888
  message: l.message
3881
- }), c.dirty()) : l.kind === "base64url" ? xd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3889
+ }), c.dirty()) : l.kind === "base64url" ? kd.test(r.data) || (u = this._getOrReturnCtx(r, u), b(u, {
3882
3890
  validation: "base64url",
3883
3891
  code: w.invalid_string,
3884
3892
  message: l.message
@@ -4117,7 +4125,7 @@ q.create = (a) => {
4117
4125
  ...A(a)
4118
4126
  });
4119
4127
  };
4120
- function Od(a, r) {
4128
+ function Id(a, r) {
4121
4129
  const i = (a.toString().split(".")[1] || "").length, c = (r.toString().split(".")[1] || "").length, u = i > c ? i : c, l = parseInt(a.toFixed(u).replace(".", "")), f = parseInt(r.toFixed(u).replace(".", ""));
4122
4130
  return l % f / Math.pow(10, u);
4123
4131
  }
@@ -4156,7 +4164,7 @@ class fe extends O {
4156
4164
  inclusive: l.inclusive,
4157
4165
  exact: !1,
4158
4166
  message: l.message
4159
- }), u.dirty()) : l.kind === "multipleOf" ? Od(r.data, l.value) !== 0 && (c = this._getOrReturnCtx(r, c), b(c, {
4167
+ }), u.dirty()) : l.kind === "multipleOf" ? Id(r.data, l.value) !== 0 && (c = this._getOrReturnCtx(r, c), b(c, {
4160
4168
  code: w.not_multiple_of,
4161
4169
  multipleOf: l.value,
4162
4170
  message: l.message
@@ -4542,7 +4550,7 @@ Wt.create = (a) => new Wt({
4542
4550
  typeName: S.ZodSymbol,
4543
4551
  ...A(a)
4544
4552
  });
4545
- class pt extends O {
4553
+ class mt extends O {
4546
4554
  _parse(r) {
4547
4555
  if (this._getType(r) !== _.undefined) {
4548
4556
  const c = this._getOrReturnCtx(r);
@@ -4555,11 +4563,11 @@ class pt extends O {
4555
4563
  return z(r.data);
4556
4564
  }
4557
4565
  }
4558
- pt.create = (a) => new pt({
4566
+ mt.create = (a) => new mt({
4559
4567
  typeName: S.ZodUndefined,
4560
4568
  ...A(a)
4561
4569
  });
4562
- class mt extends O {
4570
+ class pt extends O {
4563
4571
  _parse(r) {
4564
4572
  if (this._getType(r) !== _.null) {
4565
4573
  const c = this._getOrReturnCtx(r);
@@ -4572,7 +4580,7 @@ class mt extends O {
4572
4580
  return z(r.data);
4573
4581
  }
4574
4582
  }
4575
- mt.create = (a) => new mt({
4583
+ pt.create = (a) => new pt({
4576
4584
  typeName: S.ZodNull,
4577
4585
  ...A(a)
4578
4586
  });
@@ -4718,7 +4726,7 @@ function De(a) {
4718
4726
  } else return a instanceof G ? new G({
4719
4727
  ...a._def,
4720
4728
  type: De(a.element)
4721
- }) : a instanceof X ? X.create(De(a.unwrap())) : a instanceof me ? me.create(De(a.unwrap())) : a instanceof te ? te.create(a.items.map((r) => De(r))) : a;
4729
+ }) : a instanceof X ? X.create(De(a.unwrap())) : a instanceof pe ? pe.create(De(a.unwrap())) : a instanceof te ? te.create(a.items.map((r) => De(r))) : a;
4722
4730
  }
4723
4731
  class C extends O {
4724
4732
  constructor() {
@@ -5080,7 +5088,7 @@ gt.create = (a, r) => new gt({
5080
5088
  typeName: S.ZodUnion,
5081
5089
  ...A(r)
5082
5090
  });
5083
- const ie = (a) => a instanceof wt ? ie(a.schema) : a instanceof J ? ie(a.innerType()) : a instanceof bt ? [a.value] : a instanceof pe ? a.options : a instanceof _t ? I.objectValues(a.enum) : a instanceof xt ? ie(a._def.innerType) : a instanceof pt ? [void 0] : a instanceof mt ? [null] : a instanceof X ? [void 0, ...ie(a.unwrap())] : a instanceof me ? [null, ...ie(a.unwrap())] : a instanceof $n || a instanceof Et ? ie(a.unwrap()) : a instanceof kt ? ie(a._def.innerType) : [];
5091
+ const ie = (a) => a instanceof wt ? ie(a.schema) : a instanceof J ? ie(a.innerType()) : a instanceof bt ? [a.value] : a instanceof me ? a.options : a instanceof _t ? I.objectValues(a.enum) : a instanceof xt ? ie(a._def.innerType) : a instanceof mt ? [void 0] : a instanceof pt ? [null] : a instanceof X ? [void 0, ...ie(a.unwrap())] : a instanceof pe ? [null, ...ie(a.unwrap())] : a instanceof $n || a instanceof Et ? ie(a.unwrap()) : a instanceof kt ? ie(a._def.innerType) : [];
5084
5092
  class Jt extends O {
5085
5093
  _parse(r) {
5086
5094
  const { ctx: i } = this._processInputParams(r);
@@ -5547,13 +5555,13 @@ bt.create = (a, r) => new bt({
5547
5555
  ...A(r)
5548
5556
  });
5549
5557
  function vi(a, r) {
5550
- return new pe({
5558
+ return new me({
5551
5559
  values: a,
5552
5560
  typeName: S.ZodEnum,
5553
5561
  ...A(r)
5554
5562
  });
5555
5563
  }
5556
- class pe extends O {
5564
+ class me extends O {
5557
5565
  constructor() {
5558
5566
  super(...arguments), lt.set(this, void 0);
5559
5567
  }
@@ -5566,7 +5574,7 @@ class pe extends O {
5566
5574
  code: w.invalid_type
5567
5575
  }), T;
5568
5576
  }
5569
- if (Ft(this, lt) || pi(this, lt, new Set(this._def.values)), !Ft(this, lt).has(r.data)) {
5577
+ if (Ft(this, lt) || mi(this, lt, new Set(this._def.values)), !Ft(this, lt).has(r.data)) {
5570
5578
  const i = this._getOrReturnCtx(r), c = this._def.values;
5571
5579
  return b(i, {
5572
5580
  received: i.data,
@@ -5598,20 +5606,20 @@ class pe extends O {
5598
5606
  return r;
5599
5607
  }
5600
5608
  extract(r, i = this._def) {
5601
- return pe.create(r, {
5609
+ return me.create(r, {
5602
5610
  ...this._def,
5603
5611
  ...i
5604
5612
  });
5605
5613
  }
5606
5614
  exclude(r, i = this._def) {
5607
- return pe.create(this.options.filter((c) => !r.includes(c)), {
5615
+ return me.create(this.options.filter((c) => !r.includes(c)), {
5608
5616
  ...this._def,
5609
5617
  ...i
5610
5618
  });
5611
5619
  }
5612
5620
  }
5613
5621
  lt = /* @__PURE__ */ new WeakMap();
5614
- pe.create = vi;
5622
+ me.create = vi;
5615
5623
  class _t extends O {
5616
5624
  constructor() {
5617
5625
  super(...arguments), dt.set(this, void 0);
@@ -5626,7 +5634,7 @@ class _t extends O {
5626
5634
  code: w.invalid_type
5627
5635
  }), T;
5628
5636
  }
5629
- if (Ft(this, dt) || pi(this, dt, new Set(I.getValidEnumValues(this._def.values))), !Ft(this, dt).has(r.data)) {
5637
+ if (Ft(this, dt) || mi(this, dt, new Set(I.getValidEnumValues(this._def.values))), !Ft(this, dt).has(r.data)) {
5630
5638
  const u = I.objectValues(i);
5631
5639
  return b(c, {
5632
5640
  received: c.data,
@@ -5772,7 +5780,7 @@ X.create = (a, r) => new X({
5772
5780
  typeName: S.ZodOptional,
5773
5781
  ...A(r)
5774
5782
  });
5775
- class me extends O {
5783
+ class pe extends O {
5776
5784
  _parse(r) {
5777
5785
  return this._getType(r) === _.null ? z(null) : this._def.innerType._parse(r);
5778
5786
  }
@@ -5780,7 +5788,7 @@ class me extends O {
5780
5788
  return this._def.innerType;
5781
5789
  }
5782
5790
  }
5783
- me.create = (a, r) => new me({
5791
+ pe.create = (a, r) => new pe({
5784
5792
  innerType: a,
5785
5793
  typeName: S.ZodNullable,
5786
5794
  ...A(r)
@@ -5865,7 +5873,7 @@ Gt.create = (a) => new Gt({
5865
5873
  typeName: S.ZodNaN,
5866
5874
  ...A(a)
5867
5875
  });
5868
- const Id = Symbol("zod_brand");
5876
+ const Md = Symbol("zod_brand");
5869
5877
  class $n extends O {
5870
5878
  _parse(r) {
5871
5879
  const { ctx: i } = this._processInputParams(r), c = i.data;
@@ -5942,16 +5950,16 @@ function wi(a, r = {}, i) {
5942
5950
  }
5943
5951
  }) : ze.create();
5944
5952
  }
5945
- const Md = {
5953
+ const $d = {
5946
5954
  object: C.lazycreate
5947
5955
  };
5948
5956
  var S;
5949
5957
  (function(a) {
5950
5958
  a.ZodString = "ZodString", a.ZodNumber = "ZodNumber", a.ZodNaN = "ZodNaN", a.ZodBigInt = "ZodBigInt", a.ZodBoolean = "ZodBoolean", a.ZodDate = "ZodDate", a.ZodSymbol = "ZodSymbol", a.ZodUndefined = "ZodUndefined", a.ZodNull = "ZodNull", a.ZodAny = "ZodAny", a.ZodUnknown = "ZodUnknown", a.ZodNever = "ZodNever", a.ZodVoid = "ZodVoid", a.ZodArray = "ZodArray", a.ZodObject = "ZodObject", a.ZodUnion = "ZodUnion", a.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", a.ZodIntersection = "ZodIntersection", a.ZodTuple = "ZodTuple", a.ZodRecord = "ZodRecord", a.ZodMap = "ZodMap", a.ZodSet = "ZodSet", a.ZodFunction = "ZodFunction", a.ZodLazy = "ZodLazy", a.ZodLiteral = "ZodLiteral", a.ZodEnum = "ZodEnum", a.ZodEffects = "ZodEffects", a.ZodNativeEnum = "ZodNativeEnum", a.ZodOptional = "ZodOptional", a.ZodNullable = "ZodNullable", a.ZodDefault = "ZodDefault", a.ZodCatch = "ZodCatch", a.ZodPromise = "ZodPromise", a.ZodBranded = "ZodBranded", a.ZodPipeline = "ZodPipeline", a.ZodReadonly = "ZodReadonly";
5951
5959
  })(S || (S = {}));
5952
- const $d = (a, r = {
5960
+ const Rd = (a, r = {
5953
5961
  message: `Input not instance of ${a.name}`
5954
- }) => wi((i) => i instanceof a, r), bi = q.create, _i = fe.create, Rd = Gt.create, Cd = he.create, xi = ht.create, Nd = Te.create, jd = Wt.create, Dd = pt.create, Ud = mt.create, Pd = ze.create, Zd = Ee.create, Bd = oe.create, Ld = Ht.create, zd = G.create, Vd = C.create, Fd = C.strictCreate, Wd = gt.create, Hd = Jt.create, qd = yt.create, Gd = te.create, Jd = vt.create, Kd = qt.create, Yd = Ae.create, Qd = Ze.create, Xd = wt.create, ef = bt.create, tf = pe.create, rf = _t.create, nf = Ve.create, oi = J.create, sf = X.create, af = me.create, of = J.createWithPreprocess, cf = St.create, uf = () => bi().optional(), lf = () => _i().optional(), df = () => xi().optional(), ff = {
5962
+ }) => wi((i) => i instanceof a, r), bi = q.create, _i = fe.create, Cd = Gt.create, Nd = he.create, xi = ht.create, jd = Te.create, Dd = Wt.create, Ud = mt.create, Pd = pt.create, Zd = ze.create, Bd = Ee.create, Ld = oe.create, zd = Ht.create, Vd = G.create, Fd = C.create, Wd = C.strictCreate, Hd = gt.create, qd = Jt.create, Gd = yt.create, Jd = te.create, Kd = vt.create, Yd = qt.create, Qd = Ae.create, Xd = Ze.create, ef = wt.create, tf = bt.create, rf = me.create, nf = _t.create, sf = Ve.create, oi = J.create, af = X.create, of = pe.create, cf = J.createWithPreprocess, uf = St.create, lf = () => bi().optional(), df = () => _i().optional(), ff = () => xi().optional(), hf = {
5955
5963
  string: (a) => q.create({ ...a, coerce: !0 }),
5956
5964
  number: (a) => fe.create({ ...a, coerce: !0 }),
5957
5965
  boolean: (a) => ht.create({
@@ -5960,14 +5968,14 @@ const $d = (a, r = {
5960
5968
  }),
5961
5969
  bigint: (a) => he.create({ ...a, coerce: !0 }),
5962
5970
  date: (a) => Te.create({ ...a, coerce: !0 })
5963
- }, hf = T;
5971
+ }, mf = T;
5964
5972
  var j = /* @__PURE__ */ Object.freeze({
5965
5973
  __proto__: null,
5966
5974
  defaultErrorMap: Le,
5967
- setErrorMap: ad,
5975
+ setErrorMap: od,
5968
5976
  getErrorMap: zt,
5969
5977
  makeIssue: Vt,
5970
- EMPTY_PATH: od,
5978
+ EMPTY_PATH: cd,
5971
5979
  addIssueToContext: b,
5972
5980
  ParseStatus: L,
5973
5981
  INVALID: T,
@@ -5993,8 +6001,8 @@ var j = /* @__PURE__ */ Object.freeze({
5993
6001
  ZodBoolean: ht,
5994
6002
  ZodDate: Te,
5995
6003
  ZodSymbol: Wt,
5996
- ZodUndefined: pt,
5997
- ZodNull: mt,
6004
+ ZodUndefined: mt,
6005
+ ZodNull: pt,
5998
6006
  ZodAny: ze,
5999
6007
  ZodUnknown: Ee,
6000
6008
  ZodNever: oe,
@@ -6011,70 +6019,70 @@ var j = /* @__PURE__ */ Object.freeze({
6011
6019
  ZodFunction: Ze,
6012
6020
  ZodLazy: wt,
6013
6021
  ZodLiteral: bt,
6014
- ZodEnum: pe,
6022
+ ZodEnum: me,
6015
6023
  ZodNativeEnum: _t,
6016
6024
  ZodPromise: Ve,
6017
6025
  ZodEffects: J,
6018
6026
  ZodTransformer: J,
6019
6027
  ZodOptional: X,
6020
- ZodNullable: me,
6028
+ ZodNullable: pe,
6021
6029
  ZodDefault: xt,
6022
6030
  ZodCatch: kt,
6023
6031
  ZodNaN: Gt,
6024
- BRAND: Id,
6032
+ BRAND: Md,
6025
6033
  ZodBranded: $n,
6026
6034
  ZodPipeline: St,
6027
6035
  ZodReadonly: Et,
6028
6036
  custom: wi,
6029
6037
  Schema: O,
6030
6038
  ZodSchema: O,
6031
- late: Md,
6039
+ late: $d,
6032
6040
  get ZodFirstPartyTypeKind() {
6033
6041
  return S;
6034
6042
  },
6035
- coerce: ff,
6036
- any: Pd,
6037
- array: zd,
6038
- bigint: Cd,
6043
+ coerce: hf,
6044
+ any: Zd,
6045
+ array: Vd,
6046
+ bigint: Nd,
6039
6047
  boolean: xi,
6040
- date: Nd,
6041
- discriminatedUnion: Hd,
6048
+ date: jd,
6049
+ discriminatedUnion: qd,
6042
6050
  effect: oi,
6043
- enum: tf,
6044
- function: Qd,
6045
- instanceof: $d,
6046
- intersection: qd,
6047
- lazy: Xd,
6048
- literal: ef,
6049
- map: Kd,
6050
- nan: Rd,
6051
- nativeEnum: rf,
6052
- never: Bd,
6053
- null: Ud,
6054
- nullable: af,
6051
+ enum: rf,
6052
+ function: Xd,
6053
+ instanceof: Rd,
6054
+ intersection: Gd,
6055
+ lazy: ef,
6056
+ literal: tf,
6057
+ map: Yd,
6058
+ nan: Cd,
6059
+ nativeEnum: nf,
6060
+ never: Ld,
6061
+ null: Pd,
6062
+ nullable: of,
6055
6063
  number: _i,
6056
- object: Vd,
6057
- oboolean: df,
6058
- onumber: lf,
6059
- optional: sf,
6060
- ostring: uf,
6061
- pipeline: cf,
6062
- preprocess: of,
6063
- promise: nf,
6064
- record: Jd,
6065
- set: Yd,
6066
- strictObject: Fd,
6064
+ object: Fd,
6065
+ oboolean: ff,
6066
+ onumber: df,
6067
+ optional: af,
6068
+ ostring: lf,
6069
+ pipeline: uf,
6070
+ preprocess: cf,
6071
+ promise: sf,
6072
+ record: Kd,
6073
+ set: Qd,
6074
+ strictObject: Wd,
6067
6075
  string: bi,
6068
- symbol: jd,
6076
+ symbol: Dd,
6069
6077
  transformer: oi,
6070
- tuple: Gd,
6071
- undefined: Dd,
6072
- union: Wd,
6073
- unknown: Zd,
6074
- void: Ld,
6075
- NEVER: hf,
6078
+ tuple: Jd,
6079
+ undefined: Ud,
6080
+ union: Hd,
6081
+ unknown: Bd,
6082
+ void: zd,
6083
+ NEVER: mf,
6076
6084
  ZodIssueCode: w,
6077
- quotelessJson: id,
6085
+ quotelessJson: ad,
6078
6086
  ZodError: V
6079
6087
  }), ki = /* @__PURE__ */ ((a) => (a.TEXT = "text", a.THREAD = "thread", a.REACTION = "reaction", a))(ki || {});
6080
6088
  const ge = H.getInstance(), pf = [
@@ -6104,30 +6112,30 @@ const ge = H.getInstance(), pf = [
6104
6112
  userTopic: j.string(),
6105
6113
  additionalProps: j.record(j.any()).optional()
6106
6114
  }).refine(
6107
- (a) => !a.additionalProps || Object.keys(a.additionalProps).length === 0 ? !0 : wf(a.additionalProps).isValid,
6115
+ (a) => !a.additionalProps || Object.keys(a.additionalProps).length === 0 ? !0 : bf(a.additionalProps).isValid,
6108
6116
  {
6109
6117
  message: "Invalid additional properties in message"
6110
6118
  }
6111
- ), mf = j.object({
6119
+ ), gf = j.object({
6112
6120
  reference: j.string(),
6113
6121
  timestamp: j.number()
6114
- }), gf = j.object({
6122
+ }), yf = j.object({
6115
6123
  message: Rn,
6116
- messageStateRefs: j.array(mf).nullable()
6124
+ messageStateRefs: j.array(gf).nullable()
6117
6125
  });
6118
6126
  function Ei(a) {
6119
- const r = gf.safeParse(a);
6127
+ const r = yf.safeParse(a);
6120
6128
  return r.success ? Si(a.message) ? !0 : (ge.warn("Invalid main message signature"), !1) : (ge.warn("GSOC message validation failed:", r.error.format()), !1);
6121
6129
  }
6122
- function yf(a) {
6130
+ function vf(a) {
6123
6131
  if (!Array.isArray(a))
6124
6132
  return ge.warn("Message state must be an array"), !1;
6125
6133
  for (const r of a)
6126
- if (!vf(r))
6134
+ if (!wf(r))
6127
6135
  return ge.warn("Invalid message in message state:", r.id), !1;
6128
6136
  return !0;
6129
6137
  }
6130
- function vf(a) {
6138
+ function wf(a) {
6131
6139
  const r = Rn.safeParse(a);
6132
6140
  return r.success ? Si(a) ? !0 : (ge.warn("Invalid message signature"), !1) : (ge.warn("Message data validation failed:", r.error.format()), !1);
6133
6141
  }
@@ -6150,7 +6158,7 @@ function Si(a) {
6150
6158
  return ge.warn("Error in validateUserSignature", r), !1;
6151
6159
  }
6152
6160
  }
6153
- function wf(a) {
6161
+ function bf(a) {
6154
6162
  const r = [];
6155
6163
  if (a == null)
6156
6164
  return { isValid: !0, errors: [] };
@@ -6188,7 +6196,7 @@ function wf(a) {
6188
6196
  const h = 20;
6189
6197
  return Object.keys(a).length > h && r.push(`Too many additional properties: ${Object.keys(a).length} (max: ${h})`), { isValid: r.length === 0, errors: r };
6190
6198
  }
6191
- function bf(a) {
6199
+ function _f(a) {
6192
6200
  const r = Rn.safeParse(a);
6193
6201
  if (!r.success) {
6194
6202
  const i = r.error.issues.map(
@@ -6207,7 +6215,7 @@ const W = {
6207
6215
  MESSAGE_REQUEST_ERROR: "messageRequestError",
6208
6216
  CRITICAL_ERROR: "criticalError"
6209
6217
  };
6210
- class _f {
6218
+ class xf {
6211
6219
  constructor(r, i) {
6212
6220
  this.utils = r, this.emitter = i, this.logger = H.getInstance(), this.errorHandler = Q.getInstance(), this.processedRefs = /* @__PURE__ */ new Set(), this.refRetryCount = /* @__PURE__ */ new Map(), this.bannedRefs = /* @__PURE__ */ new Set(), this.latestStatefulMessage = null, this.MAX_RETRIES = 3, this.RETRY_DELAY = 1e3;
6213
6221
  }
@@ -6276,7 +6284,7 @@ class _f {
6276
6284
  }
6277
6285
  async processMessageRef(r) {
6278
6286
  const i = await this.utils.downloadObjectFromBee(r);
6279
- if (!yf(i))
6287
+ if (!vf(i))
6280
6288
  throw new Error(`Invalid message state for ref: ${r}`);
6281
6289
  this.processedRefs.add(r), this.refRetryCount.delete(r);
6282
6290
  for (const u of i)
@@ -6299,7 +6307,7 @@ class _f {
6299
6307
  this.processedRefs.clear(), this.refRetryCount.clear(), this.bannedRefs.clear(), this.latestStatefulMessage = null;
6300
6308
  }
6301
6309
  }
6302
- class xf {
6310
+ class kf {
6303
6311
  constructor(r, i) {
6304
6312
  this.userDetails = r, this.swarmSettings = i, this.depth = 26, this.errorHandler = Q.getInstance();
6305
6313
  }
@@ -6372,10 +6380,8 @@ class xf {
6372
6380
  }
6373
6381
  async getOwnLatestFeedIndex() {
6374
6382
  try {
6375
- const { bee: r, chatTopic: i, feedReadTimeout: c } = this.swarmSettings, { ownAddress: u } = this.userDetails, l = this.generateUserOwnedFeedId(i, u), f = ut.fromString(l), g = await r.makeFeedReader(f, u, {
6376
- timeout: c
6377
- }).downloadPayload(), y = Number(g.feedIndex.toBigInt()), x = y + 1;
6378
- return { latestIndex: y, nextIndex: x };
6383
+ const { bee: r, chatTopic: i } = this.swarmSettings, { ownAddress: c } = this.userDetails, u = this.generateUserOwnedFeedId(i, c), l = ut.fromString(u), h = await r.makeFeedReader(l, c).downloadPayload(), g = Number(h.feedIndex.toBigInt()), y = g + 1;
6384
+ return { latestIndex: g, nextIndex: y };
6379
6385
  } catch (r) {
6380
6386
  if (this.isNotFoundError(r))
6381
6387
  return { latestIndex: -1, nextIndex: 0 };
@@ -6383,10 +6389,8 @@ class xf {
6383
6389
  }
6384
6390
  }
6385
6391
  async fetchLatestChatMessage() {
6386
- const { bee: r, chatTopic: i, chatAddress: c, feedReadTimeout: u } = this.swarmSettings, f = await r.makeFeedReader(ut.fromString(i), fi(c), {
6387
- timeout: u
6388
- }).downloadPayload();
6389
- return { data: f.payload.toJSON(), index: f.feedIndex };
6392
+ const { bee: r, chatTopic: i, chatAddress: c } = this.swarmSettings, l = await r.makeFeedReader(ut.fromString(i), fi(c)).downloadPayload();
6393
+ return { data: l.payload.toJSON(), index: l.feedIndex };
6390
6394
  }
6391
6395
  async sendMessageToGsoc(r) {
6392
6396
  const { enveloped: i, stamp: c } = this.swarmSettings;
@@ -6432,7 +6436,7 @@ class xf {
6432
6436
  await We(Oe, x, N.toUint8Array());
6433
6437
  }
6434
6438
  }
6435
- class Ef {
6439
+ class Sf {
6436
6440
  constructor(r, i) {
6437
6441
  this.fallbackTransport = null, this.logger = H.getInstance(), this.errorHandler = Q.getInstance(), this.gsocIndex = null;
6438
6442
  const c = new ke(fi(r.user.privateKey));
@@ -6454,7 +6458,7 @@ class Ef {
6454
6458
  feedReadTimeout: r.infra.feedReadTimeout || 12e3,
6455
6459
  gsocWriteTimeout: r.infra.gsocWriteTimeout || 2e3,
6456
6460
  socReadTimeout: r.infra.socReadTimeout || 5e3
6457
- }, this.emitter = new sd(), this.utils = new xf(this.userDetails, this.swarmSettings), this.history = new _f(this.utils, this.emitter);
6461
+ }, this.emitter = new id(), this.utils = new kf(this.userDetails, this.swarmSettings), this.history = new xf(this.utils, this.emitter);
6458
6462
  const u = r.infra.pollingInterval || 1e3;
6459
6463
  i ? (this.transport = i, r.infra.enableFallbackPolling && (this.logger.info(`Fallback polling enabled with interval: ${u}ms`), this.fallbackTransport = this.createDefaultPollingTransport(u), this.fallbackTransport.onMessage((l) => {
6460
6464
  this.emitter.emit(W.MESSAGE_RECEIVED, l);
@@ -6505,7 +6509,7 @@ class Ef {
6505
6509
  targetMessageId: c,
6506
6510
  message: r,
6507
6511
  additionalProps: l
6508
- }, g = bf(h);
6512
+ }, g = _f(h);
6509
6513
  if (!g.isValid) {
6510
6514
  const y = `Invalid message: ${g.errors.join(", ")}`;
6511
6515
  throw this.logger.error(y), new Error(y);
@@ -6533,14 +6537,21 @@ class Ef {
6533
6537
  await this.broadcastUserMessage(r);
6534
6538
  }
6535
6539
  async init() {
6540
+ var r, i;
6536
6541
  try {
6537
6542
  this.emitter.emit(W.LOADING_INIT, !0);
6538
- const [r, i] = await Promise.allSettled([this.initOwnIndex(), this.history.init()]);
6539
- if (r.status === "rejected")
6540
- throw r.reason;
6541
- i.status === "fulfilled" && (this.gsocIndex = i.value), this.emitter.emit(W.LOADING_INIT, !1);
6542
- } catch (r) {
6543
- this.errorHandler.handleError(r, "Chat.initSelfState"), this.emitter.emit(W.CRITICAL_ERROR, r);
6543
+ const u = this.swarmSettings.feedReadTimeout - 1e3, [l, f] = await sd(
6544
+ Promise.allSettled([this.initOwnIndex(), this.history.init()]),
6545
+ u,
6546
+ "Initialization timed out"
6547
+ );
6548
+ if (l.status === "rejected")
6549
+ throw l.reason;
6550
+ f.status === "fulfilled" && (this.gsocIndex = f.value);
6551
+ } catch (c) {
6552
+ this.errorHandler.handleError(c, "Chat.initSelfState"), (r = c.message) != null && r.includes("timed out") || (i = c.message) != null && i.includes("timeout") ? this.userDetails.ownIndex === void 0 && (this.userDetails.ownIndex = -1) : this.emitter.emit(W.CRITICAL_ERROR, c);
6553
+ } finally {
6554
+ this.emitter.emit(W.LOADING_INIT, !1);
6544
6555
  }
6545
6556
  }
6546
6557
  async initOwnIndex() {
@@ -6566,5 +6577,5 @@ export {
6566
6577
  W as EVENTS,
6567
6578
  ki as MessageType,
6568
6579
  ql as PollingTransport,
6569
- Ef as SwarmChat
6580
+ Sf as SwarmChat
6570
6581
  };