bonsaif-ui 0.1.134 → 0.1.135

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.
@@ -173,22 +173,22 @@ function br({
173
173
  const L = g.current;
174
174
  if (!L) return;
175
175
  const K = 12, j = 14, ne = L.getBoundingClientRect(), Z = window.innerWidth - ne.width - K, Q = window.innerHeight - ne.height - K;
176
- let W = x.mouseX + j, U = x.mouseY + j, ue, D;
176
+ let W = x.mouseX + j, U = x.mouseY + j, ue, R;
177
177
  if (!o && m.current) {
178
- const P = m.current.getBoundingClientRect(), se = P.left + P.width / 2, R = P.top + P.height / 2;
179
- i === "top" ? (W = se - ne.width / 2, U = P.top - ne.height - j, D = ne.height - 1) : i === "left" ? (W = P.left - ne.width - j, U = R - ne.height / 2, ue = ne.width - 1) : i === "right" ? (W = P.right + j, U = R - ne.height / 2, ue = -7) : (W = se - ne.width / 2, U = P.bottom + j, D = -7);
178
+ const P = m.current.getBoundingClientRect(), se = P.left + P.width / 2, D = P.top + P.height / 2;
179
+ i === "top" ? (W = se - ne.width / 2, U = P.top - ne.height - j, R = ne.height - 1) : i === "left" ? (W = P.left - ne.width - j, U = D - ne.height / 2, ue = ne.width - 1) : i === "right" ? (W = P.right + j, U = D - ne.height / 2, ue = -7) : (W = se - ne.width / 2, U = P.bottom + j, R = -7);
180
180
  }
181
181
  if (o && (W > Z && (W = x.mouseX - ne.width - j), U > Q && (U = x.mouseY - ne.height - j)), W = Math.min(Math.max(K, W), Math.max(K, Z)), U = Math.min(Math.max(K, U), Math.max(K, Q)), !o && m.current) {
182
- const P = m.current.getBoundingClientRect(), se = P.left + P.width / 2, R = P.top + P.height / 2;
183
- i === "top" || i === "bottom" ? ue = Math.min(Math.max(14, se - W), ne.width - 14) : D = Math.min(Math.max(14, R - U), ne.height - 14);
182
+ const P = m.current.getBoundingClientRect(), se = P.left + P.width / 2, D = P.top + P.height / 2;
183
+ i === "top" || i === "bottom" ? ue = Math.min(Math.max(14, se - W), ne.width - 14) : R = Math.min(Math.max(14, D - U), ne.height - 14);
184
184
  }
185
- (Math.abs(W - x.x) > 0.5 || Math.abs(U - x.y) > 0.5 || ue !== x.arrowX || D !== x.arrowY) && C(
185
+ (Math.abs(W - x.x) > 0.5 || Math.abs(U - x.y) > 0.5 || ue !== x.arrowX || R !== x.arrowY) && C(
186
186
  (P) => P && {
187
187
  ...P,
188
188
  x: W,
189
189
  y: U,
190
190
  arrowX: ue,
191
- arrowY: D
191
+ arrowY: R
192
192
  }
193
193
  );
194
194
  }, [o, i, x]);
@@ -787,7 +787,7 @@ function Ub({
787
787
  (ce) => !ce.disabled
788
788
  )) == null ? void 0 : gt.service, [Z, Q] = q(
789
789
  d ?? ne ?? ""
790
- ), [W, U] = q({}), [ue, D] = q({}), [P, se] = q(""), [R, oe] = q(!1), k = re(ue), ee = re(0), _ = v ?? P, H = Hi(_), de = S === !0 || S === "auto" && j.length >= I, te = de && _.trim().length > 0, z = _e(() => H ? j.filter(
790
+ ), [W, U] = q({}), [ue, R] = q({}), [P, se] = q(""), [D, oe] = q(!1), k = re(ue), ee = re(0), _ = v ?? P, H = Hi(_), de = S === !0 || S === "auto" && j.length >= I, te = de && _.trim().length > 0, z = _e(() => H ? j.filter(
791
791
  (ce) => Hi(qu(ce)).includes(H)
792
792
  ) : j, [H, j]), y = c ?? Z, T = j.find((ce) => ce.service === y) ?? j.find((ce) => !ce.disabled);
793
793
  le(() => {
@@ -806,13 +806,13 @@ function Ub({
806
806
  ft < 0 || ((ce.key === "ArrowRight" || ce.key === "ArrowDown") && (ce.preventDefault(), J(We[(ft + 1) % We.length])), (ce.key === "ArrowLeft" || ce.key === "ArrowUp") && (ce.preventDefault(), J(
807
807
  We[(ft - 1 + We.length) % We.length]
808
808
  )), ce.key === "Home" && (ce.preventDefault(), J(We[0])), ce.key === "End" && (ce.preventDefault(), J(We[We.length - 1])));
809
- }, ge = me(() => {
809
+ }, he = me(() => {
810
810
  if (!T) return;
811
811
  const ce = T.service, He = k.current[ce];
812
812
  if (He != null && He.loading || He != null && He.component && m) return;
813
813
  const We = (l == null ? void 0 : l[ce]) ?? s;
814
814
  if (!We) {
815
- D((Ye) => ({
815
+ R((Ye) => ({
816
816
  ...Ye,
817
817
  [ce]: {
818
818
  loading: !1,
@@ -822,25 +822,25 @@ function Ub({
822
822
  return;
823
823
  }
824
824
  const ft = ++ee.current;
825
- D((Ye) => ({
825
+ R((Ye) => ({
826
826
  ...Ye,
827
827
  [ce]: { ...Ye[ce], loading: !0, error: void 0 }
828
828
  })), We(T, o).then((Ye) => {
829
829
  if (ft !== ee.current && !m) return;
830
830
  const kt = Uu(Ye);
831
- D((lt) => ({
831
+ R((lt) => ({
832
832
  ...lt,
833
833
  [ce]: { component: kt, loading: !1 }
834
834
  }));
835
835
  }).catch((Ye) => {
836
836
  const kt = Ye instanceof Error ? Ye : new Error(String(Ye));
837
- D((lt) => ({
837
+ R((lt) => ({
838
838
  ...lt,
839
839
  [ce]: { ...lt[ce], loading: !1, error: kt }
840
840
  }));
841
841
  });
842
842
  }, [o, m, s, l, T]);
843
- le(ge, [ge]);
843
+ le(he, [he]);
844
844
  const $e = T ? W[T.service] ?? null : null, Ie = T ? ue[T.service] : void 0, Dt = Ie == null ? void 0 : Ie.component, Ht = (ce) => {
845
845
  T && U((He) => ({
846
846
  ...He,
@@ -897,8 +897,8 @@ function Ub({
897
897
  /* @__PURE__ */ r(
898
898
  "div",
899
899
  {
900
- className: `origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${R ? "w-[min(20rem,44vw)] translate-x-0 opacity-100" : "w-0 translate-x-2 opacity-0"}`,
901
- "aria-hidden": !R,
900
+ className: `origin-right overflow-hidden transition-[width,opacity,transform] duration-200 ease-out ${D ? "w-[min(20rem,44vw)] translate-x-0 opacity-100" : "w-0 translate-x-2 opacity-0"}`,
901
+ "aria-hidden": !D,
902
902
  children: /* @__PURE__ */ r(
903
903
  Mu,
904
904
  {
@@ -906,11 +906,11 @@ function Ub({
906
906
  onChange: fe,
907
907
  placeholder: N,
908
908
  className: "w-full",
909
- autoFocus: R,
909
+ autoFocus: D,
910
910
  forceExpanded: !0,
911
911
  onEscape: () => oe(!1),
912
912
  size: "sm",
913
- inputTabIndex: R ? 0 : -1
913
+ inputTabIndex: D ? 0 : -1
914
914
  }
915
915
  )
916
916
  }
@@ -919,13 +919,13 @@ function Ub({
919
919
  "button",
920
920
  {
921
921
  type: "button",
922
- "aria-label": R ? "Cerrar busqueda" : "Buscar tabs",
923
- "aria-expanded": R,
922
+ "aria-label": D ? "Cerrar busqueda" : "Buscar tabs",
923
+ "aria-expanded": D,
924
924
  onClick: () => {
925
- R && _ && fe(""), oe((ce) => !ce);
925
+ D && _ && fe(""), oe((ce) => !ce);
926
926
  },
927
- className: `inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${R || te ? "border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm" : "border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,
928
- children: /* @__PURE__ */ r("span", { className: "grid h-4 w-4 place-items-center transition-transform duration-200", children: R || te ? /* @__PURE__ */ r(tt, { className: "h-4 w-4" }) : /* @__PURE__ */ r(Tr, { className: "h-4 w-4" }) })
927
+ className: `inline-flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md border transition-all duration-200 hover:scale-[1.03] active:scale-95 ${D || te ? "border-[var(--primary)] bg-[var(--bg-input)] text-[var(--text-main)] shadow-sm" : "border-[var(--border)] text-[var(--text-muted)] hover:bg-[var(--bg-input)] hover:text-[var(--text-main)]"}`,
928
+ children: /* @__PURE__ */ r("span", { className: "grid h-4 w-4 place-items-center transition-transform duration-200", children: D || te ? /* @__PURE__ */ r(tt, { className: "h-4 w-4" }) : /* @__PURE__ */ r(Tr, { className: "h-4 w-4" }) })
929
929
  }
930
930
  )
931
931
  ] })
@@ -964,7 +964,7 @@ function Ub({
964
964
  /* @__PURE__ */ u("div", { className: "min-h-[420px] p-4", children: [
965
965
  !T && (E ?? /* @__PURE__ */ r("div", { className: "flex min-h-[220px] items-center justify-center rounded-lg border border-dashed border-[var(--border)] text-sm text-[var(--text-muted)]", children: "No hay modulos disponibles." })),
966
966
  T && (Ie == null ? void 0 : Ie.loading) && (x ?? /* @__PURE__ */ r(zu, { title: "Cargando modulo..." })),
967
- T && (Ie == null ? void 0 : Ie.error) && C(Ie.error, ge),
967
+ T && (Ie == null ? void 0 : Ie.error) && C(Ie.error, he),
968
968
  T && Dt && !(Ie != null && Ie.loading) && !(Ie != null && Ie.error) && /* @__PURE__ */ r(
969
969
  Dt,
970
970
  {
@@ -1113,10 +1113,10 @@ function Yb({
1113
1113
  }), [h, E] = q(s.year), [x, C] = q(s.month), [A, S] = q("days"), I = 16, [N, v] = q(0), $ = h - 7 + N, w = Array.from({ length: I }, (Q, W) => $ + W);
1114
1114
  le(() => {
1115
1115
  if (!c || !d || !f.current) return;
1116
- const Q = f.current.getBoundingClientRect(), W = 8, U = 280, ue = 340, D = Q.left + U > window.innerWidth - W, P = Q.right - U >= W, se = Q.bottom + 8 + ue > window.innerHeight - W, R = Q.top - 8 - ue >= W;
1116
+ const Q = f.current.getBoundingClientRect(), W = 8, U = 280, ue = 340, R = Q.left + U > window.innerWidth - W, P = Q.right - U >= W, se = Q.bottom + 8 + ue > window.innerHeight - W, D = Q.top - 8 - ue >= W;
1117
1117
  g({
1118
- horizontal: D && P ? "right" : "left",
1119
- vertical: se && R ? "top" : "bottom"
1118
+ horizontal: R && P ? "right" : "left",
1119
+ vertical: se && D ? "top" : "bottom"
1120
1120
  });
1121
1121
  }, [c, d]), le(() => {
1122
1122
  if (!c || !d) return;
@@ -1261,11 +1261,11 @@ function Yb({
1261
1261
  },
1262
1262
  W
1263
1263
  );
1264
- const U = Do(h, x, Q), ue = U === e, D = U === i, P = !!(n && U < n);
1264
+ const U = Do(h, x, Q), ue = U === e, R = U === i, P = !!(n && U < n);
1265
1265
  return /* @__PURE__ */ r(
1266
1266
  "div",
1267
1267
  {
1268
- className: `bonsaif-multi-day${ue ? " bonsaif-multi-day-selected" : ""}${D ? " bonsaif-multi-day-today" : ""}${P ? " bonsaif-multi-day-disabled" : ""}`,
1268
+ className: `bonsaif-multi-day${ue ? " bonsaif-multi-day-selected" : ""}${R ? " bonsaif-multi-day-today" : ""}${P ? " bonsaif-multi-day-disabled" : ""}`,
1269
1269
  children: /* @__PURE__ */ r(
1270
1270
  "button",
1271
1271
  {
@@ -1631,7 +1631,7 @@ function Xr({
1631
1631
  const _ = j.current.children[N];
1632
1632
  _ == null || _.scrollIntoView({ block: "nearest" });
1633
1633
  }, [N]);
1634
- const D = me(
1634
+ const R = me(
1635
1635
  (_) => {
1636
1636
  t(_), A(!1), I("");
1637
1637
  },
@@ -1640,12 +1640,12 @@ function Xr({
1640
1640
  P.current = C;
1641
1641
  const se = re(U);
1642
1642
  se.current = U;
1643
- const R = re(N);
1644
- R.current = N;
1643
+ const D = re(N);
1644
+ D.current = N;
1645
1645
  const oe = re(c);
1646
1646
  oe.current = c;
1647
- const k = re(D);
1648
- k.current = D, le(() => {
1647
+ const k = re(R);
1648
+ k.current = R, le(() => {
1649
1649
  function _(H) {
1650
1650
  var y, T;
1651
1651
  const de = document.activeElement, te = ((y = Y.current) == null ? void 0 : y.contains(de)) ?? !1, z = ((T = L.current) == null ? void 0 : T.contains(de)) ?? !1;
@@ -1663,7 +1663,7 @@ function Xr({
1663
1663
  break;
1664
1664
  case "Enter": {
1665
1665
  H.preventDefault();
1666
- const J = R.current, fe = se.current;
1666
+ const J = D.current, fe = se.current;
1667
1667
  J === -1 && oe.current ? k.current("") : fe[J] && !fe[J].disabled && k.current(fe[J].value);
1668
1668
  break;
1669
1669
  }
@@ -1751,7 +1751,7 @@ function Xr({
1751
1751
  role: "option",
1752
1752
  "aria-selected": e === "",
1753
1753
  onMouseDown: (_) => {
1754
- _.preventDefault(), D("");
1754
+ _.preventDefault(), R("");
1755
1755
  },
1756
1756
  onMouseEnter: () => v(-1),
1757
1757
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
@@ -1771,7 +1771,7 @@ function Xr({
1771
1771
  role: "option",
1772
1772
  "aria-selected": z,
1773
1773
  onMouseDown: (y) => {
1774
- y.preventDefault(), _.disabled || D(_.value);
1774
+ y.preventDefault(), _.disabled || R(_.value);
1775
1775
  },
1776
1776
  onMouseEnter: () => !_.disabled && v(H),
1777
1777
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
@@ -1878,7 +1878,7 @@ function Xr({
1878
1878
  role: "button",
1879
1879
  tabIndex: -1,
1880
1880
  onMouseDown: (_) => {
1881
- _.preventDefault(), _.stopPropagation(), D("");
1881
+ _.preventDefault(), _.stopPropagation(), R("");
1882
1882
  },
1883
1883
  className: "flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",
1884
1884
  style: { color: "var(--text-muted)" },
@@ -2702,10 +2702,10 @@ function Ed({
2702
2702
  bottomOffset: W = 0,
2703
2703
  compact: U = !0,
2704
2704
  restrictHeight: ue = !0,
2705
- maxHeight: D,
2705
+ maxHeight: R,
2706
2706
  minTableWidth: P,
2707
2707
  enableColumnVisibility: se = !0,
2708
- enableColumnFilters: R = !0,
2708
+ enableColumnFilters: D = !0,
2709
2709
  hiddenColumnKeys: oe,
2710
2710
  defaultHiddenColumnKeys: k = hd,
2711
2711
  onHiddenColumnKeysChange: ee,
@@ -2720,7 +2720,7 @@ rol IN (admin, employee)`,
2720
2720
  bqlQuickFilters: J = [],
2721
2721
  bqlExamples: fe = [],
2722
2722
  bqlSuggestions: ie = [],
2723
- bqlActiveFilters: ge,
2723
+ bqlActiveFilters: he,
2724
2724
  bqlError: $e,
2725
2725
  onQueryChange: Ie,
2726
2726
  persistState: Dt,
@@ -2735,7 +2735,7 @@ rol IN (admin, employee)`,
2735
2735
  Ye.current = e, kt.current = k;
2736
2736
  const [lt, st] = q(
2737
2737
  !Z || !He
2738
- ), Kt = re(null), pe = re(!Z), xe = re(!1), Ae = re(Ht);
2738
+ ), Kt = re(null), pe = re(!Z), ge = re(!1), Ae = re(Ht);
2739
2739
  Ae.current = Ht;
2740
2740
  const Fe = re(
2741
2741
  !Z || !He ? Z ?? "__none__" : null
@@ -2744,7 +2744,7 @@ rol IN (admin, employee)`,
2744
2744
  e
2745
2745
  ), [qe, ut] = q(!1), [pt, pr] = q("filter"), [dt, Be] = q(
2746
2746
  null
2747
- ), [en, Ln] = q(""), [ht, Et] = q({}), [St, rr] = q({}), Mr = f !== void 0, [B, X] = q(m), be = de !== void 0, [he, Ce] = q(te), ye = be ? de : he, [Re, Le] = q(ye), [Ke, Xe] = q(!1), [nr, xt] = q(!1), [Xt, Rt] = q(!1), [ar, Gt] = q([]), Ar = re(null), hr = re(null), jt = re(z);
2747
+ ), [en, Ln] = q(""), [ht, Et] = q({}), [St, rr] = q({}), Mr = f !== void 0, [B, X] = q(m), be = de !== void 0, [xe, Se] = q(te), ye = be ? de : xe, [Re, Le] = q(ye), [Ke, Xe] = q(!1), [nr, xt] = q(!1), [Xt, Rt] = q(!1), [ar, Gt] = q([]), Ar = re(null), hr = re(null), jt = re(z);
2748
2748
  jt.current = z;
2749
2749
  const Dn = re($);
2750
2750
  Dn.current = $;
@@ -2765,7 +2765,7 @@ rol IN (admin, employee)`,
2765
2765
  function p() {
2766
2766
  rc(window.innerWidth < 640);
2767
2767
  }
2768
- if (!ue || D !== void 0)
2768
+ if (!ue || R !== void 0)
2769
2769
  return p(), window.addEventListener("resize", p), () => window.removeEventListener("resize", p);
2770
2770
  const G = $ !== !1 ? 48 : 0, O = 12;
2771
2771
  function ae() {
@@ -2779,8 +2779,8 @@ rol IN (admin, employee)`,
2779
2779
  );
2780
2780
  }
2781
2781
  return ae(), window.addEventListener("resize", ae), () => window.removeEventListener("resize", ae);
2782
- }, [a, $, W, ue, D]);
2783
- const ui = ue ? D ?? Qs : void 0;
2782
+ }, [a, $, W, ue, R]);
2783
+ const ui = ue ? R ?? Qs : void 0;
2784
2784
  le(() => {
2785
2785
  const p = or.current;
2786
2786
  if (!p) return;
@@ -2816,7 +2816,7 @@ rol IN (admin, employee)`,
2816
2816
  var Me;
2817
2817
  const p = Ye.current, M = kt.current, G = p.map((Ee) => Ee.key), O = new Set(G), ae = () => {
2818
2818
  var Ee;
2819
- xe.current || (xe.current = !0, (Ee = Ae.current) == null || Ee.call(Ae));
2819
+ ge.current || (ge.current = !0, (Ee = Ae.current) == null || Ee.call(Ae));
2820
2820
  };
2821
2821
  if (!Z || !He) {
2822
2822
  ce.layout && Dr(sr(G, p)), De || ct(
@@ -2828,10 +2828,10 @@ rol IN (admin, employee)`,
2828
2828
  return;
2829
2829
  }
2830
2830
  let ve = !1;
2831
- const Se = Fe.current === Z;
2832
- Se || (pe.current = !1, st(!1), xe.current = !1);
2831
+ const Ce = Fe.current === Z;
2832
+ Ce || (pe.current = !1, st(!1), ge.current = !1);
2833
2833
  const Te = ra(Z);
2834
- if (Vi(Te) && !Se) {
2834
+ if (Vi(Te) && !Ce) {
2835
2835
  const Ee = Te, Ne = hn(
2836
2836
  Rn.current ?? pn()
2837
2837
  ), ke = Dn.current, wr = ke === !1 ? 0 : ke, lr = ce.layout ? Ee == null ? void 0 : Ee.columnOrder : void 0, Nr = Array.isArray(lr) ? lr.filter((Ue) => G.includes(Ue)) : [], kr = sr(
@@ -2866,7 +2866,7 @@ rol IN (admin, employee)`,
2866
2866
  if (Ar.current !== Z) {
2867
2867
  Ar.current = Z;
2868
2868
  const Ue = typeof (Ee == null ? void 0 : Ee.bql) == "string" ? Ee.bql : te;
2869
- be ? (Me = jt.current) == null || Me.call(jt, Ue) : Ce(Ue);
2869
+ be ? (Me = jt.current) == null || Me.call(jt, Ue) : Se(Ue);
2870
2870
  }
2871
2871
  Gt(
2872
2872
  Array.isArray(Ee == null ? void 0 : Ee.bqlHistory) ? Ee.bqlHistory.filter(
@@ -2929,7 +2929,7 @@ rol IN (admin, employee)`,
2929
2929
  if (Ar.current !== Z) {
2930
2930
  Ar.current = Z;
2931
2931
  const rt = typeof (ke == null ? void 0 : ke.bql) == "string" ? ke.bql : te;
2932
- be ? (Oi = jt.current) == null || Oi.call(jt, rt) : Ce(rt);
2932
+ be ? (Oi = jt.current) == null || Oi.call(jt, rt) : Se(rt);
2933
2933
  }
2934
2934
  Gt(
2935
2935
  Array.isArray(ke == null ? void 0 : ke.bqlHistory) ? ke.bqlHistory.filter(
@@ -2997,7 +2997,7 @@ rol IN (admin, employee)`,
2997
2997
  if (Ar.current !== Z) {
2998
2998
  Ar.current = Z;
2999
2999
  const Ze = typeof (Ne == null ? void 0 : Ne.bql) == "string" ? Ne.bql : te;
3000
- be ? (Ee = jt.current) == null || Ee.call(jt, Ze) : Ce(Ze);
3000
+ be ? (Ee = jt.current) == null || Ee.call(jt, Ze) : Se(Ze);
3001
3001
  }
3002
3002
  Gt(
3003
3003
  Array.isArray(Ne == null ? void 0 : Ne.bqlHistory) ? Ne.bqlHistory.filter(
@@ -3108,7 +3108,7 @@ rol IN (admin, employee)`,
3108
3108
  return p ? fi(p) : [];
3109
3109
  }
3110
3110
  function lc(p) {
3111
- return !!(R && !Cr(p) && (p.filterValue || p.sortKey || fi(p).length > 0));
3111
+ return !!(D && !Cr(p) && (p.filterValue || p.sortKey || fi(p).length > 0));
3112
3112
  }
3113
3113
  function bi(p, M) {
3114
3114
  Et((G) => {
@@ -3117,8 +3117,8 @@ rol IN (admin, employee)`,
3117
3117
  });
3118
3118
  }
3119
3119
  function sc(p, M, G, O) {
3120
- const ae = ht[p] ?? [], ve = O ? ae : G.filter((Te) => Te !== M), Se = O ? ae.includes(M) ? ae.filter((Te) => Te !== M) : [...ae, M] : ve;
3121
- Se.length === G.length ? Ua(p) : bi(p, Se);
3120
+ const ae = ht[p] ?? [], ve = O ? ae : G.filter((Te) => Te !== M), Ce = O ? ae.includes(M) ? ae.filter((Te) => Te !== M) : [...ae, M] : ve;
3121
+ Ce.length === G.length ? Ua(p) : bi(p, Ce);
3122
3122
  }
3123
3123
  function Ua(p) {
3124
3124
  Et((M) => {
@@ -3139,11 +3139,11 @@ rol IN (admin, employee)`,
3139
3139
  Et({}), rr({});
3140
3140
  }
3141
3141
  function uc(p) {
3142
- be || Ce(p), z == null || z(p);
3142
+ be || Se(p), z == null || z(p);
3143
3143
  }
3144
3144
  function hi(p) {
3145
3145
  const M = p.trim();
3146
- Le(M), (z == null ? void 0 : z(M)) !== !1 && (be || Ce(M), Xe(!1), xt(!1), Rt(!1), M && Gt(
3146
+ Le(M), (z == null ? void 0 : z(M)) !== !1 && (be || Se(M), Xe(!1), xt(!1), Rt(!1), M && Gt(
3147
3147
  (O) => [M, ...O.filter((ae) => ae !== M)].slice(
3148
3148
  0,
3149
3149
  md
@@ -3180,14 +3180,14 @@ ${M}`;
3180
3180
  const M = p.getBoundingClientRect(), G = 12, O = 8, ae = Math.min(780, Math.max(320, window.innerWidth - 32)), ve = Math.max(
3181
3181
  G,
3182
3182
  window.innerWidth - ae - G
3183
- ), Se = Math.min(Math.max(G, M.left), ve), Te = M.bottom + O, je = window.innerHeight - M.top + O, Ve = window.innerHeight - Te - G, vt = M.top - G - O, Je = Ve < 280 && vt > Ve, we = Math.max(
3183
+ ), Ce = Math.min(Math.max(G, M.left), ve), Te = M.bottom + O, je = window.innerHeight - M.top + O, Ve = window.innerHeight - Te - G, vt = M.top - G - O, Je = Ve < 280 && vt > Ve, we = Math.max(
3184
3184
  240,
3185
3185
  Je ? vt : Ve
3186
3186
  );
3187
3187
  Ys({
3188
3188
  position: "fixed",
3189
3189
  zIndex: 1e4,
3190
- left: Se,
3190
+ left: Ce,
3191
3191
  top: Je ? void 0 : Te,
3192
3192
  bottom: Je ? je : void 0,
3193
3193
  width: ae,
@@ -3199,10 +3199,10 @@ ${M}`;
3199
3199
  le(() => {
3200
3200
  if (!Ke) return;
3201
3201
  function p(O) {
3202
- var ve, Se;
3202
+ var ve, Ce;
3203
3203
  if (Date.now() < oi.current) return;
3204
3204
  const ae = O.target;
3205
- (ve = Ha.current) != null && ve.contains(ae) || (Se = ai.current) != null && Se.contains(ae) || (Xe(!1), xt(!1), Rt(!1));
3205
+ (ve = Ha.current) != null && ve.contains(ae) || (Ce = ai.current) != null && Ce.contains(ae) || (Xe(!1), xt(!1), Rt(!1));
3206
3206
  }
3207
3207
  function M(O) {
3208
3208
  O.key === "Escape" && (Xe(!1), xt(!1), Rt(!1));
@@ -3229,9 +3229,9 @@ ${M}`;
3229
3229
  const Ya = at.useCallback(
3230
3230
  (p = Bn.current) => {
3231
3231
  if (!p) return;
3232
- const M = p.getBoundingClientRect(), G = Math.min(292, Math.max(240, window.innerWidth - 16)), O = Math.max(8, window.innerWidth - G - 8), ae = Math.min(Math.max(8, M.right - G), O), ve = window.innerHeight - M.bottom, Se = M.bottom + 6, Te = window.innerHeight - M.top + 6, Ve = ve < 360 && M.top > ve ? void 0 : Se, vt = Ve === void 0 ? Te : void 0, Je = Math.max(
3232
+ const M = p.getBoundingClientRect(), G = Math.min(292, Math.max(240, window.innerWidth - 16)), O = Math.max(8, window.innerWidth - G - 8), ae = Math.min(Math.max(8, M.right - G), O), ve = window.innerHeight - M.bottom, Ce = M.bottom + 6, Te = window.innerHeight - M.top + 6, Ve = ve < 360 && M.top > ve ? void 0 : Ce, vt = Ve === void 0 ? Te : void 0, Je = Math.max(
3233
3233
  220,
3234
- Ve === void 0 ? M.top - 16 : window.innerHeight - Se - 8
3234
+ Ve === void 0 ? M.top - 16 : window.innerHeight - Ce - 8
3235
3235
  ), we = {
3236
3236
  position: "fixed",
3237
3237
  zIndex: 9999,
@@ -3263,9 +3263,9 @@ ${M}`;
3263
3263
  const O = Array.from(
3264
3264
  M.querySelectorAll("[data-dt-column-key]")
3265
3265
  ).filter((ae) => ae.dataset.dtColumnKey === p.key).reduce((ae, ve) => {
3266
- const Se = ve.querySelector(
3266
+ const Ce = ve.querySelector(
3267
3267
  "[data-dt-autofit-content]"
3268
- ), Te = Se ? Se.scrollWidth : Math.max(ve.scrollWidth, ve.offsetWidth);
3268
+ ), Te = Ce ? Ce.scrollWidth : Math.max(ve.scrollWidth, ve.offsetWidth);
3269
3269
  return Math.max(
3270
3270
  ae,
3271
3271
  Math.ceil(Te + yd(ve))
@@ -3294,9 +3294,9 @@ ${M}`;
3294
3294
  );
3295
3295
  }, [We, e, De]), le(() => {
3296
3296
  function p(O) {
3297
- var Se, Te;
3297
+ var Ce, Te;
3298
3298
  const ae = O.target, ve = O.target;
3299
- ve != null && ve.closest("[data-bonsaif-select-dropdown='true']") || !((Se = ii.current) != null && Se.contains(ae)) && !((Te = Bn.current) != null && Te.contains(ae)) && (ut(!1), Be(null));
3299
+ ve != null && ve.closest("[data-bonsaif-select-dropdown='true']") || !((Ce = ii.current) != null && Ce.contains(ae)) && !((Te = Bn.current) != null && Te.contains(ae)) && (ut(!1), Be(null));
3300
3300
  }
3301
3301
  function M(O) {
3302
3302
  O.key === "Escape" && (ut(!1), Be(null));
@@ -3313,9 +3313,9 @@ ${M}`;
3313
3313
  function p(G) {
3314
3314
  const O = rn.current;
3315
3315
  if (!O) return;
3316
- const ae = G.clientX - O.startX, ve = e.find((Se) => Se.key === O.colKey);
3317
- ve && Rr((Se) => ({
3318
- ...Se,
3316
+ const ae = G.clientX - O.startX, ve = e.find((Ce) => Ce.key === O.colKey);
3317
+ ve && Rr((Ce) => ({
3318
+ ...Ce,
3319
3319
  [O.colKey]: Tt(ve, O.startWidth + ae)
3320
3320
  }));
3321
3321
  }
@@ -3344,8 +3344,8 @@ ${M}`;
3344
3344
  M.preventDefault();
3345
3345
  const G = nn.current, O = Lr.indexOf(p);
3346
3346
  G !== null && G !== O && Dr((ae) => {
3347
- const ve = [...ae], [Se] = ve.splice(G, 1);
3348
- return ve.splice(O, 0, Se), sr(ve, e);
3347
+ const ve = [...ae], [Ce] = ve.splice(G, 1);
3348
+ return ve.splice(O, 0, Ce), sr(ve, e);
3349
3349
  }), nn.current = null, Ka(null);
3350
3350
  }
3351
3351
  function gc() {
@@ -3386,18 +3386,18 @@ ${M}`;
3386
3386
  const p = Object.entries(ht), M = Object.entries(St);
3387
3387
  return p.length === 0 && M.length === 0 ? t : t.filter(
3388
3388
  (G) => p.every(([O, ae]) => {
3389
- const ve = e.find((Se) => Se.key === O);
3389
+ const ve = e.find((Ce) => Ce.key === O);
3390
3390
  return ve ? ae.includes(aa(ve, G)) : !0;
3391
3391
  }) && M.every(([O, ae]) => {
3392
3392
  const ve = e.find((Te) => Te.key === O);
3393
3393
  if (!ve) return !0;
3394
- const Se = t.map(
3394
+ const Ce = t.map(
3395
3395
  (Te) => aa(ve, Te)
3396
3396
  );
3397
3397
  return kd(
3398
3398
  aa(ve, G),
3399
3399
  ae,
3400
- Se
3400
+ Ce
3401
3401
  );
3402
3402
  })
3403
3403
  );
@@ -3512,7 +3512,7 @@ ${M}`;
3512
3512
  }
3513
3513
  ),
3514
3514
  Ct.map((p, M) => {
3515
- const G = (Ge == null ? void 0 : Ge.key) === p.key, O = !!p.sortKey, ae = Cr(p), ve = Wn[p.key], Se = ve !== void 0, Te = p.key === Ja, je = Ki(p), Ve = yi === M, Je = (gr[p.key] ?? Qt(p.width)) < 120, we = Object.prototype.hasOwnProperty.call(ht, p.key) || Object.prototype.hasOwnProperty.call(St, p.key);
3515
+ const G = (Ge == null ? void 0 : Ge.key) === p.key, O = !!p.sortKey, ae = Cr(p), ve = Wn[p.key], Ce = ve !== void 0, Te = p.key === Ja, je = Ki(p), Ve = yi === M, Je = (gr[p.key] ?? Qt(p.width)) < 120, we = Object.prototype.hasOwnProperty.call(ht, p.key) || Object.prototype.hasOwnProperty.call(St, p.key);
3516
3516
  return /* @__PURE__ */ u(
3517
3517
  "div",
3518
3518
  {
@@ -3520,7 +3520,7 @@ ${M}`;
3520
3520
  "data-dt-column-key": p.key,
3521
3521
  className: `group select-none ${Je ? "text-left" : Ci(p.align)}`,
3522
3522
  style: {
3523
- ...Se ? {
3523
+ ...Ce ? {
3524
3524
  position: "sticky",
3525
3525
  left: ve,
3526
3526
  zIndex: 12,
@@ -3599,7 +3599,7 @@ ${M}`;
3599
3599
  children: G ? Ge.dir === "asc" ? /* @__PURE__ */ r(vn, { className: "h-3 w-3" }) : /* @__PURE__ */ r(wt, { className: "h-3 w-3" }) : /* @__PURE__ */ r(Fc, { className: "h-3 w-3" })
3600
3600
  }
3601
3601
  ),
3602
- R && !ae && lc(p) && /* @__PURE__ */ r(
3602
+ D && !ae && lc(p) && /* @__PURE__ */ r(
3603
3603
  "button",
3604
3604
  {
3605
3605
  type: "button",
@@ -3687,13 +3687,13 @@ ${M}`;
3687
3687
  ]
3688
3688
  }
3689
3689
  ), Kn = () => {
3690
- if (!qe || typeof document > "u" || pt === "visibility" && !se || pt === "filter" && !R) return null;
3690
+ if (!qe || typeof document > "u" || pt === "visibility" && !se || pt === "filter" && !D) return null;
3691
3691
  const p = e.find(
3692
3692
  (we) => we.key === dt
3693
3693
  ), M = ic(), G = p ? Object.prototype.hasOwnProperty.call(ht, p.key) : !1, O = p ? St[p.key] : void 0, ae = Ra.find(
3694
3694
  (we) => we.value === (O == null ? void 0 : O.operator)
3695
- ), ve = p ? ht[p.key] ?? [] : [], Se = en.trim().toLowerCase(), Te = Se ? M.filter(
3696
- (we) => we.label.toLowerCase().includes(Se)
3695
+ ), ve = p ? ht[p.key] ?? [] : [], Ce = en.trim().toLowerCase(), Te = Ce ? M.filter(
3696
+ (we) => we.label.toLowerCase().includes(Ce)
3697
3697
  ) : M, je = p && M.length > 0 && (!G || ve.length === M.length), Ve = p && G && ve.length > 0 && ve.length < M.length, vt = ze.length, Je = () => {
3698
3698
  p && (Ua(p.key), pi(p.key));
3699
3699
  };
@@ -4023,8 +4023,8 @@ ${M}`;
4023
4023
  `), ae = `${G}
4024
4024
  ${O}`, ve = new Blob(["\uFEFF" + ae], {
4025
4025
  type: "text/csv;charset=utf-8;"
4026
- }), Se = URL.createObjectURL(ve), Te = document.createElement("a");
4027
- Te.href = Se, Te.download = `${zt}.csv`, document.body.appendChild(Te), Te.click(), document.body.removeChild(Te), URL.revokeObjectURL(Se);
4026
+ }), Ce = URL.createObjectURL(ve), Te = document.createElement("a");
4027
+ Te.href = Ce, Te.download = `${zt}.csv`, document.body.appendChild(Te), Te.click(), document.body.removeChild(Te), URL.revokeObjectURL(Ce);
4028
4028
  }
4029
4029
  function $c() {
4030
4030
  const p = Ct.filter((Te) => !Cr(Te)), M = Di(), G = p.map(
@@ -4050,8 +4050,8 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4050
4050
  <table><thead><tr>${G.map((Te) => `<th>${Te}</th>`).join("")}</tr></thead>
4051
4051
  <tbody>${ae}</tbody></table>
4052
4052
  <script>window.onload=()=>{window.print()}<\/script>
4053
- </body></html>`, Se = window.open("", "_blank");
4054
- Se && (Se.document.write(ve), Se.document.close());
4053
+ </body></html>`, Ce = window.open("", "_blank");
4054
+ Ce && (Ce.document.write(ve), Ce.document.close());
4055
4055
  }
4056
4056
  const Gn = () => !nt || !tn ? null : Nt(
4057
4057
  /* @__PURE__ */ u(
@@ -4106,11 +4106,11 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4106
4106
  ),
4107
4107
  document.body
4108
4108
  ), Zn = () => {
4109
- const p = H && ye.trim().length > 0, M = ge != null && ge.length ? ge : p ? [{ key: "bql", label: "BQL", value: ye }] : [], G = ie.filter((O) => {
4109
+ const p = H && ye.trim().length > 0, M = he != null && he.length ? he : p ? [{ key: "bql", label: "BQL", value: ye }] : [], G = ie.filter((O) => {
4110
4110
  const ae = O.trim();
4111
4111
  return ae ? !new Set(
4112
4112
  Re.split(`
4113
- `).map((Se) => Se.trim()).filter(Boolean)
4113
+ `).map((Ce) => Ce.trim()).filter(Boolean)
4114
4114
  ).has(ae) : !1;
4115
4115
  }).slice(0, 8);
4116
4116
  return !se && qa === 0 && !H && !nt ? null : /* @__PURE__ */ u(
@@ -4764,7 +4764,7 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4764
4764
  "select-cell"
4765
4765
  ),
4766
4766
  Ct.map((G, O) => {
4767
- const ae = Wn[G.key], ve = ae !== void 0, Se = G.key === Ja;
4767
+ const ae = Wn[G.key], ve = ae !== void 0, Ce = G.key === Ja;
4768
4768
  return /* @__PURE__ */ r(
4769
4769
  "div",
4770
4770
  {
@@ -4778,7 +4778,7 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4778
4778
  background: "color-mix(in srgb, var(--bg-card) 72%, transparent)",
4779
4779
  backdropFilter: "blur(10px)",
4780
4780
  WebkitBackdropFilter: "blur(10px)",
4781
- boxShadow: Se ? `3px 0 6px -2px rgba(0,0,0,0.10), inset 0 -1px 0 ${Oe}` : `inset 0 -1px 0 ${Oe}`,
4781
+ boxShadow: Ce ? `3px 0 6px -2px rgba(0,0,0,0.10), inset 0 -1px 0 ${Oe}` : `inset 0 -1px 0 ${Oe}`,
4782
4782
  borderRight: `1px solid ${Oe}`
4783
4783
  } : {
4784
4784
  borderBottom: `1px solid ${Oe}`,
@@ -4926,7 +4926,7 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4926
4926
  /* @__PURE__ */ r("div", { role: "rowgroup", children: Ei.map((p, M) => {
4927
4927
  const G = n(p), O = Mi(N == null ? void 0 : N(p)), ae = M > 0 ? Mi(
4928
4928
  N == null ? void 0 : N(Ei[M - 1])
4929
- ) : null, ve = O && O.key !== (ae == null ? void 0 : ae.key), Se = It && E.has(G), Te = It && (!A || A(p)), je = Ir ? (b == null ? void 0 : b(p)) ?? !0 : !1, Ve = je && Ni.has(G), vt = !!c || h && je, Je = Se && S ? "color-mix(in srgb, var(--primary) 8%, var(--bg-card))" : M % 2 === 1 ? "color-mix(in srgb, var(--bg-input) 30%, var(--bg-card))" : "var(--bg-card)";
4929
+ ) : null, ve = O && O.key !== (ae == null ? void 0 : ae.key), Ce = It && E.has(G), Te = It && (!A || A(p)), je = Ir ? (b == null ? void 0 : b(p)) ?? !0 : !1, Ve = je && Ni.has(G), vt = !!c || h && je, Je = Ce && S ? "color-mix(in srgb, var(--primary) 8%, var(--bg-card))" : M % 2 === 1 ? "color-mix(in srgb, var(--bg-input) 30%, var(--bg-card))" : "var(--bg-card)";
4930
4930
  return /* @__PURE__ */ u(at.Fragment, { children: [
4931
4931
  ve && /* @__PURE__ */ r(
4932
4932
  "div",
@@ -4978,7 +4978,7 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
4978
4978
  borderBottom: `1px solid ${Oe}`
4979
4979
  },
4980
4980
  onMouseEnter: (we) => {
4981
- Se || (we.currentTarget.style.setProperty(
4981
+ Ce || (we.currentTarget.style.setProperty(
4982
4982
  "--dt-row-bg",
4983
4983
  "var(--bg-hover)"
4984
4984
  ), we.currentTarget.style.setProperty(
@@ -5040,7 +5040,7 @@ ${O}`, ve = new Blob(["\uFEFF" + ae], {
5040
5040
  Ro,
5041
5041
  {
5042
5042
  size: "sm",
5043
- checked: Se,
5043
+ checked: Ce,
5044
5044
  disabled: !Te,
5045
5045
  "aria-label": Te ? "Seleccionar fila" : "Fila no seleccionable",
5046
5046
  containerClassName: "items-center",
@@ -5260,43 +5260,43 @@ function np({
5260
5260
  ), $ = re(/* @__PURE__ */ new Set()), w = re(null);
5261
5261
  le(() => {
5262
5262
  var P;
5263
- const D = document.activeElement;
5264
- (!D || D === document.body) && ((P = w.current) == null || P.focus({ preventScroll: !0 }));
5263
+ const R = document.activeElement;
5264
+ (!R || R === document.body) && ((P = w.current) == null || P.focus({ preventScroll: !0 }));
5265
5265
  }, []);
5266
- const F = e.map((D) => {
5267
- var P, se, R;
5268
- return `${D.key}:${((R = (se = (P = D.editable) == null ? void 0 : P.select) == null ? void 0 : se.options) == null ? void 0 : R.length) ?? -1}`;
5266
+ const F = e.map((R) => {
5267
+ var P, se, D;
5268
+ return `${R.key}:${((D = (se = (P = R.editable) == null ? void 0 : P.select) == null ? void 0 : se.options) == null ? void 0 : D.length) ?? -1}`;
5269
5269
  }).join("|");
5270
5270
  le(() => {
5271
- e.forEach((D) => {
5272
- var R, oe;
5273
- const P = (oe = (R = D.editable) == null ? void 0 : R.select) == null ? void 0 : oe.options;
5271
+ e.forEach((R) => {
5272
+ var D, oe;
5273
+ const P = (oe = (D = R.editable) == null ? void 0 : D.select) == null ? void 0 : oe.options;
5274
5274
  if (!P) return;
5275
- const se = S[D.key];
5276
- (!$.current.has(D.key) || (se == null ? void 0 : se.length) === 0 && P.length > 0) && ($.current.add(D.key), I((k) => ({ ...k, [D.key]: P })));
5275
+ const se = S[R.key];
5276
+ (!$.current.has(R.key) || (se == null ? void 0 : se.length) === 0 && P.length > 0) && ($.current.add(R.key), I((k) => ({ ...k, [R.key]: P })));
5277
5277
  });
5278
5278
  }, [F]);
5279
5279
  const V = me(
5280
- async (D, P) => {
5281
- if ($.current.has(D)) return;
5282
- $.current.add(D);
5283
- const { url: se, fetchOptions: R } = P.select ?? {};
5284
- if (!(!se && !R)) {
5285
- v((oe) => ({ ...oe, [D]: !0 }));
5280
+ async (R, P) => {
5281
+ if ($.current.has(R)) return;
5282
+ $.current.add(R);
5283
+ const { url: se, fetchOptions: D } = P.select ?? {};
5284
+ if (!(!se && !D)) {
5285
+ v((oe) => ({ ...oe, [R]: !0 }));
5286
5286
  try {
5287
5287
  let oe = [];
5288
- if (R)
5289
- oe = await R();
5288
+ if (D)
5289
+ oe = await D();
5290
5290
  else if (se) {
5291
5291
  const k = await fetch(se);
5292
5292
  if (!k.ok) throw new Error("fetch failed");
5293
5293
  oe = await k.json();
5294
5294
  }
5295
- I((k) => ({ ...k, [D]: oe }));
5295
+ I((k) => ({ ...k, [R]: oe }));
5296
5296
  } catch {
5297
- I((oe) => ({ ...oe, [D]: [] }));
5297
+ I((oe) => ({ ...oe, [R]: [] }));
5298
5298
  } finally {
5299
- v((oe) => ({ ...oe, [D]: !1 }));
5299
+ v((oe) => ({ ...oe, [R]: !1 }));
5300
5300
  }
5301
5301
  }
5302
5302
  },
@@ -5312,114 +5312,114 @@ function np({
5312
5312
  const ne = re(o);
5313
5313
  ne.current = o, le(() => {
5314
5314
  if (e.length > 0 && t.length > 0) {
5315
- const D = e.find((P) => P.selectable !== !1);
5316
- D && m({ rowId: n(t[0]), colKey: D.key });
5315
+ const R = e.find((P) => P.selectable !== !1);
5316
+ R && m({ rowId: n(t[0]), colKey: R.key });
5317
5317
  }
5318
5318
  }, []), le(() => {
5319
5319
  if (!f) return;
5320
- const D = w.current;
5321
- if (!D) return;
5322
- const P = D.querySelector(
5320
+ const R = w.current;
5321
+ if (!R) return;
5322
+ const P = R.querySelector(
5323
5323
  `[data-cell-id="${f.rowId}:${f.colKey}"]`
5324
5324
  );
5325
5325
  if (!P) return;
5326
- const se = D.querySelector('[role="rowgroup"]');
5326
+ const se = R.querySelector('[role="rowgroup"]');
5327
5327
  P.style.scrollMarginTop = `${(se == null ? void 0 : se.offsetHeight) ?? 0}px`;
5328
- const R = D.querySelector('[role="row"]');
5328
+ const D = R.querySelector('[role="row"]');
5329
5329
  let oe = 0;
5330
- R && R.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((k) => {
5330
+ D && D.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((k) => {
5331
5331
  k.style.position === "sticky" && k.style.left !== "" && (oe = Math.max(
5332
5332
  oe,
5333
5333
  parseFloat(k.style.left) + k.offsetWidth
5334
5334
  ));
5335
5335
  }), P.style.scrollMarginLeft = `${oe}px`, P.scrollIntoView({ block: "nearest", inline: "nearest" });
5336
5336
  }, [f]);
5337
- const Z = me((D) => {
5337
+ const Z = me((R) => {
5338
5338
  var oe;
5339
- const P = j.current, se = /* @__PURE__ */ new Set(), R = [];
5339
+ const P = j.current, se = /* @__PURE__ */ new Set(), D = [];
5340
5340
  (oe = w.current) == null || oe.querySelectorAll("[data-cell-id]").forEach((k) => {
5341
5341
  const ee = k.dataset.cellId.split(":")[0];
5342
- se.has(ee) || (se.add(ee), R.push(ee));
5342
+ se.has(ee) || (se.add(ee), D.push(ee));
5343
5343
  }), m((k) => {
5344
5344
  if (!k) return k;
5345
- const ee = P.findIndex((te) => te.key === k.colKey), _ = R.indexOf(k.rowId);
5345
+ const ee = P.findIndex((te) => te.key === k.colKey), _ = D.indexOf(k.rowId);
5346
5346
  let H = ee, de = _;
5347
- if (D === "up") de = Math.max(0, _ - 1);
5348
- else if (D === "down")
5349
- de = Math.min(R.length - 1, _ + 1);
5350
- else if (D === "left") {
5347
+ if (R === "up") de = Math.max(0, _ - 1);
5348
+ else if (R === "down")
5349
+ de = Math.min(D.length - 1, _ + 1);
5350
+ else if (R === "left") {
5351
5351
  let te = ee - 1;
5352
5352
  for (; te >= 0 && P[te].selectable === !1; )
5353
5353
  te--;
5354
5354
  te >= 0 && (H = te);
5355
- } else if (D === "right") {
5355
+ } else if (R === "right") {
5356
5356
  let te = ee + 1;
5357
5357
  for (; te < P.length && P[te].selectable === !1; )
5358
5358
  te++;
5359
5359
  te < P.length && (H = te);
5360
5360
  }
5361
- return H === ee && de === _ ? k : { rowId: R[de], colKey: P[H].key };
5361
+ return H === ee && de === _ ? k : { rowId: D[de], colKey: P[H].key };
5362
5362
  });
5363
- }, []), Q = me((D = !0) => {
5363
+ }, []), Q = me((R = !0) => {
5364
5364
  const P = c.current;
5365
- b(null), P && m(P), D && setTimeout(() => {
5365
+ b(null), P && m(P), R && setTimeout(() => {
5366
5366
  var se;
5367
5367
  return (se = w.current) == null ? void 0 : se.focus({ preventScroll: !0 });
5368
5368
  }, 0);
5369
5369
  }, []), W = me(
5370
- async (D, P, se) => {
5370
+ async (R, P, se) => {
5371
5371
  var ie;
5372
- const R = j.current.find((ge) => ge.key === P);
5373
- if (!(R != null && R.editable)) return;
5374
- const { field: oe, type: k, mask: ee, validate: _ } = R.editable, H = k === "number" ? se === "" ? null : Number(se) : se;
5372
+ const D = j.current.find((he) => he.key === P);
5373
+ if (!(D != null && D.editable)) return;
5374
+ const { field: oe, type: k, mask: ee, validate: _ } = D.editable, H = k === "number" ? se === "" ? null : Number(se) : se;
5375
5375
  if (ee) {
5376
- const ge = Cd(se, ee);
5377
- if (ge) {
5376
+ const he = Cd(se, ee);
5377
+ if (he) {
5378
5378
  E(($e) => ({
5379
5379
  ...$e,
5380
- [`${D}:${P}`]: ge
5380
+ [`${R}:${P}`]: he
5381
5381
  }));
5382
5382
  return;
5383
5383
  }
5384
5384
  }
5385
5385
  if (_) {
5386
- const ge = _(H);
5387
- if (ge) {
5388
- E(($e) => ({ ...$e, [`${D}:${P}`]: ge }));
5386
+ const he = _(H);
5387
+ if (he) {
5388
+ E(($e) => ({ ...$e, [`${R}:${P}`]: he }));
5389
5389
  return;
5390
5390
  }
5391
5391
  }
5392
- const de = K.current, te = Y.current.find((ge) => de(ge) === D);
5392
+ const de = K.current, te = Y.current.find((he) => de(he) === R);
5393
5393
  if (!te) return;
5394
5394
  const z = te[oe];
5395
- b(null), E((ge) => {
5396
- const $e = { ...ge };
5397
- return delete $e[`${D}:${P}`], $e;
5395
+ b(null), E((he) => {
5396
+ const $e = { ...he };
5397
+ return delete $e[`${R}:${P}`], $e;
5398
5398
  });
5399
- const y = Y.current, T = y.findIndex((ge) => de(ge) === D), J = y[Math.min(y.length - 1, T + 1)];
5399
+ const y = Y.current, T = y.findIndex((he) => de(he) === R), J = y[Math.min(y.length - 1, T + 1)];
5400
5400
  if (m({ rowId: de(J), colKey: P }), setTimeout(() => {
5401
5401
  var $e, Ie;
5402
- const ge = document.activeElement;
5403
- (!ge || ge === document.body || ($e = w.current) != null && $e.contains(ge)) && ((Ie = w.current) == null || Ie.focus({ preventScroll: !0 }));
5402
+ const he = document.activeElement;
5403
+ (!he || he === document.body || ($e = w.current) != null && $e.contains(he)) && ((Ie = w.current) == null || Ie.focus({ preventScroll: !0 }));
5404
5404
  }, 0), String(z ?? "") === String(H ?? "")) return;
5405
5405
  const fe = { ...te, [oe]: H };
5406
5406
  s(
5407
- (ge) => ge.map(($e) => de($e) === D ? fe : $e)
5408
- ), C({ rowId: D, colKey: P });
5407
+ (he) => he.map(($e) => de($e) === R ? fe : $e)
5408
+ ), C({ rowId: R, colKey: P });
5409
5409
  try {
5410
5410
  await ((ie = L.current) == null ? void 0 : ie.call(L, {
5411
5411
  row: te,
5412
- rowId: D,
5412
+ rowId: R,
5413
5413
  field: oe,
5414
5414
  oldValue: z,
5415
5415
  newValue: H
5416
5416
  }));
5417
5417
  } catch {
5418
5418
  s(
5419
- (ge) => ge.map(($e) => de($e) === D ? te : $e)
5420
- ), E((ge) => ({
5421
- ...ge,
5422
- [`${D}:${P}`]: "Error al guardar. Intenta de nuevo."
5419
+ (he) => he.map(($e) => de($e) === R ? te : $e)
5420
+ ), E((he) => ({
5421
+ ...he,
5422
+ [`${R}:${P}`]: "Error al guardar. Intenta de nuevo."
5423
5423
  }));
5424
5424
  } finally {
5425
5425
  C(null);
@@ -5427,9 +5427,9 @@ function np({
5427
5427
  },
5428
5428
  []
5429
5429
  ), U = me(
5430
- (D) => {
5430
+ (R) => {
5431
5431
  if (A.current) {
5432
- D.preventDefault();
5432
+ R.preventDefault();
5433
5433
  return;
5434
5434
  }
5435
5435
  if (c.current) return;
@@ -5442,8 +5442,8 @@ function np({
5442
5442
  "Enter",
5443
5443
  "Escape",
5444
5444
  "Tab"
5445
- ].includes(D.key)))
5446
- switch (D.preventDefault(), D.key) {
5445
+ ].includes(R.key)))
5446
+ switch (R.preventDefault(), R.key) {
5447
5447
  case "ArrowUp":
5448
5448
  Z("up");
5449
5449
  break;
@@ -5457,37 +5457,37 @@ function np({
5457
5457
  Z("right");
5458
5458
  break;
5459
5459
  case "Tab":
5460
- Z(D.shiftKey ? "left" : "right");
5460
+ Z(R.shiftKey ? "left" : "right");
5461
5461
  break;
5462
5462
  case "Enter": {
5463
- const R = j.current.find((oe) => oe.key === P.colKey);
5464
- R != null && R.editable && !ne.current ? (b(P), R.editable.type === "select" && !$.current.has(P.colKey) && V(P.colKey, R.editable)) : Z("down");
5463
+ const D = j.current.find((oe) => oe.key === P.colKey);
5464
+ D != null && D.editable && !ne.current ? (b(P), D.editable.type === "select" && !$.current.has(P.colKey) && V(P.colKey, D.editable)) : Z("down");
5465
5465
  break;
5466
5466
  }
5467
5467
  }
5468
5468
  },
5469
5469
  [Z, V]
5470
- ), ue = _e(() => e.map((D) => {
5471
- if (!D.editable || o) {
5472
- const se = { ...D };
5473
- if (delete se.editable, delete se.selectable, D.selectable === !1)
5470
+ ), ue = _e(() => e.map((R) => {
5471
+ if (!R.editable || o) {
5472
+ const se = { ...R };
5473
+ if (delete se.editable, delete se.selectable, R.selectable === !1)
5474
5474
  return { ...se, disableRowClick: !0 };
5475
- const R = se.cell;
5475
+ const D = se.cell;
5476
5476
  return {
5477
5477
  ...se,
5478
5478
  className: `relative ${se.className ?? ""}`.trim(),
5479
5479
  disableRowClick: !0,
5480
5480
  cell: (oe) => {
5481
- const k = n(oe), ee = (f == null ? void 0 : f.rowId) === k && (f == null ? void 0 : f.colKey) === D.key;
5481
+ const k = n(oe), ee = (f == null ? void 0 : f.rowId) === k && (f == null ? void 0 : f.colKey) === R.key;
5482
5482
  return /* @__PURE__ */ u(Pe, { children: [
5483
5483
  /* @__PURE__ */ r(
5484
5484
  "span",
5485
5485
  {
5486
- "data-cell-id": `${k}:${D.key}`,
5486
+ "data-cell-id": `${k}:${R.key}`,
5487
5487
  className: "absolute inset-0 z-10 cursor-default",
5488
5488
  onClick: () => {
5489
5489
  var _;
5490
- A.current || (m({ rowId: k, colKey: D.key }), (_ = w.current) == null || _.focus({ preventScroll: !0 }));
5490
+ A.current || (m({ rowId: k, colKey: R.key }), (_ = w.current) == null || _.focus({ preventScroll: !0 }));
5491
5491
  }
5492
5492
  }
5493
5493
  ),
@@ -5498,21 +5498,21 @@ function np({
5498
5498
  style: co
5499
5499
  }
5500
5500
  ),
5501
- /* @__PURE__ */ r("span", { className: "relative z-0 pointer-events-none", children: R(oe) })
5501
+ /* @__PURE__ */ r("span", { className: "relative z-0 pointer-events-none", children: D(oe) })
5502
5502
  ] });
5503
5503
  }
5504
5504
  };
5505
5505
  }
5506
- const P = D.editable;
5506
+ const P = R.editable;
5507
5507
  return {
5508
- ...D,
5508
+ ...R,
5509
5509
  // Make the cell a positioned ancestor so the absolute edit overlay works
5510
- className: `relative ${D.className ?? ""}`.trim(),
5510
+ className: `relative ${R.className ?? ""}`.trim(),
5511
5511
  disableRowClick: !0,
5512
5512
  cell: (se) => {
5513
- const R = n(se), oe = D.key, k = (d == null ? void 0 : d.rowId) === R && (d == null ? void 0 : d.colKey) === oe, ee = (f == null ? void 0 : f.rowId) === R && (f == null ? void 0 : f.colKey) === oe, _ = h[`${R}:${oe}`], H = (x == null ? void 0 : x.rowId) === R && (x == null ? void 0 : x.colKey) === oe, de = se[P.field], te = String(de ?? ""), z = () => {
5513
+ const D = n(se), oe = R.key, k = (d == null ? void 0 : d.rowId) === D && (d == null ? void 0 : d.colKey) === oe, ee = (f == null ? void 0 : f.rowId) === D && (f == null ? void 0 : f.colKey) === oe, _ = h[`${D}:${oe}`], H = (x == null ? void 0 : x.rowId) === D && (x == null ? void 0 : x.colKey) === oe, de = se[P.field], te = String(de ?? ""), z = () => {
5514
5514
  var T;
5515
- A.current || (m({ rowId: R, colKey: oe }), b({ rowId: R, colKey: oe }), (T = w.current) == null || T.focus({ preventScroll: !0 }), P.type === "select" && !$.current.has(oe) && V(oe, P));
5515
+ A.current || (m({ rowId: D, colKey: oe }), b({ rowId: D, colKey: oe }), (T = w.current) == null || T.focus({ preventScroll: !0 }), P.type === "select" && !$.current.has(oe) && V(oe, P));
5516
5516
  };
5517
5517
  if (k) {
5518
5518
  const T = P.type === "select" ? /* @__PURE__ */ r(
@@ -5521,7 +5521,7 @@ function np({
5521
5521
  initialValue: te,
5522
5522
  options: S[oe] ?? [],
5523
5523
  loading: N[oe] ?? !1,
5524
- onCommit: (J) => W(R, oe, J),
5524
+ onCommit: (J) => W(D, oe, J),
5525
5525
  onCancel: Q
5526
5526
  }
5527
5527
  ) : /* @__PURE__ */ r(
@@ -5530,7 +5530,7 @@ function np({
5530
5530
  initialValue: te,
5531
5531
  type: P.type ?? "text",
5532
5532
  mask: P.mask,
5533
- onCommit: (J) => W(R, oe, J),
5533
+ onCommit: (J) => W(D, oe, J),
5534
5534
  onCancel: Q
5535
5535
  }
5536
5536
  );
@@ -5544,12 +5544,12 @@ function np({
5544
5544
  }
5545
5545
  );
5546
5546
  }
5547
- const y = D.cell(se);
5547
+ const y = R.cell(se);
5548
5548
  return /* @__PURE__ */ u(Pe, { children: [
5549
5549
  /* @__PURE__ */ r(
5550
5550
  "span",
5551
5551
  {
5552
- "data-cell-id": `${R}:${oe}`,
5552
+ "data-cell-id": `${D}:${oe}`,
5553
5553
  className: `peer absolute inset-0 z-10 ${H ? "cursor-wait" : "cursor-pointer"}`,
5554
5554
  onClick: z
5555
5555
  }
@@ -5606,12 +5606,12 @@ function np({
5606
5606
  ref: w,
5607
5607
  tabIndex: 0,
5608
5608
  onKeyDown: U,
5609
- onBlur: (D) => {
5609
+ onBlur: (R) => {
5610
5610
  var P;
5611
- (P = w.current) != null && P.contains(D.relatedTarget) || setTimeout(() => {
5612
- var R, oe;
5611
+ (P = w.current) != null && P.contains(R.relatedTarget) || setTimeout(() => {
5612
+ var D, oe;
5613
5613
  const se = document.activeElement;
5614
- se && ((R = se.closest) != null && R.call(
5614
+ se && ((D = se.closest) != null && D.call(
5615
5615
  se,
5616
5616
  "[data-bonsaif-select-dropdown]"
5617
5617
  )) || (oe = w.current) != null && oe.contains(se) || Q(!1);
@@ -6043,12 +6043,12 @@ function op({
6043
6043
  ), [I, N] = q(
6044
6044
  () => dn(it(i || e[0]) ?? /* @__PURE__ */ new Date())
6045
6045
  ), [v, $] = q(d), w = c ?? v;
6046
- function F(D) {
6047
- c === void 0 && $(D), b == null || b(D);
6046
+ function F(R) {
6047
+ c === void 0 && $(R), b == null || b(R);
6048
6048
  }
6049
6049
  le(() => {
6050
- const D = it(i);
6051
- D && (S(D), N(dn(D)));
6050
+ const R = it(i);
6051
+ R && (S(R), N(dn(R)));
6052
6052
  }, [i]);
6053
6053
  const { onDayPointerDown: V, onDayPointerEnter: Y, onDayClick: L, toggleWeek: K } = ps({
6054
6054
  value: e,
@@ -6060,14 +6060,14 @@ function op({
6060
6060
  isDateDisabled: o
6061
6061
  }), j = _e(() => {
6062
6062
  if (g) return !0;
6063
- const D = [];
6064
- return x && D.push({ before: x }), C && D.push({ after: C }), o && D.push((P) => o(_t(P))), D.length > 0 ? D : void 0;
6063
+ const R = [];
6064
+ return x && R.push({ before: x }), C && R.push({ after: C }), o && R.push((P) => o(_t(P))), R.length > 0 ? R : void 0;
6065
6065
  }, [g, o, C, x]), ne = me(
6066
- (D) => /* @__PURE__ */ r(
6066
+ (R) => /* @__PURE__ */ r(
6067
6067
  fs,
6068
6068
  {
6069
- ...D,
6070
- className: `bonsaif-multi-day-btn ${D.className ?? ""}`,
6069
+ ...R,
6070
+ className: `bonsaif-multi-day-btn ${R.className ?? ""}`,
6071
6071
  onDayPointerDown: V,
6072
6072
  onDayPointerEnter: Y,
6073
6073
  onDayClickSelect: L
@@ -6089,16 +6089,16 @@ function op({
6089
6089
  );
6090
6090
  function U() {
6091
6091
  if (w === "week") {
6092
- const D = Zi(I, -7);
6093
- N(dn(D)), S(D);
6092
+ const R = Zi(I, -7);
6093
+ N(dn(R)), S(R);
6094
6094
  return;
6095
6095
  }
6096
6096
  S(new Date(A.getFullYear(), A.getMonth() - 1, 1));
6097
6097
  }
6098
6098
  function ue() {
6099
6099
  if (w === "week") {
6100
- const D = Zi(I, 7);
6101
- N(dn(D)), S(D);
6100
+ const R = Zi(I, 7);
6101
+ N(dn(R)), S(R);
6102
6102
  return;
6103
6103
  }
6104
6104
  S(new Date(A.getFullYear(), A.getMonth() + 1, 1));
@@ -6179,7 +6179,7 @@ function op({
6179
6179
  showOutsideDays: !1,
6180
6180
  weekStartsOn: 1,
6181
6181
  showWeekNumber: s,
6182
- onWeekNumberClick: (D, P) => {
6182
+ onWeekNumberClick: (R, P) => {
6183
6183
  K(P);
6184
6184
  },
6185
6185
  disabled: j,
@@ -6210,30 +6210,30 @@ function op({
6210
6210
  }
6211
6211
  }
6212
6212
  ) : /* @__PURE__ */ u("div", { className: "bonsaif-week-view", children: [
6213
- /* @__PURE__ */ r("div", { className: "bonsaif-week-view-head", children: Z.map((D) => /* @__PURE__ */ r("div", { className: "bonsaif-multi-weekday", children: new Intl.DateTimeFormat("es-MX", {
6213
+ /* @__PURE__ */ r("div", { className: "bonsaif-week-view-head", children: Z.map((R) => /* @__PURE__ */ r("div", { className: "bonsaif-multi-weekday", children: new Intl.DateTimeFormat("es-MX", {
6214
6214
  weekday: "short"
6215
- }).format(D) }, `h-${_t(D)}`)) }),
6216
- /* @__PURE__ */ r("div", { className: "bonsaif-week-view-days", children: Z.map((D) => {
6217
- const P = _t(D), se = E.has(P), R = g || (n ? P < n : !1) || (a ? P > a : !1) || !!(o != null && o(P)), oe = P === _t(/* @__PURE__ */ new Date());
6215
+ }).format(R) }, `h-${_t(R)}`)) }),
6216
+ /* @__PURE__ */ r("div", { className: "bonsaif-week-view-days", children: Z.map((R) => {
6217
+ const P = _t(R), se = E.has(P), D = g || (n ? P < n : !1) || (a ? P > a : !1) || !!(o != null && o(P)), oe = P === _t(/* @__PURE__ */ new Date());
6218
6218
  return /* @__PURE__ */ r(
6219
6219
  "div",
6220
6220
  {
6221
- className: `bonsaif-multi-day${se ? " bonsaif-multi-day-selected" : ""}${oe ? " bonsaif-multi-day-today" : ""}${R ? " bonsaif-multi-day-disabled" : ""}`,
6221
+ className: `bonsaif-multi-day${se ? " bonsaif-multi-day-selected" : ""}${oe ? " bonsaif-multi-day-today" : ""}${D ? " bonsaif-multi-day-disabled" : ""}`,
6222
6222
  children: /* @__PURE__ */ u(
6223
6223
  "button",
6224
6224
  {
6225
6225
  type: "button",
6226
6226
  className: "bonsaif-multi-day-btn",
6227
- disabled: R,
6227
+ disabled: D,
6228
6228
  "aria-pressed": se,
6229
- onPointerDown: (k) => V(D, k),
6230
- onPointerEnter: () => Y(D),
6231
- onClick: (k) => L(D, k),
6229
+ onPointerDown: (k) => V(R, k),
6230
+ onPointerEnter: () => Y(R),
6231
+ onClick: (k) => L(R, k),
6232
6232
  children: [
6233
- /* @__PURE__ */ r("span", { className: "bonsaif-week-day-num", children: D.getDate() }),
6233
+ /* @__PURE__ */ r("span", { className: "bonsaif-week-day-num", children: R.getDate() }),
6234
6234
  /* @__PURE__ */ r("span", { className: "bonsaif-week-day-month", children: new Intl.DateTimeFormat("es-MX", {
6235
6235
  month: "short"
6236
- }).format(D) })
6236
+ }).format(R) })
6237
6237
  ]
6238
6238
  }
6239
6239
  )
@@ -6259,20 +6259,20 @@ function op({
6259
6259
  " ",
6260
6260
  e.length === 1 ? "fecha" : "fechas"
6261
6261
  ] }),
6262
- /* @__PURE__ */ r("div", { className: "bonsaif-cal-chips", children: e.map((D) => /* @__PURE__ */ u(
6262
+ /* @__PURE__ */ r("div", { className: "bonsaif-cal-chips", children: e.map((R) => /* @__PURE__ */ u(
6263
6263
  "button",
6264
6264
  {
6265
6265
  type: "button",
6266
6266
  className: "bonsaif-cal-chip",
6267
6267
  disabled: g,
6268
- onClick: () => t == null ? void 0 : t(e.filter((P) => P !== D)),
6269
- title: `Quitar ${D}`,
6268
+ onClick: () => t == null ? void 0 : t(e.filter((P) => P !== R)),
6269
+ title: `Quitar ${R}`,
6270
6270
  children: [
6271
- ms(D),
6271
+ ms(R),
6272
6272
  /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "×" })
6273
6273
  ]
6274
6274
  },
6275
- D
6275
+ R
6276
6276
  )) })
6277
6277
  ] }) }) : null
6278
6278
  ] });
@@ -7347,15 +7347,15 @@ function yp({
7347
7347
  required: Y,
7348
7348
  ...L
7349
7349
  }) {
7350
- const K = La(), j = w ?? K, ne = re(null), [Z, Q] = q(!1), [W, U] = q(l), ue = i ?? W, D = !!a, P = !!t && n === "tooltip" && !D, se = g && ue.length > 0 && !V, R = (T, J) => {
7350
+ const K = La(), j = w ?? K, ne = re(null), [Z, Q] = q(!1), [W, U] = q(l), ue = i ?? W, R = !!a, P = !!t && n === "tooltip" && !R, se = g && ue.length > 0 && !V, D = (T, J) => {
7351
7351
  i === void 0 && U(T), s == null || s(T, J);
7352
7352
  }, oe = (T, J) => {
7353
7353
  const fe = T.filter(
7354
7354
  (Ie) => nl(Ie, F)
7355
7355
  ), ie = T.filter(
7356
7356
  (Ie) => !nl(Ie, F)
7357
- ), ge = f ? [...ue, ...fe] : fe, $e = am(ge, d, b);
7358
- ie.length > 0 && (c == null || c(ie)), R($e, J);
7357
+ ), he = f ? [...ue, ...fe] : fe, $e = am(he, d, b);
7358
+ ie.length > 0 && (c == null || c(ie)), D($e, J);
7359
7359
  }, k = () => {
7360
7360
  var T;
7361
7361
  V || (T = ne.current) == null || T.click();
@@ -7370,9 +7370,9 @@ function yp({
7370
7370
  }, te = (T) => {
7371
7371
  T.key !== "Enter" && T.key !== " " || (T.preventDefault(), k());
7372
7372
  }, z = (T) => {
7373
- R(ue.filter((J, fe) => fe !== T));
7373
+ D(ue.filter((J, fe) => fe !== T));
7374
7374
  }, y = () => {
7375
- R([]);
7375
+ D([]);
7376
7376
  };
7377
7377
  return /* @__PURE__ */ u("div", { className: `flex flex-col gap-2 ${I}`, children: [
7378
7378
  (e || o || P) && /* @__PURE__ */ u("div", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
@@ -7392,7 +7392,7 @@ function yp({
7392
7392
  multiple: d,
7393
7393
  disabled: V,
7394
7394
  required: Y && ue.length === 0,
7395
- "aria-invalid": D || L["aria-invalid"],
7395
+ "aria-invalid": R || L["aria-invalid"],
7396
7396
  className: "sr-only",
7397
7397
  onChange: ee
7398
7398
  }
@@ -7404,8 +7404,8 @@ function yp({
7404
7404
  tabIndex: V ? -1 : 0,
7405
7405
  "aria-controls": j,
7406
7406
  "aria-disabled": V || void 0,
7407
- "aria-invalid": D || void 0,
7408
- className: `flex cursor-pointer flex-col items-center justify-center gap-3 rounded-lg border border-dashed bg-[var(--bg-card)] text-center outline-none transition-colors focus:border-[var(--primary)] focus:bg-[var(--bg-input)] ${rm[S]} ${Z ? "border-[var(--primary)] bg-[var(--bg-input)]" : D ? "border-[var(--danger)]" : "border-[var(--border)]"} ${V ? "cursor-not-allowed opacity-60" : "hover:border-[var(--primary)] hover:bg-[var(--bg-input)]"} ${N} ${$}`,
7407
+ "aria-invalid": R || void 0,
7408
+ className: `flex cursor-pointer flex-col items-center justify-center gap-3 rounded-lg border border-dashed bg-[var(--bg-card)] text-center outline-none transition-colors focus:border-[var(--primary)] focus:bg-[var(--bg-input)] ${rm[S]} ${Z ? "border-[var(--primary)] bg-[var(--bg-input)]" : R ? "border-[var(--danger)]" : "border-[var(--border)]"} ${V ? "cursor-not-allowed opacity-60" : "hover:border-[var(--primary)] hover:bg-[var(--bg-input)]"} ${N} ${$}`,
7409
7409
  onClick: k,
7410
7410
  onDragOver: _,
7411
7411
  onDragLeave: H,
@@ -7834,21 +7834,21 @@ function pm({
7834
7834
  scale: 1,
7835
7835
  animate: !1,
7836
7836
  enabled: !1
7837
- }), [ne, Z] = q(!1), Q = re(null), W = re(null), U = re(null), ue = re(null), D = re(null), P = re(!1), se = re(!1), R = re(null), oe = re(null), k = re(null), ee = re(null), _ = re(null), H = re(a ?? 0), de = a ?? N, te = n.length === 0 ? 0 : mn(de, 0, Math.max(0, n.length - 1)), z = n[te], y = n.length > 1, T = Math.max(s, l), J = h && y, fe = me(
7837
+ }), [ne, Z] = q(!1), Q = re(null), W = re(null), U = re(null), ue = re(null), R = re(null), P = re(!1), se = re(!1), D = re(null), oe = re(null), k = re(null), ee = re(null), _ = re(null), H = re(a ?? 0), de = a ?? N, te = n.length === 0 ? 0 : mn(de, 0, Math.max(0, n.length - 1)), z = n[te], y = n.length > 1, T = Math.max(s, l), J = h && y, fe = me(
7838
7838
  (pe) => {
7839
7839
  if (n.length === 0) return;
7840
- const xe = n.length - 1, Ae = g ? (pe % n.length + n.length) % n.length : mn(pe, 0, xe);
7840
+ const ge = n.length - 1, Ae = g ? (pe % n.length + n.length) % n.length : mn(pe, 0, ge);
7841
7841
  a === void 0 && v(Ae), o == null || o(Ae);
7842
7842
  },
7843
7843
  [a, g, o, n.length]
7844
7844
  ), ie = me(() => {
7845
7845
  w(1), V({ x: 0, y: 0 });
7846
- }, []), ge = me(
7847
- (pe, xe) => {
7848
- if (xe <= s + 1e-3) return { x: 0, y: 0 };
7846
+ }, []), he = me(
7847
+ (pe, ge) => {
7848
+ if (ge <= s + 1e-3) return { x: 0, y: 0 };
7849
7849
  const Ae = ee.current, Fe = _.current;
7850
7850
  if (!Ae || !Fe) return pe;
7851
- const De = Ae.getBoundingClientRect(), bt = Fe.offsetWidth * xe, ct = Fe.offsetHeight * xe, ze = Math.max(0, (bt - De.width) / 2 + De.width * 0.15), qe = Math.max(0, (ct - De.height) / 2 + De.height * 0.15);
7851
+ const De = Ae.getBoundingClientRect(), bt = Fe.offsetWidth * ge, ct = Fe.offsetHeight * ge, ze = Math.max(0, (bt - De.width) / 2 + De.width * 0.15), qe = Math.max(0, (ct - De.height) / 2 + De.height * 0.15);
7852
7852
  return {
7853
7853
  x: mn(pe.x, -ze, ze),
7854
7854
  y: mn(pe.y, -qe, qe)
@@ -7856,12 +7856,12 @@ function pm({
7856
7856
  },
7857
7857
  [s]
7858
7858
  ), $e = me(() => {
7859
- A(!1), j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !1 }), ue.current = null, D.current = null, P.current = !1, se.current = !1, R.current && (clearTimeout(R.current), R.current = null);
7859
+ A(!1), j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !1 }), ue.current = null, R.current = null, P.current = !1, se.current = !1, D.current && (clearTimeout(D.current), D.current = null);
7860
7860
  }, []), Ie = me(() => {
7861
7861
  if (P.current) return;
7862
7862
  P.current = !0, I(!1), ie();
7863
- const pe = ue.current, xe = pe != null && D.current != null && D.current === te;
7864
- if (pe && xe) {
7863
+ const pe = ue.current, ge = pe != null && R.current != null && R.current === te;
7864
+ if (pe && ge) {
7865
7865
  U.current != null && cancelAnimationFrame(U.current), U.current = requestAnimationFrame(() => {
7866
7866
  U.current = requestAnimationFrame(() => {
7867
7867
  const Ae = _.current;
@@ -7891,7 +7891,7 @@ function pm({
7891
7891
  }
7892
7892
  j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !1 }), Q.current && clearTimeout(Q.current), Q.current = setTimeout($e, Ot + 40);
7893
7893
  }, [$e, ie, te]);
7894
- le(() => (e ? (Q.current && clearTimeout(Q.current), R.current && (clearTimeout(R.current), R.current = null), P.current = !1, se.current = !1, ue.current = bm(i), D.current = ue.current != null ? a ?? N : null, A(!0), I(!1), ue.current ? j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !0 }) : (D.current = null, requestAnimationFrame(
7894
+ le(() => (e ? (Q.current && clearTimeout(Q.current), D.current && (clearTimeout(D.current), D.current = null), P.current = !1, se.current = !1, ue.current = bm(i), R.current = ue.current != null ? a ?? N : null, A(!0), I(!1), ue.current ? j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !0 }) : (R.current = null, requestAnimationFrame(
7895
7895
  () => requestAnimationFrame(() => {
7896
7896
  I(!0), j({ dx: 0, dy: 0, scale: 1, animate: !1, enabled: !1 });
7897
7897
  })
@@ -7900,12 +7900,12 @@ function pm({
7900
7900
  }), [e]);
7901
7901
  const Dt = me(() => {
7902
7902
  if (!e || P.current || se.current) return;
7903
- const pe = ue.current, xe = _.current;
7904
- if (!pe || !xe) {
7903
+ const pe = ue.current, ge = _.current;
7904
+ if (!pe || !ge) {
7905
7905
  pe || (I(!0), se.current = !0);
7906
7906
  return;
7907
7907
  }
7908
- const Ae = xe.getBoundingClientRect();
7908
+ const Ae = ge.getBoundingClientRect();
7909
7909
  if (Ae.width < 2 || Ae.height < 2) return;
7910
7910
  se.current = !0;
7911
7911
  const Fe = al(pe, Ae);
@@ -7923,14 +7923,14 @@ function pm({
7923
7923
  dy: 0,
7924
7924
  scale: 1,
7925
7925
  animate: !0
7926
- }), I(!0), U.current = null, R.current && clearTimeout(R.current), R.current = setTimeout(() => {
7926
+ }), I(!0), U.current = null, D.current && clearTimeout(D.current), D.current = setTimeout(() => {
7927
7927
  j({
7928
7928
  dx: 0,
7929
7929
  dy: 0,
7930
7930
  scale: 1,
7931
7931
  animate: !1,
7932
7932
  enabled: !1
7933
- }), R.current = null;
7933
+ }), D.current = null;
7934
7934
  }, Hr + 20);
7935
7935
  });
7936
7936
  });
@@ -7938,7 +7938,7 @@ function pm({
7938
7938
  Aa(() => {
7939
7939
  !C || !e || !ue.current || se.current || Dt();
7940
7940
  }, [C, e, Dt]), le(() => {
7941
- !e || P.current || D.current != null && D.current !== te && j(
7941
+ !e || P.current || R.current != null && R.current !== te && j(
7942
7942
  (pe) => pe.enabled ? { dx: 0, dy: 0, scale: 1, animate: !1, enabled: !1 } : pe
7943
7943
  );
7944
7944
  }, [e, te]), le(() => {
@@ -7959,10 +7959,10 @@ function pm({
7959
7959
  const pe = H.current;
7960
7960
  if (pe === te) return;
7961
7961
  H.current = te;
7962
- const xe = n.length;
7962
+ const ge = n.length;
7963
7963
  let Ae = 1;
7964
- if (xe > 1) {
7965
- const Fe = (pe + 1) % xe === te, De = (pe - 1 + xe) % xe === te;
7964
+ if (ge > 1) {
7965
+ const Fe = (pe + 1) % ge === te, De = (pe - 1 + ge) % ge === te;
7966
7966
  De && !Fe ? Ae = -1 : Fe && !De ? Ae = 1 : Ae = te > pe ? 1 : -1;
7967
7967
  }
7968
7968
  return W.current != null && (cancelAnimationFrame(W.current), W.current = null), L({
@@ -7986,15 +7986,15 @@ function pm({
7986
7986
  };
7987
7987
  }, [e, te, n.length]);
7988
7988
  const Ht = $ <= s + 1e-3 && Math.abs(F.x) < 0.5 && Math.abs(F.y) < 0.5, nt = me(
7989
- (pe, xe, Ae) => {
7989
+ (pe, ge, Ae) => {
7990
7990
  w((Fe) => {
7991
7991
  const De = mn(pe, s, T);
7992
7992
  if (Math.abs(De - Fe) < 1e-4) return Fe;
7993
7993
  const bt = De / Fe, ct = De < Fe;
7994
7994
  return De <= s + 1e-3 ? (V({ x: 0, y: 0 }), s) : (V((ze) => {
7995
7995
  let qe = ze;
7996
- if (typeof xe == "number" && typeof Ae == "number" && ee.current && !ct) {
7997
- const ut = ee.current.getBoundingClientRect(), pt = xe - ut.left - ut.width / 2, pr = Ae - ut.top - ut.height / 2;
7996
+ if (typeof ge == "number" && typeof Ae == "number" && ee.current && !ct) {
7997
+ const ut = ee.current.getBoundingClientRect(), pt = ge - ut.left - ut.width / 2, pr = Ae - ut.top - ut.height / 2;
7998
7998
  qe = {
7999
7999
  x: pt - (pt - ze.x) * bt,
8000
8000
  y: pr - (pr - ze.y) * bt
@@ -8011,11 +8011,11 @@ function pm({
8011
8011
  };
8012
8012
  } else
8013
8013
  qe = { x: ze.x * bt, y: ze.y * bt };
8014
- return ge(qe, De);
8014
+ return he(qe, De);
8015
8015
  }), De);
8016
8016
  });
8017
8017
  },
8018
- [ge, s, T]
8018
+ [he, s, T]
8019
8019
  ), zt = me(() => {
8020
8020
  nt($ * c);
8021
8021
  }, [nt, $, c]), mt = me(() => {
@@ -8028,12 +8028,12 @@ function pm({
8028
8028
  }, [s, ie, $, c]);
8029
8029
  le(() => {
8030
8030
  if (!e) return;
8031
- const pe = (xe) => {
8032
- if (xe.key === "Escape" && b) {
8033
- xe.preventDefault(), t();
8031
+ const pe = (ge) => {
8032
+ if (ge.key === "Escape" && b) {
8033
+ ge.preventDefault(), t();
8034
8034
  return;
8035
8035
  }
8036
- xe.key === "ArrowLeft" && y ? (xe.preventDefault(), fe(te - 1)) : xe.key === "ArrowRight" && y ? (xe.preventDefault(), fe(te + 1)) : xe.key === "+" || xe.key === "=" ? (xe.preventDefault(), nt($ * c)) : xe.key === "-" || xe.key === "_" ? (xe.preventDefault(), mt()) : xe.key === "0" && (xe.preventDefault(), ie());
8036
+ ge.key === "ArrowLeft" && y ? (ge.preventDefault(), fe(te - 1)) : ge.key === "ArrowRight" && y ? (ge.preventDefault(), fe(te + 1)) : ge.key === "+" || ge.key === "=" ? (ge.preventDefault(), nt($ * c)) : ge.key === "-" || ge.key === "_" ? (ge.preventDefault(), mt()) : ge.key === "0" && (ge.preventDefault(), ie());
8037
8037
  };
8038
8038
  return window.addEventListener("keydown", pe), () => window.removeEventListener("keydown", pe);
8039
8039
  }, [
@@ -8051,8 +8051,8 @@ function pm({
8051
8051
  ]);
8052
8052
  const gt = (pe) => {
8053
8053
  pe.preventDefault();
8054
- const xe = pe.deltaY > 0 ? 1 / c : c;
8055
- nt($ * xe, pe.clientX, pe.clientY);
8054
+ const ge = pe.deltaY > 0 ? 1 / c : c;
8055
+ nt($ * ge, pe.clientX, pe.clientY);
8056
8056
  }, ce = (pe) => {
8057
8057
  $ <= s + 1e-3 || (pe.currentTarget.setPointerCapture(pe.pointerId), Z(!0), oe.current = {
8058
8058
  pointerId: pe.pointerId,
@@ -8062,19 +8062,19 @@ function pm({
8062
8062
  originY: F.y
8063
8063
  });
8064
8064
  }, He = (pe) => {
8065
- const xe = oe.current;
8066
- !xe || xe.pointerId !== pe.pointerId || V(
8067
- ge(
8065
+ const ge = oe.current;
8066
+ !ge || ge.pointerId !== pe.pointerId || V(
8067
+ he(
8068
8068
  {
8069
- x: xe.originX + (pe.clientX - xe.startX),
8070
- y: xe.originY + (pe.clientY - xe.startY)
8069
+ x: ge.originX + (pe.clientX - ge.startX),
8070
+ y: ge.originY + (pe.clientY - ge.startY)
8071
8071
  },
8072
8072
  $
8073
8073
  )
8074
8074
  );
8075
8075
  }, We = (pe) => {
8076
- var xe;
8077
- ((xe = oe.current) == null ? void 0 : xe.pointerId) === pe.pointerId && (oe.current = null, Z(!1));
8076
+ var ge;
8077
+ ((ge = oe.current) == null ? void 0 : ge.pointerId) === pe.pointerId && (oe.current = null, Z(!1));
8078
8078
  }, ft = (pe) => {
8079
8079
  if (pe.stopPropagation(), $ > s + 0.05) {
8080
8080
  ie();
@@ -8084,12 +8084,12 @@ function pm({
8084
8084
  }, Ye = (pe) => {
8085
8085
  if (pe.touches.length !== 2) return;
8086
8086
  Z(!0);
8087
- const [xe, Ae] = [pe.touches[0], pe.touches[1]], Fe = Math.hypot(xe.clientX - Ae.clientX, xe.clientY - Ae.clientY);
8087
+ const [ge, Ae] = [pe.touches[0], pe.touches[1]], Fe = Math.hypot(ge.clientX - Ae.clientX, ge.clientY - Ae.clientY);
8088
8088
  k.current = { distance: Fe, scale: $ };
8089
8089
  }, kt = (pe) => {
8090
8090
  if (pe.touches.length !== 2 || !k.current) return;
8091
8091
  pe.preventDefault();
8092
- const [xe, Ae] = [pe.touches[0], pe.touches[1]], Fe = Math.hypot(xe.clientX - Ae.clientX, xe.clientY - Ae.clientY), De = (xe.clientX + Ae.clientX) / 2, bt = (xe.clientY + Ae.clientY) / 2, ct = k.current.scale * (Fe / Math.max(1, k.current.distance));
8092
+ const [ge, Ae] = [pe.touches[0], pe.touches[1]], Fe = Math.hypot(ge.clientX - Ae.clientX, ge.clientY - Ae.clientY), De = (ge.clientX + Ae.clientX) / 2, bt = (ge.clientY + Ae.clientY) / 2, ct = k.current.scale * (Fe / Math.max(1, k.current.distance));
8093
8093
  nt(ct, De, bt);
8094
8094
  }, lt = () => {
8095
8095
  k.current = null, Z(!1);
@@ -8332,17 +8332,17 @@ function pm({
8332
8332
  },
8333
8333
  role: "tablist",
8334
8334
  "aria-label": "Miniaturas",
8335
- children: n.map((pe, xe) => {
8336
- const Ae = xe === te;
8335
+ children: n.map((pe, ge) => {
8336
+ const Ae = ge === te;
8337
8337
  return /* @__PURE__ */ r(
8338
8338
  "button",
8339
8339
  {
8340
8340
  type: "button",
8341
8341
  role: "tab",
8342
8342
  "aria-selected": Ae,
8343
- "aria-label": pe.alt || `Imagen ${xe + 1}`,
8343
+ "aria-label": pe.alt || `Imagen ${ge + 1}`,
8344
8344
  onClick: (Fe) => {
8345
- Fe.stopPropagation(), fe(xe);
8345
+ Fe.stopPropagation(), fe(ge);
8346
8346
  },
8347
8347
  className: "relative shrink-0 overflow-hidden transition-opacity",
8348
8348
  style: {
@@ -8363,7 +8363,7 @@ function pm({
8363
8363
  }
8364
8364
  )
8365
8365
  },
8366
- `${pe.src}-${xe}`
8366
+ `${pe.src}-${ge}`
8367
8367
  );
8368
8368
  })
8369
8369
  }
@@ -8477,7 +8477,7 @@ function kp({
8477
8477
  J && y.push(J);
8478
8478
  }
8479
8479
  return y;
8480
- }, [Q, e]), U = f === "all" ? W.length : f, ue = W.slice(0, U), D = Math.max(
8480
+ }, [Q, e]), U = f === "all" ? W.length : f, ue = W.slice(0, U), R = Math.max(
8481
8481
  0,
8482
8482
  W.length - ue.length
8483
8483
  ), P = g && W.length > 1, se = /* @__PURE__ */ u("div", { className: "flex max-w-[280px] flex-col gap-1.5 py-0.5", children: [
@@ -8518,7 +8518,7 @@ function kp({
8518
8518
  },
8519
8519
  y.value
8520
8520
  )) })
8521
- ] }), R = _e(() => {
8521
+ ] }), D = _e(() => {
8522
8522
  const y = S.trim();
8523
8523
  return !ne || !y ? n : n.filter((T) => hm(T, y));
8524
8524
  }, [n, S, ne]), oe = me(() => {
@@ -8577,12 +8577,12 @@ function kp({
8577
8577
  window.removeEventListener("resize", oe), window.removeEventListener("scroll", oe, !0);
8578
8578
  };
8579
8579
  }, [C, oe]), le(() => {
8580
- if (R.length === 0) {
8580
+ if (D.length === 0) {
8581
8581
  v(0);
8582
8582
  return;
8583
8583
  }
8584
- v((y) => Math.min(y, R.length - 1));
8585
- }, [R.length]), le(() => {
8584
+ v((y) => Math.min(y, D.length - 1));
8585
+ }, [D.length]), le(() => {
8586
8586
  if (N < 0 || !j.current) return;
8587
8587
  const y = j.current.children[N];
8588
8588
  y == null || y.scrollIntoView({ block: "nearest" });
@@ -8598,16 +8598,16 @@ function kp({
8598
8598
  return;
8599
8599
  }
8600
8600
  if (y.key === "ArrowDown") {
8601
- if (y.preventDefault(), R.length === 0) return;
8602
- v((T) => Math.min(T + 1, R.length - 1));
8601
+ if (y.preventDefault(), D.length === 0) return;
8602
+ v((T) => Math.min(T + 1, D.length - 1));
8603
8603
  return;
8604
8604
  }
8605
8605
  if (y.key === "ArrowUp") {
8606
8606
  y.preventDefault(), v((T) => Math.max(T - 1, 0));
8607
8607
  return;
8608
8608
  }
8609
- if (y.key === "Enter" && R[N] && !R[N].disabled) {
8610
- y.preventDefault(), ee(R[N].value);
8609
+ if (y.key === "Enter" && D[N] && !D[N].disabled) {
8610
+ y.preventDefault(), ee(D[N].value);
8611
8611
  return;
8612
8612
  }
8613
8613
  y.key === "Backspace" && !S && e.length && (y.preventDefault(), k(e.slice(0, -1)));
@@ -8715,7 +8715,7 @@ function kp({
8715
8715
  overscrollBehavior: "contain"
8716
8716
  },
8717
8717
  children: [
8718
- R.map((y, T) => {
8718
+ D.map((y, T) => {
8719
8719
  const J = T === N, fe = Z.has(y.value);
8720
8720
  return /* @__PURE__ */ u(
8721
8721
  "li",
@@ -8777,7 +8777,7 @@ function kp({
8777
8777
  y.value
8778
8778
  );
8779
8779
  }),
8780
- R.length === 0 && /* @__PURE__ */ r(
8780
+ D.length === 0 && /* @__PURE__ */ r(
8781
8781
  "li",
8782
8782
  {
8783
8783
  className: "px-3 py-4 text-center text-sm",
@@ -8858,7 +8858,7 @@ function kp({
8858
8858
  },
8859
8859
  T.value
8860
8860
  )),
8861
- D > 0 && /* @__PURE__ */ u(
8861
+ R > 0 && /* @__PURE__ */ u(
8862
8862
  "span",
8863
8863
  {
8864
8864
  className: "inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-semibold",
@@ -8866,10 +8866,10 @@ function kp({
8866
8866
  background: "color-mix(in srgb, var(--primary) 10%, transparent)",
8867
8867
  color: "var(--primary)"
8868
8868
  },
8869
- "aria-label": `${D} seleccionados más`,
8869
+ "aria-label": `${R} seleccionados más`,
8870
8870
  children: [
8871
8871
  "+",
8872
- D
8872
+ R
8873
8873
  ]
8874
8874
  }
8875
8875
  )
@@ -9253,14 +9253,14 @@ function Cp({
9253
9253
  ), U = _e(() => {
9254
9254
  const J = g ?? xm, fe = m == null ? void 0 : m.map(oa);
9255
9255
  return fe != null && fe.length ? J.filter((ie) => fe.includes(ie.value)) : J;
9256
- }, [m, g]), ue = ((T = U[0]) == null ? void 0 : T.value) ?? "+1", D = U.some(
9256
+ }, [m, g]), ue = ((T = U[0]) == null ? void 0 : T.value) ?? "+1", R = U.some(
9257
9257
  (J) => J.value === oa(d ?? Q)
9258
- ) ? oa(d ?? Q) : ue, P = l !== void 0 ? ll(l) : ne, se = `${D} ${P}`.trim(), R = n && P.length > 0 && !xs(se) ? a : void 0, oe = i ?? R, k = !!oe, ee = k && o !== "tooltip", _ = k && o !== "inline", H = !!I && N === "tooltip" && !ee, de = k ? "border-[var(--danger)] focus-within:border-[var(--danger)]" : "border-[var(--border)] focus-within:border-[var(--primary)]", te = (J) => {
9258
+ ) ? oa(d ?? Q) : ue, P = l !== void 0 ? ll(l) : ne, se = `${R} ${P}`.trim(), D = n && P.length > 0 && !xs(se) ? a : void 0, oe = i ?? D, k = !!oe, ee = k && o !== "tooltip", _ = k && o !== "inline", H = !!I && N === "tooltip" && !ee, de = k ? "border-[var(--danger)] focus-within:border-[var(--danger)]" : "border-[var(--border)] focus-within:border-[var(--primary)]", te = (J) => {
9259
9259
  const fe = J.currentTarget.value;
9260
9260
  l === void 0 && Z(fe), C == null || C(fe, {
9261
- countryCode: D,
9261
+ countryCode: R,
9262
9262
  nationalNumber: fe,
9263
- fullNumber: `${D} ${fe}`.trim()
9263
+ fullNumber: `${R} ${fe}`.trim()
9264
9264
  }), c == null || c(J);
9265
9265
  }, z = (J) => {
9266
9266
  d === void 0 && W(J), f == null || f(J), C == null || C(P, {
@@ -9301,7 +9301,7 @@ function Cp({
9301
9301
  /* @__PURE__ */ r(
9302
9302
  Xr,
9303
9303
  {
9304
- value: D,
9304
+ value: R,
9305
9305
  onChange: z,
9306
9306
  options: U,
9307
9307
  placeholder: h,
@@ -9834,7 +9834,7 @@ function Ms({
9834
9834
  () => document,
9835
9835
  []
9836
9836
  ), d = re(null), b = re(null), f = re(/* @__PURE__ */ new Map()), m = re(null), g = re(!1), h = re(e ?? ""), E = re(t), x = re(() => {
9837
- }), C = re(!1), [A, S] = q(() => !e || e.trim() === ""), [I, N] = q(/* @__PURE__ */ new Set()), [v, $] = q(null), [w, F] = q(""), [V, Y] = q(""), [L, K] = q(""), [j, ne] = q(""), [Z, Q] = q(3), [W, U] = q(3), [ue, D] = q(!0), [P, se] = q(!1), [R, oe] = q(
9837
+ }), C = re(!1), [A, S] = q(() => !e || e.trim() === ""), [I, N] = q(/* @__PURE__ */ new Set()), [v, $] = q(null), [w, F] = q(""), [V, Y] = q(""), [L, K] = q(""), [j, ne] = q(""), [Z, Q] = q(3), [W, U] = q(3), [ue, R] = q(!0), [P, se] = q(!1), [D, oe] = q(
9838
9838
  i === "full"
9839
9839
  ), [k, ee] = q(null), [_, H] = q(null), de = re(null), te = re(!1), z = re(null), y = me(
9840
9840
  () => g.current ? b.current : d.current,
@@ -9858,15 +9858,15 @@ function Ms({
9858
9858
  }
9859
9859
  C.current = !1, h.current = B;
9860
9860
  const X = [d.current, b.current].filter(
9861
- (he) => !!he
9861
+ (xe) => !!xe
9862
9862
  );
9863
- X.forEach((he) => {
9864
- he.innerHTML !== B && (he.innerHTML = B);
9865
- }), S(!B || B.trim() === ""), X.forEach((he) => ho(he));
9866
- const be = X.map((he) => fl(he));
9867
- return () => be.forEach((he) => he());
9863
+ X.forEach((xe) => {
9864
+ xe.innerHTML !== B && (xe.innerHTML = B);
9865
+ }), S(!B || B.trim() === ""), X.forEach((xe) => ho(xe));
9866
+ const be = X.map((xe) => fl(xe));
9867
+ return () => be.forEach((xe) => xe());
9868
9868
  }, [e]), le(() => {
9869
- var he, Ce;
9869
+ var xe, Se;
9870
9870
  g.current = P;
9871
9871
  let B, X = 0, be;
9872
9872
  if (P) {
@@ -9884,7 +9884,7 @@ function Ms({
9884
9884
  X = requestAnimationFrame(Re);
9885
9885
  } else {
9886
9886
  const ye = b.current, Re = d.current, Le = ye ? ia(ye) : h.current, Ke = h.current;
9887
- h.current = Le, Re && Re.innerHTML !== Le && (Re.innerHTML = Le), Le !== Ke && E.current(Le), S(((Ce = (he = ye ?? Re) == null ? void 0 : he.textContent) == null ? void 0 : Ce.trim()) === "");
9887
+ h.current = Le, Re && Re.innerHTML !== Le && (Re.innerHTML = Le), Le !== Ke && E.current(Le), S(((Se = (xe = ye ?? Re) == null ? void 0 : xe.textContent) == null ? void 0 : Se.trim()) === "");
9888
9888
  }
9889
9889
  return () => {
9890
9890
  X && cancelAnimationFrame(X), be && clearTimeout(be), B == null || B();
@@ -9903,18 +9903,18 @@ function Ms({
9903
9903
  "justifyRight",
9904
9904
  "justifyFull"
9905
9905
  ], X = /* @__PURE__ */ new Set();
9906
- B.forEach((he) => {
9906
+ B.forEach((xe) => {
9907
9907
  try {
9908
- c().queryCommandState(he) && X.add(he);
9908
+ c().queryCommandState(xe) && X.add(xe);
9909
9909
  } catch {
9910
9910
  return;
9911
9911
  }
9912
9912
  });
9913
9913
  try {
9914
- const he = Am(
9914
+ const xe = Am(
9915
9915
  c().queryCommandValue("formatBlock")
9916
9916
  );
9917
- he && X.add(`formatBlock:${he}`);
9917
+ xe && X.add(`formatBlock:${xe}`);
9918
9918
  } catch {
9919
9919
  }
9920
9920
  const be = T();
@@ -9927,13 +9927,13 @@ function Ms({
9927
9927
  x.current = fe;
9928
9928
  const ie = me(() => {
9929
9929
  z.current && (clearTimeout(z.current), z.current = null), de.current && (Ss(de.current), de.current = null), te.current = !1, ee(null), H(null);
9930
- }, []), ge = me(() => {
9930
+ }, []), he = me(() => {
9931
9931
  z.current && (clearTimeout(z.current), z.current = null);
9932
9932
  }, []), $e = me(() => {
9933
- ge(), z.current = setTimeout(() => {
9933
+ he(), z.current = setTimeout(() => {
9934
9934
  te.current || ie();
9935
9935
  }, 280);
9936
- }, [ge, ie]);
9936
+ }, [he, ie]);
9937
9937
  le(
9938
9938
  () => () => {
9939
9939
  z.current && clearTimeout(z.current);
@@ -9947,8 +9947,8 @@ function Ms({
9947
9947
  ie();
9948
9948
  return;
9949
9949
  }
9950
- const be = (k == null ? void 0 : k.rowIndex) ?? (_ == null ? void 0 : _.rowIndex) ?? -1, he = (k == null ? void 0 : k.colIndex) ?? (_ == null ? void 0 : _.colIndex) ?? -1;
9951
- Em(B, X, be, he, y()), ie(), x.current(), J();
9950
+ const be = (k == null ? void 0 : k.rowIndex) ?? (_ == null ? void 0 : _.rowIndex) ?? -1, xe = (k == null ? void 0 : k.colIndex) ?? (_ == null ? void 0 : _.colIndex) ?? -1;
9951
+ Em(B, X, be, xe, y()), ie(), x.current(), J();
9952
9952
  },
9953
9953
  [y, ie, J, _, k]
9954
9954
  ), Dt = me(
@@ -9956,51 +9956,51 @@ function Ms({
9956
9956
  if (_) return;
9957
9957
  const X = B.currentTarget, be = B.target;
9958
9958
  if (be.closest(".rich-table-action-bar, .rich-table-context-menu")) {
9959
- ge();
9959
+ he();
9960
9960
  return;
9961
9961
  }
9962
- const he = be.closest("td, th");
9963
- if (!he || !X.contains(he)) {
9962
+ const xe = be.closest("td, th");
9963
+ if (!xe || !X.contains(xe)) {
9964
9964
  $e();
9965
9965
  return;
9966
9966
  }
9967
- const Ce = he.closest("tr"), ye = he.closest("table");
9968
- if (!Ce || !ye || !X.contains(ye)) {
9967
+ const Se = xe.closest("tr"), ye = xe.closest("table");
9968
+ if (!Se || !ye || !X.contains(ye)) {
9969
9969
  $e();
9970
9970
  return;
9971
9971
  }
9972
- ge(), ye.classList.add("rich-table"), de.current = ye, sl(
9972
+ he(), ye.classList.add("rich-table"), de.current = ye, sl(
9973
9973
  ye,
9974
- Ce,
9975
- he.cellIndex
9974
+ Se,
9975
+ xe.cellIndex
9976
9976
  ), ee(
9977
9977
  km(
9978
9978
  ye,
9979
- Ce,
9980
- he
9979
+ Se,
9980
+ xe
9981
9981
  )
9982
9982
  );
9983
9983
  },
9984
- [ge, $e, _]
9984
+ [he, $e, _]
9985
9985
  ), Ht = me(
9986
9986
  (B) => {
9987
9987
  const X = B.relatedTarget;
9988
9988
  if (X instanceof Element && (X.closest(".rich-table-action-bar") || X.closest(".rich-table-context-menu"))) {
9989
- ge();
9989
+ he();
9990
9990
  return;
9991
9991
  }
9992
9992
  $e();
9993
9993
  },
9994
- [ge, $e]
9994
+ [he, $e]
9995
9995
  ), nt = me(
9996
9996
  (B) => {
9997
- const X = B.currentTarget, he = B.target.closest("td, th");
9998
- if (!he || !X.contains(he)) return;
9999
- const Ce = he.closest("tr"), ye = he.closest("table");
10000
- if (!Ce || !ye || !X.contains(ye)) return;
9997
+ const X = B.currentTarget, xe = B.target.closest("td, th");
9998
+ if (!xe || !X.contains(xe)) return;
9999
+ const Se = xe.closest("tr"), ye = xe.closest("table");
10000
+ if (!Se || !ye || !X.contains(ye)) return;
10001
10001
  B.preventDefault(), ye.classList.add("rich-table"), de.current = ye;
10002
- const Re = Array.from(ye.rows).indexOf(Ce), Le = he.cellIndex;
10003
- sl(ye, Ce, Le), ee(null), H({
10002
+ const Re = Array.from(ye.rows).indexOf(Se), Le = xe.cellIndex;
10003
+ sl(ye, Se, Le), ee(null), H({
10004
10004
  x: B.clientX,
10005
10005
  y: B.clientY,
10006
10006
  rowIndex: Re,
@@ -10050,11 +10050,11 @@ function Ms({
10050
10050
  X && !X.isCollapsed ? X.toString() : ""
10051
10051
  ), F("");
10052
10052
  }
10053
- B === "image" && (K(""), ne("")), B === "table" && (Q(3), U(3), D(!0)), $(B);
10053
+ B === "image" && (K(""), ne("")), B === "table" && (Q(3), U(3), R(!0)), $(B);
10054
10054
  }, Ye = () => {
10055
- var he;
10055
+ var xe;
10056
10056
  if (!w.trim()) return;
10057
- We(), (he = y()) == null || he.focus();
10057
+ We(), (xe = y()) == null || xe.focus();
10058
10058
  const B = window.getSelection(), be = (B && !B.isCollapsed ? B.toString() : "") || V.trim() || w.trim();
10059
10059
  c().execCommand(
10060
10060
  "insertHTML",
@@ -10075,7 +10075,7 @@ function Ms({
10075
10075
  !1,
10076
10076
  Mm(Z, W, ue)
10077
10077
  ), fe(), $(null);
10078
- }, Kt = (B, X = 1200, be = 1200, he = 0.72) => new Promise((Ce, ye) => {
10078
+ }, Kt = (B, X = 1200, be = 1200, xe = 0.72) => new Promise((Se, ye) => {
10079
10079
  const Re = new FileReader();
10080
10080
  Re.onerror = ye, Re.onload = (Le) => {
10081
10081
  var nr;
@@ -10090,10 +10090,10 @@ function Ms({
10090
10090
  Rt.width = xt, Rt.height = Xt;
10091
10091
  const ar = Rt.getContext("2d");
10092
10092
  if (!ar) {
10093
- Ce(Ke);
10093
+ Se(Ke);
10094
10094
  return;
10095
10095
  }
10096
- ar.drawImage(Xe, 0, 0, xt, Xt), Ce(Rt.toDataURL("image/jpeg", he));
10096
+ ar.drawImage(Xe, 0, 0, xt, Xt), Se(Rt.toDataURL("image/jpeg", xe));
10097
10097
  }, Xe.src = Ke;
10098
10098
  }, Re.readAsDataURL(B);
10099
10099
  }), pe = (B) => {
@@ -10103,9 +10103,9 @@ function Ms({
10103
10103
  const be = document.createRange();
10104
10104
  be.selectNodeContents(B), be.collapse(!1), X == null || X.removeAllRanges(), X == null || X.addRange(be);
10105
10105
  }
10106
- }, xe = re(() => {
10106
+ }, ge = re(() => {
10107
10107
  });
10108
- xe.current = (B) => {
10108
+ ge.current = (B) => {
10109
10109
  const X = y();
10110
10110
  X && (pe(X), c().execCommand("insertHTML", !1, B), ho(X), X.querySelectorAll("p").forEach((be) => {
10111
10111
  !(be.textContent ?? "").replace(/[\u00a0\s]+/g, "") && !be.querySelector("img, hr, table") && be.remove();
@@ -10118,29 +10118,29 @@ function Ms({
10118
10118
  const De = me((B) => {
10119
10119
  if (!B || f.current.has(B)) return;
10120
10120
  const X = (be) => {
10121
- const he = be.clipboardData;
10122
- if (!he) return;
10123
- const Ce = he.getData("text/html"), ye = he.getData("text/plain");
10124
- if (Ce || ye) {
10121
+ const xe = be.clipboardData;
10122
+ if (!xe) return;
10123
+ const Se = xe.getData("text/html"), ye = xe.getData("text/plain");
10124
+ if (Se || ye) {
10125
10125
  be.preventDefault(), be.stopPropagation();
10126
10126
  try {
10127
- const Xe = Ce ? Wm(Ce) : go(ye);
10127
+ const Xe = Se ? Wm(Se) : go(ye);
10128
10128
  if (!Xe) {
10129
- ye && xe.current(go(ye));
10129
+ ye && ge.current(go(ye));
10130
10130
  return;
10131
10131
  }
10132
- xe.current(Xe);
10132
+ ge.current(Xe);
10133
10133
  } catch {
10134
- ye && xe.current(go(ye));
10134
+ ye && ge.current(go(ye));
10135
10135
  }
10136
10136
  return;
10137
10137
  }
10138
- const Le = Array.from(he.items).find((Xe) => Xe.type.startsWith("image/"));
10138
+ const Le = Array.from(xe.items).find((Xe) => Xe.type.startsWith("image/"));
10139
10139
  if (!Le) return;
10140
10140
  be.preventDefault(), be.stopPropagation();
10141
10141
  const Ke = Le.getAsFile();
10142
10142
  Ke && Ae.current(Ke).then((Xe) => {
10143
- xe.current(
10143
+ ge.current(
10144
10144
  Fe.current(Xe, "imagen")
10145
10145
  );
10146
10146
  });
@@ -10173,15 +10173,15 @@ function Ms({
10173
10173
  const X = window.getSelection(), be = y();
10174
10174
  if (!X || !be || X.rangeCount === 0 || X.isCollapsed)
10175
10175
  return;
10176
- const he = X.getRangeAt(0);
10177
- if (!be.contains(he.startContainer) || !be.contains(he.endContainer))
10176
+ const xe = X.getRangeAt(0);
10177
+ if (!be.contains(xe.startContainer) || !be.contains(xe.endContainer))
10178
10178
  return;
10179
- const Ce = he.toString();
10180
- if (!Ce) return;
10181
- let ye = Ce;
10182
- B === "uppercase" ? ye = Ce.toLocaleUpperCase() : B === "lowercase" ? ye = Ce.toLocaleLowerCase() : ye = $s(Ce), he.deleteContents();
10179
+ const Se = xe.toString();
10180
+ if (!Se) return;
10181
+ let ye = Se;
10182
+ B === "uppercase" ? ye = Se.toLocaleUpperCase() : B === "lowercase" ? ye = Se.toLocaleLowerCase() : ye = $s(Se), xe.deleteContents();
10183
10183
  const Re = document.createTextNode(ye);
10184
- he.insertNode(Re);
10184
+ xe.insertNode(Re);
10185
10185
  const Le = document.createRange();
10186
10186
  Le.setStart(Re, 0), Le.setEnd(Re, ye.length), X.removeAllRanges(), X.addRange(Le), m.current = Le.cloneRange(), fe(), J();
10187
10187
  }, qe = () => {
@@ -10202,12 +10202,12 @@ function Ms({
10202
10202
  return;
10203
10203
  }
10204
10204
  if (B.key === "Tab") {
10205
- const he = window.getSelection(), Ce = ul((he == null ? void 0 : he.anchorNode) ?? null), ye = y(), Re = cl(Ce);
10206
- if (Ce && Re && (ye != null && ye.contains(Ce))) {
10205
+ const xe = window.getSelection(), Se = ul((xe == null ? void 0 : xe.anchorNode) ?? null), ye = y(), Re = cl(Se);
10206
+ if (Se && Re && (ye != null && ye.contains(Se))) {
10207
10207
  B.preventDefault();
10208
- const Le = Cm(Re), Ke = Le.indexOf(Ce), Xe = Ke >= 0 ? Le[Ke + 1] : null;
10208
+ const Le = Cm(Re), Ke = Le.indexOf(Se), Xe = Ke >= 0 ? Le[Ke + 1] : null;
10209
10209
  if (Xe) fa(Xe, ye, !0);
10210
- else if (dl(Ce, Re)) {
10210
+ else if (dl(Se, Re)) {
10211
10211
  const nr = Fo(Re);
10212
10212
  nr && fa(nr, ye, !0);
10213
10213
  }
@@ -10218,8 +10218,8 @@ function Ms({
10218
10218
  return;
10219
10219
  }
10220
10220
  if (B.key === "Enter" && !B.shiftKey && !(B.metaKey || B.ctrlKey)) {
10221
- const he = window.getSelection(), Ce = ul((he == null ? void 0 : he.anchorNode) ?? null), ye = y(), Re = cl(Ce);
10222
- if (Ce && Re && (ye != null && ye.contains(Ce)) && dl(Ce, Re) && Tm(Ce)) {
10221
+ const xe = window.getSelection(), Se = ul((xe == null ? void 0 : xe.anchorNode) ?? null), ye = y(), Re = cl(Se);
10222
+ if (Se && Re && (ye != null && ye.contains(Se)) && dl(Se, Re) && Tm(Se)) {
10223
10223
  B.preventDefault();
10224
10224
  const Le = Fo(Re);
10225
10225
  Le && fa(Le, ye, !0), fe(), J();
@@ -10247,8 +10247,8 @@ function Ms({
10247
10247
  className: "h-4 w-px flex-shrink-0 mx-1",
10248
10248
  style: { background: "var(--border)" }
10249
10249
  }
10250
- ), Be = (B, X, be, he, Ce) => {
10251
- const ye = Ce ?? (I.has(be) || be === "__link" && v === "link" || be === "__img" && v === "image" || be === "__table" && v === "table");
10250
+ ), Be = (B, X, be, xe, Se) => {
10251
+ const ye = Se ?? (I.has(be) || be === "__link" && v === "link" || be === "__img" && v === "image" || be === "__table" && v === "table");
10252
10252
  return /* @__PURE__ */ r(
10253
10253
  "button",
10254
10254
  {
@@ -10257,7 +10257,7 @@ function Ms({
10257
10257
  tabIndex: -1,
10258
10258
  onFocus: pt,
10259
10259
  onMouseDown: (Re) => {
10260
- Re.preventDefault(), he ? he() : mt(be);
10260
+ Re.preventDefault(), xe ? xe() : mt(be);
10261
10261
  },
10262
10262
  className: "flex h-7 w-7 items-center justify-center rounded text-xs font-bold transition-colors",
10263
10263
  style: {
@@ -10276,18 +10276,18 @@ function Ms({
10276
10276
  be && (be.remove(), fe());
10277
10277
  }
10278
10278
  }, Ln = () => {
10279
- ge(), te.current = !0;
10279
+ he(), te.current = !0;
10280
10280
  }, ht = () => {
10281
10281
  te.current = !1, $e();
10282
- }, Et = (B, X, be, he = !1) => /* @__PURE__ */ r(
10282
+ }, Et = (B, X, be, xe = !1) => /* @__PURE__ */ r(
10283
10283
  "button",
10284
10284
  {
10285
10285
  type: "button",
10286
- className: `rich-table-action-btn${he ? " rich-table-action-btn--danger" : ""}`,
10286
+ className: `rich-table-action-btn${xe ? " rich-table-action-btn--danger" : ""}`,
10287
10287
  title: B,
10288
10288
  "aria-label": B,
10289
- onMouseDown: (Ce) => {
10290
- Ce.preventDefault(), Ce.stopPropagation(), Ie(be);
10289
+ onMouseDown: (Se) => {
10290
+ Se.preventDefault(), Se.stopPropagation(), Ie(be);
10291
10291
  },
10292
10292
  children: X
10293
10293
  }
@@ -10514,7 +10514,7 @@ function Ms({
10514
10514
  {
10515
10515
  type: "checkbox",
10516
10516
  checked: ue,
10517
- onChange: (X) => D(X.target.checked)
10517
+ onChange: (X) => R(X.target.checked)
10518
10518
  }
10519
10519
  ),
10520
10520
  "Encabezado"
@@ -10611,51 +10611,55 @@ function Ms({
10611
10611
  }
10612
10612
  )
10613
10613
  ] }), Mr = (B, X) => {
10614
- const be = i === "full" || R || B;
10614
+ const be = i === "compact";
10615
10615
  return /* @__PURE__ */ u(
10616
10616
  "div",
10617
10617
  {
10618
10618
  className: "flex flex-shrink-0 flex-wrap items-center gap-0.5 border-t px-2 py-1",
10619
10619
  style: { borderColor: "var(--border)", background: X },
10620
+ "data-toolbar-variant": i,
10620
10621
  children: [
10621
- Be(/* @__PURE__ */ r("b", { children: "B" }), "Negrita (Ctrl+B)", "bold"),
10622
- Be(/* @__PURE__ */ r("i", { children: "I" }), "Cursiva (Ctrl+I)", "italic"),
10623
- Be(/* @__PURE__ */ r("u", { children: "U" }), "Subrayado (Ctrl+U)", "underline"),
10624
- Be(
10625
- /* @__PURE__ */ r(Ao, { className: "h-4 w-4" }),
10626
- "Lista sin orden",
10627
- "insertUnorderedList"
10628
- ),
10629
- Be(
10630
- /* @__PURE__ */ r(Kc, { className: "h-4 w-4" }),
10631
- "Lista numerada",
10632
- "insertOrderedList"
10633
- ),
10634
- Be(
10635
- /* @__PURE__ */ r(ql, { className: "h-4 w-4" }),
10636
- "Insertar enlace (Ctrl+K)",
10637
- "__link",
10638
- () => ft("link")
10639
- ),
10640
- i === "compact" && !B && /* @__PURE__ */ u(
10622
+ be && !B && /* @__PURE__ */ u(
10641
10623
  "button",
10642
10624
  {
10643
10625
  type: "button",
10644
- title: R ? "Ocultar herramientas" : "Mostrar más herramientas",
10626
+ title: D ? "Ocultar herramientas" : "Mostrar herramientas de formato",
10645
10627
  tabIndex: -1,
10646
10628
  onFocus: pt,
10647
- onMouseDown: (he) => {
10648
- he.preventDefault(), oe((Ce) => !Ce);
10629
+ onMouseDown: (Se) => {
10630
+ Se.preventDefault(), oe((ye) => !ye);
10631
+ },
10632
+ className: "flex h-7 items-center gap-1 rounded px-1.5 text-[10px] font-semibold transition-colors",
10633
+ style: {
10634
+ color: "var(--text-secondary)",
10635
+ background: D ? "color-mix(in srgb, var(--primary) 12%, transparent)" : "transparent"
10649
10636
  },
10650
- className: "ml-0.5 flex h-7 items-center gap-0.5 rounded px-1.5 text-[10px] font-semibold transition-colors",
10651
- style: { color: "var(--text-secondary)" },
10652
10637
  children: [
10653
- R ? /* @__PURE__ */ r(vn, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(wt, { className: "h-3.5 w-3.5" }),
10654
- R ? "Menos" : "Más"
10638
+ D ? /* @__PURE__ */ r(vn, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(wt, { className: "h-3.5 w-3.5" }),
10639
+ D ? "Ocultar herramientas" : "Herramientas"
10655
10640
  ]
10656
10641
  }
10657
10642
  ),
10658
- be && /* @__PURE__ */ u(Pe, { children: [
10643
+ (!be || D || B) && /* @__PURE__ */ u(Pe, { children: [
10644
+ Be(/* @__PURE__ */ r("b", { children: "B" }), "Negrita (Ctrl+B)", "bold"),
10645
+ Be(/* @__PURE__ */ r("i", { children: "I" }), "Cursiva (Ctrl+I)", "italic"),
10646
+ Be(/* @__PURE__ */ r("u", { children: "U" }), "Subrayado (Ctrl+U)", "underline"),
10647
+ Be(
10648
+ /* @__PURE__ */ r(Ao, { className: "h-4 w-4" }),
10649
+ "Lista sin orden",
10650
+ "insertUnorderedList"
10651
+ ),
10652
+ Be(
10653
+ /* @__PURE__ */ r(Kc, { className: "h-4 w-4" }),
10654
+ "Lista numerada",
10655
+ "insertOrderedList"
10656
+ ),
10657
+ Be(
10658
+ /* @__PURE__ */ r(ql, { className: "h-4 w-4" }),
10659
+ "Insertar enlace (Ctrl+K)",
10660
+ "__link",
10661
+ () => ft("link")
10662
+ ),
10659
10663
  dt(),
10660
10664
  Be(
10661
10665
  /* @__PURE__ */ r(Xc, { className: "h-4 w-4" }),
@@ -10794,8 +10798,8 @@ function Ms({
10794
10798
  title: B ? "Salir del modo de enfoque (Esc)" : "Modo de enfoque",
10795
10799
  tabIndex: -1,
10796
10800
  onFocus: pt,
10797
- onMouseDown: (he) => {
10798
- he.preventDefault(), zt(B);
10801
+ onMouseDown: (Se) => {
10802
+ Se.preventDefault(), zt(B);
10799
10803
  },
10800
10804
  className: "flex h-7 w-7 items-center justify-center rounded transition-colors",
10801
10805
  style: { color: "var(--text-secondary)" },
@@ -11522,7 +11526,7 @@ function bf({
11522
11526
  };
11523
11527
  return T && T.query === J.query && T.top === J.top && T.bottom === J.bottom && T.left === J.left && T.maxHeight === J.maxHeight ? T : J;
11524
11528
  });
11525
- }, [U]), D = me(
11529
+ }, [U]), R = me(
11526
11530
  (k) => {
11527
11531
  t(k), ue();
11528
11532
  },
@@ -11656,8 +11660,8 @@ function bf({
11656
11660
  if (z.key !== "Backspace" && z.key !== "Delete") return;
11657
11661
  const J = window.getSelection();
11658
11662
  if (J && !J.isCollapsed && J.rangeCount > 0) {
11659
- const ge = J.getRangeAt(0);
11660
- if (y.contains(ge.commonAncestorContainer) && hl(y).length > 0 && af(ge)) {
11663
+ const he = J.getRangeAt(0);
11664
+ if (y.contains(he.commonAncestorContainer) && hl(y).length > 0 && af(he)) {
11661
11665
  z.preventDefault(), z.stopPropagation(), of(y) && k(y);
11662
11666
  return;
11663
11667
  }
@@ -11665,14 +11669,14 @@ function bf({
11665
11669
  const fe = hl(y);
11666
11670
  if (fe.length > 0) {
11667
11671
  z.preventDefault(), z.stopPropagation();
11668
- for (const ge of fe) vo(ge);
11672
+ for (const he of fe) vo(he);
11669
11673
  xn(y), k(y);
11670
11674
  return;
11671
11675
  }
11672
11676
  if (z.key === "Backspace") {
11673
- const ge = lf(y);
11674
- if (!ge) return;
11675
- z.preventDefault(), z.stopPropagation(), vo(ge), xn(y), k(y);
11677
+ const he = lf(y);
11678
+ if (!he) return;
11679
+ z.preventDefault(), z.stopPropagation(), vo(he), xn(y), k(y);
11676
11680
  return;
11677
11681
  }
11678
11682
  const ie = sf(y);
@@ -11727,7 +11731,7 @@ function bf({
11727
11731
  );
11728
11732
  k == null || k.scrollIntoView({ block: "nearest" });
11729
11733
  }, [F, N]);
11730
- const R = d ? Qm(e) : e, oe = N && ne ? Nt(
11734
+ const D = d ? Qm(e) : e, oe = N && ne ? Nt(
11731
11735
  /* @__PURE__ */ u(
11732
11736
  "ul",
11733
11737
  {
@@ -11796,8 +11800,8 @@ function bf({
11796
11800
  /* @__PURE__ */ r(
11797
11801
  Ms,
11798
11802
  {
11799
- value: R,
11800
- onChange: D,
11803
+ value: D,
11804
+ onChange: R,
11801
11805
  placeholder: i,
11802
11806
  minHeight: o,
11803
11807
  instanceId: m,
@@ -12017,13 +12021,13 @@ function Rp({
12017
12021
  }, []), j = me(() => {
12018
12022
  const W = v.current;
12019
12023
  if (!W) return;
12020
- const U = W.getBoundingClientRect(), ue = Math.max(U.width, vf[a]), D = Math.min(Math.max(t.length, 1) * 38 + 12, 260), P = window.innerHeight - U.bottom, se = P < D && U.top > P, R = Math.min(
12024
+ const U = W.getBoundingClientRect(), ue = Math.max(U.width, vf[a]), R = Math.min(Math.max(t.length, 1) * 38 + 12, 260), P = window.innerHeight - U.bottom, se = P < R && U.top > P, D = Math.min(
12021
12025
  Math.max(8, U.left + U.width / 2 - ue / 2),
12022
12026
  window.innerWidth - ue - 8
12023
12027
  );
12024
12028
  N({
12025
12029
  position: "fixed",
12026
- left: R,
12030
+ left: D,
12027
12031
  top: se ? void 0 : U.bottom + 6,
12028
12032
  bottom: se ? window.innerHeight - U.top + 6 : void 0,
12029
12033
  width: ue,
@@ -12043,9 +12047,9 @@ function Rp({
12043
12047
  }, [h, t, j, e]), le(() => {
12044
12048
  if (!h) return;
12045
12049
  function W(U) {
12046
- var D, P;
12050
+ var R, P;
12047
12051
  const ue = U.target;
12048
- !((D = v.current) != null && D.contains(ue)) && !((P = $.current) != null && P.contains(ue)) && K();
12052
+ !((R = v.current) != null && R.contains(ue)) && !((P = $.current) != null && P.contains(ue)) && K();
12049
12053
  }
12050
12054
  return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
12051
12055
  }, [K, h]), le(() => {
@@ -12113,7 +12117,7 @@ function Rp({
12113
12117
  overscrollBehavior: "contain"
12114
12118
  },
12115
12119
  children: t.map((W, U) => {
12116
- const ue = W.value === e, D = U === A, P = {
12120
+ const ue = W.value === e, R = U === A, P = {
12117
12121
  ...W.tone ? vl[W.tone] : void 0,
12118
12122
  ...W.style
12119
12123
  };
@@ -12136,7 +12140,7 @@ function Rp({
12136
12140
  ),
12137
12141
  style: {
12138
12142
  ...ue ? P : void 0,
12139
- background: ue ? P.background ?? "color-mix(in srgb, var(--primary) 12%, transparent)" : D ? "var(--bg-hover)" : "transparent",
12143
+ background: ue ? P.background ?? "color-mix(in srgb, var(--primary) 12%, transparent)" : R ? "var(--bg-hover)" : "transparent",
12140
12144
  color: ue ? P.color ?? "var(--primary)" : "var(--text-main)"
12141
12145
  },
12142
12146
  children: [
@@ -12340,7 +12344,7 @@ function Op({
12340
12344
  return y >= 0 && y < de;
12341
12345
  });
12342
12346
  L(te), de >= 0 && F > de && K(H);
12343
- }, D = () => F <= 0 ? !1 : W(e[F - 1].id), P = () => {
12347
+ }, R = () => F <= 0 ? !1 : W(e[F - 1].id), P = () => {
12344
12348
  const H = e[F + 1];
12345
12349
  return H ? W(H.id) : !1;
12346
12350
  }, se = {
@@ -12353,10 +12357,10 @@ function Op({
12353
12357
  uncompleteStep: ue,
12354
12358
  goToStep: W,
12355
12359
  goNext: P,
12356
- goPrevious: D
12360
+ goPrevious: R
12357
12361
  };
12358
12362
  if (!V) return null;
12359
- const R = e[F + 1], oe = F > 0, k = R ? Q(R.id) : !1, ee = typeof V.content == "function" ? V.content(se) : V.content;
12363
+ const D = e[F + 1], oe = F > 0, k = D ? Q(D.id) : !1, ee = typeof V.content == "function" ? V.content(se) : V.content;
12360
12364
  return /* @__PURE__ */ u(
12361
12365
  "section",
12362
12366
  {
@@ -12485,7 +12489,7 @@ function Op({
12485
12489
  padding: "0 14px",
12486
12490
  icon: /* @__PURE__ */ r(tr, {}),
12487
12491
  disabled: !oe,
12488
- onClick: D,
12492
+ onClick: R,
12489
12493
  children: b
12490
12494
  }
12491
12495
  ),
@@ -12508,9 +12512,9 @@ function Op({
12508
12512
  height: 38,
12509
12513
  padding: "0 14px",
12510
12514
  icon: /* @__PURE__ */ r(Vt, {}),
12511
- disabled: !R || !k,
12515
+ disabled: !D || !k,
12512
12516
  onClick: P,
12513
- children: R && !k ? m : f
12517
+ children: D && !k ? m : f
12514
12518
  }
12515
12519
  )
12516
12520
  ]
@@ -12834,7 +12838,7 @@ function _p({
12834
12838
  J = !0;
12835
12839
  break;
12836
12840
  }
12837
- if (!c && y.some((ge) => ge.value.toLowerCase() === ie.toLowerCase())) {
12841
+ if (!c && y.some((he) => he.value.toLowerCase() === ie.toLowerCase())) {
12838
12842
  J = !0;
12839
12843
  continue;
12840
12844
  }
@@ -12850,7 +12854,7 @@ function _p({
12850
12854
  }
12851
12855
  return T && U(y), J && W(), T;
12852
12856
  }
12853
- function D(z) {
12857
+ function R(z) {
12854
12858
  return ue([z]);
12855
12859
  }
12856
12860
  function P(z) {
@@ -12873,7 +12877,7 @@ function _p({
12873
12877
  U(I.map((J) => J.id === z ? { ...J, value: T } : J));
12874
12878
  }
12875
12879
  }
12876
- function R(z) {
12880
+ function D(z) {
12877
12881
  o || (w(z.id), V(z.value), setTimeout(() => {
12878
12882
  var y;
12879
12883
  return (y = Z.current) == null ? void 0 : y.select();
@@ -12881,7 +12885,7 @@ function _p({
12881
12885
  }
12882
12886
  function oe(z) {
12883
12887
  if (z.key === "Enter" || l.includes(z.key)) {
12884
- z.preventDefault(), D(N) && v("");
12888
+ z.preventDefault(), R(N) && v("");
12885
12889
  return;
12886
12890
  }
12887
12891
  if (z.key === "Backspace" && N === "" && I.length > 0) {
@@ -12918,7 +12922,7 @@ function _p({
12918
12922
  }
12919
12923
  function H() {
12920
12924
  const z = N.trim();
12921
- z && D(z) && v("");
12925
+ z && R(z) && v("");
12922
12926
  }
12923
12927
  const de = x ? "var(--danger)" : Y ? "var(--primary)" : "var(--border)", te = s !== void 0 && I.length >= s;
12924
12928
  return /* @__PURE__ */ u("div", { className: `flex flex-col gap-2 ${i}`, children: [
@@ -12993,7 +12997,7 @@ function _p({
12993
12997
  disabled: o,
12994
12998
  tabIndex: -1,
12995
12999
  onClick: (T) => {
12996
- T.stopPropagation(), R(z);
13000
+ T.stopPropagation(), D(z);
12997
13001
  },
12998
13002
  className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded opacity-60 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none",
12999
13003
  children: /* @__PURE__ */ r(Kl, { className: "h-3 w-3" })
@@ -13128,8 +13132,8 @@ function ua({
13128
13132
  onBack: m,
13129
13133
  setColumnRef: g
13130
13134
  }) {
13131
- const h = re(null), E = re(null), x = re(null), C = re(""), A = re(0), S = re(!1), [I, N] = q(t), [v, $] = q(""), w = me((R) => {
13132
- C.current = R, $(R);
13135
+ const h = re(null), E = re(null), x = re(null), C = re(""), A = re(0), S = re(!1), [I, N] = q(t), [v, $] = q(""), w = me((D) => {
13136
+ C.current = D, $(D);
13133
13137
  }, []), F = _e(
13134
13138
  () => [
13135
13139
  ...Array(kl).fill(""),
@@ -13138,30 +13142,30 @@ function ua({
13138
13142
  ],
13139
13143
  [e]
13140
13144
  ), V = me(() => {
13141
- const R = h.current;
13142
- if (!R) return t;
13143
- const oe = Sl(R.scrollTop), k = Math.min(Math.max(oe, 0), e.length - 1);
13145
+ const D = h.current;
13146
+ if (!D) return t;
13147
+ const oe = Sl(D.scrollTop), k = Math.min(Math.max(oe, 0), e.length - 1);
13144
13148
  return e[k] ?? t;
13145
13149
  }, [t, e]), Y = me(
13146
- (R, oe = !0) => {
13147
- const k = Math.min(Math.max(R, 0), e.length - 1), ee = e[k], _ = h.current;
13150
+ (D, oe = !0) => {
13151
+ const k = Math.min(Math.max(D, 0), e.length - 1), ee = e[k], _ = h.current;
13148
13152
  !_ || !ee || (E.current && (window.clearTimeout(E.current), E.current = null), S.current = !0, A.current = k, _.scrollTop = El(k), N(ee), oe && ee !== t && n(ee));
13149
13153
  },
13150
13154
  [n, t, e]
13151
13155
  );
13152
13156
  Aa(() => {
13153
13157
  E.current && (window.clearTimeout(E.current), E.current = null), x.current && (window.clearTimeout(x.current), x.current = null), w(""), N(t);
13154
- const R = e.indexOf(t);
13155
- if (R >= 0 && (A.current = R), R < 0 || !h.current) return;
13156
- const oe = El(R);
13158
+ const D = e.indexOf(t);
13159
+ if (D >= 0 && (A.current = D), D < 0 || !h.current) return;
13160
+ const oe = El(D);
13157
13161
  h.current.scrollTop !== oe && (h.current.scrollTop = oe);
13158
13162
  }, [o, t, w, e]);
13159
13163
  const L = me(() => {
13160
13164
  x.current && (window.clearTimeout(x.current), x.current = null);
13161
13165
  }, []), K = me(
13162
- (R, oe = !1) => {
13166
+ (D, oe = !1) => {
13163
13167
  L(), w("");
13164
- const k = Number(R);
13168
+ const k = Number(D);
13165
13169
  if (!Number.isFinite(k)) return;
13166
13170
  const ee = Math.min(s, Math.max(0, k));
13167
13171
  let _ = et(ee), H = e.indexOf(_);
@@ -13176,42 +13180,42 @@ function ua({
13176
13180
  },
13177
13181
  [L, s, f, Y, w, e]
13178
13182
  ), j = me(
13179
- (R) => {
13183
+ (D) => {
13180
13184
  const oe = Math.floor(s / 10), k = C.current;
13181
13185
  if (k === "") {
13182
- if (R > oe) {
13183
- K(String(R), !0);
13186
+ if (D > oe) {
13187
+ K(String(D), !0);
13184
13188
  return;
13185
13189
  }
13186
- const _ = String(R);
13190
+ const _ = String(D);
13187
13191
  w(_), x.current = window.setTimeout(() => {
13188
13192
  K(C.current, !0);
13189
13193
  }, 1200);
13190
13194
  return;
13191
13195
  }
13192
13196
  L();
13193
- const ee = +`${k}${R}`;
13194
- ee <= s ? K(String(ee), !0) : K(String(R), !0);
13197
+ const ee = +`${k}${D}`;
13198
+ ee <= s ? K(String(ee), !0) : K(String(D), !0);
13195
13199
  },
13196
13200
  [L, K, s, w]
13197
13201
  ), ne = me(
13198
- (R) => {
13199
- L(), w(""), Y(A.current + R);
13202
+ (D) => {
13203
+ L(), w(""), Y(A.current + D);
13200
13204
  },
13201
13205
  [L, Y, w]
13202
- ), Z = (R) => {
13206
+ ), Z = (D) => {
13203
13207
  if (c) {
13204
- R.key === "a" || R.key === "A" ? (R.preventDefault(), n("AM"), f == null || f()) : R.key === "p" || R.key === "P" ? (R.preventDefault(), n("PM"), f == null || f()) : R.key === "ArrowUp" || R.key === "ArrowDown" ? (R.preventDefault(), n(t === "AM" ? "PM" : "AM")) : R.key === "Tab" && (R.preventDefault(), R.shiftKey ? m == null || m() : f == null || f());
13208
+ D.key === "a" || D.key === "A" ? (D.preventDefault(), n("AM"), f == null || f()) : D.key === "p" || D.key === "P" ? (D.preventDefault(), n("PM"), f == null || f()) : D.key === "ArrowUp" || D.key === "ArrowDown" ? (D.preventDefault(), n(t === "AM" ? "PM" : "AM")) : D.key === "Tab" && (D.preventDefault(), D.shiftKey ? m == null || m() : f == null || f());
13205
13209
  return;
13206
13210
  }
13207
- if (/^\d$/.test(R.key)) {
13208
- R.preventDefault(), j(Number(R.key));
13211
+ if (/^\d$/.test(D.key)) {
13212
+ D.preventDefault(), j(Number(D.key));
13209
13213
  return;
13210
13214
  }
13211
- R.key === "ArrowUp" ? (R.preventDefault(), ne(-1)) : R.key === "ArrowDown" ? (R.preventDefault(), ne(1)) : R.key === "Tab" && (R.preventDefault(), L(), C.current !== "" && K(C.current, !1), R.shiftKey ? m == null || m() : f == null || f());
13215
+ D.key === "ArrowUp" ? (D.preventDefault(), ne(-1)) : D.key === "ArrowDown" ? (D.preventDefault(), ne(1)) : D.key === "Tab" && (D.preventDefault(), L(), C.current !== "" && K(C.current, !1), D.shiftKey ? m == null || m() : f == null || f());
13212
13216
  }, Q = me(() => {
13213
- const R = a.current, oe = h.current;
13214
- oe && R === a.current && Y(Sl(oe.scrollTop));
13217
+ const D = a.current, oe = h.current;
13218
+ oe && D === a.current && Y(Sl(oe.scrollTop));
13215
13219
  }, [Y, a]), W = () => {
13216
13220
  if (C.current !== "") return;
13217
13221
  if (S.current) {
@@ -13223,11 +13227,11 @@ function ua({
13223
13227
  return;
13224
13228
  }
13225
13229
  N(V()), E.current && window.clearTimeout(E.current);
13226
- const R = a.current;
13230
+ const D = a.current;
13227
13231
  E.current = window.setTimeout(() => {
13228
- R === a.current && Q();
13232
+ D === a.current && Q();
13229
13233
  }, 100);
13230
- }, U = "absolute left-0 right-0 z-40 flex items-center justify-center border-0 bg-transparent p-0 transition-opacity duration-150 hover:opacity-80 focus:outline-none", ue = $t * ti, D = ue + Jt * 2, P = v !== "" ? v : null, se = P !== null;
13234
+ }, U = "absolute left-0 right-0 z-40 flex items-center justify-center border-0 bg-transparent p-0 transition-opacity duration-150 hover:opacity-80 focus:outline-none", ue = $t * ti, R = ue + Jt * 2, P = v !== "" ? v : null, se = P !== null;
13231
13235
  return /* @__PURE__ */ u(
13232
13236
  "div",
13233
13237
  {
@@ -13246,7 +13250,7 @@ function ua({
13246
13250
  className: "relative shrink-0 rounded-lg outline-none",
13247
13251
  style: {
13248
13252
  width: i,
13249
- height: D,
13253
+ height: R,
13250
13254
  boxShadow: d ? "0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent)" : "none"
13251
13255
  },
13252
13256
  children: [
@@ -13280,17 +13284,17 @@ function ua({
13280
13284
  onScroll: W,
13281
13285
  onMouseUp: Q,
13282
13286
  onTouchEnd: Q,
13283
- children: F.map((R, oe) => {
13284
- const k = R !== "" && R === I;
13287
+ children: F.map((D, oe) => {
13288
+ const k = D !== "" && D === I;
13285
13289
  return /* @__PURE__ */ r(
13286
13290
  "button",
13287
13291
  {
13288
13292
  type: "button",
13289
13293
  tabIndex: -1,
13290
- disabled: !R,
13294
+ disabled: !D,
13291
13295
  onClick: () => {
13292
- if (!R) return;
13293
- const ee = e.indexOf(R);
13296
+ if (!D) return;
13297
+ const ee = e.indexOf(D);
13294
13298
  ee >= 0 && Y(ee);
13295
13299
  },
13296
13300
  className: "flex w-full items-center justify-center tabular-nums leading-none disabled:cursor-default",
@@ -13300,11 +13304,11 @@ function ua({
13300
13304
  color: k ? "var(--text-main)" : "var(--text-muted)",
13301
13305
  fontSize: k ? 16 : 14,
13302
13306
  fontWeight: k ? 600 : 400,
13303
- opacity: R ? se ? k ? 0 : 0.35 : k ? 1 : 0.35 : 0
13307
+ opacity: D ? se ? k ? 0 : 0.35 : k ? 1 : 0.35 : 0
13304
13308
  },
13305
- children: R
13309
+ children: D
13306
13310
  },
13307
- `wheel-${oe}-${R}`
13311
+ `wheel-${oe}-${D}`
13308
13312
  );
13309
13313
  })
13310
13314
  }
@@ -13383,8 +13387,8 @@ function Hf({
13383
13387
  return o && ie.push("second"), m && ie.push("meridiem"), ie;
13384
13388
  }, [m, o]), Z = me(
13385
13389
  (ie) => {
13386
- j((ge) => {
13387
- const $e = ne.indexOf(ge);
13390
+ j((he) => {
13391
+ const $e = ne.indexOf(he);
13388
13392
  return ne[($e + ie + ne.length) % ne.length];
13389
13393
  });
13390
13394
  },
@@ -13399,8 +13403,8 @@ function Hf({
13399
13403
  }, []), le(() => {
13400
13404
  if (e === g.current) return;
13401
13405
  g.current = e;
13402
- const ie = zo(e, qr()), ge = ba(ie);
13403
- C(et(m ? ge.hour12 : ie.hour24)), S(et(ie.minute)), N(et(ie.second)), $(ge.meridiem);
13406
+ const ie = zo(e, qr()), he = ba(ie);
13407
+ C(et(m ? he.hour12 : ie.hour24)), S(et(ie.minute)), N(et(ie.second)), $(he.meridiem);
13404
13408
  }, [m, e]);
13405
13409
  const Q = _e(
13406
13410
  () => (m ? No(1, 12) : No(0, 23)).map(
@@ -13410,7 +13414,7 @@ function Hf({
13410
13414
  ), W = _e(
13411
13415
  () => No(0, 59).map((ie) => et(ie)),
13412
13416
  []
13413
- ), U = W, ue = _e(() => ["AM", "PM"], []), D = me(() => m ? fn({
13417
+ ), U = W, ue = _e(() => ["AM", "PM"], []), R = me(() => m ? fn({
13414
13418
  hour12: Number(x),
13415
13419
  minute: Number(A),
13416
13420
  second: Number(I),
@@ -13422,13 +13426,13 @@ function Hf({
13422
13426
  }, [x, m, v, A, I]), P = me(
13423
13427
  (ie) => {
13424
13428
  if (Y.current) return;
13425
- const ge = Nn(ie, o);
13426
- g.current = ge, t(ge);
13429
+ const he = Nn(ie, o);
13430
+ g.current = he, t(he);
13427
13431
  },
13428
13432
  [t, o]
13429
13433
  ), se = me(() => {
13430
- P(D());
13431
- }, [D, P]), R = (ie) => {
13434
+ P(R());
13435
+ }, [R, P]), D = (ie) => {
13432
13436
  C(ie), f && P(
13433
13437
  m ? fn({
13434
13438
  hour12: Number(ie),
@@ -13478,8 +13482,8 @@ function Hf({
13478
13482
  );
13479
13483
  }, _ = me(() => (V.current += 1, F(V.current), V.current), []), H = me(
13480
13484
  (ie) => {
13481
- const ge = ba(ie), $e = Nn(ie, o);
13482
- g.current = $e, C(et(m ? ge.hour12 : ie.hour24)), S(et(ie.minute)), N(et(ie.second)), $(ge.meridiem), t($e);
13485
+ const he = ba(ie), $e = Nn(ie, o);
13486
+ g.current = $e, C(et(m ? he.hour12 : ie.hour24)), S(et(ie.minute)), N(et(ie.second)), $(he.meridiem), t($e);
13483
13487
  },
13484
13488
  [m, t, o]
13485
13489
  ), de = () => {
@@ -13540,7 +13544,7 @@ function Hf({
13540
13544
  forceSyncAt: w,
13541
13545
  values: Q,
13542
13546
  selected: x,
13543
- onSelect: R,
13547
+ onSelect: D,
13544
13548
  label: "Horas",
13545
13549
  maxNumeric: m ? 12 : 23,
13546
13550
  isFocused: K === "hour",
@@ -14416,14 +14420,14 @@ function zp({
14416
14420
  }
14417
14421
  let V = 0;
14418
14422
  const Y = [], L = () => {
14419
- const U = f.current, ue = U == null ? void 0 : U.parentElement, D = document.querySelector(
14423
+ const U = f.current, ue = U == null ? void 0 : U.parentElement, R = document.querySelector(
14420
14424
  "[data-app-scroll='true']"
14421
- ), P = So(D) ?? D;
14425
+ ), P = So(R) ?? R;
14422
14426
  if (!U || !ue || !P) {
14423
14427
  S(null);
14424
14428
  return;
14425
14429
  }
14426
- const se = ue.getBoundingClientRect(), R = window.getComputedStyle(ue), oe = P.getBoundingClientRect(), k = P instanceof HTMLElement && P.clientWidth > 0 ? P.clientWidth : oe.width, ee = se.left + parseFloat(R.paddingLeft || "0"), _ = {
14430
+ const se = ue.getBoundingClientRect(), D = window.getComputedStyle(ue), oe = P.getBoundingClientRect(), k = P instanceof HTMLElement && P.clientWidth > 0 ? P.clientWidth : oe.width, ee = se.left + parseFloat(D.paddingLeft || "0"), _ = {
14427
14431
  marginLeft: Math.round(oe.left - ee),
14428
14432
  width: Math.round(k)
14429
14433
  };
@@ -16194,14 +16198,14 @@ function eh({
16194
16198
  return k.addEventListener("change", ee), () => k.removeEventListener("change", ee);
16195
16199
  }, []), s) return /* @__PURE__ */ r(At, { height: i });
16196
16200
  if (!v.length) return /* @__PURE__ */ r(Lt, { height: i, text: c });
16197
- const w = E > 0 && !I, F = E, V = Math.min(90, Math.max(40, Math.round(E / 8))), Y = Math.round(F * 0.15), L = v.length * V + Math.round(F * 0.35), K = v.some((k) => k.title || k.description), j = b ? 160 : 24, ne = K ? 168 : 24, Z = m ? 36 : 8, Q = j + 220 + ne, W = i, U = 18, ue = Math.max(120, W - U - Z - 8), D = j + 110, se = $b(v, {
16198
- cx: D,
16201
+ const w = E > 0 && !I, F = E, V = Math.min(90, Math.max(40, Math.round(E / 8))), Y = Math.round(F * 0.15), L = v.length * V + Math.round(F * 0.35), K = v.some((k) => k.title || k.description), j = b ? 160 : 24, ne = K ? 168 : 24, Z = m ? 36 : 8, Q = j + 220 + ne, W = i, U = 18, ue = Math.max(120, W - U - Z - 8), R = j + 110, se = $b(v, {
16202
+ cx: R,
16199
16203
  topY: U,
16200
16204
  plotH: ue,
16201
16205
  maxTopW: 200,
16202
16206
  taper: js(g, 0.2, 0.95),
16203
16207
  gap: 10
16204
- }), R = A != null ? se[A] : null, oe = "cubic-bezier(0.22, 1, 0.36, 1)";
16208
+ }), D = A != null ? se[A] : null, oe = "cubic-bezier(0.22, 1, 0.36, 1)";
16205
16209
  return /* @__PURE__ */ u(
16206
16210
  "div",
16207
16211
  {
@@ -16342,7 +16346,7 @@ function eh({
16342
16346
  "g",
16343
16347
  {
16344
16348
  className: "bonsaif-funnel-arrow",
16345
- transform: `translate(${D}, ${U + ue + 8})`,
16349
+ transform: `translate(${R}, ${U + ue + 8})`,
16346
16350
  fill: "var(--primary)",
16347
16351
  style: w ? {
16348
16352
  animation: `bonsaif-funnel-arrow-in ${Math.round(F * 0.7)}ms ${oe} ${L}ms both`
@@ -16354,7 +16358,7 @@ function eh({
16354
16358
  },
16355
16359
  $
16356
16360
  ),
16357
- d && R ? /* @__PURE__ */ u(
16361
+ d && D ? /* @__PURE__ */ u(
16358
16362
  "div",
16359
16363
  {
16360
16364
  className: "pointer-events-none absolute z-10 rounded-md border px-2.5 py-1.5 text-xs shadow-sm",
@@ -16367,13 +16371,13 @@ function eh({
16367
16371
  color: "var(--text-main)"
16368
16372
  },
16369
16373
  children: [
16370
- /* @__PURE__ */ r("span", { className: "font-semibold", style: { color: R.color }, children: R.name }),
16374
+ /* @__PURE__ */ r("span", { className: "font-semibold", style: { color: D.color }, children: D.name }),
16371
16375
  /* @__PURE__ */ r("span", { style: { color: "var(--text-muted)" }, children: " · " }),
16372
- x(R.value),
16376
+ x(D.value),
16373
16377
  /* @__PURE__ */ u("span", { style: { color: "var(--text-muted)" }, children: [
16374
16378
  " ",
16375
16379
  "(",
16376
- Math.round(R.pct * 100),
16380
+ Math.round(D.pct * 100),
16377
16381
  "% del top)"
16378
16382
  ] })
16379
16383
  ]
@@ -16417,9 +16421,9 @@ function th({
16417
16421
  return;
16418
16422
  }
16419
16423
  let Q = 0, W = 0;
16420
- N((D) => (W = D, D));
16421
- const U = performance.now(), ue = (D) => {
16422
- const P = Math.min(1, (D - U) / h), se = 1 - (1 - P) ** 3;
16424
+ N((R) => (W = R, R));
16425
+ const U = performance.now(), ue = (R) => {
16426
+ const P = Math.min(1, (R - U) / h), se = 1 - (1 - P) ** 3;
16423
16427
  N(W + (S - W) * se), P < 1 && (Q = requestAnimationFrame(ue));
16424
16428
  };
16425
16429
  return Q = requestAnimationFrame(ue), () => cancelAnimationFrame(Q);