bonsaif-ui 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bonsaif-ui.js +592 -590
- package/dist/bonsaif-ui.umd.cjs +3 -3
- package/dist/components/ui/DataSheets.d.ts.map +1 -1
- package/package.json +2 -1
- package/styles.css +1 -0
package/dist/bonsaif-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import je, { useRef as le, useState as
|
|
2
|
+
import je, { useRef as le, useState as D, useEffect as Q, createContext as Do, useLayoutEffect as Bo, useContext as Oo, isValidElement as cn, Children as Io, useMemo as at, useCallback as we, forwardRef as ga, cloneElement as Ro, useId as Ho, useSyncExternalStore as jo } from "react";
|
|
3
3
|
import { jsx as t, jsxs as l, Fragment as Re } from "react/jsx-runtime";
|
|
4
4
|
import { HiMagnifyingGlass as xt, HiXMark as Ie, HiInformationCircle as rn, HiExclamationCircle as ya, HiExclamationTriangle as dn, HiCheckCircle as zo, HiChevronLeft as Tt, HiChevronDown as Xe, HiChevronRight as st, HiCalendarDays as nn, HiCheck as Ue, HiClipboardDocument as Fo, HiLink as wa, HiCog6Tooth as Sr, HiChevronUp as Yr, HiChevronUpDown as _o, HiFunnel as Po, HiEllipsisVertical as Wo, HiMinus as Na, HiTableCells as qo, HiDocumentText as ka, HiCommandLine as Uo, HiClock as qn, HiTrash as Ca, HiArrowDownTray as Ko, HiPencil as Vo, HiInbox as Sa, HiArrowUpTray as Yo, HiDocument as Go, HiH2 as Xo, HiH3 as Zo, HiArrowsPointingIn as Jo, HiArrowsPointingOut as Qo, HiArrowUturnLeft as el, HiArrowUturnRight as tl, HiListBullet as an, HiNumberedList as rl, HiArrowTurnUpLeft as nl, HiArrowTurnDownRight as al, HiBars3BottomLeft as ol, HiBars3CenterLeft as ll, HiBars3BottomRight as il, HiBars3 as Ea, HiLinkSlash as sl, HiPhoto as cl, HiOutlinePaintBrush as dl, HiNoSymbol as ul, HiLockClosed as ml, HiHome as Er, HiArrowRightOnRectangle as bl, HiShieldCheck as Gr, HiBriefcase as fl, HiUsers as Un, HiBell as pl, HiUser as hl, HiClipboardDocumentList as vl, HiBuildingOffice2 as xl, HiRectangleGroup as gl, HiTicket as yl, HiChartBar as wl } from "react-icons/hi2";
|
|
5
5
|
import { createPortal as Ze } from "react-dom";
|
|
@@ -41,7 +41,7 @@ function El({
|
|
|
41
41
|
size: m = "default",
|
|
42
42
|
inputTabIndex: f
|
|
43
43
|
}) {
|
|
44
|
-
const p = le(null), [h, x] =
|
|
44
|
+
const p = le(null), [h, x] = D(!1), v = c || h || e.trim().length > 0, L = m === "sm" ? "h-9 rounded-md" : "h-10 rounded-lg", S = a || "w-48 max-w-full sm:w-64 lg:w-72";
|
|
45
45
|
Q(() => {
|
|
46
46
|
var k;
|
|
47
47
|
i && ((k = p.current) == null || k.focus());
|
|
@@ -160,40 +160,40 @@ function Ut({
|
|
|
160
160
|
tooltipStyle: h,
|
|
161
161
|
as: x = "div"
|
|
162
162
|
}) {
|
|
163
|
-
const v = le(null), L = le(null), S = le(null), w = le(!1), [k, O] =
|
|
163
|
+
const v = le(null), L = le(null), S = le(null), w = le(!1), [k, O] = D(null), [ee, z] = D("");
|
|
164
164
|
Q(() => {
|
|
165
165
|
const E = v.current;
|
|
166
|
-
E && (E.querySelectorAll("[title]").forEach((
|
|
167
|
-
const U =
|
|
168
|
-
U && (
|
|
169
|
-
}), E.querySelectorAll("svg title").forEach((
|
|
166
|
+
E && (E.querySelectorAll("[title]").forEach((H) => {
|
|
167
|
+
const U = H.getAttribute("title");
|
|
168
|
+
U && (H.getAttribute("aria-label") || H.setAttribute("aria-label", U), H.removeAttribute("title"));
|
|
169
|
+
}), E.querySelectorAll("svg title").forEach((H) => H.remove()));
|
|
170
170
|
}), Bo(() => {
|
|
171
171
|
if (!k) return;
|
|
172
172
|
const E = L.current;
|
|
173
173
|
if (!E) return;
|
|
174
|
-
const
|
|
175
|
-
let s = k.mouseX + U,
|
|
174
|
+
const H = 12, U = 14, _ = E.getBoundingClientRect(), oe = window.innerWidth - _.width - H, W = window.innerHeight - _.height - H;
|
|
175
|
+
let s = k.mouseX + U, g = k.mouseY + U, T, j;
|
|
176
176
|
if (!i && v.current) {
|
|
177
177
|
const B = v.current.getBoundingClientRect(), ne = B.left + B.width / 2, ce = B.top + B.height / 2;
|
|
178
|
-
c === "top" ? (s = ne - _.width / 2,
|
|
178
|
+
c === "top" ? (s = ne - _.width / 2, g = B.top - _.height - U, j = _.height - 1) : c === "left" ? (s = B.left - _.width - U, g = ce - _.height / 2, T = _.width - 1) : c === "right" ? (s = B.right + U, g = ce - _.height / 2, T = -7) : (s = ne - _.width / 2, g = B.bottom + U, j = -7);
|
|
179
179
|
}
|
|
180
|
-
if (i && (s > oe && (s = k.mouseX - _.width - U),
|
|
180
|
+
if (i && (s > oe && (s = k.mouseX - _.width - U), g > W && (g = k.mouseY - _.height - U)), s = Math.min(Math.max(H, s), Math.max(H, oe)), g = Math.min(Math.max(H, g), Math.max(H, W)), !i && v.current) {
|
|
181
181
|
const B = v.current.getBoundingClientRect(), ne = B.left + B.width / 2, ce = B.top + B.height / 2;
|
|
182
|
-
c === "top" || c === "bottom" ?
|
|
182
|
+
c === "top" || c === "bottom" ? T = Math.min(Math.max(14, ne - s), _.width - 14) : j = Math.min(Math.max(14, ce - g), _.height - 14);
|
|
183
183
|
}
|
|
184
|
-
(Math.abs(s - k.x) > 0.5 || Math.abs(
|
|
184
|
+
(Math.abs(s - k.x) > 0.5 || Math.abs(g - k.y) > 0.5 || T !== k.arrowX || j !== k.arrowY) && O(
|
|
185
185
|
(B) => B && {
|
|
186
186
|
...B,
|
|
187
187
|
x: s,
|
|
188
|
-
y,
|
|
189
|
-
arrowX:
|
|
188
|
+
y: g,
|
|
189
|
+
arrowX: T,
|
|
190
190
|
arrowY: j
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
193
|
}, [i, c, k]);
|
|
194
194
|
const Y = () => {
|
|
195
195
|
S.current && (window.clearTimeout(S.current), S.current = null);
|
|
196
|
-
},
|
|
196
|
+
}, M = (E, H) => {
|
|
197
197
|
if (!$l() || w.current) return;
|
|
198
198
|
const U = v.current;
|
|
199
199
|
if (U && !hr(U)) {
|
|
@@ -202,13 +202,13 @@ function Ut({
|
|
|
202
202
|
if (!_) return;
|
|
203
203
|
z(_);
|
|
204
204
|
}
|
|
205
|
-
!n && !r || O({ mouseX: E, mouseY:
|
|
205
|
+
!n && !r || O({ mouseX: E, mouseY: H, x: E + 14, y: H + 14 });
|
|
206
206
|
}
|
|
207
207
|
}, q = () => {
|
|
208
208
|
const E = v.current;
|
|
209
209
|
if (!E) return;
|
|
210
|
-
const
|
|
211
|
-
|
|
210
|
+
const H = E.getBoundingClientRect();
|
|
211
|
+
M(H.left + H.width / 2, H.bottom);
|
|
212
212
|
}, Z = () => {
|
|
213
213
|
Y(), O(null);
|
|
214
214
|
}, te = () => {
|
|
@@ -228,10 +228,10 @@ function Ut({
|
|
|
228
228
|
O(null);
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
const E = () => O(null),
|
|
231
|
+
const E = () => O(null), H = () => {
|
|
232
232
|
pr(), w.current = !0, O(null);
|
|
233
233
|
};
|
|
234
|
-
document.addEventListener("pointerdown",
|
|
234
|
+
document.addEventListener("pointerdown", H, !0), document.addEventListener("click", H, !0), document.addEventListener("scroll", E, !0), window.addEventListener("blur", E), document.addEventListener("visibilitychange", E), document.addEventListener("keydown", E, !0);
|
|
235
235
|
const U = new MutationObserver(() => {
|
|
236
236
|
hr(v.current) && O(null);
|
|
237
237
|
});
|
|
@@ -241,16 +241,16 @@ function Ut({
|
|
|
241
241
|
attributes: !0,
|
|
242
242
|
attributeFilter: ["role", "aria-modal", "aria-hidden", "class"]
|
|
243
243
|
}), () => {
|
|
244
|
-
document.removeEventListener("pointerdown",
|
|
244
|
+
document.removeEventListener("pointerdown", H, !0), document.removeEventListener("click", H, !0), document.removeEventListener("scroll", E, !0), window.removeEventListener("blur", E), document.removeEventListener("visibilitychange", E), document.removeEventListener("keydown", E, !0), U.disconnect();
|
|
245
245
|
};
|
|
246
246
|
}, [k]), Q(() => {
|
|
247
|
-
const E = () => pr(),
|
|
247
|
+
const E = () => pr(), H = () => {
|
|
248
248
|
pr(), w.current = !0, O(null);
|
|
249
249
|
};
|
|
250
|
-
return document.addEventListener("pointerdown", E, !0), document.addEventListener("click", E, !0), document.addEventListener("keydown", E, !0), window.addEventListener(Yn,
|
|
250
|
+
return document.addEventListener("pointerdown", E, !0), document.addEventListener("click", E, !0), document.addEventListener("keydown", E, !0), window.addEventListener(Yn, H), () => {
|
|
251
251
|
document.removeEventListener("pointerdown", E, !0), document.removeEventListener("click", E, !0), document.removeEventListener("keydown", E, !0), window.removeEventListener(
|
|
252
252
|
Yn,
|
|
253
|
-
|
|
253
|
+
H
|
|
254
254
|
);
|
|
255
255
|
};
|
|
256
256
|
}, []);
|
|
@@ -265,10 +265,10 @@ function Ut({
|
|
|
265
265
|
className: m,
|
|
266
266
|
style: p,
|
|
267
267
|
onMouseEnter: (E) => {
|
|
268
|
-
Y(), X(), i ?
|
|
268
|
+
Y(), X(), i ? M(E.clientX, E.clientY) : q();
|
|
269
269
|
},
|
|
270
270
|
onMouseMove: (E) => {
|
|
271
|
-
k && i &&
|
|
271
|
+
k && i && M(E.clientX, E.clientY);
|
|
272
272
|
},
|
|
273
273
|
onMouseDown: P,
|
|
274
274
|
onClick: P,
|
|
@@ -385,7 +385,7 @@ function Be({
|
|
|
385
385
|
style: x,
|
|
386
386
|
...v
|
|
387
387
|
}) {
|
|
388
|
-
const L = Oo($a), S = c ?? L.iconOnly ?? e === "icon", w = L.compact ?? !1, k = L.headerAction ?? !1, O = k && r === "md" ? "sm" : w && !k && r === "md" ? "xs" : r, ee = e === "icon" || S, z = k && ee, Y = on(f),
|
|
388
|
+
const L = Oo($a), S = c ?? L.iconOnly ?? e === "icon", w = L.compact ?? !1, k = L.headerAction ?? !1, O = k && r === "md" ? "sm" : w && !k && r === "md" ? "xs" : r, ee = e === "icon" || S, z = k && ee, Y = on(f), M = i ?? v.title ?? v["aria-label"] ?? (S ? Y : void 0), q = M ? void 0 : v.title, Z = v["aria-label"] ?? (typeof M == "string" ? M : Y || void 0), te = n ? null : a ?? (S ? Il(f) : null), P = /* @__PURE__ */ l(
|
|
389
389
|
"button",
|
|
390
390
|
{
|
|
391
391
|
...v,
|
|
@@ -420,11 +420,11 @@ function Be({
|
|
|
420
420
|
]
|
|
421
421
|
}
|
|
422
422
|
);
|
|
423
|
-
return
|
|
423
|
+
return M ? /* @__PURE__ */ t(
|
|
424
424
|
Ut,
|
|
425
425
|
{
|
|
426
426
|
as: "span",
|
|
427
|
-
content:
|
|
427
|
+
content: M,
|
|
428
428
|
className: "inline-flex shrink-0",
|
|
429
429
|
children: P
|
|
430
430
|
}
|
|
@@ -580,7 +580,7 @@ function Ks({
|
|
|
580
580
|
renderTabLabel: ee,
|
|
581
581
|
searchableTabs: z = "auto",
|
|
582
582
|
tabsSearchThreshold: Y = 6,
|
|
583
|
-
tabsSearchPlaceholder:
|
|
583
|
+
tabsSearchPlaceholder: M = "Buscar modulo...",
|
|
584
584
|
tabsSearchValue: q,
|
|
585
585
|
onTabsSearchChange: Z,
|
|
586
586
|
emptySearchState: te,
|
|
@@ -588,7 +588,7 @@ function Ks({
|
|
|
588
588
|
className: X = "",
|
|
589
589
|
parentClassName: J = "",
|
|
590
590
|
contentClassName: E = "",
|
|
591
|
-
tabsClassName:
|
|
591
|
+
tabsClassName: H = ""
|
|
592
592
|
}) {
|
|
593
593
|
var qe;
|
|
594
594
|
const U = at(
|
|
@@ -598,27 +598,27 @@ function Ks({
|
|
|
598
598
|
[x, i, c]
|
|
599
599
|
), _ = (qe = U.find(
|
|
600
600
|
(ae) => !ae.disabled
|
|
601
|
-
)) == null ? void 0 : qe.service, [oe, W] =
|
|
601
|
+
)) == null ? void 0 : qe.service, [oe, W] = D(
|
|
602
602
|
p ?? _ ?? ""
|
|
603
|
-
), [s,
|
|
604
|
-
(ae) => Xn(zl(ae)).includes(
|
|
605
|
-
) : U, [
|
|
603
|
+
), [s, g] = D({}), [T, j] = D({}), [B, ne] = D(""), [ce, pe] = D(!1), $ = le(T), ie = le(0), R = q ?? B, A = Xn(R), G = z === !0 || z === "auto" && U.length >= Y, V = G && R.trim().length > 0, re = at(() => A ? U.filter(
|
|
604
|
+
(ae) => Xn(zl(ae)).includes(A)
|
|
605
|
+
) : U, [A, U]), me = f ?? oe, se = U.find((ae) => ae.service === me) ?? U.find((ae) => !ae.disabled);
|
|
606
606
|
Q(() => {
|
|
607
607
|
!se && _ && W(_);
|
|
608
608
|
}, [_, se]), Q(() => {
|
|
609
|
-
$.current =
|
|
610
|
-
}, [
|
|
611
|
-
const
|
|
609
|
+
$.current = T;
|
|
610
|
+
}, [T]);
|
|
611
|
+
const y = (ae) => {
|
|
612
612
|
ae.disabled || (f || W(ae.service), h == null || h(ae.service, ae));
|
|
613
|
-
},
|
|
613
|
+
}, I = (ae) => {
|
|
614
614
|
q === void 0 && ne(ae), Z == null || Z(ae);
|
|
615
615
|
}, ue = (ae, Me) => {
|
|
616
616
|
const Te = re.filter((De) => !De.disabled), _e = Te.findIndex(
|
|
617
617
|
(De) => De.service === Me.service
|
|
618
618
|
);
|
|
619
|
-
_e < 0 || ((ae.key === "ArrowRight" || ae.key === "ArrowDown") && (ae.preventDefault(),
|
|
619
|
+
_e < 0 || ((ae.key === "ArrowRight" || ae.key === "ArrowDown") && (ae.preventDefault(), y(Te[(_e + 1) % Te.length])), (ae.key === "ArrowLeft" || ae.key === "ArrowUp") && (ae.preventDefault(), y(
|
|
620
620
|
Te[(_e - 1 + Te.length) % Te.length]
|
|
621
|
-
)), ae.key === "Home" && (ae.preventDefault(),
|
|
621
|
+
)), ae.key === "Home" && (ae.preventDefault(), y(Te[0])), ae.key === "End" && (ae.preventDefault(), y(Te[Te.length - 1])));
|
|
622
622
|
}, be = we(() => {
|
|
623
623
|
if (!se) return;
|
|
624
624
|
const ae = se.service, Me = $.current[ae];
|
|
@@ -654,13 +654,13 @@ function Ks({
|
|
|
654
654
|
});
|
|
655
655
|
}, [i, v, m, u, se]);
|
|
656
656
|
Q(be, [be]);
|
|
657
|
-
const Se = se ? s[se.service] ?? null : null, he = se ?
|
|
658
|
-
se &&
|
|
657
|
+
const Se = se ? s[se.service] ?? null : null, he = se ? T[se.service] : void 0, Ee = he == null ? void 0 : he.component, ke = (ae) => {
|
|
658
|
+
se && g((Me) => ({
|
|
659
659
|
...Me,
|
|
660
660
|
[se.service]: ae
|
|
661
661
|
}));
|
|
662
662
|
}, fe = () => {
|
|
663
|
-
se &&
|
|
663
|
+
se && g((ae) => ({
|
|
664
664
|
...ae,
|
|
665
665
|
[se.service]: null
|
|
666
666
|
}));
|
|
@@ -673,8 +673,8 @@ function Ks({
|
|
|
673
673
|
selectedLink: se,
|
|
674
674
|
selectedService: se == null ? void 0 : se.service,
|
|
675
675
|
activeItemId: Se,
|
|
676
|
-
tabsSearch:
|
|
677
|
-
onSelectService:
|
|
676
|
+
tabsSearch: R,
|
|
677
|
+
onSelectService: y,
|
|
678
678
|
onOpenDetail: ke,
|
|
679
679
|
onBackToList: fe
|
|
680
680
|
}, Qe = n ? n(ze) : r ? /* @__PURE__ */ t(r, { ...ze }) : e;
|
|
@@ -715,9 +715,9 @@ function Ks({
|
|
|
715
715
|
children: /* @__PURE__ */ t(
|
|
716
716
|
El,
|
|
717
717
|
{
|
|
718
|
-
value:
|
|
719
|
-
onChange:
|
|
720
|
-
placeholder:
|
|
718
|
+
value: R,
|
|
719
|
+
onChange: I,
|
|
720
|
+
placeholder: M,
|
|
721
721
|
className: "w-full",
|
|
722
722
|
autoFocus: ce,
|
|
723
723
|
forceExpanded: !0,
|
|
@@ -735,7 +735,7 @@ function Ks({
|
|
|
735
735
|
"aria-label": ce ? "Cerrar busqueda" : "Buscar tabs",
|
|
736
736
|
"aria-expanded": ce,
|
|
737
737
|
onClick: () => {
|
|
738
|
-
ce &&
|
|
738
|
+
ce && R && I(""), pe((ae) => !ae);
|
|
739
739
|
},
|
|
740
740
|
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 ${ce || V ? "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)]"}`,
|
|
741
741
|
children: /* @__PURE__ */ t("span", { className: "grid h-4 w-4 place-items-center transition-transform duration-200", children: ce || V ? /* @__PURE__ */ t(Ie, { className: "h-4 w-4" }) : /* @__PURE__ */ t(xt, { className: "h-4 w-4" }) })
|
|
@@ -749,7 +749,7 @@ function Ks({
|
|
|
749
749
|
{
|
|
750
750
|
role: "tablist",
|
|
751
751
|
"aria-label": L ?? "Modulos relacionados",
|
|
752
|
-
className: `flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${
|
|
752
|
+
className: `flex gap-1 overflow-x-auto border-b border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 transition-colors duration-200 ${H}`,
|
|
753
753
|
children: re.length > 0 ? re.map((ae) => {
|
|
754
754
|
const Me = ae.service === (se == null ? void 0 : se.service);
|
|
755
755
|
return /* @__PURE__ */ t(
|
|
@@ -759,7 +759,7 @@ function Ks({
|
|
|
759
759
|
role: "tab",
|
|
760
760
|
"aria-selected": Me,
|
|
761
761
|
disabled: ae.disabled,
|
|
762
|
-
onClick: () =>
|
|
762
|
+
onClick: () => y(ae),
|
|
763
763
|
onKeyDown: (Te) => ue(Te, ae),
|
|
764
764
|
className: `inline-flex h-9 min-w-max items-center gap-2 rounded-md border px-3 text-xs font-semibold transition-all duration-200 disabled:cursor-not-allowed disabled:opacity-50 ${Me ? "border-[var(--primary)] bg-[var(--bg-card)] text-[var(--text-main)] shadow-sm" : "border-transparent text-[var(--text-muted)] hover:bg-[var(--bg-card)] hover:text-[var(--text-main)]"}`,
|
|
765
765
|
children: ee ? ee(ae, Me) : /* @__PURE__ */ l(Re, { children: [
|
|
@@ -919,24 +919,24 @@ function Ys({
|
|
|
919
919
|
minDate: n,
|
|
920
920
|
displayMode: a = "inline"
|
|
921
921
|
}) {
|
|
922
|
-
const i = Ul(), u = Da(e || i), m = a === "popover", [f, p] =
|
|
922
|
+
const i = Ul(), u = Da(e || i), m = a === "popover", [f, p] = D(!1), h = le(null), [x, v] = D({
|
|
923
923
|
horizontal: "left",
|
|
924
924
|
vertical: "bottom"
|
|
925
|
-
}), [L, S] =
|
|
925
|
+
}), [L, S] = D(u.year), [w, k] = D(u.month), [O, ee] = D("days"), z = 16, [Y, M] = D(0), q = L - 7 + Y, Z = Array.from({ length: z }, (W, s) => q + s);
|
|
926
926
|
Q(() => {
|
|
927
927
|
if (!m || !f || !h.current) return;
|
|
928
|
-
const W = h.current.getBoundingClientRect(), s = 8,
|
|
928
|
+
const W = h.current.getBoundingClientRect(), s = 8, g = 280, T = 340, j = W.left + g > window.innerWidth - s, B = W.right - g >= s, ne = W.bottom + 8 + T > window.innerHeight - s, ce = W.top - 8 - T >= s;
|
|
929
929
|
v({
|
|
930
930
|
horizontal: j && B ? "right" : "left",
|
|
931
931
|
vertical: ne && ce ? "top" : "bottom"
|
|
932
932
|
});
|
|
933
933
|
}, [m, f]), Q(() => {
|
|
934
934
|
if (!m || !f) return;
|
|
935
|
-
function W(
|
|
936
|
-
h.current && (h.current.contains(
|
|
935
|
+
function W(g) {
|
|
936
|
+
h.current && (h.current.contains(g.target) || p(!1));
|
|
937
937
|
}
|
|
938
|
-
function s(
|
|
939
|
-
|
|
938
|
+
function s(g) {
|
|
939
|
+
g.key === "Escape" && p(!1);
|
|
940
940
|
}
|
|
941
941
|
return document.addEventListener("mousedown", W), document.addEventListener("keydown", s), () => {
|
|
942
942
|
document.removeEventListener("mousedown", W), document.removeEventListener("keydown", s);
|
|
@@ -953,7 +953,7 @@ function Ys({
|
|
|
953
953
|
...Array.from({ length: J }, (W, s) => s + 1)
|
|
954
954
|
];
|
|
955
955
|
for (; E.length < Xr * 7; ) E.push(null);
|
|
956
|
-
const
|
|
956
|
+
const H = E.slice(0, Xr * 7);
|
|
957
957
|
function U(W) {
|
|
958
958
|
const s = ln(L, w, W);
|
|
959
959
|
n && s < n || (r(s), m && p(!1));
|
|
@@ -1005,7 +1005,7 @@ function Ys({
|
|
|
1005
1005
|
{
|
|
1006
1006
|
type: "button",
|
|
1007
1007
|
onClick: () => {
|
|
1008
|
-
ee("years"),
|
|
1008
|
+
ee("years"), M(0);
|
|
1009
1009
|
},
|
|
1010
1010
|
style: {
|
|
1011
1011
|
background: "none",
|
|
@@ -1043,7 +1043,7 @@ function Ys({
|
|
|
1043
1043
|
"button",
|
|
1044
1044
|
{
|
|
1045
1045
|
type: "button",
|
|
1046
|
-
onClick: () =>
|
|
1046
|
+
onClick: () => M((W) => W - z),
|
|
1047
1047
|
style: _,
|
|
1048
1048
|
children: /* @__PURE__ */ t(Tt, { size: 16 })
|
|
1049
1049
|
}
|
|
@@ -1074,7 +1074,7 @@ function Ys({
|
|
|
1074
1074
|
"button",
|
|
1075
1075
|
{
|
|
1076
1076
|
type: "button",
|
|
1077
|
-
onClick: () =>
|
|
1077
|
+
onClick: () => M((W) => W + z),
|
|
1078
1078
|
style: _,
|
|
1079
1079
|
children: /* @__PURE__ */ t(st, { size: 16 })
|
|
1080
1080
|
}
|
|
@@ -1093,7 +1093,7 @@ function Ys({
|
|
|
1093
1093
|
marginBottom: 8
|
|
1094
1094
|
},
|
|
1095
1095
|
children: Wl.map((W, s) => {
|
|
1096
|
-
const
|
|
1096
|
+
const g = s + 1 === w;
|
|
1097
1097
|
return /* @__PURE__ */ t(
|
|
1098
1098
|
"button",
|
|
1099
1099
|
{
|
|
@@ -1104,10 +1104,10 @@ function Ys({
|
|
|
1104
1104
|
cursor: "pointer",
|
|
1105
1105
|
borderRadius: 6,
|
|
1106
1106
|
fontSize: 11,
|
|
1107
|
-
fontWeight:
|
|
1107
|
+
fontWeight: g ? 700 : 400,
|
|
1108
1108
|
padding: "4px 0",
|
|
1109
|
-
background:
|
|
1110
|
-
color:
|
|
1109
|
+
background: g ? "var(--primary)" : "transparent",
|
|
1110
|
+
color: g ? "var(--primary-fg, #ffffff)" : "var(--text-secondary)"
|
|
1111
1111
|
},
|
|
1112
1112
|
children: W
|
|
1113
1113
|
},
|
|
@@ -1195,10 +1195,10 @@ function Ys({
|
|
|
1195
1195
|
padding: "4px 8px 10px",
|
|
1196
1196
|
gap: 2
|
|
1197
1197
|
},
|
|
1198
|
-
children:
|
|
1198
|
+
children: H.map((W, s) => {
|
|
1199
1199
|
if (W === null)
|
|
1200
1200
|
return /* @__PURE__ */ t("div", { style: { aspectRatio: "1" } }, s);
|
|
1201
|
-
const
|
|
1201
|
+
const g = ln(L, w, W), T = g === e, j = g === i, B = !!(n && g < n);
|
|
1202
1202
|
return /* @__PURE__ */ t(
|
|
1203
1203
|
"button",
|
|
1204
1204
|
{
|
|
@@ -1211,11 +1211,11 @@ function Ys({
|
|
|
1211
1211
|
border: "none",
|
|
1212
1212
|
cursor: B ? "not-allowed" : "pointer",
|
|
1213
1213
|
fontSize: 12,
|
|
1214
|
-
fontWeight:
|
|
1215
|
-
background:
|
|
1216
|
-
color:
|
|
1214
|
+
fontWeight: T || j ? 700 : 400,
|
|
1215
|
+
background: T ? "var(--primary)" : "transparent",
|
|
1216
|
+
color: T ? "var(--primary-fg, #ffffff)" : B ? "var(--text-muted)" : "var(--text-main)",
|
|
1217
1217
|
opacity: B ? 0.4 : 1,
|
|
1218
|
-
outline: j && !
|
|
1218
|
+
outline: j && !T ? "2px solid var(--primary)" : "none",
|
|
1219
1219
|
outlineOffset: "-2px"
|
|
1220
1220
|
},
|
|
1221
1221
|
children: W
|
|
@@ -1358,18 +1358,18 @@ function Oa({
|
|
|
1358
1358
|
type: S = "button",
|
|
1359
1359
|
...w
|
|
1360
1360
|
}) {
|
|
1361
|
-
const [k, O] =
|
|
1361
|
+
const [k, O] = D(!1), ee = le(null);
|
|
1362
1362
|
Q(() => () => {
|
|
1363
1363
|
ee.current && window.clearTimeout(ee.current);
|
|
1364
1364
|
}, []);
|
|
1365
|
-
function z(
|
|
1366
|
-
O(!0), f == null || f(
|
|
1365
|
+
function z(M) {
|
|
1366
|
+
O(!0), f == null || f(M), ee.current && window.clearTimeout(ee.current), ee.current = window.setTimeout(() => {
|
|
1367
1367
|
O(!1), ee.current = null;
|
|
1368
1368
|
}, r);
|
|
1369
1369
|
}
|
|
1370
|
-
async function Y(
|
|
1370
|
+
async function Y(M) {
|
|
1371
1371
|
var Z;
|
|
1372
|
-
if (m &&
|
|
1372
|
+
if (m && M.stopPropagation(), L == null || L(M), M.defaultPrevented) return;
|
|
1373
1373
|
const q = Xl(e);
|
|
1374
1374
|
if (q)
|
|
1375
1375
|
try {
|
|
@@ -1509,91 +1509,91 @@ function At({
|
|
|
1509
1509
|
searchable: w = !0,
|
|
1510
1510
|
minOptionsForSearch: k = 6
|
|
1511
1511
|
}) {
|
|
1512
|
-
const [O, ee] =
|
|
1513
|
-
(
|
|
1514
|
-
var
|
|
1515
|
-
return
|
|
1512
|
+
const [O, ee] = D(!1), [z, Y] = D(""), [M, q] = D(-1), [Z, te] = D(!1), [P, X] = D({}), J = le(null), E = le(null), H = le(null), U = le(null), _ = w && n.length >= k, oe = n.find((R) => R.value === e) ?? null, W = c === "ghost", s = a === "error" ? "var(--danger)" : O ? "var(--primary)" : "var(--border)", g = _ && z.trim() ? n.filter(
|
|
1513
|
+
(R) => {
|
|
1514
|
+
var A;
|
|
1515
|
+
return R.label.toLowerCase().includes(z.toLowerCase()) || ((A = R.sublabel) == null ? void 0 : A.toLowerCase().includes(z.toLowerCase()));
|
|
1516
1516
|
}
|
|
1517
|
-
) : n,
|
|
1518
|
-
const
|
|
1519
|
-
if (!
|
|
1520
|
-
const
|
|
1517
|
+
) : n, T = we(() => {
|
|
1518
|
+
const R = J.current;
|
|
1519
|
+
if (!R) return;
|
|
1520
|
+
const A = R.getBoundingClientRect(), G = _ ? 272 : 212, V = window.innerHeight - A.bottom, re = V < G && A.top > V;
|
|
1521
1521
|
X({
|
|
1522
1522
|
position: "fixed",
|
|
1523
|
-
left:
|
|
1524
|
-
top: re ? void 0 :
|
|
1525
|
-
bottom: re ? window.innerHeight -
|
|
1526
|
-
width:
|
|
1523
|
+
left: A.left,
|
|
1524
|
+
top: re ? void 0 : A.bottom + 4,
|
|
1525
|
+
bottom: re ? window.innerHeight - A.top + 4 : void 0,
|
|
1526
|
+
width: A.width,
|
|
1527
1527
|
minWidth: Zr(v),
|
|
1528
1528
|
zIndex: 9999
|
|
1529
1529
|
});
|
|
1530
1530
|
}, [v, _]);
|
|
1531
1531
|
Q(() => te(!0), []), Q(() => {
|
|
1532
1532
|
if (!O) return;
|
|
1533
|
-
function
|
|
1533
|
+
function R(A) {
|
|
1534
1534
|
var V, re;
|
|
1535
|
-
const G =
|
|
1535
|
+
const G = A.target;
|
|
1536
1536
|
!((V = J.current) != null && V.contains(G)) && !((re = E.current) != null && re.contains(G)) && (ee(!1), Y(""));
|
|
1537
1537
|
}
|
|
1538
|
-
return document.addEventListener("mousedown",
|
|
1538
|
+
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
1539
1539
|
}, [O]), Q(() => {
|
|
1540
|
-
O && (q(-1),
|
|
1541
|
-
var
|
|
1542
|
-
return (
|
|
1540
|
+
O && (q(-1), T(), _ && setTimeout(() => {
|
|
1541
|
+
var R;
|
|
1542
|
+
return (R = H.current) == null ? void 0 : R.focus();
|
|
1543
1543
|
}, 0));
|
|
1544
|
-
}, [O, _,
|
|
1544
|
+
}, [O, _, T]), Q(() => {
|
|
1545
1545
|
if (O)
|
|
1546
|
-
return window.addEventListener("resize",
|
|
1547
|
-
window.removeEventListener("resize",
|
|
1546
|
+
return window.addEventListener("resize", T), window.addEventListener("scroll", T, !0), () => {
|
|
1547
|
+
window.removeEventListener("resize", T), window.removeEventListener("scroll", T, !0);
|
|
1548
1548
|
};
|
|
1549
|
-
}, [O,
|
|
1550
|
-
if (
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1553
|
-
}, [
|
|
1549
|
+
}, [O, T]), Q(() => {
|
|
1550
|
+
if (M < 0 || !U.current) return;
|
|
1551
|
+
const R = U.current.children[M];
|
|
1552
|
+
R == null || R.scrollIntoView({ block: "nearest" });
|
|
1553
|
+
}, [M]);
|
|
1554
1554
|
const j = we(
|
|
1555
|
-
(
|
|
1556
|
-
r(
|
|
1555
|
+
(R) => {
|
|
1556
|
+
r(R), ee(!1), Y("");
|
|
1557
1557
|
},
|
|
1558
1558
|
[r]
|
|
1559
1559
|
), B = le(O);
|
|
1560
1560
|
B.current = O;
|
|
1561
|
-
const ne = le(
|
|
1562
|
-
ne.current =
|
|
1563
|
-
const ce = le(
|
|
1564
|
-
ce.current =
|
|
1561
|
+
const ne = le(g);
|
|
1562
|
+
ne.current = g;
|
|
1563
|
+
const ce = le(M);
|
|
1564
|
+
ce.current = M;
|
|
1565
1565
|
const pe = le(f);
|
|
1566
1566
|
pe.current = f;
|
|
1567
1567
|
const $ = le(j);
|
|
1568
1568
|
$.current = j, Q(() => {
|
|
1569
|
-
function
|
|
1569
|
+
function R(A) {
|
|
1570
1570
|
var me, se;
|
|
1571
1571
|
const G = document.activeElement, V = ((me = J.current) == null ? void 0 : me.contains(G)) ?? !1, re = ((se = E.current) == null ? void 0 : se.contains(G)) ?? !1;
|
|
1572
1572
|
if (!(!V && !re)) {
|
|
1573
1573
|
if (!B.current) {
|
|
1574
|
-
(
|
|
1574
|
+
(A.key === "Enter" || A.key === " " || A.key === "ArrowDown") && (A.preventDefault(), ee(!0));
|
|
1575
1575
|
return;
|
|
1576
1576
|
}
|
|
1577
|
-
switch (
|
|
1577
|
+
switch (A.key) {
|
|
1578
1578
|
case "ArrowDown":
|
|
1579
|
-
|
|
1579
|
+
A.preventDefault(), q((y) => Math.min(y + 1, ne.current.length - 1));
|
|
1580
1580
|
break;
|
|
1581
1581
|
case "ArrowUp":
|
|
1582
|
-
|
|
1582
|
+
A.preventDefault(), q((y) => Math.max(y - 1, pe.current ? -1 : 0));
|
|
1583
1583
|
break;
|
|
1584
1584
|
case "Enter": {
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1585
|
+
A.preventDefault();
|
|
1586
|
+
const y = ce.current, I = ne.current;
|
|
1587
|
+
y === -1 && pe.current ? $.current("") : I[y] && !I[y].disabled && $.current(I[y].value);
|
|
1588
1588
|
break;
|
|
1589
1589
|
}
|
|
1590
1590
|
case "Escape":
|
|
1591
|
-
|
|
1591
|
+
A.preventDefault(), A.stopPropagation(), ee(!1), Y("");
|
|
1592
1592
|
break;
|
|
1593
1593
|
}
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
|
-
return document.addEventListener("keydown",
|
|
1596
|
+
return document.addEventListener("keydown", R), () => document.removeEventListener("keydown", R);
|
|
1597
1597
|
}, []);
|
|
1598
1598
|
const ie = /* @__PURE__ */ l(
|
|
1599
1599
|
"div",
|
|
@@ -1623,10 +1623,10 @@ function At({
|
|
|
1623
1623
|
/* @__PURE__ */ t(
|
|
1624
1624
|
"input",
|
|
1625
1625
|
{
|
|
1626
|
-
ref:
|
|
1626
|
+
ref: H,
|
|
1627
1627
|
value: z,
|
|
1628
|
-
onChange: (
|
|
1629
|
-
Y(
|
|
1628
|
+
onChange: (R) => {
|
|
1629
|
+
Y(R.target.value), q(-1);
|
|
1630
1630
|
},
|
|
1631
1631
|
placeholder: "Buscar…",
|
|
1632
1632
|
className: "min-w-0 flex-1 text-sm bg-transparent outline-none",
|
|
@@ -1637,8 +1637,8 @@ function At({
|
|
|
1637
1637
|
"button",
|
|
1638
1638
|
{
|
|
1639
1639
|
type: "button",
|
|
1640
|
-
onMouseDown: (
|
|
1641
|
-
|
|
1640
|
+
onMouseDown: (R) => {
|
|
1641
|
+
R.preventDefault(), Y("");
|
|
1642
1642
|
},
|
|
1643
1643
|
children: /* @__PURE__ */ t(
|
|
1644
1644
|
Ie,
|
|
@@ -1670,70 +1670,70 @@ function At({
|
|
|
1670
1670
|
{
|
|
1671
1671
|
role: "option",
|
|
1672
1672
|
"aria-selected": e === "",
|
|
1673
|
-
onMouseDown: (
|
|
1674
|
-
|
|
1673
|
+
onMouseDown: (R) => {
|
|
1674
|
+
R.preventDefault(), j("");
|
|
1675
1675
|
},
|
|
1676
1676
|
onMouseEnter: () => q(-1),
|
|
1677
1677
|
className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
|
|
1678
1678
|
style: {
|
|
1679
|
-
background:
|
|
1679
|
+
background: M === -1 && !z.trim() ? "var(--bg-hover)" : "transparent",
|
|
1680
1680
|
color: "var(--text-muted)",
|
|
1681
1681
|
fontStyle: "italic"
|
|
1682
1682
|
},
|
|
1683
1683
|
children: f
|
|
1684
1684
|
}
|
|
1685
1685
|
),
|
|
1686
|
-
|
|
1687
|
-
const V =
|
|
1686
|
+
g.map((R, A) => {
|
|
1687
|
+
const V = A === M, re = R.value === e;
|
|
1688
1688
|
return /* @__PURE__ */ l(
|
|
1689
1689
|
"li",
|
|
1690
1690
|
{
|
|
1691
1691
|
role: "option",
|
|
1692
1692
|
"aria-selected": re,
|
|
1693
1693
|
onMouseDown: (me) => {
|
|
1694
|
-
me.preventDefault(),
|
|
1694
|
+
me.preventDefault(), R.disabled || j(R.value);
|
|
1695
1695
|
},
|
|
1696
|
-
onMouseEnter: () => !
|
|
1696
|
+
onMouseEnter: () => !R.disabled && q(A),
|
|
1697
1697
|
className: "flex items-center gap-2 px-3 py-2 cursor-pointer text-sm transition-colors",
|
|
1698
1698
|
style: {
|
|
1699
1699
|
background: V ? "var(--bg-hover)" : re ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
|
|
1700
|
-
color:
|
|
1701
|
-
cursor:
|
|
1700
|
+
color: R.disabled ? "var(--text-muted)" : "var(--text-main)",
|
|
1701
|
+
cursor: R.disabled ? "not-allowed" : "pointer",
|
|
1702
1702
|
boxShadow: re ? "inset 2px 0 0 var(--primary)" : void 0
|
|
1703
1703
|
},
|
|
1704
1704
|
children: [
|
|
1705
|
-
|
|
1705
|
+
R.color && /* @__PURE__ */ t(
|
|
1706
1706
|
"span",
|
|
1707
1707
|
{
|
|
1708
1708
|
className: "flex-shrink-0 w-2.5 h-2.5 rounded-full",
|
|
1709
|
-
style: { background:
|
|
1709
|
+
style: { background: R.color }
|
|
1710
1710
|
}
|
|
1711
1711
|
),
|
|
1712
1712
|
/* @__PURE__ */ l("span", { className: "min-w-0 flex flex-1 items-baseline gap-1 overflow-hidden", children: [
|
|
1713
|
-
/* @__PURE__ */ t("span", { className: "truncate", children:
|
|
1714
|
-
|
|
1713
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: R.label }),
|
|
1714
|
+
R.sublabel && /* @__PURE__ */ t(
|
|
1715
1715
|
"span",
|
|
1716
1716
|
{
|
|
1717
1717
|
className: "min-w-0 flex-shrink truncate",
|
|
1718
1718
|
style: { color: "var(--text-muted)", fontSize: 12 },
|
|
1719
|
-
children:
|
|
1719
|
+
children: R.sublabel
|
|
1720
1720
|
}
|
|
1721
1721
|
)
|
|
1722
1722
|
] }),
|
|
1723
|
-
|
|
1723
|
+
R.badge && /* @__PURE__ */ t(
|
|
1724
1724
|
"span",
|
|
1725
1725
|
{
|
|
1726
1726
|
className: "text-xs flex-shrink-0",
|
|
1727
1727
|
style: { color: "var(--text-muted)" },
|
|
1728
|
-
children:
|
|
1728
|
+
children: R.badge
|
|
1729
1729
|
}
|
|
1730
1730
|
)
|
|
1731
1731
|
]
|
|
1732
1732
|
},
|
|
1733
|
-
|
|
1733
|
+
R.value
|
|
1734
1734
|
);
|
|
1735
1735
|
}),
|
|
1736
|
-
|
|
1736
|
+
g.length === 0 && /* @__PURE__ */ t(
|
|
1737
1737
|
"li",
|
|
1738
1738
|
{
|
|
1739
1739
|
className: "px-3 py-4 text-sm text-center",
|
|
@@ -1759,7 +1759,7 @@ function At({
|
|
|
1759
1759
|
{
|
|
1760
1760
|
type: "button",
|
|
1761
1761
|
disabled: p,
|
|
1762
|
-
onClick: () => !p && ee((
|
|
1762
|
+
onClick: () => !p && ee((R) => !R),
|
|
1763
1763
|
className: "flex w-full items-center gap-2 rounded-lg text-left text-sm transition-colors focus:outline-none",
|
|
1764
1764
|
style: {
|
|
1765
1765
|
height: Zr(L),
|
|
@@ -1797,8 +1797,8 @@ function At({
|
|
|
1797
1797
|
{
|
|
1798
1798
|
role: "button",
|
|
1799
1799
|
tabIndex: -1,
|
|
1800
|
-
onMouseDown: (
|
|
1801
|
-
|
|
1800
|
+
onMouseDown: (R) => {
|
|
1801
|
+
R.preventDefault(), R.stopPropagation(), j("");
|
|
1802
1802
|
},
|
|
1803
1803
|
className: "flex-shrink-0 rounded-full p-0.5 transition-colors hover:bg-black/10",
|
|
1804
1804
|
style: { color: "var(--text-muted)" },
|
|
@@ -1927,9 +1927,9 @@ function Ia({
|
|
|
1927
1927
|
contentClassName: ee = "p-4",
|
|
1928
1928
|
ariaLabel: z,
|
|
1929
1929
|
frameless: Y = !1,
|
|
1930
|
-
disabled:
|
|
1930
|
+
disabled: M = !1
|
|
1931
1931
|
}) {
|
|
1932
|
-
const [q, Z] =
|
|
1932
|
+
const [q, Z] = D(!1), [te, P] = D(!1), X = le(null);
|
|
1933
1933
|
if (Q(() => (e ? (X.current && clearTimeout(X.current), Z(!0), requestAnimationFrame(() => requestAnimationFrame(() => P(!0)))) : (P(!1), X.current = setTimeout(
|
|
1934
1934
|
() => Z(!1),
|
|
1935
1935
|
vr + 40
|
|
@@ -1947,7 +1947,7 @@ function Ia({
|
|
|
1947
1947
|
};
|
|
1948
1948
|
return window.addEventListener("keydown", oe), () => window.removeEventListener("keydown", oe);
|
|
1949
1949
|
}, [v, r, e]), !q) return null;
|
|
1950
|
-
const J = n || a || i || c || L, E = p ?? Zl[f],
|
|
1950
|
+
const J = n || a || i || c || L, E = p ?? Zl[f], H = S === "bottom-mobile" ? "items-end sm:items-center justify-center p-0 sm:p-4" : "items-center justify-center", U = S === "bottom-mobile" ? "rounded-t-2xl sm:rounded-2xl" : "rounded-2xl", _ = te ? "translateY(0) scale(1)" : S === "bottom-mobile" ? "translateY(16px) scale(0.98)" : "translateY(10px) scale(0.96)";
|
|
1951
1951
|
return Ze(
|
|
1952
1952
|
/* @__PURE__ */ l(
|
|
1953
1953
|
"div",
|
|
@@ -1956,7 +1956,7 @@ function Ia({
|
|
|
1956
1956
|
"aria-modal": "true",
|
|
1957
1957
|
"data-bonsaif-overlay": "true",
|
|
1958
1958
|
"aria-label": z ?? n,
|
|
1959
|
-
className: `fixed inset-0 flex ${
|
|
1959
|
+
className: `fixed inset-0 flex ${H} ${ee}`,
|
|
1960
1960
|
style: { zIndex: h },
|
|
1961
1961
|
children: [
|
|
1962
1962
|
/* @__PURE__ */ t(
|
|
@@ -1984,7 +1984,7 @@ function Ia({
|
|
|
1984
1984
|
},
|
|
1985
1985
|
onClick: (oe) => oe.stopPropagation(),
|
|
1986
1986
|
children: [
|
|
1987
|
-
|
|
1987
|
+
M && /* @__PURE__ */ t(
|
|
1988
1988
|
"div",
|
|
1989
1989
|
{
|
|
1990
1990
|
className: "absolute inset-0 z-[1002] cursor-not-allowed rounded-2xl",
|
|
@@ -2437,7 +2437,7 @@ function pi({
|
|
|
2437
2437
|
highlightSelected: ee = !0,
|
|
2438
2438
|
rowClassName: z,
|
|
2439
2439
|
getRowCategory: Y,
|
|
2440
|
-
stickyHeader:
|
|
2440
|
+
stickyHeader: M = !0,
|
|
2441
2441
|
pageSize: q = 25,
|
|
2442
2442
|
pageSizeOptions: Z = [25, 50, 100],
|
|
2443
2443
|
pageSizeSelectWidth: te = 62,
|
|
@@ -2445,14 +2445,14 @@ function pi({
|
|
|
2445
2445
|
pageSizeSelectPadding: X = "0 7px",
|
|
2446
2446
|
totalRows: J,
|
|
2447
2447
|
page: E,
|
|
2448
|
-
onPageChange:
|
|
2448
|
+
onPageChange: H,
|
|
2449
2449
|
onPageSizeChange: U,
|
|
2450
2450
|
storageKey: _,
|
|
2451
2451
|
stickyFirstColumn: oe = !1,
|
|
2452
2452
|
bottomOffset: W = 0,
|
|
2453
2453
|
compact: s = !0,
|
|
2454
|
-
restrictHeight:
|
|
2455
|
-
maxHeight:
|
|
2454
|
+
restrictHeight: g = !0,
|
|
2455
|
+
maxHeight: T,
|
|
2456
2456
|
minTableWidth: j,
|
|
2457
2457
|
enableColumnVisibility: B = !0,
|
|
2458
2458
|
enableColumnFilters: ne = !0,
|
|
@@ -2460,16 +2460,16 @@ function pi({
|
|
|
2460
2460
|
defaultHiddenColumnKeys: pe = li,
|
|
2461
2461
|
onHiddenColumnKeysChange: $,
|
|
2462
2462
|
columnVisibilityLabel: ie = "Columnas",
|
|
2463
|
-
enableBql:
|
|
2464
|
-
bqlValue:
|
|
2463
|
+
enableBql: R = !1,
|
|
2464
|
+
bqlValue: A,
|
|
2465
2465
|
defaultBqlValue: G = "",
|
|
2466
2466
|
onBqlChange: V,
|
|
2467
2467
|
bqlDescription: re = "Filtra registros con Bonsaif Query Language",
|
|
2468
2468
|
bqlPlaceholder: me = `status = activo
|
|
2469
2469
|
rol IN (admin, employee)`,
|
|
2470
2470
|
bqlQuickFilters: se = [],
|
|
2471
|
-
bqlExamples:
|
|
2472
|
-
bqlSuggestions:
|
|
2471
|
+
bqlExamples: y = [],
|
|
2472
|
+
bqlSuggestions: I = [],
|
|
2473
2473
|
bqlActiveFilters: ue,
|
|
2474
2474
|
bqlError: be,
|
|
2475
2475
|
onQueryChange: Se,
|
|
@@ -2480,29 +2480,29 @@ rol IN (admin, employee)`,
|
|
|
2480
2480
|
var Wn;
|
|
2481
2481
|
const fe = di(he), ze = Object.values(fe).some(Boolean), Qe = e.map((o) => o.key).join(","), qe = pe.join(","), ae = le(e), Me = le(pe);
|
|
2482
2482
|
ae.current = e, Me.current = pe;
|
|
2483
|
-
const [Te, _e] =
|
|
2483
|
+
const [Te, _e] = D(
|
|
2484
2484
|
!_ || !ze
|
|
2485
|
-
), De = le(null), et = le(!_), Fe = ce !== void 0, [Va, Dt] =
|
|
2485
|
+
), De = le(null), et = le(!_), Fe = ce !== void 0, [Va, Dt] = D(() => pt(pe, e)), Pe = pt(
|
|
2486
2486
|
Fe ? ce : Va,
|
|
2487
2487
|
e
|
|
2488
|
-
), [ot, Kt] =
|
|
2488
|
+
), [ot, Kt] = D(!1), [ct, Ya] = D("filter"), [Bt, Vt] = D(
|
|
2489
2489
|
null
|
|
2490
|
-
), [mn, bn] =
|
|
2490
|
+
), [mn, bn] = D(""), [We, Ot] = D({}), [Ke, Yt] = D({}), Tr = x !== void 0, [fn, Ga] = D(v), It = A !== void 0, [Xa, Ar] = D(G), tt = It ? A : Xa, [Gt, Xt] = D(tt), [rt, dt] = D(!1), [pn, gt] = D(!1), [hn, yt] = D(!1), [Rt, Ht] = D([]), Dr = le(null), vn = le(null), Br = le(null), [Za, Ja] = D(
|
|
2491
2491
|
{}
|
|
2492
|
-
), [Qa, eo] =
|
|
2492
|
+
), [Qa, eo] = D(
|
|
2493
2493
|
{}
|
|
2494
|
-
), [jt, Zt] =
|
|
2494
|
+
), [jt, Zt] = D(!1), Or = le(null), Jt = le(null), [to, ro] = D(
|
|
2495
2495
|
{}
|
|
2496
|
-
), xn = le(null), Qt = le(null), [Ir, gn] =
|
|
2496
|
+
), xn = le(null), Qt = le(null), [Ir, gn] = D(
|
|
2497
2497
|
r.length > 0 || a || m === !1
|
|
2498
|
-
), yn = (o, d) => 50 + (o * 17 + d * 13 + 7) % 40, lt = le(null), [no, ao] =
|
|
2498
|
+
), yn = (o, d) => 50 + (o * 17 + d * 13 + 7) % 40, lt = le(null), [no, ao] = D(
|
|
2499
2499
|
void 0
|
|
2500
|
-
), [wn, oo] =
|
|
2500
|
+
), [wn, oo] = D(0), [Rr, lo] = D(!1);
|
|
2501
2501
|
Q(() => {
|
|
2502
2502
|
function o() {
|
|
2503
2503
|
lo(window.innerWidth < 640);
|
|
2504
2504
|
}
|
|
2505
|
-
if (!
|
|
2505
|
+
if (!g || T !== void 0)
|
|
2506
2506
|
return o(), window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
2507
2507
|
const C = q !== !1 ? 48 : 0, b = 12;
|
|
2508
2508
|
function K() {
|
|
@@ -2516,8 +2516,8 @@ rol IN (admin, employee)`,
|
|
|
2516
2516
|
);
|
|
2517
2517
|
}
|
|
2518
2518
|
return K(), window.addEventListener("resize", K), () => window.removeEventListener("resize", K);
|
|
2519
|
-
}, [a, q, W,
|
|
2520
|
-
const Nn =
|
|
2519
|
+
}, [a, q, W, g, T]);
|
|
2520
|
+
const Nn = g ? T ?? no : void 0;
|
|
2521
2521
|
Q(() => {
|
|
2522
2522
|
const o = lt.current;
|
|
2523
2523
|
if (!o) return;
|
|
@@ -2537,13 +2537,13 @@ rol IN (admin, employee)`,
|
|
|
2537
2537
|
}, m);
|
|
2538
2538
|
return () => window.clearTimeout(o);
|
|
2539
2539
|
}, [r.length, m, Ir, a]);
|
|
2540
|
-
const [wt, zt] =
|
|
2540
|
+
const [wt, zt] = D(
|
|
2541
2541
|
() => e.map((o) => o.key)
|
|
2542
|
-
), [Nt, Ft] =
|
|
2542
|
+
), [Nt, Ft] = D(
|
|
2543
2543
|
() => Object.fromEntries(
|
|
2544
2544
|
e.map((o) => [o.key, nt(o, ft(o.width))])
|
|
2545
2545
|
)
|
|
2546
|
-
), [$e, kt] =
|
|
2546
|
+
), [$e, kt] = D(null), [io, er] = D(1), [tr, Hr] = D(
|
|
2547
2547
|
q === !1 ? 0 : q
|
|
2548
2548
|
);
|
|
2549
2549
|
Q(() => {
|
|
@@ -2945,7 +2945,7 @@ rol IN (admin, employee)`,
|
|
|
2945
2945
|
document.removeEventListener("pointermove", o), document.removeEventListener("pointerup", d);
|
|
2946
2946
|
};
|
|
2947
2947
|
}, [e]);
|
|
2948
|
-
const or = le(null), [An, Pr] =
|
|
2948
|
+
const or = le(null), [An, Pr] = D(null);
|
|
2949
2949
|
function xo(o, d) {
|
|
2950
2950
|
or.current = wt.indexOf(o), d.dataTransfer.effectAllowed = "move";
|
|
2951
2951
|
}
|
|
@@ -2975,7 +2975,7 @@ rol IN (admin, employee)`,
|
|
|
2975
2975
|
}, [r]), Q(() => {
|
|
2976
2976
|
er(1);
|
|
2977
2977
|
}, [Ke, We]);
|
|
2978
|
-
const ut = !!(
|
|
2978
|
+
const ut = !!(H && U), mt = q !== !1, He = ut ? E ?? 1 : io, Ye = ut || mt ? tr : r.length, Ge = !!w && !!k && !!O, Ct = !!p, Dn = je.useMemo(
|
|
2979
2979
|
() => new Set(
|
|
2980
2980
|
Tr ? Array.from(x ?? []) : fn
|
|
2981
2981
|
),
|
|
@@ -3014,10 +3014,10 @@ rol IN (admin, employee)`,
|
|
|
3014
3014
|
function Ur(o) {
|
|
3015
3015
|
if (a) return;
|
|
3016
3016
|
const d = Math.max(1, Math.min(o, qr));
|
|
3017
|
-
ut ?
|
|
3017
|
+
ut ? H(d) : er(d);
|
|
3018
3018
|
}
|
|
3019
3019
|
function Lo(o) {
|
|
3020
|
-
a || (Hr(o), ut ? (U(o),
|
|
3020
|
+
a || (Hr(o), ut ? (U(o), H(1)) : er(1), U && U(o));
|
|
3021
3021
|
}
|
|
3022
3022
|
function On(o) {
|
|
3023
3023
|
const d = new Set(Dn);
|
|
@@ -3691,8 +3691,8 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
3691
3691
|
),
|
|
3692
3692
|
document.body
|
|
3693
3693
|
), br = () => {
|
|
3694
|
-
const o =
|
|
3695
|
-
return !B && jr === 0 && !
|
|
3694
|
+
const o = R && tt.trim().length > 0, d = ue != null && ue.length ? ue : o ? [{ key: "bql", label: "BQL", value: tt }] : [], C = I.filter((b) => b.trim() && b !== Gt).slice(0, 8);
|
|
3695
|
+
return !B && jr === 0 && !R && !Ee ? null : /* @__PURE__ */ l(
|
|
3696
3696
|
"div",
|
|
3697
3697
|
{
|
|
3698
3698
|
className: "relative flex min-h-9 flex-wrap items-center justify-between gap-2 border-b rounded-t-lg px-2 py-1",
|
|
@@ -3712,7 +3712,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
3712
3712
|
]
|
|
3713
3713
|
}
|
|
3714
3714
|
),
|
|
3715
|
-
|
|
3715
|
+
R && /* @__PURE__ */ l(
|
|
3716
3716
|
"div",
|
|
3717
3717
|
{
|
|
3718
3718
|
ref: Dr,
|
|
@@ -3813,7 +3813,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
3813
3813
|
},
|
|
3814
3814
|
b.label
|
|
3815
3815
|
)),
|
|
3816
|
-
|
|
3816
|
+
y.length > 0 && /* @__PURE__ */ l(
|
|
3817
3817
|
"button",
|
|
3818
3818
|
{
|
|
3819
3819
|
type: "button",
|
|
@@ -3977,7 +3977,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
3977
3977
|
b
|
|
3978
3978
|
))
|
|
3979
3979
|
] }),
|
|
3980
|
-
pn &&
|
|
3980
|
+
pn && y.length > 0 && /* @__PURE__ */ t("div", { className: "grid gap-2 sm:grid-cols-2 lg:grid-cols-3", children: y.map((b) => /* @__PURE__ */ l(
|
|
3981
3981
|
"button",
|
|
3982
3982
|
{
|
|
3983
3983
|
type: "button",
|
|
@@ -4190,7 +4190,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
4190
4190
|
"div",
|
|
4191
4191
|
{
|
|
4192
4192
|
role: "rowgroup",
|
|
4193
|
-
style:
|
|
4193
|
+
style: M ? {
|
|
4194
4194
|
position: "sticky",
|
|
4195
4195
|
top: 0,
|
|
4196
4196
|
zIndex: 10,
|
|
@@ -4290,7 +4290,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
4290
4290
|
"div",
|
|
4291
4291
|
{
|
|
4292
4292
|
role: "rowgroup",
|
|
4293
|
-
style:
|
|
4293
|
+
style: M ? {
|
|
4294
4294
|
position: "sticky",
|
|
4295
4295
|
top: 0,
|
|
4296
4296
|
zIndex: 10,
|
|
@@ -4392,7 +4392,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
4392
4392
|
"div",
|
|
4393
4393
|
{
|
|
4394
4394
|
role: "rowgroup",
|
|
4395
|
-
style:
|
|
4395
|
+
style: M ? {
|
|
4396
4396
|
position: "sticky",
|
|
4397
4397
|
top: 0,
|
|
4398
4398
|
zIndex: 10,
|
|
@@ -4472,7 +4472,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
4472
4472
|
"div",
|
|
4473
4473
|
{
|
|
4474
4474
|
role: "rowgroup",
|
|
4475
|
-
style:
|
|
4475
|
+
style: M ? {
|
|
4476
4476
|
position: "sticky",
|
|
4477
4477
|
top: 0,
|
|
4478
4478
|
zIndex: 10,
|
|
@@ -4718,7 +4718,7 @@ function gi({
|
|
|
4718
4718
|
onCommit: a,
|
|
4719
4719
|
onCancel: i
|
|
4720
4720
|
}) {
|
|
4721
|
-
const [c, u] =
|
|
4721
|
+
const [c, u] = D(e), m = le(null), f = (n == null ? void 0 : n.preset) === "date", p = f ? "date" : r === "number" ? "number" : "text";
|
|
4722
4722
|
return Q(() => {
|
|
4723
4723
|
var h, x;
|
|
4724
4724
|
(h = m.current) == null || h.focus(), f || (x = m.current) == null || x.select();
|
|
@@ -4746,7 +4746,7 @@ function yi({
|
|
|
4746
4746
|
onCommit: a,
|
|
4747
4747
|
onCancel: i
|
|
4748
4748
|
}) {
|
|
4749
|
-
const c = le(null), [u, m] =
|
|
4749
|
+
const c = le(null), [u, m] = D(e);
|
|
4750
4750
|
return Q(() => {
|
|
4751
4751
|
if (n) return;
|
|
4752
4752
|
const f = setTimeout(() => {
|
|
@@ -4804,45 +4804,46 @@ function ec({
|
|
|
4804
4804
|
readOnly: i = !1,
|
|
4805
4805
|
...c
|
|
4806
4806
|
}) {
|
|
4807
|
-
const [u, m] =
|
|
4807
|
+
const [u, m] = D(r), f = le(null);
|
|
4808
4808
|
Q(() => {
|
|
4809
4809
|
f.current || m(r);
|
|
4810
4810
|
}, [r]);
|
|
4811
|
-
const [p, h] =
|
|
4811
|
+
const [p, h] = D(null);
|
|
4812
4812
|
f.current = p;
|
|
4813
|
-
const [x, v] =
|
|
4813
|
+
const [x, v] = D(null), L = le(null);
|
|
4814
4814
|
L.current = x;
|
|
4815
|
-
const [S, w] =
|
|
4815
|
+
const [S, w] = D({}), [k, O] = D({}), [ee, z] = D({}), Y = le(/* @__PURE__ */ new Set()), M = le(null);
|
|
4816
4816
|
Q(() => {
|
|
4817
|
-
var
|
|
4818
|
-
|
|
4817
|
+
var g;
|
|
4818
|
+
const s = document.activeElement;
|
|
4819
|
+
(!s || s === document.body) && ((g = M.current) == null || g.focus({ preventScroll: !0 }));
|
|
4819
4820
|
}, []);
|
|
4820
4821
|
const q = e.map((s) => {
|
|
4821
|
-
var
|
|
4822
|
-
return `${s.key}:${((j = (
|
|
4822
|
+
var g, T, j;
|
|
4823
|
+
return `${s.key}:${((j = (T = (g = s.editable) == null ? void 0 : g.select) == null ? void 0 : T.options) == null ? void 0 : j.length) ?? -1}`;
|
|
4823
4824
|
}).join("|");
|
|
4824
4825
|
Q(() => {
|
|
4825
4826
|
e.forEach((s) => {
|
|
4826
4827
|
var j, B;
|
|
4827
|
-
const
|
|
4828
|
-
if (!
|
|
4829
|
-
const
|
|
4830
|
-
(!Y.current.has(s.key) || (
|
|
4828
|
+
const g = (B = (j = s.editable) == null ? void 0 : j.select) == null ? void 0 : B.options;
|
|
4829
|
+
if (!g) return;
|
|
4830
|
+
const T = k[s.key];
|
|
4831
|
+
(!Y.current.has(s.key) || (T == null ? void 0 : T.length) === 0 && g.length > 0) && (Y.current.add(s.key), O((ne) => ({ ...ne, [s.key]: g })));
|
|
4831
4832
|
});
|
|
4832
4833
|
}, [q]);
|
|
4833
4834
|
const Z = we(
|
|
4834
|
-
async (s,
|
|
4835
|
+
async (s, g) => {
|
|
4835
4836
|
if (Y.current.has(s)) return;
|
|
4836
4837
|
Y.current.add(s);
|
|
4837
|
-
const { url:
|
|
4838
|
-
if (!(!
|
|
4838
|
+
const { url: T, fetchOptions: j } = g.select ?? {};
|
|
4839
|
+
if (!(!T && !j)) {
|
|
4839
4840
|
z((B) => ({ ...B, [s]: !0 }));
|
|
4840
4841
|
try {
|
|
4841
4842
|
let B = [];
|
|
4842
4843
|
if (j)
|
|
4843
4844
|
B = await j();
|
|
4844
|
-
else if (
|
|
4845
|
-
const ne = await fetch(
|
|
4845
|
+
else if (T) {
|
|
4846
|
+
const ne = await fetch(T);
|
|
4846
4847
|
if (!ne.ok) throw new Error("fetch failed");
|
|
4847
4848
|
B = await ne.json();
|
|
4848
4849
|
}
|
|
@@ -4866,101 +4867,102 @@ function ec({
|
|
|
4866
4867
|
const E = le(i);
|
|
4867
4868
|
E.current = i, Q(() => {
|
|
4868
4869
|
if (e.length > 0 && r.length > 0) {
|
|
4869
|
-
const s = e.find((
|
|
4870
|
+
const s = e.find((g) => g.selectable !== !1);
|
|
4870
4871
|
s && v({ rowId: n(r[0]), colKey: s.key });
|
|
4871
4872
|
}
|
|
4872
4873
|
}, []), Q(() => {
|
|
4873
4874
|
if (!x) return;
|
|
4874
|
-
const s =
|
|
4875
|
+
const s = M.current;
|
|
4875
4876
|
if (!s) return;
|
|
4876
|
-
const
|
|
4877
|
+
const g = s.querySelector(
|
|
4877
4878
|
`[data-cell-id="${x.rowId}:${x.colKey}"]`
|
|
4878
4879
|
);
|
|
4879
|
-
if (!
|
|
4880
|
-
const
|
|
4881
|
-
|
|
4880
|
+
if (!g) return;
|
|
4881
|
+
const T = s.querySelector('[role="rowgroup"]');
|
|
4882
|
+
g.style.scrollMarginTop = `${(T == null ? void 0 : T.offsetHeight) ?? 0}px`;
|
|
4882
4883
|
const j = s.querySelector('[role="row"]');
|
|
4883
4884
|
let B = 0;
|
|
4884
4885
|
j && j.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((ne) => {
|
|
4885
4886
|
ne.style.position === "sticky" && ne.style.left !== "" && (B = Math.max(B, parseFloat(ne.style.left) + ne.offsetWidth));
|
|
4886
|
-
}),
|
|
4887
|
+
}), g.style.scrollMarginLeft = `${B}px`, g.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
4887
4888
|
}, [x]);
|
|
4888
|
-
const
|
|
4889
|
+
const H = we(
|
|
4889
4890
|
(s) => {
|
|
4890
4891
|
var B;
|
|
4891
|
-
const
|
|
4892
|
-
(B =
|
|
4892
|
+
const g = J.current, T = /* @__PURE__ */ new Set(), j = [];
|
|
4893
|
+
(B = M.current) == null || B.querySelectorAll("[data-cell-id]").forEach((ne) => {
|
|
4893
4894
|
const ce = ne.dataset.cellId.split(":")[0];
|
|
4894
|
-
|
|
4895
|
+
T.has(ce) || (T.add(ce), j.push(ce));
|
|
4895
4896
|
}), v((ne) => {
|
|
4896
4897
|
if (!ne) return ne;
|
|
4897
|
-
const ce =
|
|
4898
|
+
const ce = g.findIndex((R) => R.key === ne.colKey), pe = j.indexOf(ne.rowId);
|
|
4898
4899
|
let $ = ce, ie = pe;
|
|
4899
4900
|
if (s === "up") ie = Math.max(0, pe - 1);
|
|
4900
4901
|
else if (s === "down") ie = Math.min(j.length - 1, pe + 1);
|
|
4901
4902
|
else if (s === "left") {
|
|
4902
|
-
let
|
|
4903
|
-
for (;
|
|
4904
|
-
|
|
4903
|
+
let R = ce - 1;
|
|
4904
|
+
for (; R >= 0 && g[R].selectable === !1; ) R--;
|
|
4905
|
+
R >= 0 && ($ = R);
|
|
4905
4906
|
} else if (s === "right") {
|
|
4906
|
-
let
|
|
4907
|
-
for (;
|
|
4908
|
-
|
|
4907
|
+
let R = ce + 1;
|
|
4908
|
+
for (; R < g.length && g[R].selectable === !1; ) R++;
|
|
4909
|
+
R < g.length && ($ = R);
|
|
4909
4910
|
}
|
|
4910
|
-
return $ === ce && ie === pe ? ne : { rowId: j[ie], colKey:
|
|
4911
|
+
return $ === ce && ie === pe ? ne : { rowId: j[ie], colKey: g[$].key };
|
|
4911
4912
|
});
|
|
4912
4913
|
},
|
|
4913
4914
|
[]
|
|
4914
|
-
), U = we(() => {
|
|
4915
|
-
const
|
|
4916
|
-
h(null),
|
|
4917
|
-
var
|
|
4918
|
-
return (
|
|
4915
|
+
), U = we((s = !0) => {
|
|
4916
|
+
const g = f.current;
|
|
4917
|
+
h(null), g && v(g), s && setTimeout(() => {
|
|
4918
|
+
var T;
|
|
4919
|
+
return (T = M.current) == null ? void 0 : T.focus({ preventScroll: !0 });
|
|
4919
4920
|
}, 0);
|
|
4920
4921
|
}, []), _ = we(
|
|
4921
|
-
async (s,
|
|
4922
|
+
async (s, g, T) => {
|
|
4922
4923
|
var se;
|
|
4923
|
-
const j = J.current.find((
|
|
4924
|
+
const j = J.current.find((y) => y.key === g);
|
|
4924
4925
|
if (!(j != null && j.editable)) return;
|
|
4925
|
-
const { field: B, type: ne, mask: ce, validate: pe } = j.editable, $ = ne === "number" ?
|
|
4926
|
+
const { field: B, type: ne, mask: ce, validate: pe } = j.editable, $ = ne === "number" ? T === "" ? null : Number(T) : T;
|
|
4926
4927
|
if (ce) {
|
|
4927
|
-
const
|
|
4928
|
-
if (
|
|
4929
|
-
w((
|
|
4928
|
+
const y = vi(T, ce);
|
|
4929
|
+
if (y) {
|
|
4930
|
+
w((I) => ({ ...I, [`${s}:${g}`]: y }));
|
|
4930
4931
|
return;
|
|
4931
4932
|
}
|
|
4932
4933
|
}
|
|
4933
4934
|
if (pe) {
|
|
4934
|
-
const
|
|
4935
|
-
if (
|
|
4936
|
-
w((
|
|
4935
|
+
const y = pe($);
|
|
4936
|
+
if (y) {
|
|
4937
|
+
w((I) => ({ ...I, [`${s}:${g}`]: y }));
|
|
4937
4938
|
return;
|
|
4938
4939
|
}
|
|
4939
4940
|
}
|
|
4940
|
-
const ie = X.current,
|
|
4941
|
-
if (!
|
|
4942
|
-
const
|
|
4943
|
-
h(null), w((
|
|
4944
|
-
const
|
|
4945
|
-
return delete
|
|
4941
|
+
const ie = X.current, R = te.current.find((y) => ie(y) === s);
|
|
4942
|
+
if (!R) return;
|
|
4943
|
+
const A = R[B];
|
|
4944
|
+
h(null), w((y) => {
|
|
4945
|
+
const I = { ...y };
|
|
4946
|
+
return delete I[`${s}:${g}`], I;
|
|
4946
4947
|
});
|
|
4947
|
-
const G = te.current, V = G.findIndex((
|
|
4948
|
-
if (v({ rowId: ie(re), colKey:
|
|
4949
|
-
var
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4948
|
+
const G = te.current, V = G.findIndex((y) => ie(y) === s), re = G[Math.min(G.length - 1, V + 1)];
|
|
4949
|
+
if (v({ rowId: ie(re), colKey: g }), setTimeout(() => {
|
|
4950
|
+
var I, ue;
|
|
4951
|
+
const y = document.activeElement;
|
|
4952
|
+
(!y || y === document.body || (I = M.current) != null && I.contains(y)) && ((ue = M.current) == null || ue.focus({ preventScroll: !0 }));
|
|
4953
|
+
}, 0), String(A ?? "") === String($ ?? "")) return;
|
|
4954
|
+
const me = { ...R, [B]: $ };
|
|
4953
4955
|
m(
|
|
4954
|
-
(
|
|
4956
|
+
(y) => y.map((I) => ie(I) === s ? me : I)
|
|
4955
4957
|
);
|
|
4956
4958
|
try {
|
|
4957
|
-
await ((se = P.current) == null ? void 0 : se.call(P, { row:
|
|
4959
|
+
await ((se = P.current) == null ? void 0 : se.call(P, { row: R, rowId: s, field: B, oldValue: A, newValue: $ }));
|
|
4958
4960
|
} catch {
|
|
4959
4961
|
m(
|
|
4960
|
-
(
|
|
4961
|
-
), w((
|
|
4962
|
-
...
|
|
4963
|
-
[`${s}:${
|
|
4962
|
+
(y) => y.map((I) => ie(I) === s ? R : I)
|
|
4963
|
+
), w((y) => ({
|
|
4964
|
+
...y,
|
|
4965
|
+
[`${s}:${g}`]: "Error al guardar. Intenta de nuevo."
|
|
4964
4966
|
}));
|
|
4965
4967
|
}
|
|
4966
4968
|
},
|
|
@@ -4968,8 +4970,8 @@ function ec({
|
|
|
4968
4970
|
), oe = we(
|
|
4969
4971
|
(s) => {
|
|
4970
4972
|
if (f.current) return;
|
|
4971
|
-
const
|
|
4972
|
-
if (!(!
|
|
4973
|
+
const g = L.current;
|
|
4974
|
+
if (!(!g || ![
|
|
4973
4975
|
"ArrowUp",
|
|
4974
4976
|
"ArrowDown",
|
|
4975
4977
|
"ArrowLeft",
|
|
@@ -4980,31 +4982,31 @@ function ec({
|
|
|
4980
4982
|
].includes(s.key)))
|
|
4981
4983
|
switch (s.preventDefault(), s.key) {
|
|
4982
4984
|
case "ArrowUp":
|
|
4983
|
-
|
|
4985
|
+
H("up");
|
|
4984
4986
|
break;
|
|
4985
4987
|
case "ArrowDown":
|
|
4986
|
-
|
|
4988
|
+
H("down");
|
|
4987
4989
|
break;
|
|
4988
4990
|
case "ArrowLeft":
|
|
4989
|
-
|
|
4991
|
+
H("left");
|
|
4990
4992
|
break;
|
|
4991
4993
|
case "ArrowRight":
|
|
4992
|
-
|
|
4994
|
+
H("right");
|
|
4993
4995
|
break;
|
|
4994
4996
|
case "Tab":
|
|
4995
|
-
|
|
4997
|
+
H(s.shiftKey ? "left" : "right");
|
|
4996
4998
|
break;
|
|
4997
4999
|
case "Enter": {
|
|
4998
|
-
const j = J.current.find((B) => B.key ===
|
|
4999
|
-
j != null && j.editable && !E.current ? (h(
|
|
5000
|
+
const j = J.current.find((B) => B.key === g.colKey);
|
|
5001
|
+
j != null && j.editable && !E.current ? (h(g), j.editable.type === "select" && !Y.current.has(g.colKey) && Z(g.colKey, j.editable)) : H("down");
|
|
5000
5002
|
break;
|
|
5001
5003
|
}
|
|
5002
5004
|
}
|
|
5003
5005
|
},
|
|
5004
|
-
[
|
|
5006
|
+
[H, Z]
|
|
5005
5007
|
), W = at(() => e.map((s) => {
|
|
5006
5008
|
if (!s.editable || i) {
|
|
5007
|
-
const { editable:
|
|
5009
|
+
const { editable: T, selectable: j, ...B } = s;
|
|
5008
5010
|
if (s.selectable === !1)
|
|
5009
5011
|
return { ...B, disableRowClick: !0 };
|
|
5010
5012
|
const ne = B.cell;
|
|
@@ -5022,7 +5024,7 @@ function ec({
|
|
|
5022
5024
|
className: "absolute inset-0 z-10 cursor-default",
|
|
5023
5025
|
onClick: () => {
|
|
5024
5026
|
var ie;
|
|
5025
|
-
v({ rowId: pe, colKey: s.key }), (ie =
|
|
5027
|
+
v({ rowId: pe, colKey: s.key }), (ie = M.current) == null || ie.focus({ preventScroll: !0 });
|
|
5026
5028
|
}
|
|
5027
5029
|
}
|
|
5028
5030
|
),
|
|
@@ -5038,19 +5040,19 @@ function ec({
|
|
|
5038
5040
|
}
|
|
5039
5041
|
};
|
|
5040
5042
|
}
|
|
5041
|
-
const
|
|
5043
|
+
const g = s.editable;
|
|
5042
5044
|
return {
|
|
5043
5045
|
...s,
|
|
5044
5046
|
// Make the cell a positioned ancestor so the absolute edit overlay works
|
|
5045
5047
|
className: `relative ${s.className ?? ""}`.trim(),
|
|
5046
5048
|
disableRowClick: !0,
|
|
5047
|
-
cell: (
|
|
5048
|
-
const j = n(
|
|
5049
|
+
cell: (T) => {
|
|
5050
|
+
const j = n(T), B = s.key, ne = (p == null ? void 0 : p.rowId) === j && (p == null ? void 0 : p.colKey) === B, ce = (x == null ? void 0 : x.rowId) === j && (x == null ? void 0 : x.colKey) === B, pe = S[`${j}:${B}`], $ = T[g.field], ie = String($ ?? ""), R = () => {
|
|
5049
5051
|
var G;
|
|
5050
|
-
v({ rowId: j, colKey: B }), h({ rowId: j, colKey: B }), (G =
|
|
5052
|
+
v({ rowId: j, colKey: B }), h({ rowId: j, colKey: B }), (G = M.current) == null || G.focus({ preventScroll: !0 }), g.type === "select" && !Y.current.has(B) && Z(B, g);
|
|
5051
5053
|
};
|
|
5052
5054
|
if (ne) {
|
|
5053
|
-
const G =
|
|
5055
|
+
const G = g.type === "select" ? /* @__PURE__ */ t(
|
|
5054
5056
|
yi,
|
|
5055
5057
|
{
|
|
5056
5058
|
initialValue: ie,
|
|
@@ -5063,8 +5065,8 @@ function ec({
|
|
|
5063
5065
|
gi,
|
|
5064
5066
|
{
|
|
5065
5067
|
initialValue: ie,
|
|
5066
|
-
type:
|
|
5067
|
-
mask:
|
|
5068
|
+
type: g.type ?? "text",
|
|
5069
|
+
mask: g.mask,
|
|
5068
5070
|
onCommit: (V) => _(j, B, V),
|
|
5069
5071
|
onCancel: U
|
|
5070
5072
|
}
|
|
@@ -5079,14 +5081,14 @@ function ec({
|
|
|
5079
5081
|
}
|
|
5080
5082
|
);
|
|
5081
5083
|
}
|
|
5082
|
-
const
|
|
5084
|
+
const A = s.cell(T);
|
|
5083
5085
|
return /* @__PURE__ */ l(Re, { children: [
|
|
5084
5086
|
/* @__PURE__ */ t(
|
|
5085
5087
|
"span",
|
|
5086
5088
|
{
|
|
5087
5089
|
"data-cell-id": `${j}:${B}`,
|
|
5088
5090
|
className: "peer absolute inset-0 z-10 cursor-pointer",
|
|
5089
|
-
onClick:
|
|
5091
|
+
onClick: R
|
|
5090
5092
|
}
|
|
5091
5093
|
),
|
|
5092
5094
|
ce && /* @__PURE__ */ t(
|
|
@@ -5099,7 +5101,7 @@ function ec({
|
|
|
5099
5101
|
/* @__PURE__ */ t("span", { className: "relative z-0 inline-flex items-center gap-1 pointer-events-none", children: pe ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1 text-red-500", children: [
|
|
5100
5102
|
/* @__PURE__ */ t(ya, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
5101
5103
|
/* @__PURE__ */ t("span", { className: "truncate text-xs", children: pe })
|
|
5102
|
-
] }) : /* @__PURE__ */ t("span", { className: "truncate", children:
|
|
5104
|
+
] }) : /* @__PURE__ */ t("span", { className: "truncate", children: A }) }),
|
|
5103
5105
|
/* @__PURE__ */ t(Vo, { className: "pointer-events-none absolute right-1 top-1/2 z-0 h-3 w-3 -translate-y-1/2 shrink-0 text-[var(--text-muted)] opacity-0 transition-opacity peer-hover:opacity-40" })
|
|
5104
5106
|
] });
|
|
5105
5107
|
}
|
|
@@ -5120,12 +5122,12 @@ function ec({
|
|
|
5120
5122
|
return /* @__PURE__ */ t(
|
|
5121
5123
|
"div",
|
|
5122
5124
|
{
|
|
5123
|
-
ref:
|
|
5125
|
+
ref: M,
|
|
5124
5126
|
tabIndex: 0,
|
|
5125
5127
|
onKeyDown: oe,
|
|
5126
5128
|
onBlur: (s) => {
|
|
5127
|
-
var
|
|
5128
|
-
(
|
|
5129
|
+
var g;
|
|
5130
|
+
(g = M.current) != null && g.contains(s.relatedTarget) || U(!1);
|
|
5129
5131
|
},
|
|
5130
5132
|
style: { width: "100%", minWidth: 0, outline: "none" },
|
|
5131
5133
|
children: /* @__PURE__ */ t(
|
|
@@ -5232,7 +5234,7 @@ function tc({
|
|
|
5232
5234
|
const p = {
|
|
5233
5235
|
from: Wt(e),
|
|
5234
5236
|
to: Wt(r)
|
|
5235
|
-
}, h = Wt(a), [x, v] =
|
|
5237
|
+
}, h = Wt(a), [x, v] = D(
|
|
5236
5238
|
Wt(i || e)
|
|
5237
5239
|
);
|
|
5238
5240
|
return Q(() => {
|
|
@@ -5423,15 +5425,15 @@ function rc({
|
|
|
5423
5425
|
menuClassName: u = "",
|
|
5424
5426
|
onOpenChange: m
|
|
5425
5427
|
}) {
|
|
5426
|
-
const [f, p] =
|
|
5427
|
-
(
|
|
5428
|
-
p(
|
|
5428
|
+
const [f, p] = D(!1), [h, x] = D(!1), [v, L] = D({}), S = le(null), w = le(null), k = we(
|
|
5429
|
+
(M) => {
|
|
5430
|
+
p(M), m == null || m(M);
|
|
5429
5431
|
},
|
|
5430
5432
|
[m]
|
|
5431
5433
|
), O = we(() => {
|
|
5432
|
-
const
|
|
5433
|
-
if (!
|
|
5434
|
-
const q =
|
|
5434
|
+
const M = S.current;
|
|
5435
|
+
if (!M) return;
|
|
5436
|
+
const q = M.getBoundingClientRect(), Z = typeof a == "number" ? a : q.width, te = typeof a == "number" ? a : Math.max(q.width, 180), P = n === "end" ? Math.max(8, q.right - te) : Math.min(q.left, window.innerWidth - te - 8), X = window.innerHeight - q.bottom, J = X < 240 && q.top > X ? void 0 : q.bottom + 6, E = J === void 0 ? window.innerHeight - q.top + 6 : void 0;
|
|
5435
5437
|
L({
|
|
5436
5438
|
position: "fixed",
|
|
5437
5439
|
zIndex: 9999,
|
|
@@ -5444,19 +5446,19 @@ function rc({
|
|
|
5444
5446
|
Q(() => x(!0), []), Q(() => {
|
|
5445
5447
|
if (!f) return;
|
|
5446
5448
|
O();
|
|
5447
|
-
const
|
|
5449
|
+
const M = (Z) => {
|
|
5448
5450
|
var P, X;
|
|
5449
5451
|
const te = Z.target;
|
|
5450
5452
|
!((P = S.current) != null && P.contains(te)) && !((X = w.current) != null && X.contains(te)) && k(!1);
|
|
5451
5453
|
}, q = (Z) => {
|
|
5452
5454
|
Z.key === "Escape" && k(!1);
|
|
5453
5455
|
};
|
|
5454
|
-
return document.addEventListener("mousedown",
|
|
5455
|
-
document.removeEventListener("mousedown",
|
|
5456
|
+
return document.addEventListener("mousedown", M), window.addEventListener("keydown", q), window.addEventListener("resize", O), window.addEventListener("scroll", O, !0), () => {
|
|
5457
|
+
document.removeEventListener("mousedown", M), window.removeEventListener("keydown", q), window.removeEventListener("resize", O), window.removeEventListener("scroll", O, !0);
|
|
5456
5458
|
};
|
|
5457
5459
|
}, [f, k, O]);
|
|
5458
|
-
const ee = (
|
|
5459
|
-
i || (
|
|
5460
|
+
const ee = (M) => {
|
|
5461
|
+
i || (M.key === "Enter" || M.key === " ") && (M.preventDefault(), k(!f));
|
|
5460
5462
|
}, z = cn(e) ? Ro(e, {
|
|
5461
5463
|
onClick: () => {
|
|
5462
5464
|
i || (ta(), k(!f));
|
|
@@ -5469,32 +5471,32 @@ function rc({
|
|
|
5469
5471
|
"data-bonsaif-overlay": "true",
|
|
5470
5472
|
className: `overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-1 shadow-xl ${u}`,
|
|
5471
5473
|
style: v,
|
|
5472
|
-
children: r.map((
|
|
5473
|
-
|
|
5474
|
+
children: r.map((M) => /* @__PURE__ */ l("div", { children: [
|
|
5475
|
+
M.separatorBefore && /* @__PURE__ */ t("div", { className: "my-1 border-t border-[var(--border)]" }),
|
|
5474
5476
|
/* @__PURE__ */ l(
|
|
5475
5477
|
"button",
|
|
5476
5478
|
{
|
|
5477
5479
|
type: "button",
|
|
5478
5480
|
role: "menuitem",
|
|
5479
|
-
disabled:
|
|
5481
|
+
disabled: M.disabled,
|
|
5480
5482
|
onClick: () => {
|
|
5481
5483
|
var q;
|
|
5482
|
-
|
|
5484
|
+
M.disabled || (ta(), (q = M.onSelect) == null || q.call(M), k(!1));
|
|
5483
5485
|
},
|
|
5484
5486
|
className: "flex w-full min-w-0 items-start gap-2 rounded-md px-2.5 py-1.5 text-left transition-colors hover:bg-[var(--bg-input)] disabled:cursor-not-allowed disabled:opacity-50",
|
|
5485
5487
|
style: {
|
|
5486
|
-
color:
|
|
5488
|
+
color: M.danger ? "var(--danger)" : "var(--text-main)"
|
|
5487
5489
|
},
|
|
5488
5490
|
children: [
|
|
5489
|
-
|
|
5491
|
+
M.icon && /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: M.icon }),
|
|
5490
5492
|
/* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: [
|
|
5491
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children:
|
|
5492
|
-
|
|
5493
|
+
/* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children: M.label }),
|
|
5494
|
+
M.description && /* @__PURE__ */ t("span", { className: "block truncate text-xs text-[var(--text-muted)]", children: M.description })
|
|
5493
5495
|
] })
|
|
5494
5496
|
]
|
|
5495
5497
|
}
|
|
5496
5498
|
)
|
|
5497
|
-
] },
|
|
5499
|
+
] }, M.id))
|
|
5498
5500
|
}
|
|
5499
5501
|
) : null;
|
|
5500
5502
|
return /* @__PURE__ */ l(
|
|
@@ -5537,7 +5539,7 @@ function nc({
|
|
|
5537
5539
|
disabled: ee = !1,
|
|
5538
5540
|
children: z
|
|
5539
5541
|
}) {
|
|
5540
|
-
const [Y,
|
|
5542
|
+
const [Y, M] = D(!1), [q, Z] = D(!1), [te, P] = D(!1), X = we(() => {
|
|
5541
5543
|
Z(!0), requestAnimationFrame(() => {
|
|
5542
5544
|
requestAnimationFrame(() => P(!0));
|
|
5543
5545
|
});
|
|
@@ -5552,11 +5554,11 @@ function nc({
|
|
|
5552
5554
|
return;
|
|
5553
5555
|
}
|
|
5554
5556
|
r();
|
|
5555
|
-
}, [v, r, X]),
|
|
5557
|
+
}, [v, r, X]), H = we(() => {
|
|
5556
5558
|
P(!1), Z(!1), O == null || O(), r();
|
|
5557
5559
|
}, [r, O]);
|
|
5558
5560
|
return Q(() => {
|
|
5559
|
-
|
|
5561
|
+
M(!0);
|
|
5560
5562
|
}, []), Q(() => (document.body.style.overflow = e ? "hidden" : "", e || (P(!1), Z(!1)), () => {
|
|
5561
5563
|
document.body.style.overflow = "";
|
|
5562
5564
|
}), [e]), Q(() => {
|
|
@@ -5752,7 +5754,7 @@ function nc({
|
|
|
5752
5754
|
Be,
|
|
5753
5755
|
{
|
|
5754
5756
|
variant: "secondary",
|
|
5755
|
-
onClick:
|
|
5757
|
+
onClick: H,
|
|
5756
5758
|
className: "flex-1 border",
|
|
5757
5759
|
style: {
|
|
5758
5760
|
background: "var(--warning, #d97706)",
|
|
@@ -5983,7 +5985,7 @@ function Wa({
|
|
|
5983
5985
|
required: x,
|
|
5984
5986
|
...v
|
|
5985
5987
|
}) {
|
|
5986
|
-
const [L, S] =
|
|
5988
|
+
const [L, S] = D(() => !!v.autoFocus), [w, k] = D(!1), O = v.type === "password" && f, ee = O && w ? "text" : v.type, z = !!a, Y = z && i !== "tooltip", M = z && i !== "inline", q = p ? x : void 0, Z = z ? "border-[var(--danger)] focus:border-[var(--danger)]" : "", te = M ? O ? "pr-20" : "pr-10" : O ? "pr-10" : "", P = v.value !== void 0 ? String(v.value).length > 0 : v.defaultValue !== void 0 && String(v.defaultValue).length > 0, X = L || P, J = {
|
|
5987
5989
|
top: X ? 7 : 12,
|
|
5988
5990
|
color: L ? "var(--primary)" : "var(--text-muted)",
|
|
5989
5991
|
fontSize: X ? 10 : 13,
|
|
@@ -5992,7 +5994,7 @@ function Wa({
|
|
|
5992
5994
|
}, E = (oe) => {
|
|
5993
5995
|
var W;
|
|
5994
5996
|
S(!0), (W = v.onFocus) == null || W.call(v, oe);
|
|
5995
|
-
},
|
|
5997
|
+
}, H = (oe) => {
|
|
5996
5998
|
var W;
|
|
5997
5999
|
S(!1), (W = v.onBlur) == null || W.call(v, oe);
|
|
5998
6000
|
}, U = O ? /* @__PURE__ */ l(
|
|
@@ -6023,7 +6025,7 @@ function Wa({
|
|
|
6023
6025
|
)
|
|
6024
6026
|
]
|
|
6025
6027
|
}
|
|
6026
|
-
) : null, _ =
|
|
6028
|
+
) : null, _ = M ? /* @__PURE__ */ t(
|
|
6027
6029
|
Ut,
|
|
6028
6030
|
{
|
|
6029
6031
|
as: "span",
|
|
@@ -6054,7 +6056,7 @@ function Wa({
|
|
|
6054
6056
|
"data-has-value": P ? "true" : void 0,
|
|
6055
6057
|
className: `h-11 w-full pt-5 ${te} ${Z} ${h}`,
|
|
6056
6058
|
onFocus: E,
|
|
6057
|
-
onBlur:
|
|
6059
|
+
onBlur: H
|
|
6058
6060
|
}
|
|
6059
6061
|
),
|
|
6060
6062
|
/* @__PURE__ */ l(
|
|
@@ -6096,7 +6098,7 @@ function Wa({
|
|
|
6096
6098
|
"aria-invalid": z || v["aria-invalid"],
|
|
6097
6099
|
className: `w-full ${te} ${Z} ${h}`,
|
|
6098
6100
|
onFocus: E,
|
|
6099
|
-
onBlur:
|
|
6101
|
+
onBlur: H
|
|
6100
6102
|
}
|
|
6101
6103
|
),
|
|
6102
6104
|
_,
|
|
@@ -6131,7 +6133,7 @@ function bc({
|
|
|
6131
6133
|
onChange: f,
|
|
6132
6134
|
...p
|
|
6133
6135
|
}) {
|
|
6134
|
-
const [h, x] =
|
|
6136
|
+
const [h, x] = D(
|
|
6135
6137
|
() => oa(m)
|
|
6136
6138
|
), v = u !== void 0 ? oa(u) : h, L = n && v.length > 0 && !ja(v) ? a : void 0;
|
|
6137
6139
|
return /* @__PURE__ */ t(
|
|
@@ -6227,7 +6229,7 @@ function pc({
|
|
|
6227
6229
|
size: ee = "md",
|
|
6228
6230
|
containerClassName: z = "",
|
|
6229
6231
|
dropzoneClassName: Y = "",
|
|
6230
|
-
fileListClassName:
|
|
6232
|
+
fileListClassName: M = "",
|
|
6231
6233
|
className: q = "",
|
|
6232
6234
|
id: Z,
|
|
6233
6235
|
accept: te,
|
|
@@ -6235,15 +6237,15 @@ function pc({
|
|
|
6235
6237
|
required: X,
|
|
6236
6238
|
...J
|
|
6237
6239
|
}) {
|
|
6238
|
-
const E = Ho(),
|
|
6240
|
+
const E = Ho(), H = Z ?? E, U = le(null), [_, oe] = D(!1), [W, s] = D(c), g = i ?? W, T = !!n, j = v && g.length > 0 && !P, B = (re, me) => {
|
|
6239
6241
|
i === void 0 && s(re), u == null || u(re, me);
|
|
6240
6242
|
}, ne = (re, me) => {
|
|
6241
6243
|
const se = re.filter(
|
|
6242
6244
|
(be) => la(be, te)
|
|
6243
|
-
),
|
|
6245
|
+
), y = re.filter(
|
|
6244
6246
|
(be) => !la(be, te)
|
|
6245
|
-
),
|
|
6246
|
-
|
|
6247
|
+
), I = h ? [...g, ...se] : se, ue = Wi(I, f, p);
|
|
6248
|
+
y.length > 0 && (m == null || m(y)), B(ue, me);
|
|
6247
6249
|
}, ce = () => {
|
|
6248
6250
|
var re;
|
|
6249
6251
|
P || (re = U.current) == null || re.click();
|
|
@@ -6253,12 +6255,12 @@ function pc({
|
|
|
6253
6255
|
re.preventDefault(), P || oe(!0);
|
|
6254
6256
|
}, ie = (re) => {
|
|
6255
6257
|
re.currentTarget.contains(re.relatedTarget) || oe(!1);
|
|
6256
|
-
},
|
|
6258
|
+
}, R = (re) => {
|
|
6257
6259
|
re.preventDefault(), oe(!1), !P && ne(Array.from(re.dataTransfer.files), re);
|
|
6258
|
-
},
|
|
6260
|
+
}, A = (re) => {
|
|
6259
6261
|
re.key !== "Enter" && re.key !== " " || (re.preventDefault(), ce());
|
|
6260
6262
|
}, G = (re) => {
|
|
6261
|
-
B(
|
|
6263
|
+
B(g.filter((me, se) => se !== re));
|
|
6262
6264
|
}, V = () => {
|
|
6263
6265
|
B([]);
|
|
6264
6266
|
};
|
|
@@ -6273,13 +6275,13 @@ function pc({
|
|
|
6273
6275
|
{
|
|
6274
6276
|
...J,
|
|
6275
6277
|
ref: U,
|
|
6276
|
-
id:
|
|
6278
|
+
id: H,
|
|
6277
6279
|
type: "file",
|
|
6278
6280
|
accept: te,
|
|
6279
6281
|
multiple: f,
|
|
6280
6282
|
disabled: P,
|
|
6281
|
-
required: X &&
|
|
6282
|
-
"aria-invalid":
|
|
6283
|
+
required: X && g.length === 0,
|
|
6284
|
+
"aria-invalid": T || J["aria-invalid"],
|
|
6283
6285
|
className: "sr-only",
|
|
6284
6286
|
onChange: pe
|
|
6285
6287
|
}
|
|
@@ -6289,15 +6291,15 @@ function pc({
|
|
|
6289
6291
|
{
|
|
6290
6292
|
role: "button",
|
|
6291
6293
|
tabIndex: P ? -1 : 0,
|
|
6292
|
-
"aria-controls":
|
|
6294
|
+
"aria-controls": H,
|
|
6293
6295
|
"aria-disabled": P || void 0,
|
|
6294
|
-
"aria-invalid":
|
|
6295
|
-
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)] ${_i[ee]} ${_ ? "border-[var(--primary)] bg-[var(--bg-input)]" :
|
|
6296
|
+
"aria-invalid": T || void 0,
|
|
6297
|
+
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)] ${_i[ee]} ${_ ? "border-[var(--primary)] bg-[var(--bg-input)]" : T ? "border-[var(--danger)]" : "border-[var(--border)]"} ${P ? "cursor-not-allowed opacity-60" : "hover:border-[var(--primary)] hover:bg-[var(--bg-input)]"} ${Y} ${q}`,
|
|
6296
6298
|
onClick: ce,
|
|
6297
6299
|
onDragOver: $,
|
|
6298
6300
|
onDragLeave: ie,
|
|
6299
|
-
onDrop:
|
|
6300
|
-
onKeyDown:
|
|
6301
|
+
onDrop: R,
|
|
6302
|
+
onKeyDown: A,
|
|
6301
6303
|
children: [
|
|
6302
6304
|
/* @__PURE__ */ t("span", { className: "flex h-10 w-10 items-center justify-center rounded-lg border border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]", children: /* @__PURE__ */ t(Yo, { className: "h-5 w-5" }) }),
|
|
6303
6305
|
/* @__PURE__ */ l("span", { className: "space-y-1", children: [
|
|
@@ -6308,10 +6310,10 @@ function pc({
|
|
|
6308
6310
|
]
|
|
6309
6311
|
}
|
|
6310
6312
|
),
|
|
6311
|
-
x &&
|
|
6313
|
+
x && g.length > 0 && /* @__PURE__ */ l(
|
|
6312
6314
|
"div",
|
|
6313
6315
|
{
|
|
6314
|
-
className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${
|
|
6316
|
+
className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${M}`,
|
|
6315
6317
|
children: [
|
|
6316
6318
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-2", children: [
|
|
6317
6319
|
/* @__PURE__ */ t("span", { className: "text-xs font-semibold uppercase text-[var(--text-muted)]", children: O }),
|
|
@@ -6326,7 +6328,7 @@ function pc({
|
|
|
6326
6328
|
}
|
|
6327
6329
|
)
|
|
6328
6330
|
] }),
|
|
6329
|
-
/* @__PURE__ */ t("ul", { className: "divide-y divide-[var(--border)]", children:
|
|
6331
|
+
/* @__PURE__ */ t("ul", { className: "divide-y divide-[var(--border)]", children: g.map((re, me) => /* @__PURE__ */ l(
|
|
6330
6332
|
"li",
|
|
6331
6333
|
{
|
|
6332
6334
|
className: "flex items-center gap-3 px-3 py-2",
|
|
@@ -6380,12 +6382,12 @@ function hc({
|
|
|
6380
6382
|
onSave: f,
|
|
6381
6383
|
onChange: p
|
|
6382
6384
|
}) {
|
|
6383
|
-
const [h, x] =
|
|
6385
|
+
const [h, x] = D(
|
|
6384
6386
|
() => e.map((z) => ({ key: !1, type: "", ...z }))
|
|
6385
|
-
), [v, L] =
|
|
6387
|
+
), [v, L] = D(""), [S, w] = D(""), k = we(
|
|
6386
6388
|
(z, Y) => {
|
|
6387
|
-
x((
|
|
6388
|
-
const q =
|
|
6389
|
+
x((M) => {
|
|
6390
|
+
const q = M.map((Z, te) => te === z ? { ...Z, ...Y } : Z);
|
|
6389
6391
|
return p == null || p(q), q;
|
|
6390
6392
|
});
|
|
6391
6393
|
},
|
|
@@ -6405,13 +6407,13 @@ function hc({
|
|
|
6405
6407
|
w("Ese campo ya existe en el arreglo.");
|
|
6406
6408
|
return;
|
|
6407
6409
|
}
|
|
6408
|
-
const
|
|
6410
|
+
const M = {
|
|
6409
6411
|
name: z,
|
|
6410
6412
|
key: !1,
|
|
6411
6413
|
type: ((q = n[0]) == null ? void 0 : q.value) ?? ""
|
|
6412
6414
|
};
|
|
6413
6415
|
x((Z) => {
|
|
6414
|
-
const te = [...Z,
|
|
6416
|
+
const te = [...Z, M];
|
|
6415
6417
|
return p == null || p(te), te;
|
|
6416
6418
|
}), L(""), w("");
|
|
6417
6419
|
}, [n, h, v, p]);
|
|
@@ -6472,7 +6474,7 @@ function hc({
|
|
|
6472
6474
|
{
|
|
6473
6475
|
size: "sm",
|
|
6474
6476
|
checked: z.key ?? !1,
|
|
6475
|
-
onChange: (
|
|
6477
|
+
onChange: (M) => k(Y, { key: M.target.checked }),
|
|
6476
6478
|
"aria-label": `${z.name} es clave`
|
|
6477
6479
|
}
|
|
6478
6480
|
) }),
|
|
@@ -6480,7 +6482,7 @@ function hc({
|
|
|
6480
6482
|
At,
|
|
6481
6483
|
{
|
|
6482
6484
|
value: z.type ?? "",
|
|
6483
|
-
onChange: (
|
|
6485
|
+
onChange: (M) => k(Y, { type: M }),
|
|
6484
6486
|
options: n,
|
|
6485
6487
|
placeholder: "—",
|
|
6486
6488
|
emptyLabel: "—",
|
|
@@ -6605,21 +6607,21 @@ function vc({
|
|
|
6605
6607
|
emptyText: L = "Sin resultados",
|
|
6606
6608
|
clearLabel: S = "Limpiar seleccion"
|
|
6607
6609
|
}) {
|
|
6608
|
-
const [w, k] =
|
|
6610
|
+
const [w, k] = D(!1), [O, ee] = D(""), [z, Y] = D(0), [M, q] = D(!1), [Z, te] = D({}), P = le(null), X = le(null), J = le(null), E = le(null), H = p && n.length >= h, U = at(() => new Set(e), [e]), _ = at(
|
|
6609
6611
|
() => n.filter(($) => U.has($.value)),
|
|
6610
6612
|
[n, U]
|
|
6611
6613
|
), oe = x === "all" ? _.length : x, W = _.slice(0, oe), s = Math.max(
|
|
6612
6614
|
0,
|
|
6613
6615
|
_.length - W.length
|
|
6614
|
-
),
|
|
6616
|
+
), g = H && O.trim() ? n.filter(
|
|
6615
6617
|
($) => {
|
|
6616
6618
|
var ie;
|
|
6617
6619
|
return $.label.toLowerCase().includes(O.toLowerCase()) || ((ie = $.sublabel) == null ? void 0 : ie.toLowerCase().includes(O.toLowerCase()));
|
|
6618
6620
|
}
|
|
6619
|
-
) : n,
|
|
6621
|
+
) : n, T = we(() => {
|
|
6620
6622
|
const $ = P.current;
|
|
6621
6623
|
if (!$) return;
|
|
6622
|
-
const ie = $.getBoundingClientRect(),
|
|
6624
|
+
const ie = $.getBoundingClientRect(), R = H ? 304 : 244, A = window.innerHeight - ie.bottom, G = A < R && ie.top > A;
|
|
6623
6625
|
te({
|
|
6624
6626
|
position: "fixed",
|
|
6625
6627
|
left: ie.left,
|
|
@@ -6628,39 +6630,39 @@ function vc({
|
|
|
6628
6630
|
width: ie.width,
|
|
6629
6631
|
zIndex: 9999
|
|
6630
6632
|
});
|
|
6631
|
-
}, [
|
|
6633
|
+
}, [H]), j = we(
|
|
6632
6634
|
($) => {
|
|
6633
6635
|
Ki(e, $) || r($);
|
|
6634
6636
|
},
|
|
6635
6637
|
[r, e]
|
|
6636
6638
|
), B = we(
|
|
6637
6639
|
($) => {
|
|
6638
|
-
const ie = n.find((
|
|
6640
|
+
const ie = n.find((A) => A.value === $);
|
|
6639
6641
|
if (ie != null && ie.disabled) return;
|
|
6640
|
-
const
|
|
6641
|
-
j(
|
|
6642
|
+
const R = U.has($) ? e.filter((A) => A !== $) : [...e, $];
|
|
6643
|
+
j(R);
|
|
6642
6644
|
},
|
|
6643
6645
|
[j, n, e, U]
|
|
6644
6646
|
), ne = we(() => j([]), [j]);
|
|
6645
6647
|
Q(() => q(!0), []), Q(() => {
|
|
6646
6648
|
if (!w) return;
|
|
6647
6649
|
function $(ie) {
|
|
6648
|
-
var
|
|
6649
|
-
const
|
|
6650
|
-
!((
|
|
6650
|
+
var A, G;
|
|
6651
|
+
const R = ie.target;
|
|
6652
|
+
!((A = P.current) != null && A.contains(R)) && !((G = X.current) != null && G.contains(R)) && (k(!1), ee(""));
|
|
6651
6653
|
}
|
|
6652
6654
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
6653
6655
|
}, [w]), Q(() => {
|
|
6654
|
-
w && (Y(0),
|
|
6656
|
+
w && (Y(0), T(), H && setTimeout(() => {
|
|
6655
6657
|
var $;
|
|
6656
6658
|
return ($ = J.current) == null ? void 0 : $.focus();
|
|
6657
6659
|
}, 0));
|
|
6658
|
-
}, [w,
|
|
6660
|
+
}, [w, H, T]), Q(() => {
|
|
6659
6661
|
if (w)
|
|
6660
|
-
return window.addEventListener("resize",
|
|
6661
|
-
window.removeEventListener("resize",
|
|
6662
|
+
return window.addEventListener("resize", T), window.addEventListener("scroll", T, !0), () => {
|
|
6663
|
+
window.removeEventListener("resize", T), window.removeEventListener("scroll", T, !0);
|
|
6662
6664
|
};
|
|
6663
|
-
}, [w,
|
|
6665
|
+
}, [w, T]), Q(() => {
|
|
6664
6666
|
if (z < 0 || !E.current) return;
|
|
6665
6667
|
const $ = E.current.children[z];
|
|
6666
6668
|
$ == null || $.scrollIntoView({ block: "nearest" });
|
|
@@ -6670,7 +6672,7 @@ function vc({
|
|
|
6670
6672
|
($.key === "Enter" || $.key === " " || $.key === "ArrowDown") && ($.preventDefault(), k(!0));
|
|
6671
6673
|
return;
|
|
6672
6674
|
}
|
|
6673
|
-
$.key === "Escape" && ($.preventDefault(), k(!1), ee("")), $.key === "ArrowDown" && ($.preventDefault(), Y((ie) => Math.min(ie + 1,
|
|
6675
|
+
$.key === "Escape" && ($.preventDefault(), k(!1), ee("")), $.key === "ArrowDown" && ($.preventDefault(), Y((ie) => Math.min(ie + 1, g.length - 1))), $.key === "ArrowUp" && ($.preventDefault(), Y((ie) => Math.max(ie - 1, 0))), $.key === "Enter" && g[z] && ($.preventDefault(), B(g[z].value)), $.key === "Backspace" && !O && e.length && ($.preventDefault(), j(e.slice(0, -1)));
|
|
6674
6676
|
}
|
|
6675
6677
|
const pe = /* @__PURE__ */ l(
|
|
6676
6678
|
"div",
|
|
@@ -6683,7 +6685,7 @@ function vc({
|
|
|
6683
6685
|
border: "1px solid var(--border)"
|
|
6684
6686
|
},
|
|
6685
6687
|
children: [
|
|
6686
|
-
|
|
6688
|
+
H && /* @__PURE__ */ l(
|
|
6687
6689
|
"div",
|
|
6688
6690
|
{
|
|
6689
6691
|
className: "flex items-center gap-2 px-3 py-2",
|
|
@@ -6763,26 +6765,26 @@ function vc({
|
|
|
6763
6765
|
"aria-multiselectable": "true",
|
|
6764
6766
|
className: "overflow-y-auto",
|
|
6765
6767
|
style: {
|
|
6766
|
-
maxHeight:
|
|
6768
|
+
maxHeight: H ? 220 : 200,
|
|
6767
6769
|
scrollbarWidth: "thin",
|
|
6768
6770
|
scrollbarColor: "var(--border) transparent",
|
|
6769
6771
|
overscrollBehavior: "contain"
|
|
6770
6772
|
},
|
|
6771
6773
|
children: [
|
|
6772
|
-
|
|
6773
|
-
const
|
|
6774
|
+
g.map(($, ie) => {
|
|
6775
|
+
const R = ie === z, A = U.has($.value);
|
|
6774
6776
|
return /* @__PURE__ */ l(
|
|
6775
6777
|
"li",
|
|
6776
6778
|
{
|
|
6777
6779
|
role: "option",
|
|
6778
|
-
"aria-selected":
|
|
6780
|
+
"aria-selected": A,
|
|
6779
6781
|
onMouseDown: (G) => {
|
|
6780
6782
|
G.preventDefault(), B($.value);
|
|
6781
6783
|
},
|
|
6782
6784
|
onMouseEnter: () => !$.disabled && Y(ie),
|
|
6783
6785
|
className: "flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors",
|
|
6784
6786
|
style: {
|
|
6785
|
-
background:
|
|
6787
|
+
background: R ? "var(--bg-hover)" : A ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
|
|
6786
6788
|
color: $.disabled ? "var(--text-muted)" : "var(--text-main)",
|
|
6787
6789
|
cursor: $.disabled ? "not-allowed" : "pointer",
|
|
6788
6790
|
opacity: $.disabled ? 0.58 : 1
|
|
@@ -6793,11 +6795,11 @@ function vc({
|
|
|
6793
6795
|
{
|
|
6794
6796
|
className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border",
|
|
6795
6797
|
style: {
|
|
6796
|
-
borderColor:
|
|
6797
|
-
background:
|
|
6798
|
+
borderColor: A ? "var(--primary)" : "var(--border)",
|
|
6799
|
+
background: A ? "var(--primary)" : "var(--bg-input)",
|
|
6798
6800
|
color: "var(--primary-fg)"
|
|
6799
6801
|
},
|
|
6800
|
-
children:
|
|
6802
|
+
children: A && /* @__PURE__ */ t(Ue, { className: "h-3 w-3" })
|
|
6801
6803
|
}
|
|
6802
6804
|
),
|
|
6803
6805
|
$.color && /* @__PURE__ */ t(
|
|
@@ -6831,7 +6833,7 @@ function vc({
|
|
|
6831
6833
|
$.value
|
|
6832
6834
|
);
|
|
6833
6835
|
}),
|
|
6834
|
-
|
|
6836
|
+
g.length === 0 && /* @__PURE__ */ t(
|
|
6835
6837
|
"li",
|
|
6836
6838
|
{
|
|
6837
6839
|
className: "px-3 py-4 text-center text-sm",
|
|
@@ -6942,7 +6944,7 @@ function vc({
|
|
|
6942
6944
|
]
|
|
6943
6945
|
}
|
|
6944
6946
|
),
|
|
6945
|
-
w &&
|
|
6947
|
+
w && M && Ze(pe, document.body)
|
|
6946
6948
|
]
|
|
6947
6949
|
}
|
|
6948
6950
|
);
|
|
@@ -7264,7 +7266,7 @@ function yc({
|
|
|
7264
7266
|
label: ee,
|
|
7265
7267
|
containerClassName: z = "",
|
|
7266
7268
|
helperText: Y,
|
|
7267
|
-
labelAction:
|
|
7269
|
+
labelAction: M,
|
|
7268
7270
|
className: q = "",
|
|
7269
7271
|
required: Z,
|
|
7270
7272
|
disabled: te,
|
|
@@ -7272,24 +7274,24 @@ function yc({
|
|
|
7272
7274
|
showPasswordToggle: X,
|
|
7273
7275
|
nativeValidation: J,
|
|
7274
7276
|
errorTooltipLabel: E = "Error de validacion",
|
|
7275
|
-
...
|
|
7277
|
+
...H
|
|
7276
7278
|
}) {
|
|
7277
7279
|
var re;
|
|
7278
|
-
const [U, _] =
|
|
7280
|
+
const [U, _] = D(
|
|
7279
7281
|
() => sa(m)
|
|
7280
|
-
), [oe, W] =
|
|
7282
|
+
), [oe, W] = D(
|
|
7281
7283
|
() => Nr(h)
|
|
7282
7284
|
), s = at(() => {
|
|
7283
7285
|
const me = L ?? Yi, se = v == null ? void 0 : v.map(Nr);
|
|
7284
|
-
return se != null && se.length ? me.filter((
|
|
7285
|
-
}, [v, L]),
|
|
7286
|
+
return se != null && se.length ? me.filter((y) => se.includes(y.value)) : me;
|
|
7287
|
+
}, [v, L]), g = ((re = s[0]) == null ? void 0 : re.value) ?? "+1", T = s.some(
|
|
7286
7288
|
(me) => me.value === Nr(p ?? oe)
|
|
7287
|
-
) ? Nr(p ?? oe) :
|
|
7289
|
+
) ? Nr(p ?? oe) : g, j = u !== void 0 ? sa(u) : U, B = `${T} ${j}`.trim(), ne = n && j.length > 0 && !za(B) ? a : void 0, ce = c ?? ne, pe = !!ce, $ = pe && i !== "tooltip", ie = pe && i !== "inline", R = pe ? "border-[var(--danger)] focus-within:border-[var(--danger)]" : "border-[var(--border)] focus-within:border-[var(--primary)]", A = (me) => {
|
|
7288
7290
|
const se = me.currentTarget.value;
|
|
7289
7291
|
u === void 0 && _(se), O == null || O(se, {
|
|
7290
|
-
countryCode:
|
|
7292
|
+
countryCode: T,
|
|
7291
7293
|
nationalNumber: se,
|
|
7292
|
-
fullNumber: `${
|
|
7294
|
+
fullNumber: `${T} ${se}`.trim()
|
|
7293
7295
|
}), f == null || f(me);
|
|
7294
7296
|
}, G = (me) => {
|
|
7295
7297
|
p === void 0 && W(me), x == null || x(me), O == null || O(j, {
|
|
@@ -7319,17 +7321,17 @@ function yc({
|
|
|
7319
7321
|
/* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
|
|
7320
7322
|
/* @__PURE__ */ t("span", { children: ee }),
|
|
7321
7323
|
Z && /* @__PURE__ */ t("span", { className: "text-[var(--danger)]", children: "*" }),
|
|
7322
|
-
|
|
7324
|
+
M && /* @__PURE__ */ t("span", { className: "ml-auto normal-case", children: M })
|
|
7323
7325
|
] }),
|
|
7324
7326
|
/* @__PURE__ */ l(
|
|
7325
7327
|
"span",
|
|
7326
7328
|
{
|
|
7327
|
-
className: `flex h-10 min-w-0 items-center overflow-hidden rounded-lg border bg-[var(--bg-input)] transition-colors ${
|
|
7329
|
+
className: `flex h-10 min-w-0 items-center overflow-hidden rounded-lg border bg-[var(--bg-input)] transition-colors ${R}`,
|
|
7328
7330
|
children: [
|
|
7329
7331
|
/* @__PURE__ */ t(
|
|
7330
7332
|
At,
|
|
7331
7333
|
{
|
|
7332
|
-
value:
|
|
7334
|
+
value: T,
|
|
7333
7335
|
onChange: G,
|
|
7334
7336
|
options: s,
|
|
7335
7337
|
placeholder: S,
|
|
@@ -7351,7 +7353,7 @@ function yc({
|
|
|
7351
7353
|
/* @__PURE__ */ t(
|
|
7352
7354
|
"input",
|
|
7353
7355
|
{
|
|
7354
|
-
...
|
|
7356
|
+
...H,
|
|
7355
7357
|
value: u,
|
|
7356
7358
|
defaultValue: m,
|
|
7357
7359
|
type: "tel",
|
|
@@ -7359,10 +7361,10 @@ function yc({
|
|
|
7359
7361
|
autoComplete: e,
|
|
7360
7362
|
disabled: te,
|
|
7361
7363
|
required: void 0,
|
|
7362
|
-
"aria-label":
|
|
7363
|
-
"aria-invalid": pe ||
|
|
7364
|
+
"aria-label": H["aria-label"] ?? (typeof ee == "string" ? ee : void 0),
|
|
7365
|
+
"aria-invalid": pe || H["aria-invalid"],
|
|
7364
7366
|
className: `h-full w-full min-w-0 bg-transparent px-2 py-1.5 text-sm text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] disabled:cursor-not-allowed disabled:opacity-60 ${ie ? "pr-10" : ""} ${q}`,
|
|
7365
|
-
onChange:
|
|
7367
|
+
onChange: A
|
|
7366
7368
|
}
|
|
7367
7369
|
),
|
|
7368
7370
|
V
|
|
@@ -7475,7 +7477,7 @@ function Nc({
|
|
|
7475
7477
|
placeholder: n = "Escribe algo...",
|
|
7476
7478
|
minHeight: a = "80px"
|
|
7477
7479
|
}) {
|
|
7478
|
-
const i = le(null), c = le(null), u = le(null), m = le(!1), f = le(e ?? ""), p = le(r), [h, x] =
|
|
7480
|
+
const i = le(null), c = le(null), u = le(null), m = le(!1), f = le(e ?? ""), p = le(r), [h, x] = D(() => !e || e.trim() === ""), [v, L] = D(/* @__PURE__ */ new Set()), [S, w] = D(null), [k, O] = D(""), [ee, z] = D(""), [Y, M] = D(""), [q, Z] = D(""), [te, P] = D(!1), X = we(
|
|
7479
7481
|
() => m.current ? c.current : i.current,
|
|
7480
7482
|
[]
|
|
7481
7483
|
);
|
|
@@ -7483,27 +7485,27 @@ function Nc({
|
|
|
7483
7485
|
p.current = r;
|
|
7484
7486
|
}, [r]);
|
|
7485
7487
|
const J = we(() => {
|
|
7486
|
-
const
|
|
7487
|
-
if (!
|
|
7488
|
+
const y = window.getSelection(), I = X();
|
|
7489
|
+
if (!y || !I || y.rangeCount === 0 || y.isCollapsed)
|
|
7488
7490
|
return "";
|
|
7489
|
-
const ue =
|
|
7490
|
-
return !
|
|
7491
|
+
const ue = y.getRangeAt(0);
|
|
7492
|
+
return !I.contains(ue.startContainer) || !I.contains(ue.endContainer) ? "" : y.toString();
|
|
7491
7493
|
}, [X]);
|
|
7492
7494
|
Q(() => {
|
|
7493
|
-
const
|
|
7494
|
-
f.current =
|
|
7495
|
-
const
|
|
7495
|
+
const y = e ?? "";
|
|
7496
|
+
f.current = y;
|
|
7497
|
+
const I = [i.current, c.current].filter(
|
|
7496
7498
|
(be) => !!be
|
|
7497
7499
|
);
|
|
7498
|
-
|
|
7499
|
-
be.innerHTML !==
|
|
7500
|
-
}), x(!
|
|
7501
|
-
const ue =
|
|
7500
|
+
I.forEach((be) => {
|
|
7501
|
+
be.innerHTML !== y && (be.innerHTML = y);
|
|
7502
|
+
}), x(!y || y.trim() === "");
|
|
7503
|
+
const ue = I.map((be) => ca(be));
|
|
7502
7504
|
return () => ue.forEach((be) => be());
|
|
7503
7505
|
}, [e]), Q(() => {
|
|
7504
7506
|
var be, Se;
|
|
7505
7507
|
m.current = te;
|
|
7506
|
-
let
|
|
7508
|
+
let y, I = 0, ue;
|
|
7507
7509
|
if (te) {
|
|
7508
7510
|
const he = i.current;
|
|
7509
7511
|
he && (f.current = he.innerHTML);
|
|
@@ -7511,22 +7513,22 @@ function Nc({
|
|
|
7511
7513
|
var fe;
|
|
7512
7514
|
const ke = c.current;
|
|
7513
7515
|
if (!ke) {
|
|
7514
|
-
|
|
7516
|
+
I = requestAnimationFrame(Ee);
|
|
7515
7517
|
return;
|
|
7516
7518
|
}
|
|
7517
|
-
ke.innerHTML !== f.current && (ke.innerHTML = f.current),
|
|
7519
|
+
ke.innerHTML !== f.current && (ke.innerHTML = f.current), y = ca(ke), x(((fe = ke.textContent) == null ? void 0 : fe.trim()) === ""), ue = setTimeout(() => ke.focus(), 60);
|
|
7518
7520
|
};
|
|
7519
|
-
|
|
7521
|
+
I = requestAnimationFrame(Ee);
|
|
7520
7522
|
} else {
|
|
7521
7523
|
const he = c.current, Ee = i.current, ke = (he == null ? void 0 : he.innerHTML) ?? f.current, fe = f.current;
|
|
7522
7524
|
f.current = ke, Ee && Ee.innerHTML !== ke && (Ee.innerHTML = ke), ke !== fe && p.current(ke), x(((Se = (be = he ?? Ee) == null ? void 0 : be.textContent) == null ? void 0 : Se.trim()) === "");
|
|
7523
7525
|
}
|
|
7524
7526
|
return () => {
|
|
7525
|
-
|
|
7527
|
+
I && cancelAnimationFrame(I), ue && clearTimeout(ue), y == null || y();
|
|
7526
7528
|
};
|
|
7527
7529
|
}, [te]);
|
|
7528
7530
|
const E = we(() => {
|
|
7529
|
-
const
|
|
7531
|
+
const y = [
|
|
7530
7532
|
"bold",
|
|
7531
7533
|
"italic",
|
|
7532
7534
|
"underline",
|
|
@@ -7537,10 +7539,10 @@ function Nc({
|
|
|
7537
7539
|
"justifyCenter",
|
|
7538
7540
|
"justifyRight",
|
|
7539
7541
|
"justifyFull"
|
|
7540
|
-
],
|
|
7541
|
-
|
|
7542
|
+
], I = /* @__PURE__ */ new Set();
|
|
7543
|
+
y.forEach((be) => {
|
|
7542
7544
|
try {
|
|
7543
|
-
document.queryCommandState(be) &&
|
|
7545
|
+
document.queryCommandState(be) && I.add(be);
|
|
7544
7546
|
} catch {
|
|
7545
7547
|
return;
|
|
7546
7548
|
}
|
|
@@ -7549,70 +7551,70 @@ function Nc({
|
|
|
7549
7551
|
const be = Xi(
|
|
7550
7552
|
document.queryCommandValue("formatBlock")
|
|
7551
7553
|
);
|
|
7552
|
-
be &&
|
|
7554
|
+
be && I.add(`formatBlock:${be}`);
|
|
7553
7555
|
} catch {
|
|
7554
7556
|
return;
|
|
7555
7557
|
}
|
|
7556
7558
|
const ue = J();
|
|
7557
|
-
Qr(ue, "uppercase") &&
|
|
7558
|
-
}, [J]),
|
|
7559
|
-
var
|
|
7560
|
-
const
|
|
7561
|
-
|
|
7562
|
-
}, U = (
|
|
7563
|
-
if (!
|
|
7564
|
-
const
|
|
7565
|
-
|
|
7559
|
+
Qr(ue, "uppercase") && I.add("__upper"), Qr(ue, "lowercase") && I.add("__lower"), Qr(ue, "capitalize") && I.add("__cap"), L(I);
|
|
7560
|
+
}, [J]), H = () => {
|
|
7561
|
+
var I;
|
|
7562
|
+
const y = X();
|
|
7563
|
+
y && (f.current = y.innerHTML, p.current(f.current), x(((I = y.textContent) == null ? void 0 : I.trim()) === ""));
|
|
7564
|
+
}, U = (y) => {
|
|
7565
|
+
if (!y) {
|
|
7566
|
+
const I = i.current;
|
|
7567
|
+
I && (f.current = I.innerHTML);
|
|
7566
7568
|
}
|
|
7567
|
-
P(!
|
|
7568
|
-
}, _ = (
|
|
7569
|
+
P(!y);
|
|
7570
|
+
}, _ = (y, I) => {
|
|
7569
7571
|
var ue;
|
|
7570
|
-
(ue = X()) == null || ue.focus(), document.execCommand(
|
|
7571
|
-
}, oe = (
|
|
7572
|
-
_("formatBlock",
|
|
7572
|
+
(ue = X()) == null || ue.focus(), document.execCommand(y, !1, I), H(), E();
|
|
7573
|
+
}, oe = (y) => {
|
|
7574
|
+
_("formatBlock", y);
|
|
7573
7575
|
}, W = () => {
|
|
7574
|
-
var
|
|
7575
|
-
(
|
|
7576
|
+
var y;
|
|
7577
|
+
(y = X()) == null || y.focus(), document.execCommand("insertHTML", !1, "<hr><p><br></p>"), H(), E();
|
|
7576
7578
|
}, s = () => {
|
|
7577
|
-
const
|
|
7578
|
-
|
|
7579
|
-
},
|
|
7580
|
-
const
|
|
7581
|
-
|
|
7582
|
-
},
|
|
7583
|
-
if (s(),
|
|
7584
|
-
const
|
|
7579
|
+
const y = window.getSelection();
|
|
7580
|
+
y && y.rangeCount > 0 && (u.current = y.getRangeAt(0).cloneRange());
|
|
7581
|
+
}, g = () => {
|
|
7582
|
+
const y = window.getSelection();
|
|
7583
|
+
y && u.current && (y.removeAllRanges(), y.addRange(u.current));
|
|
7584
|
+
}, T = (y) => {
|
|
7585
|
+
if (s(), y === "link") {
|
|
7586
|
+
const I = window.getSelection();
|
|
7585
7587
|
z(
|
|
7586
|
-
|
|
7588
|
+
I && !I.isCollapsed ? I.toString() : ""
|
|
7587
7589
|
), O("");
|
|
7588
7590
|
}
|
|
7589
|
-
|
|
7591
|
+
y === "image" && (M(""), Z("")), w(y);
|
|
7590
7592
|
}, j = () => {
|
|
7591
7593
|
var be;
|
|
7592
7594
|
if (!k.trim()) return;
|
|
7593
|
-
|
|
7594
|
-
const
|
|
7595
|
+
g(), (be = X()) == null || be.focus();
|
|
7596
|
+
const y = window.getSelection(), ue = (y && !y.isCollapsed ? y.toString() : "") || ee.trim() || k.trim();
|
|
7595
7597
|
document.execCommand(
|
|
7596
7598
|
"insertHTML",
|
|
7597
7599
|
!1,
|
|
7598
7600
|
`<a href="${kr(k.trim())}" target="_blank" rel="noopener noreferrer" class="rich-link">${kr(ue)}</a>`
|
|
7599
|
-
),
|
|
7600
|
-
}, B = (
|
|
7601
|
-
var
|
|
7602
|
-
Y.trim() && (
|
|
7601
|
+
), H(), w(null);
|
|
7602
|
+
}, B = (y, I = "") => `<span class="rich-img-wrap" contenteditable="false"><img src="${kr(y)}" alt="${kr(I)}" class="rich-img" />${qa()}</span>`, ne = () => {
|
|
7603
|
+
var y;
|
|
7604
|
+
Y.trim() && (g(), (y = X()) == null || y.focus(), document.execCommand(
|
|
7603
7605
|
"insertHTML",
|
|
7604
7606
|
!1,
|
|
7605
7607
|
B(Y.trim(), q.trim())
|
|
7606
|
-
),
|
|
7607
|
-
}, ce = (
|
|
7608
|
+
), H(), w(null));
|
|
7609
|
+
}, ce = (y, I = 1200, ue = 1200, be = 0.72) => new Promise((Se, he) => {
|
|
7608
7610
|
const Ee = new FileReader();
|
|
7609
7611
|
Ee.onerror = he, Ee.onload = (ke) => {
|
|
7610
7612
|
var Qe;
|
|
7611
7613
|
const fe = (Qe = ke.target) == null ? void 0 : Qe.result, ze = new Image();
|
|
7612
7614
|
ze.onerror = he, ze.onload = () => {
|
|
7613
7615
|
let { width: qe, height: ae } = ze;
|
|
7614
|
-
if (qe >
|
|
7615
|
-
const _e = Math.min(
|
|
7616
|
+
if (qe > I || ae > ue) {
|
|
7617
|
+
const _e = Math.min(I / qe, ue / ae);
|
|
7616
7618
|
qe = Math.round(qe * _e), ae = Math.round(ae * _e);
|
|
7617
7619
|
}
|
|
7618
7620
|
const Me = document.createElement("canvas");
|
|
@@ -7624,11 +7626,11 @@ function Nc({
|
|
|
7624
7626
|
}
|
|
7625
7627
|
Te.drawImage(ze, 0, 0, qe, ae), Se(Me.toDataURL("image/jpeg", be));
|
|
7626
7628
|
}, ze.src = fe;
|
|
7627
|
-
}, Ee.readAsDataURL(
|
|
7628
|
-
}), pe = (
|
|
7629
|
-
const ue = Array.from(
|
|
7629
|
+
}, Ee.readAsDataURL(y);
|
|
7630
|
+
}), pe = (y) => {
|
|
7631
|
+
const ue = Array.from(y.clipboardData.items).find((Se) => Se.type.startsWith("image/"));
|
|
7630
7632
|
if (!ue) return;
|
|
7631
|
-
|
|
7633
|
+
y.preventDefault();
|
|
7632
7634
|
const be = ue.getAsFile();
|
|
7633
7635
|
be && ce(be).then((Se) => {
|
|
7634
7636
|
var he;
|
|
@@ -7636,29 +7638,29 @@ function Nc({
|
|
|
7636
7638
|
"insertHTML",
|
|
7637
7639
|
!1,
|
|
7638
7640
|
B(Se, "imagen")
|
|
7639
|
-
),
|
|
7641
|
+
), H();
|
|
7640
7642
|
});
|
|
7641
|
-
}, $ = (
|
|
7642
|
-
const
|
|
7643
|
-
if (!
|
|
7643
|
+
}, $ = (y) => {
|
|
7644
|
+
const I = window.getSelection(), ue = X();
|
|
7645
|
+
if (!I || !ue || I.rangeCount === 0 || I.isCollapsed)
|
|
7644
7646
|
return;
|
|
7645
|
-
const be =
|
|
7647
|
+
const be = I.getRangeAt(0);
|
|
7646
7648
|
if (!ue.contains(be.startContainer) || !ue.contains(be.endContainer))
|
|
7647
7649
|
return;
|
|
7648
7650
|
const Se = be.toString();
|
|
7649
7651
|
if (!Se) return;
|
|
7650
7652
|
let he = Se;
|
|
7651
|
-
|
|
7653
|
+
y === "uppercase" ? he = Se.toLocaleUpperCase() : y === "lowercase" ? he = Se.toLocaleLowerCase() : he = Ua(Se), be.deleteContents();
|
|
7652
7654
|
const Ee = document.createTextNode(he);
|
|
7653
7655
|
be.insertNode(Ee);
|
|
7654
7656
|
const ke = document.createRange();
|
|
7655
|
-
ke.setStart(Ee, 0), ke.setEnd(Ee, he.length),
|
|
7657
|
+
ke.setStart(Ee, 0), ke.setEnd(Ee, he.length), I.removeAllRanges(), I.addRange(ke), u.current = ke.cloneRange(), H(), E();
|
|
7656
7658
|
}, ie = () => {
|
|
7657
7659
|
s(), E();
|
|
7658
|
-
},
|
|
7659
|
-
|
|
7660
|
-
},
|
|
7661
|
-
if (
|
|
7660
|
+
}, R = () => {
|
|
7661
|
+
H(), E();
|
|
7662
|
+
}, A = (y) => {
|
|
7663
|
+
if (y.key === "Escape") {
|
|
7662
7664
|
if (S) {
|
|
7663
7665
|
w(null);
|
|
7664
7666
|
return;
|
|
@@ -7668,20 +7670,20 @@ function Nc({
|
|
|
7668
7670
|
return;
|
|
7669
7671
|
}
|
|
7670
7672
|
}
|
|
7671
|
-
S || (
|
|
7673
|
+
S || (y.ctrlKey || y.metaKey) && (y.key === "b" && (y.preventDefault(), _("bold")), y.key === "i" && (y.preventDefault(), _("italic")), y.key === "u" && (y.preventDefault(), _("underline")), y.key === "k" && (y.preventDefault(), T("link")));
|
|
7672
7674
|
}, G = () => /* @__PURE__ */ t(
|
|
7673
7675
|
"div",
|
|
7674
7676
|
{
|
|
7675
7677
|
className: "h-4 w-px flex-shrink-0 mx-1",
|
|
7676
7678
|
style: { background: "var(--border)" }
|
|
7677
7679
|
}
|
|
7678
|
-
), V = (
|
|
7680
|
+
), V = (y, I, ue, be, Se) => {
|
|
7679
7681
|
const he = Se ?? (v.has(ue) || ue === "__link" && S === "link" || ue === "__img" && S === "image");
|
|
7680
7682
|
return /* @__PURE__ */ t(
|
|
7681
7683
|
"button",
|
|
7682
7684
|
{
|
|
7683
7685
|
type: "button",
|
|
7684
|
-
title:
|
|
7686
|
+
title: I,
|
|
7685
7687
|
onMouseDown: (Ee) => {
|
|
7686
7688
|
Ee.preventDefault(), be ? be() : _(ue);
|
|
7687
7689
|
},
|
|
@@ -7690,23 +7692,23 @@ function Nc({
|
|
|
7690
7692
|
color: he ? "var(--primary)" : "var(--text-secondary)",
|
|
7691
7693
|
background: he ? "rgba(59,130,246,0.12)" : "transparent"
|
|
7692
7694
|
},
|
|
7693
|
-
children:
|
|
7695
|
+
children: y
|
|
7694
7696
|
},
|
|
7695
7697
|
ue
|
|
7696
7698
|
);
|
|
7697
|
-
}, re = (
|
|
7698
|
-
const
|
|
7699
|
-
if (
|
|
7700
|
-
|
|
7701
|
-
const ue =
|
|
7702
|
-
ue && (ue.remove(),
|
|
7699
|
+
}, re = (y) => {
|
|
7700
|
+
const I = y.target;
|
|
7701
|
+
if (I.closest("[data-action='delete-img']")) {
|
|
7702
|
+
y.preventDefault();
|
|
7703
|
+
const ue = I.closest(".rich-img-wrap");
|
|
7704
|
+
ue && (ue.remove(), H());
|
|
7703
7705
|
}
|
|
7704
|
-
}, me = (
|
|
7706
|
+
}, me = (y) => /* @__PURE__ */ l(Re, { children: [
|
|
7705
7707
|
S === "link" && /* @__PURE__ */ l(
|
|
7706
7708
|
"div",
|
|
7707
7709
|
{
|
|
7708
7710
|
className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
|
|
7709
|
-
style: { borderColor: "var(--border)", background:
|
|
7711
|
+
style: { borderColor: "var(--border)", background: y },
|
|
7710
7712
|
children: [
|
|
7711
7713
|
/* @__PURE__ */ t(
|
|
7712
7714
|
"input",
|
|
@@ -7714,9 +7716,9 @@ function Nc({
|
|
|
7714
7716
|
autoFocus: !0,
|
|
7715
7717
|
type: "url",
|
|
7716
7718
|
value: k,
|
|
7717
|
-
onChange: (
|
|
7718
|
-
onKeyDown: (
|
|
7719
|
-
|
|
7719
|
+
onChange: (I) => O(I.target.value),
|
|
7720
|
+
onKeyDown: (I) => {
|
|
7721
|
+
I.key === "Enter" && (I.preventDefault(), j()), I.key === "Escape" && w(null);
|
|
7720
7722
|
},
|
|
7721
7723
|
placeholder: "https://...",
|
|
7722
7724
|
className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7732,9 +7734,9 @@ function Nc({
|
|
|
7732
7734
|
{
|
|
7733
7735
|
type: "text",
|
|
7734
7736
|
value: ee,
|
|
7735
|
-
onChange: (
|
|
7736
|
-
onKeyDown: (
|
|
7737
|
-
|
|
7737
|
+
onChange: (I) => z(I.target.value),
|
|
7738
|
+
onKeyDown: (I) => {
|
|
7739
|
+
I.key === "Enter" && (I.preventDefault(), j()), I.key === "Escape" && w(null);
|
|
7738
7740
|
},
|
|
7739
7741
|
placeholder: "Texto (opcional)",
|
|
7740
7742
|
className: "w-32 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7772,7 +7774,7 @@ function Nc({
|
|
|
7772
7774
|
"div",
|
|
7773
7775
|
{
|
|
7774
7776
|
className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
|
|
7775
|
-
style: { borderColor: "var(--border)", background:
|
|
7777
|
+
style: { borderColor: "var(--border)", background: y },
|
|
7776
7778
|
children: [
|
|
7777
7779
|
/* @__PURE__ */ t(
|
|
7778
7780
|
"input",
|
|
@@ -7780,9 +7782,9 @@ function Nc({
|
|
|
7780
7782
|
autoFocus: !0,
|
|
7781
7783
|
type: "url",
|
|
7782
7784
|
value: Y,
|
|
7783
|
-
onChange: (
|
|
7784
|
-
onKeyDown: (
|
|
7785
|
-
|
|
7785
|
+
onChange: (I) => M(I.target.value),
|
|
7786
|
+
onKeyDown: (I) => {
|
|
7787
|
+
I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
|
|
7786
7788
|
},
|
|
7787
7789
|
placeholder: "URL de la imagen...",
|
|
7788
7790
|
className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7798,9 +7800,9 @@ function Nc({
|
|
|
7798
7800
|
{
|
|
7799
7801
|
type: "text",
|
|
7800
7802
|
value: q,
|
|
7801
|
-
onChange: (
|
|
7802
|
-
onKeyDown: (
|
|
7803
|
-
|
|
7803
|
+
onChange: (I) => Z(I.target.value),
|
|
7804
|
+
onKeyDown: (I) => {
|
|
7805
|
+
I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
|
|
7804
7806
|
},
|
|
7805
7807
|
placeholder: "Texto alt",
|
|
7806
7808
|
className: "w-28 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7834,11 +7836,11 @@ function Nc({
|
|
|
7834
7836
|
]
|
|
7835
7837
|
}
|
|
7836
7838
|
)
|
|
7837
|
-
] }), se = (
|
|
7839
|
+
] }), se = (y, I) => /* @__PURE__ */ l(
|
|
7838
7840
|
"div",
|
|
7839
7841
|
{
|
|
7840
7842
|
className: "flex flex-shrink-0 flex-wrap items-center gap-0.5 border-t px-2 py-1",
|
|
7841
|
-
style: { borderColor: "var(--border)", background:
|
|
7843
|
+
style: { borderColor: "var(--border)", background: I },
|
|
7842
7844
|
children: [
|
|
7843
7845
|
V(
|
|
7844
7846
|
/* @__PURE__ */ t(el, { className: "h-4 w-4" }),
|
|
@@ -7950,7 +7952,7 @@ function Nc({
|
|
|
7950
7952
|
/* @__PURE__ */ t(wa, { className: "h-4 w-4" }),
|
|
7951
7953
|
"Insertar enlace (Ctrl+K)",
|
|
7952
7954
|
"__link",
|
|
7953
|
-
() =>
|
|
7955
|
+
() => T("link")
|
|
7954
7956
|
),
|
|
7955
7957
|
V(
|
|
7956
7958
|
/* @__PURE__ */ t(sl, { className: "h-4 w-4" }),
|
|
@@ -7961,7 +7963,7 @@ function Nc({
|
|
|
7961
7963
|
/* @__PURE__ */ t(cl, { className: "h-4 w-4" }),
|
|
7962
7964
|
"Insertar imagen",
|
|
7963
7965
|
"__img",
|
|
7964
|
-
() =>
|
|
7966
|
+
() => T("image")
|
|
7965
7967
|
),
|
|
7966
7968
|
V(
|
|
7967
7969
|
/* @__PURE__ */ t(Na, { className: "h-4 w-4" }),
|
|
@@ -7986,13 +7988,13 @@ function Nc({
|
|
|
7986
7988
|
"button",
|
|
7987
7989
|
{
|
|
7988
7990
|
type: "button",
|
|
7989
|
-
title:
|
|
7991
|
+
title: y ? "Salir del modo de enfoque (Esc)" : "Modo de enfoque",
|
|
7990
7992
|
onMouseDown: (ue) => {
|
|
7991
|
-
ue.preventDefault(), U(
|
|
7993
|
+
ue.preventDefault(), U(y);
|
|
7992
7994
|
},
|
|
7993
7995
|
className: "flex h-7 w-7 items-center justify-center rounded transition-colors",
|
|
7994
7996
|
style: { color: "var(--text-secondary)" },
|
|
7995
|
-
children:
|
|
7997
|
+
children: y ? /* @__PURE__ */ t(Jo, { className: "h-4 w-4" }) : /* @__PURE__ */ t(Qo, { className: "h-4 w-4" })
|
|
7996
7998
|
}
|
|
7997
7999
|
)
|
|
7998
8000
|
]
|
|
@@ -8011,8 +8013,8 @@ function Nc({
|
|
|
8011
8013
|
ref: i,
|
|
8012
8014
|
contentEditable: !0,
|
|
8013
8015
|
suppressContentEditableWarning: !0,
|
|
8014
|
-
onInput:
|
|
8015
|
-
onKeyDown:
|
|
8016
|
+
onInput: R,
|
|
8017
|
+
onKeyDown: A,
|
|
8016
8018
|
onKeyUp: ie,
|
|
8017
8019
|
onSelect: ie,
|
|
8018
8020
|
onMouseUp: ie,
|
|
@@ -8053,8 +8055,8 @@ function Nc({
|
|
|
8053
8055
|
ref: c,
|
|
8054
8056
|
contentEditable: !0,
|
|
8055
8057
|
suppressContentEditableWarning: !0,
|
|
8056
|
-
onInput:
|
|
8057
|
-
onKeyDown:
|
|
8058
|
+
onInput: R,
|
|
8059
|
+
onKeyDown: A,
|
|
8058
8060
|
onKeyUp: ie,
|
|
8059
8061
|
onSelect: ie,
|
|
8060
8062
|
onMouseUp: ie,
|
|
@@ -8235,48 +8237,48 @@ function Sc({
|
|
|
8235
8237
|
optionClassName: v,
|
|
8236
8238
|
spinnerClassName: L
|
|
8237
8239
|
}) {
|
|
8238
|
-
const [S, w] =
|
|
8240
|
+
const [S, w] = D(!1), [k, O] = D(!1), [ee, z] = D(-1), [Y, M] = D({}), q = le(null), Z = le(null), te = le(null), P = r.find((s) => s.value === e) ?? r[0], X = {
|
|
8239
8241
|
...P != null && P.tone ? da[P.tone] : void 0,
|
|
8240
8242
|
...P == null ? void 0 : P.style
|
|
8241
8243
|
}, J = i || c || r.length === 0, E = (s) => {
|
|
8242
8244
|
u && s.stopPropagation();
|
|
8243
|
-
},
|
|
8245
|
+
}, H = we(() => {
|
|
8244
8246
|
w(!1), z(-1);
|
|
8245
8247
|
}, []), U = we(() => {
|
|
8246
8248
|
const s = q.current;
|
|
8247
8249
|
if (!s) return;
|
|
8248
|
-
const
|
|
8249
|
-
Math.max(8,
|
|
8250
|
-
window.innerWidth -
|
|
8250
|
+
const g = s.getBoundingClientRect(), T = Math.max(g.width, rs[a]), j = Math.min(Math.max(r.length, 1) * 38 + 12, 260), B = window.innerHeight - g.bottom, ne = B < j && g.top > B, ce = Math.min(
|
|
8251
|
+
Math.max(8, g.left + g.width / 2 - T / 2),
|
|
8252
|
+
window.innerWidth - T - 8
|
|
8251
8253
|
);
|
|
8252
|
-
|
|
8254
|
+
M({
|
|
8253
8255
|
position: "fixed",
|
|
8254
8256
|
left: ce,
|
|
8255
|
-
top: ne ? void 0 :
|
|
8256
|
-
bottom: ne ? window.innerHeight -
|
|
8257
|
-
width:
|
|
8257
|
+
top: ne ? void 0 : g.bottom + 6,
|
|
8258
|
+
bottom: ne ? window.innerHeight - g.top + 6 : void 0,
|
|
8259
|
+
width: T,
|
|
8258
8260
|
zIndex: 9999
|
|
8259
8261
|
});
|
|
8260
8262
|
}, [r.length, a]), _ = we(
|
|
8261
8263
|
(s) => {
|
|
8262
|
-
s.disabled || (n(s.value),
|
|
8264
|
+
s.disabled || (n(s.value), H());
|
|
8263
8265
|
},
|
|
8264
|
-
[
|
|
8266
|
+
[H, n]
|
|
8265
8267
|
);
|
|
8266
8268
|
Q(() => O(!0), []), Q(() => {
|
|
8267
8269
|
if (!S) return;
|
|
8268
8270
|
U();
|
|
8269
|
-
const s = r.findIndex((
|
|
8271
|
+
const s = r.findIndex((g) => g.value === e);
|
|
8270
8272
|
z(s >= 0 ? s : 0);
|
|
8271
8273
|
}, [S, r, U, e]), Q(() => {
|
|
8272
8274
|
if (!S) return;
|
|
8273
|
-
function s(
|
|
8275
|
+
function s(g) {
|
|
8274
8276
|
var j, B;
|
|
8275
|
-
const
|
|
8276
|
-
!((j = q.current) != null && j.contains(
|
|
8277
|
+
const T = g.target;
|
|
8278
|
+
!((j = q.current) != null && j.contains(T)) && !((B = Z.current) != null && B.contains(T)) && H();
|
|
8277
8279
|
}
|
|
8278
8280
|
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
8279
|
-
}, [
|
|
8281
|
+
}, [H, S]), Q(() => {
|
|
8280
8282
|
if (S)
|
|
8281
8283
|
return window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
|
|
8282
8284
|
window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
@@ -8293,21 +8295,21 @@ function Sc({
|
|
|
8293
8295
|
return;
|
|
8294
8296
|
}
|
|
8295
8297
|
if (s.key === "Escape") {
|
|
8296
|
-
s.preventDefault(),
|
|
8298
|
+
s.preventDefault(), H();
|
|
8297
8299
|
return;
|
|
8298
8300
|
}
|
|
8299
8301
|
if (s.key === "ArrowDown") {
|
|
8300
|
-
s.preventDefault(), z((
|
|
8302
|
+
s.preventDefault(), z((g) => Math.min(g + 1, r.length - 1));
|
|
8301
8303
|
return;
|
|
8302
8304
|
}
|
|
8303
8305
|
if (s.key === "ArrowUp") {
|
|
8304
|
-
s.preventDefault(), z((
|
|
8306
|
+
s.preventDefault(), z((g) => Math.max(g - 1, 0));
|
|
8305
8307
|
return;
|
|
8306
8308
|
}
|
|
8307
8309
|
if (s.key === "Enter" || s.key === " ") {
|
|
8308
8310
|
s.preventDefault();
|
|
8309
|
-
const
|
|
8310
|
-
|
|
8311
|
+
const g = r[ee];
|
|
8312
|
+
g && _(g);
|
|
8311
8313
|
}
|
|
8312
8314
|
}
|
|
8313
8315
|
}
|
|
@@ -8340,8 +8342,8 @@ function Sc({
|
|
|
8340
8342
|
scrollbarColor: "var(--border) transparent",
|
|
8341
8343
|
overscrollBehavior: "contain"
|
|
8342
8344
|
},
|
|
8343
|
-
children: r.map((s,
|
|
8344
|
-
const
|
|
8345
|
+
children: r.map((s, g) => {
|
|
8346
|
+
const T = s.value === e, j = g === ee, B = {
|
|
8345
8347
|
...s.tone ? da[s.tone] : void 0,
|
|
8346
8348
|
...s.style
|
|
8347
8349
|
};
|
|
@@ -8350,25 +8352,25 @@ function Sc({
|
|
|
8350
8352
|
{
|
|
8351
8353
|
type: "button",
|
|
8352
8354
|
role: "option",
|
|
8353
|
-
"aria-selected":
|
|
8355
|
+
"aria-selected": T,
|
|
8354
8356
|
disabled: s.disabled,
|
|
8355
|
-
onMouseEnter: () => !s.disabled && z(
|
|
8357
|
+
onMouseEnter: () => !s.disabled && z(g),
|
|
8356
8358
|
onMouseDown: (ne) => {
|
|
8357
8359
|
ne.preventDefault(), _(s);
|
|
8358
8360
|
},
|
|
8359
8361
|
className: ht(
|
|
8360
8362
|
"flex w-full items-center gap-2 rounded-lg font-medium text-left transition-colors disabled:cursor-not-allowed disabled:opacity-45",
|
|
8361
8363
|
ns[a],
|
|
8362
|
-
|
|
8364
|
+
T ? s.className : void 0,
|
|
8363
8365
|
v
|
|
8364
8366
|
),
|
|
8365
8367
|
style: {
|
|
8366
|
-
...
|
|
8367
|
-
background:
|
|
8368
|
-
color:
|
|
8368
|
+
...T ? B : void 0,
|
|
8369
|
+
background: T ? B.background ?? "color-mix(in srgb, var(--primary) 12%, transparent)" : j ? "var(--bg-hover)" : "transparent",
|
|
8370
|
+
color: T ? B.color ?? "var(--primary)" : "var(--text-main)"
|
|
8369
8371
|
},
|
|
8370
8372
|
children: [
|
|
8371
|
-
/* @__PURE__ */ t("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children:
|
|
8373
|
+
/* @__PURE__ */ t("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: T ? /* @__PURE__ */ t(Ue, { className: "h-4 w-4" }) : null }),
|
|
8372
8374
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: s.label })
|
|
8373
8375
|
]
|
|
8374
8376
|
},
|
|
@@ -8529,56 +8531,56 @@ function $c({
|
|
|
8529
8531
|
contentClassName: w = "",
|
|
8530
8532
|
footerClassName: k = ""
|
|
8531
8533
|
}) {
|
|
8532
|
-
var
|
|
8533
|
-
const O = ((
|
|
8534
|
+
var R;
|
|
8535
|
+
const O = ((R = e[0]) == null ? void 0 : R.id) ?? "", [ee, z] = D(
|
|
8534
8536
|
n ?? O
|
|
8535
|
-
), [Y,
|
|
8537
|
+
), [Y, M] = D(
|
|
8536
8538
|
i
|
|
8537
8539
|
), q = r ?? ee, Z = a ?? Y, te = at(
|
|
8538
8540
|
() => new Set(Z),
|
|
8539
8541
|
[Z]
|
|
8540
8542
|
), P = Math.max(
|
|
8541
8543
|
0,
|
|
8542
|
-
e.findIndex((
|
|
8543
|
-
), X = e[P] ?? e[0], J = e.length <= 1 ? 100 : P / (e.length - 1) * 100, E = (
|
|
8544
|
-
a ||
|
|
8545
|
-
},
|
|
8546
|
-
const G = e.find((V) => V.id ===
|
|
8547
|
-
G && (r || z(
|
|
8548
|
-
}, U = (
|
|
8549
|
-
const G = e[
|
|
8550
|
-
return !G || G.disabled ? !1 :
|
|
8551
|
-
}, W = (
|
|
8552
|
-
const G = e.findIndex((V) => V.id ===
|
|
8544
|
+
e.findIndex((A) => A.id === q)
|
|
8545
|
+
), X = e[P] ?? e[0], J = e.length <= 1 ? 100 : P / (e.length - 1) * 100, E = (A) => {
|
|
8546
|
+
a || M(A), u == null || u(A);
|
|
8547
|
+
}, H = (A) => {
|
|
8548
|
+
const G = e.find((V) => V.id === A);
|
|
8549
|
+
G && (r || z(A), c == null || c(A, G));
|
|
8550
|
+
}, U = (A) => te.has(A), _ = (A) => e.slice(0, A).find((G) => !G.optional && !te.has(G.id)), oe = (A) => {
|
|
8551
|
+
const G = e[A];
|
|
8552
|
+
return !G || G.disabled ? !1 : A === P || f && A < P ? !0 : !_(A);
|
|
8553
|
+
}, W = (A) => {
|
|
8554
|
+
const G = e.findIndex((V) => V.id === A);
|
|
8553
8555
|
return G >= 0 && oe(G);
|
|
8554
|
-
}, s = (
|
|
8555
|
-
const G = e.findIndex((V) => V.id ===
|
|
8556
|
+
}, s = (A) => {
|
|
8557
|
+
const G = e.findIndex((V) => V.id === A);
|
|
8556
8558
|
if (G < 0) return !1;
|
|
8557
8559
|
if (!oe(G)) {
|
|
8558
8560
|
const V = _(G);
|
|
8559
8561
|
return V && (m == null || m(e[G], V)), !1;
|
|
8560
8562
|
}
|
|
8561
|
-
return
|
|
8562
|
-
},
|
|
8563
|
-
!
|
|
8564
|
-
},
|
|
8565
|
-
if (!
|
|
8566
|
-
const G = e.findIndex((re) => re.id ===
|
|
8563
|
+
return H(A), !0;
|
|
8564
|
+
}, g = (A = X == null ? void 0 : X.id) => {
|
|
8565
|
+
!A || te.has(A) || E([...Z, A]);
|
|
8566
|
+
}, T = (A = X == null ? void 0 : X.id) => {
|
|
8567
|
+
if (!A) return;
|
|
8568
|
+
const G = e.findIndex((re) => re.id === A), V = Z.filter((re) => {
|
|
8567
8569
|
const me = e.findIndex((se) => se.id === re);
|
|
8568
8570
|
return me >= 0 && me < G;
|
|
8569
8571
|
});
|
|
8570
|
-
E(V), G >= 0 && P > G &&
|
|
8572
|
+
E(V), G >= 0 && P > G && H(A);
|
|
8571
8573
|
}, j = () => P <= 0 ? !1 : s(e[P - 1].id), B = () => {
|
|
8572
|
-
const
|
|
8573
|
-
return
|
|
8574
|
+
const A = e[P + 1];
|
|
8575
|
+
return A ? s(A.id) : !1;
|
|
8574
8576
|
}, ne = {
|
|
8575
8577
|
activeStep: X,
|
|
8576
8578
|
activeIndex: P,
|
|
8577
8579
|
completedStepIds: Z,
|
|
8578
8580
|
isCompleted: U,
|
|
8579
8581
|
isUnlocked: W,
|
|
8580
|
-
completeStep:
|
|
8581
|
-
uncompleteStep:
|
|
8582
|
+
completeStep: g,
|
|
8583
|
+
uncompleteStep: T,
|
|
8582
8584
|
goToStep: s,
|
|
8583
8585
|
goNext: B,
|
|
8584
8586
|
goPrevious: j
|
|
@@ -8615,8 +8617,8 @@ function $c({
|
|
|
8615
8617
|
style: {
|
|
8616
8618
|
gridTemplateColumns: `repeat(${e.length}, minmax(0, 1fr))`
|
|
8617
8619
|
},
|
|
8618
|
-
children: e.map((
|
|
8619
|
-
const V =
|
|
8620
|
+
children: e.map((A, G) => {
|
|
8621
|
+
const V = A.id === X.id, re = U(A.id), me = oe(G), se = _(G);
|
|
8620
8622
|
return /* @__PURE__ */ l(
|
|
8621
8623
|
"button",
|
|
8622
8624
|
{
|
|
@@ -8624,8 +8626,8 @@ function $c({
|
|
|
8624
8626
|
disabled: !me,
|
|
8625
8627
|
"aria-current": V ? "step" : void 0,
|
|
8626
8628
|
"aria-disabled": !me,
|
|
8627
|
-
title: !me && se ? `Completa ${se.title}` :
|
|
8628
|
-
onClick: () => s(
|
|
8629
|
+
title: !me && se ? `Completa ${se.title}` : A.title,
|
|
8630
|
+
onClick: () => s(A.id),
|
|
8629
8631
|
className: it(
|
|
8630
8632
|
"group relative min-h-16 min-w-0 overflow-hidden rounded-md border p-3 text-left transition-all duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--primary)]/35 disabled:cursor-not-allowed",
|
|
8631
8633
|
V && "border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",
|
|
@@ -8668,17 +8670,17 @@ function $c({
|
|
|
8668
8670
|
children: [
|
|
8669
8671
|
G + 1,
|
|
8670
8672
|
". ",
|
|
8671
|
-
|
|
8673
|
+
A.title
|
|
8672
8674
|
]
|
|
8673
8675
|
}
|
|
8674
8676
|
),
|
|
8675
|
-
|
|
8677
|
+
A.description && /* @__PURE__ */ t("span", { className: "mt-1 block truncate text-[11px] text-[var(--text-muted)]", children: A.description })
|
|
8676
8678
|
] }),
|
|
8677
|
-
|
|
8679
|
+
A.badge && /* @__PURE__ */ t("span", { className: "shrink-0", children: A.badge })
|
|
8678
8680
|
] })
|
|
8679
8681
|
]
|
|
8680
8682
|
},
|
|
8681
|
-
|
|
8683
|
+
A.id
|
|
8682
8684
|
);
|
|
8683
8685
|
})
|
|
8684
8686
|
}
|
|
@@ -8791,7 +8793,7 @@ const ss = ga(
|
|
|
8791
8793
|
onInput: O,
|
|
8792
8794
|
...ee
|
|
8793
8795
|
}, z) {
|
|
8794
|
-
const Y = le(null),
|
|
8796
|
+
const Y = le(null), M = is(S, w), q = p ?? k, Z = !!(x || v || f), te = h === "error" ? "var(--danger)" : h === "success" ? "#16a34a" : "var(--border)", P = {
|
|
8795
8797
|
...L ?? {},
|
|
8796
8798
|
...u ? { minHeight: `${u * 24 + 18}px` } : null,
|
|
8797
8799
|
...m ? { maxHeight: `${m * 24 + 18}px` } : null
|
|
@@ -8823,7 +8825,7 @@ const ss = ga(
|
|
|
8823
8825
|
J,
|
|
8824
8826
|
v && /* @__PURE__ */ t("span", { className: "absolute right-2 top-2 flex items-center justify-center", children: v }),
|
|
8825
8827
|
f && /* @__PURE__ */ l("span", { className: "absolute bottom-1.5 right-2 rounded bg-[var(--bg-input)] px-1.5 text-[10px] font-semibold text-[var(--text-muted)]", children: [
|
|
8826
|
-
|
|
8828
|
+
M,
|
|
8827
8829
|
q ? `/${q}` : ""
|
|
8828
8830
|
] })
|
|
8829
8831
|
] }) : J;
|
|
@@ -9035,11 +9037,11 @@ function ys({
|
|
|
9035
9037
|
style: L
|
|
9036
9038
|
}) {
|
|
9037
9039
|
var U;
|
|
9038
|
-
const [S, w] =
|
|
9040
|
+
const [S, w] = D(!1), k = typeof e == "string" && e.trim() && e !== "undefined" && e !== "null" ? e.trim() : "";
|
|
9039
9041
|
Q(() => {
|
|
9040
9042
|
w(!1);
|
|
9041
9043
|
}, [k, x]);
|
|
9042
|
-
const { wh: O, text: ee } = ms[a], z = fa(n) || fa(r) || m, Y = z.trim()[0] || "?",
|
|
9044
|
+
const { wh: O, text: ee } = ms[a], z = fa(n) || fa(r) || m, Y = z.trim()[0] || "?", M = typeof process < "u" && ((U = process.env) == null ? void 0 : U.NEXT_PUBLIC_BASE_PATH) || "", q = xs(r, n), Z = gs(M, "/favicon.svg"), te = k ? `${M}/api/user/avatar/${k}${x ? `?v=${x}` : ""}` : "", X = {
|
|
9043
9045
|
xs: 20,
|
|
9044
9046
|
sm: 28,
|
|
9045
9047
|
md: 36,
|
|
@@ -9100,12 +9102,12 @@ function ys({
|
|
|
9100
9102
|
]
|
|
9101
9103
|
}
|
|
9102
9104
|
);
|
|
9103
|
-
const E = c ?? !0,
|
|
9104
|
-
return E &&
|
|
9105
|
+
const E = c ?? !0, H = u ?? z;
|
|
9106
|
+
return E && H ? /* @__PURE__ */ t(
|
|
9105
9107
|
Ut,
|
|
9106
9108
|
{
|
|
9107
9109
|
as: "span",
|
|
9108
|
-
content:
|
|
9110
|
+
content: H,
|
|
9109
9111
|
className: `inline-flex flex-shrink-0 ${f}`,
|
|
9110
9112
|
children: J
|
|
9111
9113
|
}
|
|
@@ -9132,7 +9134,7 @@ function ks({
|
|
|
9132
9134
|
onLogout: f,
|
|
9133
9135
|
LinkComponent: p = ws
|
|
9134
9136
|
}) {
|
|
9135
|
-
const [h, x] =
|
|
9137
|
+
const [h, x] = D(!1), v = Ns(r);
|
|
9136
9138
|
return /* @__PURE__ */ l("div", { className: "min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]", children: [
|
|
9137
9139
|
/* @__PURE__ */ t(us, {}),
|
|
9138
9140
|
/* @__PURE__ */ t(
|
|
@@ -9349,7 +9351,7 @@ function Tc({
|
|
|
9349
9351
|
contained: h = !1,
|
|
9350
9352
|
LinkComponent: x = Ss
|
|
9351
9353
|
}) {
|
|
9352
|
-
const v = le(null), [L, S] =
|
|
9354
|
+
const v = le(null), [L, S] = D(!1), [w, k] = D(f ?? "/"), [O, ee] = D(() => ha()), [z, Y] = D(null), M = f ?? w, q = m ?? Ls(M), Z = i ?? Ms(M), te = p && !O && q.length > 1, P = !te;
|
|
9353
9355
|
Q(() => {
|
|
9354
9356
|
f || k(window.location.pathname);
|
|
9355
9357
|
}, [f]), Q(() => {
|
|
@@ -9359,7 +9361,7 @@ function Tc({
|
|
|
9359
9361
|
S(!1);
|
|
9360
9362
|
return;
|
|
9361
9363
|
}
|
|
9362
|
-
let J = null, E = 0,
|
|
9364
|
+
let J = null, E = 0, H = 0;
|
|
9363
9365
|
const U = () => {
|
|
9364
9366
|
const W = v.current, s = document.querySelector(
|
|
9365
9367
|
"[data-app-scroll='true']"
|
|
@@ -9373,8 +9375,8 @@ function Tc({
|
|
|
9373
9375
|
}, oe = () => {
|
|
9374
9376
|
J == null || J.removeEventListener("scroll", _), J = U(), J.addEventListener("scroll", _, { passive: !0 }), _();
|
|
9375
9377
|
};
|
|
9376
|
-
return oe(), E = window.requestAnimationFrame(oe),
|
|
9377
|
-
window.cancelAnimationFrame(E), window.clearTimeout(
|
|
9378
|
+
return oe(), E = window.requestAnimationFrame(oe), H = window.setTimeout(oe, 120), () => {
|
|
9379
|
+
window.cancelAnimationFrame(E), window.clearTimeout(H), J == null || J.removeEventListener("scroll", _);
|
|
9378
9380
|
};
|
|
9379
9381
|
}, [h]), Q(() => {
|
|
9380
9382
|
if (h) {
|
|
@@ -9382,32 +9384,32 @@ function Tc({
|
|
|
9382
9384
|
return;
|
|
9383
9385
|
}
|
|
9384
9386
|
let J = 0;
|
|
9385
|
-
const E = [],
|
|
9386
|
-
const
|
|
9387
|
+
const E = [], H = () => {
|
|
9388
|
+
const T = v.current, j = T == null ? void 0 : T.parentElement, B = document.querySelector(
|
|
9387
9389
|
"[data-app-scroll='true']"
|
|
9388
9390
|
), ne = tn(B) ?? B;
|
|
9389
|
-
if (!
|
|
9391
|
+
if (!T || !j || !ne) {
|
|
9390
9392
|
Y(null);
|
|
9391
9393
|
return;
|
|
9392
9394
|
}
|
|
9393
|
-
const ce = j.getBoundingClientRect(), pe = window.getComputedStyle(j), $ = ne.getBoundingClientRect(), ie = ne instanceof HTMLElement && ne.clientWidth > 0 ? ne.clientWidth : $.width,
|
|
9394
|
-
marginLeft: Math.round($.left -
|
|
9395
|
+
const ce = j.getBoundingClientRect(), pe = window.getComputedStyle(j), $ = ne.getBoundingClientRect(), ie = ne instanceof HTMLElement && ne.clientWidth > 0 ? ne.clientWidth : $.width, R = ce.left + parseFloat(pe.paddingLeft || "0"), A = {
|
|
9396
|
+
marginLeft: Math.round($.left - R),
|
|
9395
9397
|
width: Math.round(ie)
|
|
9396
9398
|
};
|
|
9397
9399
|
Y(
|
|
9398
|
-
(G) => G && G.marginLeft ===
|
|
9400
|
+
(G) => G && G.marginLeft === A.marginLeft && G.width === A.width ? G : A
|
|
9399
9401
|
);
|
|
9400
9402
|
}, U = () => {
|
|
9401
|
-
window.cancelAnimationFrame(J), J = window.requestAnimationFrame(
|
|
9403
|
+
window.cancelAnimationFrame(J), J = window.requestAnimationFrame(H);
|
|
9402
9404
|
};
|
|
9403
9405
|
U(), window.addEventListener("resize", U);
|
|
9404
9406
|
const _ = new ResizeObserver(U), oe = v.current, W = oe == null ? void 0 : oe.parentElement, s = document.querySelector(
|
|
9405
9407
|
"[data-app-scroll='true']"
|
|
9406
|
-
),
|
|
9407
|
-
return [W, s,
|
|
9408
|
-
|
|
9408
|
+
), g = tn(s) ?? s;
|
|
9409
|
+
return [W, s, g].forEach((T) => {
|
|
9410
|
+
T && _.observe(T);
|
|
9409
9411
|
}), E.push(window.setTimeout(U, 120)), E.push(window.setTimeout(U, 280)), () => {
|
|
9410
|
-
window.cancelAnimationFrame(J), window.removeEventListener("resize", U), _.disconnect(), E.forEach((
|
|
9412
|
+
window.cancelAnimationFrame(J), window.removeEventListener("resize", U), _.disconnect(), E.forEach((T) => window.clearTimeout(T));
|
|
9411
9413
|
};
|
|
9412
9414
|
}, [h]);
|
|
9413
9415
|
const X = {
|
|
@@ -9449,7 +9451,7 @@ function Tc({
|
|
|
9449
9451
|
{
|
|
9450
9452
|
className: `flex flex-wrap items-center gap-1.5 leading-none transition-[font-size,line-height] duration-300 ease-out ${L ? "text-[10px]" : "text-[10px] sm:text-[11px]"}`,
|
|
9451
9453
|
children: q.map((J, E) => {
|
|
9452
|
-
const
|
|
9454
|
+
const H = E === q.length - 1;
|
|
9453
9455
|
return /* @__PURE__ */ l(
|
|
9454
9456
|
"li",
|
|
9455
9457
|
{
|
|
@@ -9462,7 +9464,7 @@ function Tc({
|
|
|
9462
9464
|
style: { color: "var(--text-muted)" }
|
|
9463
9465
|
}
|
|
9464
9466
|
),
|
|
9465
|
-
J.href && !
|
|
9467
|
+
J.href && !H ? /* @__PURE__ */ t(
|
|
9466
9468
|
x,
|
|
9467
9469
|
{
|
|
9468
9470
|
href: J.href,
|
|
@@ -9473,10 +9475,10 @@ function Tc({
|
|
|
9473
9475
|
) : /* @__PURE__ */ t(
|
|
9474
9476
|
"span",
|
|
9475
9477
|
{
|
|
9476
|
-
"aria-current":
|
|
9477
|
-
className:
|
|
9478
|
+
"aria-current": H ? "page" : void 0,
|
|
9479
|
+
className: H ? "truncate font-semibold" : "truncate",
|
|
9478
9480
|
style: {
|
|
9479
|
-
color:
|
|
9481
|
+
color: H ? "var(--text-main)" : "var(--text-muted)"
|
|
9480
9482
|
},
|
|
9481
9483
|
children: J.label
|
|
9482
9484
|
}
|
|
@@ -9597,7 +9599,7 @@ function Dc({
|
|
|
9597
9599
|
src: r,
|
|
9598
9600
|
projectKey: n
|
|
9599
9601
|
}) {
|
|
9600
|
-
const [a, i] =
|
|
9602
|
+
const [a, i] = D("system"), c = le(null);
|
|
9601
9603
|
Q(() => {
|
|
9602
9604
|
i(va());
|
|
9603
9605
|
const f = new MutationObserver(
|
|
@@ -9661,7 +9663,7 @@ function Dc({
|
|
|
9661
9663
|
) });
|
|
9662
9664
|
}
|
|
9663
9665
|
function Bc() {
|
|
9664
|
-
const [e, r] =
|
|
9666
|
+
const [e, r] = D(""), [n, a] = D(!1), [i, c] = D({ width: 96, height: 96 });
|
|
9665
9667
|
return Q(() => {
|
|
9666
9668
|
let u = !1;
|
|
9667
9669
|
return fetch("/api/microservices/prime-suite/chat-url", { cache: "no-store" }).then((m) => m.ok ? m.json() : null).then((m) => {
|
|
@@ -9728,7 +9730,7 @@ function Oc({
|
|
|
9728
9730
|
return /* @__PURE__ */ t(Nl, { position: e, theme: r, richColors: !0, closeButton: !0 });
|
|
9729
9731
|
}
|
|
9730
9732
|
function Ic(e) {
|
|
9731
|
-
const [r, n] =
|
|
9733
|
+
const [r, n] = D({}), [a, i] = D(!1), c = we(
|
|
9732
9734
|
(p) => a || r[p] ? e[p] : void 0,
|
|
9733
9735
|
[e, a, r]
|
|
9734
9736
|
), u = we((p) => {
|