@synnaxlabs/pluto 0.47.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/{Animated-BewuBtBY.cjs → Animated--SNIwznU.cjs} +1 -1
  2. package/dist/{Animated-M9ynNzcI.js → Animated-CC7iS0zH.js} +21 -21
  3. package/dist/{Animated-otpyxn5i.js → Animated-DfDp0-ep.js} +4 -4
  4. package/dist/{Animated-Ck-9v2gm.cjs → Animated-TMpTdCqK.cjs} +1 -1
  5. package/dist/{Box-D5Qv__kr.js → Box-CoQUaJk2.js} +2 -2
  6. package/dist/{Box-BvqALodh.cjs → Box-Ds_D3xR_.cjs} +1 -1
  7. package/dist/Button-BaMa3eGI.cjs +1 -0
  8. package/dist/Button-NgDHbsf8.js +306 -0
  9. package/dist/{Dialog-DwhFD4z2.cjs → Dialog-BL8T9CVw.cjs} +1 -1
  10. package/dist/{Dialog-CO4iLhHf.js → Dialog-CBDFqieV.js} +4 -4
  11. package/dist/{Editable-CxgdRDPb.js → Editable-C7KPD0hC.js} +3 -3
  12. package/dist/{Editable-BXFY3-UW.cjs → Editable-CWt3zqDm.cjs} +1 -1
  13. package/dist/{Haul-BuI0PZpo.js → Haul-Be1j5BU3.js} +2 -2
  14. package/dist/{Haul-2Xa_nMgc.cjs → Haul-D1WaI_xE.cjs} +1 -1
  15. package/dist/{Items-DNcTFEUJ.cjs → Items-BYlg9bb-.cjs} +1 -1
  16. package/dist/{Items-G25zb57I.js → Items-mikdEpyC.js} +8 -8
  17. package/dist/{Menu-DqkB9vpH.js → Menu-CcWs0t21.js} +9 -9
  18. package/dist/{Menu-D-uhqnfk.cjs → Menu-DJoh8bH7.cjs} +1 -1
  19. package/dist/{Provider--RxgAoVG.js → Provider-DScd3hYf.js} +26 -26
  20. package/dist/{Provider-575hnWmi.cjs → Provider-fx1wTnXk.cjs} +2 -2
  21. package/dist/Tags-DvPUmH2r.js +908 -0
  22. package/dist/Tags-KHafaGjR.cjs +1 -0
  23. package/dist/{Text-BzTkWLeU.js → Text-BbbqH88W.js} +492 -487
  24. package/dist/Text-CZrjPRjJ.cjs +1 -0
  25. package/dist/{Video-VlT7jSYk.cjs → Video-DRSEX8t7.cjs} +1 -1
  26. package/dist/{Video-CITi2j07.js → Video-_DrutSeT.js} +2 -2
  27. package/dist/button.cjs +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/color.cjs +1 -1
  30. package/dist/color.js +1 -1
  31. package/dist/css-C_YE-5Xa.cjs +8 -0
  32. package/dist/{css-D6ZBcSwh.js → css-Cn63X_Yv.js} +1161 -1111
  33. package/dist/css.cjs +1 -1
  34. package/dist/css.js +2 -2
  35. package/dist/{deep-DtdcJG4q.cjs → deep-7SxmCL0x.cjs} +1 -1
  36. package/dist/{deep-DRVLw7iw.js → deep-szN5DCOH.js} +1 -1
  37. package/dist/dialog.cjs +1 -1
  38. package/dist/dialog.js +1 -1
  39. package/dist/{dimensions-CGLhBwVq.cjs → dimensions-DFDTcQRG.cjs} +1 -1
  40. package/dist/{dimensions-BFCMI7yN.js → dimensions-Dclfavlh.js} +1 -1
  41. package/dist/{eraser-DvzR9kLf.js → eraser-Bpl4bpBx.js} +13 -13
  42. package/dist/{eraser-Dm5Du4PL.cjs → eraser-Bqibt23a.cjs} +2 -2
  43. package/dist/ether.cjs +1 -1
  44. package/dist/ether.js +7 -7
  45. package/dist/{_commonjsHelpers-BH3jXuIh.cjs → event-BxvV3arE.cjs} +1 -1
  46. package/dist/{_commonjsHelpers-ByX85dGu.js → event-nNH_pXSr.js} +17 -14
  47. package/dist/{external-B2Q-Yx8D.cjs → external-19BIaQc6.cjs} +1 -1
  48. package/dist/{external-CMiEiLpE.js → external-1uZLLxz-.js} +771 -792
  49. package/dist/{external-CraRr06G.js → external-6rS2YiWR.js} +16066 -15782
  50. package/dist/{external-DZSXelLG.js → external-8H4eB7TN.js} +8 -8
  51. package/dist/{external-C5W7VXIW.cjs → external-AInsIJp-.cjs} +1 -1
  52. package/dist/{external-C5ssXUvL.cjs → external-B3jTkhc4.cjs} +4 -22
  53. package/dist/external-B8hxM_jw.cjs +79 -0
  54. package/dist/{external-D9LndfvY.js → external-BOWnCKIe.js} +3 -3
  55. package/dist/external-Bi-OQCBH.js +45 -0
  56. package/dist/{external-CeNR2kU9.js → external-Bq4gfE5e.js} +6 -6
  57. package/dist/{external-CGRGVYRj.js → external-C0_sN1J0.js} +2 -2
  58. package/dist/{external-C_dsD7px.cjs → external-CFZ33YbY.cjs} +1 -1
  59. package/dist/{external-DEWhnbVF.cjs → external-CFdDgpzj.cjs} +1 -1
  60. package/dist/{external-BVcgi9yX.cjs → external-CJFfVl_u.cjs} +1 -1
  61. package/dist/{external-BA6DRS2n.cjs → external-CN15E8ls.cjs} +1 -1
  62. package/dist/{external-DUoHSX0Q.js → external-Caetm5fI.js} +5 -5
  63. package/dist/external-CfEVFfhL.cjs +1 -0
  64. package/dist/{external-DrUtWpiV.js → external-D6TsHpoG.js} +10 -10
  65. package/dist/{external-FIE7PzLB.cjs → external-D7WE6Leo.cjs} +1 -1
  66. package/dist/{external-OLyg-4Ab.cjs → external-DUGcSVbJ.cjs} +1 -1
  67. package/dist/{external-B7hb5HYU.js → external-DwhfVdFp.js} +5 -5
  68. package/dist/{external-BhOvtmPt.js → external-X_eFMRtE.js} +2 -2
  69. package/dist/{external-_LWHQroW.cjs → external-pRQzznIG.cjs} +1 -1
  70. package/dist/{external-x9Ylk2op.js → external-y1Apm7j1.js} +14 -14
  71. package/dist/flex.cjs +1 -1
  72. package/dist/flex.js +1 -1
  73. package/dist/{fontString-yPlq8smc.cjs → fontString-BcSXNOgW.cjs} +1 -1
  74. package/dist/{fontString-CGd4NYXa.js → fontString-D7EMGjIw.js} +2 -2
  75. package/dist/header.cjs +1 -1
  76. package/dist/header.js +1 -1
  77. package/dist/{hooks-15yB7IKE.js → hooks-BmUn8s1r.js} +4 -4
  78. package/dist/{hooks-D_-XdOAe.cjs → hooks-CutQY1o9.cjs} +1 -1
  79. package/dist/index.cjs +8 -40
  80. package/dist/index.js +10546 -10342
  81. package/dist/input.cjs +1 -1
  82. package/dist/input.js +1 -1
  83. package/dist/{jsx-runtime-OVHDjVDe.js → jsx-runtime-BbD0H88J.js} +108 -128
  84. package/dist/jsx-runtime-nZSsnGb7.cjs +6 -0
  85. package/dist/list.cjs +1 -1
  86. package/dist/list.js +1 -1
  87. package/dist/menu.cjs +1 -1
  88. package/dist/menu.js +1 -1
  89. package/dist/pluto.css +1 -1
  90. package/dist/{provider-C8In649C.js → provider-B6SgG_sT.js} +4910 -4821
  91. package/dist/provider-C9Beoajx.cjs +72 -0
  92. package/dist/src/button/Button.d.ts +2 -1
  93. package/dist/src/button/Button.d.ts.map +1 -1
  94. package/dist/src/channel/LinePlot.d.ts +4 -1
  95. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  96. package/dist/src/channel/Select.d.ts +2 -2
  97. package/dist/src/channel/Select.d.ts.map +1 -1
  98. package/dist/src/cluster/index.d.ts +2 -0
  99. package/dist/src/cluster/index.d.ts.map +1 -0
  100. package/dist/src/cluster/queries.d.ts +6 -0
  101. package/dist/src/cluster/queries.d.ts.map +1 -0
  102. package/dist/src/cluster/queries.spec.d.ts +2 -0
  103. package/dist/src/cluster/queries.spec.d.ts.map +1 -0
  104. package/dist/src/color/GradientPicker.d.ts.map +1 -1
  105. package/dist/src/flux/retrieve.d.ts +9 -8
  106. package/dist/src/flux/retrieve.d.ts.map +1 -1
  107. package/dist/src/hardware/device/Select.d.ts +1 -1
  108. package/dist/src/hardware/device/Select.d.ts.map +1 -1
  109. package/dist/src/hardware/rack/Select.d.ts +1 -1
  110. package/dist/src/hardware/rack/Select.d.ts.map +1 -1
  111. package/dist/src/icon/registry.d.ts +1 -0
  112. package/dist/src/icon/registry.d.ts.map +1 -1
  113. package/dist/src/index.d.ts +1 -0
  114. package/dist/src/index.d.ts.map +1 -1
  115. package/dist/src/input/DateTime.d.ts.map +1 -1
  116. package/dist/src/input/DateTime.spec.d.ts +2 -0
  117. package/dist/src/input/DateTime.spec.d.ts.map +1 -0
  118. package/dist/src/label/Select.d.ts +3 -3
  119. package/dist/src/label/Select.d.ts.map +1 -1
  120. package/dist/src/menu/Item.d.ts.map +1 -1
  121. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
  122. package/dist/src/select/Dialog.d.ts +2 -3
  123. package/dist/src/select/Dialog.d.ts.map +1 -1
  124. package/dist/src/select/Multiple.d.ts.map +1 -1
  125. package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
  126. package/dist/src/status/Select.d.ts +1 -1
  127. package/dist/src/status/Select.d.ts.map +1 -1
  128. package/dist/src/status/queries.d.ts +13 -0
  129. package/dist/src/status/queries.d.ts.map +1 -1
  130. package/dist/src/synnax/Provider.d.ts +2 -2
  131. package/dist/src/synnax/Provider.d.ts.map +1 -1
  132. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  133. package/dist/src/table/Table.d.ts.map +1 -1
  134. package/dist/src/tag/Tag.d.ts.map +1 -1
  135. package/dist/src/triggers/Provider.d.ts.map +1 -1
  136. package/dist/src/user/Avatar.d.ts +7 -0
  137. package/dist/src/user/Avatar.d.ts.map +1 -0
  138. package/dist/src/user/external.d.ts +3 -0
  139. package/dist/src/user/external.d.ts.map +1 -0
  140. package/dist/src/user/index.d.ts +1 -1
  141. package/dist/src/user/index.d.ts.map +1 -1
  142. package/dist/src/user/queries.d.ts +1 -0
  143. package/dist/src/user/queries.d.ts.map +1 -1
  144. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  145. package/dist/src/vis/draw2d/index.d.ts +2 -1
  146. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  147. package/dist/src/vis/measure/Measure.d.ts +4 -1
  148. package/dist/src/vis/measure/Measure.d.ts.map +1 -1
  149. package/dist/src/vis/measure/aether/measure.d.ts +27 -1
  150. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  151. package/dist/tabs.cjs +1 -1
  152. package/dist/tabs.js +1 -1
  153. package/dist/text.cjs +1 -1
  154. package/dist/text.js +2 -2
  155. package/dist/theming.cjs +1 -1
  156. package/dist/theming.js +2 -2
  157. package/dist/tree.cjs +1 -1
  158. package/dist/tree.js +1 -1
  159. package/dist/triggers.cjs +1 -1
  160. package/dist/triggers.js +1 -1
  161. package/dist/{units-BqIfn6VX.js → units-cBd5OJg4.js} +1 -1
  162. package/dist/units-zxke9Ng2.cjs +1 -0
  163. package/dist/value-Ce4T858D.cjs +53 -0
  164. package/dist/{value-ChGMEPP3.js → value-UJNdARAu.js} +2715 -2512
  165. package/dist/video.cjs +1 -1
  166. package/dist/video.js +1 -1
  167. package/package.json +24 -22
  168. package/dist/Button-BFoGC4WW.js +0 -305
  169. package/dist/Button-C3dvpk52.cjs +0 -1
  170. package/dist/Tags-Dekr_hwk.cjs +0 -1
  171. package/dist/Tags-Dpu9kD_T.js +0 -604
  172. package/dist/Text-DECnk5vG.cjs +0 -1
  173. package/dist/css-HnNQMUzV.cjs +0 -8
  174. package/dist/external-B9a_p-VK.cjs +0 -1
  175. package/dist/external-BZwFEYop.js +0 -44
  176. package/dist/external-g62tixOz.cjs +0 -85
  177. package/dist/jsx-runtime-Dszzpdy0.cjs +0 -22
  178. package/dist/provider-lNhTlIWj.cjs +0 -72
  179. package/dist/units-DCifOxd9.cjs +0 -1
  180. package/dist/value-B3LTg1lE.cjs +0 -53
@@ -1,67 +1,67 @@
1
- import O, { z as a } from "zod";
2
- const lr = (t) => O.union([
3
- O.union([O.null(), O.undefined()]).transform(() => []),
1
+ import v, { z as a } from "zod";
2
+ const ar = (t) => v.union([
3
+ v.union([v.null(), v.undefined()]).transform(() => []),
4
4
  t.array()
5
- ]), Tn = (t) => Array.isArray(t) ? t : t == null ? [] : [t], cr = (t, e) => {
5
+ ]), $n = (t) => Array.isArray(t) ? t : t == null ? [] : [t], or = (t, e) => {
6
6
  if (Array.isArray(e))
7
- return e.reduce((s, i) => cr(s, i), t ?? []);
7
+ return e.reduce((s, i) => or(s, i), t ?? []);
8
8
  if (t == null) return [e];
9
9
  const r = t.findIndex((s) => s == e), n = [...t];
10
10
  return r === -1 ? n.push(e) : n[r] = e, n;
11
- }, xn = ((t, e) => {
11
+ }, On = ((t, e) => {
12
12
  if (t != null)
13
13
  return Array.isArray(e) ? t.filter((r) => !e.includes(r)) : t.filter((r) => r != e);
14
- }), hr = (t, e) => {
14
+ }), ur = (t, e) => {
15
15
  if (Array.isArray(e))
16
- return e.reduce((s, i) => hr(s, i), t ?? []);
16
+ return e.reduce((s, i) => ur(s, i), t ?? []);
17
17
  if (t == null) return [e];
18
18
  const r = t.findIndex((s) => s.key === e.key), n = [...t];
19
19
  return r === -1 ? n.push(e) : n[r] = e, n;
20
- }, Sn = ((t, e) => {
20
+ }, vn = ((t, e) => {
21
21
  if (t != null)
22
22
  return Array.isArray(e) ? t.filter((r) => !e.includes(r.key)) : t.filter((r) => r.key !== e);
23
- }), du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
23
+ }), hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24
24
  __proto__: null,
25
- nullableZ: lr,
26
- remove: xn,
27
- removeKeyed: Sn,
28
- toArray: Tn,
29
- upsert: cr,
30
- upsertKeyed: hr
31
- }, Symbol.toStringTag, { value: "Module" })), Nn = (t) => {
25
+ nullableZ: ar,
26
+ remove: On,
27
+ removeKeyed: vn,
28
+ toArray: $n,
29
+ upsert: or,
30
+ upsertKeyed: ur
31
+ }, Symbol.toStringTag, { value: "Module" })), Tn = (t) => {
32
32
  const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
33
33
  return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
34
34
  }, Ze = (t) => {
35
- const e = (r, n = ut) => {
35
+ const e = (r, n = it) => {
36
36
  if (typeof r == "string") return t(r);
37
37
  if (Array.isArray(r)) return r.map((o) => e(o, n));
38
38
  if (!_e(r)) return r;
39
- n = An(n);
39
+ n = In(n);
40
40
  const s = {}, i = r;
41
41
  return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
42
42
  let l = i[o];
43
43
  const f = t(o);
44
- n.recursive && (_e(l) ? er(l) || (l = e(l, n)) : n.recursiveInArray && _t(l) && (l = [...l].map((c) => {
44
+ n.recursive && (_e(l) ? Kt(l) || (l = e(l, n)) : n.recursiveInArray && Jt(l) && (l = [...l].map((c) => {
45
45
  let d = c;
46
- return _e(c) ? er(d) || (d = e(c, n)) : _t(c) && (d = e({ key: c }, n).key), d;
46
+ return _e(c) ? Kt(d) || (d = e(c, n)) : Jt(c) && (d = e({ key: c }, n).key), d;
47
47
  }))), s[f] = l;
48
48
  }), s);
49
49
  };
50
50
  return e;
51
- }, Nt = Ze(Nn), In = (t) => (
51
+ }, Tt = Ze(Tn), xn = (t) => (
52
52
  // Don't convert the first character and don't convert a character that is after a
53
53
  // non-alphanumeric character
54
54
  t.replace(
55
55
  /([a-z0-9])([A-Z])/g,
56
56
  (e, r, n) => `${r}_${n.toLowerCase()}`
57
57
  )
58
- ), fr = Ze(In), dr = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), Mn = [Number, String, Uint8Array], ut = {
58
+ ), lr = Ze(xn), cr = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), Sn = [Number, String, Uint8Array], it = {
59
59
  recursive: !0,
60
60
  recursiveInArray: !0
61
- }, An = (t = ut) => (t.recursive == null ? t = ut : t.recursiveInArray ??= !1, t), _t = (t) => t != null && Array.isArray(t), _e = (t) => t != null && typeof t == "object" && !Array.isArray(t), er = (t) => Mn.some((e) => t instanceof e), En = (t) => t.replace(/[\s_]+/g, "-").replace(
61
+ }, In = (t = it) => (t.recursive == null ? t = it : t.recursiveInArray ??= !1, t), Jt = (t) => t != null && Array.isArray(t), _e = (t) => t != null && typeof t == "object" && !Array.isArray(t), Kt = (t) => Sn.some((e) => t instanceof e), Nn = (t) => t.replace(/[\s_]+/g, "-").replace(
62
62
  /([a-z0-9])([A-Z])/g,
63
63
  (e, r, n) => `${r}-${n.toLowerCase()}`
64
- ).toLowerCase(), Un = Ze(En), Bn = (t) => {
64
+ ).toLowerCase(), Mn = Ze(Nn), An = (t) => {
65
65
  if (t.length === 0) return t;
66
66
  let e = t.replace(/[_-]/g, " ");
67
67
  return e = e.replace(
@@ -71,15 +71,15 @@ const lr = (t) => O.union([
71
71
  /([A-Z]+)([A-Z][a-z])/g,
72
72
  (r, n, s) => `${n} ${s}`
73
73
  ), e = e.replace(/\s+/g, " ").trim(), e = e.replace(/\b\w/g, (r) => r.toUpperCase()), e;
74
- }, Cn = Ze(Bn), gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
74
+ }, En = Ze(An), fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
75
  __proto__: null,
76
- camelToSnake: fr,
77
- capitalize: dr,
78
- snakeToCamel: Nt,
79
- toKebab: Un,
80
- toProperNoun: Cn
76
+ camelToSnake: lr,
77
+ capitalize: cr,
78
+ snakeToCamel: Tt,
79
+ toKebab: Mn,
80
+ toProperNoun: En
81
81
  }, Symbol.toStringTag, { value: "Module" }));
82
- let jn = class {
82
+ let Un = class {
83
83
  contentType = "application/json";
84
84
  decoder;
85
85
  encoder;
@@ -93,15 +93,15 @@ let jn = class {
93
93
  return this.decodeString(this.decoder.decode(e), r);
94
94
  }
95
95
  decodeString(e, r) {
96
- const n = JSON.parse(e), s = Nt(n);
96
+ const n = JSON.parse(e), s = Tt(n);
97
97
  return r != null ? r.parse(s) : s;
98
98
  }
99
99
  encodeString(e) {
100
- const r = fr(e);
100
+ const r = lr(e);
101
101
  return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
102
102
  }
103
103
  };
104
- const lt = new jn(), ct = (t) => [...new Set(t)], Rn = (t, e, r = !0) => {
104
+ const at = new Un(), ot = (t) => [...new Set(t)], Bn = (t, e, r = !0) => {
105
105
  const n = /* @__PURE__ */ new Map();
106
106
  return t.forEach((s) => {
107
107
  const i = e(s);
@@ -111,12 +111,12 @@ const lt = new jn(), ct = (t) => [...new Set(t)], Rn = (t, e, r = !0) => {
111
111
  }
112
112
  n.set(i, s);
113
113
  }), Array.from(n.values());
114
- }, mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
114
+ }, gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
115
115
  __proto__: null,
116
- by: Rn,
117
- unique: ct
116
+ by: Bn,
117
+ unique: ot
118
118
  }, Symbol.toStringTag, { value: "Module" })), B = (t) => t != null && typeof t == "object" && "value" in t;
119
- let re = class {
119
+ let ne = class {
120
120
  /** The underlying primitive value */
121
121
  value;
122
122
  constructor(e) {
@@ -136,8 +136,8 @@ let re = class {
136
136
  return this.value.toString();
137
137
  }
138
138
  };
139
- const It = (t) => t != null && typeof t == "object" && "toString" in t, gr = (t) => {
140
- if (It(t)) return t?.toString().length === 0;
139
+ const xt = (t) => t != null && typeof t == "object" && "toString" in t, hr = (t) => {
140
+ if (xt(t)) return t?.toString().length === 0;
141
141
  switch (typeof t) {
142
142
  case "string":
143
143
  return t.length === 0;
@@ -154,15 +154,15 @@ const It = (t) => t != null && typeof t == "object" && "toString" in t, gr = (t)
154
154
  default:
155
155
  return !1;
156
156
  }
157
- }, Ln = (t) => !gr(t), bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
157
+ }, Cn = (t) => !hr(t), mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
158
158
  __proto__: null,
159
- ValueExtension: re,
159
+ ValueExtension: ne,
160
160
  isCrudeValueExtension: B,
161
- isNonZero: Ln,
162
- isStringer: It,
163
- isZero: gr
164
- }, Symbol.toStringTag, { value: "Module" })), Mt = (t, e = !1) => {
165
- const r = It(t) ? "stringer" : typeof t;
161
+ isNonZero: Cn,
162
+ isStringer: xt,
163
+ isZero: hr
164
+ }, Symbol.toStringTag, { value: "Module" })), St = (t, e = !1) => {
165
+ const r = xt(t) ? "stringer" : typeof t;
166
166
  let n;
167
167
  switch (r) {
168
168
  case "string":
@@ -186,19 +186,19 @@ const It = (t) => t != null && typeof t == "object" && "toString" in t, gr = (t)
186
186
  default:
187
187
  return console.warn(`sortFunc: unknown type ${r}`), () => -1;
188
188
  }
189
- return e ? Pn(n) : n;
190
- }, wu = (t, e, r) => {
191
- const n = Mt(e[t], r);
189
+ return e ? Rn(n) : n;
190
+ }, yu = (t, e, r) => {
191
+ const n = St(e[t], r);
192
192
  return (s, i) => n(s[t], i[t]);
193
- }, $u = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Dn = (t, e) => {
193
+ }, bu = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, jn = (t, e) => {
194
194
  if (t.length !== e.length) return t.length - e.length;
195
195
  if (t.length === 0) return 0;
196
- const r = Mt(t[0]), n = [...t].sort(r), s = [...e].sort(r);
196
+ const r = St(t[0]), n = [...t].sort(r), s = [...e].sort(r);
197
197
  return n.every((i, o) => i === s[o]) ? 0 : -1;
198
- }, Ou = (t, e) => {
199
- const r = ct(t), n = ct(e);
200
- return Dn(r, n);
201
- }, vu = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Pn = (t) => (e, r) => t(r, e), ve = 0, et = -1, tt = 1, kn = (t) => t < ve, qn = (t) => t > ve, Tu = (t) => t >= ve, zn = (t) => t === ve, xu = (t, e) => {
198
+ }, wu = (t, e) => {
199
+ const r = ot(t), n = ot(e);
200
+ return jn(r, n);
201
+ }, $u = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Rn = (t) => (e, r) => t(r, e), oe = 0, V = -1, W = 1, Ln = (t) => t < oe, Dn = (t) => t > oe, Ou = (t) => t >= oe, Pn = (t) => t === oe, vu = (t, e) => {
202
202
  const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
203
203
  if (!n || !s) return 0;
204
204
  for (let i = 0; i < Math.min(n.length, s.length); i++) {
@@ -214,38 +214,38 @@ const It = (t) => t != null && typeof t == "object" && "toString" in t, gr = (t)
214
214
  return n.length - s.length;
215
215
  }, Fe = a.tuple([a.number(), a.number()]);
216
216
  a.tuple([a.bigint(), a.bigint()]);
217
- const At = a.object({ width: a.number(), height: a.number() }), Zn = a.object({
217
+ const It = a.object({ width: a.number(), height: a.number() }), kn = a.object({
218
218
  signedWidth: a.number(),
219
219
  signedHeight: a.number()
220
- }), Fn = ["width", "height"];
221
- a.enum(Fn);
222
- const Yn = ["start", "center", "end"], Vn = ["signedWidth", "signedHeight"];
220
+ }), qn = ["width", "height"];
221
+ a.enum(qn);
222
+ const zn = ["start", "center", "end"], Zn = ["signedWidth", "signedHeight"];
223
+ a.enum(Zn);
224
+ const we = a.object({ x: a.number(), y: a.number() }), fr = a.object({ clientX: a.number(), clientY: a.number() }), Ye = ["x", "y"], Nt = a.enum(Ye), Mt = ["top", "right", "bottom", "left"], Fn = a.enum(Mt), Ve = ["left", "right"], At = a.enum(Ve), We = ["top", "bottom"], Et = a.enum(We), Ut = ["center"], ut = a.enum(Ut), Yn = [...Mt, ...Ut], Bt = a.enum(Yn);
225
+ a.enum(zn);
226
+ const Vn = ["first", "last"];
223
227
  a.enum(Vn);
224
- const ye = a.object({ x: a.number(), y: a.number() }), pr = a.object({ clientX: a.number(), clientY: a.number() }), Ye = ["x", "y"], Et = a.enum(Ye), Ut = ["top", "right", "bottom", "left"], Wn = a.enum(Ut), Ve = ["left", "right"], Bt = a.enum(Ve), We = ["top", "bottom"], Ct = a.enum(We), jt = ["center"], ht = a.enum(jt), Gn = [...Ut, ...jt], Rt = a.enum(Gn);
225
- a.enum(Yn);
226
- const Hn = ["first", "last"];
227
- a.enum(Hn);
228
- const mr = a.object({ lower: a.number(), upper: a.number() }), Xn = a.object({ lower: a.bigint(), upper: a.bigint() });
229
- a.union([mr, Fe]);
230
- a.union([Xn, Fe]);
231
- const Jn = a.enum([...Et.options, ...Rt.options]);
228
+ const dr = a.object({ lower: a.number(), upper: a.number() }), Wn = a.object({ lower: a.bigint(), upper: a.bigint() });
229
+ a.union([dr, Fe]);
230
+ a.union([Wn, Fe]);
231
+ const Gn = a.enum([...Nt.options, ...Bt.options]);
232
232
  a.enum(["x", "left", "right"]);
233
233
  a.enum(["y", "top", "bottom"]);
234
- const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
234
+ const Hn = a.union([Nt, Bt, a.instanceof(String)]), ue = (t) => (e, r) => {
235
235
  if (typeof e == "bigint") {
236
- if (De(r))
236
+ if (Pe(r))
237
237
  return t(e, BigInt(r));
238
238
  const n = t(Number(e), Number(r));
239
239
  return typeof n == "number" ? BigInt(Math.round(n)) : n;
240
240
  }
241
241
  return t(Number(e), Number(r));
242
- }, Z = ae((t, e) => t - e), oe = ae((t, e) => t + e), Qn = (t, e, r = 1e-4) => Math.abs(t - e) < r, ft = (t, e) => {
242
+ }, z = ue((t, e) => t - e), le = ue((t, e) => t + e), Xn = (t, e, r = 1e-4) => Math.abs(t - e) < r, lt = (t, e) => {
243
243
  const r = typeof t == "bigint", n = typeof e == "bigint";
244
- return r && n ? t === e : r && De(e) ? t === BigInt(e) : n && De(t) ? e === BigInt(t) : t === e;
245
- }, _n = (t) => {
244
+ return r && n ? t === e : r && Pe(e) ? t === BigInt(e) : n && Pe(t) ? e === BigInt(t) : t === e;
245
+ }, Jn = (t) => {
246
246
  const e = 10 ** Math.floor(Math.log10(t));
247
247
  return Math.round(t / e) * e;
248
- }, yr = ae((t, e) => t <= e ? t : e), De = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), es = ae((t, e) => t >= e ? t : e), br = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, R = ae((t, e) => t * e), Te = ae((t, e) => t / e), b = (t, e, r) => {
248
+ }, gr = ue((t, e) => t <= e ? t : e), Pe = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Kn = ue((t, e) => t >= e ? t : e), pr = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, j = ue((t, e) => t * e), xe = ue((t, e) => t / e), b = (t, e, r) => {
249
249
  const n = {};
250
250
  if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
251
251
  e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
@@ -254,64 +254,64 @@ const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
254
254
  [n.lower, n.upper] = t;
255
255
  } else
256
256
  n.lower = t.lower, n.upper = t.upper;
257
- return r?.makeValid ? wr(n) : n;
258
- }, ts = Object.freeze({ lower: 0, upper: 0 }), rs = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), ns = Object.freeze({ lower: 0, upper: 1 }), ss = Object.freeze({ lower: -1, upper: 1 }), is = (t, e) => {
257
+ return r?.makeValid ? mr(n) : n;
258
+ }, Qn = Object.freeze({ lower: 0, upper: 0 }), _n = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), es = Object.freeze({ lower: 0, upper: 1 }), ts = Object.freeze({ lower: -1, upper: 1 }), rs = (t, e) => {
259
259
  if (t == null && e == null) return !0;
260
260
  if (t == null || e == null) return !1;
261
261
  const r = b(t), n = b(e);
262
262
  return r?.lower === n?.lower && r?.upper === n?.upper;
263
- }, wr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, dt = (t, e) => {
263
+ }, mr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, ct = (t, e) => {
264
264
  const r = b(t);
265
265
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
266
- }, L = (t, e) => {
266
+ }, R = (t, e) => {
267
267
  const r = b(t);
268
268
  if (typeof e == "number" || typeof e == "bigint")
269
269
  return e >= r.lower && e < r.upper;
270
270
  const n = b(e);
271
271
  return n.lower >= r.lower && n.upper <= r.upper;
272
- }, as = (t, e) => {
272
+ }, ns = (t, e) => {
273
273
  const r = b(t), n = b(e);
274
- return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : L(r, n.upper) || L(r, n.lower) || L(n, r.upper) || L(n, r.lower);
275
- }, ue = (t) => {
274
+ return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : R(r, n.upper) || R(r, n.lower) || R(n, r.upper) || R(n, r.lower);
275
+ }, ce = (t) => {
276
276
  const e = b(t);
277
277
  return e.upper - e.lower;
278
- }, os = (t) => {
278
+ }, ss = (t) => {
279
279
  const e = b(t);
280
280
  return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
281
- }, us = (t) => {
282
- const e = ue(t);
281
+ }, is = (t) => {
282
+ const e = ce(t);
283
283
  return typeof e == "number" ? e === 0 : e === 0n;
284
- }, ls = (t) => {
284
+ }, as = (t) => {
285
285
  const e = b(t);
286
286
  return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
287
- }, cs = (t) => {
287
+ }, os = (t) => {
288
288
  const e = b(t);
289
289
  return (e.upper + e.lower) / 2;
290
- }, $r = (t) => ({
290
+ }, yr = (t) => ({
291
291
  lower: Math.min(...t.map((e) => b(e).lower)),
292
292
  upper: Math.max(...t.map((e) => b(e).upper))
293
- }), hs = (t) => ({
293
+ }), us = (t) => ({
294
294
  lower: Math.max(...t.map((e) => b(e).lower)),
295
295
  upper: Math.min(...t.map((e) => b(e).upper))
296
- }), fs = (t) => {
296
+ }), ls = (t) => {
297
297
  const e = b(t), r = typeof e.lower == "bigint";
298
- return Array.from({ length: Number(ue(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
299
- }, gt = (t, e) => {
300
- const r = t.map((i) => b(i)), n = r.findIndex((i) => L(i, e) || e < i.lower);
298
+ return Array.from({ length: Number(ce(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
299
+ }, ht = (t, e) => {
300
+ const r = t.map((i) => b(i)), n = r.findIndex((i) => R(i, e) || e < i.lower);
301
301
  if (n === -1) return { index: t.length, position: 0 };
302
302
  const s = r[n];
303
- return L(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
304
- }, rt = {
303
+ return R(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
304
+ }, et = {
305
305
  removeBefore: 0,
306
306
  removeAfter: 0,
307
307
  insertInto: 0,
308
308
  deleteInBetween: 0
309
- }, ds = (t, e) => {
309
+ }, cs = (t, e) => {
310
310
  const r = t.map((c) => b(c)), n = b(e);
311
- if (r.length === 0) return rt;
312
- const s = gt(r, n.lower), i = gt(r, n.upper);
313
- if (s.index === t.length) return { ...rt, insertInto: t.length };
314
- if (i.index === 0) return { ...rt, removeAfter: i.position };
311
+ if (r.length === 0) return et;
312
+ const s = ht(r, n.lower), i = ht(r, n.upper);
313
+ if (s.index === t.length) return { ...et, insertInto: t.length };
314
+ if (i.index === 0) return { ...et, removeAfter: i.position };
315
315
  if (s.index === i.index)
316
316
  return s.position !== 0 && i.position !== 0 ? null : {
317
317
  removeAfter: i.position,
@@ -319,25 +319,25 @@ const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
319
319
  insertInto: s.index,
320
320
  deleteInBetween: 0
321
321
  };
322
- let o = i.index - s.index, l = s.index, f = Z(Number(ue(r[s.index])), s.position);
322
+ let o = i.index - s.index, l = s.index, f = z(Number(ce(r[s.index])), s.position);
323
323
  return s.position !== 0 ? (o -= 1, l += 1) : f = 0, {
324
324
  removeBefore: f,
325
325
  removeAfter: i.position,
326
326
  insertInto: l,
327
327
  deleteInBetween: o
328
328
  };
329
- }, Or = (t, e, r) => {
329
+ }, br = (t, e, r) => {
330
330
  const n = t.map((l) => b(l)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
331
331
  if (s === 0) return e;
332
332
  let i = r, o = e;
333
- for (; ft(i, 0) === !1; ) {
333
+ for (; lt(i, 0) === !1; ) {
334
334
  const l = n.findIndex((f) => s > 0 ? o >= f.lower && o < f.upper : o > f.lower && o <= f.upper);
335
335
  if (l !== -1) {
336
336
  const f = n[l];
337
337
  let c;
338
- if (s > 0 ? c = Z(f.upper, o) : c = Z(o, f.lower), c > 0) {
339
- const d = yr(br(i), c);
340
- if (o = oe(o, s > 0 ? d : -d), i = Z(i, s > 0 ? d : -d), ft(i, 0)) return o;
338
+ if (s > 0 ? c = z(f.upper, o) : c = z(o, f.lower), c > 0) {
339
+ const d = gr(pr(i), c);
340
+ if (o = le(o, s > 0 ? d : -d), i = z(i, s > 0 ? d : -d), lt(i, 0)) return o;
341
341
  continue;
342
342
  }
343
343
  }
@@ -353,7 +353,7 @@ const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
353
353
  }
354
354
  }
355
355
  return o;
356
- }, vr = (t, e, r) => {
356
+ }, wr = (t, e, r) => {
357
357
  const n = t.map((o) => b(o));
358
358
  if (e === r) return typeof e == "bigint" ? 0n : 0;
359
359
  const s = e < r ? b([e, r]) : b([r, e]);
@@ -366,284 +366,284 @@ const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
366
366
  }
367
367
  }
368
368
  return i;
369
- }, Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
369
+ }, Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
370
370
  __proto__: null,
371
- CLIP: ss,
372
- DECIMAL: ns,
373
- INFINITE: rs,
374
- ZERO: ts,
375
- bounds: mr,
376
- buildInsertionPlan: ds,
377
- clamp: dt,
371
+ CLIP: ts,
372
+ DECIMAL: es,
373
+ INFINITE: _n,
374
+ ZERO: Qn,
375
+ bounds: dr,
376
+ buildInsertionPlan: cs,
377
+ clamp: ct,
378
378
  construct: b,
379
- contains: L,
380
- distance: vr,
381
- equals: is,
382
- findInsertPosition: gt,
383
- isFinite: ls,
384
- isZero: os,
385
- linspace: fs,
386
- makeValid: wr,
387
- max: $r,
388
- mean: cs,
389
- min: hs,
390
- overlapsWith: as,
391
- span: ue,
392
- spanIsZero: us,
393
- traverse: Or
394
- }, Symbol.toStringTag, { value: "Module" })), Tr = Jn, z = (t) => Ye.includes(t) ? t : We.includes(t) ? "y" : "x", gs = (t) => z(t) === "x" ? "y" : "x", ps = (t) => z(t) === "x" ? "width" : "height", ms = (t) => z(t) === "x" ? "left" : "top", ys = (t) => Tr.safeParse(t).success, bs = (t) => z(t) === "x" ? "signedWidth" : "signedHeight", ws = (t) => t === "center" ? !1 : z(t) === "x", $s = (t) => z(t) === "y", Os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
379
+ contains: R,
380
+ distance: wr,
381
+ equals: rs,
382
+ findInsertPosition: ht,
383
+ isFinite: as,
384
+ isZero: ss,
385
+ linspace: ls,
386
+ makeValid: mr,
387
+ max: yr,
388
+ mean: os,
389
+ min: us,
390
+ overlapsWith: ns,
391
+ span: ce,
392
+ spanIsZero: is,
393
+ traverse: br
394
+ }, Symbol.toStringTag, { value: "Module" })), $r = Gn, q = (t) => Ye.includes(t) ? t : We.includes(t) ? "y" : "x", hs = (t) => q(t) === "x" ? "y" : "x", fs = (t) => q(t) === "x" ? "width" : "height", ds = (t) => q(t) === "x" ? "left" : "top", gs = (t) => $r.safeParse(t).success, ps = (t) => q(t) === "x" ? "signedWidth" : "signedHeight", ms = (t) => t === "center" ? !1 : q(t) === "x", ys = (t) => q(t) === "y", bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
395
395
  __proto__: null,
396
396
  DIRECTIONS: Ye,
397
- construct: z,
398
- crude: Tr,
399
- dimension: ps,
400
- direction: Et,
401
- isDirection: ys,
402
- isX: ws,
403
- isY: $s,
404
- location: ms,
405
- signedDimension: bs,
406
- swap: gs
407
- }, Symbol.toStringTag, { value: "Module" })), vs = Bt, Ts = Ct, xs = ht, Ss = {
397
+ construct: q,
398
+ crude: $r,
399
+ dimension: fs,
400
+ direction: Nt,
401
+ isDirection: gs,
402
+ isX: ms,
403
+ isY: ys,
404
+ location: ds,
405
+ signedDimension: ps,
406
+ swap: hs
407
+ }, Symbol.toStringTag, { value: "Module" })), ws = At, $s = Et, Os = ut, vs = {
408
408
  top: "bottom",
409
409
  right: "left",
410
410
  bottom: "top",
411
411
  left: "right",
412
412
  center: "center"
413
- }, Ns = {
413
+ }, Ts = {
414
414
  top: "left",
415
415
  right: "top",
416
416
  bottom: "right",
417
417
  left: "bottom",
418
418
  center: "center"
419
- }, Is = Kn, H = (t) => t instanceof String || !Ye.includes(t) ? t : t === "x" ? "left" : "top", Ms = (t) => Ss[H(t)], As = (t) => Ns[H(t)], be = (t) => {
420
- const e = H(t);
419
+ }, xs = Hn, X = (t) => t instanceof String || !Ye.includes(t) ? t : t === "x" ? "left" : "top", Ss = (t) => vs[X(t)], Is = (t) => Ts[X(t)], $e = (t) => {
420
+ const e = X(t);
421
421
  return e === "top" || e === "bottom" ? "y" : "x";
422
- }, Es = a.object({
423
- x: Bt.or(ht),
424
- y: Ct.or(ht)
425
- }), xr = a.object({ x: Bt, y: Ct }), xe = Object.freeze({ x: "left", y: "top" }), Lt = Object.freeze({ x: "right", y: "top" }), Ge = Object.freeze({ x: "left", y: "bottom" }), Dt = Object.freeze({ x: "right", y: "bottom" }), Pt = Object.freeze({ x: "center", y: "center" }), kt = Object.freeze({ x: "center", y: "top" }), qt = Object.freeze({ x: "center", y: "bottom" }), zt = Object.freeze({ x: "right", y: "center" }), Zt = Object.freeze({ x: "left", y: "center" }), Us = Object.freeze([
426
- Zt,
427
- zt,
422
+ }, Ns = a.object({
423
+ x: At.or(ut),
424
+ y: Et.or(ut)
425
+ }), Or = a.object({ x: At, y: Et }), Se = Object.freeze({ x: "left", y: "top" }), Ct = Object.freeze({ x: "right", y: "top" }), Ge = Object.freeze({ x: "left", y: "bottom" }), jt = Object.freeze({ x: "right", y: "bottom" }), Rt = Object.freeze({ x: "center", y: "center" }), Lt = Object.freeze({ x: "center", y: "top" }), Dt = Object.freeze({ x: "center", y: "bottom" }), Pt = Object.freeze({ x: "right", y: "center" }), kt = Object.freeze({ x: "left", y: "center" }), Ms = Object.freeze([
428
426
  kt,
429
- qt,
430
- xe,
427
+ Pt,
431
428
  Lt,
432
- Ge,
433
429
  Dt,
434
- Pt
435
- ]), Ft = (t, e) => t.x === e.x && t.y === e.y, Bs = (t, e) => {
430
+ Se,
431
+ Ct,
432
+ Ge,
433
+ jt,
434
+ Rt
435
+ ]), qt = (t, e) => t.x === e.x && t.y === e.y, As = (t, e) => {
436
436
  if (typeof e == "object") {
437
437
  let r = !0;
438
438
  return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
439
439
  }
440
440
  return t.x === e || t.y === e;
441
- }, Sr = (t) => [t.x, t.y], Ue = (t) => be(H(t)) === "x", Cs = (t) => be(H(t)) === "y", js = (t) => `${t.x}${dr(t.y)}`, Rs = (t, e) => {
441
+ }, vr = (t) => [t.x, t.y], Be = (t) => $e(X(t)) === "x", Es = (t) => $e(X(t)) === "y", Us = (t) => `${t.x}${cr(t.y)}`, Bs = (t, e) => {
442
442
  let r, n;
443
- if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = H(t), n = H(e ?? t)), be(r) === be(n) && r !== "center" && n !== "center")
443
+ if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = X(t), n = X(e ?? t)), $e(r) === $e(n) && r !== "center" && n !== "center")
444
444
  throw new Error(
445
445
  `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
446
446
  );
447
- const s = { ...Pt };
448
- return r === "center" ? Ue(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ue(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ue(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
449
- }, Ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
447
+ const s = { ...Rt };
448
+ return r === "center" ? Be(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Be(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Be(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
449
+ }, Cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
450
450
  __proto__: null,
451
- BOTTOM_CENTER: qt,
451
+ BOTTOM_CENTER: Dt,
452
452
  BOTTOM_LEFT: Ge,
453
- BOTTOM_RIGHT: Dt,
454
- CENTER: Pt,
455
- CENTER_LEFT: Zt,
456
- CENTER_LOCATIONS: jt,
457
- CENTER_RIGHT: zt,
458
- OUTER_LOCATIONS: Ut,
459
- TOP_CENTER: kt,
460
- TOP_LEFT: xe,
461
- TOP_RIGHT: Lt,
462
- XY_LOCATIONS: Us,
453
+ BOTTOM_RIGHT: jt,
454
+ CENTER: Rt,
455
+ CENTER_LEFT: kt,
456
+ CENTER_LOCATIONS: Ut,
457
+ CENTER_RIGHT: Pt,
458
+ OUTER_LOCATIONS: Mt,
459
+ TOP_CENTER: Lt,
460
+ TOP_LEFT: Se,
461
+ TOP_RIGHT: Ct,
462
+ XY_LOCATIONS: Ms,
463
463
  X_LOCATIONS: Ve,
464
464
  Y_LOCATIONS: We,
465
- center: xs,
466
- construct: H,
467
- constructXY: Rs,
468
- corner: xr,
469
- crude: Is,
470
- direction: be,
471
- isX: Ue,
472
- isY: Cs,
473
- location: Rt,
474
- outer: Wn,
475
- rotate90: As,
476
- swap: Ms,
477
- x: vs,
478
- xy: Es,
479
- xyCouple: Sr,
480
- xyEquals: Ft,
481
- xyMatches: Bs,
482
- xyToString: js,
483
- y: Ts
484
- }, Symbol.toStringTag, { value: "Module" })), pt = a.union([
465
+ center: Os,
466
+ construct: X,
467
+ constructXY: Bs,
468
+ corner: Or,
469
+ crude: xs,
470
+ direction: $e,
471
+ isX: Be,
472
+ isY: Es,
473
+ location: Bt,
474
+ outer: Fn,
475
+ rotate90: Is,
476
+ swap: Ss,
477
+ x: ws,
478
+ xy: Ns,
479
+ xyCouple: vr,
480
+ xyEquals: qt,
481
+ xyMatches: As,
482
+ xyToString: Us,
483
+ y: $s
484
+ }, Symbol.toStringTag, { value: "Module" })), ft = a.union([
485
485
  a.number(),
486
- ye,
486
+ we,
487
487
  Fe,
488
- At,
489
- Zn,
490
- pr
491
- ]), v = (t, e) => {
488
+ It,
489
+ kn,
490
+ fr
491
+ ]), T = (t, e) => {
492
492
  if (typeof t == "string") {
493
493
  if (e === void 0) throw new Error("The y coordinate must be given.");
494
494
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
495
495
  }
496
496
  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 };
497
- }, q = Object.freeze({ x: 0, y: 0 }), Nr = Object.freeze({ x: 1, y: 1 }), Ds = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Ps = Object.freeze({ x: NaN, y: NaN }), Pe = (t, e, r = 0) => {
498
- const n = v(t), s = v(e);
497
+ }, k = Object.freeze({ x: 0, y: 0 }), Tr = Object.freeze({ x: 1, y: 1 }), js = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Rs = Object.freeze({ x: NaN, y: NaN }), ke = (t, e, r = 0) => {
498
+ const n = T(t), s = T(e);
499
499
  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;
500
- }, ks = (t) => Pe(t, q), Yt = (t, e, r) => {
501
- const n = v(t), s = v(e, r);
500
+ }, Ls = (t) => ke(t, k), zt = (t, e, r) => {
501
+ const n = T(t), s = T(e, r);
502
502
  return { x: n.x * s.x, y: n.y * s.y };
503
- }, Ir = (t, e) => {
504
- const r = v(t);
503
+ }, xr = (t, e) => {
504
+ const r = T(t);
505
505
  return { x: r.x + e, y: r.y };
506
- }, Mr = (t, e) => {
507
- const r = v(t);
506
+ }, Sr = (t, e) => {
507
+ const r = T(t);
508
508
  return { x: r.x, y: r.y + e };
509
- }, we = (t, e, r, ...n) => {
509
+ }, Oe = (t, e, r, ...n) => {
510
510
  if (typeof e == "string") {
511
511
  if (typeof r != "number") throw new Error("The value must be a number.");
512
- return e === "x" ? Ir(t, r) : Mr(t, r);
512
+ return e === "x" ? xr(t, r) : Sr(t, r);
513
513
  }
514
514
  if (typeof e == "object" && "x" in e && typeof e.x == "string") {
515
- const s = v(r), i = v(t);
515
+ const s = T(r), i = T(t);
516
516
  return e.x === "left" ? s.x = -s.x : e.x === "center" && (s.x = 0), e.y === "top" ? s.y = -s.y : e.y === "center" && (s.y = 0), { x: i.x + s.x, y: i.y + s.y };
517
517
  }
518
- return [t, e, r ?? q, ...n].reduce((s, i) => {
519
- const o = v(i);
518
+ return [t, e, r ?? k, ...n].reduce((s, i) => {
519
+ const o = T(i);
520
520
  return { x: s.x + o.x, y: s.y + o.y };
521
- }, q);
522
- }, qs = (t, e, r) => {
523
- const n = v(t);
521
+ }, k);
522
+ }, Ds = (t, e, r) => {
523
+ const n = T(t);
524
524
  return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
525
- }, zs = (t, e) => {
526
- const r = v(t), n = v(e);
525
+ }, Ps = (t, e) => {
526
+ const r = T(t), n = T(e);
527
527
  return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
528
- }, Zs = (t, e) => {
529
- const r = v(t), n = v(e);
528
+ }, ks = (t, e) => {
529
+ const r = T(t), n = T(e);
530
530
  return { x: n.x - r.x, y: n.y - r.y };
531
- }, Fs = (t) => {
532
- const e = v(t);
531
+ }, qs = (t) => {
532
+ const e = T(t);
533
533
  return Number.isNaN(e.x) || Number.isNaN(e.y);
534
- }, Ys = (t) => {
535
- const e = v(t);
534
+ }, zs = (t) => {
535
+ const e = T(t);
536
536
  return Number.isFinite(e.x) && Number.isFinite(e.y);
537
- }, Vs = (t) => {
538
- const e = v(t);
537
+ }, Zs = (t) => {
538
+ const e = T(t);
539
539
  return [e.x, e.y];
540
- }, Ws = (t) => {
541
- const e = v(t);
540
+ }, Fs = (t) => {
541
+ const e = T(t);
542
542
  return { left: e.x, top: e.y };
543
- }, mt = (t, e = 0) => {
544
- const r = v(t);
543
+ }, dt = (t, e = 0) => {
544
+ const r = T(t);
545
545
  return {
546
546
  x: Number(r.x.toFixed(e)),
547
547
  y: Number(r.y.toFixed(e))
548
548
  };
549
- }, ce = (t, e) => {
550
- const r = v(t), n = v(e);
549
+ }, fe = (t, e) => {
550
+ const r = T(t), n = T(e);
551
551
  return { x: r.x - n.x, y: r.y - n.y };
552
- }, he = (t) => {
553
- const e = v(t), r = Math.hypot(e.x, e.y);
552
+ }, de = (t) => {
553
+ const e = T(t), r = Math.hypot(e.x, e.y);
554
554
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
555
- }, Ar = (t) => {
556
- const e = v(t), r = Math.hypot(e.x, e.y);
555
+ }, Ir = (t) => {
556
+ const e = T(t), r = Math.hypot(e.x, e.y);
557
557
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
558
- }, Er = (...t) => {
559
- const e = t.reduce((r, n) => we(r, n), q);
560
- return Yt(e, 1 / t.length);
561
- }, Gs = (t, e) => {
558
+ }, Nr = (...t) => {
559
+ const e = t.reduce((r, n) => Oe(r, n), k);
560
+ return zt(e, 1 / t.length);
561
+ }, Ys = (t, e) => {
562
562
  const r = [];
563
563
  for (let n = 0; n < t.length; n++) {
564
564
  const s = t[n];
565
565
  let i, o, l, f;
566
566
  if (n === 0) {
567
- const c = t[n + 1], d = ce(c, s);
568
- o = he(d), l = o, f = e;
567
+ const c = t[n + 1], d = fe(c, s);
568
+ o = de(d), l = o, f = e;
569
569
  } else if (n === t.length - 1) {
570
- const c = t[n - 1], d = ce(s, c);
571
- i = he(d), l = i, f = e;
570
+ const c = t[n - 1], d = fe(s, c);
571
+ i = de(d), l = i, f = e;
572
572
  } else {
573
- const c = t[n - 1], d = t[n + 1], m = ce(s, c), p = ce(d, s);
574
- i = he(m), o = he(p);
575
- const A = Math.acos(
573
+ const c = t[n - 1], d = t[n + 1], m = fe(s, c), p = fe(d, s);
574
+ i = de(m), o = de(p);
575
+ const M = Math.acos(
576
576
  (m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
577
- ), U = Math.sin(A / 2);
578
- U === 0 ? f = e : f = e / U, l = Ar(Er(i, o));
577
+ ), E = Math.sin(M / 2);
578
+ E === 0 ? f = e : f = e / E, l = Ir(Nr(i, o));
579
579
  }
580
- r.push(Yt(l, f));
580
+ r.push(zt(l, f));
581
581
  }
582
582
  return r;
583
- }, Hs = (t) => {
584
- const e = v(t);
583
+ }, Vs = (t) => {
584
+ const e = T(t);
585
585
  return { x: e.y, y: e.x };
586
- }, yt = (t) => {
587
- const e = v(t);
586
+ }, gt = (t) => {
587
+ const e = T(t);
588
588
  return { x: Math.round(e.x), y: Math.round(e.y) };
589
- }, Xs = (t) => {
590
- const e = v(t);
589
+ }, Ws = (t) => {
590
+ const e = T(t);
591
591
  return { x: 1 / e.x, y: 1 / e.y };
592
- }, Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
592
+ }, xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
593
593
  __proto__: null,
594
- INFINITY: Ds,
595
- NAN: Ps,
596
- ONE: Nr,
597
- ZERO: q,
598
- average: Er,
599
- calculateMiters: Gs,
600
- clientXY: pr,
601
- construct: v,
602
- couple: Vs,
603
- crudeZ: pt,
604
- css: Ws,
605
- distance: zs,
606
- equals: Pe,
607
- isFinite: Ys,
608
- isNan: Fs,
609
- isZero: ks,
610
- normal: he,
611
- normalize: Ar,
612
- reciprocal: Xs,
613
- round: yt,
614
- scale: Yt,
615
- set: qs,
616
- sub: ce,
617
- swap: Hs,
618
- translate: we,
619
- translateX: Ir,
620
- translateY: Mr,
621
- translation: Zs,
622
- truncate: mt,
623
- xy: ye
624
- }, Symbol.toStringTag, { value: "Module" })), Ne = a.union([a.number(), a.string()]), Js = a.object({
594
+ INFINITY: js,
595
+ NAN: Rs,
596
+ ONE: Tr,
597
+ ZERO: k,
598
+ average: Nr,
599
+ calculateMiters: Ys,
600
+ clientXY: fr,
601
+ construct: T,
602
+ couple: Zs,
603
+ crudeZ: ft,
604
+ css: Fs,
605
+ distance: Ps,
606
+ equals: ke,
607
+ isFinite: zs,
608
+ isNan: qs,
609
+ isZero: Ls,
610
+ normal: de,
611
+ normalize: Ir,
612
+ reciprocal: Ws,
613
+ round: gt,
614
+ scale: zt,
615
+ set: Ds,
616
+ sub: fe,
617
+ swap: Vs,
618
+ translate: Oe,
619
+ translateX: xr,
620
+ translateY: Sr,
621
+ translation: ks,
622
+ truncate: dt,
623
+ xy: we
624
+ }, Symbol.toStringTag, { value: "Module" })), Ne = a.union([a.number(), a.string()]), Gs = a.object({
625
625
  top: Ne,
626
626
  left: Ne,
627
627
  width: Ne,
628
628
  height: Ne
629
- }), Ks = a.object({
629
+ }), Hs = a.object({
630
630
  left: a.number(),
631
631
  top: a.number(),
632
632
  right: a.number(),
633
633
  bottom: a.number()
634
- }), Qs = a.object({
635
- one: ye,
636
- two: ye,
637
- root: xr
638
- }), Ur = { one: q, two: q, root: xe }, _s = { one: q, two: Nr, root: Ge }, Br = (t, e) => ({
634
+ }), Xs = a.object({
635
+ one: we,
636
+ two: we,
637
+ root: Or
638
+ }), Mr = { one: k, two: k, root: Se }, Js = { one: k, two: Tr, root: Ge }, Ar = (t, e) => ({
639
639
  one: t.one,
640
640
  two: t.two,
641
641
  root: e ?? t.root
642
- }), x = (t, e, r = 0, n = 0, s) => {
642
+ }), S = (t, e, r = 0, n = 0, s) => {
643
643
  const i = {
644
- one: { ...q },
645
- two: { ...q },
646
- root: s ?? xe
644
+ one: { ...k },
645
+ two: { ...k },
646
+ root: s ?? Se
647
647
  };
648
648
  if (typeof t == "number") {
649
649
  if (typeof e != "number")
@@ -657,219 +657,219 @@ const Kn = a.union([Et, Rt, a.instanceof(String)]), ae = (t) => (e, r) => {
657
657
  x: i.one.x + e.signedWidth,
658
658
  y: i.one.y + e.signedHeight
659
659
  } : i.two = e, i));
660
- }, ei = (t, e, r) => {
661
- const n = x(t);
660
+ }, Ks = (t, e, r) => {
661
+ const n = S(t);
662
662
  if (typeof e == "string") {
663
663
  if (r == null) throw new Error("Invalid arguments for resize");
664
- const s = z(e);
665
- return x(
664
+ const s = q(e);
665
+ return S(
666
666
  n.one,
667
667
  void 0,
668
- s === "x" ? r : X(n),
669
- s === "y" ? r : J(n),
668
+ s === "x" ? r : J(n),
669
+ s === "y" ? r : K(n),
670
670
  n.root
671
671
  );
672
672
  }
673
- return x(n.one, e, void 0, void 0, n.root);
674
- }, ti = (t, e, r = !0) => {
675
- const n = x(t);
673
+ return S(n.one, e, void 0, void 0, n.root);
674
+ }, Qs = (t, e, r = !0) => {
675
+ const n = S(t);
676
676
  let s = (i, o) => i < o;
677
- return r && (s = (i, o) => i <= o), "one" in e ? s(W(n), W(e)) && s(_(e), _(n)) && s(G(n), G(e)) && s(ee(e), ee(n)) : s(W(n), e.x) && s(e.x, _(n)) && s(G(n), e.y) && s(e.y, ee(n));
678
- }, ri = (t, e) => Pe(t.one, e.one) && Pe(t.two, e.two) && Ft(t.root, e.root), Cr = (t) => ({
679
- width: X(t),
680
- height: J(t)
681
- }), ni = (t) => ({
677
+ return r && (s = (i, o) => i <= o), "one" in e ? s(G(n), G(e)) && s(ee(e), ee(n)) && s(H(n), H(e)) && s(te(e), te(n)) : s(G(n), e.x) && s(e.x, ee(n)) && s(H(n), e.y) && s(e.y, te(n));
678
+ }, _s = (t, e) => ke(t.one, e.one) && ke(t.two, e.two) && qt(t.root, e.root), Er = (t) => ({
679
+ width: J(t),
680
+ height: K(t)
681
+ }), ei = (t) => ({
682
682
  signedWidth: He(t),
683
683
  signedHeight: Xe(t)
684
- }), si = (t) => ({
685
- top: G(t),
686
- left: W(t),
687
- width: X(t),
688
- height: J(t)
689
- }), Vt = (t, e, r = !1) => {
690
- const n = z(e) === "y" ? Xe(t) : He(t);
684
+ }), ti = (t) => ({
685
+ top: H(t),
686
+ left: G(t),
687
+ width: J(t),
688
+ height: K(t)
689
+ }), Zt = (t, e, r = !1) => {
690
+ const n = q(e) === "y" ? Xe(t) : He(t);
691
691
  return r ? n : Math.abs(n);
692
- }, F = (t, e) => {
693
- const r = x(t);
692
+ }, Z = (t, e) => {
693
+ const r = S(t);
694
694
  return {
695
- x: e.x === "center" ? bt(r).x : te(r, e.x),
696
- y: e.y === "center" ? bt(r).y : te(r, e.y)
695
+ x: e.x === "center" ? pt(r).x : re(r, e.x),
696
+ y: e.y === "center" ? pt(r).y : re(r, e.y)
697
697
  };
698
- }, te = (t, e) => {
699
- const r = x(t), n = Sr(r.root).includes(e) ? Math.min : Math.max;
698
+ }, re = (t, e) => {
699
+ const r = S(t), n = vr(r.root).includes(e) ? Math.min : Math.max;
700
700
  return Ve.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
701
- }, ii = (t) => Lr(t) === 0, X = (t) => Vt(t, "x"), J = (t) => Vt(t, "y"), He = (t) => {
702
- const e = x(t);
701
+ }, ri = (t) => Cr(t) === 0, J = (t) => Zt(t, "x"), K = (t) => Zt(t, "y"), He = (t) => {
702
+ const e = S(t);
703
703
  return e.two.x - e.one.x;
704
704
  }, Xe = (t) => {
705
- const e = x(t);
705
+ const e = S(t);
706
706
  return e.two.y - e.one.y;
707
- }, jr = (t) => F(t, xe), ai = (t) => F(t, kt), oi = (t) => F(t, Lt), ui = (t) => F(t, Ge), li = (t) => F(t, qt), ci = (t) => F(t, Dt), hi = (t) => F(t, Zt), fi = (t) => F(t, zt), _ = (t) => te(t, "right"), ee = (t) => te(t, "bottom"), W = (t) => te(t, "left"), G = (t) => te(t, "top"), bt = (t) => we(jr(t), {
707
+ }, Ur = (t) => Z(t, Se), ni = (t) => Z(t, Lt), si = (t) => Z(t, Ct), ii = (t) => Z(t, Ge), ai = (t) => Z(t, Dt), oi = (t) => Z(t, jt), ui = (t) => Z(t, kt), li = (t) => Z(t, Pt), ee = (t) => re(t, "right"), te = (t) => re(t, "bottom"), G = (t) => re(t, "left"), H = (t) => re(t, "top"), pt = (t) => Oe(Ur(t), {
708
708
  x: He(t) / 2,
709
709
  y: Xe(t) / 2
710
- }), Wt = (t) => {
711
- const e = x(t);
712
- return e.root.x === "left" ? W(e) : _(e);
713
- }, Gt = (t) => {
714
- const e = x(t);
715
- return e.root.y === "top" ? G(e) : ee(e);
716
- }, di = (t) => ({ x: Wt(t), y: Gt(t) }), Be = (t) => {
717
- const e = x(t);
710
+ }), Ft = (t) => {
711
+ const e = S(t);
712
+ return e.root.x === "left" ? G(e) : ee(e);
713
+ }, Yt = (t) => {
714
+ const e = S(t);
715
+ return e.root.y === "top" ? H(e) : te(e);
716
+ }, ci = (t) => ({ x: Ft(t), y: Yt(t) }), Ce = (t) => {
717
+ const e = S(t);
718
718
  return { lower: e.one.x, upper: e.two.x };
719
- }, Ce = (t) => {
720
- const e = x(t);
719
+ }, je = (t) => {
720
+ const e = S(t);
721
721
  return { lower: e.one.y, upper: e.two.y };
722
- }, gi = (t, e) => Br(t, e), pi = (t, e) => {
723
- const r = x(t), n = Ve.includes(e) ? "x" : We.includes(e) ? "y" : null;
722
+ }, hi = (t, e) => Ar(t, e), fi = (t, e) => {
723
+ const r = S(t), n = Ve.includes(e) ? "x" : We.includes(e) ? "y" : null;
724
724
  if (n === null) throw new Error(`Invalid location: ${e}`);
725
725
  const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
726
726
  return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
727
- }, mi = (t, e) => {
728
- const r = x(t), n = x(e), s = Wt(n) + (X(n) - X(r)) / 2, i = Gt(n) + (J(n) - J(r)) / 2;
729
- return x({ x: s, y: i }, Cr(r));
730
- }, Rr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, yi = (t) => X(t) / J(t), bi = (t, e, r) => {
727
+ }, di = (t, e) => {
728
+ const r = S(t), n = S(e), s = Ft(n) + (J(n) - J(r)) / 2, i = Yt(n) + (K(n) - K(r)) / 2;
729
+ return S({ x: s, y: i }, Er(r));
730
+ }, Br = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, gi = (t) => J(t) / K(t), pi = (t, e, r) => {
731
731
  if (typeof e == "string") {
732
732
  if (r == null) throw new Error("Undefined amount passed into box.translate");
733
- const s = z(e);
734
- e = v(s, r);
733
+ const s = q(e);
734
+ e = T(s, r);
735
735
  }
736
- const n = x(t);
737
- return x(
738
- we(n.one, e),
739
- we(n.two, e),
736
+ const n = S(t);
737
+ return S(
738
+ Oe(n.one, e),
739
+ Oe(n.two, e),
740
740
  void 0,
741
741
  void 0,
742
742
  n.root
743
743
  );
744
- }, wi = (t, e) => {
745
- const r = Math.max(W(t), W(e)), n = Math.max(G(t), G(e)), s = Math.min(_(t), _(e)), i = Math.min(ee(t), ee(e));
746
- return r > s || n > i ? Ur : x({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
747
- }, Lr = (t) => X(t) * J(t), $i = (t, e) => {
748
- const r = x(t);
749
- return x(
750
- mt(r.one, e),
751
- mt(r.two, e),
744
+ }, mi = (t, e) => {
745
+ const r = Math.max(G(t), G(e)), n = Math.max(H(t), H(e)), s = Math.min(ee(t), ee(e)), i = Math.min(te(t), te(e));
746
+ return r > s || n > i ? Mr : S({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
747
+ }, Cr = (t) => J(t) * K(t), yi = (t, e) => {
748
+ const r = S(t);
749
+ return S(
750
+ dt(r.one, e),
751
+ dt(r.two, e),
752
752
  void 0,
753
753
  void 0,
754
754
  r.root
755
755
  );
756
- }, Oi = (t, e, r, n, s, i) => {
756
+ }, bi = (t, e, r, n, s, i) => {
757
757
  const o = { x: t, y: e }, l = { x: t + r, y: e + n };
758
- return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, l.x -= r / 2) : (o.x -= r, l.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, l.y -= n / 2) : (o.y -= n, l.y -= n)), x(o, l, void 0, void 0, i);
759
- }, vi = (t) => {
760
- const e = x(t);
761
- return x(yt(e.one), yt(e.two), void 0, void 0, e.root);
762
- }, Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
758
+ return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, l.x -= r / 2) : (o.x -= r, l.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, l.y -= n / 2) : (o.y -= n, l.y -= n)), S(o, l, void 0, void 0, i);
759
+ }, wi = (t) => {
760
+ const e = S(t);
761
+ return S(gt(e.one), gt(e.two), void 0, void 0, e.root);
762
+ }, Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
763
763
  __proto__: null,
764
- DECIMAL: _s,
765
- ZERO: Ur,
766
- area: Lr,
767
- areaIsZero: ii,
768
- aspect: yi,
769
- bottom: ee,
770
- bottomCenter: li,
771
- bottomLeft: ui,
772
- bottomRight: ci,
773
- box: Qs,
774
- center: bt,
775
- centerLeft: hi,
776
- centerRight: fi,
777
- construct: x,
778
- constructWithAlternateRoot: Oi,
779
- contains: ti,
780
- copy: Br,
781
- css: si,
782
- cssBox: Js,
783
- dim: Vt,
784
- dims: Cr,
785
- domRect: Ks,
786
- edgePoints: pi,
787
- equals: ri,
788
- height: J,
789
- intersection: wi,
790
- isBox: Rr,
791
- left: W,
792
- loc: te,
793
- positionInCenter: mi,
794
- reRoot: gi,
795
- resize: ei,
796
- right: _,
797
- root: di,
798
- round: vi,
799
- signedDims: ni,
764
+ DECIMAL: Js,
765
+ ZERO: Mr,
766
+ area: Cr,
767
+ areaIsZero: ri,
768
+ aspect: gi,
769
+ bottom: te,
770
+ bottomCenter: ai,
771
+ bottomLeft: ii,
772
+ bottomRight: oi,
773
+ box: Xs,
774
+ center: pt,
775
+ centerLeft: ui,
776
+ centerRight: li,
777
+ construct: S,
778
+ constructWithAlternateRoot: bi,
779
+ contains: Qs,
780
+ copy: Ar,
781
+ css: ti,
782
+ cssBox: Gs,
783
+ dim: Zt,
784
+ dims: Er,
785
+ domRect: Hs,
786
+ edgePoints: fi,
787
+ equals: _s,
788
+ height: K,
789
+ intersection: mi,
790
+ isBox: Br,
791
+ left: G,
792
+ loc: re,
793
+ positionInCenter: di,
794
+ reRoot: hi,
795
+ resize: Ks,
796
+ right: ee,
797
+ root: ci,
798
+ round: wi,
799
+ signedDims: ei,
800
800
  signedHeight: Xe,
801
801
  signedWidth: He,
802
- top: G,
803
- topCenter: ai,
804
- topLeft: jr,
805
- topRight: oi,
806
- translate: bi,
807
- truncate: $i,
808
- width: X,
809
- x: Wt,
810
- xBounds: Be,
811
- xyLoc: F,
812
- y: Gt,
813
- yBounds: Ce
814
- }, Symbol.toStringTag, { value: "Module" })), Dr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Ti = a.union([At, Dr, ye, Fe]), xi = { width: 0, height: 0 }, Si = { width: 1, height: 1 }, D = (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 }, Ni = (t, e) => {
802
+ top: H,
803
+ topCenter: ni,
804
+ topLeft: Ur,
805
+ topRight: si,
806
+ translate: pi,
807
+ truncate: yi,
808
+ width: J,
809
+ x: Ft,
810
+ xBounds: Ce,
811
+ xyLoc: Z,
812
+ y: Yt,
813
+ yBounds: je
814
+ }, Symbol.toStringTag, { value: "Module" })), jr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), $i = a.union([It, jr, we, Fe]), Oi = { width: 0, height: 0 }, vi = { width: 1, height: 1 }, L = (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) => {
815
815
  if (e == null) return !1;
816
- const r = D(t), n = D(e);
816
+ const r = L(t), n = L(e);
817
817
  return r.width === n.width && r.height === n.height;
818
- }, Ii = (t) => {
819
- const e = D(t);
818
+ }, xi = (t) => {
819
+ const e = L(t);
820
820
  return { width: e.height, height: e.width };
821
- }, Mi = (t) => {
822
- const e = D(t);
821
+ }, Si = (t) => {
822
+ const e = L(t);
823
823
  return `0 0 ${e.width} ${e.height}`;
824
- }, Ai = (t) => {
825
- const e = D(t);
824
+ }, Ii = (t) => {
825
+ const e = L(t);
826
826
  return [e.width, e.height];
827
- }, Ei = (t) => ({
828
- width: Math.max(...t.map((e) => D(e).width)),
829
- height: Math.max(...t.map((e) => D(e).height))
830
- }), Ui = (t) => ({
831
- width: Math.min(...t.map((e) => D(e).width)),
832
- height: Math.min(...t.map((e) => D(e).height))
833
- }), Bi = (t, e) => {
834
- const r = D(t);
827
+ }, Ni = (t) => ({
828
+ width: Math.max(...t.map((e) => L(e).width)),
829
+ height: Math.max(...t.map((e) => L(e).height))
830
+ }), Mi = (t) => ({
831
+ width: Math.min(...t.map((e) => L(e).width)),
832
+ height: Math.min(...t.map((e) => L(e).height))
833
+ }), Ai = (t, e) => {
834
+ const r = L(t);
835
835
  return { width: r.width * e, height: r.height * e };
836
- }, Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
836
+ }, Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
837
837
  __proto__: null,
838
- DECIMAL: Si,
839
- ZERO: xi,
840
- construct: D,
841
- couple: Ai,
842
- crude: Ti,
843
- dimensions: At,
844
- equals: Ni,
845
- max: Ei,
846
- min: Ui,
847
- scale: Bi,
848
- signed: Dr,
849
- svgViewBox: Mi,
850
- swap: Ii
851
- }, Symbol.toStringTag, { value: "Module" })), Ci = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, ji = a.object({ offset: pt, scale: pt }), Ri = a.object({ offset: a.number(), scale: a.number() }), Li = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
838
+ DECIMAL: vi,
839
+ ZERO: Oi,
840
+ construct: L,
841
+ couple: Ii,
842
+ crude: $i,
843
+ dimensions: It,
844
+ equals: Ti,
845
+ max: Ni,
846
+ min: Mi,
847
+ scale: Ai,
848
+ signed: jr,
849
+ svgViewBox: Si,
850
+ swap: xi
851
+ }, Symbol.toStringTag, { value: "Module" })), Ei = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, Ui = a.object({ offset: ft, scale: ft }), Bi = a.object({ offset: a.number(), scale: a.number() }), Ci = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
852
852
  e,
853
853
  s ? n - t : n + t
854
- ], Di = (t) => (e, r, n, s) => [
854
+ ], ji = (t) => (e, r, n, s) => [
855
855
  e,
856
856
  s ? n / t : n * t
857
- ], Pi = (t) => (e, r, n) => {
857
+ ], Ri = (t) => (e, r, n) => {
858
858
  if (e === null) return [t, n];
859
859
  const { lower: s, upper: i } = e, { lower: o, upper: l } = t, f = i - s, c = l - o;
860
860
  if (r === "dimension") return [t, n * (c / f)];
861
861
  const d = (n - s) * (c / f) + o;
862
862
  return [t, d];
863
- }, ki = (t) => (e, r, n) => [t, n], qi = () => (t, e, r) => {
863
+ }, Li = (t) => (e, r, n) => [t, n], Di = () => (t, e, r) => {
864
864
  if (t === null) throw new Error("cannot invert without bounds");
865
865
  if (e === "dimension") return [t, r];
866
866
  const { lower: n, upper: s } = t;
867
867
  return [t, s - (r - n)];
868
- }, zi = (t) => (e, r, n) => {
868
+ }, Pi = (t) => (e, r, n) => {
869
869
  const { lower: s, upper: i } = t;
870
- return n = Ci(n, s, i), [e, n];
870
+ return n = Ei(n, s, i), [e, n];
871
871
  };
872
- let wt = class se {
872
+ let mt = class ie {
873
873
  ops = [];
874
874
  currBounds = null;
875
875
  currType = null;
@@ -883,7 +883,7 @@ let wt = class se {
883
883
  * @param value - The amount to translate by.
884
884
  */
885
885
  static translate(e) {
886
- return new se().translate(e);
886
+ return new ie().translate(e);
887
887
  }
888
888
  /**
889
889
  * @returns a new scale with a magnification as its first operation. Any number provided
@@ -891,10 +891,10 @@ let wt = class se {
891
891
  * @param value - The amount to translate by.
892
892
  */
893
893
  static magnify(e) {
894
- return new se().magnify(e);
894
+ return new ie().magnify(e);
895
895
  }
896
896
  static scale(e, r) {
897
- return new se().scale(e, r);
897
+ return new ie().scale(e, r);
898
898
  }
899
899
  /**
900
900
  * @returns a copy of the scale with a translation as its next operation. Any
@@ -903,7 +903,7 @@ let wt = class se {
903
903
  * @param value - The amount to translate by.
904
904
  */
905
905
  translate(e) {
906
- const r = this.new(), n = Li(e);
906
+ const r = this.new(), n = Ci(e);
907
907
  return n.type = "translate", r.ops.push(n), r;
908
908
  }
909
909
  /**
@@ -913,23 +913,23 @@ let wt = class se {
913
913
  * @param value - The amount to magnify by.
914
914
  */
915
915
  magnify(e) {
916
- const r = this.new(), n = Di(e);
916
+ const r = this.new(), n = ji(e);
917
917
  return n.type = "magnify", r.ops.push(n), r;
918
918
  }
919
919
  scale(e, r) {
920
- const n = b(e, r), s = this.new(), i = Pi(n);
920
+ const n = b(e, r), s = this.new(), i = Ri(n);
921
921
  return i.type = "scale", s.ops.push(i), s;
922
922
  }
923
923
  clamp(e, r) {
924
- const n = b(e, r), s = this.new(), i = zi(n);
924
+ const n = b(e, r), s = this.new(), i = Pi(n);
925
925
  return i.type = "clamp", s.ops.push(i), s;
926
926
  }
927
927
  reBound(e, r) {
928
- const n = b(e, r), s = this.new(), i = ki(n);
928
+ const n = b(e, r), s = this.new(), i = Li(n);
929
929
  return i.type = "re-bound", s.ops.push(i), s;
930
930
  }
931
931
  invert() {
932
- const e = qi();
932
+ const e = Di();
933
933
  e.type = "invert";
934
934
  const r = this.new();
935
935
  return r.ops.push(e), r;
@@ -941,7 +941,7 @@ let wt = class se {
941
941
  return this.exec("dimension", e);
942
942
  }
943
943
  new() {
944
- const e = new se();
944
+ const e = new ie();
945
945
  return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
946
946
  }
947
947
  exec(e, r) {
@@ -967,37 +967,37 @@ let wt = class se {
967
967
  get transform() {
968
968
  return { scale: this.dim(1), offset: this.pos(0) };
969
969
  }
970
- static IDENTITY = new se();
971
- }, Zi = class P {
970
+ static IDENTITY = new ie();
971
+ }, ki = class D {
972
972
  x;
973
973
  y;
974
974
  currRoot;
975
- constructor(e = new wt(), r = new wt(), n = null) {
975
+ constructor(e = new mt(), r = new mt(), n = null) {
976
976
  this.x = e, this.y = r, this.currRoot = n;
977
977
  }
978
978
  static translate(e, r) {
979
- return new P().translate(e, r);
979
+ return new D().translate(e, r);
980
980
  }
981
981
  static translateX(e) {
982
- return new P().translateX(e);
982
+ return new D().translateX(e);
983
983
  }
984
984
  static translateY(e) {
985
- return new P().translateY(e);
985
+ return new D().translateY(e);
986
986
  }
987
987
  static clamp(e) {
988
- return new P().clamp(e);
988
+ return new D().clamp(e);
989
989
  }
990
990
  static magnify(e) {
991
- return new P().magnify(e);
991
+ return new D().magnify(e);
992
992
  }
993
993
  static scale(e) {
994
- return new P().scale(e);
994
+ return new D().scale(e);
995
995
  }
996
996
  static reBound(e) {
997
- return new P().reBound(e);
997
+ return new D().reBound(e);
998
998
  }
999
999
  translate(e, r) {
1000
- const n = v(e, r), s = this.copy();
1000
+ const n = T(e, r), s = this.copy();
1001
1001
  return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
1002
1002
  }
1003
1003
  translateX(e) {
@@ -1014,22 +1014,22 @@ let wt = class se {
1014
1014
  }
1015
1015
  scale(e) {
1016
1016
  const r = this.copy();
1017
- if (Rr(e)) {
1017
+ if (Br(e)) {
1018
1018
  const n = this.currRoot;
1019
- return r.currRoot = e.root, n != null && !Ft(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(Be(e)), r.y = r.y.scale(Ce(e)), r;
1019
+ return r.currRoot = e.root, n != null && !qt(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(Ce(e)), r.y = r.y.scale(je(e)), r;
1020
1020
  }
1021
1021
  return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
1022
1022
  }
1023
1023
  reBound(e) {
1024
1024
  const r = this.copy();
1025
- return r.x = this.x.reBound(Be(e)), r.y = this.y.reBound(Ce(e)), r;
1025
+ return r.x = this.x.reBound(Ce(e)), r.y = this.y.reBound(je(e)), r;
1026
1026
  }
1027
1027
  clamp(e) {
1028
1028
  const r = this.copy();
1029
- return r.x = this.x.clamp(Be(e)), r.y = this.y.clamp(Ce(e)), r;
1029
+ return r.x = this.x.clamp(Ce(e)), r.y = this.y.clamp(je(e)), r;
1030
1030
  }
1031
1031
  copy() {
1032
- const e = new P();
1032
+ const e = new D();
1033
1033
  return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
1034
1034
  }
1035
1035
  reverse() {
@@ -1043,7 +1043,7 @@ let wt = class se {
1043
1043
  return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
1044
1044
  }
1045
1045
  box(e) {
1046
- return x(
1046
+ return S(
1047
1047
  this.pos(e.one),
1048
1048
  this.pos(e.two),
1049
1049
  0,
@@ -1057,31 +1057,31 @@ let wt = class se {
1057
1057
  offset: this.pos({ x: 0, y: 0 })
1058
1058
  };
1059
1059
  }
1060
- static IDENTITY = new P();
1060
+ static IDENTITY = new D();
1061
1061
  };
1062
- const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1062
+ const Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1063
1063
  __proto__: null,
1064
- Scale: wt,
1065
- XY: Zi,
1066
- crudeXYTransform: ji,
1067
- transform: Ri
1064
+ Scale: mt,
1065
+ XY: ki,
1066
+ crudeXYTransform: Ui,
1067
+ transform: Bi
1068
1068
  }, Symbol.toStringTag, { value: "Module" }));
1069
- let Pr = (t, e = 21) => (r = e) => {
1069
+ let Rr = (t, e = 21) => (r = e) => {
1070
1070
  let n = "", s = r | 0;
1071
1071
  for (; s--; )
1072
1072
  n += t[Math.random() * t.length | 0];
1073
1073
  return n;
1074
1074
  };
1075
- const kr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Fi = `0123456789${kr}`, qr = 11, Yi = Pr(kr, 1), Vi = Pr(Fi, qr - 1), Ht = () => `${Yi()}${Vi()}`, Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1075
+ const Lr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", qi = `0123456789${Lr}`, Dr = 11, zi = Rr(Lr, 1), Zi = Rr(qi, Dr - 1), Vt = () => `${zi()}${Zi()}`, Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1076
1076
  __proto__: null,
1077
- LENGTH: qr,
1078
- create: Ht
1079
- }, Symbol.toStringTag, { value: "Module" })), Wi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Gi = a.enum(["static", "dynamic"]), Hi = 2 ** 8 - 1, Xi = 2 ** 16 - 1, Ji = 2 ** 32 - 1, Ki = 2n ** 64n - 1n, Qi = 2 ** 64 - 1, _i = -128, ea = 2 ** 7 - 1, ta = -32768, ra = 2 ** 15 - 1, na = -2147483648, sa = 2 ** 31 - 1, ia = -(2n ** 63n), ke = 2n ** 63n - 1n, aa = -9223372036854776e3, zr = 2 ** 63 - 1, tr = 365, Ie = 30, oa = a.union([
1077
+ LENGTH: Dr,
1078
+ create: Vt
1079
+ }, Symbol.toStringTag, { value: "Module" })), Fi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Yi = a.enum(["static", "dynamic"]), Vi = 2 ** 8 - 1, Wi = 2 ** 16 - 1, Gi = 2 ** 32 - 1, Hi = 2n ** 64n - 1n, Xi = 2 ** 64 - 1, Ji = -128, Ki = 2 ** 7 - 1, Qi = -32768, _i = 2 ** 15 - 1, ea = -2147483648, ta = 2 ** 31 - 1, ra = -(2n ** 63n), qe = 2n ** 63n - 1n, na = -9223372036854776e3, Pr = 2 ** 63 - 1, Qt = 365, Me = 30, sa = a.union([
1080
1080
  a.tuple([a.int()]),
1081
1081
  a.tuple([a.int(), a.int().min(1).max(12)]),
1082
1082
  a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
1083
- ]), Zr = (t, e) => {
1084
- const r = new $(e);
1083
+ ]), kr = (t, e) => {
1084
+ const r = new O(e);
1085
1085
  if (![
1086
1086
  h.DAY,
1087
1087
  h.HOUR,
@@ -1095,9 +1095,9 @@ const kr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Fi = `0123456
1095
1095
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
1096
1096
  );
1097
1097
  const n = t.valueOf() % r.valueOf();
1098
- return t instanceof $ ? new $(n) : new h(n);
1098
+ return t instanceof O ? new O(n) : new h(n);
1099
1099
  };
1100
- let $ = class g extends re {
1100
+ let O = class g extends ne {
1101
1101
  constructor(e, r = "UTC") {
1102
1102
  if (e == null) super(g.now().valueOf());
1103
1103
  else if (e instanceof Date)
@@ -1107,7 +1107,7 @@ let $ = class g extends re {
1107
1107
  else if (Array.isArray(e)) super(g.parseDate(e));
1108
1108
  else {
1109
1109
  let n = 0n;
1110
- e instanceof Number && (e = e.valueOf()), r === "local" && (n = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e === zr ? e = ke : e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = g.MAX : e = g.MIN)), B(e) && (e = e.value), super(BigInt(e.valueOf()) + n);
1110
+ e instanceof Number && (e = e.valueOf()), r === "local" && (n = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e === Pr ? e = qe : e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = g.MAX : e = g.MIN)), B(e) && (e = e.value), super(BigInt(e.valueOf()) + n);
1111
1111
  }
1112
1112
  }
1113
1113
  static parseDate([e = 1970, r = 1, n = 1]) {
@@ -1131,6 +1131,17 @@ let $ = class g extends re {
1131
1131
  static parseDateTimeString(e, r = "UTC") {
1132
1132
  if (!e.includes("/") && !e.includes("-"))
1133
1133
  return g.parseTimeString(e, r);
1134
+ if (e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?$/) != null) {
1135
+ let s = e, i = 0;
1136
+ if (e.includes(".")) {
1137
+ const c = e.split(".");
1138
+ s = c[0];
1139
+ const d = c[1] || "0";
1140
+ i = parseInt(d.padEnd(3, "0").slice(0, 3));
1141
+ }
1142
+ const o = r === "local" ? new Date(s.replace("T", " ")) : /* @__PURE__ */ new Date(`${s}Z`), l = BigInt(o.getTime()) * g.MILLISECOND.valueOf(), f = BigInt(i) * g.MILLISECOND.valueOf();
1143
+ return l + f;
1144
+ }
1134
1145
  const n = new Date(e);
1135
1146
  return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new g(
1136
1147
  BigInt(n.getTime()) * g.MILLISECOND.valueOf(),
@@ -1193,7 +1204,7 @@ let $ = class g extends re {
1193
1204
  * valid, regardless of the TimeStamp order.
1194
1205
  */
1195
1206
  range(e) {
1196
- return new Q(this, e).makeValid();
1207
+ return new _(this, e).makeValid();
1197
1208
  }
1198
1209
  /**
1199
1210
  * Creates a TimeRange starting at the TimeStamp and spanning the given
@@ -1262,7 +1273,7 @@ let $ = class g extends re {
1262
1273
  * TimeSpan.
1263
1274
  */
1264
1275
  add(e) {
1265
- return new g(oe(this.valueOf(), new h(e).valueOf()));
1276
+ return new g(le(this.valueOf(), new h(e).valueOf()));
1266
1277
  }
1267
1278
  /**
1268
1279
  * Subtracts a TimeSpan from the TimeStamp.
@@ -1272,7 +1283,7 @@ let $ = class g extends re {
1272
1283
  * TimeSpan.
1273
1284
  */
1274
1285
  sub(e) {
1275
- return new g(Z(this.valueOf(), new h(e).valueOf()));
1286
+ return new g(z(this.valueOf(), new h(e).valueOf()));
1276
1287
  }
1277
1288
  /**
1278
1289
  * @returns the floating point number of hours since the unix epoch to the timestamp
@@ -1463,7 +1474,7 @@ let $ = class g extends re {
1463
1474
  * @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
1464
1475
  */
1465
1476
  remainder(e) {
1466
- return Zr(this, e);
1477
+ return kr(this, e);
1467
1478
  }
1468
1479
  /** @returns true if the day portion TimeStamp is today, false otherwise. */
1469
1480
  get isToday() {
@@ -1478,6 +1489,22 @@ let $ = class g extends re {
1478
1489
  truncate(e) {
1479
1490
  return this.sub(this.remainder(e));
1480
1491
  }
1492
+ /**
1493
+ * Determines the appropriate string format based on the span magnitude.
1494
+ *
1495
+ * @param span - The span that provides context for format selection
1496
+ * @returns The appropriate TimeStampStringFormat
1497
+ *
1498
+ * Rules:
1499
+ * - For spans >= 30 days: "shortDate" (e.g., "Nov 5")
1500
+ * - For spans >= 1 day: "dateTime" (e.g., "Nov 5 14:23:45")
1501
+ * - For spans >= 1 hour: "time" (e.g., "14:23:45")
1502
+ * - For spans >= 1 second: "preciseTime" (e.g., "14:23:45.123")
1503
+ * - For spans < 1 second: "ISOTime" (full precision time)
1504
+ */
1505
+ formatBySpan(e) {
1506
+ return e.greaterThanOrEqual(h.days(30)) ? "shortDate" : e.greaterThanOrEqual(h.DAY) ? "dateTime" : e.greaterThanOrEqual(h.HOUR) ? "time" : e.greaterThanOrEqual(h.SECOND) ? "preciseTime" : "ISOTime";
1507
+ }
1481
1508
  /**
1482
1509
  * @returns A new TimeStamp representing the current time in UTC. It's important to
1483
1510
  * note that this TimeStamp is only accurate to the millisecond level (that's the best
@@ -1562,7 +1589,7 @@ let $ = class g extends re {
1562
1589
  /** One day after the unix epoch */
1563
1590
  static DAY = g.days(1);
1564
1591
  /** The maximum possible value for a timestamp */
1565
- static MAX = new g(ke);
1592
+ static MAX = new g(qe);
1566
1593
  /** The minimum possible value for a timestamp */
1567
1594
  static MIN = new g(0);
1568
1595
  /** The unix epoch */
@@ -1576,7 +1603,7 @@ let $ = class g extends re {
1576
1603
  a.bigint().transform((e) => new g(e)),
1577
1604
  a.date().transform((e) => new g(e)),
1578
1605
  a.custom((e) => e instanceof h).transform((e) => new g(e)),
1579
- oa.transform((e) => new g(e))
1606
+ sa.transform((e) => new g(e))
1580
1607
  ]);
1581
1608
  /**
1582
1609
  * Sorts two timestamps.
@@ -1590,7 +1617,7 @@ let $ = class g extends re {
1590
1617
  return Number(e.valueOf() - r.valueOf());
1591
1618
  }
1592
1619
  };
1593
- class h extends re {
1620
+ class h extends ne {
1594
1621
  constructor(e) {
1595
1622
  typeof e == "number" && (e = Math.trunc(e.valueOf())), B(e) && (e = e.value), super(BigInt(e.valueOf()));
1596
1623
  }
@@ -1601,7 +1628,7 @@ class h extends re {
1601
1628
  * @returns A TimeSpan representing the given number of seconds.
1602
1629
  */
1603
1630
  static fromSeconds(e) {
1604
- return e instanceof h ? e : e instanceof nt ? e.period : e instanceof $ ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.seconds(e) : new h(e));
1631
+ return e instanceof h ? e : e instanceof U ? e.period : e instanceof O ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.seconds(e) : new h(e));
1605
1632
  }
1606
1633
  /**
1607
1634
  * Creates a TimeSpan representing the given number of milliseconds.
@@ -1610,7 +1637,7 @@ class h extends re {
1610
1637
  * @returns A TimeSpan representing the given number of milliseconds.
1611
1638
  */
1612
1639
  static fromMilliseconds(e) {
1613
- return e instanceof h ? e : e instanceof nt ? e.period : e instanceof $ ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.milliseconds(e) : new h(e));
1640
+ return e instanceof h ? e : e instanceof U ? e.period : e instanceof O ? new h(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? h.milliseconds(e) : new h(e));
1614
1641
  }
1615
1642
  /**
1616
1643
  * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
@@ -1662,7 +1689,7 @@ class h extends re {
1662
1689
  * @returns A new TimeSpan representing the remainder.
1663
1690
  */
1664
1691
  remainder(e) {
1665
- return Zr(this, e);
1692
+ return kr(this, e);
1666
1693
  }
1667
1694
  /**
1668
1695
  * Truncates the TimeSpan to the nearest multiple of the given span.
@@ -1685,47 +1712,47 @@ class h extends re {
1685
1712
  */
1686
1713
  toString(e = "full") {
1687
1714
  if (e === "semantic") return this.toSemanticString();
1688
- const r = this.truncate(h.DAY), n = this.truncate(h.HOUR), s = this.truncate(h.MINUTE), i = this.truncate(h.SECOND), o = this.truncate(h.MILLISECOND), l = this.truncate(h.MICROSECOND), f = this.truncate(h.NANOSECOND), c = r, d = n.sub(r), m = s.sub(n), p = i.sub(s), A = o.sub(i), U = l.sub(o), j = f.sub(l);
1715
+ const r = this.truncate(h.DAY), n = this.truncate(h.HOUR), s = this.truncate(h.MINUTE), i = this.truncate(h.SECOND), o = this.truncate(h.MILLISECOND), l = this.truncate(h.MICROSECOND), f = this.truncate(h.NANOSECOND), c = r, d = n.sub(r), m = s.sub(n), p = i.sub(s), M = o.sub(i), E = l.sub(o), C = f.sub(l);
1689
1716
  let w = "";
1690
- return c.isZero || (w += `${c.days}d `), d.isZero || (w += `${d.hours}h `), m.isZero || (w += `${m.minutes}m `), p.isZero || (w += `${p.seconds}s `), A.isZero || (w += `${A.milliseconds}ms `), U.isZero || (w += `${U.microseconds}µs `), j.isZero || (w += `${j.nanoseconds}ns`), w.trim();
1717
+ return c.isZero || (w += `${c.days}d `), d.isZero || (w += `${d.hours}h `), m.isZero || (w += `${m.minutes}m `), p.isZero || (w += `${p.seconds}s `), M.isZero || (w += `${M.milliseconds}ms `), E.isZero || (w += `${E.microseconds}µs `), C.isZero || (w += `${C.nanoseconds}ns`), w.trim();
1691
1718
  }
1692
1719
  toSemanticString() {
1693
1720
  const e = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), r = new h(e), n = this.valueOf() < 0n;
1694
1721
  if (r.valueOf() === 0n) return "0s";
1695
1722
  if (r.lessThan(h.SECOND)) return "< 1s";
1696
- const s = r.days, i = r.hours, o = r.minutes, l = r.seconds, f = Math.floor(s / tr), c = Math.floor(s / Ie), d = Math.floor(s / 7), m = Math.floor(s), p = Math.floor(i), A = Math.floor(o), U = Math.floor(l), j = n ? "-" : "";
1723
+ const s = r.days, i = r.hours, o = r.minutes, l = r.seconds, f = Math.floor(s / Qt), c = Math.floor(s / Me), d = Math.floor(s / 7), m = Math.floor(s), p = Math.floor(i), M = Math.floor(o), E = Math.floor(l), C = n ? "-" : "";
1697
1724
  if (f >= 1) {
1698
1725
  let w = `${f}y`;
1699
1726
  if (f < 2) {
1700
1727
  const N = Math.floor(
1701
- s % tr / Ie
1728
+ s % Qt / Me
1702
1729
  );
1703
1730
  N > 0 && (w += ` ${N}mo`);
1704
1731
  }
1705
- return j + w;
1732
+ return C + w;
1706
1733
  }
1707
- if (d >= 1 && s < Ie && s % 7 === 0) {
1734
+ if (d >= 1 && s < Me && s % 7 === 0) {
1708
1735
  let w = `${d}w`;
1709
- const N = Math.floor(s % 7), K = Math.floor(i - d * 7 * 24);
1710
- return d < 2 && (N > 0 ? w += ` ${N}d` : K > 0 && K < 24 && (w += ` ${K}h`)), j + w;
1736
+ const N = Math.floor(s % 7), Q = Math.floor(i - d * 7 * 24);
1737
+ return d < 2 && (N > 0 ? w += ` ${N}d` : Q > 0 && Q < 24 && (w += ` ${Q}h`)), C + w;
1711
1738
  }
1712
1739
  if (c >= 1) {
1713
1740
  let w = `${c}mo`;
1714
1741
  if (c < 3) {
1715
- const N = Math.floor(s % Ie);
1742
+ const N = Math.floor(s % Me);
1716
1743
  N > 0 && (w += ` ${N}d`);
1717
1744
  }
1718
- return j + w;
1745
+ return C + w;
1719
1746
  }
1720
1747
  if (d >= 1) {
1721
1748
  let w = `${d}w`;
1722
- const N = Math.floor(s % 7), K = Math.floor(i - d * 7 * 24);
1723
- return d < 2 && (N > 0 ? w += ` ${N}d` : K > 0 && K < 24 && (w += ` ${K}h`)), j + w;
1749
+ const N = Math.floor(s % 7), Q = Math.floor(i - d * 7 * 24);
1750
+ return d < 2 && (N > 0 ? w += ` ${N}d` : Q > 0 && Q < 24 && (w += ` ${Q}h`)), C + w;
1724
1751
  }
1725
1752
  if (m >= 1) {
1726
1753
  let w = `${m}d`;
1727
1754
  const N = Math.floor(i - m * 24);
1728
- return m < 2 && N > 0 && (w += ` ${N}h`), j + w;
1755
+ return m < 2 && N > 0 && (w += ` ${N}h`), C + w;
1729
1756
  }
1730
1757
  if (p >= 1) {
1731
1758
  let w = `${p}h`;
@@ -1733,17 +1760,17 @@ class h extends re {
1733
1760
  const N = Math.floor(o - p * 60);
1734
1761
  N > 0 && (w += ` ${N}m`);
1735
1762
  }
1736
- return j + w;
1763
+ return C + w;
1737
1764
  }
1738
- if (A >= 1) {
1739
- let w = `${A}m`;
1740
- if (A < 5) {
1741
- const N = Math.floor(l - A * 60);
1765
+ if (M >= 1) {
1766
+ let w = `${M}m`;
1767
+ if (M < 5) {
1768
+ const N = Math.floor(l - M * 60);
1742
1769
  N > 0 && (w += ` ${N}s`);
1743
1770
  }
1744
- return j + w;
1771
+ return C + w;
1745
1772
  }
1746
- return `${j}${U}s`;
1773
+ return `${C}${E}s`;
1747
1774
  }
1748
1775
  /**
1749
1776
  * Multiplies the TimeSpan by a scalar value.
@@ -1752,7 +1779,7 @@ class h extends re {
1752
1779
  * @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
1753
1780
  */
1754
1781
  mult(e) {
1755
- return new h(R(this.valueOf(), e));
1782
+ return new h(j(this.valueOf(), e));
1756
1783
  }
1757
1784
  /**
1758
1785
  * Divides the TimeSpan by a scalar value.
@@ -1761,7 +1788,7 @@ class h extends re {
1761
1788
  * @returns A new TimeSpan that is this TimeSpan divided by the provided value.
1762
1789
  */
1763
1790
  div(e) {
1764
- return new h(Te(this.valueOf(), e));
1791
+ return new h(xe(this.valueOf(), e));
1765
1792
  }
1766
1793
  /** @returns the decimal number of days in the TimeSpan. */
1767
1794
  get days() {
@@ -1841,7 +1868,7 @@ class h extends re {
1841
1868
  * @returns A TimeSpan representing the given number of microseconds.
1842
1869
  */
1843
1870
  static microseconds(e = 1) {
1844
- return h.nanoseconds(R(e, 1e3));
1871
+ return h.nanoseconds(j(e, 1e3));
1845
1872
  }
1846
1873
  /** A microsecond. */
1847
1874
  static MICROSECOND = h.microseconds(1);
@@ -1852,7 +1879,7 @@ class h extends re {
1852
1879
  * @returns A TimeSpan representing the given number of milliseconds.
1853
1880
  */
1854
1881
  static milliseconds(e = 1) {
1855
- return h.microseconds(R(e, 1e3));
1882
+ return h.microseconds(j(e, 1e3));
1856
1883
  }
1857
1884
  /** A millisecond. */
1858
1885
  static MILLISECOND = h.milliseconds(1);
@@ -1863,7 +1890,7 @@ class h extends re {
1863
1890
  * @returns A TimeSpan representing the given number of seconds.
1864
1891
  */
1865
1892
  static seconds(e = 1) {
1866
- return h.milliseconds(R(e, 1e3));
1893
+ return h.milliseconds(j(e, 1e3));
1867
1894
  }
1868
1895
  /** A second. */
1869
1896
  static SECOND = h.seconds(1);
@@ -1874,7 +1901,7 @@ class h extends re {
1874
1901
  * @returns A TimeSpan representing the given number of minutes.
1875
1902
  */
1876
1903
  static minutes(e = 1) {
1877
- return h.seconds(R(e, 60));
1904
+ return h.seconds(j(e, 60));
1878
1905
  }
1879
1906
  /** A minute. */
1880
1907
  static MINUTE = h.minutes(1);
@@ -1885,7 +1912,7 @@ class h extends re {
1885
1912
  * @returns A TimeSpan representing the given number of hours.
1886
1913
  */
1887
1914
  static hours(e) {
1888
- return h.minutes(R(e, 60));
1915
+ return h.minutes(j(e, 60));
1889
1916
  }
1890
1917
  /** Represents an hour. */
1891
1918
  static HOUR = h.hours(1);
@@ -1896,12 +1923,12 @@ class h extends re {
1896
1923
  * @returns A TimeSpan representing the given number of days.
1897
1924
  */
1898
1925
  static days(e) {
1899
- return h.hours(R(e, 24));
1926
+ return h.hours(j(e, 24));
1900
1927
  }
1901
1928
  /** Represents a day. */
1902
1929
  static DAY = h.days(1);
1903
1930
  /** The maximum possible value for a TimeSpan. */
1904
- static MAX = new h(ke);
1931
+ static MAX = new h(qe);
1905
1932
  /** The minimum possible value for a TimeSpan. */
1906
1933
  static MIN = new h(0);
1907
1934
  /** The zero value for a TimeSpan. */
@@ -1913,11 +1940,11 @@ class h extends re {
1913
1940
  a.number().transform((e) => new h(e)),
1914
1941
  a.bigint().transform((e) => new h(e)),
1915
1942
  a.instanceof(h),
1916
- a.instanceof($).transform((e) => new h(e)),
1917
- a.custom((e) => e instanceof nt).transform((e) => new h(e))
1943
+ a.instanceof(O).transform((e) => new h(e)),
1944
+ a.custom((e) => e instanceof U).transform((e) => new h(e))
1918
1945
  ]);
1919
1946
  }
1920
- let nt = class C extends re {
1947
+ class U extends ne {
1921
1948
  constructor(e) {
1922
1949
  B(e) && (e = e.value), super(e.valueOf());
1923
1950
  }
@@ -1927,7 +1954,7 @@ let nt = class C extends re {
1927
1954
  }
1928
1955
  /** @returns The number of seconds in the Rate. */
1929
1956
  equals(e) {
1930
- return this.valueOf() === new C(e).valueOf();
1957
+ return this.valueOf() === new U(e).valueOf();
1931
1958
  }
1932
1959
  /**
1933
1960
  * Calculates the period of the Rate as a TimeSpan.
@@ -1954,7 +1981,7 @@ let nt = class C extends re {
1954
1981
  * @returns The number of bytes in the given TimeSpan at this rate.
1955
1982
  */
1956
1983
  byteCount(e, r) {
1957
- return this.sampleCount(e) * new M(r).valueOf();
1984
+ return this.sampleCount(e) * new $(r).valueOf();
1958
1985
  }
1959
1986
  /**
1960
1987
  * Calculates a TimeSpan given the number of samples at this rate.
@@ -1973,7 +2000,7 @@ let nt = class C extends re {
1973
2000
  * @returns A TimeSpan that corresponds to the given number of bytes.
1974
2001
  */
1975
2002
  byteSpan(e, r) {
1976
- return this.span(e.valueOf() / new M(r).valueOf());
2003
+ return this.span(e.valueOf() / new $(r).valueOf());
1977
2004
  }
1978
2005
  /**
1979
2006
  * Adds another Rate to this Rate.
@@ -1982,7 +2009,7 @@ let nt = class C extends re {
1982
2009
  * @returns A new Rate representing the sum of the two rates.
1983
2010
  */
1984
2011
  add(e) {
1985
- return new C(oe(this.valueOf(), new C(e).valueOf()));
2012
+ return new U(le(this.valueOf(), new U(e).valueOf()));
1986
2013
  }
1987
2014
  /**
1988
2015
  * Subtracts another Rate from this Rate.
@@ -1991,7 +2018,7 @@ let nt = class C extends re {
1991
2018
  * @returns A new Rate representing the difference of the two rates.
1992
2019
  */
1993
2020
  sub(e) {
1994
- return new C(Z(this.valueOf(), new C(e).valueOf()));
2021
+ return new U(z(this.valueOf(), new U(e).valueOf()));
1995
2022
  }
1996
2023
  /**
1997
2024
  * Multiplies this Rate by a scalar value.
@@ -2000,7 +2027,7 @@ let nt = class C extends re {
2000
2027
  * @returns A new Rate representing this Rate multiplied by the value.
2001
2028
  */
2002
2029
  mult(e) {
2003
- return new C(R(this.valueOf(), e));
2030
+ return new U(j(this.valueOf(), e));
2004
2031
  }
2005
2032
  /**
2006
2033
  * Divides this Rate by a scalar value.
@@ -2009,7 +2036,7 @@ let nt = class C extends re {
2009
2036
  * @returns A new Rate representing this Rate divided by the value.
2010
2037
  */
2011
2038
  div(e) {
2012
- return new C(Te(this.valueOf(), e));
2039
+ return new U(xe(this.valueOf(), e));
2013
2040
  }
2014
2041
  /**
2015
2042
  * Creates a Rate representing the given number of Hz.
@@ -2018,7 +2045,7 @@ let nt = class C extends re {
2018
2045
  * @returns A Rate representing the given number of Hz.
2019
2046
  */
2020
2047
  static hz(e) {
2021
- return new C(e);
2048
+ return new U(e);
2022
2049
  }
2023
2050
  /**
2024
2051
  * Creates a Rate representing the given number of kHz.
@@ -2027,14 +2054,15 @@ let nt = class C extends re {
2027
2054
  * @returns A Rate representing the given number of kHz.
2028
2055
  */
2029
2056
  static khz(e) {
2030
- return C.hz(e * 1e3);
2057
+ return U.hz(e * 1e3);
2031
2058
  }
2032
2059
  /** A zod schema for validating and transforming rates */
2033
2060
  static z = a.union([
2034
- a.number().transform((e) => new C(e)),
2035
- a.instanceof(C)
2061
+ a.number().transform((e) => new U(e)),
2062
+ a.instanceof(U)
2036
2063
  ]);
2037
- }, M = class E extends re {
2064
+ }
2065
+ class $ extends ne {
2038
2066
  /**
2039
2067
  * Creates a Density representing the given number of bytes per value.
2040
2068
  *
@@ -2061,7 +2089,7 @@ let nt = class C extends re {
2061
2089
  * @returns A Size representing the given number of values.
2062
2090
  */
2063
2091
  size(e) {
2064
- return new qe(e * this.valueOf());
2092
+ return new y(e * this.valueOf());
2065
2093
  }
2066
2094
  /**
2067
2095
  * Adds another Density to this Density.
@@ -2070,7 +2098,7 @@ let nt = class C extends re {
2070
2098
  * @returns A new Density representing the sum of the two densities.
2071
2099
  */
2072
2100
  add(e) {
2073
- return new E(oe(this.valueOf(), new E(e).valueOf()));
2101
+ return new $(le(this.valueOf(), new $(e).valueOf()));
2074
2102
  }
2075
2103
  /**
2076
2104
  * Subtracts another Density from this Density.
@@ -2079,7 +2107,7 @@ let nt = class C extends re {
2079
2107
  * @returns A new Density representing the difference of the two densities.
2080
2108
  */
2081
2109
  sub(e) {
2082
- return new E(Z(this.valueOf(), new E(e).valueOf()));
2110
+ return new $(z(this.valueOf(), new $(e).valueOf()));
2083
2111
  }
2084
2112
  /**
2085
2113
  * Multiplies this Density by a scalar value.
@@ -2088,7 +2116,7 @@ let nt = class C extends re {
2088
2116
  * @returns A new Density representing this Density multiplied by the value.
2089
2117
  */
2090
2118
  mult(e) {
2091
- return new E(R(this.valueOf(), e));
2119
+ return new $(j(this.valueOf(), e));
2092
2120
  }
2093
2121
  /**
2094
2122
  * Divides this Density by a scalar value.
@@ -2097,26 +2125,27 @@ let nt = class C extends re {
2097
2125
  * @returns A new Density representing this Density divided by the value.
2098
2126
  */
2099
2127
  div(e) {
2100
- return new E(Te(this.valueOf(), e));
2128
+ return new $(xe(this.valueOf(), e));
2101
2129
  }
2102
2130
  /** Unknown/Invalid Density. */
2103
- static UNKNOWN = new E(0);
2131
+ static UNKNOWN = new $(0);
2104
2132
  /** 128 bits per value. */
2105
- static BIT128 = new E(16);
2133
+ static BIT128 = new $(16);
2106
2134
  /** 64 bits per value. */
2107
- static BIT64 = new E(8);
2135
+ static BIT64 = new $(8);
2108
2136
  /** 32 bits per value. */
2109
- static BIT32 = new E(4);
2137
+ static BIT32 = new $(4);
2110
2138
  /** 16 bits per value. */
2111
- static BIT16 = new E(2);
2139
+ static BIT16 = new $(2);
2112
2140
  /** 8 bits per value. */
2113
- static BIT8 = new E(1);
2141
+ static BIT8 = new $(1);
2114
2142
  /** A zod schema for validating and transforming densities */
2115
2143
  static z = a.union([
2116
- a.number().transform((e) => new E(e)),
2117
- a.instanceof(E)
2144
+ a.number().transform((e) => new $(e)),
2145
+ a.instanceof($)
2118
2146
  ]);
2119
- }, Q = class k {
2147
+ }
2148
+ let _ = class P {
2120
2149
  /**
2121
2150
  * The starting TimeStamp of the TimeRange.
2122
2151
  *
@@ -2142,7 +2171,7 @@ let nt = class C extends re {
2142
2171
  * @param end - A TimeStamp representing the end of the range.
2143
2172
  */
2144
2173
  constructor(e, r) {
2145
- typeof e == "object" && "start" in e ? (this.start = new $(e.start), this.end = new $(e.end)) : (this.start = new $(e), this.end = new $(r));
2174
+ typeof e == "object" && "start" in e ? (this.start = new O(e.start), this.end = new O(e.end)) : (this.start = new O(e), this.end = new O(r));
2146
2175
  }
2147
2176
  /** @returns The TimeSpan occupied by the TimeRange. */
2148
2177
  get span() {
@@ -2184,7 +2213,7 @@ let nt = class C extends re {
2184
2213
  * @returns A TimeRange with the start and end swapped.
2185
2214
  */
2186
2215
  swap() {
2187
- return new k(this.end, this.start);
2216
+ return new P(this.end, this.start);
2188
2217
  }
2189
2218
  get numericBounds() {
2190
2219
  return {
@@ -2236,11 +2265,11 @@ let nt = class C extends re {
2236
2265
  const n = this.makeValid();
2237
2266
  if (this.equals(e)) return !0;
2238
2267
  if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
2239
- const s = $.max(n.start, e.start), i = $.min(n.end, e.end);
2268
+ const s = O.max(n.start, e.start), i = O.min(n.end, e.end);
2240
2269
  return i.before(s) ? !1 : new h(i.sub(s)).greaterThanOrEqual(r);
2241
2270
  }
2242
2271
  contains(e) {
2243
- return e instanceof k ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2272
+ return e instanceof P ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2244
2273
  }
2245
2274
  /**
2246
2275
  * Returns a new TimeRange that is bound by the given TimeRange.
@@ -2254,23 +2283,23 @@ let nt = class C extends re {
2254
2283
  * console.log(bounded); // TimeRange(1500, 2000)
2255
2284
  */
2256
2285
  boundBy(e) {
2257
- const r = new k(this.start, this.end);
2286
+ const r = new P(this.start, this.end);
2258
2287
  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;
2259
2288
  }
2260
2289
  static max(...e) {
2261
- return new k(
2262
- $.min(...e.map((r) => r.start)),
2263
- $.max(...e.map((r) => r.end))
2290
+ return new P(
2291
+ O.min(...e.map((r) => r.start)),
2292
+ O.max(...e.map((r) => r.end))
2264
2293
  );
2265
2294
  }
2266
2295
  /** The maximum possible time range. */
2267
- static MAX = new k($.MIN, $.MAX);
2296
+ static MAX = new P(O.MIN, O.MAX);
2268
2297
  /** A time range whose start and end are both zero. */
2269
- static ZERO = new k($.ZERO, $.ZERO);
2298
+ static ZERO = new P(O.ZERO, O.ZERO);
2270
2299
  /** A zod schema for validating and transforming time ranges */
2271
2300
  static z = a.union([
2272
- a.object({ start: $.z, end: $.z }).transform((e) => new k(e.start, e.end)),
2273
- a.instanceof(k)
2301
+ a.object({ start: O.z, end: O.z }).transform((e) => new P(e.start, e.end)),
2302
+ a.instanceof(P)
2274
2303
  ]);
2275
2304
  /**
2276
2305
  * Sorts two time ranges. The range with the earlier start time is considered less than
@@ -2284,7 +2313,7 @@ let nt = class C extends re {
2284
2313
  * equal.
2285
2314
  */
2286
2315
  static sort(e, r) {
2287
- return $.sort(e.start, r.start) || $.sort(e.end, r.end);
2316
+ return O.sort(e.start, r.start) || O.sort(e.end, r.end);
2288
2317
  }
2289
2318
  /**
2290
2319
  * Simplify takes the list of `TimeRange`s, makes all of them valid, sorts them, and
@@ -2294,15 +2323,15 @@ let nt = class C extends re {
2294
2323
  * @returns A list of simplified `TimeRange`s.
2295
2324
  */
2296
2325
  static simplify(e) {
2297
- return e.map((r) => r.makeValid()).sort((r, n) => k.sort(r, n)).reduce((r, n) => {
2326
+ return e.map((r) => r.makeValid()).sort((r, n) => P.sort(r, n)).reduce((r, n) => {
2298
2327
  if (n.span.isZero) return r;
2299
2328
  if (r.length === 0)
2300
2329
  return r.push(n), r;
2301
2330
  const s = r[r.length - 1];
2302
- return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = $.max(s.end, n.end) : r.push(n), r;
2331
+ return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = O.max(s.end, n.end) : r.push(n), r;
2303
2332
  }, []);
2304
2333
  }
2305
- }, S = class u extends re {
2334
+ }, I = class u extends ne {
2306
2335
  constructor(e) {
2307
2336
  if (B(e) && (e = e.value), e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
2308
2337
  super(e.valueOf());
@@ -2482,20 +2511,20 @@ let nt = class C extends re {
2482
2511
  [BigInt64Array.name, u.INT64]
2483
2512
  ]);
2484
2513
  static DENSITIES = /* @__PURE__ */ new Map([
2485
- [u.UINT8.toString(), M.BIT8],
2486
- [u.UINT16.toString(), M.BIT16],
2487
- [u.UINT32.toString(), M.BIT32],
2488
- [u.UINT64.toString(), M.BIT64],
2489
- [u.FLOAT32.toString(), M.BIT32],
2490
- [u.FLOAT64.toString(), M.BIT64],
2491
- [u.INT8.toString(), M.BIT8],
2492
- [u.INT16.toString(), M.BIT16],
2493
- [u.INT32.toString(), M.BIT32],
2494
- [u.INT64.toString(), M.BIT64],
2495
- [u.TIMESTAMP.toString(), M.BIT64],
2496
- [u.STRING.toString(), M.UNKNOWN],
2497
- [u.JSON.toString(), M.UNKNOWN],
2498
- [u.UUID.toString(), M.BIT128]
2514
+ [u.UINT8.toString(), $.BIT8],
2515
+ [u.UINT16.toString(), $.BIT16],
2516
+ [u.UINT32.toString(), $.BIT32],
2517
+ [u.UINT64.toString(), $.BIT64],
2518
+ [u.FLOAT32.toString(), $.BIT32],
2519
+ [u.FLOAT64.toString(), $.BIT64],
2520
+ [u.INT8.toString(), $.BIT8],
2521
+ [u.INT16.toString(), $.BIT16],
2522
+ [u.INT32.toString(), $.BIT32],
2523
+ [u.INT64.toString(), $.BIT64],
2524
+ [u.TIMESTAMP.toString(), $.BIT64],
2525
+ [u.STRING.toString(), $.UNKNOWN],
2526
+ [u.JSON.toString(), $.UNKNOWN],
2527
+ [u.UUID.toString(), $.BIT128]
2499
2528
  ]);
2500
2529
  /** All the data types. */
2501
2530
  static ALL = [
@@ -2538,7 +2567,8 @@ let nt = class C extends re {
2538
2567
  a.string().transform((e) => new u(e)),
2539
2568
  a.instanceof(u)
2540
2569
  ]);
2541
- }, qe = class y extends re {
2570
+ };
2571
+ class y extends ne {
2542
2572
  constructor(e) {
2543
2573
  B(e) && (e = e.value), super(e.valueOf());
2544
2574
  }
@@ -2552,11 +2582,11 @@ let nt = class C extends re {
2552
2582
  }
2553
2583
  /** @returns a new Size representing the sum of the two Sizes. */
2554
2584
  add(e) {
2555
- return B(e) && (e = e.value), new y(oe(this.valueOf(), e.valueOf()));
2585
+ return B(e) && (e = e.value), new y(le(this.valueOf(), e.valueOf()));
2556
2586
  }
2557
2587
  /** @returns a new Size representing the difference of the two Sizes. */
2558
2588
  sub(e) {
2559
- return B(e) && (e = e.value), new y(Z(this.valueOf(), e.valueOf()));
2589
+ return B(e) && (e = e.value), new y(z(this.valueOf(), e.valueOf()));
2560
2590
  }
2561
2591
  /**
2562
2592
  * Multiplies this Size by a scalar value.
@@ -2565,7 +2595,7 @@ let nt = class C extends re {
2565
2595
  * @returns A new Size representing this Size multiplied by the value.
2566
2596
  */
2567
2597
  mult(e) {
2568
- return new y(R(this.valueOf(), e));
2598
+ return new y(j(this.valueOf(), e));
2569
2599
  }
2570
2600
  /**
2571
2601
  * Divides this Size by a scalar value.
@@ -2574,7 +2604,7 @@ let nt = class C extends re {
2574
2604
  * @returns A new Size representing this Size divided by the value.
2575
2605
  */
2576
2606
  div(e) {
2577
- return new y(Te(this.valueOf(), e));
2607
+ return new y(xe(this.valueOf(), e));
2578
2608
  }
2579
2609
  /** @returns a new Size representing the truncated value of the Size. */
2580
2610
  truncate(e) {
@@ -2674,12 +2704,12 @@ let nt = class C extends re {
2674
2704
  get isZero() {
2675
2705
  return this.valueOf() === 0;
2676
2706
  }
2677
- };
2707
+ }
2678
2708
  a.object({
2679
2709
  start: a.number(),
2680
2710
  end: a.number()
2681
2711
  });
2682
- const Uu = a.union([
2712
+ const Au = a.union([
2683
2713
  a.instanceof(Uint8Array),
2684
2714
  a.instanceof(Uint16Array),
2685
2715
  a.instanceof(Uint32Array),
@@ -2690,65 +2720,65 @@ const Uu = a.union([
2690
2720
  a.instanceof(Int16Array),
2691
2721
  a.instanceof(Int32Array),
2692
2722
  a.instanceof(BigInt64Array)
2693
- ]), Fr = (t) => {
2723
+ ]), qr = (t) => {
2694
2724
  const e = typeof t;
2695
- return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof $ || t instanceof h || t instanceof Date;
2696
- }, ua = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : je(r, -n), je = (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), la = "00000000-0000-0000-0000-000000000000", ca = /^(?:[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;
2697
- function ha(t) {
2698
- return typeof t == "string" && ca.test(t);
2725
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof O || t instanceof h || t instanceof Date;
2726
+ }, ia = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Re(r, -n), Re = (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), aa = "00000000-0000-0000-0000-000000000000", oa = /^(?:[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;
2727
+ function ua(t) {
2728
+ return typeof t == "string" && oa.test(t);
2699
2729
  }
2700
- const I = [];
2730
+ const A = [];
2701
2731
  for (let t = 0; t < 256; ++t)
2702
- I.push((t + 256).toString(16).slice(1));
2703
- function Yr(t, e = 0) {
2704
- return (I[t[e + 0]] + I[t[e + 1]] + I[t[e + 2]] + I[t[e + 3]] + "-" + I[t[e + 4]] + I[t[e + 5]] + "-" + I[t[e + 6]] + I[t[e + 7]] + "-" + I[t[e + 8]] + I[t[e + 9]] + "-" + I[t[e + 10]] + I[t[e + 11]] + I[t[e + 12]] + I[t[e + 13]] + I[t[e + 14]] + I[t[e + 15]]).toLowerCase();
2732
+ A.push((t + 256).toString(16).slice(1));
2733
+ function zr(t, e = 0) {
2734
+ return (A[t[e + 0]] + A[t[e + 1]] + A[t[e + 2]] + A[t[e + 3]] + "-" + A[t[e + 4]] + A[t[e + 5]] + "-" + A[t[e + 6]] + A[t[e + 7]] + "-" + A[t[e + 8]] + A[t[e + 9]] + "-" + A[t[e + 10]] + A[t[e + 11]] + A[t[e + 12]] + A[t[e + 13]] + A[t[e + 14]] + A[t[e + 15]]).toLowerCase();
2705
2735
  }
2706
- function fa(t, e = 0) {
2707
- const r = Yr(t, e);
2708
- if (!ha(r))
2736
+ function la(t, e = 0) {
2737
+ const r = zr(t, e);
2738
+ if (!ua(r))
2709
2739
  throw TypeError("Stringified UUID is invalid");
2710
2740
  return r;
2711
2741
  }
2712
- let st;
2713
- const da = new Uint8Array(16);
2714
- function ga() {
2715
- if (!st) {
2742
+ let tt;
2743
+ const ca = new Uint8Array(16);
2744
+ function ha() {
2745
+ if (!tt) {
2716
2746
  if (typeof crypto > "u" || !crypto.getRandomValues)
2717
2747
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2718
- st = crypto.getRandomValues.bind(crypto);
2748
+ tt = crypto.getRandomValues.bind(crypto);
2719
2749
  }
2720
- return st(da);
2750
+ return tt(ca);
2721
2751
  }
2722
- const pa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), rr = { randomUUID: pa };
2723
- function ma(t, e, r) {
2752
+ const fa = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), _t = { randomUUID: fa };
2753
+ function da(t, e, r) {
2724
2754
  t = t || {};
2725
- const n = t.random ?? t.rng?.() ?? ga();
2755
+ const n = t.random ?? t.rng?.() ?? ha();
2726
2756
  if (n.length < 16)
2727
2757
  throw new Error("Random bytes length must be >= 16");
2728
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Yr(n);
2758
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, zr(n);
2729
2759
  }
2730
- function ya(t, e, r) {
2731
- return rr.randomUUID && !t ? rr.randomUUID() : ma(t);
2760
+ function ga(t, e, r) {
2761
+ return _t.randomUUID && !t ? _t.randomUUID() : da(t);
2732
2762
  }
2733
- const ba = () => ya(), Xt = (t, e) => fa(t, e), wa = la, Bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2763
+ const pa = () => ga(), Wt = (t, e) => la(t, e), ma = aa, Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2734
2764
  __proto__: null,
2735
- ZERO: wa,
2736
- create: ba,
2737
- parse: Xt
2738
- }, Symbol.toStringTag, { value: "Module" })), Y = -1, $t = {
2739
- [Symbol.iterator]: () => $t,
2765
+ ZERO: ma,
2766
+ create: pa,
2767
+ parse: Wt
2768
+ }, Symbol.toStringTag, { value: "Module" })), F = -1, yt = {
2769
+ [Symbol.iterator]: () => yt,
2740
2770
  next: () => ({ done: !0, value: void 0 })
2741
- }, $a = a.string().transform(
2771
+ }, ya = a.string().transform(
2742
2772
  (t) => new Uint8Array(
2743
2773
  atob(t).split("").map((e) => e.charCodeAt(0))
2744
2774
  ).buffer
2745
- ), Oa = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), Ot = 10, Vr = (t, e) => {
2775
+ ), ba = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), bt = 10, Zr = (t, e) => {
2746
2776
  if (t === "number" && !e.isNumeric)
2747
2777
  throw new Error(`cannot convert series of type ${e.toString()} to number`);
2748
2778
  if (t === "bigint" && !e.usesBigInt)
2749
2779
  throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
2750
- }, Wr = "sy_x_telem_series";
2751
- let Gr = class V {
2780
+ }, Fr = "sy_x_telem_series";
2781
+ let Yr = class Y {
2752
2782
  /**
2753
2783
  * A unique identifier for the series. If specified by the user, it is their
2754
2784
  * responsibility to ensure that it is unique. If not specified, a new ID will be
@@ -2759,7 +2789,7 @@ let Gr = class V {
2759
2789
  * A discriminator used for identifying instances of the series class even
2760
2790
  * when bundlers mangle the class name.
2761
2791
  */
2762
- discriminator = Wr;
2792
+ discriminator = Fr;
2763
2793
  /** The data type of the series. */
2764
2794
  dataType;
2765
2795
  /**
@@ -2775,7 +2805,7 @@ let Gr = class V {
2775
2805
  /** The underlying data. */
2776
2806
  _data;
2777
2807
  /** The time range occupied by the series' data. */
2778
- timeRange = Q.ZERO;
2808
+ timeRange = _.ZERO;
2779
2809
  /**
2780
2810
  * Alignment defines the location of the series relative to other series in a logical
2781
2811
  * group. Useful for defining the position of the series within a channel's data.
@@ -2792,7 +2822,7 @@ let Gr = class V {
2792
2822
  /** A cached maximum value. */
2793
2823
  cachedMax;
2794
2824
  /** The write position of the buffer. */
2795
- writePos = Y;
2825
+ writePos = F;
2796
2826
  /** Tracks the number of entities currently using this array. */
2797
2827
  _refCount = 0;
2798
2828
  /** Caches the length of the array for variable length data types. */
@@ -2804,22 +2834,22 @@ let Gr = class V {
2804
2834
  * can be constructed into a series.
2805
2835
  */
2806
2836
  static crudeZ = a.object({
2807
- timeRange: Q.z.optional(),
2808
- dataType: S.z,
2837
+ timeRange: _.z.optional(),
2838
+ dataType: I.z,
2809
2839
  alignment: a.coerce.bigint().optional(),
2810
2840
  data: a.union([
2811
- $a,
2812
- Oa,
2841
+ ya,
2842
+ ba,
2813
2843
  a.instanceof(ArrayBuffer),
2814
2844
  a.instanceof(Uint8Array)
2815
2845
  ]),
2816
- glBufferUsage: Gi.optional().default("static").optional()
2846
+ glBufferUsage: Yi.optional().default("static").optional()
2817
2847
  });
2818
2848
  /**
2819
2849
  * A zod schema that validates and constructs a series from it's crude
2820
2850
  * representation.
2821
2851
  */
2822
- static z = V.crudeZ.transform((e) => new V(e));
2852
+ static z = Y.crudeZ.transform((e) => new Y(e));
2823
2853
  /**
2824
2854
  * The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
2825
2855
  *
@@ -2894,7 +2924,7 @@ let Gr = class V {
2894
2924
  * @throws Error if data type cannot be inferred from input
2895
2925
  */
2896
2926
  constructor(e) {
2897
- va(e) && (e = { data: e }), e.data ??= [];
2927
+ wa(e) && (e = { data: e }), e.data ??= [];
2898
2928
  const {
2899
2929
  dataType: r,
2900
2930
  timeRange: n,
@@ -2902,16 +2932,16 @@ let Gr = class V {
2902
2932
  glBufferUsage: i = "static",
2903
2933
  alignment: o = 0n,
2904
2934
  alignmentMultiple: l = 1n,
2905
- key: f = Ht(),
2935
+ key: f = Vt(),
2906
2936
  data: c
2907
2937
  } = e;
2908
- if (Hr(c)) {
2938
+ if (Vr(c)) {
2909
2939
  const p = c;
2910
2940
  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;
2911
2941
  return;
2912
2942
  }
2913
- const d = Fr(c), m = Array.isArray(c);
2914
- if (r != null) this.dataType = new S(r);
2943
+ const d = qr(c), m = Array.isArray(c);
2944
+ if (r != null) this.dataType = new I(r);
2915
2945
  else {
2916
2946
  if (c instanceof ArrayBuffer)
2917
2947
  throw new Error(
@@ -2926,38 +2956,38 @@ let Gr = class V {
2926
2956
  );
2927
2957
  p = c[0];
2928
2958
  }
2929
- if (typeof p == "string") this.dataType = S.STRING;
2930
- else if (typeof p == "number") this.dataType = S.FLOAT64;
2931
- else if (typeof p == "bigint") this.dataType = S.INT64;
2932
- else if (typeof p == "boolean") this.dataType = S.BOOLEAN;
2933
- else if (p instanceof $ || p instanceof Date || p instanceof $)
2934
- this.dataType = S.TIMESTAMP;
2935
- else if (typeof p == "object") this.dataType = S.JSON;
2959
+ if (typeof p == "string") this.dataType = I.STRING;
2960
+ else if (typeof p == "number") this.dataType = I.FLOAT64;
2961
+ else if (typeof p == "bigint") this.dataType = I.INT64;
2962
+ else if (typeof p == "boolean") this.dataType = I.BOOLEAN;
2963
+ else if (p instanceof O || p instanceof Date || p instanceof O)
2964
+ this.dataType = I.TIMESTAMP;
2965
+ else if (typeof p == "object") this.dataType = I.JSON;
2936
2966
  else
2937
2967
  throw new Error(
2938
2968
  `cannot infer data type of ${typeof p} when constructing a Series from a JS array`
2939
2969
  );
2940
- } else this.dataType = new S(c);
2970
+ } else this.dataType = new I(c);
2941
2971
  }
2942
2972
  if (!m && !d) this._data = c;
2943
2973
  else if (m && c.length === 0)
2944
2974
  this._data = new this.dataType.Array([]).buffer;
2945
2975
  else {
2946
2976
  let p = d ? [c] : c;
2947
- const A = p[0];
2948
- (A instanceof $ || A instanceof Date || A instanceof h) && (p = p.map((U) => new $(U).valueOf())), this.dataType.equals(S.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2977
+ const M = p[0];
2978
+ (M instanceof O || M instanceof Date || M instanceof h) && (p = p.map((E) => new O(E).valueOf())), this.dataType.equals(I.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2949
2979
  `)}
2950
- `).buffer) : this.dataType.equals(S.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2951
- `${p.map((U) => lt.encodeString(U)).join(`
2980
+ `).buffer) : this.dataType.equals(I.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2981
+ `${p.map((E) => at.encodeString(E)).join(`
2952
2982
  `)}
2953
2983
  `
2954
- ).buffer) : this.dataType.usesBigInt && typeof A == "number" ? this._data = new this.dataType.Array(
2955
- p.map((U) => BigInt(Math.round(U)))
2956
- ).buffer : !this.dataType.usesBigInt && typeof A == "bigint" ? this._data = new this.dataType.Array(
2984
+ ).buffer) : this.dataType.usesBigInt && typeof M == "number" ? this._data = new this.dataType.Array(
2985
+ p.map((E) => BigInt(Math.round(E)))
2986
+ ).buffer : !this.dataType.usesBigInt && typeof M == "bigint" ? this._data = new this.dataType.Array(
2957
2987
  p.map(Number)
2958
2988
  ).buffer : this._data = new this.dataType.Array(p).buffer;
2959
2989
  }
2960
- this.key = f, this.alignment = o, this.alignmentMultiple = l, this.sampleOffset = s ?? 0, this.timeRange = n ?? Q.ZERO, this.gl = {
2990
+ this.key = f, this.alignment = o, this.alignmentMultiple = l, this.sampleOffset = s ?? 0, this.timeRange = n ?? _.ZERO, this.gl = {
2961
2991
  control: null,
2962
2992
  buffer: null,
2963
2993
  prevBuffer: 0,
@@ -2974,7 +3004,7 @@ let Gr = class V {
2974
3004
  static alloc({ capacity: e, dataType: r, ...n }) {
2975
3005
  if (e === 0)
2976
3006
  throw new Error("[Series] - cannot allocate an array of length 0");
2977
- const s = new new S(r).Array(e), i = new V({ data: s.buffer, dataType: r, ...n });
3007
+ const s = new new I(r).Array(e), i = new Y({ data: s.buffer, dataType: r, ...n });
2978
3008
  return i.writePos = 0, i;
2979
3009
  }
2980
3010
  /**
@@ -3017,12 +3047,12 @@ let Gr = class V {
3017
3047
  return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
3018
3048
  }
3019
3049
  writeVariable(e) {
3020
- if (this.writePos === Y) return 0;
3050
+ if (this.writePos === F) return 0;
3021
3051
  const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
3022
3052
  return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
3023
3053
  }
3024
3054
  writeFixed(e) {
3025
- if (this.writePos === Y) return 0;
3055
+ if (this.writePos === F) return 0;
3026
3056
  const r = this.capacity - this.writePos, n = e.sub(0, r);
3027
3057
  return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
3028
3058
  }
@@ -3045,7 +3075,7 @@ let Gr = class V {
3045
3075
  * @returns A typed array containing the series data.
3046
3076
  */
3047
3077
  get data() {
3048
- return this.writePos === Y ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
3078
+ return this.writePos === F ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
3049
3079
  }
3050
3080
  /**
3051
3081
  * Returns an array of the values in the series as strings.
@@ -3064,16 +3094,16 @@ let Gr = class V {
3064
3094
  * @returns An array of values parsed from the JSON series.
3065
3095
  */
3066
3096
  parseJSON(e) {
3067
- if (!this.dataType.equals(S.JSON))
3097
+ if (!this.dataType.equals(I.JSON))
3068
3098
  throw new Error("cannot parse non-JSON series as JSON");
3069
- return this.toStrings().map((r) => e.parse(lt.decodeString(r)));
3099
+ return this.toStrings().map((r) => e.parse(at.decodeString(r)));
3070
3100
  }
3071
3101
  /**
3072
3102
  * Returns the capacity of the series in bytes.
3073
3103
  * @returns The size of the underlying buffer in bytes.
3074
3104
  */
3075
3105
  get byteCapacity() {
3076
- return new qe(this.underlyingData.byteLength);
3106
+ return new y(this.underlyingData.byteLength);
3077
3107
  }
3078
3108
  /**
3079
3109
  * Returns the capacity of the series in samples.
@@ -3089,7 +3119,7 @@ let Gr = class V {
3089
3119
  * @returns The size of the data in bytes.
3090
3120
  */
3091
3121
  get byteLength() {
3092
- return this.writePos === Y ? this.byteCapacity : this.dataType.isVariable ? new qe(this.writePos) : this.dataType.density.size(this.writePos);
3122
+ return this.writePos === F ? this.byteCapacity : this.dataType.isVariable ? new y(this.writePos) : this.dataType.density.size(this.writePos);
3093
3123
  }
3094
3124
  /**
3095
3125
  * Returns the number of samples in this array.
@@ -3097,7 +3127,7 @@ let Gr = class V {
3097
3127
  * @returns The number of samples in the series.
3098
3128
  */
3099
3129
  get length() {
3100
- return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === Y ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
3130
+ return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === F ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
3101
3131
  }
3102
3132
  calculateCachedLength() {
3103
3133
  if (!this.dataType.isVariable)
@@ -3105,7 +3135,7 @@ let Gr = class V {
3105
3135
  let e = 0;
3106
3136
  const r = [0];
3107
3137
  return this.data.forEach((n, s) => {
3108
- n === Ot && (e++, r.push(s + 1));
3138
+ n === bt && (e++, r.push(s + 1));
3109
3139
  }), this._cachedIndexes = r, this.cachedLength = e, e;
3110
3140
  }
3111
3141
  /**
@@ -3121,8 +3151,8 @@ let Gr = class V {
3121
3151
  if (this.dataType.equals(e)) return this;
3122
3152
  const n = new e.Array(this.length);
3123
3153
  for (let s = 0; s < this.length; s++)
3124
- n[s] = ua(this.dataType, e, this.data[s], r);
3125
- return new V({
3154
+ n[s] = ia(this.dataType, e, this.data[s], r);
3155
+ return new Y({
3126
3156
  data: n.buffer,
3127
3157
  dataType: e,
3128
3158
  timeRange: this.timeRange,
@@ -3133,7 +3163,7 @@ let Gr = class V {
3133
3163
  }
3134
3164
  calcRawMax() {
3135
3165
  if (this.length === 0) return -1 / 0;
3136
- if (this.dataType.equals(S.TIMESTAMP))
3166
+ if (this.dataType.equals(I.TIMESTAMP))
3137
3167
  this.cachedMax = this.data[this.data.length - 1];
3138
3168
  else if (this.dataType.usesBigInt) {
3139
3169
  const e = this.data;
@@ -3151,11 +3181,11 @@ let Gr = class V {
3151
3181
  calcMax() {
3152
3182
  if (this.dataType.isVariable)
3153
3183
  throw new Error("cannot calculate maximum on a variable length data type");
3154
- return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), je(this.cachedMax, this.sampleOffset));
3184
+ return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Re(this.cachedMax, this.sampleOffset));
3155
3185
  }
3156
3186
  calcRawMin() {
3157
3187
  if (this.length === 0) return 1 / 0;
3158
- if (this.dataType.equals(S.TIMESTAMP)) this.cachedMin = this.data[0];
3188
+ if (this.dataType.equals(I.TIMESTAMP)) this.cachedMin = this.data[0];
3159
3189
  else if (this.dataType.usesBigInt) {
3160
3190
  const e = this.data;
3161
3191
  this.cachedMin = e.reduce((r, n) => r < n ? r : n);
@@ -3172,7 +3202,7 @@ let Gr = class V {
3172
3202
  calcMin() {
3173
3203
  if (this.dataType.isVariable)
3174
3204
  throw new Error("cannot calculate minimum on a variable length data type");
3175
- return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), je(this.cachedMin, this.sampleOffset));
3205
+ return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Re(this.cachedMin, this.sampleOffset));
3176
3206
  }
3177
3207
  /** @returns the bounds of the series. */
3178
3208
  get bounds() {
@@ -3198,18 +3228,18 @@ let Gr = class V {
3198
3228
  }
3199
3229
  at(e, r = !1) {
3200
3230
  if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
3201
- if (this.dataType.equals(S.UUID)) return this.atUUID(e, r);
3231
+ if (this.dataType.equals(I.UUID)) return this.atUUID(e, r);
3202
3232
  e < 0 && (e = this.length + e);
3203
3233
  const n = this.data[e];
3204
3234
  if (n == null) {
3205
3235
  if (r === !0) throw new Error(`[series] - no value at index ${e}`);
3206
3236
  return;
3207
3237
  }
3208
- return je(n, this.sampleOffset);
3238
+ return Re(n, this.sampleOffset);
3209
3239
  }
3210
3240
  atUUID(e, r) {
3211
3241
  e < 0 && (e = this.length + e);
3212
- const n = Xt(
3242
+ const n = Wt(
3213
3243
  new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
3214
3244
  );
3215
3245
  if (n == null) {
@@ -3225,7 +3255,7 @@ let Gr = class V {
3225
3255
  else {
3226
3256
  e < 0 && (e = this.length + e);
3227
3257
  for (let o = 0; o < this.data.length; o++)
3228
- if (this.data[o] === Ot) {
3258
+ if (this.data[o] === bt) {
3229
3259
  if (e === 0) {
3230
3260
  s = o;
3231
3261
  break;
@@ -3238,7 +3268,7 @@ let Gr = class V {
3238
3268
  }
3239
3269
  }
3240
3270
  const i = this.data.slice(n, s);
3241
- return this.dataType.equals(S.STRING) ? new TextDecoder().decode(i) : Nt(JSON.parse(new TextDecoder().decode(i)));
3271
+ return this.dataType.equals(I.STRING) ? new TextDecoder().decode(i) : Tt(JSON.parse(new TextDecoder().decode(i)));
3242
3272
  }
3243
3273
  /**
3244
3274
  * @returns the index of the first sample that is greater than or equal to the given value.
@@ -3247,7 +3277,7 @@ let Gr = class V {
3247
3277
  */
3248
3278
  binarySearch(e) {
3249
3279
  let r = 0, n = this.length - 1;
3250
- const s = Mt(e);
3280
+ const s = St(e);
3251
3281
  for (; r <= n; ) {
3252
3282
  const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
3253
3283
  if (o === 0) return i;
@@ -3263,11 +3293,11 @@ let Gr = class V {
3263
3293
  * be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
3264
3294
  */
3265
3295
  updateGLBuffer(e) {
3266
- if (this.gl.control = e, !this.dataType.equals(S.FLOAT32) && !this.dataType.equals(S.UINT8))
3296
+ if (this.gl.control = e, !this.dataType.equals(I.FLOAT32) && !this.dataType.equals(I.UINT8))
3267
3297
  throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
3268
3298
  const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
3269
3299
  if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
3270
- if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== Y) {
3300
+ if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== F) {
3271
3301
  s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
3272
3302
  const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
3273
3303
  e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
@@ -3276,10 +3306,10 @@ let Gr = class V {
3276
3306
  e.ARRAY_BUFFER,
3277
3307
  this.buffer,
3278
3308
  n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
3279
- ), this.gl.prevBuffer = Y;
3309
+ ), this.gl.prevBuffer = F;
3280
3310
  }
3281
3311
  as(e) {
3282
- return Vr(e, this.dataType), this;
3312
+ return Zr(e, this.dataType), this;
3283
3313
  }
3284
3314
  /** @returns a digest containing information about the series. */
3285
3315
  get digest() {
@@ -3288,8 +3318,8 @@ let Gr = class V {
3288
3318
  dataType: this.dataType.toString(),
3289
3319
  sampleOffset: this.sampleOffset,
3290
3320
  alignment: {
3291
- lower: sr(this.alignmentBounds.lower),
3292
- upper: sr(this.alignmentBounds.upper),
3321
+ lower: tr(this.alignmentBounds.lower),
3322
+ upper: tr(this.alignmentBounds.upper),
3293
3323
  multiple: this.alignmentMultiple
3294
3324
  },
3295
3325
  timeRange: this.timeRange.toString(),
@@ -3327,10 +3357,10 @@ let Gr = class V {
3327
3357
  }
3328
3358
  [Symbol.iterator]() {
3329
3359
  if (this.dataType.isVariable) {
3330
- const e = new Ta(this);
3331
- return this.dataType.equals(S.JSON) ? new xa(e) : e;
3360
+ const e = new $a(this);
3361
+ return this.dataType.equals(I.JSON) ? new Oa(e) : e;
3332
3362
  }
3333
- return this.dataType.equals(S.UUID) ? new Sa(this) : new Na(this);
3363
+ return this.dataType.equals(I.UUID) ? new va(this) : new Ta(this);
3334
3364
  }
3335
3365
  /**
3336
3366
  * Returns a slice of the series from start to end.
@@ -3357,7 +3387,7 @@ let Gr = class V {
3357
3387
  * @returns An iterator over the specified range.
3358
3388
  */
3359
3389
  subIterator(e, r) {
3360
- return new nr(this, e, r ?? this.length);
3390
+ return new er(this, e, r ?? this.length);
3361
3391
  }
3362
3392
  /**
3363
3393
  * Returns an iterator over a portion of the series based on alignment.
@@ -3371,12 +3401,12 @@ let Gr = class V {
3371
3401
  ), s = Math.ceil(
3372
3402
  Number(r - this.alignment) / Number(this.alignmentMultiple)
3373
3403
  );
3374
- return new nr(this, n, s);
3404
+ return new er(this, n, s);
3375
3405
  }
3376
3406
  subBytes(e, r) {
3377
3407
  if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
3378
3408
  const n = this.data.subarray(e, r);
3379
- return new V({
3409
+ return new Y({
3380
3410
  data: n,
3381
3411
  dataType: this.dataType,
3382
3412
  timeRange: this.timeRange,
@@ -3388,7 +3418,7 @@ let Gr = class V {
3388
3418
  sliceSub(e, r, n) {
3389
3419
  if (r <= 0 && (n == null || n >= this.length)) return this;
3390
3420
  let s;
3391
- return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new V({
3421
+ return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new Y({
3392
3422
  data: s,
3393
3423
  dataType: this.dataType,
3394
3424
  timeRange: this.timeRange,
@@ -3403,10 +3433,10 @@ let Gr = class V {
3403
3433
  * @returns A new series with the specified alignment.
3404
3434
  */
3405
3435
  reAlign(e) {
3406
- return new V({
3436
+ return new Y({
3407
3437
  data: this.buffer,
3408
3438
  dataType: this.dataType,
3409
- timeRange: Q.ZERO,
3439
+ timeRange: _.ZERO,
3410
3440
  sampleOffset: this.sampleOffset,
3411
3441
  glBufferUsage: "static",
3412
3442
  alignment: e
@@ -3430,20 +3460,21 @@ let Gr = class V {
3430
3460
  return e += "])", e;
3431
3461
  }
3432
3462
  };
3433
- const va = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Gr ? !0 : Fr(t), Hr = Wi(Wr, Gr);
3434
- let nr = class {
3463
+ const wa = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Yr ? !0 : qr(t), Vr = Fi(Fr, Yr);
3464
+ class er {
3435
3465
  series;
3436
3466
  end;
3437
3467
  index;
3438
3468
  constructor(e, r, n) {
3439
3469
  this.series = e;
3440
3470
  const s = b(0, e.length + 1);
3441
- this.end = dt(s, n), this.index = dt(s, r);
3471
+ this.end = ct(s, n), this.index = ct(s, r);
3442
3472
  }
3443
3473
  next() {
3444
3474
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3445
3475
  }
3446
- }, Ta = class {
3476
+ }
3477
+ let $a = class {
3447
3478
  series;
3448
3479
  index;
3449
3480
  decoder;
@@ -3456,11 +3487,11 @@ let nr = class {
3456
3487
  }
3457
3488
  next() {
3458
3489
  const e = this.index, r = this.series.data;
3459
- for (; this.index < r.length && r[this.index] !== Ot; ) this.index++;
3490
+ for (; this.index < r.length && r[this.index] !== bt; ) this.index++;
3460
3491
  const n = this.index;
3461
3492
  return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
3462
3493
  }
3463
- }, xa = class Xr {
3494
+ }, Oa = class Wr {
3464
3495
  wrapped;
3465
3496
  static schema = a.record(a.string(), a.unknown());
3466
3497
  constructor(e) {
@@ -3470,25 +3501,25 @@ let nr = class {
3470
3501
  const e = this.wrapped.next();
3471
3502
  return e.done === !0 ? { done: !0, value: void 0 } : {
3472
3503
  done: !1,
3473
- value: lt.decodeString(e.value, Xr.schema)
3504
+ value: at.decodeString(e.value, Wr.schema)
3474
3505
  };
3475
3506
  }
3476
- }, Sa = class {
3507
+ }, va = class {
3477
3508
  series;
3478
3509
  index;
3479
3510
  data;
3480
3511
  density;
3481
3512
  constructor(e) {
3482
- if (!e.dataType.equals(S.UUID))
3513
+ if (!e.dataType.equals(I.UUID))
3483
3514
  throw new Error("cannot create a UUID series iterator for a non-UUID series");
3484
- this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = S.UUID.density.valueOf();
3515
+ this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = I.UUID.density.valueOf();
3485
3516
  }
3486
3517
  next() {
3487
3518
  if (this.index >= this.series.length) return { done: !0, value: void 0 };
3488
- const e = Xt(this.data, this.index * this.density);
3519
+ const e = Wt(this.data, this.index * this.density);
3489
3520
  return this.index++, { done: !1, value: e };
3490
3521
  }
3491
- }, Na = class {
3522
+ }, Ta = class {
3492
3523
  series;
3493
3524
  index;
3494
3525
  constructor(e) {
@@ -3501,7 +3532,7 @@ let nr = class {
3501
3532
  };
3502
3533
  }
3503
3534
  };
3504
- class Du {
3535
+ class ju {
3505
3536
  /** The array of series in this collection */
3506
3537
  series;
3507
3538
  /**
@@ -3554,14 +3585,14 @@ class Du {
3554
3585
  this.series = e;
3555
3586
  }
3556
3587
  as(e) {
3557
- return Vr(e, this.dataType), this;
3588
+ return Zr(e, this.dataType), this;
3558
3589
  }
3559
3590
  /**
3560
3591
  * Returns the data type of the series in this collection. If the collection is empty,
3561
3592
  * returns DataType.UNKNOWN.
3562
3593
  */
3563
3594
  get dataType() {
3564
- return this.series.length === 0 ? S.UNKNOWN : this.series[0].dataType;
3595
+ return this.series.length === 0 ? I.UNKNOWN : this.series[0].dataType;
3565
3596
  }
3566
3597
  /**
3567
3598
  * Returns the combined time range of all series in the collection. If the collection
@@ -3569,7 +3600,7 @@ class Du {
3569
3600
  * series to the end of the last series.
3570
3601
  */
3571
3602
  get timeRange() {
3572
- return this.series.length === 0 ? Q.ZERO : new Q(
3603
+ return this.series.length === 0 ? _.ZERO : new _(
3573
3604
  this.series[0].timeRange.start,
3574
3605
  this.series[this.series.length - 1].timeRange.end
3575
3606
  );
@@ -3596,7 +3627,7 @@ class Du {
3596
3627
  const r = () => new Error(
3597
3628
  `cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
3598
3629
  ), n = e.dataType.equals(this.dataType);
3599
- if (Hr(e)) {
3630
+ if (Vr(e)) {
3600
3631
  if (this.series.length !== 0 && !n) throw r();
3601
3632
  this.series.push(e);
3602
3633
  } else {
@@ -3614,7 +3645,7 @@ class Du {
3614
3645
  }
3615
3646
  atAlignment(e, r) {
3616
3647
  for (const n of this.series)
3617
- if (L(n.alignmentBounds, e))
3648
+ if (R(n.alignmentBounds, e))
3618
3649
  return n.atAlignment(e, r);
3619
3650
  if (r) throw new Error(`[series] - no value at alignment ${e}`);
3620
3651
  }
@@ -3633,7 +3664,7 @@ class Du {
3633
3664
  * @returns An iterator over the specified range.
3634
3665
  */
3635
3666
  subIterator(e, r) {
3636
- return new it(this, e, r ?? this.length);
3667
+ return new rt(this, e, r ?? this.length);
3637
3668
  }
3638
3669
  /**
3639
3670
  * Returns an iterator over a portion of the multi-series based on alignment.
@@ -3643,13 +3674,13 @@ class Du {
3643
3674
  */
3644
3675
  subAlignmentIterator(e, r) {
3645
3676
  if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
3646
- return $t;
3677
+ return yt;
3647
3678
  let n = 0;
3648
3679
  for (let i = 0; i < this.series.length; i++) {
3649
3680
  const o = this.series[i];
3650
3681
  if (e < o.alignment) break;
3651
3682
  if (e >= o.alignmentBounds.upper) n += o.length;
3652
- else if (L(o.alignmentBounds, e)) {
3683
+ else if (R(o.alignmentBounds, e)) {
3653
3684
  n += Math.ceil(
3654
3685
  Number(e - o.alignment) / Number(o.alignmentMultiple)
3655
3686
  );
@@ -3661,14 +3692,14 @@ class Du {
3661
3692
  const o = this.series[i];
3662
3693
  if (r < o.alignment) break;
3663
3694
  if (r >= o.alignmentBounds.upper) s += o.length;
3664
- else if (L(o.alignmentBounds, r)) {
3695
+ else if (R(o.alignmentBounds, r)) {
3665
3696
  s += Math.ceil(
3666
3697
  Number(r - o.alignment) / Number(o.alignmentMultiple)
3667
3698
  );
3668
3699
  break;
3669
3700
  }
3670
3701
  }
3671
- return new it(this, n, s);
3702
+ return new rt(this, n, s);
3672
3703
  }
3673
3704
  /**
3674
3705
  * Returns an iterator over the specified alignment range and span.
@@ -3677,19 +3708,19 @@ class Du {
3677
3708
  * @returns An iterator over the specified range.
3678
3709
  */
3679
3710
  subAlignmentSpanIterator(e, r) {
3680
- if (e >= this.alignmentBounds.upper) return $t;
3711
+ if (e >= this.alignmentBounds.upper) return yt;
3681
3712
  r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
3682
3713
  let n = 0;
3683
3714
  for (let s = 0; s < this.series.length; s++) {
3684
3715
  const i = this.series[s];
3685
3716
  if (e < i.alignment) break;
3686
3717
  if (e >= i.alignmentBounds.upper) n += i.length;
3687
- else if (L(i.alignmentBounds, e)) {
3718
+ else if (R(i.alignmentBounds, e)) {
3688
3719
  n += Number(e - i.alignment);
3689
3720
  break;
3690
3721
  }
3691
3722
  }
3692
- return new it(this, n, n + r);
3723
+ return new rt(this, n, n + r);
3693
3724
  }
3694
3725
  /**
3695
3726
  * Updates the WebGL buffer for all series in the collection.
@@ -3702,13 +3733,13 @@ class Du {
3702
3733
  * Returns the bounds containing the minimum and maximum values across all series.
3703
3734
  */
3704
3735
  get bounds() {
3705
- return $r(this.series.map((e) => e.bounds));
3736
+ return yr(this.series.map((e) => e.bounds));
3706
3737
  }
3707
3738
  /**
3708
3739
  * Returns the sum of the byte lengths of all series.
3709
3740
  */
3710
3741
  get byteLength() {
3711
- return new qe(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3742
+ return new y(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3712
3743
  }
3713
3744
  /**
3714
3745
  * Returns a combined typed array containing all data from all series.
@@ -3729,7 +3760,7 @@ class Du {
3729
3760
  */
3730
3761
  traverseAlignment(e, r) {
3731
3762
  const n = this.series.map((s) => s.alignmentBounds);
3732
- return Or(n, e, r);
3763
+ return br(n, e, r);
3733
3764
  }
3734
3765
  /**
3735
3766
  * Acquires a reference to the WebGL buffer for all series.
@@ -3752,7 +3783,7 @@ class Du {
3752
3783
  */
3753
3784
  distance(e, r) {
3754
3785
  const n = this.series.map((s) => s.alignmentBounds);
3755
- return vr(n, e, r);
3786
+ return wr(n, e, r);
3756
3787
  }
3757
3788
  /**
3758
3789
  * Parses a JSON multi-series into an array of values using the provided zod schema.
@@ -3762,7 +3793,7 @@ class Du {
3762
3793
  * @returns An array of values parsed from the JSON series.
3763
3794
  */
3764
3795
  parseJSON(e) {
3765
- if (!this.dataType.equals(S.JSON))
3796
+ if (!this.dataType.equals(I.JSON))
3766
3797
  throw new Error("cannot parse non-JSON series as JSON");
3767
3798
  return this.series.flatMap((r) => r.parseJSON(e));
3768
3799
  }
@@ -3775,7 +3806,7 @@ class Du {
3775
3806
  next() {
3776
3807
  return { done: !0, value: void 0 };
3777
3808
  }
3778
- } : new Ia(this.series);
3809
+ } : new xa(this.series);
3779
3810
  }
3780
3811
  /**
3781
3812
  * Returns an array of the values in the multi-series as strings.
@@ -3786,7 +3817,7 @@ class Du {
3786
3817
  return this.series.flatMap((e) => e.toStrings());
3787
3818
  }
3788
3819
  }
3789
- class Ia {
3820
+ class xa {
3790
3821
  series;
3791
3822
  seriesIndex;
3792
3823
  internal;
@@ -3801,7 +3832,7 @@ class Ia {
3801
3832
  return this;
3802
3833
  }
3803
3834
  }
3804
- class it {
3835
+ class rt {
3805
3836
  series;
3806
3837
  index;
3807
3838
  end;
@@ -3815,51 +3846,51 @@ class it {
3815
3846
  return this;
3816
3847
  }
3817
3848
  }
3818
- const sr = (t) => {
3849
+ const tr = (t) => {
3819
3850
  const e = t >> 32n, r = t & 0xffffffffn;
3820
3851
  return { domain: e, sample: r };
3821
3852
  };
3822
3853
  a.object({ key: a.string(), value: a.string() });
3823
- const Ma = a.record(
3854
+ const Sa = a.record(
3824
3855
  a.union([a.number(), a.string(), a.symbol()]),
3825
3856
  a.unknown()
3826
- ), Jt = (t) => Object.entries(t), Aa = (t, e) => Object.fromEntries(Jt(t).map(([r, n]) => [r, e(n, r)])), Ea = (t) => Object.fromEntries(Jt(t).filter(([e, r]) => r !== void 0)), Ua = (t, ...e) => {
3857
+ ), Gt = (t) => Object.entries(t), Ia = (t, e) => Object.fromEntries(Gt(t).map(([r, n]) => [r, e(n, r)])), Na = (t) => Object.fromEntries(Gt(t).filter(([e, r]) => r !== void 0)), Ma = (t, ...e) => {
3827
3858
  const r = { ...t };
3828
3859
  for (const n of e) delete r[n];
3829
3860
  return r;
3830
- }, Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3861
+ }, Ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3831
3862
  __proto__: null,
3832
- entries: Jt,
3833
- map: Aa,
3834
- omit: Ua,
3835
- purgeUndefined: Ea,
3836
- unknownZ: Ma
3837
- }, Symbol.toStringTag, { value: "Module" })), Jr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Ba = Jr(), Kr = ["macOS", "Windows", "Linux"], Ca = ["macos", "windows", "linux"], ja = {
3863
+ entries: Gt,
3864
+ map: Ia,
3865
+ omit: Ma,
3866
+ purgeUndefined: Na,
3867
+ unknownZ: Sa
3868
+ }, Symbol.toStringTag, { value: "Module" })), Gr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Aa = Gr(), Hr = ["macOS", "Windows", "Linux"], Ea = ["macos", "windows", "linux"], Ua = {
3838
3869
  macos: "macOS",
3839
3870
  windows: "Windows",
3840
3871
  linux: "Linux"
3841
- }, Ra = a.enum(Kr).or(
3842
- a.enum(Ca).transform((t) => ja[t])
3843
- ), La = () => {
3872
+ }, Ba = a.enum(Hr).or(
3873
+ a.enum(Ea).transform((t) => Ua[t])
3874
+ ), Ca = () => {
3844
3875
  if (typeof window > "u") return;
3845
3876
  const t = window.navigator.userAgent.toLowerCase();
3846
3877
  if (t.includes("mac")) return "macOS";
3847
3878
  if (t.includes("win")) return "Windows";
3848
3879
  if (t.includes("linux")) return "Linux";
3849
3880
  };
3850
- let at;
3851
- const Da = ((t = {}) => {
3881
+ let nt;
3882
+ const ja = ((t = {}) => {
3852
3883
  const { force: e, default: r } = t;
3853
- return e ?? at ?? (at = La(), at ?? r);
3854
- }), ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3884
+ return e ?? nt ?? (nt = Ca(), nt ?? r);
3885
+ }), Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3855
3886
  __proto__: null,
3856
- OPERATING_SYSTEMS: Kr,
3857
- RUNTIME: Ba,
3858
- detect: Jr,
3859
- getOS: Da,
3860
- osZ: Ra
3861
- }, Symbol.toStringTag, { value: "Module" })), Pa = (...t) => t.map(Qr).join(""), Qr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), ka = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3862
- class Re {
3887
+ OPERATING_SYSTEMS: Hr,
3888
+ RUNTIME: Aa,
3889
+ detect: Gr,
3890
+ getOS: ja,
3891
+ osZ: Ba
3892
+ }, Symbol.toStringTag, { value: "Module" })), Ra = (...t) => t.map(Xr).join(""), Xr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), La = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3893
+ class Le {
3863
3894
  protocol;
3864
3895
  host;
3865
3896
  port;
@@ -3871,7 +3902,7 @@ class Re {
3871
3902
  * @param pathPrefix - A path prefix to use for all requests. Defaults to "".
3872
3903
  */
3873
3904
  constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
3874
- this.protocol = n, this.host = e, this.port = r, this.path = Qr(s);
3905
+ this.protocol = n, this.host = e, this.port = r, this.path = Xr(s);
3875
3906
  }
3876
3907
  /**
3877
3908
  * Replaces creates a new URL with the specified properties replaced.
@@ -3879,7 +3910,7 @@ class Re {
3879
3910
  * @returns a new URL.
3880
3911
  */
3881
3912
  replace(e) {
3882
- return new Re({
3913
+ return new Le({
3883
3914
  host: e.host ?? this.host,
3884
3915
  port: e.port ?? this.port,
3885
3916
  protocol: e.protocol ?? this.protocol,
@@ -3892,148 +3923,148 @@ class Re {
3892
3923
  * @returns a new URL.
3893
3924
  */
3894
3925
  child(e) {
3895
- return new Re({
3926
+ return new Le({
3896
3927
  ...this,
3897
- pathPrefix: Pa(this.path, e)
3928
+ pathPrefix: Ra(this.path, e)
3898
3929
  });
3899
3930
  }
3900
3931
  /** @returns a string representation of the url */
3901
3932
  toString() {
3902
- return ka(
3933
+ return La(
3903
3934
  `${this.protocol}://${this.host}:${this.port}/${this.path}`
3904
3935
  );
3905
3936
  }
3906
- static UNKNOWN = new Re({ host: "unknown", port: 0 });
3937
+ static UNKNOWN = new Le({ host: "unknown", port: 0 });
3907
3938
  }
3908
- const vt = 2, Tt = 3, _r = 2, qa = (t, e) => {
3939
+ const wt = 2, $t = 3, Jr = 2, Da = (t, e) => {
3909
3940
  if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3910
- const r = ue(e);
3941
+ const r = ce(e);
3911
3942
  if (r == 0) return t;
3912
3943
  let n;
3913
- r >= 1e3 ? n = vt : r >= 1 ? n = Tt : n = Math.ceil(-Math.log10(r)) + _r;
3944
+ r >= 1e3 ? n = wt : r >= 1 ? n = $t : n = Math.ceil(-Math.log10(r)) + Jr;
3914
3945
  const s = 10 ** n;
3915
3946
  return Math.round(t * s) / s;
3916
- }, za = 5, Za = 1e-10, Fa = (t, e) => {
3947
+ }, Pa = 5, ka = 1e-10, qa = (t, e) => {
3917
3948
  if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3918
3949
  const r = Math.abs(t);
3919
3950
  if (r === 0) return 0;
3920
3951
  let n = !1, s = 0;
3921
3952
  if (e != null) {
3922
- s = ue(e);
3953
+ s = ce(e);
3923
3954
  const l = s / r;
3924
- n = s > 0 && l > Za;
3955
+ n = s > 0 && l > ka;
3925
3956
  }
3926
3957
  if (n) {
3927
3958
  let l;
3928
- s >= 1e3 ? l = vt : s >= 1 ? l = Tt : l = Math.ceil(-Math.log10(s)) + _r;
3959
+ s >= 1e3 ? l = wt : s >= 1 ? l = $t : l = Math.ceil(-Math.log10(s)) + Jr;
3929
3960
  const f = 10 ** l;
3930
3961
  return Math.round(t * f) / f;
3931
3962
  }
3932
3963
  if (r >= 1e3) {
3933
- const l = 10 ** vt;
3964
+ const l = 10 ** wt;
3934
3965
  return Math.round(t * l) / l;
3935
3966
  }
3936
3967
  if (r >= 1) {
3937
- const l = 10 ** Tt;
3968
+ const l = 10 ** $t;
3938
3969
  return Math.round(t * l) / l;
3939
3970
  }
3940
- const i = Math.floor(Math.log10(r)), o = 10 ** (za - i - 1);
3971
+ const i = Math.floor(Math.log10(r)), o = 10 ** (Pa - i - 1);
3941
3972
  return Math.round(t * o) / o;
3942
- }, qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3973
+ }, Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3943
3974
  __proto__: null,
3944
- MAX_INT16: ra,
3945
- MAX_INT32: sa,
3946
- MAX_INT64: ke,
3947
- MAX_INT64_NUMBER: zr,
3948
- MAX_INT8: ea,
3949
- MAX_UINT16: Xi,
3950
- MAX_UINT32: Ji,
3951
- MAX_UINT64: Ki,
3952
- MAX_UINT64_NUMBER: Qi,
3953
- MAX_UINT8: Hi,
3954
- MIN_INT16: ta,
3955
- MIN_INT32: na,
3956
- MIN_INT64: ia,
3957
- MIN_INT64_NUMBER: aa,
3958
- MIN_INT8: _i,
3959
- abs: br,
3960
- add: oe,
3961
- closeTo: Qn,
3962
- div: Te,
3963
- equal: ft,
3964
- isInteger: De,
3965
- max: es,
3966
- min: yr,
3967
- mult: R,
3968
- roundBySpan: qa,
3969
- roundToNearestMagnitude: _n,
3970
- smartRound: Fa,
3971
- sub: Z
3975
+ MAX_INT16: _i,
3976
+ MAX_INT32: ta,
3977
+ MAX_INT64: qe,
3978
+ MAX_INT64_NUMBER: Pr,
3979
+ MAX_INT8: Ki,
3980
+ MAX_UINT16: Wi,
3981
+ MAX_UINT32: Gi,
3982
+ MAX_UINT64: Hi,
3983
+ MAX_UINT64_NUMBER: Xi,
3984
+ MAX_UINT8: Vi,
3985
+ MIN_INT16: Qi,
3986
+ MIN_INT32: ea,
3987
+ MIN_INT64: ra,
3988
+ MIN_INT64_NUMBER: na,
3989
+ MIN_INT8: Ji,
3990
+ abs: pr,
3991
+ add: le,
3992
+ closeTo: Xn,
3993
+ div: xe,
3994
+ equal: lt,
3995
+ isInteger: Pe,
3996
+ max: Kn,
3997
+ min: gr,
3998
+ mult: j,
3999
+ roundBySpan: Da,
4000
+ roundToNearestMagnitude: Jn,
4001
+ smartRound: qa,
4002
+ sub: z
3972
4003
  }, Symbol.toStringTag, { value: "Module" }));
3973
4004
  a.object({
3974
4005
  baseInterval: h.z.optional(),
3975
4006
  maxRetries: a.number().optional(),
3976
4007
  scale: a.number().optional()
3977
4008
  });
3978
- const Ya = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(Ya), ie = a.number().min(0).max(255), en = a.number().min(0).max(1), Je = a.tuple([ie, ie, ie, en]), Va = a.tuple([ie, ie, ie]), Wa = a.object({ rgba255: Je }), Ga = a.number().min(0).max(360), Ha = a.number().min(0).max(100), Xa = a.number().min(0).max(100), tn = a.tuple([Ga, Ha, Xa, en]), Ke = a.union([ze, Va, Je, tn, Wa]), Qe = Ke.transform((t) => T(t)), Ja = (t) => Qe.safeParse(t).success, Ka = (t) => Je.safeParse(t).success, Qa = ((t) => {
4009
+ const za = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(za), ae = a.number().min(0).max(255), Kr = a.number().min(0).max(1), Je = a.tuple([ae, ae, ae, Kr]), Za = a.tuple([ae, ae, ae]), Fa = a.object({ rgba255: Je }), Ya = a.number().min(0).max(360), Va = a.number().min(0).max(100), Wa = a.number().min(0).max(100), Qr = a.tuple([Ya, Va, Wa, Kr]), Ke = a.union([ze, Za, Je, Qr, Fa]), Qe = Ke.transform((t) => x(t)), Ga = (t) => Qe.safeParse(t).success, Ha = (t) => Je.safeParse(t).success, Xa = ((t) => {
3979
4010
  if (t == null) return;
3980
4011
  const e = Qe.safeParse(t);
3981
- if (e.success) return nn(e.data);
4012
+ if (e.success) return en(e.data);
3982
4013
  if (typeof t == "string") return t;
3983
4014
  throw e.error;
3984
- }), T = (t, e = 1) => {
3985
- if (t = Ke.parse(t), typeof t == "string") return Le(t, e);
4015
+ }), x = (t, e = 1) => {
4016
+ if (t = Ke.parse(t), typeof t == "string") return De(t, e);
3986
4017
  if (Array.isArray(t)) {
3987
4018
  if (t.length < 3 || t.length > 4)
3988
4019
  throw new Error(`Invalid color: [${t.join(", ")}]`);
3989
4020
  return t.length === 3 ? [...t, e] : t;
3990
4021
  }
3991
4022
  return t.rgba255;
3992
- }, rn = (t, e) => {
4023
+ }, _r = (t, e) => {
3993
4024
  if (t == null || e == null) return t == e;
3994
- const r = T(t), n = T(e);
4025
+ const r = x(t), n = x(e);
3995
4026
  return r.every((s, i) => s === n[i]);
3996
- }, _a = ((t) => {
4027
+ }, Ja = ((t) => {
3997
4028
  if (t == null) return;
3998
- const [e, r, n, s] = T(t);
3999
- return `#${Me(e)}${Me(r)}${Me(n)}${s === 1 ? "" : Me(s * 255)}`;
4000
- }), nn = (t) => {
4001
- const [e, r, n, s] = T(t);
4029
+ const [e, r, n, s] = x(t);
4030
+ return `#${Ae(e)}${Ae(r)}${Ae(n)}${s === 1 ? "" : Ae(s * 255)}`;
4031
+ }), en = (t) => {
4032
+ const [e, r, n, s] = x(t);
4002
4033
  return `rgba(${e}, ${r}, ${n}, ${s})`;
4003
- }, eo = (t) => `rgb(${sn(t)})`, sn = (t) => {
4004
- const [e, r, n] = T(t);
4034
+ }, Ka = (t) => `rgb(${tn(t)})`, tn = (t) => {
4035
+ const [e, r, n] = x(t);
4005
4036
  return `${e}, ${r}, ${n}`;
4006
- }, to = (t) => [...Kt(t), me(t)], Kt = (t) => [
4007
- de(t) / 255,
4008
- ge(t) / 255,
4009
- pe(t) / 255
4010
- ], de = (t) => T(t)[0], ge = (t) => T(t)[1], pe = (t) => T(t)[2], me = (t) => T(t)[3], ro = (t) => rn(Qt, t), no = (t) => fo(T(t)), so = (t, e) => {
4011
- const [r, n, s] = T(t);
4037
+ }, Qa = (t) => [...Ht(t), be(t)], Ht = (t) => [
4038
+ pe(t) / 255,
4039
+ me(t) / 255,
4040
+ ye(t) / 255
4041
+ ], pe = (t) => x(t)[0], me = (t) => x(t)[1], ye = (t) => x(t)[2], be = (t) => x(t)[3], _a = (t) => _r(Xt, t), eo = (t) => lo(x(t)), to = (t, e) => {
4042
+ const [r, n, s] = x(t);
4012
4043
  if (e > 100)
4013
4044
  throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
4014
4045
  return e > 1 && (e /= 100), [r, n, s, e];
4015
- }, $e = (t) => {
4016
- const [e, r, n] = Kt(t).map(
4046
+ }, ve = (t) => {
4047
+ const [e, r, n] = Ht(t).map(
4017
4048
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
4018
4049
  );
4019
4050
  return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
4020
- }, io = (t) => {
4021
- const [e, r, n] = Kt(t);
4051
+ }, ro = (t) => {
4052
+ const [e, r, n] = Ht(t);
4022
4053
  return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
4023
- }, xt = (t, e) => {
4024
- const r = T(t), n = T(e), s = $e(r), i = $e(n);
4054
+ }, Ot = (t, e) => {
4055
+ const r = x(t), n = x(e), s = ve(r), i = ve(n);
4025
4056
  return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
4026
- }, ao = (t, ...e) => {
4057
+ }, no = (t, ...e) => {
4027
4058
  if (e.length === 0)
4028
4059
  throw new Error("[Color.pickByContrast] - must provide at least one color");
4029
- const r = T(t), [n] = e.sort((s, i) => xt(r, i) - xt(r, s));
4030
- return T(n);
4031
- }, oo = (t) => $e(t) < 0.5, uo = (t) => $e(t) > 0.5, Le = (t, e = 1) => (t = ze.parse(t), t = lo(t), [
4032
- Ae(t, 0),
4033
- Ae(t, 2),
4034
- Ae(t, 4),
4035
- t.length === 8 ? Ae(t, 6) / 255 : e
4036
- ]), Qt = [0, 0, 0, 0], Me = (t) => Math.floor(t).toString(16).padStart(2, "0"), Ae = (t, e) => parseInt(t.slice(e, e + 2), 16), lo = (t) => t.startsWith("#") ? t.slice(1) : t, ir = {
4060
+ const r = x(t), [n] = e.sort((s, i) => Ot(r, i) - Ot(r, s));
4061
+ return x(n);
4062
+ }, so = (t) => ve(t) < 0.5, io = (t) => ve(t) > 0.5, De = (t, e = 1) => (t = ze.parse(t), t = ao(t), [
4063
+ Ee(t, 0),
4064
+ Ee(t, 2),
4065
+ Ee(t, 4),
4066
+ t.length === 8 ? Ee(t, 6) / 255 : e
4067
+ ]), Xt = [0, 0, 0, 0], Ae = (t) => Math.floor(t).toString(16).padStart(2, "0"), Ee = (t, e) => parseInt(t.slice(e, e + 2), 16), ao = (t) => t.startsWith("#") ? t.slice(1) : t, rr = {
4037
4068
  black: "#000000",
4038
4069
  white: "#ffffff",
4039
4070
  red: "#ff0000",
@@ -4065,16 +4096,16 @@ const Ya = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(Ya), ie = a.n
4065
4096
  khaki: "#f0e68c",
4066
4097
  crimson: "#dc143c",
4067
4098
  transparent: "transparent"
4068
- }, co = (t) => {
4099
+ }, oo = (t) => {
4069
4100
  if (!t) return;
4070
4101
  const e = t.trim().toLowerCase();
4071
4102
  if (!(e === "transparent" || e === "none")) {
4072
4103
  if (e.startsWith("#")) {
4073
4104
  if (e.length === 4) {
4074
4105
  const r = e[1], n = e[2], s = e[3], i = `#${r}${r}${n}${n}${s}${s}`;
4075
- if (ze.safeParse(i).success) return Le(i);
4106
+ if (ze.safeParse(i).success) return De(i);
4076
4107
  }
4077
- return (e.length === 7 || e.length === 9) && ze.safeParse(e).success ? Le(e) : void 0;
4108
+ return (e.length === 7 || e.length === 9) && ze.safeParse(e).success ? De(e) : void 0;
4078
4109
  }
4079
4110
  if (e.startsWith("rgb")) {
4080
4111
  const r = e.match(
@@ -4085,10 +4116,10 @@ const Ya = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(Ya), ie = a.n
4085
4116
  return [parseInt(n), parseInt(s), parseInt(i), o ? parseFloat(o) : 1];
4086
4117
  }
4087
4118
  }
4088
- if (ir[e]) return Le(ir[e]);
4119
+ if (rr[e]) return De(rr[e]);
4089
4120
  }
4090
- }, ho = (t) => {
4091
- t = tn.parse(t);
4121
+ }, uo = (t) => {
4122
+ t = Qr.parse(t);
4092
4123
  let [e, r, n] = t;
4093
4124
  const s = t[3];
4094
4125
  e /= 360, r /= 100, n /= 100;
@@ -4097,10 +4128,10 @@ const Ya = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(Ya), ie = a.n
4097
4128
  i = o = l = n;
4098
4129
  else {
4099
4130
  const f = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - f;
4100
- i = ot(c, f, e + 1 / 3), o = ot(c, f, e), l = ot(c, f, e - 1 / 3);
4131
+ i = st(c, f, e + 1 / 3), o = st(c, f, e), l = st(c, f, e - 1 / 3);
4101
4132
  }
4102
4133
  return [Math.round(i * 255), Math.round(o * 255), Math.round(l * 255), s];
4103
- }, ot = (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), fo = (t) => {
4134
+ }, st = (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), lo = (t) => {
4104
4135
  t = Je.parse(t);
4105
4136
  let [e, r, n] = t;
4106
4137
  const s = t[3];
@@ -4114,227 +4145,246 @@ const Ya = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ze = a.string().regex(Ya), ie = a.n
4114
4145
  f = c > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? l = (r - n) / d + (r < n ? 6 : 0) : i === r ? l = (n - e) / d + 2 : l = (e - r) / d + 4, l /= 6;
4115
4146
  }
4116
4147
  return l *= 360, f *= 100, c *= 100, [Math.round(l), Math.round(f), Math.round(c), s];
4117
- }, go = T("#000000"), po = T("#ffffff"), an = a.object({
4148
+ }, co = x("#000000"), ho = x("#ffffff"), rn = a.object({
4118
4149
  key: a.string(),
4119
4150
  color: Ke,
4120
4151
  position: a.number(),
4121
4152
  switched: a.boolean().optional()
4122
- }), mo = a.array(an), yo = (t, e) => {
4123
- if (t.length === 0) return Qt;
4124
- if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return T(t[0].color);
4153
+ }), fo = a.array(rn), go = (t, e) => {
4154
+ if (t.length === 0) return Xt;
4155
+ if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return x(t[0].color);
4125
4156
  if (e >= t[t.length - 1].position)
4126
- return T(t[t.length - 1].color);
4157
+ return x(t[t.length - 1].color);
4127
4158
  for (let r = 0; r < t.length - 1; r++) {
4128
4159
  const n = t[r], s = t[r + 1];
4129
4160
  if (e < n.position || e > s.position) continue;
4130
- if (e === n.position) return T(n.color);
4131
- if (e === s.position) return T(s.color);
4132
- const i = (e - n.position) / (s.position - n.position), o = T(n.color), l = T(s.color), f = Math.round(
4133
- de(o) + i * (de(l) - de(o))
4161
+ if (e === n.position) return x(n.color);
4162
+ if (e === s.position) return x(s.color);
4163
+ const i = (e - n.position) / (s.position - n.position), o = x(n.color), l = x(s.color), f = Math.round(
4164
+ pe(o) + i * (pe(l) - pe(o))
4134
4165
  ), c = Math.round(
4135
- ge(o) + i * (ge(l) - ge(o))
4166
+ me(o) + i * (me(l) - me(o))
4136
4167
  ), d = Math.round(
4137
- pe(o) + i * (pe(l) - pe(o))
4138
- ), m = me(o) + i * (me(l) - me(o));
4139
- return T([f, c, d, m]);
4168
+ ye(o) + i * (ye(l) - ye(o))
4169
+ ), m = be(o) + i * (be(l) - be(o));
4170
+ return x([f, c, d, m]);
4140
4171
  }
4141
- return T(t[t.length - 1].color);
4142
- }, bo = a.object({
4172
+ return x(t[t.length - 1].color);
4173
+ }, po = a.object({
4143
4174
  key: a.string(),
4144
4175
  name: a.string(),
4145
4176
  color: Qe
4146
- }), wo = a.object({
4177
+ }), mo = a.object({
4147
4178
  key: a.string(),
4148
4179
  name: a.string(),
4149
- swatches: a.array(bo)
4150
- }), $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4180
+ swatches: a.array(po)
4181
+ }), yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4151
4182
  __proto__: null,
4152
- BLACK: go,
4153
- WHITE: po,
4154
- ZERO: Qt,
4155
- aValue: me,
4156
- bValue: pe,
4183
+ BLACK: co,
4184
+ WHITE: ho,
4185
+ ZERO: Xt,
4186
+ aValue: be,
4187
+ bValue: ye,
4157
4188
  colorZ: Qe,
4158
- construct: T,
4159
- contrast: xt,
4189
+ construct: x,
4190
+ contrast: Ot,
4160
4191
  crudeZ: Ke,
4161
- cssString: Qa,
4162
- equals: rn,
4163
- fromCSS: co,
4164
- fromGradient: yo,
4165
- fromHSLA: ho,
4166
- gValue: ge,
4167
- gradientZ: mo,
4168
- grayness: io,
4169
- hex: _a,
4170
- hsla: no,
4171
- isColor: Ka,
4172
- isCrude: Ja,
4173
- isDark: oo,
4174
- isLight: uo,
4175
- isZero: ro,
4176
- luminance: $e,
4177
- paletteZ: wo,
4178
- pickByContrast: ao,
4179
- rValue: de,
4180
- rgbCSS: eo,
4181
- rgbString: sn,
4182
- rgba1: to,
4183
- rgbaCSS: nn,
4184
- setAlpha: so,
4185
- stopZ: an
4186
- }, Symbol.toStringTag, { value: "Module" })), on = a.int().min(0).max(255), un = 255, ln = 0, Oo = {
4187
- lower: ln,
4188
- upper: un + 1
4189
- }, cn = a.object({
4192
+ cssString: Xa,
4193
+ equals: _r,
4194
+ fromCSS: oo,
4195
+ fromGradient: go,
4196
+ fromHSLA: uo,
4197
+ gValue: me,
4198
+ gradientZ: fo,
4199
+ grayness: ro,
4200
+ hex: Ja,
4201
+ hsla: eo,
4202
+ isColor: Ha,
4203
+ isCrude: Ga,
4204
+ isDark: so,
4205
+ isLight: io,
4206
+ isZero: _a,
4207
+ luminance: ve,
4208
+ paletteZ: mo,
4209
+ pickByContrast: no,
4210
+ rValue: pe,
4211
+ rgbCSS: Ka,
4212
+ rgbString: tn,
4213
+ rgba1: Qa,
4214
+ rgbaCSS: en,
4215
+ setAlpha: to,
4216
+ stopZ: rn
4217
+ }, Symbol.toStringTag, { value: "Module" })), nn = a.int().min(0).max(255), sn = 255, an = 0, bo = {
4218
+ lower: an,
4219
+ upper: sn + 1
4220
+ }, on = a.object({
4190
4221
  name: a.string(),
4191
4222
  key: a.string()
4192
- }), Oe = (t) => a.object({
4193
- subject: cn,
4223
+ }), Te = (t) => a.object({
4224
+ subject: on,
4194
4225
  resource: t,
4195
- authority: on
4196
- }), vo = (...t) => (e) => e.filter((r) => {
4226
+ authority: nn
4227
+ }), wo = (...t) => (e) => e.filter((r) => {
4197
4228
  let n = !1;
4198
4229
  return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
4199
- }), hn = (t) => a.object({
4200
- from: Oe(t),
4230
+ }), un = (t) => a.object({
4231
+ from: Te(t),
4201
4232
  to: a.null()
4202
- }), fn = (t) => a.object({
4233
+ }), ln = (t) => a.object({
4203
4234
  from: a.null(),
4204
- to: Oe(t)
4205
- }), To = (t) => a.union([
4206
- hn(t),
4207
- fn(t),
4235
+ to: Te(t)
4236
+ }), $o = (t) => a.union([
4237
+ un(t),
4238
+ ln(t),
4208
4239
  a.object({
4209
- from: Oe(t),
4210
- to: Oe(t)
4240
+ from: Te(t),
4241
+ to: Te(t)
4211
4242
  })
4212
- ]), zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4243
+ ]), Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4213
4244
  __proto__: null,
4214
- ABSOLUTE_AUTHORITY: un,
4215
- AUTHORITY_BOUNDS: Oo,
4216
- ZERO_AUTHORITY: ln,
4217
- acquireZ: fn,
4218
- authorityZ: on,
4219
- filterTransfersByChannelKey: vo,
4220
- releaseZ: hn,
4221
- stateZ: Oe,
4222
- subjectZ: cn,
4223
- transferZ: To
4224
- }, Symbol.toStringTag, { value: "Module" })), xo = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), So = (t, e) => {
4245
+ ABSOLUTE_AUTHORITY: sn,
4246
+ AUTHORITY_BOUNDS: bo,
4247
+ ZERO_AUTHORITY: an,
4248
+ acquireZ: ln,
4249
+ authorityZ: nn,
4250
+ filterTransfersByChannelKey: wo,
4251
+ releaseZ: un,
4252
+ stateZ: Te,
4253
+ subjectZ: on,
4254
+ transferZ: $o
4255
+ }, Symbol.toStringTag, { value: "Module" })), Oo = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), vo = (t, e) => {
4225
4256
  const r = Symbol.for(t);
4226
- if (!xo(r)) {
4257
+ if (!Oo(r)) {
4227
4258
  const n = e();
4228
4259
  Object.defineProperty(globalThis, r, { value: n });
4229
4260
  }
4230
4261
  return () => globalThis[r];
4231
- }, dn = "sy_x_error", No = (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), gn = (t) => class fe extends Error {
4232
- static discriminator = dn;
4233
- discriminator = fe.discriminator;
4262
+ }, cn = "sy_x_error", To = (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), hn = (t) => class ge extends Error {
4263
+ static discriminator = cn;
4264
+ discriminator = ge.discriminator;
4234
4265
  static TYPE = t;
4235
- type = fe.TYPE;
4236
- static matches = No(t);
4237
- matches = fe.matches;
4266
+ type = ge.TYPE;
4267
+ static matches = To(t);
4268
+ matches = ge.matches;
4238
4269
  constructor(r, n) {
4239
- super(r, n), this.name = fe.TYPE;
4270
+ super(r, n), this.name = ge.TYPE;
4240
4271
  }
4241
4272
  static sub(r) {
4242
- return gn(`${t}.${r}`);
4273
+ return hn(`${t}.${r}`);
4243
4274
  }
4244
- }, Io = (t) => {
4275
+ }, xo = (t) => {
4245
4276
  if (t == null || typeof t != "object") return !1;
4246
4277
  const e = t;
4247
- if (e.discriminator !== dn) return !1;
4278
+ if (e.discriminator !== cn) return !1;
4248
4279
  if (!("type" in e))
4249
4280
  throw new Error(
4250
4281
  `X Error is missing its type property: ${JSON.stringify(e)}`
4251
4282
  );
4252
4283
  return !0;
4253
- }, le = "unknown", ar = "nil";
4254
- class Mo {
4284
+ }, he = "unknown", nr = "nil";
4285
+ class So {
4255
4286
  providers = [];
4256
4287
  register(e) {
4257
4288
  this.providers.push(e);
4258
4289
  }
4259
4290
  encode(e) {
4260
- if (e == null) return { type: ar, data: "" };
4261
- if (Io(e))
4291
+ if (e == null) return { type: nr, data: "" };
4292
+ if (xo(e))
4262
4293
  for (const r of this.providers) {
4263
4294
  const n = r.encode(e);
4264
4295
  if (n != null) return n;
4265
4296
  }
4266
- if (e instanceof Error) return { type: le, data: e.message };
4267
- if (typeof e == "string") return { type: le, data: e };
4297
+ if (e instanceof Error) return { type: he, data: e.message };
4298
+ if (typeof e == "string") return { type: he, data: e };
4268
4299
  try {
4269
- return { type: le, data: JSON.stringify(e) };
4300
+ return { type: he, data: JSON.stringify(e) };
4270
4301
  } catch {
4271
- return { type: le, data: "unable to encode error information" };
4302
+ return { type: he, data: "unable to encode error information" };
4272
4303
  }
4273
4304
  }
4274
4305
  decode(e) {
4275
- if (e == null || e.type === ar) return null;
4276
- if (e.type === le) return new or(e.data);
4306
+ if (e == null || e.type === nr) return null;
4307
+ if (e.type === he) return new sr(e.data);
4277
4308
  for (const r of this.providers) {
4278
4309
  const n = r.decode(e);
4279
4310
  if (n != null) return n;
4280
4311
  }
4281
- return new or(e.data);
4312
+ return new sr(e.data);
4282
4313
  }
4283
4314
  }
4284
- So("synnax-error-registry", () => new Mo());
4285
- class or extends gn("unknown") {
4315
+ vo("synnax-error-registry", () => new So());
4316
+ class sr extends hn("unknown") {
4286
4317
  }
4287
4318
  a.object({ type: a.string(), data: a.string() });
4288
- const Zu = () => new Promise((t) => setTimeout(t, 0)), Ao = O.object({
4289
- jsonrpc: O.literal("2.0"),
4290
- method: O.string(),
4319
+ const ku = () => new Promise((t) => setTimeout(t, 0)), Io = v.object({
4320
+ jsonrpc: v.literal("2.0"),
4321
+ method: v.string(),
4291
4322
  // params should be z.union([z.record(z.string(), z.json()),
4292
4323
  // z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
4293
4324
  // definition of params then in the JSON-RPC spec.
4294
- params: O.any().optional(),
4295
- id: O.union([O.string(), O.number(), O.null()]).optional()
4296
- }), pn = O.object({
4297
- jsonrpc: O.literal("2.0"),
4298
- id: O.union([O.string(), O.number(), O.null()])
4299
- }), Eo = pn.extend({
4300
- result: O.json()
4301
- }), Uo = pn.extend({
4302
- error: O.object({
4303
- code: O.number().int(),
4325
+ params: v.any().optional(),
4326
+ id: v.union([v.string(), v.number(), v.null()]).optional()
4327
+ }), fn = v.object({
4328
+ jsonrpc: v.literal("2.0"),
4329
+ id: v.union([v.string(), v.number(), v.null()])
4330
+ }), No = fn.extend({
4331
+ result: v.json()
4332
+ }), Mo = fn.extend({
4333
+ error: v.object({
4334
+ code: v.number().int(),
4304
4335
  // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
4305
4336
  // definition of error than the JSON-RPC spec.
4306
- message: O.string().optional(),
4307
- data: O.json().optional()
4337
+ message: v.string().optional(),
4338
+ data: v.json().optional()
4308
4339
  })
4309
- }), Bo = O.union([Eo, Uo]);
4310
- O.union([Ao, Bo]);
4311
- const Co = O.uuid(), jo = O.object({
4312
- key: Co,
4313
- name: O.string().min(1),
4314
- color: O.string()
4315
- }), Ro = (t, e, r) => {
4340
+ }), Ao = v.union([No, Mo]);
4341
+ v.union([Io, Ao]);
4342
+ const Eo = v.uuid(), Uo = v.object({
4343
+ key: Eo,
4344
+ name: v.string().min(1),
4345
+ color: v.string()
4346
+ }), Bo = (t, e, r) => {
4316
4347
  const n = t.get(e);
4317
4348
  return n === void 0 ? (t.set(e, r), r) : n;
4318
- }, Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4349
+ }, qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4319
4350
  __proto__: null,
4320
- getOrSetDefault: Ro
4321
- }, Symbol.toStringTag, { value: "Module" })), St = a.string().regex(/^\d+\.\d+\.\d+$/), Se = ((t, e, r = {}) => {
4351
+ getOrSetDefault: Bo
4352
+ }, Symbol.toStringTag, { value: "Module" })), vt = a.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/), Co = (t, e) => {
4353
+ const r = t.split("."), n = e.split("."), s = Math.max(r.length, n.length);
4354
+ for (let i = 0; i < s; i++) {
4355
+ const o = r[i], l = n[i];
4356
+ if (o === void 0) return V;
4357
+ if (l === void 0) return W;
4358
+ const f = /^\d+$/.test(o), c = /^\d+$/.test(l);
4359
+ if (f && !c) return V;
4360
+ if (!f && c) return W;
4361
+ if (f && c) {
4362
+ const d = parseInt(o), m = parseInt(l);
4363
+ if (d < m) return V;
4364
+ if (d > m) return W;
4365
+ } else {
4366
+ if (o < l) return V;
4367
+ if (o > l) return W;
4368
+ }
4369
+ }
4370
+ return oe;
4371
+ }, Ie = ((t, e, r = {}) => {
4322
4372
  r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
4323
- const n = St.parse(t), s = St.parse(e), [i, o, l] = n.split(".").map(Number), [f, c, d] = s.split(".").map(Number);
4373
+ const n = vt.parse(t), s = vt.parse(e), [i, o] = n.split("-"), [l, f] = s.split("-"), [c, d, m] = i.split(".").map(Number), [p, M, E] = l.split(".").map(Number);
4324
4374
  if (r.checkMajor) {
4325
- if (i < f) return et;
4326
- if (i > f) return tt;
4375
+ if (c < p) return V;
4376
+ if (c > p) return W;
4327
4377
  }
4328
4378
  if (r.checkMinor) {
4329
- if (o < c) return et;
4330
- if (o > c) return tt;
4379
+ if (d < M) return V;
4380
+ if (d > M) return W;
4331
4381
  }
4332
4382
  if (r.checkPatch) {
4333
- if (l < d) return et;
4334
- if (l > d) return tt;
4383
+ if (m < E) return V;
4384
+ if (m > E) return W;
4335
4385
  }
4336
- return ve;
4337
- }), Lo = (t, e, r = {}) => zn(Se(t, e, r)), mn = (t, e, r = {}) => qn(Se(t, e, r)), Do = (t, e, r = {}) => kn(Se(t, e, r)), Po = ({
4386
+ return o === void 0 && f === void 0 ? oe : o === void 0 ? W : f === void 0 ? V : Co(o, f);
4387
+ }), jo = (t, e, r = {}) => Pn(Ie(t, e, r)), dn = (t, e, r = {}) => Dn(Ie(t, e, r)), Ro = (t, e, r = {}) => Ln(Ie(t, e, r)), Lo = ({
4338
4388
  name: t,
4339
4389
  migrate: e
4340
4390
  }) => (r) => {
@@ -4344,14 +4394,14 @@ const Co = O.uuid(), jo = O.object({
4344
4394
  } catch (n) {
4345
4395
  throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
4346
4396
  }
4347
- }, ko = ({
4397
+ }, Do = ({
4348
4398
  name: t,
4349
4399
  migrations: e,
4350
4400
  targetSchema: r,
4351
4401
  defaultVersion: n,
4352
4402
  def: s
4353
4403
  }) => {
4354
- const i = Object.keys(e).sort(Se).pop();
4404
+ const i = Object.keys(e).sort(Ie).pop();
4355
4405
  if (i == null)
4356
4406
  return (c) => {
4357
4407
  if (c.version ??= n, c.version !== s.version)
@@ -4370,7 +4420,7 @@ const Co = O.uuid(), jo = O.object({
4370
4420
  let l = !1;
4371
4421
  const f = (c) => {
4372
4422
  try {
4373
- if (o === 0 || mn(c.version, i))
4423
+ if (o === 0 || dn(c.version, i))
4374
4424
  return console.log(l ? `${t} ${c.version} now up to date` : `${t} version ${c.version} is up to date with target version ${s.version}`), c;
4375
4425
  const d = c.version, m = e[d], p = m(c);
4376
4426
  return l = !0, f(p);
@@ -4396,16 +4446,16 @@ const Co = O.uuid(), jo = O.object({
4396
4446
  return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
4397
4447
  }
4398
4448
  };
4399
- }, Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4449
+ }, zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4400
4450
  __proto__: null,
4401
- compareSemVer: Se,
4402
- createMigration: Po,
4403
- migrator: ko,
4404
- semVerNewer: mn,
4405
- semVerOlder: Do,
4406
- semVerZ: St,
4407
- versionsEqual: Lo
4408
- }, Symbol.toStringTag, { value: "Module" })), yn = ["standard", "scientific", "engineering"], qo = a.enum(yn), zo = (t, e, r) => {
4451
+ compareSemVer: Ie,
4452
+ createMigration: Lo,
4453
+ migrator: Do,
4454
+ semVerNewer: dn,
4455
+ semVerOlder: Ro,
4456
+ semVerZ: vt,
4457
+ versionsEqual: jo
4458
+ }, Symbol.toStringTag, { value: "Module" })), gn = ["standard", "scientific", "engineering"], Po = a.enum(gn), ko = (t, e, r) => {
4409
4459
  if (Number.isNaN(t)) return "NaN";
4410
4460
  if (t === 1 / 0) return "∞";
4411
4461
  if (t === -1 / 0) return "-∞";
@@ -4414,71 +4464,71 @@ const Co = O.uuid(), jo = O.object({
4414
4464
  return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
4415
4465
  let n;
4416
4466
  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}`;
4417
- }, Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4467
+ }, Zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4418
4468
  __proto__: null,
4419
- NOTATIONS: yn,
4420
- notationZ: qo,
4421
- stringifyNumber: zo
4422
- }, Symbol.toStringTag, { value: "Module" })), Wu = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, bn = a.enum([
4469
+ NOTATIONS: gn,
4470
+ notationZ: Po,
4471
+ stringifyNumber: ko
4472
+ }, Symbol.toStringTag, { value: "Module" })), Fu = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, pn = a.enum([
4423
4473
  "success",
4424
4474
  "info",
4425
4475
  "warning",
4426
4476
  "error",
4427
4477
  "loading",
4428
4478
  "disabled"
4429
- ]), Zo = (t) => a.object({
4479
+ ]), qo = (t) => a.object({
4430
4480
  key: a.string(),
4431
4481
  name: a.string().default(""),
4432
- variant: bn,
4482
+ variant: pn,
4433
4483
  message: a.string(),
4434
4484
  description: a.string().optional(),
4435
- time: $.z,
4436
- labels: lr(jo).optional(),
4485
+ time: O.z,
4486
+ labels: ar(Uo).optional(),
4437
4487
  details: t ?? a.unknown().optional()
4438
- }), Fo = a.object({
4488
+ }), zo = a.object({
4439
4489
  stack: a.string(),
4440
4490
  error: a.instanceof(Error)
4441
- }), Yo = (t, e) => {
4491
+ }), Zo = (t, e) => {
4442
4492
  if (!(t instanceof Error)) throw t;
4443
- return wn({
4493
+ return mn({
4444
4494
  variant: "error",
4445
4495
  message: e ?? t.message,
4446
4496
  description: e != null ? t.message : void 0,
4447
4497
  details: { stack: t.stack ?? "", error: t }
4448
4498
  });
4449
- }, wn = (t) => ({
4450
- key: Ht(),
4451
- time: $.now(),
4499
+ }, mn = (t) => ({
4500
+ key: Vt(),
4501
+ time: O.now(),
4452
4502
  name: "",
4453
4503
  ...t
4454
- }), Vo = (t, e = []) => {
4504
+ }), Fo = (t, e = []) => {
4455
4505
  if (t != null)
4456
4506
  return Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0;
4457
- }, Wo = (t, e = []) => {
4507
+ }, Yo = (t, e = []) => {
4458
4508
  if (t != null)
4459
4509
  return Array.isArray(e) ? e.includes(t) ? void 0 : t : e === t ? void 0 : t;
4460
- }, Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4510
+ }, Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4461
4511
  __proto__: null,
4462
- create: wn,
4463
- exceptionDetailsSchema: Fo,
4464
- fromException: Yo,
4465
- keepVariants: Vo,
4466
- removeVariants: Wo,
4467
- statusZ: Zo,
4468
- variantZ: bn
4469
- }, Symbol.toStringTag, { value: "Module" })), Go = (t, e) => {
4512
+ create: mn,
4513
+ exceptionDetailsSchema: zo,
4514
+ fromException: Zo,
4515
+ keepVariants: Fo,
4516
+ removeVariants: Yo,
4517
+ statusZ: qo,
4518
+ variantZ: pn
4519
+ }, Symbol.toStringTag, { value: "Module" })), Vo = (t, e) => {
4470
4520
  if (!e.has(t)) return t;
4471
4521
  let r = t, n = 1, s = t;
4472
4522
  for (; e.has(s); ) {
4473
- const i = s.match(Ho);
4523
+ const i = s.match(Wo);
4474
4524
  i ? (r = s.slice(0, i.index).trim(), n = parseInt(i[1]) + 1) : (r = s, n = 1), s = `${r} (${n})`;
4475
4525
  }
4476
4526
  return s;
4477
- }, Ho = /\((\d+)\)$/, Xo = (t, e = "") => {
4527
+ }, Wo = /\((\d+)\)$/, Go = (t, e = "") => {
4478
4528
  if (typeof t == "string") return t;
4479
4529
  const r = t.length;
4480
4530
  return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
4481
- }, Jo = (t) => {
4531
+ }, Ho = (t) => {
4482
4532
  const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
4483
4533
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
4484
4534
  const s = /\d+/g;
@@ -4496,14 +4546,14 @@ const Co = O.uuid(), jo = O.object({
4496
4546
  return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
4497
4547
  (o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
4498
4548
  );
4499
- }, Ko = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4549
+ }, Xo = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4500
4550
  __proto__: null,
4501
- createShortIdentifiers: Jo,
4502
- deduplicateFileName: Go,
4503
- naturalLanguageJoin: Xo,
4504
- trimPrefix: Ko
4505
- }, Symbol.toStringTag, { value: "Module" })), Qo = new Error("request for lock canceled");
4506
- var _o = function(t, e, r, n) {
4551
+ createShortIdentifiers: Ho,
4552
+ deduplicateFileName: Vo,
4553
+ naturalLanguageJoin: Go,
4554
+ trimPrefix: Xo
4555
+ }, Symbol.toStringTag, { value: "Module" })), Jo = new Error("request for lock canceled");
4556
+ var Ko = function(t, e, r, n) {
4507
4557
  function s(i) {
4508
4558
  return i instanceof r ? i : new r(function(o) {
4509
4559
  o(i);
@@ -4530,20 +4580,20 @@ var _o = function(t, e, r, n) {
4530
4580
  c((n = n.apply(t, e || [])).next());
4531
4581
  });
4532
4582
  };
4533
- class eu {
4534
- constructor(e, r = Qo) {
4583
+ class Qo {
4584
+ constructor(e, r = Jo) {
4535
4585
  this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
4536
4586
  }
4537
4587
  acquire(e = 1, r = 0) {
4538
4588
  if (e <= 0)
4539
4589
  throw new Error(`invalid weight ${e}: must be positive`);
4540
4590
  return new Promise((n, s) => {
4541
- const i = { resolve: n, reject: s, weight: e, priority: r }, o = $n(this._queue, (l) => r <= l.priority);
4591
+ const i = { resolve: n, reject: s, weight: e, priority: r }, o = yn(this._queue, (l) => r <= l.priority);
4542
4592
  o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
4543
4593
  });
4544
4594
  }
4545
4595
  runExclusive(e) {
4546
- return _o(this, arguments, void 0, function* (r, n = 1, s = 0) {
4596
+ return Ko(this, arguments, void 0, function* (r, n = 1, s = 0) {
4547
4597
  const [i, o] = yield this.acquire(n, s);
4548
4598
  try {
4549
4599
  return yield r(i);
@@ -4556,7 +4606,7 @@ class eu {
4556
4606
  if (e <= 0)
4557
4607
  throw new Error(`invalid weight ${e}: must be positive`);
4558
4608
  return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
4559
- this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), tu(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4609
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), _o(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4560
4610
  });
4561
4611
  }
4562
4612
  isLocked() {
@@ -4611,17 +4661,17 @@ class eu {
4611
4661
  return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
4612
4662
  }
4613
4663
  }
4614
- function tu(t, e) {
4615
- const r = $n(t, (n) => e.priority <= n.priority);
4664
+ function _o(t, e) {
4665
+ const r = yn(t, (n) => e.priority <= n.priority);
4616
4666
  t.splice(r + 1, 0, e);
4617
4667
  }
4618
- function $n(t, e) {
4668
+ function yn(t, e) {
4619
4669
  for (let r = t.length - 1; r >= 0; r--)
4620
4670
  if (e(t[r]))
4621
4671
  return r;
4622
4672
  return -1;
4623
4673
  }
4624
- var ru = function(t, e, r, n) {
4674
+ var eu = function(t, e, r, n) {
4625
4675
  function s(i) {
4626
4676
  return i instanceof r ? i : new r(function(o) {
4627
4677
  o(i);
@@ -4648,12 +4698,12 @@ var ru = function(t, e, r, n) {
4648
4698
  c((n = n.apply(t, e || [])).next());
4649
4699
  });
4650
4700
  };
4651
- class nu {
4701
+ class tu {
4652
4702
  constructor(e) {
4653
- this._semaphore = new eu(1, e);
4703
+ this._semaphore = new Qo(1, e);
4654
4704
  }
4655
4705
  acquire() {
4656
- return ru(this, arguments, void 0, function* (e = 0) {
4706
+ return eu(this, arguments, void 0, function* (e = 0) {
4657
4707
  const [, r] = yield this._semaphore.acquire(1, e);
4658
4708
  return r;
4659
4709
  });
@@ -4674,34 +4724,34 @@ class nu {
4674
4724
  return this._semaphore.cancel();
4675
4725
  }
4676
4726
  }
4677
- class On extends nu {
4727
+ class bn extends tu {
4678
4728
  constructor(e) {
4679
4729
  super(), Object.assign(this, e);
4680
4730
  }
4681
4731
  }
4682
- const su = (t) => new On(t), Xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4732
+ const ru = (t) => new bn(t), Wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4683
4733
  __proto__: null,
4684
- mutex: On,
4685
- newMutex: su
4734
+ mutex: bn,
4735
+ newMutex: ru
4686
4736
  }, Symbol.toStringTag, { value: "Module" }));
4687
- function vn(t) {
4737
+ function wn(t) {
4688
4738
  var e, r, n = "";
4689
4739
  if (typeof t == "string" || typeof t == "number") n += t;
4690
4740
  else if (typeof t == "object") if (Array.isArray(t)) {
4691
4741
  var s = t.length;
4692
- for (e = 0; e < s; e++) t[e] && (r = vn(t[e])) && (n && (n += " "), n += r);
4742
+ for (e = 0; e < s; e++) t[e] && (r = wn(t[e])) && (n && (n += " "), n += r);
4693
4743
  } else for (r in t) t[r] && (n && (n += " "), n += r);
4694
4744
  return n;
4695
4745
  }
4696
- function iu() {
4697
- for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = vn(t)) && (n && (n += " "), n += e);
4746
+ function nu() {
4747
+ for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = wn(t)) && (n && (n += " "), n += e);
4698
4748
  return n;
4699
4749
  }
4700
- const au = iu, ne = "-", ur = "__", Ee = "--", ou = (t) => {
4701
- const e = (...r) => au(...r);
4702
- return e.B = (...r) => t + ne + r.join(ne), e.E = (r) => t + ur + r, e.M = (...r) => t + Ee + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ee + n.join("-"), e.BE = (r, ...n) => e.B(r) + ur + n.join(ne), e.BEM = (r, n, ...s) => e.BE(r, n) + Ee + s.join(ne), e.var = (...r) => Ee + t + ne + r.join(ne), e;
4750
+ const su = nu, se = "-", ir = "__", Ue = "--", iu = (t) => {
4751
+ const e = (...r) => su(...r);
4752
+ return e.B = (...r) => t + se + r.join(se), e.E = (r) => t + ir + r, e.M = (...r) => t + Ue + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ue + n.join("-"), e.BE = (r, ...n) => e.B(r) + ir + n.join(se), e.BEM = (r, n, ...s) => e.BE(r, n) + Ue + s.join(se), e.var = (...r) => Ue + t + se + r.join(se), e;
4703
4753
  };
4704
- class uu {
4754
+ class au {
4705
4755
  rows = [];
4706
4756
  columns = [];
4707
4757
  prefix;
@@ -4730,71 +4780,71 @@ class uu {
4730
4780
  };
4731
4781
  }
4732
4782
  }
4733
- const lu = (t, e) => Object.entries(e).forEach(
4783
+ const ou = (t, e) => Object.entries(e).forEach(
4734
4784
  ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
4735
- ), cu = (t, e) => Array.from(t.style).forEach((r) => {
4785
+ ), uu = (t, e) => Array.from(t.style).forEach((r) => {
4736
4786
  r.startsWith(e) && t.style.removeProperty(r);
4737
- }), hu = (t) => {
4738
- const e = ou(t);
4739
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", Ls.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Os.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 = lu, e.removeVars = cu, e.newGridBuilder = (r) => new uu(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) => {
4787
+ }), lu = (t) => {
4788
+ const e = iu(t);
4789
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", Cs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", bs.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 = ou, e.removeVars = uu, e.newGridBuilder = (r) => new au(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) => {
4740
4790
  if (!(r == null || r === !1))
4741
- return typeof r == "number" ? `var(--${t}-gray-l${r})` : $o.cssString(r);
4791
+ return typeof r == "number" ? `var(--${t}-gray-l${r})` : yo.cssString(r);
4742
4792
  }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
4743
- }, Ju = hu("pluto");
4793
+ }, Gu = lu("pluto");
4744
4794
  export {
4745
- Bu as $,
4746
- wu as A,
4747
- qe as B,
4748
- Ju as C,
4749
- Eu as D,
4750
- $u as E,
4751
- Tu as F,
4752
- Vu as G,
4753
- Su as H,
4754
- Xu as I,
4755
- Ci as J,
4756
- Ls as K,
4757
- $o as L,
4758
- Hu as M,
4759
- zu as N,
4760
- Du as O,
4761
- et as P,
4762
- Nu as Q,
4763
- qu as R,
4764
- ku as S,
4765
- Ou as T,
4766
- gu as U,
4767
- Zu as V,
4768
- iu as W,
4769
- Fu as X,
4770
- Gu as Y,
4771
- Yu as Z,
4772
- vu as _,
4773
- Dn as a,
4774
- M as a0,
4775
- qn as b,
4776
- mu as c,
4777
- Pn as d,
4778
- zn as e,
4779
- Mt as f,
4780
- ve as g,
4781
- du as h,
4782
- Au as i,
4783
- Iu as j,
4784
- xu as k,
4785
- Pu as l,
4795
+ Eu as $,
4796
+ yu as A,
4797
+ Au as B,
4798
+ Gu as C,
4799
+ Yr as D,
4800
+ bu as E,
4801
+ Ou as F,
4802
+ y as G,
4803
+ Tu as H,
4804
+ Wu as I,
4805
+ Vu as J,
4806
+ Cs as K,
4807
+ Du as L,
4808
+ U as M,
4809
+ nu as N,
4810
+ ju as O,
4811
+ V as P,
4812
+ xu as Q,
4813
+ Ei as R,
4814
+ Lu as S,
4815
+ wu as T,
4816
+ fu as U,
4817
+ ku as V,
4818
+ Pu as W,
4819
+ qu as X,
4820
+ Zu as Y,
4821
+ zu as Z,
4822
+ $u as _,
4823
+ jn as a,
4824
+ $ as a0,
4825
+ Dn as b,
4826
+ gu as c,
4827
+ Rn as d,
4828
+ Pn as e,
4829
+ St as f,
4830
+ oe as g,
4831
+ hu as h,
4832
+ Nu as i,
4833
+ Su as j,
4834
+ vu as k,
4835
+ Ru as l,
4786
4836
  h as m,
4787
- ou as n,
4788
- Mu as o,
4789
- Os as p,
4790
- tt as q,
4791
- Wu as r,
4792
- $ as s,
4793
- Q as t,
4794
- S as u,
4795
- Uu as v,
4796
- kn as w,
4797
- nt as x,
4798
- bu as y,
4799
- Gr as z
4837
+ iu as n,
4838
+ Iu as o,
4839
+ bs as p,
4840
+ W as q,
4841
+ Fu as r,
4842
+ Mu as s,
4843
+ Yu as t,
4844
+ O as u,
4845
+ _ as v,
4846
+ Ln as w,
4847
+ I as x,
4848
+ mu as y,
4849
+ yo as z
4800
4850
  };