bonsaif-ui 0.1.47 → 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 +752 -744
- 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
|
@@ -41,7 +41,7 @@ function El({
|
|
|
41
41
|
size: m = "default",
|
|
42
42
|
inputTabIndex: f
|
|
43
43
|
}) {
|
|
44
|
-
const p = le(null), [
|
|
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());
|
|
@@ -53,9 +53,9 @@ function El({
|
|
|
53
53
|
return /* @__PURE__ */ l(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className: `relative min-w-0 max-w-full flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${
|
|
56
|
+
className: `relative min-w-0 max-w-full flex-shrink-0 overflow-visible transition-[width] duration-200 ease-out ${v ? S : "w-24 sm:w-28"}`,
|
|
57
57
|
onMouseDown: (k) => {
|
|
58
|
-
|
|
58
|
+
v || (k.preventDefault(), w());
|
|
59
59
|
},
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ t(
|
|
@@ -80,12 +80,12 @@ function El({
|
|
|
80
80
|
onKeyDown: (k) => {
|
|
81
81
|
k.key === "Escape" && (u == null || u());
|
|
82
82
|
},
|
|
83
|
-
placeholder:
|
|
84
|
-
className: `${L} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${
|
|
83
|
+
placeholder: v ? n : "Buscar",
|
|
84
|
+
className: `${L} w-full py-0 text-sm leading-none placeholder:text-[var(--text-muted)] focus:outline-none transition-all duration-200 ${v ? "pl-9 pr-8" : "cursor-pointer pl-9 pr-3"}`,
|
|
85
85
|
style: {
|
|
86
86
|
height: `var(--page-header-control-height, ${m === "sm" ? "36px" : "40px"})`,
|
|
87
87
|
paddingLeft: "calc(var(--page-header-control-icon-left, 12px) + 24px)",
|
|
88
|
-
paddingRight:
|
|
88
|
+
paddingRight: v ? "calc(var(--page-header-control-padding-x, 14px) + 18px)" : "var(--page-header-control-padding-x, 14px)",
|
|
89
89
|
background: "color-mix(in srgb, var(--bg-card) 86%, transparent)",
|
|
90
90
|
border: "1px solid var(--border)",
|
|
91
91
|
color: "var(--text-main)"
|
|
@@ -157,58 +157,58 @@ function Ut({
|
|
|
157
157
|
className: m = "",
|
|
158
158
|
tooltipClassName: f = "",
|
|
159
159
|
style: p,
|
|
160
|
-
tooltipStyle:
|
|
160
|
+
tooltipStyle: h,
|
|
161
161
|
as: x = "div"
|
|
162
162
|
}) {
|
|
163
|
-
const
|
|
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
|
-
const E =
|
|
166
|
-
E && (E.querySelectorAll("[title]").forEach((
|
|
167
|
-
const U =
|
|
168
|
-
U && (
|
|
169
|
-
}), E.querySelectorAll("svg title").forEach((
|
|
165
|
+
const E = v.current;
|
|
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,
|
|
176
|
-
if (!i &&
|
|
177
|
-
const B =
|
|
178
|
-
c === "top" ? (s = ne - _.width / 2,
|
|
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
|
+
if (!i && v.current) {
|
|
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, 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),
|
|
181
|
-
const B =
|
|
182
|
-
c === "top" || c === "bottom" ?
|
|
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
|
+
const B = v.current.getBoundingClientRect(), ne = B.left + B.width / 2, ce = B.top + B.height / 2;
|
|
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
|
-
const U =
|
|
198
|
+
const U = v.current;
|
|
199
199
|
if (U && !hr(U)) {
|
|
200
200
|
if (n) {
|
|
201
201
|
const _ = Ll(U);
|
|
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
|
-
const E =
|
|
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 = () => {
|
|
@@ -224,16 +224,16 @@ function Ut({
|
|
|
224
224
|
};
|
|
225
225
|
Q(() => {
|
|
226
226
|
if (!k) return;
|
|
227
|
-
if (hr(
|
|
227
|
+
if (hr(v.current)) {
|
|
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
|
-
hr(
|
|
236
|
+
hr(v.current) && O(null);
|
|
237
237
|
});
|
|
238
238
|
return U.observe(document.body, {
|
|
239
239
|
childList: !0,
|
|
@@ -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
|
}, []);
|
|
@@ -260,15 +260,15 @@ function Ut({
|
|
|
260
260
|
x,
|
|
261
261
|
{
|
|
262
262
|
ref: (E) => {
|
|
263
|
-
|
|
263
|
+
v.current = E;
|
|
264
264
|
},
|
|
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,
|
|
@@ -280,7 +280,7 @@ function Ut({
|
|
|
280
280
|
children: e
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
|
-
k && J && !hr(
|
|
283
|
+
k && J && !hr(v.current) ? Ze(
|
|
284
284
|
/* @__PURE__ */ l(
|
|
285
285
|
"div",
|
|
286
286
|
{
|
|
@@ -306,7 +306,7 @@ function Ut({
|
|
|
306
306
|
whiteSpace: "normal",
|
|
307
307
|
lineHeight: 1.6,
|
|
308
308
|
overflowWrap: "anywhere",
|
|
309
|
-
...
|
|
309
|
+
...h
|
|
310
310
|
},
|
|
311
311
|
children: [
|
|
312
312
|
u && /* @__PURE__ */ t(
|
|
@@ -317,11 +317,11 @@ function Ut({
|
|
|
317
317
|
position: "absolute",
|
|
318
318
|
width: 12,
|
|
319
319
|
height: 12,
|
|
320
|
-
background: (
|
|
321
|
-
borderLeft: c === "right" ? (
|
|
322
|
-
borderTop: c === "bottom" || c === "right" ? (
|
|
323
|
-
borderRight: c === "left" ? (
|
|
324
|
-
borderBottom: c === "top" || c === "left" ? (
|
|
320
|
+
background: (h == null ? void 0 : h.background) ?? "var(--bg-card)",
|
|
321
|
+
borderLeft: c === "right" ? (h == null ? void 0 : h.border) ?? "1px solid var(--border)" : void 0,
|
|
322
|
+
borderTop: c === "bottom" || c === "right" ? (h == null ? void 0 : h.border) ?? "1px solid var(--border)" : void 0,
|
|
323
|
+
borderRight: c === "left" ? (h == null ? void 0 : h.border) ?? "1px solid var(--border)" : void 0,
|
|
324
|
+
borderBottom: c === "top" || c === "left" ? (h == null ? void 0 : h.border) ?? "1px solid var(--border)" : void 0,
|
|
325
325
|
transform: "rotate(45deg)",
|
|
326
326
|
left: k.arrowX === void 0 ? void 0 : k.arrowX - 6,
|
|
327
327
|
top: k.arrowY === void 0 ? void 0 : k.arrowY - 6,
|
|
@@ -381,20 +381,20 @@ function Be({
|
|
|
381
381
|
padding: m,
|
|
382
382
|
children: f,
|
|
383
383
|
className: p = "",
|
|
384
|
-
disabled:
|
|
384
|
+
disabled: h,
|
|
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,
|
|
392
392
|
title: q,
|
|
393
393
|
"aria-label": Z,
|
|
394
394
|
"data-variant": e,
|
|
395
395
|
"data-size": O,
|
|
396
396
|
"data-icon": ee ? "true" : void 0,
|
|
397
|
-
disabled:
|
|
397
|
+
disabled: h || n,
|
|
398
398
|
className: `${Ml} ${z ? Al : Tl[e]} ${ee ? Bl[O] : Dl[O]} ${w && !ee ? "px-2.5" : ""} ${p}`,
|
|
399
399
|
style: {
|
|
400
400
|
...Ol[e],
|
|
@@ -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
|
}
|
|
@@ -569,9 +569,9 @@ function Ks({
|
|
|
569
569
|
loadModule: m,
|
|
570
570
|
activeService: f,
|
|
571
571
|
initialService: p,
|
|
572
|
-
onActiveServiceChange:
|
|
572
|
+
onActiveServiceChange: h,
|
|
573
573
|
canAccess: x,
|
|
574
|
-
keepAlive:
|
|
574
|
+
keepAlive: v = !0,
|
|
575
575
|
title: L,
|
|
576
576
|
subtitle: S,
|
|
577
577
|
emptyState: w,
|
|
@@ -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(
|
|
@@ -600,29 +600,29 @@ function Ks({
|
|
|
600
600
|
(ae) => !ae.disabled
|
|
601
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
|
|
612
|
-
ae.disabled || (f || W(ae.service),
|
|
613
|
-
},
|
|
609
|
+
$.current = T;
|
|
610
|
+
}, [T]);
|
|
611
|
+
const y = (ae) => {
|
|
612
|
+
ae.disabled || (f || W(ae.service), h == null || h(ae.service, ae));
|
|
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];
|
|
625
|
-
if (Me != null && Me.loading || Me != null && Me.component &&
|
|
625
|
+
if (Me != null && Me.loading || Me != null && Me.component && v) return;
|
|
626
626
|
const Te = (u == null ? void 0 : u[ae]) ?? m;
|
|
627
627
|
if (!Te) {
|
|
628
628
|
j((De) => ({
|
|
@@ -639,7 +639,7 @@ function Ks({
|
|
|
639
639
|
...De,
|
|
640
640
|
[ae]: { ...De[ae], loading: !0, error: void 0 }
|
|
641
641
|
})), Te(se, i).then((De) => {
|
|
642
|
-
if (_e !== ie.current && !
|
|
642
|
+
if (_e !== ie.current && !v) return;
|
|
643
643
|
const et = Fl(De);
|
|
644
644
|
j((Fe) => ({
|
|
645
645
|
...Fe,
|
|
@@ -652,15 +652,15 @@ function Ks({
|
|
|
652
652
|
[ae]: { ...Fe[ae], loading: !1, error: et }
|
|
653
653
|
}));
|
|
654
654
|
});
|
|
655
|
-
}, [i,
|
|
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] = D(!1),
|
|
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] = D(u.year), [w, k] = D(u.month), [O, ee] = D("days"), z = 16, [Y,
|
|
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
|
-
if (!m || !f || !
|
|
928
|
-
const W =
|
|
929
|
-
|
|
927
|
+
if (!m || !f || !h.current) return;
|
|
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
|
+
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
|
-
|
|
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
|
|
@@ -1229,7 +1229,7 @@ function Ys({
|
|
|
1229
1229
|
]
|
|
1230
1230
|
}
|
|
1231
1231
|
);
|
|
1232
|
-
return m ? /* @__PURE__ */ l("div", { ref:
|
|
1232
|
+
return m ? /* @__PURE__ */ l("div", { ref: h, className: "relative w-full", children: [
|
|
1233
1233
|
/* @__PURE__ */ l(
|
|
1234
1234
|
"button",
|
|
1235
1235
|
{
|
|
@@ -1290,7 +1290,7 @@ const sn = ga(function({
|
|
|
1290
1290
|
containerClassName: m = "",
|
|
1291
1291
|
disabled: f,
|
|
1292
1292
|
...p
|
|
1293
|
-
},
|
|
1293
|
+
}, h) {
|
|
1294
1294
|
const x = le(null);
|
|
1295
1295
|
return Q(() => {
|
|
1296
1296
|
x.current && (x.current.indeterminate = c);
|
|
@@ -1304,8 +1304,8 @@ const sn = ga(function({
|
|
|
1304
1304
|
"input",
|
|
1305
1305
|
{
|
|
1306
1306
|
...p,
|
|
1307
|
-
ref: (
|
|
1308
|
-
x.current =
|
|
1307
|
+
ref: (v) => {
|
|
1308
|
+
x.current = v, Yl(h, v);
|
|
1309
1309
|
},
|
|
1310
1310
|
type: "checkbox",
|
|
1311
1311
|
disabled: f,
|
|
@@ -1351,9 +1351,9 @@ function Oa({
|
|
|
1351
1351
|
stopPropagation: m = !0,
|
|
1352
1352
|
onCopied: f,
|
|
1353
1353
|
onCopyError: p,
|
|
1354
|
-
className:
|
|
1354
|
+
className: h = "",
|
|
1355
1355
|
style: x,
|
|
1356
|
-
children:
|
|
1356
|
+
children: v,
|
|
1357
1357
|
onClick: L,
|
|
1358
1358
|
type: S = "button",
|
|
1359
1359
|
...w
|
|
@@ -1362,14 +1362,14 @@ function Oa({
|
|
|
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 {
|
|
@@ -1393,7 +1393,7 @@ function Oa({
|
|
|
1393
1393
|
title: k ? a : n,
|
|
1394
1394
|
"aria-label": w["aria-label"] ?? (k ? a : n),
|
|
1395
1395
|
"data-copied": k ? "true" : void 0,
|
|
1396
|
-
className: `relative inline-flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-md transition-all duration-200 ${
|
|
1396
|
+
className: `relative inline-flex h-7 shrink-0 items-center justify-center gap-1.5 rounded-md transition-all duration-200 ${v ? "min-w-7 px-2" : "w-7"} ${h}`,
|
|
1397
1397
|
style: {
|
|
1398
1398
|
cursor: "pointer",
|
|
1399
1399
|
background: k ? "rgba(22,163,74,0.15)" : "var(--bg-card)",
|
|
@@ -1411,7 +1411,7 @@ function Oa({
|
|
|
1411
1411
|
children: k ? u : c
|
|
1412
1412
|
}
|
|
1413
1413
|
),
|
|
1414
|
-
|
|
1414
|
+
v && /* @__PURE__ */ t("span", { className: "text-xs font-semibold leading-none", children: k ? i ?? v : v })
|
|
1415
1415
|
]
|
|
1416
1416
|
}
|
|
1417
1417
|
);
|
|
@@ -1501,99 +1501,99 @@ function At({
|
|
|
1501
1501
|
placeholder: m = "Seleccionar…",
|
|
1502
1502
|
emptyLabel: f,
|
|
1503
1503
|
disabled: p = !1,
|
|
1504
|
-
className:
|
|
1504
|
+
className: h = "",
|
|
1505
1505
|
style: x,
|
|
1506
|
-
dropdownMinWidth:
|
|
1506
|
+
dropdownMinWidth: v,
|
|
1507
1507
|
height: L = 40,
|
|
1508
1508
|
padding: S = "0 10px",
|
|
1509
1509
|
searchable: w = !0,
|
|
1510
1510
|
minOptionsForSearch: k = 6
|
|
1511
1511
|
}) {
|
|
1512
|
-
const [O, ee] = D(!1), [z, Y] = D(""), [
|
|
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:
|
|
1527
|
-
minWidth: Zr(
|
|
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
|
+
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",
|
|
@@ -1751,7 +1751,7 @@ function At({
|
|
|
1751
1751
|
"div",
|
|
1752
1752
|
{
|
|
1753
1753
|
ref: J,
|
|
1754
|
-
className: `relative ${
|
|
1754
|
+
className: `relative ${h || "w-full"}`,
|
|
1755
1755
|
style: x,
|
|
1756
1756
|
children: [
|
|
1757
1757
|
/* @__PURE__ */ l(
|
|
@@ -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)" },
|
|
@@ -1868,8 +1868,8 @@ function Zs({
|
|
|
1868
1868
|
iconLeft: f = 10,
|
|
1869
1869
|
searchable: p = !0
|
|
1870
1870
|
}) {
|
|
1871
|
-
const
|
|
1872
|
-
(x,
|
|
1871
|
+
const h = i ? n.map(
|
|
1872
|
+
(x, v) => v === 0 && !x.color ? { ...x, sublabel: x.sublabel ?? void 0 } : x
|
|
1873
1873
|
) : n;
|
|
1874
1874
|
return /* @__PURE__ */ l("div", { className: `relative ${c}`, children: [
|
|
1875
1875
|
i && /* @__PURE__ */ t(
|
|
@@ -1885,7 +1885,7 @@ function Zs({
|
|
|
1885
1885
|
{
|
|
1886
1886
|
value: e,
|
|
1887
1887
|
onChange: r,
|
|
1888
|
-
options:
|
|
1888
|
+
options: h,
|
|
1889
1889
|
placeholder: a,
|
|
1890
1890
|
searchable: p,
|
|
1891
1891
|
minOptionsForSearch: 5,
|
|
@@ -1916,9 +1916,9 @@ function Ia({
|
|
|
1916
1916
|
children: m,
|
|
1917
1917
|
size: f = "md",
|
|
1918
1918
|
maxWidth: p,
|
|
1919
|
-
zIndex:
|
|
1919
|
+
zIndex: h = 1e3,
|
|
1920
1920
|
closeOnBackdrop: x = !0,
|
|
1921
|
-
closeOnEscape:
|
|
1921
|
+
closeOnEscape: v = !0,
|
|
1922
1922
|
showCloseButton: L = !0,
|
|
1923
1923
|
placement: S = "center",
|
|
1924
1924
|
bodyClassName: w = "px-6 py-5",
|
|
@@ -1927,7 +1927,7 @@ 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
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(
|
|
@@ -1941,13 +1941,13 @@ function Ia({
|
|
|
1941
1941
|
document.body.style.overflow = "";
|
|
1942
1942
|
};
|
|
1943
1943
|
}, [e]), Q(() => {
|
|
1944
|
-
if (!e || !
|
|
1944
|
+
if (!e || !v) return;
|
|
1945
1945
|
const oe = (W) => {
|
|
1946
1946
|
W.key === "Escape" && r();
|
|
1947
1947
|
};
|
|
1948
1948
|
return window.addEventListener("keydown", oe), () => window.removeEventListener("keydown", oe);
|
|
1949
|
-
}, [
|
|
1950
|
-
const J = n || a || i || c || L, E = p ?? Zl[f],
|
|
1949
|
+
}, [v, r, e]), !q) return null;
|
|
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,8 +1956,8 @@ 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 ${
|
|
1960
|
-
style: { zIndex:
|
|
1959
|
+
className: `fixed inset-0 flex ${H} ${ee}`,
|
|
1960
|
+
style: { zIndex: h },
|
|
1961
1961
|
children: [
|
|
1962
1962
|
/* @__PURE__ */ t(
|
|
1963
1963
|
"div",
|
|
@@ -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",
|
|
@@ -2380,15 +2380,15 @@ function fi(e, r, n) {
|
|
|
2380
2380
|
case "bottom10": {
|
|
2381
2381
|
const p = n.map((x) => ({ value: x, number: qt(x) })).filter(
|
|
2382
2382
|
(x) => x.number !== null
|
|
2383
|
-
).sort((x,
|
|
2383
|
+
).sort((x, v) => x.number - v.number).map((x) => x.value);
|
|
2384
2384
|
return (r.operator === "top10" ? p.slice(-10) : p.slice(0, 10)).includes(e);
|
|
2385
2385
|
}
|
|
2386
2386
|
case "aboveAverage":
|
|
2387
2387
|
case "belowAverage": {
|
|
2388
2388
|
const f = n.map(qt).filter((x) => x !== null);
|
|
2389
2389
|
if (f.length === 0) return !1;
|
|
2390
|
-
const p = f.reduce((x,
|
|
2391
|
-
return
|
|
2390
|
+
const p = f.reduce((x, v) => x + v, 0) / f.length, h = qt(e);
|
|
2391
|
+
return h === null ? !1 : r.operator === "aboveAverage" ? h > p : h < p;
|
|
2392
2392
|
}
|
|
2393
2393
|
default:
|
|
2394
2394
|
return !0;
|
|
@@ -2426,9 +2426,9 @@ function pi({
|
|
|
2426
2426
|
initialEmptyDelay: m = 450,
|
|
2427
2427
|
onRowClick: f,
|
|
2428
2428
|
renderExpandedRow: p,
|
|
2429
|
-
getRowCanExpand:
|
|
2429
|
+
getRowCanExpand: h,
|
|
2430
2430
|
expandedRowIds: x,
|
|
2431
|
-
defaultExpandedRowIds:
|
|
2431
|
+
defaultExpandedRowIds: v = [],
|
|
2432
2432
|
onExpandedRowIdsChange: L,
|
|
2433
2433
|
expandOnRowClick: S = !1,
|
|
2434
2434
|
selected: w,
|
|
@@ -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,
|
|
@@ -2487,7 +2487,7 @@ rol IN (admin, employee)`,
|
|
|
2487
2487
|
e
|
|
2488
2488
|
), [ot, Kt] = D(!1), [ct, Ya] = D("filter"), [Bt, Vt] = D(
|
|
2489
2489
|
null
|
|
2490
|
-
), [mn, bn] = D(""), [We, Ot] = D({}), [Ke, Yt] = D({}), Tr = x !== void 0, [fn, Ga] = D(
|
|
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
2492
|
), [Qa, eo] = D(
|
|
2493
2493
|
{}
|
|
@@ -2502,7 +2502,7 @@ rol IN (admin, employee)`,
|
|
|
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;
|
|
@@ -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,
|
|
@@ -4485,7 +4485,7 @@ ${C}`, K = new Blob(["\uFEFF" + b], {
|
|
|
4485
4485
|
/* @__PURE__ */ t("div", { role: "rowgroup", children: Bn.map((o, d) => {
|
|
4486
4486
|
const C = n(o), b = jn(Y == null ? void 0 : Y(o)), K = d > 0 ? jn(
|
|
4487
4487
|
Y == null ? void 0 : Y(Bn[d - 1])
|
|
4488
|
-
) : null, N = b && b.key !== (K == null ? void 0 : K.key), de = Ge && w.has(C), F = Ct ? (
|
|
4488
|
+
) : null, N = b && b.key !== (K == null ? void 0 : K.key), de = Ge && w.has(C), F = Ct ? (h == null ? void 0 : h(o)) ?? !0 : !1, Le = F && Dn.has(C), Ce = !!f || S && F, ve = de && ee ? "color-mix(in srgb, var(--primary) 8%, var(--bg-card))" : d % 2 === 1 ? "color-mix(in srgb, var(--bg-input) 30%, var(--bg-card))" : "var(--bg-card)";
|
|
4489
4489
|
return /* @__PURE__ */ l(je.Fragment, { children: [
|
|
4490
4490
|
N && /* @__PURE__ */ t(
|
|
4491
4491
|
"div",
|
|
@@ -4720,8 +4720,8 @@ function gi({
|
|
|
4720
4720
|
}) {
|
|
4721
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
|
-
var
|
|
4724
|
-
(
|
|
4723
|
+
var h, x;
|
|
4724
|
+
(h = m.current) == null || h.focus(), f || (x = m.current) == null || x.select();
|
|
4725
4725
|
}, [f]), /* @__PURE__ */ t(
|
|
4726
4726
|
"input",
|
|
4727
4727
|
{
|
|
@@ -4729,12 +4729,12 @@ function gi({
|
|
|
4729
4729
|
type: p,
|
|
4730
4730
|
value: c,
|
|
4731
4731
|
maxLength: n == null ? void 0 : n.maxLength,
|
|
4732
|
-
onChange: (
|
|
4732
|
+
onChange: (h) => u(h.target.value),
|
|
4733
4733
|
onBlur: () => a(c),
|
|
4734
|
-
onKeyDown: (
|
|
4735
|
-
|
|
4734
|
+
onKeyDown: (h) => {
|
|
4735
|
+
h.key === "Enter" && (h.preventDefault(), a(c)), h.key === "Escape" && (h.preventDefault(), i()), (n == null ? void 0 : n.preset) === "integer" && !h.ctrlKey && !h.metaKey && !xi.has(h.key) && !/^[\d-]$/.test(h.key) && h.preventDefault();
|
|
4736
4736
|
},
|
|
4737
|
-
onClick: (
|
|
4737
|
+
onClick: (h) => h.stopPropagation(),
|
|
4738
4738
|
className: "w-full min-w-0 border-0 bg-transparent p-0 text-sm text-[var(--text-main)] outline-none"
|
|
4739
4739
|
}
|
|
4740
4740
|
);
|
|
@@ -4746,27 +4746,33 @@ function yi({
|
|
|
4746
4746
|
onCommit: a,
|
|
4747
4747
|
onCancel: i
|
|
4748
4748
|
}) {
|
|
4749
|
-
const c = le(null);
|
|
4749
|
+
const c = le(null), [u, m] = D(e);
|
|
4750
4750
|
return Q(() => {
|
|
4751
4751
|
if (n) return;
|
|
4752
|
-
const
|
|
4753
|
-
var
|
|
4754
|
-
(
|
|
4752
|
+
const f = setTimeout(() => {
|
|
4753
|
+
var p, h;
|
|
4754
|
+
(h = (p = c.current) == null ? void 0 : p.querySelector("button")) == null || h.click();
|
|
4755
4755
|
}, 0);
|
|
4756
|
-
return () => clearTimeout(
|
|
4756
|
+
return () => clearTimeout(f);
|
|
4757
4757
|
}, [n]), /* @__PURE__ */ t(
|
|
4758
4758
|
"div",
|
|
4759
4759
|
{
|
|
4760
4760
|
ref: c,
|
|
4761
4761
|
className: "w-full",
|
|
4762
|
-
|
|
4763
|
-
|
|
4762
|
+
tabIndex: -1,
|
|
4763
|
+
onKeyDown: (f) => {
|
|
4764
|
+
f.key === "Escape" && (f.stopPropagation(), i()), f.key === "Enter" && (f.preventDefault(), f.stopPropagation(), a(u));
|
|
4764
4765
|
},
|
|
4765
4766
|
children: /* @__PURE__ */ t(
|
|
4766
4767
|
At,
|
|
4767
4768
|
{
|
|
4768
|
-
value:
|
|
4769
|
-
onChange:
|
|
4769
|
+
value: u,
|
|
4770
|
+
onChange: (f) => {
|
|
4771
|
+
m(f), setTimeout(() => {
|
|
4772
|
+
var p;
|
|
4773
|
+
return (p = c.current) == null ? void 0 : p.focus({ preventScroll: !0 });
|
|
4774
|
+
}, 0);
|
|
4775
|
+
},
|
|
4770
4776
|
options: r,
|
|
4771
4777
|
disabled: n,
|
|
4772
4778
|
placeholder: n ? "Cargando…" : "Seleccionar…",
|
|
@@ -4802,41 +4808,42 @@ function ec({
|
|
|
4802
4808
|
Q(() => {
|
|
4803
4809
|
f.current || m(r);
|
|
4804
4810
|
}, [r]);
|
|
4805
|
-
const [p,
|
|
4811
|
+
const [p, h] = D(null);
|
|
4806
4812
|
f.current = p;
|
|
4807
|
-
const [x,
|
|
4813
|
+
const [x, v] = D(null), L = le(null);
|
|
4808
4814
|
L.current = x;
|
|
4809
|
-
const [S, w] = D({}), [k, O] = D({}), [ee, z] = D({}), Y = le(/* @__PURE__ */ new Set()),
|
|
4815
|
+
const [S, w] = D({}), [k, O] = D({}), [ee, z] = D({}), Y = le(/* @__PURE__ */ new Set()), M = le(null);
|
|
4810
4816
|
Q(() => {
|
|
4811
|
-
var
|
|
4812
|
-
|
|
4817
|
+
var g;
|
|
4818
|
+
const s = document.activeElement;
|
|
4819
|
+
(!s || s === document.body) && ((g = M.current) == null || g.focus({ preventScroll: !0 }));
|
|
4813
4820
|
}, []);
|
|
4814
4821
|
const q = e.map((s) => {
|
|
4815
|
-
var
|
|
4816
|
-
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}`;
|
|
4817
4824
|
}).join("|");
|
|
4818
4825
|
Q(() => {
|
|
4819
4826
|
e.forEach((s) => {
|
|
4820
4827
|
var j, B;
|
|
4821
|
-
const
|
|
4822
|
-
if (!
|
|
4823
|
-
const
|
|
4824
|
-
(!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 })));
|
|
4825
4832
|
});
|
|
4826
4833
|
}, [q]);
|
|
4827
4834
|
const Z = we(
|
|
4828
|
-
async (s,
|
|
4835
|
+
async (s, g) => {
|
|
4829
4836
|
if (Y.current.has(s)) return;
|
|
4830
4837
|
Y.current.add(s);
|
|
4831
|
-
const { url:
|
|
4832
|
-
if (!(!
|
|
4838
|
+
const { url: T, fetchOptions: j } = g.select ?? {};
|
|
4839
|
+
if (!(!T && !j)) {
|
|
4833
4840
|
z((B) => ({ ...B, [s]: !0 }));
|
|
4834
4841
|
try {
|
|
4835
4842
|
let B = [];
|
|
4836
4843
|
if (j)
|
|
4837
4844
|
B = await j();
|
|
4838
|
-
else if (
|
|
4839
|
-
const ne = await fetch(
|
|
4845
|
+
else if (T) {
|
|
4846
|
+
const ne = await fetch(T);
|
|
4840
4847
|
if (!ne.ok) throw new Error("fetch failed");
|
|
4841
4848
|
B = await ne.json();
|
|
4842
4849
|
}
|
|
@@ -4860,101 +4867,102 @@ function ec({
|
|
|
4860
4867
|
const E = le(i);
|
|
4861
4868
|
E.current = i, Q(() => {
|
|
4862
4869
|
if (e.length > 0 && r.length > 0) {
|
|
4863
|
-
const s = e.find((
|
|
4864
|
-
s &&
|
|
4870
|
+
const s = e.find((g) => g.selectable !== !1);
|
|
4871
|
+
s && v({ rowId: n(r[0]), colKey: s.key });
|
|
4865
4872
|
}
|
|
4866
4873
|
}, []), Q(() => {
|
|
4867
4874
|
if (!x) return;
|
|
4868
|
-
const s =
|
|
4875
|
+
const s = M.current;
|
|
4869
4876
|
if (!s) return;
|
|
4870
|
-
const
|
|
4877
|
+
const g = s.querySelector(
|
|
4871
4878
|
`[data-cell-id="${x.rowId}:${x.colKey}"]`
|
|
4872
4879
|
);
|
|
4873
|
-
if (!
|
|
4874
|
-
const
|
|
4875
|
-
|
|
4880
|
+
if (!g) return;
|
|
4881
|
+
const T = s.querySelector('[role="rowgroup"]');
|
|
4882
|
+
g.style.scrollMarginTop = `${(T == null ? void 0 : T.offsetHeight) ?? 0}px`;
|
|
4876
4883
|
const j = s.querySelector('[role="row"]');
|
|
4877
4884
|
let B = 0;
|
|
4878
4885
|
j && j.querySelectorAll('[role="cell"], [role="columnheader"]').forEach((ne) => {
|
|
4879
4886
|
ne.style.position === "sticky" && ne.style.left !== "" && (B = Math.max(B, parseFloat(ne.style.left) + ne.offsetWidth));
|
|
4880
|
-
}),
|
|
4887
|
+
}), g.style.scrollMarginLeft = `${B}px`, g.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
4881
4888
|
}, [x]);
|
|
4882
|
-
const
|
|
4889
|
+
const H = we(
|
|
4883
4890
|
(s) => {
|
|
4884
4891
|
var B;
|
|
4885
|
-
const
|
|
4886
|
-
(B =
|
|
4892
|
+
const g = J.current, T = /* @__PURE__ */ new Set(), j = [];
|
|
4893
|
+
(B = M.current) == null || B.querySelectorAll("[data-cell-id]").forEach((ne) => {
|
|
4887
4894
|
const ce = ne.dataset.cellId.split(":")[0];
|
|
4888
|
-
|
|
4889
|
-
}),
|
|
4895
|
+
T.has(ce) || (T.add(ce), j.push(ce));
|
|
4896
|
+
}), v((ne) => {
|
|
4890
4897
|
if (!ne) return ne;
|
|
4891
|
-
const ce =
|
|
4898
|
+
const ce = g.findIndex((R) => R.key === ne.colKey), pe = j.indexOf(ne.rowId);
|
|
4892
4899
|
let $ = ce, ie = pe;
|
|
4893
4900
|
if (s === "up") ie = Math.max(0, pe - 1);
|
|
4894
4901
|
else if (s === "down") ie = Math.min(j.length - 1, pe + 1);
|
|
4895
4902
|
else if (s === "left") {
|
|
4896
|
-
let
|
|
4897
|
-
for (;
|
|
4898
|
-
|
|
4903
|
+
let R = ce - 1;
|
|
4904
|
+
for (; R >= 0 && g[R].selectable === !1; ) R--;
|
|
4905
|
+
R >= 0 && ($ = R);
|
|
4899
4906
|
} else if (s === "right") {
|
|
4900
|
-
let
|
|
4901
|
-
for (;
|
|
4902
|
-
|
|
4907
|
+
let R = ce + 1;
|
|
4908
|
+
for (; R < g.length && g[R].selectable === !1; ) R++;
|
|
4909
|
+
R < g.length && ($ = R);
|
|
4903
4910
|
}
|
|
4904
|
-
return $ === ce && ie === pe ? ne : { rowId: j[ie], colKey:
|
|
4911
|
+
return $ === ce && ie === pe ? ne : { rowId: j[ie], colKey: g[$].key };
|
|
4905
4912
|
});
|
|
4906
4913
|
},
|
|
4907
4914
|
[]
|
|
4908
|
-
), U = we(() => {
|
|
4909
|
-
const
|
|
4910
|
-
|
|
4911
|
-
var
|
|
4912
|
-
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 });
|
|
4913
4920
|
}, 0);
|
|
4914
4921
|
}, []), _ = we(
|
|
4915
|
-
async (s,
|
|
4922
|
+
async (s, g, T) => {
|
|
4916
4923
|
var se;
|
|
4917
|
-
const j = J.current.find((
|
|
4924
|
+
const j = J.current.find((y) => y.key === g);
|
|
4918
4925
|
if (!(j != null && j.editable)) return;
|
|
4919
|
-
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;
|
|
4920
4927
|
if (ce) {
|
|
4921
|
-
const
|
|
4922
|
-
if (
|
|
4923
|
-
w((
|
|
4928
|
+
const y = vi(T, ce);
|
|
4929
|
+
if (y) {
|
|
4930
|
+
w((I) => ({ ...I, [`${s}:${g}`]: y }));
|
|
4924
4931
|
return;
|
|
4925
4932
|
}
|
|
4926
4933
|
}
|
|
4927
4934
|
if (pe) {
|
|
4928
|
-
const
|
|
4929
|
-
if (
|
|
4930
|
-
w((
|
|
4935
|
+
const y = pe($);
|
|
4936
|
+
if (y) {
|
|
4937
|
+
w((I) => ({ ...I, [`${s}:${g}`]: y }));
|
|
4931
4938
|
return;
|
|
4932
4939
|
}
|
|
4933
4940
|
}
|
|
4934
|
-
const ie = X.current,
|
|
4935
|
-
if (!
|
|
4936
|
-
const
|
|
4937
|
-
|
|
4938
|
-
const
|
|
4939
|
-
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;
|
|
4940
4947
|
});
|
|
4941
|
-
const G = te.current, V = G.findIndex((
|
|
4942
|
-
if (
|
|
4943
|
-
var
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
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]: $ };
|
|
4947
4955
|
m(
|
|
4948
|
-
(
|
|
4956
|
+
(y) => y.map((I) => ie(I) === s ? me : I)
|
|
4949
4957
|
);
|
|
4950
4958
|
try {
|
|
4951
|
-
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: $ }));
|
|
4952
4960
|
} catch {
|
|
4953
4961
|
m(
|
|
4954
|
-
(
|
|
4955
|
-
), w((
|
|
4956
|
-
...
|
|
4957
|
-
[`${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."
|
|
4958
4966
|
}));
|
|
4959
4967
|
}
|
|
4960
4968
|
},
|
|
@@ -4962,8 +4970,8 @@ function ec({
|
|
|
4962
4970
|
), oe = we(
|
|
4963
4971
|
(s) => {
|
|
4964
4972
|
if (f.current) return;
|
|
4965
|
-
const
|
|
4966
|
-
if (!(!
|
|
4973
|
+
const g = L.current;
|
|
4974
|
+
if (!(!g || ![
|
|
4967
4975
|
"ArrowUp",
|
|
4968
4976
|
"ArrowDown",
|
|
4969
4977
|
"ArrowLeft",
|
|
@@ -4974,31 +4982,31 @@ function ec({
|
|
|
4974
4982
|
].includes(s.key)))
|
|
4975
4983
|
switch (s.preventDefault(), s.key) {
|
|
4976
4984
|
case "ArrowUp":
|
|
4977
|
-
|
|
4985
|
+
H("up");
|
|
4978
4986
|
break;
|
|
4979
4987
|
case "ArrowDown":
|
|
4980
|
-
|
|
4988
|
+
H("down");
|
|
4981
4989
|
break;
|
|
4982
4990
|
case "ArrowLeft":
|
|
4983
|
-
|
|
4991
|
+
H("left");
|
|
4984
4992
|
break;
|
|
4985
4993
|
case "ArrowRight":
|
|
4986
|
-
|
|
4994
|
+
H("right");
|
|
4987
4995
|
break;
|
|
4988
4996
|
case "Tab":
|
|
4989
|
-
|
|
4997
|
+
H(s.shiftKey ? "left" : "right");
|
|
4990
4998
|
break;
|
|
4991
4999
|
case "Enter": {
|
|
4992
|
-
const j = J.current.find((B) => B.key ===
|
|
4993
|
-
j != null && j.editable && !E.current ? (
|
|
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");
|
|
4994
5002
|
break;
|
|
4995
5003
|
}
|
|
4996
5004
|
}
|
|
4997
5005
|
},
|
|
4998
|
-
[
|
|
5006
|
+
[H, Z]
|
|
4999
5007
|
), W = at(() => e.map((s) => {
|
|
5000
5008
|
if (!s.editable || i) {
|
|
5001
|
-
const { editable:
|
|
5009
|
+
const { editable: T, selectable: j, ...B } = s;
|
|
5002
5010
|
if (s.selectable === !1)
|
|
5003
5011
|
return { ...B, disableRowClick: !0 };
|
|
5004
5012
|
const ne = B.cell;
|
|
@@ -5016,7 +5024,7 @@ function ec({
|
|
|
5016
5024
|
className: "absolute inset-0 z-10 cursor-default",
|
|
5017
5025
|
onClick: () => {
|
|
5018
5026
|
var ie;
|
|
5019
|
-
|
|
5027
|
+
v({ rowId: pe, colKey: s.key }), (ie = M.current) == null || ie.focus({ preventScroll: !0 });
|
|
5020
5028
|
}
|
|
5021
5029
|
}
|
|
5022
5030
|
),
|
|
@@ -5032,19 +5040,19 @@ function ec({
|
|
|
5032
5040
|
}
|
|
5033
5041
|
};
|
|
5034
5042
|
}
|
|
5035
|
-
const
|
|
5043
|
+
const g = s.editable;
|
|
5036
5044
|
return {
|
|
5037
5045
|
...s,
|
|
5038
5046
|
// Make the cell a positioned ancestor so the absolute edit overlay works
|
|
5039
5047
|
className: `relative ${s.className ?? ""}`.trim(),
|
|
5040
5048
|
disableRowClick: !0,
|
|
5041
|
-
cell: (
|
|
5042
|
-
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 = () => {
|
|
5043
5051
|
var G;
|
|
5044
|
-
|
|
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);
|
|
5045
5053
|
};
|
|
5046
5054
|
if (ne) {
|
|
5047
|
-
const G =
|
|
5055
|
+
const G = g.type === "select" ? /* @__PURE__ */ t(
|
|
5048
5056
|
yi,
|
|
5049
5057
|
{
|
|
5050
5058
|
initialValue: ie,
|
|
@@ -5057,8 +5065,8 @@ function ec({
|
|
|
5057
5065
|
gi,
|
|
5058
5066
|
{
|
|
5059
5067
|
initialValue: ie,
|
|
5060
|
-
type:
|
|
5061
|
-
mask:
|
|
5068
|
+
type: g.type ?? "text",
|
|
5069
|
+
mask: g.mask,
|
|
5062
5070
|
onCommit: (V) => _(j, B, V),
|
|
5063
5071
|
onCancel: U
|
|
5064
5072
|
}
|
|
@@ -5073,14 +5081,14 @@ function ec({
|
|
|
5073
5081
|
}
|
|
5074
5082
|
);
|
|
5075
5083
|
}
|
|
5076
|
-
const
|
|
5084
|
+
const A = s.cell(T);
|
|
5077
5085
|
return /* @__PURE__ */ l(Re, { children: [
|
|
5078
5086
|
/* @__PURE__ */ t(
|
|
5079
5087
|
"span",
|
|
5080
5088
|
{
|
|
5081
5089
|
"data-cell-id": `${j}:${B}`,
|
|
5082
5090
|
className: "peer absolute inset-0 z-10 cursor-pointer",
|
|
5083
|
-
onClick:
|
|
5091
|
+
onClick: R
|
|
5084
5092
|
}
|
|
5085
5093
|
),
|
|
5086
5094
|
ce && /* @__PURE__ */ t(
|
|
@@ -5093,7 +5101,7 @@ function ec({
|
|
|
5093
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: [
|
|
5094
5102
|
/* @__PURE__ */ t(ya, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
5095
5103
|
/* @__PURE__ */ t("span", { className: "truncate text-xs", children: pe })
|
|
5096
|
-
] }) : /* @__PURE__ */ t("span", { className: "truncate", children:
|
|
5104
|
+
] }) : /* @__PURE__ */ t("span", { className: "truncate", children: A }) }),
|
|
5097
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" })
|
|
5098
5106
|
] });
|
|
5099
5107
|
}
|
|
@@ -5114,12 +5122,12 @@ function ec({
|
|
|
5114
5122
|
return /* @__PURE__ */ t(
|
|
5115
5123
|
"div",
|
|
5116
5124
|
{
|
|
5117
|
-
ref:
|
|
5125
|
+
ref: M,
|
|
5118
5126
|
tabIndex: 0,
|
|
5119
5127
|
onKeyDown: oe,
|
|
5120
5128
|
onBlur: (s) => {
|
|
5121
|
-
var
|
|
5122
|
-
(
|
|
5129
|
+
var g;
|
|
5130
|
+
(g = M.current) != null && g.contains(s.relatedTarget) || U(!1);
|
|
5123
5131
|
},
|
|
5124
5132
|
style: { width: "100%", minWidth: 0, outline: "none" },
|
|
5125
5133
|
children: /* @__PURE__ */ t(
|
|
@@ -5226,11 +5234,11 @@ function tc({
|
|
|
5226
5234
|
const p = {
|
|
5227
5235
|
from: Wt(e),
|
|
5228
5236
|
to: Wt(r)
|
|
5229
|
-
},
|
|
5237
|
+
}, h = Wt(a), [x, v] = D(
|
|
5230
5238
|
Wt(i || e)
|
|
5231
5239
|
);
|
|
5232
5240
|
return Q(() => {
|
|
5233
|
-
|
|
5241
|
+
v(Wt(i || e));
|
|
5234
5242
|
}, [i, e]), /* @__PURE__ */ l("div", { children: [
|
|
5235
5243
|
/* @__PURE__ */ t(
|
|
5236
5244
|
"div",
|
|
@@ -5250,14 +5258,14 @@ function tc({
|
|
|
5250
5258
|
mode: "range",
|
|
5251
5259
|
selected: p,
|
|
5252
5260
|
month: x,
|
|
5253
|
-
onMonthChange:
|
|
5261
|
+
onMonthChange: v,
|
|
5254
5262
|
onSelect: (L) => {
|
|
5255
5263
|
const S = L != null && L.from ? ea(L.from) : e, w = L != null && L.to ? ea(L.to) : "";
|
|
5256
5264
|
n({ startDate: S, endDate: w });
|
|
5257
5265
|
},
|
|
5258
5266
|
numberOfMonths: c,
|
|
5259
5267
|
hideNavigation: !0,
|
|
5260
|
-
disabled:
|
|
5268
|
+
disabled: h ? { before: h } : void 0,
|
|
5261
5269
|
showOutsideDays: !1,
|
|
5262
5270
|
components: {
|
|
5263
5271
|
MonthCaption: Ni
|
|
@@ -5417,15 +5425,15 @@ function rc({
|
|
|
5417
5425
|
menuClassName: u = "",
|
|
5418
5426
|
onOpenChange: m
|
|
5419
5427
|
}) {
|
|
5420
|
-
const [f, p] = D(!1), [
|
|
5421
|
-
(
|
|
5422
|
-
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);
|
|
5423
5431
|
},
|
|
5424
5432
|
[m]
|
|
5425
5433
|
), O = we(() => {
|
|
5426
|
-
const
|
|
5427
|
-
if (!
|
|
5428
|
-
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;
|
|
5429
5437
|
L({
|
|
5430
5438
|
position: "fixed",
|
|
5431
5439
|
zIndex: 9999,
|
|
@@ -5438,19 +5446,19 @@ function rc({
|
|
|
5438
5446
|
Q(() => x(!0), []), Q(() => {
|
|
5439
5447
|
if (!f) return;
|
|
5440
5448
|
O();
|
|
5441
|
-
const
|
|
5449
|
+
const M = (Z) => {
|
|
5442
5450
|
var P, X;
|
|
5443
5451
|
const te = Z.target;
|
|
5444
5452
|
!((P = S.current) != null && P.contains(te)) && !((X = w.current) != null && X.contains(te)) && k(!1);
|
|
5445
5453
|
}, q = (Z) => {
|
|
5446
5454
|
Z.key === "Escape" && k(!1);
|
|
5447
5455
|
};
|
|
5448
|
-
return document.addEventListener("mousedown",
|
|
5449
|
-
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);
|
|
5450
5458
|
};
|
|
5451
5459
|
}, [f, k, O]);
|
|
5452
|
-
const ee = (
|
|
5453
|
-
i || (
|
|
5460
|
+
const ee = (M) => {
|
|
5461
|
+
i || (M.key === "Enter" || M.key === " ") && (M.preventDefault(), k(!f));
|
|
5454
5462
|
}, z = cn(e) ? Ro(e, {
|
|
5455
5463
|
onClick: () => {
|
|
5456
5464
|
i || (ta(), k(!f));
|
|
@@ -5462,33 +5470,33 @@ function rc({
|
|
|
5462
5470
|
role: "menu",
|
|
5463
5471
|
"data-bonsaif-overlay": "true",
|
|
5464
5472
|
className: `overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--bg-card)] p-1 shadow-xl ${u}`,
|
|
5465
|
-
style:
|
|
5466
|
-
children: r.map((
|
|
5467
|
-
|
|
5473
|
+
style: v,
|
|
5474
|
+
children: r.map((M) => /* @__PURE__ */ l("div", { children: [
|
|
5475
|
+
M.separatorBefore && /* @__PURE__ */ t("div", { className: "my-1 border-t border-[var(--border)]" }),
|
|
5468
5476
|
/* @__PURE__ */ l(
|
|
5469
5477
|
"button",
|
|
5470
5478
|
{
|
|
5471
5479
|
type: "button",
|
|
5472
5480
|
role: "menuitem",
|
|
5473
|
-
disabled:
|
|
5481
|
+
disabled: M.disabled,
|
|
5474
5482
|
onClick: () => {
|
|
5475
5483
|
var q;
|
|
5476
|
-
|
|
5484
|
+
M.disabled || (ta(), (q = M.onSelect) == null || q.call(M), k(!1));
|
|
5477
5485
|
},
|
|
5478
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",
|
|
5479
5487
|
style: {
|
|
5480
|
-
color:
|
|
5488
|
+
color: M.danger ? "var(--danger)" : "var(--text-main)"
|
|
5481
5489
|
},
|
|
5482
5490
|
children: [
|
|
5483
|
-
|
|
5491
|
+
M.icon && /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: M.icon }),
|
|
5484
5492
|
/* @__PURE__ */ l("span", { className: "min-w-0 flex-1", children: [
|
|
5485
|
-
/* @__PURE__ */ t("span", { className: "block truncate text-sm font-medium", children:
|
|
5486
|
-
|
|
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 })
|
|
5487
5495
|
] })
|
|
5488
5496
|
]
|
|
5489
5497
|
}
|
|
5490
5498
|
)
|
|
5491
|
-
] },
|
|
5499
|
+
] }, M.id))
|
|
5492
5500
|
}
|
|
5493
5501
|
) : null;
|
|
5494
5502
|
return /* @__PURE__ */ l(
|
|
@@ -5503,7 +5511,7 @@ function rc({
|
|
|
5503
5511
|
className: `inline-flex ${i ? "pointer-events-none opacity-60" : ""} ${c}`,
|
|
5504
5512
|
children: [
|
|
5505
5513
|
z,
|
|
5506
|
-
|
|
5514
|
+
h && Y ? Ze(Y, document.body) : null
|
|
5507
5515
|
]
|
|
5508
5516
|
}
|
|
5509
5517
|
);
|
|
@@ -5520,9 +5528,9 @@ function nc({
|
|
|
5520
5528
|
loading: m = !1,
|
|
5521
5529
|
confirmDisabled: f = !1,
|
|
5522
5530
|
headerActions: p,
|
|
5523
|
-
bodyClassName:
|
|
5531
|
+
bodyClassName: h = "flex-1 overflow-y-auto px-6 py-5",
|
|
5524
5532
|
width: x = 440,
|
|
5525
|
-
hasUnsavedChanges:
|
|
5533
|
+
hasUnsavedChanges: v = !1,
|
|
5526
5534
|
unsavedChangesTitle: L = "Descartar cambios",
|
|
5527
5535
|
unsavedChangesDescription: S = "Hay cambios sin guardar. Si cierras el drawer se perderán.",
|
|
5528
5536
|
unsavedChangesConfirmLabel: w = "Descartar",
|
|
@@ -5531,7 +5539,7 @@ function nc({
|
|
|
5531
5539
|
disabled: ee = !1,
|
|
5532
5540
|
children: z
|
|
5533
5541
|
}) {
|
|
5534
|
-
const [Y,
|
|
5542
|
+
const [Y, M] = D(!1), [q, Z] = D(!1), [te, P] = D(!1), X = we(() => {
|
|
5535
5543
|
Z(!0), requestAnimationFrame(() => {
|
|
5536
5544
|
requestAnimationFrame(() => P(!0));
|
|
5537
5545
|
});
|
|
@@ -5541,16 +5549,16 @@ function nc({
|
|
|
5541
5549
|
Ei
|
|
5542
5550
|
);
|
|
5543
5551
|
}, []), E = we(() => {
|
|
5544
|
-
if (
|
|
5552
|
+
if (v) {
|
|
5545
5553
|
X();
|
|
5546
5554
|
return;
|
|
5547
5555
|
}
|
|
5548
5556
|
r();
|
|
5549
|
-
}, [
|
|
5557
|
+
}, [v, r, X]), H = we(() => {
|
|
5550
5558
|
P(!1), Z(!1), O == null || O(), r();
|
|
5551
5559
|
}, [r, O]);
|
|
5552
5560
|
return Q(() => {
|
|
5553
|
-
|
|
5561
|
+
M(!0);
|
|
5554
5562
|
}, []), Q(() => (document.body.style.overflow = e ? "hidden" : "", e || (P(!1), Z(!1)), () => {
|
|
5555
5563
|
document.body.style.overflow = "";
|
|
5556
5564
|
}), [e]), Q(() => {
|
|
@@ -5648,7 +5656,7 @@ function nc({
|
|
|
5648
5656
|
]
|
|
5649
5657
|
}
|
|
5650
5658
|
),
|
|
5651
|
-
/* @__PURE__ */ t("div", { "data-drawer-scroll": "true", className:
|
|
5659
|
+
/* @__PURE__ */ t("div", { "data-drawer-scroll": "true", className: h, children: z })
|
|
5652
5660
|
]
|
|
5653
5661
|
}
|
|
5654
5662
|
),
|
|
@@ -5746,7 +5754,7 @@ function nc({
|
|
|
5746
5754
|
Be,
|
|
5747
5755
|
{
|
|
5748
5756
|
variant: "secondary",
|
|
5749
|
-
onClick:
|
|
5757
|
+
onClick: H,
|
|
5750
5758
|
className: "flex-1 border",
|
|
5751
5759
|
style: {
|
|
5752
5760
|
background: "var(--warning, #d97706)",
|
|
@@ -5973,11 +5981,11 @@ function Wa({
|
|
|
5973
5981
|
floatingLabel: m = !1,
|
|
5974
5982
|
showPasswordToggle: f = !0,
|
|
5975
5983
|
nativeValidation: p = !1,
|
|
5976
|
-
className:
|
|
5984
|
+
className: h = "",
|
|
5977
5985
|
required: x,
|
|
5978
|
-
...
|
|
5986
|
+
...v
|
|
5979
5987
|
}) {
|
|
5980
|
-
const [L, S] = D(() => !!
|
|
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 = {
|
|
5981
5989
|
top: X ? 7 : 12,
|
|
5982
5990
|
color: L ? "var(--primary)" : "var(--text-muted)",
|
|
5983
5991
|
fontSize: X ? 10 : 13,
|
|
@@ -5985,10 +5993,10 @@ function Wa({
|
|
|
5985
5993
|
textTransform: X ? "uppercase" : "none"
|
|
5986
5994
|
}, E = (oe) => {
|
|
5987
5995
|
var W;
|
|
5988
|
-
S(!0), (W =
|
|
5989
|
-
},
|
|
5996
|
+
S(!0), (W = v.onFocus) == null || W.call(v, oe);
|
|
5997
|
+
}, H = (oe) => {
|
|
5990
5998
|
var W;
|
|
5991
|
-
S(!1), (W =
|
|
5999
|
+
S(!1), (W = v.onBlur) == null || W.call(v, oe);
|
|
5992
6000
|
}, U = O ? /* @__PURE__ */ l(
|
|
5993
6001
|
"button",
|
|
5994
6002
|
{
|
|
@@ -6017,7 +6025,7 @@ function Wa({
|
|
|
6017
6025
|
)
|
|
6018
6026
|
]
|
|
6019
6027
|
}
|
|
6020
|
-
) : null, _ =
|
|
6028
|
+
) : null, _ = M ? /* @__PURE__ */ t(
|
|
6021
6029
|
Ut,
|
|
6022
6030
|
{
|
|
6023
6031
|
as: "span",
|
|
@@ -6040,15 +6048,15 @@ function Wa({
|
|
|
6040
6048
|
/* @__PURE__ */ t(
|
|
6041
6049
|
Jr,
|
|
6042
6050
|
{
|
|
6043
|
-
...
|
|
6051
|
+
...v,
|
|
6044
6052
|
type: ee,
|
|
6045
6053
|
required: q,
|
|
6046
6054
|
placeholder: " ",
|
|
6047
|
-
"aria-invalid": z ||
|
|
6055
|
+
"aria-invalid": z || v["aria-invalid"],
|
|
6048
6056
|
"data-has-value": P ? "true" : void 0,
|
|
6049
|
-
className: `h-11 w-full pt-5 ${te} ${Z} ${
|
|
6057
|
+
className: `h-11 w-full pt-5 ${te} ${Z} ${h}`,
|
|
6050
6058
|
onFocus: E,
|
|
6051
|
-
onBlur:
|
|
6059
|
+
onBlur: H
|
|
6052
6060
|
}
|
|
6053
6061
|
),
|
|
6054
6062
|
/* @__PURE__ */ l(
|
|
@@ -6084,13 +6092,13 @@ function Wa({
|
|
|
6084
6092
|
/* @__PURE__ */ t(
|
|
6085
6093
|
Jr,
|
|
6086
6094
|
{
|
|
6087
|
-
...
|
|
6095
|
+
...v,
|
|
6088
6096
|
type: ee,
|
|
6089
6097
|
required: q,
|
|
6090
|
-
"aria-invalid": z ||
|
|
6091
|
-
className: `w-full ${te} ${Z} ${
|
|
6098
|
+
"aria-invalid": z || v["aria-invalid"],
|
|
6099
|
+
className: `w-full ${te} ${Z} ${h}`,
|
|
6092
6100
|
onFocus: E,
|
|
6093
|
-
onBlur:
|
|
6101
|
+
onBlur: H
|
|
6094
6102
|
}
|
|
6095
6103
|
),
|
|
6096
6104
|
_,
|
|
@@ -6099,10 +6107,10 @@ function Wa({
|
|
|
6099
6107
|
/* @__PURE__ */ t(
|
|
6100
6108
|
Jr,
|
|
6101
6109
|
{
|
|
6102
|
-
...
|
|
6110
|
+
...v,
|
|
6103
6111
|
required: q,
|
|
6104
|
-
"aria-invalid": z ||
|
|
6105
|
-
className: `w-full ${te} ${Z} ${
|
|
6112
|
+
"aria-invalid": z || v["aria-invalid"],
|
|
6113
|
+
className: `w-full ${te} ${Z} ${h}`
|
|
6106
6114
|
}
|
|
6107
6115
|
),
|
|
6108
6116
|
_
|
|
@@ -6125,9 +6133,9 @@ function bc({
|
|
|
6125
6133
|
onChange: f,
|
|
6126
6134
|
...p
|
|
6127
6135
|
}) {
|
|
6128
|
-
const [
|
|
6136
|
+
const [h, x] = D(
|
|
6129
6137
|
() => oa(m)
|
|
6130
|
-
),
|
|
6138
|
+
), v = u !== void 0 ? oa(u) : h, L = n && v.length > 0 && !ja(v) ? a : void 0;
|
|
6131
6139
|
return /* @__PURE__ */ t(
|
|
6132
6140
|
Wa,
|
|
6133
6141
|
{
|
|
@@ -6210,9 +6218,9 @@ function pc({
|
|
|
6210
6218
|
onRejectedFiles: m,
|
|
6211
6219
|
multiple: f = !1,
|
|
6212
6220
|
maxFiles: p,
|
|
6213
|
-
appendFiles:
|
|
6221
|
+
appendFiles: h = !1,
|
|
6214
6222
|
showFileList: x = !0,
|
|
6215
|
-
clearable:
|
|
6223
|
+
clearable: v = !0,
|
|
6216
6224
|
browseLabel: L = "Buscar archivos",
|
|
6217
6225
|
dropLabel: S = "Suelta los archivos aqui",
|
|
6218
6226
|
emptyLabel: w = "Arrastra y suelta archivos",
|
|
@@ -6221,7 +6229,7 @@ function pc({
|
|
|
6221
6229
|
size: ee = "md",
|
|
6222
6230
|
containerClassName: z = "",
|
|
6223
6231
|
dropzoneClassName: Y = "",
|
|
6224
|
-
fileListClassName:
|
|
6232
|
+
fileListClassName: M = "",
|
|
6225
6233
|
className: q = "",
|
|
6226
6234
|
id: Z,
|
|
6227
6235
|
accept: te,
|
|
@@ -6229,15 +6237,15 @@ function pc({
|
|
|
6229
6237
|
required: X,
|
|
6230
6238
|
...J
|
|
6231
6239
|
}) {
|
|
6232
|
-
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) => {
|
|
6233
6241
|
i === void 0 && s(re), u == null || u(re, me);
|
|
6234
6242
|
}, ne = (re, me) => {
|
|
6235
6243
|
const se = re.filter(
|
|
6236
6244
|
(be) => la(be, te)
|
|
6237
|
-
),
|
|
6245
|
+
), y = re.filter(
|
|
6238
6246
|
(be) => !la(be, te)
|
|
6239
|
-
),
|
|
6240
|
-
|
|
6247
|
+
), I = h ? [...g, ...se] : se, ue = Wi(I, f, p);
|
|
6248
|
+
y.length > 0 && (m == null || m(y)), B(ue, me);
|
|
6241
6249
|
}, ce = () => {
|
|
6242
6250
|
var re;
|
|
6243
6251
|
P || (re = U.current) == null || re.click();
|
|
@@ -6247,12 +6255,12 @@ function pc({
|
|
|
6247
6255
|
re.preventDefault(), P || oe(!0);
|
|
6248
6256
|
}, ie = (re) => {
|
|
6249
6257
|
re.currentTarget.contains(re.relatedTarget) || oe(!1);
|
|
6250
|
-
},
|
|
6258
|
+
}, R = (re) => {
|
|
6251
6259
|
re.preventDefault(), oe(!1), !P && ne(Array.from(re.dataTransfer.files), re);
|
|
6252
|
-
},
|
|
6260
|
+
}, A = (re) => {
|
|
6253
6261
|
re.key !== "Enter" && re.key !== " " || (re.preventDefault(), ce());
|
|
6254
6262
|
}, G = (re) => {
|
|
6255
|
-
B(
|
|
6263
|
+
B(g.filter((me, se) => se !== re));
|
|
6256
6264
|
}, V = () => {
|
|
6257
6265
|
B([]);
|
|
6258
6266
|
};
|
|
@@ -6267,13 +6275,13 @@ function pc({
|
|
|
6267
6275
|
{
|
|
6268
6276
|
...J,
|
|
6269
6277
|
ref: U,
|
|
6270
|
-
id:
|
|
6278
|
+
id: H,
|
|
6271
6279
|
type: "file",
|
|
6272
6280
|
accept: te,
|
|
6273
6281
|
multiple: f,
|
|
6274
6282
|
disabled: P,
|
|
6275
|
-
required: X &&
|
|
6276
|
-
"aria-invalid":
|
|
6283
|
+
required: X && g.length === 0,
|
|
6284
|
+
"aria-invalid": T || J["aria-invalid"],
|
|
6277
6285
|
className: "sr-only",
|
|
6278
6286
|
onChange: pe
|
|
6279
6287
|
}
|
|
@@ -6283,15 +6291,15 @@ function pc({
|
|
|
6283
6291
|
{
|
|
6284
6292
|
role: "button",
|
|
6285
6293
|
tabIndex: P ? -1 : 0,
|
|
6286
|
-
"aria-controls":
|
|
6294
|
+
"aria-controls": H,
|
|
6287
6295
|
"aria-disabled": P || void 0,
|
|
6288
|
-
"aria-invalid":
|
|
6289
|
-
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}`,
|
|
6290
6298
|
onClick: ce,
|
|
6291
6299
|
onDragOver: $,
|
|
6292
6300
|
onDragLeave: ie,
|
|
6293
|
-
onDrop:
|
|
6294
|
-
onKeyDown:
|
|
6301
|
+
onDrop: R,
|
|
6302
|
+
onKeyDown: A,
|
|
6295
6303
|
children: [
|
|
6296
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" }) }),
|
|
6297
6305
|
/* @__PURE__ */ l("span", { className: "space-y-1", children: [
|
|
@@ -6302,10 +6310,10 @@ function pc({
|
|
|
6302
6310
|
]
|
|
6303
6311
|
}
|
|
6304
6312
|
),
|
|
6305
|
-
x &&
|
|
6313
|
+
x && g.length > 0 && /* @__PURE__ */ l(
|
|
6306
6314
|
"div",
|
|
6307
6315
|
{
|
|
6308
|
-
className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${
|
|
6316
|
+
className: `rounded-lg border border-[var(--border)] bg-[var(--bg-card)] ${M}`,
|
|
6309
6317
|
children: [
|
|
6310
6318
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3 border-b border-[var(--border)] px-3 py-2", children: [
|
|
6311
6319
|
/* @__PURE__ */ t("span", { className: "text-xs font-semibold uppercase text-[var(--text-muted)]", children: O }),
|
|
@@ -6320,7 +6328,7 @@ function pc({
|
|
|
6320
6328
|
}
|
|
6321
6329
|
)
|
|
6322
6330
|
] }),
|
|
6323
|
-
/* @__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(
|
|
6324
6332
|
"li",
|
|
6325
6333
|
{
|
|
6326
6334
|
className: "flex items-center gap-3 px-3 py-2",
|
|
@@ -6374,41 +6382,41 @@ function hc({
|
|
|
6374
6382
|
onSave: f,
|
|
6375
6383
|
onChange: p
|
|
6376
6384
|
}) {
|
|
6377
|
-
const [
|
|
6385
|
+
const [h, x] = D(
|
|
6378
6386
|
() => e.map((z) => ({ key: !1, type: "", ...z }))
|
|
6379
|
-
), [
|
|
6387
|
+
), [v, L] = D(""), [S, w] = D(""), k = we(
|
|
6380
6388
|
(z, Y) => {
|
|
6381
|
-
x((
|
|
6382
|
-
const q =
|
|
6389
|
+
x((M) => {
|
|
6390
|
+
const q = M.map((Z, te) => te === z ? { ...Z, ...Y } : Z);
|
|
6383
6391
|
return p == null || p(q), q;
|
|
6384
6392
|
});
|
|
6385
6393
|
},
|
|
6386
6394
|
[p]
|
|
6387
6395
|
), O = we(() => {
|
|
6388
|
-
f == null || f(
|
|
6389
|
-
}, [
|
|
6396
|
+
f == null || f(h);
|
|
6397
|
+
}, [h, f]), ee = we(() => {
|
|
6390
6398
|
var q;
|
|
6391
|
-
const z =
|
|
6399
|
+
const z = v.trim();
|
|
6392
6400
|
if (!z) {
|
|
6393
6401
|
w("Ingresa un nombre de campo.");
|
|
6394
6402
|
return;
|
|
6395
6403
|
}
|
|
6396
|
-
if (
|
|
6404
|
+
if (h.some(
|
|
6397
6405
|
(Z) => Z.name.toLowerCase() === z.toLowerCase()
|
|
6398
6406
|
)) {
|
|
6399
6407
|
w("Ese campo ya existe en el arreglo.");
|
|
6400
6408
|
return;
|
|
6401
6409
|
}
|
|
6402
|
-
const
|
|
6410
|
+
const M = {
|
|
6403
6411
|
name: z,
|
|
6404
6412
|
key: !1,
|
|
6405
6413
|
type: ((q = n[0]) == null ? void 0 : q.value) ?? ""
|
|
6406
6414
|
};
|
|
6407
6415
|
x((Z) => {
|
|
6408
|
-
const te = [...Z,
|
|
6416
|
+
const te = [...Z, M];
|
|
6409
6417
|
return p == null || p(te), te;
|
|
6410
6418
|
}), L(""), w("");
|
|
6411
|
-
}, [n,
|
|
6419
|
+
}, [n, h, v, p]);
|
|
6412
6420
|
return /* @__PURE__ */ l(
|
|
6413
6421
|
"div",
|
|
6414
6422
|
{
|
|
@@ -6447,7 +6455,7 @@ function hc({
|
|
|
6447
6455
|
}
|
|
6448
6456
|
),
|
|
6449
6457
|
/* @__PURE__ */ l("div", { className: "max-h-[420px] overflow-y-auto", children: [
|
|
6450
|
-
|
|
6458
|
+
h.map((z, Y) => /* @__PURE__ */ l(
|
|
6451
6459
|
"div",
|
|
6452
6460
|
{
|
|
6453
6461
|
className: "grid grid-cols-[1fr_80px_1fr] items-center gap-4 border-b px-6 py-3 last:border-0 hover:bg-[var(--bg-input)] transition-colors",
|
|
@@ -6466,7 +6474,7 @@ function hc({
|
|
|
6466
6474
|
{
|
|
6467
6475
|
size: "sm",
|
|
6468
6476
|
checked: z.key ?? !1,
|
|
6469
|
-
onChange: (
|
|
6477
|
+
onChange: (M) => k(Y, { key: M.target.checked }),
|
|
6470
6478
|
"aria-label": `${z.name} es clave`
|
|
6471
6479
|
}
|
|
6472
6480
|
) }),
|
|
@@ -6474,7 +6482,7 @@ function hc({
|
|
|
6474
6482
|
At,
|
|
6475
6483
|
{
|
|
6476
6484
|
value: z.type ?? "",
|
|
6477
|
-
onChange: (
|
|
6485
|
+
onChange: (M) => k(Y, { type: M }),
|
|
6478
6486
|
options: n,
|
|
6479
6487
|
placeholder: "—",
|
|
6480
6488
|
emptyLabel: "—",
|
|
@@ -6487,7 +6495,7 @@ function hc({
|
|
|
6487
6495
|
},
|
|
6488
6496
|
z.name
|
|
6489
6497
|
)),
|
|
6490
|
-
|
|
6498
|
+
h.length === 0 && /* @__PURE__ */ t(
|
|
6491
6499
|
"p",
|
|
6492
6500
|
{
|
|
6493
6501
|
className: "px-6 py-8 text-center text-sm",
|
|
@@ -6508,7 +6516,7 @@ function hc({
|
|
|
6508
6516
|
"input",
|
|
6509
6517
|
{
|
|
6510
6518
|
type: "text",
|
|
6511
|
-
value:
|
|
6519
|
+
value: v,
|
|
6512
6520
|
onChange: (z) => {
|
|
6513
6521
|
L(z.currentTarget.value), S && w("");
|
|
6514
6522
|
},
|
|
@@ -6593,27 +6601,27 @@ function vc({
|
|
|
6593
6601
|
height: m = 40,
|
|
6594
6602
|
padding: f = "6px 10px",
|
|
6595
6603
|
searchable: p = !0,
|
|
6596
|
-
minOptionsForSearch:
|
|
6604
|
+
minOptionsForSearch: h = 6,
|
|
6597
6605
|
maxVisibleValues: x = 2,
|
|
6598
|
-
truncateSelectedValues:
|
|
6606
|
+
truncateSelectedValues: v = !0,
|
|
6599
6607
|
emptyText: L = "Sin resultados",
|
|
6600
6608
|
clearLabel: S = "Limpiar seleccion"
|
|
6601
6609
|
}) {
|
|
6602
|
-
const [w, k] = D(!1), [O, ee] = D(""), [z, Y] = D(0), [
|
|
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(
|
|
6603
6611
|
() => n.filter(($) => U.has($.value)),
|
|
6604
6612
|
[n, U]
|
|
6605
6613
|
), oe = x === "all" ? _.length : x, W = _.slice(0, oe), s = Math.max(
|
|
6606
6614
|
0,
|
|
6607
6615
|
_.length - W.length
|
|
6608
|
-
),
|
|
6616
|
+
), g = H && O.trim() ? n.filter(
|
|
6609
6617
|
($) => {
|
|
6610
6618
|
var ie;
|
|
6611
6619
|
return $.label.toLowerCase().includes(O.toLowerCase()) || ((ie = $.sublabel) == null ? void 0 : ie.toLowerCase().includes(O.toLowerCase()));
|
|
6612
6620
|
}
|
|
6613
|
-
) : n,
|
|
6621
|
+
) : n, T = we(() => {
|
|
6614
6622
|
const $ = P.current;
|
|
6615
6623
|
if (!$) return;
|
|
6616
|
-
const ie = $.getBoundingClientRect(),
|
|
6624
|
+
const ie = $.getBoundingClientRect(), R = H ? 304 : 244, A = window.innerHeight - ie.bottom, G = A < R && ie.top > A;
|
|
6617
6625
|
te({
|
|
6618
6626
|
position: "fixed",
|
|
6619
6627
|
left: ie.left,
|
|
@@ -6622,39 +6630,39 @@ function vc({
|
|
|
6622
6630
|
width: ie.width,
|
|
6623
6631
|
zIndex: 9999
|
|
6624
6632
|
});
|
|
6625
|
-
}, [
|
|
6633
|
+
}, [H]), j = we(
|
|
6626
6634
|
($) => {
|
|
6627
6635
|
Ki(e, $) || r($);
|
|
6628
6636
|
},
|
|
6629
6637
|
[r, e]
|
|
6630
6638
|
), B = we(
|
|
6631
6639
|
($) => {
|
|
6632
|
-
const ie = n.find((
|
|
6640
|
+
const ie = n.find((A) => A.value === $);
|
|
6633
6641
|
if (ie != null && ie.disabled) return;
|
|
6634
|
-
const
|
|
6635
|
-
j(
|
|
6642
|
+
const R = U.has($) ? e.filter((A) => A !== $) : [...e, $];
|
|
6643
|
+
j(R);
|
|
6636
6644
|
},
|
|
6637
6645
|
[j, n, e, U]
|
|
6638
6646
|
), ne = we(() => j([]), [j]);
|
|
6639
6647
|
Q(() => q(!0), []), Q(() => {
|
|
6640
6648
|
if (!w) return;
|
|
6641
6649
|
function $(ie) {
|
|
6642
|
-
var
|
|
6643
|
-
const
|
|
6644
|
-
!((
|
|
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(""));
|
|
6645
6653
|
}
|
|
6646
6654
|
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
6647
6655
|
}, [w]), Q(() => {
|
|
6648
|
-
w && (Y(0),
|
|
6656
|
+
w && (Y(0), T(), H && setTimeout(() => {
|
|
6649
6657
|
var $;
|
|
6650
6658
|
return ($ = J.current) == null ? void 0 : $.focus();
|
|
6651
6659
|
}, 0));
|
|
6652
|
-
}, [w,
|
|
6660
|
+
}, [w, H, T]), Q(() => {
|
|
6653
6661
|
if (w)
|
|
6654
|
-
return window.addEventListener("resize",
|
|
6655
|
-
window.removeEventListener("resize",
|
|
6662
|
+
return window.addEventListener("resize", T), window.addEventListener("scroll", T, !0), () => {
|
|
6663
|
+
window.removeEventListener("resize", T), window.removeEventListener("scroll", T, !0);
|
|
6656
6664
|
};
|
|
6657
|
-
}, [w,
|
|
6665
|
+
}, [w, T]), Q(() => {
|
|
6658
6666
|
if (z < 0 || !E.current) return;
|
|
6659
6667
|
const $ = E.current.children[z];
|
|
6660
6668
|
$ == null || $.scrollIntoView({ block: "nearest" });
|
|
@@ -6664,7 +6672,7 @@ function vc({
|
|
|
6664
6672
|
($.key === "Enter" || $.key === " " || $.key === "ArrowDown") && ($.preventDefault(), k(!0));
|
|
6665
6673
|
return;
|
|
6666
6674
|
}
|
|
6667
|
-
$.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)));
|
|
6668
6676
|
}
|
|
6669
6677
|
const pe = /* @__PURE__ */ l(
|
|
6670
6678
|
"div",
|
|
@@ -6677,7 +6685,7 @@ function vc({
|
|
|
6677
6685
|
border: "1px solid var(--border)"
|
|
6678
6686
|
},
|
|
6679
6687
|
children: [
|
|
6680
|
-
|
|
6688
|
+
H && /* @__PURE__ */ l(
|
|
6681
6689
|
"div",
|
|
6682
6690
|
{
|
|
6683
6691
|
className: "flex items-center gap-2 px-3 py-2",
|
|
@@ -6757,26 +6765,26 @@ function vc({
|
|
|
6757
6765
|
"aria-multiselectable": "true",
|
|
6758
6766
|
className: "overflow-y-auto",
|
|
6759
6767
|
style: {
|
|
6760
|
-
maxHeight:
|
|
6768
|
+
maxHeight: H ? 220 : 200,
|
|
6761
6769
|
scrollbarWidth: "thin",
|
|
6762
6770
|
scrollbarColor: "var(--border) transparent",
|
|
6763
6771
|
overscrollBehavior: "contain"
|
|
6764
6772
|
},
|
|
6765
6773
|
children: [
|
|
6766
|
-
|
|
6767
|
-
const
|
|
6774
|
+
g.map(($, ie) => {
|
|
6775
|
+
const R = ie === z, A = U.has($.value);
|
|
6768
6776
|
return /* @__PURE__ */ l(
|
|
6769
6777
|
"li",
|
|
6770
6778
|
{
|
|
6771
6779
|
role: "option",
|
|
6772
|
-
"aria-selected":
|
|
6780
|
+
"aria-selected": A,
|
|
6773
6781
|
onMouseDown: (G) => {
|
|
6774
6782
|
G.preventDefault(), B($.value);
|
|
6775
6783
|
},
|
|
6776
6784
|
onMouseEnter: () => !$.disabled && Y(ie),
|
|
6777
6785
|
className: "flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors",
|
|
6778
6786
|
style: {
|
|
6779
|
-
background:
|
|
6787
|
+
background: R ? "var(--bg-hover)" : A ? "color-mix(in srgb, var(--primary) 6%, transparent)" : "transparent",
|
|
6780
6788
|
color: $.disabled ? "var(--text-muted)" : "var(--text-main)",
|
|
6781
6789
|
cursor: $.disabled ? "not-allowed" : "pointer",
|
|
6782
6790
|
opacity: $.disabled ? 0.58 : 1
|
|
@@ -6787,11 +6795,11 @@ function vc({
|
|
|
6787
6795
|
{
|
|
6788
6796
|
className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border",
|
|
6789
6797
|
style: {
|
|
6790
|
-
borderColor:
|
|
6791
|
-
background:
|
|
6798
|
+
borderColor: A ? "var(--primary)" : "var(--border)",
|
|
6799
|
+
background: A ? "var(--primary)" : "var(--bg-input)",
|
|
6792
6800
|
color: "var(--primary-fg)"
|
|
6793
6801
|
},
|
|
6794
|
-
children:
|
|
6802
|
+
children: A && /* @__PURE__ */ t(Ue, { className: "h-3 w-3" })
|
|
6795
6803
|
}
|
|
6796
6804
|
),
|
|
6797
6805
|
$.color && /* @__PURE__ */ t(
|
|
@@ -6825,7 +6833,7 @@ function vc({
|
|
|
6825
6833
|
$.value
|
|
6826
6834
|
);
|
|
6827
6835
|
}),
|
|
6828
|
-
|
|
6836
|
+
g.length === 0 && /* @__PURE__ */ t(
|
|
6829
6837
|
"li",
|
|
6830
6838
|
{
|
|
6831
6839
|
className: "px-3 py-4 text-center text-sm",
|
|
@@ -6870,7 +6878,7 @@ function vc({
|
|
|
6870
6878
|
W.map(($) => /* @__PURE__ */ l(
|
|
6871
6879
|
"span",
|
|
6872
6880
|
{
|
|
6873
|
-
className: `inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-semibold ${
|
|
6881
|
+
className: `inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs font-semibold ${v ? "max-w-[160px]" : "max-w-full whitespace-normal"}`,
|
|
6874
6882
|
style: {
|
|
6875
6883
|
background: "var(--bg-card)",
|
|
6876
6884
|
borderColor: "var(--border)",
|
|
@@ -6887,7 +6895,7 @@ function vc({
|
|
|
6887
6895
|
/* @__PURE__ */ t(
|
|
6888
6896
|
"span",
|
|
6889
6897
|
{
|
|
6890
|
-
className:
|
|
6898
|
+
className: v ? "truncate" : "break-words",
|
|
6891
6899
|
children: $.label
|
|
6892
6900
|
}
|
|
6893
6901
|
)
|
|
@@ -6936,7 +6944,7 @@ function vc({
|
|
|
6936
6944
|
]
|
|
6937
6945
|
}
|
|
6938
6946
|
),
|
|
6939
|
-
w &&
|
|
6947
|
+
w && M && Ze(pe, document.body)
|
|
6940
6948
|
]
|
|
6941
6949
|
}
|
|
6942
6950
|
);
|
|
@@ -6980,13 +6988,13 @@ function gc({
|
|
|
6980
6988
|
}
|
|
6981
6989
|
),
|
|
6982
6990
|
f.map(
|
|
6983
|
-
(p,
|
|
6991
|
+
(p, h) => p === "..." ? /* @__PURE__ */ t(
|
|
6984
6992
|
"span",
|
|
6985
6993
|
{
|
|
6986
6994
|
className: "flex h-8 min-w-8 items-center justify-center text-xs font-semibold text-[var(--text-muted)]",
|
|
6987
6995
|
children: "..."
|
|
6988
6996
|
},
|
|
6989
|
-
`ellipsis-${
|
|
6997
|
+
`ellipsis-${h}`
|
|
6990
6998
|
) : /* @__PURE__ */ t(
|
|
6991
6999
|
"button",
|
|
6992
7000
|
{
|
|
@@ -7247,9 +7255,9 @@ function yc({
|
|
|
7247
7255
|
defaultValue: m,
|
|
7248
7256
|
onChange: f,
|
|
7249
7257
|
countryCode: p,
|
|
7250
|
-
defaultCountryCode:
|
|
7258
|
+
defaultCountryCode: h = "+1",
|
|
7251
7259
|
onCountryCodeChange: x,
|
|
7252
|
-
allowedCountryCodes:
|
|
7260
|
+
allowedCountryCodes: v,
|
|
7253
7261
|
countryCodeOptions: L,
|
|
7254
7262
|
countryCodePlaceholder: S = "Codigo",
|
|
7255
7263
|
countryCodeClassName: w = "",
|
|
@@ -7258,7 +7266,7 @@ function yc({
|
|
|
7258
7266
|
label: ee,
|
|
7259
7267
|
containerClassName: z = "",
|
|
7260
7268
|
helperText: Y,
|
|
7261
|
-
labelAction:
|
|
7269
|
+
labelAction: M,
|
|
7262
7270
|
className: q = "",
|
|
7263
7271
|
required: Z,
|
|
7264
7272
|
disabled: te,
|
|
@@ -7266,24 +7274,24 @@ function yc({
|
|
|
7266
7274
|
showPasswordToggle: X,
|
|
7267
7275
|
nativeValidation: J,
|
|
7268
7276
|
errorTooltipLabel: E = "Error de validacion",
|
|
7269
|
-
...
|
|
7277
|
+
...H
|
|
7270
7278
|
}) {
|
|
7271
7279
|
var re;
|
|
7272
7280
|
const [U, _] = D(
|
|
7273
7281
|
() => sa(m)
|
|
7274
7282
|
), [oe, W] = D(
|
|
7275
|
-
() => Nr(
|
|
7283
|
+
() => Nr(h)
|
|
7276
7284
|
), s = at(() => {
|
|
7277
|
-
const me = L ?? Yi, se =
|
|
7278
|
-
return se != null && se.length ? me.filter((
|
|
7279
|
-
}, [
|
|
7285
|
+
const me = L ?? Yi, se = v == null ? void 0 : v.map(Nr);
|
|
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(
|
|
7280
7288
|
(me) => me.value === Nr(p ?? oe)
|
|
7281
|
-
) ? 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) => {
|
|
7282
7290
|
const se = me.currentTarget.value;
|
|
7283
7291
|
u === void 0 && _(se), O == null || O(se, {
|
|
7284
|
-
countryCode:
|
|
7292
|
+
countryCode: T,
|
|
7285
7293
|
nationalNumber: se,
|
|
7286
|
-
fullNumber: `${
|
|
7294
|
+
fullNumber: `${T} ${se}`.trim()
|
|
7287
7295
|
}), f == null || f(me);
|
|
7288
7296
|
}, G = (me) => {
|
|
7289
7297
|
p === void 0 && W(me), x == null || x(me), O == null || O(j, {
|
|
@@ -7313,17 +7321,17 @@ function yc({
|
|
|
7313
7321
|
/* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1 text-xs font-semibold uppercase text-[var(--text-muted)]", children: [
|
|
7314
7322
|
/* @__PURE__ */ t("span", { children: ee }),
|
|
7315
7323
|
Z && /* @__PURE__ */ t("span", { className: "text-[var(--danger)]", children: "*" }),
|
|
7316
|
-
|
|
7324
|
+
M && /* @__PURE__ */ t("span", { className: "ml-auto normal-case", children: M })
|
|
7317
7325
|
] }),
|
|
7318
7326
|
/* @__PURE__ */ l(
|
|
7319
7327
|
"span",
|
|
7320
7328
|
{
|
|
7321
|
-
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}`,
|
|
7322
7330
|
children: [
|
|
7323
7331
|
/* @__PURE__ */ t(
|
|
7324
7332
|
At,
|
|
7325
7333
|
{
|
|
7326
|
-
value:
|
|
7334
|
+
value: T,
|
|
7327
7335
|
onChange: G,
|
|
7328
7336
|
options: s,
|
|
7329
7337
|
placeholder: S,
|
|
@@ -7345,7 +7353,7 @@ function yc({
|
|
|
7345
7353
|
/* @__PURE__ */ t(
|
|
7346
7354
|
"input",
|
|
7347
7355
|
{
|
|
7348
|
-
...
|
|
7356
|
+
...H,
|
|
7349
7357
|
value: u,
|
|
7350
7358
|
defaultValue: m,
|
|
7351
7359
|
type: "tel",
|
|
@@ -7353,10 +7361,10 @@ function yc({
|
|
|
7353
7361
|
autoComplete: e,
|
|
7354
7362
|
disabled: te,
|
|
7355
7363
|
required: void 0,
|
|
7356
|
-
"aria-label":
|
|
7357
|
-
"aria-invalid": pe ||
|
|
7364
|
+
"aria-label": H["aria-label"] ?? (typeof ee == "string" ? ee : void 0),
|
|
7365
|
+
"aria-invalid": pe || H["aria-invalid"],
|
|
7358
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}`,
|
|
7359
|
-
onChange:
|
|
7367
|
+
onChange: A
|
|
7360
7368
|
}
|
|
7361
7369
|
),
|
|
7362
7370
|
V
|
|
@@ -7385,14 +7393,14 @@ function wc({
|
|
|
7385
7393
|
{
|
|
7386
7394
|
className: c === "horizontal" ? "flex flex-wrap gap-2" : "flex flex-col gap-2",
|
|
7387
7395
|
children: n.map((p) => {
|
|
7388
|
-
const
|
|
7396
|
+
const h = p.value === e, x = u || p.disabled;
|
|
7389
7397
|
return /* @__PURE__ */ l(
|
|
7390
7398
|
"label",
|
|
7391
7399
|
{
|
|
7392
7400
|
className: `inline-flex min-w-0 items-start gap-2 rounded-lg border px-2.5 py-1.5 transition-colors ${x ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-[var(--bg-input)]"} ${f}`,
|
|
7393
7401
|
style: {
|
|
7394
|
-
borderColor:
|
|
7395
|
-
background:
|
|
7402
|
+
borderColor: h ? "color-mix(in srgb, var(--primary) 48%, var(--border))" : "var(--border)",
|
|
7403
|
+
background: h ? "color-mix(in srgb, var(--primary) 8%, transparent)" : "var(--bg-card)"
|
|
7396
7404
|
},
|
|
7397
7405
|
children: [
|
|
7398
7406
|
/* @__PURE__ */ l("span", { className: "relative mt-0.5 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-[var(--border)] bg-[var(--bg-input)]", children: [
|
|
@@ -7402,7 +7410,7 @@ function wc({
|
|
|
7402
7410
|
type: "radio",
|
|
7403
7411
|
name: a,
|
|
7404
7412
|
value: p.value,
|
|
7405
|
-
checked:
|
|
7413
|
+
checked: h,
|
|
7406
7414
|
disabled: x,
|
|
7407
7415
|
onChange: () => r(p.value),
|
|
7408
7416
|
className: "absolute inset-0 opacity-0"
|
|
@@ -7411,7 +7419,7 @@ function wc({
|
|
|
7411
7419
|
/* @__PURE__ */ t(
|
|
7412
7420
|
"span",
|
|
7413
7421
|
{
|
|
7414
|
-
className: `h-2 w-2 rounded-full transition ${
|
|
7422
|
+
className: `h-2 w-2 rounded-full transition ${h ? "scale-100 opacity-100" : "scale-50 opacity-0"}`,
|
|
7415
7423
|
style: { background: "var(--primary)" }
|
|
7416
7424
|
}
|
|
7417
7425
|
)
|
|
@@ -7469,7 +7477,7 @@ function Nc({
|
|
|
7469
7477
|
placeholder: n = "Escribe algo...",
|
|
7470
7478
|
minHeight: a = "80px"
|
|
7471
7479
|
}) {
|
|
7472
|
-
const i = le(null), c = le(null), u = le(null), m = le(!1), f = le(e ?? ""), p = le(r), [
|
|
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(
|
|
7473
7481
|
() => m.current ? c.current : i.current,
|
|
7474
7482
|
[]
|
|
7475
7483
|
);
|
|
@@ -7477,27 +7485,27 @@ function Nc({
|
|
|
7477
7485
|
p.current = r;
|
|
7478
7486
|
}, [r]);
|
|
7479
7487
|
const J = we(() => {
|
|
7480
|
-
const
|
|
7481
|
-
if (!
|
|
7488
|
+
const y = window.getSelection(), I = X();
|
|
7489
|
+
if (!y || !I || y.rangeCount === 0 || y.isCollapsed)
|
|
7482
7490
|
return "";
|
|
7483
|
-
const ue =
|
|
7484
|
-
return !
|
|
7491
|
+
const ue = y.getRangeAt(0);
|
|
7492
|
+
return !I.contains(ue.startContainer) || !I.contains(ue.endContainer) ? "" : y.toString();
|
|
7485
7493
|
}, [X]);
|
|
7486
7494
|
Q(() => {
|
|
7487
|
-
const
|
|
7488
|
-
f.current =
|
|
7489
|
-
const
|
|
7495
|
+
const y = e ?? "";
|
|
7496
|
+
f.current = y;
|
|
7497
|
+
const I = [i.current, c.current].filter(
|
|
7490
7498
|
(be) => !!be
|
|
7491
7499
|
);
|
|
7492
|
-
|
|
7493
|
-
be.innerHTML !==
|
|
7494
|
-
}), x(!
|
|
7495
|
-
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));
|
|
7496
7504
|
return () => ue.forEach((be) => be());
|
|
7497
7505
|
}, [e]), Q(() => {
|
|
7498
7506
|
var be, Se;
|
|
7499
7507
|
m.current = te;
|
|
7500
|
-
let
|
|
7508
|
+
let y, I = 0, ue;
|
|
7501
7509
|
if (te) {
|
|
7502
7510
|
const he = i.current;
|
|
7503
7511
|
he && (f.current = he.innerHTML);
|
|
@@ -7505,22 +7513,22 @@ function Nc({
|
|
|
7505
7513
|
var fe;
|
|
7506
7514
|
const ke = c.current;
|
|
7507
7515
|
if (!ke) {
|
|
7508
|
-
|
|
7516
|
+
I = requestAnimationFrame(Ee);
|
|
7509
7517
|
return;
|
|
7510
7518
|
}
|
|
7511
|
-
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);
|
|
7512
7520
|
};
|
|
7513
|
-
|
|
7521
|
+
I = requestAnimationFrame(Ee);
|
|
7514
7522
|
} else {
|
|
7515
7523
|
const he = c.current, Ee = i.current, ke = (he == null ? void 0 : he.innerHTML) ?? f.current, fe = f.current;
|
|
7516
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()) === "");
|
|
7517
7525
|
}
|
|
7518
7526
|
return () => {
|
|
7519
|
-
|
|
7527
|
+
I && cancelAnimationFrame(I), ue && clearTimeout(ue), y == null || y();
|
|
7520
7528
|
};
|
|
7521
7529
|
}, [te]);
|
|
7522
7530
|
const E = we(() => {
|
|
7523
|
-
const
|
|
7531
|
+
const y = [
|
|
7524
7532
|
"bold",
|
|
7525
7533
|
"italic",
|
|
7526
7534
|
"underline",
|
|
@@ -7531,10 +7539,10 @@ function Nc({
|
|
|
7531
7539
|
"justifyCenter",
|
|
7532
7540
|
"justifyRight",
|
|
7533
7541
|
"justifyFull"
|
|
7534
|
-
],
|
|
7535
|
-
|
|
7542
|
+
], I = /* @__PURE__ */ new Set();
|
|
7543
|
+
y.forEach((be) => {
|
|
7536
7544
|
try {
|
|
7537
|
-
document.queryCommandState(be) &&
|
|
7545
|
+
document.queryCommandState(be) && I.add(be);
|
|
7538
7546
|
} catch {
|
|
7539
7547
|
return;
|
|
7540
7548
|
}
|
|
@@ -7543,70 +7551,70 @@ function Nc({
|
|
|
7543
7551
|
const be = Xi(
|
|
7544
7552
|
document.queryCommandValue("formatBlock")
|
|
7545
7553
|
);
|
|
7546
|
-
be &&
|
|
7554
|
+
be && I.add(`formatBlock:${be}`);
|
|
7547
7555
|
} catch {
|
|
7548
7556
|
return;
|
|
7549
7557
|
}
|
|
7550
7558
|
const ue = J();
|
|
7551
|
-
Qr(ue, "uppercase") &&
|
|
7552
|
-
}, [J]),
|
|
7553
|
-
var
|
|
7554
|
-
const
|
|
7555
|
-
|
|
7556
|
-
}, U = (
|
|
7557
|
-
if (!
|
|
7558
|
-
const
|
|
7559
|
-
|
|
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);
|
|
7560
7568
|
}
|
|
7561
|
-
P(!
|
|
7562
|
-
}, _ = (
|
|
7569
|
+
P(!y);
|
|
7570
|
+
}, _ = (y, I) => {
|
|
7563
7571
|
var ue;
|
|
7564
|
-
(ue = X()) == null || ue.focus(), document.execCommand(
|
|
7565
|
-
}, oe = (
|
|
7566
|
-
_("formatBlock",
|
|
7572
|
+
(ue = X()) == null || ue.focus(), document.execCommand(y, !1, I), H(), E();
|
|
7573
|
+
}, oe = (y) => {
|
|
7574
|
+
_("formatBlock", y);
|
|
7567
7575
|
}, W = () => {
|
|
7568
|
-
var
|
|
7569
|
-
(
|
|
7576
|
+
var y;
|
|
7577
|
+
(y = X()) == null || y.focus(), document.execCommand("insertHTML", !1, "<hr><p><br></p>"), H(), E();
|
|
7570
7578
|
}, s = () => {
|
|
7571
|
-
const
|
|
7572
|
-
|
|
7573
|
-
},
|
|
7574
|
-
const
|
|
7575
|
-
|
|
7576
|
-
},
|
|
7577
|
-
if (s(),
|
|
7578
|
-
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();
|
|
7579
7587
|
z(
|
|
7580
|
-
|
|
7588
|
+
I && !I.isCollapsed ? I.toString() : ""
|
|
7581
7589
|
), O("");
|
|
7582
7590
|
}
|
|
7583
|
-
|
|
7591
|
+
y === "image" && (M(""), Z("")), w(y);
|
|
7584
7592
|
}, j = () => {
|
|
7585
7593
|
var be;
|
|
7586
7594
|
if (!k.trim()) return;
|
|
7587
|
-
|
|
7588
|
-
const
|
|
7595
|
+
g(), (be = X()) == null || be.focus();
|
|
7596
|
+
const y = window.getSelection(), ue = (y && !y.isCollapsed ? y.toString() : "") || ee.trim() || k.trim();
|
|
7589
7597
|
document.execCommand(
|
|
7590
7598
|
"insertHTML",
|
|
7591
7599
|
!1,
|
|
7592
7600
|
`<a href="${kr(k.trim())}" target="_blank" rel="noopener noreferrer" class="rich-link">${kr(ue)}</a>`
|
|
7593
|
-
),
|
|
7594
|
-
}, B = (
|
|
7595
|
-
var
|
|
7596
|
-
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(
|
|
7597
7605
|
"insertHTML",
|
|
7598
7606
|
!1,
|
|
7599
7607
|
B(Y.trim(), q.trim())
|
|
7600
|
-
),
|
|
7601
|
-
}, ce = (
|
|
7608
|
+
), H(), w(null));
|
|
7609
|
+
}, ce = (y, I = 1200, ue = 1200, be = 0.72) => new Promise((Se, he) => {
|
|
7602
7610
|
const Ee = new FileReader();
|
|
7603
7611
|
Ee.onerror = he, Ee.onload = (ke) => {
|
|
7604
7612
|
var Qe;
|
|
7605
7613
|
const fe = (Qe = ke.target) == null ? void 0 : Qe.result, ze = new Image();
|
|
7606
7614
|
ze.onerror = he, ze.onload = () => {
|
|
7607
7615
|
let { width: qe, height: ae } = ze;
|
|
7608
|
-
if (qe >
|
|
7609
|
-
const _e = Math.min(
|
|
7616
|
+
if (qe > I || ae > ue) {
|
|
7617
|
+
const _e = Math.min(I / qe, ue / ae);
|
|
7610
7618
|
qe = Math.round(qe * _e), ae = Math.round(ae * _e);
|
|
7611
7619
|
}
|
|
7612
7620
|
const Me = document.createElement("canvas");
|
|
@@ -7618,11 +7626,11 @@ function Nc({
|
|
|
7618
7626
|
}
|
|
7619
7627
|
Te.drawImage(ze, 0, 0, qe, ae), Se(Me.toDataURL("image/jpeg", be));
|
|
7620
7628
|
}, ze.src = fe;
|
|
7621
|
-
}, Ee.readAsDataURL(
|
|
7622
|
-
}), pe = (
|
|
7623
|
-
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/"));
|
|
7624
7632
|
if (!ue) return;
|
|
7625
|
-
|
|
7633
|
+
y.preventDefault();
|
|
7626
7634
|
const be = ue.getAsFile();
|
|
7627
7635
|
be && ce(be).then((Se) => {
|
|
7628
7636
|
var he;
|
|
@@ -7630,29 +7638,29 @@ function Nc({
|
|
|
7630
7638
|
"insertHTML",
|
|
7631
7639
|
!1,
|
|
7632
7640
|
B(Se, "imagen")
|
|
7633
|
-
),
|
|
7641
|
+
), H();
|
|
7634
7642
|
});
|
|
7635
|
-
}, $ = (
|
|
7636
|
-
const
|
|
7637
|
-
if (!
|
|
7643
|
+
}, $ = (y) => {
|
|
7644
|
+
const I = window.getSelection(), ue = X();
|
|
7645
|
+
if (!I || !ue || I.rangeCount === 0 || I.isCollapsed)
|
|
7638
7646
|
return;
|
|
7639
|
-
const be =
|
|
7647
|
+
const be = I.getRangeAt(0);
|
|
7640
7648
|
if (!ue.contains(be.startContainer) || !ue.contains(be.endContainer))
|
|
7641
7649
|
return;
|
|
7642
7650
|
const Se = be.toString();
|
|
7643
7651
|
if (!Se) return;
|
|
7644
7652
|
let he = Se;
|
|
7645
|
-
|
|
7653
|
+
y === "uppercase" ? he = Se.toLocaleUpperCase() : y === "lowercase" ? he = Se.toLocaleLowerCase() : he = Ua(Se), be.deleteContents();
|
|
7646
7654
|
const Ee = document.createTextNode(he);
|
|
7647
7655
|
be.insertNode(Ee);
|
|
7648
7656
|
const ke = document.createRange();
|
|
7649
|
-
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();
|
|
7650
7658
|
}, ie = () => {
|
|
7651
7659
|
s(), E();
|
|
7652
|
-
},
|
|
7653
|
-
|
|
7654
|
-
},
|
|
7655
|
-
if (
|
|
7660
|
+
}, R = () => {
|
|
7661
|
+
H(), E();
|
|
7662
|
+
}, A = (y) => {
|
|
7663
|
+
if (y.key === "Escape") {
|
|
7656
7664
|
if (S) {
|
|
7657
7665
|
w(null);
|
|
7658
7666
|
return;
|
|
@@ -7662,20 +7670,20 @@ function Nc({
|
|
|
7662
7670
|
return;
|
|
7663
7671
|
}
|
|
7664
7672
|
}
|
|
7665
|
-
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")));
|
|
7666
7674
|
}, G = () => /* @__PURE__ */ t(
|
|
7667
7675
|
"div",
|
|
7668
7676
|
{
|
|
7669
7677
|
className: "h-4 w-px flex-shrink-0 mx-1",
|
|
7670
7678
|
style: { background: "var(--border)" }
|
|
7671
7679
|
}
|
|
7672
|
-
), V = (
|
|
7673
|
-
const he = Se ?? (
|
|
7680
|
+
), V = (y, I, ue, be, Se) => {
|
|
7681
|
+
const he = Se ?? (v.has(ue) || ue === "__link" && S === "link" || ue === "__img" && S === "image");
|
|
7674
7682
|
return /* @__PURE__ */ t(
|
|
7675
7683
|
"button",
|
|
7676
7684
|
{
|
|
7677
7685
|
type: "button",
|
|
7678
|
-
title:
|
|
7686
|
+
title: I,
|
|
7679
7687
|
onMouseDown: (Ee) => {
|
|
7680
7688
|
Ee.preventDefault(), be ? be() : _(ue);
|
|
7681
7689
|
},
|
|
@@ -7684,23 +7692,23 @@ function Nc({
|
|
|
7684
7692
|
color: he ? "var(--primary)" : "var(--text-secondary)",
|
|
7685
7693
|
background: he ? "rgba(59,130,246,0.12)" : "transparent"
|
|
7686
7694
|
},
|
|
7687
|
-
children:
|
|
7695
|
+
children: y
|
|
7688
7696
|
},
|
|
7689
7697
|
ue
|
|
7690
7698
|
);
|
|
7691
|
-
}, re = (
|
|
7692
|
-
const
|
|
7693
|
-
if (
|
|
7694
|
-
|
|
7695
|
-
const ue =
|
|
7696
|
-
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());
|
|
7697
7705
|
}
|
|
7698
|
-
}, me = (
|
|
7706
|
+
}, me = (y) => /* @__PURE__ */ l(Re, { children: [
|
|
7699
7707
|
S === "link" && /* @__PURE__ */ l(
|
|
7700
7708
|
"div",
|
|
7701
7709
|
{
|
|
7702
7710
|
className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
|
|
7703
|
-
style: { borderColor: "var(--border)", background:
|
|
7711
|
+
style: { borderColor: "var(--border)", background: y },
|
|
7704
7712
|
children: [
|
|
7705
7713
|
/* @__PURE__ */ t(
|
|
7706
7714
|
"input",
|
|
@@ -7708,9 +7716,9 @@ function Nc({
|
|
|
7708
7716
|
autoFocus: !0,
|
|
7709
7717
|
type: "url",
|
|
7710
7718
|
value: k,
|
|
7711
|
-
onChange: (
|
|
7712
|
-
onKeyDown: (
|
|
7713
|
-
|
|
7719
|
+
onChange: (I) => O(I.target.value),
|
|
7720
|
+
onKeyDown: (I) => {
|
|
7721
|
+
I.key === "Enter" && (I.preventDefault(), j()), I.key === "Escape" && w(null);
|
|
7714
7722
|
},
|
|
7715
7723
|
placeholder: "https://...",
|
|
7716
7724
|
className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7726,9 +7734,9 @@ function Nc({
|
|
|
7726
7734
|
{
|
|
7727
7735
|
type: "text",
|
|
7728
7736
|
value: ee,
|
|
7729
|
-
onChange: (
|
|
7730
|
-
onKeyDown: (
|
|
7731
|
-
|
|
7737
|
+
onChange: (I) => z(I.target.value),
|
|
7738
|
+
onKeyDown: (I) => {
|
|
7739
|
+
I.key === "Enter" && (I.preventDefault(), j()), I.key === "Escape" && w(null);
|
|
7732
7740
|
},
|
|
7733
7741
|
placeholder: "Texto (opcional)",
|
|
7734
7742
|
className: "w-32 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7766,7 +7774,7 @@ function Nc({
|
|
|
7766
7774
|
"div",
|
|
7767
7775
|
{
|
|
7768
7776
|
className: "flex flex-shrink-0 flex-wrap items-center gap-2 border-t px-3 py-2",
|
|
7769
|
-
style: { borderColor: "var(--border)", background:
|
|
7777
|
+
style: { borderColor: "var(--border)", background: y },
|
|
7770
7778
|
children: [
|
|
7771
7779
|
/* @__PURE__ */ t(
|
|
7772
7780
|
"input",
|
|
@@ -7774,9 +7782,9 @@ function Nc({
|
|
|
7774
7782
|
autoFocus: !0,
|
|
7775
7783
|
type: "url",
|
|
7776
7784
|
value: Y,
|
|
7777
|
-
onChange: (
|
|
7778
|
-
onKeyDown: (
|
|
7779
|
-
|
|
7785
|
+
onChange: (I) => M(I.target.value),
|
|
7786
|
+
onKeyDown: (I) => {
|
|
7787
|
+
I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
|
|
7780
7788
|
},
|
|
7781
7789
|
placeholder: "URL de la imagen...",
|
|
7782
7790
|
className: "min-w-0 flex-1 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7792,9 +7800,9 @@ function Nc({
|
|
|
7792
7800
|
{
|
|
7793
7801
|
type: "text",
|
|
7794
7802
|
value: q,
|
|
7795
|
-
onChange: (
|
|
7796
|
-
onKeyDown: (
|
|
7797
|
-
|
|
7803
|
+
onChange: (I) => Z(I.target.value),
|
|
7804
|
+
onKeyDown: (I) => {
|
|
7805
|
+
I.key === "Enter" && (I.preventDefault(), ne()), I.key === "Escape" && w(null);
|
|
7798
7806
|
},
|
|
7799
7807
|
placeholder: "Texto alt",
|
|
7800
7808
|
className: "w-28 rounded px-2 py-1 text-xs focus:outline-none",
|
|
@@ -7828,11 +7836,11 @@ function Nc({
|
|
|
7828
7836
|
]
|
|
7829
7837
|
}
|
|
7830
7838
|
)
|
|
7831
|
-
] }), se = (
|
|
7839
|
+
] }), se = (y, I) => /* @__PURE__ */ l(
|
|
7832
7840
|
"div",
|
|
7833
7841
|
{
|
|
7834
7842
|
className: "flex flex-shrink-0 flex-wrap items-center gap-0.5 border-t px-2 py-1",
|
|
7835
|
-
style: { borderColor: "var(--border)", background:
|
|
7843
|
+
style: { borderColor: "var(--border)", background: I },
|
|
7836
7844
|
children: [
|
|
7837
7845
|
V(
|
|
7838
7846
|
/* @__PURE__ */ t(el, { className: "h-4 w-4" }),
|
|
@@ -7850,28 +7858,28 @@ function Nc({
|
|
|
7850
7858
|
"Parrafo",
|
|
7851
7859
|
"__paragraph",
|
|
7852
7860
|
() => oe("p"),
|
|
7853
|
-
|
|
7861
|
+
v.has("formatBlock:p") || v.has("formatBlock:div")
|
|
7854
7862
|
),
|
|
7855
7863
|
V(
|
|
7856
7864
|
/* @__PURE__ */ t(Xo, { className: "h-4 w-4" }),
|
|
7857
7865
|
"Titulo 2",
|
|
7858
7866
|
"__h2",
|
|
7859
7867
|
() => oe("h2"),
|
|
7860
|
-
|
|
7868
|
+
v.has("formatBlock:h2")
|
|
7861
7869
|
),
|
|
7862
7870
|
V(
|
|
7863
7871
|
/* @__PURE__ */ t(Zo, { className: "h-4 w-4" }),
|
|
7864
7872
|
"Titulo 3",
|
|
7865
7873
|
"__h3",
|
|
7866
7874
|
() => oe("h3"),
|
|
7867
|
-
|
|
7875
|
+
v.has("formatBlock:h3")
|
|
7868
7876
|
),
|
|
7869
7877
|
V(
|
|
7870
7878
|
/* @__PURE__ */ t("span", { style: { fontSize: "13px", lineHeight: 1 }, children: "“" }),
|
|
7871
7879
|
"Cita",
|
|
7872
7880
|
"__quote",
|
|
7873
7881
|
() => oe("blockquote"),
|
|
7874
|
-
|
|
7882
|
+
v.has("formatBlock:blockquote")
|
|
7875
7883
|
),
|
|
7876
7884
|
G(),
|
|
7877
7885
|
V(/* @__PURE__ */ t("b", { children: "B" }), "Negrita (Ctrl+B)", "bold"),
|
|
@@ -7944,7 +7952,7 @@ function Nc({
|
|
|
7944
7952
|
/* @__PURE__ */ t(wa, { className: "h-4 w-4" }),
|
|
7945
7953
|
"Insertar enlace (Ctrl+K)",
|
|
7946
7954
|
"__link",
|
|
7947
|
-
() =>
|
|
7955
|
+
() => T("link")
|
|
7948
7956
|
),
|
|
7949
7957
|
V(
|
|
7950
7958
|
/* @__PURE__ */ t(sl, { className: "h-4 w-4" }),
|
|
@@ -7955,7 +7963,7 @@ function Nc({
|
|
|
7955
7963
|
/* @__PURE__ */ t(cl, { className: "h-4 w-4" }),
|
|
7956
7964
|
"Insertar imagen",
|
|
7957
7965
|
"__img",
|
|
7958
|
-
() =>
|
|
7966
|
+
() => T("image")
|
|
7959
7967
|
),
|
|
7960
7968
|
V(
|
|
7961
7969
|
/* @__PURE__ */ t(Na, { className: "h-4 w-4" }),
|
|
@@ -7980,13 +7988,13 @@ function Nc({
|
|
|
7980
7988
|
"button",
|
|
7981
7989
|
{
|
|
7982
7990
|
type: "button",
|
|
7983
|
-
title:
|
|
7991
|
+
title: y ? "Salir del modo de enfoque (Esc)" : "Modo de enfoque",
|
|
7984
7992
|
onMouseDown: (ue) => {
|
|
7985
|
-
ue.preventDefault(), U(
|
|
7993
|
+
ue.preventDefault(), U(y);
|
|
7986
7994
|
},
|
|
7987
7995
|
className: "flex h-7 w-7 items-center justify-center rounded transition-colors",
|
|
7988
7996
|
style: { color: "var(--text-secondary)" },
|
|
7989
|
-
children:
|
|
7997
|
+
children: y ? /* @__PURE__ */ t(Jo, { className: "h-4 w-4" }) : /* @__PURE__ */ t(Qo, { className: "h-4 w-4" })
|
|
7990
7998
|
}
|
|
7991
7999
|
)
|
|
7992
8000
|
]
|
|
@@ -8005,15 +8013,15 @@ function Nc({
|
|
|
8005
8013
|
ref: i,
|
|
8006
8014
|
contentEditable: !0,
|
|
8007
8015
|
suppressContentEditableWarning: !0,
|
|
8008
|
-
onInput:
|
|
8009
|
-
onKeyDown:
|
|
8016
|
+
onInput: R,
|
|
8017
|
+
onKeyDown: A,
|
|
8010
8018
|
onKeyUp: ie,
|
|
8011
8019
|
onSelect: ie,
|
|
8012
8020
|
onMouseUp: ie,
|
|
8013
8021
|
onPaste: pe,
|
|
8014
8022
|
onMouseDown: re,
|
|
8015
8023
|
"data-placeholder": n,
|
|
8016
|
-
className: `rich-editor px-3 py-2 text-sm focus:outline-none${
|
|
8024
|
+
className: `rich-editor px-3 py-2 text-sm focus:outline-none${h ? " is-empty" : ""}`,
|
|
8017
8025
|
style: {
|
|
8018
8026
|
color: "var(--text-main)",
|
|
8019
8027
|
background: "var(--bg-input)",
|
|
@@ -8047,15 +8055,15 @@ function Nc({
|
|
|
8047
8055
|
ref: c,
|
|
8048
8056
|
contentEditable: !0,
|
|
8049
8057
|
suppressContentEditableWarning: !0,
|
|
8050
|
-
onInput:
|
|
8051
|
-
onKeyDown:
|
|
8058
|
+
onInput: R,
|
|
8059
|
+
onKeyDown: A,
|
|
8052
8060
|
onKeyUp: ie,
|
|
8053
8061
|
onSelect: ie,
|
|
8054
8062
|
onMouseUp: ie,
|
|
8055
8063
|
onPaste: pe,
|
|
8056
8064
|
onMouseDown: re,
|
|
8057
8065
|
"data-placeholder": n,
|
|
8058
|
-
className: `rich-editor min-h-0 flex-1 overflow-y-auto px-8 py-6 text-sm focus:outline-none${
|
|
8066
|
+
className: `rich-editor min-h-0 flex-1 overflow-y-auto px-8 py-6 text-sm focus:outline-none${h ? " is-empty" : ""}`,
|
|
8059
8067
|
style: {
|
|
8060
8068
|
color: "var(--text-main)",
|
|
8061
8069
|
background: "var(--bg-card)",
|
|
@@ -8224,53 +8232,53 @@ function Sc({
|
|
|
8224
8232
|
ariaLabel: m = "Cambiar estado",
|
|
8225
8233
|
title: f = "Cambiar estado",
|
|
8226
8234
|
className: p,
|
|
8227
|
-
selectClassName:
|
|
8235
|
+
selectClassName: h,
|
|
8228
8236
|
menuClassName: x,
|
|
8229
|
-
optionClassName:
|
|
8237
|
+
optionClassName: v,
|
|
8230
8238
|
spinnerClassName: L
|
|
8231
8239
|
}) {
|
|
8232
|
-
const [S, w] = D(!1), [k, O] = D(!1), [ee, z] = D(-1), [Y,
|
|
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 = {
|
|
8233
8241
|
...P != null && P.tone ? da[P.tone] : void 0,
|
|
8234
8242
|
...P == null ? void 0 : P.style
|
|
8235
8243
|
}, J = i || c || r.length === 0, E = (s) => {
|
|
8236
8244
|
u && s.stopPropagation();
|
|
8237
|
-
},
|
|
8245
|
+
}, H = we(() => {
|
|
8238
8246
|
w(!1), z(-1);
|
|
8239
8247
|
}, []), U = we(() => {
|
|
8240
8248
|
const s = q.current;
|
|
8241
8249
|
if (!s) return;
|
|
8242
|
-
const
|
|
8243
|
-
Math.max(8,
|
|
8244
|
-
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
|
|
8245
8253
|
);
|
|
8246
|
-
|
|
8254
|
+
M({
|
|
8247
8255
|
position: "fixed",
|
|
8248
8256
|
left: ce,
|
|
8249
|
-
top: ne ? void 0 :
|
|
8250
|
-
bottom: ne ? window.innerHeight -
|
|
8251
|
-
width:
|
|
8257
|
+
top: ne ? void 0 : g.bottom + 6,
|
|
8258
|
+
bottom: ne ? window.innerHeight - g.top + 6 : void 0,
|
|
8259
|
+
width: T,
|
|
8252
8260
|
zIndex: 9999
|
|
8253
8261
|
});
|
|
8254
8262
|
}, [r.length, a]), _ = we(
|
|
8255
8263
|
(s) => {
|
|
8256
|
-
s.disabled || (n(s.value),
|
|
8264
|
+
s.disabled || (n(s.value), H());
|
|
8257
8265
|
},
|
|
8258
|
-
[
|
|
8266
|
+
[H, n]
|
|
8259
8267
|
);
|
|
8260
8268
|
Q(() => O(!0), []), Q(() => {
|
|
8261
8269
|
if (!S) return;
|
|
8262
8270
|
U();
|
|
8263
|
-
const s = r.findIndex((
|
|
8271
|
+
const s = r.findIndex((g) => g.value === e);
|
|
8264
8272
|
z(s >= 0 ? s : 0);
|
|
8265
8273
|
}, [S, r, U, e]), Q(() => {
|
|
8266
8274
|
if (!S) return;
|
|
8267
|
-
function s(
|
|
8275
|
+
function s(g) {
|
|
8268
8276
|
var j, B;
|
|
8269
|
-
const
|
|
8270
|
-
!((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();
|
|
8271
8279
|
}
|
|
8272
8280
|
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
8273
|
-
}, [
|
|
8281
|
+
}, [H, S]), Q(() => {
|
|
8274
8282
|
if (S)
|
|
8275
8283
|
return window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), () => {
|
|
8276
8284
|
window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
@@ -8287,21 +8295,21 @@ function Sc({
|
|
|
8287
8295
|
return;
|
|
8288
8296
|
}
|
|
8289
8297
|
if (s.key === "Escape") {
|
|
8290
|
-
s.preventDefault(),
|
|
8298
|
+
s.preventDefault(), H();
|
|
8291
8299
|
return;
|
|
8292
8300
|
}
|
|
8293
8301
|
if (s.key === "ArrowDown") {
|
|
8294
|
-
s.preventDefault(), z((
|
|
8302
|
+
s.preventDefault(), z((g) => Math.min(g + 1, r.length - 1));
|
|
8295
8303
|
return;
|
|
8296
8304
|
}
|
|
8297
8305
|
if (s.key === "ArrowUp") {
|
|
8298
|
-
s.preventDefault(), z((
|
|
8306
|
+
s.preventDefault(), z((g) => Math.max(g - 1, 0));
|
|
8299
8307
|
return;
|
|
8300
8308
|
}
|
|
8301
8309
|
if (s.key === "Enter" || s.key === " ") {
|
|
8302
8310
|
s.preventDefault();
|
|
8303
|
-
const
|
|
8304
|
-
|
|
8311
|
+
const g = r[ee];
|
|
8312
|
+
g && _(g);
|
|
8305
8313
|
}
|
|
8306
8314
|
}
|
|
8307
8315
|
}
|
|
@@ -8334,8 +8342,8 @@ function Sc({
|
|
|
8334
8342
|
scrollbarColor: "var(--border) transparent",
|
|
8335
8343
|
overscrollBehavior: "contain"
|
|
8336
8344
|
},
|
|
8337
|
-
children: r.map((s,
|
|
8338
|
-
const
|
|
8345
|
+
children: r.map((s, g) => {
|
|
8346
|
+
const T = s.value === e, j = g === ee, B = {
|
|
8339
8347
|
...s.tone ? da[s.tone] : void 0,
|
|
8340
8348
|
...s.style
|
|
8341
8349
|
};
|
|
@@ -8344,25 +8352,25 @@ function Sc({
|
|
|
8344
8352
|
{
|
|
8345
8353
|
type: "button",
|
|
8346
8354
|
role: "option",
|
|
8347
|
-
"aria-selected":
|
|
8355
|
+
"aria-selected": T,
|
|
8348
8356
|
disabled: s.disabled,
|
|
8349
|
-
onMouseEnter: () => !s.disabled && z(
|
|
8357
|
+
onMouseEnter: () => !s.disabled && z(g),
|
|
8350
8358
|
onMouseDown: (ne) => {
|
|
8351
8359
|
ne.preventDefault(), _(s);
|
|
8352
8360
|
},
|
|
8353
8361
|
className: ht(
|
|
8354
8362
|
"flex w-full items-center gap-2 rounded-lg font-medium text-left transition-colors disabled:cursor-not-allowed disabled:opacity-45",
|
|
8355
8363
|
ns[a],
|
|
8356
|
-
|
|
8357
|
-
|
|
8364
|
+
T ? s.className : void 0,
|
|
8365
|
+
v
|
|
8358
8366
|
),
|
|
8359
8367
|
style: {
|
|
8360
|
-
...
|
|
8361
|
-
background:
|
|
8362
|
-
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)"
|
|
8363
8371
|
},
|
|
8364
8372
|
children: [
|
|
8365
|
-
/* @__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 }),
|
|
8366
8374
|
/* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: s.label })
|
|
8367
8375
|
]
|
|
8368
8376
|
},
|
|
@@ -8396,7 +8404,7 @@ function Sc({
|
|
|
8396
8404
|
"inline-flex items-center rounded-full border border-transparent font-medium leading-none outline-none transition-colors hover:border-current focus:border-current disabled:cursor-wait disabled:opacity-70",
|
|
8397
8405
|
es[a],
|
|
8398
8406
|
P == null ? void 0 : P.className,
|
|
8399
|
-
|
|
8407
|
+
h
|
|
8400
8408
|
),
|
|
8401
8409
|
style: X,
|
|
8402
8410
|
children: /* @__PURE__ */ t("span", { className: "min-w-0 truncate", children: (P == null ? void 0 : P.label) ?? e })
|
|
@@ -8439,7 +8447,7 @@ function Ec({
|
|
|
8439
8447
|
listClassName: m = "",
|
|
8440
8448
|
panelClassName: f = ""
|
|
8441
8449
|
}) {
|
|
8442
|
-
const p = e.find((S) => !S.disabled) ?? e[0],
|
|
8450
|
+
const p = e.find((S) => !S.disabled) ?? e[0], h = r ?? n ?? (p == null ? void 0 : p.id), x = e.find((S) => S.id === h) ?? p, v = (S) => {
|
|
8443
8451
|
S.disabled || a == null || a(S.id);
|
|
8444
8452
|
};
|
|
8445
8453
|
return /* @__PURE__ */ l("div", { className: u, children: [
|
|
@@ -8454,9 +8462,9 @@ function Ec({
|
|
|
8454
8462
|
const k = w.findIndex(
|
|
8455
8463
|
(O) => O.id === x.id
|
|
8456
8464
|
);
|
|
8457
|
-
(S.key === "ArrowRight" || S.key === "ArrowDown") && (S.preventDefault(),
|
|
8465
|
+
(S.key === "ArrowRight" || S.key === "ArrowDown") && (S.preventDefault(), v(w[(k + 1) % w.length])), (S.key === "ArrowLeft" || S.key === "ArrowUp") && (S.preventDefault(), v(
|
|
8458
8466
|
w[(k - 1 + w.length) % w.length]
|
|
8459
|
-
)), S.key === "Home" && (S.preventDefault(),
|
|
8467
|
+
)), S.key === "Home" && (S.preventDefault(), v(w[0])), S.key === "End" && (S.preventDefault(), v(w[w.length - 1]));
|
|
8460
8468
|
},
|
|
8461
8469
|
className: `flex min-w-0 gap-1 overflow-x-auto ${c === "underline" ? "border-b border-[var(--border)]" : "rounded-lg border border-[var(--border)] bg-[var(--bg-input)] p-1"} ${m}`,
|
|
8462
8470
|
children: e.map((S) => {
|
|
@@ -8471,7 +8479,7 @@ function Ec({
|
|
|
8471
8479
|
id: `${S.id}-tab`,
|
|
8472
8480
|
disabled: S.disabled,
|
|
8473
8481
|
tabIndex: w ? 0 : -1,
|
|
8474
|
-
onClick: () =>
|
|
8482
|
+
onClick: () => v(S),
|
|
8475
8483
|
className: `inline-flex min-h-8 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap px-2.5 text-sm font-semibold transition-colors focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${c === "underline" ? "border-b-2" : "rounded-md border"}`,
|
|
8476
8484
|
style: {
|
|
8477
8485
|
color: w ? "var(--primary)" : "var(--text-muted)",
|
|
@@ -8515,64 +8523,64 @@ function $c({
|
|
|
8515
8523
|
onBlockedStep: m,
|
|
8516
8524
|
allowBackNavigation: f = !0,
|
|
8517
8525
|
showFooter: p = !0,
|
|
8518
|
-
previousLabel:
|
|
8526
|
+
previousLabel: h = "Anterior",
|
|
8519
8527
|
nextLabel: x = "Siguiente",
|
|
8520
|
-
blockedNextLabel:
|
|
8528
|
+
blockedNextLabel: v = "Completa este paso",
|
|
8521
8529
|
className: L = "",
|
|
8522
8530
|
headerClassName: S = "",
|
|
8523
8531
|
contentClassName: w = "",
|
|
8524
8532
|
footerClassName: k = ""
|
|
8525
8533
|
}) {
|
|
8526
|
-
var
|
|
8527
|
-
const O = ((
|
|
8534
|
+
var R;
|
|
8535
|
+
const O = ((R = e[0]) == null ? void 0 : R.id) ?? "", [ee, z] = D(
|
|
8528
8536
|
n ?? O
|
|
8529
|
-
), [Y,
|
|
8537
|
+
), [Y, M] = D(
|
|
8530
8538
|
i
|
|
8531
8539
|
), q = r ?? ee, Z = a ?? Y, te = at(
|
|
8532
8540
|
() => new Set(Z),
|
|
8533
8541
|
[Z]
|
|
8534
8542
|
), P = Math.max(
|
|
8535
8543
|
0,
|
|
8536
|
-
e.findIndex((
|
|
8537
|
-
), X = e[P] ?? e[0], J = e.length <= 1 ? 100 : P / (e.length - 1) * 100, E = (
|
|
8538
|
-
a ||
|
|
8539
|
-
},
|
|
8540
|
-
const G = e.find((V) => V.id ===
|
|
8541
|
-
G && (r || z(
|
|
8542
|
-
}, U = (
|
|
8543
|
-
const G = e[
|
|
8544
|
-
return !G || G.disabled ? !1 :
|
|
8545
|
-
}, W = (
|
|
8546
|
-
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);
|
|
8547
8555
|
return G >= 0 && oe(G);
|
|
8548
|
-
}, s = (
|
|
8549
|
-
const G = e.findIndex((V) => V.id ===
|
|
8556
|
+
}, s = (A) => {
|
|
8557
|
+
const G = e.findIndex((V) => V.id === A);
|
|
8550
8558
|
if (G < 0) return !1;
|
|
8551
8559
|
if (!oe(G)) {
|
|
8552
8560
|
const V = _(G);
|
|
8553
8561
|
return V && (m == null || m(e[G], V)), !1;
|
|
8554
8562
|
}
|
|
8555
|
-
return
|
|
8556
|
-
},
|
|
8557
|
-
!
|
|
8558
|
-
},
|
|
8559
|
-
if (!
|
|
8560
|
-
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) => {
|
|
8561
8569
|
const me = e.findIndex((se) => se.id === re);
|
|
8562
8570
|
return me >= 0 && me < G;
|
|
8563
8571
|
});
|
|
8564
|
-
E(V), G >= 0 && P > G &&
|
|
8572
|
+
E(V), G >= 0 && P > G && H(A);
|
|
8565
8573
|
}, j = () => P <= 0 ? !1 : s(e[P - 1].id), B = () => {
|
|
8566
|
-
const
|
|
8567
|
-
return
|
|
8574
|
+
const A = e[P + 1];
|
|
8575
|
+
return A ? s(A.id) : !1;
|
|
8568
8576
|
}, ne = {
|
|
8569
8577
|
activeStep: X,
|
|
8570
8578
|
activeIndex: P,
|
|
8571
8579
|
completedStepIds: Z,
|
|
8572
8580
|
isCompleted: U,
|
|
8573
8581
|
isUnlocked: W,
|
|
8574
|
-
completeStep:
|
|
8575
|
-
uncompleteStep:
|
|
8582
|
+
completeStep: g,
|
|
8583
|
+
uncompleteStep: T,
|
|
8576
8584
|
goToStep: s,
|
|
8577
8585
|
goNext: B,
|
|
8578
8586
|
goPrevious: j
|
|
@@ -8609,8 +8617,8 @@ function $c({
|
|
|
8609
8617
|
style: {
|
|
8610
8618
|
gridTemplateColumns: `repeat(${e.length}, minmax(0, 1fr))`
|
|
8611
8619
|
},
|
|
8612
|
-
children: e.map((
|
|
8613
|
-
const V =
|
|
8620
|
+
children: e.map((A, G) => {
|
|
8621
|
+
const V = A.id === X.id, re = U(A.id), me = oe(G), se = _(G);
|
|
8614
8622
|
return /* @__PURE__ */ l(
|
|
8615
8623
|
"button",
|
|
8616
8624
|
{
|
|
@@ -8618,8 +8626,8 @@ function $c({
|
|
|
8618
8626
|
disabled: !me,
|
|
8619
8627
|
"aria-current": V ? "step" : void 0,
|
|
8620
8628
|
"aria-disabled": !me,
|
|
8621
|
-
title: !me && se ? `Completa ${se.title}` :
|
|
8622
|
-
onClick: () => s(
|
|
8629
|
+
title: !me && se ? `Completa ${se.title}` : A.title,
|
|
8630
|
+
onClick: () => s(A.id),
|
|
8623
8631
|
className: it(
|
|
8624
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",
|
|
8625
8633
|
V && "border-[var(--primary)] bg-[var(--bg-card)] shadow-sm",
|
|
@@ -8662,17 +8670,17 @@ function $c({
|
|
|
8662
8670
|
children: [
|
|
8663
8671
|
G + 1,
|
|
8664
8672
|
". ",
|
|
8665
|
-
|
|
8673
|
+
A.title
|
|
8666
8674
|
]
|
|
8667
8675
|
}
|
|
8668
8676
|
),
|
|
8669
|
-
|
|
8677
|
+
A.description && /* @__PURE__ */ t("span", { className: "mt-1 block truncate text-[11px] text-[var(--text-muted)]", children: A.description })
|
|
8670
8678
|
] }),
|
|
8671
|
-
|
|
8679
|
+
A.badge && /* @__PURE__ */ t("span", { className: "shrink-0", children: A.badge })
|
|
8672
8680
|
] })
|
|
8673
8681
|
]
|
|
8674
8682
|
},
|
|
8675
|
-
|
|
8683
|
+
A.id
|
|
8676
8684
|
);
|
|
8677
8685
|
})
|
|
8678
8686
|
}
|
|
@@ -8708,7 +8716,7 @@ function $c({
|
|
|
8708
8716
|
icon: /* @__PURE__ */ t(Tt, {}),
|
|
8709
8717
|
disabled: !pe,
|
|
8710
8718
|
onClick: j,
|
|
8711
|
-
children:
|
|
8719
|
+
children: h
|
|
8712
8720
|
}
|
|
8713
8721
|
),
|
|
8714
8722
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 text-xs text-[var(--text-muted)]", children: [
|
|
@@ -8732,7 +8740,7 @@ function $c({
|
|
|
8732
8740
|
icon: /* @__PURE__ */ t(st, {}),
|
|
8733
8741
|
disabled: !ce || !$,
|
|
8734
8742
|
onClick: B,
|
|
8735
|
-
children: ce && !$ ?
|
|
8743
|
+
children: ce && !$ ? v : x
|
|
8736
8744
|
}
|
|
8737
8745
|
)
|
|
8738
8746
|
]
|
|
@@ -8775,9 +8783,9 @@ const ss = ga(
|
|
|
8775
8783
|
maxRows: m,
|
|
8776
8784
|
showCount: f = !1,
|
|
8777
8785
|
maxCount: p,
|
|
8778
|
-
status:
|
|
8786
|
+
status: h = "default",
|
|
8779
8787
|
icon: x,
|
|
8780
|
-
action:
|
|
8788
|
+
action: v,
|
|
8781
8789
|
style: L,
|
|
8782
8790
|
value: S,
|
|
8783
8791
|
defaultValue: w,
|
|
@@ -8785,7 +8793,7 @@ const ss = ga(
|
|
|
8785
8793
|
onInput: O,
|
|
8786
8794
|
...ee
|
|
8787
8795
|
}, z) {
|
|
8788
|
-
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 = {
|
|
8789
8797
|
...L ?? {},
|
|
8790
8798
|
...u ? { minHeight: `${u * 24 + 18}px` } : null,
|
|
8791
8799
|
...m ? { maxHeight: `${m * 24 + 18}px` } : null
|
|
@@ -8804,20 +8812,20 @@ const ss = ga(
|
|
|
8804
8812
|
value: S,
|
|
8805
8813
|
defaultValue: w,
|
|
8806
8814
|
maxLength: k,
|
|
8807
|
-
"aria-invalid":
|
|
8815
|
+
"aria-invalid": h === "error" || ee["aria-invalid"],
|
|
8808
8816
|
onInput: (E) => {
|
|
8809
8817
|
X(), O == null || O(E);
|
|
8810
8818
|
},
|
|
8811
8819
|
style: { ...P, borderColor: te },
|
|
8812
|
-
className: `w-full rounded-lg border bg-[var(--bg-input)] text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-60 ${as[a]} ${os[c ? "none" : i]} ${x ? "pl-8" : ""} ${
|
|
8820
|
+
className: `w-full rounded-lg border bg-[var(--bg-input)] text-[var(--text-main)] outline-none placeholder:text-[var(--text-muted)] transition-colors focus:border-[var(--primary)] disabled:cursor-not-allowed disabled:opacity-60 ${as[a]} ${os[c ? "none" : i]} ${x ? "pl-8" : ""} ${v ? "pr-10" : ""} ${r}`
|
|
8813
8821
|
}
|
|
8814
8822
|
);
|
|
8815
8823
|
return Z ? /* @__PURE__ */ l("span", { className: `relative block ${n}`, children: [
|
|
8816
8824
|
x && /* @__PURE__ */ t("span", { className: "pointer-events-none absolute left-2.5 top-2.5 flex h-4 w-4 items-center justify-center text-[var(--text-muted)]", children: x }),
|
|
8817
8825
|
J,
|
|
8818
|
-
|
|
8826
|
+
v && /* @__PURE__ */ t("span", { className: "absolute right-2 top-2 flex items-center justify-center", children: v }),
|
|
8819
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: [
|
|
8820
|
-
|
|
8828
|
+
M,
|
|
8821
8829
|
q ? `/${q}` : ""
|
|
8822
8830
|
] })
|
|
8823
8831
|
] }) : J;
|
|
@@ -9023,9 +9031,9 @@ function ys({
|
|
|
9023
9031
|
fallbackLabel: m = "Usuario",
|
|
9024
9032
|
wrapperClassName: f = "",
|
|
9025
9033
|
labelClassName: p = "",
|
|
9026
|
-
labelSize:
|
|
9034
|
+
labelSize: h = "xs",
|
|
9027
9035
|
avatarVersion: x = 0,
|
|
9028
|
-
className:
|
|
9036
|
+
className: v = "",
|
|
9029
9037
|
style: L
|
|
9030
9038
|
}) {
|
|
9031
9039
|
var U;
|
|
@@ -9033,7 +9041,7 @@ function ys({
|
|
|
9033
9041
|
Q(() => {
|
|
9034
9042
|
w(!1);
|
|
9035
9043
|
}, [k, x]);
|
|
9036
|
-
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 = {
|
|
9037
9045
|
xs: 20,
|
|
9038
9046
|
sm: 28,
|
|
9039
9047
|
md: 36,
|
|
@@ -9042,7 +9050,7 @@ function ys({
|
|
|
9042
9050
|
}[a], J = q ? /* @__PURE__ */ t(
|
|
9043
9051
|
"span",
|
|
9044
9052
|
{
|
|
9045
|
-
className: `${O} ${hs[a]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${
|
|
9053
|
+
className: `${O} ${hs[a]} rounded-full flex items-center justify-center bg-[#071f1a] ring-1 ring-emerald-400/35 shadow-[0_0_0_1px_rgba(255,255,255,0.06)] flex-shrink-0 ${v}`,
|
|
9046
9054
|
style: L,
|
|
9047
9055
|
children: /* @__PURE__ */ t(
|
|
9048
9056
|
"img",
|
|
@@ -9062,7 +9070,7 @@ function ys({
|
|
|
9062
9070
|
alt: z,
|
|
9063
9071
|
width: X,
|
|
9064
9072
|
height: X,
|
|
9065
|
-
className: `${O} rounded-full object-cover flex-shrink-0 ${
|
|
9073
|
+
className: `${O} rounded-full object-cover flex-shrink-0 ${v}`,
|
|
9066
9074
|
style: L,
|
|
9067
9075
|
onError: () => w(!0)
|
|
9068
9076
|
},
|
|
@@ -9070,7 +9078,7 @@ function ys({
|
|
|
9070
9078
|
) : /* @__PURE__ */ t(
|
|
9071
9079
|
"span",
|
|
9072
9080
|
{
|
|
9073
|
-
className: `${O} ${vs(z)} ${ee} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${
|
|
9081
|
+
className: `${O} ${vs(z)} ${ee} rounded-full flex items-center justify-center font-black text-white uppercase flex-shrink-0 ${v}`,
|
|
9074
9082
|
style: L,
|
|
9075
9083
|
title: z,
|
|
9076
9084
|
children: Y
|
|
@@ -9086,7 +9094,7 @@ function ys({
|
|
|
9086
9094
|
/* @__PURE__ */ t(
|
|
9087
9095
|
"span",
|
|
9088
9096
|
{
|
|
9089
|
-
className: `min-w-0 truncate ${bs[
|
|
9097
|
+
className: `min-w-0 truncate ${bs[h]} font-medium text-[var(--text-main)] ${p}`,
|
|
9090
9098
|
title: z,
|
|
9091
9099
|
children: z
|
|
9092
9100
|
}
|
|
@@ -9094,12 +9102,12 @@ function ys({
|
|
|
9094
9102
|
]
|
|
9095
9103
|
}
|
|
9096
9104
|
);
|
|
9097
|
-
const E = c ?? !0,
|
|
9098
|
-
return E &&
|
|
9105
|
+
const E = c ?? !0, H = u ?? z;
|
|
9106
|
+
return E && H ? /* @__PURE__ */ t(
|
|
9099
9107
|
Ut,
|
|
9100
9108
|
{
|
|
9101
9109
|
as: "span",
|
|
9102
|
-
content:
|
|
9110
|
+
content: H,
|
|
9103
9111
|
className: `inline-flex flex-shrink-0 ${f}`,
|
|
9104
9112
|
children: J
|
|
9105
9113
|
}
|
|
@@ -9126,7 +9134,7 @@ function ks({
|
|
|
9126
9134
|
onLogout: f,
|
|
9127
9135
|
LinkComponent: p = ws
|
|
9128
9136
|
}) {
|
|
9129
|
-
const [
|
|
9137
|
+
const [h, x] = D(!1), v = Ns(r);
|
|
9130
9138
|
return /* @__PURE__ */ l("div", { className: "min-h-screen bg-[var(--bg-main)] text-[var(--text-main)]", children: [
|
|
9131
9139
|
/* @__PURE__ */ t(us, {}),
|
|
9132
9140
|
/* @__PURE__ */ t(
|
|
@@ -9139,7 +9147,7 @@ function ks({
|
|
|
9139
9147
|
children: /* @__PURE__ */ t(Ea, { className: "h-5 w-5" })
|
|
9140
9148
|
}
|
|
9141
9149
|
),
|
|
9142
|
-
|
|
9150
|
+
h && /* @__PURE__ */ t(
|
|
9143
9151
|
"button",
|
|
9144
9152
|
{
|
|
9145
9153
|
type: "button",
|
|
@@ -9151,7 +9159,7 @@ function ks({
|
|
|
9151
9159
|
/* @__PURE__ */ l(
|
|
9152
9160
|
"aside",
|
|
9153
9161
|
{
|
|
9154
|
-
className: `fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${
|
|
9162
|
+
className: `fixed inset-y-0 left-0 z-50 flex w-72 flex-col bg-[#071716] text-white shadow-2xl transition-transform duration-200 lg:translate-x-0 ${h ? "translate-x-0" : "-translate-x-full"}`,
|
|
9155
9163
|
children: [
|
|
9156
9164
|
/* @__PURE__ */ l("div", { className: "flex h-16 items-center gap-3 border-b border-white/10 px-4", children: [
|
|
9157
9165
|
/* @__PURE__ */ t("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-white/10 text-white", children: c ?? /* @__PURE__ */ t(Er, { className: "h-5 w-5" }) }),
|
|
@@ -9172,7 +9180,7 @@ function ks({
|
|
|
9172
9180
|
{
|
|
9173
9181
|
className: "sidebar-scroll min-h-0 flex-1 overflow-y-auto px-3 py-4",
|
|
9174
9182
|
"data-overlay-scroll": "true",
|
|
9175
|
-
children: Object.entries(
|
|
9183
|
+
children: Object.entries(v).map(([L, S]) => /* @__PURE__ */ l("div", { className: "mb-5", children: [
|
|
9176
9184
|
/* @__PURE__ */ l("div", { className: "mb-2 flex items-center gap-2 px-2 text-[11px] font-semibold uppercase tracking-wide text-white/35", children: [
|
|
9177
9185
|
/* @__PURE__ */ t(Xe, { className: "h-3.5 w-3.5" }),
|
|
9178
9186
|
L
|
|
@@ -9340,22 +9348,22 @@ function Tc({
|
|
|
9340
9348
|
breadcrumbs: m,
|
|
9341
9349
|
currentPath: f,
|
|
9342
9350
|
showBreadcrumbs: p = !0,
|
|
9343
|
-
contained:
|
|
9351
|
+
contained: h = !1,
|
|
9344
9352
|
LinkComponent: x = Ss
|
|
9345
9353
|
}) {
|
|
9346
|
-
const
|
|
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;
|
|
9347
9355
|
Q(() => {
|
|
9348
9356
|
f || k(window.location.pathname);
|
|
9349
9357
|
}, [f]), Q(() => {
|
|
9350
9358
|
ee(ha());
|
|
9351
9359
|
}, []), Q(() => {
|
|
9352
|
-
if (
|
|
9360
|
+
if (h) {
|
|
9353
9361
|
S(!1);
|
|
9354
9362
|
return;
|
|
9355
9363
|
}
|
|
9356
|
-
let J = null, E = 0,
|
|
9364
|
+
let J = null, E = 0, H = 0;
|
|
9357
9365
|
const U = () => {
|
|
9358
|
-
const W =
|
|
9366
|
+
const W = v.current, s = document.querySelector(
|
|
9359
9367
|
"[data-app-scroll='true']"
|
|
9360
9368
|
);
|
|
9361
9369
|
return (W == null ? void 0 : W.closest(".os-viewport")) ?? (W == null ? void 0 : W.closest(
|
|
@@ -9367,61 +9375,61 @@ function Tc({
|
|
|
9367
9375
|
}, oe = () => {
|
|
9368
9376
|
J == null || J.removeEventListener("scroll", _), J = U(), J.addEventListener("scroll", _, { passive: !0 }), _();
|
|
9369
9377
|
};
|
|
9370
|
-
return oe(), E = window.requestAnimationFrame(oe),
|
|
9371
|
-
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", _);
|
|
9372
9380
|
};
|
|
9373
|
-
}, [
|
|
9374
|
-
if (
|
|
9381
|
+
}, [h]), Q(() => {
|
|
9382
|
+
if (h) {
|
|
9375
9383
|
Y(null);
|
|
9376
9384
|
return;
|
|
9377
9385
|
}
|
|
9378
9386
|
let J = 0;
|
|
9379
|
-
const E = [],
|
|
9380
|
-
const
|
|
9387
|
+
const E = [], H = () => {
|
|
9388
|
+
const T = v.current, j = T == null ? void 0 : T.parentElement, B = document.querySelector(
|
|
9381
9389
|
"[data-app-scroll='true']"
|
|
9382
9390
|
), ne = tn(B) ?? B;
|
|
9383
|
-
if (!
|
|
9391
|
+
if (!T || !j || !ne) {
|
|
9384
9392
|
Y(null);
|
|
9385
9393
|
return;
|
|
9386
9394
|
}
|
|
9387
|
-
const ce = j.getBoundingClientRect(), pe = window.getComputedStyle(j), $ = ne.getBoundingClientRect(), ie = ne instanceof HTMLElement && ne.clientWidth > 0 ? ne.clientWidth : $.width,
|
|
9388
|
-
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),
|
|
9389
9397
|
width: Math.round(ie)
|
|
9390
9398
|
};
|
|
9391
9399
|
Y(
|
|
9392
|
-
(G) => G && G.marginLeft ===
|
|
9400
|
+
(G) => G && G.marginLeft === A.marginLeft && G.width === A.width ? G : A
|
|
9393
9401
|
);
|
|
9394
9402
|
}, U = () => {
|
|
9395
|
-
window.cancelAnimationFrame(J), J = window.requestAnimationFrame(
|
|
9403
|
+
window.cancelAnimationFrame(J), J = window.requestAnimationFrame(H);
|
|
9396
9404
|
};
|
|
9397
9405
|
U(), window.addEventListener("resize", U);
|
|
9398
|
-
const _ = new ResizeObserver(U), oe =
|
|
9406
|
+
const _ = new ResizeObserver(U), oe = v.current, W = oe == null ? void 0 : oe.parentElement, s = document.querySelector(
|
|
9399
9407
|
"[data-app-scroll='true']"
|
|
9400
|
-
),
|
|
9401
|
-
return [W, s,
|
|
9402
|
-
|
|
9408
|
+
), g = tn(s) ?? s;
|
|
9409
|
+
return [W, s, g].forEach((T) => {
|
|
9410
|
+
T && _.observe(T);
|
|
9403
9411
|
}), E.push(window.setTimeout(U, 120)), E.push(window.setTimeout(U, 280)), () => {
|
|
9404
|
-
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));
|
|
9405
9413
|
};
|
|
9406
|
-
}, [
|
|
9414
|
+
}, [h]);
|
|
9407
9415
|
const X = {
|
|
9408
9416
|
...z ? { marginLeft: z.marginLeft, width: z.width } : null,
|
|
9409
9417
|
"--page-header-control-height": L ? "34px" : "40px",
|
|
9410
9418
|
"--page-header-control-padding-x": L ? "10px" : "14px",
|
|
9411
9419
|
"--page-header-control-icon-left": L ? "10px" : "12px",
|
|
9412
|
-
background:
|
|
9420
|
+
background: h ? "var(--bg-card)" : L ? "color-mix(in srgb, var(--bg-main) 82%, transparent)" : "color-mix(in srgb, var(--bg-main) 58%, transparent)",
|
|
9413
9421
|
backdropFilter: "saturate(1.25) blur(18px)",
|
|
9414
9422
|
WebkitBackdropFilter: "saturate(1.25) blur(18px)",
|
|
9415
|
-
borderBottom:
|
|
9423
|
+
borderBottom: h || L ? "1px solid var(--border)" : "1px solid transparent",
|
|
9416
9424
|
boxShadow: L ? "0 10px 28px rgba(12, 54, 53, 0.12)" : "none"
|
|
9417
9425
|
};
|
|
9418
9426
|
return /* @__PURE__ */ t(
|
|
9419
9427
|
"div",
|
|
9420
9428
|
{
|
|
9421
|
-
ref:
|
|
9429
|
+
ref: v,
|
|
9422
9430
|
"data-page-header": "true",
|
|
9423
9431
|
"data-compact": L ? "true" : "false",
|
|
9424
|
-
className: `sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${
|
|
9432
|
+
className: `sticky top-0 z-30 overflow-visible py-0 transition-[background-color,box-shadow,border-color] duration-300 ease-out ${h ? "mb-0 flex-shrink-0" : "mb-4 sm:mb-0"} ${c}`,
|
|
9425
9433
|
style: X,
|
|
9426
9434
|
children: /* @__PURE__ */ l(
|
|
9427
9435
|
"div",
|
|
@@ -9443,7 +9451,7 @@ function Tc({
|
|
|
9443
9451
|
{
|
|
9444
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]"}`,
|
|
9445
9453
|
children: q.map((J, E) => {
|
|
9446
|
-
const
|
|
9454
|
+
const H = E === q.length - 1;
|
|
9447
9455
|
return /* @__PURE__ */ l(
|
|
9448
9456
|
"li",
|
|
9449
9457
|
{
|
|
@@ -9456,7 +9464,7 @@ function Tc({
|
|
|
9456
9464
|
style: { color: "var(--text-muted)" }
|
|
9457
9465
|
}
|
|
9458
9466
|
),
|
|
9459
|
-
J.href && !
|
|
9467
|
+
J.href && !H ? /* @__PURE__ */ t(
|
|
9460
9468
|
x,
|
|
9461
9469
|
{
|
|
9462
9470
|
href: J.href,
|
|
@@ -9467,10 +9475,10 @@ function Tc({
|
|
|
9467
9475
|
) : /* @__PURE__ */ t(
|
|
9468
9476
|
"span",
|
|
9469
9477
|
{
|
|
9470
|
-
"aria-current":
|
|
9471
|
-
className:
|
|
9478
|
+
"aria-current": H ? "page" : void 0,
|
|
9479
|
+
className: H ? "truncate font-semibold" : "truncate",
|
|
9472
9480
|
style: {
|
|
9473
|
-
color:
|
|
9481
|
+
color: H ? "var(--text-main)" : "var(--text-muted)"
|
|
9474
9482
|
},
|
|
9475
9483
|
children: J.label
|
|
9476
9484
|
}
|
|
@@ -9615,22 +9623,22 @@ function Dc({
|
|
|
9615
9623
|
return Q(() => {
|
|
9616
9624
|
if (!n) return;
|
|
9617
9625
|
const f = n;
|
|
9618
|
-
function p(
|
|
9626
|
+
function p(h) {
|
|
9619
9627
|
var L, S, w;
|
|
9620
|
-
if (
|
|
9621
|
-
if (((S =
|
|
9628
|
+
if (h.source !== ((L = c.current) == null ? void 0 : L.contentWindow) || m && h.origin !== m) return;
|
|
9629
|
+
if (((S = h.data) == null ? void 0 : S.type) === "prime-microservice:overlay") {
|
|
9622
9630
|
window.dispatchEvent(
|
|
9623
9631
|
new CustomEvent("prime-auth:microservice-overlay", {
|
|
9624
|
-
detail: { active: !!
|
|
9632
|
+
detail: { active: !!h.data.active }
|
|
9625
9633
|
})
|
|
9626
9634
|
);
|
|
9627
9635
|
return;
|
|
9628
9636
|
}
|
|
9629
|
-
if (((w =
|
|
9630
|
-
const x =
|
|
9637
|
+
if (((w = h.data) == null ? void 0 : w.type) !== "prime-microservice:navigation") return;
|
|
9638
|
+
const x = h.data.path;
|
|
9631
9639
|
if (!x || !x.startsWith("/") || x.startsWith("//")) return;
|
|
9632
|
-
const
|
|
9633
|
-
`${window.location.pathname}${window.location.search}${window.location.hash}` !==
|
|
9640
|
+
const v = `/apps/${encodeURIComponent(f)}${x}`;
|
|
9641
|
+
`${window.location.pathname}${window.location.search}${window.location.hash}` !== v && (window.history.replaceState(window.history.state, "", v), window.dispatchEvent(
|
|
9634
9642
|
new CustomEvent("prime-auth:microservice-navigation")
|
|
9635
9643
|
));
|
|
9636
9644
|
}
|
|
@@ -9726,7 +9734,7 @@ function Ic(e) {
|
|
|
9726
9734
|
(p) => a || r[p] ? e[p] : void 0,
|
|
9727
9735
|
[e, a, r]
|
|
9728
9736
|
), u = we((p) => {
|
|
9729
|
-
n((
|
|
9737
|
+
n((h) => ({ ...h, [p]: !0 }));
|
|
9730
9738
|
}, []), m = we(() => {
|
|
9731
9739
|
i(!0);
|
|
9732
9740
|
}, []), f = we(() => {
|