@synnaxlabs/pluto 0.44.3 → 0.44.5

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 (153) hide show
  1. package/dist/Animated-BDoJWl9g.cjs +1 -0
  2. package/dist/{Animated-BHxq6Pmm.js → Animated-fI-NFaha.js} +2 -2
  3. package/dist/{symbols-aLnytgtc.js → Editable-C1g_CFYk.js} +5898 -5888
  4. package/dist/{symbols-DWZqHjhU.cjs → Editable-DUtJOqJ5.cjs} +41 -41
  5. package/dist/{LinePlot-BJ10hKs7.cjs → LinePlot-6cl8_hmn.cjs} +5 -5
  6. package/dist/{LinePlot-VIcFjuPQ.js → LinePlot-Ck0rhtFk.js} +712 -728
  7. package/dist/{Toggle-C--I90ch.js → Toggle-DEJ8Uvun.js} +1 -1
  8. package/dist/Toggle-DUKDeqpe.cjs +1 -0
  9. package/dist/{Video-DdsVXhnt.js → Video-B6tujjr8.js} +1 -1
  10. package/dist/{Video-BbRLzkdH.cjs → Video-BjRd9sFv.cjs} +1 -1
  11. package/dist/button.cjs +1 -1
  12. package/dist/button.js +1 -1
  13. package/dist/color.cjs +1 -1
  14. package/dist/color.js +1 -1
  15. package/dist/css-DI0uCCGq.cjs +8 -0
  16. package/dist/{css-BKrX40Df.js → css-DvIPI3Qm.js} +1383 -1252
  17. package/dist/css.cjs +1 -1
  18. package/dist/css.js +2 -2
  19. package/dist/dialog.cjs +1 -1
  20. package/dist/dialog.js +1 -1
  21. package/dist/eraser-B03ej59l.cjs +63 -0
  22. package/dist/{eraser-DtXU7kOS.js → eraser-CnRJY__h.js} +4999 -4687
  23. package/dist/ether.cjs +1 -1
  24. package/dist/ether.js +6 -6
  25. package/dist/{external-BT0nByPv.js → external-B3dPSZUg.js} +7 -8
  26. package/dist/external-BEd3F7zY.cjs +1 -0
  27. package/dist/external-BS9S-b49.cjs +1 -0
  28. package/dist/external-BVDQNHbo.cjs +1 -0
  29. package/dist/external-BenP6Hcm.cjs +1 -0
  30. package/dist/external-Blrrgnzw.cjs +1 -0
  31. package/dist/{external-tHxdTvxn.js → external-BzV_PGNe.js} +2 -2
  32. package/dist/{external-ONwuyKzG.js → external-C2iqWGd2.js} +22 -22
  33. package/dist/external-CAAPXpVr.cjs +1 -0
  34. package/dist/{external-n4gJTJfw.js → external-CKhbbig_.js} +15 -15
  35. package/dist/external-CNF5TNBY.cjs +1 -0
  36. package/dist/{external-Bt-WjDvD.js → external-D16M7vHB.js} +9 -9
  37. package/dist/{external-dkXc0y5z.js → external-D6hAP7eJ.js} +7 -7
  38. package/dist/external-D98a3YQJ.cjs +1 -0
  39. package/dist/external-DKh0JhWO.cjs +1 -0
  40. package/dist/external-DNO3FJLl.cjs +1 -0
  41. package/dist/{external-yddEc8os.cjs → external-DOEaBrpz.cjs} +2 -2
  42. package/dist/external-DRuZ24L7.js +78 -0
  43. package/dist/{external-CEMgElRx.js → external-Daage1AI.js} +10 -10
  44. package/dist/{external-BApQK7XP.js → external-Db9iKa8k.js} +3 -3
  45. package/dist/{external-BmfZaFKB.js → external-Dfr7xymv.js} +3 -3
  46. package/dist/external-DwRvB5ZT.cjs +1 -0
  47. package/dist/{external-NUi5IwGn.js → external-GR-20z_c.js} +14 -14
  48. package/dist/external-I_-aclFy.cjs +1 -0
  49. package/dist/{external-Dgui980d.js → external-R9a28aP6.js} +24 -24
  50. package/dist/{external-Dwfn2jsF.js → external-dew29Q0v.js} +9 -9
  51. package/dist/flex.cjs +1 -1
  52. package/dist/flex.js +1 -1
  53. package/dist/{fontString-D2-HUuI_.js → fontString-CW0wLG5g.js} +2 -2
  54. package/dist/{fontString-BWGnZU-8.cjs → fontString-aK--tYMM.cjs} +1 -1
  55. package/dist/header.cjs +1 -1
  56. package/dist/header.js +1 -1
  57. package/dist/index.cjs +7 -7
  58. package/dist/index.js +6084 -5944
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +1 -1
  61. package/dist/list.cjs +1 -1
  62. package/dist/list.js +1 -1
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/channel/queries.d.ts.map +1 -1
  67. package/dist/src/flux/form.d.ts +39 -10
  68. package/dist/src/flux/form.d.ts.map +1 -1
  69. package/dist/src/flux/retrieve.d.ts +4 -2
  70. package/dist/src/flux/retrieve.d.ts.map +1 -1
  71. package/dist/src/flux/update.d.ts +13 -0
  72. package/dist/src/flux/update.d.ts.map +1 -1
  73. package/dist/src/form/Context.d.ts +6 -2
  74. package/dist/src/form/Context.d.ts.map +1 -1
  75. package/dist/src/form/state.d.ts +1 -0
  76. package/dist/src/form/state.d.ts.map +1 -1
  77. package/dist/src/form/use.d.ts.map +1 -1
  78. package/dist/src/hardware/device/queries.d.ts.map +1 -1
  79. package/dist/src/hardware/rack/queries.d.ts.map +1 -1
  80. package/dist/src/hardware/task/queries.d.ts +22 -1
  81. package/dist/src/hardware/task/queries.d.ts.map +1 -1
  82. package/dist/src/icon/registry.d.ts +1 -0
  83. package/dist/src/icon/registry.d.ts.map +1 -1
  84. package/dist/src/label/queries.d.ts.map +1 -1
  85. package/dist/src/mosaic/Mosaic.d.ts +1 -1
  86. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  87. package/dist/src/ontology/queries.d.ts.map +1 -1
  88. package/dist/src/ranger/queries.d.ts +3 -3
  89. package/dist/src/ranger/queries.d.ts.map +1 -1
  90. package/dist/src/select/Button.d.ts +3 -2
  91. package/dist/src/select/Button.d.ts.map +1 -1
  92. package/dist/src/select/use.d.ts +7 -4
  93. package/dist/src/select/use.d.ts.map +1 -1
  94. package/dist/src/showcase/TextShowcase.d.ts.map +1 -1
  95. package/dist/src/status/Summary.d.ts.map +1 -1
  96. package/dist/src/synnax/Provider.d.ts.map +1 -1
  97. package/dist/src/synnax/aether/provider.d.ts +6 -6
  98. package/dist/src/telem/aether/remote.d.ts +4 -4
  99. package/dist/src/telem/aether/transformers.d.ts +0 -2
  100. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  101. package/dist/src/telem/aether/transformers.spec.d.ts +2 -0
  102. package/dist/src/telem/aether/transformers.spec.d.ts.map +1 -0
  103. package/dist/src/text/external.d.ts +0 -1
  104. package/dist/src/text/external.d.ts.map +1 -1
  105. package/dist/src/triggers/Text.d.ts.map +1 -1
  106. package/dist/src/triggers/triggers.d.ts +3 -0
  107. package/dist/src/triggers/triggers.d.ts.map +1 -1
  108. package/dist/src/viewport/SelectMode.d.ts +10 -2
  109. package/dist/src/viewport/SelectMode.d.ts.map +1 -1
  110. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  111. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  112. package/dist/src/vis/line/aether/line.d.ts +0 -1
  113. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  114. package/dist/src/vis/lineplot/Legend.d.ts.map +1 -1
  115. package/dist/src/vis/lineplot/aether/XAxis.d.ts +2 -2
  116. package/dist/src/vis/lineplot/aether/YAxis.d.ts +2 -2
  117. package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
  118. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  119. package/dist/tabs.cjs +1 -1
  120. package/dist/tabs.js +1 -1
  121. package/dist/text.cjs +1 -1
  122. package/dist/text.js +2 -2
  123. package/dist/theming.cjs +1 -1
  124. package/dist/theming.js +2 -2
  125. package/dist/tree.cjs +1 -1
  126. package/dist/tree.js +1 -1
  127. package/dist/triggers.cjs +1 -1
  128. package/dist/triggers.js +1 -1
  129. package/dist/{units-ny6lkoIv.js → units-Dh7MflIZ.js} +3 -3
  130. package/dist/units-WWUmv-rf.cjs +1 -0
  131. package/dist/video.cjs +1 -1
  132. package/dist/video.js +1 -1
  133. package/package.json +6 -6
  134. package/dist/Animated-DEXELMDa.cjs +0 -1
  135. package/dist/Toggle-CCsw0kkq.cjs +0 -1
  136. package/dist/css-TyQvZIXQ.cjs +0 -8
  137. package/dist/eraser-Bxknv-HS.cjs +0 -63
  138. package/dist/external-BBXhtVjD.cjs +0 -1
  139. package/dist/external-BOmNpcyI.js +0 -75
  140. package/dist/external-BPF50O_x.cjs +0 -1
  141. package/dist/external-BUAnicLg.cjs +0 -1
  142. package/dist/external-BaRBYE0N.cjs +0 -1
  143. package/dist/external-BsyCwXWB.cjs +0 -1
  144. package/dist/external-COBt6FnN.cjs +0 -1
  145. package/dist/external-CZSk2V5E.cjs +0 -1
  146. package/dist/external-Cw5iYImi.cjs +0 -1
  147. package/dist/external-EMhi5ISu.cjs +0 -1
  148. package/dist/external-Jee63xkv.cjs +0 -1
  149. package/dist/external-TAYJZFme.cjs +0 -1
  150. package/dist/external-bvOijYCw.cjs +0 -1
  151. package/dist/src/text/symbols.d.ts +0 -3
  152. package/dist/src/text/symbols.d.ts.map +0 -1
  153. package/dist/units-XE06scfL.cjs +0 -1
@@ -1,45 +1,45 @@
1
- import x, { z as a } from "zod";
2
- const rn = (t) => {
1
+ import S, { z as a } from "zod";
2
+ const ln = (t) => {
3
3
  const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
4
4
  return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
5
- }, lt = (t) => {
6
- const e = (r, n = Ge) => {
5
+ }, pt = (t) => {
6
+ const e = (r, n = _e) => {
7
7
  if (typeof r == "string") return t(r);
8
8
  if (Array.isArray(r)) return r.map((o) => e(o, n));
9
- if (!Fe(r)) return r;
10
- n = an(n);
9
+ if (!He(r)) return r;
10
+ n = fn(n);
11
11
  const s = {}, i = r;
12
12
  return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
13
13
  let c = i[o];
14
- const l = t(o);
15
- n.recursive && (Fe(c) ? Rt(c) || (c = e(c, n)) : n.recursiveInArray && jt(c) && (c = [...c].map((h) => {
16
- let g = h;
17
- return Fe(h) ? Rt(g) || (g = e(h, n)) : jt(h) && (g = e({ key: h }, n).key), g;
18
- }))), s[l] = c;
14
+ const h = t(o);
15
+ n.recursive && (He(c) ? zt(c) || (c = e(c, n)) : n.recursiveInArray && kt(c) && (c = [...c].map((l) => {
16
+ let d = l;
17
+ return He(l) ? zt(d) || (d = e(l, n)) : kt(l) && (d = e({ key: l }, n).key), d;
18
+ }))), s[h] = c;
19
19
  }), s);
20
20
  };
21
21
  return e;
22
- }, ct = lt(rn), nn = (t) => (
22
+ }, mt = pt(ln), cn = (t) => (
23
23
  // Don't convert the first character and don't convert a character that is after a
24
24
  // non-alphanumeric character
25
25
  t.replace(
26
26
  /([a-z0-9])([A-Z])/g,
27
27
  (e, r, n) => `${r}_${n.toLowerCase()}`
28
28
  )
29
- ), Ft = lt(nn), Zt = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), sn = [Number, String, Uint8Array], Ge = {
29
+ ), Gt = pt(cn), Ht = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), hn = [Number, String, Uint8Array], _e = {
30
30
  recursive: !0,
31
31
  recursiveInArray: !0
32
- }, an = (t = Ge) => (t.recursive == null ? t = Ge : t.recursiveInArray ??= !1, t), jt = (t) => t != null && Array.isArray(t), Fe = (t) => t != null && typeof t == "object" && !Array.isArray(t), Rt = (t) => sn.some((e) => t instanceof e), on = (t) => t.replace(/\s+/g, "-").replace(
32
+ }, fn = (t = _e) => (t.recursive == null ? t = _e : t.recursiveInArray ??= !1, t), kt = (t) => t != null && Array.isArray(t), He = (t) => t != null && typeof t == "object" && !Array.isArray(t), zt = (t) => hn.some((e) => t instanceof e), dn = (t) => t.replace(/\s+/g, "-").replace(
33
33
  /([a-z0-9])([A-Z])/g,
34
34
  (e, r, n) => `${r}-${n.toLowerCase()}`
35
- ).toLowerCase(), un = lt(on), fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
+ ).toLowerCase(), gn = pt(dn), wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36
36
  __proto__: null,
37
- camelToSnake: Ft,
38
- capitalize: Zt,
39
- snakeToCamel: ct,
40
- toKebab: un
37
+ camelToSnake: Gt,
38
+ capitalize: Ht,
39
+ snakeToCamel: mt,
40
+ toKebab: gn
41
41
  }, Symbol.toStringTag, { value: "Module" }));
42
- let ln = class {
42
+ let pn = class {
43
43
  contentType = "application/json";
44
44
  decoder;
45
45
  encoder;
@@ -53,15 +53,15 @@ let ln = class {
53
53
  return this.decodeString(this.decoder.decode(e), r);
54
54
  }
55
55
  decodeString(e, r) {
56
- const n = JSON.parse(e), s = ct(n);
56
+ const n = JSON.parse(e), s = mt(n);
57
57
  return r != null ? r.parse(s) : s;
58
58
  }
59
59
  encodeString(e) {
60
- const r = Ft(e);
60
+ const r = Gt(e);
61
61
  return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
62
62
  }
63
63
  };
64
- const He = new ln(), Je = (t) => [...new Set(t)], cn = (t, e, r = !0) => {
64
+ const et = new pn(), tt = (t) => [...new Set(t)], mn = (t, e, r = !0) => {
65
65
  const n = /* @__PURE__ */ new Map();
66
66
  return t.forEach((s) => {
67
67
  const i = e(s);
@@ -71,12 +71,12 @@ const He = new ln(), Je = (t) => [...new Set(t)], cn = (t, e, r = !0) => {
71
71
  }
72
72
  n.set(i, s);
73
73
  }), Array.from(n.values());
74
- }, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
+ }, vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
75
  __proto__: null,
76
- by: cn,
77
- unique: Je
76
+ by: mn,
77
+ unique: tt
78
78
  }, Symbol.toStringTag, { value: "Module" }));
79
- let J = class {
79
+ let _ = class {
80
80
  /** The underlying primitive value */
81
81
  value;
82
82
  constructor(e) {
@@ -96,8 +96,8 @@ let J = class {
96
96
  return this.value.toString();
97
97
  }
98
98
  };
99
- const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t) => {
100
- if (ht(t)) return t?.toString().length === 0;
99
+ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t) => {
100
+ if (yt(t)) return t?.toString().length === 0;
101
101
  switch (typeof t) {
102
102
  case "string":
103
103
  return t.length === 0;
@@ -114,14 +114,14 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t)
114
114
  default:
115
115
  return !1;
116
116
  }
117
- }, hn = (t) => !Yt(t), mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
117
+ }, yn = (t) => !Jt(t), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
118
  __proto__: null,
119
- ValueExtension: J,
120
- isNonZero: hn,
121
- isStringer: ht,
122
- isZero: Yt
123
- }, Symbol.toStringTag, { value: "Module" })), Be = (t, e = !1) => {
124
- const r = ht(t) ? "stringer" : typeof t;
119
+ ValueExtension: _,
120
+ isNonZero: yn,
121
+ isStringer: yt,
122
+ isZero: Jt
123
+ }, Symbol.toStringTag, { value: "Module" })), De = (t, e = !1) => {
124
+ const r = yt(t) ? "stringer" : typeof t;
125
125
  let n;
126
126
  switch (r) {
127
127
  case "string":
@@ -145,69 +145,80 @@ const ht = (t) => t != null && typeof t == "object" && "toString" in t, Yt = (t)
145
145
  default:
146
146
  return console.warn(`sortFunc: unknown type ${r}`), () => -1;
147
147
  }
148
- return e ? Wt(n) : n;
149
- }, fn = (t, e, r) => {
150
- const n = Be(e[t], r);
148
+ return e ? Kt(n) : n;
149
+ }, bn = (t, e, r) => {
150
+ const n = De(e[t], r);
151
151
  return (s, i) => n(s[t], i[t]);
152
- }, dn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Vt = (t, e) => {
152
+ }, wn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Xt = (t, e) => {
153
153
  if (t.length !== e.length) return t.length - e.length;
154
154
  if (t.length === 0) return 0;
155
- const r = Be(t[0]), n = [...t].sort(r), s = [...e].sort(r);
155
+ const r = De(t[0]), n = [...t].sort(r), s = [...e].sort(r);
156
156
  return n.every((i, o) => i === s[o]) ? 0 : -1;
157
- }, gn = (t, e) => {
158
- const r = Je(t), n = Je(e);
159
- return Vt(r, n);
160
- }, pn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Wt = (t) => (e, r) => t(r, e), ee = 0, xe = -1, $e = 1, Gt = (t) => t < ee, Ht = (t) => t > ee, yn = (t) => t >= ee, Jt = (t) => t === ee, mn = (t, e) => {
157
+ }, On = (t, e) => {
158
+ const r = tt(t), n = tt(e);
159
+ return Xt(r, n);
160
+ }, vn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Kt = (t) => (e, r) => t(r, e), ne = 0, Ie = -1, Me = 1, Qt = (t) => t < ne, _t = (t) => t > ne, Tn = (t) => t >= ne, er = (t) => t === ne, xn = (t, e) => {
161
161
  const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
162
162
  if (!n || !s) return 0;
163
163
  for (let i = 0; i < Math.min(n.length, s.length); i++) {
164
164
  const o = n[i], c = s[i];
165
165
  if (isNaN(Number(o)) && isNaN(Number(c))) {
166
- const l = o.localeCompare(c);
167
- if (l !== 0) return l;
166
+ const h = o.localeCompare(c);
167
+ if (h !== 0) return h;
168
168
  } else if (!isNaN(Number(o)) && !isNaN(Number(c))) {
169
- const l = Number(o) - Number(c);
170
- if (l !== 0) return l;
169
+ const h = Number(o) - Number(c);
170
+ if (h !== 0) return h;
171
171
  } else return isNaN(Number(o)) ? -1 : 1;
172
172
  }
173
173
  return n.length - s.length;
174
- }, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174
+ }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
175
175
  __proto__: null,
176
- EQUAL: ee,
177
- GREATER_THAN: $e,
178
- LESS_THAN: xe,
179
- isEqualTo: Jt,
180
- isGreaterThan: Ht,
181
- isGreaterThanEqual: yn,
182
- isLessThan: Gt,
183
- newF: Be,
184
- newFieldF: fn,
185
- order: pn,
186
- primitiveArrays: dn,
187
- reverseF: Wt,
188
- stringsWithNumbers: mn,
189
- uniqueUnorderedPrimitiveArrays: gn,
190
- unorderedPrimitiveArrays: Vt
191
- }, Symbol.toStringTag, { value: "Module" })), Ue = a.tuple([a.number(), a.number()]);
176
+ EQUAL: ne,
177
+ GREATER_THAN: Me,
178
+ LESS_THAN: Ie,
179
+ isEqualTo: er,
180
+ isGreaterThan: _t,
181
+ isGreaterThanEqual: Tn,
182
+ isLessThan: Qt,
183
+ newF: De,
184
+ newFieldF: bn,
185
+ order: vn,
186
+ primitiveArrays: wn,
187
+ reverseF: Kt,
188
+ stringsWithNumbers: xn,
189
+ uniqueUnorderedPrimitiveArrays: On,
190
+ unorderedPrimitiveArrays: Xt
191
+ }, Symbol.toStringTag, { value: "Module" })), Pe = a.tuple([a.number(), a.number()]);
192
192
  a.tuple([a.bigint(), a.bigint()]);
193
- const ft = a.object({ width: a.number(), height: a.number() }), bn = a.object({
193
+ const bt = a.object({ width: a.number(), height: a.number() }), $n = a.object({
194
194
  signedWidth: a.number(),
195
195
  signedHeight: a.number()
196
- }), wn = ["width", "height"];
197
- a.enum(wn);
198
- const On = ["start", "center", "end"], vn = ["signedWidth", "signedHeight"];
199
- a.enum(vn);
200
- const he = a.object({ x: a.number(), y: a.number() }), Xt = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], dt = a.enum(Ce), Kt = ["top", "right", "bottom", "left"], Tn = a.enum(Kt), je = ["left", "right"], gt = a.enum(je), Re = ["top", "bottom"], pt = a.enum(Re), yt = ["center"], Xe = a.enum(yt), xn = [...Kt, ...yt], mt = a.enum(xn);
201
- a.enum(On);
202
- const $n = ["first", "last"];
203
- a.enum($n);
204
- const Qt = a.object({ lower: a.number(), upper: a.number() }), Sn = a.object({ lower: a.bigint(), upper: a.bigint() });
205
- a.union([Qt, Ue]);
206
- a.union([Sn, Ue]);
207
- const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.instanceof(String)]), ae = (t, e) => typeof t == "bigint" ? t - BigInt(e) : t - Number(e), _t = (t, e) => typeof t == "bigint" ? t + BigInt(e) : t + Number(e), Mn = (t, e, r = 1e-4) => Math.abs(t - e) < r, Ke = (t, e) => typeof t == "bigint" ? t === BigInt(e) : t === Number(e), En = (t) => {
196
+ }), Sn = ["width", "height"];
197
+ a.enum(Sn);
198
+ const Nn = ["start", "center", "end"], In = ["signedWidth", "signedHeight"];
199
+ a.enum(In);
200
+ const ge = a.object({ x: a.number(), y: a.number() }), tr = a.object({ clientX: a.number(), clientY: a.number() }), qe = ["x", "y"], wt = a.enum(qe), rr = ["top", "right", "bottom", "left"], Mn = a.enum(rr), ke = ["left", "right"], Ot = a.enum(ke), ze = ["top", "bottom"], vt = a.enum(ze), Tt = ["center"], rt = a.enum(Tt), En = [...rr, ...Tt], xt = a.enum(En);
201
+ a.enum(Nn);
202
+ const An = ["first", "last"];
203
+ a.enum(An);
204
+ const nr = a.object({ lower: a.number(), upper: a.number() }), Bn = a.object({ lower: a.bigint(), upper: a.bigint() });
205
+ a.union([nr, Pe]);
206
+ a.union([Bn, Pe]);
207
+ const Un = a.enum([...wt.options, ...xt.options]), Cn = a.union([wt, xt, a.instanceof(String)]), se = (t) => (e, r) => {
208
+ if (typeof e == "bigint") {
209
+ if (je(r))
210
+ return t(e, BigInt(r));
211
+ const n = t(Number(e), Number(r));
212
+ return typeof n == "number" ? BigInt(Math.round(n)) : n;
213
+ }
214
+ return t(Number(e), Number(r));
215
+ }, P = se((t, e) => t - e), ie = se((t, e) => t + e), jn = (t, e, r = 1e-4) => Math.abs(t - e) < r, nt = (t, e) => {
216
+ const r = typeof t == "bigint", n = typeof e == "bigint";
217
+ return r && n ? t === e : r && je(e) ? t === BigInt(e) : n && je(t) ? e === BigInt(t) : t === e;
218
+ }, Rn = (t) => {
208
219
  const e = 10 ** Math.floor(Math.log10(t));
209
220
  return Math.round(t / e) * e;
210
- }, er = (t, e) => t <= e ? t : typeof t == "bigint" ? t <= e ? t : BigInt(e) : t <= e ? t : Number(e), An = (t, e) => typeof t == "bigint" ? t >= e ? t : BigInt(e) : t >= e ? t : Number(e), tr = (t) => t < 0 ? -t : t, Y = (t, e) => typeof t == "bigint" ? t * BigInt(e) : t * Number(e), Bn = (t, e) => typeof t == "bigint" ? t / BigInt(e) : t / Number(e), y = (t, e, r) => {
221
+ }, sr = se((t, e) => t <= e ? t : e), je = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Ln = se((t, e) => t >= e ? t : e), ir = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, B = se((t, e) => t * e), we = se((t, e) => t / e), y = (t, e, r) => {
211
222
  const n = {};
212
223
  if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
213
224
  e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
@@ -216,64 +227,64 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
216
227
  [n.lower, n.upper] = t;
217
228
  } else
218
229
  n.lower = t.lower, n.upper = t.upper;
219
- return r?.makeValid ? rr(n) : n;
220
- }, Un = Object.freeze({ lower: 0, upper: 0 }), Cn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), jn = Object.freeze({ lower: 0, upper: 1 }), Rn = Object.freeze({ lower: -1, upper: 1 }), Ln = (t, e) => {
230
+ return r?.makeValid ? ar(n) : n;
231
+ }, Dn = Object.freeze({ lower: 0, upper: 0 }), Pn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), qn = Object.freeze({ lower: 0, upper: 1 }), kn = Object.freeze({ lower: -1, upper: 1 }), zn = (t, e) => {
221
232
  if (t == null && e == null) return !0;
222
233
  if (t == null || e == null) return !1;
223
234
  const r = y(t), n = y(e);
224
235
  return r?.lower === n?.lower && r?.upper === n?.upper;
225
- }, rr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Qe = (t, e) => {
236
+ }, ar = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, st = (t, e) => {
226
237
  const r = y(t);
227
238
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
228
- }, I = (t, e) => {
239
+ }, U = (t, e) => {
229
240
  const r = y(t);
230
241
  if (typeof e == "number" || typeof e == "bigint")
231
242
  return e >= r.lower && e < r.upper;
232
243
  const n = y(e);
233
244
  return n.lower >= r.lower && n.upper <= r.upper;
234
- }, Dn = (t, e) => {
245
+ }, Fn = (t, e) => {
235
246
  const r = y(t), n = y(e);
236
- return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : I(r, n.upper) || I(r, n.lower) || I(n, r.upper) || I(n, r.lower);
237
- }, ye = (t) => {
247
+ return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : U(r, n.upper) || U(r, n.lower) || U(n, r.upper) || U(n, r.lower);
248
+ }, Oe = (t) => {
238
249
  const e = y(t);
239
250
  return e.upper - e.lower;
240
- }, Pn = (t) => {
251
+ }, Zn = (t) => {
241
252
  const e = y(t);
242
253
  return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
243
- }, qn = (t) => {
244
- const e = ye(t);
254
+ }, Yn = (t) => {
255
+ const e = Oe(t);
245
256
  return typeof e == "number" ? e === 0 : e === 0n;
246
- }, kn = (t) => {
257
+ }, Wn = (t) => {
247
258
  const e = y(t);
248
259
  return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
249
- }, zn = (t) => {
260
+ }, Vn = (t) => {
250
261
  const e = y(t);
251
262
  return (e.upper + e.lower) / 2;
252
- }, nr = (t) => ({
263
+ }, or = (t) => ({
253
264
  lower: Math.min(...t.map((e) => y(e).lower)),
254
265
  upper: Math.max(...t.map((e) => y(e).upper))
255
- }), Fn = (t) => ({
266
+ }), Gn = (t) => ({
256
267
  lower: Math.max(...t.map((e) => y(e).lower)),
257
268
  upper: Math.min(...t.map((e) => y(e).upper))
258
- }), Zn = (t) => {
269
+ }), Hn = (t) => {
259
270
  const e = y(t), r = typeof e.lower == "bigint";
260
- return Array.from({ length: Number(ye(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
261
- }, _e = (t, e) => {
262
- const r = t.map((i) => y(i)), n = r.findIndex((i) => I(i, e) || e < i.lower);
271
+ return Array.from({ length: Number(Oe(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
272
+ }, it = (t, e) => {
273
+ const r = t.map((i) => y(i)), n = r.findIndex((i) => U(i, e) || e < i.lower);
263
274
  if (n === -1) return { index: t.length, position: 0 };
264
275
  const s = r[n];
265
- return I(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
266
- }, Ze = {
276
+ return U(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
277
+ }, Je = {
267
278
  removeBefore: 0,
268
279
  removeAfter: 0,
269
280
  insertInto: 0,
270
281
  deleteInBetween: 0
271
- }, Yn = (t, e) => {
272
- const r = t.map((h) => y(h)), n = y(e);
273
- if (r.length === 0) return Ze;
274
- const s = _e(r, n.lower), i = _e(r, n.upper);
275
- if (s.index === t.length) return { ...Ze, insertInto: t.length };
276
- if (i.index === 0) return { ...Ze, removeAfter: i.position };
282
+ }, Jn = (t, e) => {
283
+ const r = t.map((l) => y(l)), n = y(e);
284
+ if (r.length === 0) return Je;
285
+ const s = it(r, n.lower), i = it(r, n.upper);
286
+ if (s.index === t.length) return { ...Je, insertInto: t.length };
287
+ if (i.index === 0) return { ...Je, removeAfter: i.position };
277
288
  if (s.index === i.index)
278
289
  return s.position !== 0 && i.position !== 0 ? null : {
279
290
  removeAfter: i.position,
@@ -281,314 +292,314 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
281
292
  insertInto: s.index,
282
293
  deleteInBetween: 0
283
294
  };
284
- let o = i.index - s.index, c = s.index, l = ae(Number(ye(r[s.index])), s.position);
285
- return s.position !== 0 ? (o -= 1, c += 1) : l = 0, {
286
- removeBefore: l,
295
+ let o = i.index - s.index, c = s.index, h = P(Number(Oe(r[s.index])), s.position);
296
+ return s.position !== 0 ? (o -= 1, c += 1) : h = 0, {
297
+ removeBefore: h,
287
298
  removeAfter: i.position,
288
299
  insertInto: c,
289
300
  deleteInBetween: o
290
301
  };
291
- }, sr = (t, e, r) => {
302
+ }, ur = (t, e, r) => {
292
303
  const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
293
304
  if (s === 0) return e;
294
305
  let i = r, o = e;
295
- for (; Ke(i, 0) === !1; ) {
296
- const c = n.findIndex((l) => s > 0 ? o >= l.lower && o < l.upper : o > l.lower && o <= l.upper);
306
+ for (; nt(i, 0) === !1; ) {
307
+ const c = n.findIndex((h) => s > 0 ? o >= h.lower && o < h.upper : o > h.lower && o <= h.upper);
297
308
  if (c !== -1) {
298
- const l = n[c];
299
- let h;
300
- if (s > 0 ? h = ae(l.upper, o) : h = ae(o, l.lower), h > 0) {
301
- const g = er(tr(i), h);
302
- if (o = _t(
309
+ const h = n[c];
310
+ let l;
311
+ if (s > 0 ? l = P(h.upper, o) : l = P(o, h.lower), l > 0) {
312
+ const d = sr(ir(i), l);
313
+ if (o = ie(
303
314
  o,
304
- s > 0 ? g : -g
305
- ), i = ae(i, s > 0 ? g : -g), Ke(i, 0)) return o;
315
+ s > 0 ? d : -d
316
+ ), i = P(i, s > 0 ? d : -d), nt(i, 0)) return o;
306
317
  continue;
307
318
  }
308
319
  }
309
320
  if (s > 0) {
310
- const l = n.filter((h) => h.lower > o);
311
- if (l.length > 0) o = l[0].lower;
321
+ const h = n.filter((l) => l.lower > o);
322
+ if (h.length > 0) o = h[0].lower;
312
323
  else return o;
313
324
  } else {
314
- const l = n.filter((h) => h.upper < o);
315
- if (l.length > 0)
316
- o = l[l.length - 1].upper;
325
+ const h = n.filter((l) => l.upper < o);
326
+ if (h.length > 0)
327
+ o = h[h.length - 1].upper;
317
328
  else return o;
318
329
  }
319
330
  }
320
331
  return o;
321
- }, ir = (t, e, r) => {
332
+ }, lr = (t, e, r) => {
322
333
  const n = t.map((o) => y(o));
323
334
  if (e === r) return typeof e == "bigint" ? 0n : 0;
324
335
  const s = e < r ? y([e, r]) : y([r, e]);
325
336
  let i = typeof e == "bigint" ? 0n : 0;
326
337
  for (const o of n) {
327
- const c = o.lower > s.lower ? o.lower : s.lower, l = o.upper < s.upper ? o.upper : s.upper;
328
- if (c < l) {
329
- const h = l - c;
330
- i = i + h;
338
+ const c = o.lower > s.lower ? o.lower : s.lower, h = o.upper < s.upper ? o.upper : s.upper;
339
+ if (c < h) {
340
+ const l = h - c;
341
+ i = i + l;
331
342
  }
332
343
  }
333
344
  return i;
334
- }, wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
345
+ }, So = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
335
346
  __proto__: null,
336
- CLIP: Rn,
337
- DECIMAL: jn,
338
- INFINITE: Cn,
339
- ZERO: Un,
340
- bounds: Qt,
341
- buildInsertionPlan: Yn,
342
- clamp: Qe,
347
+ CLIP: kn,
348
+ DECIMAL: qn,
349
+ INFINITE: Pn,
350
+ ZERO: Dn,
351
+ bounds: nr,
352
+ buildInsertionPlan: Jn,
353
+ clamp: st,
343
354
  construct: y,
344
- contains: I,
345
- distance: ir,
346
- equals: Ln,
347
- findInsertPosition: _e,
348
- isFinite: kn,
349
- isZero: Pn,
350
- linspace: Zn,
351
- makeValid: rr,
352
- max: nr,
353
- mean: zn,
354
- min: Fn,
355
- overlapsWith: Dn,
356
- span: ye,
357
- spanIsZero: qn,
358
- traverse: sr
359
- }, Symbol.toStringTag, { value: "Module" })), ar = Nn, Z = (t) => Ce.includes(t) ? t : Re.includes(t) ? "y" : "x", Vn = (t) => Z(t) === "x" ? "y" : "x", Wn = (t) => Z(t) === "x" ? "width" : "height", Gn = (t) => Z(t) === "x" ? "left" : "top", Hn = (t) => ar.safeParse(t).success, Jn = (t) => Z(t) === "x" ? "signedWidth" : "signedHeight", Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
355
+ contains: U,
356
+ distance: lr,
357
+ equals: zn,
358
+ findInsertPosition: it,
359
+ isFinite: Wn,
360
+ isZero: Zn,
361
+ linspace: Hn,
362
+ makeValid: ar,
363
+ max: or,
364
+ mean: Vn,
365
+ min: Gn,
366
+ overlapsWith: Fn,
367
+ span: Oe,
368
+ spanIsZero: Yn,
369
+ traverse: ur
370
+ }, Symbol.toStringTag, { value: "Module" })), cr = Un, H = (t) => qe.includes(t) ? t : ze.includes(t) ? "y" : "x", Xn = (t) => H(t) === "x" ? "y" : "x", Kn = (t) => H(t) === "x" ? "width" : "height", Qn = (t) => H(t) === "x" ? "left" : "top", _n = (t) => cr.safeParse(t).success, es = (t) => H(t) === "x" ? "signedWidth" : "signedHeight", ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
360
371
  __proto__: null,
361
- DIRECTIONS: Ce,
362
- construct: Z,
363
- crude: ar,
364
- dimension: Wn,
365
- direction: dt,
366
- isDirection: Hn,
367
- location: Gn,
368
- signedDimension: Jn,
369
- swap: Vn
370
- }, Symbol.toStringTag, { value: "Module" })), Kn = gt, Qn = pt, _n = Xe, es = {
372
+ DIRECTIONS: qe,
373
+ construct: H,
374
+ crude: cr,
375
+ dimension: Kn,
376
+ direction: wt,
377
+ isDirection: _n,
378
+ location: Qn,
379
+ signedDimension: es,
380
+ swap: Xn
381
+ }, Symbol.toStringTag, { value: "Module" })), rs = Ot, ns = vt, ss = rt, is = {
371
382
  top: "bottom",
372
383
  right: "left",
373
384
  bottom: "top",
374
385
  left: "right",
375
386
  center: "center"
376
- }, ts = {
387
+ }, as = {
377
388
  top: "left",
378
389
  right: "top",
379
390
  bottom: "right",
380
391
  left: "bottom",
381
392
  center: "center"
382
- }, rs = In, k = (t) => t instanceof String || !Ce.includes(t) ? t : t === "x" ? "left" : "top", ns = (t) => es[k(t)], ss = (t) => ts[k(t)], fe = (t) => {
383
- const e = k(t);
393
+ }, os = Cn, W = (t) => t instanceof String || !qe.includes(t) ? t : t === "x" ? "left" : "top", us = (t) => is[W(t)], ls = (t) => as[W(t)], pe = (t) => {
394
+ const e = W(t);
384
395
  return e === "top" || e === "bottom" ? "y" : "x";
385
- }, is = a.object({
386
- x: gt.or(Xe),
387
- y: pt.or(Xe)
388
- }), or = a.object({ x: gt, y: pt }), me = Object.freeze({ x: "left", y: "top" }), bt = Object.freeze({ x: "right", y: "top" }), Le = Object.freeze({ x: "left", y: "bottom" }), wt = Object.freeze({ x: "right", y: "bottom" }), Ot = Object.freeze({ x: "center", y: "center" }), vt = Object.freeze({ x: "center", y: "top" }), Tt = Object.freeze({ x: "center", y: "bottom" }), xt = Object.freeze({ x: "right", y: "center" }), $t = Object.freeze({ x: "left", y: "center" }), as = Object.freeze([
396
+ }, cs = a.object({
397
+ x: Ot.or(rt),
398
+ y: vt.or(rt)
399
+ }), hr = a.object({ x: Ot, y: vt }), ve = Object.freeze({ x: "left", y: "top" }), $t = Object.freeze({ x: "right", y: "top" }), Fe = Object.freeze({ x: "left", y: "bottom" }), St = Object.freeze({ x: "right", y: "bottom" }), Nt = Object.freeze({ x: "center", y: "center" }), It = Object.freeze({ x: "center", y: "top" }), Mt = Object.freeze({ x: "center", y: "bottom" }), Et = Object.freeze({ x: "right", y: "center" }), At = Object.freeze({ x: "left", y: "center" }), hs = Object.freeze([
400
+ At,
401
+ Et,
402
+ It,
403
+ Mt,
404
+ ve,
389
405
  $t,
390
- xt,
391
- vt,
392
- Tt,
393
- me,
394
- bt,
395
- Le,
396
- wt,
397
- Ot
398
- ]), St = (t, e) => t.x === e.x && t.y === e.y, os = (t, e) => {
406
+ Fe,
407
+ St,
408
+ Nt
409
+ ]), Bt = (t, e) => t.x === e.x && t.y === e.y, fs = (t, e) => {
399
410
  if (typeof e == "object") {
400
411
  let r = !0;
401
412
  return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
402
413
  }
403
414
  return t.x === e || t.y === e;
404
- }, ur = (t) => [t.x, t.y], Se = (t) => fe(k(t)) === "x", us = (t) => fe(k(t)) === "y", ls = (t) => `${t.x}${Zt(t.y)}`, cs = (t, e) => {
415
+ }, fr = (t) => [t.x, t.y], Ee = (t) => pe(W(t)) === "x", ds = (t) => pe(W(t)) === "y", gs = (t) => `${t.x}${Ht(t.y)}`, ps = (t, e) => {
405
416
  let r, n;
406
- if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = k(t), n = k(e ?? t)), fe(r) === fe(n) && r !== "center" && n !== "center")
417
+ if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = W(t), n = W(e ?? t)), pe(r) === pe(n) && r !== "center" && n !== "center")
407
418
  throw new Error(
408
419
  `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
409
420
  );
410
- const s = { ...Ot };
411
- return r === "center" ? Se(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
412
- }, hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
421
+ const s = { ...Nt };
422
+ return r === "center" ? Ee(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
423
+ }, ms = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
413
424
  __proto__: null,
414
- BOTTOM_CENTER: Tt,
415
- BOTTOM_LEFT: Le,
416
- BOTTOM_RIGHT: wt,
417
- CENTER: Ot,
418
- CENTER_LEFT: $t,
419
- CENTER_LOCATIONS: yt,
420
- CENTER_RIGHT: xt,
421
- TOP_CENTER: vt,
422
- TOP_LEFT: me,
423
- TOP_RIGHT: bt,
424
- XY_LOCATIONS: as,
425
- X_LOCATIONS: je,
426
- Y_LOCATIONS: Re,
427
- center: _n,
428
- construct: k,
429
- constructXY: cs,
430
- corner: or,
431
- crude: rs,
432
- direction: fe,
433
- isX: Se,
434
- isY: us,
435
- location: mt,
436
- outer: Tn,
437
- rotate90: ss,
438
- swap: ns,
439
- x: Kn,
440
- xy: is,
441
- xyCouple: ur,
442
- xyEquals: St,
443
- xyMatches: os,
444
- xyToString: ls,
445
- y: Qn
446
- }, Symbol.toStringTag, { value: "Module" })), et = a.union([
425
+ BOTTOM_CENTER: Mt,
426
+ BOTTOM_LEFT: Fe,
427
+ BOTTOM_RIGHT: St,
428
+ CENTER: Nt,
429
+ CENTER_LEFT: At,
430
+ CENTER_LOCATIONS: Tt,
431
+ CENTER_RIGHT: Et,
432
+ TOP_CENTER: It,
433
+ TOP_LEFT: ve,
434
+ TOP_RIGHT: $t,
435
+ XY_LOCATIONS: hs,
436
+ X_LOCATIONS: ke,
437
+ Y_LOCATIONS: ze,
438
+ center: ss,
439
+ construct: W,
440
+ constructXY: ps,
441
+ corner: hr,
442
+ crude: os,
443
+ direction: pe,
444
+ isX: Ee,
445
+ isY: ds,
446
+ location: xt,
447
+ outer: Mn,
448
+ rotate90: ls,
449
+ swap: us,
450
+ x: rs,
451
+ xy: cs,
452
+ xyCouple: fr,
453
+ xyEquals: Bt,
454
+ xyMatches: fs,
455
+ xyToString: gs,
456
+ y: ns
457
+ }, Symbol.toStringTag, { value: "Module" })), at = a.union([
447
458
  a.number(),
448
- he,
449
- Ue,
450
- ft,
451
- bn,
452
- Xt
453
- ]), v = (t, e) => {
459
+ ge,
460
+ Pe,
461
+ bt,
462
+ $n,
463
+ tr
464
+ ]), x = (t, e) => {
454
465
  if (typeof t == "string") {
455
466
  if (e === void 0) throw new Error("The y coordinate must be given.");
456
467
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
457
468
  }
458
469
  return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
459
- }, U = Object.freeze({ x: 0, y: 0 }), lr = Object.freeze({ x: 1, y: 1 }), fs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), ds = Object.freeze({ x: NaN, y: NaN }), Ae = (t, e, r = 0) => {
460
- const n = v(t), s = v(e);
470
+ }, D = Object.freeze({ x: 0, y: 0 }), dr = Object.freeze({ x: 1, y: 1 }), ys = Object.freeze({ x: 1 / 0, y: 1 / 0 }), bs = Object.freeze({ x: NaN, y: NaN }), Re = (t, e, r = 0) => {
471
+ const n = x(t), s = x(e);
461
472
  return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
462
- }, gs = (t) => Ae(t, U), Nt = (t, e, r) => {
463
- const n = v(t), s = v(e, r);
473
+ }, ws = (t) => Re(t, D), Ut = (t, e, r) => {
474
+ const n = x(t), s = x(e, r);
464
475
  return { x: n.x * s.x, y: n.y * s.y };
465
- }, cr = (t, e) => {
466
- const r = v(t);
476
+ }, gr = (t, e) => {
477
+ const r = x(t);
467
478
  return { x: r.x + e, y: r.y };
468
- }, hr = (t, e) => {
469
- const r = v(t);
479
+ }, pr = (t, e) => {
480
+ const r = x(t);
470
481
  return { x: r.x, y: r.y + e };
471
- }, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? cr(t, r) : hr(t, r) : [t, e, r ?? U, ...n].reduce((s, i) => {
472
- const o = v(i);
482
+ }, me = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? gr(t, r) : pr(t, r) : [t, e, r ?? D, ...n].reduce((s, i) => {
483
+ const o = x(i);
473
484
  return { x: s.x + o.x, y: s.y + o.y };
474
- }, U), ps = (t, e, r) => {
475
- const n = v(t);
485
+ }, D), Os = (t, e, r) => {
486
+ const n = x(t);
476
487
  return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
477
- }, ys = (t, e) => {
478
- const r = v(t), n = v(e);
488
+ }, vs = (t, e) => {
489
+ const r = x(t), n = x(e);
479
490
  return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
480
- }, ms = (t, e) => {
481
- const r = v(t), n = v(e);
491
+ }, Ts = (t, e) => {
492
+ const r = x(t), n = x(e);
482
493
  return { x: n.x - r.x, y: n.y - r.y };
483
- }, bs = (t) => {
484
- const e = v(t);
494
+ }, xs = (t) => {
495
+ const e = x(t);
485
496
  return Number.isNaN(e.x) || Number.isNaN(e.y);
486
- }, ws = (t) => {
487
- const e = v(t);
497
+ }, $s = (t) => {
498
+ const e = x(t);
488
499
  return Number.isFinite(e.x) && Number.isFinite(e.y);
489
- }, Os = (t) => {
490
- const e = v(t);
500
+ }, Ss = (t) => {
501
+ const e = x(t);
491
502
  return [e.x, e.y];
492
- }, vs = (t) => {
493
- const e = v(t);
503
+ }, Ns = (t) => {
504
+ const e = x(t);
494
505
  return { left: e.x, top: e.y };
495
- }, tt = (t, e = 0) => {
496
- const r = v(t);
506
+ }, ot = (t, e = 0) => {
507
+ const r = x(t);
497
508
  return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
498
- }, ne = (t, e) => {
499
- const r = v(t), n = v(e);
509
+ }, oe = (t, e) => {
510
+ const r = x(t), n = x(e);
500
511
  return { x: r.x - n.x, y: r.y - n.y };
501
- }, se = (t) => {
502
- const e = v(t), r = Math.hypot(e.x, e.y);
512
+ }, ue = (t) => {
513
+ const e = x(t), r = Math.hypot(e.x, e.y);
503
514
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
504
- }, fr = (t) => {
505
- const e = v(t), r = Math.hypot(e.x, e.y);
515
+ }, mr = (t) => {
516
+ const e = x(t), r = Math.hypot(e.x, e.y);
506
517
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
507
- }, dr = (...t) => {
508
- const e = t.reduce((r, n) => de(r, n), U);
509
- return Nt(e, 1 / t.length);
510
- }, Ts = (t, e) => {
518
+ }, yr = (...t) => {
519
+ const e = t.reduce((r, n) => me(r, n), D);
520
+ return Ut(e, 1 / t.length);
521
+ }, Is = (t, e) => {
511
522
  const r = [];
512
523
  for (let n = 0; n < t.length; n++) {
513
524
  const s = t[n];
514
- let i, o, c, l;
525
+ let i, o, c, h;
515
526
  if (n === 0) {
516
- const h = t[n + 1], g = ne(h, s);
517
- o = se(g), c = o, l = e;
527
+ const l = t[n + 1], d = oe(l, s);
528
+ o = ue(d), c = o, h = e;
518
529
  } else if (n === t.length - 1) {
519
- const h = t[n - 1], g = ne(s, h);
520
- i = se(g), c = i, l = e;
530
+ const l = t[n - 1], d = oe(s, l);
531
+ i = ue(d), c = i, h = e;
521
532
  } else {
522
- const h = t[n - 1], g = t[n + 1], p = ne(s, h), S = ne(g, s);
523
- i = se(p), o = se(S);
524
- const E = Math.acos(
525
- (p.x * S.x + p.y * S.y) / (Math.hypot(p.x, p.y) * Math.hypot(S.x, S.y))
526
- ), te = Math.sin(E / 2);
527
- te === 0 ? l = e : l = e / te, c = fr(dr(i, o));
533
+ const l = t[n - 1], d = t[n + 1], m = oe(s, l), p = oe(d, s);
534
+ i = ue(m), o = ue(p);
535
+ const j = Math.acos(
536
+ (m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
537
+ ), A = Math.sin(j / 2);
538
+ A === 0 ? h = e : h = e / A, c = mr(yr(i, o));
528
539
  }
529
- r.push(Nt(c, l));
540
+ r.push(Ut(c, h));
530
541
  }
531
542
  return r;
532
- }, xs = (t) => {
533
- const e = v(t);
543
+ }, Ms = (t) => {
544
+ const e = x(t);
534
545
  return { x: e.y, y: e.x };
535
- }, rt = (t) => {
536
- const e = v(t);
546
+ }, ut = (t) => {
547
+ const e = x(t);
537
548
  return { x: Math.round(e.x), y: Math.round(e.y) };
538
- }, Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
549
+ }, No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
539
550
  __proto__: null,
540
- INFINITY: fs,
541
- NAN: ds,
542
- ONE: lr,
543
- ZERO: U,
544
- average: dr,
545
- calculateMiters: Ts,
546
- clientXY: Xt,
547
- construct: v,
548
- couple: Os,
549
- crudeZ: et,
550
- css: vs,
551
- distance: ys,
552
- equals: Ae,
553
- isFinite: ws,
554
- isNan: bs,
555
- isZero: gs,
556
- normal: se,
557
- normalize: fr,
558
- round: rt,
559
- scale: Nt,
560
- set: ps,
561
- sub: ne,
562
- swap: xs,
563
- translate: de,
564
- translateX: cr,
565
- translateY: hr,
566
- translation: ms,
567
- truncate: tt,
568
- xy: he
569
- }, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]), $s = a.object({
570
- top: we,
571
- left: we,
572
- width: we,
573
- height: we
574
- }), Ss = a.object({
551
+ INFINITY: ys,
552
+ NAN: bs,
553
+ ONE: dr,
554
+ ZERO: D,
555
+ average: yr,
556
+ calculateMiters: Is,
557
+ clientXY: tr,
558
+ construct: x,
559
+ couple: Ss,
560
+ crudeZ: at,
561
+ css: Ns,
562
+ distance: vs,
563
+ equals: Re,
564
+ isFinite: $s,
565
+ isNan: xs,
566
+ isZero: ws,
567
+ normal: ue,
568
+ normalize: mr,
569
+ round: ut,
570
+ scale: Ut,
571
+ set: Os,
572
+ sub: oe,
573
+ swap: Ms,
574
+ translate: me,
575
+ translateX: gr,
576
+ translateY: pr,
577
+ translation: Ts,
578
+ truncate: ot,
579
+ xy: ge
580
+ }, Symbol.toStringTag, { value: "Module" })), xe = a.union([a.number(), a.string()]), Es = a.object({
581
+ top: xe,
582
+ left: xe,
583
+ width: xe,
584
+ height: xe
585
+ }), As = a.object({
575
586
  left: a.number(),
576
587
  top: a.number(),
577
588
  right: a.number(),
578
589
  bottom: a.number()
579
- }), Ns = a.object({
580
- one: he,
581
- two: he,
582
- root: or
583
- }), gr = { one: U, two: U, root: me }, Is = { one: U, two: lr, root: Le }, pr = (t, e) => ({
590
+ }), Bs = a.object({
591
+ one: ge,
592
+ two: ge,
593
+ root: hr
594
+ }), br = { one: D, two: D, root: ve }, Us = { one: D, two: dr, root: Fe }, wr = (t, e) => ({
584
595
  one: t.one,
585
596
  two: t.two,
586
597
  root: e ?? t.root
587
- }), O = (t, e, r = 0, n = 0, s) => {
598
+ }), T = (t, e, r = 0, n = 0, s) => {
588
599
  const i = {
589
- one: { ...U },
590
- two: { ...U },
591
- root: s ?? me
600
+ one: { ...D },
601
+ two: { ...D },
602
+ root: s ?? ve
592
603
  };
593
604
  if (typeof t == "number") {
594
605
  if (typeof e != "number")
@@ -602,219 +613,219 @@ const Nn = a.enum([...dt.options, ...mt.options]), In = a.union([dt, mt, a.insta
602
613
  x: i.one.x + e.signedWidth,
603
614
  y: i.one.y + e.signedHeight
604
615
  } : i.two = e, i));
605
- }, Ms = (t, e, r) => {
606
- const n = O(t);
616
+ }, Cs = (t, e, r) => {
617
+ const n = T(t);
607
618
  if (typeof e == "string") {
608
619
  if (r == null) throw new Error("Invalid arguments for resize");
609
- const s = Z(e);
610
- return O(
620
+ const s = H(e);
621
+ return T(
611
622
  n.one,
612
623
  void 0,
613
- s === "x" ? r : z(n),
614
- s === "y" ? r : F(n),
624
+ s === "x" ? r : V(n),
625
+ s === "y" ? r : G(n),
615
626
  n.root
616
627
  );
617
628
  }
618
- return O(n.one, e, void 0, void 0, n.root);
619
- }, Es = (t, e, r = !0) => {
620
- const n = O(t);
629
+ return T(n.one, e, void 0, void 0, n.root);
630
+ }, js = (t, e, r = !0) => {
631
+ const n = T(t);
621
632
  let s = (i, o) => i < o;
622
- return r && (s = (i, o) => i <= o), "one" in e ? s(P(n), P(e)) && s(W(e), W(n)) && s(q(n), q(e)) && s(G(e), G(n)) : s(P(n), e.x) && s(e.x, W(n)) && s(q(n), e.y) && s(e.y, G(n));
623
- }, As = (t, e) => Ae(t.one, e.one) && Ae(t.two, e.two) && St(t.root, e.root), yr = (t) => ({
624
- width: z(t),
625
- height: F(t)
626
- }), Bs = (t) => ({
627
- signedWidth: De(t),
628
- signedHeight: Pe(t)
629
- }), Us = (t) => ({
630
- top: q(t),
631
- left: P(t),
632
- width: z(t),
633
- height: F(t)
634
- }), It = (t, e, r = !1) => {
635
- const n = Z(e) === "y" ? Pe(t) : De(t);
633
+ return r && (s = (i, o) => i <= o), "one" in e ? s(Z(n), Z(e)) && s(X(e), X(n)) && s(Y(n), Y(e)) && s(K(e), K(n)) : s(Z(n), e.x) && s(e.x, X(n)) && s(Y(n), e.y) && s(e.y, K(n));
634
+ }, Rs = (t, e) => Re(t.one, e.one) && Re(t.two, e.two) && Bt(t.root, e.root), Or = (t) => ({
635
+ width: V(t),
636
+ height: G(t)
637
+ }), Ls = (t) => ({
638
+ signedWidth: Ze(t),
639
+ signedHeight: Ye(t)
640
+ }), Ds = (t) => ({
641
+ top: Y(t),
642
+ left: Z(t),
643
+ width: V(t),
644
+ height: G(t)
645
+ }), Ct = (t, e, r = !1) => {
646
+ const n = H(e) === "y" ? Ye(t) : Ze(t);
636
647
  return r ? n : Math.abs(n);
637
- }, j = (t, e) => {
638
- const r = O(t);
648
+ }, q = (t, e) => {
649
+ const r = T(t);
639
650
  return {
640
- x: e.x === "center" ? nt(r).x : H(r, e.x),
641
- y: e.y === "center" ? nt(r).y : H(r, e.y)
651
+ x: e.x === "center" ? lt(r).x : Q(r, e.x),
652
+ y: e.y === "center" ? lt(r).y : Q(r, e.y)
642
653
  };
643
- }, H = (t, e) => {
644
- const r = O(t), n = ur(r.root).includes(e) ? Math.min : Math.max;
645
- return je.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
646
- }, Cs = (t) => t.one.x === t.two.x && t.one.y === t.two.y, z = (t) => It(t, "x"), F = (t) => It(t, "y"), De = (t) => {
647
- const e = O(t);
654
+ }, Q = (t, e) => {
655
+ const r = T(t), n = fr(r.root).includes(e) ? Math.min : Math.max;
656
+ return ke.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
657
+ }, Ps = (t) => t.one.x === t.two.x && t.one.y === t.two.y, V = (t) => Ct(t, "x"), G = (t) => Ct(t, "y"), Ze = (t) => {
658
+ const e = T(t);
648
659
  return e.two.x - e.one.x;
649
- }, Pe = (t) => {
650
- const e = O(t);
660
+ }, Ye = (t) => {
661
+ const e = T(t);
651
662
  return e.two.y - e.one.y;
652
- }, mr = (t) => j(t, me), js = (t) => j(t, vt), Rs = (t) => j(t, bt), Ls = (t) => j(t, Le), Ds = (t) => j(t, Tt), Ps = (t) => j(t, wt), qs = (t) => j(t, $t), ks = (t) => j(t, xt), W = (t) => H(t, "right"), G = (t) => H(t, "bottom"), P = (t) => H(t, "left"), q = (t) => H(t, "top"), nt = (t) => de(mr(t), {
653
- x: De(t) / 2,
654
- y: Pe(t) / 2
655
- }), Mt = (t) => {
656
- const e = O(t);
657
- return e.root.x === "left" ? P(e) : W(e);
658
- }, Et = (t) => {
659
- const e = O(t);
660
- return e.root.y === "top" ? q(e) : G(e);
661
- }, zs = (t) => ({ x: Mt(t), y: Et(t) }), Ne = (t) => {
662
- const e = O(t);
663
+ }, vr = (t) => q(t, ve), qs = (t) => q(t, It), ks = (t) => q(t, $t), zs = (t) => q(t, Fe), Fs = (t) => q(t, Mt), Zs = (t) => q(t, St), Ys = (t) => q(t, At), Ws = (t) => q(t, Et), X = (t) => Q(t, "right"), K = (t) => Q(t, "bottom"), Z = (t) => Q(t, "left"), Y = (t) => Q(t, "top"), lt = (t) => me(vr(t), {
664
+ x: Ze(t) / 2,
665
+ y: Ye(t) / 2
666
+ }), jt = (t) => {
667
+ const e = T(t);
668
+ return e.root.x === "left" ? Z(e) : X(e);
669
+ }, Rt = (t) => {
670
+ const e = T(t);
671
+ return e.root.y === "top" ? Y(e) : K(e);
672
+ }, Vs = (t) => ({ x: jt(t), y: Rt(t) }), Ae = (t) => {
673
+ const e = T(t);
663
674
  return { lower: e.one.x, upper: e.two.x };
664
- }, Ie = (t) => {
665
- const e = O(t);
675
+ }, Be = (t) => {
676
+ const e = T(t);
666
677
  return { lower: e.one.y, upper: e.two.y };
667
- }, Fs = (t, e) => pr(t, e), Zs = (t, e) => {
668
- const r = O(t), n = je.includes(e) ? "x" : Re.includes(e) ? "y" : null;
678
+ }, Gs = (t, e) => wr(t, e), Hs = (t, e) => {
679
+ const r = T(t), n = ke.includes(e) ? "x" : ze.includes(e) ? "y" : null;
669
680
  if (n === null) throw new Error(`Invalid location: ${e}`);
670
681
  const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
671
682
  return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
672
- }, Ys = (t, e) => {
673
- const r = O(t), n = O(e), s = Mt(n) + (z(n) - z(r)) / 2, i = Et(n) + (F(n) - F(r)) / 2;
674
- return O({ x: s, y: i }, yr(r));
675
- }, br = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Vs = (t) => z(t) / F(t), Ws = (t, e, r) => {
683
+ }, Js = (t, e) => {
684
+ const r = T(t), n = T(e), s = jt(n) + (V(n) - V(r)) / 2, i = Rt(n) + (G(n) - G(r)) / 2;
685
+ return T({ x: s, y: i }, Or(r));
686
+ }, Tr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Xs = (t) => V(t) / G(t), Ks = (t, e, r) => {
676
687
  if (typeof e == "string") {
677
688
  if (r == null) throw new Error("Undefined amount passed into box.translate");
678
- const s = Z(e);
679
- e = v(s, r);
689
+ const s = H(e);
690
+ e = x(s, r);
680
691
  }
681
- const n = O(t);
682
- return O(
683
- de(n.one, e),
684
- de(n.two, e),
692
+ const n = T(t);
693
+ return T(
694
+ me(n.one, e),
695
+ me(n.two, e),
685
696
  void 0,
686
697
  void 0,
687
698
  n.root
688
699
  );
689
- }, Gs = (t, e) => {
690
- const r = Math.max(P(t), P(e)), n = Math.max(q(t), q(e)), s = Math.min(W(t), W(e)), i = Math.min(G(t), G(e));
691
- return r > s || n > i ? gr : O({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
692
- }, Hs = (t) => z(t) * F(t), Js = (t, e) => {
693
- const r = O(t);
694
- return O(
695
- tt(r.one, e),
696
- tt(r.two, e),
700
+ }, Qs = (t, e) => {
701
+ const r = Math.max(Z(t), Z(e)), n = Math.max(Y(t), Y(e)), s = Math.min(X(t), X(e)), i = Math.min(K(t), K(e));
702
+ return r > s || n > i ? br : T({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
703
+ }, _s = (t) => V(t) * G(t), ei = (t, e) => {
704
+ const r = T(t);
705
+ return T(
706
+ ot(r.one, e),
707
+ ot(r.two, e),
697
708
  void 0,
698
709
  void 0,
699
710
  r.root
700
711
  );
701
- }, Xs = (t, e, r, n, s, i) => {
712
+ }, ti = (t, e, r, n, s, i) => {
702
713
  const o = { x: t, y: e }, c = { x: t + r, y: e + n };
703
- return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), O(o, c, void 0, void 0, i);
704
- }, Ks = (t) => {
705
- const e = O(t);
706
- return O(rt(e.one), rt(e.two), void 0, void 0, e.root);
707
- }, vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
714
+ return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), T(o, c, void 0, void 0, i);
715
+ }, ri = (t) => {
716
+ const e = T(t);
717
+ return T(ut(e.one), ut(e.two), void 0, void 0, e.root);
718
+ }, Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
708
719
  __proto__: null,
709
- DECIMAL: Is,
710
- ZERO: gr,
711
- area: Hs,
712
- areaIsZero: Cs,
713
- aspect: Vs,
714
- bottom: G,
715
- bottomCenter: Ds,
716
- bottomLeft: Ls,
717
- bottomRight: Ps,
718
- box: Ns,
719
- center: nt,
720
- centerLeft: qs,
721
- centerRight: ks,
722
- construct: O,
723
- constructWithAlternateRoot: Xs,
724
- contains: Es,
725
- copy: pr,
726
- css: Us,
727
- cssBox: $s,
728
- dim: It,
729
- dims: yr,
730
- domRect: Ss,
731
- edgePoints: Zs,
732
- equals: As,
733
- height: F,
734
- intersection: Gs,
735
- isBox: br,
736
- left: P,
737
- loc: H,
738
- positionInCenter: Ys,
739
- reRoot: Fs,
740
- resize: Ms,
741
- right: W,
742
- root: zs,
743
- round: Ks,
744
- signedDims: Bs,
745
- signedHeight: Pe,
746
- signedWidth: De,
747
- top: q,
748
- topCenter: js,
749
- topLeft: mr,
750
- topRight: Rs,
751
- translate: Ws,
752
- truncate: Js,
753
- width: z,
754
- x: Mt,
755
- xBounds: Ne,
756
- xyLoc: j,
757
- y: Et,
758
- yBounds: Ie
759
- }, Symbol.toStringTag, { value: "Module" })), wr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Qs = a.union([ft, wr, he, Ue]), _s = { width: 0, height: 0 }, ei = { width: 1, height: 1 }, M = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, ti = (t, e) => {
720
+ DECIMAL: Us,
721
+ ZERO: br,
722
+ area: _s,
723
+ areaIsZero: Ps,
724
+ aspect: Xs,
725
+ bottom: K,
726
+ bottomCenter: Fs,
727
+ bottomLeft: zs,
728
+ bottomRight: Zs,
729
+ box: Bs,
730
+ center: lt,
731
+ centerLeft: Ys,
732
+ centerRight: Ws,
733
+ construct: T,
734
+ constructWithAlternateRoot: ti,
735
+ contains: js,
736
+ copy: wr,
737
+ css: Ds,
738
+ cssBox: Es,
739
+ dim: Ct,
740
+ dims: Or,
741
+ domRect: As,
742
+ edgePoints: Hs,
743
+ equals: Rs,
744
+ height: G,
745
+ intersection: Qs,
746
+ isBox: Tr,
747
+ left: Z,
748
+ loc: Q,
749
+ positionInCenter: Js,
750
+ reRoot: Gs,
751
+ resize: Cs,
752
+ right: X,
753
+ root: Vs,
754
+ round: ri,
755
+ signedDims: Ls,
756
+ signedHeight: Ye,
757
+ signedWidth: Ze,
758
+ top: Y,
759
+ topCenter: qs,
760
+ topLeft: vr,
761
+ topRight: ks,
762
+ translate: Ks,
763
+ truncate: ei,
764
+ width: V,
765
+ x: jt,
766
+ xBounds: Ae,
767
+ xyLoc: q,
768
+ y: Rt,
769
+ yBounds: Be
770
+ }, Symbol.toStringTag, { value: "Module" })), xr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ni = a.union([bt, xr, ge, Pe]), si = { width: 0, height: 0 }, ii = { width: 1, height: 1 }, C = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, ai = (t, e) => {
760
771
  if (e == null) return !1;
761
- const r = M(t), n = M(e);
772
+ const r = C(t), n = C(e);
762
773
  return r.width === n.width && r.height === n.height;
763
- }, ri = (t) => {
764
- const e = M(t);
774
+ }, oi = (t) => {
775
+ const e = C(t);
765
776
  return { width: e.height, height: e.width };
766
- }, ni = (t) => {
767
- const e = M(t);
777
+ }, ui = (t) => {
778
+ const e = C(t);
768
779
  return `0 0 ${e.width} ${e.height}`;
769
- }, si = (t) => {
770
- const e = M(t);
780
+ }, li = (t) => {
781
+ const e = C(t);
771
782
  return [e.width, e.height];
772
- }, ii = (t) => ({
773
- width: Math.max(...t.map((e) => M(e).width)),
774
- height: Math.max(...t.map((e) => M(e).height))
775
- }), ai = (t) => ({
776
- width: Math.min(...t.map((e) => M(e).width)),
777
- height: Math.min(...t.map((e) => M(e).height))
778
- }), oi = (t, e) => {
779
- const r = M(t);
783
+ }, ci = (t) => ({
784
+ width: Math.max(...t.map((e) => C(e).width)),
785
+ height: Math.max(...t.map((e) => C(e).height))
786
+ }), hi = (t) => ({
787
+ width: Math.min(...t.map((e) => C(e).width)),
788
+ height: Math.min(...t.map((e) => C(e).height))
789
+ }), fi = (t, e) => {
790
+ const r = C(t);
780
791
  return { width: r.width * e, height: r.height * e };
781
- }, To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
792
+ }, Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
782
793
  __proto__: null,
783
- DECIMAL: ei,
784
- ZERO: _s,
785
- construct: M,
786
- couple: si,
787
- crude: Qs,
788
- dimensions: ft,
789
- equals: ti,
790
- max: ii,
791
- min: ai,
792
- scale: oi,
793
- signed: wr,
794
- svgViewBox: ni,
795
- swap: ri
796
- }, Symbol.toStringTag, { value: "Module" })), ui = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, li = a.object({ offset: et, scale: et }), ci = a.object({ offset: a.number(), scale: a.number() }), hi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
794
+ DECIMAL: ii,
795
+ ZERO: si,
796
+ construct: C,
797
+ couple: li,
798
+ crude: ni,
799
+ dimensions: bt,
800
+ equals: ai,
801
+ max: ci,
802
+ min: hi,
803
+ scale: fi,
804
+ signed: xr,
805
+ svgViewBox: ui,
806
+ swap: oi
807
+ }, Symbol.toStringTag, { value: "Module" })), di = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, gi = a.object({ offset: at, scale: at }), pi = a.object({ offset: a.number(), scale: a.number() }), mi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
797
808
  e,
798
809
  s ? n - t : n + t
799
- ], fi = (t) => (e, r, n, s) => [
810
+ ], yi = (t) => (e, r, n, s) => [
800
811
  e,
801
812
  s ? n / t : n * t
802
- ], di = (t) => (e, r, n) => {
813
+ ], bi = (t) => (e, r, n) => {
803
814
  if (e === null) return [t, n];
804
- const { lower: s, upper: i } = e, { lower: o, upper: c } = t, l = i - s, h = c - o;
805
- if (r === "dimension") return [t, n * (h / l)];
806
- const g = (n - s) * (h / l) + o;
807
- return [t, g];
808
- }, gi = (t) => (e, r, n) => [t, n], pi = () => (t, e, r) => {
815
+ const { lower: s, upper: i } = e, { lower: o, upper: c } = t, h = i - s, l = c - o;
816
+ if (r === "dimension") return [t, n * (l / h)];
817
+ const d = (n - s) * (l / h) + o;
818
+ return [t, d];
819
+ }, wi = (t) => (e, r, n) => [t, n], Oi = () => (t, e, r) => {
809
820
  if (t === null) throw new Error("cannot invert without bounds");
810
821
  if (e === "dimension") return [t, r];
811
822
  const { lower: n, upper: s } = t;
812
823
  return [t, s - (r - n)];
813
- }, yi = (t) => (e, r, n) => {
824
+ }, vi = (t) => (e, r, n) => {
814
825
  const { lower: s, upper: i } = t;
815
- return n = ui(n, s, i), [e, n];
826
+ return n = di(n, s, i), [e, n];
816
827
  };
817
- let st = class K {
828
+ let ct = class te {
818
829
  ops = [];
819
830
  currBounds = null;
820
831
  currType = null;
@@ -828,7 +839,7 @@ let st = class K {
828
839
  * @param value - The amount to translate by.
829
840
  */
830
841
  static translate(e) {
831
- return new K().translate(e);
842
+ return new te().translate(e);
832
843
  }
833
844
  /**
834
845
  * @returns a new scale with a magnification as its first operation. Any number provided
@@ -836,10 +847,10 @@ let st = class K {
836
847
  * @param value - The amount to translate by.
837
848
  */
838
849
  static magnify(e) {
839
- return new K().magnify(e);
850
+ return new te().magnify(e);
840
851
  }
841
852
  static scale(e, r) {
842
- return new K().scale(e, r);
853
+ return new te().scale(e, r);
843
854
  }
844
855
  /**
845
856
  * @returns a copy of the scale with a translation as its next operation. Any
@@ -848,7 +859,7 @@ let st = class K {
848
859
  * @param value - The amount to translate by.
849
860
  */
850
861
  translate(e) {
851
- const r = this.new(), n = hi(e);
862
+ const r = this.new(), n = mi(e);
852
863
  return n.type = "translate", r.ops.push(n), r;
853
864
  }
854
865
  /**
@@ -858,23 +869,23 @@ let st = class K {
858
869
  * @param value - The amount to magnify by.
859
870
  */
860
871
  magnify(e) {
861
- const r = this.new(), n = fi(e);
872
+ const r = this.new(), n = yi(e);
862
873
  return n.type = "magnify", r.ops.push(n), r;
863
874
  }
864
875
  scale(e, r) {
865
- const n = y(e, r), s = this.new(), i = di(n);
876
+ const n = y(e, r), s = this.new(), i = bi(n);
866
877
  return i.type = "scale", s.ops.push(i), s;
867
878
  }
868
879
  clamp(e, r) {
869
- const n = y(e, r), s = this.new(), i = yi(n);
880
+ const n = y(e, r), s = this.new(), i = vi(n);
870
881
  return i.type = "clamp", s.ops.push(i), s;
871
882
  }
872
883
  reBound(e, r) {
873
- const n = y(e, r), s = this.new(), i = gi(n);
884
+ const n = y(e, r), s = this.new(), i = wi(n);
874
885
  return i.type = "re-bound", s.ops.push(i), s;
875
886
  }
876
887
  invert() {
877
- const e = pi();
888
+ const e = Oi();
878
889
  e.type = "invert";
879
890
  const r = this.new();
880
891
  return r.ops.push(e), r;
@@ -886,7 +897,7 @@ let st = class K {
886
897
  return this.exec("dimension", e);
887
898
  }
888
899
  new() {
889
- const e = new K();
900
+ const e = new te();
890
901
  return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
891
902
  }
892
903
  exec(e, r) {
@@ -912,37 +923,37 @@ let st = class K {
912
923
  get transform() {
913
924
  return { scale: this.dim(1), offset: this.pos(0) };
914
925
  }
915
- static IDENTITY = new K();
916
- }, mi = class A {
926
+ static IDENTITY = new te();
927
+ }, Ti = class R {
917
928
  x;
918
929
  y;
919
930
  currRoot;
920
- constructor(e = new st(), r = new st(), n = null) {
931
+ constructor(e = new ct(), r = new ct(), n = null) {
921
932
  this.x = e, this.y = r, this.currRoot = n;
922
933
  }
923
934
  static translate(e, r) {
924
- return new A().translate(e, r);
935
+ return new R().translate(e, r);
925
936
  }
926
937
  static translateX(e) {
927
- return new A().translateX(e);
938
+ return new R().translateX(e);
928
939
  }
929
940
  static translateY(e) {
930
- return new A().translateY(e);
941
+ return new R().translateY(e);
931
942
  }
932
943
  static clamp(e) {
933
- return new A().clamp(e);
944
+ return new R().clamp(e);
934
945
  }
935
946
  static magnify(e) {
936
- return new A().magnify(e);
947
+ return new R().magnify(e);
937
948
  }
938
949
  static scale(e) {
939
- return new A().scale(e);
950
+ return new R().scale(e);
940
951
  }
941
952
  static reBound(e) {
942
- return new A().reBound(e);
953
+ return new R().reBound(e);
943
954
  }
944
955
  translate(e, r) {
945
- const n = v(e, r), s = this.copy();
956
+ const n = x(e, r), s = this.copy();
946
957
  return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
947
958
  }
948
959
  translateX(e) {
@@ -959,22 +970,22 @@ let st = class K {
959
970
  }
960
971
  scale(e) {
961
972
  const r = this.copy();
962
- if (br(e)) {
973
+ if (Tr(e)) {
963
974
  const n = this.currRoot;
964
- return r.currRoot = e.root, n != null && !St(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ne(e)), r.y = r.y.scale(Ie(e)), r;
975
+ return r.currRoot = e.root, n != null && !Bt(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ae(e)), r.y = r.y.scale(Be(e)), r;
965
976
  }
966
977
  return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
967
978
  }
968
979
  reBound(e) {
969
980
  const r = this.copy();
970
- return r.x = this.x.reBound(Ne(e)), r.y = this.y.reBound(Ie(e)), r;
981
+ return r.x = this.x.reBound(Ae(e)), r.y = this.y.reBound(Be(e)), r;
971
982
  }
972
983
  clamp(e) {
973
984
  const r = this.copy();
974
- return r.x = this.x.clamp(Ne(e)), r.y = this.y.clamp(Ie(e)), r;
985
+ return r.x = this.x.clamp(Ae(e)), r.y = this.y.clamp(Be(e)), r;
975
986
  }
976
987
  copy() {
977
- const e = new A();
988
+ const e = new R();
978
989
  return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
979
990
  }
980
991
  reverse() {
@@ -988,7 +999,7 @@ let st = class K {
988
999
  return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
989
1000
  }
990
1001
  box(e) {
991
- return O(
1002
+ return T(
992
1003
  this.pos(e.one),
993
1004
  this.pos(e.two),
994
1005
  0,
@@ -1002,62 +1013,62 @@ let st = class K {
1002
1013
  offset: this.pos({ x: 0, y: 0 })
1003
1014
  };
1004
1015
  }
1005
- static IDENTITY = new A();
1016
+ static IDENTITY = new R();
1006
1017
  };
1007
- const xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1018
+ const Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1008
1019
  __proto__: null,
1009
- Scale: st,
1010
- XY: mi,
1011
- crudeXYTransform: li,
1012
- transform: ci
1020
+ Scale: ct,
1021
+ XY: Ti,
1022
+ crudeXYTransform: gi,
1023
+ transform: pi
1013
1024
  }, Symbol.toStringTag, { value: "Module" }));
1014
- let bi = (t, e = 21) => (r = e) => {
1025
+ let $r = (t, e = 21) => (r = e) => {
1015
1026
  let n = "", s = r | 0;
1016
1027
  for (; s--; )
1017
1028
  n += t[Math.random() * t.length | 0];
1018
1029
  return n;
1019
1030
  };
1020
- const wi = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Or = 11, Oi = bi(wi, Or), At = () => Oi(), $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1031
+ const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", xi = `0123456789${Sr}`, Nr = 11, $i = $r(Sr, 1), Si = $r(xi, Nr - 1), Lt = () => `${$i()}${Si()}`, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1021
1032
  __proto__: null,
1022
- LENGTH: Or,
1023
- create: At
1024
- }, Symbol.toStringTag, { value: "Module" })), vi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ti = a.enum(["static", "dynamic"]), xi = a.union([
1033
+ LENGTH: Nr,
1034
+ create: Lt
1035
+ }, Symbol.toStringTag, { value: "Module" })), Ni = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ii = a.enum(["static", "dynamic"]), Mi = a.union([
1025
1036
  a.tuple([a.int()]),
1026
1037
  a.tuple([a.int(), a.int().min(1).max(12)]),
1027
1038
  a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
1028
- ]), vr = (t, e) => {
1039
+ ]), Ir = (t, e) => {
1029
1040
  const r = new b(e);
1030
1041
  if (![
1031
- f.DAY,
1032
- f.HOUR,
1033
- f.MINUTE,
1034
- f.SECOND,
1035
- f.MILLISECOND,
1036
- f.MICROSECOND,
1037
- f.NANOSECOND
1042
+ O.DAY,
1043
+ O.HOUR,
1044
+ O.MINUTE,
1045
+ O.SECOND,
1046
+ O.MILLISECOND,
1047
+ O.MICROSECOND,
1048
+ O.NANOSECOND
1038
1049
  ].some((s) => s.equals(r)))
1039
1050
  throw new Error(
1040
1051
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
1041
1052
  );
1042
1053
  const n = t.valueOf() % r.valueOf();
1043
- return t instanceof b ? new b(n) : new f(n);
1054
+ return t instanceof b ? new b(n) : new O(n);
1044
1055
  };
1045
- let b = class d extends J {
1056
+ let b = class f extends _ {
1046
1057
  constructor(e, r = "UTC") {
1047
- if (e == null) super(d.now().valueOf());
1058
+ if (e == null) super(f.now().valueOf());
1048
1059
  else if (e instanceof Date)
1049
- super(BigInt(e.getTime()) * d.MILLISECOND.valueOf());
1060
+ super(BigInt(e.getTime()) * f.MILLISECOND.valueOf());
1050
1061
  else if (typeof e == "string")
1051
- super(d.parseDateTimeString(e, r).valueOf());
1052
- else if (Array.isArray(e)) super(d.parseDate(e));
1062
+ super(f.parseDateTimeString(e, r).valueOf());
1063
+ else if (Array.isArray(e)) super(f.parseDate(e));
1053
1064
  else {
1054
1065
  let n = 0n;
1055
- e instanceof Number && (e = e.valueOf()), r === "local" && (n = d.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = d.MAX : e = d.MIN)), super(BigInt(e.valueOf()) + n);
1066
+ e instanceof Number && (e = e.valueOf()), r === "local" && (n = f.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = f.MAX : e = f.MIN)), super(BigInt(e.valueOf()) + n);
1056
1067
  }
1057
1068
  }
1058
1069
  static parseDate([e = 1970, r = 1, n = 1]) {
1059
1070
  const s = new Date(e, r - 1, n, 0, 0, 0, 0);
1060
- return new d(BigInt(s.getTime()) * d.MILLISECOND.valueOf()).truncate(d.DAY).valueOf();
1071
+ return new f(BigInt(s.getTime()) * f.MILLISECOND.valueOf()).truncate(f.DAY).valueOf();
1061
1072
  }
1062
1073
  /**
1063
1074
  * @returns the primitive value of the TimeStamp. Overrides standard JS valueOf()
@@ -1070,15 +1081,15 @@ let b = class d extends J {
1070
1081
  const [n, s, i] = e.split(":");
1071
1082
  let o = "00", c = "00";
1072
1083
  i != null && ([o, c] = i.split("."));
1073
- let l = d.hours(parseInt(n ?? "00")).add(d.minutes(parseInt(s ?? "00"))).add(d.seconds(parseInt(o ?? "00"))).add(d.milliseconds(parseInt(c ?? "00")));
1074
- return r === "local" && (l = l.add(d.utcOffset)), l.valueOf();
1084
+ let h = f.hours(parseInt(n ?? "00")).add(f.minutes(parseInt(s ?? "00"))).add(f.seconds(parseInt(o ?? "00"))).add(f.milliseconds(parseInt(c ?? "00")));
1085
+ return r === "local" && (h = h.add(f.utcOffset)), h.valueOf();
1075
1086
  }
1076
1087
  static parseDateTimeString(e, r = "UTC") {
1077
1088
  if (!e.includes("/") && !e.includes("-"))
1078
- return d.parseTimeString(e, r);
1089
+ return f.parseTimeString(e, r);
1079
1090
  const n = new Date(e);
1080
- return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new d(
1081
- BigInt(n.getTime()) * d.MILLISECOND.valueOf(),
1091
+ return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new f(
1092
+ BigInt(n.getTime()) * f.MILLISECOND.valueOf(),
1082
1093
  r
1083
1094
  ).valueOf();
1084
1095
  }
@@ -1110,7 +1121,7 @@ let b = class d extends J {
1110
1121
  }
1111
1122
  }
1112
1123
  toISOString(e = "UTC") {
1113
- return e === "UTC" ? this.date().toISOString() : this.sub(d.utcOffset).date().toISOString();
1124
+ return e === "UTC" ? this.date().toISOString() : this.sub(f.utcOffset).date().toISOString();
1114
1125
  }
1115
1126
  timeString(e = !1, r = "UTC") {
1116
1127
  const n = this.toISOString(r);
@@ -1122,8 +1133,8 @@ let b = class d extends J {
1122
1133
  }
1123
1134
  /** @returns The UTC offset for the time zone of the machine. */
1124
1135
  static get utcOffset() {
1125
- return new f(
1126
- BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * d.MINUTE.valueOf()
1136
+ return new O(
1137
+ BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * f.MINUTE.valueOf()
1127
1138
  );
1128
1139
  }
1129
1140
  /**
@@ -1132,7 +1143,7 @@ let b = class d extends J {
1132
1143
  * @param other - The other timestamp.
1133
1144
  */
1134
1145
  static since(e) {
1135
- return new d().span(e);
1146
+ return new f().span(e);
1136
1147
  }
1137
1148
  /** @returns A JavaScript Date object representing the TimeStamp. */
1138
1149
  date() {
@@ -1145,7 +1156,7 @@ let b = class d extends J {
1145
1156
  * @returns True if the TimeStamps are equal, false otherwise.
1146
1157
  */
1147
1158
  equals(e) {
1148
- return this.valueOf() === new d(e).valueOf();
1159
+ return this.valueOf() === new f(e).valueOf();
1149
1160
  }
1150
1161
  /**
1151
1162
  * Creates a TimeSpan representing the duration between the two timestamps.
@@ -1165,7 +1176,7 @@ let b = class d extends J {
1165
1176
  * valid, regardless of the TimeStamp order.
1166
1177
  */
1167
1178
  range(e) {
1168
- return new V(this, e).makeValid();
1179
+ return new J(this, e).makeValid();
1169
1180
  }
1170
1181
  /**
1171
1182
  * Creates a TimeRange starting at the TimeStamp and spanning the given
@@ -1194,7 +1205,7 @@ let b = class d extends J {
1194
1205
  * otherwise.
1195
1206
  */
1196
1207
  after(e) {
1197
- return this.valueOf() > new d(e).valueOf();
1208
+ return this.valueOf() > new f(e).valueOf();
1198
1209
  }
1199
1210
  /**
1200
1211
  * Checks if the TimeStamp is after or equal to the given TimeStamp.
@@ -1204,7 +1215,7 @@ let b = class d extends J {
1204
1215
  * false otherwise.
1205
1216
  */
1206
1217
  afterEq(e) {
1207
- return this.valueOf() >= new d(e).valueOf();
1218
+ return this.valueOf() >= new f(e).valueOf();
1208
1219
  }
1209
1220
  /**
1210
1221
  * Checks if the TimeStamp is before the given TimeStamp.
@@ -1214,7 +1225,7 @@ let b = class d extends J {
1214
1225
  * otherwise.
1215
1226
  */
1216
1227
  before(e) {
1217
- return this.valueOf() < new d(e).valueOf();
1228
+ return this.valueOf() < new f(e).valueOf();
1218
1229
  }
1219
1230
  /**
1220
1231
  * Checks if TimeStamp is before or equal to the current timestamp.
@@ -1224,7 +1235,7 @@ let b = class d extends J {
1224
1235
  * false otherwise.
1225
1236
  */
1226
1237
  beforeEq(e) {
1227
- return this.valueOf() <= new d(e).valueOf();
1238
+ return this.valueOf() <= new f(e).valueOf();
1228
1239
  }
1229
1240
  /**
1230
1241
  * Adds a TimeSpan to the TimeStamp.
@@ -1234,7 +1245,7 @@ let b = class d extends J {
1234
1245
  * TimeSpan.
1235
1246
  */
1236
1247
  add(e) {
1237
- return new d(this.valueOf() + BigInt(e.valueOf()));
1248
+ return new f(ie(this.valueOf(), new O(e).valueOf()));
1238
1249
  }
1239
1250
  /**
1240
1251
  * Subtracts a TimeSpan from the TimeStamp.
@@ -1244,43 +1255,43 @@ let b = class d extends J {
1244
1255
  * TimeSpan.
1245
1256
  */
1246
1257
  sub(e) {
1247
- return new d(this.valueOf() - BigInt(e.valueOf()));
1258
+ return new f(P(this.valueOf(), new O(e).valueOf()));
1248
1259
  }
1249
1260
  /**
1250
1261
  * @returns the floating point number of hours since the unix epoch to the timestamp
1251
1262
  * value.
1252
1263
  */
1253
1264
  get hours() {
1254
- return Number(this.valueOf()) / Number(f.HOUR.valueOf());
1265
+ return Number(this.valueOf()) / Number(O.HOUR.valueOf());
1255
1266
  }
1256
1267
  /**
1257
1268
  * @returns the floating point number of minutes since the unix epoch to the timestamp
1258
1269
  * value.
1259
1270
  */
1260
1271
  get minutes() {
1261
- return Number(this.valueOf()) / Number(f.MINUTE.valueOf());
1272
+ return Number(this.valueOf()) / Number(O.MINUTE.valueOf());
1262
1273
  }
1263
1274
  /**
1264
1275
  * @returns the floating point number of days since the unix epoch to the timestamp
1265
1276
  * value.
1266
1277
  */
1267
1278
  get days() {
1268
- return Number(this.valueOf()) / Number(f.DAY.valueOf());
1279
+ return Number(this.valueOf()) / Number(O.DAY.valueOf());
1269
1280
  }
1270
1281
  /**
1271
1282
  * @returns the floating point number of seconds since the unix epoch to the timestamp
1272
1283
  * value.
1273
1284
  */
1274
1285
  get seconds() {
1275
- return Number(this.valueOf()) / Number(f.SECOND.valueOf());
1286
+ return Number(this.valueOf()) / Number(O.SECOND.valueOf());
1276
1287
  }
1277
1288
  /** @returns the floating point number of milliseconds since the unix epoch. */
1278
1289
  get milliseconds() {
1279
- return Number(this.valueOf()) / Number(d.MILLISECOND.valueOf());
1290
+ return Number(this.valueOf()) / Number(f.MILLISECOND.valueOf());
1280
1291
  }
1281
1292
  /** @returns the floating point number of microseconds since the unix epoch. */
1282
1293
  get microseconds() {
1283
- return Number(this.valueOf()) / Number(d.MICROSECOND.valueOf());
1294
+ return Number(this.valueOf()) / Number(f.MICROSECOND.valueOf());
1284
1295
  }
1285
1296
  /**
1286
1297
  * @returns the floating point number of nanoseconds since the unix epoch.
@@ -1300,7 +1311,7 @@ let b = class d extends J {
1300
1311
  */
1301
1312
  setYear(e) {
1302
1313
  const r = this.date();
1303
- return r.setUTCFullYear(e), new d(r);
1314
+ return r.setUTCFullYear(e), new f(r);
1304
1315
  }
1305
1316
  /** @returns the integer month that the timestamp corresponds to with its year. */
1306
1317
  get month() {
@@ -1312,7 +1323,7 @@ let b = class d extends J {
1312
1323
  */
1313
1324
  setMonth(e) {
1314
1325
  const r = this.date();
1315
- return r.setUTCMonth(e), new d(r);
1326
+ return r.setUTCMonth(e), new f(r);
1316
1327
  }
1317
1328
  /** @returns the integer day that the timestamp corresponds to within its month. */
1318
1329
  get day() {
@@ -1324,7 +1335,7 @@ let b = class d extends J {
1324
1335
  */
1325
1336
  setDay(e) {
1326
1337
  const r = this.date();
1327
- return r.setUTCDate(e), new d(r);
1338
+ return r.setUTCDate(e), new f(r);
1328
1339
  }
1329
1340
  /**
1330
1341
  * @returns the integer hour that the timestamp corresponds to within its day.
@@ -1338,7 +1349,7 @@ let b = class d extends J {
1338
1349
  */
1339
1350
  setHour(e) {
1340
1351
  const r = this.date();
1341
- return r.setUTCHours(e), new d(r, "UTC");
1352
+ return r.setUTCHours(e), new f(r, "UTC");
1342
1353
  }
1343
1354
  /** @returns the integer minute that the timestamp corresponds to within its hour. */
1344
1355
  get minute() {
@@ -1350,7 +1361,7 @@ let b = class d extends J {
1350
1361
  */
1351
1362
  setMinute(e) {
1352
1363
  const r = this.date();
1353
- return r.setUTCMinutes(e), new d(r);
1364
+ return r.setUTCMinutes(e), new f(r);
1354
1365
  }
1355
1366
  /**
1356
1367
  * @returns the integer second that the timestamp corresponds to within its
@@ -1365,7 +1376,7 @@ let b = class d extends J {
1365
1376
  */
1366
1377
  setSecond(e) {
1367
1378
  const r = this.date();
1368
- return r.setUTCSeconds(e), new d(r);
1379
+ return r.setUTCSeconds(e), new f(r);
1369
1380
  }
1370
1381
  /**
1371
1382
  * @reutrns the integer millisecond that the timestamp corresponds to within
@@ -1380,7 +1391,7 @@ let b = class d extends J {
1380
1391
  */
1381
1392
  setMillisecond(e) {
1382
1393
  const r = this.date();
1383
- return r.setUTCMilliseconds(e), new d(r);
1394
+ return r.setUTCMilliseconds(e), new f(r);
1384
1395
  }
1385
1396
  /** @returns the time stamp formatted as an ISO string. */
1386
1397
  toString() {
@@ -1398,11 +1409,11 @@ let b = class d extends J {
1398
1409
  * @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
1399
1410
  */
1400
1411
  remainder(e) {
1401
- return vr(this, e);
1412
+ return Ir(this, e);
1402
1413
  }
1403
1414
  /** @returns true if the day portion TimeStamp is today, false otherwise. */
1404
1415
  get isToday() {
1405
- return this.truncate(f.DAY).equals(d.now().truncate(f.DAY));
1416
+ return this.truncate(O.DAY).equals(f.now().truncate(O.DAY));
1406
1417
  }
1407
1418
  /**
1408
1419
  * Truncates the TimeStamp to the nearest multiple of the given span.
@@ -1419,7 +1430,7 @@ let b = class d extends J {
1419
1430
  * JavaScript can do).
1420
1431
  */
1421
1432
  static now() {
1422
- return new d(/* @__PURE__ */ new Date());
1433
+ return new f(/* @__PURE__ */ new Date());
1423
1434
  }
1424
1435
  /**
1425
1436
  * Finds the maximum timestamp among the provided timestamps.
@@ -1428,9 +1439,9 @@ let b = class d extends J {
1428
1439
  * @returns The maximum (latest) timestamp from the input.
1429
1440
  */
1430
1441
  static max(...e) {
1431
- let r = d.MIN;
1442
+ let r = f.MIN;
1432
1443
  for (const n of e) {
1433
- const s = new d(n);
1444
+ const s = new f(n);
1434
1445
  s.after(r) && (r = s);
1435
1446
  }
1436
1447
  return r;
@@ -1442,9 +1453,9 @@ let b = class d extends J {
1442
1453
  * @returns The minimum (earliest) timestamp from the input.
1443
1454
  */
1444
1455
  static min(...e) {
1445
- let r = d.MAX;
1456
+ let r = f.MAX;
1446
1457
  for (const n of e) {
1447
- const s = new d(n);
1458
+ const s = new f(n);
1448
1459
  s.before(r) && (r = s);
1449
1460
  }
1450
1461
  return r;
@@ -1456,62 +1467,62 @@ let b = class d extends J {
1456
1467
  * @returns A TimeStamp representing the given number of nanoseconds.
1457
1468
  */
1458
1469
  static nanoseconds(e, r = "UTC") {
1459
- return new d(e, r);
1470
+ return new f(e, r);
1460
1471
  }
1461
1472
  /** One nanosecond after the unix epoch */
1462
- static NANOSECOND = d.nanoseconds(1);
1473
+ static NANOSECOND = f.nanoseconds(1);
1463
1474
  /** @returns a new TimeStamp n microseconds after the unix epoch */
1464
1475
  static microseconds(e, r = "UTC") {
1465
- return d.nanoseconds(e * 1e3, r);
1476
+ return f.nanoseconds(e * 1e3, r);
1466
1477
  }
1467
1478
  /** One microsecond after the unix epoch */
1468
- static MICROSECOND = d.microseconds(1);
1479
+ static MICROSECOND = f.microseconds(1);
1469
1480
  /** @returns a new TimeStamp n milliseconds after the unix epoch */
1470
1481
  static milliseconds(e, r = "UTC") {
1471
- return d.microseconds(e * 1e3, r);
1482
+ return f.microseconds(e * 1e3, r);
1472
1483
  }
1473
1484
  /** One millisecond after the unix epoch */
1474
- static MILLISECOND = d.milliseconds(1);
1485
+ static MILLISECOND = f.milliseconds(1);
1475
1486
  /** @returns a new TimeStamp n seconds after the unix epoch */
1476
1487
  static seconds(e, r = "UTC") {
1477
- return d.milliseconds(e * 1e3, r);
1488
+ return f.milliseconds(e * 1e3, r);
1478
1489
  }
1479
1490
  /** One second after the unix epoch */
1480
- static SECOND = d.seconds(1);
1491
+ static SECOND = f.seconds(1);
1481
1492
  /** @returns a new TimeStamp n minutes after the unix epoch */
1482
1493
  static minutes(e, r = "UTC") {
1483
- return d.seconds(e * 60, r);
1494
+ return f.seconds(e * 60, r);
1484
1495
  }
1485
1496
  /** One minute after the unix epoch */
1486
- static MINUTE = d.minutes(1);
1497
+ static MINUTE = f.minutes(1);
1487
1498
  /** @returns a new TimeStamp n hours after the unix epoch */
1488
1499
  static hours(e, r = "UTC") {
1489
- return d.minutes(e * 60, r);
1500
+ return f.minutes(e * 60, r);
1490
1501
  }
1491
1502
  /** One hour after the unix epoch */
1492
- static HOUR = d.hours(1);
1503
+ static HOUR = f.hours(1);
1493
1504
  /** @returns a new TimeStamp n days after the unix epoch */
1494
1505
  static days(e, r = "UTC") {
1495
- return d.hours(e * 24, r);
1506
+ return f.hours(e * 24, r);
1496
1507
  }
1497
1508
  /** One day after the unix epoch */
1498
- static DAY = d.days(1);
1509
+ static DAY = f.days(1);
1499
1510
  /** The maximum possible value for a timestamp */
1500
- static MAX = new d((1n << 63n) - 1n);
1511
+ static MAX = new f((1n << 63n) - 1n);
1501
1512
  /** The minimum possible value for a timestamp */
1502
- static MIN = new d(0);
1513
+ static MIN = new f(0);
1503
1514
  /** The unix epoch */
1504
- static ZERO = new d(0);
1515
+ static ZERO = new f(0);
1505
1516
  /** A zod schema for validating timestamps */
1506
1517
  static z = a.union([
1507
- a.instanceof(d),
1508
- a.object({ value: a.bigint() }).transform((e) => new d(e.value)),
1509
- a.string().transform((e) => new d(BigInt(e))),
1510
- a.number().transform((e) => new d(e)),
1511
- a.bigint().transform((e) => new d(e)),
1512
- a.date().transform((e) => new d(e)),
1513
- a.custom((e) => e instanceof f).transform((e) => new d(e)),
1514
- xi.transform((e) => new d(e))
1518
+ a.instanceof(f),
1519
+ a.object({ value: a.bigint() }).transform((e) => new f(e.value)),
1520
+ a.string().transform((e) => new f(BigInt(e))),
1521
+ a.number().transform((e) => new f(e)),
1522
+ a.bigint().transform((e) => new f(e)),
1523
+ a.date().transform((e) => new f(e)),
1524
+ a.custom((e) => e instanceof O).transform((e) => new f(e)),
1525
+ Mi.transform((e) => new f(e))
1515
1526
  ]);
1516
1527
  /**
1517
1528
  * Sorts two timestamps.
@@ -1524,8 +1535,7 @@ let b = class d extends J {
1524
1535
  static sort(e, r) {
1525
1536
  return Number(e.valueOf() - r.valueOf());
1526
1537
  }
1527
- };
1528
- class f extends J {
1538
+ }, O = class g extends _ {
1529
1539
  constructor(e) {
1530
1540
  typeof e == "number" && (e = Math.trunc(e.valueOf())), super(BigInt(e.valueOf()));
1531
1541
  }
@@ -1536,7 +1546,7 @@ class f extends J {
1536
1546
  * @returns A TimeSpan representing the given number of seconds.
1537
1547
  */
1538
1548
  static fromSeconds(e) {
1539
- return e instanceof f ? e : e instanceof Lt ? e.period : e instanceof b ? new f(e) : ["number", "bigint"].includes(typeof e) ? f.seconds(e) : new f(e);
1549
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e);
1540
1550
  }
1541
1551
  /**
1542
1552
  * Creates a TimeSpan representing the given number of milliseconds.
@@ -1545,7 +1555,7 @@ class f extends J {
1545
1555
  * @returns A TimeSpan representing the given number of milliseconds.
1546
1556
  */
1547
1557
  static fromMilliseconds(e) {
1548
- return e instanceof f ? e : e instanceof Lt ? e.period : e instanceof b ? new f(e) : ["number", "bigint"].includes(typeof e) ? f.milliseconds(e) : new f(e);
1558
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof b ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e);
1549
1559
  }
1550
1560
  /**
1551
1561
  * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
@@ -1561,7 +1571,7 @@ class f extends J {
1561
1571
  * @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
1562
1572
  */
1563
1573
  lessThan(e) {
1564
- return this.valueOf() < new f(e).valueOf();
1574
+ return this.valueOf() < new g(e).valueOf();
1565
1575
  }
1566
1576
  /**
1567
1577
  * Checks if the TimeSpan is greater than another TimeSpan.
@@ -1570,7 +1580,7 @@ class f extends J {
1570
1580
  * @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
1571
1581
  */
1572
1582
  greaterThan(e) {
1573
- return this.valueOf() > new f(e).valueOf();
1583
+ return this.valueOf() > new g(e).valueOf();
1574
1584
  }
1575
1585
  /**
1576
1586
  * Checks if the TimeSpan is less than or equal to another TimeSpan.
@@ -1579,7 +1589,7 @@ class f extends J {
1579
1589
  * @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
1580
1590
  */
1581
1591
  lessThanOrEqual(e) {
1582
- return this.valueOf() <= new f(e).valueOf();
1592
+ return this.valueOf() <= new g(e).valueOf();
1583
1593
  }
1584
1594
  /**
1585
1595
  * Checks if the TimeSpan is greater than or equal to another TimeSpan.
@@ -1588,7 +1598,7 @@ class f extends J {
1588
1598
  * @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
1589
1599
  */
1590
1600
  greaterThanOrEqual(e) {
1591
- return this.valueOf() >= new f(e).valueOf();
1601
+ return this.valueOf() >= new g(e).valueOf();
1592
1602
  }
1593
1603
  /**
1594
1604
  * Calculates the remainder of the TimeSpan when divided by another TimeSpan.
@@ -1597,7 +1607,7 @@ class f extends J {
1597
1607
  * @returns A new TimeSpan representing the remainder.
1598
1608
  */
1599
1609
  remainder(e) {
1600
- return vr(this, e);
1610
+ return Ir(this, e);
1601
1611
  }
1602
1612
  /**
1603
1613
  * Truncates the TimeSpan to the nearest multiple of the given span.
@@ -1606,7 +1616,7 @@ class f extends J {
1606
1616
  * @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
1607
1617
  */
1608
1618
  truncate(e) {
1609
- return new f(
1619
+ return new g(
1610
1620
  BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
1611
1621
  );
1612
1622
  }
@@ -1616,9 +1626,9 @@ class f extends J {
1616
1626
  * @returns A string representation of the TimeSpan.
1617
1627
  */
1618
1628
  toString() {
1619
- const e = this.truncate(f.DAY), r = this.truncate(f.HOUR), n = this.truncate(f.MINUTE), s = this.truncate(f.SECOND), i = this.truncate(f.MILLISECOND), o = this.truncate(f.MICROSECOND), c = this.truncate(f.NANOSECOND), l = e, h = r.sub(e), g = n.sub(r), p = s.sub(n), S = i.sub(s), E = o.sub(i), te = c.sub(o);
1620
- let R = "";
1621
- return l.isZero || (R += `${l.days}d `), h.isZero || (R += `${h.hours}h `), g.isZero || (R += `${g.minutes}m `), p.isZero || (R += `${p.seconds}s `), S.isZero || (R += `${S.milliseconds}ms `), E.isZero || (R += `${E.microseconds}µs `), te.isZero || (R += `${te.nanoseconds}ns`), R.trim();
1629
+ const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), m = s.sub(n), p = i.sub(s), j = o.sub(i), A = c.sub(o);
1630
+ let k = "";
1631
+ return h.isZero || (k += `${h.days}d `), l.isZero || (k += `${l.hours}h `), d.isZero || (k += `${d.minutes}m `), m.isZero || (k += `${m.seconds}s `), p.isZero || (k += `${p.milliseconds}ms `), j.isZero || (k += `${j.microseconds}µs `), A.isZero || (k += `${A.nanoseconds}ns`), k.trim();
1622
1632
  }
1623
1633
  /**
1624
1634
  * Multiplies the TimeSpan by a scalar value.
@@ -1627,31 +1637,40 @@ class f extends J {
1627
1637
  * @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
1628
1638
  */
1629
1639
  mult(e) {
1630
- return new f(this.valueOf() * BigInt(e));
1640
+ return new g(B(this.valueOf(), e));
1641
+ }
1642
+ /**
1643
+ * Divides the TimeSpan by a scalar value.
1644
+ *
1645
+ * @param value - The scalar value to divide by.
1646
+ * @returns A new TimeSpan that is this TimeSpan divided by the provided value.
1647
+ */
1648
+ div(e) {
1649
+ return new g(we(this.valueOf(), e));
1631
1650
  }
1632
1651
  /** @returns the decimal number of days in the TimeSpan. */
1633
1652
  get days() {
1634
- return Number(this.valueOf()) / Number(f.DAY.valueOf());
1653
+ return Number(this.valueOf()) / Number(g.DAY.valueOf());
1635
1654
  }
1636
1655
  /** @returns the decimal number of hours in the TimeSpan. */
1637
1656
  get hours() {
1638
- return Number(this.valueOf()) / Number(f.HOUR.valueOf());
1657
+ return Number(this.valueOf()) / Number(g.HOUR.valueOf());
1639
1658
  }
1640
1659
  /** @returns the decimal number of minutes in the TimeSpan. */
1641
1660
  get minutes() {
1642
- return Number(this.valueOf()) / Number(f.MINUTE.valueOf());
1661
+ return Number(this.valueOf()) / Number(g.MINUTE.valueOf());
1643
1662
  }
1644
1663
  /** @returns The number of seconds in the TimeSpan. */
1645
1664
  get seconds() {
1646
- return Number(this.valueOf()) / Number(f.SECOND.valueOf());
1665
+ return Number(this.valueOf()) / Number(g.SECOND.valueOf());
1647
1666
  }
1648
1667
  /** @returns The number of milliseconds in the TimeSpan. */
1649
1668
  get milliseconds() {
1650
- return Number(this.valueOf()) / Number(f.MILLISECOND.valueOf());
1669
+ return Number(this.valueOf()) / Number(g.MILLISECOND.valueOf());
1651
1670
  }
1652
1671
  /** @returns The number of microseconds in the TimeSpan. */
1653
1672
  get microseconds() {
1654
- return Number(this.valueOf()) / Number(f.MICROSECOND.valueOf());
1673
+ return Number(this.valueOf()) / Number(g.MICROSECOND.valueOf());
1655
1674
  }
1656
1675
  /** @returns The number of nanoseconds in the TimeSpan. */
1657
1676
  get nanoseconds() {
@@ -1671,7 +1690,7 @@ class f extends J {
1671
1690
  * @returns True if the TimeSpans are equal, false otherwise.
1672
1691
  */
1673
1692
  equals(e) {
1674
- return this.valueOf() === new f(e).valueOf();
1693
+ return this.valueOf() === new g(e).valueOf();
1675
1694
  }
1676
1695
  /**
1677
1696
  * Adds a TimeSpan to the TimeSpan.
@@ -1679,7 +1698,7 @@ class f extends J {
1679
1698
  * @returns A new TimeSpan representing the sum of the two TimeSpans.
1680
1699
  */
1681
1700
  add(e) {
1682
- return new f(this.valueOf() + new f(e).valueOf());
1701
+ return new g(this.valueOf() + new g(e).valueOf());
1683
1702
  }
1684
1703
  /**
1685
1704
  * Creates a TimeSpan representing the duration between the two timestamps.
@@ -1687,7 +1706,7 @@ class f extends J {
1687
1706
  * @param other
1688
1707
  */
1689
1708
  sub(e) {
1690
- return new f(this.valueOf() - new f(e).valueOf());
1709
+ return new g(this.valueOf() - new g(e).valueOf());
1691
1710
  }
1692
1711
  /**
1693
1712
  * Creates a TimeSpan representing the given number of nanoseconds.
@@ -1696,10 +1715,10 @@ class f extends J {
1696
1715
  * @returns A TimeSpan representing the given number of nanoseconds.
1697
1716
  */
1698
1717
  static nanoseconds(e = 1) {
1699
- return new f(e);
1718
+ return new g(e);
1700
1719
  }
1701
1720
  /** A nanosecond. */
1702
- static NANOSECOND = f.nanoseconds(1);
1721
+ static NANOSECOND = g.nanoseconds(1);
1703
1722
  /**
1704
1723
  * Creates a TimeSpan representing the given number of microseconds.
1705
1724
  *
@@ -1707,10 +1726,10 @@ class f extends J {
1707
1726
  * @returns A TimeSpan representing the given number of microseconds.
1708
1727
  */
1709
1728
  static microseconds(e = 1) {
1710
- return f.nanoseconds(Y(e, 1e3));
1729
+ return g.nanoseconds(B(e, 1e3));
1711
1730
  }
1712
1731
  /** A microsecond. */
1713
- static MICROSECOND = f.microseconds(1);
1732
+ static MICROSECOND = g.microseconds(1);
1714
1733
  /**
1715
1734
  * Creates a TimeSpan representing the given number of milliseconds.
1716
1735
  *
@@ -1718,10 +1737,10 @@ class f extends J {
1718
1737
  * @returns A TimeSpan representing the given number of milliseconds.
1719
1738
  */
1720
1739
  static milliseconds(e = 1) {
1721
- return f.microseconds(Y(e, 1e3));
1740
+ return g.microseconds(B(e, 1e3));
1722
1741
  }
1723
1742
  /** A millisecond. */
1724
- static MILLISECOND = f.milliseconds(1);
1743
+ static MILLISECOND = g.milliseconds(1);
1725
1744
  /**
1726
1745
  * Creates a TimeSpan representing the given number of seconds.
1727
1746
  *
@@ -1729,10 +1748,10 @@ class f extends J {
1729
1748
  * @returns A TimeSpan representing the given number of seconds.
1730
1749
  */
1731
1750
  static seconds(e = 1) {
1732
- return f.milliseconds(Y(e, 1e3));
1751
+ return g.milliseconds(B(e, 1e3));
1733
1752
  }
1734
1753
  /** A second. */
1735
- static SECOND = f.seconds(1);
1754
+ static SECOND = g.seconds(1);
1736
1755
  /**
1737
1756
  * Creates a TimeSpan representing the given number of minutes.
1738
1757
  *
@@ -1740,10 +1759,10 @@ class f extends J {
1740
1759
  * @returns A TimeSpan representing the given number of minutes.
1741
1760
  */
1742
1761
  static minutes(e = 1) {
1743
- return f.seconds(Y(e, 60));
1762
+ return g.seconds(B(e, 60));
1744
1763
  }
1745
1764
  /** A minute. */
1746
- static MINUTE = f.minutes(1);
1765
+ static MINUTE = g.minutes(1);
1747
1766
  /**
1748
1767
  * Creates a TimeSpan representing the given number of hours.
1749
1768
  *
@@ -1751,10 +1770,10 @@ class f extends J {
1751
1770
  * @returns A TimeSpan representing the given number of hours.
1752
1771
  */
1753
1772
  static hours(e) {
1754
- return f.minutes(Y(e, 60));
1773
+ return g.minutes(B(e, 60));
1755
1774
  }
1756
1775
  /** Represents an hour. */
1757
- static HOUR = f.hours(1);
1776
+ static HOUR = g.hours(1);
1758
1777
  /**
1759
1778
  * Creates a TimeSpan representing the given number of days.
1760
1779
  *
@@ -1762,25 +1781,28 @@ class f extends J {
1762
1781
  * @returns A TimeSpan representing the given number of days.
1763
1782
  */
1764
1783
  static days(e) {
1765
- return f.hours(Y(e, 24));
1784
+ return g.hours(B(e, 24));
1766
1785
  }
1767
1786
  /** Represents a day. */
1768
- static DAY = f.days(1);
1787
+ static DAY = g.days(1);
1769
1788
  /** The maximum possible value for a TimeSpan. */
1770
- static MAX = new f((1n << 63n) - 1n);
1789
+ static MAX = new g((1n << 63n) - 1n);
1771
1790
  /** The minimum possible value for a TimeSpan. */
1772
- static MIN = new f(0);
1791
+ static MIN = new g(0);
1773
1792
  /** The zero value for a TimeSpan. */
1774
- static ZERO = new f(0);
1793
+ static ZERO = new g(0);
1775
1794
  /** A zod schema for validating and transforming timespans */
1776
1795
  static z = a.union([
1777
- a.object({ value: a.bigint() }).transform((e) => new f(e.value)),
1778
- a.string().transform((e) => new f(BigInt(e))),
1779
- a.number().transform((e) => new f(e)),
1780
- a.instanceof(f)
1796
+ a.object({ value: a.bigint() }).transform((e) => new g(e.value)),
1797
+ a.string().transform((e) => new g(BigInt(e))),
1798
+ a.number().transform((e) => new g(e)),
1799
+ a.bigint().transform((e) => new g(e)),
1800
+ a.instanceof(g),
1801
+ a.instanceof(b).transform((e) => new g(e)),
1802
+ a.custom((e) => e instanceof E).transform((e) => new g(e))
1781
1803
  ]);
1782
- }
1783
- let Lt = class Q extends J {
1804
+ };
1805
+ class E extends _ {
1784
1806
  constructor(e) {
1785
1807
  super(e.valueOf());
1786
1808
  }
@@ -1790,7 +1812,7 @@ let Lt = class Q extends J {
1790
1812
  }
1791
1813
  /** @returns The number of seconds in the Rate. */
1792
1814
  equals(e) {
1793
- return this.valueOf() === new Q(e).valueOf();
1815
+ return this.valueOf() === new E(e).valueOf();
1794
1816
  }
1795
1817
  /**
1796
1818
  * Calculates the period of the Rate as a TimeSpan.
@@ -1798,7 +1820,7 @@ let Lt = class Q extends J {
1798
1820
  * @returns A TimeSpan representing the period of the Rate.
1799
1821
  */
1800
1822
  get period() {
1801
- return f.seconds(1 / this.valueOf());
1823
+ return O.seconds(1 / this.valueOf());
1802
1824
  }
1803
1825
  /**
1804
1826
  * Calculates the number of samples in the given TimeSpan at this rate.
@@ -1807,7 +1829,7 @@ let Lt = class Q extends J {
1807
1829
  * @returns The number of samples in the given TimeSpan at this rate.
1808
1830
  */
1809
1831
  sampleCount(e) {
1810
- return new f(e).seconds * this.valueOf();
1832
+ return new O(e).seconds * this.valueOf();
1811
1833
  }
1812
1834
  /**
1813
1835
  * Calculates the number of bytes in the given TimeSpan at this rate.
@@ -1817,7 +1839,7 @@ let Lt = class Q extends J {
1817
1839
  * @returns The number of bytes in the given TimeSpan at this rate.
1818
1840
  */
1819
1841
  byteCount(e, r) {
1820
- return this.sampleCount(e) * new N(r).valueOf();
1842
+ return this.sampleCount(e) * new I(r).valueOf();
1821
1843
  }
1822
1844
  /**
1823
1845
  * Calculates a TimeSpan given the number of samples at this rate.
@@ -1826,7 +1848,7 @@ let Lt = class Q extends J {
1826
1848
  * @returns A TimeSpan that corresponds to the given number of samples.
1827
1849
  */
1828
1850
  span(e) {
1829
- return f.seconds(e / this.valueOf());
1851
+ return O.seconds(e / this.valueOf());
1830
1852
  }
1831
1853
  /**
1832
1854
  * Calculates a TimeSpan given the number of bytes at this rate.
@@ -1838,6 +1860,42 @@ let Lt = class Q extends J {
1838
1860
  byteSpan(e, r) {
1839
1861
  return this.span(e.valueOf() / r.valueOf());
1840
1862
  }
1863
+ /**
1864
+ * Adds another Rate to this Rate.
1865
+ *
1866
+ * @param other - The Rate to add.
1867
+ * @returns A new Rate representing the sum of the two rates.
1868
+ */
1869
+ add(e) {
1870
+ return new E(ie(this.valueOf(), e.valueOf()));
1871
+ }
1872
+ /**
1873
+ * Subtracts another Rate from this Rate.
1874
+ *
1875
+ * @param other - The Rate to subtract.
1876
+ * @returns A new Rate representing the difference of the two rates.
1877
+ */
1878
+ sub(e) {
1879
+ return new E(P(this.valueOf(), e.valueOf()));
1880
+ }
1881
+ /**
1882
+ * Multiplies this Rate by a scalar value.
1883
+ *
1884
+ * @param value - The scalar value to multiply by.
1885
+ * @returns A new Rate representing this Rate multiplied by the value.
1886
+ */
1887
+ mult(e) {
1888
+ return new E(B(this.valueOf(), e));
1889
+ }
1890
+ /**
1891
+ * Divides this Rate by a scalar value.
1892
+ *
1893
+ * @param value - The scalar value to divide by.
1894
+ * @returns A new Rate representing this Rate divided by the value.
1895
+ */
1896
+ div(e) {
1897
+ return new E(we(this.valueOf(), e));
1898
+ }
1841
1899
  /**
1842
1900
  * Creates a Rate representing the given number of Hz.
1843
1901
  *
@@ -1845,7 +1903,7 @@ let Lt = class Q extends J {
1845
1903
  * @returns A Rate representing the given number of Hz.
1846
1904
  */
1847
1905
  static hz(e) {
1848
- return new Q(e);
1906
+ return new E(e);
1849
1907
  }
1850
1908
  /**
1851
1909
  * Creates a Rate representing the given number of kHz.
@@ -1854,14 +1912,15 @@ let Lt = class Q extends J {
1854
1912
  * @returns A Rate representing the given number of kHz.
1855
1913
  */
1856
1914
  static khz(e) {
1857
- return Q.hz(e * 1e3);
1915
+ return E.hz(e * 1e3);
1858
1916
  }
1859
1917
  /** A zod schema for validating and transforming rates */
1860
1918
  static z = a.union([
1861
- a.number().transform((e) => new Q(e)),
1862
- a.instanceof(Q)
1919
+ a.number().transform((e) => new E(e)),
1920
+ a.instanceof(E)
1863
1921
  ]);
1864
- }, N = class C extends J {
1922
+ }
1923
+ let I = class M extends _ {
1865
1924
  /**
1866
1925
  * Creates a Density representing the given number of bytes per value.
1867
1926
  *
@@ -1888,26 +1947,62 @@ let Lt = class Q extends J {
1888
1947
  * @returns A Size representing the given number of values.
1889
1948
  */
1890
1949
  size(e) {
1891
- return new m(e * this.valueOf());
1950
+ return new Le(e * this.valueOf());
1951
+ }
1952
+ /**
1953
+ * Adds another Density to this Density.
1954
+ *
1955
+ * @param other - The Density to add.
1956
+ * @returns A new Density representing the sum of the two densities.
1957
+ */
1958
+ add(e) {
1959
+ return new M(ie(this.valueOf(), e.valueOf()));
1960
+ }
1961
+ /**
1962
+ * Subtracts another Density from this Density.
1963
+ *
1964
+ * @param other - The Density to subtract.
1965
+ * @returns A new Density representing the difference of the two densities.
1966
+ */
1967
+ sub(e) {
1968
+ return new M(P(this.valueOf(), e.valueOf()));
1969
+ }
1970
+ /**
1971
+ * Multiplies this Density by a scalar value.
1972
+ *
1973
+ * @param value - The scalar value to multiply by.
1974
+ * @returns A new Density representing this Density multiplied by the value.
1975
+ */
1976
+ mult(e) {
1977
+ return new M(B(this.valueOf(), e));
1978
+ }
1979
+ /**
1980
+ * Divides this Density by a scalar value.
1981
+ *
1982
+ * @param value - The scalar value to divide by.
1983
+ * @returns A new Density representing this Density divided by the value.
1984
+ */
1985
+ div(e) {
1986
+ return new M(we(this.valueOf(), e));
1892
1987
  }
1893
1988
  /** Unknown/Invalid Density. */
1894
- static UNKNOWN = new C(0);
1989
+ static UNKNOWN = new M(0);
1895
1990
  /** 128 bits per value. */
1896
- static BIT128 = new C(16);
1991
+ static BIT128 = new M(16);
1897
1992
  /** 64 bits per value. */
1898
- static BIT64 = new C(8);
1993
+ static BIT64 = new M(8);
1899
1994
  /** 32 bits per value. */
1900
- static BIT32 = new C(4);
1995
+ static BIT32 = new M(4);
1901
1996
  /** 16 bits per value. */
1902
- static BIT16 = new C(2);
1997
+ static BIT16 = new M(2);
1903
1998
  /** 8 bits per value. */
1904
- static BIT8 = new C(1);
1999
+ static BIT8 = new M(1);
1905
2000
  /** A zod schema for validating and transforming densities */
1906
2001
  static z = a.union([
1907
- a.number().transform((e) => new C(e)),
1908
- a.instanceof(C)
2002
+ a.number().transform((e) => new M(e)),
2003
+ a.instanceof(M)
1909
2004
  ]);
1910
- }, V = class B {
2005
+ }, J = class L {
1911
2006
  /**
1912
2007
  * The starting TimeStamp of the TimeRange.
1913
2008
  *
@@ -1937,7 +2032,7 @@ let Lt = class Q extends J {
1937
2032
  }
1938
2033
  /** @returns The TimeSpan occupied by the TimeRange. */
1939
2034
  get span() {
1940
- return new f(this.end.valueOf() - this.start.valueOf());
2035
+ return new O(this.end.valueOf() - this.start.valueOf());
1941
2036
  }
1942
2037
  /**
1943
2038
  * Checks if the timestamp is valid i.e. the start is before the end.
@@ -1975,7 +2070,7 @@ let Lt = class Q extends J {
1975
2070
  * @returns A TimeRange with the start and end swapped.
1976
2071
  */
1977
2072
  swap() {
1978
- return new B(this.end, this.start);
2073
+ return new L(this.end, this.start);
1979
2074
  }
1980
2075
  get numericBounds() {
1981
2076
  return {
@@ -1989,7 +2084,7 @@ let Lt = class Q extends J {
1989
2084
  * @param other - The TimeRange to compare to.
1990
2085
  * @returns True if the TimeRange is equal to the given TimeRange.
1991
2086
  */
1992
- equals(e, r = f.ZERO) {
2087
+ equals(e, r = O.ZERO) {
1993
2088
  if (r.isZero)
1994
2089
  return this.start.equals(e.start) && this.end.equals(e.end);
1995
2090
  let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
@@ -2022,16 +2117,16 @@ let Lt = class Q extends J {
2022
2117
  * checking for overlap.
2023
2118
  * @returns True if the two TimeRanges overlap, false otherwise.
2024
2119
  */
2025
- overlapsWith(e, r = f.ZERO) {
2120
+ overlapsWith(e, r = O.ZERO) {
2026
2121
  e = e.makeValid();
2027
2122
  const n = this.makeValid();
2028
2123
  if (this.equals(e)) return !0;
2029
2124
  if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
2030
2125
  const s = b.max(n.start, e.start), i = b.min(n.end, e.end);
2031
- return i.before(s) ? !1 : new f(i.sub(s)).greaterThanOrEqual(r);
2126
+ return i.before(s) ? !1 : new O(i.sub(s)).greaterThanOrEqual(r);
2032
2127
  }
2033
2128
  contains(e) {
2034
- return e instanceof B ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2129
+ return e instanceof L ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2035
2130
  }
2036
2131
  /**
2037
2132
  * Returns a new TimeRange that is bound by the given TimeRange.
@@ -2045,25 +2140,25 @@ let Lt = class Q extends J {
2045
2140
  * console.log(bounded); // TimeRange(1500, 2000)
2046
2141
  */
2047
2142
  boundBy(e) {
2048
- const r = new B(this.start, this.end);
2143
+ const r = new L(this.start, this.end);
2049
2144
  return e.start.after(this.start) && (r.start = e.start), e.start.after(this.end) && (r.end = e.start), e.end.before(this.end) && (r.end = e.end), e.end.before(this.start) && (r.start = e.end), r;
2050
2145
  }
2051
2146
  static max(...e) {
2052
- return new B(
2147
+ return new L(
2053
2148
  b.min(...e.map((r) => r.start)),
2054
2149
  b.max(...e.map((r) => r.end))
2055
2150
  );
2056
2151
  }
2057
2152
  /** The maximum possible time range. */
2058
- static MAX = new B(b.MIN, b.MAX);
2153
+ static MAX = new L(b.MIN, b.MAX);
2059
2154
  /** The minimum possible time range. */
2060
- static MIN = new B(b.MAX, b.MIN);
2155
+ static MIN = new L(b.MAX, b.MIN);
2061
2156
  /** A time range whose start and end are both zero. */
2062
- static ZERO = new B(b.ZERO, b.ZERO);
2157
+ static ZERO = new L(b.ZERO, b.ZERO);
2063
2158
  /** A zod schema for validating and transforming time ranges */
2064
2159
  static z = a.union([
2065
- a.object({ start: b.z, end: b.z }).transform((e) => new B(e.start, e.end)),
2066
- a.instanceof(B)
2160
+ a.object({ start: b.z, end: b.z }).transform((e) => new L(e.start, e.end)),
2161
+ a.instanceof(L)
2067
2162
  ]);
2068
2163
  /**
2069
2164
  * Sorts two time ranges. The range with the earlier start time is considered less than
@@ -2079,7 +2174,7 @@ let Lt = class Q extends J {
2079
2174
  static sort(e, r) {
2080
2175
  return b.sort(e.start, r.start) || b.sort(e.end, r.end);
2081
2176
  }
2082
- }, T = class u extends J {
2177
+ }, $ = class u extends _ {
2083
2178
  constructor(e) {
2084
2179
  if (e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
2085
2180
  super(e.valueOf());
@@ -2258,20 +2353,20 @@ let Lt = class Q extends J {
2258
2353
  [BigInt64Array.name, u.INT64]
2259
2354
  ]);
2260
2355
  static DENSITIES = /* @__PURE__ */ new Map([
2261
- [u.UINT8.toString(), N.BIT8],
2262
- [u.UINT16.toString(), N.BIT16],
2263
- [u.UINT32.toString(), N.BIT32],
2264
- [u.UINT64.toString(), N.BIT64],
2265
- [u.FLOAT32.toString(), N.BIT32],
2266
- [u.FLOAT64.toString(), N.BIT64],
2267
- [u.INT8.toString(), N.BIT8],
2268
- [u.INT16.toString(), N.BIT16],
2269
- [u.INT32.toString(), N.BIT32],
2270
- [u.INT64.toString(), N.BIT64],
2271
- [u.TIMESTAMP.toString(), N.BIT64],
2272
- [u.STRING.toString(), N.UNKNOWN],
2273
- [u.JSON.toString(), N.UNKNOWN],
2274
- [u.UUID.toString(), N.BIT128]
2356
+ [u.UINT8.toString(), I.BIT8],
2357
+ [u.UINT16.toString(), I.BIT16],
2358
+ [u.UINT32.toString(), I.BIT32],
2359
+ [u.UINT64.toString(), I.BIT64],
2360
+ [u.FLOAT32.toString(), I.BIT32],
2361
+ [u.FLOAT64.toString(), I.BIT64],
2362
+ [u.INT8.toString(), I.BIT8],
2363
+ [u.INT16.toString(), I.BIT16],
2364
+ [u.INT32.toString(), I.BIT32],
2365
+ [u.INT64.toString(), I.BIT64],
2366
+ [u.TIMESTAMP.toString(), I.BIT64],
2367
+ [u.STRING.toString(), I.UNKNOWN],
2368
+ [u.JSON.toString(), I.UNKNOWN],
2369
+ [u.UUID.toString(), I.BIT128]
2275
2370
  ]);
2276
2371
  /** All the data types. */
2277
2372
  static ALL = [
@@ -2297,8 +2392,7 @@ let Lt = class Q extends J {
2297
2392
  a.string().transform((e) => new u(e)),
2298
2393
  a.instanceof(u)
2299
2394
  ]);
2300
- };
2301
- class m extends J {
2395
+ }, Le = class w extends _ {
2302
2396
  constructor(e) {
2303
2397
  super(e.valueOf());
2304
2398
  }
@@ -2312,41 +2406,59 @@ class m extends J {
2312
2406
  }
2313
2407
  /** @returns a new Size representing the sum of the two Sizes. */
2314
2408
  add(e) {
2315
- return m.bytes(this.valueOf() + e.valueOf());
2409
+ return new w(ie(this.valueOf(), e.valueOf()));
2316
2410
  }
2317
2411
  /** @returns a new Size representing the difference of the two Sizes. */
2318
2412
  sub(e) {
2319
- return m.bytes(this.valueOf() - e.valueOf());
2413
+ return new w(P(this.valueOf(), e.valueOf()));
2414
+ }
2415
+ /**
2416
+ * Multiplies this Size by a scalar value.
2417
+ *
2418
+ * @param value - The scalar value to multiply by.
2419
+ * @returns A new Size representing this Size multiplied by the value.
2420
+ */
2421
+ mult(e) {
2422
+ return new w(B(this.valueOf(), e));
2423
+ }
2424
+ /**
2425
+ * Divides this Size by a scalar value.
2426
+ *
2427
+ * @param value - The scalar value to divide by.
2428
+ * @returns A new Size representing this Size divided by the value.
2429
+ */
2430
+ div(e) {
2431
+ return new w(we(this.valueOf(), e));
2320
2432
  }
2321
2433
  /** @returns a new Size representing the truncated value of the Size. */
2322
2434
  truncate(e) {
2323
- return new m(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
2435
+ return new w(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
2324
2436
  }
2325
2437
  /** @returns a new Size representing the remainder of the Size. */
2326
2438
  remainder(e) {
2327
- return m.bytes(this.valueOf() % e.valueOf());
2439
+ return w.bytes(this.valueOf() % e.valueOf());
2328
2440
  }
2329
2441
  /** @returns the number of gigabytes in the Size. */
2330
2442
  get gigabytes() {
2331
- return this.valueOf() / m.GIGABYTE.valueOf();
2443
+ return this.valueOf() / w.GIGABYTE.valueOf();
2332
2444
  }
2333
2445
  /** @returns the number of megabytes in the Size. */
2334
2446
  get megabytes() {
2335
- return this.valueOf() / m.MEGABYTE.valueOf();
2447
+ return this.valueOf() / w.MEGABYTE.valueOf();
2336
2448
  }
2337
2449
  /** @returns the number of kilobytes in the Size. */
2338
2450
  get kilobytes() {
2339
- return this.valueOf() / m.KILOBYTE.valueOf();
2451
+ return this.valueOf() / w.KILOBYTE.valueOf();
2340
2452
  }
2341
2453
  /** @returns the number of terabytes in the Size. */
2342
2454
  get terabytes() {
2343
- return this.valueOf() / m.TERABYTE.valueOf();
2455
+ return this.valueOf() / w.TERABYTE.valueOf();
2344
2456
  }
2345
2457
  /** @returns a nicely formatted string representation of the Size. */
2346
2458
  toString() {
2347
- const e = this.truncate(m.TERABYTE), r = this.truncate(m.GIGABYTE), n = this.truncate(m.MEGABYTE), s = this.truncate(m.KILOBYTE), i = this.truncate(m.BYTE), o = e, c = r.sub(e), l = n.sub(r), h = s.sub(n), g = i.sub(s);
2348
- let p = "";
2349
- return o.isZero || (p += `${o.terabytes}TB `), c.isZero || (p += `${c.gigabytes}GB `), l.isZero || (p += `${l.megabytes}MB `), h.isZero || (p += `${h.kilobytes}KB `), (!g.isZero || p === "") && (p += `${g.valueOf()}B`), p.trim();
2459
+ const e = this.truncate(w.TERABYTE), r = this.truncate(w.GIGABYTE), n = this.truncate(w.MEGABYTE), s = this.truncate(w.KILOBYTE), i = this.truncate(w.BYTE), o = e, c = r.sub(e), h = n.sub(r), l = s.sub(n), d = i.sub(s);
2460
+ let m = "";
2461
+ return o.isZero || (m += `${o.terabytes}TB `), c.isZero || (m += `${c.gigabytes}GB `), h.isZero || (m += `${h.megabytes}MB `), l.isZero || (m += `${l.kilobytes}KB `), (!d.isZero || m === "") && (m += `${d.valueOf()}B`), m.trim();
2350
2462
  }
2351
2463
  /**
2352
2464
  * Creates a Size from the given number of bytes.
@@ -2355,10 +2467,10 @@ class m extends J {
2355
2467
  * @returns A Size representing the given number of bytes.
2356
2468
  */
2357
2469
  static bytes(e = 1) {
2358
- return new m(e);
2470
+ return new w(e);
2359
2471
  }
2360
2472
  /** A single byte */
2361
- static BYTE = new m(1);
2473
+ static BYTE = new w(1);
2362
2474
  /**
2363
2475
  * Creates a Size from the given number if kilobytes.
2364
2476
  *
@@ -2366,10 +2478,10 @@ class m extends J {
2366
2478
  * @returns A Size representing the given number of kilobytes.
2367
2479
  */
2368
2480
  static kilobytes(e = 1) {
2369
- return m.bytes(e.valueOf() * 1e3);
2481
+ return w.bytes(e.valueOf() * 1e3);
2370
2482
  }
2371
2483
  /** A kilobyte */
2372
- static KILOBYTE = m.kilobytes(1);
2484
+ static KILOBYTE = w.kilobytes(1);
2373
2485
  /**
2374
2486
  * Creates a Size from the given number of megabytes.
2375
2487
  *
@@ -2377,10 +2489,10 @@ class m extends J {
2377
2489
  * @returns A Size representing the given number of megabytes.
2378
2490
  */
2379
2491
  static megabytes(e = 1) {
2380
- return m.kilobytes(e.valueOf() * 1e3);
2492
+ return w.kilobytes(e.valueOf() * 1e3);
2381
2493
  }
2382
2494
  /** A megabyte */
2383
- static MEGABYTE = m.megabytes(1);
2495
+ static MEGABYTE = w.megabytes(1);
2384
2496
  /**
2385
2497
  * Creates a Size from the given number of gigabytes.
2386
2498
  *
@@ -2388,10 +2500,10 @@ class m extends J {
2388
2500
  * @returns A Size representing the given number of gigabytes.
2389
2501
  */
2390
2502
  static gigabytes(e = 1) {
2391
- return m.megabytes(e.valueOf() * 1e3);
2503
+ return w.megabytes(e.valueOf() * 1e3);
2392
2504
  }
2393
2505
  /** A gigabyte */
2394
- static GIGABYTE = m.gigabytes(1);
2506
+ static GIGABYTE = w.gigabytes(1);
2395
2507
  /**
2396
2508
  * Creates a Size from the given number of terabytes.
2397
2509
  *
@@ -2399,23 +2511,23 @@ class m extends J {
2399
2511
  * @returns A Size representing the given number of terabytes.
2400
2512
  */
2401
2513
  static terabytes(e) {
2402
- return m.gigabytes(e.valueOf() * 1e3);
2514
+ return w.gigabytes(e.valueOf() * 1e3);
2403
2515
  }
2404
2516
  /** A terabyte. */
2405
- static TERABYTE = m.terabytes(1);
2517
+ static TERABYTE = w.terabytes(1);
2406
2518
  /** The zero value for Size */
2407
- static ZERO = new m(0);
2519
+ static ZERO = new w(0);
2408
2520
  /** A zod schema for a Size. */
2409
2521
  static z = a.union([
2410
- a.number().transform((e) => new m(e)),
2411
- a.instanceof(m)
2522
+ a.number().transform((e) => new w(e)),
2523
+ a.instanceof(w)
2412
2524
  ]);
2413
2525
  /** @returns true if the Size is zero. */
2414
2526
  get isZero() {
2415
2527
  return this.valueOf() === 0;
2416
2528
  }
2417
- }
2418
- const So = a.union([
2529
+ };
2530
+ const Bo = a.union([
2419
2531
  a.instanceof(Uint8Array),
2420
2532
  a.instanceof(Uint16Array),
2421
2533
  a.instanceof(Uint32Array),
@@ -2426,40 +2538,40 @@ const So = a.union([
2426
2538
  a.instanceof(Int16Array),
2427
2539
  a.instanceof(Int32Array),
2428
2540
  a.instanceof(BigInt64Array)
2429
- ]), Tr = (t) => {
2541
+ ]), Mr = (t) => {
2430
2542
  const e = typeof t;
2431
- return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof f || t instanceof Date;
2432
- }, $i = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Me(r, -n), Me = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Si = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
2433
- function Ni(t) {
2434
- return typeof t == "string" && Si.test(t);
2543
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof O || t instanceof Date;
2544
+ }, Ei = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ue(r, -n), Ue = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Ai = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
2545
+ function Bi(t) {
2546
+ return typeof t == "string" && Ai.test(t);
2435
2547
  }
2436
- const $ = [];
2548
+ const N = [];
2437
2549
  for (let t = 0; t < 256; ++t)
2438
- $.push((t + 256).toString(16).slice(1));
2439
- function Ii(t, e = 0) {
2440
- return ($[t[e + 0]] + $[t[e + 1]] + $[t[e + 2]] + $[t[e + 3]] + "-" + $[t[e + 4]] + $[t[e + 5]] + "-" + $[t[e + 6]] + $[t[e + 7]] + "-" + $[t[e + 8]] + $[t[e + 9]] + "-" + $[t[e + 10]] + $[t[e + 11]] + $[t[e + 12]] + $[t[e + 13]] + $[t[e + 14]] + $[t[e + 15]]).toLowerCase();
2550
+ N.push((t + 256).toString(16).slice(1));
2551
+ function Ui(t, e = 0) {
2552
+ return (N[t[e + 0]] + N[t[e + 1]] + N[t[e + 2]] + N[t[e + 3]] + "-" + N[t[e + 4]] + N[t[e + 5]] + "-" + N[t[e + 6]] + N[t[e + 7]] + "-" + N[t[e + 8]] + N[t[e + 9]] + "-" + N[t[e + 10]] + N[t[e + 11]] + N[t[e + 12]] + N[t[e + 13]] + N[t[e + 14]] + N[t[e + 15]]).toLowerCase();
2441
2553
  }
2442
- function Mi(t, e = 0) {
2443
- const r = Ii(t, e);
2444
- if (!Ni(r))
2554
+ function Ci(t, e = 0) {
2555
+ const r = Ui(t, e);
2556
+ if (!Bi(r))
2445
2557
  throw TypeError("Stringified UUID is invalid");
2446
2558
  return r;
2447
2559
  }
2448
2560
  typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2449
- const xr = (t, e) => Mi(t, e), L = -1, it = {
2450
- [Symbol.iterator]: () => it,
2561
+ const Er = (t, e) => Ci(t, e), z = -1, ht = {
2562
+ [Symbol.iterator]: () => ht,
2451
2563
  next: () => ({ done: !0, value: void 0 })
2452
- }, Ei = a.string().transform(
2564
+ }, ji = a.string().transform(
2453
2565
  (t) => new Uint8Array(
2454
2566
  atob(t).split("").map((e) => e.charCodeAt(0))
2455
2567
  ).buffer
2456
- ), Ai = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), at = 10, $r = (t, e) => {
2568
+ ), Ri = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), ft = 10, Ar = (t, e) => {
2457
2569
  if (t === "number" && !e.isNumeric)
2458
2570
  throw new Error(`cannot convert series of type ${e.toString()} to number`);
2459
2571
  if (t === "bigint" && !e.usesBigInt)
2460
2572
  throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
2461
- }, Sr = "sy_x_telem_series";
2462
- let Nr = class D {
2573
+ }, Br = "sy_x_telem_series";
2574
+ let Ur = class F {
2463
2575
  /**
2464
2576
  * A unique identifier for the series. If specified by the user, it is their
2465
2577
  * responsibility to ensure that it is unique. If not specified, a new ID will be
@@ -2470,7 +2582,7 @@ let Nr = class D {
2470
2582
  * A discriminator used for identifying instances of the series class even
2471
2583
  * when bundlers mangle the class name.
2472
2584
  */
2473
- discriminator = Sr;
2585
+ discriminator = Br;
2474
2586
  /** The data type of the series. */
2475
2587
  dataType;
2476
2588
  /**
@@ -2486,18 +2598,24 @@ let Nr = class D {
2486
2598
  /** The underlying data. */
2487
2599
  _data;
2488
2600
  /** The time range occupied by the series' data. */
2489
- timeRange = V.ZERO;
2601
+ timeRange = J.ZERO;
2490
2602
  /**
2491
2603
  * Alignment defines the location of the series relative to other series in a logical
2492
2604
  * group. Useful for defining the position of the series within a channel's data.
2493
2605
  */
2494
2606
  alignment = 0n;
2607
+ /**
2608
+ * Alignment multiple defines the number of alignment steps taken per sample. This is
2609
+ * useful for when the samples in a series represent a partial view of the raw data
2610
+ * i.e. decimation or averaging.
2611
+ */
2612
+ alignmentMultiple = 1n;
2495
2613
  /** A cached minimum value. */
2496
2614
  cachedMin;
2497
2615
  /** A cached maximum value. */
2498
2616
  cachedMax;
2499
2617
  /** The write position of the buffer. */
2500
- writePos = L;
2618
+ writePos = z;
2501
2619
  /** Tracks the number of entities currently using this array. */
2502
2620
  _refCount = 0;
2503
2621
  /** Caches the length of the array for variable length data types. */
@@ -2509,22 +2627,22 @@ let Nr = class D {
2509
2627
  * can be constructed into a series.
2510
2628
  */
2511
2629
  static crudeZ = a.object({
2512
- timeRange: V.z.optional(),
2513
- dataType: T.z,
2630
+ timeRange: J.z.optional(),
2631
+ dataType: $.z,
2514
2632
  alignment: a.coerce.bigint().optional(),
2515
2633
  data: a.union([
2516
- Ei,
2517
- Ai,
2634
+ ji,
2635
+ Ri,
2518
2636
  a.instanceof(ArrayBuffer),
2519
2637
  a.instanceof(Uint8Array)
2520
2638
  ]),
2521
- glBufferUsage: Ti.optional().default("static").optional()
2639
+ glBufferUsage: Ii.optional().default("static").optional()
2522
2640
  });
2523
2641
  /**
2524
2642
  * A zod schema that validates and constructs a series from it's crude
2525
2643
  * representation.
2526
2644
  */
2527
- static z = D.crudeZ.transform((e) => new D(e));
2645
+ static z = F.crudeZ.transform((e) => new F(e));
2528
2646
  /**
2529
2647
  * The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
2530
2648
  *
@@ -2599,69 +2717,70 @@ let Nr = class D {
2599
2717
  * @throws Error if data type cannot be inferred from input
2600
2718
  */
2601
2719
  constructor(e) {
2602
- Bi(e) && (e = { data: e }), e.data ??= [];
2720
+ Li(e) && (e = { data: e }), e.data ??= [];
2603
2721
  const {
2604
2722
  dataType: r,
2605
2723
  timeRange: n,
2606
2724
  sampleOffset: s = 0,
2607
2725
  glBufferUsage: i = "static",
2608
2726
  alignment: o = 0n,
2609
- key: c = At(),
2727
+ alignmentMultiple: c = 1n,
2728
+ key: h = Lt(),
2610
2729
  data: l
2611
2730
  } = e;
2612
- if (Ir(l)) {
2731
+ if (Cr(l)) {
2613
2732
  const p = l;
2614
- this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
2733
+ this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.alignmentMultiple = p.alignmentMultiple, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
2615
2734
  return;
2616
2735
  }
2617
- const h = Tr(l), g = Array.isArray(l);
2618
- if (r != null) this.dataType = new T(r);
2736
+ const d = Mr(l), m = Array.isArray(l);
2737
+ if (r != null) this.dataType = new $(r);
2619
2738
  else {
2620
2739
  if (l instanceof ArrayBuffer)
2621
2740
  throw new Error(
2622
2741
  "cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
2623
2742
  );
2624
- if (g || h) {
2743
+ if (m || d) {
2625
2744
  let p = l;
2626
- if (!h) {
2745
+ if (!d) {
2627
2746
  if (l.length === 0)
2628
2747
  throw new Error(
2629
2748
  "cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
2630
2749
  );
2631
2750
  p = l[0];
2632
2751
  }
2633
- if (typeof p == "string") this.dataType = T.STRING;
2634
- else if (typeof p == "number") this.dataType = T.FLOAT64;
2635
- else if (typeof p == "bigint") this.dataType = T.INT64;
2636
- else if (typeof p == "boolean") this.dataType = T.BOOLEAN;
2752
+ if (typeof p == "string") this.dataType = $.STRING;
2753
+ else if (typeof p == "number") this.dataType = $.FLOAT64;
2754
+ else if (typeof p == "bigint") this.dataType = $.INT64;
2755
+ else if (typeof p == "boolean") this.dataType = $.BOOLEAN;
2637
2756
  else if (p instanceof b || p instanceof Date || p instanceof b)
2638
- this.dataType = T.TIMESTAMP;
2639
- else if (typeof p == "object") this.dataType = T.JSON;
2757
+ this.dataType = $.TIMESTAMP;
2758
+ else if (typeof p == "object") this.dataType = $.JSON;
2640
2759
  else
2641
2760
  throw new Error(
2642
2761
  `cannot infer data type of ${typeof p} when constructing a Series from a JS array`
2643
2762
  );
2644
- } else this.dataType = new T(l);
2763
+ } else this.dataType = new $(l);
2645
2764
  }
2646
- if (!g && !h) this._data = l;
2647
- else if (g && l.length === 0)
2765
+ if (!m && !d) this._data = l;
2766
+ else if (m && l.length === 0)
2648
2767
  this._data = new this.dataType.Array([]).buffer;
2649
2768
  else {
2650
- let p = h ? [l] : l;
2651
- const S = p[0];
2652
- (S instanceof b || S instanceof Date || S instanceof f) && (p = p.map((E) => new b(E).valueOf())), this.dataType.equals(T.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2769
+ let p = d ? [l] : l;
2770
+ const j = p[0];
2771
+ (j instanceof b || j instanceof Date || j instanceof O) && (p = p.map((A) => new b(A).valueOf())), this.dataType.equals($.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2653
2772
  `)}
2654
- `).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2655
- `${p.map((E) => He.encodeString(E)).join(`
2773
+ `).buffer) : this.dataType.equals($.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2774
+ `${p.map((A) => et.encodeString(A)).join(`
2656
2775
  `)}
2657
2776
  `
2658
- ).buffer) : this.dataType.usesBigInt && typeof S == "number" ? this._data = new this.dataType.Array(
2659
- p.map((E) => BigInt(Math.round(E)))
2660
- ).buffer : !this.dataType.usesBigInt && typeof S == "bigint" ? this._data = new this.dataType.Array(
2777
+ ).buffer) : this.dataType.usesBigInt && typeof j == "number" ? this._data = new this.dataType.Array(
2778
+ p.map((A) => BigInt(Math.round(A)))
2779
+ ).buffer : !this.dataType.usesBigInt && typeof j == "bigint" ? this._data = new this.dataType.Array(
2661
2780
  p.map(Number)
2662
2781
  ).buffer : this._data = new this.dataType.Array(p).buffer;
2663
2782
  }
2664
- this.key = c, this.alignment = o, this.sampleOffset = s ?? 0, this.timeRange = n ?? V.ZERO, this.gl = {
2783
+ this.key = h, this.alignment = o, this.alignmentMultiple = c, this.sampleOffset = s ?? 0, this.timeRange = n ?? J.ZERO, this.gl = {
2665
2784
  control: null,
2666
2785
  buffer: null,
2667
2786
  prevBuffer: 0,
@@ -2678,7 +2797,7 @@ let Nr = class D {
2678
2797
  static alloc({ capacity: e, dataType: r, ...n }) {
2679
2798
  if (e === 0)
2680
2799
  throw new Error("[Series] - cannot allocate an array of length 0");
2681
- const s = new new T(r).Array(e), i = new D({ data: s.buffer, dataType: r, ...n });
2800
+ const s = new new $(r).Array(e), i = new F({ data: s.buffer, dataType: r, ...n });
2682
2801
  return i.writePos = 0, i;
2683
2802
  }
2684
2803
  /**
@@ -2721,12 +2840,12 @@ let Nr = class D {
2721
2840
  return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
2722
2841
  }
2723
2842
  writeVariable(e) {
2724
- if (this.writePos === L) return 0;
2843
+ if (this.writePos === z) return 0;
2725
2844
  const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
2726
2845
  return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
2727
2846
  }
2728
2847
  writeFixed(e) {
2729
- if (this.writePos === L) return 0;
2848
+ if (this.writePos === z) return 0;
2730
2849
  const r = this.capacity - this.writePos, n = e.sub(0, r);
2731
2850
  return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
2732
2851
  }
@@ -2749,7 +2868,7 @@ let Nr = class D {
2749
2868
  * @returns A typed array containing the series data.
2750
2869
  */
2751
2870
  get data() {
2752
- return this.writePos === L ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2871
+ return this.writePos === z ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2753
2872
  }
2754
2873
  /**
2755
2874
  * Returns an array of the values in the series as strings.
@@ -2768,16 +2887,16 @@ let Nr = class D {
2768
2887
  * @returns An array of values parsed from the JSON series.
2769
2888
  */
2770
2889
  parseJSON(e) {
2771
- if (!this.dataType.equals(T.JSON))
2890
+ if (!this.dataType.equals($.JSON))
2772
2891
  throw new Error("cannot parse non-JSON series as JSON");
2773
- return this.toStrings().map((r) => e.parse(He.decodeString(r)));
2892
+ return this.toStrings().map((r) => e.parse(et.decodeString(r)));
2774
2893
  }
2775
2894
  /**
2776
2895
  * Returns the capacity of the series in bytes.
2777
2896
  * @returns The size of the underlying buffer in bytes.
2778
2897
  */
2779
2898
  get byteCapacity() {
2780
- return new m(this.underlyingData.byteLength);
2899
+ return new Le(this.underlyingData.byteLength);
2781
2900
  }
2782
2901
  /**
2783
2902
  * Returns the capacity of the series in samples.
@@ -2793,7 +2912,7 @@ let Nr = class D {
2793
2912
  * @returns The size of the data in bytes.
2794
2913
  */
2795
2914
  get byteLength() {
2796
- return this.writePos === L ? this.byteCapacity : this.dataType.isVariable ? new m(this.writePos) : this.dataType.density.size(this.writePos);
2915
+ return this.writePos === z ? this.byteCapacity : this.dataType.isVariable ? new Le(this.writePos) : this.dataType.density.size(this.writePos);
2797
2916
  }
2798
2917
  /**
2799
2918
  * Returns the number of samples in this array.
@@ -2801,7 +2920,7 @@ let Nr = class D {
2801
2920
  * @returns The number of samples in the series.
2802
2921
  */
2803
2922
  get length() {
2804
- return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === L ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2923
+ return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === z ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2805
2924
  }
2806
2925
  calculateCachedLength() {
2807
2926
  if (!this.dataType.isVariable)
@@ -2809,7 +2928,7 @@ let Nr = class D {
2809
2928
  let e = 0;
2810
2929
  const r = [0];
2811
2930
  return this.data.forEach((n, s) => {
2812
- n === at && (e++, r.push(s + 1));
2931
+ n === ft && (e++, r.push(s + 1));
2813
2932
  }), this._cachedIndexes = r, this.cachedLength = e, e;
2814
2933
  }
2815
2934
  /**
@@ -2825,8 +2944,8 @@ let Nr = class D {
2825
2944
  if (this.dataType.equals(e)) return this;
2826
2945
  const n = new e.Array(this.length);
2827
2946
  for (let s = 0; s < this.length; s++)
2828
- n[s] = $i(this.dataType, e, this.data[s], r);
2829
- return new D({
2947
+ n[s] = Ei(this.dataType, e, this.data[s], r);
2948
+ return new F({
2830
2949
  data: n.buffer,
2831
2950
  dataType: e,
2832
2951
  timeRange: this.timeRange,
@@ -2837,7 +2956,7 @@ let Nr = class D {
2837
2956
  }
2838
2957
  calcRawMax() {
2839
2958
  if (this.length === 0) return -1 / 0;
2840
- if (this.dataType.equals(T.TIMESTAMP))
2959
+ if (this.dataType.equals($.TIMESTAMP))
2841
2960
  this.cachedMax = this.data[this.data.length - 1];
2842
2961
  else if (this.dataType.usesBigInt) {
2843
2962
  const e = this.data;
@@ -2855,11 +2974,11 @@ let Nr = class D {
2855
2974
  calcMax() {
2856
2975
  if (this.dataType.isVariable)
2857
2976
  throw new Error("cannot calculate maximum on a variable length data type");
2858
- return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Me(this.cachedMax, this.sampleOffset));
2977
+ return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Ue(this.cachedMax, this.sampleOffset));
2859
2978
  }
2860
2979
  calcRawMin() {
2861
2980
  if (this.length === 0) return 1 / 0;
2862
- if (this.dataType.equals(T.TIMESTAMP)) this.cachedMin = this.data[0];
2981
+ if (this.dataType.equals($.TIMESTAMP)) this.cachedMin = this.data[0];
2863
2982
  else if (this.dataType.usesBigInt) {
2864
2983
  const e = this.data;
2865
2984
  this.cachedMin = e.reduce((r, n) => r < n ? r : n);
@@ -2876,7 +2995,7 @@ let Nr = class D {
2876
2995
  calcMin() {
2877
2996
  if (this.dataType.isVariable)
2878
2997
  throw new Error("cannot calculate minimum on a variable length data type");
2879
- return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Me(this.cachedMin, this.sampleOffset));
2998
+ return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Ue(this.cachedMin, this.sampleOffset));
2880
2999
  }
2881
3000
  /** @returns the bounds of the series. */
2882
3001
  get bounds() {
@@ -2893,7 +3012,7 @@ let Nr = class D {
2893
3012
  }
2894
3013
  }
2895
3014
  atAlignment(e, r) {
2896
- const n = Number(e - this.alignment);
3015
+ const n = Number((e - this.alignment) / this.alignmentMultiple);
2897
3016
  if (n < 0 || n >= this.length) {
2898
3017
  if (r === !0) throw new Error(`[series] - no value at index ${n}`);
2899
3018
  return;
@@ -2902,18 +3021,18 @@ let Nr = class D {
2902
3021
  }
2903
3022
  at(e, r = !1) {
2904
3023
  if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
2905
- if (this.dataType.equals(T.UUID)) return this.atUUID(e, r);
3024
+ if (this.dataType.equals($.UUID)) return this.atUUID(e, r);
2906
3025
  e < 0 && (e = this.length + e);
2907
3026
  const n = this.data[e];
2908
3027
  if (n == null) {
2909
3028
  if (r === !0) throw new Error(`[series] - no value at index ${e}`);
2910
3029
  return;
2911
3030
  }
2912
- return Me(n, this.sampleOffset);
3031
+ return Ue(n, this.sampleOffset);
2913
3032
  }
2914
3033
  atUUID(e, r) {
2915
3034
  e < 0 && (e = this.length + e);
2916
- const n = xr(
3035
+ const n = Er(
2917
3036
  new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
2918
3037
  );
2919
3038
  if (n == null) {
@@ -2929,7 +3048,7 @@ let Nr = class D {
2929
3048
  else {
2930
3049
  e < 0 && (e = this.length + e);
2931
3050
  for (let o = 0; o < this.data.length; o++)
2932
- if (this.data[o] === at) {
3051
+ if (this.data[o] === ft) {
2933
3052
  if (e === 0) {
2934
3053
  s = o;
2935
3054
  break;
@@ -2942,7 +3061,7 @@ let Nr = class D {
2942
3061
  }
2943
3062
  }
2944
3063
  const i = this.data.slice(n, s);
2945
- return this.dataType.equals(T.STRING) ? new TextDecoder().decode(i) : ct(JSON.parse(new TextDecoder().decode(i)));
3064
+ return this.dataType.equals($.STRING) ? new TextDecoder().decode(i) : mt(JSON.parse(new TextDecoder().decode(i)));
2946
3065
  }
2947
3066
  /**
2948
3067
  * @returns the index of the first sample that is greater than or equal to the given value.
@@ -2951,7 +3070,7 @@ let Nr = class D {
2951
3070
  */
2952
3071
  binarySearch(e) {
2953
3072
  let r = 0, n = this.length - 1;
2954
- const s = Be(e);
3073
+ const s = De(e);
2955
3074
  for (; r <= n; ) {
2956
3075
  const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
2957
3076
  if (o === 0) return i;
@@ -2967,11 +3086,11 @@ let Nr = class D {
2967
3086
  * be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
2968
3087
  */
2969
3088
  updateGLBuffer(e) {
2970
- if (this.gl.control = e, !this.dataType.equals(T.FLOAT32) && !this.dataType.equals(T.UINT8))
3089
+ if (this.gl.control = e, !this.dataType.equals($.FLOAT32) && !this.dataType.equals($.UINT8))
2971
3090
  throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
2972
3091
  const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
2973
3092
  if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
2974
- if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== L) {
3093
+ if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== z) {
2975
3094
  s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
2976
3095
  const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
2977
3096
  e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
@@ -2980,10 +3099,10 @@ let Nr = class D {
2980
3099
  e.ARRAY_BUFFER,
2981
3100
  this.buffer,
2982
3101
  n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
2983
- ), this.gl.prevBuffer = L;
3102
+ ), this.gl.prevBuffer = z;
2984
3103
  }
2985
3104
  as(e) {
2986
- return $r(e, this.dataType), this;
3105
+ return Ar(e, this.dataType), this;
2987
3106
  }
2988
3107
  /** @returns a digest containing information about the series. */
2989
3108
  get digest() {
@@ -2992,8 +3111,8 @@ let Nr = class D {
2992
3111
  dataType: this.dataType.toString(),
2993
3112
  sampleOffset: this.sampleOffset,
2994
3113
  alignment: {
2995
- lower: Pt(this.alignmentBounds.lower),
2996
- upper: Pt(this.alignmentBounds.upper)
3114
+ lower: Zt(this.alignmentBounds.lower),
3115
+ upper: Zt(this.alignmentBounds.upper)
2997
3116
  },
2998
3117
  timeRange: this.timeRange.toString(),
2999
3118
  length: this.length,
@@ -3010,7 +3129,10 @@ let Nr = class D {
3010
3129
  * is exclusive.
3011
3130
  */
3012
3131
  get alignmentBounds() {
3013
- return y(this.alignment, this.alignment + BigInt(this.length));
3132
+ return y(
3133
+ this.alignment,
3134
+ this.alignment + BigInt(this.length) * this.alignmentMultiple
3135
+ );
3014
3136
  }
3015
3137
  maybeGarbageCollectGLBuffer(e) {
3016
3138
  this.gl.buffer != null && (e.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
@@ -3027,10 +3149,10 @@ let Nr = class D {
3027
3149
  }
3028
3150
  [Symbol.iterator]() {
3029
3151
  if (this.dataType.isVariable) {
3030
- const e = new Ui(this);
3031
- return this.dataType.equals(T.JSON) ? new Ci(e) : e;
3152
+ const e = new Di(this);
3153
+ return this.dataType.equals($.JSON) ? new Pi(e) : e;
3032
3154
  }
3033
- return this.dataType.equals(T.UUID) ? new ji(this) : new Ri(this);
3155
+ return this.dataType.equals($.UUID) ? new qi(this) : new ki(this);
3034
3156
  }
3035
3157
  /**
3036
3158
  * Returns a slice of the series from start to end.
@@ -3057,7 +3179,7 @@ let Nr = class D {
3057
3179
  * @returns An iterator over the specified range.
3058
3180
  */
3059
3181
  subIterator(e, r) {
3060
- return new Dt(this, e, r ?? this.length);
3182
+ return new Ft(this, e, r ?? this.length);
3061
3183
  }
3062
3184
  /**
3063
3185
  * Returns an iterator over a portion of the series based on alignment.
@@ -3066,16 +3188,17 @@ let Nr = class D {
3066
3188
  * @returns An iterator over the specified alignment range.
3067
3189
  */
3068
3190
  subAlignmentIterator(e, r) {
3069
- return new Dt(
3070
- this,
3071
- Number(e - this.alignment),
3072
- Number(r - this.alignment)
3191
+ const n = Math.ceil(
3192
+ Number(e - this.alignment) / Number(this.alignmentMultiple)
3193
+ ), s = Math.ceil(
3194
+ Number(r - this.alignment) / Number(this.alignmentMultiple)
3073
3195
  );
3196
+ return new Ft(this, n, s);
3074
3197
  }
3075
3198
  subBytes(e, r) {
3076
3199
  if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
3077
3200
  const n = this.data.subarray(e, r);
3078
- return new D({
3201
+ return new F({
3079
3202
  data: n,
3080
3203
  dataType: this.dataType,
3081
3204
  timeRange: this.timeRange,
@@ -3087,7 +3210,7 @@ let Nr = class D {
3087
3210
  sliceSub(e, r, n) {
3088
3211
  if (r <= 0 && (n == null || n >= this.length)) return this;
3089
3212
  let s;
3090
- return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new D({
3213
+ return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new F({
3091
3214
  data: s,
3092
3215
  dataType: this.dataType,
3093
3216
  timeRange: this.timeRange,
@@ -3102,10 +3225,10 @@ let Nr = class D {
3102
3225
  * @returns A new series with the specified alignment.
3103
3226
  */
3104
3227
  reAlign(e) {
3105
- return new D({
3228
+ return new F({
3106
3229
  data: this.buffer,
3107
3230
  dataType: this.dataType,
3108
- timeRange: V.ZERO,
3231
+ timeRange: J.ZERO,
3109
3232
  sampleOffset: this.sampleOffset,
3110
3233
  glBufferUsage: "static",
3111
3234
  alignment: e
@@ -3129,21 +3252,20 @@ let Nr = class D {
3129
3252
  return e += "])", e;
3130
3253
  }
3131
3254
  };
3132
- const Bi = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Nr ? !0 : Tr(t), Ir = vi(Sr, Nr);
3133
- let Dt = class {
3255
+ const Li = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Ur ? !0 : Mr(t), Cr = Ni(Br, Ur);
3256
+ let Ft = class {
3134
3257
  series;
3135
3258
  end;
3136
3259
  index;
3137
3260
  constructor(e, r, n) {
3138
3261
  this.series = e;
3139
- const s = y(0, e.length);
3140
- this.end = Qe(s, n), this.index = Qe(s, r);
3262
+ const s = y(0, e.length + 1);
3263
+ this.end = st(s, n), this.index = st(s, r);
3141
3264
  }
3142
3265
  next() {
3143
3266
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3144
3267
  }
3145
- };
3146
- class Ui {
3268
+ }, Di = class {
3147
3269
  series;
3148
3270
  index;
3149
3271
  decoder;
@@ -3156,12 +3278,11 @@ class Ui {
3156
3278
  }
3157
3279
  next() {
3158
3280
  const e = this.index, r = this.series.data;
3159
- for (; this.index < r.length && r[this.index] !== at; ) this.index++;
3281
+ for (; this.index < r.length && r[this.index] !== ft; ) this.index++;
3160
3282
  const n = this.index;
3161
3283
  return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
3162
3284
  }
3163
- }
3164
- let Ci = class Mr {
3285
+ }, Pi = class jr {
3165
3286
  wrapped;
3166
3287
  static schema = a.record(a.string(), a.unknown());
3167
3288
  constructor(e) {
@@ -3171,25 +3292,26 @@ let Ci = class Mr {
3171
3292
  const e = this.wrapped.next();
3172
3293
  return e.done === !0 ? { done: !0, value: void 0 } : {
3173
3294
  done: !1,
3174
- value: He.decodeString(e.value, Mr.schema)
3295
+ value: et.decodeString(e.value, jr.schema)
3175
3296
  };
3176
3297
  }
3177
- }, ji = class {
3298
+ }, qi = class {
3178
3299
  series;
3179
3300
  index;
3180
3301
  data;
3181
3302
  density;
3182
3303
  constructor(e) {
3183
- if (!e.dataType.equals(T.UUID))
3304
+ if (!e.dataType.equals($.UUID))
3184
3305
  throw new Error("cannot create a UUID series iterator for a non-UUID series");
3185
- this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = T.UUID.density.valueOf();
3306
+ this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = $.UUID.density.valueOf();
3186
3307
  }
3187
3308
  next() {
3188
3309
  if (this.index >= this.series.length) return { done: !0, value: void 0 };
3189
- const e = xr(this.data, this.index * this.density);
3310
+ const e = Er(this.data, this.index * this.density);
3190
3311
  return this.index++, { done: !1, value: e };
3191
3312
  }
3192
- }, Ri = class {
3313
+ };
3314
+ class ki {
3193
3315
  series;
3194
3316
  index;
3195
3317
  constructor(e) {
@@ -3201,7 +3323,8 @@ let Ci = class Mr {
3201
3323
  value: this.series.at(this.index++, !0)
3202
3324
  };
3203
3325
  }
3204
- }, Eo = class {
3326
+ }
3327
+ let Ro = class {
3205
3328
  /** The array of series in this collection */
3206
3329
  series;
3207
3330
  /**
@@ -3254,14 +3377,14 @@ let Ci = class Mr {
3254
3377
  this.series = e;
3255
3378
  }
3256
3379
  as(e) {
3257
- return $r(e, this.dataType), this;
3380
+ return Ar(e, this.dataType), this;
3258
3381
  }
3259
3382
  /**
3260
3383
  * Returns the data type of the series in this collection. If the collection is empty,
3261
3384
  * returns DataType.UNKNOWN.
3262
3385
  */
3263
3386
  get dataType() {
3264
- return this.series.length === 0 ? T.UNKNOWN : this.series[0].dataType;
3387
+ return this.series.length === 0 ? $.UNKNOWN : this.series[0].dataType;
3265
3388
  }
3266
3389
  /**
3267
3390
  * Returns the combined time range of all series in the collection. If the collection
@@ -3269,7 +3392,7 @@ let Ci = class Mr {
3269
3392
  * series to the end of the last series.
3270
3393
  */
3271
3394
  get timeRange() {
3272
- return this.series.length === 0 ? V.ZERO : new V(
3395
+ return this.series.length === 0 ? J.ZERO : new J(
3273
3396
  this.series[0].timeRange.start,
3274
3397
  this.series[this.series.length - 1].timeRange.end
3275
3398
  );
@@ -3296,7 +3419,7 @@ let Ci = class Mr {
3296
3419
  const r = () => new Error(
3297
3420
  `cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
3298
3421
  ), n = e.dataType.equals(this.dataType);
3299
- if (Ir(e)) {
3422
+ if (Cr(e)) {
3300
3423
  if (this.series.length !== 0 && !n) throw r();
3301
3424
  this.series.push(e);
3302
3425
  } else {
@@ -3314,7 +3437,7 @@ let Ci = class Mr {
3314
3437
  }
3315
3438
  atAlignment(e, r) {
3316
3439
  for (const n of this.series)
3317
- if (I(n.alignmentBounds, e))
3440
+ if (U(n.alignmentBounds, e))
3318
3441
  return n.atAlignment(e, r);
3319
3442
  if (r) throw new Error(`[series] - no value at alignment ${e}`);
3320
3443
  }
@@ -3333,7 +3456,7 @@ let Ci = class Mr {
3333
3456
  * @returns An iterator over the specified range.
3334
3457
  */
3335
3458
  subIterator(e, r) {
3336
- return new Ye(this, e, r ?? this.length);
3459
+ return new Xe(this, e, r ?? this.length);
3337
3460
  }
3338
3461
  /**
3339
3462
  * Returns an iterator over a portion of the multi-series based on alignment.
@@ -3343,14 +3466,16 @@ let Ci = class Mr {
3343
3466
  */
3344
3467
  subAlignmentIterator(e, r) {
3345
3468
  if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
3346
- return it;
3469
+ return ht;
3347
3470
  let n = 0;
3348
3471
  for (let i = 0; i < this.series.length; i++) {
3349
3472
  const o = this.series[i];
3350
3473
  if (e < o.alignment) break;
3351
3474
  if (e >= o.alignmentBounds.upper) n += o.length;
3352
- else if (I(o.alignmentBounds, e)) {
3353
- n += Number(e - o.alignment);
3475
+ else if (U(o.alignmentBounds, e)) {
3476
+ n += Math.ceil(
3477
+ Number(e - o.alignment) / Number(o.alignmentMultiple)
3478
+ );
3354
3479
  break;
3355
3480
  }
3356
3481
  }
@@ -3359,12 +3484,14 @@ let Ci = class Mr {
3359
3484
  const o = this.series[i];
3360
3485
  if (r < o.alignment) break;
3361
3486
  if (r >= o.alignmentBounds.upper) s += o.length;
3362
- else if (I(o.alignmentBounds, r)) {
3363
- s += Number(r - o.alignment);
3487
+ else if (U(o.alignmentBounds, r)) {
3488
+ s += Math.ceil(
3489
+ Number(r - o.alignment) / Number(o.alignmentMultiple)
3490
+ );
3364
3491
  break;
3365
3492
  }
3366
3493
  }
3367
- return new Ye(this, n, s);
3494
+ return new Xe(this, n, s);
3368
3495
  }
3369
3496
  /**
3370
3497
  * Returns an iterator over the specified alignment range and span.
@@ -3373,19 +3500,19 @@ let Ci = class Mr {
3373
3500
  * @returns An iterator over the specified range.
3374
3501
  */
3375
3502
  subAlignmentSpanIterator(e, r) {
3376
- if (e >= this.alignmentBounds.upper) return it;
3503
+ if (e >= this.alignmentBounds.upper) return ht;
3377
3504
  r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
3378
3505
  let n = 0;
3379
3506
  for (let s = 0; s < this.series.length; s++) {
3380
3507
  const i = this.series[s];
3381
3508
  if (e < i.alignment) break;
3382
3509
  if (e >= i.alignmentBounds.upper) n += i.length;
3383
- else if (I(i.alignmentBounds, e)) {
3510
+ else if (U(i.alignmentBounds, e)) {
3384
3511
  n += Number(e - i.alignment);
3385
3512
  break;
3386
3513
  }
3387
3514
  }
3388
- return new Ye(this, n, n + r);
3515
+ return new Xe(this, n, n + r);
3389
3516
  }
3390
3517
  /**
3391
3518
  * Updates the WebGL buffer for all series in the collection.
@@ -3398,13 +3525,13 @@ let Ci = class Mr {
3398
3525
  * Returns the bounds containing the minimum and maximum values across all series.
3399
3526
  */
3400
3527
  get bounds() {
3401
- return nr(this.series.map((e) => e.bounds));
3528
+ return or(this.series.map((e) => e.bounds));
3402
3529
  }
3403
3530
  /**
3404
3531
  * Returns the sum of the byte lengths of all series.
3405
3532
  */
3406
3533
  get byteLength() {
3407
- return new m(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3534
+ return new Le(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3408
3535
  }
3409
3536
  /**
3410
3537
  * Returns a combined typed array containing all data from all series.
@@ -3425,7 +3552,7 @@ let Ci = class Mr {
3425
3552
  */
3426
3553
  traverseAlignment(e, r) {
3427
3554
  const n = this.series.map((s) => s.alignmentBounds);
3428
- return sr(n, e, r);
3555
+ return ur(n, e, r);
3429
3556
  }
3430
3557
  /**
3431
3558
  * Acquires a reference to the WebGL buffer for all series.
@@ -3448,7 +3575,7 @@ let Ci = class Mr {
3448
3575
  */
3449
3576
  distance(e, r) {
3450
3577
  const n = this.series.map((s) => s.alignmentBounds);
3451
- return ir(n, e, r);
3578
+ return lr(n, e, r);
3452
3579
  }
3453
3580
  /**
3454
3581
  * Parses a JSON multi-series into an array of values using the provided zod schema.
@@ -3458,7 +3585,7 @@ let Ci = class Mr {
3458
3585
  * @returns An array of values parsed from the JSON series.
3459
3586
  */
3460
3587
  parseJSON(e) {
3461
- if (!this.dataType.equals(T.JSON))
3588
+ if (!this.dataType.equals($.JSON))
3462
3589
  throw new Error("cannot parse non-JSON series as JSON");
3463
3590
  return this.series.flatMap((r) => r.parseJSON(e));
3464
3591
  }
@@ -3471,7 +3598,7 @@ let Ci = class Mr {
3471
3598
  next() {
3472
3599
  return { done: !0, value: void 0 };
3473
3600
  }
3474
- } : new Li(this.series);
3601
+ } : new zi(this.series);
3475
3602
  }
3476
3603
  /**
3477
3604
  * Returns an array of the values in the multi-series as strings.
@@ -3481,7 +3608,7 @@ let Ci = class Mr {
3481
3608
  toStrings() {
3482
3609
  return this.series.flatMap((e) => e.toStrings());
3483
3610
  }
3484
- }, Li = class {
3611
+ }, zi = class {
3485
3612
  series;
3486
3613
  seriesIndex;
3487
3614
  internal;
@@ -3495,7 +3622,8 @@ let Ci = class Mr {
3495
3622
  [Symbol.iterator]() {
3496
3623
  return this;
3497
3624
  }
3498
- }, Ye = class {
3625
+ };
3626
+ class Xe {
3499
3627
  series;
3500
3628
  index;
3501
3629
  end;
@@ -3508,47 +3636,47 @@ let Ci = class Mr {
3508
3636
  [Symbol.iterator]() {
3509
3637
  return this;
3510
3638
  }
3511
- };
3512
- const Pt = (t) => {
3639
+ }
3640
+ const Zt = (t) => {
3513
3641
  const e = t >> 32n, r = t & 0xffffffffn;
3514
3642
  return { domain: e, sample: r };
3515
3643
  };
3516
3644
  a.object({ key: a.string(), value: a.string() });
3517
- const Di = a.record(
3645
+ const Fi = a.record(
3518
3646
  a.union([a.number(), a.string(), a.symbol()]),
3519
3647
  a.unknown()
3520
- ), Bt = (t) => Object.entries(t), Pi = (t, e) => Object.fromEntries(Bt(t).map(([r, n]) => [r, e(n, r)])), qi = (t) => Object.fromEntries(Bt(t).filter(([e, r]) => r !== void 0)), Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3648
+ ), Dt = (t) => Object.entries(t), Zi = (t, e) => Object.fromEntries(Dt(t).map(([r, n]) => [r, e(n, r)])), Yi = (t) => Object.fromEntries(Dt(t).filter(([e, r]) => r !== void 0)), Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3521
3649
  __proto__: null,
3522
- entries: Bt,
3523
- map: Pi,
3524
- purgeUndefined: qi,
3525
- unknownZ: Di
3526
- }, Symbol.toStringTag, { value: "Module" })), Er = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", ki = Er(), Ar = ["macOS", "Windows", "Linux"], zi = ["macos", "windows", "linux"], Fi = {
3650
+ entries: Dt,
3651
+ map: Zi,
3652
+ purgeUndefined: Yi,
3653
+ unknownZ: Fi
3654
+ }, Symbol.toStringTag, { value: "Module" })), Rr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Wi = Rr(), Lr = ["macOS", "Windows", "Linux"], Vi = ["macos", "windows", "linux"], Gi = {
3527
3655
  macos: "macOS",
3528
3656
  windows: "Windows",
3529
3657
  linux: "Linux"
3530
- }, Zi = a.enum(Ar).or(
3531
- a.enum(zi).transform((t) => Fi[t])
3532
- ), Yi = () => {
3658
+ }, Hi = a.enum(Lr).or(
3659
+ a.enum(Vi).transform((t) => Gi[t])
3660
+ ), Ji = () => {
3533
3661
  if (typeof window > "u") return;
3534
3662
  const t = window.navigator.userAgent.toLowerCase();
3535
3663
  if (t.includes("mac")) return "macOS";
3536
3664
  if (t.includes("win")) return "Windows";
3537
3665
  if (t.includes("linux")) return "Linux";
3538
3666
  };
3539
- let Ve;
3540
- const Vi = (t = {}) => {
3667
+ let Ke;
3668
+ const Xi = (t = {}) => {
3541
3669
  const { force: e, default: r } = t;
3542
- return e ?? Ve ?? (Ve = Yi(), Ve ?? r);
3543
- }, jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3670
+ return e ?? Ke ?? (Ke = Ji(), Ke ?? r);
3671
+ }, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3544
3672
  __proto__: null,
3545
- OPERATING_SYSTEMS: Ar,
3546
- RUNTIME: ki,
3547
- detect: Er,
3548
- getOS: Vi,
3549
- osZ: Zi
3550
- }, Symbol.toStringTag, { value: "Module" })), Wi = (...t) => t.map(Br).join(""), Br = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Gi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3551
- class Ee {
3673
+ OPERATING_SYSTEMS: Lr,
3674
+ RUNTIME: Wi,
3675
+ detect: Rr,
3676
+ getOS: Xi,
3677
+ osZ: Hi
3678
+ }, Symbol.toStringTag, { value: "Module" })), Ki = (...t) => t.map(Dr).join(""), Dr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Qi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3679
+ class Ce {
3552
3680
  protocol;
3553
3681
  host;
3554
3682
  port;
@@ -3560,7 +3688,7 @@ class Ee {
3560
3688
  * @param pathPrefix - A path prefix to use for all requests. Defaults to "".
3561
3689
  */
3562
3690
  constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
3563
- this.protocol = n, this.host = e, this.port = r, this.path = Br(s);
3691
+ this.protocol = n, this.host = e, this.port = r, this.path = Dr(s);
3564
3692
  }
3565
3693
  /**
3566
3694
  * Replaces creates a new URL with the specified properties replaced.
@@ -3568,7 +3696,7 @@ class Ee {
3568
3696
  * @returns a new URL.
3569
3697
  */
3570
3698
  replace(e) {
3571
- return new Ee({
3699
+ return new Ce({
3572
3700
  host: e.host ?? this.host,
3573
3701
  port: e.port ?? this.port,
3574
3702
  protocol: e.protocol ?? this.protocol,
@@ -3581,106 +3709,107 @@ class Ee {
3581
3709
  * @returns a new URL.
3582
3710
  */
3583
3711
  child(e) {
3584
- return new Ee({
3712
+ return new Ce({
3585
3713
  ...this,
3586
- pathPrefix: Wi(this.path, e)
3714
+ pathPrefix: Ki(this.path, e)
3587
3715
  });
3588
3716
  }
3589
3717
  /** @returns a string representation of the url */
3590
3718
  toString() {
3591
- return Gi(
3719
+ return Qi(
3592
3720
  `${this.protocol}://${this.host}:${this.port}/${this.path}`
3593
3721
  );
3594
3722
  }
3595
- static UNKNOWN = new Ee({ host: "unknown", port: 0 });
3723
+ static UNKNOWN = new Ce({ host: "unknown", port: 0 });
3596
3724
  }
3597
- const Hi = 2, Ji = 3, Xi = 2, Ki = (t, e) => {
3725
+ const _i = 2, ea = 3, ta = 2, ra = (t, e) => {
3598
3726
  if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3599
- const r = ye(e);
3727
+ const r = Oe(e);
3600
3728
  if (r == 0) return t;
3601
3729
  let n;
3602
- r >= 1e3 ? n = Hi : r >= 1 ? n = Ji : n = Math.ceil(-Math.log10(r)) + Xi;
3730
+ r >= 1e3 ? n = _i : r >= 1 ? n = ea : n = Math.ceil(-Math.log10(r)) + ta;
3603
3731
  const s = 10 ** n;
3604
3732
  return Math.round(t * s) / s;
3605
- }, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3733
+ }, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3606
3734
  __proto__: null,
3607
- abs: tr,
3608
- add: _t,
3609
- closeTo: Mn,
3610
- div: Bn,
3611
- equal: Ke,
3612
- max: An,
3613
- min: er,
3614
- mult: Y,
3615
- roundBySpan: Ki,
3616
- roundToNearestMagnitude: En,
3617
- sub: ae
3735
+ abs: ir,
3736
+ add: ie,
3737
+ closeTo: jn,
3738
+ div: we,
3739
+ equal: nt,
3740
+ isInteger: je,
3741
+ max: Ln,
3742
+ min: sr,
3743
+ mult: B,
3744
+ roundBySpan: ra,
3745
+ roundToNearestMagnitude: Rn,
3746
+ sub: P
3618
3747
  }, Symbol.toStringTag, { value: "Module" }));
3619
3748
  a.object({
3620
- baseInterval: f.z.optional(),
3749
+ baseInterval: O.z.optional(),
3621
3750
  maxRetries: a.number().optional(),
3622
3751
  scale: a.number().optional()
3623
3752
  });
3624
- const Qi = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ur = a.string().regex(Qi), _ = a.number().min(0).max(255), Cr = a.number().min(0).max(1), qe = a.tuple([_, _, _, Cr]), _i = a.tuple([_, _, _]), ea = a.object({ rgba255: qe }), ta = a.number().min(0).max(360), ra = a.number().min(0).max(100), na = a.number().min(0).max(100), jr = a.tuple([ta, ra, na, Cr]), ke = a.union([Ur, _i, qe, jr, ea]), ze = ke.transform((t) => w(t)), sa = (t) => ze.safeParse(t).success, ia = (t) => qe.safeParse(t).success, aa = (t) => {
3753
+ const na = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(na), re = a.number().min(0).max(255), qr = a.number().min(0).max(1), We = a.tuple([re, re, re, qr]), sa = a.tuple([re, re, re]), ia = a.object({ rgba255: We }), aa = a.number().min(0).max(360), oa = a.number().min(0).max(100), ua = a.number().min(0).max(100), kr = a.tuple([aa, oa, ua, qr]), Ve = a.union([Pr, sa, We, kr, ia]), Ge = Ve.transform((t) => v(t)), la = (t) => Ge.safeParse(t).success, ca = (t) => We.safeParse(t).success, ha = (t) => {
3625
3754
  if (t == null) return;
3626
- const e = ze.safeParse(t);
3627
- if (e.success) return Lr(e.data);
3755
+ const e = Ge.safeParse(t);
3756
+ if (e.success) return Fr(e.data);
3628
3757
  if (typeof t == "string") return t;
3629
3758
  throw e.error;
3630
- }, w = (t, e = 1) => {
3631
- if (t = ke.parse(t), typeof t == "string") return ma(t, e);
3759
+ }, v = (t, e = 1) => {
3760
+ if (t = Ve.parse(t), typeof t == "string") return Ta(t, e);
3632
3761
  if (Array.isArray(t)) {
3633
3762
  if (t.length < 3 || t.length > 4)
3634
3763
  throw new Error(`Invalid color: [${t.join(", ")}]`);
3635
3764
  return t.length === 3 ? [...t, e] : t;
3636
3765
  }
3637
3766
  return t.rgba255;
3638
- }, Rr = (t, e) => {
3767
+ }, zr = (t, e) => {
3639
3768
  if (t == null || e == null) return t == e;
3640
- const r = w(t), n = w(e);
3769
+ const r = v(t), n = v(e);
3641
3770
  return r.every((s, i) => s === n[i]);
3642
- }, oa = (t) => {
3771
+ }, fa = (t) => {
3643
3772
  if (t == null) return;
3644
- const [e, r, n, s] = w(t);
3645
- return `#${Oe(e)}${Oe(r)}${Oe(n)}${s === 1 ? "" : Oe(s * 255)}`;
3646
- }, Lr = (t) => {
3647
- const [e, r, n, s] = w(t);
3773
+ const [e, r, n, s] = v(t);
3774
+ return `#${$e(e)}${$e(r)}${$e(n)}${s === 1 ? "" : $e(s * 255)}`;
3775
+ }, Fr = (t) => {
3776
+ const [e, r, n, s] = v(t);
3648
3777
  return `rgba(${e}, ${r}, ${n}, ${s})`;
3649
- }, ua = (t) => `rgb(${Dr(t)})`, Dr = (t) => {
3650
- const [e, r, n] = w(t);
3778
+ }, da = (t) => `rgb(${Zr(t)})`, Zr = (t) => {
3779
+ const [e, r, n] = v(t);
3651
3780
  return `${e}, ${r}, ${n}`;
3652
- }, la = (t) => [...Ut(t), ce(t)], Ut = (t) => [
3653
- oe(t) / 255,
3654
- ue(t) / 255,
3655
- le(t) / 255
3656
- ], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3], ca = (t) => Rr(Ct, t), ha = (t) => Oa(w(t)), fa = (t, e) => {
3657
- const [r, n, s] = w(t);
3781
+ }, ga = (t) => [...Pt(t), de(t)], Pt = (t) => [
3782
+ ce(t) / 255,
3783
+ he(t) / 255,
3784
+ fe(t) / 255
3785
+ ], ce = (t) => v(t)[0], he = (t) => v(t)[1], fe = (t) => v(t)[2], de = (t) => v(t)[3], pa = (t) => zr(qt, t), ma = (t) => Sa(v(t)), ya = (t, e) => {
3786
+ const [r, n, s] = v(t);
3658
3787
  if (e > 100)
3659
3788
  throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
3660
3789
  return e > 1 && (e /= 100), [r, n, s, e];
3661
- }, ge = (t) => {
3662
- const [e, r, n] = Ut(t).map(
3790
+ }, ye = (t) => {
3791
+ const [e, r, n] = Pt(t).map(
3663
3792
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
3664
3793
  );
3665
3794
  return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
3666
- }, da = (t) => {
3667
- const [e, r, n] = Ut(t);
3795
+ }, ba = (t) => {
3796
+ const [e, r, n] = Pt(t);
3668
3797
  return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
3669
- }, ot = (t, e) => {
3670
- const r = w(t), n = w(e), s = ge(r), i = ge(n);
3798
+ }, dt = (t, e) => {
3799
+ const r = v(t), n = v(e), s = ye(r), i = ye(n);
3671
3800
  return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
3672
- }, ga = (t, ...e) => {
3801
+ }, wa = (t, ...e) => {
3673
3802
  if (e.length === 0)
3674
3803
  throw new Error("[Color.pickByContrast] - must provide at least one color");
3675
- const r = w(t), [n] = e.sort((s, i) => ot(r, i) - ot(r, s));
3676
- return w(n);
3677
- }, pa = (t) => ge(t) < 0.5, ya = (t) => ge(t) > 0.5, ma = (t, e = 1) => (t = Ur.parse(t), t = ba(t), [
3678
- ve(t, 0),
3679
- ve(t, 2),
3680
- ve(t, 4),
3681
- t.length === 8 ? ve(t, 6) / 255 : e
3682
- ]), Ct = [0, 0, 0, 0], Oe = (t) => Math.floor(t).toString(16).padStart(2, "0"), ve = (t, e) => parseInt(t.slice(e, e + 2), 16), ba = (t) => t.startsWith("#") ? t.slice(1) : t, wa = (t) => {
3683
- t = jr.parse(t);
3804
+ const r = v(t), [n] = e.sort((s, i) => dt(r, i) - dt(r, s));
3805
+ return v(n);
3806
+ }, Oa = (t) => ye(t) < 0.5, va = (t) => ye(t) > 0.5, Ta = (t, e = 1) => (t = Pr.parse(t), t = xa(t), [
3807
+ Se(t, 0),
3808
+ Se(t, 2),
3809
+ Se(t, 4),
3810
+ t.length === 8 ? Se(t, 6) / 255 : e
3811
+ ]), qt = [0, 0, 0, 0], $e = (t) => Math.floor(t).toString(16).padStart(2, "0"), Se = (t, e) => parseInt(t.slice(e, e + 2), 16), xa = (t) => t.startsWith("#") ? t.slice(1) : t, $a = (t) => {
3812
+ t = kr.parse(t);
3684
3813
  let [e, r, n] = t;
3685
3814
  const s = t[3];
3686
3815
  e /= 360, r /= 100, n /= 100;
@@ -3688,240 +3817,240 @@ const Qi = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ur = a.string().regex(Qi), _ = a.nu
3688
3817
  if (r === 0)
3689
3818
  i = o = c = n;
3690
3819
  else {
3691
- const l = n < 0.5 ? n * (1 + r) : n + r - n * r, h = 2 * n - l;
3692
- i = We(h, l, e + 1 / 3), o = We(h, l, e), c = We(h, l, e - 1 / 3);
3820
+ const h = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - h;
3821
+ i = Qe(l, h, e + 1 / 3), o = Qe(l, h, e), c = Qe(l, h, e - 1 / 3);
3693
3822
  }
3694
3823
  return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
3695
- }, We = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Oa = (t) => {
3696
- t = qe.parse(t);
3824
+ }, Qe = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Sa = (t) => {
3825
+ t = We.parse(t);
3697
3826
  let [e, r, n] = t;
3698
3827
  const s = t[3];
3699
3828
  e /= 255, r /= 255, n /= 255;
3700
3829
  const i = Math.max(e, r, n), o = Math.min(e, r, n);
3701
- let c, l, h = (i + o) / 2;
3830
+ let c, h, l = (i + o) / 2;
3702
3831
  if (i === o)
3703
- c = l = 0;
3832
+ c = h = 0;
3704
3833
  else {
3705
- const g = i - o;
3706
- l = h > 0.5 ? g / (2 - i - o) : g / (i + o), i === e ? c = (r - n) / g + (r < n ? 6 : 0) : i === r ? c = (n - e) / g + 2 : c = (e - r) / g + 4, c /= 6;
3834
+ const d = i - o;
3835
+ h = l > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? c = (r - n) / d + (r < n ? 6 : 0) : i === r ? c = (n - e) / d + 2 : c = (e - r) / d + 4, c /= 6;
3707
3836
  }
3708
- return c *= 360, l *= 100, h *= 100, [Math.round(c), Math.round(l), Math.round(h), s];
3709
- }, va = w("#000000"), Ta = w("#ffffff"), Pr = a.object({
3837
+ return c *= 360, h *= 100, l *= 100, [Math.round(c), Math.round(h), Math.round(l), s];
3838
+ }, Na = v("#000000"), Ia = v("#ffffff"), Yr = a.object({
3710
3839
  key: a.string(),
3711
- color: ke,
3840
+ color: Ve,
3712
3841
  position: a.number(),
3713
3842
  switched: a.boolean().optional()
3714
- }), xa = a.array(Pr), $a = (t, e) => {
3715
- if (t.length === 0) return Ct;
3716
- if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return w(t[0].color);
3843
+ }), Ma = a.array(Yr), Ea = (t, e) => {
3844
+ if (t.length === 0) return qt;
3845
+ if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return v(t[0].color);
3717
3846
  if (e >= t[t.length - 1].position)
3718
- return w(t[t.length - 1].color);
3847
+ return v(t[t.length - 1].color);
3719
3848
  for (let r = 0; r < t.length - 1; r++) {
3720
3849
  const n = t[r], s = t[r + 1];
3721
3850
  if (e < n.position || e > s.position) continue;
3722
- if (e === n.position) return w(n.color);
3723
- if (e === s.position) return w(s.color);
3724
- const i = (e - n.position) / (s.position - n.position), o = w(n.color), c = w(s.color), l = Math.round(
3725
- oe(o) + i * (oe(c) - oe(o))
3726
- ), h = Math.round(
3727
- ue(o) + i * (ue(c) - ue(o))
3728
- ), g = Math.round(
3729
- le(o) + i * (le(c) - le(o))
3730
- ), p = ce(o) + i * (ce(c) - ce(o));
3731
- return w([l, h, g, p]);
3732
- }
3733
- return w(t[t.length - 1].color);
3734
- }, Sa = a.object({
3851
+ if (e === n.position) return v(n.color);
3852
+ if (e === s.position) return v(s.color);
3853
+ const i = (e - n.position) / (s.position - n.position), o = v(n.color), c = v(s.color), h = Math.round(
3854
+ ce(o) + i * (ce(c) - ce(o))
3855
+ ), l = Math.round(
3856
+ he(o) + i * (he(c) - he(o))
3857
+ ), d = Math.round(
3858
+ fe(o) + i * (fe(c) - fe(o))
3859
+ ), m = de(o) + i * (de(c) - de(o));
3860
+ return v([h, l, d, m]);
3861
+ }
3862
+ return v(t[t.length - 1].color);
3863
+ }, Aa = a.object({
3735
3864
  key: a.string(),
3736
3865
  name: a.string(),
3737
- color: ze
3738
- }), Na = a.object({
3866
+ color: Ge
3867
+ }), Ba = a.object({
3739
3868
  key: a.string(),
3740
3869
  name: a.string(),
3741
- swatches: a.array(Sa)
3742
- }), Ia = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3870
+ swatches: a.array(Aa)
3871
+ }), Ua = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3743
3872
  __proto__: null,
3744
- BLACK: va,
3745
- WHITE: Ta,
3746
- ZERO: Ct,
3747
- aValue: ce,
3748
- bValue: le,
3749
- colorZ: ze,
3750
- construct: w,
3751
- contrast: ot,
3752
- crudeZ: ke,
3753
- cssString: aa,
3754
- equals: Rr,
3755
- fromGradient: $a,
3756
- fromHSLA: wa,
3757
- gValue: ue,
3758
- gradientZ: xa,
3759
- grayness: da,
3760
- hex: oa,
3761
- hsla: ha,
3762
- isColor: ia,
3763
- isCrude: sa,
3764
- isDark: pa,
3765
- isLight: ya,
3766
- isZero: ca,
3767
- luminance: ge,
3768
- paletteZ: Na,
3769
- pickByContrast: ga,
3770
- rValue: oe,
3771
- rgbCSS: ua,
3772
- rgbString: Dr,
3773
- rgba1: la,
3774
- rgbaCSS: Lr,
3775
- setAlpha: fa,
3776
- stopZ: Pr
3777
- }, Symbol.toStringTag, { value: "Module" })), qr = a.int().min(0).max(255), kr = 255, zr = 0, Ma = {
3778
- lower: zr,
3779
- upper: kr + 1
3780
- }, Fr = a.object({
3873
+ BLACK: Na,
3874
+ WHITE: Ia,
3875
+ ZERO: qt,
3876
+ aValue: de,
3877
+ bValue: fe,
3878
+ colorZ: Ge,
3879
+ construct: v,
3880
+ contrast: dt,
3881
+ crudeZ: Ve,
3882
+ cssString: ha,
3883
+ equals: zr,
3884
+ fromGradient: Ea,
3885
+ fromHSLA: $a,
3886
+ gValue: he,
3887
+ gradientZ: Ma,
3888
+ grayness: ba,
3889
+ hex: fa,
3890
+ hsla: ma,
3891
+ isColor: ca,
3892
+ isCrude: la,
3893
+ isDark: Oa,
3894
+ isLight: va,
3895
+ isZero: pa,
3896
+ luminance: ye,
3897
+ paletteZ: Ba,
3898
+ pickByContrast: wa,
3899
+ rValue: ce,
3900
+ rgbCSS: da,
3901
+ rgbString: Zr,
3902
+ rgba1: ga,
3903
+ rgbaCSS: Fr,
3904
+ setAlpha: ya,
3905
+ stopZ: Yr
3906
+ }, Symbol.toStringTag, { value: "Module" })), Wr = a.int().min(0).max(255), Vr = 255, Gr = 0, Ca = {
3907
+ lower: Gr,
3908
+ upper: Vr + 1
3909
+ }, Hr = a.object({
3781
3910
  name: a.string(),
3782
3911
  key: a.string()
3783
- }), pe = (t) => a.object({
3784
- subject: Fr,
3912
+ }), be = (t) => a.object({
3913
+ subject: Hr,
3785
3914
  resource: t,
3786
- authority: qr
3787
- }), Ea = (...t) => (e) => e.filter((r) => {
3915
+ authority: Wr
3916
+ }), ja = (...t) => (e) => e.filter((r) => {
3788
3917
  let n = !1;
3789
3918
  return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
3790
- }), Zr = (t) => a.object({
3791
- from: pe(t),
3919
+ }), Jr = (t) => a.object({
3920
+ from: be(t),
3792
3921
  to: a.null()
3793
- }), Yr = (t) => a.object({
3922
+ }), Xr = (t) => a.object({
3794
3923
  from: a.null(),
3795
- to: pe(t)
3796
- }), Aa = (t) => a.union([
3797
- Zr(t),
3798
- Yr(t),
3924
+ to: be(t)
3925
+ }), Ra = (t) => a.union([
3926
+ Jr(t),
3927
+ Xr(t),
3799
3928
  a.object({
3800
- from: pe(t),
3801
- to: pe(t)
3929
+ from: be(t),
3930
+ to: be(t)
3802
3931
  })
3803
- ]), Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3932
+ ]), zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3804
3933
  __proto__: null,
3805
- ABSOLUTE_AUTHORITY: kr,
3806
- AUTHORITY_BOUNDS: Ma,
3807
- ZERO_AUTHORITY: zr,
3808
- acquireZ: Yr,
3809
- authorityZ: qr,
3810
- filterTransfersByChannelKey: Ea,
3811
- releaseZ: Zr,
3812
- stateZ: pe,
3813
- subjectZ: Fr,
3814
- transferZ: Aa
3815
- }, Symbol.toStringTag, { value: "Module" })), Ba = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Ua = (t, e) => {
3934
+ ABSOLUTE_AUTHORITY: Vr,
3935
+ AUTHORITY_BOUNDS: Ca,
3936
+ ZERO_AUTHORITY: Gr,
3937
+ acquireZ: Xr,
3938
+ authorityZ: Wr,
3939
+ filterTransfersByChannelKey: ja,
3940
+ releaseZ: Jr,
3941
+ stateZ: be,
3942
+ subjectZ: Hr,
3943
+ transferZ: Ra
3944
+ }, Symbol.toStringTag, { value: "Module" })), La = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Da = (t, e) => {
3816
3945
  const r = Symbol.for(t);
3817
- if (!Ba(r)) {
3946
+ if (!La(r)) {
3818
3947
  const n = e();
3819
3948
  Object.defineProperty(globalThis, r, { value: n });
3820
3949
  }
3821
3950
  return () => globalThis[r];
3822
- }, Vr = "sy_x_error", Ca = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Wr = (t) => class ie extends Error {
3823
- static discriminator = Vr;
3824
- discriminator = ie.discriminator;
3951
+ }, Kr = "sy_x_error", Pa = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Qr = (t) => class le extends Error {
3952
+ static discriminator = Kr;
3953
+ discriminator = le.discriminator;
3825
3954
  static TYPE = t;
3826
- type = ie.TYPE;
3827
- static matches = Ca(t);
3828
- matches = ie.matches;
3955
+ type = le.TYPE;
3956
+ static matches = Pa(t);
3957
+ matches = le.matches;
3829
3958
  constructor(r, n) {
3830
- super(r, n), this.name = ie.TYPE;
3959
+ super(r, n), this.name = le.TYPE;
3831
3960
  }
3832
3961
  static sub(r) {
3833
- return Wr(`${t}.${r}`);
3962
+ return Qr(`${t}.${r}`);
3834
3963
  }
3835
- }, ja = (t) => {
3964
+ }, qa = (t) => {
3836
3965
  if (t == null || typeof t != "object") return !1;
3837
3966
  const e = t;
3838
- if (e.discriminator !== Vr) return !1;
3967
+ if (e.discriminator !== Kr) return !1;
3839
3968
  if (!("type" in e))
3840
3969
  throw new Error(
3841
3970
  `X Error is missing its type property: ${JSON.stringify(e)}`
3842
3971
  );
3843
3972
  return !0;
3844
- }, re = "unknown", qt = "nil";
3845
- class Ra {
3973
+ }, ae = "unknown", Yt = "nil";
3974
+ class ka {
3846
3975
  providers = [];
3847
3976
  register(e) {
3848
3977
  this.providers.push(e);
3849
3978
  }
3850
3979
  encode(e) {
3851
- if (e == null) return { type: qt, data: "" };
3852
- if (ja(e))
3980
+ if (e == null) return { type: Yt, data: "" };
3981
+ if (qa(e))
3853
3982
  for (const r of this.providers) {
3854
3983
  const n = r.encode(e);
3855
3984
  if (n != null) return n;
3856
3985
  }
3857
- if (e instanceof Error) return { type: re, data: e.message };
3858
- if (typeof e == "string") return { type: re, data: e };
3986
+ if (e instanceof Error) return { type: ae, data: e.message };
3987
+ if (typeof e == "string") return { type: ae, data: e };
3859
3988
  try {
3860
- return { type: re, data: JSON.stringify(e) };
3989
+ return { type: ae, data: JSON.stringify(e) };
3861
3990
  } catch {
3862
- return { type: re, data: "unable to encode error information" };
3991
+ return { type: ae, data: "unable to encode error information" };
3863
3992
  }
3864
3993
  }
3865
3994
  decode(e) {
3866
- if (e == null || e.type === qt) return null;
3867
- if (e.type === re) return new kt(e.data);
3995
+ if (e == null || e.type === Yt) return null;
3996
+ if (e.type === ae) return new Wt(e.data);
3868
3997
  for (const r of this.providers) {
3869
3998
  const n = r.decode(e);
3870
3999
  if (n != null) return n;
3871
4000
  }
3872
- return new kt(e.data);
4001
+ return new Wt(e.data);
3873
4002
  }
3874
4003
  }
3875
- Ua("synnax-error-registry", () => new Ra());
3876
- class kt extends Wr("unknown") {
4004
+ Da("synnax-error-registry", () => new ka());
4005
+ class Wt extends Qr("unknown") {
3877
4006
  }
3878
4007
  a.object({ type: a.string(), data: a.string() });
3879
- const Do = () => new Promise((t) => setTimeout(t, 0)), Po = (t) => t ? -1 : 1, La = x.object({
3880
- jsonrpc: x.literal("2.0"),
3881
- method: x.string(),
4008
+ const Fo = () => new Promise((t) => setTimeout(t, 0)), Zo = (t) => t ? -1 : 1, za = S.object({
4009
+ jsonrpc: S.literal("2.0"),
4010
+ method: S.string(),
3882
4011
  // params should be z.union([z.record(z.string(), z.json()),
3883
4012
  // z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
3884
4013
  // definition of params then in the JSON-RPC spec.
3885
- params: x.any().optional(),
3886
- id: x.union([x.string(), x.number(), x.null()]).optional()
3887
- }), Gr = x.object({
3888
- jsonrpc: x.literal("2.0"),
3889
- id: x.union([x.string(), x.number(), x.null()])
3890
- }), Da = Gr.extend({
3891
- result: x.json()
3892
- }), Pa = Gr.extend({
3893
- error: x.object({
3894
- code: x.number().int(),
4014
+ params: S.any().optional(),
4015
+ id: S.union([S.string(), S.number(), S.null()]).optional()
4016
+ }), _r = S.object({
4017
+ jsonrpc: S.literal("2.0"),
4018
+ id: S.union([S.string(), S.number(), S.null()])
4019
+ }), Fa = _r.extend({
4020
+ result: S.json()
4021
+ }), Za = _r.extend({
4022
+ error: S.object({
4023
+ code: S.number().int(),
3895
4024
  // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
3896
4025
  // definition of error than the JSON-RPC spec.
3897
- message: x.string().optional(),
3898
- data: x.json().optional()
4026
+ message: S.string().optional(),
4027
+ data: S.json().optional()
3899
4028
  })
3900
- }), qa = x.union([Da, Pa]);
3901
- x.union([La, qa]);
3902
- const ka = (t, e, r) => {
4029
+ }), Ya = S.union([Fa, Za]);
4030
+ S.union([za, Ya]);
4031
+ const Wa = (t, e, r) => {
3903
4032
  const n = t.get(e);
3904
4033
  return n === void 0 ? (t.set(e, r), r) : n;
3905
- }, qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4034
+ }, Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3906
4035
  __proto__: null,
3907
- getOrSetDefault: ka
3908
- }, Symbol.toStringTag, { value: "Module" })), ut = a.string().regex(/^\d+\.\d+\.\d+$/), be = (t, e, r = {}) => {
4036
+ getOrSetDefault: Wa
4037
+ }, Symbol.toStringTag, { value: "Module" })), gt = a.string().regex(/^\d+\.\d+\.\d+$/), Te = (t, e, r = {}) => {
3909
4038
  r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
3910
- const n = ut.parse(t), s = ut.parse(e), [i, o, c] = n.split(".").map(Number), [l, h, g] = s.split(".").map(Number);
4039
+ const n = gt.parse(t), s = gt.parse(e), [i, o, c] = n.split(".").map(Number), [h, l, d] = s.split(".").map(Number);
3911
4040
  if (r.checkMajor) {
3912
- if (i < l) return xe;
3913
- if (i > l) return $e;
4041
+ if (i < h) return Ie;
4042
+ if (i > h) return Me;
3914
4043
  }
3915
4044
  if (r.checkMinor) {
3916
- if (o < h) return xe;
3917
- if (o > h) return $e;
4045
+ if (o < l) return Ie;
4046
+ if (o > l) return Me;
3918
4047
  }
3919
4048
  if (r.checkPatch) {
3920
- if (c < g) return xe;
3921
- if (c > g) return $e;
4049
+ if (c < d) return Ie;
4050
+ if (c > d) return Me;
3922
4051
  }
3923
- return ee;
3924
- }, za = (t, e, r = {}) => Jt(be(t, e, r)), Hr = (t, e, r = {}) => Ht(be(t, e, r)), Fa = (t, e, r = {}) => Gt(be(t, e, r)), Za = ({
4052
+ return ne;
4053
+ }, Va = (t, e, r = {}) => er(Te(t, e, r)), en = (t, e, r = {}) => _t(Te(t, e, r)), Ga = (t, e, r = {}) => Qt(Te(t, e, r)), Ha = ({
3925
4054
  name: t,
3926
4055
  migrate: e
3927
4056
  }) => (r) => {
@@ -3931,68 +4060,68 @@ const ka = (t, e, r) => {
3931
4060
  } catch (n) {
3932
4061
  throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
3933
4062
  }
3934
- }, Ya = ({
4063
+ }, Ja = ({
3935
4064
  name: t,
3936
4065
  migrations: e,
3937
4066
  targetSchema: r,
3938
4067
  defaultVersion: n,
3939
4068
  def: s
3940
4069
  }) => {
3941
- const i = Object.keys(e).sort(be).pop();
4070
+ const i = Object.keys(e).sort(Te).pop();
3942
4071
  if (i == null)
3943
- return (h) => {
3944
- if (h.version ??= n, h.version !== s.version)
4072
+ return (l) => {
4073
+ if (l.version ??= n, l.version !== s.version)
3945
4074
  return console.log(
3946
- `${t} version ${h.version} is newer than latest version of ${s.version}.
4075
+ `${t} version ${l.version} is newer than latest version of ${s.version}.
3947
4076
  Returning default instead.
3948
4077
  `
3949
4078
  ), s;
3950
4079
  try {
3951
- return r != null ? r.parse(h) : h;
3952
- } catch (g) {
3953
- return console.log(`${t} failed to parse default. Exiting with default`), console.error(g), s;
4080
+ return r != null ? r.parse(l) : l;
4081
+ } catch (d) {
4082
+ return console.log(`${t} failed to parse default. Exiting with default`), console.error(d), s;
3954
4083
  }
3955
4084
  };
3956
4085
  const o = Object.keys(e).length;
3957
4086
  let c = !1;
3958
- const l = (h) => {
4087
+ const h = (l) => {
3959
4088
  try {
3960
- if (o === 0 || Hr(h.version, i))
3961
- return console.log(c ? `${t} ${h.version} now up to date` : `${t} version ${h.version} is up to date with target version ${s.version}`), h;
3962
- const g = h.version, p = e[g], S = p(h);
3963
- return c = !0, l(S);
3964
- } catch (g) {
4089
+ if (o === 0 || en(l.version, i))
4090
+ return console.log(c ? `${t} ${l.version} now up to date` : `${t} version ${l.version} is up to date with target version ${s.version}`), l;
4091
+ const d = l.version, m = e[d], p = m(l);
4092
+ return c = !0, h(p);
4093
+ } catch (d) {
3965
4094
  return console.log(
3966
- `${t} failed to migrate from ${h.version} to ${i}`
3967
- ), console.error(g), s;
4095
+ `${t} failed to migrate from ${l.version} to ${i}`
4096
+ ), console.error(d), s;
3968
4097
  }
3969
4098
  };
3970
- return (h) => {
4099
+ return (l) => {
3971
4100
  try {
3972
- if (h.version == null)
4101
+ if (l.version == null)
3973
4102
  if (n != null)
3974
4103
  console.log(
3975
4104
  `${t} version is null. Setting version to default of ${n}`
3976
- ), h.version = n;
4105
+ ), l.version = n;
3977
4106
  else
3978
4107
  return console.log(
3979
4108
  `${t} version is null and no default version set. Exiting with default`
3980
4109
  ), s;
3981
- return l(h);
3982
- } catch (g) {
3983
- return console.log(`${t} failed to parse final result. Exiting with default`), console.error(g), s;
4110
+ return h(l);
4111
+ } catch (d) {
4112
+ return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
3984
4113
  }
3985
4114
  };
3986
- }, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4115
+ }, Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3987
4116
  __proto__: null,
3988
- compareSemVer: be,
3989
- createMigration: Za,
3990
- migrator: Ya,
3991
- semVerNewer: Hr,
3992
- semVerOlder: Fa,
3993
- semVerZ: ut,
3994
- versionsEqual: za
3995
- }, Symbol.toStringTag, { value: "Module" })), Jr = ["standard", "scientific", "engineering"], Va = a.enum(Jr), Wa = (t, e, r) => {
4117
+ compareSemVer: Te,
4118
+ createMigration: Ha,
4119
+ migrator: Ja,
4120
+ semVerNewer: en,
4121
+ semVerOlder: Ga,
4122
+ semVerZ: gt,
4123
+ versionsEqual: Va
4124
+ }, Symbol.toStringTag, { value: "Module" })), tn = ["standard", "scientific", "engineering"], Xa = a.enum(tn), Ka = (t, e, r) => {
3996
4125
  if (Number.isNaN(t)) return "NaN";
3997
4126
  if (t === 1 / 0) return "∞";
3998
4127
  if (t === -1 / 0) return "-∞";
@@ -4001,28 +4130,28 @@ const ka = (t, e, r) => {
4001
4130
  return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
4002
4131
  let n;
4003
4132
  return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
4004
- }, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4133
+ }, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4005
4134
  __proto__: null,
4006
- NOTATIONS: Jr,
4007
- notationZ: Va,
4008
- stringifyNumber: Wa
4009
- }, Symbol.toStringTag, { value: "Module" })), Fo = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, Xr = a.enum([
4135
+ NOTATIONS: tn,
4136
+ notationZ: Xa,
4137
+ stringifyNumber: Ka
4138
+ }, Symbol.toStringTag, { value: "Module" })), Go = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, rn = a.enum([
4010
4139
  "success",
4011
4140
  "info",
4012
4141
  "warning",
4013
4142
  "error",
4014
4143
  "loading",
4015
4144
  "disabled"
4016
- ]), Ga = (t) => a.object({
4145
+ ]), Qa = (t) => a.object({
4017
4146
  key: a.string(),
4018
- variant: Xr,
4147
+ variant: rn,
4019
4148
  message: a.string(),
4020
4149
  description: a.string().optional(),
4021
4150
  time: b.z,
4022
4151
  details: t ?? a.unknown().optional()
4023
- }), Ha = (t, e) => {
4152
+ }), _a = (t, e) => {
4024
4153
  if (!(t instanceof Error)) throw t;
4025
- return Kr({
4154
+ return nn({
4026
4155
  variant: "error",
4027
4156
  message: e ?? t.message,
4028
4157
  description: e != null ? t.message : void 0,
@@ -4030,28 +4159,30 @@ const ka = (t, e, r) => {
4030
4159
  stack: t.stack ?? ""
4031
4160
  }
4032
4161
  });
4033
- }, Kr = (t) => ({
4034
- key: At(),
4162
+ }, nn = (t) => ({
4163
+ key: Lt(),
4035
4164
  time: b.now(),
4036
4165
  ...t
4037
- }), Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4166
+ }), eo = (t, e = []) => Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4038
4167
  __proto__: null,
4039
- create: Kr,
4040
- fromException: Ha,
4041
- statusZ: Ga,
4042
- variantZ: Xr
4043
- }, Symbol.toStringTag, { value: "Module" })), Ja = (t, e = "") => {
4168
+ create: nn,
4169
+ filterVariant: eo,
4170
+ fromException: _a,
4171
+ statusZ: Qa,
4172
+ variantZ: rn
4173
+ }, Symbol.toStringTag, { value: "Module" })), to = (t, e = "") => {
4174
+ if (typeof t == "string") return t;
4044
4175
  const r = t.length;
4045
4176
  return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
4046
- }, Xa = (t) => {
4177
+ }, ro = (t) => {
4047
4178
  const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
4048
4179
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
4049
4180
  const s = /\d+/g;
4050
4181
  t.match(s) && e.forEach((o, c) => {
4051
4182
  if (s.test(o)) {
4052
- const l = e.map((h, g) => g !== c ? h.charAt(0).toLowerCase() : h).join("");
4053
- r.add(l.replace(/-/g, "_")), r.add(
4054
- l.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
4183
+ const h = e.map((l, d) => d !== c ? l.charAt(0).toLowerCase() : l).join("");
4184
+ r.add(h.replace(/-/g, "_")), r.add(
4185
+ h.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
4055
4186
  );
4056
4187
  }
4057
4188
  });
@@ -4061,53 +4192,53 @@ const ka = (t, e, r) => {
4061
4192
  return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
4062
4193
  (o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
4063
4194
  );
4064
- }, Ka = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4195
+ }, no = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4065
4196
  __proto__: null,
4066
- createShortIdentifiers: Xa,
4067
- naturalLanguageJoin: Ja,
4068
- trimPrefix: Ka
4069
- }, Symbol.toStringTag, { value: "Module" })), Qa = new Error("request for lock canceled");
4070
- var _a = function(t, e, r, n) {
4197
+ createShortIdentifiers: ro,
4198
+ naturalLanguageJoin: to,
4199
+ trimPrefix: no
4200
+ }, Symbol.toStringTag, { value: "Module" })), so = new Error("request for lock canceled");
4201
+ var io = function(t, e, r, n) {
4071
4202
  function s(i) {
4072
4203
  return i instanceof r ? i : new r(function(o) {
4073
4204
  o(i);
4074
4205
  });
4075
4206
  }
4076
4207
  return new (r || (r = Promise))(function(i, o) {
4077
- function c(g) {
4208
+ function c(d) {
4078
4209
  try {
4079
- h(n.next(g));
4080
- } catch (p) {
4081
- o(p);
4210
+ l(n.next(d));
4211
+ } catch (m) {
4212
+ o(m);
4082
4213
  }
4083
4214
  }
4084
- function l(g) {
4215
+ function h(d) {
4085
4216
  try {
4086
- h(n.throw(g));
4087
- } catch (p) {
4088
- o(p);
4217
+ l(n.throw(d));
4218
+ } catch (m) {
4219
+ o(m);
4089
4220
  }
4090
4221
  }
4091
- function h(g) {
4092
- g.done ? i(g.value) : s(g.value).then(c, l);
4222
+ function l(d) {
4223
+ d.done ? i(d.value) : s(d.value).then(c, h);
4093
4224
  }
4094
- h((n = n.apply(t, e || [])).next());
4225
+ l((n = n.apply(t, e || [])).next());
4095
4226
  });
4096
4227
  };
4097
- class eo {
4098
- constructor(e, r = Qa) {
4228
+ class ao {
4229
+ constructor(e, r = so) {
4099
4230
  this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
4100
4231
  }
4101
4232
  acquire(e = 1, r = 0) {
4102
4233
  if (e <= 0)
4103
4234
  throw new Error(`invalid weight ${e}: must be positive`);
4104
4235
  return new Promise((n, s) => {
4105
- const i = { resolve: n, reject: s, weight: e, priority: r }, o = Qr(this._queue, (c) => r <= c.priority);
4236
+ const i = { resolve: n, reject: s, weight: e, priority: r }, o = sn(this._queue, (c) => r <= c.priority);
4106
4237
  o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
4107
4238
  });
4108
4239
  }
4109
4240
  runExclusive(e) {
4110
- return _a(this, arguments, void 0, function* (r, n = 1, s = 0) {
4241
+ return io(this, arguments, void 0, function* (r, n = 1, s = 0) {
4111
4242
  const [i, o] = yield this.acquire(n, s);
4112
4243
  try {
4113
4244
  return yield r(i);
@@ -4120,7 +4251,7 @@ class eo {
4120
4251
  if (e <= 0)
4121
4252
  throw new Error(`invalid weight ${e}: must be positive`);
4122
4253
  return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
4123
- this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), to(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4254
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), oo(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4124
4255
  });
4125
4256
  }
4126
4257
  isLocked() {
@@ -4175,49 +4306,49 @@ class eo {
4175
4306
  return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
4176
4307
  }
4177
4308
  }
4178
- function to(t, e) {
4179
- const r = Qr(t, (n) => e.priority <= n.priority);
4309
+ function oo(t, e) {
4310
+ const r = sn(t, (n) => e.priority <= n.priority);
4180
4311
  t.splice(r + 1, 0, e);
4181
4312
  }
4182
- function Qr(t, e) {
4313
+ function sn(t, e) {
4183
4314
  for (let r = t.length - 1; r >= 0; r--)
4184
4315
  if (e(t[r]))
4185
4316
  return r;
4186
4317
  return -1;
4187
4318
  }
4188
- var ro = function(t, e, r, n) {
4319
+ var uo = function(t, e, r, n) {
4189
4320
  function s(i) {
4190
4321
  return i instanceof r ? i : new r(function(o) {
4191
4322
  o(i);
4192
4323
  });
4193
4324
  }
4194
4325
  return new (r || (r = Promise))(function(i, o) {
4195
- function c(g) {
4326
+ function c(d) {
4196
4327
  try {
4197
- h(n.next(g));
4198
- } catch (p) {
4199
- o(p);
4328
+ l(n.next(d));
4329
+ } catch (m) {
4330
+ o(m);
4200
4331
  }
4201
4332
  }
4202
- function l(g) {
4333
+ function h(d) {
4203
4334
  try {
4204
- h(n.throw(g));
4205
- } catch (p) {
4206
- o(p);
4335
+ l(n.throw(d));
4336
+ } catch (m) {
4337
+ o(m);
4207
4338
  }
4208
4339
  }
4209
- function h(g) {
4210
- g.done ? i(g.value) : s(g.value).then(c, l);
4340
+ function l(d) {
4341
+ d.done ? i(d.value) : s(d.value).then(c, h);
4211
4342
  }
4212
- h((n = n.apply(t, e || [])).next());
4343
+ l((n = n.apply(t, e || [])).next());
4213
4344
  });
4214
4345
  };
4215
- class no {
4346
+ class lo {
4216
4347
  constructor(e) {
4217
- this._semaphore = new eo(1, e);
4348
+ this._semaphore = new ao(1, e);
4218
4349
  }
4219
4350
  acquire() {
4220
- return ro(this, arguments, void 0, function* (e = 0) {
4351
+ return uo(this, arguments, void 0, function* (e = 0) {
4221
4352
  const [, r] = yield this._semaphore.acquire(1, e);
4222
4353
  return r;
4223
4354
  });
@@ -4238,34 +4369,34 @@ class no {
4238
4369
  return this._semaphore.cancel();
4239
4370
  }
4240
4371
  }
4241
- class _r extends no {
4372
+ class an extends lo {
4242
4373
  constructor(e) {
4243
4374
  super(), Object.assign(this, e);
4244
4375
  }
4245
4376
  }
4246
- const so = (t) => new _r(t), Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4377
+ const co = (t) => new an(t), Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4247
4378
  __proto__: null,
4248
- mutex: _r,
4249
- newMutex: so
4379
+ mutex: an,
4380
+ newMutex: co
4250
4381
  }, Symbol.toStringTag, { value: "Module" }));
4251
- function en(t) {
4382
+ function on(t) {
4252
4383
  var e, r, n = "";
4253
4384
  if (typeof t == "string" || typeof t == "number") n += t;
4254
4385
  else if (typeof t == "object") if (Array.isArray(t)) {
4255
4386
  var s = t.length;
4256
- for (e = 0; e < s; e++) t[e] && (r = en(t[e])) && (n && (n += " "), n += r);
4387
+ for (e = 0; e < s; e++) t[e] && (r = on(t[e])) && (n && (n += " "), n += r);
4257
4388
  } else for (r in t) t[r] && (n && (n += " "), n += r);
4258
4389
  return n;
4259
4390
  }
4260
- function io() {
4261
- for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = en(t)) && (n && (n += " "), n += e);
4391
+ function ho() {
4392
+ for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = on(t)) && (n && (n += " "), n += e);
4262
4393
  return n;
4263
4394
  }
4264
- const ao = io, X = "-", zt = "__", Te = "--", tn = (t) => {
4265
- const e = (...r) => ao(...r);
4266
- return e.B = (...r) => t + X + r.join(X), e.E = (r) => t + zt + r, e.M = (...r) => t + Te + r.join("-"), e.BM = (r, ...n) => e.B(r) + Te + n.join("-"), e.BE = (r, ...n) => e.B(r) + zt + n.join(X), e.BEM = (r, n, ...s) => e.BE(r, n) + Te + s.join(X), e.extend = (r) => tn(e.B(r)), e.var = (...r) => Te + t + X + r.join(X), e;
4395
+ const fo = ho, ee = "-", Vt = "__", Ne = "--", un = (t) => {
4396
+ const e = (...r) => fo(...r);
4397
+ return e.B = (...r) => t + ee + r.join(ee), e.E = (r) => t + Vt + r, e.M = (...r) => t + Ne + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ne + n.join("-"), e.BE = (r, ...n) => e.B(r) + Vt + n.join(ee), e.BEM = (r, n, ...s) => e.BE(r, n) + Ne + s.join(ee), e.extend = (r) => un(e.B(r)), e.var = (...r) => Ne + t + ee + r.join(ee), e;
4267
4398
  };
4268
- class oo {
4399
+ class go {
4269
4400
  rows = [];
4270
4401
  columns = [];
4271
4402
  prefix;
@@ -4294,72 +4425,72 @@ class oo {
4294
4425
  };
4295
4426
  }
4296
4427
  }
4297
- const uo = (t, e) => Object.entries(e).forEach(
4428
+ const po = (t, e) => Object.entries(e).forEach(
4298
4429
  ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
4299
- ), lo = (t, e) => Array.from(t.style).forEach((r) => {
4430
+ ), mo = (t, e) => Array.from(t.style).forEach((r) => {
4300
4431
  r.startsWith(e) && t.style.removeProperty(r);
4301
- }), co = (t) => {
4302
- const e = tn(t);
4303
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", hs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Xn.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = uo, e.removeVars = lo, e.newGridBuilder = (r) => new oo(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
4432
+ }), yo = (t) => {
4433
+ const e = un(t);
4434
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", ms.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", ts.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = po, e.removeVars = mo, e.newGridBuilder = (r) => new go(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
4304
4435
  if (!(r == null || r === !1))
4305
- return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ia.cssString(r);
4436
+ return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ua.cssString(r);
4306
4437
  }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
4307
- }, Wo = co("pluto");
4438
+ }, Ko = yo("pluto");
4308
4439
  export {
4309
- $o as $,
4310
- is as A,
4311
- mt as B,
4312
- Wo as C,
4313
- Z as D,
4314
- Lt as E,
4315
- as as F,
4316
- os as G,
4317
- vo as H,
4318
- Nr as I,
4319
- St as J,
4320
- Oo as K,
4321
- Ot as L,
4322
- O as M,
4323
- j as N,
4324
- mo as O,
4325
- ns as P,
4326
- Xs as Q,
4327
- ui as R,
4328
- jo as S,
4329
- me as T,
4330
- F as U,
4331
- Eo as V,
4332
- wo as W,
4333
- z as X,
4334
- So as Y,
4335
- Hs as Z,
4336
- Zo as _,
4337
- xo as a,
4338
- Gs as a0,
4339
- Po as a1,
4340
- Fo as b,
4341
- po as c,
4342
- To as d,
4343
- b as e,
4344
- f,
4345
- Xn as g,
4346
- m as h,
4347
- Ia as i,
4348
- Ro as j,
4349
- Vo as k,
4350
- bo as l,
4351
- zo as m,
4352
- tn as n,
4353
- hs as o,
4354
- Lo as p,
4355
- io as q,
4356
- T as r,
4357
- ko as s,
4358
- qo as t,
4359
- Do as u,
4360
- Co as v,
4361
- V as w,
4362
- N as x,
4363
- Yo as y,
4364
- fo as z
4440
+ hs as $,
4441
+ Wo as A,
4442
+ Po as B,
4443
+ Ko as C,
4444
+ I as D,
4445
+ cs as E,
4446
+ xt as F,
4447
+ H as G,
4448
+ Io as H,
4449
+ E as I,
4450
+ Bo as J,
4451
+ No as K,
4452
+ fs as L,
4453
+ Bt as M,
4454
+ Nt as N,
4455
+ xo as O,
4456
+ us as P,
4457
+ T as Q,
4458
+ di as R,
4459
+ qo as S,
4460
+ q as T,
4461
+ ti as U,
4462
+ ve as V,
4463
+ Ro as W,
4464
+ G as X,
4465
+ V as Y,
4466
+ _s as Z,
4467
+ Mo as _,
4468
+ vo as a,
4469
+ Qs as a0,
4470
+ Zo as a1,
4471
+ Eo as b,
4472
+ Ua as c,
4473
+ So as d,
4474
+ J as e,
4475
+ $ as f,
4476
+ ts as g,
4477
+ Vo as h,
4478
+ O as i,
4479
+ Le as j,
4480
+ Ao as k,
4481
+ Xo as l,
4482
+ $o as m,
4483
+ un as n,
4484
+ ko as o,
4485
+ ms as p,
4486
+ zo as q,
4487
+ b as r,
4488
+ Jo as s,
4489
+ Fo as t,
4490
+ ho as u,
4491
+ Ur as v,
4492
+ Ho as w,
4493
+ Yo as x,
4494
+ Go as y,
4495
+ wo as z
4365
4496
  };