@synnaxlabs/pluto 0.44.8 → 0.45.1

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 (277) hide show
  1. package/dist/Animated-BT-w0cPF.cjs +1 -0
  2. package/dist/{Animated-fJsLX-Tt.js → Animated-B_xTpw9g.js} +2 -2
  3. package/dist/LinePlot-De-VLJHL.cjs +53 -0
  4. package/dist/{LinePlot-BIZ1E3Rb.js → LinePlot-mRCOU5PM.js} +833 -793
  5. package/dist/{Toggle-BsP_WecR.js → Toggle-CzRMXK-K.js} +2 -2
  6. package/dist/Toggle-DY4PmA0_.cjs +1 -0
  7. package/dist/{Video-CMuBiBcp.js → Video-B4UWip-3.js} +1 -1
  8. package/dist/{Video-CbaEeyGH.cjs → Video-CgaO8bTm.cjs} +1 -1
  9. package/dist/button.cjs +1 -1
  10. package/dist/button.js +1 -1
  11. package/dist/color.cjs +1 -1
  12. package/dist/color.js +1 -1
  13. package/dist/{css-BlHGoCgb.js → css-BUXMI9PB.js} +1082 -990
  14. package/dist/css-CmXY6iPo.cjs +8 -0
  15. package/dist/css.cjs +1 -1
  16. package/dist/css.js +2 -2
  17. package/dist/dialog.cjs +1 -1
  18. package/dist/dialog.js +1 -1
  19. package/dist/{eraser-BstNvEkO.js → eraser-BcLVtorx.js} +3470 -3017
  20. package/dist/eraser-h8NIswGM.cjs +63 -0
  21. package/dist/ether.cjs +1 -1
  22. package/dist/ether.js +9 -9
  23. package/dist/{external-CuYkHdQ-.js → external-BA4cUJmi.js} +2 -2
  24. package/dist/external-BBGCooyz.cjs +1 -0
  25. package/dist/{external-YHSSoyM9.js → external-BF3OTViJ.js} +3 -3
  26. package/dist/{external-B5vTtpm8.js → external-BNitHfU5.js} +2 -2
  27. package/dist/{external-C1_CUNeZ.js → external-BY99QanC.js} +3 -3
  28. package/dist/external-ByxpHVEA.js +84 -0
  29. package/dist/{external-NISlPgIR.js → external-C-0pnmB4.js} +3 -3
  30. package/dist/{external-BWwSCjxj.js → external-CBLyUVI_.js} +4 -4
  31. package/dist/external-CGbANgXa.cjs +1 -0
  32. package/dist/{external-Poa7jfNM.js → external-CJrxLSWV.js} +2 -2
  33. package/dist/external-CMtT44YA.cjs +1 -0
  34. package/dist/external-CNbPkF53.cjs +1 -0
  35. package/dist/external-CbHzHgtw.js +92 -0
  36. package/dist/external-CiJ7RsGt.cjs +1 -0
  37. package/dist/external-D2VXaXzu.cjs +1 -0
  38. package/dist/{external-BhMf86-b.js → external-DNwQ_1PT.js} +43 -45
  39. package/dist/external-DYC1EK6G.cjs +1 -0
  40. package/dist/{external-DVsTr26y.js → external-D_PgcvDj.js} +13 -10
  41. package/dist/external-Dl5JyJaH.cjs +1 -0
  42. package/dist/external-Du8Z1FRh.js +380 -0
  43. package/dist/{external-lcuUe52o.cjs → external-DynvKrxv.cjs} +2 -2
  44. package/dist/{external-CzyQFMzI.js → external-DzuRmcYi.js} +5 -4
  45. package/dist/external-ETemCKjS.cjs +1 -0
  46. package/dist/external-S6GiiOBy.cjs +1 -0
  47. package/dist/external-aXmXhGMj.cjs +1 -0
  48. package/dist/external-zzhrikgD.cjs +1 -0
  49. package/dist/flex.cjs +1 -1
  50. package/dist/flex.js +1 -1
  51. package/dist/{fontString-Ca1-oixk.js → fontString-B3WuZ-o6.js} +2 -2
  52. package/dist/{fontString-Cp4X6CqQ.cjs → fontString-C4QgiFXy.cjs} +1 -1
  53. package/dist/header.cjs +1 -1
  54. package/dist/header.js +1 -1
  55. package/dist/index.cjs +7 -7
  56. package/dist/index.js +13247 -12503
  57. package/dist/input.cjs +1 -1
  58. package/dist/input.js +1 -1
  59. package/dist/list.cjs +1 -1
  60. package/dist/list.js +1 -1
  61. package/dist/main-DCvw0wt3.cjs +92 -0
  62. package/dist/{Editable-MR16HLlJ.js → main-mGfIFfsW.js} +9355 -9184
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/button/Button.d.ts +3 -2
  67. package/dist/src/button/Button.d.ts.map +1 -1
  68. package/dist/src/color/BaseSwatch.d.ts.map +1 -1
  69. package/dist/src/dialog/Frame.d.ts.map +1 -1
  70. package/dist/src/flex/Box.d.ts +4 -4
  71. package/dist/src/flux/core/store.d.ts +38 -27
  72. package/dist/src/flux/core/store.d.ts.map +1 -1
  73. package/dist/src/flux/form.d.ts.map +1 -1
  74. package/dist/src/flux/form.spec.d.ts.map +1 -1
  75. package/dist/src/flux/list.d.ts +3 -1
  76. package/dist/src/flux/list.d.ts.map +1 -1
  77. package/dist/src/flux/list.spec.d.ts.map +1 -1
  78. package/dist/src/flux/result.spec.d.ts.map +1 -1
  79. package/dist/src/flux/retrieve.spec.d.ts.map +1 -1
  80. package/dist/src/flux/update.d.ts +3 -5
  81. package/dist/src/flux/update.d.ts.map +1 -1
  82. package/dist/src/flux/update.spec.d.ts.map +1 -1
  83. package/dist/src/form/Context.d.ts +1 -0
  84. package/dist/src/form/Context.d.ts.map +1 -1
  85. package/dist/src/form/state.d.ts +5 -1
  86. package/dist/src/form/state.d.ts.map +1 -1
  87. package/dist/src/form/use.d.ts.map +1 -1
  88. package/dist/src/form/useField.d.ts +3 -2
  89. package/dist/src/form/useField.d.ts.map +1 -1
  90. package/dist/src/generic/Generic.d.ts.map +1 -1
  91. package/dist/src/group/queries.d.ts +4 -3
  92. package/dist/src/group/queries.d.ts.map +1 -1
  93. package/dist/src/hardware/task/queries.d.ts +2 -1
  94. package/dist/src/hardware/task/queries.d.ts.map +1 -1
  95. package/dist/src/header/Header.d.ts +2 -1
  96. package/dist/src/header/Header.d.ts.map +1 -1
  97. package/dist/src/hooks/index.d.ts +1 -0
  98. package/dist/src/hooks/index.d.ts.map +1 -1
  99. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts.map +1 -1
  100. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebKit.d.ts.map +1 -1
  101. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebView.d.ts.map +1 -1
  102. package/dist/src/icon/Fitting.d.ts +2 -0
  103. package/dist/src/icon/Fitting.d.ts.map +1 -0
  104. package/dist/src/icon/LabJack.d.ts +3 -0
  105. package/dist/src/icon/LabJack.d.ts.map +1 -0
  106. package/dist/src/icon/NI.d.ts +2 -0
  107. package/dist/src/icon/NI.d.ts.map +1 -0
  108. package/dist/src/icon/OPC.d.ts +2 -0
  109. package/dist/src/icon/OPC.d.ts.map +1 -0
  110. package/dist/src/icon/Process.d.ts +2 -0
  111. package/dist/src/icon/Process.d.ts.map +1 -0
  112. package/dist/src/icon/Pump.d.ts +2 -0
  113. package/dist/src/icon/Pump.d.ts.map +1 -0
  114. package/dist/src/icon/Tank.d.ts +2 -0
  115. package/dist/src/icon/Tank.d.ts.map +1 -0
  116. package/dist/src/icon/Valve.d.ts +2 -0
  117. package/dist/src/icon/Valve.d.ts.map +1 -0
  118. package/dist/src/icon/external.d.ts +5 -0
  119. package/dist/src/icon/external.d.ts.map +1 -1
  120. package/dist/src/icon/registry.d.ts +8 -2
  121. package/dist/src/icon/registry.d.ts.map +1 -1
  122. package/dist/src/index.d.ts +2 -1
  123. package/dist/src/index.d.ts.map +1 -1
  124. package/dist/src/input/DateTime.d.ts.map +1 -1
  125. package/dist/src/input/HelpText.d.ts.map +1 -1
  126. package/dist/src/label/queries.d.ts +1 -1
  127. package/dist/src/label/queries.d.ts.map +1 -1
  128. package/dist/src/list/Frame.d.ts.map +1 -1
  129. package/dist/src/list/Items.d.ts +1 -1
  130. package/dist/src/list/Items.d.ts.map +1 -1
  131. package/dist/src/list/external.d.ts +1 -0
  132. package/dist/src/list/external.d.ts.map +1 -1
  133. package/dist/src/list/pager.spec.d.ts.map +1 -1
  134. package/dist/src/list/useCombinedData.d.ts +8 -0
  135. package/dist/src/list/useCombinedData.d.ts.map +1 -0
  136. package/dist/src/list/useCombinedData.spec.d.ts +2 -0
  137. package/dist/src/list/useCombinedData.spec.d.ts.map +1 -0
  138. package/dist/src/mosaic/use.d.ts.map +1 -1
  139. package/dist/src/ontology/queries.d.ts +2 -2
  140. package/dist/src/pluto/Pluto.d.ts +2 -0
  141. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  142. package/dist/src/ranger/queries.d.ts +3 -2
  143. package/dist/src/ranger/queries.d.ts.map +1 -1
  144. package/dist/src/schematic/external.d.ts +3 -0
  145. package/dist/src/schematic/external.d.ts.map +1 -0
  146. package/dist/src/schematic/index.d.ts.map +1 -0
  147. package/dist/src/schematic/symbol/Custom.d.ts +15 -0
  148. package/dist/src/schematic/symbol/Custom.d.ts.map +1 -0
  149. package/dist/src/schematic/symbol/Custom.spec.d.ts +2 -0
  150. package/dist/src/schematic/symbol/Custom.spec.d.ts.map +1 -0
  151. package/dist/src/{vis/schematic → schematic/symbol}/Forms.d.ts +7 -5
  152. package/dist/src/schematic/symbol/Forms.d.ts.map +1 -0
  153. package/dist/src/schematic/symbol/Grid.d.ts.map +1 -0
  154. package/dist/src/{vis/schematic/primitives → schematic/symbol}/Primitives.d.ts +18 -7
  155. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -0
  156. package/dist/src/schematic/symbol/SelectOrientation.d.ts.map +1 -0
  157. package/dist/src/{vis/schematic → schematic/symbol}/Symbols.d.ts +18 -8
  158. package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -0
  159. package/dist/src/schematic/symbol/external.d.ts +6 -0
  160. package/dist/src/schematic/symbol/external.d.ts.map +1 -0
  161. package/dist/src/schematic/symbol/extractRegions.d.ts +3 -0
  162. package/dist/src/schematic/symbol/extractRegions.d.ts.map +1 -0
  163. package/dist/src/schematic/symbol/extractRegions.spec.d.ts +2 -0
  164. package/dist/src/schematic/symbol/extractRegions.spec.d.ts.map +1 -0
  165. package/dist/src/schematic/symbol/index.d.ts +2 -0
  166. package/dist/src/schematic/symbol/index.d.ts.map +1 -0
  167. package/dist/src/schematic/symbol/queries.d.ts +179 -0
  168. package/dist/src/schematic/symbol/queries.d.ts.map +1 -0
  169. package/dist/src/schematic/symbol/queries.spec.d.ts +2 -0
  170. package/dist/src/schematic/symbol/queries.spec.d.ts.map +1 -0
  171. package/dist/src/{vis/schematic → schematic/symbol}/registry.d.ts +15 -6
  172. package/dist/src/schematic/symbol/registry.d.ts.map +1 -0
  173. package/dist/src/select/use.d.ts.map +1 -1
  174. package/dist/src/showcase/InputShowcase.d.ts +3 -0
  175. package/dist/src/showcase/InputShowcase.d.ts.map +1 -1
  176. package/dist/src/status/aether/aggregator.d.ts +2 -2
  177. package/dist/src/table/aether/Table.d.ts +4 -0
  178. package/dist/src/table/aether/Table.d.ts.map +1 -1
  179. package/dist/src/table/cells/Cells.d.ts +7 -1
  180. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  181. package/dist/src/table/cells/registry.d.ts.map +1 -1
  182. package/dist/src/tabs/Selector.d.ts +3 -2
  183. package/dist/src/tabs/Selector.d.ts.map +1 -1
  184. package/dist/src/tabs/Tabs.d.ts +2 -2
  185. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  186. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  187. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  188. package/dist/src/telem/control/aether/chip.d.ts +2 -2
  189. package/dist/src/telem/control/aether/controller.d.ts +1 -1
  190. package/dist/src/telem/control/aether/indicator.d.ts +7 -7
  191. package/dist/src/telem/control/aether/legend.d.ts +2 -2
  192. package/dist/src/telem/control/aether/state.d.ts +1 -1
  193. package/dist/src/theming/Provider.d.ts +2 -1
  194. package/dist/src/theming/Provider.d.ts.map +1 -1
  195. package/dist/src/theming/aether/provider.d.ts +129 -129
  196. package/dist/src/theming/core/theme.d.ts +131 -131
  197. package/dist/src/tree/Tree.d.ts.map +1 -1
  198. package/dist/src/triggers/Text.d.ts.map +1 -1
  199. package/dist/src/triggers/hooks.d.ts.map +1 -1
  200. package/dist/src/triggers/triggers.d.ts +11 -11
  201. package/dist/src/vis/axis/axis.d.ts +2 -2
  202. package/dist/src/vis/diagram/aether/Diagram.d.ts +4 -0
  203. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  204. package/dist/src/vis/line/Line.d.ts.map +1 -1
  205. package/dist/src/vis/line/aether/line.d.ts +1 -1
  206. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  207. package/dist/src/vis/lineplot/aether/XAxis.d.ts +4 -4
  208. package/dist/src/vis/lineplot/aether/YAxis.d.ts +4 -4
  209. package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
  210. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  211. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +4 -4
  212. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +8 -8
  213. package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +1 -1
  214. package/dist/src/vis/log/aether/Log.d.ts +3 -3
  215. package/dist/src/vis/measure/aether/measure.d.ts +8 -8
  216. package/dist/src/vis/rule/aether/aether.d.ts +2 -2
  217. package/dist/src/vis/setpoint/aether/setpoint.d.ts +3 -3
  218. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  219. package/dist/src/vis/setpoint/use.d.ts +2 -2
  220. package/dist/src/vis/setpoint/use.d.ts.map +1 -1
  221. package/dist/src/vis/value/RedlineForm.d.ts.map +1 -1
  222. package/dist/src/vis/value/TelemForm.d.ts.map +1 -1
  223. package/dist/src/vis/value/aether/value.d.ts +23 -3
  224. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  225. package/dist/src/vis/value/use.d.ts +8 -2
  226. package/dist/src/vis/value/use.d.ts.map +1 -1
  227. package/dist/tabs.cjs +1 -1
  228. package/dist/tabs.js +1 -1
  229. package/dist/text.cjs +1 -1
  230. package/dist/text.js +2 -2
  231. package/dist/theming.cjs +1 -1
  232. package/dist/theming.js +2 -2
  233. package/dist/tree.cjs +1 -1
  234. package/dist/tree.js +1 -1
  235. package/dist/triggers.cjs +1 -1
  236. package/dist/triggers.js +1 -1
  237. package/dist/{units-D8blpqyN.js → units-BPvO622s.js} +3 -3
  238. package/dist/units-DkdMPsxa.cjs +1 -0
  239. package/dist/video.cjs +1 -1
  240. package/dist/video.js +1 -1
  241. package/package.json +7 -7
  242. package/dist/Animated-CyK_c82a.cjs +0 -1
  243. package/dist/Editable-B8pvBXQS.cjs +0 -92
  244. package/dist/LinePlot-DslwDvAo.cjs +0 -53
  245. package/dist/Toggle-Bqp97ujd.cjs +0 -1
  246. package/dist/css-CZ_XGkIB.cjs +0 -8
  247. package/dist/eraser-DiJNbabo.cjs +0 -63
  248. package/dist/external-0zUBjsWc.cjs +0 -1
  249. package/dist/external-1ebWGBIY.cjs +0 -1
  250. package/dist/external-B4A9qxs2.cjs +0 -1
  251. package/dist/external-BNagUgId.cjs +0 -1
  252. package/dist/external-Bbrq8Uh2.cjs +0 -1
  253. package/dist/external-BoI3SDJy.cjs +0 -1
  254. package/dist/external-CbHi1R5M.cjs +0 -1
  255. package/dist/external-Cd_bzIsx.cjs +0 -1
  256. package/dist/external-Cw9nrwGS.cjs +0 -1
  257. package/dist/external-D0FRmOeg.cjs +0 -1
  258. package/dist/external-D4Cbm19R.js +0 -69
  259. package/dist/external-DHgpDWNu.cjs +0 -1
  260. package/dist/external-DpjNdrhL.js +0 -374
  261. package/dist/external-H1IGckxo.cjs +0 -1
  262. package/dist/external-IBOALZ2N.js +0 -82
  263. package/dist/src/vis/schematic/Forms.d.ts.map +0 -1
  264. package/dist/src/vis/schematic/Grid.d.ts.map +0 -1
  265. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +0 -1
  266. package/dist/src/vis/schematic/Symbols.d.ts.map +0 -1
  267. package/dist/src/vis/schematic/external.d.ts +0 -4
  268. package/dist/src/vis/schematic/external.d.ts.map +0 -1
  269. package/dist/src/vis/schematic/index.d.ts.map +0 -1
  270. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +0 -1
  271. package/dist/src/vis/schematic/primitives/index.d.ts +0 -2
  272. package/dist/src/vis/schematic/primitives/index.d.ts.map +0 -1
  273. package/dist/src/vis/schematic/registry.d.ts.map +0 -1
  274. package/dist/units-Cqxg-SBx.cjs +0 -1
  275. /package/dist/src/{vis/schematic → schematic}/index.d.ts +0 -0
  276. /package/dist/src/{vis/schematic → schematic/symbol}/Grid.d.ts +0 -0
  277. /package/dist/src/{vis/schematic → schematic/symbol}/SelectOrientation.d.ts +0 -0
@@ -1,45 +1,56 @@
1
1
  import S, { z as a } from "zod";
2
- const ln = (t) => {
2
+ const fn = (t) => {
3
3
  const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
4
4
  return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
5
- }, pt = (t) => {
6
- const e = (r, n = _e) => {
5
+ }, qe = (t) => {
6
+ const e = (r, n = nt) => {
7
7
  if (typeof r == "string") return t(r);
8
8
  if (Array.isArray(r)) return r.map((o) => e(o, n));
9
- if (!He(r)) return r;
10
- n = fn(n);
9
+ if (!Qe(r)) return r;
10
+ n = pn(n);
11
11
  const s = {}, i = r;
12
12
  return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
13
13
  let c = i[o];
14
14
  const h = t(o);
15
- n.recursive && (He(c) ? zt(c) || (c = e(c, n)) : n.recursiveInArray && kt(c) && (c = [...c].map((l) => {
15
+ n.recursive && (Qe(c) ? Wt(c) || (c = e(c, n)) : n.recursiveInArray && Ft(c) && (c = [...c].map((l) => {
16
16
  let d = l;
17
- return He(l) ? zt(d) || (d = e(l, n)) : kt(l) && (d = e({ key: l }, n).key), d;
17
+ return Qe(l) ? Wt(d) || (d = e(l, n)) : Ft(l) && (d = e({ key: l }, n).key), d;
18
18
  }))), s[h] = c;
19
19
  }), s);
20
20
  };
21
21
  return e;
22
- }, mt = pt(ln), cn = (t) => (
22
+ }, bt = qe(fn), dn = (t) => (
23
23
  // Don't convert the first character and don't convert a character that is after a
24
24
  // non-alphanumeric character
25
25
  t.replace(
26
26
  /([a-z0-9])([A-Z])/g,
27
27
  (e, r, n) => `${r}_${n.toLowerCase()}`
28
28
  )
29
- ), Gt = pt(cn), Ht = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), hn = [Number, String, Uint8Array], _e = {
29
+ ), Qt = qe(dn), _t = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), gn = [Number, String, Uint8Array], nt = {
30
30
  recursive: !0,
31
31
  recursiveInArray: !0
32
- }, fn = (t = _e) => (t.recursive == null ? t = _e : t.recursiveInArray ??= !1, t), kt = (t) => t != null && Array.isArray(t), He = (t) => t != null && typeof t == "object" && !Array.isArray(t), zt = (t) => hn.some((e) => t instanceof e), dn = (t) => t.replace(/\s+/g, "-").replace(
32
+ }, pn = (t = nt) => (t.recursive == null ? t = nt : t.recursiveInArray ??= !1, t), Ft = (t) => t != null && Array.isArray(t), Qe = (t) => t != null && typeof t == "object" && !Array.isArray(t), Wt = (t) => gn.some((e) => t instanceof e), mn = (t) => t.replace(/\s+/g, "-").replace(
33
33
  /([a-z0-9])([A-Z])/g,
34
34
  (e, r, n) => `${r}-${n.toLowerCase()}`
35
- ).toLowerCase(), gn = pt(dn), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
+ ).toLowerCase(), yn = qe(mn), wn = (t) => {
36
+ if (t.length === 0) return t;
37
+ let e = t.replace(/[_-]/g, " ");
38
+ return e = e.replace(
39
+ /([a-z0-9])([A-Z])/g,
40
+ (r, n, s) => `${n} ${s}`
41
+ ), e = e.replace(
42
+ /([A-Z]+)([A-Z][a-z])/g,
43
+ (r, n, s) => `${n} ${s}`
44
+ ), e = e.replace(/\s+/g, " ").trim(), e = e.replace(/\b\w/g, (r) => r.toUpperCase()), e;
45
+ }, bn = qe(wn), Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36
46
  __proto__: null,
37
- camelToSnake: Gt,
38
- capitalize: Ht,
39
- snakeToCamel: mt,
40
- toKebab: gn
47
+ camelToSnake: Qt,
48
+ capitalize: _t,
49
+ snakeToCamel: bt,
50
+ toKebab: yn,
51
+ toProperNoun: bn
41
52
  }, Symbol.toStringTag, { value: "Module" }));
42
- let pn = class {
53
+ let On = class {
43
54
  contentType = "application/json";
44
55
  decoder;
45
56
  encoder;
@@ -53,15 +64,15 @@ let pn = class {
53
64
  return this.decodeString(this.decoder.decode(e), r);
54
65
  }
55
66
  decodeString(e, r) {
56
- const n = JSON.parse(e), s = mt(n);
67
+ const n = JSON.parse(e), s = bt(n);
57
68
  return r != null ? r.parse(s) : s;
58
69
  }
59
70
  encodeString(e) {
60
- const r = Gt(e);
71
+ const r = Qt(e);
61
72
  return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
62
73
  }
63
74
  };
64
- const et = new pn(), tt = (t) => [...new Set(t)], mn = (t, e, r = !0) => {
75
+ const st = new On(), it = (t) => [...new Set(t)], vn = (t, e, r = !0) => {
65
76
  const n = /* @__PURE__ */ new Map();
66
77
  return t.forEach((s) => {
67
78
  const i = e(s);
@@ -71,12 +82,12 @@ const et = new pn(), tt = (t) => [...new Set(t)], mn = (t, e, r = !0) => {
71
82
  }
72
83
  n.set(i, s);
73
84
  }), Array.from(n.values());
74
- }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
85
+ }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
86
  __proto__: null,
76
- by: mn,
77
- unique: tt
78
- }, Symbol.toStringTag, { value: "Module" }));
79
- let _ = class {
87
+ by: vn,
88
+ unique: it
89
+ }, Symbol.toStringTag, { value: "Module" })), A = (t) => t != null && typeof t == "object" && "value" in t;
90
+ let ee = class {
80
91
  /** The underlying primitive value */
81
92
  value;
82
93
  constructor(e) {
@@ -96,8 +107,8 @@ let _ = class {
96
107
  return this.value.toString();
97
108
  }
98
109
  };
99
- const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t) => {
100
- if (yt(t)) return t?.toString().length === 0;
110
+ const Ot = (t) => t != null && typeof t == "object" && "toString" in t, er = (t) => {
111
+ if (Ot(t)) return t?.toString().length === 0;
101
112
  switch (typeof t) {
102
113
  case "string":
103
114
  return t.length === 0;
@@ -114,14 +125,15 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
114
125
  default:
115
126
  return !1;
116
127
  }
117
- }, yn = (t) => !Jt(t), No = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
128
+ }, xn = (t) => !er(t), Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
129
  __proto__: null,
119
- ValueExtension: _,
120
- isNonZero: yn,
121
- isStringer: yt,
122
- isZero: Jt
123
- }, Symbol.toStringTag, { value: "Module" })), De = (t, e = !1) => {
124
- const r = yt(t) ? "stringer" : typeof t;
130
+ ValueExtension: ee,
131
+ isCrudeValueExtension: A,
132
+ isNonZero: xn,
133
+ isStringer: Ot,
134
+ isZero: er
135
+ }, Symbol.toStringTag, { value: "Module" })), ze = (t, e = !1) => {
136
+ const r = Ot(t) ? "stringer" : typeof t;
125
137
  let n;
126
138
  switch (r) {
127
139
  case "string":
@@ -145,19 +157,19 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
145
157
  default:
146
158
  return console.warn(`sortFunc: unknown type ${r}`), () => -1;
147
159
  }
148
- return e ? Kt(n) : n;
149
- }, bn = (t, e, r) => {
150
- const n = De(e[t], r);
160
+ return e ? rr(n) : n;
161
+ }, $n = (t, e, r) => {
162
+ const n = ze(e[t], r);
151
163
  return (s, i) => n(s[t], i[t]);
152
- }, wn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Xt = (t, e) => {
164
+ }, Tn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, tr = (t, e) => {
153
165
  if (t.length !== e.length) return t.length - e.length;
154
166
  if (t.length === 0) return 0;
155
- const r = De(t[0]), n = [...t].sort(r), s = [...e].sort(r);
167
+ const r = ze(t[0]), n = [...t].sort(r), s = [...e].sort(r);
156
168
  return n.every((i, o) => i === s[o]) ? 0 : -1;
157
- }, On = (t, e) => {
158
- const r = tt(t), n = tt(e);
159
- return Xt(r, n);
160
- }, vn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Kt = (t) => (e, r) => t(r, e), ne = 0, Ie = -1, Me = 1, Qt = (t) => t < ne, _t = (t) => t > ne, xn = (t) => t >= ne, er = (t) => t === ne, Tn = (t, e) => {
169
+ }, Sn = (t, e) => {
170
+ const r = it(t), n = it(e);
171
+ return tr(r, n);
172
+ }, Nn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, rr = (t) => (e, r) => t(r, e), se = 0, Me = -1, Ee = 1, nr = (t) => t < se, sr = (t) => t > se, In = (t) => t >= se, ir = (t) => t === se, Mn = (t, e) => {
161
173
  const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
162
174
  if (!n || !s) return 0;
163
175
  for (let i = 0; i < Math.min(n.length, s.length); i++) {
@@ -171,57 +183,57 @@ const yt = (t) => t != null && typeof t == "object" && "toString" in t, Jt = (t)
171
183
  } else return isNaN(Number(o)) ? -1 : 1;
172
184
  }
173
185
  return n.length - s.length;
174
- }, Io = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
186
+ }, Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
175
187
  __proto__: null,
176
- EQUAL: ne,
177
- GREATER_THAN: Me,
178
- LESS_THAN: Ie,
179
- isEqualTo: er,
180
- isGreaterThan: _t,
181
- isGreaterThanEqual: xn,
182
- isLessThan: Qt,
183
- newF: De,
184
- newFieldF: bn,
185
- order: vn,
186
- primitiveArrays: wn,
187
- reverseF: Kt,
188
- stringsWithNumbers: Tn,
189
- uniqueUnorderedPrimitiveArrays: On,
190
- unorderedPrimitiveArrays: Xt
191
- }, Symbol.toStringTag, { value: "Module" })), Pe = a.tuple([a.number(), a.number()]);
188
+ EQUAL: se,
189
+ GREATER_THAN: Ee,
190
+ LESS_THAN: Me,
191
+ isEqualTo: ir,
192
+ isGreaterThan: sr,
193
+ isGreaterThanEqual: In,
194
+ isLessThan: nr,
195
+ newF: ze,
196
+ newFieldF: $n,
197
+ order: Nn,
198
+ primitiveArrays: Tn,
199
+ reverseF: rr,
200
+ stringsWithNumbers: Mn,
201
+ uniqueUnorderedPrimitiveArrays: Sn,
202
+ unorderedPrimitiveArrays: tr
203
+ }, Symbol.toStringTag, { value: "Module" })), Ze = a.tuple([a.number(), a.number()]);
192
204
  a.tuple([a.bigint(), a.bigint()]);
193
- const bt = a.object({ width: a.number(), height: a.number() }), $n = a.object({
205
+ const vt = a.object({ width: a.number(), height: a.number() }), En = a.object({
194
206
  signedWidth: a.number(),
195
207
  signedHeight: a.number()
196
- }), Sn = ["width", "height"];
197
- a.enum(Sn);
198
- const Nn = ["start", "center", "end"], In = ["signedWidth", "signedHeight"];
199
- a.enum(In);
200
- const ge = a.object({ x: a.number(), y: a.number() }), tr = a.object({ clientX: a.number(), clientY: a.number() }), qe = ["x", "y"], wt = a.enum(qe), rr = ["top", "right", "bottom", "left"], Mn = a.enum(rr), ke = ["left", "right"], Ot = a.enum(ke), ze = ["top", "bottom"], vt = a.enum(ze), xt = ["center"], rt = a.enum(xt), En = [...rr, ...xt], Tt = a.enum(En);
201
- a.enum(Nn);
202
- const An = ["first", "last"];
208
+ }), An = ["width", "height"];
203
209
  a.enum(An);
204
- const nr = a.object({ lower: a.number(), upper: a.number() }), Bn = a.object({ lower: a.bigint(), upper: a.bigint() });
205
- a.union([nr, Pe]);
206
- a.union([Bn, Pe]);
207
- const Un = a.enum([...wt.options, ...Tt.options]);
210
+ const Bn = ["start", "center", "end"], Un = ["signedWidth", "signedHeight"];
211
+ a.enum(Un);
212
+ const pe = a.object({ x: a.number(), y: a.number() }), ar = a.object({ clientX: a.number(), clientY: a.number() }), Ye = ["x", "y"], xt = a.enum(Ye), $t = ["top", "right", "bottom", "left"], Cn = a.enum($t), Fe = ["left", "right"], Tt = a.enum(Fe), We = ["top", "bottom"], St = a.enum(We), Nt = ["center"], at = a.enum(Nt), jn = [...$t, ...Nt], It = a.enum(jn);
213
+ a.enum(Bn);
214
+ const Rn = ["first", "last"];
215
+ a.enum(Rn);
216
+ const or = a.object({ lower: a.number(), upper: a.number() }), Ln = a.object({ lower: a.bigint(), upper: a.bigint() });
217
+ a.union([or, Ze]);
218
+ a.union([Ln, Ze]);
219
+ const Dn = a.enum([...xt.options, ...It.options]);
208
220
  a.enum(["x", "left", "right"]);
209
221
  a.enum(["y", "top", "bottom"]);
210
- const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
222
+ const Pn = a.union([xt, It, a.instanceof(String)]), ie = (t) => (e, r) => {
211
223
  if (typeof e == "bigint") {
212
- if (je(r))
224
+ if (Le(r))
213
225
  return t(e, BigInt(r));
214
226
  const n = t(Number(e), Number(r));
215
227
  return typeof n == "number" ? BigInt(Math.round(n)) : n;
216
228
  }
217
229
  return t(Number(e), Number(r));
218
- }, q = se((t, e) => t - e), ie = se((t, e) => t + e), jn = (t, e, r = 1e-4) => Math.abs(t - e) < r, nt = (t, e) => {
230
+ }, q = ie((t, e) => t - e), ae = ie((t, e) => t + e), kn = (t, e, r = 1e-4) => Math.abs(t - e) < r, ot = (t, e) => {
219
231
  const r = typeof t == "bigint", n = typeof e == "bigint";
220
- return r && n ? t === e : r && je(e) ? t === BigInt(e) : n && je(t) ? e === BigInt(t) : t === e;
221
- }, Rn = (t) => {
232
+ return r && n ? t === e : r && Le(e) ? t === BigInt(e) : n && Le(t) ? e === BigInt(t) : t === e;
233
+ }, qn = (t) => {
222
234
  const e = 10 ** Math.floor(Math.log10(t));
223
235
  return Math.round(t / e) * e;
224
- }, sr = se((t, e) => t <= e ? t : e), je = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), Ln = se((t, e) => t >= e ? t : e), ir = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, U = se((t, e) => t * e), we = se((t, e) => t / e), b = (t, e, r) => {
236
+ }, ur = ie((t, e) => t <= e ? t : e), Le = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), zn = ie((t, e) => t >= e ? t : e), lr = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, C = ie((t, e) => t * e), Oe = ie((t, e) => t / e), b = (t, e, r) => {
225
237
  const n = {};
226
238
  if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
227
239
  e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
@@ -230,64 +242,64 @@ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
230
242
  [n.lower, n.upper] = t;
231
243
  } else
232
244
  n.lower = t.lower, n.upper = t.upper;
233
- return r?.makeValid ? ar(n) : n;
234
- }, Dn = Object.freeze({ lower: 0, upper: 0 }), Pn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), qn = Object.freeze({ lower: 0, upper: 1 }), kn = Object.freeze({ lower: -1, upper: 1 }), zn = (t, e) => {
245
+ return r?.makeValid ? cr(n) : n;
246
+ }, Zn = Object.freeze({ lower: 0, upper: 0 }), Yn = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Fn = Object.freeze({ lower: 0, upper: 1 }), Wn = Object.freeze({ lower: -1, upper: 1 }), Vn = (t, e) => {
235
247
  if (t == null && e == null) return !0;
236
248
  if (t == null || e == null) return !1;
237
249
  const r = b(t), n = b(e);
238
250
  return r?.lower === n?.lower && r?.upper === n?.upper;
239
- }, ar = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, st = (t, e) => {
251
+ }, cr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, ut = (t, e) => {
240
252
  const r = b(t);
241
253
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
242
- }, C = (t, e) => {
254
+ }, j = (t, e) => {
243
255
  const r = b(t);
244
256
  if (typeof e == "number" || typeof e == "bigint")
245
257
  return e >= r.lower && e < r.upper;
246
258
  const n = b(e);
247
259
  return n.lower >= r.lower && n.upper <= r.upper;
248
- }, Zn = (t, e) => {
260
+ }, Gn = (t, e) => {
249
261
  const r = b(t), n = b(e);
250
- return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : C(r, n.upper) || C(r, n.lower) || C(n, r.upper) || C(n, r.lower);
251
- }, Oe = (t) => {
262
+ return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : j(r, n.upper) || j(r, n.lower) || j(n, r.upper) || j(n, r.lower);
263
+ }, ve = (t) => {
252
264
  const e = b(t);
253
265
  return e.upper - e.lower;
254
- }, Fn = (t) => {
266
+ }, Hn = (t) => {
255
267
  const e = b(t);
256
268
  return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
257
- }, Yn = (t) => {
258
- const e = Oe(t);
269
+ }, Jn = (t) => {
270
+ const e = ve(t);
259
271
  return typeof e == "number" ? e === 0 : e === 0n;
260
- }, Wn = (t) => {
272
+ }, Xn = (t) => {
261
273
  const e = b(t);
262
274
  return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
263
- }, Vn = (t) => {
275
+ }, Kn = (t) => {
264
276
  const e = b(t);
265
277
  return (e.upper + e.lower) / 2;
266
- }, or = (t) => ({
278
+ }, hr = (t) => ({
267
279
  lower: Math.min(...t.map((e) => b(e).lower)),
268
280
  upper: Math.max(...t.map((e) => b(e).upper))
269
- }), Gn = (t) => ({
281
+ }), Qn = (t) => ({
270
282
  lower: Math.max(...t.map((e) => b(e).lower)),
271
283
  upper: Math.min(...t.map((e) => b(e).upper))
272
- }), Hn = (t) => {
284
+ }), _n = (t) => {
273
285
  const e = b(t), r = typeof e.lower == "bigint";
274
- return Array.from({ length: Number(Oe(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
275
- }, it = (t, e) => {
276
- const r = t.map((i) => b(i)), n = r.findIndex((i) => C(i, e) || e < i.lower);
286
+ return Array.from({ length: Number(ve(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
287
+ }, lt = (t, e) => {
288
+ const r = t.map((i) => b(i)), n = r.findIndex((i) => j(i, e) || e < i.lower);
277
289
  if (n === -1) return { index: t.length, position: 0 };
278
290
  const s = r[n];
279
- return C(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
280
- }, Je = {
291
+ return j(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
292
+ }, _e = {
281
293
  removeBefore: 0,
282
294
  removeAfter: 0,
283
295
  insertInto: 0,
284
296
  deleteInBetween: 0
285
- }, Jn = (t, e) => {
297
+ }, es = (t, e) => {
286
298
  const r = t.map((l) => b(l)), n = b(e);
287
- if (r.length === 0) return Je;
288
- const s = it(r, n.lower), i = it(r, n.upper);
289
- if (s.index === t.length) return { ...Je, insertInto: t.length };
290
- if (i.index === 0) return { ...Je, removeAfter: i.position };
299
+ if (r.length === 0) return _e;
300
+ const s = lt(r, n.lower), i = lt(r, n.upper);
301
+ if (s.index === t.length) return { ..._e, insertInto: t.length };
302
+ if (i.index === 0) return { ..._e, removeAfter: i.position };
291
303
  if (s.index === i.index)
292
304
  return s.position !== 0 && i.position !== 0 ? null : {
293
305
  removeAfter: i.position,
@@ -295,28 +307,28 @@ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
295
307
  insertInto: s.index,
296
308
  deleteInBetween: 0
297
309
  };
298
- let o = i.index - s.index, c = s.index, h = q(Number(Oe(r[s.index])), s.position);
310
+ let o = i.index - s.index, c = s.index, h = q(Number(ve(r[s.index])), s.position);
299
311
  return s.position !== 0 ? (o -= 1, c += 1) : h = 0, {
300
312
  removeBefore: h,
301
313
  removeAfter: i.position,
302
314
  insertInto: c,
303
315
  deleteInBetween: o
304
316
  };
305
- }, ur = (t, e, r) => {
317
+ }, fr = (t, e, r) => {
306
318
  const n = t.map((c) => b(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
307
319
  if (s === 0) return e;
308
320
  let i = r, o = e;
309
- for (; nt(i, 0) === !1; ) {
321
+ for (; ot(i, 0) === !1; ) {
310
322
  const c = n.findIndex((h) => s > 0 ? o >= h.lower && o < h.upper : o > h.lower && o <= h.upper);
311
323
  if (c !== -1) {
312
324
  const h = n[c];
313
325
  let l;
314
326
  if (s > 0 ? l = q(h.upper, o) : l = q(o, h.lower), l > 0) {
315
- const d = sr(ir(i), l);
316
- if (o = ie(
327
+ const d = ur(lr(i), l);
328
+ if (o = ae(
317
329
  o,
318
330
  s > 0 ? d : -d
319
- ), i = q(i, s > 0 ? d : -d), nt(i, 0)) return o;
331
+ ), i = q(i, s > 0 ? d : -d), ot(i, 0)) return o;
320
332
  continue;
321
333
  }
322
334
  }
@@ -332,7 +344,7 @@ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
332
344
  }
333
345
  }
334
346
  return o;
335
- }, lr = (t, e, r) => {
347
+ }, dr = (t, e, r) => {
336
348
  const n = t.map((o) => b(o));
337
349
  if (e === r) return typeof e == "bigint" ? 0n : 0;
338
350
  const s = e < r ? b([e, r]) : b([r, e]);
@@ -345,276 +357,277 @@ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
345
357
  }
346
358
  }
347
359
  return i;
348
- }, Mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
360
+ }, jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
349
361
  __proto__: null,
350
- CLIP: kn,
351
- DECIMAL: qn,
352
- INFINITE: Pn,
353
- ZERO: Dn,
354
- bounds: nr,
355
- buildInsertionPlan: Jn,
356
- clamp: st,
362
+ CLIP: Wn,
363
+ DECIMAL: Fn,
364
+ INFINITE: Yn,
365
+ ZERO: Zn,
366
+ bounds: or,
367
+ buildInsertionPlan: es,
368
+ clamp: ut,
357
369
  construct: b,
358
- contains: C,
359
- distance: lr,
360
- equals: zn,
361
- findInsertPosition: it,
362
- isFinite: Wn,
363
- isZero: Fn,
364
- linspace: Hn,
365
- makeValid: ar,
366
- max: or,
367
- mean: Vn,
368
- min: Gn,
369
- overlapsWith: Zn,
370
- span: Oe,
371
- spanIsZero: Yn,
372
- traverse: ur
373
- }, Symbol.toStringTag, { value: "Module" })), cr = Un, P = (t) => qe.includes(t) ? t : ze.includes(t) ? "y" : "x", Xn = (t) => P(t) === "x" ? "y" : "x", Kn = (t) => P(t) === "x" ? "width" : "height", Qn = (t) => P(t) === "x" ? "left" : "top", _n = (t) => cr.safeParse(t).success, es = (t) => P(t) === "x" ? "signedWidth" : "signedHeight", ts = (t) => t === "center" ? !1 : P(t) === "x", rs = (t) => P(t) === "y", ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
370
+ contains: j,
371
+ distance: dr,
372
+ equals: Vn,
373
+ findInsertPosition: lt,
374
+ isFinite: Xn,
375
+ isZero: Hn,
376
+ linspace: _n,
377
+ makeValid: cr,
378
+ max: hr,
379
+ mean: Kn,
380
+ min: Qn,
381
+ overlapsWith: Gn,
382
+ span: ve,
383
+ spanIsZero: Jn,
384
+ traverse: fr
385
+ }, Symbol.toStringTag, { value: "Module" })), gr = Dn, k = (t) => Ye.includes(t) ? t : We.includes(t) ? "y" : "x", ts = (t) => k(t) === "x" ? "y" : "x", rs = (t) => k(t) === "x" ? "width" : "height", ns = (t) => k(t) === "x" ? "left" : "top", ss = (t) => gr.safeParse(t).success, is = (t) => k(t) === "x" ? "signedWidth" : "signedHeight", as = (t) => t === "center" ? !1 : k(t) === "x", os = (t) => k(t) === "y", us = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
374
386
  __proto__: null,
375
- DIRECTIONS: qe,
376
- construct: P,
377
- crude: cr,
378
- dimension: Kn,
379
- direction: wt,
380
- isDirection: _n,
381
- isX: ts,
382
- isY: rs,
383
- location: Qn,
384
- signedDimension: es,
385
- swap: Xn
386
- }, Symbol.toStringTag, { value: "Module" })), ss = Ot, is = vt, as = rt, os = {
387
+ DIRECTIONS: Ye,
388
+ construct: k,
389
+ crude: gr,
390
+ dimension: rs,
391
+ direction: xt,
392
+ isDirection: ss,
393
+ isX: as,
394
+ isY: os,
395
+ location: ns,
396
+ signedDimension: is,
397
+ swap: ts
398
+ }, Symbol.toStringTag, { value: "Module" })), ls = Tt, cs = St, hs = at, fs = {
387
399
  top: "bottom",
388
400
  right: "left",
389
401
  bottom: "top",
390
402
  left: "right",
391
403
  center: "center"
392
- }, us = {
404
+ }, ds = {
393
405
  top: "left",
394
406
  right: "top",
395
407
  bottom: "right",
396
408
  left: "bottom",
397
409
  center: "center"
398
- }, ls = Cn, V = (t) => t instanceof String || !qe.includes(t) ? t : t === "x" ? "left" : "top", cs = (t) => os[V(t)], hs = (t) => us[V(t)], pe = (t) => {
399
- const e = V(t);
410
+ }, gs = Pn, G = (t) => t instanceof String || !Ye.includes(t) ? t : t === "x" ? "left" : "top", ps = (t) => fs[G(t)], ms = (t) => ds[G(t)], me = (t) => {
411
+ const e = G(t);
400
412
  return e === "top" || e === "bottom" ? "y" : "x";
401
- }, fs = a.object({
402
- x: Ot.or(rt),
403
- y: vt.or(rt)
404
- }), hr = a.object({ x: Ot, y: vt }), ve = Object.freeze({ x: "left", y: "top" }), $t = Object.freeze({ x: "right", y: "top" }), Ze = Object.freeze({ x: "left", y: "bottom" }), St = Object.freeze({ x: "right", y: "bottom" }), Nt = Object.freeze({ x: "center", y: "center" }), It = Object.freeze({ x: "center", y: "top" }), Mt = Object.freeze({ x: "center", y: "bottom" }), Et = Object.freeze({ x: "right", y: "center" }), At = Object.freeze({ x: "left", y: "center" }), ds = Object.freeze([
405
- At,
406
- Et,
407
- It,
413
+ }, ys = a.object({
414
+ x: Tt.or(at),
415
+ y: St.or(at)
416
+ }), pr = a.object({ x: Tt, y: St }), xe = Object.freeze({ x: "left", y: "top" }), Mt = Object.freeze({ x: "right", y: "top" }), Ve = Object.freeze({ x: "left", y: "bottom" }), Et = Object.freeze({ x: "right", y: "bottom" }), At = Object.freeze({ x: "center", y: "center" }), Bt = Object.freeze({ x: "center", y: "top" }), Ut = Object.freeze({ x: "center", y: "bottom" }), Ct = Object.freeze({ x: "right", y: "center" }), jt = Object.freeze({ x: "left", y: "center" }), ws = Object.freeze([
417
+ jt,
418
+ Ct,
419
+ Bt,
420
+ Ut,
421
+ xe,
408
422
  Mt,
409
- ve,
410
- $t,
411
- Ze,
412
- St,
413
- Nt
414
- ]), Bt = (t, e) => t.x === e.x && t.y === e.y, gs = (t, e) => {
423
+ Ve,
424
+ Et,
425
+ At
426
+ ]), Rt = (t, e) => t.x === e.x && t.y === e.y, bs = (t, e) => {
415
427
  if (typeof e == "object") {
416
428
  let r = !0;
417
429
  return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
418
430
  }
419
431
  return t.x === e || t.y === e;
420
- }, fr = (t) => [t.x, t.y], Ee = (t) => pe(V(t)) === "x", ps = (t) => pe(V(t)) === "y", ms = (t) => `${t.x}${Ht(t.y)}`, ys = (t, e) => {
432
+ }, mr = (t) => [t.x, t.y], Ae = (t) => me(G(t)) === "x", Os = (t) => me(G(t)) === "y", vs = (t) => `${t.x}${_t(t.y)}`, xs = (t, e) => {
421
433
  let r, n;
422
- if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = V(t), n = V(e ?? t)), pe(r) === pe(n) && r !== "center" && n !== "center")
434
+ if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = G(t), n = G(e ?? t)), me(r) === me(n) && r !== "center" && n !== "center")
423
435
  throw new Error(
424
436
  `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
425
437
  );
426
- const s = { ...Nt };
427
- return r === "center" ? Ee(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ee(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
428
- }, bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
438
+ const s = { ...At };
439
+ return r === "center" ? Ae(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Ae(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Ae(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
440
+ }, $s = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
429
441
  __proto__: null,
430
- BOTTOM_CENTER: Mt,
431
- BOTTOM_LEFT: Ze,
432
- BOTTOM_RIGHT: St,
433
- CENTER: Nt,
434
- CENTER_LEFT: At,
435
- CENTER_LOCATIONS: xt,
436
- CENTER_RIGHT: Et,
437
- TOP_CENTER: It,
438
- TOP_LEFT: ve,
439
- TOP_RIGHT: $t,
440
- XY_LOCATIONS: ds,
441
- X_LOCATIONS: ke,
442
- Y_LOCATIONS: ze,
443
- center: as,
444
- construct: V,
445
- constructXY: ys,
446
- corner: hr,
447
- crude: ls,
448
- direction: pe,
449
- isX: Ee,
450
- isY: ps,
451
- location: Tt,
452
- outer: Mn,
453
- rotate90: hs,
454
- swap: cs,
455
- x: ss,
456
- xy: fs,
457
- xyCouple: fr,
458
- xyEquals: Bt,
459
- xyMatches: gs,
460
- xyToString: ms,
461
- y: is
462
- }, Symbol.toStringTag, { value: "Module" })), at = a.union([
442
+ BOTTOM_CENTER: Ut,
443
+ BOTTOM_LEFT: Ve,
444
+ BOTTOM_RIGHT: Et,
445
+ CENTER: At,
446
+ CENTER_LEFT: jt,
447
+ CENTER_LOCATIONS: Nt,
448
+ CENTER_RIGHT: Ct,
449
+ OUTER_LOCATIONS: $t,
450
+ TOP_CENTER: Bt,
451
+ TOP_LEFT: xe,
452
+ TOP_RIGHT: Mt,
453
+ XY_LOCATIONS: ws,
454
+ X_LOCATIONS: Fe,
455
+ Y_LOCATIONS: We,
456
+ center: hs,
457
+ construct: G,
458
+ constructXY: xs,
459
+ corner: pr,
460
+ crude: gs,
461
+ direction: me,
462
+ isX: Ae,
463
+ isY: Os,
464
+ location: It,
465
+ outer: Cn,
466
+ rotate90: ms,
467
+ swap: ps,
468
+ x: ls,
469
+ xy: ys,
470
+ xyCouple: mr,
471
+ xyEquals: Rt,
472
+ xyMatches: bs,
473
+ xyToString: vs,
474
+ y: cs
475
+ }, Symbol.toStringTag, { value: "Module" })), ct = a.union([
463
476
  a.number(),
464
- ge,
465
- Pe,
466
- bt,
467
- $n,
468
- tr
477
+ pe,
478
+ Ze,
479
+ vt,
480
+ En,
481
+ ar
469
482
  ]), v = (t, e) => {
470
483
  if (typeof t == "string") {
471
484
  if (e === void 0) throw new Error("The y coordinate must be given.");
472
485
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
473
486
  }
474
487
  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 };
475
- }, D = Object.freeze({ x: 0, y: 0 }), dr = Object.freeze({ x: 1, y: 1 }), ws = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Os = Object.freeze({ x: NaN, y: NaN }), Re = (t, e, r = 0) => {
488
+ }, P = Object.freeze({ x: 0, y: 0 }), yr = Object.freeze({ x: 1, y: 1 }), Ts = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Ss = Object.freeze({ x: NaN, y: NaN }), De = (t, e, r = 0) => {
476
489
  const n = v(t), s = v(e);
477
490
  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;
478
- }, vs = (t) => Re(t, D), Ut = (t, e, r) => {
491
+ }, Ns = (t) => De(t, P), Lt = (t, e, r) => {
479
492
  const n = v(t), s = v(e, r);
480
493
  return { x: n.x * s.x, y: n.y * s.y };
481
- }, gr = (t, e) => {
494
+ }, wr = (t, e) => {
482
495
  const r = v(t);
483
496
  return { x: r.x + e, y: r.y };
484
- }, pr = (t, e) => {
497
+ }, br = (t, e) => {
485
498
  const r = v(t);
486
499
  return { x: r.x, y: r.y + e };
487
- }, me = (t, e, r, ...n) => {
500
+ }, ye = (t, e, r, ...n) => {
488
501
  if (typeof e == "string") {
489
502
  if (typeof r != "number") throw new Error("The value must be a number.");
490
- return e === "x" ? gr(t, r) : pr(t, r);
503
+ return e === "x" ? wr(t, r) : br(t, r);
491
504
  }
492
505
  if (typeof e == "object" && "x" in e && typeof e.x == "string") {
493
506
  const s = v(r), i = v(t);
494
507
  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 };
495
508
  }
496
- return [t, e, r ?? D, ...n].reduce((s, i) => {
509
+ return [t, e, r ?? P, ...n].reduce((s, i) => {
497
510
  const o = v(i);
498
511
  return { x: s.x + o.x, y: s.y + o.y };
499
- }, D);
500
- }, xs = (t, e, r) => {
512
+ }, P);
513
+ }, Is = (t, e, r) => {
501
514
  const n = v(t);
502
515
  return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
503
- }, Ts = (t, e) => {
516
+ }, Ms = (t, e) => {
504
517
  const r = v(t), n = v(e);
505
518
  return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
506
- }, $s = (t, e) => {
519
+ }, Es = (t, e) => {
507
520
  const r = v(t), n = v(e);
508
521
  return { x: n.x - r.x, y: n.y - r.y };
509
- }, Ss = (t) => {
522
+ }, As = (t) => {
510
523
  const e = v(t);
511
524
  return Number.isNaN(e.x) || Number.isNaN(e.y);
512
- }, Ns = (t) => {
525
+ }, Bs = (t) => {
513
526
  const e = v(t);
514
527
  return Number.isFinite(e.x) && Number.isFinite(e.y);
515
- }, Is = (t) => {
528
+ }, Us = (t) => {
516
529
  const e = v(t);
517
530
  return [e.x, e.y];
518
- }, Ms = (t) => {
531
+ }, Cs = (t) => {
519
532
  const e = v(t);
520
533
  return { left: e.x, top: e.y };
521
- }, ot = (t, e = 0) => {
534
+ }, ht = (t, e = 0) => {
522
535
  const r = v(t);
523
536
  return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
524
- }, oe = (t, e) => {
537
+ }, ue = (t, e) => {
525
538
  const r = v(t), n = v(e);
526
539
  return { x: r.x - n.x, y: r.y - n.y };
527
- }, ue = (t) => {
540
+ }, le = (t) => {
528
541
  const e = v(t), r = Math.hypot(e.x, e.y);
529
542
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
530
- }, mr = (t) => {
543
+ }, Or = (t) => {
531
544
  const e = v(t), r = Math.hypot(e.x, e.y);
532
545
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
533
- }, yr = (...t) => {
534
- const e = t.reduce((r, n) => me(r, n), D);
535
- return Ut(e, 1 / t.length);
536
- }, Es = (t, e) => {
546
+ }, vr = (...t) => {
547
+ const e = t.reduce((r, n) => ye(r, n), P);
548
+ return Lt(e, 1 / t.length);
549
+ }, js = (t, e) => {
537
550
  const r = [];
538
551
  for (let n = 0; n < t.length; n++) {
539
552
  const s = t[n];
540
553
  let i, o, c, h;
541
554
  if (n === 0) {
542
- const l = t[n + 1], d = oe(l, s);
543
- o = ue(d), c = o, h = e;
555
+ const l = t[n + 1], d = ue(l, s);
556
+ o = le(d), c = o, h = e;
544
557
  } else if (n === t.length - 1) {
545
- const l = t[n - 1], d = oe(s, l);
546
- i = ue(d), c = i, h = e;
558
+ const l = t[n - 1], d = ue(s, l);
559
+ i = le(d), c = i, h = e;
547
560
  } else {
548
- const l = t[n - 1], d = t[n + 1], m = oe(s, l), p = oe(d, s);
549
- i = ue(m), o = ue(p);
550
- const R = Math.acos(
551
- (m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
552
- ), A = Math.sin(R / 2);
553
- A === 0 ? h = e : h = e / A, c = mr(yr(i, o));
561
+ const l = t[n - 1], d = t[n + 1], y = ue(s, l), p = ue(d, s);
562
+ i = le(y), o = le(p);
563
+ const L = Math.acos(
564
+ (y.x * p.x + y.y * p.y) / (Math.hypot(y.x, y.y) * Math.hypot(p.x, p.y))
565
+ ), B = Math.sin(L / 2);
566
+ B === 0 ? h = e : h = e / B, c = Or(vr(i, o));
554
567
  }
555
- r.push(Ut(c, h));
568
+ r.push(Lt(c, h));
556
569
  }
557
570
  return r;
558
- }, As = (t) => {
571
+ }, Rs = (t) => {
559
572
  const e = v(t);
560
573
  return { x: e.y, y: e.x };
561
- }, ut = (t) => {
574
+ }, ft = (t) => {
562
575
  const e = v(t);
563
576
  return { x: Math.round(e.x), y: Math.round(e.y) };
564
- }, Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
577
+ }, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
565
578
  __proto__: null,
566
- INFINITY: ws,
567
- NAN: Os,
568
- ONE: dr,
569
- ZERO: D,
570
- average: yr,
571
- calculateMiters: Es,
572
- clientXY: tr,
579
+ INFINITY: Ts,
580
+ NAN: Ss,
581
+ ONE: yr,
582
+ ZERO: P,
583
+ average: vr,
584
+ calculateMiters: js,
585
+ clientXY: ar,
573
586
  construct: v,
574
- couple: Is,
575
- crudeZ: at,
576
- css: Ms,
577
- distance: Ts,
578
- equals: Re,
579
- isFinite: Ns,
580
- isNan: Ss,
581
- isZero: vs,
582
- normal: ue,
583
- normalize: mr,
584
- round: ut,
585
- scale: Ut,
586
- set: xs,
587
- sub: oe,
588
- swap: As,
589
- translate: me,
590
- translateX: gr,
591
- translateY: pr,
592
- translation: $s,
593
- truncate: ot,
594
- xy: ge
595
- }, Symbol.toStringTag, { value: "Module" })), Te = a.union([a.number(), a.string()]), Bs = a.object({
587
+ couple: Us,
588
+ crudeZ: ct,
589
+ css: Cs,
590
+ distance: Ms,
591
+ equals: De,
592
+ isFinite: Bs,
593
+ isNan: As,
594
+ isZero: Ns,
595
+ normal: le,
596
+ normalize: Or,
597
+ round: ft,
598
+ scale: Lt,
599
+ set: Is,
600
+ sub: ue,
601
+ swap: Rs,
602
+ translate: ye,
603
+ translateX: wr,
604
+ translateY: br,
605
+ translation: Es,
606
+ truncate: ht,
607
+ xy: pe
608
+ }, Symbol.toStringTag, { value: "Module" })), Te = a.union([a.number(), a.string()]), Ls = a.object({
596
609
  top: Te,
597
610
  left: Te,
598
611
  width: Te,
599
612
  height: Te
600
- }), Us = a.object({
613
+ }), Ds = a.object({
601
614
  left: a.number(),
602
615
  top: a.number(),
603
616
  right: a.number(),
604
617
  bottom: a.number()
605
- }), Cs = a.object({
606
- one: ge,
607
- two: ge,
608
- root: hr
609
- }), br = { one: D, two: D, root: ve }, js = { one: D, two: dr, root: Ze }, wr = (t, e) => ({
618
+ }), Ps = a.object({
619
+ one: pe,
620
+ two: pe,
621
+ root: pr
622
+ }), xr = { one: P, two: P, root: xe }, ks = { one: P, two: yr, root: Ve }, $r = (t, e) => ({
610
623
  one: t.one,
611
624
  two: t.two,
612
625
  root: e ?? t.root
613
- }), T = (t, e, r = 0, n = 0, s) => {
626
+ }), $ = (t, e, r = 0, n = 0, s) => {
614
627
  const i = {
615
- one: { ...D },
616
- two: { ...D },
617
- root: s ?? ve
628
+ one: { ...P },
629
+ two: { ...P },
630
+ root: s ?? xe
618
631
  };
619
632
  if (typeof t == "number") {
620
633
  if (typeof e != "number")
@@ -628,219 +641,219 @@ const Cn = a.union([wt, Tt, a.instanceof(String)]), se = (t) => (e, r) => {
628
641
  x: i.one.x + e.signedWidth,
629
642
  y: i.one.y + e.signedHeight
630
643
  } : i.two = e, i));
631
- }, Rs = (t, e, r) => {
632
- const n = T(t);
644
+ }, qs = (t, e, r) => {
645
+ const n = $(t);
633
646
  if (typeof e == "string") {
634
647
  if (r == null) throw new Error("Invalid arguments for resize");
635
- const s = P(e);
636
- return T(
648
+ const s = k(e);
649
+ return $(
637
650
  n.one,
638
651
  void 0,
639
- s === "x" ? r : G(n),
640
- s === "y" ? r : H(n),
652
+ s === "x" ? r : H(n),
653
+ s === "y" ? r : J(n),
641
654
  n.root
642
655
  );
643
656
  }
644
- return T(n.one, e, void 0, void 0, n.root);
645
- }, Ls = (t, e, r = !0) => {
646
- const n = T(t);
657
+ return $(n.one, e, void 0, void 0, n.root);
658
+ }, zs = (t, e, r = !0) => {
659
+ const n = $(t);
647
660
  let s = (i, o) => i < o;
648
- return r && (s = (i, o) => i <= o), "one" in e ? s(Y(n), Y(e)) && s(X(e), X(n)) && s(W(n), W(e)) && s(K(e), K(n)) : s(Y(n), e.x) && s(e.x, X(n)) && s(W(n), e.y) && s(e.y, K(n));
649
- }, Ds = (t, e) => Re(t.one, e.one) && Re(t.two, e.two) && Bt(t.root, e.root), Or = (t) => ({
650
- width: G(t),
651
- height: H(t)
652
- }), Ps = (t) => ({
653
- signedWidth: Fe(t),
654
- signedHeight: Ye(t)
655
- }), qs = (t) => ({
656
- top: W(t),
657
- left: Y(t),
658
- width: G(t),
659
- height: H(t)
660
- }), Ct = (t, e, r = !1) => {
661
- const n = P(e) === "y" ? Ye(t) : Fe(t);
661
+ return r && (s = (i, o) => i <= o), "one" in e ? s(W(n), W(e)) && s(K(e), K(n)) && s(V(n), V(e)) && s(Q(e), Q(n)) : s(W(n), e.x) && s(e.x, K(n)) && s(V(n), e.y) && s(e.y, Q(n));
662
+ }, Zs = (t, e) => De(t.one, e.one) && De(t.two, e.two) && Rt(t.root, e.root), Tr = (t) => ({
663
+ width: H(t),
664
+ height: J(t)
665
+ }), Ys = (t) => ({
666
+ signedWidth: Ge(t),
667
+ signedHeight: He(t)
668
+ }), Fs = (t) => ({
669
+ top: V(t),
670
+ left: W(t),
671
+ width: H(t),
672
+ height: J(t)
673
+ }), Dt = (t, e, r = !1) => {
674
+ const n = k(e) === "y" ? He(t) : Ge(t);
662
675
  return r ? n : Math.abs(n);
663
- }, k = (t, e) => {
664
- const r = T(t);
676
+ }, z = (t, e) => {
677
+ const r = $(t);
665
678
  return {
666
- x: e.x === "center" ? lt(r).x : Q(r, e.x),
667
- y: e.y === "center" ? lt(r).y : Q(r, e.y)
679
+ x: e.x === "center" ? dt(r).x : _(r, e.x),
680
+ y: e.y === "center" ? dt(r).y : _(r, e.y)
668
681
  };
669
- }, Q = (t, e) => {
670
- const r = T(t), n = fr(r.root).includes(e) ? Math.min : Math.max;
671
- return ke.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
672
- }, ks = (t) => t.one.x === t.two.x && t.one.y === t.two.y, G = (t) => Ct(t, "x"), H = (t) => Ct(t, "y"), Fe = (t) => {
673
- const e = T(t);
682
+ }, _ = (t, e) => {
683
+ const r = $(t), n = mr(r.root).includes(e) ? Math.min : Math.max;
684
+ return Fe.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
685
+ }, Ws = (t) => t.one.x === t.two.x && t.one.y === t.two.y, H = (t) => Dt(t, "x"), J = (t) => Dt(t, "y"), Ge = (t) => {
686
+ const e = $(t);
674
687
  return e.two.x - e.one.x;
675
- }, Ye = (t) => {
676
- const e = T(t);
688
+ }, He = (t) => {
689
+ const e = $(t);
677
690
  return e.two.y - e.one.y;
678
- }, vr = (t) => k(t, ve), zs = (t) => k(t, It), Zs = (t) => k(t, $t), Fs = (t) => k(t, Ze), Ys = (t) => k(t, Mt), Ws = (t) => k(t, St), Vs = (t) => k(t, At), Gs = (t) => k(t, Et), X = (t) => Q(t, "right"), K = (t) => Q(t, "bottom"), Y = (t) => Q(t, "left"), W = (t) => Q(t, "top"), lt = (t) => me(vr(t), {
679
- x: Fe(t) / 2,
680
- y: Ye(t) / 2
681
- }), jt = (t) => {
682
- const e = T(t);
683
- return e.root.x === "left" ? Y(e) : X(e);
684
- }, Rt = (t) => {
685
- const e = T(t);
686
- return e.root.y === "top" ? W(e) : K(e);
687
- }, Hs = (t) => ({ x: jt(t), y: Rt(t) }), Ae = (t) => {
688
- const e = T(t);
691
+ }, Sr = (t) => z(t, xe), Vs = (t) => z(t, Bt), Gs = (t) => z(t, Mt), Hs = (t) => z(t, Ve), Js = (t) => z(t, Ut), Xs = (t) => z(t, Et), Ks = (t) => z(t, jt), Qs = (t) => z(t, Ct), K = (t) => _(t, "right"), Q = (t) => _(t, "bottom"), W = (t) => _(t, "left"), V = (t) => _(t, "top"), dt = (t) => ye(Sr(t), {
692
+ x: Ge(t) / 2,
693
+ y: He(t) / 2
694
+ }), Pt = (t) => {
695
+ const e = $(t);
696
+ return e.root.x === "left" ? W(e) : K(e);
697
+ }, kt = (t) => {
698
+ const e = $(t);
699
+ return e.root.y === "top" ? V(e) : Q(e);
700
+ }, _s = (t) => ({ x: Pt(t), y: kt(t) }), Be = (t) => {
701
+ const e = $(t);
689
702
  return { lower: e.one.x, upper: e.two.x };
690
- }, Be = (t) => {
691
- const e = T(t);
703
+ }, Ue = (t) => {
704
+ const e = $(t);
692
705
  return { lower: e.one.y, upper: e.two.y };
693
- }, Js = (t, e) => wr(t, e), Xs = (t, e) => {
694
- const r = T(t), n = ke.includes(e) ? "x" : ze.includes(e) ? "y" : null;
706
+ }, ei = (t, e) => $r(t, e), ti = (t, e) => {
707
+ const r = $(t), n = Fe.includes(e) ? "x" : We.includes(e) ? "y" : null;
695
708
  if (n === null) throw new Error(`Invalid location: ${e}`);
696
709
  const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
697
710
  return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
698
- }, Ks = (t, e) => {
699
- const r = T(t), n = T(e), s = jt(n) + (G(n) - G(r)) / 2, i = Rt(n) + (H(n) - H(r)) / 2;
700
- return T({ x: s, y: i }, Or(r));
701
- }, xr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Qs = (t) => G(t) / H(t), _s = (t, e, r) => {
711
+ }, ri = (t, e) => {
712
+ const r = $(t), n = $(e), s = Pt(n) + (H(n) - H(r)) / 2, i = kt(n) + (J(n) - J(r)) / 2;
713
+ return $({ x: s, y: i }, Tr(r));
714
+ }, Nr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, ni = (t) => H(t) / J(t), si = (t, e, r) => {
702
715
  if (typeof e == "string") {
703
716
  if (r == null) throw new Error("Undefined amount passed into box.translate");
704
- const s = P(e);
717
+ const s = k(e);
705
718
  e = v(s, r);
706
719
  }
707
- const n = T(t);
708
- return T(
709
- me(n.one, e),
710
- me(n.two, e),
720
+ const n = $(t);
721
+ return $(
722
+ ye(n.one, e),
723
+ ye(n.two, e),
711
724
  void 0,
712
725
  void 0,
713
726
  n.root
714
727
  );
715
- }, ei = (t, e) => {
716
- const r = Math.max(Y(t), Y(e)), n = Math.max(W(t), W(e)), s = Math.min(X(t), X(e)), i = Math.min(K(t), K(e));
717
- return r > s || n > i ? br : T({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
718
- }, ti = (t) => G(t) * H(t), ri = (t, e) => {
719
- const r = T(t);
720
- return T(
721
- ot(r.one, e),
722
- ot(r.two, e),
728
+ }, ii = (t, e) => {
729
+ const r = Math.max(W(t), W(e)), n = Math.max(V(t), V(e)), s = Math.min(K(t), K(e)), i = Math.min(Q(t), Q(e));
730
+ return r > s || n > i ? xr : $({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
731
+ }, ai = (t) => H(t) * J(t), oi = (t, e) => {
732
+ const r = $(t);
733
+ return $(
734
+ ht(r.one, e),
735
+ ht(r.two, e),
723
736
  void 0,
724
737
  void 0,
725
738
  r.root
726
739
  );
727
- }, ni = (t, e, r, n, s, i) => {
740
+ }, ui = (t, e, r, n, s, i) => {
728
741
  const o = { x: t, y: e }, c = { x: t + r, y: e + n };
729
- return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), T(o, c, void 0, void 0, i);
730
- }, si = (t) => {
731
- const e = T(t);
732
- return T(ut(e.one), ut(e.two), void 0, void 0, e.root);
733
- }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
742
+ return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), $(o, c, void 0, void 0, i);
743
+ }, li = (t) => {
744
+ const e = $(t);
745
+ return $(ft(e.one), ft(e.two), void 0, void 0, e.root);
746
+ }, Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
734
747
  __proto__: null,
735
- DECIMAL: js,
736
- ZERO: br,
737
- area: ti,
738
- areaIsZero: ks,
739
- aspect: Qs,
740
- bottom: K,
741
- bottomCenter: Ys,
742
- bottomLeft: Fs,
743
- bottomRight: Ws,
744
- box: Cs,
745
- center: lt,
746
- centerLeft: Vs,
747
- centerRight: Gs,
748
- construct: T,
749
- constructWithAlternateRoot: ni,
750
- contains: Ls,
751
- copy: wr,
752
- css: qs,
753
- cssBox: Bs,
754
- dim: Ct,
755
- dims: Or,
756
- domRect: Us,
757
- edgePoints: Xs,
758
- equals: Ds,
759
- height: H,
760
- intersection: ei,
761
- isBox: xr,
762
- left: Y,
763
- loc: Q,
764
- positionInCenter: Ks,
765
- reRoot: Js,
766
- resize: Rs,
767
- right: X,
768
- root: Hs,
769
- round: si,
770
- signedDims: Ps,
771
- signedHeight: Ye,
772
- signedWidth: Fe,
773
- top: W,
774
- topCenter: zs,
775
- topLeft: vr,
776
- topRight: Zs,
777
- translate: _s,
778
- truncate: ri,
779
- width: G,
780
- x: jt,
781
- xBounds: Ae,
782
- xyLoc: k,
783
- y: Rt,
784
- yBounds: Be
785
- }, Symbol.toStringTag, { value: "Module" })), Tr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ii = a.union([bt, Tr, ge, Pe]), ai = { width: 0, height: 0 }, oi = { width: 1, height: 1 }, j = (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 }, ui = (t, e) => {
748
+ DECIMAL: ks,
749
+ ZERO: xr,
750
+ area: ai,
751
+ areaIsZero: Ws,
752
+ aspect: ni,
753
+ bottom: Q,
754
+ bottomCenter: Js,
755
+ bottomLeft: Hs,
756
+ bottomRight: Xs,
757
+ box: Ps,
758
+ center: dt,
759
+ centerLeft: Ks,
760
+ centerRight: Qs,
761
+ construct: $,
762
+ constructWithAlternateRoot: ui,
763
+ contains: zs,
764
+ copy: $r,
765
+ css: Fs,
766
+ cssBox: Ls,
767
+ dim: Dt,
768
+ dims: Tr,
769
+ domRect: Ds,
770
+ edgePoints: ti,
771
+ equals: Zs,
772
+ height: J,
773
+ intersection: ii,
774
+ isBox: Nr,
775
+ left: W,
776
+ loc: _,
777
+ positionInCenter: ri,
778
+ reRoot: ei,
779
+ resize: qs,
780
+ right: K,
781
+ root: _s,
782
+ round: li,
783
+ signedDims: Ys,
784
+ signedHeight: He,
785
+ signedWidth: Ge,
786
+ top: V,
787
+ topCenter: Vs,
788
+ topLeft: Sr,
789
+ topRight: Gs,
790
+ translate: si,
791
+ truncate: oi,
792
+ width: H,
793
+ x: Pt,
794
+ xBounds: Be,
795
+ xyLoc: z,
796
+ y: kt,
797
+ yBounds: Ue
798
+ }, Symbol.toStringTag, { value: "Module" })), Ir = a.object({ signedWidth: a.number(), signedHeight: a.number() }), ci = a.union([vt, Ir, pe, Ze]), hi = { width: 0, height: 0 }, fi = { width: 1, height: 1 }, R = (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 }, di = (t, e) => {
786
799
  if (e == null) return !1;
787
- const r = j(t), n = j(e);
800
+ const r = R(t), n = R(e);
788
801
  return r.width === n.width && r.height === n.height;
789
- }, li = (t) => {
790
- const e = j(t);
802
+ }, gi = (t) => {
803
+ const e = R(t);
791
804
  return { width: e.height, height: e.width };
792
- }, ci = (t) => {
793
- const e = j(t);
805
+ }, pi = (t) => {
806
+ const e = R(t);
794
807
  return `0 0 ${e.width} ${e.height}`;
795
- }, hi = (t) => {
796
- const e = j(t);
808
+ }, mi = (t) => {
809
+ const e = R(t);
797
810
  return [e.width, e.height];
798
- }, fi = (t) => ({
799
- width: Math.max(...t.map((e) => j(e).width)),
800
- height: Math.max(...t.map((e) => j(e).height))
801
- }), di = (t) => ({
802
- width: Math.min(...t.map((e) => j(e).width)),
803
- height: Math.min(...t.map((e) => j(e).height))
804
- }), gi = (t, e) => {
805
- const r = j(t);
811
+ }, yi = (t) => ({
812
+ width: Math.max(...t.map((e) => R(e).width)),
813
+ height: Math.max(...t.map((e) => R(e).height))
814
+ }), wi = (t) => ({
815
+ width: Math.min(...t.map((e) => R(e).width)),
816
+ height: Math.min(...t.map((e) => R(e).height))
817
+ }), bi = (t, e) => {
818
+ const r = R(t);
806
819
  return { width: r.width * e, height: r.height * e };
807
- }, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
820
+ }, Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
808
821
  __proto__: null,
809
- DECIMAL: oi,
810
- ZERO: ai,
811
- construct: j,
812
- couple: hi,
813
- crude: ii,
814
- dimensions: bt,
815
- equals: ui,
816
- max: fi,
817
- min: di,
818
- scale: gi,
819
- signed: Tr,
820
- svgViewBox: ci,
821
- swap: li
822
- }, Symbol.toStringTag, { value: "Module" })), pi = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, mi = a.object({ offset: at, scale: at }), yi = a.object({ offset: a.number(), scale: a.number() }), bi = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
822
+ DECIMAL: fi,
823
+ ZERO: hi,
824
+ construct: R,
825
+ couple: mi,
826
+ crude: ci,
827
+ dimensions: vt,
828
+ equals: di,
829
+ max: yi,
830
+ min: wi,
831
+ scale: bi,
832
+ signed: Ir,
833
+ svgViewBox: pi,
834
+ swap: gi
835
+ }, Symbol.toStringTag, { value: "Module" })), Oi = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, vi = a.object({ offset: ct, scale: ct }), xi = a.object({ offset: a.number(), scale: a.number() }), $i = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
823
836
  e,
824
837
  s ? n - t : n + t
825
- ], wi = (t) => (e, r, n, s) => [
838
+ ], Ti = (t) => (e, r, n, s) => [
826
839
  e,
827
840
  s ? n / t : n * t
828
- ], Oi = (t) => (e, r, n) => {
841
+ ], Si = (t) => (e, r, n) => {
829
842
  if (e === null) return [t, n];
830
843
  const { lower: s, upper: i } = e, { lower: o, upper: c } = t, h = i - s, l = c - o;
831
844
  if (r === "dimension") return [t, n * (l / h)];
832
845
  const d = (n - s) * (l / h) + o;
833
846
  return [t, d];
834
- }, vi = (t) => (e, r, n) => [t, n], xi = () => (t, e, r) => {
847
+ }, Ni = (t) => (e, r, n) => [t, n], Ii = () => (t, e, r) => {
835
848
  if (t === null) throw new Error("cannot invert without bounds");
836
849
  if (e === "dimension") return [t, r];
837
850
  const { lower: n, upper: s } = t;
838
851
  return [t, s - (r - n)];
839
- }, Ti = (t) => (e, r, n) => {
852
+ }, Mi = (t) => (e, r, n) => {
840
853
  const { lower: s, upper: i } = t;
841
- return n = pi(n, s, i), [e, n];
854
+ return n = Oi(n, s, i), [e, n];
842
855
  };
843
- let ct = class te {
856
+ let gt = class re {
844
857
  ops = [];
845
858
  currBounds = null;
846
859
  currType = null;
@@ -854,7 +867,7 @@ let ct = class te {
854
867
  * @param value - The amount to translate by.
855
868
  */
856
869
  static translate(e) {
857
- return new te().translate(e);
870
+ return new re().translate(e);
858
871
  }
859
872
  /**
860
873
  * @returns a new scale with a magnification as its first operation. Any number provided
@@ -862,10 +875,10 @@ let ct = class te {
862
875
  * @param value - The amount to translate by.
863
876
  */
864
877
  static magnify(e) {
865
- return new te().magnify(e);
878
+ return new re().magnify(e);
866
879
  }
867
880
  static scale(e, r) {
868
- return new te().scale(e, r);
881
+ return new re().scale(e, r);
869
882
  }
870
883
  /**
871
884
  * @returns a copy of the scale with a translation as its next operation. Any
@@ -874,7 +887,7 @@ let ct = class te {
874
887
  * @param value - The amount to translate by.
875
888
  */
876
889
  translate(e) {
877
- const r = this.new(), n = bi(e);
890
+ const r = this.new(), n = $i(e);
878
891
  return n.type = "translate", r.ops.push(n), r;
879
892
  }
880
893
  /**
@@ -884,23 +897,23 @@ let ct = class te {
884
897
  * @param value - The amount to magnify by.
885
898
  */
886
899
  magnify(e) {
887
- const r = this.new(), n = wi(e);
900
+ const r = this.new(), n = Ti(e);
888
901
  return n.type = "magnify", r.ops.push(n), r;
889
902
  }
890
903
  scale(e, r) {
891
- const n = b(e, r), s = this.new(), i = Oi(n);
904
+ const n = b(e, r), s = this.new(), i = Si(n);
892
905
  return i.type = "scale", s.ops.push(i), s;
893
906
  }
894
907
  clamp(e, r) {
895
- const n = b(e, r), s = this.new(), i = Ti(n);
908
+ const n = b(e, r), s = this.new(), i = Mi(n);
896
909
  return i.type = "clamp", s.ops.push(i), s;
897
910
  }
898
911
  reBound(e, r) {
899
- const n = b(e, r), s = this.new(), i = vi(n);
912
+ const n = b(e, r), s = this.new(), i = Ni(n);
900
913
  return i.type = "re-bound", s.ops.push(i), s;
901
914
  }
902
915
  invert() {
903
- const e = xi();
916
+ const e = Ii();
904
917
  e.type = "invert";
905
918
  const r = this.new();
906
919
  return r.ops.push(e), r;
@@ -912,7 +925,7 @@ let ct = class te {
912
925
  return this.exec("dimension", e);
913
926
  }
914
927
  new() {
915
- const e = new te();
928
+ const e = new re();
916
929
  return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
917
930
  }
918
931
  exec(e, r) {
@@ -938,34 +951,34 @@ let ct = class te {
938
951
  get transform() {
939
952
  return { scale: this.dim(1), offset: this.pos(0) };
940
953
  }
941
- static IDENTITY = new te();
942
- }, $i = class L {
954
+ static IDENTITY = new re();
955
+ }, Ei = class D {
943
956
  x;
944
957
  y;
945
958
  currRoot;
946
- constructor(e = new ct(), r = new ct(), n = null) {
959
+ constructor(e = new gt(), r = new gt(), n = null) {
947
960
  this.x = e, this.y = r, this.currRoot = n;
948
961
  }
949
962
  static translate(e, r) {
950
- return new L().translate(e, r);
963
+ return new D().translate(e, r);
951
964
  }
952
965
  static translateX(e) {
953
- return new L().translateX(e);
966
+ return new D().translateX(e);
954
967
  }
955
968
  static translateY(e) {
956
- return new L().translateY(e);
969
+ return new D().translateY(e);
957
970
  }
958
971
  static clamp(e) {
959
- return new L().clamp(e);
972
+ return new D().clamp(e);
960
973
  }
961
974
  static magnify(e) {
962
- return new L().magnify(e);
975
+ return new D().magnify(e);
963
976
  }
964
977
  static scale(e) {
965
- return new L().scale(e);
978
+ return new D().scale(e);
966
979
  }
967
980
  static reBound(e) {
968
- return new L().reBound(e);
981
+ return new D().reBound(e);
969
982
  }
970
983
  translate(e, r) {
971
984
  const n = v(e, r), s = this.copy();
@@ -985,22 +998,22 @@ let ct = class te {
985
998
  }
986
999
  scale(e) {
987
1000
  const r = this.copy();
988
- if (xr(e)) {
1001
+ if (Nr(e)) {
989
1002
  const n = this.currRoot;
990
- return r.currRoot = e.root, n != null && !Bt(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ae(e)), r.y = r.y.scale(Be(e)), r;
1003
+ return r.currRoot = e.root, n != null && !Rt(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(Ue(e)), r;
991
1004
  }
992
1005
  return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
993
1006
  }
994
1007
  reBound(e) {
995
1008
  const r = this.copy();
996
- return r.x = this.x.reBound(Ae(e)), r.y = this.y.reBound(Be(e)), r;
1009
+ return r.x = this.x.reBound(Be(e)), r.y = this.y.reBound(Ue(e)), r;
997
1010
  }
998
1011
  clamp(e) {
999
1012
  const r = this.copy();
1000
- return r.x = this.x.clamp(Ae(e)), r.y = this.y.clamp(Be(e)), r;
1013
+ return r.x = this.x.clamp(Be(e)), r.y = this.y.clamp(Ue(e)), r;
1001
1014
  }
1002
1015
  copy() {
1003
- const e = new L();
1016
+ const e = new D();
1004
1017
  return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
1005
1018
  }
1006
1019
  reverse() {
@@ -1014,7 +1027,7 @@ let ct = class te {
1014
1027
  return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
1015
1028
  }
1016
1029
  box(e) {
1017
- return T(
1030
+ return $(
1018
1031
  this.pos(e.one),
1019
1032
  this.pos(e.two),
1020
1033
  0,
@@ -1028,31 +1041,31 @@ let ct = class te {
1028
1041
  offset: this.pos({ x: 0, y: 0 })
1029
1042
  };
1030
1043
  }
1031
- static IDENTITY = new L();
1044
+ static IDENTITY = new D();
1032
1045
  };
1033
- const Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1046
+ const Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1034
1047
  __proto__: null,
1035
- Scale: ct,
1036
- XY: $i,
1037
- crudeXYTransform: mi,
1038
- transform: yi
1048
+ Scale: gt,
1049
+ XY: Ei,
1050
+ crudeXYTransform: vi,
1051
+ transform: xi
1039
1052
  }, Symbol.toStringTag, { value: "Module" }));
1040
- let $r = (t, e = 21) => (r = e) => {
1053
+ let Mr = (t, e = 21) => (r = e) => {
1041
1054
  let n = "", s = r | 0;
1042
1055
  for (; s--; )
1043
1056
  n += t[Math.random() * t.length | 0];
1044
1057
  return n;
1045
1058
  };
1046
- const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Si = `0123456789${Sr}`, Nr = 11, Ni = $r(Sr, 1), Ii = $r(Si, Nr - 1), Lt = () => `${Ni()}${Ii()}`, Co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1059
+ const Er = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Ai = `0123456789${Er}`, Ar = 11, Bi = Mr(Er, 1), Ui = Mr(Ai, Ar - 1), qt = () => `${Bi()}${Ui()}`, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1047
1060
  __proto__: null,
1048
- LENGTH: Nr,
1049
- create: Lt
1050
- }, Symbol.toStringTag, { value: "Module" })), Mi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ei = a.enum(["static", "dynamic"]), Ai = a.union([
1061
+ LENGTH: Ar,
1062
+ create: qt
1063
+ }, Symbol.toStringTag, { value: "Module" })), Ci = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, ji = a.enum(["static", "dynamic"]), Ri = a.union([
1051
1064
  a.tuple([a.int()]),
1052
1065
  a.tuple([a.int(), a.int().min(1).max(12)]),
1053
1066
  a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
1054
- ]), Ir = (t, e) => {
1055
- const r = new y(e);
1067
+ ]), Br = (t, e) => {
1068
+ const r = new w(e);
1056
1069
  if (![
1057
1070
  O.DAY,
1058
1071
  O.HOUR,
@@ -1066,9 +1079,9 @@ const Sr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Si = `0123456
1066
1079
  "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
1067
1080
  );
1068
1081
  const n = t.valueOf() % r.valueOf();
1069
- return t instanceof y ? new y(n) : new O(n);
1082
+ return t instanceof w ? new w(n) : new O(n);
1070
1083
  };
1071
- let y = class f extends _ {
1084
+ let w = class f extends ee {
1072
1085
  constructor(e, r = "UTC") {
1073
1086
  if (e == null) super(f.now().valueOf());
1074
1087
  else if (e instanceof Date)
@@ -1078,7 +1091,7 @@ let y = class f extends _ {
1078
1091
  else if (Array.isArray(e)) super(f.parseDate(e));
1079
1092
  else {
1080
1093
  let n = 0n;
1081
- e instanceof Number && (e = e.valueOf()), r === "local" && (n = f.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = f.MAX : e = f.MIN)), super(BigInt(e.valueOf()) + n);
1094
+ e instanceof Number && (e = e.valueOf()), r === "local" && (n = f.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = f.MAX : e = f.MIN)), A(e) && (e = e.value), super(BigInt(e.valueOf()) + n);
1082
1095
  }
1083
1096
  }
1084
1097
  static parseDate([e = 1970, r = 1, n = 1]) {
@@ -1191,7 +1204,7 @@ let y = class f extends _ {
1191
1204
  * valid, regardless of the TimeStamp order.
1192
1205
  */
1193
1206
  range(e) {
1194
- return new J(this, e).makeValid();
1207
+ return new X(this, e).makeValid();
1195
1208
  }
1196
1209
  /**
1197
1210
  * Creates a TimeRange starting at the TimeStamp and spanning the given
@@ -1260,7 +1273,7 @@ let y = class f extends _ {
1260
1273
  * TimeSpan.
1261
1274
  */
1262
1275
  add(e) {
1263
- return new f(ie(this.valueOf(), new O(e).valueOf()));
1276
+ return new f(ae(this.valueOf(), new O(e).valueOf()));
1264
1277
  }
1265
1278
  /**
1266
1279
  * Subtracts a TimeSpan from the TimeStamp.
@@ -1358,13 +1371,27 @@ let y = class f extends _ {
1358
1371
  get hour() {
1359
1372
  return this.date().getUTCHours();
1360
1373
  }
1374
+ /**
1375
+ * @returns the integer hour that the timestamp corresponds to within its day in local time.
1376
+ */
1377
+ get localHour() {
1378
+ return this.date().getHours();
1379
+ }
1380
+ /**
1381
+ * @returns a copy of the timestamp with the hour changed.
1382
+ * @param hour the value to set the hour to.
1383
+ */
1384
+ setLocalHour(e) {
1385
+ const r = this.date();
1386
+ return r.setHours(e), new f(r);
1387
+ }
1361
1388
  /**
1362
1389
  * @returns a copy of the timestamp with the hour changed.
1363
1390
  * @param hour the value to set the hour to.
1364
1391
  */
1365
1392
  setHour(e) {
1366
1393
  const r = this.date();
1367
- return r.setUTCHours(e), new f(r, "UTC");
1394
+ return r.setUTCHours(e), new f(r);
1368
1395
  }
1369
1396
  /** @returns the integer minute that the timestamp corresponds to within its hour. */
1370
1397
  get minute() {
@@ -1424,7 +1451,7 @@ let y = class f extends _ {
1424
1451
  * @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
1425
1452
  */
1426
1453
  remainder(e) {
1427
- return Ir(this, e);
1454
+ return Br(this, e);
1428
1455
  }
1429
1456
  /** @returns true if the day portion TimeStamp is today, false otherwise. */
1430
1457
  get isToday() {
@@ -1537,7 +1564,7 @@ let y = class f extends _ {
1537
1564
  a.bigint().transform((e) => new f(e)),
1538
1565
  a.date().transform((e) => new f(e)),
1539
1566
  a.custom((e) => e instanceof O).transform((e) => new f(e)),
1540
- Ai.transform((e) => new f(e))
1567
+ Ri.transform((e) => new f(e))
1541
1568
  ]);
1542
1569
  /**
1543
1570
  * Sorts two timestamps.
@@ -1550,9 +1577,9 @@ let y = class f extends _ {
1550
1577
  static sort(e, r) {
1551
1578
  return Number(e.valueOf() - r.valueOf());
1552
1579
  }
1553
- }, O = class g extends _ {
1580
+ }, O = class g extends ee {
1554
1581
  constructor(e) {
1555
- typeof e == "number" && (e = Math.trunc(e.valueOf())), super(BigInt(e.valueOf()));
1582
+ typeof e == "number" && (e = Math.trunc(e.valueOf())), A(e) && (e = e.value), super(BigInt(e.valueOf()));
1556
1583
  }
1557
1584
  /**
1558
1585
  * Creates a TimeSpan representing the given number of seconds.
@@ -1561,7 +1588,7 @@ let y = class f extends _ {
1561
1588
  * @returns A TimeSpan representing the given number of seconds.
1562
1589
  */
1563
1590
  static fromSeconds(e) {
1564
- return e instanceof g ? e : e instanceof E ? e.period : e instanceof y ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e);
1591
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof w ? new g(e) : (A(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? g.seconds(e) : new g(e));
1565
1592
  }
1566
1593
  /**
1567
1594
  * Creates a TimeSpan representing the given number of milliseconds.
@@ -1570,7 +1597,7 @@ let y = class f extends _ {
1570
1597
  * @returns A TimeSpan representing the given number of milliseconds.
1571
1598
  */
1572
1599
  static fromMilliseconds(e) {
1573
- return e instanceof g ? e : e instanceof E ? e.period : e instanceof y ? new g(e) : ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e);
1600
+ return e instanceof g ? e : e instanceof E ? e.period : e instanceof w ? new g(e) : (A(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? g.milliseconds(e) : new g(e));
1574
1601
  }
1575
1602
  /**
1576
1603
  * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
@@ -1622,7 +1649,7 @@ let y = class f extends _ {
1622
1649
  * @returns A new TimeSpan representing the remainder.
1623
1650
  */
1624
1651
  remainder(e) {
1625
- return Ir(this, e);
1652
+ return Br(this, e);
1626
1653
  }
1627
1654
  /**
1628
1655
  * Truncates the TimeSpan to the nearest multiple of the given span.
@@ -1641,9 +1668,9 @@ let y = class f extends _ {
1641
1668
  * @returns A string representation of the TimeSpan.
1642
1669
  */
1643
1670
  toString() {
1644
- const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), m = s.sub(n), p = i.sub(s), R = o.sub(i), A = c.sub(o);
1645
- let z = "";
1646
- return h.isZero || (z += `${h.days}d `), l.isZero || (z += `${l.hours}h `), d.isZero || (z += `${d.minutes}m `), m.isZero || (z += `${m.seconds}s `), p.isZero || (z += `${p.milliseconds}ms `), R.isZero || (z += `${R.microseconds}µs `), A.isZero || (z += `${A.nanoseconds}ns`), z.trim();
1671
+ const e = this.truncate(g.DAY), r = this.truncate(g.HOUR), n = this.truncate(g.MINUTE), s = this.truncate(g.SECOND), i = this.truncate(g.MILLISECOND), o = this.truncate(g.MICROSECOND), c = this.truncate(g.NANOSECOND), h = e, l = r.sub(e), d = n.sub(r), y = s.sub(n), p = i.sub(s), L = o.sub(i), B = c.sub(o);
1672
+ let Z = "";
1673
+ return h.isZero || (Z += `${h.days}d `), l.isZero || (Z += `${l.hours}h `), d.isZero || (Z += `${d.minutes}m `), y.isZero || (Z += `${y.seconds}s `), p.isZero || (Z += `${p.milliseconds}ms `), L.isZero || (Z += `${L.microseconds}µs `), B.isZero || (Z += `${B.nanoseconds}ns`), Z.trim();
1647
1674
  }
1648
1675
  /**
1649
1676
  * Multiplies the TimeSpan by a scalar value.
@@ -1652,7 +1679,7 @@ let y = class f extends _ {
1652
1679
  * @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
1653
1680
  */
1654
1681
  mult(e) {
1655
- return new g(U(this.valueOf(), e));
1682
+ return new g(C(this.valueOf(), e));
1656
1683
  }
1657
1684
  /**
1658
1685
  * Divides the TimeSpan by a scalar value.
@@ -1661,7 +1688,7 @@ let y = class f extends _ {
1661
1688
  * @returns A new TimeSpan that is this TimeSpan divided by the provided value.
1662
1689
  */
1663
1690
  div(e) {
1664
- return new g(we(this.valueOf(), e));
1691
+ return new g(Oe(this.valueOf(), e));
1665
1692
  }
1666
1693
  /** @returns the decimal number of days in the TimeSpan. */
1667
1694
  get days() {
@@ -1741,7 +1768,7 @@ let y = class f extends _ {
1741
1768
  * @returns A TimeSpan representing the given number of microseconds.
1742
1769
  */
1743
1770
  static microseconds(e = 1) {
1744
- return g.nanoseconds(U(e, 1e3));
1771
+ return g.nanoseconds(C(e, 1e3));
1745
1772
  }
1746
1773
  /** A microsecond. */
1747
1774
  static MICROSECOND = g.microseconds(1);
@@ -1752,7 +1779,7 @@ let y = class f extends _ {
1752
1779
  * @returns A TimeSpan representing the given number of milliseconds.
1753
1780
  */
1754
1781
  static milliseconds(e = 1) {
1755
- return g.microseconds(U(e, 1e3));
1782
+ return g.microseconds(C(e, 1e3));
1756
1783
  }
1757
1784
  /** A millisecond. */
1758
1785
  static MILLISECOND = g.milliseconds(1);
@@ -1763,7 +1790,7 @@ let y = class f extends _ {
1763
1790
  * @returns A TimeSpan representing the given number of seconds.
1764
1791
  */
1765
1792
  static seconds(e = 1) {
1766
- return g.milliseconds(U(e, 1e3));
1793
+ return g.milliseconds(C(e, 1e3));
1767
1794
  }
1768
1795
  /** A second. */
1769
1796
  static SECOND = g.seconds(1);
@@ -1774,7 +1801,7 @@ let y = class f extends _ {
1774
1801
  * @returns A TimeSpan representing the given number of minutes.
1775
1802
  */
1776
1803
  static minutes(e = 1) {
1777
- return g.seconds(U(e, 60));
1804
+ return g.seconds(C(e, 60));
1778
1805
  }
1779
1806
  /** A minute. */
1780
1807
  static MINUTE = g.minutes(1);
@@ -1785,7 +1812,7 @@ let y = class f extends _ {
1785
1812
  * @returns A TimeSpan representing the given number of hours.
1786
1813
  */
1787
1814
  static hours(e) {
1788
- return g.minutes(U(e, 60));
1815
+ return g.minutes(C(e, 60));
1789
1816
  }
1790
1817
  /** Represents an hour. */
1791
1818
  static HOUR = g.hours(1);
@@ -1796,7 +1823,7 @@ let y = class f extends _ {
1796
1823
  * @returns A TimeSpan representing the given number of days.
1797
1824
  */
1798
1825
  static days(e) {
1799
- return g.hours(U(e, 24));
1826
+ return g.hours(C(e, 24));
1800
1827
  }
1801
1828
  /** Represents a day. */
1802
1829
  static DAY = g.days(1);
@@ -1813,13 +1840,13 @@ let y = class f extends _ {
1813
1840
  a.number().transform((e) => new g(e)),
1814
1841
  a.bigint().transform((e) => new g(e)),
1815
1842
  a.instanceof(g),
1816
- a.instanceof(y).transform((e) => new g(e)),
1843
+ a.instanceof(w).transform((e) => new g(e)),
1817
1844
  a.custom((e) => e instanceof E).transform((e) => new g(e))
1818
1845
  ]);
1819
1846
  };
1820
- class E extends _ {
1847
+ class E extends ee {
1821
1848
  constructor(e) {
1822
- super(e.valueOf());
1849
+ A(e) && (e = e.value), super(e.valueOf());
1823
1850
  }
1824
1851
  /** @returns a pretty string representation of the rate in the format "X Hz". */
1825
1852
  toString() {
@@ -1873,7 +1900,7 @@ class E extends _ {
1873
1900
  * @returns A TimeSpan that corresponds to the given number of bytes.
1874
1901
  */
1875
1902
  byteSpan(e, r) {
1876
- return this.span(e.valueOf() / r.valueOf());
1903
+ return this.span(e.valueOf() / new I(r).valueOf());
1877
1904
  }
1878
1905
  /**
1879
1906
  * Adds another Rate to this Rate.
@@ -1882,7 +1909,7 @@ class E extends _ {
1882
1909
  * @returns A new Rate representing the sum of the two rates.
1883
1910
  */
1884
1911
  add(e) {
1885
- return new E(ie(this.valueOf(), e.valueOf()));
1912
+ return new E(ae(this.valueOf(), new E(e).valueOf()));
1886
1913
  }
1887
1914
  /**
1888
1915
  * Subtracts another Rate from this Rate.
@@ -1891,7 +1918,7 @@ class E extends _ {
1891
1918
  * @returns A new Rate representing the difference of the two rates.
1892
1919
  */
1893
1920
  sub(e) {
1894
- return new E(q(this.valueOf(), e.valueOf()));
1921
+ return new E(q(this.valueOf(), new E(e).valueOf()));
1895
1922
  }
1896
1923
  /**
1897
1924
  * Multiplies this Rate by a scalar value.
@@ -1900,7 +1927,7 @@ class E extends _ {
1900
1927
  * @returns A new Rate representing this Rate multiplied by the value.
1901
1928
  */
1902
1929
  mult(e) {
1903
- return new E(U(this.valueOf(), e));
1930
+ return new E(C(this.valueOf(), e));
1904
1931
  }
1905
1932
  /**
1906
1933
  * Divides this Rate by a scalar value.
@@ -1909,7 +1936,7 @@ class E extends _ {
1909
1936
  * @returns A new Rate representing this Rate divided by the value.
1910
1937
  */
1911
1938
  div(e) {
1912
- return new E(we(this.valueOf(), e));
1939
+ return new E(Oe(this.valueOf(), e));
1913
1940
  }
1914
1941
  /**
1915
1942
  * Creates a Rate representing the given number of Hz.
@@ -1935,7 +1962,7 @@ class E extends _ {
1935
1962
  a.instanceof(E)
1936
1963
  ]);
1937
1964
  }
1938
- let I = class M extends _ {
1965
+ let I = class M extends ee {
1939
1966
  /**
1940
1967
  * Creates a Density representing the given number of bytes per value.
1941
1968
  *
@@ -1944,7 +1971,7 @@ let I = class M extends _ {
1944
1971
  * @returns A Density representing the given number of bytes per value.
1945
1972
  */
1946
1973
  constructor(e) {
1947
- super(e.valueOf());
1974
+ A(e) && (e = e.value), super(e.valueOf());
1948
1975
  }
1949
1976
  /**
1950
1977
  * Calculates the number of values in the given Size.
@@ -1962,7 +1989,7 @@ let I = class M extends _ {
1962
1989
  * @returns A Size representing the given number of values.
1963
1990
  */
1964
1991
  size(e) {
1965
- return new Le(e * this.valueOf());
1992
+ return new Pe(e * this.valueOf());
1966
1993
  }
1967
1994
  /**
1968
1995
  * Adds another Density to this Density.
@@ -1971,7 +1998,7 @@ let I = class M extends _ {
1971
1998
  * @returns A new Density representing the sum of the two densities.
1972
1999
  */
1973
2000
  add(e) {
1974
- return new M(ie(this.valueOf(), e.valueOf()));
2001
+ return new M(ae(this.valueOf(), new M(e).valueOf()));
1975
2002
  }
1976
2003
  /**
1977
2004
  * Subtracts another Density from this Density.
@@ -1980,7 +2007,7 @@ let I = class M extends _ {
1980
2007
  * @returns A new Density representing the difference of the two densities.
1981
2008
  */
1982
2009
  sub(e) {
1983
- return new M(q(this.valueOf(), e.valueOf()));
2010
+ return new M(q(this.valueOf(), new M(e).valueOf()));
1984
2011
  }
1985
2012
  /**
1986
2013
  * Multiplies this Density by a scalar value.
@@ -1989,7 +2016,7 @@ let I = class M extends _ {
1989
2016
  * @returns A new Density representing this Density multiplied by the value.
1990
2017
  */
1991
2018
  mult(e) {
1992
- return new M(U(this.valueOf(), e));
2019
+ return new M(C(this.valueOf(), e));
1993
2020
  }
1994
2021
  /**
1995
2022
  * Divides this Density by a scalar value.
@@ -1998,7 +2025,7 @@ let I = class M extends _ {
1998
2025
  * @returns A new Density representing this Density divided by the value.
1999
2026
  */
2000
2027
  div(e) {
2001
- return new M(we(this.valueOf(), e));
2028
+ return new M(Oe(this.valueOf(), e));
2002
2029
  }
2003
2030
  /** Unknown/Invalid Density. */
2004
2031
  static UNKNOWN = new M(0);
@@ -2017,7 +2044,7 @@ let I = class M extends _ {
2017
2044
  a.number().transform((e) => new M(e)),
2018
2045
  a.instanceof(M)
2019
2046
  ]);
2020
- }, J = class B {
2047
+ }, X = class U {
2021
2048
  /**
2022
2049
  * The starting TimeStamp of the TimeRange.
2023
2050
  *
@@ -2043,7 +2070,7 @@ let I = class M extends _ {
2043
2070
  * @param end - A TimeStamp representing the end of the range.
2044
2071
  */
2045
2072
  constructor(e, r) {
2046
- typeof e == "object" && "start" in e ? (this.start = new y(e.start), this.end = new y(e.end)) : (this.start = new y(e), this.end = new y(r));
2073
+ typeof e == "object" && "start" in e ? (this.start = new w(e.start), this.end = new w(e.end)) : (this.start = new w(e), this.end = new w(r));
2047
2074
  }
2048
2075
  /** @returns The TimeSpan occupied by the TimeRange. */
2049
2076
  get span() {
@@ -2085,7 +2112,7 @@ let I = class M extends _ {
2085
2112
  * @returns A TimeRange with the start and end swapped.
2086
2113
  */
2087
2114
  swap() {
2088
- return new B(this.end, this.start);
2115
+ return new U(this.end, this.start);
2089
2116
  }
2090
2117
  get numericBounds() {
2091
2118
  return {
@@ -2137,11 +2164,11 @@ let I = class M extends _ {
2137
2164
  const n = this.makeValid();
2138
2165
  if (this.equals(e)) return !0;
2139
2166
  if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
2140
- const s = y.max(n.start, e.start), i = y.min(n.end, e.end);
2167
+ const s = w.max(n.start, e.start), i = w.min(n.end, e.end);
2141
2168
  return i.before(s) ? !1 : new O(i.sub(s)).greaterThanOrEqual(r);
2142
2169
  }
2143
2170
  contains(e) {
2144
- return e instanceof B ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2171
+ return e instanceof U ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2145
2172
  }
2146
2173
  /**
2147
2174
  * Returns a new TimeRange that is bound by the given TimeRange.
@@ -2155,25 +2182,25 @@ let I = class M extends _ {
2155
2182
  * console.log(bounded); // TimeRange(1500, 2000)
2156
2183
  */
2157
2184
  boundBy(e) {
2158
- const r = new B(this.start, this.end);
2185
+ const r = new U(this.start, this.end);
2159
2186
  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;
2160
2187
  }
2161
2188
  static max(...e) {
2162
- return new B(
2163
- y.min(...e.map((r) => r.start)),
2164
- y.max(...e.map((r) => r.end))
2189
+ return new U(
2190
+ w.min(...e.map((r) => r.start)),
2191
+ w.max(...e.map((r) => r.end))
2165
2192
  );
2166
2193
  }
2167
2194
  /** The maximum possible time range. */
2168
- static MAX = new B(y.MIN, y.MAX);
2195
+ static MAX = new U(w.MIN, w.MAX);
2169
2196
  /** The minimum possible time range. */
2170
- static MIN = new B(y.MAX, y.MIN);
2197
+ static MIN = new U(w.MAX, w.MIN);
2171
2198
  /** A time range whose start and end are both zero. */
2172
- static ZERO = new B(y.ZERO, y.ZERO);
2199
+ static ZERO = new U(w.ZERO, w.ZERO);
2173
2200
  /** A zod schema for validating and transforming time ranges */
2174
2201
  static z = a.union([
2175
- a.object({ start: y.z, end: y.z }).transform((e) => new B(e.start, e.end)),
2176
- a.instanceof(B)
2202
+ a.object({ start: w.z, end: w.z }).transform((e) => new U(e.start, e.end)),
2203
+ a.instanceof(U)
2177
2204
  ]);
2178
2205
  /**
2179
2206
  * Sorts two time ranges. The range with the earlier start time is considered less than
@@ -2187,7 +2214,7 @@ let I = class M extends _ {
2187
2214
  * equal.
2188
2215
  */
2189
2216
  static sort(e, r) {
2190
- return y.sort(e.start, r.start) || y.sort(e.end, r.end);
2217
+ return w.sort(e.start, r.start) || w.sort(e.end, r.end);
2191
2218
  }
2192
2219
  /**
2193
2220
  * Simplify takes the list of `TimeRange`s, makes all of them valid, sorts them, and
@@ -2197,17 +2224,17 @@ let I = class M extends _ {
2197
2224
  * @returns A list of simplified `TimeRange`s.
2198
2225
  */
2199
2226
  static simplify(e) {
2200
- return e.map((r) => r.makeValid()).sort((r, n) => B.sort(r, n)).reduce((r, n) => {
2227
+ return e.map((r) => r.makeValid()).sort((r, n) => U.sort(r, n)).reduce((r, n) => {
2201
2228
  if (n.isZero) return r;
2202
2229
  if (r.length === 0)
2203
2230
  return r.push(n), r;
2204
2231
  const s = r[r.length - 1];
2205
- return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = y.max(s.end, n.end) : r.push(n), r;
2232
+ return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = w.max(s.end, n.end) : r.push(n), r;
2206
2233
  }, []);
2207
2234
  }
2208
- }, $ = class u extends _ {
2235
+ }, T = class u extends ee {
2209
2236
  constructor(e) {
2210
- if (e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
2237
+ if (A(e) && (e = e.value), e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
2211
2238
  super(e.valueOf());
2212
2239
  else {
2213
2240
  const r = u.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);
@@ -2423,25 +2450,25 @@ let I = class M extends _ {
2423
2450
  a.string().transform((e) => new u(e)),
2424
2451
  a.instanceof(u)
2425
2452
  ]);
2426
- }, Le = class w extends _ {
2453
+ }, Pe = class m extends ee {
2427
2454
  constructor(e) {
2428
- super(e.valueOf());
2455
+ A(e) && (e = e.value), super(e.valueOf());
2429
2456
  }
2430
2457
  /** @returns true if the Size is larger than the other size. */
2431
2458
  largerThan(e) {
2432
- return this.valueOf() > e.valueOf();
2459
+ return A(e) && (e = e.value), this.valueOf() > e.valueOf();
2433
2460
  }
2434
2461
  /** @returns true if the Size is smaller than the other size. */
2435
2462
  smallerThan(e) {
2436
- return this.valueOf() < e.valueOf();
2463
+ return A(e) && (e = e.value), this.valueOf() < e.valueOf();
2437
2464
  }
2438
2465
  /** @returns a new Size representing the sum of the two Sizes. */
2439
2466
  add(e) {
2440
- return new w(ie(this.valueOf(), e.valueOf()));
2467
+ return A(e) && (e = e.value), new m(ae(this.valueOf(), e.valueOf()));
2441
2468
  }
2442
2469
  /** @returns a new Size representing the difference of the two Sizes. */
2443
2470
  sub(e) {
2444
- return new w(q(this.valueOf(), e.valueOf()));
2471
+ return A(e) && (e = e.value), new m(q(this.valueOf(), e.valueOf()));
2445
2472
  }
2446
2473
  /**
2447
2474
  * Multiplies this Size by a scalar value.
@@ -2450,7 +2477,7 @@ let I = class M extends _ {
2450
2477
  * @returns A new Size representing this Size multiplied by the value.
2451
2478
  */
2452
2479
  mult(e) {
2453
- return new w(U(this.valueOf(), e));
2480
+ return new m(C(this.valueOf(), e));
2454
2481
  }
2455
2482
  /**
2456
2483
  * Divides this Size by a scalar value.
@@ -2459,37 +2486,39 @@ let I = class M extends _ {
2459
2486
  * @returns A new Size representing this Size divided by the value.
2460
2487
  */
2461
2488
  div(e) {
2462
- return new w(we(this.valueOf(), e));
2489
+ return new m(Oe(this.valueOf(), e));
2463
2490
  }
2464
2491
  /** @returns a new Size representing the truncated value of the Size. */
2465
2492
  truncate(e) {
2466
- return new w(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
2493
+ return new m(
2494
+ Math.trunc(this.valueOf() / new m(e).valueOf()) * new m(e).valueOf()
2495
+ );
2467
2496
  }
2468
2497
  /** @returns a new Size representing the remainder of the Size. */
2469
2498
  remainder(e) {
2470
- return w.bytes(this.valueOf() % e.valueOf());
2499
+ return m.bytes(this.valueOf() % new m(e).valueOf());
2471
2500
  }
2472
2501
  /** @returns the number of gigabytes in the Size. */
2473
2502
  get gigabytes() {
2474
- return this.valueOf() / w.GIGABYTE.valueOf();
2503
+ return this.valueOf() / m.GIGABYTE.valueOf();
2475
2504
  }
2476
2505
  /** @returns the number of megabytes in the Size. */
2477
2506
  get megabytes() {
2478
- return this.valueOf() / w.MEGABYTE.valueOf();
2507
+ return this.valueOf() / m.MEGABYTE.valueOf();
2479
2508
  }
2480
2509
  /** @returns the number of kilobytes in the Size. */
2481
2510
  get kilobytes() {
2482
- return this.valueOf() / w.KILOBYTE.valueOf();
2511
+ return this.valueOf() / m.KILOBYTE.valueOf();
2483
2512
  }
2484
2513
  /** @returns the number of terabytes in the Size. */
2485
2514
  get terabytes() {
2486
- return this.valueOf() / w.TERABYTE.valueOf();
2515
+ return this.valueOf() / m.TERABYTE.valueOf();
2487
2516
  }
2488
2517
  /** @returns a nicely formatted string representation of the Size. */
2489
2518
  toString() {
2490
- const e = this.truncate(w.TERABYTE), r = this.truncate(w.GIGABYTE), n = this.truncate(w.MEGABYTE), s = this.truncate(w.KILOBYTE), i = this.truncate(w.BYTE), o = e, c = r.sub(e), h = n.sub(r), l = s.sub(n), d = i.sub(s);
2491
- let m = "";
2492
- return o.isZero || (m += `${o.terabytes}TB `), c.isZero || (m += `${c.gigabytes}GB `), h.isZero || (m += `${h.megabytes}MB `), l.isZero || (m += `${l.kilobytes}KB `), (!d.isZero || m === "") && (m += `${d.valueOf()}B`), m.trim();
2519
+ const e = this.truncate(m.TERABYTE), r = this.truncate(m.GIGABYTE), n = this.truncate(m.MEGABYTE), s = this.truncate(m.KILOBYTE), i = this.truncate(m.BYTE), o = e, c = r.sub(e), h = n.sub(r), l = s.sub(n), d = i.sub(s);
2520
+ let y = "";
2521
+ return o.isZero || (y += `${o.terabytes}TB `), c.isZero || (y += `${c.gigabytes}GB `), h.isZero || (y += `${h.megabytes}MB `), l.isZero || (y += `${l.kilobytes}KB `), (!d.isZero || y === "") && (y += `${d.valueOf()}B`), y.trim();
2493
2522
  }
2494
2523
  /**
2495
2524
  * Creates a Size from the given number of bytes.
@@ -2498,10 +2527,10 @@ let I = class M extends _ {
2498
2527
  * @returns A Size representing the given number of bytes.
2499
2528
  */
2500
2529
  static bytes(e = 1) {
2501
- return new w(e);
2530
+ return new m(e);
2502
2531
  }
2503
2532
  /** A single byte */
2504
- static BYTE = new w(1);
2533
+ static BYTE = new m(1);
2505
2534
  /**
2506
2535
  * Creates a Size from the given number if kilobytes.
2507
2536
  *
@@ -2509,10 +2538,10 @@ let I = class M extends _ {
2509
2538
  * @returns A Size representing the given number of kilobytes.
2510
2539
  */
2511
2540
  static kilobytes(e = 1) {
2512
- return w.bytes(e.valueOf() * 1e3);
2541
+ return m.bytes(new m(e).valueOf() * 1e3);
2513
2542
  }
2514
2543
  /** A kilobyte */
2515
- static KILOBYTE = w.kilobytes(1);
2544
+ static KILOBYTE = m.kilobytes(1);
2516
2545
  /**
2517
2546
  * Creates a Size from the given number of megabytes.
2518
2547
  *
@@ -2520,10 +2549,10 @@ let I = class M extends _ {
2520
2549
  * @returns A Size representing the given number of megabytes.
2521
2550
  */
2522
2551
  static megabytes(e = 1) {
2523
- return w.kilobytes(e.valueOf() * 1e3);
2552
+ return m.kilobytes(new m(e).valueOf() * 1e3);
2524
2553
  }
2525
2554
  /** A megabyte */
2526
- static MEGABYTE = w.megabytes(1);
2555
+ static MEGABYTE = m.megabytes(1);
2527
2556
  /**
2528
2557
  * Creates a Size from the given number of gigabytes.
2529
2558
  *
@@ -2531,10 +2560,10 @@ let I = class M extends _ {
2531
2560
  * @returns A Size representing the given number of gigabytes.
2532
2561
  */
2533
2562
  static gigabytes(e = 1) {
2534
- return w.megabytes(e.valueOf() * 1e3);
2563
+ return m.megabytes(new m(e).valueOf() * 1e3);
2535
2564
  }
2536
2565
  /** A gigabyte */
2537
- static GIGABYTE = w.gigabytes(1);
2566
+ static GIGABYTE = m.gigabytes(1);
2538
2567
  /**
2539
2568
  * Creates a Size from the given number of terabytes.
2540
2569
  *
@@ -2542,23 +2571,23 @@ let I = class M extends _ {
2542
2571
  * @returns A Size representing the given number of terabytes.
2543
2572
  */
2544
2573
  static terabytes(e) {
2545
- return w.gigabytes(e.valueOf() * 1e3);
2574
+ return m.gigabytes(new m(e).valueOf() * 1e3);
2546
2575
  }
2547
2576
  /** A terabyte. */
2548
- static TERABYTE = w.terabytes(1);
2577
+ static TERABYTE = m.terabytes(1);
2549
2578
  /** The zero value for Size */
2550
- static ZERO = new w(0);
2579
+ static ZERO = new m(0);
2551
2580
  /** A zod schema for a Size. */
2552
2581
  static z = a.union([
2553
- a.number().transform((e) => new w(e)),
2554
- a.instanceof(w)
2582
+ a.number().transform((e) => new m(e)),
2583
+ a.instanceof(m)
2555
2584
  ]);
2556
2585
  /** @returns true if the Size is zero. */
2557
2586
  get isZero() {
2558
2587
  return this.valueOf() === 0;
2559
2588
  }
2560
2589
  };
2561
- const jo = a.union([
2590
+ const qo = a.union([
2562
2591
  a.instanceof(Uint8Array),
2563
2592
  a.instanceof(Uint16Array),
2564
2593
  a.instanceof(Uint32Array),
@@ -2569,40 +2598,40 @@ const jo = a.union([
2569
2598
  a.instanceof(Int16Array),
2570
2599
  a.instanceof(Int32Array),
2571
2600
  a.instanceof(BigInt64Array)
2572
- ]), Mr = (t) => {
2601
+ ]), Ur = (t) => {
2573
2602
  const e = typeof t;
2574
- return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof y || t instanceof O || t instanceof Date;
2575
- }, Bi = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ue(r, -n), Ue = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), Ui = /^(?:[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;
2576
- function Ci(t) {
2577
- return typeof t == "string" && Ui.test(t);
2603
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof w || t instanceof O || t instanceof Date;
2604
+ }, Li = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Ce(r, -n), Ce = (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), Di = /^(?:[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;
2605
+ function Pi(t) {
2606
+ return typeof t == "string" && Di.test(t);
2578
2607
  }
2579
2608
  const N = [];
2580
2609
  for (let t = 0; t < 256; ++t)
2581
2610
  N.push((t + 256).toString(16).slice(1));
2582
- function ji(t, e = 0) {
2611
+ function ki(t, e = 0) {
2583
2612
  return (N[t[e + 0]] + N[t[e + 1]] + N[t[e + 2]] + N[t[e + 3]] + "-" + N[t[e + 4]] + N[t[e + 5]] + "-" + N[t[e + 6]] + N[t[e + 7]] + "-" + N[t[e + 8]] + N[t[e + 9]] + "-" + N[t[e + 10]] + N[t[e + 11]] + N[t[e + 12]] + N[t[e + 13]] + N[t[e + 14]] + N[t[e + 15]]).toLowerCase();
2584
2613
  }
2585
- function Ri(t, e = 0) {
2586
- const r = ji(t, e);
2587
- if (!Ci(r))
2614
+ function qi(t, e = 0) {
2615
+ const r = ki(t, e);
2616
+ if (!Pi(r))
2588
2617
  throw TypeError("Stringified UUID is invalid");
2589
2618
  return r;
2590
2619
  }
2591
2620
  typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2592
- const Er = (t, e) => Ri(t, e), Z = -1, ht = {
2593
- [Symbol.iterator]: () => ht,
2621
+ const Cr = (t, e) => qi(t, e), Y = -1, pt = {
2622
+ [Symbol.iterator]: () => pt,
2594
2623
  next: () => ({ done: !0, value: void 0 })
2595
- }, Li = a.string().transform(
2624
+ }, zi = a.string().transform(
2596
2625
  (t) => new Uint8Array(
2597
2626
  atob(t).split("").map((e) => e.charCodeAt(0))
2598
2627
  ).buffer
2599
- ), Di = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), ft = 10, Ar = (t, e) => {
2628
+ ), Zi = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), mt = 10, jr = (t, e) => {
2600
2629
  if (t === "number" && !e.isNumeric)
2601
2630
  throw new Error(`cannot convert series of type ${e.toString()} to number`);
2602
2631
  if (t === "bigint" && !e.usesBigInt)
2603
2632
  throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
2604
- }, Br = "sy_x_telem_series";
2605
- let Ur = class F {
2633
+ }, Rr = "sy_x_telem_series";
2634
+ let Lr = class F {
2606
2635
  /**
2607
2636
  * A unique identifier for the series. If specified by the user, it is their
2608
2637
  * responsibility to ensure that it is unique. If not specified, a new ID will be
@@ -2613,7 +2642,7 @@ let Ur = class F {
2613
2642
  * A discriminator used for identifying instances of the series class even
2614
2643
  * when bundlers mangle the class name.
2615
2644
  */
2616
- discriminator = Br;
2645
+ discriminator = Rr;
2617
2646
  /** The data type of the series. */
2618
2647
  dataType;
2619
2648
  /**
@@ -2629,7 +2658,7 @@ let Ur = class F {
2629
2658
  /** The underlying data. */
2630
2659
  _data;
2631
2660
  /** The time range occupied by the series' data. */
2632
- timeRange = J.ZERO;
2661
+ timeRange = X.ZERO;
2633
2662
  /**
2634
2663
  * Alignment defines the location of the series relative to other series in a logical
2635
2664
  * group. Useful for defining the position of the series within a channel's data.
@@ -2646,7 +2675,7 @@ let Ur = class F {
2646
2675
  /** A cached maximum value. */
2647
2676
  cachedMax;
2648
2677
  /** The write position of the buffer. */
2649
- writePos = Z;
2678
+ writePos = Y;
2650
2679
  /** Tracks the number of entities currently using this array. */
2651
2680
  _refCount = 0;
2652
2681
  /** Caches the length of the array for variable length data types. */
@@ -2658,16 +2687,16 @@ let Ur = class F {
2658
2687
  * can be constructed into a series.
2659
2688
  */
2660
2689
  static crudeZ = a.object({
2661
- timeRange: J.z.optional(),
2662
- dataType: $.z,
2690
+ timeRange: X.z.optional(),
2691
+ dataType: T.z,
2663
2692
  alignment: a.coerce.bigint().optional(),
2664
2693
  data: a.union([
2665
- Li,
2666
- Di,
2694
+ zi,
2695
+ Zi,
2667
2696
  a.instanceof(ArrayBuffer),
2668
2697
  a.instanceof(Uint8Array)
2669
2698
  ]),
2670
- glBufferUsage: Ei.optional().default("static").optional()
2699
+ glBufferUsage: ji.optional().default("static").optional()
2671
2700
  });
2672
2701
  /**
2673
2702
  * A zod schema that validates and constructs a series from it's crude
@@ -2748,7 +2777,7 @@ let Ur = class F {
2748
2777
  * @throws Error if data type cannot be inferred from input
2749
2778
  */
2750
2779
  constructor(e) {
2751
- Pi(e) && (e = { data: e }), e.data ??= [];
2780
+ Yi(e) && (e = { data: e }), e.data ??= [];
2752
2781
  const {
2753
2782
  dataType: r,
2754
2783
  timeRange: n,
@@ -2756,22 +2785,22 @@ let Ur = class F {
2756
2785
  glBufferUsage: i = "static",
2757
2786
  alignment: o = 0n,
2758
2787
  alignmentMultiple: c = 1n,
2759
- key: h = Lt(),
2788
+ key: h = qt(),
2760
2789
  data: l
2761
2790
  } = e;
2762
- if (Cr(l)) {
2791
+ if (Dr(l)) {
2763
2792
  const p = l;
2764
2793
  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;
2765
2794
  return;
2766
2795
  }
2767
- const d = Mr(l), m = Array.isArray(l);
2768
- if (r != null) this.dataType = new $(r);
2796
+ const d = Ur(l), y = Array.isArray(l);
2797
+ if (r != null) this.dataType = new T(r);
2769
2798
  else {
2770
2799
  if (l instanceof ArrayBuffer)
2771
2800
  throw new Error(
2772
2801
  "cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
2773
2802
  );
2774
- if (m || d) {
2803
+ if (y || d) {
2775
2804
  let p = l;
2776
2805
  if (!d) {
2777
2806
  if (l.length === 0)
@@ -2780,38 +2809,38 @@ let Ur = class F {
2780
2809
  );
2781
2810
  p = l[0];
2782
2811
  }
2783
- if (typeof p == "string") this.dataType = $.STRING;
2784
- else if (typeof p == "number") this.dataType = $.FLOAT64;
2785
- else if (typeof p == "bigint") this.dataType = $.INT64;
2786
- else if (typeof p == "boolean") this.dataType = $.BOOLEAN;
2787
- else if (p instanceof y || p instanceof Date || p instanceof y)
2788
- this.dataType = $.TIMESTAMP;
2789
- else if (typeof p == "object") this.dataType = $.JSON;
2812
+ if (typeof p == "string") this.dataType = T.STRING;
2813
+ else if (typeof p == "number") this.dataType = T.FLOAT64;
2814
+ else if (typeof p == "bigint") this.dataType = T.INT64;
2815
+ else if (typeof p == "boolean") this.dataType = T.BOOLEAN;
2816
+ else if (p instanceof w || p instanceof Date || p instanceof w)
2817
+ this.dataType = T.TIMESTAMP;
2818
+ else if (typeof p == "object") this.dataType = T.JSON;
2790
2819
  else
2791
2820
  throw new Error(
2792
2821
  `cannot infer data type of ${typeof p} when constructing a Series from a JS array`
2793
2822
  );
2794
- } else this.dataType = new $(l);
2823
+ } else this.dataType = new T(l);
2795
2824
  }
2796
- if (!m && !d) this._data = l;
2797
- else if (m && l.length === 0)
2825
+ if (!y && !d) this._data = l;
2826
+ else if (y && l.length === 0)
2798
2827
  this._data = new this.dataType.Array([]).buffer;
2799
2828
  else {
2800
2829
  let p = d ? [l] : l;
2801
- const R = p[0];
2802
- (R instanceof y || R instanceof Date || R instanceof O) && (p = p.map((A) => new y(A).valueOf())), this.dataType.equals($.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2830
+ const L = p[0];
2831
+ (L instanceof w || L instanceof Date || L instanceof O) && (p = p.map((B) => new w(B).valueOf())), this.dataType.equals(T.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
2803
2832
  `)}
2804
- `).buffer) : this.dataType.equals($.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2805
- `${p.map((A) => et.encodeString(A)).join(`
2833
+ `).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
2834
+ `${p.map((B) => st.encodeString(B)).join(`
2806
2835
  `)}
2807
2836
  `
2808
- ).buffer) : this.dataType.usesBigInt && typeof R == "number" ? this._data = new this.dataType.Array(
2809
- p.map((A) => BigInt(Math.round(A)))
2810
- ).buffer : !this.dataType.usesBigInt && typeof R == "bigint" ? this._data = new this.dataType.Array(
2837
+ ).buffer) : this.dataType.usesBigInt && typeof L == "number" ? this._data = new this.dataType.Array(
2838
+ p.map((B) => BigInt(Math.round(B)))
2839
+ ).buffer : !this.dataType.usesBigInt && typeof L == "bigint" ? this._data = new this.dataType.Array(
2811
2840
  p.map(Number)
2812
2841
  ).buffer : this._data = new this.dataType.Array(p).buffer;
2813
2842
  }
2814
- this.key = h, this.alignment = o, this.alignmentMultiple = c, this.sampleOffset = s ?? 0, this.timeRange = n ?? J.ZERO, this.gl = {
2843
+ this.key = h, this.alignment = o, this.alignmentMultiple = c, this.sampleOffset = s ?? 0, this.timeRange = n ?? X.ZERO, this.gl = {
2815
2844
  control: null,
2816
2845
  buffer: null,
2817
2846
  prevBuffer: 0,
@@ -2828,7 +2857,7 @@ let Ur = class F {
2828
2857
  static alloc({ capacity: e, dataType: r, ...n }) {
2829
2858
  if (e === 0)
2830
2859
  throw new Error("[Series] - cannot allocate an array of length 0");
2831
- const s = new new $(r).Array(e), i = new F({ data: s.buffer, dataType: r, ...n });
2860
+ const s = new new T(r).Array(e), i = new F({ data: s.buffer, dataType: r, ...n });
2832
2861
  return i.writePos = 0, i;
2833
2862
  }
2834
2863
  /**
@@ -2871,12 +2900,12 @@ let Ur = class F {
2871
2900
  return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
2872
2901
  }
2873
2902
  writeVariable(e) {
2874
- if (this.writePos === Z) return 0;
2903
+ if (this.writePos === Y) return 0;
2875
2904
  const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
2876
2905
  return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
2877
2906
  }
2878
2907
  writeFixed(e) {
2879
- if (this.writePos === Z) return 0;
2908
+ if (this.writePos === Y) return 0;
2880
2909
  const r = this.capacity - this.writePos, n = e.sub(0, r);
2881
2910
  return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
2882
2911
  }
@@ -2899,7 +2928,7 @@ let Ur = class F {
2899
2928
  * @returns A typed array containing the series data.
2900
2929
  */
2901
2930
  get data() {
2902
- return this.writePos === Z ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2931
+ return this.writePos === Y ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2903
2932
  }
2904
2933
  /**
2905
2934
  * Returns an array of the values in the series as strings.
@@ -2918,16 +2947,16 @@ let Ur = class F {
2918
2947
  * @returns An array of values parsed from the JSON series.
2919
2948
  */
2920
2949
  parseJSON(e) {
2921
- if (!this.dataType.equals($.JSON))
2950
+ if (!this.dataType.equals(T.JSON))
2922
2951
  throw new Error("cannot parse non-JSON series as JSON");
2923
- return this.toStrings().map((r) => e.parse(et.decodeString(r)));
2952
+ return this.toStrings().map((r) => e.parse(st.decodeString(r)));
2924
2953
  }
2925
2954
  /**
2926
2955
  * Returns the capacity of the series in bytes.
2927
2956
  * @returns The size of the underlying buffer in bytes.
2928
2957
  */
2929
2958
  get byteCapacity() {
2930
- return new Le(this.underlyingData.byteLength);
2959
+ return new Pe(this.underlyingData.byteLength);
2931
2960
  }
2932
2961
  /**
2933
2962
  * Returns the capacity of the series in samples.
@@ -2943,7 +2972,7 @@ let Ur = class F {
2943
2972
  * @returns The size of the data in bytes.
2944
2973
  */
2945
2974
  get byteLength() {
2946
- return this.writePos === Z ? this.byteCapacity : this.dataType.isVariable ? new Le(this.writePos) : this.dataType.density.size(this.writePos);
2975
+ return this.writePos === Y ? this.byteCapacity : this.dataType.isVariable ? new Pe(this.writePos) : this.dataType.density.size(this.writePos);
2947
2976
  }
2948
2977
  /**
2949
2978
  * Returns the number of samples in this array.
@@ -2951,7 +2980,7 @@ let Ur = class F {
2951
2980
  * @returns The number of samples in the series.
2952
2981
  */
2953
2982
  get length() {
2954
- return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === Z ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2983
+ return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === Y ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2955
2984
  }
2956
2985
  calculateCachedLength() {
2957
2986
  if (!this.dataType.isVariable)
@@ -2959,7 +2988,7 @@ let Ur = class F {
2959
2988
  let e = 0;
2960
2989
  const r = [0];
2961
2990
  return this.data.forEach((n, s) => {
2962
- n === ft && (e++, r.push(s + 1));
2991
+ n === mt && (e++, r.push(s + 1));
2963
2992
  }), this._cachedIndexes = r, this.cachedLength = e, e;
2964
2993
  }
2965
2994
  /**
@@ -2975,7 +3004,7 @@ let Ur = class F {
2975
3004
  if (this.dataType.equals(e)) return this;
2976
3005
  const n = new e.Array(this.length);
2977
3006
  for (let s = 0; s < this.length; s++)
2978
- n[s] = Bi(this.dataType, e, this.data[s], r);
3007
+ n[s] = Li(this.dataType, e, this.data[s], r);
2979
3008
  return new F({
2980
3009
  data: n.buffer,
2981
3010
  dataType: e,
@@ -2987,7 +3016,7 @@ let Ur = class F {
2987
3016
  }
2988
3017
  calcRawMax() {
2989
3018
  if (this.length === 0) return -1 / 0;
2990
- if (this.dataType.equals($.TIMESTAMP))
3019
+ if (this.dataType.equals(T.TIMESTAMP))
2991
3020
  this.cachedMax = this.data[this.data.length - 1];
2992
3021
  else if (this.dataType.usesBigInt) {
2993
3022
  const e = this.data;
@@ -3005,11 +3034,11 @@ let Ur = class F {
3005
3034
  calcMax() {
3006
3035
  if (this.dataType.isVariable)
3007
3036
  throw new Error("cannot calculate maximum on a variable length data type");
3008
- return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Ue(this.cachedMax, this.sampleOffset));
3037
+ return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Ce(this.cachedMax, this.sampleOffset));
3009
3038
  }
3010
3039
  calcRawMin() {
3011
3040
  if (this.length === 0) return 1 / 0;
3012
- if (this.dataType.equals($.TIMESTAMP)) this.cachedMin = this.data[0];
3041
+ if (this.dataType.equals(T.TIMESTAMP)) this.cachedMin = this.data[0];
3013
3042
  else if (this.dataType.usesBigInt) {
3014
3043
  const e = this.data;
3015
3044
  this.cachedMin = e.reduce((r, n) => r < n ? r : n);
@@ -3026,7 +3055,7 @@ let Ur = class F {
3026
3055
  calcMin() {
3027
3056
  if (this.dataType.isVariable)
3028
3057
  throw new Error("cannot calculate minimum on a variable length data type");
3029
- return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Ue(this.cachedMin, this.sampleOffset));
3058
+ return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Ce(this.cachedMin, this.sampleOffset));
3030
3059
  }
3031
3060
  /** @returns the bounds of the series. */
3032
3061
  get bounds() {
@@ -3052,18 +3081,18 @@ let Ur = class F {
3052
3081
  }
3053
3082
  at(e, r = !1) {
3054
3083
  if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
3055
- if (this.dataType.equals($.UUID)) return this.atUUID(e, r);
3084
+ if (this.dataType.equals(T.UUID)) return this.atUUID(e, r);
3056
3085
  e < 0 && (e = this.length + e);
3057
3086
  const n = this.data[e];
3058
3087
  if (n == null) {
3059
3088
  if (r === !0) throw new Error(`[series] - no value at index ${e}`);
3060
3089
  return;
3061
3090
  }
3062
- return Ue(n, this.sampleOffset);
3091
+ return Ce(n, this.sampleOffset);
3063
3092
  }
3064
3093
  atUUID(e, r) {
3065
3094
  e < 0 && (e = this.length + e);
3066
- const n = Er(
3095
+ const n = Cr(
3067
3096
  new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
3068
3097
  );
3069
3098
  if (n == null) {
@@ -3079,7 +3108,7 @@ let Ur = class F {
3079
3108
  else {
3080
3109
  e < 0 && (e = this.length + e);
3081
3110
  for (let o = 0; o < this.data.length; o++)
3082
- if (this.data[o] === ft) {
3111
+ if (this.data[o] === mt) {
3083
3112
  if (e === 0) {
3084
3113
  s = o;
3085
3114
  break;
@@ -3092,7 +3121,7 @@ let Ur = class F {
3092
3121
  }
3093
3122
  }
3094
3123
  const i = this.data.slice(n, s);
3095
- return this.dataType.equals($.STRING) ? new TextDecoder().decode(i) : mt(JSON.parse(new TextDecoder().decode(i)));
3124
+ return this.dataType.equals(T.STRING) ? new TextDecoder().decode(i) : bt(JSON.parse(new TextDecoder().decode(i)));
3096
3125
  }
3097
3126
  /**
3098
3127
  * @returns the index of the first sample that is greater than or equal to the given value.
@@ -3101,7 +3130,7 @@ let Ur = class F {
3101
3130
  */
3102
3131
  binarySearch(e) {
3103
3132
  let r = 0, n = this.length - 1;
3104
- const s = De(e);
3133
+ const s = ze(e);
3105
3134
  for (; r <= n; ) {
3106
3135
  const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
3107
3136
  if (o === 0) return i;
@@ -3117,11 +3146,11 @@ let Ur = class F {
3117
3146
  * be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
3118
3147
  */
3119
3148
  updateGLBuffer(e) {
3120
- if (this.gl.control = e, !this.dataType.equals($.FLOAT32) && !this.dataType.equals($.UINT8))
3149
+ if (this.gl.control = e, !this.dataType.equals(T.FLOAT32) && !this.dataType.equals(T.UINT8))
3121
3150
  throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
3122
3151
  const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
3123
3152
  if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
3124
- if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== Z) {
3153
+ if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== Y) {
3125
3154
  s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
3126
3155
  const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
3127
3156
  e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
@@ -3130,10 +3159,10 @@ let Ur = class F {
3130
3159
  e.ARRAY_BUFFER,
3131
3160
  this.buffer,
3132
3161
  n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
3133
- ), this.gl.prevBuffer = Z;
3162
+ ), this.gl.prevBuffer = Y;
3134
3163
  }
3135
3164
  as(e) {
3136
- return Ar(e, this.dataType), this;
3165
+ return jr(e, this.dataType), this;
3137
3166
  }
3138
3167
  /** @returns a digest containing information about the series. */
3139
3168
  get digest() {
@@ -3142,8 +3171,9 @@ let Ur = class F {
3142
3171
  dataType: this.dataType.toString(),
3143
3172
  sampleOffset: this.sampleOffset,
3144
3173
  alignment: {
3145
- lower: Ft(this.alignmentBounds.lower),
3146
- upper: Ft(this.alignmentBounds.upper)
3174
+ lower: Gt(this.alignmentBounds.lower),
3175
+ upper: Gt(this.alignmentBounds.upper),
3176
+ multiple: this.alignmentMultiple
3147
3177
  },
3148
3178
  timeRange: this.timeRange.toString(),
3149
3179
  length: this.length,
@@ -3180,10 +3210,10 @@ let Ur = class F {
3180
3210
  }
3181
3211
  [Symbol.iterator]() {
3182
3212
  if (this.dataType.isVariable) {
3183
- const e = new qi(this);
3184
- return this.dataType.equals($.JSON) ? new ki(e) : e;
3213
+ const e = new Fi(this);
3214
+ return this.dataType.equals(T.JSON) ? new Wi(e) : e;
3185
3215
  }
3186
- return this.dataType.equals($.UUID) ? new zi(this) : new Zi(this);
3216
+ return this.dataType.equals(T.UUID) ? new Vi(this) : new Gi(this);
3187
3217
  }
3188
3218
  /**
3189
3219
  * Returns a slice of the series from start to end.
@@ -3210,7 +3240,7 @@ let Ur = class F {
3210
3240
  * @returns An iterator over the specified range.
3211
3241
  */
3212
3242
  subIterator(e, r) {
3213
- return new Zt(this, e, r ?? this.length);
3243
+ return new Vt(this, e, r ?? this.length);
3214
3244
  }
3215
3245
  /**
3216
3246
  * Returns an iterator over a portion of the series based on alignment.
@@ -3224,7 +3254,7 @@ let Ur = class F {
3224
3254
  ), s = Math.ceil(
3225
3255
  Number(r - this.alignment) / Number(this.alignmentMultiple)
3226
3256
  );
3227
- return new Zt(this, n, s);
3257
+ return new Vt(this, n, s);
3228
3258
  }
3229
3259
  subBytes(e, r) {
3230
3260
  if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
@@ -3259,7 +3289,7 @@ let Ur = class F {
3259
3289
  return new F({
3260
3290
  data: this.buffer,
3261
3291
  dataType: this.dataType,
3262
- timeRange: J.ZERO,
3292
+ timeRange: X.ZERO,
3263
3293
  sampleOffset: this.sampleOffset,
3264
3294
  glBufferUsage: "static",
3265
3295
  alignment: e
@@ -3283,20 +3313,21 @@ let Ur = class F {
3283
3313
  return e += "])", e;
3284
3314
  }
3285
3315
  };
3286
- const Pi = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Ur ? !0 : Mr(t), Cr = Mi(Br, Ur);
3287
- let Zt = class {
3316
+ const Yi = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Lr ? !0 : Ur(t), Dr = Ci(Rr, Lr);
3317
+ class Vt {
3288
3318
  series;
3289
3319
  end;
3290
3320
  index;
3291
3321
  constructor(e, r, n) {
3292
3322
  this.series = e;
3293
3323
  const s = b(0, e.length + 1);
3294
- this.end = st(s, n), this.index = st(s, r);
3324
+ this.end = ut(s, n), this.index = ut(s, r);
3295
3325
  }
3296
3326
  next() {
3297
3327
  return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3298
3328
  }
3299
- }, qi = class {
3329
+ }
3330
+ let Fi = class {
3300
3331
  series;
3301
3332
  index;
3302
3333
  decoder;
@@ -3309,11 +3340,11 @@ let Zt = class {
3309
3340
  }
3310
3341
  next() {
3311
3342
  const e = this.index, r = this.series.data;
3312
- for (; this.index < r.length && r[this.index] !== ft; ) this.index++;
3343
+ for (; this.index < r.length && r[this.index] !== mt; ) this.index++;
3313
3344
  const n = this.index;
3314
3345
  return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
3315
3346
  }
3316
- }, ki = class jr {
3347
+ }, Wi = class Pr {
3317
3348
  wrapped;
3318
3349
  static schema = a.record(a.string(), a.unknown());
3319
3350
  constructor(e) {
@@ -3323,26 +3354,25 @@ let Zt = class {
3323
3354
  const e = this.wrapped.next();
3324
3355
  return e.done === !0 ? { done: !0, value: void 0 } : {
3325
3356
  done: !1,
3326
- value: et.decodeString(e.value, jr.schema)
3357
+ value: st.decodeString(e.value, Pr.schema)
3327
3358
  };
3328
3359
  }
3329
- }, zi = class {
3360
+ }, Vi = class {
3330
3361
  series;
3331
3362
  index;
3332
3363
  data;
3333
3364
  density;
3334
3365
  constructor(e) {
3335
- if (!e.dataType.equals($.UUID))
3366
+ if (!e.dataType.equals(T.UUID))
3336
3367
  throw new Error("cannot create a UUID series iterator for a non-UUID series");
3337
- this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = $.UUID.density.valueOf();
3368
+ this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = T.UUID.density.valueOf();
3338
3369
  }
3339
3370
  next() {
3340
3371
  if (this.index >= this.series.length) return { done: !0, value: void 0 };
3341
- const e = Er(this.data, this.index * this.density);
3372
+ const e = Cr(this.data, this.index * this.density);
3342
3373
  return this.index++, { done: !1, value: e };
3343
3374
  }
3344
- };
3345
- class Zi {
3375
+ }, Gi = class {
3346
3376
  series;
3347
3377
  index;
3348
3378
  constructor(e) {
@@ -3354,8 +3384,7 @@ class Zi {
3354
3384
  value: this.series.at(this.index++, !0)
3355
3385
  };
3356
3386
  }
3357
- }
3358
- let Po = class {
3387
+ }, Fo = class {
3359
3388
  /** The array of series in this collection */
3360
3389
  series;
3361
3390
  /**
@@ -3408,14 +3437,14 @@ let Po = class {
3408
3437
  this.series = e;
3409
3438
  }
3410
3439
  as(e) {
3411
- return Ar(e, this.dataType), this;
3440
+ return jr(e, this.dataType), this;
3412
3441
  }
3413
3442
  /**
3414
3443
  * Returns the data type of the series in this collection. If the collection is empty,
3415
3444
  * returns DataType.UNKNOWN.
3416
3445
  */
3417
3446
  get dataType() {
3418
- return this.series.length === 0 ? $.UNKNOWN : this.series[0].dataType;
3447
+ return this.series.length === 0 ? T.UNKNOWN : this.series[0].dataType;
3419
3448
  }
3420
3449
  /**
3421
3450
  * Returns the combined time range of all series in the collection. If the collection
@@ -3423,7 +3452,7 @@ let Po = class {
3423
3452
  * series to the end of the last series.
3424
3453
  */
3425
3454
  get timeRange() {
3426
- return this.series.length === 0 ? J.ZERO : new J(
3455
+ return this.series.length === 0 ? X.ZERO : new X(
3427
3456
  this.series[0].timeRange.start,
3428
3457
  this.series[this.series.length - 1].timeRange.end
3429
3458
  );
@@ -3450,7 +3479,7 @@ let Po = class {
3450
3479
  const r = () => new Error(
3451
3480
  `cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
3452
3481
  ), n = e.dataType.equals(this.dataType);
3453
- if (Cr(e)) {
3482
+ if (Dr(e)) {
3454
3483
  if (this.series.length !== 0 && !n) throw r();
3455
3484
  this.series.push(e);
3456
3485
  } else {
@@ -3468,7 +3497,7 @@ let Po = class {
3468
3497
  }
3469
3498
  atAlignment(e, r) {
3470
3499
  for (const n of this.series)
3471
- if (C(n.alignmentBounds, e))
3500
+ if (j(n.alignmentBounds, e))
3472
3501
  return n.atAlignment(e, r);
3473
3502
  if (r) throw new Error(`[series] - no value at alignment ${e}`);
3474
3503
  }
@@ -3487,7 +3516,7 @@ let Po = class {
3487
3516
  * @returns An iterator over the specified range.
3488
3517
  */
3489
3518
  subIterator(e, r) {
3490
- return new Xe(this, e, r ?? this.length);
3519
+ return new et(this, e, r ?? this.length);
3491
3520
  }
3492
3521
  /**
3493
3522
  * Returns an iterator over a portion of the multi-series based on alignment.
@@ -3497,13 +3526,13 @@ let Po = class {
3497
3526
  */
3498
3527
  subAlignmentIterator(e, r) {
3499
3528
  if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
3500
- return ht;
3529
+ return pt;
3501
3530
  let n = 0;
3502
3531
  for (let i = 0; i < this.series.length; i++) {
3503
3532
  const o = this.series[i];
3504
3533
  if (e < o.alignment) break;
3505
3534
  if (e >= o.alignmentBounds.upper) n += o.length;
3506
- else if (C(o.alignmentBounds, e)) {
3535
+ else if (j(o.alignmentBounds, e)) {
3507
3536
  n += Math.ceil(
3508
3537
  Number(e - o.alignment) / Number(o.alignmentMultiple)
3509
3538
  );
@@ -3515,14 +3544,14 @@ let Po = class {
3515
3544
  const o = this.series[i];
3516
3545
  if (r < o.alignment) break;
3517
3546
  if (r >= o.alignmentBounds.upper) s += o.length;
3518
- else if (C(o.alignmentBounds, r)) {
3547
+ else if (j(o.alignmentBounds, r)) {
3519
3548
  s += Math.ceil(
3520
3549
  Number(r - o.alignment) / Number(o.alignmentMultiple)
3521
3550
  );
3522
3551
  break;
3523
3552
  }
3524
3553
  }
3525
- return new Xe(this, n, s);
3554
+ return new et(this, n, s);
3526
3555
  }
3527
3556
  /**
3528
3557
  * Returns an iterator over the specified alignment range and span.
@@ -3531,19 +3560,19 @@ let Po = class {
3531
3560
  * @returns An iterator over the specified range.
3532
3561
  */
3533
3562
  subAlignmentSpanIterator(e, r) {
3534
- if (e >= this.alignmentBounds.upper) return ht;
3563
+ if (e >= this.alignmentBounds.upper) return pt;
3535
3564
  r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
3536
3565
  let n = 0;
3537
3566
  for (let s = 0; s < this.series.length; s++) {
3538
3567
  const i = this.series[s];
3539
3568
  if (e < i.alignment) break;
3540
3569
  if (e >= i.alignmentBounds.upper) n += i.length;
3541
- else if (C(i.alignmentBounds, e)) {
3570
+ else if (j(i.alignmentBounds, e)) {
3542
3571
  n += Number(e - i.alignment);
3543
3572
  break;
3544
3573
  }
3545
3574
  }
3546
- return new Xe(this, n, n + r);
3575
+ return new et(this, n, n + r);
3547
3576
  }
3548
3577
  /**
3549
3578
  * Updates the WebGL buffer for all series in the collection.
@@ -3556,13 +3585,13 @@ let Po = class {
3556
3585
  * Returns the bounds containing the minimum and maximum values across all series.
3557
3586
  */
3558
3587
  get bounds() {
3559
- return or(this.series.map((e) => e.bounds));
3588
+ return hr(this.series.map((e) => e.bounds));
3560
3589
  }
3561
3590
  /**
3562
3591
  * Returns the sum of the byte lengths of all series.
3563
3592
  */
3564
3593
  get byteLength() {
3565
- return new Le(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3594
+ return new Pe(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3566
3595
  }
3567
3596
  /**
3568
3597
  * Returns a combined typed array containing all data from all series.
@@ -3583,7 +3612,7 @@ let Po = class {
3583
3612
  */
3584
3613
  traverseAlignment(e, r) {
3585
3614
  const n = this.series.map((s) => s.alignmentBounds);
3586
- return ur(n, e, r);
3615
+ return fr(n, e, r);
3587
3616
  }
3588
3617
  /**
3589
3618
  * Acquires a reference to the WebGL buffer for all series.
@@ -3606,7 +3635,7 @@ let Po = class {
3606
3635
  */
3607
3636
  distance(e, r) {
3608
3637
  const n = this.series.map((s) => s.alignmentBounds);
3609
- return lr(n, e, r);
3638
+ return dr(n, e, r);
3610
3639
  }
3611
3640
  /**
3612
3641
  * Parses a JSON multi-series into an array of values using the provided zod schema.
@@ -3616,7 +3645,7 @@ let Po = class {
3616
3645
  * @returns An array of values parsed from the JSON series.
3617
3646
  */
3618
3647
  parseJSON(e) {
3619
- if (!this.dataType.equals($.JSON))
3648
+ if (!this.dataType.equals(T.JSON))
3620
3649
  throw new Error("cannot parse non-JSON series as JSON");
3621
3650
  return this.series.flatMap((r) => r.parseJSON(e));
3622
3651
  }
@@ -3629,7 +3658,7 @@ let Po = class {
3629
3658
  next() {
3630
3659
  return { done: !0, value: void 0 };
3631
3660
  }
3632
- } : new Fi(this.series);
3661
+ } : new Hi(this.series);
3633
3662
  }
3634
3663
  /**
3635
3664
  * Returns an array of the values in the multi-series as strings.
@@ -3639,7 +3668,8 @@ let Po = class {
3639
3668
  toStrings() {
3640
3669
  return this.series.flatMap((e) => e.toStrings());
3641
3670
  }
3642
- }, Fi = class {
3671
+ };
3672
+ class Hi {
3643
3673
  series;
3644
3674
  seriesIndex;
3645
3675
  internal;
@@ -3653,8 +3683,8 @@ let Po = class {
3653
3683
  [Symbol.iterator]() {
3654
3684
  return this;
3655
3685
  }
3656
- };
3657
- class Xe {
3686
+ }
3687
+ let et = class {
3658
3688
  series;
3659
3689
  index;
3660
3690
  end;
@@ -3667,52 +3697,52 @@ class Xe {
3667
3697
  [Symbol.iterator]() {
3668
3698
  return this;
3669
3699
  }
3670
- }
3671
- const Ft = (t) => {
3700
+ };
3701
+ const Gt = (t) => {
3672
3702
  const e = t >> 32n, r = t & 0xffffffffn;
3673
3703
  return { domain: e, sample: r };
3674
3704
  };
3675
3705
  a.object({ key: a.string(), value: a.string() });
3676
- const Yi = a.record(
3706
+ const Ji = a.record(
3677
3707
  a.union([a.number(), a.string(), a.symbol()]),
3678
3708
  a.unknown()
3679
- ), Dt = (t) => Object.entries(t), Wi = (t, e) => Object.fromEntries(Dt(t).map(([r, n]) => [r, e(n, r)])), Vi = (t) => Object.fromEntries(Dt(t).filter(([e, r]) => r !== void 0)), Gi = (t, ...e) => {
3709
+ ), zt = (t) => Object.entries(t), Xi = (t, e) => Object.fromEntries(zt(t).map(([r, n]) => [r, e(n, r)])), Ki = (t) => Object.fromEntries(zt(t).filter(([e, r]) => r !== void 0)), Qi = (t, ...e) => {
3680
3710
  const r = { ...t };
3681
3711
  for (const n of e) delete r[n];
3682
3712
  return r;
3683
- }, zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3713
+ }, Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3684
3714
  __proto__: null,
3685
- entries: Dt,
3686
- map: Wi,
3687
- omit: Gi,
3688
- purgeUndefined: Vi,
3689
- unknownZ: Yi
3690
- }, Symbol.toStringTag, { value: "Module" })), Rr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Hi = Rr(), Lr = ["macOS", "Windows", "Linux"], Ji = ["macos", "windows", "linux"], Xi = {
3715
+ entries: zt,
3716
+ map: Xi,
3717
+ omit: Qi,
3718
+ purgeUndefined: Ki,
3719
+ unknownZ: Ji
3720
+ }, Symbol.toStringTag, { value: "Module" })), kr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", _i = kr(), qr = ["macOS", "Windows", "Linux"], ea = ["macos", "windows", "linux"], ta = {
3691
3721
  macos: "macOS",
3692
3722
  windows: "Windows",
3693
3723
  linux: "Linux"
3694
- }, Ki = a.enum(Lr).or(
3695
- a.enum(Ji).transform((t) => Xi[t])
3696
- ), Qi = () => {
3724
+ }, ra = a.enum(qr).or(
3725
+ a.enum(ea).transform((t) => ta[t])
3726
+ ), na = () => {
3697
3727
  if (typeof window > "u") return;
3698
3728
  const t = window.navigator.userAgent.toLowerCase();
3699
3729
  if (t.includes("mac")) return "macOS";
3700
3730
  if (t.includes("win")) return "Windows";
3701
3731
  if (t.includes("linux")) return "Linux";
3702
3732
  };
3703
- let Ke;
3704
- const _i = (t = {}) => {
3733
+ let tt;
3734
+ const sa = (t = {}) => {
3705
3735
  const { force: e, default: r } = t;
3706
- return e ?? Ke ?? (Ke = Qi(), Ke ?? r);
3707
- }, Zo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3736
+ return e ?? tt ?? (tt = na(), tt ?? r);
3737
+ }, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3708
3738
  __proto__: null,
3709
- OPERATING_SYSTEMS: Lr,
3710
- RUNTIME: Hi,
3711
- detect: Rr,
3712
- getOS: _i,
3713
- osZ: Ki
3714
- }, Symbol.toStringTag, { value: "Module" })), ea = (...t) => t.map(Dr).join(""), Dr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), ta = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3715
- class Ce {
3739
+ OPERATING_SYSTEMS: qr,
3740
+ RUNTIME: _i,
3741
+ detect: kr,
3742
+ getOS: sa,
3743
+ osZ: ra
3744
+ }, Symbol.toStringTag, { value: "Module" })), ia = (...t) => t.map(zr).join(""), zr = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), aa = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3745
+ class je {
3716
3746
  protocol;
3717
3747
  host;
3718
3748
  port;
@@ -3724,7 +3754,7 @@ class Ce {
3724
3754
  * @param pathPrefix - A path prefix to use for all requests. Defaults to "".
3725
3755
  */
3726
3756
  constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
3727
- this.protocol = n, this.host = e, this.port = r, this.path = Dr(s);
3757
+ this.protocol = n, this.host = e, this.port = r, this.path = zr(s);
3728
3758
  }
3729
3759
  /**
3730
3760
  * Replaces creates a new URL with the specified properties replaced.
@@ -3732,7 +3762,7 @@ class Ce {
3732
3762
  * @returns a new URL.
3733
3763
  */
3734
3764
  replace(e) {
3735
- return new Ce({
3765
+ return new je({
3736
3766
  host: e.host ?? this.host,
3737
3767
  port: e.port ?? this.port,
3738
3768
  protocol: e.protocol ?? this.protocol,
@@ -3745,40 +3775,40 @@ class Ce {
3745
3775
  * @returns a new URL.
3746
3776
  */
3747
3777
  child(e) {
3748
- return new Ce({
3778
+ return new je({
3749
3779
  ...this,
3750
- pathPrefix: ea(this.path, e)
3780
+ pathPrefix: ia(this.path, e)
3751
3781
  });
3752
3782
  }
3753
3783
  /** @returns a string representation of the url */
3754
3784
  toString() {
3755
- return ta(
3785
+ return aa(
3756
3786
  `${this.protocol}://${this.host}:${this.port}/${this.path}`
3757
3787
  );
3758
3788
  }
3759
- static UNKNOWN = new Ce({ host: "unknown", port: 0 });
3789
+ static UNKNOWN = new je({ host: "unknown", port: 0 });
3760
3790
  }
3761
- const ra = 2, na = 3, sa = 2, ia = (t, e) => {
3791
+ const oa = 2, ua = 3, la = 2, ca = (t, e) => {
3762
3792
  if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3763
- const r = Oe(e);
3793
+ const r = ve(e);
3764
3794
  if (r == 0) return t;
3765
3795
  let n;
3766
- r >= 1e3 ? n = ra : r >= 1 ? n = na : n = Math.ceil(-Math.log10(r)) + sa;
3796
+ r >= 1e3 ? n = oa : r >= 1 ? n = ua : n = Math.ceil(-Math.log10(r)) + la;
3767
3797
  const s = 10 ** n;
3768
3798
  return Math.round(t * s) / s;
3769
- }, Fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3799
+ }, Jo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3770
3800
  __proto__: null,
3771
- abs: ir,
3772
- add: ie,
3773
- closeTo: jn,
3774
- div: we,
3775
- equal: nt,
3776
- isInteger: je,
3777
- max: Ln,
3778
- min: sr,
3779
- mult: U,
3780
- roundBySpan: ia,
3781
- roundToNearestMagnitude: Rn,
3801
+ abs: lr,
3802
+ add: ae,
3803
+ closeTo: kn,
3804
+ div: Oe,
3805
+ equal: ot,
3806
+ isInteger: Le,
3807
+ max: zn,
3808
+ min: ur,
3809
+ mult: C,
3810
+ roundBySpan: ca,
3811
+ roundToNearestMagnitude: qn,
3782
3812
  sub: q
3783
3813
  }, Symbol.toStringTag, { value: "Module" }));
3784
3814
  a.object({
@@ -3786,66 +3816,120 @@ a.object({
3786
3816
  maxRetries: a.number().optional(),
3787
3817
  scale: a.number().optional()
3788
3818
  });
3789
- const aa = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(aa), re = a.number().min(0).max(255), qr = a.number().min(0).max(1), We = a.tuple([re, re, re, qr]), oa = a.tuple([re, re, re]), ua = a.object({ rgba255: We }), la = a.number().min(0).max(360), ca = a.number().min(0).max(100), ha = a.number().min(0).max(100), kr = a.tuple([la, ca, ha, qr]), Ve = a.union([Pr, oa, We, kr, ua]), Ge = Ve.transform((t) => x(t)), fa = (t) => Ge.safeParse(t).success, da = (t) => We.safeParse(t).success, ga = (t) => {
3819
+ const ha = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ke = a.string().regex(ha), ne = a.number().min(0).max(255), Zr = a.number().min(0).max(1), Je = a.tuple([ne, ne, ne, Zr]), fa = a.tuple([ne, ne, ne]), da = a.object({ rgba255: Je }), ga = a.number().min(0).max(360), pa = a.number().min(0).max(100), ma = a.number().min(0).max(100), Yr = a.tuple([ga, pa, ma, Zr]), Xe = a.union([ke, fa, Je, Yr, da]), Ke = Xe.transform((t) => x(t)), ya = (t) => Ke.safeParse(t).success, wa = (t) => Je.safeParse(t).success, ba = (t) => {
3790
3820
  if (t == null) return;
3791
- const e = Ge.safeParse(t);
3792
- if (e.success) return Zr(e.data);
3821
+ const e = Ke.safeParse(t);
3822
+ if (e.success) return Wr(e.data);
3793
3823
  if (typeof t == "string") return t;
3794
3824
  throw e.error;
3795
3825
  }, x = (t, e = 1) => {
3796
- if (t = Ve.parse(t), typeof t == "string") return Sa(t, e);
3826
+ if (t = Xe.parse(t), typeof t == "string") return Re(t, e);
3797
3827
  if (Array.isArray(t)) {
3798
3828
  if (t.length < 3 || t.length > 4)
3799
3829
  throw new Error(`Invalid color: [${t.join(", ")}]`);
3800
3830
  return t.length === 3 ? [...t, e] : t;
3801
3831
  }
3802
3832
  return t.rgba255;
3803
- }, zr = (t, e) => {
3833
+ }, Fr = (t, e) => {
3804
3834
  if (t == null || e == null) return t == e;
3805
3835
  const r = x(t), n = x(e);
3806
3836
  return r.every((s, i) => s === n[i]);
3807
- }, pa = (t) => {
3837
+ }, Oa = (t) => {
3808
3838
  if (t == null) return;
3809
3839
  const [e, r, n, s] = x(t);
3810
- return `#${$e(e)}${$e(r)}${$e(n)}${s === 1 ? "" : $e(s * 255)}`;
3811
- }, Zr = (t) => {
3840
+ return `#${Se(e)}${Se(r)}${Se(n)}${s === 1 ? "" : Se(s * 255)}`;
3841
+ }, Wr = (t) => {
3812
3842
  const [e, r, n, s] = x(t);
3813
3843
  return `rgba(${e}, ${r}, ${n}, ${s})`;
3814
- }, ma = (t) => `rgb(${Fr(t)})`, Fr = (t) => {
3844
+ }, va = (t) => `rgb(${Vr(t)})`, Vr = (t) => {
3815
3845
  const [e, r, n] = x(t);
3816
3846
  return `${e}, ${r}, ${n}`;
3817
- }, ya = (t) => [...Pt(t), de(t)], Pt = (t) => [
3818
- ce(t) / 255,
3847
+ }, xa = (t) => [...Zt(t), ge(t)], Zt = (t) => [
3819
3848
  he(t) / 255,
3820
- fe(t) / 255
3821
- ], ce = (t) => x(t)[0], he = (t) => x(t)[1], fe = (t) => x(t)[2], de = (t) => x(t)[3], ba = (t) => zr(qt, t), wa = (t) => Ma(x(t)), Oa = (t, e) => {
3849
+ fe(t) / 255,
3850
+ de(t) / 255
3851
+ ], he = (t) => x(t)[0], fe = (t) => x(t)[1], de = (t) => x(t)[2], ge = (t) => x(t)[3], $a = (t) => Fr(Yt, t), Ta = (t) => Ca(x(t)), Sa = (t, e) => {
3822
3852
  const [r, n, s] = x(t);
3823
3853
  if (e > 100)
3824
3854
  throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
3825
3855
  return e > 1 && (e /= 100), [r, n, s, e];
3826
- }, ye = (t) => {
3827
- const [e, r, n] = Pt(t).map(
3856
+ }, we = (t) => {
3857
+ const [e, r, n] = Zt(t).map(
3828
3858
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
3829
3859
  );
3830
3860
  return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
3831
- }, va = (t) => {
3832
- const [e, r, n] = Pt(t);
3861
+ }, Na = (t) => {
3862
+ const [e, r, n] = Zt(t);
3833
3863
  return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
3834
- }, dt = (t, e) => {
3835
- const r = x(t), n = x(e), s = ye(r), i = ye(n);
3864
+ }, yt = (t, e) => {
3865
+ const r = x(t), n = x(e), s = we(r), i = we(n);
3836
3866
  return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
3837
- }, xa = (t, ...e) => {
3867
+ }, Ia = (t, ...e) => {
3838
3868
  if (e.length === 0)
3839
3869
  throw new Error("[Color.pickByContrast] - must provide at least one color");
3840
- const r = x(t), [n] = e.sort((s, i) => dt(r, i) - dt(r, s));
3870
+ const r = x(t), [n] = e.sort((s, i) => yt(r, i) - yt(r, s));
3841
3871
  return x(n);
3842
- }, Ta = (t) => ye(t) < 0.5, $a = (t) => ye(t) > 0.5, Sa = (t, e = 1) => (t = Pr.parse(t), t = Na(t), [
3843
- Se(t, 0),
3844
- Se(t, 2),
3845
- Se(t, 4),
3846
- t.length === 8 ? Se(t, 6) / 255 : e
3847
- ]), qt = [0, 0, 0, 0], $e = (t) => Math.floor(t).toString(16).padStart(2, "0"), Se = (t, e) => parseInt(t.slice(e, e + 2), 16), Na = (t) => t.startsWith("#") ? t.slice(1) : t, Ia = (t) => {
3848
- t = kr.parse(t);
3872
+ }, Ma = (t) => we(t) < 0.5, Ea = (t) => we(t) > 0.5, Re = (t, e = 1) => (t = ke.parse(t), t = Aa(t), [
3873
+ Ne(t, 0),
3874
+ Ne(t, 2),
3875
+ Ne(t, 4),
3876
+ t.length === 8 ? Ne(t, 6) / 255 : e
3877
+ ]), Yt = [0, 0, 0, 0], Se = (t) => Math.floor(t).toString(16).padStart(2, "0"), Ne = (t, e) => parseInt(t.slice(e, e + 2), 16), Aa = (t) => t.startsWith("#") ? t.slice(1) : t, Ht = {
3878
+ black: "#000000",
3879
+ white: "#ffffff",
3880
+ red: "#ff0000",
3881
+ green: "#008000",
3882
+ blue: "#0000ff",
3883
+ yellow: "#ffff00",
3884
+ cyan: "#00ffff",
3885
+ magenta: "#ff00ff",
3886
+ silver: "#c0c0c0",
3887
+ gray: "#808080",
3888
+ grey: "#808080",
3889
+ maroon: "#800000",
3890
+ olive: "#808000",
3891
+ lime: "#00ff00",
3892
+ aqua: "#00ffff",
3893
+ teal: "#008080",
3894
+ navy: "#000080",
3895
+ fuchsia: "#ff00ff",
3896
+ purple: "#800080",
3897
+ orange: "#ffa500",
3898
+ brown: "#a52a2a",
3899
+ tan: "#d2b48c",
3900
+ gold: "#ffd700",
3901
+ indigo: "#4b0082",
3902
+ violet: "#ee82ee",
3903
+ pink: "#ffc0cb",
3904
+ coral: "#ff7f50",
3905
+ salmon: "#fa8072",
3906
+ khaki: "#f0e68c",
3907
+ crimson: "#dc143c",
3908
+ transparent: "transparent"
3909
+ }, Ba = (t) => {
3910
+ if (!t) return;
3911
+ const e = t.trim().toLowerCase();
3912
+ if (!(e === "transparent" || e === "none")) {
3913
+ if (e.startsWith("#")) {
3914
+ if (e.length === 4) {
3915
+ const r = e[1], n = e[2], s = e[3], i = `#${r}${r}${n}${n}${s}${s}`;
3916
+ if (ke.safeParse(i).success) return Re(i);
3917
+ }
3918
+ return (e.length === 7 || e.length === 9) && ke.safeParse(e).success ? Re(e) : void 0;
3919
+ }
3920
+ if (e.startsWith("rgb")) {
3921
+ const r = e.match(
3922
+ /rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/
3923
+ );
3924
+ if (r) {
3925
+ const [, n, s, i, o] = r;
3926
+ return [parseInt(n), parseInt(s), parseInt(i), o ? parseFloat(o) : 1];
3927
+ }
3928
+ }
3929
+ if (Ht[e]) return Re(Ht[e]);
3930
+ }
3931
+ }, Ua = (t) => {
3932
+ t = Yr.parse(t);
3849
3933
  let [e, r, n] = t;
3850
3934
  const s = t[3];
3851
3935
  e /= 360, r /= 100, n /= 100;
@@ -3854,11 +3938,11 @@ const aa = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(aa), re = a.n
3854
3938
  i = o = c = n;
3855
3939
  else {
3856
3940
  const h = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - h;
3857
- i = Qe(l, h, e + 1 / 3), o = Qe(l, h, e), c = Qe(l, h, e - 1 / 3);
3941
+ i = rt(l, h, e + 1 / 3), o = rt(l, h, e), c = rt(l, h, e - 1 / 3);
3858
3942
  }
3859
3943
  return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
3860
- }, Qe = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Ma = (t) => {
3861
- t = We.parse(t);
3944
+ }, rt = (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), Ca = (t) => {
3945
+ t = Je.parse(t);
3862
3946
  let [e, r, n] = t;
3863
3947
  const s = t[3];
3864
3948
  e /= 255, r /= 255, n /= 255;
@@ -3871,13 +3955,13 @@ const aa = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(aa), re = a.n
3871
3955
  h = l > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? c = (r - n) / d + (r < n ? 6 : 0) : i === r ? c = (n - e) / d + 2 : c = (e - r) / d + 4, c /= 6;
3872
3956
  }
3873
3957
  return c *= 360, h *= 100, l *= 100, [Math.round(c), Math.round(h), Math.round(l), s];
3874
- }, Ea = x("#000000"), Aa = x("#ffffff"), Yr = a.object({
3958
+ }, ja = x("#000000"), Ra = x("#ffffff"), Gr = a.object({
3875
3959
  key: a.string(),
3876
- color: Ve,
3960
+ color: Xe,
3877
3961
  position: a.number(),
3878
3962
  switched: a.boolean().optional()
3879
- }), Ba = a.array(Yr), Ua = (t, e) => {
3880
- if (t.length === 0) return qt;
3963
+ }), La = a.array(Gr), Da = (t, e) => {
3964
+ if (t.length === 0) return Yt;
3881
3965
  if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return x(t[0].color);
3882
3966
  if (e >= t[t.length - 1].position)
3883
3967
  return x(t[t.length - 1].color);
@@ -3887,161 +3971,162 @@ const aa = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Pr = a.string().regex(aa), re = a.n
3887
3971
  if (e === n.position) return x(n.color);
3888
3972
  if (e === s.position) return x(s.color);
3889
3973
  const i = (e - n.position) / (s.position - n.position), o = x(n.color), c = x(s.color), h = Math.round(
3890
- ce(o) + i * (ce(c) - ce(o))
3891
- ), l = Math.round(
3892
3974
  he(o) + i * (he(c) - he(o))
3893
- ), d = Math.round(
3975
+ ), l = Math.round(
3894
3976
  fe(o) + i * (fe(c) - fe(o))
3895
- ), m = de(o) + i * (de(c) - de(o));
3896
- return x([h, l, d, m]);
3977
+ ), d = Math.round(
3978
+ de(o) + i * (de(c) - de(o))
3979
+ ), y = ge(o) + i * (ge(c) - ge(o));
3980
+ return x([h, l, d, y]);
3897
3981
  }
3898
3982
  return x(t[t.length - 1].color);
3899
- }, Ca = a.object({
3983
+ }, Pa = a.object({
3900
3984
  key: a.string(),
3901
3985
  name: a.string(),
3902
- color: Ge
3903
- }), ja = a.object({
3986
+ color: Ke
3987
+ }), ka = a.object({
3904
3988
  key: a.string(),
3905
3989
  name: a.string(),
3906
- swatches: a.array(Ca)
3907
- }), Ra = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3990
+ swatches: a.array(Pa)
3991
+ }), qa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3908
3992
  __proto__: null,
3909
- BLACK: Ea,
3910
- WHITE: Aa,
3911
- ZERO: qt,
3912
- aValue: de,
3913
- bValue: fe,
3914
- colorZ: Ge,
3993
+ BLACK: ja,
3994
+ WHITE: Ra,
3995
+ ZERO: Yt,
3996
+ aValue: ge,
3997
+ bValue: de,
3998
+ colorZ: Ke,
3915
3999
  construct: x,
3916
- contrast: dt,
3917
- crudeZ: Ve,
3918
- cssString: ga,
3919
- equals: zr,
3920
- fromGradient: Ua,
3921
- fromHSLA: Ia,
3922
- gValue: he,
3923
- gradientZ: Ba,
3924
- grayness: va,
3925
- hex: pa,
3926
- hsla: wa,
3927
- isColor: da,
3928
- isCrude: fa,
3929
- isDark: Ta,
3930
- isLight: $a,
3931
- isZero: ba,
3932
- luminance: ye,
3933
- paletteZ: ja,
3934
- pickByContrast: xa,
3935
- rValue: ce,
3936
- rgbCSS: ma,
3937
- rgbString: Fr,
3938
- rgba1: ya,
3939
- rgbaCSS: Zr,
3940
- setAlpha: Oa,
3941
- stopZ: Yr
3942
- }, Symbol.toStringTag, { value: "Module" })), Wr = a.int().min(0).max(255), Vr = 255, Gr = 0, La = {
3943
- lower: Gr,
3944
- upper: Vr + 1
3945
- }, Hr = a.object({
4000
+ contrast: yt,
4001
+ crudeZ: Xe,
4002
+ cssString: ba,
4003
+ equals: Fr,
4004
+ fromCSS: Ba,
4005
+ fromGradient: Da,
4006
+ fromHSLA: Ua,
4007
+ gValue: fe,
4008
+ gradientZ: La,
4009
+ grayness: Na,
4010
+ hex: Oa,
4011
+ hsla: Ta,
4012
+ isColor: wa,
4013
+ isCrude: ya,
4014
+ isDark: Ma,
4015
+ isLight: Ea,
4016
+ isZero: $a,
4017
+ luminance: we,
4018
+ paletteZ: ka,
4019
+ pickByContrast: Ia,
4020
+ rValue: he,
4021
+ rgbCSS: va,
4022
+ rgbString: Vr,
4023
+ rgba1: xa,
4024
+ rgbaCSS: Wr,
4025
+ setAlpha: Sa,
4026
+ stopZ: Gr
4027
+ }, Symbol.toStringTag, { value: "Module" })), Hr = a.int().min(0).max(255), Jr = 255, Xr = 0, za = {
4028
+ lower: Xr,
4029
+ upper: Jr + 1
4030
+ }, Kr = a.object({
3946
4031
  name: a.string(),
3947
4032
  key: a.string()
3948
4033
  }), be = (t) => a.object({
3949
- subject: Hr,
4034
+ subject: Kr,
3950
4035
  resource: t,
3951
- authority: Wr
3952
- }), Da = (...t) => (e) => e.filter((r) => {
4036
+ authority: Hr
4037
+ }), Za = (...t) => (e) => e.filter((r) => {
3953
4038
  let n = !1;
3954
4039
  return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
3955
- }), Jr = (t) => a.object({
4040
+ }), Qr = (t) => a.object({
3956
4041
  from: be(t),
3957
4042
  to: a.null()
3958
- }), Xr = (t) => a.object({
4043
+ }), _r = (t) => a.object({
3959
4044
  from: a.null(),
3960
4045
  to: be(t)
3961
- }), Pa = (t) => a.union([
3962
- Jr(t),
3963
- Xr(t),
4046
+ }), Ya = (t) => a.union([
4047
+ Qr(t),
4048
+ _r(t),
3964
4049
  a.object({
3965
4050
  from: be(t),
3966
4051
  to: be(t)
3967
4052
  })
3968
- ]), Yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4053
+ ]), Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3969
4054
  __proto__: null,
3970
- ABSOLUTE_AUTHORITY: Vr,
3971
- AUTHORITY_BOUNDS: La,
3972
- ZERO_AUTHORITY: Gr,
3973
- acquireZ: Xr,
3974
- authorityZ: Wr,
3975
- filterTransfersByChannelKey: Da,
3976
- releaseZ: Jr,
4055
+ ABSOLUTE_AUTHORITY: Jr,
4056
+ AUTHORITY_BOUNDS: za,
4057
+ ZERO_AUTHORITY: Xr,
4058
+ acquireZ: _r,
4059
+ authorityZ: Hr,
4060
+ filterTransfersByChannelKey: Za,
4061
+ releaseZ: Qr,
3977
4062
  stateZ: be,
3978
- subjectZ: Hr,
3979
- transferZ: Pa
3980
- }, Symbol.toStringTag, { value: "Module" })), qa = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), ka = (t, e) => {
4063
+ subjectZ: Kr,
4064
+ transferZ: Ya
4065
+ }, Symbol.toStringTag, { value: "Module" })), Fa = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Wa = (t, e) => {
3981
4066
  const r = Symbol.for(t);
3982
- if (!qa(r)) {
4067
+ if (!Fa(r)) {
3983
4068
  const n = e();
3984
4069
  Object.defineProperty(globalThis, r, { value: n });
3985
4070
  }
3986
4071
  return () => globalThis[r];
3987
- }, Kr = "sy_x_error", za = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Qr = (t) => class le extends Error {
3988
- static discriminator = Kr;
3989
- discriminator = le.discriminator;
4072
+ }, en = "sy_x_error", Va = (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), tn = (t) => class ce extends Error {
4073
+ static discriminator = en;
4074
+ discriminator = ce.discriminator;
3990
4075
  static TYPE = t;
3991
- type = le.TYPE;
3992
- static matches = za(t);
3993
- matches = le.matches;
4076
+ type = ce.TYPE;
4077
+ static matches = Va(t);
4078
+ matches = ce.matches;
3994
4079
  constructor(r, n) {
3995
- super(r, n), this.name = le.TYPE;
4080
+ super(r, n), this.name = ce.TYPE;
3996
4081
  }
3997
4082
  static sub(r) {
3998
- return Qr(`${t}.${r}`);
4083
+ return tn(`${t}.${r}`);
3999
4084
  }
4000
- }, Za = (t) => {
4085
+ }, Ga = (t) => {
4001
4086
  if (t == null || typeof t != "object") return !1;
4002
4087
  const e = t;
4003
- if (e.discriminator !== Kr) return !1;
4088
+ if (e.discriminator !== en) return !1;
4004
4089
  if (!("type" in e))
4005
4090
  throw new Error(
4006
4091
  `X Error is missing its type property: ${JSON.stringify(e)}`
4007
4092
  );
4008
4093
  return !0;
4009
- }, ae = "unknown", Yt = "nil";
4010
- class Fa {
4094
+ }, oe = "unknown", Jt = "nil";
4095
+ class Ha {
4011
4096
  providers = [];
4012
4097
  register(e) {
4013
4098
  this.providers.push(e);
4014
4099
  }
4015
4100
  encode(e) {
4016
- if (e == null) return { type: Yt, data: "" };
4017
- if (Za(e))
4101
+ if (e == null) return { type: Jt, data: "" };
4102
+ if (Ga(e))
4018
4103
  for (const r of this.providers) {
4019
4104
  const n = r.encode(e);
4020
4105
  if (n != null) return n;
4021
4106
  }
4022
- if (e instanceof Error) return { type: ae, data: e.message };
4023
- if (typeof e == "string") return { type: ae, data: e };
4107
+ if (e instanceof Error) return { type: oe, data: e.message };
4108
+ if (typeof e == "string") return { type: oe, data: e };
4024
4109
  try {
4025
- return { type: ae, data: JSON.stringify(e) };
4110
+ return { type: oe, data: JSON.stringify(e) };
4026
4111
  } catch {
4027
- return { type: ae, data: "unable to encode error information" };
4112
+ return { type: oe, data: "unable to encode error information" };
4028
4113
  }
4029
4114
  }
4030
4115
  decode(e) {
4031
- if (e == null || e.type === Yt) return null;
4032
- if (e.type === ae) return new Wt(e.data);
4116
+ if (e == null || e.type === Jt) return null;
4117
+ if (e.type === oe) return new Xt(e.data);
4033
4118
  for (const r of this.providers) {
4034
4119
  const n = r.decode(e);
4035
4120
  if (n != null) return n;
4036
4121
  }
4037
- return new Wt(e.data);
4122
+ return new Xt(e.data);
4038
4123
  }
4039
4124
  }
4040
- ka("synnax-error-registry", () => new Fa());
4041
- class Wt extends Qr("unknown") {
4125
+ Wa("synnax-error-registry", () => new Ha());
4126
+ class Xt extends tn("unknown") {
4042
4127
  }
4043
4128
  a.object({ type: a.string(), data: a.string() });
4044
- const Wo = () => new Promise((t) => setTimeout(t, 0)), Ya = S.object({
4129
+ const Ko = () => new Promise((t) => setTimeout(t, 0)), Ja = S.object({
4045
4130
  jsonrpc: S.literal("2.0"),
4046
4131
  method: S.string(),
4047
4132
  // params should be z.union([z.record(z.string(), z.json()),
@@ -4049,12 +4134,12 @@ const Wo = () => new Promise((t) => setTimeout(t, 0)), Ya = S.object({
4049
4134
  // definition of params then in the JSON-RPC spec.
4050
4135
  params: S.any().optional(),
4051
4136
  id: S.union([S.string(), S.number(), S.null()]).optional()
4052
- }), _r = S.object({
4137
+ }), rn = S.object({
4053
4138
  jsonrpc: S.literal("2.0"),
4054
4139
  id: S.union([S.string(), S.number(), S.null()])
4055
- }), Wa = _r.extend({
4140
+ }), Xa = rn.extend({
4056
4141
  result: S.json()
4057
- }), Va = _r.extend({
4142
+ }), Ka = rn.extend({
4058
4143
  error: S.object({
4059
4144
  code: S.number().int(),
4060
4145
  // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
@@ -4062,31 +4147,31 @@ const Wo = () => new Promise((t) => setTimeout(t, 0)), Ya = S.object({
4062
4147
  message: S.string().optional(),
4063
4148
  data: S.json().optional()
4064
4149
  })
4065
- }), Ga = S.union([Wa, Va]);
4066
- S.union([Ya, Ga]);
4067
- const Ha = (t, e, r) => {
4150
+ }), Qa = S.union([Xa, Ka]);
4151
+ S.union([Ja, Qa]);
4152
+ const _a = (t, e, r) => {
4068
4153
  const n = t.get(e);
4069
4154
  return n === void 0 ? (t.set(e, r), r) : n;
4070
- }, Vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4155
+ }, Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4071
4156
  __proto__: null,
4072
- getOrSetDefault: Ha
4073
- }, Symbol.toStringTag, { value: "Module" })), gt = a.string().regex(/^\d+\.\d+\.\d+$/), xe = (t, e, r = {}) => {
4157
+ getOrSetDefault: _a
4158
+ }, Symbol.toStringTag, { value: "Module" })), wt = a.string().regex(/^\d+\.\d+\.\d+$/), $e = (t, e, r = {}) => {
4074
4159
  r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
4075
- const n = gt.parse(t), s = gt.parse(e), [i, o, c] = n.split(".").map(Number), [h, l, d] = s.split(".").map(Number);
4160
+ const n = wt.parse(t), s = wt.parse(e), [i, o, c] = n.split(".").map(Number), [h, l, d] = s.split(".").map(Number);
4076
4161
  if (r.checkMajor) {
4077
- if (i < h) return Ie;
4078
- if (i > h) return Me;
4162
+ if (i < h) return Me;
4163
+ if (i > h) return Ee;
4079
4164
  }
4080
4165
  if (r.checkMinor) {
4081
- if (o < l) return Ie;
4082
- if (o > l) return Me;
4166
+ if (o < l) return Me;
4167
+ if (o > l) return Ee;
4083
4168
  }
4084
4169
  if (r.checkPatch) {
4085
- if (c < d) return Ie;
4086
- if (c > d) return Me;
4170
+ if (c < d) return Me;
4171
+ if (c > d) return Ee;
4087
4172
  }
4088
- return ne;
4089
- }, Ja = (t, e, r = {}) => er(xe(t, e, r)), en = (t, e, r = {}) => _t(xe(t, e, r)), Xa = (t, e, r = {}) => Qt(xe(t, e, r)), Ka = ({
4173
+ return se;
4174
+ }, eo = (t, e, r = {}) => ir($e(t, e, r)), nn = (t, e, r = {}) => sr($e(t, e, r)), to = (t, e, r = {}) => nr($e(t, e, r)), ro = ({
4090
4175
  name: t,
4091
4176
  migrate: e
4092
4177
  }) => (r) => {
@@ -4096,14 +4181,14 @@ const Ha = (t, e, r) => {
4096
4181
  } catch (n) {
4097
4182
  throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
4098
4183
  }
4099
- }, Qa = ({
4184
+ }, no = ({
4100
4185
  name: t,
4101
4186
  migrations: e,
4102
4187
  targetSchema: r,
4103
4188
  defaultVersion: n,
4104
4189
  def: s
4105
4190
  }) => {
4106
- const i = Object.keys(e).sort(xe).pop();
4191
+ const i = Object.keys(e).sort($e).pop();
4107
4192
  if (i == null)
4108
4193
  return (l) => {
4109
4194
  if (l.version ??= n, l.version !== s.version)
@@ -4122,9 +4207,9 @@ const Ha = (t, e, r) => {
4122
4207
  let c = !1;
4123
4208
  const h = (l) => {
4124
4209
  try {
4125
- if (o === 0 || en(l.version, i))
4210
+ if (o === 0 || nn(l.version, i))
4126
4211
  return console.log(c ? `${t} ${l.version} now up to date` : `${t} version ${l.version} is up to date with target version ${s.version}`), l;
4127
- const d = l.version, m = e[d], p = m(l);
4212
+ const d = l.version, y = e[d], p = y(l);
4128
4213
  return c = !0, h(p);
4129
4214
  } catch (d) {
4130
4215
  return console.log(
@@ -4148,16 +4233,16 @@ const Ha = (t, e, r) => {
4148
4233
  return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
4149
4234
  }
4150
4235
  };
4151
- }, Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4236
+ }, _o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4152
4237
  __proto__: null,
4153
- compareSemVer: xe,
4154
- createMigration: Ka,
4155
- migrator: Qa,
4156
- semVerNewer: en,
4157
- semVerOlder: Xa,
4158
- semVerZ: gt,
4159
- versionsEqual: Ja
4160
- }, Symbol.toStringTag, { value: "Module" })), tn = ["standard", "scientific", "engineering"], _a = a.enum(tn), eo = (t, e, r) => {
4238
+ compareSemVer: $e,
4239
+ createMigration: ro,
4240
+ migrator: no,
4241
+ semVerNewer: nn,
4242
+ semVerOlder: to,
4243
+ semVerZ: wt,
4244
+ versionsEqual: eo
4245
+ }, Symbol.toStringTag, { value: "Module" })), sn = ["standard", "scientific", "engineering"], so = a.enum(sn), io = (t, e, r) => {
4161
4246
  if (Number.isNaN(t)) return "NaN";
4162
4247
  if (t === 1 / 0) return "∞";
4163
4248
  if (t === -1 / 0) return "-∞";
@@ -4166,28 +4251,28 @@ const Ha = (t, e, r) => {
4166
4251
  return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
4167
4252
  let n;
4168
4253
  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}`;
4169
- }, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4254
+ }, eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4170
4255
  __proto__: null,
4171
- NOTATIONS: tn,
4172
- notationZ: _a,
4173
- stringifyNumber: eo
4174
- }, Symbol.toStringTag, { value: "Module" })), Jo = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, rn = a.enum([
4256
+ NOTATIONS: sn,
4257
+ notationZ: so,
4258
+ stringifyNumber: io
4259
+ }, Symbol.toStringTag, { value: "Module" })), tu = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, an = a.enum([
4175
4260
  "success",
4176
4261
  "info",
4177
4262
  "warning",
4178
4263
  "error",
4179
4264
  "loading",
4180
4265
  "disabled"
4181
- ]), to = (t) => a.object({
4266
+ ]), ao = (t) => a.object({
4182
4267
  key: a.string(),
4183
- variant: rn,
4268
+ variant: an,
4184
4269
  message: a.string(),
4185
4270
  description: a.string().optional(),
4186
- time: y.z,
4271
+ time: w.z,
4187
4272
  details: t ?? a.unknown().optional()
4188
- }), ro = (t, e) => {
4273
+ }), oo = (t, e) => {
4189
4274
  if (!(t instanceof Error)) throw t;
4190
- return nn({
4275
+ return on({
4191
4276
  variant: "error",
4192
4277
  message: e ?? t.message,
4193
4278
  description: e != null ? t.message : void 0,
@@ -4195,22 +4280,29 @@ const Ha = (t, e, r) => {
4195
4280
  stack: t.stack ?? ""
4196
4281
  }
4197
4282
  });
4198
- }, nn = (t) => ({
4199
- key: Lt(),
4200
- time: y.now(),
4283
+ }, on = (t) => ({
4284
+ key: qt(),
4285
+ time: w.now(),
4201
4286
  ...t
4202
- }), no = (t, e = []) => Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4287
+ }), uo = (t, e = []) => {
4288
+ if (t != null)
4289
+ return Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0;
4290
+ }, lo = (t, e = []) => {
4291
+ if (t != null)
4292
+ return Array.isArray(e) ? e.includes(t) ? void 0 : t : e === t ? void 0 : t;
4293
+ }, ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4203
4294
  __proto__: null,
4204
- create: nn,
4205
- filterVariant: no,
4206
- fromException: ro,
4207
- statusZ: to,
4208
- variantZ: rn
4209
- }, Symbol.toStringTag, { value: "Module" })), so = (t, e = "") => {
4295
+ create: on,
4296
+ fromException: oo,
4297
+ keepVariants: uo,
4298
+ removeVariants: lo,
4299
+ statusZ: ao,
4300
+ variantZ: an
4301
+ }, Symbol.toStringTag, { value: "Module" })), co = (t, e = "") => {
4210
4302
  if (typeof t == "string") return t;
4211
4303
  const r = t.length;
4212
4304
  return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
4213
- }, io = (t) => {
4305
+ }, ho = (t) => {
4214
4306
  const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
4215
4307
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
4216
4308
  const s = /\d+/g;
@@ -4228,13 +4320,13 @@ const Ha = (t, e, r) => {
4228
4320
  return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
4229
4321
  (o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
4230
4322
  );
4231
- }, ao = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, Ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4323
+ }, fo = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4232
4324
  __proto__: null,
4233
- createShortIdentifiers: io,
4234
- naturalLanguageJoin: so,
4235
- trimPrefix: ao
4236
- }, Symbol.toStringTag, { value: "Module" })), oo = new Error("request for lock canceled");
4237
- var uo = function(t, e, r, n) {
4325
+ createShortIdentifiers: ho,
4326
+ naturalLanguageJoin: co,
4327
+ trimPrefix: fo
4328
+ }, Symbol.toStringTag, { value: "Module" })), go = new Error("request for lock canceled");
4329
+ var po = function(t, e, r, n) {
4238
4330
  function s(i) {
4239
4331
  return i instanceof r ? i : new r(function(o) {
4240
4332
  o(i);
@@ -4244,15 +4336,15 @@ var uo = function(t, e, r, n) {
4244
4336
  function c(d) {
4245
4337
  try {
4246
4338
  l(n.next(d));
4247
- } catch (m) {
4248
- o(m);
4339
+ } catch (y) {
4340
+ o(y);
4249
4341
  }
4250
4342
  }
4251
4343
  function h(d) {
4252
4344
  try {
4253
4345
  l(n.throw(d));
4254
- } catch (m) {
4255
- o(m);
4346
+ } catch (y) {
4347
+ o(y);
4256
4348
  }
4257
4349
  }
4258
4350
  function l(d) {
@@ -4261,20 +4353,20 @@ var uo = function(t, e, r, n) {
4261
4353
  l((n = n.apply(t, e || [])).next());
4262
4354
  });
4263
4355
  };
4264
- class lo {
4265
- constructor(e, r = oo) {
4356
+ class mo {
4357
+ constructor(e, r = go) {
4266
4358
  this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
4267
4359
  }
4268
4360
  acquire(e = 1, r = 0) {
4269
4361
  if (e <= 0)
4270
4362
  throw new Error(`invalid weight ${e}: must be positive`);
4271
4363
  return new Promise((n, s) => {
4272
- const i = { resolve: n, reject: s, weight: e, priority: r }, o = sn(this._queue, (c) => r <= c.priority);
4364
+ const i = { resolve: n, reject: s, weight: e, priority: r }, o = un(this._queue, (c) => r <= c.priority);
4273
4365
  o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
4274
4366
  });
4275
4367
  }
4276
4368
  runExclusive(e) {
4277
- return uo(this, arguments, void 0, function* (r, n = 1, s = 0) {
4369
+ return po(this, arguments, void 0, function* (r, n = 1, s = 0) {
4278
4370
  const [i, o] = yield this.acquire(n, s);
4279
4371
  try {
4280
4372
  return yield r(i);
@@ -4287,7 +4379,7 @@ class lo {
4287
4379
  if (e <= 0)
4288
4380
  throw new Error(`invalid weight ${e}: must be positive`);
4289
4381
  return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
4290
- this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), co(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4382
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), yo(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4291
4383
  });
4292
4384
  }
4293
4385
  isLocked() {
@@ -4342,17 +4434,17 @@ class lo {
4342
4434
  return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
4343
4435
  }
4344
4436
  }
4345
- function co(t, e) {
4346
- const r = sn(t, (n) => e.priority <= n.priority);
4437
+ function yo(t, e) {
4438
+ const r = un(t, (n) => e.priority <= n.priority);
4347
4439
  t.splice(r + 1, 0, e);
4348
4440
  }
4349
- function sn(t, e) {
4441
+ function un(t, e) {
4350
4442
  for (let r = t.length - 1; r >= 0; r--)
4351
4443
  if (e(t[r]))
4352
4444
  return r;
4353
4445
  return -1;
4354
4446
  }
4355
- var ho = function(t, e, r, n) {
4447
+ var wo = function(t, e, r, n) {
4356
4448
  function s(i) {
4357
4449
  return i instanceof r ? i : new r(function(o) {
4358
4450
  o(i);
@@ -4362,15 +4454,15 @@ var ho = function(t, e, r, n) {
4362
4454
  function c(d) {
4363
4455
  try {
4364
4456
  l(n.next(d));
4365
- } catch (m) {
4366
- o(m);
4457
+ } catch (y) {
4458
+ o(y);
4367
4459
  }
4368
4460
  }
4369
4461
  function h(d) {
4370
4462
  try {
4371
4463
  l(n.throw(d));
4372
- } catch (m) {
4373
- o(m);
4464
+ } catch (y) {
4465
+ o(y);
4374
4466
  }
4375
4467
  }
4376
4468
  function l(d) {
@@ -4379,12 +4471,12 @@ var ho = function(t, e, r, n) {
4379
4471
  l((n = n.apply(t, e || [])).next());
4380
4472
  });
4381
4473
  };
4382
- class fo {
4474
+ class bo {
4383
4475
  constructor(e) {
4384
- this._semaphore = new lo(1, e);
4476
+ this._semaphore = new mo(1, e);
4385
4477
  }
4386
4478
  acquire() {
4387
- return ho(this, arguments, void 0, function* (e = 0) {
4479
+ return wo(this, arguments, void 0, function* (e = 0) {
4388
4480
  const [, r] = yield this._semaphore.acquire(1, e);
4389
4481
  return r;
4390
4482
  });
@@ -4405,34 +4497,34 @@ class fo {
4405
4497
  return this._semaphore.cancel();
4406
4498
  }
4407
4499
  }
4408
- class an extends fo {
4500
+ class ln extends bo {
4409
4501
  constructor(e) {
4410
4502
  super(), Object.assign(this, e);
4411
4503
  }
4412
4504
  }
4413
- const go = (t) => new an(t), Qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4505
+ const Oo = (t) => new ln(t), su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4414
4506
  __proto__: null,
4415
- mutex: an,
4416
- newMutex: go
4507
+ mutex: ln,
4508
+ newMutex: Oo
4417
4509
  }, Symbol.toStringTag, { value: "Module" }));
4418
- function on(t) {
4510
+ function cn(t) {
4419
4511
  var e, r, n = "";
4420
4512
  if (typeof t == "string" || typeof t == "number") n += t;
4421
4513
  else if (typeof t == "object") if (Array.isArray(t)) {
4422
4514
  var s = t.length;
4423
- for (e = 0; e < s; e++) t[e] && (r = on(t[e])) && (n && (n += " "), n += r);
4515
+ for (e = 0; e < s; e++) t[e] && (r = cn(t[e])) && (n && (n += " "), n += r);
4424
4516
  } else for (r in t) t[r] && (n && (n += " "), n += r);
4425
4517
  return n;
4426
4518
  }
4427
- function po() {
4428
- for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = on(t)) && (n && (n += " "), n += e);
4519
+ function vo() {
4520
+ for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = cn(t)) && (n && (n += " "), n += e);
4429
4521
  return n;
4430
4522
  }
4431
- const mo = po, ee = "-", Vt = "__", Ne = "--", un = (t) => {
4432
- const e = (...r) => mo(...r);
4433
- return e.B = (...r) => t + ee + r.join(ee), e.E = (r) => t + Vt + r, e.M = (...r) => t + Ne + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ne + n.join("-"), e.BE = (r, ...n) => e.B(r) + Vt + n.join(ee), e.BEM = (r, n, ...s) => e.BE(r, n) + Ne + s.join(ee), e.extend = (r) => un(e.B(r)), e.var = (...r) => Ne + t + ee + r.join(ee), e;
4523
+ const xo = vo, te = "-", Kt = "__", Ie = "--", hn = (t) => {
4524
+ const e = (...r) => xo(...r);
4525
+ return e.B = (...r) => t + te + r.join(te), e.E = (r) => t + Kt + r, e.M = (...r) => t + Ie + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ie + n.join("-"), e.BE = (r, ...n) => e.B(r) + Kt + n.join(te), e.BEM = (r, n, ...s) => e.BE(r, n) + Ie + s.join(te), e.extend = (r) => hn(e.B(r)), e.var = (...r) => Ie + t + te + r.join(te), e;
4434
4526
  };
4435
- class yo {
4527
+ class $o {
4436
4528
  rows = [];
4437
4529
  columns = [];
4438
4530
  prefix;
@@ -4461,55 +4553,55 @@ class yo {
4461
4553
  };
4462
4554
  }
4463
4555
  }
4464
- const bo = (t, e) => Object.entries(e).forEach(
4556
+ const To = (t, e) => Object.entries(e).forEach(
4465
4557
  ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
4466
- ), wo = (t, e) => Array.from(t.style).forEach((r) => {
4558
+ ), So = (t, e) => Array.from(t.style).forEach((r) => {
4467
4559
  r.startsWith(e) && t.style.removeProperty(r);
4468
- }), Oo = (t) => {
4469
- const e = un(t);
4470
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", bs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", ns.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 = bo, e.removeVars = wo, e.newGridBuilder = (r) => new yo(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) => {
4560
+ }), No = (t) => {
4561
+ const e = hn(t);
4562
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", $s.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", us.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 = To, e.removeVars = So, e.newGridBuilder = (r) => new $o(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) => {
4471
4563
  if (!(r == null || r === !1))
4472
- return typeof r == "number" ? `var(--${t}-gray-l${r})` : Ra.cssString(r);
4564
+ return typeof r == "number" ? `var(--${t}-gray-l${r})` : qa.cssString(r);
4473
4565
  }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
4474
- }, _o = Oo("pluto");
4566
+ }, iu = No("pluto");
4475
4567
  export {
4476
- Go as A,
4477
- zo as B,
4478
- _o as C,
4479
- I as D,
4480
- Ao as H,
4481
- E as I,
4482
- jo as J,
4483
- Eo as K,
4484
- J as O,
4485
- pi as R,
4486
- Zo as S,
4487
- Po as W,
4488
- Bo as _,
4489
- $o as a,
4490
- Uo as b,
4491
- Ra as c,
4492
- Mo as d,
4493
- No as e,
4494
- $ as f,
4495
- Ho as g,
4496
- Le as h,
4568
+ nu as $,
4569
+ Lr as A,
4570
+ I as B,
4571
+ iu as C,
4572
+ ko as G,
4573
+ Lo as H,
4574
+ Ro as K,
4575
+ X as O,
4576
+ Oi as R,
4577
+ Ho as S,
4578
+ Mo as U,
4579
+ Fo as W,
4580
+ Do as _,
4581
+ Po as a,
4582
+ tu as b,
4583
+ Ao as c,
4584
+ jo as d,
4585
+ Uo as e,
4586
+ qa as f,
4587
+ T as g,
4588
+ qo as h,
4497
4589
  O as i,
4498
- Qo as j,
4499
- Co as k,
4500
- Io as l,
4501
- bs as m,
4502
- un as n,
4503
- Fo as o,
4504
- ns as p,
4505
- Yo as q,
4506
- y as r,
4507
- Ko as s,
4508
- Wo as t,
4509
- po as u,
4510
- Ur as v,
4511
- Xo as w,
4512
- Vo as x,
4513
- Jo as y,
4514
- xo as z
4590
+ E as j,
4591
+ Jo as k,
4592
+ Pe as l,
4593
+ su as m,
4594
+ hn as n,
4595
+ Co as o,
4596
+ us as p,
4597
+ $s as q,
4598
+ w as r,
4599
+ Xo as s,
4600
+ Ko as t,
4601
+ vo as u,
4602
+ _o as v,
4603
+ eu as w,
4604
+ ru as x,
4605
+ Qo as y,
4606
+ Go as z
4515
4607
  };