@synnaxlabs/pluto 0.36.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/dist/{Animated-BAoBw9cC.cjs → Animated-BOjwPkTJ.cjs} +1 -1
  2. package/dist/{Animated-DkZIfEYP.js → Animated-ByIJT_wA.js} +2 -2
  3. package/dist/{Item-BjErngVu.cjs → Item-Bamd13Tl.cjs} +1 -1
  4. package/dist/{Item-C7Q_zqsK.js → Item-CQ2ZuDfi.js} +8 -8
  5. package/dist/{LinePlot-Cyj5fPvs.js → LinePlot-Ci-61YDW.js} +111 -108
  6. package/dist/LinePlot-D4V1ltNT.cjs +24 -0
  7. package/dist/{Link-DIP4E5h4.cjs → Link-Cm6yn4zC.cjs} +1 -1
  8. package/dist/{Link-DkPbZ9Vw.js → Link-ZlOdu4jA.js} +1 -1
  9. package/dist/{Pack-ClLR2ywa.cjs → Pack-CyaEXvnu.cjs} +1 -1
  10. package/dist/{Pack-D8EcIVa2.js → Pack-DNCFnyuR.js} +1 -1
  11. package/dist/{Toggle-CZlnDV1Y.js → Toggle-DlYB4nmh.js} +10838 -10799
  12. package/dist/{Toggle-Dwz8HiqJ.cjs → Toggle-vgmhy8wZ.cjs} +56 -56
  13. package/dist/{Video-xr1Ey5qV.cjs → Video-g30B90s-.cjs} +1 -1
  14. package/dist/{Video-CI9sBV9l.js → Video-jaT7Y97L.js} +1 -1
  15. package/dist/{aggregator-D6gAHK4j.js → aggregator-CWsCIyed.js} +1276 -1258
  16. package/dist/aggregator-DX8ts24k.cjs +77 -0
  17. package/dist/align.cjs +1 -1
  18. package/dist/align.js +1 -1
  19. package/dist/button.cjs +1 -1
  20. package/dist/button.js +1 -1
  21. package/dist/color.cjs +1 -1
  22. package/dist/color.js +1 -1
  23. package/dist/css-Bo-hsQHb.cjs +1 -0
  24. package/dist/{css-DnIb4t_E.js → css-Csw1Dn4s.js} +449 -446
  25. package/dist/css.cjs +1 -1
  26. package/dist/css.js +2 -2
  27. package/dist/dropdown.cjs +1 -1
  28. package/dist/dropdown.js +1 -1
  29. package/dist/ether.cjs +1 -1
  30. package/dist/ether.js +5 -5
  31. package/dist/{external-CetHCRLx.js → external-2PznkZYs.js} +36 -36
  32. package/dist/{external-BxiJID8F.js → external-4ikhWnyq.js} +2 -2
  33. package/dist/{external-CIm5lpCQ.cjs → external-BS9Bfsj3.cjs} +1 -1
  34. package/dist/{external-wgG3P6Dp.js → external-BTnFzhMM.js} +1 -1
  35. package/dist/{external-BeoanEV1.js → external-BpeQ9rNJ.js} +144 -133
  36. package/dist/external-Bt_kX5KM.cjs +1 -0
  37. package/dist/{external-C-tizEE4.js → external-CEcxrva2.js} +5 -5
  38. package/dist/{external-AQutxNrw.cjs → external-CMEDU76u.cjs} +1 -1
  39. package/dist/{external-Lmd8cJhx.cjs → external-CWincA61.cjs} +1 -1
  40. package/dist/{external-Czhk9fZS.cjs → external-C_th4MW9.cjs} +1 -1
  41. package/dist/{external-BX17kwZc.cjs → external-CyPQsB1T.cjs} +1 -1
  42. package/dist/{external-BpqHq8f8.js → external-CyYaJ5TW.js} +4 -4
  43. package/dist/{external-6FH5NjXf.js → external-DIwKYTmY.js} +2 -2
  44. package/dist/{external-feiUnuJI.js → external-DXD4PtTK.js} +2 -2
  45. package/dist/{external-xPdBJlsz.js → external-Dn4tpDVi.js} +2 -2
  46. package/dist/{external-CXQMoMS3.cjs → external-DsJYjdNk.cjs} +1 -1
  47. package/dist/{external-bByVUOOg.cjs → external-Dtr4ZxR6.cjs} +1 -1
  48. package/dist/{external-8w5Eg-ce.cjs → external-IztUjYjX.cjs} +1 -1
  49. package/dist/{external-DAn-_GLc.cjs → external-VEFOprRU.cjs} +1 -1
  50. package/dist/{external-CFaZ_vCi.js → external-WZW4OBZx.js} +4 -4
  51. package/dist/{external-Cy8UF9vk.cjs → external-kAduhcvp.cjs} +1 -1
  52. package/dist/{external-BDzzt6lF.js → external-rGv5AzBK.js} +12 -12
  53. package/dist/{external-DlCfhkx8.cjs → external-vMTeF1dc.cjs} +1 -1
  54. package/dist/{external-Ckaptp3S.js → external-vYsKqfFS.js} +4 -4
  55. package/dist/header.cjs +1 -1
  56. package/dist/header.js +1 -1
  57. package/dist/index.cjs +7 -7
  58. package/dist/index.js +9767 -7504
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.js +1 -1
  61. package/dist/list.cjs +1 -1
  62. package/dist/list.js +1 -1
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/breadcrumb/Breadcrumb.d.ts +2 -1
  67. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  68. package/dist/src/breadcrumb/Breadcrumb.spec.d.ts +2 -0
  69. package/dist/src/breadcrumb/Breadcrumb.spec.d.ts.map +1 -0
  70. package/dist/src/color/core/color.d.ts +4 -0
  71. package/dist/src/color/core/color.d.ts.map +1 -1
  72. package/dist/src/haul/Haul.d.ts.map +1 -1
  73. package/dist/src/index.d.ts +1 -0
  74. package/dist/src/index.d.ts.map +1 -1
  75. package/dist/src/input/DateTime.d.ts.map +1 -1
  76. package/dist/src/input/Numeric.d.ts.map +1 -1
  77. package/dist/src/input/Text.d.ts +1 -0
  78. package/dist/src/input/Text.d.ts.map +1 -1
  79. package/dist/src/modal/Modal.d.ts.map +1 -1
  80. package/dist/src/pluto/Pluto.d.ts +1 -4
  81. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  82. package/dist/src/select/ComponentSize.d.ts +12 -0
  83. package/dist/src/select/ComponentSize.d.ts.map +1 -0
  84. package/dist/src/select/DataType.d.ts +3 -2
  85. package/dist/src/select/DataType.d.ts.map +1 -1
  86. package/dist/src/select/external.d.ts +1 -0
  87. package/dist/src/select/external.d.ts.map +1 -1
  88. package/dist/src/table/aether/Table.d.ts.map +1 -1
  89. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  90. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  91. package/dist/src/text/Editable.d.ts +2 -1
  92. package/dist/src/text/Editable.d.ts.map +1 -1
  93. package/dist/src/text/Keyboard.d.ts.map +1 -1
  94. package/dist/src/theming/Provider.d.ts.map +1 -1
  95. package/dist/src/tree/Tree.d.ts +2 -2
  96. package/dist/src/tree/Tree.d.ts.map +1 -1
  97. package/dist/src/tree/core.d.ts +5 -2
  98. package/dist/src/tree/core.d.ts.map +1 -1
  99. package/dist/src/util/canDisable.d.ts +10 -0
  100. package/dist/src/util/canDisable.d.ts.map +1 -0
  101. package/dist/src/util/removeProps.d.ts +26 -0
  102. package/dist/src/util/removeProps.d.ts.map +1 -0
  103. package/dist/src/util/removeProps.spec.d.ts +2 -0
  104. package/dist/src/util/removeProps.spec.d.ts.map +1 -0
  105. package/dist/src/vis/canvas/aether/canvas.d.ts +4 -4
  106. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  107. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  108. package/dist/src/vis/schematic/Forms.d.ts +9 -2
  109. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  110. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -3
  111. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  112. package/dist/src/vis/schematic/Symbols.d.ts +183 -3
  113. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  114. package/dist/src/vis/schematic/primitives/Primitives.d.ts +115 -6
  115. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  116. package/dist/src/vis/schematic/registry.d.ts +1 -1
  117. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  118. package/dist/src/vis/setpoint/aether/setpoint.d.ts +1 -1
  119. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  120. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  121. package/dist/tabs.cjs +1 -1
  122. package/dist/tabs.js +1 -1
  123. package/dist/text.cjs +1 -1
  124. package/dist/text.js +2 -2
  125. package/dist/theming.cjs +1 -1
  126. package/dist/theming.js +2 -2
  127. package/dist/tree.cjs +1 -1
  128. package/dist/tree.js +1 -1
  129. package/dist/triggers.cjs +1 -1
  130. package/dist/triggers.js +1 -1
  131. package/dist/{units-CKQQRvyD.js → units-CJ76Jzvw.js} +1 -1
  132. package/dist/{units-YvMXZR11.cjs → units-CXFC0OLO.cjs} +1 -1
  133. package/dist/video.cjs +1 -1
  134. package/dist/video.js +1 -1
  135. package/package.json +13 -13
  136. package/dist/LinePlot-CFpCtIU5.cjs +0 -24
  137. package/dist/aggregator-q3hNa4qv.cjs +0 -77
  138. package/dist/css-C3zWKgOb.cjs +0 -1
  139. package/dist/external-DtsEr2ls.cjs +0 -1
@@ -1,37 +1,37 @@
1
- var vt = Object.defineProperty;
2
- var Ot = (t, e, r) => e in t ? vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var C = (t, e, r) => Ot(t, typeof e != "symbol" ? e + "" : e, r);
1
+ var $t = Object.defineProperty;
2
+ var vt = (t, e, r) => e in t ? $t(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var C = (t, e, r) => vt(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import { z as i } from "zod";
5
- const te = i.tuple([i.number(), i.number()]);
5
+ const Q = i.tuple([i.number(), i.number()]);
6
6
  i.tuple([i.bigint(), i.bigint()]);
7
- const Oe = i.object({ width: i.number(), height: i.number() }), Mt = i.object({
7
+ const $e = i.object({ width: i.number(), height: i.number() }), Ot = i.object({
8
8
  signedWidth: i.number(),
9
9
  signedHeight: i.number()
10
- }), jt = ["width", "height"];
11
- i.enum(jt);
12
- const Tt = ["start", "center", "end"], It = ["signedWidth", "signedHeight"];
13
- i.enum(It);
14
- const H = i.object({ x: i.number(), y: i.number() }), ke = i.object({ clientX: i.number(), clientY: i.number() }), Me = ["x", "y"], je = i.enum(Me), Fe = ["top", "right", "bottom", "left"], Et = i.enum(Fe), re = ["left", "right"], Te = i.enum(re), ne = ["top", "bottom"], Ie = i.enum(ne), Ee = ["center"], ce = i.enum(Ee), St = [...Fe, ...Ee], Se = i.enum(St);
10
+ }), Mt = ["width", "height"];
11
+ i.enum(Mt);
12
+ const jt = ["start", "center", "end"], Tt = ["signedWidth", "signedHeight"];
15
13
  i.enum(Tt);
16
- const Bt = ["first", "last"];
17
- i.enum(Bt);
18
- const We = i.object({ lower: i.number(), upper: i.number() }), Nt = i.object({ lower: i.bigint(), upper: i.bigint() });
19
- i.union([We, te]);
20
- i.union([Nt, te]);
21
- const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T = (t) => typeof t == "bigint" || t instanceof BigInt, Z = (t, e) => T(t) ? t.valueOf() - BigInt(e.valueOf().valueOf()) : t.valueOf() - Number(e.valueOf()), Xe = (t, e) => T(t) ? t.valueOf() + BigInt(e.valueOf().valueOf()) : t + Number(e.valueOf()), At = (t, e, r = 1e-4) => Math.abs(t - e) < r, pe = (t, e) => T(t) ? t === BigInt(e.valueOf().valueOf()) : t === Number(e.valueOf()), Rt = (t) => {
14
+ const H = i.object({ x: i.number(), y: i.number() }), Fe = i.object({ clientX: i.number(), clientY: i.number() }), ve = ["x", "y"], Oe = i.enum(ve), We = ["top", "right", "bottom", "left"], It = i.enum(We), ee = ["left", "right"], Me = i.enum(ee), te = ["top", "bottom"], je = i.enum(te), Te = ["center"], ce = i.enum(Te), Et = [...We, ...Te], Ie = i.enum(Et);
15
+ i.enum(jt);
16
+ const St = ["first", "last"];
17
+ i.enum(St);
18
+ const Xe = i.object({ lower: i.number(), upper: i.number() }), Bt = i.object({ lower: i.bigint(), upper: i.bigint() });
19
+ i.union([Xe, Q]);
20
+ i.union([Bt, Q]);
21
+ const Nt = i.union([Oe, Ie]), zt = i.union([Oe, Ie, i.instanceof(String)]), T = (t) => typeof t == "bigint" || t instanceof BigInt, Z = (t, e) => T(t) ? t.valueOf() - BigInt(e.valueOf().valueOf()) : t.valueOf() - Number(e.valueOf()), De = (t, e) => T(t) ? t.valueOf() + BigInt(e.valueOf().valueOf()) : t + Number(e.valueOf()), Ct = (t, e, r = 1e-4) => Math.abs(t - e) < r, le = (t, e) => T(t) ? t === BigInt(e.valueOf().valueOf()) : t === Number(e.valueOf()), At = (t) => {
22
22
  const e = 10 ** Math.floor(Math.log10(t));
23
23
  return Math.round(t / e) * e;
24
- }, De = (t, e) => T(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), Lt = (t, e) => T(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()), Ve = (t) => T(t) || t instanceof BigInt ? t.valueOf() < 0n ? -t : t : t.valueOf() < 0 ? -t : t, _t = (t, e) => T(t) ? t.valueOf() * BigInt(e.valueOf()) : t.valueOf() * Number(e.valueOf()), Pt = (t, e) => T(t) ? t.valueOf() / BigInt(e.valueOf()) : t.valueOf() / Number(e.valueOf()), Wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
24
+ }, qe = (t, e) => T(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), Rt = (t, e) => T(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()), Ve = (t) => T(t) || t instanceof BigInt ? t.valueOf() < 0n ? -t : t : t.valueOf() < 0 ? -t : t, Lt = (t, e) => T(t) ? t.valueOf() * BigInt(e.valueOf()) : t.valueOf() * Number(e.valueOf()), _t = (t, e) => T(t) ? t.valueOf() / BigInt(e.valueOf()) : t.valueOf() / Number(e.valueOf()), Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
25
25
  __proto__: null,
26
26
  abs: Ve,
27
- add: Xe,
28
- closeTo: At,
29
- div: Pt,
30
- equal: pe,
31
- max: Lt,
32
- min: De,
33
- mult: _t,
34
- roundToNearestMagnitude: Rt,
27
+ add: De,
28
+ closeTo: Ct,
29
+ div: _t,
30
+ equal: le,
31
+ max: Rt,
32
+ min: qe,
33
+ mult: Lt,
34
+ roundToNearestMagnitude: At,
35
35
  sub: Z
36
36
  }, Symbol.toStringTag, { value: "Module" })), p = (t, e) => {
37
37
  const r = {};
@@ -40,14 +40,14 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
40
40
  else if (Array.isArray(t)) {
41
41
  if (t.length !== 2) throw new Error("bounds: expected array of length 2");
42
42
  [r.lower, r.upper] = t;
43
- } else return he(t);
44
- return he(r);
45
- }, Zt = Object.freeze({ lower: 0, upper: 0 }), Ht = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Yt = Object.freeze({ lower: 0, upper: 1 }), kt = Object.freeze({ lower: -1, upper: 1 }), Ft = (t, e) => {
43
+ } else return pe(t);
44
+ return pe(r);
45
+ }, Pt = Object.freeze({ lower: 0, upper: 0 }), Zt = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Ht = Object.freeze({ lower: 0, upper: 1 }), Yt = Object.freeze({ lower: -1, upper: 1 }), kt = (t, e) => {
46
46
  if (t == null && e == null) return !0;
47
47
  if (t == null || e == null) return !1;
48
48
  const r = p(t), n = p(e);
49
49
  return (r == null ? void 0 : r.lower) === (n == null ? void 0 : n.lower) && (r == null ? void 0 : r.upper) === (n == null ? void 0 : n.upper);
50
- }, he = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Wt = (t, e) => {
50
+ }, pe = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Ft = (t, e) => {
51
51
  const r = p(t);
52
52
  return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
53
53
  }, S = (t, e) => {
@@ -56,49 +56,49 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
56
56
  return e >= r.lower && e < r.upper;
57
57
  const n = p(e);
58
58
  return n.lower >= r.lower && n.upper <= r.upper;
59
- }, Xt = (t, e) => {
59
+ }, Wt = (t, e) => {
60
60
  const r = p(t), n = p(e);
61
61
  return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : S(r, n.upper) || S(r, n.lower) || S(n, r.upper) || S(n, r.lower);
62
- }, oe = (t) => {
62
+ }, re = (t) => {
63
63
  const e = p(t);
64
64
  return e.upper - e.lower;
65
- }, Dt = (t) => {
65
+ }, Xt = (t) => {
66
66
  const e = p(t);
67
67
  return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
68
- }, Vt = (t) => {
69
- const e = oe(t);
68
+ }, Dt = (t) => {
69
+ const e = re(t);
70
70
  return typeof e == "number" ? e === 0 : e === 0n;
71
71
  }, qt = (t) => {
72
72
  const e = p(t);
73
73
  return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
74
- }, Ut = (t) => {
74
+ }, Vt = (t) => {
75
75
  const e = p(t);
76
76
  return (e.upper + e.lower) / 2;
77
- }, Gt = (t) => ({
77
+ }, Ut = (t) => ({
78
78
  lower: Math.min(...t.map((e) => p(e).lower)),
79
79
  upper: Math.max(...t.map((e) => p(e).upper))
80
- }), Kt = (t) => ({
80
+ }), Gt = (t) => ({
81
81
  lower: Math.max(...t.map((e) => p(e).lower)),
82
82
  upper: Math.min(...t.map((e) => p(e).upper))
83
- }), Jt = (t) => {
83
+ }), Kt = (t) => {
84
84
  const e = p(t), r = typeof e.lower == "bigint";
85
- return Array.from({ length: Number(oe(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
86
- }, ye = (t, e) => {
85
+ return Array.from({ length: Number(re(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
86
+ }, he = (t, e) => {
87
87
  const r = t.map((s) => p(s)), n = r.findIndex((s) => S(s, e) || e < s.lower);
88
88
  if (n === -1) return { index: t.length, position: 0 };
89
89
  const o = r[n];
90
90
  return S(o, e) ? { index: n, position: Number(e - o.lower) } : { index: n, position: 0 };
91
- }, ae = {
91
+ }, ie = {
92
92
  removeBefore: 0,
93
93
  removeAfter: 0,
94
94
  insertInto: 0,
95
95
  deleteInBetween: 0
96
- }, Qt = (t, e) => {
97
- const r = t.map((c) => p(c)), n = p(e);
98
- if (r.length === 0) return ae;
99
- const o = ye(r, n.lower), s = ye(r, n.upper);
100
- if (o.index === t.length) return { ...ae, insertInto: t.length };
101
- if (s.index === 0) return { ...ae, removeAfter: s.position };
96
+ }, Jt = (t, e) => {
97
+ const r = t.map((l) => p(l)), n = p(e);
98
+ if (r.length === 0) return ie;
99
+ const o = he(r, n.lower), s = he(r, n.upper);
100
+ if (o.index === t.length) return { ...ie, insertInto: t.length };
101
+ if (s.index === 0) return { ...ie, removeAfter: s.position };
102
102
  if (o.index === s.index)
103
103
  return o.position !== 0 && s.position !== 0 ? null : {
104
104
  removeAfter: s.position,
@@ -106,255 +106,251 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
106
106
  insertInto: o.index,
107
107
  deleteInBetween: 0
108
108
  };
109
- let u = s.index - o.index, a = o.index, l = Z(Number(oe(r[o.index])), o.position);
110
- return o.position !== 0 ? (u -= 1, a += 1) : l = 0, {
111
- removeBefore: l,
109
+ let u = s.index - o.index, a = o.index, c = Z(Number(re(r[o.index])), o.position);
110
+ return o.position !== 0 ? (u -= 1, a += 1) : c = 0, {
111
+ removeBefore: c,
112
112
  removeAfter: s.position,
113
113
  insertInto: a,
114
114
  deleteInBetween: u
115
115
  };
116
- }, er = (t, e, r) => {
116
+ }, Qt = (t, e, r) => {
117
117
  const n = t.map((a) => p(a)), o = r > 0 ? 1 : r < 0 ? -1 : 0;
118
118
  if (o === 0) return e;
119
119
  let s = r, u = e;
120
- for (; pe(s, 0) === !1; ) {
121
- const a = n.findIndex((l) => o > 0 ? u >= l.lower && u < l.upper : u > l.lower && u <= l.upper);
120
+ for (; le(s, 0) === !1; ) {
121
+ const a = n.findIndex((c) => o > 0 ? u >= c.lower && u < c.upper : u > c.lower && u <= c.upper);
122
122
  if (a !== -1) {
123
- const l = n[a];
124
- let c;
125
- if (o > 0 ? c = Z(l.upper, u) : c = Z(u, l.lower), c > 0) {
126
- const h = De(Ve(s), c);
127
- if (u = Xe(
123
+ const c = n[a];
124
+ let l;
125
+ if (o > 0 ? l = Z(c.upper, u) : l = Z(u, c.lower), l > 0) {
126
+ const h = qe(Ve(s), l);
127
+ if (u = De(
128
128
  u,
129
129
  o > 0 ? h : -h
130
- ), s = Z(s, o > 0 ? h : -h), pe(s, 0)) return u;
130
+ ), s = Z(s, o > 0 ? h : -h), le(s, 0)) return u;
131
131
  continue;
132
132
  }
133
133
  }
134
134
  if (o > 0) {
135
- const l = n.filter((c) => c.lower > u);
136
- if (l.length > 0) u = l[0].lower;
135
+ const c = n.filter((l) => l.lower > u);
136
+ if (c.length > 0) u = c[0].lower;
137
137
  else return u;
138
138
  } else {
139
- const l = n.filter((c) => c.upper < u);
140
- if (l.length > 0)
141
- u = l[l.length - 1].upper;
139
+ const c = n.filter((l) => l.upper < u);
140
+ if (c.length > 0)
141
+ u = c[c.length - 1].upper;
142
142
  else return u;
143
143
  }
144
144
  }
145
145
  return u;
146
- }, tr = (t, e, r) => {
146
+ }, er = (t, e, r) => {
147
147
  const n = t.map((u) => p(u));
148
148
  if (e === r) return typeof e == "bigint" ? 0n : 0;
149
149
  const o = e < r ? p([e, r]) : p([r, e]);
150
150
  let s = typeof e == "bigint" ? 0n : 0;
151
151
  for (const u of n) {
152
- const a = u.lower > o.lower ? u.lower : o.lower, l = u.upper < o.upper ? u.upper : o.upper;
153
- if (a < l) {
154
- const c = l - a;
155
- s = s + c;
152
+ const a = u.lower > o.lower ? u.lower : o.lower, c = u.upper < o.upper ? u.upper : o.upper;
153
+ if (a < c) {
154
+ const l = c - a;
155
+ s = s + l;
156
156
  }
157
157
  }
158
158
  return s;
159
- }, Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
159
+ }, qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
160
160
  __proto__: null,
161
- CLIP: kt,
162
- DECIMAL: Yt,
163
- INFINITE: Ht,
164
- ZERO: Zt,
165
- bounds: We,
166
- buildInsertionPlan: Qt,
167
- clamp: Wt,
161
+ CLIP: Yt,
162
+ DECIMAL: Ht,
163
+ INFINITE: Zt,
164
+ ZERO: Pt,
165
+ bounds: Xe,
166
+ buildInsertionPlan: Jt,
167
+ clamp: Ft,
168
168
  construct: p,
169
169
  contains: S,
170
- distance: tr,
171
- equals: Ft,
172
- findInsertPosition: ye,
170
+ distance: er,
171
+ equals: kt,
172
+ findInsertPosition: he,
173
173
  isFinite: qt,
174
- isZero: Dt,
175
- linspace: Jt,
176
- makeValid: he,
177
- max: Gt,
178
- mean: Ut,
179
- min: Kt,
180
- overlapsWith: Xt,
181
- span: oe,
182
- spanIsZero: Vt,
183
- traverse: er
184
- }, Symbol.toStringTag, { value: "Module" })), qe = zt, I = (t) => Me.includes(t) ? t : ne.includes(t) ? "y" : "x", rr = (t) => I(t) === "x" ? "y" : "x", nr = (t) => I(t) === "x" ? "width" : "height", or = (t) => I(t) === "x" ? "left" : "top", sr = (t) => qe.safeParse(t).success, ir = (t) => I(t) === "x" ? "signedWidth" : "signedHeight", ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174
+ isZero: Xt,
175
+ linspace: Kt,
176
+ makeValid: pe,
177
+ max: Ut,
178
+ mean: Vt,
179
+ min: Gt,
180
+ overlapsWith: Wt,
181
+ span: re,
182
+ spanIsZero: Dt,
183
+ traverse: Qt
184
+ }, Symbol.toStringTag, { value: "Module" })), Ue = Nt, I = (t) => ve.includes(t) ? t : te.includes(t) ? "y" : "x", tr = (t) => I(t) === "x" ? "y" : "x", rr = (t) => I(t) === "x" ? "width" : "height", nr = (t) => I(t) === "x" ? "left" : "top", or = (t) => Ue.safeParse(t).success, sr = (t) => I(t) === "x" ? "signedWidth" : "signedHeight", ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
185
185
  __proto__: null,
186
186
  construct: I,
187
- crude: qe,
188
- dimension: nr,
189
- direction: je,
190
- isDirection: sr,
191
- location: or,
192
- signedDimension: ir,
193
- swap: rr
194
- }, Symbol.toStringTag, { value: "Module" })), ar = (t) => {
187
+ crude: Ue,
188
+ dimension: rr,
189
+ direction: Oe,
190
+ isDirection: or,
191
+ location: nr,
192
+ signedDimension: sr,
193
+ swap: tr
194
+ }, Symbol.toStringTag, { value: "Module" })), ur = (t) => {
195
195
  const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
196
196
  return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
197
- }, Ue = (t) => {
198
- const e = (r, n = Q) => {
197
+ }, Ee = (t) => {
198
+ const e = (r, n = ye) => {
199
199
  if (typeof r == "string") return t(r);
200
200
  if (Array.isArray(r)) return r.map((u) => e(u, n));
201
- if (!U(r)) return r;
202
- n = Ke(n);
201
+ if (!ue(r)) return r;
202
+ n = pr(n);
203
203
  const o = {}, s = r;
204
204
  return Object.keys(s).forEach((u) => {
205
205
  let a = s[u];
206
- const l = t(u);
207
- n.recursive && (U(a) ? de(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && fe(a) && (a = [...a].map((c) => {
208
- let h = c;
209
- return U(c) ? de(h, n.keepTypesOnRecursion) || (h = e(c, n)) : fe(c) && (h = e({ key: c }, n).key), h;
210
- }))), o[l] = a;
206
+ const c = t(u);
207
+ n.recursive && (ue(a) ? He(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && Ze(a) && (a = [...a].map((l) => {
208
+ let h = l;
209
+ return ue(l) ? He(h, n.keepTypesOnRecursion) || (h = e(l, n)) : Ze(l) && (h = e({ key: l }, n).key), h;
210
+ }))), o[c] = a;
211
211
  }), o;
212
212
  };
213
213
  return e;
214
- }, lr = Ue(ar), cr = (t) => (
214
+ }, ar = Ee(ur), cr = (t) => (
215
215
  // Don't convert the first character and don't convert a character that is after a
216
216
  // non-alphanumeric character
217
217
  t.replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}_${n.toLowerCase()}`)
218
- ), pr = Ue(cr), Ge = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), Q = {
218
+ ), lr = Ee(cr), Ge = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), ye = {
219
219
  recursive: !0,
220
220
  recursiveInArray: !0,
221
221
  keepTypesOnRecursion: [Number, String, Uint8Array]
222
- }, Ke = (t = Q) => (t.recursive == null ? t = Q : t.recursiveInArray ?? (t.recursiveInArray = !1), t), fe = (t) => t != null && Array.isArray(t), U = (t) => t != null && typeof t == "object" && !Array.isArray(t), de = (t, e) => (e || []).some((r) => t instanceof r), Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
222
+ }, pr = (t = ye) => (t.recursive == null ? t = ye : t.recursiveInArray ?? (t.recursiveInArray = !1), t), Ze = (t) => t != null && Array.isArray(t), ue = (t) => t != null && typeof t == "object" && !Array.isArray(t), He = (t, e) => (e || []).some((r) => t instanceof r), hr = (t) => t.replace(/\s+/g, "-").replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}-${n.toLowerCase()}`).toLowerCase(), yr = Ee(hr), Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
223
223
  __proto__: null,
224
- belongToTypes: de,
225
- camelToSnake: pr,
224
+ camelToSnake: lr,
226
225
  capitalize: Ge,
227
- defaultOptions: Q,
228
- isArrayObject: fe,
229
- isValidObject: U,
230
- snakeToCamel: lr,
231
- validateOptions: Ke
232
- }, Symbol.toStringTag, { value: "Module" })), hr = Te, yr = Ie, fr = ce, dr = {
226
+ snakeToCamel: ar,
227
+ toKebab: yr
228
+ }, Symbol.toStringTag, { value: "Module" })), fr = Me, gr = je, dr = ce, br = {
233
229
  top: "bottom",
234
230
  right: "left",
235
231
  bottom: "top",
236
232
  left: "right",
237
233
  center: "center"
238
- }, gr = {
234
+ }, xr = {
239
235
  top: "left",
240
236
  right: "top",
241
237
  bottom: "right",
242
238
  left: "bottom",
243
239
  center: "center"
244
- }, br = Ct, O = (t) => t instanceof String || !Me.includes(t) ? t : t === "x" ? "left" : "top", xr = (t) => dr[O(t)], mr = (t) => gr[O(t)], Y = (t) => {
240
+ }, mr = zt, O = (t) => t instanceof String || !ve.includes(t) ? t : t === "x" ? "left" : "top", wr = (t) => br[O(t)], $r = (t) => xr[O(t)], Y = (t) => {
245
241
  const e = O(t);
246
242
  return e === "top" || e === "bottom" ? "y" : "x";
247
- }, wr = i.object({
248
- x: Te.or(ce),
249
- y: Ie.or(ce)
250
- }), Je = i.object({ x: Te, y: Ie }), F = Object.freeze({ x: "left", y: "top" }), Be = Object.freeze({ x: "right", y: "top" }), se = Object.freeze({ x: "left", y: "bottom" }), Ne = Object.freeze({ x: "right", y: "bottom" }), ze = Object.freeze({ x: "center", y: "center" }), Qe = Object.freeze({ x: "center", y: "top" }), et = Object.freeze({ x: "center", y: "bottom" }), tt = Object.freeze({ x: "right", y: "center" }), rt = Object.freeze({ x: "left", y: "center" }), $r = Object.freeze([
251
- rt,
243
+ }, vr = i.object({
244
+ x: Me.or(ce),
245
+ y: je.or(ce)
246
+ }), Ke = i.object({ x: Me, y: je }), F = Object.freeze({ x: "left", y: "top" }), Se = Object.freeze({ x: "right", y: "top" }), ne = Object.freeze({ x: "left", y: "bottom" }), Be = Object.freeze({ x: "right", y: "bottom" }), Ne = Object.freeze({ x: "center", y: "center" }), Je = Object.freeze({ x: "center", y: "top" }), Qe = Object.freeze({ x: "center", y: "bottom" }), et = Object.freeze({ x: "right", y: "center" }), tt = Object.freeze({ x: "left", y: "center" }), Or = Object.freeze([
252
247
  tt,
253
- Qe,
254
248
  et,
249
+ Je,
250
+ Qe,
255
251
  F,
252
+ Se,
253
+ ne,
256
254
  Be,
257
- se,
258
- Ne,
259
- ze
260
- ]), Ce = (t, e) => t.x === e.x && t.y === e.y, vr = (t, e) => {
255
+ Ne
256
+ ]), ze = (t, e) => t.x === e.x && t.y === e.y, Mr = (t, e) => {
261
257
  if (typeof e == "object") {
262
258
  let r = !0;
263
259
  return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
264
260
  }
265
261
  return t.x === e || t.y === e;
266
- }, nt = (t) => [t.x, t.y], G = (t) => Y(O(t)) === "x", Or = (t) => Y(O(t)) === "y", Mr = (t) => `${t.x}${Ge(t.y)}`, jr = (t, e) => {
262
+ }, rt = (t) => [t.x, t.y], U = (t) => Y(O(t)) === "x", jr = (t) => Y(O(t)) === "y", Tr = (t) => `${t.x}${Ge(t.y)}`, Ir = (t, e) => {
267
263
  let r, n;
268
264
  if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = O(t), n = O(e ?? t)), Y(r) === Y(n) && r !== "center" && n !== "center")
269
265
  throw new Error(
270
266
  `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
271
267
  );
272
- const o = { ...ze };
273
- return r === "center" ? G(n) ? [o.x, o.y] = [n, r] : [o.x, o.y] = [r, n] : n === "center" ? G(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r] : G(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r], o;
274
- }, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
268
+ const o = { ...Ne };
269
+ return r === "center" ? U(n) ? [o.x, o.y] = [n, r] : [o.x, o.y] = [r, n] : n === "center" ? U(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r] : U(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r], o;
270
+ }, nt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
275
271
  __proto__: null,
276
- BOTTOM_CENTER: et,
277
- BOTTOM_LEFT: se,
278
- BOTTOM_RIGHT: Ne,
279
- CENTER: ze,
280
- CENTER_LOCATIONS: Ee,
281
- LEFT_CENTER: rt,
282
- RIGHT_CENTER: tt,
283
- TOP_CENTER: Qe,
272
+ BOTTOM_CENTER: Qe,
273
+ BOTTOM_LEFT: ne,
274
+ BOTTOM_RIGHT: Be,
275
+ CENTER: Ne,
276
+ CENTER_LOCATIONS: Te,
277
+ LEFT_CENTER: tt,
278
+ RIGHT_CENTER: et,
279
+ TOP_CENTER: Je,
284
280
  TOP_LEFT: F,
285
- TOP_RIGHT: Be,
286
- XY_LOCATIONS: $r,
287
- X_LOCATIONS: re,
288
- Y_LOCATIONS: ne,
289
- center: fr,
281
+ TOP_RIGHT: Se,
282
+ XY_LOCATIONS: Or,
283
+ X_LOCATIONS: ee,
284
+ Y_LOCATIONS: te,
285
+ center: dr,
290
286
  construct: O,
291
- constructXY: jr,
292
- corner: Je,
293
- crude: br,
287
+ constructXY: Ir,
288
+ corner: Ke,
289
+ crude: mr,
294
290
  direction: Y,
295
- isX: G,
296
- isY: Or,
297
- location: Se,
298
- outer: Et,
299
- rotate90: mr,
300
- swap: xr,
301
- x: hr,
302
- xy: wr,
303
- xyCouple: nt,
304
- xyEquals: Ce,
305
- xyMatches: vr,
306
- xyToString: Mr,
307
- y: yr
308
- }, Symbol.toStringTag, { value: "Module" })), ge = i.union([
291
+ isX: U,
292
+ isY: jr,
293
+ location: Ie,
294
+ outer: It,
295
+ rotate90: $r,
296
+ swap: wr,
297
+ x: fr,
298
+ xy: vr,
299
+ xyCouple: rt,
300
+ xyEquals: ze,
301
+ xyMatches: Mr,
302
+ xyToString: Tr,
303
+ y: gr
304
+ }, Symbol.toStringTag, { value: "Module" })), fe = i.union([
309
305
  i.number(),
310
306
  H,
311
- te,
312
- Oe,
313
- Mt,
314
- ke
307
+ Q,
308
+ $e,
309
+ Ot,
310
+ Fe
315
311
  ]), f = (t, e) => {
316
312
  if (typeof t == "string") {
317
313
  if (e === void 0) throw new Error("The y coordinate must be given.");
318
314
  return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
319
315
  }
320
316
  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 };
321
- }, x = Object.freeze({ x: 0, y: 0 }), st = Object.freeze({ x: 1, y: 1 }), Tr = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Ir = Object.freeze({ x: NaN, y: NaN }), ee = (t, e, r = 0) => {
317
+ }, x = Object.freeze({ x: 0, y: 0 }), ot = Object.freeze({ x: 1, y: 1 }), Er = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Sr = Object.freeze({ x: NaN, y: NaN }), J = (t, e, r = 0) => {
322
318
  const n = f(t), o = f(e);
323
319
  return r === 0 ? n.x === o.x && n.y === o.y : Math.abs(n.x - o.x) <= r && Math.abs(n.y - o.y) <= r;
324
- }, Er = (t) => ee(t, x), Ae = (t, e, r) => {
320
+ }, Br = (t) => J(t, x), Ce = (t, e, r) => {
325
321
  const n = f(t), o = f(e, r);
326
322
  return { x: n.x * o.x, y: n.y * o.y };
327
- }, it = (t, e) => {
323
+ }, st = (t, e) => {
328
324
  const r = f(t);
329
325
  return { x: r.x + e, y: r.y };
330
- }, ut = (t, e) => {
326
+ }, it = (t, e) => {
331
327
  const r = f(t);
332
328
  return { x: r.x, y: r.y + e };
333
- }, k = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? it(t, r) : ut(t, r) : [t, e, r ?? x, ...n].reduce((o, s) => {
329
+ }, k = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? st(t, r) : it(t, r) : [t, e, r ?? x, ...n].reduce((o, s) => {
334
330
  const u = f(s);
335
331
  return { x: o.x + u.x, y: o.y + u.y };
336
- }, x), Sr = (t, e, r) => {
332
+ }, x), Nr = (t, e, r) => {
337
333
  const n = f(t);
338
334
  return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
339
- }, Br = (t, e) => {
335
+ }, zr = (t, e) => {
340
336
  const r = f(t), n = f(e);
341
337
  return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
342
- }, Nr = (t, e) => {
338
+ }, Cr = (t, e) => {
343
339
  const r = f(t), n = f(e);
344
340
  return { x: n.x - r.x, y: n.y - r.y };
345
- }, zr = (t) => {
341
+ }, Ar = (t) => {
346
342
  const e = f(t);
347
343
  return Number.isNaN(e.x) || Number.isNaN(e.y);
348
- }, Cr = (t) => {
344
+ }, Rr = (t) => {
349
345
  const e = f(t);
350
346
  return Number.isFinite(e.x) && Number.isFinite(e.y);
351
- }, Ar = (t) => {
347
+ }, Lr = (t) => {
352
348
  const e = f(t);
353
349
  return [e.x, e.y];
354
- }, Rr = (t) => {
350
+ }, _r = (t) => {
355
351
  const e = f(t);
356
352
  return { left: e.x, top: e.y };
357
- }, be = (t, e = 0) => {
353
+ }, ge = (t, e = 0) => {
358
354
  const r = f(t);
359
355
  return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
360
356
  }, L = (t, e) => {
@@ -363,78 +359,78 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
363
359
  }, _ = (t) => {
364
360
  const e = f(t), r = Math.hypot(e.x, e.y);
365
361
  return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
366
- }, at = (t) => {
362
+ }, ut = (t) => {
367
363
  const e = f(t), r = Math.hypot(e.x, e.y);
368
364
  return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
369
- }, lt = (...t) => {
365
+ }, at = (...t) => {
370
366
  const e = t.reduce((r, n) => k(r, n), x);
371
- return Ae(e, 1 / t.length);
372
- }, Lr = (t, e) => {
367
+ return Ce(e, 1 / t.length);
368
+ }, Pr = (t, e) => {
373
369
  const r = [];
374
370
  for (let n = 0; n < t.length; n++) {
375
371
  const o = t[n];
376
- let s, u, a, l;
372
+ let s, u, a, c;
377
373
  if (n === 0) {
378
- const c = t[n + 1], h = L(c, o);
379
- u = _(h), a = u, l = e;
374
+ const l = t[n + 1], h = L(l, o);
375
+ u = _(h), a = u, c = e;
380
376
  } else if (n === t.length - 1) {
381
- const c = t[n - 1], h = L(o, c);
382
- s = _(h), a = s, l = e;
377
+ const l = t[n - 1], h = L(o, l);
378
+ s = _(h), a = s, c = e;
383
379
  } else {
384
- const c = t[n - 1], h = t[n + 1], E = L(o, c), R = L(h, o);
380
+ const l = t[n - 1], h = t[n + 1], E = L(o, l), R = L(h, o);
385
381
  s = _(E), u = _(R);
386
- const $t = Math.acos(
382
+ const wt = Math.acos(
387
383
  (E.x * R.x + E.y * R.y) / (Math.hypot(E.x, E.y) * Math.hypot(R.x, R.y))
388
- ), Ze = Math.sin($t / 2);
389
- Ze === 0 ? l = e : l = e / Ze, a = at(lt(s, u));
384
+ ), Pe = Math.sin(wt / 2);
385
+ Pe === 0 ? c = e : c = e / Pe, a = ut(at(s, u));
390
386
  }
391
- r.push(Ae(a, l));
387
+ r.push(Ce(a, c));
392
388
  }
393
389
  return r;
394
- }, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
390
+ }, Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
395
391
  __proto__: null,
396
- INFINITY: Tr,
397
- NAN: Ir,
398
- ONE: st,
392
+ INFINITY: Er,
393
+ NAN: Sr,
394
+ ONE: ot,
399
395
  ZERO: x,
400
- average: lt,
401
- calculateMiters: Lr,
402
- clientXY: ke,
396
+ average: at,
397
+ calculateMiters: Pr,
398
+ clientXY: Fe,
403
399
  construct: f,
404
- couple: Ar,
405
- crudeZ: ge,
406
- css: Rr,
407
- distance: Br,
408
- equals: ee,
409
- isFinite: Cr,
410
- isNan: zr,
411
- isZero: Er,
400
+ couple: Lr,
401
+ crudeZ: fe,
402
+ css: _r,
403
+ distance: zr,
404
+ equals: J,
405
+ isFinite: Rr,
406
+ isNan: Ar,
407
+ isZero: Br,
412
408
  normal: _,
413
- normalize: at,
414
- scale: Ae,
415
- set: Sr,
409
+ normalize: ut,
410
+ scale: Ce,
411
+ set: Nr,
416
412
  sub: L,
417
413
  translate: k,
418
- translateX: it,
419
- translateY: ut,
420
- translation: Nr,
421
- truncate: be,
414
+ translateX: st,
415
+ translateY: it,
416
+ translation: Cr,
417
+ truncate: ge,
422
418
  xy: H
423
- }, Symbol.toStringTag, { value: "Module" })), X = i.union([i.number(), i.string()]), _r = i.object({
419
+ }, Symbol.toStringTag, { value: "Module" })), X = i.union([i.number(), i.string()]), Zr = i.object({
424
420
  top: X,
425
421
  left: X,
426
422
  width: X,
427
423
  height: X
428
- }), Pr = i.object({
424
+ }), Hr = i.object({
429
425
  left: i.number(),
430
426
  top: i.number(),
431
427
  right: i.number(),
432
428
  bottom: i.number()
433
- }), Zr = i.object({
429
+ }), Yr = i.object({
434
430
  one: H,
435
431
  two: H,
436
- root: Je
437
- }), ct = { one: x, two: x, root: F }, Hr = { one: x, two: st, root: se }, pt = (t, e) => ({
432
+ root: Ke
433
+ }), ct = { one: x, two: x, root: F }, kr = { one: x, two: ot, root: ne }, lt = (t, e) => ({
438
434
  one: t.one,
439
435
  two: t.two,
440
436
  root: e ?? t.root
@@ -456,7 +452,7 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
456
452
  x: s.one.x + e.signedWidth,
457
453
  y: s.one.y + e.signedHeight
458
454
  } : s.two = e, s));
459
- }, Yr = (t, e, r) => {
455
+ }, Fr = (t, e, r) => {
460
456
  const n = y(t);
461
457
  if (typeof e == "string") {
462
458
  if (r == null) throw new Error("Invalid arguments for resize");
@@ -470,63 +466,63 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
470
466
  );
471
467
  }
472
468
  return y(n.one, e, void 0, void 0, n.root);
473
- }, kr = (t, e, r = !0) => {
469
+ }, Wr = (t, e, r = !0) => {
474
470
  const n = y(t);
475
471
  let o = (s, u) => s < u;
476
472
  return r && (o = (s, u) => s <= u), "one" in e ? o($(n), $(e)) && o(B(e), B(n)) && o(v(n), v(e)) && o(N(e), N(n)) : o($(n), e.x) && o(e.x, B(n)) && o(v(n), e.y) && o(e.y, N(n));
477
- }, Fr = (t, e) => ee(t.one, e.one) && ee(t.two, e.two) && Ce(t.root, e.root), ht = (t) => ({
473
+ }, Xr = (t, e) => J(t.one, e.one) && J(t.two, e.two) && ze(t.root, e.root), pt = (t) => ({
478
474
  width: M(t),
479
475
  height: j(t)
480
- }), Wr = (t) => ({
481
- signedWidth: ie(t),
482
- signedHeight: ue(t)
483
- }), Xr = (t) => ({
476
+ }), Dr = (t) => ({
477
+ signedWidth: oe(t),
478
+ signedHeight: se(t)
479
+ }), qr = (t) => ({
484
480
  top: v(t),
485
481
  left: $(t),
486
482
  width: M(t),
487
483
  height: j(t)
488
- }), Re = (t, e, r = !1) => {
489
- const n = I(e) === "y" ? ue(t) : ie(t);
484
+ }), Ae = (t, e, r = !1) => {
485
+ const n = I(e) === "y" ? se(t) : oe(t);
490
486
  return r ? n : Math.abs(n);
491
487
  }, W = (t, e) => {
492
488
  const r = y(t);
493
489
  return {
494
- x: e.x === "center" ? xe(r).x : z(r, e.x),
495
- y: e.y === "center" ? xe(r).y : z(r, e.y)
490
+ x: e.x === "center" ? de(r).x : z(r, e.x),
491
+ y: e.y === "center" ? de(r).y : z(r, e.y)
496
492
  };
497
493
  }, z = (t, e) => {
498
- const r = y(t), n = nt(r.root).includes(e) ? Math.min : Math.max;
499
- return re.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
500
- }, Dr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, M = (t) => Re(t, "x"), j = (t) => Re(t, "y"), ie = (t) => {
494
+ const r = y(t), n = rt(r.root).includes(e) ? Math.min : Math.max;
495
+ return ee.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
496
+ }, Vr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, M = (t) => Ae(t, "x"), j = (t) => Ae(t, "y"), oe = (t) => {
501
497
  const e = y(t);
502
498
  return e.two.x - e.one.x;
503
- }, ue = (t) => {
499
+ }, se = (t) => {
504
500
  const e = y(t);
505
501
  return e.two.y - e.one.y;
506
- }, yt = (t) => W(t, F), Vr = (t) => W(t, Be), qr = (t) => W(t, se), Ur = (t) => W(t, Ne), B = (t) => z(t, "right"), N = (t) => z(t, "bottom"), $ = (t) => z(t, "left"), v = (t) => z(t, "top"), xe = (t) => k(yt(t), {
507
- x: ie(t) / 2,
508
- y: ue(t) / 2
509
- }), Le = (t) => {
502
+ }, ht = (t) => W(t, F), Ur = (t) => W(t, Se), Gr = (t) => W(t, ne), Kr = (t) => W(t, Be), B = (t) => z(t, "right"), N = (t) => z(t, "bottom"), $ = (t) => z(t, "left"), v = (t) => z(t, "top"), de = (t) => k(ht(t), {
503
+ x: oe(t) / 2,
504
+ y: se(t) / 2
505
+ }), Re = (t) => {
510
506
  const e = y(t);
511
507
  return e.root.x === "left" ? $(e) : B(e);
512
- }, _e = (t) => {
508
+ }, Le = (t) => {
513
509
  const e = y(t);
514
510
  return e.root.y === "top" ? v(e) : N(e);
515
- }, Gr = (t) => ({ x: Le(t), y: _e(t) }), K = (t) => {
511
+ }, Jr = (t) => ({ x: Re(t), y: Le(t) }), G = (t) => {
516
512
  const e = y(t);
517
513
  return { lower: e.one.x, upper: e.two.x };
518
- }, J = (t) => {
514
+ }, K = (t) => {
519
515
  const e = y(t);
520
516
  return { lower: e.one.y, upper: e.two.y };
521
- }, Kr = (t, e) => pt(t, e), Jr = (t, e) => {
522
- const r = y(t), n = re.includes(e) ? "x" : ne.includes(e) ? "y" : null;
523
- if (n === null) throw new Error(`Invalid location: ${ot}`);
517
+ }, Qr = (t, e) => lt(t, e), en = (t, e) => {
518
+ const r = y(t), n = ee.includes(e) ? "x" : te.includes(e) ? "y" : null;
519
+ if (n === null) throw new Error(`Invalid location: ${nt}`);
524
520
  const o = e === "top" || e === "left" ? Math.min : Math.max, s = { ...r.one }, u = { ...r.two };
525
521
  return s[n] = o(r.one[n], r.two[n]), u[n] = o(r.one[n], r.two[n]), [s, u];
526
- }, Qr = (t, e) => {
527
- const r = y(t), n = y(e), o = Le(n) + (M(n) - M(r)) / 2, s = _e(n) + (j(n) - j(r)) / 2;
528
- return y({ x: o, y: s }, ht(r));
529
- }, ft = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, en = (t) => M(t) / j(t), tn = (t, e, r) => {
522
+ }, tn = (t, e) => {
523
+ const r = y(t), n = y(e), o = Re(n) + (M(n) - M(r)) / 2, s = Le(n) + (j(n) - j(r)) / 2;
524
+ return y({ x: o, y: s }, pt(r));
525
+ }, yt = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, rn = (t) => M(t) / j(t), nn = (t, e, r) => {
530
526
  if (typeof e == "string") {
531
527
  if (r == null) throw new Error("Undefined amount passed into box.translate");
532
528
  const o = I(e);
@@ -540,128 +536,128 @@ const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T =
540
536
  void 0,
541
537
  n.root
542
538
  );
543
- }, rn = (t, e) => {
539
+ }, on = (t, e) => {
544
540
  const r = Math.max($(t), $(e)), n = Math.max(v(t), v(e)), o = Math.min(B(t), B(e)), s = Math.min(N(t), N(e));
545
541
  return r > o || n > s ? ct : y({ x: r, y: n }, { x: o, y: s }, void 0, void 0, t.root);
546
- }, nn = (t) => M(t) * j(t), on = (t, e) => {
542
+ }, sn = (t) => M(t) * j(t), un = (t, e) => {
547
543
  const r = y(t);
548
544
  return y(
549
- be(r.one, e),
550
- be(r.two, e),
545
+ ge(r.one, e),
546
+ ge(r.two, e),
551
547
  void 0,
552
548
  void 0,
553
549
  r.root
554
550
  );
555
- }, sn = (t, e, r, n, o, s) => {
551
+ }, an = (t, e, r, n, o, s) => {
556
552
  const u = { x: t, y: e }, a = { x: t + r, y: e + n };
557
553
  return o.x !== s.x && (o.x === "center" ? (u.x -= r / 2, a.x -= r / 2) : (u.x -= r, a.x -= r)), o.y !== s.y && (o.y === "center" ? (u.y -= n / 2, a.y -= n / 2) : (u.y -= n, a.y -= n)), y(u, a, void 0, void 0, s);
558
- }, qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
554
+ }, Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
559
555
  __proto__: null,
560
- DECIMAL: Hr,
556
+ DECIMAL: kr,
561
557
  ZERO: ct,
562
- area: nn,
563
- areaIsZero: Dr,
564
- aspect: en,
558
+ area: sn,
559
+ areaIsZero: Vr,
560
+ aspect: rn,
565
561
  bottom: N,
566
- bottomLeft: qr,
567
- bottomRight: Ur,
568
- box: Zr,
569
- center: xe,
562
+ bottomLeft: Gr,
563
+ bottomRight: Kr,
564
+ box: Yr,
565
+ center: de,
570
566
  construct: y,
571
- constructWithAlternateRoot: sn,
572
- contains: kr,
573
- copy: pt,
574
- css: Xr,
575
- cssBox: _r,
576
- dim: Re,
577
- dims: ht,
578
- domRect: Pr,
579
- edgePoints: Jr,
580
- equals: Fr,
567
+ constructWithAlternateRoot: an,
568
+ contains: Wr,
569
+ copy: lt,
570
+ css: qr,
571
+ cssBox: Zr,
572
+ dim: Ae,
573
+ dims: pt,
574
+ domRect: Hr,
575
+ edgePoints: en,
576
+ equals: Xr,
581
577
  height: j,
582
- intersection: rn,
583
- isBox: ft,
578
+ intersection: on,
579
+ isBox: yt,
584
580
  left: $,
585
581
  loc: z,
586
- positionInCenter: Qr,
587
- reRoot: Kr,
588
- resize: Yr,
582
+ positionInCenter: tn,
583
+ reRoot: Qr,
584
+ resize: Fr,
589
585
  right: B,
590
- root: Gr,
591
- signedDims: Wr,
592
- signedHeight: ue,
593
- signedWidth: ie,
586
+ root: Jr,
587
+ signedDims: Dr,
588
+ signedHeight: se,
589
+ signedWidth: oe,
594
590
  top: v,
595
- topLeft: yt,
596
- topRight: Vr,
597
- translate: tn,
598
- truncate: on,
591
+ topLeft: ht,
592
+ topRight: Ur,
593
+ translate: nn,
594
+ truncate: un,
599
595
  width: M,
600
- x: Le,
601
- xBounds: K,
596
+ x: Re,
597
+ xBounds: G,
602
598
  xyLoc: W,
603
- y: _e,
604
- yBounds: J
605
- }, Symbol.toStringTag, { value: "Module" })), dt = i.object({ signedWidth: i.number(), signedHeight: i.number() }), un = i.union([Oe, dt, H, te]), an = { width: 0, height: 0 }, ln = { width: 1, height: 1 }, g = (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 }, cn = (t, e) => {
599
+ y: Le,
600
+ yBounds: K
601
+ }, Symbol.toStringTag, { value: "Module" })), ft = i.object({ signedWidth: i.number(), signedHeight: i.number() }), cn = i.union([$e, ft, H, Q]), ln = { width: 0, height: 0 }, pn = { width: 1, height: 1 }, d = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, hn = (t, e) => {
606
602
  if (e == null) return !1;
607
- const r = g(t), n = g(e);
603
+ const r = d(t), n = d(e);
608
604
  return r.width === n.width && r.height === n.height;
609
- }, pn = (t) => {
610
- const e = g(t);
605
+ }, yn = (t) => {
606
+ const e = d(t);
611
607
  return { width: e.height, height: e.width };
612
- }, hn = (t) => {
613
- const e = g(t);
608
+ }, fn = (t) => {
609
+ const e = d(t);
614
610
  return `0 0 ${e.width} ${e.height}`;
615
- }, yn = (t) => {
616
- const e = g(t);
611
+ }, gn = (t) => {
612
+ const e = d(t);
617
613
  return [e.width, e.height];
618
- }, fn = (t) => ({
619
- width: Math.max(...t.map((e) => g(e).width)),
620
- height: Math.max(...t.map((e) => g(e).height))
621
- }), dn = (t) => ({
622
- width: Math.min(...t.map((e) => g(e).width)),
623
- height: Math.min(...t.map((e) => g(e).height))
624
- }), gn = (t, e) => {
625
- const r = g(t);
614
+ }, dn = (t) => ({
615
+ width: Math.max(...t.map((e) => d(e).width)),
616
+ height: Math.max(...t.map((e) => d(e).height))
617
+ }), bn = (t) => ({
618
+ width: Math.min(...t.map((e) => d(e).width)),
619
+ height: Math.min(...t.map((e) => d(e).height))
620
+ }), xn = (t, e) => {
621
+ const r = d(t);
626
622
  return { width: r.width * e, height: r.height * e };
627
- }, Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
623
+ }, Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
628
624
  __proto__: null,
629
- DECIMAL: ln,
630
- ZERO: an,
631
- construct: g,
632
- couple: yn,
633
- crude: un,
634
- dimensions: Oe,
635
- equals: cn,
636
- max: fn,
637
- min: dn,
638
- scale: gn,
639
- signed: dt,
640
- svgViewBox: hn,
641
- swap: pn
625
+ DECIMAL: pn,
626
+ ZERO: ln,
627
+ construct: d,
628
+ couple: gn,
629
+ crude: cn,
630
+ dimensions: $e,
631
+ equals: hn,
632
+ max: dn,
633
+ min: bn,
634
+ scale: xn,
635
+ signed: ft,
636
+ svgViewBox: fn,
637
+ swap: yn
642
638
  }, Symbol.toStringTag, { value: "Module" }));
643
- var bn = Object.defineProperty, xn = (t, e, r) => e in t ? bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, w = (t, e, r) => xn(t, typeof e != "symbol" ? e + "" : e, r);
644
- const mn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, wn = i.object({ offset: ge, scale: ge }), $n = i.object({ offset: i.number(), scale: i.number() }), vn = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
639
+ var mn = Object.defineProperty, wn = (t, e, r) => e in t ? mn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, w = (t, e, r) => wn(t, typeof e != "symbol" ? e + "" : e, r);
640
+ const $n = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, vn = i.object({ offset: fe, scale: fe }), On = i.object({ offset: i.number(), scale: i.number() }), Mn = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
645
641
  e,
646
642
  o ? n - t : n + t
647
- ], On = (t) => (e, r, n, o) => [
643
+ ], jn = (t) => (e, r, n, o) => [
648
644
  e,
649
645
  o ? n / t : n * t
650
- ], Mn = (t) => (e, r, n) => {
646
+ ], Tn = (t) => (e, r, n) => {
651
647
  if (e === null) return [t, n];
652
- const { lower: o, upper: s } = e, { lower: u, upper: a } = t, l = s - o, c = a - u;
653
- if (r === "dimension") return [t, n * (c / l)];
654
- const h = (n - o) * (c / l) + u;
648
+ const { lower: o, upper: s } = e, { lower: u, upper: a } = t, c = s - o, l = a - u;
649
+ if (r === "dimension") return [t, n * (l / c)];
650
+ const h = (n - o) * (l / c) + u;
655
651
  return [t, h];
656
- }, jn = (t) => (e, r, n) => [t, n], Tn = () => (t, e, r) => {
652
+ }, In = (t) => (e, r, n) => [t, n], En = () => (t, e, r) => {
657
653
  if (t === null) throw new Error("cannot invert without bounds");
658
654
  if (e === "dimension") return [t, r];
659
655
  const { lower: n, upper: o } = t;
660
656
  return [t, o - (r - n)];
661
- }, In = (t) => (e, r, n) => {
657
+ }, Sn = (t) => (e, r, n) => {
662
658
  const { lower: o, upper: s } = t;
663
- return n = mn(n, o, s), [e, n];
664
- }, me = class P {
659
+ return n = $n(n, o, s), [e, n];
660
+ }, be = class P {
665
661
  constructor() {
666
662
  w(this, "ops", []), w(this, "currBounds", null), w(this, "currType", null), w(this, "reversed", !1), this.ops = [];
667
663
  }
@@ -691,7 +687,7 @@ const mn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r :
691
687
  * @param value - The amount to translate by.
692
688
  */
693
689
  translate(e) {
694
- const r = this.new(), n = vn(e);
690
+ const r = this.new(), n = Mn(e);
695
691
  return n.type = "translate", r.ops.push(n), r;
696
692
  }
697
693
  /**
@@ -701,23 +697,23 @@ const mn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r :
701
697
  * @param value - The amount to magnify by.
702
698
  */
703
699
  magnify(e) {
704
- const r = this.new(), n = On(e);
700
+ const r = this.new(), n = jn(e);
705
701
  return n.type = "magnify", r.ops.push(n), r;
706
702
  }
707
703
  scale(e, r) {
708
- const n = p(e, r), o = this.new(), s = Mn(n);
704
+ const n = p(e, r), o = this.new(), s = Tn(n);
709
705
  return s.type = "scale", o.ops.push(s), o;
710
706
  }
711
707
  clamp(e, r) {
712
- const n = p(e, r), o = this.new(), s = In(n);
708
+ const n = p(e, r), o = this.new(), s = Sn(n);
713
709
  return s.type = "clamp", o.ops.push(s), o;
714
710
  }
715
711
  reBound(e, r) {
716
- const n = p(e, r), o = this.new(), s = jn(n);
712
+ const n = p(e, r), o = this.new(), s = In(n);
717
713
  return s.type = "re-bound", o.ops.push(s), o;
718
714
  }
719
715
  invert() {
720
- const e = Tn();
716
+ const e = En();
721
717
  e.type = "invert";
722
718
  const r = this.new();
723
719
  return r.ops.push(e), r;
@@ -756,10 +752,10 @@ const mn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r :
756
752
  return { scale: this.dim(1), offset: this.pos(0) };
757
753
  }
758
754
  };
759
- w(me, "IDENTITY", new me());
760
- let we = me;
761
- const $e = class m {
762
- constructor(e = new we(), r = new we(), n = null) {
755
+ w(be, "IDENTITY", new be());
756
+ let xe = be;
757
+ const me = class m {
758
+ constructor(e = new xe(), r = new xe(), n = null) {
763
759
  w(this, "x"), w(this, "y"), w(this, "currRoot"), this.x = e, this.y = r, this.currRoot = n;
764
760
  }
765
761
  static translate(e, r) {
@@ -801,19 +797,19 @@ const $e = class m {
801
797
  }
802
798
  scale(e) {
803
799
  const r = this.copy();
804
- if (ft(e)) {
800
+ if (yt(e)) {
805
801
  const n = this.currRoot;
806
- return r.currRoot = e.root, n != null && !Ce(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(K(e)), r.y = r.y.scale(J(e)), r;
802
+ return r.currRoot = e.root, n != null && !ze(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(G(e)), r.y = r.y.scale(K(e)), r;
807
803
  }
808
804
  return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
809
805
  }
810
806
  reBound(e) {
811
807
  const r = this.copy();
812
- return r.x = this.x.reBound(K(e)), r.y = this.y.reBound(J(e)), r;
808
+ return r.x = this.x.reBound(G(e)), r.y = this.y.reBound(K(e)), r;
813
809
  }
814
810
  clamp(e) {
815
811
  const r = this.copy();
816
- return r.x = this.x.clamp(K(e)), r.y = this.y.clamp(J(e)), r;
812
+ return r.x = this.x.clamp(G(e)), r.y = this.y.clamp(K(e)), r;
817
813
  }
818
814
  copy() {
819
815
  const e = new m();
@@ -845,14 +841,14 @@ const $e = class m {
845
841
  };
846
842
  }
847
843
  };
848
- w($e, "IDENTITY", new $e());
849
- let En = $e;
850
- const Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
844
+ w(me, "IDENTITY", new me());
845
+ let Bn = me;
846
+ const Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
851
847
  __proto__: null,
852
- Scale: we,
853
- XY: En,
854
- crudeXYTransform: wn,
855
- transform: $n
848
+ Scale: xe,
849
+ XY: Bn,
850
+ crudeXYTransform: vn,
851
+ transform: On
856
852
  }, Symbol.toStringTag, { value: "Module" }));
857
853
  function gt(t) {
858
854
  var e, r, n = "";
@@ -863,16 +859,16 @@ function gt(t) {
863
859
  } else for (r in t) t[r] && (n && (n += " "), n += r);
864
860
  return n;
865
861
  }
866
- function Sn() {
862
+ function Nn() {
867
863
  for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = gt(t)) && (n && (n += " "), n += e);
868
864
  return n;
869
865
  }
870
- const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
871
- const e = (...r) => Bn(...r);
872
- return e.B = (r) => t + He + r, e.E = (r) => t + Ye + r, e.M = (r) => t + D + r, e.BM = (r, n) => e.B(r) + D + n, e.BE = (r, n) => e.B(r) + Ye + n, e.BEM = (r, n, o) => e.BE(r, n) + D + o, e.extend = (r) => bt(e.B(r)), e.var = (r) => D + t + He + r, e;
873
- }, Nn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ve = i.string().regex(Nn), A = i.number().min(0).max(255), zn = i.number().min(0).max(1), Pe = i.tuple([A, A, A, zn]), xt = i.tuple([A, A, A]), mt = i.object({ rgba255: Pe }), Kn = (t) => t == null ? void 0 : new d(t).hex, Jn = (t) => {
866
+ const zn = Nn, Ye = "-", ke = "__", D = "--", dt = (t) => {
867
+ const e = (...r) => zn(...r);
868
+ return e.B = (r) => t + Ye + r, e.E = (r) => t + ke + r, e.M = (r) => t + D + r, e.BM = (r, n) => e.B(r) + D + n, e.BE = (r, n) => e.B(r) + ke + n, e.BEM = (r, n, o) => e.BE(r, n) + D + o, e.extend = (r) => dt(e.B(r)), e.var = (r) => D + t + Ye + r, e;
869
+ }, Cn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, we = i.string().regex(Cn), A = i.number().min(0).max(255), An = i.number().min(0).max(1), _e = i.tuple([A, A, A, An]), bt = i.tuple([A, A, A]), xt = i.object({ rgba255: _e }), Qn = (t) => t == null ? void 0 : new g(t).hex, eo = (t) => {
874
870
  if (t == null) return;
875
- const e = d.z.safeParse(t);
871
+ const e = g.z.safeParse(t);
876
872
  if (e.success) return e.data.rgbaCSS;
877
873
  if (typeof t == "string") return t;
878
874
  throw e.error;
@@ -920,7 +916,7 @@ const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
920
916
  */
921
917
  get hex() {
922
918
  const [e, r, n, o] = this.rgba255;
923
- return `#${V(e)}${V(r)}${V(n)}${o === 1 ? "" : V(o * 255)}`;
919
+ return `#${q(e)}${q(r)}${q(n)}${o === 1 ? "" : q(o * 255)}`;
924
920
  }
925
921
  /**
926
922
  * @returns the color as a CSS RGBA string.
@@ -971,10 +967,10 @@ const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
971
967
  }
972
968
  /** @returns true if all RGBA values are 0. */
973
969
  get isZero() {
974
- return this.equals(wt);
970
+ return this.equals(mt);
975
971
  }
976
972
  get hsla() {
977
- return An(this.rgba255);
973
+ return Ln(this.rgba255);
978
974
  }
979
975
  /**
980
976
  * Creates a new color with the given alpha.
@@ -998,6 +994,13 @@ const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
998
994
  );
999
995
  return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
1000
996
  }
997
+ /**
998
+ * @returns the grayness of the color, between 0 and 1.
999
+ */
1000
+ get grayness() {
1001
+ const [e, r, n] = this.rgb1;
1002
+ return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
1003
+ }
1001
1004
  /**
1002
1005
  * @returns the contrast ratio between this color and the given color. The contrast
1003
1006
  * ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
@@ -1022,18 +1025,18 @@ const Bn = Sn, He = "-", Ye = "__", D = "--", bt = (t) => {
1022
1025
  return !this.isDark;
1023
1026
  }
1024
1027
  static fromHex(e, r = 1) {
1025
- if (!ve.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
1026
- return e = Cn(e), [
1027
- q(e, 0),
1028
- q(e, 2),
1029
- q(e, 4),
1030
- e.length === 8 ? q(e, 6) / 255 : r
1028
+ if (!we.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
1029
+ return e = Rn(e), [
1030
+ V(e, 0),
1031
+ V(e, 2),
1032
+ V(e, 4),
1033
+ e.length === 8 ? V(e, 6) / 255 : r
1031
1034
  ];
1032
1035
  }
1033
1036
  };
1034
- C(b, "z", i.union([ve, Pe, xt, i.instanceof(b), mt]).transform((e) => new b(e)));
1035
- let d = b;
1036
- const wt = new d([0, 0, 0, 0]), V = (t) => Math.floor(t).toString(16).padStart(2, "0"), q = (t, e) => parseInt(t.slice(e, e + 2), 16), Cn = (t) => t.startsWith("#") ? t.slice(1) : t, Qn = (t) => {
1037
+ C(b, "z", i.union([we, _e, bt, i.instanceof(b), xt]).transform((e) => new b(e)));
1038
+ let g = b;
1039
+ const mt = new g([0, 0, 0, 0]), q = (t) => Math.floor(t).toString(16).padStart(2, "0"), V = (t, e) => parseInt(t.slice(e, e + 2), 16), Rn = (t) => t.startsWith("#") ? t.slice(1) : t, to = (t) => {
1037
1040
  let [e, r, n] = t;
1038
1041
  const o = t[3];
1039
1042
  e /= 360, r /= 100, n /= 100;
@@ -1041,60 +1044,60 @@ const wt = new d([0, 0, 0, 0]), V = (t) => Math.floor(t).toString(16).padStart(2
1041
1044
  if (r === 0)
1042
1045
  s = u = a = n;
1043
1046
  else {
1044
- const l = n < 0.5 ? n * (1 + r) : n + r - n * r, c = 2 * n - l;
1045
- s = le(c, l, e + 1 / 3), u = le(c, l, e), a = le(c, l, e - 1 / 3);
1047
+ const c = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - c;
1048
+ s = ae(l, c, e + 1 / 3), u = ae(l, c, e), a = ae(l, c, e - 1 / 3);
1046
1049
  }
1047
1050
  return [Math.round(s * 255), Math.round(u * 255), Math.round(a * 255), o];
1048
- }, le = (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), An = (t) => {
1051
+ }, ae = (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), Ln = (t) => {
1049
1052
  let [e, r, n] = t;
1050
1053
  const o = t[3];
1051
1054
  e /= 255, r /= 255, n /= 255, e /= 255, r /= 255, n /= 255;
1052
1055
  const s = Math.max(e, r, n), u = Math.min(e, r, n);
1053
- let a, l, c = (s + u) / 2;
1056
+ let a, c, l = (s + u) / 2;
1054
1057
  if (s === u)
1055
- a = l = 0;
1058
+ a = c = 0;
1056
1059
  else {
1057
1060
  const h = s - u;
1058
- l = c > 0.5 ? h / (2 - s - u) : h / (s + u), s === e ? a = (r - n) / h + (r < n ? 6 : 0) : s === r ? a = (n - e) / h + 2 : a = (e - r) / h + 4, a /= 6;
1061
+ c = l > 0.5 ? h / (2 - s - u) : h / (s + u), s === e ? a = (r - n) / h + (r < n ? 6 : 0) : s === r ? a = (n - e) / h + 2 : a = (e - r) / h + 4, a /= 6;
1059
1062
  }
1060
- return a *= 360, l *= 100, c *= 100, [Math.round(a), Math.round(l), Math.round(c), o];
1061
- }, Rn = i.union([
1062
- ve,
1063
- Pe,
1064
- i.instanceof(d),
1063
+ return a *= 360, c *= 100, l *= 100, [Math.round(a), Math.round(c), Math.round(l), o];
1064
+ }, _n = i.union([
1065
+ we,
1066
+ _e,
1067
+ i.instanceof(g),
1065
1068
  i.string(),
1066
- xt,
1067
- mt
1068
- ]), Ln = i.object({
1069
+ bt,
1070
+ xt
1071
+ ]), Pn = i.object({
1069
1072
  key: i.string(),
1070
- color: Rn,
1073
+ color: _n,
1071
1074
  position: i.number(),
1072
1075
  switched: i.boolean().optional()
1073
- }), eo = i.array(Ln), to = (t, e) => {
1074
- if (t.length === 0) return wt;
1075
- if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return new d(t[0].color);
1076
+ }), ro = i.array(Pn), no = (t, e) => {
1077
+ if (t.length === 0) return mt;
1078
+ if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return new g(t[0].color);
1076
1079
  if (e >= t[t.length - 1].position)
1077
- return new d(t[t.length - 1].color);
1080
+ return new g(t[t.length - 1].color);
1078
1081
  for (let r = 0; r < t.length - 1; r++) {
1079
1082
  const n = t[r], o = t[r + 1];
1080
1083
  if (e >= n.position && e <= o.position) {
1081
- if (e === n.position) return new d(n.color);
1082
- if (e === o.position) return new d(o.color);
1083
- const s = (e - n.position) / (o.position - n.position), u = new d(n.color), a = new d(o.color), l = Math.round(u.r + s * (a.r - u.r)), c = Math.round(u.g + s * (a.g - u.g)), h = Math.round(u.b + s * (a.b - u.b)), E = u.a + s * (a.a - u.a);
1084
- return new d([l, c, h, E]);
1084
+ if (e === n.position) return new g(n.color);
1085
+ if (e === o.position) return new g(o.color);
1086
+ const s = (e - n.position) / (o.position - n.position), u = new g(n.color), a = new g(o.color), c = Math.round(u.r + s * (a.r - u.r)), l = Math.round(u.g + s * (a.g - u.g)), h = Math.round(u.b + s * (a.b - u.b)), E = u.a + s * (a.a - u.a);
1087
+ return new g([c, l, h, E]);
1085
1088
  }
1086
1089
  }
1087
- return new d(t[t.length - 1].color);
1088
- }, _n = i.object({
1090
+ return new g(t[t.length - 1].color);
1091
+ }, Zn = i.object({
1089
1092
  key: i.string(),
1090
1093
  name: i.string(),
1091
- color: d.z
1092
- }), ro = i.object({
1094
+ color: g.z
1095
+ }), oo = i.object({
1093
1096
  key: i.string(),
1094
1097
  name: i.string(),
1095
- swatches: i.array(_n)
1098
+ swatches: i.array(Zn)
1096
1099
  });
1097
- class Pn {
1100
+ class Hn {
1098
1101
  constructor(e = "") {
1099
1102
  C(this, "rows", []);
1100
1103
  C(this, "columns", []);
@@ -1123,63 +1126,63 @@ class Pn {
1123
1126
  };
1124
1127
  }
1125
1128
  }
1126
- const Zn = (t, e) => Object.entries(e).forEach(
1129
+ const Yn = (t, e) => Object.entries(e).forEach(
1127
1130
  ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
1128
- ), Hn = (t, e) => Array.from(t.style).forEach((r) => {
1131
+ ), kn = (t, e) => Array.from(t.style).forEach((r) => {
1129
1132
  r.startsWith(e) && t.style.removeProperty(r);
1130
- }), Yn = (t) => {
1131
- const e = bt(t);
1132
- return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(ot.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(ur.construct(r)), e.size = (r) => typeof r == "string" && e.M(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}`) : 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.noWrap = (r) => r && e.M("no-wrap"), e.applyVars = Zn, e.removeVars = Hn, e.newGridBuilder = (r) => new Pn(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) => e.M(`shade-${r}`), e.shadeVar = (r) => {
1133
+ }), Fn = (t) => {
1134
+ const e = dt(t);
1135
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(nt.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(ir.construct(r)), e.size = (r) => typeof r == "string" && e.M(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}`) : 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.noWrap = (r) => r && e.M("no-wrap"), e.applyVars = Yn, e.removeVars = kn, e.newGridBuilder = (r) => new Hn(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) => e.M(`shade-${r}`), e.shadeVar = (r) => {
1133
1136
  if (r != null)
1134
1137
  return `var(--${t}-gray-l${r})`;
1135
1138
  }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e;
1136
- }, no = Yn("pluto");
1139
+ }, so = Fn("pluto");
1137
1140
  export {
1138
- $r as $,
1141
+ Or as $,
1139
1142
  j as A,
1140
- Ce as B,
1141
- no as C,
1142
- vr as D,
1143
- qn as E,
1143
+ ze as B,
1144
+ so as C,
1145
+ Mr as D,
1146
+ Gn as E,
1144
1147
  M as F,
1145
- Vn as G,
1146
- Xn as H,
1147
- nn as I,
1148
- rn as J,
1149
- ot as K,
1150
- Sn as L,
1151
- _t as M,
1152
- xr as P,
1153
- Wt as T,
1154
- er as U,
1155
- tr as V,
1156
- mn as Y,
1157
- wt as Z,
1158
- Un as _,
1159
- d as a,
1160
- Jn as b,
1161
- Rn as c,
1162
- Qn as d,
1163
- ur as e,
1164
- to as f,
1165
- eo as g,
1166
- pr as h,
1148
+ Un as G,
1149
+ qn as H,
1150
+ sn as I,
1151
+ on as J,
1152
+ nt as K,
1153
+ Nn as L,
1154
+ Lt as M,
1155
+ wr as P,
1156
+ Ft as T,
1157
+ Qt as U,
1158
+ er as V,
1159
+ $n as Y,
1160
+ mt as Z,
1161
+ Kn as _,
1162
+ g as a,
1163
+ eo as b,
1164
+ _n as c,
1165
+ to as d,
1166
+ ir as e,
1167
+ no as f,
1168
+ ro as g,
1169
+ ar as h,
1167
1170
  p as i,
1168
1171
  S as j,
1169
1172
  lr as k,
1170
- Gn as l,
1171
- Wn as m,
1172
- bt as n,
1173
- Dn as o,
1174
- ro as p,
1175
- Se as q,
1173
+ Jn as l,
1174
+ Dn as m,
1175
+ dt as n,
1176
+ Vn as o,
1177
+ oo as p,
1178
+ Ie as q,
1176
1179
  I as r,
1177
- Ln as s,
1178
- Kn as t,
1180
+ Pn as s,
1181
+ Qn as t,
1179
1182
  y as u,
1180
1183
  W as v,
1181
- wr as w,
1182
- ze as x,
1183
- sn as y,
1184
+ vr as w,
1185
+ Ne as x,
1186
+ an as y,
1184
1187
  F as z
1185
1188
  };