@blockbite/ui 2.1.2 → 2.1.4

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.
package/dist/index.js CHANGED
@@ -97,13 +97,13 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
97
97
  }) => {
98
98
  const u = ke(
99
99
  (f) => {
100
- const h = i && e === f ? "" : f;
101
- l == null || l(h);
100
+ const p = i && e === f ? "" : f;
101
+ l == null || l(p);
102
102
  },
103
103
  [l, i, e]
104
- ), d = (f) => {
105
- const h = (f == null ? void 0 : f.icon) || null;
106
- return n === "icon" && (f != null && f.icon) ? /* @__PURE__ */ React.createElement(h, { className: "w-4 h-4" }) : n === "label" ? /* @__PURE__ */ React.createElement("span", null, f.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, f.icon && /* @__PURE__ */ React.createElement(h, { className: "w-3 h-3" }), /* @__PURE__ */ React.createElement("span", null, f.label));
104
+ ), m = (f) => {
105
+ const p = (f == null ? void 0 : f.icon) || null;
106
+ return n === "icon" && (f != null && f.icon) ? /* @__PURE__ */ React.createElement(p, { className: "w-4 h-4" }) : n === "label" ? /* @__PURE__ */ React.createElement("span", null, f.label) : /* @__PURE__ */ React.createElement("span", { className: "flex items-center justify-center gap-1" }, f.icon && /* @__PURE__ */ React.createElement(p, { className: "w-3 h-3" }), /* @__PURE__ */ React.createElement("span", null, f.label));
107
107
  };
108
108
  return /* @__PURE__ */ React.createElement(
109
109
  "div",
@@ -114,10 +114,10 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
114
114
  o ? "blockbite-ui__button-group--tabs" : ""
115
115
  )
116
116
  },
117
- r.map((f, h) => /* @__PURE__ */ React.createElement(
117
+ r.map((f, p) => /* @__PURE__ */ React.createElement(
118
118
  Y,
119
119
  {
120
- key: `ButtonToggleGroup__${f.value}__${f.label}__${h}`,
120
+ key: `ButtonToggleGroup__${f.value}__${f.label}__${p}`,
121
121
  className: B("blockbite-ui__button--default", {
122
122
  grow: s,
123
123
  "justify-center": s
@@ -131,7 +131,7 @@ const B = /* @__PURE__ */ Ri(Ni), Ci = Ye(
131
131
  isPressed: e === f.value,
132
132
  onClick: () => u(f.value)
133
133
  },
134
- d(f),
134
+ m(f),
135
135
  f.children && f.children
136
136
  ))
137
137
  );
@@ -172,7 +172,7 @@ function Kn({
172
172
  "div",
173
173
  {
174
174
  style: {
175
- backgroundColor: (u = e.find((d) => d.value === t)) == null ? void 0 : u.style
175
+ backgroundColor: (u = e.find((m) => m.value === t)) == null ? void 0 : u.style
176
176
  },
177
177
  className: "h-3 w-3 rounded-full"
178
178
  }
@@ -257,18 +257,18 @@ const Ht = ({
257
257
  if (c) {
258
258
  a(c.body);
259
259
  const s = c.createElement("style");
260
- s.innerHTML = e, c.head.appendChild(s), i.forEach(({ type: l, id: u, url: d }) => {
260
+ s.innerHTML = e, c.head.appendChild(s), i.forEach(({ type: l, id: u, url: m }) => {
261
261
  const f = document.getElementById(u);
262
262
  if (f) {
263
- const h = document.adoptNode(
263
+ const p = document.adoptNode(
264
264
  f.cloneNode(!0)
265
265
  );
266
- c.head.appendChild(h);
266
+ c.head.appendChild(p);
267
267
  } else {
268
- const h = c.createElement(
268
+ const p = c.createElement(
269
269
  l === "script" ? "script" : "link"
270
270
  );
271
- h.id = u, l === "script" ? (h.src = d, h.async = !0) : (h.rel = "stylesheet", h.href = d), c.head.appendChild(h);
271
+ p.id = u, l === "script" ? (p.src = m, p.async = !0) : (p.rel = "stylesheet", p.href = m), c.head.appendChild(p);
272
272
  }
273
273
  });
274
274
  }
@@ -600,9 +600,9 @@ const Ht = ({
600
600
  onBlur: s,
601
601
  type: l = "text",
602
602
  label: u,
603
- helper: d = "",
603
+ helper: m = "",
604
604
  ...f
605
- }, h) => {
605
+ }, p) => {
606
606
  const v = `text-control-${Math.random().toString(36).substring(2, 15)}`;
607
607
  return /* @__PURE__ */ React.createElement(
608
608
  "div",
@@ -623,16 +623,16 @@ const Ht = ({
623
623
  value: n,
624
624
  placeholder: c,
625
625
  onFocus: () => t && t(),
626
- onBlur: (b) => {
627
- t && t(), s && s(b.target.value);
626
+ onBlur: (x) => {
627
+ t && t(), s && s(x.target.value);
628
628
  },
629
- onChange: (b) => e && e(b.target.value),
629
+ onChange: (x) => e && e(x.target.value),
630
630
  readOnly: o,
631
- ref: h
631
+ ref: p
632
632
  }
633
633
  ),
634
634
  r,
635
- d && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, d)
635
+ m && /* @__PURE__ */ React.createElement("p", { className: "text-primary !m-0 !mb-0 text-xs" }, m)
636
636
  );
637
637
  }
638
638
  );
@@ -645,92 +645,95 @@ const Gn = ({
645
645
  onDelete: r,
646
646
  onUpdate: a,
647
647
  onSwitch: o,
648
- renderItemActions: c,
649
- renderItemContent: s,
650
- addons: l,
651
- className: u = "",
652
- footerSlot: d,
653
- footerSlotClassName: f = "",
654
- badge: h = ""
648
+ allowCreate: c = !0,
649
+ allowDelete: s = !0,
650
+ allowRename: l = !0,
651
+ renderItemActions: u,
652
+ renderItemContent: m,
653
+ addons: f,
654
+ className: p = "",
655
+ footerSlot: v,
656
+ footerSlotClassName: x = "",
657
+ badge: b = ""
655
658
  }) => {
656
- const [v, b] = A({
659
+ const [g, z] = A({
657
660
  id: "",
658
661
  title: ""
659
- }), [y, w] = A(!1), N = U(null), C = () => {
660
- n();
661
- }, x = () => {
662
- if (!e || t.length === 0) return;
663
- const m = t.filter((T) => T.id !== (e == null ? void 0 : e.id)), E = t.findIndex((T) => T.id === (e == null ? void 0 : e.id)), k = m[E] || m[0];
664
- r(e.id), i(k);
665
- }, L = (m) => {
666
- w(!0), v.id && a(v.id, { title: m }), setTimeout(() => {
667
- b({ id: "", title: "" }), w(!1);
668
- }, 500);
669
- }, I = (m) => !h || !m[h] ? null : /* @__PURE__ */ React.createElement(Ht, { className: "ml-2 max-w-[80px] text-sm" }, m[h]);
662
+ }), [I, y] = A(!1), L = U(null), k = () => {
663
+ c && n();
664
+ }, d = () => {
665
+ if (!s || !e || t.length === 0) return;
666
+ const R = t.filter((_) => _.id !== (e == null ? void 0 : e.id)), O = t.findIndex((_) => _.id === (e == null ? void 0 : e.id)), M = R[O] || R[0];
667
+ r(e.id), i(M);
668
+ }, S = (R) => {
669
+ l && (y(!0), g.id && a(g.id, { title: R }), setTimeout(() => {
670
+ z({ id: "", title: "" }), y(!1);
671
+ }, 500));
672
+ }, T = (R) => !b || !R[b] ? null : /* @__PURE__ */ React.createElement(Ht, { className: "ml-2 max-w-[80px] text-sm" }, R[b]);
670
673
  return /* @__PURE__ */ React.createElement(
671
674
  "div",
672
675
  {
673
- className: B("flex flex-col justify-between h-full", u)
676
+ className: B("flex flex-col justify-between h-full", p)
674
677
  },
675
- /* @__PURE__ */ React.createElement("ul", { className: "divide-y overflow-auto" }, l, t.length > 0 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-border border-b border-border" }, t.map((m) => /* @__PURE__ */ React.createElement(
678
+ /* @__PURE__ */ React.createElement("ul", { className: "divide-y overflow-auto" }, f, t.length > 0 && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement("ul", { className: "divide-y divide-border border-b border-border" }, t.map((R) => /* @__PURE__ */ React.createElement(
676
679
  "li",
677
680
  {
678
- key: `data__${m.id}`,
681
+ key: `data__${R.id}`,
679
682
  className: B(
680
683
  "relative !mb-0 flex flex-col hover:bg-wp/10",
681
684
  {
682
- "bg-[#1e40af]/20": m.id === (e == null ? void 0 : e.id)
685
+ "bg-[#1e40af]/20": R.id === (e == null ? void 0 : e.id)
683
686
  }
684
687
  )
685
688
  },
686
689
  /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between gap-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 relative" }, /* @__PURE__ */ React.createElement(
687
690
  "button",
688
691
  {
689
- className: "text-gray-medium w-full truncate px-3 py-2 text-left text-sm/6 font-semibold hover:text-wordpress",
692
+ className: "text-gray-medium w-full truncate py-1 pl-2 text-left text-[11px]! font-semibold hover:text-wordpress",
690
693
  onClick: () => {
691
- o(e == null ? void 0 : e.id, { ...e }), i(m);
694
+ o(e == null ? void 0 : e.id, { ...e }), i(R);
692
695
  },
693
696
  onDoubleClick: () => {
694
- b({ id: m.id, title: m.title || "" });
697
+ l && z({ id: R.id, title: R.title || "" });
695
698
  }
696
699
  },
697
- y && v.id === m.id ? /* @__PURE__ */ React.createElement("span", { className: "animate-pulse text-gray-medium" }, v.title, " ", I(m)) : /* @__PURE__ */ React.createElement("span", { className: "text-gray-medium" }, m.title || "Untitled", " ", I(m))
698
- ), v.id === m.id && !y && /* @__PURE__ */ React.createElement(
700
+ I && g.id === R.id ? /* @__PURE__ */ React.createElement("span", { className: "animate-pulse text-gray-medium" }, g.title, " ", T(R)) : /* @__PURE__ */ React.createElement("span", { className: "text-gray-medium" }, R.title || "Untitled", " ", T(R))
701
+ ), g.id === R.id && !I && /* @__PURE__ */ React.createElement(
699
702
  jt,
700
703
  {
701
704
  className: "absolute left-1 top-0 w-[calc(100%-.5rem)] h-full",
702
705
  inputClassName: "w-full",
703
- defaultValue: v.title,
704
- onChange: (E) => b({ ...v, title: E }),
705
- ref: N,
706
- onBlur: () => L(v.title)
706
+ defaultValue: g.title,
707
+ onChange: (O) => z({ ...g, title: O }),
708
+ ref: L,
709
+ onBlur: () => S(g.title)
707
710
  }
708
- )), c && /* @__PURE__ */ React.createElement("div", { className: "flex gap-1 pr-1" }, c(m))),
709
- s && s(m, m.id === (e == null ? void 0 : e.id))
711
+ )), u && /* @__PURE__ */ React.createElement("div", { className: "flex gap-1 pr-1" }, u(R))),
712
+ m && m(R, R.id === (e == null ? void 0 : e.id))
710
713
  ))))),
711
- /* @__PURE__ */ React.createElement(
714
+ (v || c || s) && /* @__PURE__ */ React.createElement(
712
715
  "div",
713
716
  {
714
717
  className: B(
715
718
  "flex flex-wrap justify-center gap-2 p-2",
716
- f
719
+ x
717
720
  )
718
721
  },
719
- d,
720
- /* @__PURE__ */ React.createElement(
722
+ v,
723
+ c && /* @__PURE__ */ React.createElement(
721
724
  Y,
722
725
  {
723
- onClick: C,
726
+ onClick: k,
724
727
  icon: /* @__PURE__ */ React.createElement($i, { className: "h-4 w-4" }),
725
728
  variant: "tertiary",
726
729
  size: "compact"
727
730
  },
728
731
  "Add"
729
732
  ),
730
- /* @__PURE__ */ React.createElement(
733
+ s && /* @__PURE__ */ React.createElement(
731
734
  Y,
732
735
  {
733
- onClick: x,
736
+ onClick: d,
734
737
  icon: /* @__PURE__ */ React.createElement(Bi, { className: "h-4 w-4" }),
735
738
  variant: "tertiary",
736
739
  size: "compact",
@@ -790,13 +793,13 @@ Received: { icon: <ColumnsIcon /> }`
790
793
  l(i);
791
794
  }, [i]);
792
795
  const u = [
793
- ...o.map((h) => ({
794
- icon: h.icon,
795
- label: h.label,
796
- title: h.label,
797
- value: h.value,
796
+ ...o.map((p) => ({
797
+ icon: p.icon,
798
+ label: p.label,
799
+ title: p.label,
800
+ value: p.value,
798
801
  onClick: () => {
799
- l(h.value), a(h.value);
802
+ l(p.value), a(p.value);
800
803
  }
801
804
  })),
802
805
  {
@@ -808,13 +811,13 @@ Received: { icon: <ColumnsIcon /> }`
808
811
  }
809
812
  }
810
813
  ];
811
- let d = "1em";
812
- return r === "medium" ? d = "1.5em" : r === "large" && (d = "2em"), /* @__PURE__ */ React.createElement(
814
+ let m = "1em";
815
+ return r === "medium" ? m = "1.5em" : r === "large" && (m = "2em"), /* @__PURE__ */ React.createElement(
813
816
  ri,
814
817
  {
815
818
  controls: u,
816
819
  className: B("blockbite-ui__dropdown-picker", e),
817
- icon: ((f = o.find((h) => h.value === s)) == null ? void 0 : f.icon) || /* @__PURE__ */ React.createElement(He, { width: d, height: d, icon: n }),
820
+ icon: ((f = o.find((p) => p.value === s)) == null ? void 0 : f.icon) || /* @__PURE__ */ React.createElement(He, { width: m, height: m, icon: n }),
818
821
  label: t || "Select",
819
822
  ...c
820
823
  }
@@ -847,10 +850,10 @@ function nr({
847
850
  }) {
848
851
  const e = U(null), [i, n] = A({ x: 100, y: 100 }), [r, a] = A(!1), [o, c] = A({ x: 0, y: 0 });
849
852
  j(() => {
850
- const l = (d) => {
853
+ const l = (m) => {
851
854
  r && n({
852
- x: d.clientX - o.x,
853
- y: d.clientY - o.y
855
+ x: m.clientX - o.x,
856
+ y: m.clientY - o.y
854
857
  });
855
858
  }, u = () => a(!1);
856
859
  return window.addEventListener("mousemove", l), window.addEventListener("mouseup", u), () => {
@@ -1041,40 +1044,40 @@ function he(t) {
1041
1044
  return Number.isFinite(i) ? Math.min(100, Math.max(0, i)) : void 0;
1042
1045
  }
1043
1046
  function ar(t, e) {
1044
- var f, h, v, b;
1047
+ var f, p, v, x;
1045
1048
  if (!t) return null;
1046
- const i = t["gradient-direction"], n = i === Ke ? "radial" : "linear", r = n === "radial" ? "to-r" : i && je[i] || "to-r", a = [], o = (f = t["gradient-from"]) == null ? void 0 : f[0], c = (h = t["gradient-from-pos"]) == null ? void 0 : h[0];
1049
+ const i = t["gradient-direction"], n = i === Ke ? "radial" : "linear", r = n === "radial" ? "to-r" : i && je[i] || "to-r", a = [], o = (f = t["gradient-from"]) == null ? void 0 : f[0], c = (p = t["gradient-from-pos"]) == null ? void 0 : p[0];
1047
1050
  if (o != null && o.from) {
1048
- const y = String(o.from), { opacityFromToken: w } = fe(e, y);
1051
+ const b = String(o.from), { opacityFromToken: g } = fe(e, b);
1049
1052
  a.push({
1050
1053
  id: "from",
1051
1054
  role: "from",
1052
- colorToken: y,
1055
+ colorToken: b,
1053
1056
  position: he(c == null ? void 0 : c.from) ?? 0,
1054
- opacity: w ?? 100
1057
+ opacity: g ?? 100
1055
1058
  });
1056
1059
  }
1057
1060
  const s = t["gradient-via"] || [], l = t["gradient-via-pos"] || [];
1058
- s.forEach((y, w) => {
1061
+ s.forEach((b, g) => {
1059
1062
  var L;
1060
- const N = String(y.via), { opacityFromToken: C } = fe(e, N), x = (L = l[w]) == null ? void 0 : L.via;
1063
+ const z = String(b.via), { opacityFromToken: I } = fe(e, z), y = (L = l[g]) == null ? void 0 : L.via;
1061
1064
  a.push({
1062
- id: `via-${w}`,
1065
+ id: `via-${g}`,
1063
1066
  role: "via",
1064
- colorToken: N,
1065
- position: he(x) ?? 50,
1066
- opacity: C ?? 100
1067
+ colorToken: z,
1068
+ position: he(y) ?? 50,
1069
+ opacity: I ?? 100
1067
1070
  });
1068
1071
  });
1069
- const u = (v = t["gradient-to"]) == null ? void 0 : v[0], d = (b = t["gradient-to-pos"]) == null ? void 0 : b[0];
1072
+ const u = (v = t["gradient-to"]) == null ? void 0 : v[0], m = (x = t["gradient-to-pos"]) == null ? void 0 : x[0];
1070
1073
  if (u != null && u.to) {
1071
- const y = String(u.to), { opacityFromToken: w } = fe(e, y);
1074
+ const b = String(u.to), { opacityFromToken: g } = fe(e, b);
1072
1075
  a.push({
1073
1076
  id: "to",
1074
1077
  role: "to",
1075
- colorToken: y,
1076
- position: he(d == null ? void 0 : d.to) ?? 100,
1077
- opacity: w ?? 100
1078
+ colorToken: b,
1079
+ position: he(m == null ? void 0 : m.to) ?? 100,
1080
+ opacity: g ?? 100
1078
1081
  });
1079
1082
  }
1080
1083
  return a.length ? { kind: n, direction: r, stops: ve(a) } : null;
@@ -1187,12 +1190,12 @@ function ur(t) {
1187
1190
  return Xi(Yi(t));
1188
1191
  }
1189
1192
  const mr = (t) => {
1190
- var h, v, b, y, w, N, C, x, L;
1191
- const e = Array.isArray(t) ? t.filter((I) => String((I == null ? void 0 : I.value) ?? "").trim() !== "") : [];
1193
+ var p, v, x, b, g, z, I, y, L;
1194
+ const e = Array.isArray(t) ? t.filter((k) => String((k == null ? void 0 : k.value) ?? "").trim() !== "") : [];
1192
1195
  if (e.length === 0)
1193
1196
  return null;
1194
1197
  const n = (Array.isArray(t) ? t : []).some(
1195
- (I) => [
1198
+ (k) => [
1196
1199
  "gradient-direction",
1197
1200
  "gradient-from",
1198
1201
  "gradient-from-pos",
@@ -1200,11 +1203,11 @@ const mr = (t) => {
1200
1203
  "gradient-via-pos",
1201
1204
  "gradient-to",
1202
1205
  "gradient-to-pos"
1203
- ].includes(I == null ? void 0 : I.id)
1204
- ), r = (I) => e.filter((m) => m.id === I);
1205
- if (n && !!!((h = r("gradient-from")[0]) != null && h.value || (v = r("gradient-to")[0]) != null && v.value || (b = r("gradient-direction")[0]) != null && b.value || r("gradient-via").length && r("gradient-via").some((m) => !!m.value) || (y = r("gradient-from-pos")[0]) != null && y.value || (w = r("gradient-to-pos")[0]) != null && w.value || r("gradient-via-pos").length && r("gradient-via-pos").some((m) => !!m.value)))
1206
+ ].includes(k == null ? void 0 : k.id)
1207
+ ), r = (k) => e.filter((d) => d.id === k);
1208
+ if (n && !!!((p = r("gradient-from")[0]) != null && p.value || (v = r("gradient-to")[0]) != null && v.value || (x = r("gradient-direction")[0]) != null && x.value || r("gradient-via").length && r("gradient-via").some((d) => !!d.value) || (b = r("gradient-from-pos")[0]) != null && b.value || (g = r("gradient-to-pos")[0]) != null && g.value || r("gradient-via-pos").length && r("gradient-via-pos").some((d) => !!d.value)))
1206
1209
  return null;
1207
- const a = [], o = (N = r("gradient-from")[0]) == null ? void 0 : N.value, c = he((C = r("gradient-from-pos")[0]) == null ? void 0 : C.value);
1210
+ const a = [], o = (z = r("gradient-from")[0]) == null ? void 0 : z.value, c = he((I = r("gradient-from-pos")[0]) == null ? void 0 : I.value);
1208
1211
  o && a.push({
1209
1212
  id: "from",
1210
1213
  role: "from",
@@ -1213,38 +1216,38 @@ const mr = (t) => {
1213
1216
  opacity: 100
1214
1217
  });
1215
1218
  const s = r("gradient-via"), l = r("gradient-via-pos");
1216
- s.forEach((I, m) => {
1217
- var T;
1218
- const E = I.value;
1219
- if (!E) return;
1220
- const k = he((T = l[m]) == null ? void 0 : T.value);
1219
+ s.forEach((k, d) => {
1220
+ var R;
1221
+ const S = k.value;
1222
+ if (!S) return;
1223
+ const T = he((R = l[d]) == null ? void 0 : R.value);
1221
1224
  a.push({
1222
- id: `via-${m}`,
1225
+ id: `via-${d}`,
1223
1226
  role: "via",
1224
- colorToken: E,
1225
- position: k ?? 50,
1227
+ colorToken: S,
1228
+ position: T ?? 50,
1226
1229
  opacity: 100
1227
1230
  });
1228
1231
  });
1229
- const u = (x = r("gradient-to")[0]) == null ? void 0 : x.value, d = he((L = r("gradient-to-pos")[0]) == null ? void 0 : L.value);
1232
+ const u = (y = r("gradient-to")[0]) == null ? void 0 : y.value, m = he((L = r("gradient-to-pos")[0]) == null ? void 0 : L.value);
1230
1233
  if (u && a.push({
1231
1234
  id: "to",
1232
1235
  role: "to",
1233
1236
  colorToken: u,
1234
- position: d ?? 100,
1237
+ position: m ?? 100,
1235
1238
  opacity: 100
1236
1239
  }), a.length) {
1237
- const I = r("gradient-direction")[0], m = I == null ? void 0 : I.value, E = m === Ke ? "radial" : "linear", k = E === "radial" ? "to-r" : m && je[m] ? je[m] : "to-r";
1238
- return { kind: E, direction: k, stops: ve(a) };
1239
- }
1240
- const f = e.map((I, m) => {
1241
- const E = (I == null ? void 0 : I.selector) ?? "";
1242
- let k = "via";
1243
- return E.startsWith("from-") || m === 0 ? k = "from" : (E.startsWith("to-") || m === e.length - 1) && (k = "to"), {
1244
- id: I.id ?? (k === "via" ? `via-${m}` : k),
1245
- role: k,
1246
- colorToken: I.value,
1247
- position: m === 0 ? 0 : m === e.length - 1 ? 100 : 50,
1240
+ const k = r("gradient-direction")[0], d = k == null ? void 0 : k.value, S = d === Ke ? "radial" : "linear", T = S === "radial" ? "to-r" : d && je[d] ? je[d] : "to-r";
1241
+ return { kind: S, direction: T, stops: ve(a) };
1242
+ }
1243
+ const f = e.map((k, d) => {
1244
+ const S = (k == null ? void 0 : k.selector) ?? "";
1245
+ let T = "via";
1246
+ return S.startsWith("from-") || d === 0 ? T = "from" : (S.startsWith("to-") || d === e.length - 1) && (T = "to"), {
1247
+ id: k.id ?? (T === "via" ? `via-${d}` : T),
1248
+ role: T,
1249
+ colorToken: k.value,
1250
+ position: d === 0 ? 0 : d === e.length - 1 ? 100 : 50,
1248
1251
  opacity: 100
1249
1252
  };
1250
1253
  });
@@ -1266,23 +1269,23 @@ const dr = ({
1266
1269
  value: e,
1267
1270
  onChange: i
1268
1271
  }) => {
1269
- const n = U(null), [r, a] = A(null), [o, c] = A(!1), [s, l] = A(null), [u, d] = A(null), f = u ? e.stops.map(
1270
- (m) => m.id === u.stopId ? { ...m, position: u.position } : m
1271
- ) : e.stops, h = e.stops.find((m) => m.id === r), v = (m) => {
1272
- const E = ve(m(e.stops));
1273
- i({ ...e, stops: E });
1274
- }, b = (m, E) => {
1272
+ const n = U(null), [r, a] = A(null), [o, c] = A(!1), [s, l] = A(null), [u, m] = A(null), f = u ? e.stops.map(
1273
+ (d) => d.id === u.stopId ? { ...d, position: u.position } : d
1274
+ ) : e.stops, p = e.stops.find((d) => d.id === r), v = (d) => {
1275
+ const S = ve(d(e.stops));
1276
+ i({ ...e, stops: S });
1277
+ }, x = (d, S) => {
1275
1278
  v(
1276
- (k) => k.map((T) => T.id === m ? { ...T, ...E } : T)
1279
+ (T) => T.map((R) => R.id === d ? { ...R, ...S } : R)
1277
1280
  );
1278
- }, y = (m) => {
1279
- e.stops.length <= 2 || v((E) => E.filter((k) => k.id !== m));
1280
- }, w = (m) => {
1281
+ }, b = (d) => {
1282
+ e.stops.length <= 2 || v((S) => S.filter((T) => T.id !== d));
1283
+ }, g = (d) => {
1281
1284
  var V;
1282
- if (((V = m.target.dataset) == null ? void 0 : V.stopHandle) === "true") return;
1283
- const k = n.current;
1284
- if (!k) return;
1285
- const T = k.getBoundingClientRect(), H = (m.clientX - T.left) / T.width * 100, M = se(H, 0, 100), _ = e.stops.reduce(
1285
+ if (((V = d.target.dataset) == null ? void 0 : V.stopHandle) === "true") return;
1286
+ const T = n.current;
1287
+ if (!T) return;
1288
+ const R = T.getBoundingClientRect(), O = (d.clientX - R.left) / R.width * 100, M = se(O, 0, 100), _ = e.stops.reduce(
1286
1289
  (P, $) => Math.abs($.position - M) < Math.abs(P.position - M) ? $ : P,
1287
1290
  e.stops[0]
1288
1291
  ) ?? e.stops[0], D = `via-${Date.now()}`;
@@ -1296,33 +1299,33 @@ const dr = ({
1296
1299
  opacity: _.opacity
1297
1300
  }
1298
1301
  ]), a(D);
1299
- }, N = (m, E) => {
1300
- if (m.stopPropagation(), m.preventDefault(), !n.current) return;
1301
- const k = n.current;
1302
- a(E.id);
1303
- const T = k.getBoundingClientRect(), H = (_) => {
1304
- const D = (_.clientX - T.left) / T.width * 100, V = se(D, 0, 100);
1305
- d({ stopId: E.id, position: V });
1302
+ }, z = (d, S) => {
1303
+ if (d.stopPropagation(), d.preventDefault(), !n.current) return;
1304
+ const T = n.current;
1305
+ a(S.id);
1306
+ const R = T.getBoundingClientRect(), O = (_) => {
1307
+ const D = (_.clientX - R.left) / R.width * 100, V = se(D, 0, 100);
1308
+ m({ stopId: S.id, position: V });
1306
1309
  }, M = (_) => {
1307
- window.removeEventListener("mousemove", H), window.removeEventListener("mouseup", M);
1308
- const D = (_.clientX - T.left) / T.width * 100, V = se(D, 0, 100);
1309
- d(null), b(E.id, { position: V });
1310
+ window.removeEventListener("mousemove", O), window.removeEventListener("mouseup", M);
1311
+ const D = (_.clientX - R.left) / R.width * 100, V = se(D, 0, 100);
1312
+ m(null), x(S.id, { position: V });
1310
1313
  };
1311
- window.addEventListener("mousemove", H), window.addEventListener("mouseup", M);
1312
- }, C = (m, E) => {
1313
- a(m.id), l(E), c(!0);
1314
- }, x = (m) => {
1315
- i({ ...e, kind: m });
1316
- }, L = (m) => {
1317
- i({ ...e, direction: m });
1318
- }, I = ke(
1319
- (m) => {
1320
- if (!h) return;
1321
- const k = `[${typeof m == "string" ? m : (m == null ? void 0 : m.hex) ?? "#000000"}]`;
1322
- b(h.id, { colorToken: k });
1314
+ window.addEventListener("mousemove", O), window.addEventListener("mouseup", M);
1315
+ }, I = (d, S) => {
1316
+ a(d.id), l(S), c(!0);
1317
+ }, y = (d) => {
1318
+ i({ ...e, kind: d });
1319
+ }, L = (d) => {
1320
+ i({ ...e, direction: d });
1321
+ }, k = ke(
1322
+ (d) => {
1323
+ if (!p) return;
1324
+ const T = `[${typeof d == "string" ? d : (d == null ? void 0 : d.hex) ?? "#000000"}]`;
1325
+ x(p.id, { colorToken: T });
1323
1326
  },
1324
1327
  // eslint-disable-next-line react-hooks/exhaustive-deps
1325
- [h]
1328
+ [p]
1326
1329
  );
1327
1330
  return /* @__PURE__ */ React.createElement("div", { className: "bb-gradient-picker space-y-3 text-xs" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement(
1328
1331
  Fi,
@@ -1333,7 +1336,7 @@ const dr = ({
1333
1336
  { label: "Radial", value: "radial" }
1334
1337
  ],
1335
1338
  value: e.kind,
1336
- onChange: (m) => x(m)
1339
+ onChange: (d) => y(d)
1337
1340
  }
1338
1341
  )), e.kind === "linear" && /* @__PURE__ */ React.createElement(
1339
1342
  ye,
@@ -1349,7 +1352,7 @@ const dr = ({
1349
1352
  { value: "to-br", label: "to-br" }
1350
1353
  ],
1351
1354
  value: e.direction,
1352
- onPressedChange: (m) => L(m)
1355
+ onPressedChange: (d) => L(d)
1353
1356
  }
1354
1357
  ), /* @__PURE__ */ React.createElement(
1355
1358
  "div",
@@ -1362,42 +1365,42 @@ const dr = ({
1362
1365
  t
1363
1366
  )
1364
1367
  },
1365
- onMouseDown: w
1368
+ onMouseDown: g
1366
1369
  },
1367
- f.map((m) => /* @__PURE__ */ React.createElement(
1370
+ f.map((d) => /* @__PURE__ */ React.createElement(
1368
1371
  "div",
1369
1372
  {
1370
- key: m.id,
1373
+ key: d.id,
1371
1374
  "data-stop-handle": "true",
1372
1375
  className: "absolute top-1/2 h-4 w-4 rounded-full -translate-y-1/2 -translate-x-1/2 cursor-pointer ring-2 ring-border",
1373
1376
  style: {
1374
- left: `${m.position}%`,
1375
- backgroundColor: m.colorToken.startsWith("[") ? m.colorToken.slice(1, -1) : void 0
1377
+ left: `${d.position}%`,
1378
+ backgroundColor: d.colorToken.startsWith("[") ? d.colorToken.slice(1, -1) : void 0
1376
1379
  },
1377
- onMouseDown: (E) => N(E, m),
1378
- onClick: (E) => {
1379
- E.stopPropagation(), a(m.id);
1380
+ onMouseDown: (S) => z(S, d),
1381
+ onClick: (S) => {
1382
+ S.stopPropagation(), a(d.id);
1380
1383
  }
1381
1384
  }
1382
1385
  ))
1383
- ), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start justify-between text-[10px] font-semibold uppercase" }, /* @__PURE__ */ React.createElement("span", null, "Stops")), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, ve(f).map((m) => {
1384
- const { hex: E, baseToken: k } = fe(t, m.colorToken);
1386
+ ), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start justify-between text-[10px] font-semibold uppercase" }, /* @__PURE__ */ React.createElement("span", null, "Stops")), /* @__PURE__ */ React.createElement("div", { className: "space-y-1" }, ve(f).map((d) => {
1387
+ const { hex: S, baseToken: T } = fe(t, d.colorToken);
1385
1388
  return /* @__PURE__ */ React.createElement(
1386
1389
  "div",
1387
1390
  {
1388
- key: m.id,
1389
- className: `flex gap-2 items-start ${r === m.id ? "bg-wp/10" : "bg-transparent"}`,
1390
- onClick: () => a(m.id)
1391
+ key: d.id,
1392
+ className: `flex gap-2 items-start ${r === d.id ? "bg-wp/10" : "bg-transparent"}`,
1393
+ onClick: () => a(d.id)
1391
1394
  },
1392
1395
  /* @__PURE__ */ React.createElement(
1393
1396
  Ee,
1394
1397
  {
1395
1398
  className: "w-16 h-6",
1396
1399
  __nextHasNoMarginBottom: !0,
1397
- value: String(Math.round(m.position)),
1398
- onChange: (T) => {
1399
- const H = se(parseFloat(T) || 0, 0, 100);
1400
- b(m.id, { position: H });
1400
+ value: String(Math.round(d.position)),
1401
+ onChange: (R) => {
1402
+ const O = se(parseFloat(R) || 0, 0, 100);
1403
+ x(d.id, { position: O });
1401
1404
  },
1402
1405
  type: "text",
1403
1406
  suffix: "%"
@@ -1408,26 +1411,26 @@ const dr = ({
1408
1411
  {
1409
1412
  type: "button",
1410
1413
  className: "flex w-16 h-[32px] items-center gap border border-border",
1411
- onClick: (T) => C(m, T.currentTarget)
1414
+ onClick: (R) => I(d, R.currentTarget)
1412
1415
  },
1413
1416
  /* @__PURE__ */ React.createElement(
1414
1417
  tt,
1415
1418
  {
1416
- colorValue: E ?? "#000000",
1419
+ colorValue: S ?? "#000000",
1417
1420
  className: "!h-4 !w-4"
1418
1421
  }
1419
1422
  ),
1420
- /* @__PURE__ */ React.createElement("span", { className: "truncate text-[11px]" }, k)
1423
+ /* @__PURE__ */ React.createElement("span", { className: "truncate text-[11px]" }, T)
1421
1424
  ),
1422
1425
  /* @__PURE__ */ React.createElement(
1423
1426
  Ee,
1424
1427
  {
1425
1428
  __nextHasNoMarginBottom: !0,
1426
1429
  className: "w-12",
1427
- value: String(Math.round(m.opacity)),
1428
- onChange: (T) => {
1429
- const H = se(parseFloat(T) || 0, 0, 100);
1430
- b(m.id, { opacity: H });
1430
+ value: String(Math.round(d.opacity)),
1431
+ onChange: (R) => {
1432
+ const O = se(parseFloat(R) || 0, 0, 100);
1433
+ x(d.id, { opacity: O });
1431
1434
  },
1432
1435
  type: "text",
1433
1436
  suffix: "%"
@@ -1438,7 +1441,7 @@ const dr = ({
1438
1441
  {
1439
1442
  type: "button",
1440
1443
  className: "flex h-6 w-6 items-center justify-center rounded border text-xs",
1441
- onClick: () => y(m.id),
1444
+ onClick: () => b(d.id),
1442
1445
  disabled: e.stops.length <= 1
1443
1446
  },
1444
1447
  "–"
@@ -1447,34 +1450,34 @@ const dr = ({
1447
1450
  }))), /* @__PURE__ */ React.createElement(
1448
1451
  Wt,
1449
1452
  {
1450
- visible: o && !!h,
1453
+ visible: o && !!p,
1451
1454
  anchor: s,
1452
1455
  onClose: () => c(!1),
1453
1456
  position: "bottom center",
1454
1457
  offset: 8
1455
1458
  },
1456
- h && /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement(xe, { title: "Theme tokens" }), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-1 max-w-[200px]" }, t.map((m) => /* @__PURE__ */ React.createElement(
1459
+ p && /* @__PURE__ */ React.createElement("div", { className: "space-y-3" }, /* @__PURE__ */ React.createElement(xe, { title: "Theme tokens" }), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-1 max-w-[200px]" }, t.map((d) => /* @__PURE__ */ React.createElement(
1457
1460
  "button",
1458
1461
  {
1459
- key: m.value,
1462
+ key: d.value,
1460
1463
  type: "button",
1461
1464
  className: "flex h-6 w-6 items-center justify-center rounded-full border",
1462
- onClick: () => b(h.id, {
1463
- colorToken: m.value
1465
+ onClick: () => x(p.id, {
1466
+ colorToken: d.value
1464
1467
  })
1465
1468
  },
1466
1469
  /* @__PURE__ */ React.createElement(
1467
1470
  tt,
1468
1471
  {
1469
- colorValue: m.color,
1472
+ colorValue: d.color,
1470
1473
  className: "!h-5 !w-5 !rounded-full"
1471
1474
  }
1472
1475
  )
1473
1476
  ))), /* @__PURE__ */ React.createElement(
1474
1477
  oi,
1475
1478
  {
1476
- color: fe(t, h.colorToken).hex ?? "#000000",
1477
- onChange: I
1479
+ color: fe(t, p.colorToken).hex ?? "#000000",
1480
+ onChange: k
1478
1481
  }
1479
1482
  ))
1480
1483
  ));
@@ -1566,7 +1569,7 @@ function pr({ mediaProps: t, mediaCallback: e, className: i }) {
1566
1569
  height: 0
1567
1570
  });
1568
1571
  }, o = (c) => {
1569
- var u, d;
1572
+ var u, m;
1570
1573
  const s = {
1571
1574
  thumbnail: null,
1572
1575
  medium: null,
@@ -1576,7 +1579,7 @@ function pr({ mediaProps: t, mediaCallback: e, className: i }) {
1576
1579
  f.width <= 768 && (s.thumbnail = f.url), f.width > 768 && f.width <= 1536 && (s.medium = f.url), f.width > 1536 && (s.large = f.url);
1577
1580
  });
1578
1581
  let l = c.type;
1579
- (u = c.url) != null && u.endsWith(".json") && (l = "lottie"), (d = c.url) != null && d.endsWith(".svg") && (l = "svg"), e({
1582
+ (u = c.url) != null && u.endsWith(".json") && (l = "lottie"), (m = c.url) != null && m.endsWith(".svg") && (l = "svg"), e({
1580
1583
  id: c.id,
1581
1584
  url: c.url,
1582
1585
  sizes: s,
@@ -1630,17 +1633,17 @@ const Ji = ({
1630
1633
  showTooltip: l = !1,
1631
1634
  ...u
1632
1635
  }) => {
1633
- const [f] = A(-999), [h, v] = A(0);
1636
+ const [f] = A(-999), [p, v] = A(0);
1634
1637
  j(() => {
1635
1638
  v(Math.round(parseInt(t) / (s ? 16 : 1)));
1636
1639
  }, [t]);
1637
- function b(y) {
1638
- if (y === -999) {
1640
+ function x(b) {
1641
+ if (b === -999) {
1639
1642
  o ? o() : a("");
1640
1643
  return;
1641
1644
  }
1642
- const w = y * (s ? 16 : 1);
1643
- a(w.toString());
1645
+ const g = b * (s ? 16 : 1);
1646
+ a(g.toString());
1644
1647
  }
1645
1648
  return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement(
1646
1649
  li,
@@ -1648,19 +1651,19 @@ const Ji = ({
1648
1651
  __next40pxDefaultSize: !0,
1649
1652
  __nextHasNoMarginBottom: !0,
1650
1653
  label: e,
1651
- value: h,
1654
+ value: p,
1652
1655
  min: i,
1653
1656
  max: n,
1654
1657
  showTooltip: l,
1655
1658
  withInputField: r,
1656
1659
  allowReset: c,
1657
- onChange: (y) => {
1658
- v(y), b(y);
1660
+ onChange: (b) => {
1661
+ v(b), x(b);
1659
1662
  },
1660
1663
  resetFallbackValue: f,
1661
1664
  ...u
1662
1665
  }
1663
- ), /* @__PURE__ */ React.createElement("span", null, s ? `${h * 16}px` : null, " "));
1666
+ ), /* @__PURE__ */ React.createElement("span", null, s ? `${p * 16}px` : null, " "));
1664
1667
  }, Le = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, nt = /^\((?:(\w[\w-]*):)?(.+)\)$/i, Zt = /^\d+\/\d+$/, qi = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Re = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Qi = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, Gi = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, en = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, rt = (t) => Zt.test(t), _e = (t) => !!t && !Number.isNaN(Number(t)), tn = (t) => !!t && t.endsWith("%") && _e(t.slice(0, -1)), nn = (t) => qi.test(t), rn = [
1665
1668
  { value: "px", label: "Pixels" },
1666
1669
  { value: "rem", label: "Root EM" },
@@ -1683,14 +1686,14 @@ const Ji = ({
1683
1686
  classGroupControl: n,
1684
1687
  tailwindUi: r = {}
1685
1688
  }) => {
1686
- var S, R;
1687
- const [a, o] = A(!1), [c, s] = A("arbitrary"), [l, u] = A(""), [d, f] = A(""), h = U(null), {
1689
+ var E, N;
1690
+ const [a, o] = A(!1), [c, s] = A("arbitrary"), [l, u] = A(""), [m, f] = A(""), p = U(null), {
1688
1691
  manualFraction: v,
1689
- manualOptions: b,
1690
- manualRange: y,
1691
- manualCssVars: w,
1692
- manualArbitrary: N,
1693
- placeholder: C
1692
+ manualOptions: x,
1693
+ manualRange: b,
1694
+ manualCssVars: g,
1695
+ manualArbitrary: z,
1696
+ placeholder: I
1694
1697
  } = (n == null ? void 0 : n.metadata) || {
1695
1698
  manualFraction: !0,
1696
1699
  manualOptions: !0,
@@ -1698,75 +1701,75 @@ const Ji = ({
1698
1701
  manualCssVars: !0,
1699
1702
  manualArbitrary: !0,
1700
1703
  placeholder: "0"
1701
- }, x = ((S = n == null ? void 0 : n.metadata) == null ? void 0 : S.rangeMin) ?? 0, L = ((R = n == null ? void 0 : n.metadata) == null ? void 0 : R.rangeMax) ?? 100;
1704
+ }, y = ((E = n == null ? void 0 : n.metadata) == null ? void 0 : E.rangeMin) ?? 0, L = ((N = n == null ? void 0 : n.metadata) == null ? void 0 : N.rangeMax) ?? 100;
1702
1705
  j(() => {
1703
- u(H(t)), f(t), s(_(t));
1706
+ u(O(t)), f(t), s(_(t));
1704
1707
  }, [t]);
1705
- const I = oe(
1708
+ const k = oe(
1706
1709
  () => (n == null ? void 0 : n.options) || [],
1707
1710
  [n == null ? void 0 : n.options]
1708
- ), m = oe(
1709
- () => T(n == null ? void 0 : n.validators, [
1711
+ ), d = oe(
1712
+ () => R(n == null ? void 0 : n.validators, [
1710
1713
  "isArbitraryVariable",
1711
1714
  "isArbitraryValue",
1712
1715
  "themeGetter"
1713
1716
  ]),
1714
1717
  [n == null ? void 0 : n.validators]
1715
- ), E = oe(
1716
- () => T(n == null ? void 0 : n.validators, ["isFraction"]),
1718
+ ), S = oe(
1719
+ () => R(n == null ? void 0 : n.validators, ["isFraction"]),
1717
1720
  [n == null ? void 0 : n.validators]
1718
- ), k = oe(
1719
- () => T(n == null ? void 0 : n.validators, ["themeGetter"]),
1721
+ ), T = oe(
1722
+ () => R(n == null ? void 0 : n.validators, ["themeGetter"]),
1720
1723
  [n == null ? void 0 : n.validators]
1721
1724
  );
1722
- function T(p, g) {
1723
- return p ? p.some((z) => typeof z == "function" && typeof z.name == "string" ? g.includes(z.name) : !1) : !1;
1724
- }
1725
- const H = (p) => {
1726
- if (!p) return "";
1727
- const g = p.match(Le);
1728
- if (g) return g[2];
1729
- const z = p.match(nt);
1730
- return z ? z[2] : p;
1731
- }, M = (p) => {
1732
- if (!p) return "";
1733
- const g = p.trim();
1734
- return I.some((z) => String(z.value) === g) ? g : g.startsWith("--") ? `(${g})` : _e(g) && !Re.test(g) ? (n == null ? void 0 : n.themeProvider) && Array.isArray(n.themeProvider) && n.themeProvider.length > 0 ? g : `[${g}]` : Re.test(g) ? `[${g}]` : p;
1735
- }, _ = (p) => {
1736
- const g = (p || "").trim();
1737
- return I.some((z) => String(z.value) === g) ? "list" : g.startsWith("--") ? "arbitrary" : rt(g) ? "fraction" : Le.test(g) ? "arbitrary" : _e(g) && !Re.test(g) ? "native" : tn(g) || Re.test(g) ? "arbitrary" : nn(g) ? "native" : Qi.test(g) || /^#([0-9a-f]{3,8})$/i.test(g) ? "color" : (Gi.test(g) || en.test(g), "arbitrary");
1738
- }, D = (p) => !!(p === "" || _e(p) || Le.test(p) || nt.test(p) || I.some((g) => String(g.value) === p) || rt(p) || p === "full"), V = (p) => {
1739
- u(p);
1725
+ function R(h, w) {
1726
+ return h ? h.some((C) => typeof C == "function" && typeof C.name == "string" ? w.includes(C.name) : !1) : !1;
1727
+ }
1728
+ const O = (h) => {
1729
+ if (!h) return "";
1730
+ const w = h.match(Le);
1731
+ if (w) return w[2];
1732
+ const C = h.match(nt);
1733
+ return C ? C[2] : h;
1734
+ }, M = (h) => {
1735
+ if (!h) return "";
1736
+ const w = h.trim();
1737
+ return k.some((C) => String(C.value) === w) ? w : w.startsWith("--") ? `(${w})` : _e(w) && !Re.test(w) ? (n == null ? void 0 : n.themeProvider) && Array.isArray(n.themeProvider) && n.themeProvider.length > 0 ? w : `[${w}]` : Re.test(w) ? `[${w}]` : h;
1738
+ }, _ = (h) => {
1739
+ const w = (h || "").trim();
1740
+ return k.some((C) => String(C.value) === w) ? "list" : w.startsWith("--") ? "arbitrary" : rt(w) ? "fraction" : Le.test(w) ? "arbitrary" : _e(w) && !Re.test(w) ? "native" : tn(w) || Re.test(w) ? "arbitrary" : nn(w) ? "native" : Qi.test(w) || /^#([0-9a-f]{3,8})$/i.test(w) ? "color" : (Gi.test(w) || en.test(w), "arbitrary");
1741
+ }, D = (h) => !!(h === "" || _e(h) || Le.test(h) || nt.test(h) || k.some((w) => String(w.value) === h) || rt(h) || h === "full"), V = (h) => {
1742
+ u(h);
1740
1743
  }, P = () => {
1741
- const p = M(l);
1742
- D(p) ? (f(p), e(p), s(_(p))) : u(d);
1743
- }, $ = (p) => {
1744
- if (p.key === "Enter") {
1745
- const g = M(l);
1746
- D(g) ? (f(g), e(g), s(_(g))) : u(d);
1747
- }
1748
- }, O = (p) => {
1744
+ const h = M(l);
1745
+ D(h) ? (f(h), e(h), s(_(h))) : u(m);
1746
+ }, $ = (h) => {
1747
+ if (h.key === "Enter") {
1748
+ const w = M(l);
1749
+ D(w) ? (f(w), e(w), s(_(w))) : u(m);
1750
+ }
1751
+ }, H = (h) => {
1749
1752
  var Ge;
1750
- const g = l.trim(), z = !isNaN(Number(g));
1753
+ const w = l.trim(), C = !isNaN(Number(w));
1751
1754
  let Z = "";
1752
- if (p === "")
1755
+ if (h === "")
1753
1756
  Z = "";
1754
- else if (Zt.test(p))
1755
- Z = p;
1756
- else if (c === "list" || c === "theme" || g.startsWith("--"))
1757
- Z = p;
1758
- else if (z)
1759
- Z = `${g}${p}`;
1757
+ else if (Zt.test(h))
1758
+ Z = h;
1759
+ else if (c === "list" || c === "theme" || w.startsWith("--"))
1760
+ Z = h;
1761
+ else if (C)
1762
+ Z = `${w}${h}`;
1760
1763
  else {
1761
- const et = g.match(/^(-?\d+\.?\d*)/);
1762
- et ? Z = `${et[1]}${p}` : Z = p;
1764
+ const et = w.match(/^(-?\d+\.?\d*)/);
1765
+ et ? Z = `${et[1]}${h}` : Z = h;
1763
1766
  }
1764
1767
  u(Z);
1765
1768
  const ce = M(Z);
1766
- D(ce) && (f(ce), e(ce), s(_(ce))), (Ge = h.current) == null || Ge.focus();
1767
- }, K = (p) => {
1768
- const g = H(p), z = M(g);
1769
- D(z) ? (u(g), f(z), e(z), s(_(z))) : u(d);
1769
+ D(ce) && (f(ce), e(ce), s(_(ce))), (Ge = p.current) == null || Ge.focus();
1770
+ }, K = (h) => {
1771
+ const w = O(h), C = M(w);
1772
+ D(C) ? (u(w), f(C), e(C), s(_(C))) : u(m);
1770
1773
  }, ne = (() => {
1771
1774
  switch (c) {
1772
1775
  case "fraction":
@@ -1781,48 +1784,48 @@ const Ji = ({
1781
1784
  return /* @__PURE__ */ React.createElement(Ft, null);
1782
1785
  }
1783
1786
  })(), F = () => o(!0), re = () => {
1784
- var p, g, z;
1785
- return E ? /* @__PURE__ */ React.createElement(
1787
+ var h, w, C;
1788
+ return S ? /* @__PURE__ */ React.createElement(
1786
1789
  ye,
1787
1790
  {
1788
- options: ((z = (g = (p = r == null ? void 0 : r.units) == null ? void 0 : p.spacing) == null ? void 0 : g.fraction) == null ? void 0 : z.options) || [],
1791
+ options: ((C = (w = (h = r == null ? void 0 : r.units) == null ? void 0 : h.spacing) == null ? void 0 : w.fraction) == null ? void 0 : C.options) || [],
1789
1792
  size: "small",
1790
1793
  value: l,
1791
1794
  className: "mt-0 w-[200px]",
1792
- onPressedChange: (Z) => O(String(Z))
1795
+ onPressedChange: (Z) => H(String(Z))
1793
1796
  }
1794
1797
  ) : null;
1795
1798
  }, W = () => /* @__PURE__ */ React.createElement(
1796
1799
  ye,
1797
1800
  {
1798
- options: I.map((p) => ({
1799
- value: p.value,
1800
- label: p.label
1801
+ options: k.map((h) => ({
1802
+ value: h.value,
1803
+ label: h.label
1801
1804
  })),
1802
1805
  size: "small",
1803
1806
  className: "mt-0 w-[200px]",
1804
1807
  value: l,
1805
- onPressedChange: (p) => K(String(p))
1808
+ onPressedChange: (h) => K(String(h))
1806
1809
  }
1807
1810
  ), J = oe(() => {
1808
1811
  try {
1809
- const p = window.getComputedStyle(document.documentElement), g = [];
1810
- for (let z = 0; z < p.length; z++) {
1811
- const Z = p[z];
1812
+ const h = window.getComputedStyle(document.documentElement), w = [];
1813
+ for (let C = 0; C < h.length; C++) {
1814
+ const Z = h[C];
1812
1815
  if (Z.startsWith("--wp--custom--")) {
1813
- const ce = p.getPropertyValue(Z).trim();
1814
- g.push({
1816
+ const ce = h.getPropertyValue(Z).trim();
1817
+ w.push({
1815
1818
  value: Z,
1816
1819
  label: `${Z} (${ce})`
1817
1820
  });
1818
1821
  }
1819
1822
  }
1820
- return g;
1823
+ return w;
1821
1824
  } catch {
1822
1825
  return [];
1823
1826
  }
1824
1827
  }, []), ae = () => {
1825
- const g = [
1828
+ const w = [
1826
1829
  ...J,
1827
1830
  {
1828
1831
  value: "--custom-css-var",
@@ -1833,24 +1836,24 @@ const Ji = ({
1833
1836
  ye,
1834
1837
  {
1835
1838
  className: "mt-0 w-[200px]",
1836
- options: g,
1839
+ options: w,
1837
1840
  size: "small",
1838
1841
  value: l,
1839
- onPressedChange: (z) => K(String(z))
1842
+ onPressedChange: (C) => K(String(C))
1840
1843
  }
1841
1844
  );
1842
1845
  }, le = () => /* @__PURE__ */ React.createElement("div", { className: "flex gap-2" }, /* @__PURE__ */ React.createElement(
1843
1846
  ye,
1844
1847
  {
1845
1848
  className: "mt-0 w-[200px]",
1846
- options: rn.map((p) => ({
1847
- value: p.value,
1848
- label: p.value,
1849
- tooltip: p.label
1849
+ options: rn.map((h) => ({
1850
+ value: h.value,
1851
+ label: h.value,
1852
+ tooltip: h.label
1850
1853
  })),
1851
1854
  size: "small",
1852
1855
  value: l,
1853
- onPressedChange: (p) => O(String(p))
1856
+ onPressedChange: (h) => H(String(h))
1854
1857
  }
1855
1858
  ));
1856
1859
  return /* @__PURE__ */ React.createElement("div", { className: "relative flex flex-col items-baseline" }, /* @__PURE__ */ React.createElement(
@@ -1862,7 +1865,7 @@ const Ji = ({
1862
1865
  onChange: V,
1863
1866
  onBlur: P,
1864
1867
  onKeyDown: $,
1865
- placeholder: C,
1868
+ placeholder: I,
1866
1869
  autoComplete: "off",
1867
1870
  suffix: /* @__PURE__ */ React.createElement($t, null, /* @__PURE__ */ React.createElement(
1868
1871
  Wt,
@@ -1873,22 +1876,22 @@ const Ji = ({
1873
1876
  className: "overflow-x-hidden w-[280px] max-h-[400px]",
1874
1877
  onVisibleChange: o
1875
1878
  },
1876
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col divide-y divide-border -m-4" }, y && /* @__PURE__ */ React.createElement(
1879
+ /* @__PURE__ */ React.createElement("div", { className: "flex flex-col divide-y divide-border -m-4" }, b && /* @__PURE__ */ React.createElement(
1877
1880
  Ji,
1878
1881
  {
1879
1882
  value: l,
1880
1883
  label: "Number Value",
1881
1884
  className: "w-[200px] pt-4 pb-2 px-4",
1882
- min: x,
1885
+ min: y,
1883
1886
  max: L,
1884
1887
  gridMode: !1,
1885
1888
  showTooltip: !1,
1886
- onValueChange: (p) => {
1887
- const g = M(p);
1888
- D(g) ? (u(p), f(g), e(g), s(_(g))) : u(p);
1889
+ onValueChange: (h) => {
1890
+ const w = M(h);
1891
+ D(w) ? (u(h), f(w), e(w), s(_(w))) : u(h);
1889
1892
  }
1890
1893
  }
1891
- ), E && v && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Fraction" }), re()), I.length > 0 && b && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Options" }), W()), m && N && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Arbitrary Units" }), le()), k && w && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(
1894
+ ), S && v && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Fraction" }), re()), k.length > 0 && x && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Options" }), W()), d && z && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(xe, { title: "Arbitrary Units" }), le()), T && g && /* @__PURE__ */ React.createElement("div", { className: "p-4" }, /* @__PURE__ */ React.createElement(
1892
1895
  xe,
1893
1896
  {
1894
1897
  title: "CSS Variables",
@@ -1935,20 +1938,20 @@ const Ji = ({
1935
1938
  shouldCloseOnClickOutside: l = !0,
1936
1939
  ...u
1937
1940
  }) => {
1938
- const d = e !== void 0, [f, h] = A(i), v = d ? e : f, b = (x) => {
1939
- d || h(x), n == null || n(x);
1940
- }, y = () => b(!0), w = () => {
1941
- c == null || c(), b(!1);
1942
- }, N = ge.toArray(t).some(
1943
- (x) => we(x) && x.type === at
1941
+ const m = e !== void 0, [f, p] = A(i), v = m ? e : f, x = (y) => {
1942
+ m || p(y), n == null || n(y);
1943
+ }, b = () => x(!0), g = () => {
1944
+ c == null || c(), x(!1);
1945
+ }, z = ge.toArray(t).some(
1946
+ (y) => we(y) && y.type === at
1944
1947
  );
1945
1948
  j(() => {
1946
1949
  n == null || n(v);
1947
1950
  }, [v, n]);
1948
- let C = {};
1949
- return N ? C = { labelledby: "bb-modal-heading" } : r && (C = { label: r }), /* @__PURE__ */ React.createElement(Ut.Provider, { value: { closeModal: w, openModal: y } }, ge.map(
1951
+ let I = {};
1952
+ return z ? I = { labelledby: "bb-modal-heading" } : r && (I = { label: r }), /* @__PURE__ */ React.createElement(Ut.Provider, { value: { closeModal: g, openModal: b } }, ge.map(
1950
1953
  t,
1951
- (x) => we(x) && x.type === on ? x : null
1954
+ (y) => we(y) && y.type === on ? y : null
1952
1955
  ), v && /* @__PURE__ */ React.createElement(
1953
1956
  ci,
1954
1957
  {
@@ -1959,8 +1962,8 @@ const Ji = ({
1959
1962
  ),
1960
1963
  size: o,
1961
1964
  title: "",
1962
- aria: C,
1963
- onRequestClose: w,
1965
+ aria: I,
1966
+ onRequestClose: g,
1964
1967
  shouldCloseOnEsc: s,
1965
1968
  shouldCloseOnClickOutside: l,
1966
1969
  ...u
@@ -1971,18 +1974,18 @@ const Ji = ({
1971
1974
  "aria-label": "Close",
1972
1975
  label: "Close",
1973
1976
  variant: "secondary",
1974
- onClick: w
1977
+ onClick: g
1975
1978
  },
1976
1979
  /* @__PURE__ */ React.createElement(Ti, { className: "h-4 w-4" })
1977
1980
  )), ge.map(
1978
1981
  t,
1979
- (x) => we(x) && x.type === at ? x : null
1982
+ (y) => we(y) && y.type === at ? y : null
1980
1983
  ), ge.map(
1981
1984
  t,
1982
- (x) => we(x) && x.type === sn ? x : null
1985
+ (y) => we(y) && y.type === sn ? y : null
1983
1986
  ), ge.map(
1984
1987
  t,
1985
- (x) => we(x) && x.type === an ? x : null
1988
+ (y) => we(y) && y.type === an ? y : null
1986
1989
  ))
1987
1990
  ));
1988
1991
  }, at = ({ children: t, className: e = "", ...i }) => /* @__PURE__ */ React.createElement(
@@ -2120,7 +2123,7 @@ function Sr(t) {
2120
2123
  const { media: e, bbFill: i } = t, { url: n, alt: r, sizes: a } = e;
2121
2124
  if (a === void 0)
2122
2125
  return /* @__PURE__ */ React.createElement("picture", { className: "b_fill" }, /* @__PURE__ */ React.createElement("img", { src: n, alt: r, className: `b_media ${i}` }));
2123
- const { thumbnail: o, medium: c, large: s } = a, l = o || n, u = c || n, d = s || n;
2126
+ const { thumbnail: o, medium: c, large: s } = a, l = o || n, u = c || n, m = s || n;
2124
2127
  return /* @__PURE__ */ React.createElement("picture", { className: "b_fill" }, l ? /* @__PURE__ */ React.createElement(
2125
2128
  "source",
2126
2129
  {
@@ -2135,11 +2138,11 @@ function Sr(t) {
2135
2138
  srcSet: u,
2136
2139
  className: `b_media ${i}`
2137
2140
  }
2138
- ) : null, d ? /* @__PURE__ */ React.createElement(
2141
+ ) : null, m ? /* @__PURE__ */ React.createElement(
2139
2142
  "source",
2140
2143
  {
2141
2144
  media: "(min-width: 1536px)",
2142
- srcSet: d,
2145
+ srcSet: m,
2143
2146
  className: `b_media ${i}`
2144
2147
  }
2145
2148
  ) : null, u ? /* @__PURE__ */ React.createElement("img", { src: u, alt: r, className: `b_media ${i}` }) : null);
@@ -2172,31 +2175,31 @@ const cn = 2e3, zr = ({
2172
2175
  disabled: s = !1,
2173
2176
  savedLabel: l = "Saved",
2174
2177
  savedDuration: u = cn,
2175
- ...d
2178
+ ...m
2176
2179
  }) => {
2177
- const [f, h] = A(!1), [v, b] = A(!1), y = U(null), w = o === "icon" || o === "icon-lg";
2180
+ const [f, p] = A(!1), [v, x] = A(!1), b = U(null), g = o === "icon" || o === "icon-lg";
2178
2181
  j(() => () => {
2179
- y.current && window.clearTimeout(y.current);
2182
+ b.current && window.clearTimeout(b.current);
2180
2183
  }, []);
2181
- const N = async () => {
2184
+ const z = async () => {
2182
2185
  if (!(s || f)) {
2183
- y.current && window.clearTimeout(y.current), b(!1), h(!0);
2186
+ b.current && window.clearTimeout(b.current), x(!1), p(!0);
2184
2187
  try {
2185
- await Promise.resolve(r == null ? void 0 : r()), h(!1), b(!0), y.current = window.setTimeout(() => {
2186
- b(!1);
2188
+ await Promise.resolve(r == null ? void 0 : r()), p(!1), x(!0), b.current = window.setTimeout(() => {
2189
+ x(!1);
2187
2190
  }, u);
2188
2191
  } catch {
2189
- h(!1);
2192
+ p(!1);
2190
2193
  }
2191
2194
  }
2192
- }, C = v ? l : i, x = v ? _i : c;
2195
+ }, I = v ? l : i, y = v ? _i : c;
2193
2196
  return /* @__PURE__ */ React.createElement(
2194
2197
  Y,
2195
2198
  {
2196
- ...d,
2199
+ ...m,
2197
2200
  size: e,
2198
2201
  variant: a,
2199
- label: C,
2202
+ label: I,
2200
2203
  showTooltip: !0,
2201
2204
  disabled: s || f,
2202
2205
  isBusy: f,
@@ -2210,17 +2213,17 @@ const cn = 2e3, zr = ({
2210
2213
  { "is-tertiary": a === "tertiary" },
2211
2214
  { "is-icon": o === "icon" }
2212
2215
  ),
2213
- onClick: N
2216
+ onClick: z
2214
2217
  },
2215
- x && /* @__PURE__ */ React.createElement(
2218
+ y && /* @__PURE__ */ React.createElement(
2216
2219
  He,
2217
2220
  {
2218
- icon: x,
2221
+ icon: y,
2219
2222
  className: B({ "h-4 w-4": o === "icon-lg" })
2220
2223
  }
2221
2224
  ),
2222
- w ? null : v ? l : t,
2223
- C && !t && !w ? /* @__PURE__ */ React.createElement("span", null, C) : null
2225
+ g ? null : v ? l : t,
2226
+ I && !t && !g ? /* @__PURE__ */ React.createElement("span", null, I) : null
2224
2227
  );
2225
2228
  }, Nr = ({
2226
2229
  children: t,
@@ -2360,10 +2363,10 @@ var Ve, lt, ct, dn = (st || (st = 1, Ve = ot, (function() {
2360
2363
  }
2361
2364
  function c(s) {
2362
2365
  if (typeof s == "number") return s;
2363
- if ((function(d) {
2364
- return typeof d == "symbol" || /* @__PURE__ */ (function(f) {
2366
+ if ((function(m) {
2367
+ return typeof m == "symbol" || /* @__PURE__ */ (function(f) {
2365
2368
  return !!f && typeof f == "object";
2366
- })(d) && a.call(d) == "[object Symbol]";
2369
+ })(m) && a.call(m) == "[object Symbol]";
2367
2370
  })(s)) return NaN;
2368
2371
  if (o(s)) {
2369
2372
  var l = typeof s.valueOf == "function" ? s.valueOf() : s;
@@ -2375,72 +2378,72 @@ var Ve, lt, ct, dn = (st || (st = 1, Ve = ot, (function() {
2375
2378
  return u || n.test(s) ? r(s.slice(2), u ? 2 : 8) : e.test(s) ? NaN : +s;
2376
2379
  }
2377
2380
  return ut = function(s, l, u) {
2378
- return u === void 0 && (u = l, l = void 0), u !== void 0 && (u = (u = c(u)) == u ? u : 0), l !== void 0 && (l = (l = c(l)) == l ? l : 0), (function(d, f, h) {
2379
- return d == d && (h !== void 0 && (d = d <= h ? d : h), f !== void 0 && (d = d >= f ? d : f)), d;
2381
+ return u === void 0 && (u = l, l = void 0), u !== void 0 && (u = (u = c(u)) == u ? u : 0), l !== void 0 && (l = (l = c(l)) == l ? l : 0), (function(m, f, p) {
2382
+ return m == m && (p !== void 0 && (m = m <= p ? m : p), f !== void 0 && (m = m >= f ? m : f)), m;
2380
2383
  })(c(s), l, u);
2381
2384
  };
2382
2385
  })()), pn = Se((function() {
2383
2386
  if (ft) return dt;
2384
2387
  ft = 1;
2385
- var t = /^\s+|\s+$/g, e = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, n = /^0o[0-7]+$/i, r = parseInt, a = typeof ze == "object" && ze && ze.Object === Object && ze, o = typeof self == "object" && self && self.Object === Object && self, c = a || o || Function("return this")(), s = Object.prototype.toString, l = Math.max, u = Math.min, d = function() {
2388
+ var t = /^\s+|\s+$/g, e = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, n = /^0o[0-7]+$/i, r = parseInt, a = typeof ze == "object" && ze && ze.Object === Object && ze, o = typeof self == "object" && self && self.Object === Object && self, c = a || o || Function("return this")(), s = Object.prototype.toString, l = Math.max, u = Math.min, m = function() {
2386
2389
  return c.Date.now();
2387
2390
  };
2388
2391
  function f(v) {
2389
- var b = typeof v;
2390
- return !!v && (b == "object" || b == "function");
2392
+ var x = typeof v;
2393
+ return !!v && (x == "object" || x == "function");
2391
2394
  }
2392
- function h(v) {
2395
+ function p(v) {
2393
2396
  if (typeof v == "number") return v;
2394
- if ((function(w) {
2395
- return typeof w == "symbol" || /* @__PURE__ */ (function(N) {
2396
- return !!N && typeof N == "object";
2397
- })(w) && s.call(w) == "[object Symbol]";
2397
+ if ((function(g) {
2398
+ return typeof g == "symbol" || /* @__PURE__ */ (function(z) {
2399
+ return !!z && typeof z == "object";
2400
+ })(g) && s.call(g) == "[object Symbol]";
2398
2401
  })(v)) return NaN;
2399
2402
  if (f(v)) {
2400
- var b = typeof v.valueOf == "function" ? v.valueOf() : v;
2401
- v = f(b) ? b + "" : b;
2403
+ var x = typeof v.valueOf == "function" ? v.valueOf() : v;
2404
+ v = f(x) ? x + "" : x;
2402
2405
  }
2403
2406
  if (typeof v != "string") return v === 0 ? v : +v;
2404
2407
  v = v.replace(t, "");
2405
- var y = i.test(v);
2406
- return y || n.test(v) ? r(v.slice(2), y ? 2 : 8) : e.test(v) ? NaN : +v;
2408
+ var b = i.test(v);
2409
+ return b || n.test(v) ? r(v.slice(2), b ? 2 : 8) : e.test(v) ? NaN : +v;
2407
2410
  }
2408
- return dt = function(v, b, y) {
2409
- var w, N, C, x, L, I, m = 0, E = !1, k = !1, T = !0;
2411
+ return dt = function(v, x, b) {
2412
+ var g, z, I, y, L, k, d = 0, S = !1, T = !1, R = !0;
2410
2413
  if (typeof v != "function") throw new TypeError("Expected a function");
2411
- function H(P) {
2412
- var $ = w, O = N;
2413
- return w = N = void 0, m = P, x = v.apply(O, $);
2414
+ function O(P) {
2415
+ var $ = g, H = z;
2416
+ return g = z = void 0, d = P, y = v.apply(H, $);
2414
2417
  }
2415
2418
  function M(P) {
2416
- var $ = P - I;
2417
- return I === void 0 || $ >= b || $ < 0 || k && P - m >= C;
2419
+ var $ = P - k;
2420
+ return k === void 0 || $ >= x || $ < 0 || T && P - d >= I;
2418
2421
  }
2419
2422
  function _() {
2420
- var P = d();
2423
+ var P = m();
2421
2424
  if (M(P)) return D(P);
2422
2425
  L = setTimeout(_, (function($) {
2423
- var O = b - ($ - I);
2424
- return k ? u(O, C - ($ - m)) : O;
2426
+ var H = x - ($ - k);
2427
+ return T ? u(H, I - ($ - d)) : H;
2425
2428
  })(P));
2426
2429
  }
2427
2430
  function D(P) {
2428
- return L = void 0, T && w ? H(P) : (w = N = void 0, x);
2431
+ return L = void 0, R && g ? O(P) : (g = z = void 0, y);
2429
2432
  }
2430
2433
  function V() {
2431
- var P = d(), $ = M(P);
2432
- if (w = arguments, N = this, I = P, $) {
2433
- if (L === void 0) return (function(O) {
2434
- return m = O, L = setTimeout(_, b), E ? H(O) : x;
2435
- })(I);
2436
- if (k) return L = setTimeout(_, b), H(I);
2434
+ var P = m(), $ = M(P);
2435
+ if (g = arguments, z = this, k = P, $) {
2436
+ if (L === void 0) return (function(H) {
2437
+ return d = H, L = setTimeout(_, x), S ? O(H) : y;
2438
+ })(k);
2439
+ if (T) return L = setTimeout(_, x), O(k);
2437
2440
  }
2438
- return L === void 0 && (L = setTimeout(_, b)), x;
2441
+ return L === void 0 && (L = setTimeout(_, x)), y;
2439
2442
  }
2440
- return b = h(b) || 0, f(y) && (E = !!y.leading, C = (k = "maxWait" in y) ? l(h(y.maxWait) || 0, b) : C, T = "trailing" in y ? !!y.trailing : T), V.cancel = function() {
2441
- L !== void 0 && clearTimeout(L), m = 0, w = I = N = L = void 0;
2443
+ return x = p(x) || 0, f(b) && (S = !!b.leading, I = (T = "maxWait" in b) ? l(p(b.maxWait) || 0, x) : I, R = "trailing" in b ? !!b.trailing : R), V.cancel = function() {
2444
+ L !== void 0 && clearTimeout(L), d = 0, g = k = z = L = void 0;
2442
2445
  }, V.flush = function() {
2443
- return L === void 0 ? x : D(d());
2446
+ return L === void 0 ? y : D(m());
2444
2447
  }, V;
2445
2448
  };
2446
2449
  })()), ht = {
@@ -2463,13 +2466,13 @@ function vn(t) {
2463
2466
  return s.current = t.onResize, window.React.useEffect(() => {
2464
2467
  if (!e.current || typeof window > "u" || !("ResizeObserver" in window)) return;
2465
2468
  const l = new ResizeObserver(([u]) => {
2466
- const d = i === "border-box" ? "borderBoxSize" : i === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", f = pt(u, d, "inlineSize"), h = pt(u, d, "blockSize");
2467
- if (c.current.width !== f || c.current.height !== h) {
2469
+ const m = i === "border-box" ? "borderBoxSize" : i === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize", f = pt(u, m, "inlineSize"), p = pt(u, m, "blockSize");
2470
+ if (c.current.width !== f || c.current.height !== p) {
2468
2471
  const v = {
2469
2472
  width: f,
2470
- height: h
2473
+ height: p
2471
2474
  };
2472
- c.current.width = f, c.current.height = h, s.current ? s.current(v) : o() && a(v);
2475
+ c.current.width = f, c.current.height = p, s.current ? s.current(v) : o() && a(v);
2473
2476
  }
2474
2477
  });
2475
2478
  return l.observe(e.current, {
@@ -2513,10 +2516,10 @@ var gt, wt = {
2513
2516
  function r(s, l, u) {
2514
2517
  this.fn = s, this.context = l, this.once = u || !1;
2515
2518
  }
2516
- function a(s, l, u, d, f) {
2519
+ function a(s, l, u, m, f) {
2517
2520
  if (typeof u != "function") throw new TypeError("The listener must be a function");
2518
- var h = new r(u, d || s, f), v = i ? i + l : l;
2519
- return s._events[v] ? s._events[v].fn ? s._events[v] = [s._events[v], h] : s._events[v].push(h) : (s._events[v] = h, s._eventsCount++), s;
2521
+ var p = new r(u, m || s, f), v = i ? i + l : l;
2522
+ return s._events[v] ? s._events[v].fn ? s._events[v] = [s._events[v], p] : s._events[v].push(p) : (s._events[v] = p, s._eventsCount++), s;
2520
2523
  }
2521
2524
  function o(s, l) {
2522
2525
  --s._eventsCount === 0 ? s._events = new n() : delete s._events[l];
@@ -2533,50 +2536,50 @@ var gt, wt = {
2533
2536
  var l = i ? i + s : s, u = this._events[l];
2534
2537
  if (!u) return [];
2535
2538
  if (u.fn) return [u.fn];
2536
- for (var d = 0, f = u.length, h = new Array(f); d < f; d++) h[d] = u[d].fn;
2537
- return h;
2539
+ for (var m = 0, f = u.length, p = new Array(f); m < f; m++) p[m] = u[m].fn;
2540
+ return p;
2538
2541
  }, c.prototype.listenerCount = function(s) {
2539
2542
  var l = i ? i + s : s, u = this._events[l];
2540
2543
  return u ? u.fn ? 1 : u.length : 0;
2541
- }, c.prototype.emit = function(s, l, u, d, f, h) {
2544
+ }, c.prototype.emit = function(s, l, u, m, f, p) {
2542
2545
  var v = i ? i + s : s;
2543
2546
  if (!this._events[v]) return !1;
2544
- var b, y, w = this._events[v], N = arguments.length;
2545
- if (w.fn) {
2546
- switch (w.once && this.removeListener(s, w.fn, void 0, !0), N) {
2547
+ var x, b, g = this._events[v], z = arguments.length;
2548
+ if (g.fn) {
2549
+ switch (g.once && this.removeListener(s, g.fn, void 0, !0), z) {
2547
2550
  case 1:
2548
- return w.fn.call(w.context), !0;
2551
+ return g.fn.call(g.context), !0;
2549
2552
  case 2:
2550
- return w.fn.call(w.context, l), !0;
2553
+ return g.fn.call(g.context, l), !0;
2551
2554
  case 3:
2552
- return w.fn.call(w.context, l, u), !0;
2555
+ return g.fn.call(g.context, l, u), !0;
2553
2556
  case 4:
2554
- return w.fn.call(w.context, l, u, d), !0;
2557
+ return g.fn.call(g.context, l, u, m), !0;
2555
2558
  case 5:
2556
- return w.fn.call(w.context, l, u, d, f), !0;
2559
+ return g.fn.call(g.context, l, u, m, f), !0;
2557
2560
  case 6:
2558
- return w.fn.call(w.context, l, u, d, f, h), !0;
2561
+ return g.fn.call(g.context, l, u, m, f, p), !0;
2559
2562
  }
2560
- for (y = 1, b = new Array(N - 1); y < N; y++) b[y - 1] = arguments[y];
2561
- w.fn.apply(w.context, b);
2563
+ for (b = 1, x = new Array(z - 1); b < z; b++) x[b - 1] = arguments[b];
2564
+ g.fn.apply(g.context, x);
2562
2565
  } else {
2563
- var C, x = w.length;
2564
- for (y = 0; y < x; y++) switch (w[y].once && this.removeListener(s, w[y].fn, void 0, !0), N) {
2566
+ var I, y = g.length;
2567
+ for (b = 0; b < y; b++) switch (g[b].once && this.removeListener(s, g[b].fn, void 0, !0), z) {
2565
2568
  case 1:
2566
- w[y].fn.call(w[y].context);
2569
+ g[b].fn.call(g[b].context);
2567
2570
  break;
2568
2571
  case 2:
2569
- w[y].fn.call(w[y].context, l);
2572
+ g[b].fn.call(g[b].context, l);
2570
2573
  break;
2571
2574
  case 3:
2572
- w[y].fn.call(w[y].context, l, u);
2575
+ g[b].fn.call(g[b].context, l, u);
2573
2576
  break;
2574
2577
  case 4:
2575
- w[y].fn.call(w[y].context, l, u, d);
2578
+ g[b].fn.call(g[b].context, l, u, m);
2576
2579
  break;
2577
2580
  default:
2578
- if (!b) for (C = 1, b = new Array(N - 1); C < N; C++) b[C - 1] = arguments[C];
2579
- w[y].fn.apply(w[y].context, b);
2581
+ if (!x) for (I = 1, x = new Array(z - 1); I < z; I++) x[I - 1] = arguments[I];
2582
+ g[b].fn.apply(g[b].context, x);
2580
2583
  }
2581
2584
  }
2582
2585
  return !0;
@@ -2584,15 +2587,15 @@ var gt, wt = {
2584
2587
  return a(this, s, l, u, !1);
2585
2588
  }, c.prototype.once = function(s, l, u) {
2586
2589
  return a(this, s, l, u, !0);
2587
- }, c.prototype.removeListener = function(s, l, u, d) {
2590
+ }, c.prototype.removeListener = function(s, l, u, m) {
2588
2591
  var f = i ? i + s : s;
2589
2592
  if (!this._events[f]) return this;
2590
2593
  if (!l) return o(this, f), this;
2591
- var h = this._events[f];
2592
- if (h.fn) h.fn !== l || d && !h.once || u && h.context !== u || o(this, f);
2594
+ var p = this._events[f];
2595
+ if (p.fn) p.fn !== l || m && !p.once || u && p.context !== u || o(this, f);
2593
2596
  else {
2594
- for (var v = 0, b = [], y = h.length; v < y; v++) (h[v].fn !== l || d && !h[v].once || u && h[v].context !== u) && b.push(h[v]);
2595
- b.length ? this._events[f] = b.length === 1 ? b[0] : b : o(this, f);
2597
+ for (var v = 0, x = [], b = p.length; v < b; v++) (p[v].fn !== l || m && !p[v].once || u && p[v].context !== u) && x.push(p[v]);
2598
+ x.length ? this._events[f] = x.length === 1 ? x[0] : x : o(this, f);
2596
2599
  }
2597
2600
  return this;
2598
2601
  }, c.prototype.removeAllListeners = function(s) {
@@ -2638,17 +2641,17 @@ class Et extends Je {
2638
2641
  currentY: c
2639
2642
  };
2640
2643
  this.el.classList.add("sash-active", $e), this.emit("start", s), this.el.setPointerCapture(a.pointerId);
2641
- const l = (d) => {
2642
- d.preventDefault();
2644
+ const l = (m) => {
2645
+ m.preventDefault();
2643
2646
  const f = {
2644
2647
  startX: o,
2645
- currentX: d.pageX,
2648
+ currentX: m.pageX,
2646
2649
  startY: c,
2647
- currentY: d.pageY
2650
+ currentY: m.pageY
2648
2651
  };
2649
2652
  this.emit("change", f);
2650
- }, u = (d) => {
2651
- d.preventDefault(), this.el.classList.remove("sash-active", $e), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(d.pointerId), window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
2653
+ }, u = (m) => {
2654
+ m.preventDefault(), this.el.classList.remove("sash-active", $e), this.hoverDelayer.cancel(), this.emit("end"), this.el.releasePointerCapture(m.pointerId), window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
2652
2655
  };
2653
2656
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
2654
2657
  }, this.onPointerDoublePress = () => {
@@ -2767,8 +2770,8 @@ class Ln extends Je {
2767
2770
  }, this.orientation = (o = i.orientation) != null ? o : G.Vertical, this.proportionalLayout = (c = i.proportionalLayout) != null ? c : !0, this.getSashOrthogonalSize = i.getSashOrthogonalSize, n && (this.onDidChange = n), r && (this.onDidDragStart = r), a && (this.onDidDragEnd = a), this.sashContainer = document.createElement("div"), this.sashContainer.classList.add("sash-container", wn), e.prepend(this.sashContainer), i.descriptor) {
2768
2771
  this.size = i.descriptor.size;
2769
2772
  for (const [s, l] of i.descriptor.views.entries()) {
2770
- const u = l.size, d = l.container, f = l.view;
2771
- this.addView(d, f, u, s, !0);
2773
+ const u = l.size, m = l.container, f = l.view;
2774
+ this.addView(m, f, u, s, !0);
2772
2775
  }
2773
2776
  this.contentSize = this.viewItems.reduce((s, l) => s + l.size, 0), this.saveProportions();
2774
2777
  }
@@ -2781,37 +2784,37 @@ class Ln extends Je {
2781
2784
  const c = this.orientation === G.Vertical ? new Mn(e, i, o) : new Tn(e, i, o);
2782
2785
  if (this.viewItems.splice(r, 0, c), this.viewItems.length > 1) {
2783
2786
  const s = this.orientation === G.Vertical ? new Et(this.sashContainer, {
2784
- getHorizontalSashTop: (d) => this.getSashPosition(d),
2787
+ getHorizontalSashTop: (m) => this.getSashPosition(m),
2785
2788
  getHorizontalSashWidth: this.getSashOrthogonalSize
2786
2789
  }, {
2787
2790
  orientation: G.Horizontal
2788
2791
  }) : new Et(this.sashContainer, {
2789
- getVerticalSashLeft: (d) => this.getSashPosition(d),
2792
+ getVerticalSashLeft: (m) => this.getSashPosition(m),
2790
2793
  getVerticalSashHeight: this.getSashOrthogonalSize
2791
2794
  }, {
2792
2795
  orientation: G.Vertical
2793
- }), l = this.orientation === G.Vertical ? (d) => ({
2796
+ }), l = this.orientation === G.Vertical ? (m) => ({
2794
2797
  sash: s,
2795
- start: d.startY,
2796
- current: d.currentY
2797
- }) : (d) => ({
2798
+ start: m.startY,
2799
+ current: m.currentY
2800
+ }) : (m) => ({
2798
2801
  sash: s,
2799
- start: d.startX,
2800
- current: d.currentX
2802
+ start: m.startX,
2803
+ current: m.currentX
2801
2804
  });
2802
- s.on("start", (d) => {
2805
+ s.on("start", (m) => {
2803
2806
  var f;
2804
- this.emit("sashDragStart"), this.onSashStart(l(d));
2805
- const h = this.viewItems.map((v) => v.size);
2806
- (f = this.onDidDragStart) == null || f.call(this, h);
2807
- }), s.on("change", (d) => this.onSashChange(l(d))), s.on("end", () => {
2808
- var d;
2809
- this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex((h) => h.sash === s));
2810
- const f = this.viewItems.map((h) => h.size);
2811
- (d = this.onDidDragEnd) == null || d.call(this, f);
2807
+ this.emit("sashDragStart"), this.onSashStart(l(m));
2808
+ const p = this.viewItems.map((v) => v.size);
2809
+ (f = this.onDidDragStart) == null || f.call(this, p);
2810
+ }), s.on("change", (m) => this.onSashChange(l(m))), s.on("end", () => {
2811
+ var m;
2812
+ this.emit("sashDragEnd"), this.onSashEnd(this.sashItems.findIndex((p) => p.sash === s));
2813
+ const f = this.viewItems.map((p) => p.size);
2814
+ (m = this.onDidDragEnd) == null || m.call(this, f);
2812
2815
  }), s.on("reset", () => {
2813
- const d = this.sashItems.findIndex((y) => y.sash === s), f = q(d, -1, -1), h = q(d + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), b = this.findFirstSnapIndex(h);
2814
- (typeof v != "number" || this.viewItems[v].visible) && (typeof b != "number" || this.viewItems[b].visible) && this.emit("sashreset", d);
2816
+ const m = this.sashItems.findIndex((b) => b.sash === s), f = q(m, -1, -1), p = q(m + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), x = this.findFirstSnapIndex(p);
2817
+ (typeof v != "number" || this.viewItems[v].visible) && (typeof x != "number" || this.viewItems[x].visible) && this.emit("sashreset", m);
2815
2818
  });
2816
2819
  const u = {
2817
2820
  sash: s
@@ -2895,25 +2898,25 @@ class Ln extends Je {
2895
2898
  }) {
2896
2899
  const n = this.sashItems.findIndex((r) => r.sash === e);
2897
2900
  ((r) => {
2898
- const a = this.viewItems.map((N) => N.size);
2901
+ const a = this.viewItems.map((z) => z.size);
2899
2902
  let o, c, s = Number.NEGATIVE_INFINITY, l = Number.POSITIVE_INFINITY;
2900
- const u = q(n, -1, -1), d = q(n + 1, this.viewItems.length), f = u.reduce((N, C) => N + (this.viewItems[C].minimumSize - a[C]), 0), h = u.reduce((N, C) => N + (this.viewItems[C].viewMaximumSize - a[C]), 0), v = d.length === 0 ? Number.POSITIVE_INFINITY : d.reduce((N, C) => N + (a[C] - this.viewItems[C].minimumSize), 0), b = d.length === 0 ? Number.NEGATIVE_INFINITY : d.reduce((N, C) => N + (a[C] - this.viewItems[C].viewMaximumSize), 0);
2901
- s = Math.max(f, b), l = Math.min(v, h);
2902
- const y = this.findFirstSnapIndex(u), w = this.findFirstSnapIndex(d);
2903
- if (typeof y == "number") {
2904
- const N = this.viewItems[y], C = Math.floor(N.viewMinimumSize / 2);
2903
+ const u = q(n, -1, -1), m = q(n + 1, this.viewItems.length), f = u.reduce((z, I) => z + (this.viewItems[I].minimumSize - a[I]), 0), p = u.reduce((z, I) => z + (this.viewItems[I].viewMaximumSize - a[I]), 0), v = m.length === 0 ? Number.POSITIVE_INFINITY : m.reduce((z, I) => z + (a[I] - this.viewItems[I].minimumSize), 0), x = m.length === 0 ? Number.NEGATIVE_INFINITY : m.reduce((z, I) => z + (a[I] - this.viewItems[I].viewMaximumSize), 0);
2904
+ s = Math.max(f, x), l = Math.min(v, p);
2905
+ const b = this.findFirstSnapIndex(u), g = this.findFirstSnapIndex(m);
2906
+ if (typeof b == "number") {
2907
+ const z = this.viewItems[b], I = Math.floor(z.viewMinimumSize / 2);
2905
2908
  o = {
2906
- index: y,
2907
- limitDelta: N.visible ? s - C : s + C,
2908
- size: N.size
2909
+ index: b,
2910
+ limitDelta: z.visible ? s - I : s + I,
2911
+ size: z.size
2909
2912
  };
2910
2913
  }
2911
- if (typeof w == "number") {
2912
- const N = this.viewItems[w], C = Math.floor(N.viewMinimumSize / 2);
2914
+ if (typeof g == "number") {
2915
+ const z = this.viewItems[g], I = Math.floor(z.viewMinimumSize / 2);
2913
2916
  c = {
2914
- index: w,
2915
- limitDelta: N.visible ? l + C : l - C,
2916
- size: N.size
2917
+ index: g,
2918
+ limitDelta: z.visible ? l + I : l - I,
2919
+ size: z.size
2917
2920
  };
2918
2921
  }
2919
2922
  this.sashDragState = {
@@ -2951,27 +2954,27 @@ class Ln extends Je {
2951
2954
  }
2952
2955
  resize(e, i, n = this.viewItems.map((u) => u.size), r, a, o = Number.NEGATIVE_INFINITY, c = Number.POSITIVE_INFINITY, s, l) {
2953
2956
  if (e < 0 || e >= this.viewItems.length) return 0;
2954
- const u = q(e, -1, -1), d = q(e + 1, this.viewItems.length);
2955
- if (a) for (const m of a) bt(u, m), bt(d, m);
2956
- if (r) for (const m of r) De(u, m), De(d, m);
2957
- const f = u.map((m) => this.viewItems[m]), h = u.map((m) => n[m]), v = d.map((m) => this.viewItems[m]), b = d.map((m) => n[m]), y = u.reduce((m, E) => m + (this.viewItems[E].minimumSize - n[E]), 0), w = u.reduce((m, E) => m + (this.viewItems[E].maximumSize - n[E]), 0), N = d.length === 0 ? Number.POSITIVE_INFINITY : d.reduce((m, E) => m + (n[E] - this.viewItems[E].minimumSize), 0), C = d.length === 0 ? Number.NEGATIVE_INFINITY : d.reduce((m, E) => m + (n[E] - this.viewItems[E].maximumSize), 0), x = Math.max(y, C, o), L = Math.min(N, w, c);
2958
- let I = !1;
2957
+ const u = q(e, -1, -1), m = q(e + 1, this.viewItems.length);
2958
+ if (a) for (const d of a) bt(u, d), bt(m, d);
2959
+ if (r) for (const d of r) De(u, d), De(m, d);
2960
+ const f = u.map((d) => this.viewItems[d]), p = u.map((d) => n[d]), v = m.map((d) => this.viewItems[d]), x = m.map((d) => n[d]), b = u.reduce((d, S) => d + (this.viewItems[S].minimumSize - n[S]), 0), g = u.reduce((d, S) => d + (this.viewItems[S].maximumSize - n[S]), 0), z = m.length === 0 ? Number.POSITIVE_INFINITY : m.reduce((d, S) => d + (n[S] - this.viewItems[S].minimumSize), 0), I = m.length === 0 ? Number.NEGATIVE_INFINITY : m.reduce((d, S) => d + (n[S] - this.viewItems[S].maximumSize), 0), y = Math.max(b, I, o), L = Math.min(z, g, c);
2961
+ let k = !1;
2959
2962
  if (s) {
2960
- const m = this.viewItems[s.index], E = i >= s.limitDelta;
2961
- I = E !== m.visible, m.setVisible(E, s.size);
2963
+ const d = this.viewItems[s.index], S = i >= s.limitDelta;
2964
+ k = S !== d.visible, d.setVisible(S, s.size);
2962
2965
  }
2963
- if (!I && l) {
2964
- const m = this.viewItems[l.index], E = i < l.limitDelta;
2965
- I = E !== m.visible, m.setVisible(E, l.size);
2966
+ if (!k && l) {
2967
+ const d = this.viewItems[l.index], S = i < l.limitDelta;
2968
+ k = S !== d.visible, d.setVisible(S, l.size);
2966
2969
  }
2967
- if (I) return this.resize(e, i, n, r, a, o, c);
2968
- for (let m = 0, E = i = ie(i, x, L); m < f.length; m++) {
2969
- const k = f[m], T = ie(h[m] + E, k.minimumSize, k.maximumSize);
2970
- E -= T - h[m], k.size = T;
2970
+ if (k) return this.resize(e, i, n, r, a, o, c);
2971
+ for (let d = 0, S = i = ie(i, y, L); d < f.length; d++) {
2972
+ const T = f[d], R = ie(p[d] + S, T.minimumSize, T.maximumSize);
2973
+ S -= R - p[d], T.size = R;
2971
2974
  }
2972
- for (let m = 0, E = i; m < v.length; m++) {
2973
- const k = v[m], T = ie(b[m] - E, k.minimumSize, k.maximumSize);
2974
- E += T - b[m], k.size = T;
2975
+ for (let d = 0, S = i; d < v.length; d++) {
2976
+ const T = v[d], R = ie(x[d] - S, T.minimumSize, T.maximumSize);
2977
+ S += R - x[d], T.size = R;
2975
2978
  }
2976
2979
  return i;
2977
2980
  }
@@ -2981,8 +2984,8 @@ class Ln extends Je {
2981
2984
  const r = q(0, this.viewItems.length), a = [], o = r.filter((l) => this.viewItems[l].priority === Q.Low), c = r.filter((l) => this.viewItems[l].priority === Q.Normal), s = r.filter((l) => this.viewItems[l].priority === Q.High);
2982
2985
  a.push(...s, ...c, ...o), typeof e == "number" && De(a, e);
2983
2986
  for (let l = 0; n !== 0 && l < a.length; l++) {
2984
- const u = this.viewItems[a[l]], d = ie(u.size + n, u.minimumSize, u.maximumSize);
2985
- n -= d - u.size, u.size = d;
2987
+ const u = this.viewItems[a[l]], m = ie(u.size + n, u.minimumSize, u.maximumSize);
2988
+ n -= m - u.size, u.size = m;
2986
2989
  }
2987
2990
  }
2988
2991
  layoutViews() {
@@ -3010,11 +3013,11 @@ class Ln extends Je {
3010
3013
  sash: l
3011
3014
  } = this.sashItems[s];
3012
3015
  c += this.viewItems[s].size;
3013
- const u = !(i[s] && o[s + 1]), d = !(n[s] && a[s + 1]);
3014
- if (u && d) {
3015
- const f = q(s, -1, -1), h = q(s + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), b = this.findFirstSnapIndex(h), y = typeof v == "number" && !this.viewItems[v].visible, w = typeof b == "number" && !this.viewItems[b].visible;
3016
- y && a[s] && (c > 0 || this.startSnappingEnabled) ? l.state = X.Minimum : w && i[s] && (c < this.contentSize || this.endSnappingEnabled) ? l.state = X.Maximum : l.state = X.Disabled;
3017
- } else l.state = u && !d ? X.Minimum : !u && d ? X.Maximum : X.Enabled;
3016
+ const u = !(i[s] && o[s + 1]), m = !(n[s] && a[s + 1]);
3017
+ if (u && m) {
3018
+ const f = q(s, -1, -1), p = q(s + 1, this.viewItems.length), v = this.findFirstSnapIndex(f), x = this.findFirstSnapIndex(p), b = typeof v == "number" && !this.viewItems[v].visible, g = typeof x == "number" && !this.viewItems[x].visible;
3019
+ b && a[s] && (c > 0 || this.startSnappingEnabled) ? l.state = X.Minimum : g && i[s] && (c < this.contentSize || this.endSnappingEnabled) ? l.state = X.Maximum : l.state = X.Disabled;
3020
+ } else l.state = u && !m ? X.Minimum : !u && m ? X.Maximum : X.Enabled;
3018
3021
  }
3019
3022
  }
3020
3023
  findFirstSnapIndex(e) {
@@ -3113,33 +3116,33 @@ const ti = window.React.forwardRef(({
3113
3116
  defaultSizes: s = c,
3114
3117
  snap: l = !1,
3115
3118
  vertical: u = !1,
3116
- onChange: d,
3119
+ onChange: m,
3117
3120
  onReset: f,
3118
- onVisibleChange: h,
3121
+ onVisibleChange: p,
3119
3122
  onDragStart: v,
3120
- onDragEnd: b
3121
- }, y) => {
3122
- const w = window.React.useRef(null), N = window.React.useRef([]), C = window.React.useRef(/* @__PURE__ */ new Map()), x = window.React.useRef(null), L = window.React.useRef(/* @__PURE__ */ new Map()), I = window.React.useRef(new Rn()), m = window.React.useRef([]), [E, k] = window.React.useState(!1), T = window.React.useMemo(() => window.React.Children.toArray(t).filter(window.React.isValidElement), [t]), H = window.React.useCallback((M) => {
3123
+ onDragEnd: x
3124
+ }, b) => {
3125
+ const g = window.React.useRef(null), z = window.React.useRef([]), I = window.React.useRef(/* @__PURE__ */ new Map()), y = window.React.useRef(null), L = window.React.useRef(/* @__PURE__ */ new Map()), k = window.React.useRef(new Rn()), d = window.React.useRef([]), [S, T] = window.React.useState(!1), R = window.React.useMemo(() => window.React.Children.toArray(t).filter(window.React.isValidElement), [t]), O = window.React.useCallback((M) => {
3123
3126
  var _, D;
3124
- const V = (_ = m.current) == null ? void 0 : _[M];
3125
- return typeof (V == null ? void 0 : V.preferredSize) == "number" && ((D = x.current) != null && D.resizeView(M, Math.round(V.preferredSize)), !0);
3127
+ const V = (_ = d.current) == null ? void 0 : _[M];
3128
+ return typeof (V == null ? void 0 : V.preferredSize) == "number" && ((D = y.current) != null && D.resizeView(M, Math.round(V.preferredSize)), !0);
3126
3129
  }, []);
3127
- return window.React.useImperativeHandle(y, () => ({
3130
+ return window.React.useImperativeHandle(b, () => ({
3128
3131
  reset: () => {
3129
3132
  if (f) f();
3130
3133
  else {
3131
3134
  var M;
3132
- (M = x.current) == null || M.distributeViewSizes();
3133
- for (let _ = 0; _ < m.current.length; _++) H(_);
3135
+ (M = y.current) == null || M.distributeViewSizes();
3136
+ for (let _ = 0; _ < d.current.length; _++) O(_);
3134
3137
  }
3135
3138
  },
3136
3139
  resize: (M) => {
3137
3140
  var _;
3138
- (_ = x.current) == null || _.resizeViews(M);
3141
+ (_ = y.current) == null || _.resizeViews(M);
3139
3142
  }
3140
3143
  })), vt(() => {
3141
3144
  let M = !0;
3142
- s && L.current.size !== s.length && (M = !1, console.warn(`Expected ${s.length} children based on defaultSizes but found ${L.current.size}`)), M && s && (N.current = T.map((V) => V.key));
3145
+ s && L.current.size !== s.length && (M = !1, console.warn(`Expected ${s.length} children based on defaultSizes but found ${L.current.size}`)), M && s && (z.current = R.map((V) => V.key));
3143
3146
  const _ = pe({
3144
3147
  orientation: u ? G.Vertical : G.Horizontal,
3145
3148
  proportionalLayout: a
@@ -3147,18 +3150,18 @@ const ti = window.React.forwardRef(({
3147
3150
  descriptor: {
3148
3151
  size: s.reduce((V, P) => V + P, 0),
3149
3152
  views: s.map((V, P) => {
3150
- var $, O, K, ne;
3151
- const F = C.current.get(N.current[P]), re = new Rt(I.current, pe({
3153
+ var $, H, K, ne;
3154
+ const F = I.current.get(z.current[P]), re = new Rt(k.current, pe({
3152
3155
  element: document.createElement("div"),
3153
3156
  minimumSize: ($ = F == null ? void 0 : F.minSize) != null ? $ : r,
3154
- maximumSize: (O = F == null ? void 0 : F.maxSize) != null ? O : n,
3157
+ maximumSize: (H = F == null ? void 0 : F.maxSize) != null ? H : n,
3155
3158
  priority: (K = F == null ? void 0 : F.priority) != null ? K : Q.Normal
3156
3159
  }, (F == null ? void 0 : F.preferredSize) && {
3157
3160
  preferredSize: F == null ? void 0 : F.preferredSize
3158
3161
  }, {
3159
3162
  snap: (ne = F == null ? void 0 : F.snap) != null ? ne : l
3160
3163
  }));
3161
- return m.current.push(re), {
3164
+ return d.current.push(re), {
3162
3165
  container: [...L.current.values()][P],
3163
3166
  size: V,
3164
3167
  view: re
@@ -3166,103 +3169,103 @@ const ti = window.React.forwardRef(({
3166
3169
  })
3167
3170
  }
3168
3171
  });
3169
- x.current = new Ln(w.current, _, d, v, b), x.current.on("sashDragStart", () => {
3172
+ y.current = new Ln(g.current, _, m, v, x), y.current.on("sashDragStart", () => {
3170
3173
  var V;
3171
- (V = w.current) == null || V.classList.add("split-view-sash-dragging");
3172
- }), x.current.on("sashDragEnd", () => {
3174
+ (V = g.current) == null || V.classList.add("split-view-sash-dragging");
3175
+ }), y.current.on("sashDragEnd", () => {
3173
3176
  var V;
3174
- (V = w.current) == null || V.classList.remove("split-view-sash-dragging");
3175
- }), x.current.on("sashchange", (V) => {
3176
- if (h && x.current) {
3177
- const P = T.map(($) => $.key);
3177
+ (V = g.current) == null || V.classList.remove("split-view-sash-dragging");
3178
+ }), y.current.on("sashchange", (V) => {
3179
+ if (p && y.current) {
3180
+ const P = R.map(($) => $.key);
3178
3181
  for (let $ = 0; $ < P.length; $++) {
3179
- const O = C.current.get(P[$]);
3180
- (O == null ? void 0 : O.visible) !== void 0 && O.visible !== x.current.isViewVisible($) && h($, x.current.isViewVisible($));
3182
+ const H = I.current.get(P[$]);
3183
+ (H == null ? void 0 : H.visible) !== void 0 && H.visible !== y.current.isViewVisible($) && p($, y.current.isViewVisible($));
3181
3184
  }
3182
3185
  }
3183
- }), x.current.on("sashreset", (V) => {
3186
+ }), y.current.on("sashreset", (V) => {
3184
3187
  if (f) f();
3185
3188
  else {
3186
3189
  var P;
3187
- if (H(V) || H(V + 1)) return;
3188
- (P = x.current) == null || P.distributeViewSizes();
3190
+ if (O(V) || O(V + 1)) return;
3191
+ (P = y.current) == null || P.distributeViewSizes();
3189
3192
  }
3190
3193
  });
3191
- const D = x.current;
3194
+ const D = y.current;
3192
3195
  return () => {
3193
3196
  D.dispose();
3194
3197
  };
3195
3198
  }, []), vt(() => {
3196
- if (E) {
3197
- const W = T.map((R) => R.key), J = [...N.current], ae = W.filter((R) => !N.current.includes(R)), le = W.filter((R) => N.current.includes(R)), S = N.current.map((R) => !W.includes(R));
3198
- for (let R = S.length - 1; R >= 0; R--) {
3199
+ if (S) {
3200
+ const W = R.map((N) => N.key), J = [...z.current], ae = W.filter((N) => !z.current.includes(N)), le = W.filter((N) => z.current.includes(N)), E = z.current.map((N) => !W.includes(N));
3201
+ for (let N = E.length - 1; N >= 0; N--) {
3199
3202
  var M;
3200
- S[R] && ((M = x.current) != null && M.removeView(R), J.splice(R, 1), m.current.splice(R, 1));
3203
+ E[N] && ((M = y.current) != null && M.removeView(N), J.splice(N, 1), d.current.splice(N, 1));
3201
3204
  }
3202
- for (const R of ae) {
3205
+ for (const N of ae) {
3203
3206
  var _, D, V, P, $;
3204
- const p = C.current.get(R), g = new Rt(I.current, pe({
3207
+ const h = I.current.get(N), w = new Rt(k.current, pe({
3205
3208
  element: document.createElement("div"),
3206
- minimumSize: (_ = p == null ? void 0 : p.minSize) != null ? _ : r,
3207
- maximumSize: (D = p == null ? void 0 : p.maxSize) != null ? D : n,
3208
- priority: (V = p == null ? void 0 : p.priority) != null ? V : Q.Normal
3209
- }, (p == null ? void 0 : p.preferredSize) && {
3210
- preferredSize: p == null ? void 0 : p.preferredSize
3209
+ minimumSize: (_ = h == null ? void 0 : h.minSize) != null ? _ : r,
3210
+ maximumSize: (D = h == null ? void 0 : h.maxSize) != null ? D : n,
3211
+ priority: (V = h == null ? void 0 : h.priority) != null ? V : Q.Normal
3212
+ }, (h == null ? void 0 : h.preferredSize) && {
3213
+ preferredSize: h == null ? void 0 : h.preferredSize
3211
3214
  }, {
3212
- snap: (P = p == null ? void 0 : p.snap) != null ? P : l
3215
+ snap: (P = h == null ? void 0 : h.snap) != null ? P : l
3213
3216
  }));
3214
- ($ = x.current) != null && $.addView(L.current.get(R), g, Ie.Distribute, W.findIndex((z) => z === R)), J.splice(W.findIndex((z) => z === R), 0, R), m.current.splice(W.findIndex((z) => z === R), 0, g);
3217
+ ($ = y.current) != null && $.addView(L.current.get(N), w, Ie.Distribute, W.findIndex((C) => C === N)), J.splice(W.findIndex((C) => C === N), 0, N), d.current.splice(W.findIndex((C) => C === N), 0, w);
3215
3218
  }
3216
- for (; !hn(W, J); ) for (const [R, p] of W.entries()) {
3217
- const g = J.findIndex((z) => z === p);
3218
- if (g !== R) {
3219
- var O;
3220
- (O = x.current) == null || O.moveView(L.current.get(p), g, R);
3221
- const z = J[g];
3222
- J.splice(g, 1), J.splice(R, 0, z);
3219
+ for (; !hn(W, J); ) for (const [N, h] of W.entries()) {
3220
+ const w = J.findIndex((C) => C === h);
3221
+ if (w !== N) {
3222
+ var H;
3223
+ (H = y.current) == null || H.moveView(L.current.get(h), w, N);
3224
+ const C = J[w];
3225
+ J.splice(w, 1), J.splice(N, 0, C);
3223
3226
  break;
3224
3227
  }
3225
3228
  }
3226
- for (const R of ae) {
3229
+ for (const N of ae) {
3227
3230
  var K;
3228
- const p = W.findIndex((z) => z === R), g = m.current[p].preferredSize;
3229
- g !== void 0 && ((K = x.current) == null || K.resizeView(p, g));
3231
+ const h = W.findIndex((C) => C === N), w = d.current[h].preferredSize;
3232
+ w !== void 0 && ((K = y.current) == null || K.resizeView(h, w));
3230
3233
  }
3231
- for (const R of [...ae, ...le]) {
3234
+ for (const N of [...ae, ...le]) {
3232
3235
  var ne, F;
3233
- const p = C.current.get(R), g = W.findIndex((z) => z === R);
3234
- p && zt(p) && p.visible !== void 0 && ((ne = x.current) == null ? void 0 : ne.isViewVisible(g)) !== p.visible && ((F = x.current) == null || F.setViewVisible(g, p.visible));
3236
+ const h = I.current.get(N), w = W.findIndex((C) => C === N);
3237
+ h && zt(h) && h.visible !== void 0 && ((ne = y.current) == null ? void 0 : ne.isViewVisible(w)) !== h.visible && ((F = y.current) == null || F.setViewVisible(w, h.visible));
3235
3238
  }
3236
- for (const R of le) {
3237
- const p = C.current.get(R), g = W.findIndex((z) => z === R);
3238
- if (p && zt(p)) {
3239
+ for (const N of le) {
3240
+ const h = I.current.get(N), w = W.findIndex((C) => C === N);
3241
+ if (h && zt(h)) {
3239
3242
  var re;
3240
- p.preferredSize !== void 0 && m.current[g].preferredSize !== p.preferredSize && (m.current[g].preferredSize = p.preferredSize);
3241
- let z = !1;
3242
- p.minSize !== void 0 && m.current[g].minimumSize !== p.minSize && (m.current[g].minimumSize = p.minSize, z = !0), p.maxSize !== void 0 && m.current[g].maximumSize !== p.maxSize && (m.current[g].maximumSize = p.maxSize, z = !0), z && ((re = x.current) == null || re.layout());
3243
+ h.preferredSize !== void 0 && d.current[w].preferredSize !== h.preferredSize && (d.current[w].preferredSize = h.preferredSize);
3244
+ let C = !1;
3245
+ h.minSize !== void 0 && d.current[w].minimumSize !== h.minSize && (d.current[w].minimumSize = h.minSize, C = !0), h.maxSize !== void 0 && d.current[w].maximumSize !== h.maxSize && (d.current[w].maximumSize = h.maxSize, C = !0), C && ((re = y.current) == null || re.layout());
3243
3246
  }
3244
3247
  }
3245
- (ae.length > 0 || S.length > 0) && (N.current = W);
3248
+ (ae.length > 0 || E.length > 0) && (z.current = W);
3246
3249
  }
3247
- }, [T, E, n, r, l]), window.React.useEffect(() => {
3248
- x.current && (x.current.onDidChange = d);
3249
- }, [d]), window.React.useEffect(() => {
3250
- x.current && (x.current.onDidDragStart = v);
3250
+ }, [R, S, n, r, l]), window.React.useEffect(() => {
3251
+ y.current && (y.current.onDidChange = m);
3252
+ }, [m]), window.React.useEffect(() => {
3253
+ y.current && (y.current.onDidDragStart = v);
3251
3254
  }, [v]), window.React.useEffect(() => {
3252
- x.current && (x.current.onDidDragEnd = b);
3253
- }, [b]), vn({
3254
- ref: w,
3255
+ y.current && (y.current.onDidDragEnd = x);
3256
+ }, [x]), vn({
3257
+ ref: g,
3255
3258
  onResize: ({
3256
3259
  width: M,
3257
3260
  height: _
3258
3261
  }) => {
3259
3262
  var D;
3260
- M && _ && ((D = x.current) != null && D.layout(u ? _ : M), I.current.setSize(u ? _ : M), k(!0));
3263
+ M && _ && ((D = y.current) != null && D.layout(u ? _ : M), k.current.setSize(u ? _ : M), T(!0));
3261
3264
  }
3262
3265
  }), window.React.useEffect(() => {
3263
3266
  qt && Vn(20);
3264
3267
  }, []), window.React.createElement("div", {
3265
- ref: w,
3268
+ ref: g,
3266
3269
  className: We("split-view", u ? "split-view-vertical" : "split-view-horizontal", {
3267
3270
  "split-view-separator-border": o
3268
3271
  }, gn, u ? yn : xn, {
@@ -3274,7 +3277,7 @@ const ti = window.React.forwardRef(({
3274
3277
  }, window.React.Children.toArray(t).map((M) => {
3275
3278
  if (!window.React.isValidElement(M)) return null;
3276
3279
  const _ = M.key;
3277
- return M.type.displayName === "Allotment.Pane" ? (C.current.set(_, M.props), window.React.cloneElement(M, {
3280
+ return M.type.displayName === "Allotment.Pane" ? (I.current.set(_, M.props), window.React.cloneElement(M, {
3278
3281
  key: _,
3279
3282
  ref: (D) => {
3280
3283
  const V = M.ref;
@@ -3401,10 +3404,10 @@ const kr = ({
3401
3404
  }) => {
3402
3405
  const o = U(null), c = !!e, s = U(!1), l = U(null), u = U(!0);
3403
3406
  if (u.current && i) {
3404
- const h = localStorage.getItem(`splitPaneSizes-${i}`);
3405
- if (h)
3407
+ const p = localStorage.getItem(`splitPaneSizes-${i}`);
3408
+ if (p)
3406
3409
  try {
3407
- l.current = JSON.parse(h);
3410
+ l.current = JSON.parse(p);
3408
3411
  } catch {
3409
3412
  l.current = [70, 30];
3410
3413
  }
@@ -3414,14 +3417,14 @@ const kr = ({
3414
3417
  }
3415
3418
  gi(() => {
3416
3419
  c && !s.current && o.current && l.current && requestAnimationFrame(() => {
3417
- var h;
3418
- (h = o.current) != null && h.resize && o.current.resize(l.current);
3420
+ var p;
3421
+ (p = o.current) != null && p.resize && o.current.resize(l.current);
3419
3422
  }), s.current = c;
3420
3423
  }, [c]);
3421
- const d = (h) => {
3422
- i && c && h[1] > 10 && (l.current = h, localStorage.setItem(
3424
+ const m = (p) => {
3425
+ i && c && p[1] > 10 && (l.current = p, localStorage.setItem(
3423
3426
  `splitPaneSizes-${i}`,
3424
- JSON.stringify(h)
3427
+ JSON.stringify(p)
3425
3428
  ));
3426
3429
  };
3427
3430
  let f;
@@ -3430,7 +3433,7 @@ const kr = ({
3430
3433
  {
3431
3434
  ref: o,
3432
3435
  className: n,
3433
- onChange: d,
3436
+ onChange: m,
3434
3437
  defaultSizes: f,
3435
3438
  proportionalLayout: !0
3436
3439
  },
@@ -3446,8 +3449,8 @@ const kr = ({
3446
3449
  }) => {
3447
3450
  const a = i !== void 0, [o, c] = A(e || ""), u = {
3448
3451
  activeTab: a ? i : o,
3449
- setActiveTab: (d) => {
3450
- a || c(d), n && n(d);
3452
+ setActiveTab: (m) => {
3453
+ a || c(m), n && n(m);
3451
3454
  },
3452
3455
  initialTabName: a ? i : e
3453
3456
  };
@@ -3499,151 +3502,151 @@ const kr = ({
3499
3502
  colorTokenClasses: s,
3500
3503
  suggestions: l = [],
3501
3504
  onLoadMore: u,
3502
- css: d,
3505
+ css: m,
3503
3506
  hasMore: f = !1,
3504
- isLoading: h = !1,
3507
+ isLoading: p = !1,
3505
3508
  allowCustom: v = !0,
3506
- dedupe: b = !0,
3507
- ...y
3509
+ dedupe: x = !0,
3510
+ ...b
3508
3511
  }) => {
3509
- const w = U(null), N = U(null), C = U(null), x = U(!1), [L, I] = A(""), [m, E] = A(!1), [k, T] = A(-1), [H, M] = A(!1), [_, D] = A(null), [V, P] = A(""), $ = () => {
3510
- E(!1), T(-1);
3511
- }, O = (S) => {
3512
- var g;
3513
- const R = Vt(S);
3514
- if (!R.length) return;
3515
- const p = b ? Oe([...i, ...R]) : [...i, ...R];
3516
- o == null || o(p), I(""), c == null || c(""), $(), (g = w.current) == null || g.focus();
3517
- }, K = (S) => {
3518
- const R = i.filter((p, g) => g !== S);
3519
- o == null || o(R), _ === S ? (D(null), P("")) : _ !== null && S < _ && D(_ - 1);
3520
- }, ne = (S) => {
3521
- x.current = !0, D(S), P(i[S] ?? ""), $();
3512
+ const g = U(null), z = U(null), I = U(null), y = U(!1), [L, k] = A(""), [d, S] = A(!1), [T, R] = A(-1), [O, M] = A(!1), [_, D] = A(null), [V, P] = A(""), $ = () => {
3513
+ S(!1), R(-1);
3514
+ }, H = (E) => {
3515
+ var w;
3516
+ const N = Vt(E);
3517
+ if (!N.length) return;
3518
+ const h = x ? Oe([...i, ...N]) : [...i, ...N];
3519
+ o == null || o(h), k(""), c == null || c(""), $(), (w = g.current) == null || w.focus();
3520
+ }, K = (E) => {
3521
+ const N = i.filter((h, w) => w !== E);
3522
+ o == null || o(N), _ === E ? (D(null), P("")) : _ !== null && E < _ && D(_ - 1);
3523
+ }, ne = (E) => {
3524
+ y.current = !0, D(E), P(i[E] ?? ""), $();
3522
3525
  }, F = () => {
3523
3526
  var Z;
3524
3527
  if (_ === null) return;
3525
- const S = V.trim();
3526
- if (!S) {
3528
+ const E = V.trim();
3529
+ if (!E) {
3527
3530
  K(_);
3528
3531
  return;
3529
3532
  }
3530
- const R = Vt(S), p = i.slice(0, _), g = i.slice(_ + 1);
3531
- let z = [...p, ...R, ...g];
3532
- b && (z = Oe(z)), o == null || o(z), D(null), P(""), x.current = !1, (Z = w.current) == null || Z.focus();
3533
+ const N = Vt(E), h = i.slice(0, _), w = i.slice(_ + 1);
3534
+ let C = [...h, ...N, ...w];
3535
+ x && (C = Oe(C)), o == null || o(C), D(null), P(""), y.current = !1, (Z = g.current) == null || Z.focus();
3533
3536
  }, re = () => {
3534
- var S;
3535
- D(null), P(""), x.current = !1, (S = w.current) == null || S.focus();
3536
- }, W = (S) => {
3537
+ var E;
3538
+ D(null), P(""), y.current = !1, (E = g.current) == null || E.focus();
3539
+ }, W = (E) => {
3537
3540
  M(!0);
3538
- const R = b ? Oe([...i, S]) : [...i, S];
3539
- o == null || o(R), I(""), c == null || c(""), $(), setTimeout(() => {
3540
- var p;
3541
- M(!1), (p = w.current) == null || p.focus();
3541
+ const N = x ? Oe([...i, E]) : [...i, E];
3542
+ o == null || o(N), k(""), c == null || c(""), $(), setTimeout(() => {
3543
+ var h;
3544
+ M(!1), (h = g.current) == null || h.focus();
3542
3545
  }, 0);
3543
- }, J = (S) => {
3544
- I(S), c == null || c(S), T(-1), S.length > 0 && l.length > 0 ? E(!0) : $();
3545
- }, ae = (S) => {
3546
- if (m) {
3547
- if (S.key === "ArrowDown") {
3548
- S.preventDefault(), T(
3549
- (p) => Math.min(p + 1, l.length - 1)
3546
+ }, J = (E) => {
3547
+ k(E), c == null || c(E), R(-1), E.length > 0 && l.length > 0 ? S(!0) : $();
3548
+ }, ae = (E) => {
3549
+ if (d) {
3550
+ if (E.key === "ArrowDown") {
3551
+ E.preventDefault(), R(
3552
+ (h) => Math.min(h + 1, l.length - 1)
3550
3553
  );
3551
3554
  return;
3552
3555
  }
3553
- if (S.key === "ArrowUp") {
3554
- S.preventDefault(), T((p) => Math.max(p - 1, 0));
3556
+ if (E.key === "ArrowUp") {
3557
+ E.preventDefault(), R((h) => Math.max(h - 1, 0));
3555
3558
  return;
3556
3559
  }
3557
- if (S.key === "Escape") {
3558
- S.preventDefault(), $();
3560
+ if (E.key === "Escape") {
3561
+ E.preventDefault(), $();
3559
3562
  return;
3560
3563
  }
3561
- if (S.key === "Enter" && k >= 0 && l[k]) {
3562
- S.preventDefault(), W(l[k]);
3564
+ if (E.key === "Enter" && T >= 0 && l[T]) {
3565
+ E.preventDefault(), W(l[T]);
3563
3566
  return;
3564
3567
  }
3565
3568
  }
3566
- if (S.key === "Enter" || S.key === "," || S.key === "Tab") {
3567
- if (!v && !(k >= 0 && l[k])) {
3568
- S.key === "Enter" && k >= 0 && l[k] && (S.preventDefault(), W(l[k]));
3569
+ if (E.key === "Enter" || E.key === "," || E.key === "Tab") {
3570
+ if (!v && !(T >= 0 && l[T])) {
3571
+ E.key === "Enter" && T >= 0 && l[T] && (E.preventDefault(), W(l[T]));
3569
3572
  return;
3570
3573
  }
3571
- L.trim().length > 0 ? (S.preventDefault(), O(L)) : S.key === "Enter" && (S.preventDefault(), $());
3574
+ L.trim().length > 0 ? (E.preventDefault(), H(L)) : E.key === "Enter" && (E.preventDefault(), $());
3572
3575
  return;
3573
3576
  }
3574
- if (S.key === "Backspace" && L.length === 0 && i.length > 0) {
3577
+ if (E.key === "Backspace" && L.length === 0 && i.length > 0) {
3575
3578
  K(i.length - 1);
3576
3579
  return;
3577
3580
  }
3578
- S.key === " " && L.trim().length > 0 && (S.preventDefault(), O(L));
3581
+ E.key === " " && L.trim().length > 0 && (E.preventDefault(), H(L));
3579
3582
  }, le = () => {
3580
- if (!H) {
3583
+ if (!O) {
3581
3584
  if (v && L.trim().length > 0) {
3582
- O(L);
3585
+ H(L);
3583
3586
  return;
3584
3587
  }
3585
3588
  $();
3586
3589
  }
3587
3590
  };
3588
3591
  return j(() => {
3589
- const S = C.current;
3590
- if (!S || !u || !f || h) return;
3591
- const R = () => {
3592
- const { scrollTop: p, scrollHeight: g, clientHeight: z } = S;
3593
- g - p - z < 50 && u();
3592
+ const E = I.current;
3593
+ if (!E || !u || !f || p) return;
3594
+ const N = () => {
3595
+ const { scrollTop: h, scrollHeight: w, clientHeight: C } = E;
3596
+ w - h - C < 50 && u();
3594
3597
  };
3595
- return S.addEventListener("scroll", R), () => S.removeEventListener("scroll", R);
3596
- }, [u, f, h]), j(() => {
3598
+ return E.addEventListener("scroll", N), () => E.removeEventListener("scroll", N);
3599
+ }, [u, f, p]), j(() => {
3597
3600
  if (_ !== null) {
3598
- const S = N.current;
3599
- if (!S) return;
3600
- S.focus();
3601
- const R = S.value.length;
3602
- S.setSelectionRange(R, R);
3601
+ const E = z.current;
3602
+ if (!E) return;
3603
+ E.focus();
3604
+ const N = E.value.length;
3605
+ E.setSelectionRange(N, N);
3603
3606
  }
3604
3607
  }, [_]), j(() => {
3605
- l.length === 0 && E(!1);
3606
- }, [l.length]), /* @__PURE__ */ React.createElement("div", { className: B("flex flex-col gap-2", t), ...y }, d && /* @__PURE__ */ React.createElement("style", null, d), n && /* @__PURE__ */ React.createElement("div", { className: "text-xs font-medium flex gap-1 items-center" }, /* @__PURE__ */ React.createElement(Ft, null), " ", n), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-2 flex-start" }, i.map((S, R) => {
3607
- const p = _ === R, g = s == null ? void 0 : s[S];
3608
+ l.length === 0 && S(!1);
3609
+ }, [l.length]), /* @__PURE__ */ React.createElement("div", { className: B("flex flex-col gap-2", t), ...b }, m && /* @__PURE__ */ React.createElement("style", null, m), n && /* @__PURE__ */ React.createElement("div", { className: "text-xs font-medium flex gap-1 items-center" }, /* @__PURE__ */ React.createElement(Ft, null), " ", n), /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-2 flex-start" }, i.map((E, N) => {
3610
+ const h = _ === N, w = s == null ? void 0 : s[E];
3608
3611
  return /* @__PURE__ */ React.createElement(
3609
3612
  "div",
3610
3613
  {
3611
- key: `${S}-${R}`,
3614
+ key: `${E}-${N}`,
3612
3615
  className: B(
3613
3616
  "bg-border/50 gap-1 p-1 text-xs hover:bg-border-75 ",
3614
- { "bg-white border-border/50 border": p }
3617
+ { "bg-white border-border/50 border": h }
3615
3618
  ),
3616
3619
  title: "Click to edit"
3617
3620
  },
3618
- p ? /* @__PURE__ */ React.createElement(
3621
+ h ? /* @__PURE__ */ React.createElement(
3619
3622
  "input",
3620
3623
  {
3621
- ref: N,
3624
+ ref: z,
3622
3625
  className: "bg-transparent text-sm outline-none",
3623
3626
  value: V,
3624
- onChange: (z) => P(z.target.value),
3627
+ onChange: (C) => P(C.target.value),
3625
3628
  onBlur: () => F(),
3626
- onKeyDown: (z) => {
3627
- z.key === "Enter" && (z.preventDefault(), F()), z.key === "Escape" && (z.preventDefault(), re());
3629
+ onKeyDown: (C) => {
3630
+ C.key === "Enter" && (C.preventDefault(), F()), C.key === "Escape" && (C.preventDefault(), re());
3628
3631
  }
3629
3632
  }
3630
3633
  ) : /* @__PURE__ */ React.createElement(
3631
3634
  "button",
3632
3635
  {
3633
3636
  type: "button",
3634
- onClick: () => ne(R),
3637
+ onClick: () => ne(N),
3635
3638
  onMouseDown: () => {
3636
- x.current = !0, $();
3639
+ y.current = !0, $();
3637
3640
  },
3638
3641
  className: "select-none inline-flex justify-center items-center gap-1 w-auto rounded-sm px-1 hover:bg-gray-100"
3639
3642
  },
3640
- S,
3641
- g && /* @__PURE__ */ React.createElement(
3643
+ E,
3644
+ w && /* @__PURE__ */ React.createElement(
3642
3645
  "span",
3643
3646
  {
3644
3647
  className: B(
3645
3648
  "w-3! h-3! overflow-hidden! rounded-full!",
3646
- g
3649
+ w
3647
3650
  )
3648
3651
  }
3649
3652
  )
@@ -3653,10 +3656,10 @@ const kr = ({
3653
3656
  {
3654
3657
  type: "button",
3655
3658
  className: "inline-flex items-center rounded-full px-1 cursor-pointer hover:bg-gray-100",
3656
- onMouseDown: (z) => {
3657
- z.preventDefault(), z.stopPropagation(), K(R);
3659
+ onMouseDown: (C) => {
3660
+ C.preventDefault(), C.stopPropagation(), K(N);
3658
3661
  },
3659
- "aria-label": `Remove ${S}`
3662
+ "aria-label": `Remove ${E}`
3660
3663
  },
3661
3664
  "×"
3662
3665
  )
@@ -3664,14 +3667,14 @@ const kr = ({
3664
3667
  })), /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
3665
3668
  "input",
3666
3669
  {
3667
- ref: w,
3670
+ ref: g,
3668
3671
  className: B(
3669
3672
  "w-full border px-3 py-2 text-sm outline-none",
3670
3673
  e
3671
3674
  ),
3672
3675
  value: L,
3673
3676
  placeholder: a,
3674
- onChange: (S) => J(S.target.value),
3677
+ onChange: (E) => J(E.target.value),
3675
3678
  onKeyDown: ae,
3676
3679
  onFocus: () => {
3677
3680
  },
@@ -3680,39 +3683,39 @@ const kr = ({
3680
3683
  autoComplete: "off",
3681
3684
  "aria-autocomplete": "list"
3682
3685
  }
3683
- ), m && /* @__PURE__ */ React.createElement(
3686
+ ), d && /* @__PURE__ */ React.createElement(
3684
3687
  Dt,
3685
3688
  {
3686
3689
  position: "bottom left",
3687
3690
  onClose: $,
3688
- anchor: w.current ?? void 0,
3691
+ anchor: g.current ?? void 0,
3689
3692
  focusOnMount: !1,
3690
3693
  offset: 12
3691
3694
  },
3692
3695
  /* @__PURE__ */ React.createElement(
3693
3696
  "div",
3694
3697
  {
3695
- ref: C,
3698
+ ref: I,
3696
3699
  role: "listbox",
3697
3700
  className: "max-h-60 min-w-64 overflow-y-auto p-1"
3698
3701
  },
3699
- l.map((S, R) => /* @__PURE__ */ React.createElement(
3702
+ l.map((E, N) => /* @__PURE__ */ React.createElement(
3700
3703
  Y,
3701
3704
  {
3702
- key: `${S}-${R}`,
3703
- variant: R === k ? "primary" : "tertiary",
3705
+ key: `${E}-${N}`,
3706
+ variant: N === T ? "primary" : "tertiary",
3704
3707
  className: B("block w-full text-left", {
3705
- "is-active": R === k
3708
+ "is-active": N === T
3706
3709
  }),
3707
3710
  onMouseDown: () => M(!0),
3708
- onMouseEnter: () => T(R),
3709
- onClick: () => W(S),
3711
+ onMouseEnter: () => R(N),
3712
+ onClick: () => W(E),
3710
3713
  tabIndex: -1
3711
3714
  },
3712
- /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, S)
3715
+ /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, E)
3713
3716
  )),
3714
- h && /* @__PURE__ */ React.createElement("div", { className: "flex justify-center py-3" }, /* @__PURE__ */ React.createElement(At, null)),
3715
- !h && f && l.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "text-center text-xs text-gray-500 py-2" }, "Scroll for more")
3717
+ p && /* @__PURE__ */ React.createElement("div", { className: "flex justify-center py-3" }, /* @__PURE__ */ React.createElement(At, null)),
3718
+ !p && f && l.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "text-center text-xs text-gray-500 py-2" }, "Scroll for more")
3716
3719
  )
3717
3720
  )), r && /* @__PURE__ */ React.createElement("p", { className: "text-xs text-primary" }, r));
3718
3721
  };