@synnaxlabs/x 0.36.0 → 0.38.0

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.
Files changed (147) hide show
  1. package/.turbo/turbo-build.log +41 -37
  2. package/dist/binary.cjs +1 -1
  3. package/dist/binary.js +1 -1
  4. package/dist/box-BZ6d2d5A.cjs +1 -0
  5. package/dist/box-Cto-5Uxu.js +201 -0
  6. package/dist/box.cjs +1 -1
  7. package/dist/box.js +1 -1
  8. package/dist/caseconv.cjs +1 -1
  9. package/dist/caseconv.js +1 -1
  10. package/dist/compare.cjs +1 -1
  11. package/dist/compare.js +1 -1
  12. package/dist/external-C-dNgNQw.cjs +1 -0
  13. package/dist/external-Cax-LfQW.cjs +1 -0
  14. package/dist/external-DqPrWKvU.js +47 -0
  15. package/dist/external-vFGUdZf6.js +30 -0
  16. package/dist/index-BG3Scw3G.cjs +1 -0
  17. package/dist/{index-HQonyH7n.js → index-BVC_8Cg9.js} +1 -1
  18. package/dist/index-BfDeGfej.js +41 -0
  19. package/dist/{index-CYxQwEdX.cjs → index-CnclyYpG.cjs} +1 -1
  20. package/dist/index-D4NCYiQB.js +19 -0
  21. package/dist/index-Dd8DLyMx.cjs +1 -0
  22. package/dist/{index-BBa2mWG1.js → index-OHIRoCei.js} +1 -1
  23. package/dist/index-udOjA9d-.cjs +1 -0
  24. package/dist/index.cjs +2 -2
  25. package/dist/index.js +126 -124
  26. package/dist/kv.cjs +1 -1
  27. package/dist/kv.js +2 -2
  28. package/dist/link.cjs +1 -0
  29. package/dist/link.js +10 -0
  30. package/dist/{location-DLP2ZS0o.cjs → location-BIet4Mig.cjs} +1 -1
  31. package/dist/{location-Cn1ByVTZ.js → location-C5Ot4MVG.js} +1 -1
  32. package/dist/location.cjs +1 -1
  33. package/dist/location.js +1 -1
  34. package/dist/position-CvSNZkSD.cjs +1 -0
  35. package/dist/position-GeF1oEYk.js +85 -0
  36. package/dist/position.cjs +1 -1
  37. package/dist/position.js +1 -1
  38. package/dist/runtime.cjs +1 -1
  39. package/dist/runtime.js +1 -1
  40. package/dist/{scale-BI4wJF3b.cjs → scale-BTgf0Mr-.cjs} +1 -1
  41. package/dist/{scale-rZ1YKDFy.js → scale-Dh1UNRoC.js} +3 -3
  42. package/dist/scale.cjs +1 -1
  43. package/dist/scale.js +1 -1
  44. package/dist/series-BMhEEJZL.cjs +11 -0
  45. package/dist/{series-CnEQe1dh.js → series-DxDIugLj.js} +296 -286
  46. package/dist/spatial.cjs +1 -1
  47. package/dist/spatial.js +5 -5
  48. package/dist/src/breaker/breaker.d.ts +1 -1
  49. package/dist/src/breaker/breaker.d.ts.map +1 -1
  50. package/dist/src/caseconv/caseconv.d.ts +12 -6
  51. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  52. package/dist/src/deep/path.d.ts.map +1 -1
  53. package/dist/src/index.d.ts +2 -1
  54. package/dist/src/index.d.ts.map +1 -1
  55. package/dist/src/kv/external.d.ts +3 -0
  56. package/dist/src/kv/external.d.ts.map +1 -0
  57. package/dist/src/kv/index.d.ts +1 -1
  58. package/dist/src/kv/index.d.ts.map +1 -1
  59. package/dist/src/kv/mock.d.ts +24 -0
  60. package/dist/src/kv/mock.d.ts.map +1 -0
  61. package/dist/src/kv/mock.spec.d.ts +2 -0
  62. package/dist/src/kv/mock.spec.d.ts.map +1 -0
  63. package/dist/src/kv/types.d.ts +18 -18
  64. package/dist/src/kv/types.d.ts.map +1 -1
  65. package/dist/src/link/index.d.ts +2 -0
  66. package/dist/src/link/index.d.ts.map +1 -0
  67. package/dist/src/link/link.d.ts +2 -0
  68. package/dist/src/link/link.d.ts.map +1 -0
  69. package/dist/src/link/link.spec.d.ts +2 -0
  70. package/dist/src/link/link.spec.d.ts.map +1 -0
  71. package/dist/src/runtime/os.d.ts +1 -1
  72. package/dist/src/runtime/os.d.ts.map +1 -1
  73. package/dist/src/sleep/sleep.d.ts.map +1 -1
  74. package/dist/src/telem/index.d.ts +1 -1
  75. package/dist/src/telem/index.d.ts.map +1 -1
  76. package/dist/src/telem/series.d.ts +1 -0
  77. package/dist/src/telem/series.d.ts.map +1 -1
  78. package/dist/src/telem/telem.d.ts +2 -0
  79. package/dist/src/telem/telem.d.ts.map +1 -1
  80. package/dist/src/unique/index.d.ts +2 -0
  81. package/dist/src/unique/index.d.ts.map +1 -0
  82. package/dist/src/unique/unique.d.ts +42 -0
  83. package/dist/src/unique/unique.d.ts.map +1 -0
  84. package/dist/src/unique/unique.spec.d.ts +2 -0
  85. package/dist/src/unique/unique.spec.d.ts.map +1 -0
  86. package/dist/src/zodutil/index.d.ts.map +1 -1
  87. package/dist/src/zodutil/zodutil.d.ts +1 -16
  88. package/dist/src/zodutil/zodutil.d.ts.map +1 -1
  89. package/dist/telem.cjs +1 -1
  90. package/dist/telem.js +1 -1
  91. package/dist/unique.cjs +1 -1
  92. package/dist/unique.js +2 -2
  93. package/dist/url.cjs +1 -1
  94. package/dist/url.js +5 -5
  95. package/dist/{xy-LADI2wVU.cjs → xy-Budz-qz-.cjs} +1 -1
  96. package/dist/{xy-DQdccWlc.js → xy-DxjPL2DZ.js} +4 -4
  97. package/dist/xy.cjs +1 -1
  98. package/dist/xy.js +1 -1
  99. package/dist/zodutil-BfrF8jE3.js +23 -0
  100. package/dist/zodutil-DFJyyQd2.cjs +1 -0
  101. package/dist/zodutil.cjs +1 -1
  102. package/dist/zodutil.js +1 -1
  103. package/package.json +8 -10
  104. package/src/breaker/breaker.spec.ts +3 -4
  105. package/src/breaker/breaker.ts +3 -2
  106. package/src/caseconv/caseconv.spec.ts +20 -20
  107. package/src/caseconv/caseconv.ts +34 -5
  108. package/src/compare/compare.ts +2 -2
  109. package/src/deep/path.ts +1 -1
  110. package/src/index.ts +2 -1
  111. package/src/{unique.ts → kv/external.ts} +2 -1
  112. package/src/kv/index.ts +1 -1
  113. package/src/kv/mock.spec.ts +101 -0
  114. package/src/kv/mock.ts +58 -0
  115. package/src/kv/types.ts +22 -28
  116. package/src/link/index.ts +10 -0
  117. package/src/link/link.spec.ts +68 -0
  118. package/src/link/link.ts +21 -0
  119. package/src/runtime/os.ts +18 -2
  120. package/src/sleep/sleep.ts +1 -1
  121. package/src/telem/index.ts +1 -1
  122. package/src/telem/series.spec.ts +21 -0
  123. package/src/telem/series.ts +15 -9
  124. package/src/telem/telem.ts +34 -10
  125. package/src/unique/index.ts +10 -0
  126. package/src/unique/unique.spec.ts +192 -0
  127. package/src/unique/unique.ts +67 -0
  128. package/src/zodutil/index.ts +1 -1
  129. package/src/zodutil/zodutil.ts +1 -29
  130. package/tsconfig.tsbuildinfo +1 -1
  131. package/vite.config.ts +6 -8
  132. package/dist/box-BpSX4si6.cjs +0 -1
  133. package/dist/box-CYXc9-qp.js +0 -201
  134. package/dist/external-B3XSLDq5.cjs +0 -1
  135. package/dist/external-sVtvYJS6.js +0 -23
  136. package/dist/index-YsO0EMN8.cjs +0 -1
  137. package/dist/index-eue4dSQX.js +0 -45
  138. package/dist/index-h-QAL9T1.cjs +0 -1
  139. package/dist/position-DJXB-pDS.js +0 -85
  140. package/dist/position-JCN6-sJC.cjs +0 -1
  141. package/dist/series-BN9CILsQ.cjs +0 -11
  142. package/dist/src/unique.d.ts +0 -2
  143. package/dist/src/unique.d.ts.map +0 -1
  144. package/dist/types-BpAJW2TM.js +0 -11
  145. package/dist/types-zRwnQ1hc.cjs +0 -1
  146. package/dist/zodutil-BRjUdYAv.cjs +0 -1
  147. package/dist/zodutil-DI4gVZkT.js +0 -27
@@ -1,23 +1,23 @@
1
1
  var et = Object.defineProperty;
2
- var rt = (o, t, e) => t in o ? et(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var s = (o, t, e) => rt(o, typeof t != "symbol" ? t + "" : t, e);
2
+ var nt = (o, t, e) => t in o ? et(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var s = (o, t, e) => nt(o, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { z as l } from "zod";
5
- import { J as $ } from "./index-BBa2mWG1.js";
6
- import { s as nt } from "./index-eue4dSQX.js";
7
- import { n as st } from "./index-HQonyH7n.js";
8
- import { m as R, c as L, a as k, d as D, t as it, e as at } from "./bounds-BtccGJW0.js";
9
- import "./box-CYXc9-qp.js";
5
+ import { J as q } from "./index-OHIRoCei.js";
6
+ import { s as rt } from "./index-BfDeGfej.js";
7
+ import { n as st } from "./index-BVC_8Cg9.js";
8
+ import { m as R, c as L, a as G, d as D, t as it, e as at } from "./bounds-BtccGJW0.js";
9
+ import "./box-Cto-5Uxu.js";
10
10
  import "./dimensions-D-1PnJVI.js";
11
11
  import "./base-DnZzEvvz.js";
12
- import "./location-Cn1ByVTZ.js";
13
- import "./scale-rZ1YKDFy.js";
14
- import "./xy-DQdccWlc.js";
15
- import { b as ut } from "./zodutil-DI4gVZkT.js";
12
+ import "./location-C5Ot4MVG.js";
13
+ import "./scale-Dh1UNRoC.js";
14
+ import "./xy-DxjPL2DZ.js";
15
+ import { b as ut } from "./zodutil-BfrF8jE3.js";
16
16
  let ot = (o, t = 21) => (e = t) => {
17
- let r = "", i = e;
17
+ let n = "", i = e | 0;
18
18
  for (; i--; )
19
- r += o[Math.random() * o.length | 0];
20
- return r;
19
+ n += o[Math.random() * o.length | 0];
20
+ return n;
21
21
  };
22
22
  const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q = ot(lt, 11), xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
23
23
  __proto__: null,
@@ -36,8 +36,8 @@ const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q =
36
36
  throw new Error(
37
37
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
38
38
  );
39
- const r = o.valueOf() % e.valueOf();
40
- return o instanceof m ? new m(r) : new w(r);
39
+ const n = o.valueOf() % e.valueOf();
40
+ return o instanceof m ? new m(n) : new w(n);
41
41
  }, a = class a {
42
42
  constructor(t, e = "UTC") {
43
43
  s(this, "value");
@@ -49,12 +49,12 @@ const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q =
49
49
  this.value = a.parseDateTimeString(t, e).valueOf();
50
50
  else if (Array.isArray(t)) this.value = a.parseDate(t);
51
51
  else {
52
- let r = BigInt(0);
53
- t instanceof Number && (t = t.valueOf()), e === "local" && (r = a.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t = Math.trunc(t) : (isNaN(t) && (t = 0), t === 1 / 0 ? t = a.MAX : t = a.MIN)), this.value = BigInt(t.valueOf()) + r;
52
+ let n = BigInt(0);
53
+ t instanceof Number && (t = t.valueOf()), e === "local" && (n = a.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t = Math.trunc(t) : (isNaN(t) && (t = 0), t === 1 / 0 ? t = a.MAX : t = a.MIN)), this.value = BigInt(t.valueOf()) + n;
54
54
  }
55
55
  }
56
- static parseDate([t = 1970, e = 1, r = 1]) {
57
- const i = new Date(t, e - 1, r, 0, 0, 0, 0);
56
+ static parseDate([t = 1970, e = 1, n = 1]) {
57
+ const i = new Date(t, e - 1, n, 0, 0, 0, 0);
58
58
  return new a(BigInt(i.getTime()) * a.MILLISECOND.valueOf()).truncate(a.DAY).valueOf();
59
59
  }
60
60
  encode() {
@@ -64,18 +64,18 @@ const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q =
64
64
  return this.value;
65
65
  }
66
66
  static parseTimeString(t, e = "UTC") {
67
- const [r, i, f] = t.split(":");
68
- let h = "00", v = "00";
69
- f != null && ([h, v] = f.split("."));
70
- let O = a.hours(parseInt(r ?? "00")).add(a.minutes(parseInt(i ?? "00"))).add(a.seconds(parseInt(h ?? "00"))).add(a.milliseconds(parseInt(v ?? "00")));
67
+ const [n, i, f] = t.split(":");
68
+ let c = "00", S = "00";
69
+ f != null && ([c, S] = f.split("."));
70
+ let O = a.hours(parseInt(n ?? "00")).add(a.minutes(parseInt(i ?? "00"))).add(a.seconds(parseInt(c ?? "00"))).add(a.milliseconds(parseInt(S ?? "00")));
71
71
  return e === "local" && (O = O.add(a.utcOffset)), O.valueOf();
72
72
  }
73
73
  static parseDateTimeString(t, e = "UTC") {
74
74
  if (!t.includes("/") && !t.includes("-"))
75
75
  return a.parseTimeString(t, e);
76
- const r = new Date(t);
77
- return t.includes(":") || r.setUTCHours(0, 0, 0, 0), new a(
78
- BigInt(r.getTime()) * a.MILLISECOND.valueOf(),
76
+ const n = new Date(t);
77
+ return t.includes(":") || n.setUTCHours(0, 0, 0, 0), new a(
78
+ BigInt(n.getTime()) * a.MILLISECOND.valueOf(),
79
79
  e
80
80
  ).valueOf();
81
81
  }
@@ -103,12 +103,12 @@ const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q =
103
103
  return t === "UTC" ? this.date().toISOString() : this.sub(a.utcOffset).date().toISOString();
104
104
  }
105
105
  timeString(t = !1, e = "UTC") {
106
- const r = this.toISOString(e);
107
- return t ? r.slice(11, 23) : r.slice(11, 19);
106
+ const n = this.toISOString(e);
107
+ return t ? n.slice(11, 23) : n.slice(11, 19);
108
108
  }
109
109
  dateString() {
110
- const t = this.date(), e = t.toLocaleString("default", { month: "short" }), r = t.toLocaleString("default", { day: "numeric" });
111
- return `${e} ${r}`;
110
+ const t = this.date(), e = t.toLocaleString("default", { month: "short" }), n = t.toLocaleString("default", { day: "numeric" });
111
+ return `${e} ${n}`;
112
112
  }
113
113
  static get utcOffset() {
114
114
  return new w(
@@ -357,16 +357,16 @@ const lt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Q =
357
357
  }
358
358
  static max(...t) {
359
359
  let e = a.MIN;
360
- for (const r of t) {
361
- const i = new a(r);
360
+ for (const n of t) {
361
+ const i = new a(n);
362
362
  i.after(e) && (e = i);
363
363
  }
364
364
  return e;
365
365
  }
366
366
  static min(...t) {
367
367
  let e = a.MAX;
368
- for (const r of t) {
369
- const i = new a(r);
368
+ for (const n of t) {
369
+ const i = new a(n);
370
370
  i.before(e) && (e = i);
371
371
  }
372
372
  return e;
@@ -426,10 +426,10 @@ const u = class u {
426
426
  typeof t == "number" && (t = Math.trunc(t.valueOf())), this.value = BigInt(t.valueOf());
427
427
  }
428
428
  static fromSeconds(t) {
429
- return t instanceof u ? t : t instanceof F ? t.period : t instanceof m ? new u(t) : ["number", "bigint"].includes(typeof t) ? u.seconds(t) : new u(t);
429
+ return t instanceof u ? t : t instanceof $ ? t.period : t instanceof m ? new u(t) : ["number", "bigint"].includes(typeof t) ? u.seconds(t) : new u(t);
430
430
  }
431
431
  static fromMilliseconds(t) {
432
- return t instanceof u ? t : t instanceof F ? t.period : t instanceof m ? new u(t) : ["number", "bigint"].includes(typeof t) ? u.milliseconds(t) : new u(t);
432
+ return t instanceof u ? t : t instanceof $ ? t.period : t instanceof m ? new u(t) : ["number", "bigint"].includes(typeof t) ? u.milliseconds(t) : new u(t);
433
433
  }
434
434
  encode() {
435
435
  return this.value.toString();
@@ -458,9 +458,9 @@ const u = class u {
458
458
  );
459
459
  }
460
460
  toString() {
461
- const t = this.truncate(u.DAY), e = this.truncate(u.HOUR), r = this.truncate(u.MINUTE), i = this.truncate(u.SECOND), f = this.truncate(u.MILLISECOND), h = this.truncate(u.MICROSECOND), v = this.truncate(u.NANOSECOND), O = t, N = e.sub(t), p = r.sub(e), c = i.sub(r), M = f.sub(i), U = h.sub(f), Z = v.sub(h);
461
+ const t = this.truncate(u.DAY), e = this.truncate(u.HOUR), n = this.truncate(u.MINUTE), i = this.truncate(u.SECOND), f = this.truncate(u.MILLISECOND), c = this.truncate(u.MICROSECOND), S = this.truncate(u.NANOSECOND), O = t, N = e.sub(t), v = n.sub(e), h = i.sub(n), M = f.sub(i), U = c.sub(f), k = S.sub(c);
462
462
  let A = "";
463
- return O.isZero || (A += `${O.days}d `), N.isZero || (A += `${N.hours}h `), p.isZero || (A += `${p.minutes}m `), c.isZero || (A += `${c.seconds}s `), M.isZero || (A += `${M.milliseconds}ms `), U.isZero || (A += `${U.microseconds}µs `), Z.isZero || (A += `${Z.nanoseconds}ns`), A.trim();
463
+ return O.isZero || (A += `${O.days}d `), N.isZero || (A += `${N.hours}h `), v.isZero || (A += `${v.minutes}m `), h.isZero || (A += `${h.seconds}s `), M.isZero || (A += `${M.milliseconds}ms `), U.isZero || (A += `${U.microseconds}µs `), k.isZero || (A += `${k.nanoseconds}ns`), A.trim();
464
464
  }
465
465
  mult(t) {
466
466
  return new u(this.valueOf() * BigInt(t));
@@ -606,7 +606,7 @@ s(u, "z", l.union([
606
606
  l.instanceof(u)
607
607
  ]));
608
608
  let w = u;
609
- const S = class S extends Number {
609
+ const p = class p extends Number {
610
610
  constructor(t) {
611
611
  t instanceof Number ? super(t.valueOf()) : super(t);
612
612
  }
@@ -616,7 +616,7 @@ const S = class S extends Number {
616
616
  }
617
617
  /** @returns The number of seconds in the Rate. */
618
618
  equals(t) {
619
- return this.valueOf() === new S(t).valueOf();
619
+ return this.valueOf() === new p(t).valueOf();
620
620
  }
621
621
  /**
622
622
  * Calculates the period of the Rate as a TimeSpan.
@@ -671,7 +671,7 @@ const S = class S extends Number {
671
671
  * @returns A Rate representing the given number of Hz.
672
672
  */
673
673
  static hz(t) {
674
- return new S(t);
674
+ return new p(t);
675
675
  }
676
676
  /**
677
677
  * Creates a Rate representing the given number of kHz.
@@ -680,16 +680,16 @@ const S = class S extends Number {
680
680
  * @returns A Rate representing the given number of kHz.
681
681
  */
682
682
  static khz(t) {
683
- return S.hz(t * 1e3);
683
+ return p.hz(t * 1e3);
684
684
  }
685
685
  };
686
686
  /** A zod schema for validating and transforming rates */
687
- s(S, "z", l.union([
688
- l.number().transform((t) => new S(t)),
689
- l.instanceof(Number).transform((t) => new S(t)),
690
- l.instanceof(S)
687
+ s(p, "z", l.union([
688
+ l.number().transform((t) => new p(t)),
689
+ l.instanceof(Number).transform((t) => new p(t)),
690
+ l.instanceof(p)
691
691
  ]));
692
- let F = S;
692
+ let $ = p;
693
693
  const y = class y extends Number {
694
694
  /**
695
695
  * Creates a Density representing the given number of bytes per value.
@@ -816,15 +816,15 @@ const T = class T {
816
816
  */
817
817
  overlapsWith(t, e = w.ZERO) {
818
818
  t = t.makeValid();
819
- const r = this.makeValid();
819
+ const n = this.makeValid();
820
820
  if (this.equals(t)) return !0;
821
- if (t.end.equals(r.start) || r.end.equals(t.start)) return !1;
822
- const i = m.max(r.start, t.start), f = m.min(r.end, t.end);
821
+ if (t.end.equals(n.start) || n.end.equals(t.start)) return !1;
822
+ const i = m.max(n.start, t.start), f = m.min(n.end, t.end);
823
823
  return f.before(i) ? !1 : new w(f.sub(i)).greaterThanOrEqual(e);
824
824
  }
825
825
  roughlyEquals(t, e) {
826
- let r = this.start.sub(t.start).valueOf(), i = this.end.sub(t.end).valueOf();
827
- return r < 0 && (r = -r), i < 0 && (i = -i), r <= e.valueOf() && i <= e.valueOf();
826
+ let n = this.start.sub(t.start).valueOf(), i = this.end.sub(t.end).valueOf();
827
+ return n < 0 && (n = -n), i < 0 && (i = -i), n <= e.valueOf() && i <= e.valueOf();
828
828
  }
829
829
  contains(t) {
830
830
  return t instanceof T ? this.contains(t.start) && this.contains(t.end) : this.start.beforeEq(t) && this.end.after(t);
@@ -843,24 +843,24 @@ s(T, "z", l.union([
843
843
  l.instanceof(T)
844
844
  ]));
845
845
  let E = T;
846
- const Ct = (o, t) => o.start.before(t.start) ? -1 : o.start.after(t.start) ? 1 : o.end.before(t.end) ? -1 : o.end.after(t.end) ? 1 : 0, n = class n extends String {
846
+ const Ct = (o, t) => o.start.before(t.start) ? -1 : o.start.after(t.start) ? 1 : o.end.before(t.end) ? -1 : o.end.after(t.end) ? 1 : 0, r = class r extends String {
847
847
  constructor(t) {
848
- if (t instanceof n || typeof t == "string" || typeof t.valueOf() == "string") {
848
+ if (t instanceof r || typeof t == "string" || typeof t.valueOf() == "string") {
849
849
  super(t.valueOf());
850
850
  return;
851
851
  }
852
- const e = n.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);
852
+ const e = r.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);
853
853
  if (e != null) {
854
854
  super(e.valueOf());
855
855
  return;
856
856
  }
857
- throw super(n.UNKNOWN.valueOf()), new Error(`unable to find data type for ${t.toString()}`);
857
+ throw super(r.UNKNOWN.valueOf()), new Error(`unable to find data type for ${t.toString()}`);
858
858
  }
859
859
  /**
860
860
  * @returns the TypedArray constructor for the DataType.
861
861
  */
862
862
  get Array() {
863
- const t = n.ARRAY_CONSTRUCTORS.get(this.toString());
863
+ const t = r.ARRAY_CONSTRUCTORS.get(this.toString());
864
864
  if (t == null)
865
865
  throw new Error(`unable to find array constructor for ${this.valueOf()}`);
866
866
  return t;
@@ -882,25 +882,32 @@ const Ct = (o, t) => o.start.before(t.start) ? -1 : o.start.after(t.start) ? 1 :
882
882
  return this.valueOf();
883
883
  }
884
884
  get isVariable() {
885
- return this.equals(n.JSON) || this.equals(n.STRING);
885
+ return this.equals(r.JSON) || this.equals(r.STRING);
886
886
  }
887
887
  get isNumeric() {
888
- return !this.isVariable && !this.equals(n.UUID);
888
+ return !this.isVariable && !this.equals(r.UUID);
889
889
  }
890
890
  get isInteger() {
891
- return this.toString().startsWith("int");
891
+ const t = this.toString();
892
+ return t.startsWith("int") || t.startsWith("uint");
892
893
  }
893
894
  get isFloat() {
894
895
  return this.toString().startsWith("float");
895
896
  }
896
897
  get density() {
897
- const t = n.DENSITIES.get(this.toString());
898
+ const t = r.DENSITIES.get(this.toString());
898
899
  if (t == null) throw new Error(`unable to find density for ${this.valueOf()}`);
899
900
  return t;
900
901
  }
902
+ get isUnsigned() {
903
+ return this.equals(r.UINT8) || this.equals(r.UINT16) || this.equals(r.UINT32) || this.equals(r.UINT64);
904
+ }
905
+ get isSigned() {
906
+ return this.equals(r.INT8) || this.equals(r.INT16) || this.equals(r.INT32) || this.equals(r.INT64);
907
+ }
901
908
  /** @returns true if the data type can be cast to the other data type without loss of precision. */
902
909
  canSafelyCastTo(t) {
903
- return this.equals(t) ? !0 : this.isVariable && !t.isVariable || !this.isVariable && t.isVariable ? !1 : this.isFloat && t.isInteger || this.isInteger && t.isFloat ? this.density.valueOf() < t.density.valueOf() : this.isFloat && t.isFloat || this.isInteger && t.isInteger ? this.density.valueOf() <= t.density.valueOf() : !1;
910
+ return this.equals(t) ? !0 : !this.isNumeric || !t.isNumeric || this.isVariable || t.isVariable || this.isUnsigned && t.isSigned ? !1 : this.isFloat ? t.isFloat && this.density.valueOf() <= t.density.valueOf() : this.equals(r.INT32) && t.equals(r.FLOAT64) || this.equals(r.INT8) && t.equals(r.FLOAT32) ? !0 : this.isInteger && t.isInteger ? this.density.valueOf() <= t.density.valueOf() && this.isUnsigned === t.isUnsigned : !1;
904
911
  }
905
912
  /** @returns true if the data type can be cast to the other data type, even if there is a loss of precision. */
906
913
  canCastTo(t) {
@@ -919,91 +926,91 @@ const Ct = (o, t) => o.start.before(t.start) ? -1 : o.start.after(t.start) ? 1 :
919
926
  return this.toString();
920
927
  }
921
928
  get usesBigInt() {
922
- return n.BIG_INT_TYPES.some((t) => t.equals(this));
929
+ return r.BIG_INT_TYPES.some((t) => t.equals(this));
923
930
  }
924
931
  };
925
932
  /** Represents an Unknown/Invalid DataType. */
926
- s(n, "UNKNOWN", new n("unknown")), /** Represents a 64-bit floating point value. */
927
- s(n, "FLOAT64", new n("float64")), /** Represents a 32-bit floating point value. */
928
- s(n, "FLOAT32", new n("float32")), /** Represents a 64-bit signed integer value. */
929
- s(n, "INT64", new n("int64")), /** Represents a 32-bit signed integer value. */
930
- s(n, "INT32", new n("int32")), /** Represents a 16-bit signed integer value. */
931
- s(n, "INT16", new n("int16")), /** Represents a 8-bit signed integer value. */
932
- s(n, "INT8", new n("int8")), /** Represents a 64-bit unsigned integer value. */
933
- s(n, "UINT64", new n("uint64")), /** Represents a 32-bit unsigned integer value. */
934
- s(n, "UINT32", new n("uint32")), /** Represents a 16-bit unsigned integer value. */
935
- s(n, "UINT16", new n("uint16")), /** Represents a 8-bit unsigned integer value. */
936
- s(n, "UINT8", new n("uint8")), /** Represents a boolean value. Alias for UINT8. */
937
- s(n, "BOOLEAN", n.UINT8), /** Represents a 64-bit unix epoch. */
938
- s(n, "TIMESTAMP", new n("timestamp")), /** Represents a UUID data type */
939
- s(n, "UUID", new n("uuid")), /** Represents a string data type. Strings have an unknown density, and are separate
933
+ s(r, "UNKNOWN", new r("unknown")), /** Represents a 64-bit floating point value. */
934
+ s(r, "FLOAT64", new r("float64")), /** Represents a 32-bit floating point value. */
935
+ s(r, "FLOAT32", new r("float32")), /** Represents a 64-bit signed integer value. */
936
+ s(r, "INT64", new r("int64")), /** Represents a 32-bit signed integer value. */
937
+ s(r, "INT32", new r("int32")), /** Represents a 16-bit signed integer value. */
938
+ s(r, "INT16", new r("int16")), /** Represents a 8-bit signed integer value. */
939
+ s(r, "INT8", new r("int8")), /** Represents a 64-bit unsigned integer value. */
940
+ s(r, "UINT64", new r("uint64")), /** Represents a 32-bit unsigned integer value. */
941
+ s(r, "UINT32", new r("uint32")), /** Represents a 16-bit unsigned integer value. */
942
+ s(r, "UINT16", new r("uint16")), /** Represents a 8-bit unsigned integer value. */
943
+ s(r, "UINT8", new r("uint8")), /** Represents a boolean value. Alias for UINT8. */
944
+ s(r, "BOOLEAN", r.UINT8), /** Represents a 64-bit unix epoch. */
945
+ s(r, "TIMESTAMP", new r("timestamp")), /** Represents a UUID data type */
946
+ s(r, "UUID", new r("uuid")), /** Represents a string data type. Strings have an unknown density, and are separate
940
947
  * by a newline character. */
941
- s(n, "STRING", new n("string")), /** Represents a JSON data type. JSON has an unknown density, and is separated by a
948
+ s(r, "STRING", new r("string")), /** Represents a JSON data type. JSON has an unknown density, and is separated by a
942
949
  * newline character. */
943
- s(n, "JSON", new n("json")), s(n, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map([
944
- [n.UINT8.toString(), Uint8Array],
945
- [n.UINT16.toString(), Uint16Array],
946
- [n.UINT32.toString(), Uint32Array],
947
- [n.UINT64.toString(), BigUint64Array],
948
- [n.FLOAT32.toString(), Float32Array],
949
- [n.FLOAT64.toString(), Float64Array],
950
- [n.INT8.toString(), Int8Array],
951
- [n.INT16.toString(), Int16Array],
952
- [n.INT32.toString(), Int32Array],
953
- [n.INT64.toString(), BigInt64Array],
954
- [n.TIMESTAMP.toString(), BigInt64Array],
955
- [n.STRING.toString(), Uint8Array],
956
- [n.JSON.toString(), Uint8Array],
957
- [n.UUID.toString(), Uint8Array]
958
- ])), s(n, "ARRAY_CONSTRUCTOR_DATA_TYPES", /* @__PURE__ */ new Map([
959
- [Uint8Array.name, n.UINT8],
960
- [Uint16Array.name, n.UINT16],
961
- [Uint32Array.name, n.UINT32],
962
- [BigUint64Array.name, n.UINT64],
963
- [Float32Array.name, n.FLOAT32],
964
- [Float64Array.name, n.FLOAT64],
965
- [Int8Array.name, n.INT8],
966
- [Int16Array.name, n.INT16],
967
- [Int32Array.name, n.INT32],
968
- [BigInt64Array.name, n.INT64]
969
- ])), s(n, "DENSITIES", /* @__PURE__ */ new Map([
970
- [n.UINT8.toString(), b.BIT8],
971
- [n.UINT16.toString(), b.BIT16],
972
- [n.UINT32.toString(), b.BIT32],
973
- [n.UINT64.toString(), b.BIT64],
974
- [n.FLOAT32.toString(), b.BIT32],
975
- [n.FLOAT64.toString(), b.BIT64],
976
- [n.INT8.toString(), b.BIT8],
977
- [n.INT16.toString(), b.BIT16],
978
- [n.INT32.toString(), b.BIT32],
979
- [n.INT64.toString(), b.BIT64],
980
- [n.TIMESTAMP.toString(), b.BIT64],
981
- [n.STRING.toString(), b.UNKNOWN],
982
- [n.JSON.toString(), b.UNKNOWN],
983
- [n.UUID.toString(), b.BIT128]
950
+ s(r, "JSON", new r("json")), s(r, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map([
951
+ [r.UINT8.toString(), Uint8Array],
952
+ [r.UINT16.toString(), Uint16Array],
953
+ [r.UINT32.toString(), Uint32Array],
954
+ [r.UINT64.toString(), BigUint64Array],
955
+ [r.FLOAT32.toString(), Float32Array],
956
+ [r.FLOAT64.toString(), Float64Array],
957
+ [r.INT8.toString(), Int8Array],
958
+ [r.INT16.toString(), Int16Array],
959
+ [r.INT32.toString(), Int32Array],
960
+ [r.INT64.toString(), BigInt64Array],
961
+ [r.TIMESTAMP.toString(), BigInt64Array],
962
+ [r.STRING.toString(), Uint8Array],
963
+ [r.JSON.toString(), Uint8Array],
964
+ [r.UUID.toString(), Uint8Array]
965
+ ])), s(r, "ARRAY_CONSTRUCTOR_DATA_TYPES", /* @__PURE__ */ new Map([
966
+ [Uint8Array.name, r.UINT8],
967
+ [Uint16Array.name, r.UINT16],
968
+ [Uint32Array.name, r.UINT32],
969
+ [BigUint64Array.name, r.UINT64],
970
+ [Float32Array.name, r.FLOAT32],
971
+ [Float64Array.name, r.FLOAT64],
972
+ [Int8Array.name, r.INT8],
973
+ [Int16Array.name, r.INT16],
974
+ [Int32Array.name, r.INT32],
975
+ [BigInt64Array.name, r.INT64]
976
+ ])), s(r, "DENSITIES", /* @__PURE__ */ new Map([
977
+ [r.UINT8.toString(), b.BIT8],
978
+ [r.UINT16.toString(), b.BIT16],
979
+ [r.UINT32.toString(), b.BIT32],
980
+ [r.UINT64.toString(), b.BIT64],
981
+ [r.FLOAT32.toString(), b.BIT32],
982
+ [r.FLOAT64.toString(), b.BIT64],
983
+ [r.INT8.toString(), b.BIT8],
984
+ [r.INT16.toString(), b.BIT16],
985
+ [r.INT32.toString(), b.BIT32],
986
+ [r.INT64.toString(), b.BIT64],
987
+ [r.TIMESTAMP.toString(), b.BIT64],
988
+ [r.STRING.toString(), b.UNKNOWN],
989
+ [r.JSON.toString(), b.UNKNOWN],
990
+ [r.UUID.toString(), b.BIT128]
984
991
  ])), /** All the data types. */
985
- s(n, "ALL", [
986
- n.UNKNOWN,
987
- n.FLOAT64,
988
- n.FLOAT32,
989
- n.INT64,
990
- n.INT32,
991
- n.INT16,
992
- n.INT8,
993
- n.UINT64,
994
- n.UINT32,
995
- n.UINT16,
996
- n.UINT8,
997
- n.TIMESTAMP,
998
- n.UUID,
999
- n.STRING,
1000
- n.JSON
1001
- ]), s(n, "BIG_INT_TYPES", [n.INT64, n.UINT64, n.TIMESTAMP]), /** A zod schema for a DataType. */
1002
- s(n, "z", l.union([
1003
- l.string().transform((t) => new n(t)),
1004
- l.instanceof(n)
992
+ s(r, "ALL", [
993
+ r.UNKNOWN,
994
+ r.FLOAT64,
995
+ r.FLOAT32,
996
+ r.INT64,
997
+ r.INT32,
998
+ r.INT16,
999
+ r.INT8,
1000
+ r.UINT64,
1001
+ r.UINT32,
1002
+ r.UINT16,
1003
+ r.UINT8,
1004
+ r.TIMESTAMP,
1005
+ r.UUID,
1006
+ r.STRING,
1007
+ r.JSON
1008
+ ]), s(r, "BIG_INT_TYPES", [r.INT64, r.UINT64, r.TIMESTAMP]), /** A zod schema for a DataType. */
1009
+ s(r, "z", l.union([
1010
+ l.string().transform((t) => new r(t)),
1011
+ l.instanceof(r)
1005
1012
  ]));
1006
- let g = n;
1013
+ let g = r;
1007
1014
  const d = class d extends Number {
1008
1015
  constructor(t) {
1009
1016
  super(t.valueOf());
@@ -1041,9 +1048,9 @@ const d = class d extends Number {
1041
1048
  return this.valueOf() / d.TERABYTE.valueOf();
1042
1049
  }
1043
1050
  toString() {
1044
- const t = this.truncate(d.TERABYTE), e = this.truncate(d.GIGABYTE), r = this.truncate(d.MEGABYTE), i = this.truncate(d.KILOBYTE), f = this.truncate(d.BYTE), h = t, v = e.sub(t), O = r.sub(e), N = i.sub(r), p = f.sub(i);
1045
- let c = "";
1046
- return h.isZero || (c += `${h.terabytes}TB `), v.isZero || (c += `${v.gigabytes}GB `), O.isZero || (c += `${O.megabytes}MB `), N.isZero || (c += `${N.kilobytes}KB `), (!p.isZero || c === "") && (c += `${p.valueOf()}B`), c.trim();
1051
+ const t = this.truncate(d.TERABYTE), e = this.truncate(d.GIGABYTE), n = this.truncate(d.MEGABYTE), i = this.truncate(d.KILOBYTE), f = this.truncate(d.BYTE), c = t, S = e.sub(t), O = n.sub(e), N = i.sub(n), v = f.sub(i);
1052
+ let h = "";
1053
+ return c.isZero || (h += `${c.terabytes}TB `), S.isZero || (h += `${S.gigabytes}GB `), O.isZero || (h += `${O.megabytes}MB `), N.isZero || (h += `${N.kilobytes}KB `), (!v.isZero || h === "") && (h += `${v.valueOf()}B`), h.trim();
1047
1054
  }
1048
1055
  /**
1049
1056
  * Creates a Size from the given number of bytes.
@@ -1120,14 +1127,14 @@ const Lt = l.union([
1120
1127
  ]), tt = (o) => {
1121
1128
  const t = typeof o;
1122
1129
  return t === "string" || t === "number" || t === "boolean" || t === "bigint" || o instanceof m || o instanceof w || o instanceof Date;
1123
- }, ct = (o, t, e, r = 0) => o.usesBigInt && !t.usesBigInt ? Number(e) - Number(r) : !o.usesBigInt && t.usesBigInt ? BigInt(e.valueOf()) - BigInt(r.valueOf()) : C(e, -r).valueOf(), ht = (o) => o == null ? !1 : Array.isArray(o) || o instanceof ArrayBuffer || ArrayBuffer.isView(o) && !(o instanceof DataView) || o instanceof V ? !0 : tt(o), B = -1, Y = {
1124
- [Symbol.iterator]: () => Y,
1130
+ }, ht = (o, t, e, n = 0) => o.usesBigInt && !t.usesBigInt ? Number(e) - Number(n) : !o.usesBigInt && t.usesBigInt ? BigInt(e.valueOf()) - BigInt(n.valueOf()) : C(e, -n).valueOf(), ct = (o) => o == null ? !1 : Array.isArray(o) || o instanceof ArrayBuffer || ArrayBuffer.isView(o) && !(o instanceof DataView) || o instanceof Z ? !0 : tt(o), B = -1, P = {
1131
+ [Symbol.iterator]: () => P,
1125
1132
  next: () => ({ done: !0, value: void 0 })
1126
1133
  }, dt = l.string().transform(
1127
1134
  (o) => new Uint8Array(
1128
1135
  atob(o).split("").map((t) => t.charCodeAt(0))
1129
1136
  ).buffer
1130
- ), gt = l.union([l.null(), l.undefined()]).transform(() => new Uint8Array().buffer), q = 10, I = class I {
1137
+ ), gt = l.union([l.null(), l.undefined()]).transform(() => new Uint8Array().buffer), Y = 10, I = class I {
1131
1138
  constructor(t) {
1132
1139
  s(this, "key", "");
1133
1140
  s(this, "isSynnaxSeries", !0);
@@ -1159,102 +1166,102 @@ const Lt = l.union([
1159
1166
  s(this, "_cachedLength");
1160
1167
  /** Caches the indexes of the array for variable length data types. */
1161
1168
  s(this, "_cachedIndexes");
1162
- ht(t) && (t = { data: t });
1169
+ ct(t) && (t = { data: t });
1163
1170
  const {
1164
1171
  dataType: e,
1165
- timeRange: r,
1172
+ timeRange: n,
1166
1173
  sampleOffset: i = 0,
1167
1174
  glBufferUsage: f = "static",
1168
- alignment: h = 0n,
1169
- key: v = Q()
1175
+ alignment: c = 0n,
1176
+ key: S = Q()
1170
1177
  } = t, O = t.data ?? [];
1171
1178
  if (O instanceof I || typeof O == "object" && "isSynnaxSeries" in O && O.isSynnaxSeries === !0) {
1172
- const c = O;
1173
- this.key = c.key, this.dataType = c.dataType, this.sampleOffset = c.sampleOffset, this.gl = c.gl, this._data = c._data, this._timeRange = c._timeRange, this.alignment = c.alignment, this._cachedMin = c._cachedMin, this._cachedMax = c._cachedMax, this.writePos = c.writePos, this._refCount = c._refCount, this._cachedLength = c._cachedLength;
1179
+ const h = O;
1180
+ this.key = h.key, this.dataType = h.dataType, this.sampleOffset = h.sampleOffset, this.gl = h.gl, this._data = h._data, this._timeRange = h._timeRange, this.alignment = h.alignment, this._cachedMin = h._cachedMin, this._cachedMax = h._cachedMax, this.writePos = h.writePos, this._refCount = h._refCount, this._cachedLength = h._cachedLength;
1174
1181
  return;
1175
1182
  }
1176
- const N = tt(O), p = Array.isArray(O);
1183
+ const N = tt(O), v = Array.isArray(O);
1177
1184
  if (e != null) this.dataType = new g(e);
1178
1185
  else {
1179
1186
  if (O instanceof ArrayBuffer)
1180
1187
  throw new Error(
1181
1188
  "cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
1182
1189
  );
1183
- if (p || N) {
1184
- let c = O;
1190
+ if (v || N) {
1191
+ let h = O;
1185
1192
  if (!N) {
1186
1193
  if (O.length === 0)
1187
1194
  throw new Error(
1188
1195
  "cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
1189
1196
  );
1190
- c = O[0];
1197
+ h = O[0];
1191
1198
  }
1192
- if (typeof c == "string") this.dataType = g.STRING;
1193
- else if (typeof c == "number") this.dataType = g.FLOAT64;
1194
- else if (typeof c == "bigint") this.dataType = g.INT64;
1195
- else if (typeof c == "boolean") this.dataType = g.BOOLEAN;
1196
- else if (c instanceof m || c instanceof Date || c instanceof m)
1199
+ if (typeof h == "string") this.dataType = g.STRING;
1200
+ else if (typeof h == "number") this.dataType = g.FLOAT64;
1201
+ else if (typeof h == "bigint") this.dataType = g.INT64;
1202
+ else if (typeof h == "boolean") this.dataType = g.BOOLEAN;
1203
+ else if (h instanceof m || h instanceof Date || h instanceof m)
1197
1204
  this.dataType = g.TIMESTAMP;
1198
- else if (typeof c == "object") this.dataType = g.JSON;
1205
+ else if (typeof h == "object") this.dataType = g.JSON;
1199
1206
  else
1200
1207
  throw new Error(
1201
- `cannot infer data type of ${typeof c} when constructing a Series from a JS array`
1208
+ `cannot infer data type of ${typeof h} when constructing a Series from a JS array`
1202
1209
  );
1203
1210
  } else this.dataType = new g(O);
1204
1211
  }
1205
- if (!p && !N) this._data = O;
1212
+ if (!v && !N) this._data = O;
1206
1213
  else {
1207
- let c = N ? [O] : O;
1208
- const M = c[0];
1209
- (M instanceof m || M instanceof Date || M instanceof w) && (c = c.map((U) => new m(U).valueOf())), this.dataType.equals(g.STRING) ? (this._cachedLength = c.length, this._data = new TextEncoder().encode(`${c.join(`
1214
+ let h = N ? [O] : O;
1215
+ const M = h[0];
1216
+ (M instanceof m || M instanceof Date || M instanceof w) && (h = h.map((U) => new m(U).valueOf())), this.dataType.equals(g.STRING) ? (this._cachedLength = h.length, this._data = new TextEncoder().encode(`${h.join(`
1210
1217
  `)}
1211
- `).buffer) : this.dataType.equals(g.JSON) ? (this._cachedLength = c.length, this._data = new TextEncoder().encode(
1212
- `${c.map((U) => $.encodeString(U)).join(`
1218
+ `).buffer) : this.dataType.equals(g.JSON) ? (this._cachedLength = h.length, this._data = new TextEncoder().encode(
1219
+ `${h.map((U) => q.encodeString(U)).join(`
1213
1220
  `)}
1214
1221
  `
1215
- ).buffer) : this._data = new this.dataType.Array(c).buffer;
1222
+ ).buffer) : this._data = new this.dataType.Array(h).buffer;
1216
1223
  }
1217
- this.key = v, this.alignment = h, this.sampleOffset = i ?? 0, this._timeRange = r, this.gl = {
1224
+ this.key = S, this.alignment = c, this.sampleOffset = i ?? 0, this._timeRange = n, this.gl = {
1218
1225
  control: null,
1219
1226
  buffer: null,
1220
1227
  prevBuffer: 0,
1221
1228
  bufferUsage: f
1222
1229
  };
1223
1230
  }
1224
- static alloc({ capacity: t, dataType: e, ...r }) {
1231
+ static alloc({ capacity: t, dataType: e, ...n }) {
1225
1232
  if (t === 0)
1226
1233
  throw new Error("[Series] - cannot allocate an array of length 0");
1227
1234
  const i = new new g(e).Array(t), f = new I({
1228
1235
  data: i.buffer,
1229
1236
  dataType: e,
1230
- ...r
1237
+ ...n
1231
1238
  });
1232
1239
  return f.writePos = 0, f;
1233
1240
  }
1234
- static generateTimestamps(t, e, r) {
1235
- const i = r.spanRange(e.span(t)), f = new BigInt64Array(t);
1236
- for (let h = 0; h < t; h++)
1237
- f[h] = BigInt(r.add(e.span(h)).valueOf());
1241
+ static generateTimestamps(t, e, n) {
1242
+ const i = n.spanRange(e.span(t)), f = new BigInt64Array(t);
1243
+ for (let c = 0; c < t; c++)
1244
+ f[c] = BigInt(n.add(e.span(c)).valueOf());
1238
1245
  return new I({ data: f, dataType: g.TIMESTAMP, timeRange: i });
1239
1246
  }
1240
1247
  get refCount() {
1241
1248
  return this._refCount;
1242
1249
  }
1243
1250
  static fromStrings(t, e) {
1244
- const r = new TextEncoder().encode(
1251
+ const n = new TextEncoder().encode(
1245
1252
  `${t.join(`
1246
1253
  `)}
1247
1254
  `
1248
1255
  );
1249
- return new I({ data: r, dataType: g.STRING, timeRange: e });
1256
+ return new I({ data: n, dataType: g.STRING, timeRange: e });
1250
1257
  }
1251
1258
  static fromJSON(t, e) {
1252
- const r = new TextEncoder().encode(
1253
- `${t.map((i) => $.encodeString(i)).join(`
1259
+ const n = new TextEncoder().encode(
1260
+ `${t.map((i) => q.encodeString(i)).join(`
1254
1261
  `)}
1255
1262
  `
1256
1263
  );
1257
- return new I({ data: r, dataType: g.JSON, timeRange: e });
1264
+ return new I({ data: n, dataType: g.JSON, timeRange: e });
1258
1265
  }
1259
1266
  acquire(t) {
1260
1267
  this._refCount++, t != null && this.updateGLBuffer(t);
@@ -1280,13 +1287,13 @@ const Lt = l.union([
1280
1287
  }
1281
1288
  writeVariable(t) {
1282
1289
  if (this.writePos === B) return 0;
1283
- const e = this.byteCapacity.valueOf() - this.writePos, r = t.subBytes(0, e);
1284
- return this.writeToUnderlyingData(r), this.writePos += r.byteLength.valueOf(), this._cachedLength != null && (this._cachedLength += r.length, this.calculateCachedLength()), r.length;
1290
+ const e = this.byteCapacity.valueOf() - this.writePos, n = t.subBytes(0, e);
1291
+ return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this._cachedLength != null && (this._cachedLength += n.length, this.calculateCachedLength()), n.length;
1285
1292
  }
1286
1293
  writeFixed(t) {
1287
1294
  if (this.writePos === B) return 0;
1288
- const e = this.capacity - this.writePos, r = t.sub(0, e);
1289
- return this.writeToUnderlyingData(r), this._cachedLength = void 0, this.maybeRecomputeMinMax(r), this.writePos += r.length, r.length;
1295
+ const e = this.capacity - this.writePos, n = t.sub(0, e);
1296
+ return this.writeToUnderlyingData(n), this._cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
1290
1297
  }
1291
1298
  writeToUnderlyingData(t) {
1292
1299
  this.underlyingData.set(
@@ -1315,20 +1322,20 @@ const Lt = l.union([
1315
1322
  if (!this.dataType.equals(g.UUID))
1316
1323
  throw new Error("cannot convert non-uuid series to uuids");
1317
1324
  const t = g.UUID.density.valueOf(), e = Array(this.length);
1318
- for (let r = 0; r < this.length; r++) {
1319
- const i = this.underlyingData.slice(r * t, (r + 1) * t), f = Array.from(
1325
+ for (let n = 0; n < this.length; n++) {
1326
+ const i = this.underlyingData.slice(n * t, (n + 1) * t), f = Array.from(
1320
1327
  new Uint8Array(i.buffer),
1321
- (h) => h.toString(16).padStart(2, "0")
1328
+ (c) => c.toString(16).padStart(2, "0")
1322
1329
  ).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/, "$1-$2-$3-$4-$5");
1323
- e[r] = f;
1330
+ e[n] = f;
1324
1331
  }
1325
1332
  return e;
1326
1333
  }
1327
1334
  parseJSON(t) {
1328
1335
  if (!this.dataType.equals(g.JSON))
1329
- throw new Error("cannot convert non-string series to strings");
1336
+ throw new Error("cannot parse non-JSON series as JSON");
1330
1337
  return new TextDecoder().decode(this.underlyingData).split(`
1331
- `).slice(0, -1).map((e) => t.parse($.decodeString(e)));
1338
+ `).slice(0, -1).map((e) => t.parse(q.decodeString(e)));
1332
1339
  }
1333
1340
  /** @returns the time range of this array. */
1334
1341
  get timeRange() {
@@ -1356,8 +1363,8 @@ const Lt = l.union([
1356
1363
  throw new Error("cannot calculate length of a non-variable length data type");
1357
1364
  let t = 0;
1358
1365
  const e = [0];
1359
- return this.data.forEach((r, i) => {
1360
- r === q && (t++, e.push(i + 1));
1366
+ return this.data.forEach((n, i) => {
1367
+ n === Y && (t++, e.push(i + 1));
1361
1368
  }), this._cachedIndexes = e, this._cachedLength = t, t;
1362
1369
  }
1363
1370
  /**
@@ -1371,11 +1378,11 @@ const Lt = l.union([
1371
1378
  */
1372
1379
  convert(t, e = 0) {
1373
1380
  if (this.dataType.equals(t)) return this;
1374
- const r = new t.Array(this.length);
1381
+ const n = new t.Array(this.length);
1375
1382
  for (let i = 0; i < this.length; i++)
1376
- r[i] = ct(this.dataType, t, this.data[i], e);
1383
+ n[i] = ht(this.dataType, t, this.data[i], e);
1377
1384
  return new I({
1378
- data: r.buffer,
1385
+ data: n.buffer,
1379
1386
  dataType: t,
1380
1387
  timeRange: this._timeRange,
1381
1388
  sampleOffset: e,
@@ -1389,10 +1396,10 @@ const Lt = l.union([
1389
1396
  this._cachedMax = this.data[this.data.length - 1];
1390
1397
  else if (this.dataType.usesBigInt) {
1391
1398
  const t = this.data;
1392
- this._cachedMax = t.reduce((e, r) => e > r ? e : r);
1399
+ this._cachedMax = t.reduce((e, n) => e > n ? e : n);
1393
1400
  } else {
1394
1401
  const t = this.data;
1395
- this._cachedMax = t.reduce((e, r) => e > r ? e : r);
1402
+ this._cachedMax = t.reduce((e, n) => e > n ? e : n);
1396
1403
  }
1397
1404
  return this._cachedMax;
1398
1405
  }
@@ -1407,10 +1414,10 @@ const Lt = l.union([
1407
1414
  if (this.dataType.equals(g.TIMESTAMP)) this._cachedMin = this.data[0];
1408
1415
  else if (this.dataType.usesBigInt) {
1409
1416
  const t = this.data;
1410
- this._cachedMin = t.reduce((e, r) => e < r ? e : r);
1417
+ this._cachedMin = t.reduce((e, n) => e < n ? e : n);
1411
1418
  } else {
1412
1419
  const t = this.data;
1413
- this._cachedMin = t.reduce((e, r) => e < r ? e : r);
1420
+ this._cachedMin = t.reduce((e, n) => e < n ? e : n);
1414
1421
  }
1415
1422
  return this._cachedMin;
1416
1423
  }
@@ -1441,46 +1448,44 @@ const Lt = l.union([
1441
1448
  return C(this.max, -this.min);
1442
1449
  }
1443
1450
  atAlignment(t, e) {
1444
- const r = Number(t - this.alignment);
1445
- if (r < 0 || r >= this.length) {
1446
- if (e === !0) throw new Error(`[series] - no value at index ${r}`);
1451
+ const n = Number(t - this.alignment);
1452
+ if (n < 0 || n >= this.length) {
1453
+ if (e === !0) throw new Error(`[series] - no value at index ${n}`);
1447
1454
  return;
1448
1455
  }
1449
- return this.at(r, e);
1456
+ return this.at(n, e);
1450
1457
  }
1451
1458
  at(t, e) {
1452
1459
  if (this.dataType.isVariable) return this.atVariable(t, e ?? !1);
1453
1460
  t < 0 && (t = this.length + t);
1454
- const r = this.data[t];
1455
- if (r == null) {
1461
+ const n = this.data[t];
1462
+ if (n == null) {
1456
1463
  if (e === !0) throw new Error(`[series] - no value at index ${t}`);
1457
1464
  return;
1458
1465
  }
1459
- return C(r, this.sampleOffset);
1466
+ return C(n, this.sampleOffset);
1460
1467
  }
1461
1468
  atVariable(t, e) {
1462
- let r = 0, i = 0;
1469
+ let n = 0, i = 0;
1463
1470
  if (this._cachedIndexes != null)
1464
- r = this._cachedIndexes[t], i = this._cachedIndexes[t + 1] - 1;
1471
+ n = this._cachedIndexes[t], i = this._cachedIndexes[t + 1] - 1;
1465
1472
  else {
1466
1473
  t < 0 && (t = this.length + t);
1467
- for (let h = 0; h < this.data.length; h++)
1468
- if (this.data[h] === q) {
1474
+ for (let c = 0; c < this.data.length; c++)
1475
+ if (this.data[c] === Y) {
1469
1476
  if (t === 0) {
1470
- i = h;
1477
+ i = c;
1471
1478
  break;
1472
1479
  }
1473
- r = h + 1, t--;
1480
+ n = c + 1, t--;
1474
1481
  }
1475
- if (i === 0 && (i = this.data.length), r >= i || t > 0) {
1482
+ if (i === 0 && (i = this.data.length), n >= i || t > 0) {
1476
1483
  if (e) throw new Error(`[series] - no value at index ${t}`);
1477
1484
  return;
1478
1485
  }
1479
1486
  }
1480
- const f = this.data.slice(r, i);
1481
- return this.dataType.equals(g.STRING) ? new TextDecoder().decode(f) : nt(
1482
- JSON.parse(new TextDecoder().decode(f))
1483
- );
1487
+ const f = this.data.slice(n, i);
1488
+ return this.dataType.equals(g.STRING) ? new TextDecoder().decode(f) : rt(JSON.parse(new TextDecoder().decode(f)));
1484
1489
  }
1485
1490
  /**
1486
1491
  * @returns the index of the first sample that is greater than or equal to the given value.
@@ -1488,29 +1493,29 @@ const Lt = l.union([
1488
1493
  * @param value the value to search for.
1489
1494
  */
1490
1495
  binarySearch(t) {
1491
- let e = 0, r = this.length - 1;
1496
+ let e = 0, n = this.length - 1;
1492
1497
  const i = st(t);
1493
- for (; e <= r; ) {
1494
- const f = Math.floor((e + r) / 2), h = i(this.at(f, !0), t);
1495
- if (h === 0) return f;
1496
- h < 0 ? e = f + 1 : r = f - 1;
1498
+ for (; e <= n; ) {
1499
+ const f = Math.floor((e + n) / 2), c = i(this.at(f, !0), t);
1500
+ if (c === 0) return f;
1501
+ c < 0 ? e = f + 1 : n = f - 1;
1497
1502
  }
1498
1503
  return e;
1499
1504
  }
1500
1505
  updateGLBuffer(t) {
1501
- if (this.gl.control = t, !this.dataType.equals(g.FLOAT32))
1502
- throw new Error("Only FLOAT32 arrays can be used in WebGL");
1503
- const { buffer: e, bufferUsage: r, prevBuffer: i } = this.gl;
1506
+ if (this.gl.control = t, !this.dataType.equals(g.FLOAT32) && !this.dataType.equals(g.UINT8))
1507
+ throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
1508
+ const { buffer: e, bufferUsage: n, prevBuffer: i } = this.gl;
1504
1509
  if (e == null && (this.gl.buffer = t.createBuffer()), this.writePos !== i)
1505
1510
  if (t.bindBuffer(t.ARRAY_BUFFER, this.gl.buffer), this.writePos !== B) {
1506
1511
  i === 0 && t.bufferData(t.ARRAY_BUFFER, this.byteCapacity.valueOf(), t.STATIC_DRAW);
1507
- const f = this.dataType.density.size(i).valueOf(), h = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
1508
- t.bufferSubData(t.ARRAY_BUFFER, f, h.buffer), this.gl.prevBuffer = this.writePos;
1512
+ const f = this.dataType.density.size(i).valueOf(), c = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
1513
+ t.bufferSubData(t.ARRAY_BUFFER, f, c.buffer), this.gl.prevBuffer = this.writePos;
1509
1514
  } else
1510
1515
  t.bufferData(
1511
1516
  t.ARRAY_BUFFER,
1512
1517
  this.buffer,
1513
- r === "static" ? t.STATIC_DRAW : t.DYNAMIC_DRAW
1518
+ n === "static" ? t.STATIC_DRAW : t.DYNAMIC_DRAW
1514
1519
  ), this.gl.prevBuffer = B;
1515
1520
  }
1516
1521
  as(t) {
@@ -1584,10 +1589,10 @@ const Lt = l.union([
1584
1589
  return this.sliceSub(!0, t, e);
1585
1590
  }
1586
1591
  subIterator(t, e) {
1587
- return new G(this, t, e ?? this.length);
1592
+ return new V(this, t, e ?? this.length);
1588
1593
  }
1589
1594
  subAlignmentIterator(t, e) {
1590
- return new G(
1595
+ return new V(
1591
1596
  this,
1592
1597
  Number(t - this.alignment),
1593
1598
  Number(e - this.alignment)
@@ -1595,9 +1600,9 @@ const Lt = l.union([
1595
1600
  }
1596
1601
  subBytes(t, e) {
1597
1602
  if (t >= 0 && (e == null || e >= this.byteLength.valueOf())) return this;
1598
- const r = this.data.subarray(t, e);
1603
+ const n = this.data.subarray(t, e);
1599
1604
  return new I({
1600
- data: r,
1605
+ data: n,
1601
1606
  dataType: this.dataType,
1602
1607
  timeRange: this._timeRange,
1603
1608
  sampleOffset: this.sampleOffset,
@@ -1605,10 +1610,10 @@ const Lt = l.union([
1605
1610
  alignment: this.alignment + BigInt(t)
1606
1611
  });
1607
1612
  }
1608
- sliceSub(t, e, r) {
1609
- if (e <= 0 && (r == null || r >= this.length)) return this;
1613
+ sliceSub(t, e, n) {
1614
+ if (e <= 0 && (n == null || n >= this.length)) return this;
1610
1615
  let i;
1611
- return t ? i = this.data.subarray(e, r) : i = this.data.slice(e, r), new I({
1616
+ return t ? i = this.data.subarray(e, n) : i = this.data.slice(e, n), new I({
1612
1617
  data: i,
1613
1618
  dataType: this.dataType,
1614
1619
  timeRange: this._timeRange,
@@ -1640,15 +1645,15 @@ s(I, "crudeZ", l.object({
1640
1645
  ]),
1641
1646
  glBufferUsage: ft.optional().default("static").optional()
1642
1647
  })), s(I, "z", I.crudeZ.transform((t) => new I(t)));
1643
- let V = I;
1644
- class G {
1645
- constructor(t, e, r) {
1648
+ let Z = I;
1649
+ class V {
1650
+ constructor(t, e, n) {
1646
1651
  s(this, "series");
1647
1652
  s(this, "end");
1648
1653
  s(this, "index");
1649
1654
  this.series = t;
1650
1655
  const i = L(0, t.length);
1651
- this.end = k(i, r), this.index = k(i, e);
1656
+ this.end = G(i, n), this.index = G(i, e);
1652
1657
  }
1653
1658
  next() {
1654
1659
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
@@ -1670,9 +1675,9 @@ class mt {
1670
1675
  }
1671
1676
  next() {
1672
1677
  const t = this.index, e = this.series.data;
1673
- for (; this.index < e.length && e[this.index] !== q; ) this.index++;
1674
- const r = this.index;
1675
- return t === r ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(t, r)) });
1678
+ for (; this.index < e.length && e[this.index] !== Y; ) this.index++;
1679
+ const n = this.index;
1680
+ return t === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(t, n)) });
1676
1681
  }
1677
1682
  [Symbol.iterator]() {
1678
1683
  return this;
@@ -1689,7 +1694,7 @@ class Ot {
1689
1694
  const t = this.wrapped.next();
1690
1695
  return t.done === !0 ? { done: !0, value: void 0 } : {
1691
1696
  done: !1,
1692
- value: $.decodeString(t.value)
1697
+ value: q.decodeString(t.value)
1693
1698
  };
1694
1699
  }
1695
1700
  [(j = Symbol.iterator, W = Symbol.toStringTag, j)]() {
@@ -1720,8 +1725,8 @@ class Dt {
1720
1725
  s(this, "series");
1721
1726
  if (t.length !== 0) {
1722
1727
  const e = t[0].dataType;
1723
- for (let r = 1; r < t.length; r++)
1724
- if (!t[r].dataType.equals(e))
1728
+ for (let n = 1; n < t.length; n++)
1729
+ if (!t[n].dataType.equals(e))
1725
1730
  throw new Error("[multi-series] - series must have the same data type");
1726
1731
  }
1727
1732
  this.series = t;
@@ -1762,60 +1767,60 @@ class Dt {
1762
1767
  if (e) throw new Error(`[series] - no value at alignment ${t}`);
1763
1768
  return;
1764
1769
  }
1765
- for (const r of this.series)
1766
- if (D(r.alignmentBounds, t))
1767
- return r.atAlignment(t, e);
1770
+ for (const n of this.series)
1771
+ if (D(n.alignmentBounds, t))
1772
+ return n.atAlignment(t, e);
1768
1773
  if (e) throw new Error(`[series] - no value at alignment ${t}`);
1769
1774
  }
1770
1775
  at(t, e = !1) {
1771
1776
  t < 0 && (t = this.length + t);
1772
- for (const r of this.series) {
1773
- if (t < r.length) return r.at(t, e);
1774
- t -= r.length;
1777
+ for (const n of this.series) {
1778
+ if (t < n.length) return n.at(t, e);
1779
+ t -= n.length;
1775
1780
  }
1776
1781
  if (e) throw new Error(`[series] - no value at index ${t}`);
1777
1782
  }
1778
1783
  subIterator(t, e) {
1779
- return new P(this, t, e ?? this.length);
1784
+ return new F(this, t, e ?? this.length);
1780
1785
  }
1781
1786
  subAlignmentIterator(t, e) {
1782
1787
  if (t >= this.alignmentBounds.upper || e <= this.alignmentBounds.lower)
1783
- return Y;
1784
- let r = 0;
1788
+ return P;
1789
+ let n = 0;
1785
1790
  for (let f = 0; f < this.series.length; f++) {
1786
- const h = this.series[f];
1787
- if (t < h.alignment) break;
1788
- if (t >= h.alignmentBounds.upper) r += h.length;
1789
- else if (D(h.alignmentBounds, t)) {
1790
- r += Number(t - h.alignment);
1791
+ const c = this.series[f];
1792
+ if (t < c.alignment) break;
1793
+ if (t >= c.alignmentBounds.upper) n += c.length;
1794
+ else if (D(c.alignmentBounds, t)) {
1795
+ n += Number(t - c.alignment);
1791
1796
  break;
1792
1797
  }
1793
1798
  }
1794
1799
  let i = 0;
1795
1800
  for (let f = 0; f < this.series.length; f++) {
1796
- const h = this.series[f];
1797
- if (e < h.alignment) break;
1798
- if (e >= h.alignmentBounds.upper) i += h.length;
1799
- else if (D(h.alignmentBounds, e)) {
1800
- i += Number(e - h.alignment);
1801
+ const c = this.series[f];
1802
+ if (e < c.alignment) break;
1803
+ if (e >= c.alignmentBounds.upper) i += c.length;
1804
+ else if (D(c.alignmentBounds, e)) {
1805
+ i += Number(e - c.alignment);
1801
1806
  break;
1802
1807
  }
1803
1808
  }
1804
- return new P(this, r, i);
1809
+ return new F(this, n, i);
1805
1810
  }
1806
1811
  subAlignmentSpanIterator(t, e) {
1807
- if (t >= this.alignmentBounds.upper) return Y;
1808
- let r = 0;
1812
+ if (t >= this.alignmentBounds.upper) return P;
1813
+ let n = 0;
1809
1814
  for (let i = 0; i < this.series.length; i++) {
1810
1815
  const f = this.series[i];
1811
1816
  if (t < f.alignment) break;
1812
- if (t >= f.alignmentBounds.upper) r += f.length;
1817
+ if (t >= f.alignmentBounds.upper) n += f.length;
1813
1818
  else if (D(f.alignmentBounds, t)) {
1814
- r += Number(t - f.alignment);
1819
+ n += Number(t - f.alignment);
1815
1820
  break;
1816
1821
  }
1817
1822
  }
1818
- return new P(this, r, r + e);
1823
+ return new F(this, n, n + e);
1819
1824
  }
1820
1825
  get byteLength() {
1821
1826
  return new x(this.series.reduce((t, e) => t + e.byteLength.valueOf(), 0));
@@ -1823,17 +1828,22 @@ class Dt {
1823
1828
  get data() {
1824
1829
  const t = new this.dataType.Array(this.length);
1825
1830
  let e = 0;
1826
- for (const r of this.series)
1827
- t.set(r.data, e), e += r.length;
1831
+ for (const n of this.series)
1832
+ t.set(n.data, e), e += n.length;
1828
1833
  return new this.dataType.Array(t.buffer);
1829
1834
  }
1830
1835
  traverseAlignment(t, e) {
1831
- const r = this.series.map((i) => i.alignmentBounds);
1832
- return it(r, t, e);
1836
+ const n = this.series.map((i) => i.alignmentBounds);
1837
+ return it(n, t, e);
1833
1838
  }
1834
1839
  distance(t, e) {
1835
- const r = this.series.map((i) => i.alignmentBounds);
1836
- return at(r, t, e);
1840
+ const n = this.series.map((i) => i.alignmentBounds);
1841
+ return at(n, t, e);
1842
+ }
1843
+ parseJSON(t) {
1844
+ if (!this.dataType.equals(g.JSON))
1845
+ throw new Error("cannot parse non-JSON series as JSON");
1846
+ return this.series.flatMap((e) => e.parseJSON(t));
1837
1847
  }
1838
1848
  [Symbol.iterator]() {
1839
1849
  return this.series.length === 0 ? {
@@ -1860,12 +1870,12 @@ class yt {
1860
1870
  return this;
1861
1871
  }
1862
1872
  }
1863
- class P {
1864
- constructor(t, e, r) {
1873
+ class F {
1874
+ constructor(t, e, n) {
1865
1875
  s(this, "series");
1866
1876
  s(this, "index");
1867
1877
  s(this, "end");
1868
- this.series = t, this.end = r, this.index = e;
1878
+ this.series = t, this.end = n, this.index = e;
1869
1879
  }
1870
1880
  next() {
1871
1881
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
@@ -1881,8 +1891,8 @@ const J = (o) => {
1881
1891
  export {
1882
1892
  b as D,
1883
1893
  Dt as M,
1884
- F as R,
1885
- V as S,
1894
+ $ as R,
1895
+ Z as S,
1886
1896
  m as T,
1887
1897
  C as a,
1888
1898
  w as b,
@@ -1890,9 +1900,9 @@ export {
1890
1900
  g as d,
1891
1901
  x as e,
1892
1902
  tt as f,
1893
- ct as g,
1903
+ ht as g,
1894
1904
  xt as h,
1895
- ht as i,
1905
+ ct as i,
1896
1906
  Ct as s,
1897
1907
  Lt as t
1898
1908
  };