@frantsiles/components 0.0.0-stage → 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,4985 @@
1
+ import { jsx as i, jsxs as b, Fragment as R } from "react/jsx-runtime";
2
+ import { Disclosure as wt, DisclosureGroup as Ii, Button as W, DisclosurePanel as Bi, I18nProvider as Di, DialogTrigger as Ti, Pressable as Nt, ModalOverlay as Ai, Modal as $i, Dialog as ye, Calendar as Ct, Heading as Mi, CalendarGrid as Ei, CalendarGridHeader as Ri, CalendarHeaderCell as Li, CalendarGridBody as Pi, CalendarCell as ji, Popover as J, ListBox as Re, ListBoxItem as Gi, ListBoxSection as Oi, Header as zt, ComboBox as kt, Group as St, Input as Fi, PopoverContext as Hi, MenuContext as Ki, Menu as Ui, MenuItem as _i, MenuSection as qi, Separator as Vi, MenuTrigger as Wi, Checkbox as Xi, Table as Qi, Virtualizer as Yi, TableLayout as Zi, TableBody as Ji, Cell as Le, Column as It, useTableOptions as Bt, TableHeader as er, Row as tr, TableStateContext as ir, DatePicker as rr, DateInput as ar, DateSegment as nr, ComboBoxValue as sr, ComboBoxStateContext as or, Select as lr, SelectValue as dr, Tab as cr, TabList as ur, TabPanel as mr, Tabs as fr, UNSTABLE_ToastRegion as br, UNSTABLE_ToastQueue as gr, UNSTABLE_Toast as xr, UNSTABLE_ToastContent as pr, Text as rt, TooltipTrigger as hr, Focusable as vr, Tooltip as yr, OverlayArrow as wr, Tree as Nr, TreeItem as Cr, TreeItemContent as zr } from "react-aria-components";
3
+ import { cn as l, focusRing as T, fieldFocusRing as Dt } from "@frantsiles/core";
4
+ import { IconChevronDown as Y, IconX as ee, IconCircleAlert as we, IconTriangleAlert as Tt, IconCircleCheck as At, IconInfo as Me, IconExternalLink as kr, IconChevronRight as Pe, IconChevronLeft as $t, IconCheck as le, IconMinus as Mt, IconArrowDown as Et, IconArrowUp as Rt, IconArrowUpDown as Lt, IconPencil as Sr, IconCalendar as Ir, IconUpload as Br, IconFile as Dr, IconMenu as Pt, IconEyeOff as Tr, IconEye as Ar, IconSearch as $r } from "@frantsiles/icons";
5
+ import { use as B, useMemo as Ne, createContext as P, Children as te, isValidElement as je, useRef as M, useState as E, useLayoutEffect as jt, useId as L, useEffect as de, useCallback as Mr } from "react";
6
+ import { parseDate as xe, isToday as Er, getLocalTimeZone as Rr } from "@internationalized/date";
7
+ function Gt({ title: e, children: t, headingLevel: r = 3, className: a }) {
8
+ const n = `h${r}`;
9
+ return /* @__PURE__ */ b(R, { children: [
10
+ /* @__PURE__ */ i(n, { className: "m-0 text-ui-body font-ui-semibold", children: /* @__PURE__ */ b(
11
+ W,
12
+ {
13
+ slot: "trigger",
14
+ className: l(
15
+ "flex min-h-11 w-full cursor-pointer items-center justify-between gap-ui-sm rounded-sm py-ui-sm text-start text-ui-fg",
16
+ "hover:text-ui-fg-hover data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
17
+ T
18
+ ),
19
+ children: [
20
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: e }),
21
+ /* @__PURE__ */ i(Y, { className: "size-4 shrink-0 text-ui-fg-muted transition-transform duration-(--ui-duration-fast) ease-ui-standard group-data-expanded/section:rotate-180" })
22
+ ]
23
+ }
24
+ ) }),
25
+ /* @__PURE__ */ i(Bi, { className: l("text-ui-body-sm text-ui-fg", a), children: /* @__PURE__ */ i("div", { className: "pb-ui-md", children: t }) })
26
+ ] });
27
+ }
28
+ function dn({ open: e, defaultOpen: t, onOpenChange: r, disabled: a, className: n, ...s }) {
29
+ return /* @__PURE__ */ i(
30
+ wt,
31
+ {
32
+ ...e !== void 0 && { isExpanded: e },
33
+ ...t !== void 0 && { defaultExpanded: t },
34
+ ...r && { onExpandedChange: r },
35
+ ...a && { isDisabled: !0 },
36
+ className: l("group/section", n),
37
+ children: /* @__PURE__ */ i(Gt, { ...s })
38
+ }
39
+ );
40
+ }
41
+ function cn({ children: e, multiple: t = !1, value: r, defaultValue: a, onChange: n, disabled: s, className: o }) {
42
+ return /* @__PURE__ */ i(
43
+ Ii,
44
+ {
45
+ allowsMultipleExpanded: t,
46
+ ...r !== void 0 && { expandedKeys: r },
47
+ ...a !== void 0 && { defaultExpandedKeys: a },
48
+ ...n && { onExpandedChange: (d) => n(Array.from(d, String)) },
49
+ ...s && { isDisabled: !0 },
50
+ className: l("flex flex-col border-t border-ui-border", o),
51
+ children: e
52
+ }
53
+ );
54
+ }
55
+ function un({ value: e, disabled: t, className: r, ...a }) {
56
+ return /* @__PURE__ */ i(
57
+ wt,
58
+ {
59
+ id: e,
60
+ ...t && { isDisabled: !0 },
61
+ className: l("group/section border-b border-ui-border", r),
62
+ children: /* @__PURE__ */ i(Gt, { ...a })
63
+ }
64
+ );
65
+ }
66
+ const Ot = {
67
+ "alert.dismiss": "Cerrar aviso",
68
+ "alert.tone": (e) => ({
69
+ neutral: "Nota",
70
+ primary: "Información",
71
+ success: "Listo",
72
+ warning: "Advertencia",
73
+ danger: "Error"
74
+ })[e],
75
+ "alertDialog.cancel": "Cancelar",
76
+ "appShell.skipLink": "Saltar al contenido",
77
+ "breadcrumbs.label": "Ruta de navegación",
78
+ "calendar.next": "Mes siguiente",
79
+ "calendar.previous": "Mes anterior",
80
+ "combobox.empty": "Sin resultados",
81
+ "combobox.showOptions": "Mostrar opciones",
82
+ "dataGrid.cancel": "Cancelar",
83
+ "dataGrid.editHint": "Enter para editar",
84
+ "dataGrid.empty": "Sin datos",
85
+ "dataGrid.save": "Guardar",
86
+ "dataGrid.selectAll": "Seleccionar todo",
87
+ "dataGrid.selectRow": "Seleccionar",
88
+ "dataGrid.selection": "Selección",
89
+ "datePicker.open": "Abrir calendario",
90
+ "dialog.close": "Cerrar",
91
+ "fileUpload.choose": (e) => e ? "Elegir archivos" : "Elegir archivo",
92
+ "fileUpload.drop": (e) => e ? "o arrástralos aquí" : "o arrástralo aquí",
93
+ "fileUpload.remove": (e) => `Quitar ${e}`,
94
+ "fileUpload.selected": (e) => e === 0 ? "Ningún archivo elegido" : e === 1 ? "1 archivo elegido" : `${e} archivos elegidos`,
95
+ "footer.label": "Pie de página",
96
+ "label.optional": "(opcional)",
97
+ "listBox.empty": "Sin opciones",
98
+ "link.newTab": "(se abre en una pestaña nueva)",
99
+ "navBar.label": "Principal",
100
+ "navBar.toggle": "Menú",
101
+ "pagination.label": "Paginación",
102
+ "pagination.next": "Siguiente",
103
+ "pagination.page": (e) => `Página ${e}`,
104
+ "pagination.previous": "Anterior",
105
+ "passwordInput.show": "Mostrar contraseña",
106
+ "searchInput.clear": "Limpiar búsqueda",
107
+ "select.placeholder": "Elige una opción",
108
+ "sideNav.label": "Secciones",
109
+ "spinner.label": "Cargando",
110
+ "stepper.label": "Progreso",
111
+ "stepper.status": (e) => ({ complete: "completado", invalid: "con errores", upcoming: "pendiente" })[e],
112
+ "tag.remove": (e) => `Quitar ${e}`,
113
+ "tag.removeUnnamed": "Quitar",
114
+ "toast.close": "Cerrar notificación",
115
+ "toast.region": "Notificaciones",
116
+ "tree.collapse": "Contraer",
117
+ "tree.empty": "Sin elementos",
118
+ "tree.expand": "Expandir",
119
+ "tree.select": "Seleccionar"
120
+ }, Lr = {
121
+ "alert.dismiss": "Dismiss",
122
+ "alert.tone": (e) => ({
123
+ neutral: "Note",
124
+ primary: "Info",
125
+ success: "Success",
126
+ warning: "Warning",
127
+ danger: "Error"
128
+ })[e],
129
+ "alertDialog.cancel": "Cancel",
130
+ "appShell.skipLink": "Skip to content",
131
+ "breadcrumbs.label": "Breadcrumb",
132
+ "calendar.next": "Next month",
133
+ "calendar.previous": "Previous month",
134
+ "combobox.empty": "No results",
135
+ "combobox.showOptions": "Show options",
136
+ "dataGrid.cancel": "Cancel",
137
+ "dataGrid.editHint": "Press Enter to edit",
138
+ "dataGrid.empty": "No data",
139
+ "dataGrid.save": "Save",
140
+ "dataGrid.selectAll": "Select all",
141
+ "dataGrid.selectRow": "Select",
142
+ "dataGrid.selection": "Selection",
143
+ "datePicker.open": "Open calendar",
144
+ "dialog.close": "Close",
145
+ "fileUpload.choose": (e) => e ? "Choose files" : "Choose file",
146
+ "fileUpload.drop": (e) => e ? "or drop them here" : "or drop it here",
147
+ "fileUpload.remove": (e) => `Remove ${e}`,
148
+ "fileUpload.selected": (e) => e === 0 ? "No files chosen" : e === 1 ? "1 file chosen" : `${e} files chosen`,
149
+ "footer.label": "Footer",
150
+ "label.optional": "(optional)",
151
+ "listBox.empty": "No options",
152
+ "link.newTab": "(opens in a new tab)",
153
+ "navBar.label": "Main",
154
+ "navBar.toggle": "Menu",
155
+ "pagination.label": "Pagination",
156
+ "pagination.next": "Next",
157
+ "pagination.page": (e) => `Page ${e}`,
158
+ "pagination.previous": "Previous",
159
+ "passwordInput.show": "Show password",
160
+ "searchInput.clear": "Clear search",
161
+ "select.placeholder": "Select an option",
162
+ "sideNav.label": "Sections",
163
+ "spinner.label": "Loading",
164
+ "stepper.label": "Progress",
165
+ "stepper.status": (e) => ({ complete: "completed", invalid: "has errors", upcoming: "not started" })[e],
166
+ "tag.remove": (e) => `Remove ${e}`,
167
+ "tag.removeUnnamed": "Remove",
168
+ "toast.close": "Close notification",
169
+ "toast.region": "Notifications",
170
+ "tree.collapse": "Collapse",
171
+ "tree.empty": "No items",
172
+ "tree.expand": "Expand",
173
+ "tree.select": "Select"
174
+ }, at = { es: Ot, en: Lr }, De = "es";
175
+ function Ft(e) {
176
+ const t = e.toLowerCase().split("-")[0] ?? "";
177
+ return at[e] ?? at[t] ?? Ot;
178
+ }
179
+ const Pr = /* @__PURE__ */ new Set([
180
+ "ar",
181
+ "arc",
182
+ "ckb",
183
+ "dv",
184
+ "fa",
185
+ "he",
186
+ "ps",
187
+ "sd",
188
+ "ug",
189
+ "ur",
190
+ "yi"
191
+ ]);
192
+ function Ht(e) {
193
+ const t = e.toLowerCase().split("-")[0] ?? "";
194
+ return Pr.has(t) ? "rtl" : "ltr";
195
+ }
196
+ const pe = P({
197
+ locale: De,
198
+ direction: Ht(De),
199
+ messages: Ft(De),
200
+ overrides: {}
201
+ });
202
+ function mn({ locale: e, messages: t, children: r }) {
203
+ const a = B(pe), n = e ?? a.locale, s = Ne(() => {
204
+ const d = { ...n === a.locale ? a.overrides : {}, ...t };
205
+ return {
206
+ locale: n,
207
+ direction: Ht(n),
208
+ messages: { ...Ft(n), ...d },
209
+ overrides: d
210
+ };
211
+ }, [n, t, a.locale, a.overrides]);
212
+ return /* @__PURE__ */ i(pe, { value: s, children: /* @__PURE__ */ i(Di, { locale: n, children: r }) });
213
+ }
214
+ function Kt() {
215
+ const { locale: e, direction: t } = B(pe);
216
+ return { locale: e, direction: t };
217
+ }
218
+ function I() {
219
+ return B(pe).messages;
220
+ }
221
+ function X({ className: e, ...t }) {
222
+ return /* @__PURE__ */ i("span", { className: l("sr-only", e), ...t });
223
+ }
224
+ const jr = {
225
+ sm: "size-4",
226
+ md: "size-5",
227
+ lg: "size-8"
228
+ };
229
+ function Gr({
230
+ size: e = "md",
231
+ label: t,
232
+ decorative: r = !1,
233
+ className: a,
234
+ ...n
235
+ }) {
236
+ const s = I(), o = r ? { "aria-hidden": !0 } : { role: "progressbar", "aria-label": t ?? s["spinner.label"] };
237
+ return /* @__PURE__ */ i(
238
+ "span",
239
+ {
240
+ "data-slot": "spinner",
241
+ className: l("inline-flex shrink-0", jr[e], a),
242
+ ...o,
243
+ ...n,
244
+ children: /* @__PURE__ */ b(
245
+ "svg",
246
+ {
247
+ viewBox: "0 0 24 24",
248
+ fill: "none",
249
+ className: "size-full animate-spin motion-reduce:[animation-duration:3s]",
250
+ "aria-hidden": "true",
251
+ focusable: "false",
252
+ children: [
253
+ /* @__PURE__ */ i("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: "0.25" }),
254
+ /* @__PURE__ */ i("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round" })
255
+ ]
256
+ }
257
+ )
258
+ }
259
+ );
260
+ }
261
+ const Ut = P({}), Or = {
262
+ neutral: "bg-ui-fg enabled:hover:bg-ui-fg-hover",
263
+ primary: "bg-ui-primary enabled:hover:bg-ui-primary-hover",
264
+ success: "bg-ui-success enabled:hover:bg-ui-success-hover",
265
+ warning: "bg-ui-warning enabled:hover:bg-ui-warning-hover",
266
+ danger: "bg-ui-danger enabled:hover:bg-ui-danger-hover"
267
+ }, Fr = {
268
+ neutral: "border-ui-border text-ui-fg enabled:hover:bg-ui-surface-muted",
269
+ primary: "border-ui-primary text-ui-primary enabled:hover:bg-ui-primary-soft",
270
+ success: "border-ui-success text-ui-success enabled:hover:bg-ui-success-soft",
271
+ warning: "border-ui-warning text-ui-warning enabled:hover:bg-ui-warning-soft",
272
+ danger: "border-ui-danger text-ui-danger enabled:hover:bg-ui-danger-soft"
273
+ }, Hr = {
274
+ neutral: "text-ui-fg enabled:hover:bg-ui-surface-muted",
275
+ primary: "text-ui-primary enabled:hover:bg-ui-primary-soft",
276
+ success: "text-ui-success enabled:hover:bg-ui-success-soft",
277
+ warning: "text-ui-warning enabled:hover:bg-ui-warning-soft",
278
+ danger: "text-ui-danger enabled:hover:bg-ui-danger-soft"
279
+ }, Kr = {
280
+ // Borde transparente: en colores forzados el navegador lo pinta y el botón conserva su forma
281
+ solid: (e) => l("border-transparent text-ui-surface", Or[e]),
282
+ outline: (e) => l("bg-transparent", Fr[e]),
283
+ ghost: (e) => l("border-transparent bg-transparent", Hr[e])
284
+ }, Ur = {
285
+ solid: "disabled:bg-ui-surface-disabled disabled:text-ui-fg-disabled",
286
+ outline: "disabled:border-ui-border-subtle disabled:text-ui-fg-disabled",
287
+ ghost: "disabled:text-ui-fg-disabled"
288
+ }, _r = { sm: "sm", md: "sm", lg: "md" }, qr = {
289
+ sm: "min-h-ui-control-sm gap-1.5 px-3 text-ui-label",
290
+ md: "min-h-ui-control-md gap-2 px-4 text-ui-label",
291
+ lg: "min-h-ui-control-lg gap-2 px-5 text-ui-body font-ui-medium"
292
+ };
293
+ function _t(e, t) {
294
+ return l(
295
+ "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-md border select-none",
296
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
297
+ "disabled:cursor-not-allowed data-loading:cursor-wait",
298
+ Kr[e](t),
299
+ Ur[e],
300
+ T
301
+ );
302
+ }
303
+ function qt({ size: e, variant: t, tone: r, disabled: a }, n = { variant: "solid", tone: "primary" }) {
304
+ const s = B(Ut);
305
+ return {
306
+ size: e ?? s.size ?? "md",
307
+ variant: t ?? s.variant ?? n.variant,
308
+ tone: r ?? s.tone ?? n.tone,
309
+ disabled: a ?? s.disabled ?? !1
310
+ };
311
+ }
312
+ function ne({
313
+ variant: e,
314
+ tone: t,
315
+ size: r,
316
+ disabled: a,
317
+ startIcon: n,
318
+ endIcon: s,
319
+ loading: o = !1,
320
+ loadingLabel: d,
321
+ type: c = "button",
322
+ className: m,
323
+ children: u,
324
+ onClick: f,
325
+ ...g
326
+ }) {
327
+ const x = I(), { size: p, variant: y, tone: v, disabled: h } = qt({
328
+ size: r,
329
+ variant: e,
330
+ tone: t,
331
+ disabled: a
332
+ }), N = /* @__PURE__ */ b(R, { children: [
333
+ n && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0", children: n }),
334
+ u,
335
+ s && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0", children: s })
336
+ ] }), C = (S) => {
337
+ if (o) {
338
+ S.preventDefault();
339
+ return;
340
+ }
341
+ f?.(S);
342
+ };
343
+ return /* @__PURE__ */ i(
344
+ "button",
345
+ {
346
+ type: c,
347
+ disabled: h,
348
+ "aria-disabled": o && !h ? !0 : void 0,
349
+ "data-loading": o ? "" : void 0,
350
+ className: l(
351
+ _t(y, v),
352
+ qr[p],
353
+ o && "relative",
354
+ m
355
+ ),
356
+ onClick: C,
357
+ ...g,
358
+ children: o ? /* @__PURE__ */ b(R, { children: [
359
+ /* @__PURE__ */ i("span", { className: "inline-flex items-center gap-[inherit] opacity-0", children: N }),
360
+ /* @__PURE__ */ i("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ i(Gr, { decorative: !0, size: _r[p] }) }),
361
+ " ",
362
+ /* @__PURE__ */ i(X, { children: d ?? x["spinner.label"] })
363
+ ] }) : N
364
+ }
365
+ );
366
+ }
367
+ const Vr = {
368
+ sm: "size-ui-control-sm [&_svg]:size-4",
369
+ md: "size-ui-control-md [&_svg]:size-5",
370
+ lg: "size-ui-control-lg [&_svg]:size-6"
371
+ };
372
+ function Ce({
373
+ label: e,
374
+ variant: t,
375
+ tone: r,
376
+ size: a,
377
+ disabled: n,
378
+ type: s = "button",
379
+ className: o,
380
+ children: d,
381
+ ...c
382
+ }) {
383
+ const m = qt(
384
+ { size: a, variant: t, tone: r, disabled: n },
385
+ { variant: "ghost", tone: "neutral" }
386
+ );
387
+ return /* @__PURE__ */ i(
388
+ "button",
389
+ {
390
+ type: s,
391
+ "aria-label": e,
392
+ disabled: m.disabled,
393
+ className: l(
394
+ _t(m.variant, m.tone),
395
+ "p-0",
396
+ Vr[m.size],
397
+ o
398
+ ),
399
+ ...c,
400
+ children: /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex", children: d })
401
+ }
402
+ );
403
+ }
404
+ const nt = {
405
+ neutral: { box: "bg-ui-surface-muted border-ui-border-subtle", icon: "text-ui-fg" },
406
+ primary: { box: "bg-ui-primary-soft border-ui-primary/40", icon: "text-ui-primary" },
407
+ success: { box: "bg-ui-success-soft border-ui-success/40", icon: "text-ui-success" },
408
+ warning: { box: "bg-ui-warning-soft border-ui-warning/40", icon: "text-ui-warning" },
409
+ danger: { box: "bg-ui-danger-soft border-ui-danger/40", icon: "text-ui-danger" }
410
+ }, Wr = {
411
+ neutral: /* @__PURE__ */ i(Me, {}),
412
+ primary: /* @__PURE__ */ i(Me, {}),
413
+ success: /* @__PURE__ */ i(At, {}),
414
+ warning: /* @__PURE__ */ i(Tt, {}),
415
+ danger: /* @__PURE__ */ i(we, {})
416
+ }, Xr = {
417
+ inline: "rounded-md border",
418
+ banner: "border-y"
419
+ };
420
+ function fn({
421
+ tone: e = "primary",
422
+ variant: t = "inline",
423
+ title: r,
424
+ children: a,
425
+ actions: n,
426
+ icon: s,
427
+ onDismiss: o,
428
+ dismissLabel: d,
429
+ toneLabel: c,
430
+ className: m,
431
+ ...u
432
+ }) {
433
+ const f = I(), g = c ?? f["alert.tone"](e);
434
+ return /* @__PURE__ */ b(
435
+ "div",
436
+ {
437
+ "data-tone": e,
438
+ className: l(
439
+ "flex items-start gap-3 px-4 py-3 text-ui-body-sm text-ui-fg",
440
+ Xr[t],
441
+ nt[e].box,
442
+ m
443
+ ),
444
+ ...u,
445
+ children: [
446
+ /* @__PURE__ */ i(
447
+ "span",
448
+ {
449
+ "aria-hidden": "true",
450
+ className: l("inline-flex h-[1lh] shrink-0 items-center [&_svg]:size-5", nt[e].icon),
451
+ children: s ?? Wr[e]
452
+ }
453
+ ),
454
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
455
+ r ? /* @__PURE__ */ b("p", { className: "font-ui-semibold", children: [
456
+ /* @__PURE__ */ b(X, { children: [
457
+ g,
458
+ ": "
459
+ ] }),
460
+ r
461
+ ] }) : /* @__PURE__ */ b(X, { children: [
462
+ g,
463
+ ": "
464
+ ] }),
465
+ a && /* @__PURE__ */ i("div", { children: a }),
466
+ n && /* @__PURE__ */ i("div", { className: "mt-2 flex flex-wrap gap-2", children: n })
467
+ ] }),
468
+ o && /* @__PURE__ */ i(
469
+ Ce,
470
+ {
471
+ size: "sm",
472
+ label: d ?? f["alert.dismiss"],
473
+ onClick: o,
474
+ className: "-my-1.5 -me-2",
475
+ children: /* @__PURE__ */ i(ee, {})
476
+ }
477
+ )
478
+ ]
479
+ }
480
+ );
481
+ }
482
+ const Qr = {
483
+ sm: "text-ui-heading-sm",
484
+ md: "text-ui-heading-md",
485
+ lg: "text-ui-heading-lg",
486
+ xl: "text-ui-heading-xl",
487
+ display: "text-ui-display"
488
+ }, Yr = {
489
+ 1: "xl",
490
+ 2: "lg",
491
+ 3: "md",
492
+ 4: "sm",
493
+ 5: "sm",
494
+ 6: "sm"
495
+ };
496
+ function ce({ level: e, size: t, className: r, ...a }) {
497
+ const n = `h${e}`;
498
+ return /* @__PURE__ */ i(
499
+ n,
500
+ {
501
+ className: l(
502
+ "m-0 text-ui-fg text-balance",
503
+ Qr[t ?? Yr[e]],
504
+ r
505
+ ),
506
+ ...a
507
+ }
508
+ );
509
+ }
510
+ function Vt({ children: e, open: t, defaultOpen: r, onOpenChange: a }) {
511
+ const [n, ...s] = te.toArray(e);
512
+ return /* @__PURE__ */ b(
513
+ Ti,
514
+ {
515
+ ...t !== void 0 && { isOpen: t },
516
+ ...r !== void 0 && { defaultOpen: r },
517
+ ...a && { onOpenChange: a },
518
+ children: [
519
+ je(n) ? /* @__PURE__ */ i(Nt, { children: n }) : n,
520
+ s
521
+ ]
522
+ }
523
+ );
524
+ }
525
+ function q(...e) {
526
+ return (t) => {
527
+ for (const r of e)
528
+ typeof r == "function" ? r(t) : r && (r.current = t);
529
+ };
530
+ }
531
+ const Zr = {
532
+ vertical: "overflow-y-auto [scrollbar-gutter:stable]",
533
+ horizontal: "overflow-x-auto",
534
+ both: "overflow-auto"
535
+ };
536
+ function Wt({
537
+ orientation: e = "vertical",
538
+ maxHeight: t,
539
+ className: r,
540
+ style: a,
541
+ ref: n,
542
+ ...s
543
+ }) {
544
+ const o = M(null), [d, c] = E(!0);
545
+ jt(() => {
546
+ const u = o.current;
547
+ if (!u || typeof ResizeObserver > "u") return;
548
+ const f = () => c(
549
+ u.scrollHeight > u.clientHeight || u.scrollWidth > u.clientWidth
550
+ ), g = new ResizeObserver(f), x = () => {
551
+ g.disconnect(), g.observe(u);
552
+ for (const y of Array.from(u.children)) g.observe(y);
553
+ }, p = new MutationObserver(() => {
554
+ x(), f();
555
+ });
556
+ return x(), f(), p.observe(u, { childList: !0, subtree: !0, characterData: !0 }), () => {
557
+ g.disconnect(), p.disconnect();
558
+ };
559
+ }, []);
560
+ const m = t ? { maxHeight: t, ...a } : a;
561
+ return /* @__PURE__ */ i(
562
+ "div",
563
+ {
564
+ ref: q(o, n),
565
+ role: "region",
566
+ tabIndex: d ? 0 : void 0,
567
+ style: m,
568
+ className: l("min-w-0 overscroll-contain", Zr[e], T, r),
569
+ ...s
570
+ }
571
+ );
572
+ }
573
+ function bn(e) {
574
+ return /* @__PURE__ */ i(Vt, { ...e });
575
+ }
576
+ const Xt = P(null), Jr = {
577
+ sm: "max-w-(--container-ui-sm)",
578
+ md: "max-w-(--container-ui-md)",
579
+ lg: "max-w-(--container-ui-lg)"
580
+ };
581
+ function ea(e) {
582
+ return {
583
+ overlay: "items-center justify-center p-ui-md",
584
+ panel: l(
585
+ "max-h-full w-full rounded-lg border",
586
+ "transition-[opacity,scale] data-entering:scale-95 data-exiting:scale-95",
587
+ Jr[e]
588
+ ),
589
+ dialog: "rounded-lg"
590
+ };
591
+ }
592
+ function gn(e) {
593
+ return /* @__PURE__ */ i(Ge, { ...e });
594
+ }
595
+ function Ge({
596
+ children: e,
597
+ title: t,
598
+ headingLevel: r = 2,
599
+ description: a,
600
+ size: n = "md",
601
+ dismissable: s = !0,
602
+ closeButton: o = !0,
603
+ closeLabel: d,
604
+ open: c,
605
+ defaultOpen: m,
606
+ onOpenChange: u,
607
+ className: f,
608
+ ref: g,
609
+ role: x = "dialog",
610
+ describedBy: p,
611
+ layout: y = ea(n),
612
+ "aria-label": v
613
+ }) {
614
+ const h = I(), N = L(), C = L(), S = v ? { "aria-label": v } : { "aria-labelledby": N }, z = p ?? (a != null ? C : void 0);
615
+ return /* @__PURE__ */ i(
616
+ Ai,
617
+ {
618
+ isDismissable: s,
619
+ ...c !== void 0 && { isOpen: c },
620
+ ...m !== void 0 && { defaultOpen: m },
621
+ ...u && { onOpenChange: u },
622
+ className: l(
623
+ // dvh: en móviles no queda tapado por la barra del navegador
624
+ "fixed inset-0 z-(--ui-z-modal) flex h-dvh bg-ui-overlay",
625
+ "transition-opacity duration-(--ui-duration-slow) ease-ui-enter data-entering:opacity-0 data-exiting:opacity-0 data-exiting:ease-ui-exit",
626
+ y.overlay
627
+ ),
628
+ children: /* @__PURE__ */ i(
629
+ $i,
630
+ {
631
+ className: l(
632
+ "flex border-ui-border-subtle bg-ui-surface-raised text-ui-fg shadow-ui-modal",
633
+ "duration-(--ui-duration-slow) ease-ui-enter data-exiting:ease-ui-exit",
634
+ y.panel,
635
+ f
636
+ ),
637
+ children: /* @__PURE__ */ i(
638
+ ye,
639
+ {
640
+ ref: g,
641
+ role: x,
642
+ ...S,
643
+ ...z && { "aria-describedby": z },
644
+ className: l("flex min-h-0 w-full flex-col", y.dialog, T),
645
+ children: ({ close: w }) => /* @__PURE__ */ b(Xt, { value: S, children: [
646
+ /* @__PURE__ */ b("div", { className: "flex items-start gap-ui-md px-ui-lg pt-ui-lg pb-ui-md", children: [
647
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 flex-col gap-ui-xs", children: [
648
+ t != null && /* @__PURE__ */ i(ce, { level: r, size: "md", id: N, children: t }),
649
+ a != null && /* @__PURE__ */ i("p", { id: C, className: "m-0 text-ui-body-sm text-ui-fg-muted", children: a })
650
+ ] }),
651
+ o && /* @__PURE__ */ i(
652
+ Ce,
653
+ {
654
+ size: "sm",
655
+ variant: "ghost",
656
+ label: d ?? h["dialog.close"],
657
+ onClick: w,
658
+ className: "-me-ui-xs -mt-ui-xs",
659
+ children: /* @__PURE__ */ i(ee, {})
660
+ }
661
+ )
662
+ ] }),
663
+ typeof e == "function" ? e({ close: w }) : e
664
+ ] })
665
+ }
666
+ )
667
+ }
668
+ )
669
+ }
670
+ );
671
+ }
672
+ function Qt({ className: e, ...t }) {
673
+ const r = B(Xt) ?? { "aria-label": "" };
674
+ return /* @__PURE__ */ i(
675
+ Wt,
676
+ {
677
+ ...r,
678
+ className: l("min-h-0 flex-1 px-ui-lg pb-ui-lg text-ui-body", e),
679
+ ...t
680
+ }
681
+ );
682
+ }
683
+ const ta = {
684
+ start: "justify-start",
685
+ end: "justify-end",
686
+ between: "justify-between"
687
+ };
688
+ function ia({ align: e = "end", className: t, ...r }) {
689
+ return /* @__PURE__ */ i(
690
+ "div",
691
+ {
692
+ className: l(
693
+ "flex flex-wrap items-center gap-ui-sm border-t border-ui-border-subtle px-ui-lg py-ui-md",
694
+ ta[e],
695
+ t
696
+ ),
697
+ ...r
698
+ }
699
+ );
700
+ }
701
+ function xn({
702
+ title: e,
703
+ children: t,
704
+ confirmLabel: r,
705
+ cancelLabel: a,
706
+ tone: n = "danger",
707
+ onConfirm: s,
708
+ headingLevel: o,
709
+ open: d,
710
+ defaultOpen: c,
711
+ onOpenChange: m,
712
+ className: u,
713
+ ref: f
714
+ }) {
715
+ const g = I(), x = L(), [p, y] = E(!1);
716
+ return /* @__PURE__ */ i(
717
+ Ge,
718
+ {
719
+ role: "alertdialog",
720
+ title: e,
721
+ headingLevel: o,
722
+ describedBy: x,
723
+ size: "sm",
724
+ dismissable: !1,
725
+ closeButton: !1,
726
+ open: d,
727
+ defaultOpen: c,
728
+ onOpenChange: m,
729
+ className: u,
730
+ ref: f,
731
+ children: ({ close: v }) => {
732
+ const h = async () => {
733
+ y(!0);
734
+ try {
735
+ await s(), v();
736
+ } catch {
737
+ } finally {
738
+ y(!1);
739
+ }
740
+ };
741
+ return /* @__PURE__ */ b(R, { children: [
742
+ /* @__PURE__ */ i(Qt, { children: /* @__PURE__ */ i("div", { id: x, children: t }) }),
743
+ /* @__PURE__ */ b(ia, { children: [
744
+ /* @__PURE__ */ i(ne, { variant: "ghost", autoFocus: !0, onClick: v, children: a ?? g["alertDialog.cancel"] }),
745
+ /* @__PURE__ */ i(ne, { tone: n, loading: p, onClick: () => {
746
+ h();
747
+ }, children: r })
748
+ ] })
749
+ ] });
750
+ }
751
+ }
752
+ );
753
+ }
754
+ const Yt = P(null);
755
+ function pn({
756
+ children: e,
757
+ header: t,
758
+ sidebar: r,
759
+ footer: a,
760
+ skipLinkLabel: n,
761
+ mainClassName: s,
762
+ className: o
763
+ }) {
764
+ const d = I(), c = L();
765
+ return /* @__PURE__ */ i(Yt, { value: { sidebar: r ?? null }, children: /* @__PURE__ */ b(
766
+ "div",
767
+ {
768
+ className: l(
769
+ "flex min-h-dvh flex-col bg-ui-surface text-ui-fg",
770
+ o
771
+ ),
772
+ children: [
773
+ /* @__PURE__ */ i(
774
+ "a",
775
+ {
776
+ href: `#${c}`,
777
+ className: l(
778
+ "sr-only focus:not-sr-only focus:fixed focus:start-ui-sm focus:top-ui-sm focus:z-(--ui-z-toast)",
779
+ "focus:rounded-md focus:bg-ui-surface-raised focus:px-ui-md focus:py-ui-sm focus:shadow-ui-overlay",
780
+ "text-ui-label font-ui-semibold text-ui-primary underline",
781
+ T
782
+ ),
783
+ children: n ?? d["appShell.skipLink"]
784
+ }
785
+ ),
786
+ t,
787
+ /* @__PURE__ */ b("div", { className: "flex flex-1", children: [
788
+ r && // En angostas está en el Drawer del Header
789
+ /* @__PURE__ */ i("div", { className: "hidden w-64 shrink-0 border-e border-ui-border-subtle p-ui-sm ui-md:block", children: r }),
790
+ /* @__PURE__ */ i(
791
+ "main",
792
+ {
793
+ id: c,
794
+ className: l("min-w-0 flex-1 p-ui-lg", s),
795
+ children: e
796
+ }
797
+ )
798
+ ] }),
799
+ a
800
+ ]
801
+ }
802
+ ) });
803
+ }
804
+ const ra = {
805
+ sm: "size-6 text-ui-caption",
806
+ md: "size-8 text-ui-label",
807
+ lg: "size-10 text-ui-body"
808
+ };
809
+ function aa(e, t) {
810
+ const r = e.trim().split(/\s+/).filter(Boolean), a = r[0], n = r.length > 1 ? r[r.length - 1] : void 0, s = (o) => o ? Array.from(o)[0] ?? "" : "";
811
+ return (s(a) + s(n)).toLocaleUpperCase(t);
812
+ }
813
+ function hn({
814
+ name: e,
815
+ src: t,
816
+ size: r = "md",
817
+ decorative: a = !1,
818
+ className: n,
819
+ ...s
820
+ }) {
821
+ const { locale: o } = Kt(), [d, c] = E(), m = !!t && d !== t, u = a ? { "aria-hidden": !0 } : { role: "img", "aria-label": e };
822
+ return /* @__PURE__ */ b(
823
+ "span",
824
+ {
825
+ "data-slot": "avatar",
826
+ className: l(
827
+ "relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full select-none",
828
+ "border border-ui-border-subtle bg-ui-surface-muted font-ui-semibold text-ui-fg",
829
+ ra[r],
830
+ n
831
+ ),
832
+ ...u,
833
+ ...s,
834
+ children: [
835
+ /* @__PURE__ */ i("span", { "aria-hidden": "true", children: aa(e, o) }),
836
+ m && /* @__PURE__ */ i(
837
+ "img",
838
+ {
839
+ src: t,
840
+ alt: "",
841
+ className: "absolute inset-0 size-full object-cover",
842
+ onError: () => c(t)
843
+ }
844
+ )
845
+ ]
846
+ }
847
+ );
848
+ }
849
+ const Zt = {
850
+ neutral: "bg-ui-surface-muted text-ui-fg border-ui-border-subtle",
851
+ primary: "bg-ui-primary-soft text-ui-primary border-current/30",
852
+ success: "bg-ui-success-soft text-ui-success border-current/30",
853
+ warning: "bg-ui-warning-soft text-ui-warning border-current/30",
854
+ danger: "bg-ui-danger-soft text-ui-danger border-current/30"
855
+ };
856
+ function vn({
857
+ children: e,
858
+ tone: t = "neutral",
859
+ srText: r,
860
+ className: a,
861
+ ...n
862
+ }) {
863
+ return /* @__PURE__ */ b(
864
+ "span",
865
+ {
866
+ className: l(
867
+ "inline-flex min-h-5 min-w-5 items-center justify-center rounded-full border px-1.5 text-ui-caption font-ui-semibold tabular-nums",
868
+ Zt[t],
869
+ a
870
+ ),
871
+ ...n,
872
+ children: [
873
+ e,
874
+ r && /* @__PURE__ */ b(R, { children: [
875
+ " ",
876
+ /* @__PURE__ */ i(X, { children: r })
877
+ ] })
878
+ ]
879
+ }
880
+ );
881
+ }
882
+ const na = {
883
+ primary: "text-ui-primary hover:text-ui-primary-hover",
884
+ neutral: "text-ui-fg hover:text-ui-fg-hover"
885
+ };
886
+ function Jt({
887
+ tone: e = "primary",
888
+ external: t = !1,
889
+ newTabLabel: r,
890
+ className: a,
891
+ children: n,
892
+ target: s,
893
+ rel: o,
894
+ ...d
895
+ }) {
896
+ const c = I();
897
+ return /* @__PURE__ */ b(
898
+ "a",
899
+ {
900
+ target: t ? "_blank" : s,
901
+ rel: t ? ["noopener", "noreferrer", o].filter(Boolean).join(" ") : o,
902
+ className: l(
903
+ "cursor-pointer rounded-xs underline decoration-1 underline-offset-[0.2em]",
904
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard hover:decoration-2",
905
+ na[e],
906
+ T,
907
+ a
908
+ ),
909
+ ...d,
910
+ children: [
911
+ n,
912
+ t && /* @__PURE__ */ b(R, { children: [
913
+ /* @__PURE__ */ i(kr, { className: "ms-0.5 inline-block align-[-0.125em]" }),
914
+ " ",
915
+ /* @__PURE__ */ i(X, { children: r ?? c["link.newTab"] })
916
+ ] })
917
+ ]
918
+ }
919
+ );
920
+ }
921
+ const ei = P(!1);
922
+ function yn({ children: e, className: t, "aria-label": r, ...a }) {
923
+ const n = I(), s = te.toArray(e);
924
+ return /* @__PURE__ */ i("nav", { "aria-label": r ?? n["breadcrumbs.label"], className: t, ...a, children: /* @__PURE__ */ i("ol", { className: "flex flex-wrap items-center gap-x-ui-xs gap-y-1 text-ui-body-sm text-ui-fg-muted", children: s.map((o, d) => {
925
+ const c = d === s.length - 1;
926
+ return /* @__PURE__ */ b("li", { className: "inline-flex min-w-0 items-center gap-x-ui-xs", children: [
927
+ /* @__PURE__ */ i(ei, { value: c, children: o }),
928
+ !c && /* @__PURE__ */ i(Pe, { className: "size-4 shrink-0 rtl:-scale-x-100" })
929
+ ] }, d);
930
+ }) }) });
931
+ }
932
+ function wn({ href: e, children: t, className: r }) {
933
+ const a = B(ei);
934
+ return a || e === void 0 ? /* @__PURE__ */ i(
935
+ "span",
936
+ {
937
+ ...a && { "aria-current": "page" },
938
+ className: l("truncate", a && "font-ui-medium text-ui-fg", r),
939
+ children: t
940
+ }
941
+ ) : (
942
+ // Área táctil: el enlace ocupa al menos 24 px de alto (WCAG 2.5.8)
943
+ /* @__PURE__ */ i(Jt, { href: e, tone: "neutral", className: l("inline-flex min-h-6 items-center truncate", r), children: t })
944
+ );
945
+ }
946
+ const sa = {
947
+ horizontal: "[&>*:not(:first-child)]:-ms-px [&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",
948
+ vertical: "[&>*:not(:first-child)]:-mt-px [&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"
949
+ };
950
+ function Nn({
951
+ attached: e = !1,
952
+ orientation: t = "horizontal",
953
+ size: r,
954
+ variant: a,
955
+ tone: n,
956
+ disabled: s,
957
+ className: o,
958
+ ...d
959
+ }) {
960
+ const c = Ne(
961
+ () => ({ size: r, variant: a, tone: n, disabled: s }),
962
+ [r, a, n, s]
963
+ );
964
+ return /* @__PURE__ */ i(Ut, { value: c, children: /* @__PURE__ */ i(
965
+ "div",
966
+ {
967
+ role: "group",
968
+ "data-orientation": t,
969
+ className: l(
970
+ "inline-flex",
971
+ t === "vertical" ? "flex-col items-stretch" : "flex-row flex-wrap",
972
+ // Al pegar los botones, el enfocado o con hover queda encima para que se vea su borde y su anillo
973
+ e ? l(sa[t], "[&>*]:relative [&>*:focus-visible]:z-10 [&>*:hover]:z-10") : "gap-2",
974
+ o
975
+ ),
976
+ ...d
977
+ }
978
+ ) });
979
+ }
980
+ function he(e) {
981
+ return e == null ? e : xe(e);
982
+ }
983
+ function Oe(e) {
984
+ return e.toString().slice(0, 10);
985
+ }
986
+ function ti({
987
+ min: e,
988
+ max: t,
989
+ unavailable: r
990
+ }) {
991
+ return {
992
+ ...e && { minValue: xe(e) },
993
+ ...t && { maxValue: xe(t) },
994
+ ...r && {
995
+ isDateUnavailable: (a) => r(Oe(a))
996
+ }
997
+ };
998
+ }
999
+ const st = l(
1000
+ "inline-flex size-8 cursor-pointer items-center justify-center rounded-md text-ui-fg-muted",
1001
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
1002
+ "data-hovered:bg-ui-surface-muted data-hovered:text-ui-fg",
1003
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled data-disabled:bg-transparent",
1004
+ "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:outline-offset-[var(--ui-focus-ring-offset)] data-focus-visible:outline-ui-focus"
1005
+ );
1006
+ function ii() {
1007
+ const e = I();
1008
+ return /* @__PURE__ */ b(R, { children: [
1009
+ /* @__PURE__ */ b("div", { className: "mb-ui-xs flex items-center justify-between gap-ui-xs", children: [
1010
+ /* @__PURE__ */ i(
1011
+ W,
1012
+ {
1013
+ slot: "previous",
1014
+ "aria-label": e["calendar.previous"],
1015
+ className: st,
1016
+ children: /* @__PURE__ */ i($t, { className: "size-4" })
1017
+ }
1018
+ ),
1019
+ /* @__PURE__ */ i(Mi, { className: "text-ui-body font-ui-semibold first-letter:uppercase" }),
1020
+ /* @__PURE__ */ i(
1021
+ W,
1022
+ {
1023
+ slot: "next",
1024
+ "aria-label": e["calendar.next"],
1025
+ className: st,
1026
+ children: /* @__PURE__ */ i(Pe, { className: "size-4" })
1027
+ }
1028
+ )
1029
+ ] }),
1030
+ /* @__PURE__ */ b(Ei, { className: "border-separate border-spacing-0.5", children: [
1031
+ /* @__PURE__ */ i(Ri, { children: (t) => /* @__PURE__ */ i(Li, { className: "size-9 text-ui-caption font-ui-medium text-ui-fg-muted", children: t }) }),
1032
+ /* @__PURE__ */ i(Pi, { children: (t) => /* @__PURE__ */ i(
1033
+ ji,
1034
+ {
1035
+ date: t,
1036
+ className: ({
1037
+ isSelected: r,
1038
+ isUnavailable: a,
1039
+ isDisabled: n,
1040
+ isOutsideMonth: s
1041
+ }) => l(
1042
+ // Área táctil de 36 px
1043
+ "relative flex size-9 cursor-pointer items-center justify-center rounded-md text-ui-body-sm tabular-nums",
1044
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
1045
+ "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:outline-offset-[var(--ui-focus-ring-offset)] data-focus-visible:outline-ui-focus",
1046
+ r ? "bg-ui-primary font-ui-semibold text-ui-surface data-hovered:bg-ui-primary-hover" : "data-hovered:bg-ui-surface-muted",
1047
+ // Hoy: subrayado, no solo color
1048
+ Er(t, Rr()) && "font-ui-semibold underline decoration-2 underline-offset-4",
1049
+ (n || a) && "cursor-not-allowed text-ui-fg-disabled data-hovered:bg-transparent",
1050
+ // No disponible: tachado, no solo color
1051
+ a && "line-through",
1052
+ s && "invisible"
1053
+ )
1054
+ }
1055
+ ) })
1056
+ ] })
1057
+ ] });
1058
+ }
1059
+ function Cn({
1060
+ value: e,
1061
+ defaultValue: t,
1062
+ onChange: r,
1063
+ defaultFocusedValue: a,
1064
+ min: n,
1065
+ max: s,
1066
+ unavailable: o,
1067
+ disabled: d,
1068
+ readOnly: c,
1069
+ autoFocus: m,
1070
+ className: u,
1071
+ ref: f,
1072
+ ...g
1073
+ }) {
1074
+ const x = he(e), p = he(t);
1075
+ return /* @__PURE__ */ i(
1076
+ Ct,
1077
+ {
1078
+ ref: f,
1079
+ ...g["aria-label"] !== void 0 && {
1080
+ "aria-label": g["aria-label"]
1081
+ },
1082
+ ...g["aria-labelledby"] !== void 0 && {
1083
+ "aria-labelledby": g["aria-labelledby"]
1084
+ },
1085
+ ...x !== void 0 && { value: x },
1086
+ ...p !== void 0 && { defaultValue: p },
1087
+ ...r && {
1088
+ onChange: (y) => r(Oe(y))
1089
+ },
1090
+ ...a && {
1091
+ defaultFocusedValue: xe(a)
1092
+ },
1093
+ ...ti({ min: n, max: s, unavailable: o }),
1094
+ ...d && { isDisabled: !0 },
1095
+ ...c && { isReadOnly: !0 },
1096
+ ...m && { autoFocus: !0 },
1097
+ className: l(
1098
+ "inline-flex flex-col rounded-lg border border-ui-border bg-ui-surface p-ui-sm text-ui-fg",
1099
+ u
1100
+ ),
1101
+ children: /* @__PURE__ */ i(ii, {})
1102
+ }
1103
+ );
1104
+ }
1105
+ const ri = P(null), oa = {
1106
+ outline: "border-ui-border-subtle bg-ui-surface",
1107
+ raised: "border-ui-border-subtle bg-ui-surface-raised shadow-ui-raised",
1108
+ subtle: "border-transparent bg-ui-surface-muted"
1109
+ }, la = /* @__PURE__ */ new Set(["section", "article", "aside"]);
1110
+ function zn({ as: e = "div", variant: t = "outline", className: r, ref: a, ...n }) {
1111
+ const [s, o] = E(), d = e, c = la.has(e) && n["aria-label"] == null && n["aria-labelledby"] == null;
1112
+ return /* @__PURE__ */ i(ri, { value: { registerTitle: o }, children: /* @__PURE__ */ i(
1113
+ d,
1114
+ {
1115
+ ref: a,
1116
+ "aria-labelledby": c ? s : void 0,
1117
+ className: l(
1118
+ "@container m-0 flex min-w-0 flex-col gap-ui-md rounded-lg border p-ui-lg text-ui-fg",
1119
+ oa[t],
1120
+ r
1121
+ ),
1122
+ ...n
1123
+ }
1124
+ ) });
1125
+ }
1126
+ function kn({
1127
+ title: e,
1128
+ headingLevel: t = 3,
1129
+ description: r,
1130
+ actions: a,
1131
+ className: n,
1132
+ ...s
1133
+ }) {
1134
+ const o = L(), c = B(ri)?.registerTitle;
1135
+ return jt(() => (c?.(o), () => c?.(void 0)), [c, o]), /* @__PURE__ */ b(
1136
+ "div",
1137
+ {
1138
+ className: l(
1139
+ "flex flex-col gap-ui-sm @ui-xs:flex-row @ui-xs:items-start @ui-xs:justify-between",
1140
+ n
1141
+ ),
1142
+ ...s,
1143
+ children: [
1144
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-col gap-ui-xs", children: [
1145
+ /* @__PURE__ */ i(ce, { level: t, size: "sm", id: o, children: e }),
1146
+ r && /* @__PURE__ */ i("p", { className: "m-0 text-ui-body-sm text-ui-fg-muted", children: r })
1147
+ ] }),
1148
+ a && /* @__PURE__ */ i("div", { className: "flex shrink-0 flex-wrap items-center gap-ui-sm", children: a })
1149
+ ]
1150
+ }
1151
+ );
1152
+ }
1153
+ function Sn({ className: e, ...t }) {
1154
+ return /* @__PURE__ */ i("div", { className: l("min-w-0 text-ui-body", e), ...t });
1155
+ }
1156
+ const da = {
1157
+ start: "justify-start",
1158
+ end: "justify-end",
1159
+ between: "justify-between"
1160
+ };
1161
+ function In({ align: e = "end", className: t, ...r }) {
1162
+ return /* @__PURE__ */ i(
1163
+ "div",
1164
+ {
1165
+ className: l("flex flex-wrap items-center gap-ui-sm", da[e], t),
1166
+ ...r
1167
+ }
1168
+ );
1169
+ }
1170
+ function Fe({ className: e, children: t, ...r }) {
1171
+ return /* @__PURE__ */ b(
1172
+ "p",
1173
+ {
1174
+ className: l("flex items-start gap-1.5 text-ui-body-sm text-ui-danger", e),
1175
+ ...r,
1176
+ children: [
1177
+ /* @__PURE__ */ i(we, { size: "sm", className: "mt-0.5" }),
1178
+ /* @__PURE__ */ i("span", { children: t })
1179
+ ]
1180
+ }
1181
+ );
1182
+ }
1183
+ function He({ className: e, ...t }) {
1184
+ return /* @__PURE__ */ i("p", { className: l("text-ui-body-sm text-ui-fg-muted", e), ...t });
1185
+ }
1186
+ const Ee = {
1187
+ // indent = ancho de la caja + gap-2: la ayuda y el error se alinean con el texto
1188
+ sm: { text: "text-ui-body-sm", box: "size-4", indent: "ps-6" },
1189
+ md: { text: "text-ui-body ui-sm:text-ui-body-sm", box: "size-4.5", indent: "ps-6.5" },
1190
+ lg: { text: "text-ui-body", box: "size-5", indent: "ps-7" }
1191
+ };
1192
+ function ot(e) {
1193
+ return e != null && e !== !1 && e !== "";
1194
+ }
1195
+ function ue(e, {
1196
+ id: t,
1197
+ description: r,
1198
+ error: a,
1199
+ describedBy: n
1200
+ }) {
1201
+ const s = L(), o = t ?? `${e}-${s}`, d = ot(a), c = ot(r) ? `${o}-description` : void 0, m = d ? `${o}-error` : void 0;
1202
+ return {
1203
+ id: o,
1204
+ hasError: d,
1205
+ descriptionId: c,
1206
+ errorId: m,
1207
+ describedBy: [n, c, m].filter(Boolean).join(" ") || void 0
1208
+ };
1209
+ }
1210
+ function ai(e, t) {
1211
+ return l(
1212
+ "peer m-0 shrink-0 cursor-[inherit] appearance-none border bg-ui-surface",
1213
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
1214
+ Ee[e].box,
1215
+ t ? "border-ui-danger" : "border-ui-border enabled:hover:border-ui-border-hover",
1216
+ "disabled:border-ui-border-subtle disabled:bg-ui-surface-disabled",
1217
+ T
1218
+ );
1219
+ }
1220
+ function Ke({
1221
+ id: e,
1222
+ size: t,
1223
+ className: r,
1224
+ control: a,
1225
+ children: n,
1226
+ description: s,
1227
+ descriptionId: o,
1228
+ error: d,
1229
+ errorId: c,
1230
+ indentClassName: m
1231
+ }) {
1232
+ const u = m ?? Ee[t].indent;
1233
+ return /* @__PURE__ */ b("div", { className: l("flex flex-col gap-1", Ee[t].text, r), children: [
1234
+ /* @__PURE__ */ b(
1235
+ "label",
1236
+ {
1237
+ htmlFor: e,
1238
+ className: l(
1239
+ // Alto mínimo de 24 px: toda la etiqueta es el área táctil (WCAG 2.5.8)
1240
+ "inline-flex min-h-6 cursor-pointer items-start gap-2 text-ui-fg",
1241
+ "has-disabled:cursor-not-allowed has-disabled:text-ui-fg-disabled"
1242
+ ),
1243
+ children: [
1244
+ /* @__PURE__ */ i("span", { className: "relative inline-flex h-[1lh] shrink-0 items-center", children: a }),
1245
+ /* @__PURE__ */ i("span", { children: n })
1246
+ ]
1247
+ }
1248
+ ),
1249
+ o && /* @__PURE__ */ i(He, { id: o, className: u, children: s }),
1250
+ c && /* @__PURE__ */ i(Fe, { id: c, className: u, children: d })
1251
+ ] });
1252
+ }
1253
+ function ni({
1254
+ ids: e,
1255
+ label: t,
1256
+ hideLabel: r = !1,
1257
+ description: a,
1258
+ error: n,
1259
+ required: s = !1,
1260
+ orientation: o = "vertical",
1261
+ className: d,
1262
+ children: c,
1263
+ ...m
1264
+ }) {
1265
+ return /* @__PURE__ */ b(
1266
+ "fieldset",
1267
+ {
1268
+ id: e.id,
1269
+ "aria-describedby": e.describedBy,
1270
+ "data-orientation": o,
1271
+ className: l("group m-0 min-w-0 border-0 p-0", d),
1272
+ ...m,
1273
+ children: [
1274
+ /* @__PURE__ */ b(
1275
+ "legend",
1276
+ {
1277
+ className: l(
1278
+ "mb-2 p-0 text-ui-label text-ui-fg group-disabled:text-ui-fg-disabled",
1279
+ r && "sr-only"
1280
+ ),
1281
+ children: [
1282
+ t,
1283
+ s && /* @__PURE__ */ b(R, { children: [
1284
+ " ",
1285
+ /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "text-ui-danger", children: "*" })
1286
+ ] })
1287
+ ]
1288
+ }
1289
+ ),
1290
+ e.descriptionId && /* @__PURE__ */ i(He, { id: e.descriptionId, className: "-mt-1 mb-2", children: a }),
1291
+ /* @__PURE__ */ i(
1292
+ "div",
1293
+ {
1294
+ className: l(
1295
+ "flex",
1296
+ o === "vertical" ? "flex-col gap-2" : "flex-row flex-wrap gap-x-6 gap-y-2"
1297
+ ),
1298
+ children: c
1299
+ }
1300
+ ),
1301
+ e.errorId && /* @__PURE__ */ i(Fe, { id: e.errorId, className: "mt-2", children: n })
1302
+ ]
1303
+ }
1304
+ );
1305
+ }
1306
+ const si = P(null), lt = "pointer-events-none absolute inset-0 m-auto hidden size-[0.75em] text-ui-surface";
1307
+ function Bn({
1308
+ children: e,
1309
+ description: t,
1310
+ error: r,
1311
+ invalid: a,
1312
+ indeterminate: n = !1,
1313
+ size: s,
1314
+ className: o,
1315
+ id: d,
1316
+ ref: c,
1317
+ "aria-describedby": m,
1318
+ onChange: u,
1319
+ ...f
1320
+ }) {
1321
+ const g = B(si), x = M(null), p = ue("checkbox", {
1322
+ id: d,
1323
+ description: t,
1324
+ error: r,
1325
+ describedBy: m
1326
+ }), y = s ?? g?.size ?? "md", v = a ?? (p.hasError || g?.invalid === !0);
1327
+ de(() => {
1328
+ x.current && (x.current.indeterminate = n);
1329
+ });
1330
+ const h = g !== null && f.value !== void 0, N = h ? { name: f.name ?? g.name, checked: g.value.includes(String(f.value)) } : {}, C = (S) => {
1331
+ h && g.toggle(String(f.value), S.currentTarget.checked), u?.(S);
1332
+ };
1333
+ return /* @__PURE__ */ i(
1334
+ Ke,
1335
+ {
1336
+ id: p.id,
1337
+ size: y,
1338
+ className: o,
1339
+ description: t,
1340
+ descriptionId: p.descriptionId,
1341
+ error: r,
1342
+ errorId: p.errorId,
1343
+ control: /* @__PURE__ */ b(R, { children: [
1344
+ /* @__PURE__ */ i(
1345
+ "input",
1346
+ {
1347
+ ref: q(x, c),
1348
+ type: "checkbox",
1349
+ id: p.id,
1350
+ "aria-describedby": p.describedBy,
1351
+ "aria-invalid": v || void 0,
1352
+ "data-indeterminate": n ? "" : void 0,
1353
+ onChange: C,
1354
+ className: l(
1355
+ ai(y, v),
1356
+ "rounded-sm",
1357
+ "checked:border-ui-primary checked:bg-ui-primary enabled:checked:hover:bg-ui-primary-hover",
1358
+ "indeterminate:border-ui-primary indeterminate:bg-ui-primary enabled:indeterminate:hover:bg-ui-primary-hover",
1359
+ "disabled:checked:bg-ui-fg-disabled disabled:indeterminate:bg-ui-fg-disabled"
1360
+ ),
1361
+ ...N,
1362
+ ...f
1363
+ }
1364
+ ),
1365
+ /* @__PURE__ */ i(
1366
+ le,
1367
+ {
1368
+ strokeWidth: 3,
1369
+ className: l(lt, "peer-checked:block peer-indeterminate:hidden")
1370
+ }
1371
+ ),
1372
+ /* @__PURE__ */ i(Mt, { strokeWidth: 3, className: l(lt, "peer-indeterminate:block") })
1373
+ ] }),
1374
+ children: e
1375
+ }
1376
+ );
1377
+ }
1378
+ function Dn({
1379
+ value: e,
1380
+ defaultValue: t,
1381
+ onChange: r,
1382
+ name: a,
1383
+ size: n = "md",
1384
+ id: s,
1385
+ description: o,
1386
+ error: d,
1387
+ "aria-describedby": c,
1388
+ ...m
1389
+ }) {
1390
+ const u = ue("checkbox-group", { id: s, description: o, error: d, describedBy: c }), [f, g] = E(t ?? []), x = e ?? f, p = Ne(
1391
+ () => ({
1392
+ name: a,
1393
+ value: x,
1394
+ size: n,
1395
+ invalid: u.hasError,
1396
+ toggle: (y, v) => {
1397
+ const h = v ? [...x.filter((N) => N !== y), y] : x.filter((N) => N !== y);
1398
+ e === void 0 && g(h), r?.(h);
1399
+ }
1400
+ }),
1401
+ [a, x, n, u.hasError, e, r]
1402
+ );
1403
+ return /* @__PURE__ */ i(si, { value: p, children: /* @__PURE__ */ i(ni, { ids: u, description: o, error: d, ...m }) });
1404
+ }
1405
+ const ca = {
1406
+ sm: "text-ui-label",
1407
+ md: "text-ui-label",
1408
+ lg: "text-ui-body font-ui-medium"
1409
+ };
1410
+ function ua({
1411
+ required: e = !1,
1412
+ optional: t = !1,
1413
+ optionalText: r,
1414
+ disabled: a = !1,
1415
+ size: n = "md",
1416
+ className: s,
1417
+ children: o,
1418
+ ...d
1419
+ }) {
1420
+ const c = I();
1421
+ return /* @__PURE__ */ b(
1422
+ "label",
1423
+ {
1424
+ className: l(
1425
+ "inline-flex flex-wrap items-baseline gap-x-1 text-ui-fg",
1426
+ ca[n],
1427
+ a && "text-ui-fg-disabled",
1428
+ s
1429
+ ),
1430
+ ...d,
1431
+ children: [
1432
+ o,
1433
+ (e || t) && " ",
1434
+ e && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "text-ui-danger", children: "*" }),
1435
+ t && !e && /* @__PURE__ */ i("span", { className: "font-ui-regular text-ui-fg-muted", children: r ?? c["label.optional"] })
1436
+ ]
1437
+ }
1438
+ );
1439
+ }
1440
+ const Ue = P(null);
1441
+ function ma({
1442
+ label: e,
1443
+ hideLabel: t = !1,
1444
+ description: r,
1445
+ error: a,
1446
+ required: n = !1,
1447
+ optional: s = !1,
1448
+ disabled: o = !1,
1449
+ size: d = "md",
1450
+ id: c,
1451
+ className: m,
1452
+ children: u,
1453
+ ...f
1454
+ }) {
1455
+ const g = L(), x = c ?? `field-${g}`, p = a != null && a !== !1 && a !== "", y = r ? `${x}-description` : void 0, v = p ? `${x}-error` : void 0;
1456
+ return /* @__PURE__ */ i(
1457
+ Ue,
1458
+ {
1459
+ value: {
1460
+ id: x,
1461
+ labelId: `${x}-label`,
1462
+ descriptionId: y,
1463
+ errorId: v,
1464
+ invalid: p,
1465
+ required: n,
1466
+ disabled: o,
1467
+ size: d
1468
+ },
1469
+ children: /* @__PURE__ */ b("div", { className: l("flex flex-col gap-1.5", m), ...f, children: [
1470
+ /* @__PURE__ */ i(
1471
+ ua,
1472
+ {
1473
+ id: `${x}-label`,
1474
+ htmlFor: x,
1475
+ required: n,
1476
+ optional: s,
1477
+ disabled: o,
1478
+ size: d,
1479
+ className: l(t && "sr-only"),
1480
+ children: e
1481
+ }
1482
+ ),
1483
+ u,
1484
+ r && /* @__PURE__ */ i(He, { id: y, children: r }),
1485
+ p && /* @__PURE__ */ i(Fe, { id: v, children: a })
1486
+ ] })
1487
+ }
1488
+ );
1489
+ }
1490
+ function V(e) {
1491
+ const t = B(Ue), { invalid: r, ...a } = e, n = r ?? (e["aria-invalid"] === !0 || e["aria-invalid"] === "true" || t?.invalid === !0), s = [e["aria-describedby"], t?.descriptionId, t?.errorId].filter(Boolean).join(" ") || void 0;
1492
+ return {
1493
+ ...a,
1494
+ id: e.id ?? t?.id,
1495
+ "aria-describedby": s,
1496
+ "aria-invalid": n || void 0,
1497
+ required: e.required ?? t?.required,
1498
+ disabled: e.disabled ?? t?.disabled,
1499
+ size: e.size ?? t?.size ?? "md",
1500
+ invalid: n
1501
+ };
1502
+ }
1503
+ function ze() {
1504
+ return B(Ue)?.labelId;
1505
+ }
1506
+ const me = {
1507
+ sm: "min-h-ui-control-sm gap-1.5 px-2.5 text-ui-body ui-sm:text-ui-body-sm",
1508
+ md: "min-h-ui-control-md gap-2 px-3 text-ui-body ui-sm:text-ui-body-sm",
1509
+ lg: "min-h-ui-control-lg gap-2 px-4 text-ui-body"
1510
+ };
1511
+ function ie({
1512
+ invalid: e,
1513
+ disabled: t,
1514
+ readOnly: r
1515
+ }) {
1516
+ return l(
1517
+ "w-full rounded-md border bg-ui-surface text-ui-fg",
1518
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
1519
+ Dt,
1520
+ e ? "border-ui-danger" : "border-ui-border hover:border-ui-border-hover",
1521
+ r && "bg-ui-surface-muted",
1522
+ t && "cursor-not-allowed border-ui-border-subtle bg-ui-surface-disabled text-ui-fg-disabled hover:border-ui-border-subtle"
1523
+ );
1524
+ }
1525
+ const re = l(
1526
+ "z-(--ui-z-popover) rounded-lg border border-ui-border-subtle bg-ui-surface-raised text-ui-fg shadow-ui-overlay",
1527
+ // Entra y sale con un fundido corto (sin movimiento con reduced motion: la duración es casi 0)
1528
+ "origin-(--trigger-anchor-point) transition-[opacity,scale] duration-(--ui-duration-normal) ease-ui-enter",
1529
+ "data-entering:scale-95 data-entering:opacity-0 data-exiting:scale-95 data-exiting:opacity-0 data-exiting:ease-ui-exit"
1530
+ );
1531
+ function Tn(e) {
1532
+ return /* @__PURE__ */ i(Vt, { ...e });
1533
+ }
1534
+ function An({
1535
+ children: e,
1536
+ title: t,
1537
+ headingLevel: r = 2,
1538
+ placement: a = "bottom start",
1539
+ offset: n = 8,
1540
+ className: s,
1541
+ ref: o,
1542
+ "aria-label": d
1543
+ }) {
1544
+ const c = L();
1545
+ return /* @__PURE__ */ i(
1546
+ J,
1547
+ {
1548
+ placement: a,
1549
+ offset: n,
1550
+ className: l(
1551
+ re,
1552
+ "w-max max-w-(--container-ui-xs)",
1553
+ s
1554
+ ),
1555
+ children: /* @__PURE__ */ i(
1556
+ ye,
1557
+ {
1558
+ ref: o,
1559
+ ...d ? { "aria-label": d } : { "aria-labelledby": c },
1560
+ className: l("flex flex-col gap-ui-sm rounded-lg p-ui-md text-ui-body-sm", T),
1561
+ children: ({ close: m }) => /* @__PURE__ */ b(R, { children: [
1562
+ t != null && /* @__PURE__ */ i(ce, { level: r, size: "sm", id: c, children: t }),
1563
+ typeof e == "function" ? e({ close: m }) : e
1564
+ ] })
1565
+ }
1566
+ )
1567
+ }
1568
+ );
1569
+ }
1570
+ const ke = P("md"), oi = "flex flex-col gap-px overflow-auto p-ui-xs text-ui-fg outline-hidden";
1571
+ function dt(e) {
1572
+ if (e !== void 0)
1573
+ return e === null ? [] : typeof e == "string" ? [e] : e;
1574
+ }
1575
+ function $n(e) {
1576
+ const { children: t, size: r = "md", emptyState: a, autoFocus: n, className: s, ref: o } = e, d = I(), c = M(null), m = (g) => {
1577
+ const x = g === "all" ? Array.from(
1578
+ c.current?.querySelectorAll('[role="option"]:not([aria-disabled="true"])') ?? [],
1579
+ (p) => p.dataset.key ?? ""
1580
+ ) : Array.from(g, String);
1581
+ e.selectionMode === "multiple" ? e.onChange?.(x) : e.onChange?.(x[0] ?? null);
1582
+ }, u = dt(e.value), f = dt(e.defaultValue);
1583
+ return /* @__PURE__ */ i(ke, { value: r, children: /* @__PURE__ */ i(
1584
+ Re,
1585
+ {
1586
+ ref: q(c, o),
1587
+ ...e["aria-label"] !== void 0 ? { "aria-label": e["aria-label"] } : { "aria-labelledby": e["aria-labelledby"] },
1588
+ selectionMode: e.selectionMode ?? "single",
1589
+ disallowEmptySelection: e.selectionMode !== "multiple",
1590
+ ...u && { selectedKeys: u },
1591
+ ...f && { defaultSelectedKeys: f },
1592
+ onSelectionChange: m,
1593
+ ...n && { autoFocus: n },
1594
+ renderEmptyState: () => /* @__PURE__ */ i("div", { className: "px-ui-sm py-ui-sm text-ui-body-sm text-ui-fg-muted", children: a ?? d["listBox.empty"] }),
1595
+ className: l(
1596
+ "flex max-h-full flex-col gap-px overflow-auto rounded-md border border-ui-border bg-ui-surface p-ui-xs text-ui-fg",
1597
+ T,
1598
+ s
1599
+ ),
1600
+ children: t
1601
+ }
1602
+ ) });
1603
+ }
1604
+ const fa = {
1605
+ sm: "min-h-ui-control-sm text-ui-body-sm",
1606
+ md: "min-h-ui-control-md text-ui-body",
1607
+ lg: "min-h-ui-control-lg text-ui-body"
1608
+ };
1609
+ function Mn({ value: e, children: t, textValue: r, description: a, icon: n, disabled: s, className: o }) {
1610
+ const d = B(ke), c = r ?? (typeof t == "string" ? t : void 0);
1611
+ return /* @__PURE__ */ i(
1612
+ Gi,
1613
+ {
1614
+ id: e,
1615
+ ...c !== void 0 && { textValue: c },
1616
+ ...s && { isDisabled: !0 },
1617
+ className: l(
1618
+ "flex cursor-default items-center gap-ui-sm rounded-sm px-ui-sm py-ui-xs",
1619
+ "data-focused:bg-ui-surface-muted data-selected:bg-ui-primary-soft",
1620
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
1621
+ T,
1622
+ fa[d],
1623
+ o
1624
+ ),
1625
+ children: ({ isSelected: m }) => /* @__PURE__ */ b(R, { children: [
1626
+ n && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0 [&_svg]:size-4", children: n }),
1627
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 flex-col", children: [
1628
+ /* @__PURE__ */ i("div", { children: t }),
1629
+ a != null && /* @__PURE__ */ i("div", { className: "text-ui-body-sm text-ui-fg-muted", children: a })
1630
+ ] }),
1631
+ /* @__PURE__ */ i(le, { className: l("size-4 text-ui-primary", !m && "invisible") })
1632
+ ] })
1633
+ }
1634
+ );
1635
+ }
1636
+ function En({ title: e, children: t, className: r }) {
1637
+ return /* @__PURE__ */ b(Oi, { className: l("flex flex-col gap-px [&:not(:first-child)]:mt-ui-xs", r), children: [
1638
+ /* @__PURE__ */ i(zt, { className: "px-ui-sm pt-ui-xs pb-ui-xs text-ui-caption font-ui-semibold text-ui-fg-muted", children: e }),
1639
+ t
1640
+ ] });
1641
+ }
1642
+ const ba = {
1643
+ sm: "size-4",
1644
+ md: "size-4",
1645
+ lg: "size-5"
1646
+ };
1647
+ function Rn({
1648
+ children: e,
1649
+ value: t,
1650
+ defaultValue: r,
1651
+ onChange: a,
1652
+ inputValue: n,
1653
+ defaultInputValue: s,
1654
+ onInputChange: o,
1655
+ allowCustomValue: d = !1,
1656
+ openOn: c = "input",
1657
+ emptyState: m,
1658
+ placeholder: u,
1659
+ name: f,
1660
+ className: g,
1661
+ ref: x,
1662
+ "aria-label": p,
1663
+ "aria-labelledby": y,
1664
+ ...v
1665
+ }) {
1666
+ const h = ze(), { size: N, invalid: C, disabled: S, required: z, id: w, "aria-describedby": k } = V(v), D = y ?? h;
1667
+ return /* @__PURE__ */ b(
1668
+ kt,
1669
+ {
1670
+ ...t !== void 0 && { selectedKey: t },
1671
+ ...r !== void 0 && { defaultSelectedKey: r },
1672
+ onSelectionChange: (A) => a?.(A === null ? null : String(A)),
1673
+ ...n !== void 0 && { inputValue: n },
1674
+ ...s !== void 0 && { defaultInputValue: s },
1675
+ ...o && { onInputChange: o },
1676
+ allowsCustomValue: d,
1677
+ menuTrigger: c,
1678
+ allowsEmptyCollection: !0,
1679
+ ...f && { name: f },
1680
+ isDisabled: !!S,
1681
+ isRequired: !!z,
1682
+ isInvalid: C,
1683
+ ...D ? { "aria-labelledby": D } : p && { "aria-label": p },
1684
+ ...k && { "aria-describedby": k },
1685
+ validationBehavior: "aria",
1686
+ className: "flex w-full",
1687
+ children: [
1688
+ /* @__PURE__ */ i(li, { size: N, invalid: C, disabled: !!S, className: g, children: /* @__PURE__ */ i(di, { ref: x, id: w, placeholder: u }) }),
1689
+ /* @__PURE__ */ i(ci, { size: N, labelledBy: D, ariaLabel: p, emptyState: m, children: e })
1690
+ ]
1691
+ }
1692
+ );
1693
+ }
1694
+ function li({
1695
+ size: e,
1696
+ invalid: t,
1697
+ disabled: r,
1698
+ className: a,
1699
+ children: n
1700
+ }) {
1701
+ const s = I();
1702
+ return /* @__PURE__ */ b(
1703
+ St,
1704
+ {
1705
+ role: "presentation",
1706
+ className: l(
1707
+ "flex items-center",
1708
+ ie({ invalid: t, disabled: r, readOnly: !1 }),
1709
+ me[e],
1710
+ "pe-1",
1711
+ a
1712
+ ),
1713
+ children: [
1714
+ n,
1715
+ /* @__PURE__ */ i(
1716
+ W,
1717
+ {
1718
+ "aria-label": s["combobox.showOptions"],
1719
+ className: l(
1720
+ "inline-flex shrink-0 cursor-pointer items-center justify-center rounded-sm p-ui-xs text-ui-fg-muted",
1721
+ "hover:text-ui-fg disabled:cursor-not-allowed disabled:text-ui-fg-disabled",
1722
+ T
1723
+ ),
1724
+ children: /* @__PURE__ */ i(Y, { className: ba[e] })
1725
+ }
1726
+ )
1727
+ ]
1728
+ }
1729
+ );
1730
+ }
1731
+ function di({
1732
+ ref: e,
1733
+ id: t,
1734
+ placeholder: r,
1735
+ className: a
1736
+ }) {
1737
+ return /* @__PURE__ */ i(
1738
+ Fi,
1739
+ {
1740
+ ref: e,
1741
+ ...t && { id: t },
1742
+ ...r && { placeholder: r },
1743
+ className: l(
1744
+ "min-w-0 flex-1 self-stretch bg-transparent outline-hidden placeholder:text-ui-fg-muted disabled:cursor-not-allowed",
1745
+ a
1746
+ )
1747
+ }
1748
+ );
1749
+ }
1750
+ function ci({
1751
+ size: e,
1752
+ labelledBy: t,
1753
+ ariaLabel: r,
1754
+ emptyState: a,
1755
+ children: n
1756
+ }) {
1757
+ const s = I();
1758
+ return /* @__PURE__ */ i(J, { offset: 4, className: l(re, "flex min-w-(--trigger-width) flex-col"), children: /* @__PURE__ */ i(ke, { value: e, children: /* @__PURE__ */ i(
1759
+ Re,
1760
+ {
1761
+ ...t ? { "aria-labelledby": t, "aria-label": "" } : r && { "aria-label": r },
1762
+ className: oi,
1763
+ renderEmptyState: () => /* @__PURE__ */ i("div", { className: "px-ui-sm py-ui-sm text-ui-body-sm text-ui-fg-muted", children: a ?? s["combobox.empty"] }),
1764
+ children: n
1765
+ }
1766
+ ) }) });
1767
+ }
1768
+ const ga = {
1769
+ sm: "max-w-(--container-ui-md)",
1770
+ // 36rem: formularios, diálogos de página
1771
+ md: "max-w-(--container-ui-lg)",
1772
+ // 48rem
1773
+ lg: "max-w-(--container-ui-xl)",
1774
+ // 64rem: por defecto
1775
+ xl: "max-w-(--breakpoint-ui-xl)",
1776
+ // 80rem: tablas y paneles anchos
1777
+ prose: "max-w-(--ui-measure)",
1778
+ full: "max-w-none"
1779
+ };
1780
+ function Ln({
1781
+ as: e = "div",
1782
+ width: t = "lg",
1783
+ gutter: r = !0,
1784
+ className: a,
1785
+ ref: n,
1786
+ ...s
1787
+ }) {
1788
+ return /* @__PURE__ */ i(
1789
+ e,
1790
+ {
1791
+ ref: n,
1792
+ className: l(
1793
+ "@container mx-auto w-full",
1794
+ ga[t],
1795
+ r && "px-ui-md ui-md:px-ui-lg ui-lg:px-ui-xl",
1796
+ a
1797
+ ),
1798
+ ...s
1799
+ }
1800
+ );
1801
+ }
1802
+ function Pn({ children: e, open: t, defaultOpen: r, onOpenChange: a }) {
1803
+ const [n, ...s] = te.toArray(e);
1804
+ return /* @__PURE__ */ b(
1805
+ Wi,
1806
+ {
1807
+ ...t !== void 0 && { isOpen: t },
1808
+ ...r !== void 0 && { defaultOpen: r },
1809
+ ...a && { onOpenChange: a },
1810
+ children: [
1811
+ je(n) ? /* @__PURE__ */ i(Nt, { children: n }) : n,
1812
+ s
1813
+ ]
1814
+ }
1815
+ );
1816
+ }
1817
+ function jn({ children: e, onAction: t, "aria-label": r, placement: a = "bottom start", className: n, ref: s }) {
1818
+ return /* @__PURE__ */ i(
1819
+ J,
1820
+ {
1821
+ placement: a,
1822
+ offset: 4,
1823
+ className: l(re, "flex min-w-(--trigger-width) flex-col"),
1824
+ children: /* @__PURE__ */ i(
1825
+ Ui,
1826
+ {
1827
+ ref: s,
1828
+ ...r && { "aria-label": r, "aria-labelledby": "" },
1829
+ ...t && { onAction: (o) => t(String(o)) },
1830
+ className: l(
1831
+ "flex max-h-[inherit] min-w-40 flex-col gap-px overflow-auto p-ui-xs text-ui-body-sm text-ui-fg outline-hidden",
1832
+ n
1833
+ ),
1834
+ children: e
1835
+ }
1836
+ )
1837
+ }
1838
+ );
1839
+ }
1840
+ function Gn({
1841
+ value: e,
1842
+ children: t,
1843
+ textValue: r,
1844
+ description: a,
1845
+ icon: n,
1846
+ shortcut: s,
1847
+ tone: o = "neutral",
1848
+ disabled: d,
1849
+ onAction: c,
1850
+ className: m
1851
+ }) {
1852
+ const u = r ?? (typeof t == "string" ? t : void 0);
1853
+ return /* @__PURE__ */ b(
1854
+ _i,
1855
+ {
1856
+ id: e,
1857
+ ...u !== void 0 && { textValue: u },
1858
+ ...d && { isDisabled: !0 },
1859
+ ...c && { onAction: c },
1860
+ className: l(
1861
+ // 32 px de alto: área táctil cómoda (WCAG 2.5.8 pide 24)
1862
+ "flex min-h-8 cursor-default items-center gap-ui-sm rounded-sm px-ui-sm py-ui-xs",
1863
+ "data-focused:bg-ui-surface-muted",
1864
+ o === "danger" && "text-ui-danger data-focused:bg-ui-danger-soft",
1865
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
1866
+ T,
1867
+ m
1868
+ ),
1869
+ children: [
1870
+ n && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0 [&_svg]:size-4", children: n }),
1871
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 flex-col", children: [
1872
+ /* @__PURE__ */ i("div", { children: t }),
1873
+ a != null && /* @__PURE__ */ i("div", { className: "text-ui-caption text-ui-fg-muted", children: a })
1874
+ ] }),
1875
+ s && /* @__PURE__ */ i("kbd", { className: "ms-ui-md shrink-0 font-ui-sans text-ui-caption text-ui-fg-muted", children: s })
1876
+ ]
1877
+ }
1878
+ );
1879
+ }
1880
+ function On({ title: e, children: t, className: r }) {
1881
+ return /* @__PURE__ */ b(qi, { className: l("flex flex-col gap-px [&:not(:first-child)]:mt-ui-xs", r), children: [
1882
+ /* @__PURE__ */ i(zt, { className: "px-ui-sm pt-ui-xs pb-ui-xs text-ui-caption font-ui-semibold text-ui-fg-muted", children: e }),
1883
+ t
1884
+ ] });
1885
+ }
1886
+ function Fn({ className: e }) {
1887
+ return /* @__PURE__ */ i(Vi, { className: l("my-ui-xs border-t border-ui-border-subtle", e) });
1888
+ }
1889
+ const xa = 500, pa = 10;
1890
+ function Hn({ children: e, label: t, open: r, onOpenChange: a, disabled: n = !1 }) {
1891
+ const [s, ...o] = te.toArray(e), [d, c] = E(!1), m = r ?? d, [u, f] = E({ x: 0, y: 0 }), g = M(null), x = M(null), p = (w) => {
1892
+ r === void 0 && c(w), a?.(w);
1893
+ }, y = (w, k) => {
1894
+ f({ x: w, y: k }), p(!0);
1895
+ }, v = () => {
1896
+ x.current && clearTimeout(x.current.timer), x.current = null;
1897
+ }, h = (w) => {
1898
+ n || (w.preventDefault(), v(), w.clientX === 0 && w.clientY === 0 ? N(w.target) : y(w.clientX, w.clientY));
1899
+ }, N = (w) => {
1900
+ const k = w.getBoundingClientRect();
1901
+ y(k.left, k.bottom);
1902
+ };
1903
+ return /* @__PURE__ */ b(R, { children: [
1904
+ /* @__PURE__ */ i(
1905
+ "div",
1906
+ {
1907
+ className: "contents [-webkit-touch-callout:none]",
1908
+ onContextMenu: h,
1909
+ onKeyDown: (w) => {
1910
+ n || (w.key === "ContextMenu" || w.shiftKey && w.key === "F10") && (w.preventDefault(), N(w.target));
1911
+ },
1912
+ onPointerDown: (w) => {
1913
+ if (n || w.pointerType !== "touch") return;
1914
+ const { clientX: k, clientY: D } = w;
1915
+ v(), x.current = { timer: setTimeout(() => y(k, D), xa), x: k, y: D };
1916
+ },
1917
+ onPointerMove: (w) => {
1918
+ const k = x.current;
1919
+ k && Math.hypot(w.clientX - k.x, w.clientY - k.y) > pa && v();
1920
+ },
1921
+ onPointerUp: v,
1922
+ onPointerCancel: v,
1923
+ children: s
1924
+ }
1925
+ ),
1926
+ /* @__PURE__ */ i(
1927
+ "span",
1928
+ {
1929
+ ref: g,
1930
+ "aria-hidden": "true",
1931
+ className: "pointer-events-none fixed size-0",
1932
+ style: { left: u.x, top: u.y }
1933
+ }
1934
+ ),
1935
+ /* @__PURE__ */ i(
1936
+ Hi,
1937
+ {
1938
+ value: { isOpen: m, onOpenChange: p, triggerRef: g, trigger: "ContextMenu", "aria-label": t },
1939
+ children: /* @__PURE__ */ i(Ki, { value: { "aria-label": t, autoFocus: "first", onClose: () => p(!1) }, children: o })
1940
+ }
1941
+ )
1942
+ ] });
1943
+ }
1944
+ function _e({
1945
+ className: e,
1946
+ inputClassName: t,
1947
+ startIcon: r,
1948
+ endIcon: a,
1949
+ endAdornment: n,
1950
+ ref: s,
1951
+ readOnly: o = !1,
1952
+ ...d
1953
+ }) {
1954
+ const { size: c, invalid: m, ...u } = V(d), f = M(null), g = !!u.disabled, x = (p) => {
1955
+ p.target === p.currentTarget && !g && (p.preventDefault(), f.current?.focus());
1956
+ };
1957
+ return /* @__PURE__ */ b(
1958
+ "div",
1959
+ {
1960
+ className: l(
1961
+ "flex items-center",
1962
+ ie({ invalid: m, disabled: g, readOnly: o }),
1963
+ me[c],
1964
+ e
1965
+ ),
1966
+ onMouseDown: x,
1967
+ children: [
1968
+ r && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "pointer-events-none inline-flex shrink-0 text-ui-fg-muted", children: r }),
1969
+ /* @__PURE__ */ i(
1970
+ "input",
1971
+ {
1972
+ ref: q(f, s),
1973
+ readOnly: o,
1974
+ className: l(
1975
+ "min-w-0 flex-1 self-stretch bg-transparent outline-hidden",
1976
+ "placeholder:text-ui-fg-muted disabled:cursor-not-allowed",
1977
+ t
1978
+ ),
1979
+ ...u
1980
+ }
1981
+ ),
1982
+ a && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "pointer-events-none inline-flex shrink-0 text-ui-fg-muted", children: a }),
1983
+ n
1984
+ ]
1985
+ }
1986
+ );
1987
+ }
1988
+ function qe({ label: e }) {
1989
+ return /* @__PURE__ */ i(
1990
+ Xi,
1991
+ {
1992
+ slot: "selection",
1993
+ "aria-label": e,
1994
+ className: "group/check inline-flex size-6 shrink-0 cursor-pointer items-center justify-center align-middle",
1995
+ children: ({ isSelected: t, isIndeterminate: r }) => /* @__PURE__ */ i(
1996
+ "span",
1997
+ {
1998
+ className: l(
1999
+ "flex size-4 items-center justify-center rounded-sm border text-ui-surface",
2000
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
2001
+ t || r ? "border-ui-primary bg-ui-primary group-data-hovered/check:bg-ui-primary-hover" : "border-ui-border bg-ui-surface group-data-hovered/check:border-ui-border-hover"
2002
+ ),
2003
+ children: r ? /* @__PURE__ */ i(Mt, { strokeWidth: 3, className: "size-3" }) : t && /* @__PURE__ */ i(le, { strokeWidth: 3, className: "size-3" })
2004
+ }
2005
+ )
2006
+ }
2007
+ );
2008
+ }
2009
+ const Z = P({
2010
+ size: "md",
2011
+ hasRowAction: !1,
2012
+ virtualized: !1,
2013
+ stateRef: void 0
2014
+ });
2015
+ function ct(e) {
2016
+ if (e !== void 0)
2017
+ return e === null ? [] : typeof e == "string" ? [e] : e;
2018
+ }
2019
+ const Ve = {
2020
+ sm: "px-ui-sm py-ui-xs",
2021
+ md: "px-ui-md py-ui-sm",
2022
+ lg: "px-ui-md py-ui-md"
2023
+ }, We = {
2024
+ start: "text-start",
2025
+ center: "text-center",
2026
+ end: "text-end tabular-nums whitespace-nowrap"
2027
+ }, fe = {
2028
+ start: "flex size-full items-center",
2029
+ center: "flex size-full items-center justify-center",
2030
+ end: "flex size-full items-center justify-end"
2031
+ }, ut = {
2032
+ sm: 33,
2033
+ md: 41,
2034
+ lg: 49
2035
+ }, mt = 40, Q = "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:-outline-offset-[var(--ui-focus-ring-width)] data-focus-visible:outline-ui-focus";
2036
+ function Kn(e) {
2037
+ const {
2038
+ children: t,
2039
+ size: r = "md",
2040
+ sortDescriptor: a,
2041
+ onSortChange: n,
2042
+ onRowAction: s,
2043
+ maxHeight: o,
2044
+ virtualized: d = !1,
2045
+ className: c,
2046
+ ref: m
2047
+ } = e, u = M(null), f = e.selectionMode ?? "none", g = o ?? (d ? "24rem" : void 0), x = () => {
2048
+ const C = u.current;
2049
+ return C ? C.collection.rows.filter((S) => S.type === "item" && !C.disabledKeys.has(S.key)).map((S) => String(S.key)) : [];
2050
+ }, p = (C) => {
2051
+ const S = C === "all" ? x() : Array.from(C, String);
2052
+ e.selectionMode === "multiple" ? e.onChange?.(S) : e.selectionMode === "single" && e.onChange?.(S[0] ?? null);
2053
+ }, y = ct(e.value), v = ct(e.defaultValue), h = g ? { maxHeight: g } : void 0, N = /* @__PURE__ */ i(
2054
+ Qi,
2055
+ {
2056
+ ref: m,
2057
+ ...d && h && { style: h },
2058
+ ...e["aria-label"] !== void 0 ? { "aria-label": e["aria-label"] } : { "aria-labelledby": e["aria-labelledby"] },
2059
+ selectionMode: f,
2060
+ selectionBehavior: "toggle",
2061
+ ...y && { selectedKeys: y },
2062
+ ...v && { defaultSelectedKeys: v },
2063
+ onSelectionChange: p,
2064
+ ...a && {
2065
+ sortDescriptor: a
2066
+ },
2067
+ ...n && {
2068
+ onSortChange: (C) => n({
2069
+ column: String(C.column),
2070
+ direction: C.direction
2071
+ })
2072
+ },
2073
+ ...s && {
2074
+ onRowAction: (C) => s(String(C))
2075
+ },
2076
+ className: l(
2077
+ d ? "relative block w-full overflow-auto" : "w-full border-separate border-spacing-0",
2078
+ "text-ui-fg",
2079
+ r === "sm" ? "text-ui-body-sm" : "text-ui-body",
2080
+ Q,
2081
+ c
2082
+ ),
2083
+ children: t
2084
+ }
2085
+ );
2086
+ return /* @__PURE__ */ i(
2087
+ Z,
2088
+ {
2089
+ value: {
2090
+ size: r,
2091
+ hasRowAction: !!s,
2092
+ virtualized: d,
2093
+ stateRef: u
2094
+ },
2095
+ children: /* @__PURE__ */ i(
2096
+ "div",
2097
+ {
2098
+ ...!d && h && { style: h },
2099
+ className: l(
2100
+ "isolate min-w-0 rounded-lg border border-ui-border-subtle bg-ui-surface",
2101
+ d ? "overflow-hidden" : "overflow-auto"
2102
+ ),
2103
+ children: d ? /* @__PURE__ */ i(
2104
+ Yi,
2105
+ {
2106
+ layout: Zi,
2107
+ layoutOptions: {
2108
+ estimatedRowHeight: ut[r],
2109
+ estimatedHeadingHeight: ut[r]
2110
+ },
2111
+ children: N
2112
+ }
2113
+ ) : N
2114
+ }
2115
+ )
2116
+ }
2117
+ );
2118
+ }
2119
+ function ha() {
2120
+ const { stateRef: e } = B(Z), t = B(ir);
2121
+ return de(() => {
2122
+ e && t && (e.current = t);
2123
+ }), null;
2124
+ }
2125
+ const ui = "border-b border-ui-border bg-ui-surface-muted font-ui-semibold whitespace-nowrap text-ui-fg-muted", mi = "sticky top-0 z-(--ui-z-sticky)";
2126
+ function Un({ children: e }) {
2127
+ const { selectionMode: t } = Bt(), { size: r, virtualized: a } = B(Z), n = I();
2128
+ return /* @__PURE__ */ b(er, { children: [
2129
+ t !== "none" && /* @__PURE__ */ i(
2130
+ It,
2131
+ {
2132
+ width: mt,
2133
+ minWidth: mt,
2134
+ className: l(
2135
+ ui,
2136
+ !a && mi,
2137
+ a && fe.center,
2138
+ // Sin virtualizar, la columna se encoge a la casilla; virtualizada, el ancho lo da el layout
2139
+ !a && "w-0",
2140
+ "px-ui-xs",
2141
+ Q,
2142
+ r === "sm" ? "py-0" : "py-ui-xs"
2143
+ ),
2144
+ children: t === "multiple" ? /* @__PURE__ */ b(R, { children: [
2145
+ /* @__PURE__ */ i(qe, { label: n["dataGrid.selectAll"] }),
2146
+ /* @__PURE__ */ i(ha, {})
2147
+ ] }) : /* @__PURE__ */ i("span", { className: "sr-only", children: n["dataGrid.selection"] })
2148
+ }
2149
+ ),
2150
+ e
2151
+ ] });
2152
+ }
2153
+ const va = {
2154
+ ascending: Rt,
2155
+ descending: Et
2156
+ };
2157
+ function _n({
2158
+ id: e,
2159
+ children: t,
2160
+ rowHeader: r = !1,
2161
+ sortable: a = !1,
2162
+ align: n = "start",
2163
+ textValue: s,
2164
+ width: o,
2165
+ minWidth: d,
2166
+ className: c
2167
+ }) {
2168
+ const { size: m, virtualized: u } = B(Z);
2169
+ return /* @__PURE__ */ i(
2170
+ It,
2171
+ {
2172
+ id: e,
2173
+ isRowHeader: r,
2174
+ allowsSorting: a,
2175
+ ...s !== void 0 && { textValue: s },
2176
+ ...o !== void 0 && { width: o },
2177
+ ...d !== void 0 && { minWidth: d },
2178
+ className: l(
2179
+ ui,
2180
+ u ? fe[n] : mi,
2181
+ Ve[m],
2182
+ We[n],
2183
+ a && "cursor-pointer data-hovered:text-ui-fg",
2184
+ Q,
2185
+ c
2186
+ ),
2187
+ children: ({ sortDirection: f }) => {
2188
+ if (!a) return t;
2189
+ const g = f ? va[f] : Lt;
2190
+ return /* @__PURE__ */ b(
2191
+ "span",
2192
+ {
2193
+ className: l(
2194
+ "inline-flex items-center gap-ui-xs",
2195
+ f && "text-ui-fg",
2196
+ n === "end" && "flex-row-reverse"
2197
+ ),
2198
+ children: [
2199
+ t,
2200
+ /* @__PURE__ */ i(
2201
+ g,
2202
+ {
2203
+ className: l("size-4 shrink-0", !f && "opacity-60")
2204
+ }
2205
+ )
2206
+ ]
2207
+ }
2208
+ );
2209
+ }
2210
+ }
2211
+ );
2212
+ }
2213
+ function qn({
2214
+ items: e,
2215
+ children: t,
2216
+ emptyState: r
2217
+ }) {
2218
+ const a = I();
2219
+ return /* @__PURE__ */ i(
2220
+ Ji,
2221
+ {
2222
+ ...e !== void 0 && { items: e },
2223
+ renderEmptyState: () => /* @__PURE__ */ i("div", { className: "px-ui-md py-ui-lg text-center text-ui-fg-muted", children: r ?? a["dataGrid.empty"] }),
2224
+ children: t
2225
+ }
2226
+ );
2227
+ }
2228
+ const Xe = "border-b border-ui-border-subtle group-last/row:border-b-0";
2229
+ function Vn({
2230
+ id: e,
2231
+ children: t,
2232
+ textValue: r,
2233
+ className: a
2234
+ }) {
2235
+ const { selectionMode: n } = Bt(), { hasRowAction: s, virtualized: o } = B(Z), d = I(), c = n !== "none";
2236
+ return /* @__PURE__ */ b(
2237
+ tr,
2238
+ {
2239
+ id: e,
2240
+ ...r !== void 0 && { textValue: r },
2241
+ className: l(
2242
+ "group/row",
2243
+ // El color acompaña a la casilla marcada: no es la única señal
2244
+ "data-selected:bg-ui-primary-soft",
2245
+ (c || s) && "cursor-pointer data-hovered:bg-ui-surface-muted data-selected:data-hovered:bg-ui-primary-soft",
2246
+ Q,
2247
+ a
2248
+ ),
2249
+ children: [
2250
+ c && /* @__PURE__ */ i(
2251
+ Le,
2252
+ {
2253
+ className: l(
2254
+ Xe,
2255
+ "px-ui-xs",
2256
+ o && fe.center,
2257
+ Q
2258
+ ),
2259
+ children: /* @__PURE__ */ i(qe, { label: d["dataGrid.selectRow"] })
2260
+ }
2261
+ ),
2262
+ t
2263
+ ]
2264
+ }
2265
+ );
2266
+ }
2267
+ function Wn({
2268
+ children: e,
2269
+ align: t = "start",
2270
+ textValue: r,
2271
+ className: a
2272
+ }) {
2273
+ const { size: n, virtualized: s } = B(Z);
2274
+ return /* @__PURE__ */ i(
2275
+ Le,
2276
+ {
2277
+ ...r !== void 0 && { textValue: r },
2278
+ className: l(
2279
+ Xe,
2280
+ s ? fe[t] : "align-middle",
2281
+ Ve[n],
2282
+ We[t],
2283
+ Q,
2284
+ a
2285
+ ),
2286
+ children: e
2287
+ }
2288
+ );
2289
+ }
2290
+ const _ = (e) => e.stopPropagation();
2291
+ function Xn({
2292
+ value: e,
2293
+ onChange: t,
2294
+ label: r,
2295
+ children: a,
2296
+ validate: n,
2297
+ align: s = "start",
2298
+ className: o
2299
+ }) {
2300
+ const { size: d, virtualized: c } = B(Z), m = I(), u = M(null), [f, g] = E(!1), [x, p] = E(e), [y, v] = E(void 0), h = () => {
2301
+ p(e), v(void 0), g(!0);
2302
+ }, N = () => {
2303
+ const z = n?.(x);
2304
+ if (z) {
2305
+ v(z);
2306
+ return;
2307
+ }
2308
+ x !== e && t(x), g(!1);
2309
+ const w = performance.now(), k = () => {
2310
+ const D = u.current, A = document.activeElement;
2311
+ if (!(!D || A === D)) {
2312
+ if (!A || A === document.body) {
2313
+ D.focus();
2314
+ return;
2315
+ }
2316
+ performance.now() - w < 1e3 && requestAnimationFrame(k);
2317
+ }
2318
+ };
2319
+ requestAnimationFrame(k);
2320
+ }, C = M(h);
2321
+ de(() => {
2322
+ C.current = h;
2323
+ });
2324
+ const S = Mr((z) => {
2325
+ if (u.current = z, !z) return;
2326
+ const w = (k) => {
2327
+ k.target === z && (k.key === "Enter" || k.key === "F2") && (k.preventDefault(), k.stopPropagation(), C.current());
2328
+ };
2329
+ return z.addEventListener("keydown", w), () => {
2330
+ z.removeEventListener("keydown", w), u.current = null;
2331
+ };
2332
+ }, []);
2333
+ return /* @__PURE__ */ b(
2334
+ Le,
2335
+ {
2336
+ ref: S,
2337
+ textValue: e,
2338
+ onDoubleClick: h,
2339
+ className: l(
2340
+ "group/cell cursor-text",
2341
+ Xe,
2342
+ c ? fe[s] : "align-middle",
2343
+ Ve[d],
2344
+ We[s],
2345
+ Q,
2346
+ o
2347
+ ),
2348
+ children: [
2349
+ /* @__PURE__ */ b(
2350
+ "span",
2351
+ {
2352
+ className: l(
2353
+ "inline-flex items-center gap-ui-xs",
2354
+ s === "end" && "flex-row-reverse"
2355
+ ),
2356
+ children: [
2357
+ a ?? e,
2358
+ /* @__PURE__ */ i(Sr, { className: "size-3.5 shrink-0 opacity-0 group-data-focus-visible/cell:opacity-60 group-data-hovered/cell:opacity-60" })
2359
+ ]
2360
+ }
2361
+ ),
2362
+ " ",
2363
+ /* @__PURE__ */ i("span", { className: "sr-only", children: m["dataGrid.editHint"] }),
2364
+ /* @__PURE__ */ i(
2365
+ "span",
2366
+ {
2367
+ className: "contents",
2368
+ onKeyDown: _,
2369
+ onKeyUp: _,
2370
+ onPointerDown: _,
2371
+ onPointerUp: _,
2372
+ onMouseDown: _,
2373
+ onMouseUp: _,
2374
+ onClick: _,
2375
+ onDoubleClick: _,
2376
+ onFocus: _,
2377
+ onBlur: _,
2378
+ children: /* @__PURE__ */ i(
2379
+ J,
2380
+ {
2381
+ triggerRef: u,
2382
+ isOpen: f,
2383
+ onOpenChange: g,
2384
+ placement: "bottom start",
2385
+ offset: 4,
2386
+ className: l(re, "w-72 max-w-[90vw]"),
2387
+ children: /* @__PURE__ */ i(ye, { "aria-label": r, className: "p-ui-md outline-hidden", children: /* @__PURE__ */ b(
2388
+ "form",
2389
+ {
2390
+ className: "flex flex-col gap-ui-sm",
2391
+ onSubmit: (z) => {
2392
+ z.preventDefault(), N();
2393
+ },
2394
+ children: [
2395
+ /* @__PURE__ */ i(ma, { label: r, error: y, size: "sm", children: /* @__PURE__ */ i(
2396
+ _e,
2397
+ {
2398
+ autoFocus: !0,
2399
+ value: x,
2400
+ onChange: (z) => p(z.target.value)
2401
+ }
2402
+ ) }),
2403
+ /* @__PURE__ */ b("div", { className: "flex justify-end gap-ui-xs", children: [
2404
+ /* @__PURE__ */ i(
2405
+ ne,
2406
+ {
2407
+ size: "sm",
2408
+ variant: "ghost",
2409
+ onClick: () => g(!1),
2410
+ children: m["dataGrid.cancel"]
2411
+ }
2412
+ ),
2413
+ /* @__PURE__ */ i(ne, { size: "sm", type: "submit", children: m["dataGrid.save"] })
2414
+ ] })
2415
+ ]
2416
+ }
2417
+ ) })
2418
+ }
2419
+ )
2420
+ }
2421
+ )
2422
+ ]
2423
+ }
2424
+ );
2425
+ }
2426
+ const ya = {
2427
+ sm: "size-4",
2428
+ md: "size-4",
2429
+ lg: "size-5"
2430
+ };
2431
+ function Qn({
2432
+ value: e,
2433
+ defaultValue: t,
2434
+ onChange: r,
2435
+ open: a,
2436
+ defaultOpen: n,
2437
+ onOpenChange: s,
2438
+ min: o,
2439
+ max: d,
2440
+ unavailable: c,
2441
+ name: m,
2442
+ readOnly: u,
2443
+ className: f,
2444
+ ref: g,
2445
+ "aria-label": x,
2446
+ "aria-labelledby": p,
2447
+ ...y
2448
+ }) {
2449
+ const v = I(), h = ze(), {
2450
+ size: N,
2451
+ invalid: C,
2452
+ disabled: S,
2453
+ required: z,
2454
+ id: w,
2455
+ "aria-describedby": k
2456
+ } = V(y), D = p ?? h, A = he(e), F = he(t);
2457
+ return /* @__PURE__ */ b(
2458
+ rr,
2459
+ {
2460
+ ...A !== void 0 && { value: A },
2461
+ ...F !== void 0 && { defaultValue: F },
2462
+ onChange: (j) => r?.(j ? Oe(j) : null),
2463
+ ...a !== void 0 && { isOpen: a },
2464
+ ...n !== void 0 && { defaultOpen: n },
2465
+ ...s && { onOpenChange: s },
2466
+ ...ti({ min: o, max: d, unavailable: c }),
2467
+ ...m && { name: m },
2468
+ granularity: "day",
2469
+ isDisabled: !!S,
2470
+ isRequired: !!z,
2471
+ isReadOnly: !!u,
2472
+ isInvalid: C,
2473
+ ...D ? { "aria-labelledby": D } : x && { "aria-label": x },
2474
+ ...k && { "aria-describedby": k },
2475
+ validationBehavior: "aria",
2476
+ className: "flex w-full",
2477
+ children: [
2478
+ /* @__PURE__ */ b(
2479
+ St,
2480
+ {
2481
+ ref: g,
2482
+ ...w && { id: w },
2483
+ className: l(
2484
+ ie({
2485
+ invalid: C,
2486
+ disabled: !!S,
2487
+ readOnly: !!u
2488
+ }),
2489
+ me[N],
2490
+ "flex items-center pe-1",
2491
+ // Anillo del campo al escribir en una parte, como un Input
2492
+ "has-[[role=spinbutton]:focus-visible]:outline-solid has-[[role=spinbutton]:focus-visible]:outline-[length:var(--ui-focus-ring-width)] has-[[role=spinbutton]:focus-visible]:outline-offset-[var(--ui-focus-ring-offset)] has-[[role=spinbutton]:focus-visible]:outline-ui-focus",
2493
+ f
2494
+ ),
2495
+ children: [
2496
+ /* @__PURE__ */ i(ar, { className: "flex min-w-0 flex-1 items-center tabular-nums", children: (j) => /* @__PURE__ */ i(
2497
+ nr,
2498
+ {
2499
+ segment: j,
2500
+ className: l(
2501
+ "rounded-sm px-0.5 outline-hidden caret-transparent",
2502
+ "data-placeholder:text-ui-fg-muted",
2503
+ "data-[type=literal]:px-0 data-[type=literal]:text-ui-fg-muted",
2504
+ // La parte enfocada se resalta: es la que cambian las flechas
2505
+ "data-focused:bg-ui-primary data-focused:text-ui-surface",
2506
+ "data-disabled:text-ui-fg-disabled"
2507
+ )
2508
+ }
2509
+ ) }),
2510
+ /* @__PURE__ */ i(
2511
+ W,
2512
+ {
2513
+ "aria-label": v["datePicker.open"],
2514
+ className: l(
2515
+ "inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-sm text-ui-fg-muted",
2516
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
2517
+ "data-hovered:text-ui-fg data-pressed:bg-ui-surface-muted",
2518
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
2519
+ "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:outline-offset-[var(--ui-focus-ring-offset)] data-focus-visible:outline-ui-focus"
2520
+ ),
2521
+ children: /* @__PURE__ */ i(Ir, { className: ya[N] })
2522
+ }
2523
+ )
2524
+ ]
2525
+ }
2526
+ ),
2527
+ /* @__PURE__ */ i(
2528
+ J,
2529
+ {
2530
+ offset: 4,
2531
+ placement: "bottom start",
2532
+ className: re,
2533
+ children: /* @__PURE__ */ i(ye, { className: "p-ui-sm outline-hidden", children: /* @__PURE__ */ i(Ct, { children: /* @__PURE__ */ i(ii, {}) }) })
2534
+ }
2535
+ )
2536
+ ]
2537
+ }
2538
+ );
2539
+ }
2540
+ function Yn({
2541
+ orientation: e = "horizontal",
2542
+ decorative: t = !1,
2543
+ className: r,
2544
+ ...a
2545
+ }) {
2546
+ const n = e === "vertical";
2547
+ return /* @__PURE__ */ i(
2548
+ "hr",
2549
+ {
2550
+ "data-orientation": e,
2551
+ "aria-orientation": n && !t ? "vertical" : void 0,
2552
+ role: t ? "none" : void 0,
2553
+ className: l(
2554
+ "m-0 shrink-0 border-0 border-ui-border-subtle",
2555
+ n ? "h-auto w-0 self-stretch border-s" : "h-0 w-full border-t",
2556
+ r
2557
+ ),
2558
+ ...a
2559
+ }
2560
+ );
2561
+ }
2562
+ const wa = {
2563
+ sm: "max-w-(--container-ui-xs)",
2564
+ md: "max-w-(--container-ui-sm)",
2565
+ lg: "max-w-(--container-ui-md)"
2566
+ }, Na = {
2567
+ end: l(
2568
+ "border-s",
2569
+ "ltr:data-entering:translate-x-full ltr:data-exiting:translate-x-full",
2570
+ "rtl:data-entering:-translate-x-full rtl:data-exiting:-translate-x-full"
2571
+ ),
2572
+ start: l(
2573
+ "border-e",
2574
+ "ltr:data-entering:-translate-x-full ltr:data-exiting:-translate-x-full",
2575
+ "rtl:data-entering:translate-x-full rtl:data-exiting:translate-x-full"
2576
+ )
2577
+ };
2578
+ function Ca(e, t) {
2579
+ return e === "bottom" ? {
2580
+ overlay: "items-end",
2581
+ panel: l(
2582
+ // Siempre queda a la vista una franja de la página: se entiende que es una capa
2583
+ "max-h-[85dvh] w-full rounded-t-lg border-t",
2584
+ "transition-[translate] data-entering:translate-y-full data-exiting:translate-y-full"
2585
+ ),
2586
+ dialog: "rounded-t-lg"
2587
+ } : {
2588
+ // justify-start / justify-end ya siguen la dirección del texto
2589
+ overlay: e === "end" ? "justify-end" : "justify-start",
2590
+ panel: l("h-full w-full transition-[translate]", Na[e], wa[t]),
2591
+ dialog: ""
2592
+ };
2593
+ }
2594
+ function za({ placement: e = "end", size: t = "md", ...r }) {
2595
+ return /* @__PURE__ */ i(Ge, { ...r, layout: Ca(e, t) });
2596
+ }
2597
+ function Se({
2598
+ className: e,
2599
+ type: t = "button",
2600
+ ...r
2601
+ }) {
2602
+ return /* @__PURE__ */ i(
2603
+ "button",
2604
+ {
2605
+ type: t,
2606
+ className: l(
2607
+ "inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-ui-fg-muted",
2608
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard hover:text-ui-fg",
2609
+ "disabled:pointer-events-none disabled:text-ui-fg-disabled",
2610
+ T,
2611
+ e
2612
+ ),
2613
+ ...r
2614
+ }
2615
+ );
2616
+ }
2617
+ function ka(e, t) {
2618
+ if (!t) return !0;
2619
+ const r = e.name.toLowerCase(), a = e.type.toLowerCase();
2620
+ return t.split(",").map((n) => n.trim().toLowerCase()).filter(Boolean).some((n) => n.startsWith(".") ? r.endsWith(n) : n.endsWith("/*") ? a.startsWith(n.slice(0, -1)) : a === n);
2621
+ }
2622
+ function Sa(e, t) {
2623
+ const r = ["byte", "kilobyte", "megabyte", "gigabyte"];
2624
+ let a = e, n = 0;
2625
+ for (; a >= 1024 && n < r.length - 1; )
2626
+ a /= 1024, n += 1;
2627
+ return new Intl.NumberFormat(t, {
2628
+ style: "unit",
2629
+ unit: r[n],
2630
+ unitDisplay: "short",
2631
+ maximumFractionDigits: n === 0 ? 0 : 1
2632
+ }).format(a);
2633
+ }
2634
+ function ft(e, t) {
2635
+ if (!e || typeof DataTransfer > "u") return;
2636
+ const r = new DataTransfer();
2637
+ for (const a of t) r.items.add(a);
2638
+ try {
2639
+ e.files = r.files;
2640
+ } catch {
2641
+ }
2642
+ }
2643
+ const Ia = {
2644
+ sm: "gap-ui-xs p-ui-sm text-ui-body-sm",
2645
+ md: "gap-ui-sm p-ui-md text-ui-body-sm",
2646
+ lg: "gap-ui-sm p-ui-lg text-ui-body"
2647
+ };
2648
+ function Zn({
2649
+ accept: e,
2650
+ multiple: t = !1,
2651
+ maxSize: r,
2652
+ maxFiles: a,
2653
+ value: n,
2654
+ defaultValue: s,
2655
+ onChange: o,
2656
+ onReject: d,
2657
+ name: c,
2658
+ className: m,
2659
+ ref: u,
2660
+ "aria-label": f,
2661
+ ...g
2662
+ }) {
2663
+ const x = I(), { locale: p } = Kt(), {
2664
+ size: y,
2665
+ invalid: v,
2666
+ disabled: h,
2667
+ required: N,
2668
+ id: C,
2669
+ "aria-describedby": S
2670
+ } = V(g), z = L(), w = C ?? `file-upload-${z}`, k = M(null), D = M(null), [A, F] = E(s ?? []), [j, ae] = E(!1), be = M(0), H = n ?? A;
2671
+ de(() => {
2672
+ ft(k.current, H);
2673
+ }, [H]);
2674
+ const tt = ($) => {
2675
+ n === void 0 && F($), o?.($);
2676
+ }, it = ($) => {
2677
+ const G = [], K = [];
2678
+ for (const O of $)
2679
+ ka(O, e) ? r !== void 0 && O.size > r ? G.push({ file: O, reason: "size" }) : K.push(O) : G.push({ file: O, reason: "type" });
2680
+ let U;
2681
+ if (t) {
2682
+ U = [...H, ...K];
2683
+ const O = a ?? 1 / 0;
2684
+ if (U.length > O) {
2685
+ for (const Si of U.slice(O))
2686
+ G.push({ file: Si, reason: "count" });
2687
+ U = U.slice(0, O);
2688
+ }
2689
+ } else {
2690
+ U = K.length > 0 ? [K[0]] : [...H];
2691
+ for (const O of K.slice(1))
2692
+ G.push({ file: O, reason: "count" });
2693
+ }
2694
+ K.length > 0 ? tt(U) : ft(k.current, H), G.length > 0 && d?.(G);
2695
+ }, ki = ($) => {
2696
+ const G = H.filter((K, U) => U !== $);
2697
+ tt(G), requestAnimationFrame(() => {
2698
+ const K = D.current?.querySelectorAll("button");
2699
+ (K?.[Math.min($, (K?.length ?? 0) - 1)] ?? k.current)?.focus();
2700
+ });
2701
+ };
2702
+ return /* @__PURE__ */ b("div", { className: "flex w-full flex-col gap-ui-sm", children: [
2703
+ /* @__PURE__ */ b(
2704
+ "label",
2705
+ {
2706
+ htmlFor: w,
2707
+ ...h ? {} : {
2708
+ onDragEnter: ($) => {
2709
+ $.preventDefault(), be.current += 1, ae(!0);
2710
+ },
2711
+ onDragOver: ($) => {
2712
+ $.preventDefault(), $.dataTransfer.dropEffect = "copy";
2713
+ },
2714
+ onDragLeave: () => {
2715
+ be.current -= 1, be.current <= 0 && ae(!1);
2716
+ },
2717
+ onDrop: ($) => {
2718
+ $.preventDefault(), be.current = 0, ae(!1), it(Array.from($.dataTransfer.files));
2719
+ }
2720
+ },
2721
+ "data-drag-over": j || void 0,
2722
+ className: l(
2723
+ "flex w-full cursor-pointer flex-wrap items-center justify-center rounded-md border border-dashed bg-ui-surface text-center text-ui-fg-muted",
2724
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
2725
+ Dt,
2726
+ v ? "border-ui-danger" : "border-ui-border hover:border-ui-border-hover",
2727
+ "data-drag-over:border-solid data-drag-over:border-ui-primary data-drag-over:bg-ui-primary-soft",
2728
+ h && "cursor-not-allowed border-ui-border-subtle bg-ui-surface-disabled text-ui-fg-disabled hover:border-ui-border-subtle",
2729
+ Ia[y],
2730
+ m
2731
+ ),
2732
+ children: [
2733
+ /* @__PURE__ */ i(
2734
+ "input",
2735
+ {
2736
+ ref: q(k, u),
2737
+ id: w,
2738
+ type: "file",
2739
+ className: "sr-only",
2740
+ ...e && { accept: e },
2741
+ multiple: t,
2742
+ ...c && { name: c },
2743
+ disabled: !!h,
2744
+ required: !!N && H.length === 0,
2745
+ "aria-required": N || void 0,
2746
+ "aria-invalid": v || void 0,
2747
+ ...f && { "aria-label": f },
2748
+ ...S && { "aria-describedby": S },
2749
+ onChange: ($) => it(Array.from($.currentTarget.files ?? []))
2750
+ }
2751
+ ),
2752
+ /* @__PURE__ */ i(Br, { "aria-hidden": "true", className: "size-5 shrink-0" }),
2753
+ /* @__PURE__ */ i(
2754
+ "span",
2755
+ {
2756
+ className: l(
2757
+ "rounded-md border px-ui-sm py-1 font-ui-medium",
2758
+ h ? "border-ui-border-subtle text-ui-fg-disabled" : "border-ui-border bg-ui-surface text-ui-fg"
2759
+ ),
2760
+ children: x["fileUpload.choose"](t)
2761
+ }
2762
+ ),
2763
+ " ",
2764
+ /* @__PURE__ */ i("span", { children: x["fileUpload.drop"](t) })
2765
+ ]
2766
+ }
2767
+ ),
2768
+ H.length > 0 && /* @__PURE__ */ i("ul", { ref: D, className: "flex flex-col gap-ui-xs", children: H.map(($, G) => /* @__PURE__ */ b(
2769
+ "li",
2770
+ {
2771
+ className: "flex items-center gap-ui-sm rounded-md border border-ui-border-subtle bg-ui-surface px-ui-sm py-ui-xs text-ui-body-sm",
2772
+ children: [
2773
+ /* @__PURE__ */ i(
2774
+ Dr,
2775
+ {
2776
+ "aria-hidden": "true",
2777
+ className: "size-4 shrink-0 text-ui-fg-muted"
2778
+ }
2779
+ ),
2780
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1 truncate text-ui-fg", children: $.name }),
2781
+ /* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-ui-fg-muted", children: Sa($.size, p) }),
2782
+ !h && /* @__PURE__ */ i(
2783
+ Se,
2784
+ {
2785
+ "aria-label": x["fileUpload.remove"]($.name),
2786
+ onClick: () => ki(G),
2787
+ children: /* @__PURE__ */ i(ee, { className: "size-4" })
2788
+ }
2789
+ )
2790
+ ]
2791
+ },
2792
+ `${$.name}-${$.size}-${$.lastModified}-${G}`
2793
+ )) }),
2794
+ /* @__PURE__ */ i("span", { role: "status", className: "sr-only", children: x["fileUpload.selected"](H.length) })
2795
+ ] });
2796
+ }
2797
+ const Qe = {
2798
+ none: "gap-0",
2799
+ xs: "gap-ui-xs",
2800
+ sm: "gap-ui-sm",
2801
+ md: "gap-ui-md",
2802
+ lg: "gap-ui-lg",
2803
+ xl: "gap-ui-xl",
2804
+ "2xl": "gap-ui-2xl"
2805
+ }, fi = {
2806
+ start: "items-start",
2807
+ center: "items-center",
2808
+ end: "items-end",
2809
+ stretch: "items-stretch",
2810
+ baseline: "items-baseline"
2811
+ }, bi = {
2812
+ start: "justify-start",
2813
+ center: "justify-center",
2814
+ end: "justify-end",
2815
+ between: "justify-between"
2816
+ };
2817
+ function Ye(e) {
2818
+ return e === "ul" || e === "ol" ? "list" : void 0;
2819
+ }
2820
+ const bt = {
2821
+ 1: "grid-cols-1",
2822
+ 2: "grid-cols-2",
2823
+ 3: "grid-cols-3",
2824
+ 4: "grid-cols-4",
2825
+ 5: "grid-cols-5",
2826
+ 6: "grid-cols-6"
2827
+ }, Ba = {
2828
+ xs: {
2829
+ 1: "@ui-xs:grid-cols-1",
2830
+ 2: "@ui-xs:grid-cols-2",
2831
+ 3: "@ui-xs:grid-cols-3",
2832
+ 4: "@ui-xs:grid-cols-4",
2833
+ 5: "@ui-xs:grid-cols-5",
2834
+ 6: "@ui-xs:grid-cols-6"
2835
+ },
2836
+ sm: {
2837
+ 1: "@ui-sm:grid-cols-1",
2838
+ 2: "@ui-sm:grid-cols-2",
2839
+ 3: "@ui-sm:grid-cols-3",
2840
+ 4: "@ui-sm:grid-cols-4",
2841
+ 5: "@ui-sm:grid-cols-5",
2842
+ 6: "@ui-sm:grid-cols-6"
2843
+ },
2844
+ md: {
2845
+ 1: "@ui-md:grid-cols-1",
2846
+ 2: "@ui-md:grid-cols-2",
2847
+ 3: "@ui-md:grid-cols-3",
2848
+ 4: "@ui-md:grid-cols-4",
2849
+ 5: "@ui-md:grid-cols-5",
2850
+ 6: "@ui-md:grid-cols-6"
2851
+ },
2852
+ lg: {
2853
+ 1: "@ui-lg:grid-cols-1",
2854
+ 2: "@ui-lg:grid-cols-2",
2855
+ 3: "@ui-lg:grid-cols-3",
2856
+ 4: "@ui-lg:grid-cols-4",
2857
+ 5: "@ui-lg:grid-cols-5",
2858
+ 6: "@ui-lg:grid-cols-6"
2859
+ },
2860
+ xl: {
2861
+ 1: "@ui-xl:grid-cols-1",
2862
+ 2: "@ui-xl:grid-cols-2",
2863
+ 3: "@ui-xl:grid-cols-3",
2864
+ 4: "@ui-xl:grid-cols-4",
2865
+ 5: "@ui-xl:grid-cols-5",
2866
+ 6: "@ui-xl:grid-cols-6"
2867
+ }
2868
+ }, gi = ["xs", "sm", "md", "lg", "xl"], Da = (e) => gi.includes(e);
2869
+ function Ta(e) {
2870
+ return typeof e == "number" ? bt[e] : l(
2871
+ bt[e.base ?? 1],
2872
+ gi.map((t) => {
2873
+ const r = e[t];
2874
+ return r ? Ba[t][r] : void 0;
2875
+ })
2876
+ );
2877
+ }
2878
+ function Aa({
2879
+ as: e = "div",
2880
+ minItemWidth: t,
2881
+ columns: r,
2882
+ gap: a = "md",
2883
+ className: n,
2884
+ style: s,
2885
+ ref: o,
2886
+ ...d
2887
+ }) {
2888
+ const c = e, m = t === void 0 ? void 0 : Da(t) ? `var(--container-ui-${t})` : t, u = /* @__PURE__ */ i(
2889
+ c,
2890
+ {
2891
+ ref: o,
2892
+ role: Ye(e),
2893
+ className: l(
2894
+ "m-0 grid p-0",
2895
+ Qe[a],
2896
+ m ? (
2897
+ // min(…, 100%): una columna nunca es más ancha que el contenedor (sin scroll a 320 px)
2898
+ "grid-cols-[repeat(auto-fill,minmax(min(var(--ui-grid-min),100%),1fr))]"
2899
+ ) : Ta(r ?? 1),
2900
+ n
2901
+ ),
2902
+ style: m ? { "--ui-grid-min": m, ...s } : s,
2903
+ ...d
2904
+ }
2905
+ );
2906
+ return r !== void 0 && typeof r == "object" && !m ? /* @__PURE__ */ i("div", { className: "@container", children: u }) : u;
2907
+ }
2908
+ function Jn({
2909
+ children: e,
2910
+ brand: t,
2911
+ legal: r,
2912
+ navigationLabel: a,
2913
+ className: n,
2914
+ ...s
2915
+ }) {
2916
+ const o = I();
2917
+ return /* @__PURE__ */ i(
2918
+ "footer",
2919
+ {
2920
+ className: l(
2921
+ "border-t border-ui-border-subtle bg-ui-surface-muted text-ui-fg",
2922
+ n
2923
+ ),
2924
+ ...s,
2925
+ children: /* @__PURE__ */ b("div", { className: "flex flex-col gap-ui-xl px-ui-md py-ui-xl", children: [
2926
+ (t || e) && /* @__PURE__ */ b("div", { className: "flex flex-col gap-ui-xl ui-lg:flex-row", children: [
2927
+ t && /* @__PURE__ */ i("div", { className: "flex max-w-(--container-ui-xs) flex-col gap-ui-sm", children: t }),
2928
+ e && /* @__PURE__ */ i(
2929
+ "nav",
2930
+ {
2931
+ "aria-label": a ?? o["footer.label"],
2932
+ className: "min-w-0 flex-1",
2933
+ children: /* @__PURE__ */ i(Aa, { minItemWidth: "10rem", gap: "xl", children: e })
2934
+ }
2935
+ )
2936
+ ] }),
2937
+ r && /* @__PURE__ */ i(
2938
+ "div",
2939
+ {
2940
+ className: l(
2941
+ "text-ui-caption text-ui-fg-muted",
2942
+ // Separado por un borde solo si hay algo arriba
2943
+ (t || e) && "border-t border-ui-border-subtle pt-ui-md"
2944
+ ),
2945
+ children: r
2946
+ }
2947
+ )
2948
+ ] })
2949
+ }
2950
+ );
2951
+ }
2952
+ function es({
2953
+ title: e,
2954
+ children: t,
2955
+ headingLevel: r = 2,
2956
+ className: a
2957
+ }) {
2958
+ return /* @__PURE__ */ b("div", { className: l("flex flex-col gap-ui-sm", a), children: [
2959
+ /* @__PURE__ */ i(ce, { level: r, size: "sm", children: e }),
2960
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-ui-xs text-ui-body-sm", children: t })
2961
+ ] });
2962
+ }
2963
+ function ts({
2964
+ tone: e = "neutral",
2965
+ className: t,
2966
+ ...r
2967
+ }) {
2968
+ return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
2969
+ Jt,
2970
+ {
2971
+ tone: e,
2972
+ className: l("inline-block py-0.5", t),
2973
+ ...r
2974
+ }
2975
+ ) });
2976
+ }
2977
+ const Ze = P(null), xi = P(!1), ve = "data-navbar-top", ge = "data-navbar-sub";
2978
+ function Te(e, t) {
2979
+ return e ? Array.from(e.querySelectorAll(`[${t}]`)) : [];
2980
+ }
2981
+ function gt(e, t, r) {
2982
+ const a = e.indexOf(t), n = {
2983
+ next: e[a + 1],
2984
+ prev: e[a - 1],
2985
+ first: e[0],
2986
+ last: e.at(-1)
2987
+ }[r];
2988
+ return n?.focus(), !!n;
2989
+ }
2990
+ function xt({
2991
+ children: e,
2992
+ brand: t,
2993
+ toggleLabel: r,
2994
+ orientation: a = "horizontal",
2995
+ collapsible: n = !0,
2996
+ onNavigate: s,
2997
+ className: o,
2998
+ "aria-label": d,
2999
+ ref: c,
3000
+ ...m
3001
+ }) {
3002
+ const u = I(), [f, g] = E(null), [x, p] = E(!1), y = M(null), v = M(null), h = L(), N = a === "vertical", C = n && !N;
3003
+ de(() => {
3004
+ if (f === null) return;
3005
+ const z = (w) => {
3006
+ y.current?.contains(w.target) || g(null);
3007
+ };
3008
+ return document.addEventListener("pointerdown", z), () => document.removeEventListener("pointerdown", z);
3009
+ }, [f]);
3010
+ const S = (z) => {
3011
+ const w = z.target, k = y.current, D = k ? getComputedStyle(k).direction === "rtl" : !1;
3012
+ if (z.key === "Escape") {
3013
+ const A = v.current;
3014
+ f === null && x && A && A.offsetParent !== null && (p(!1), A.focus(), z.preventDefault());
3015
+ return;
3016
+ }
3017
+ if (w.hasAttribute(ge)) {
3018
+ const A = w.closest("ul"), F = Te(A, ge), j = {
3019
+ ArrowDown: "next",
3020
+ ArrowUp: "prev",
3021
+ Home: "first",
3022
+ End: "last"
3023
+ }[z.key];
3024
+ j && gt(F, w, j) && z.preventDefault();
3025
+ return;
3026
+ }
3027
+ if (w.hasAttribute(ve)) {
3028
+ if (z.key === "ArrowDown" && w.getAttribute("aria-expanded") === "true") {
3029
+ const ae = document.getElementById(
3030
+ w.getAttribute("aria-controls") ?? ""
3031
+ );
3032
+ Te(ae, ge)[0]?.focus(), z.preventDefault();
3033
+ return;
3034
+ }
3035
+ const A = D ? "ArrowLeft" : "ArrowRight", F = D ? "ArrowRight" : "ArrowLeft", j = {
3036
+ [A]: "next",
3037
+ ArrowDown: "next",
3038
+ [F]: "prev",
3039
+ ArrowUp: "prev",
3040
+ Home: "first",
3041
+ End: "last"
3042
+ }[z.key];
3043
+ j && gt(Te(k, ve), w, j) && z.preventDefault();
3044
+ }
3045
+ };
3046
+ return /* @__PURE__ */ i(
3047
+ Ze,
3048
+ {
3049
+ value: {
3050
+ openMenu: f,
3051
+ setOpenMenu: g,
3052
+ closeAll: () => {
3053
+ g(null), p(!1), s?.();
3054
+ },
3055
+ vertical: N
3056
+ },
3057
+ children: /* @__PURE__ */ b(
3058
+ "nav",
3059
+ {
3060
+ ref: q(y, c),
3061
+ "aria-label": d ?? u["navBar.label"],
3062
+ onKeyDown: S,
3063
+ className: l(
3064
+ N ? "flex flex-col" : "flex flex-wrap items-center gap-x-ui-md gap-y-ui-xs",
3065
+ o
3066
+ ),
3067
+ ...m,
3068
+ children: [
3069
+ t && /* @__PURE__ */ i("div", { className: "me-auto flex items-center", children: t }),
3070
+ C && /* @__PURE__ */ b(
3071
+ "button",
3072
+ {
3073
+ ref: v,
3074
+ type: "button",
3075
+ "aria-expanded": x,
3076
+ "aria-controls": h,
3077
+ onClick: () => p((z) => !z),
3078
+ className: l(
3079
+ "inline-flex min-h-10 items-center gap-ui-xs rounded-md px-ui-sm text-ui-label font-ui-medium text-ui-fg",
3080
+ "hover:bg-ui-surface-muted ui-md:hidden",
3081
+ T
3082
+ ),
3083
+ children: [
3084
+ /* @__PURE__ */ i(Pt, { className: "size-5" }),
3085
+ r ?? u["navBar.toggle"]
3086
+ ]
3087
+ }
3088
+ ),
3089
+ /* @__PURE__ */ i(
3090
+ "ul",
3091
+ {
3092
+ id: h,
3093
+ className: l(
3094
+ N ? "flex w-full flex-col gap-ui-xs" : C ? [
3095
+ x ? "flex" : "hidden",
3096
+ "w-full flex-col gap-ui-xs",
3097
+ "ui-md:flex ui-md:w-auto ui-md:flex-row ui-md:items-center"
3098
+ ] : "flex flex-row items-center gap-ui-xs"
3099
+ ),
3100
+ children: e
3101
+ }
3102
+ )
3103
+ ]
3104
+ }
3105
+ )
3106
+ }
3107
+ );
3108
+ }
3109
+ const pi = l(
3110
+ "flex min-h-10 items-center gap-ui-xs rounded-md px-ui-sm text-ui-label font-ui-medium text-ui-fg",
3111
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard hover:bg-ui-surface-muted",
3112
+ T
3113
+ );
3114
+ function is({
3115
+ current: e = !1,
3116
+ className: t,
3117
+ onClick: r,
3118
+ children: a,
3119
+ ...n
3120
+ }) {
3121
+ const s = B(Ze), o = B(xi);
3122
+ return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
3123
+ "a",
3124
+ {
3125
+ [o ? ge : ve]: "",
3126
+ ...e && { "aria-current": "page" },
3127
+ onClick: (d) => {
3128
+ r?.(d), s?.closeAll();
3129
+ },
3130
+ className: l(
3131
+ pi,
3132
+ o && "w-full",
3133
+ // La actual se marca con subrayado grueso y peso, no solo con color
3134
+ "aria-[current=page]:font-ui-semibold aria-[current=page]:text-ui-primary",
3135
+ "aria-[current=page]:underline aria-[current=page]:decoration-2 aria-[current=page]:underline-offset-[0.4em]",
3136
+ t
3137
+ ),
3138
+ ...n,
3139
+ children: a
3140
+ }
3141
+ ) });
3142
+ }
3143
+ function rs({ label: e, children: t, className: r }) {
3144
+ const a = B(Ze), n = L(), s = L(), o = M(null), d = a?.openMenu === n, c = (m) => a?.setOpenMenu(m ? n : null);
3145
+ return /* @__PURE__ */ b(
3146
+ "li",
3147
+ {
3148
+ className: "relative",
3149
+ onKeyDown: (m) => {
3150
+ m.key === "Escape" && d && (c(!1), o.current?.focus(), m.stopPropagation());
3151
+ },
3152
+ onBlur: (m) => {
3153
+ const u = m.relatedTarget;
3154
+ d && u && !m.currentTarget.contains(u) && c(!1);
3155
+ },
3156
+ children: [
3157
+ /* @__PURE__ */ b(
3158
+ "button",
3159
+ {
3160
+ ref: o,
3161
+ type: "button",
3162
+ [ve]: "",
3163
+ "aria-expanded": d,
3164
+ "aria-controls": s,
3165
+ onClick: () => c(!d),
3166
+ className: l(
3167
+ pi,
3168
+ "w-full cursor-pointer justify-between",
3169
+ !a?.vertical && "ui-md:w-auto",
3170
+ r
3171
+ ),
3172
+ children: [
3173
+ e,
3174
+ /* @__PURE__ */ i(
3175
+ Y,
3176
+ {
3177
+ className: l(
3178
+ "size-4 text-ui-fg-muted transition-transform duration-(--ui-duration-fast) ease-ui-standard",
3179
+ d && "rotate-180"
3180
+ )
3181
+ }
3182
+ )
3183
+ ]
3184
+ }
3185
+ ),
3186
+ /* @__PURE__ */ i(
3187
+ "ul",
3188
+ {
3189
+ id: s,
3190
+ hidden: !d,
3191
+ className: l(
3192
+ // En angostas (y en vertical), debajo del botón y con sangría; en anchas, flota bajo él
3193
+ "flex flex-col gap-ui-xs ps-ui-md",
3194
+ !a?.vertical && [
3195
+ "ui-md:absolute ui-md:start-0 ui-md:top-full ui-md:z-(--ui-z-popover) ui-md:mt-ui-xs ui-md:min-w-56 ui-md:p-ui-xs",
3196
+ "ui-md:rounded-lg ui-md:border ui-md:border-ui-border-subtle ui-md:bg-ui-surface-raised ui-md:shadow-ui-overlay"
3197
+ ]
3198
+ ),
3199
+ children: /* @__PURE__ */ i(xi, { value: !0, children: t })
3200
+ }
3201
+ )
3202
+ ]
3203
+ }
3204
+ );
3205
+ }
3206
+ function as({
3207
+ brand: e,
3208
+ navigation: t,
3209
+ navigationLabel: r,
3210
+ actions: a,
3211
+ sticky: n = !1,
3212
+ menuLabel: s,
3213
+ className: o,
3214
+ ...d
3215
+ }) {
3216
+ const c = I(), [m, u] = E(!1), f = s ?? c["navBar.toggle"], g = B(Yt)?.sidebar, x = !!(t || g);
3217
+ return /* @__PURE__ */ i(
3218
+ "header",
3219
+ {
3220
+ className: l(
3221
+ "border-b border-ui-border-subtle bg-ui-surface text-ui-fg",
3222
+ n && "sticky top-0 z-(--ui-z-sticky)",
3223
+ o
3224
+ ),
3225
+ ...d,
3226
+ children: /* @__PURE__ */ b("div", { className: "flex min-h-16 items-center gap-ui-md px-ui-md", children: [
3227
+ x && /* @__PURE__ */ b(R, { children: [
3228
+ /* @__PURE__ */ i(
3229
+ Ce,
3230
+ {
3231
+ label: f,
3232
+ className: "ui-md:hidden",
3233
+ onClick: () => u(!0),
3234
+ children: /* @__PURE__ */ i(Pt, {})
3235
+ }
3236
+ ),
3237
+ /* @__PURE__ */ i(
3238
+ za,
3239
+ {
3240
+ title: f,
3241
+ placement: "start",
3242
+ size: "sm",
3243
+ open: m,
3244
+ onOpenChange: u,
3245
+ children: /* @__PURE__ */ i(Qt, { children: /* @__PURE__ */ b(
3246
+ "div",
3247
+ {
3248
+ className: "flex flex-col gap-ui-lg",
3249
+ onClick: (p) => {
3250
+ p.target.closest("a[href]") && u(!1);
3251
+ },
3252
+ children: [
3253
+ t && /* @__PURE__ */ i(xt, { orientation: "vertical", "aria-label": r, children: t }),
3254
+ g
3255
+ ]
3256
+ }
3257
+ ) })
3258
+ }
3259
+ )
3260
+ ] }),
3261
+ /* @__PURE__ */ i("div", { className: "flex shrink-0 items-center", children: e }),
3262
+ t && // En angostas está en el Drawer
3263
+ /* @__PURE__ */ i(
3264
+ xt,
3265
+ {
3266
+ "aria-label": r,
3267
+ collapsible: !1,
3268
+ className: "hidden ui-md:flex",
3269
+ children: t
3270
+ }
3271
+ ),
3272
+ a && /* @__PURE__ */ i("div", { className: "ms-auto flex items-center gap-ui-xs", children: a })
3273
+ ] })
3274
+ }
3275
+ );
3276
+ }
3277
+ function ns({
3278
+ as: e = "div",
3279
+ gap: t = "sm",
3280
+ align: r = "center",
3281
+ justify: a,
3282
+ wrap: n = !0,
3283
+ className: s,
3284
+ ref: o,
3285
+ ...d
3286
+ }) {
3287
+ return /* @__PURE__ */ i(
3288
+ e,
3289
+ {
3290
+ ref: o,
3291
+ role: Ye(e),
3292
+ className: l(
3293
+ "m-0 flex flex-row p-0",
3294
+ n ? "flex-wrap" : "flex-nowrap",
3295
+ Qe[t],
3296
+ fi[r],
3297
+ a && bi[a],
3298
+ s
3299
+ ),
3300
+ ...d
3301
+ }
3302
+ );
3303
+ }
3304
+ function $a() {
3305
+ try {
3306
+ return process.env.NODE_ENV === "production";
3307
+ } catch {
3308
+ return !1;
3309
+ }
3310
+ }
3311
+ function hi(e, t) {
3312
+ e && !$a() && console.warn(`[@frantsiles/components] ${t}`);
3313
+ }
3314
+ const Ma = {
3315
+ sm: "min-h-6 gap-1 px-2 text-ui-caption",
3316
+ md: "min-h-7 gap-1.5 px-2.5 text-ui-body-sm"
3317
+ };
3318
+ function Ea({
3319
+ children: e,
3320
+ tone: t = "neutral",
3321
+ size: r = "md",
3322
+ icon: a,
3323
+ onRemove: n,
3324
+ removeLabel: s,
3325
+ disabled: o = !1,
3326
+ className: d,
3327
+ ...c
3328
+ }) {
3329
+ const m = I(), u = typeof e == "string" || typeof e == "number" ? String(e) : void 0, f = s ?? (u !== void 0 ? m["tag.remove"](u) : void 0);
3330
+ return hi(
3331
+ !!n && !f,
3332
+ "Tag: con onRemove y contenido que no es texto, pasa `removeLabel` para que el botón tenga nombre accesible."
3333
+ ), /* @__PURE__ */ b(
3334
+ "span",
3335
+ {
3336
+ className: l(
3337
+ "inline-flex max-w-full items-center rounded-full border font-ui-medium",
3338
+ Ma[r],
3339
+ Zt[t],
3340
+ n && "pe-0.5",
3341
+ d
3342
+ ),
3343
+ ...c,
3344
+ children: [
3345
+ a && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0", children: a }),
3346
+ /* @__PURE__ */ i("span", { className: "truncate", title: u, children: e }),
3347
+ n && /* @__PURE__ */ i(
3348
+ Se,
3349
+ {
3350
+ "aria-label": f ?? m["tag.removeUnnamed"],
3351
+ onClick: n,
3352
+ disabled: o,
3353
+ className: "rounded-full text-current hover:text-current hover:bg-current/10",
3354
+ children: /* @__PURE__ */ i(ee, { size: r === "sm" ? "xs" : "sm" })
3355
+ }
3356
+ )
3357
+ ]
3358
+ }
3359
+ );
3360
+ }
3361
+ function ss({
3362
+ children: e,
3363
+ value: t,
3364
+ defaultValue: r,
3365
+ onChange: a,
3366
+ inputValue: n,
3367
+ defaultInputValue: s,
3368
+ onInputChange: o,
3369
+ openOn: d = "input",
3370
+ emptyState: c,
3371
+ placeholder: m,
3372
+ name: u,
3373
+ className: f,
3374
+ ref: g,
3375
+ "aria-label": x,
3376
+ "aria-labelledby": p,
3377
+ ...y
3378
+ }) {
3379
+ const v = ze(), { size: h, invalid: N, disabled: C, required: S, id: z, "aria-describedby": w } = V(y), k = p ?? v, D = M(null);
3380
+ return /* @__PURE__ */ b(
3381
+ kt,
3382
+ {
3383
+ selectionMode: "multiple",
3384
+ ...t !== void 0 && { value: t },
3385
+ ...r !== void 0 && { defaultValue: r },
3386
+ onChange: (A) => a?.(A.map(String)),
3387
+ ...n !== void 0 && { inputValue: n },
3388
+ ...s !== void 0 && { defaultInputValue: s },
3389
+ ...o && { onInputChange: o },
3390
+ menuTrigger: d,
3391
+ allowsEmptyCollection: !0,
3392
+ ...u && { name: u },
3393
+ isDisabled: !!C,
3394
+ isRequired: !!S,
3395
+ isInvalid: N,
3396
+ ...k ? { "aria-labelledby": k } : x && { "aria-label": x },
3397
+ ...w && { "aria-describedby": w },
3398
+ validationBehavior: "aria",
3399
+ className: "flex w-full flex-col",
3400
+ children: [
3401
+ /* @__PURE__ */ i(li, { size: h, invalid: N, disabled: !!C, className: l("py-1", f), children: /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-1 self-stretch", children: [
3402
+ /* @__PURE__ */ i(La, { size: h, disabled: !!C, inputRef: D }),
3403
+ /* @__PURE__ */ i(
3404
+ di,
3405
+ {
3406
+ ref: q(D, g),
3407
+ id: z,
3408
+ placeholder: m,
3409
+ className: "w-0 min-w-16 self-stretch"
3410
+ }
3411
+ )
3412
+ ] }) }),
3413
+ /* @__PURE__ */ i(sr, { className: "sr-only", children: ({ selectedText: A }) => A }),
3414
+ /* @__PURE__ */ i(ci, { size: h, labelledBy: k, ariaLabel: x, emptyState: c, children: e })
3415
+ ]
3416
+ }
3417
+ );
3418
+ }
3419
+ const Ra = { sm: "sm", md: "sm", lg: "md" };
3420
+ function La({
3421
+ size: e,
3422
+ disabled: t,
3423
+ inputRef: r
3424
+ }) {
3425
+ const a = B(or), n = I();
3426
+ return !a || a.selectedItems.length === 0 ? null : (
3427
+ // Con la lista abierta, React Aria oculta (aria-hidden) todo lo de afuera;
3428
+ // inert saca también los botones del foco, que si no quedarían ocultos y enfocables
3429
+ /* @__PURE__ */ i("span", { className: "contents", inert: a.isOpen, children: a.selectedItems.map((s) => /* @__PURE__ */ i(
3430
+ Ea,
3431
+ {
3432
+ size: Ra[e],
3433
+ disabled: t,
3434
+ removeLabel: n["tag.remove"](s.textValue),
3435
+ onRemove: () => {
3436
+ const o = Array.isArray(a.value) ? a.value : [];
3437
+ a.setValue(o.filter((d) => d !== s.key)), r.current?.focus();
3438
+ },
3439
+ children: s.textValue
3440
+ },
3441
+ s.key
3442
+ )) })
3443
+ );
3444
+ }
3445
+ const Pa = {
3446
+ sm: "pe-8",
3447
+ md: "pe-9",
3448
+ lg: "pe-11"
3449
+ }, ja = {
3450
+ sm: "end-2.5 size-4",
3451
+ md: "end-3 size-4",
3452
+ lg: "end-4 size-5"
3453
+ };
3454
+ function os({
3455
+ className: e,
3456
+ selectClassName: t,
3457
+ placeholder: r,
3458
+ children: a,
3459
+ value: n,
3460
+ defaultValue: s,
3461
+ ...o
3462
+ }) {
3463
+ const { size: d, invalid: c, ...m } = V(o), u = !!m.disabled, f = n === void 0 && s === void 0 && r !== void 0 ? "" : s;
3464
+ return /* @__PURE__ */ b("div", { className: l("relative flex w-full", e), children: [
3465
+ /* @__PURE__ */ b(
3466
+ "select",
3467
+ {
3468
+ value: n,
3469
+ defaultValue: f,
3470
+ className: l(
3471
+ ie({ invalid: c, disabled: u, readOnly: !1 }),
3472
+ me[d],
3473
+ Pa[d],
3474
+ "cursor-pointer appearance-none truncate",
3475
+ // El select es el control con foco: el anillo va en él
3476
+ T,
3477
+ // Placeholder elegido: en gris, como en Input (las opciones de la lista, no)
3478
+ 'has-[option[value=""]:checked]:text-ui-fg-muted [&_option]:text-ui-fg',
3479
+ t
3480
+ ),
3481
+ ...m,
3482
+ children: [
3483
+ r !== void 0 && /* @__PURE__ */ i("option", { value: "", children: r }),
3484
+ a
3485
+ ]
3486
+ }
3487
+ ),
3488
+ /* @__PURE__ */ i(
3489
+ Y,
3490
+ {
3491
+ className: l(
3492
+ "pointer-events-none absolute inset-y-0 my-auto text-ui-fg-muted",
3493
+ u && "text-ui-fg-disabled",
3494
+ ja[d]
3495
+ )
3496
+ }
3497
+ )
3498
+ ] });
3499
+ }
3500
+ function ls({
3501
+ title: e,
3502
+ headingLevel: t = 1,
3503
+ description: r,
3504
+ breadcrumbs: a,
3505
+ actions: n,
3506
+ className: s,
3507
+ ...o
3508
+ }) {
3509
+ return (
3510
+ // Es un @container: las acciones suben al costado según el ancho de la
3511
+ // cabecera, no el de la pantalla (con barra lateral, el contenido es más angosto)
3512
+ /* @__PURE__ */ b(
3513
+ "div",
3514
+ {
3515
+ className: l("@container flex flex-col gap-ui-sm", s),
3516
+ ...o,
3517
+ children: [
3518
+ a,
3519
+ /* @__PURE__ */ b("div", { className: "flex flex-col gap-ui-md @ui-md:flex-row @ui-md:items-start @ui-md:justify-between", children: [
3520
+ /* @__PURE__ */ b("div", { className: "flex min-w-0 flex-col gap-ui-xs", children: [
3521
+ /* @__PURE__ */ i(ce, { level: t, size: "xl", children: e }),
3522
+ r && /* @__PURE__ */ i("p", { className: "m-0 max-w-(--container-ui-lg) text-ui-body text-ui-fg-muted", children: r })
3523
+ ] }),
3524
+ n && /* @__PURE__ */ i("div", { className: "flex shrink-0 flex-wrap items-center gap-ui-sm", children: n })
3525
+ ] })
3526
+ ]
3527
+ }
3528
+ )
3529
+ );
3530
+ }
3531
+ function Ga(e, t, r = 1) {
3532
+ const a = 2 * r + 5;
3533
+ if (t <= a) return Array.from({ length: t }, (m, u) => u + 1);
3534
+ const n = Math.max(e - r, 1), s = Math.min(e + r, t), o = n > 3, d = s < t - 2, c = 3 + 2 * r;
3535
+ return o ? d ? [
3536
+ 1,
3537
+ "start-ellipsis",
3538
+ ...Array.from({ length: s - n + 1 }, (m, u) => n + u),
3539
+ "end-ellipsis",
3540
+ t
3541
+ ] : [1, "start-ellipsis", ...Array.from({ length: c }, (m, u) => t - c + 1 + u)] : [...Array.from({ length: c }, (m, u) => u + 1), "end-ellipsis", t];
3542
+ }
3543
+ const pt = l(
3544
+ // 40 px de alto (36 de ancho en pantallas angostas, para que entre en una fila):
3545
+ // área táctil cómoda; WCAG 2.5.8 pide 24
3546
+ "inline-flex min-h-10 min-w-9 ui-sm:min-w-10 shrink-0 items-center justify-center gap-ui-xs rounded-md border px-ui-sm",
3547
+ "text-ui-label font-ui-medium transition-colors duration-(--ui-duration-fast) ease-ui-standard",
3548
+ T
3549
+ );
3550
+ function Ae({ page: e, getHref: t, onChange: r, disabled: a, className: n, children: s, ...o }) {
3551
+ return t ? a ? /* @__PURE__ */ i("a", { "aria-disabled": "true", className: n, ...o, children: s }) : /* @__PURE__ */ i("a", { href: t(e), onClick: () => r?.(e), className: n, ...o, children: s }) : /* @__PURE__ */ i("button", { type: "button", disabled: a, onClick: () => r?.(e), className: n, ...o, children: s });
3552
+ }
3553
+ function ds({
3554
+ page: e,
3555
+ totalPages: t,
3556
+ onChange: r,
3557
+ getHref: a,
3558
+ siblings: n = 1,
3559
+ className: s,
3560
+ "aria-label": o,
3561
+ ...d
3562
+ }) {
3563
+ const c = I();
3564
+ if (t < 1) return null;
3565
+ const m = Math.min(Math.max(e, 1), t), u = l(
3566
+ pt,
3567
+ "border-transparent text-ui-fg hover:bg-ui-surface-muted",
3568
+ "aria-disabled:cursor-not-allowed aria-disabled:text-ui-fg-disabled aria-disabled:hover:bg-transparent",
3569
+ "disabled:cursor-not-allowed disabled:text-ui-fg-disabled disabled:hover:bg-transparent"
3570
+ );
3571
+ return /* @__PURE__ */ i("nav", { "aria-label": o ?? c["pagination.label"], className: s, ...d, children: /* @__PURE__ */ b("ul", { className: "flex flex-wrap items-center gap-ui-xs", children: [
3572
+ /* @__PURE__ */ i("li", { children: /* @__PURE__ */ b(
3573
+ Ae,
3574
+ {
3575
+ page: m - 1,
3576
+ getHref: a,
3577
+ onChange: r,
3578
+ disabled: m === 1,
3579
+ className: u,
3580
+ children: [
3581
+ /* @__PURE__ */ i($t, { className: "size-4 rtl:-scale-x-100" }),
3582
+ /* @__PURE__ */ i("span", { className: "sr-only ui-sm:not-sr-only", children: c["pagination.previous"] })
3583
+ ]
3584
+ }
3585
+ ) }),
3586
+ Ga(m, t, n).map(
3587
+ (f) => typeof f == "number" ? /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
3588
+ Ae,
3589
+ {
3590
+ page: f,
3591
+ getHref: a,
3592
+ onChange: r,
3593
+ "aria-label": c["pagination.page"](f),
3594
+ ...f === m && { "aria-current": "page" },
3595
+ className: l(
3596
+ pt,
3597
+ // La actual se distingue por el borde y el peso, no solo por el color
3598
+ f === m ? "border-ui-primary bg-ui-primary-soft font-ui-semibold text-ui-primary" : "border-transparent text-ui-fg hover:bg-ui-surface-muted"
3599
+ ),
3600
+ children: f
3601
+ }
3602
+ ) }, f) : /* @__PURE__ */ i("li", { "aria-hidden": "true", className: "inline-flex min-w-6 justify-center text-ui-fg-muted", children: "…" }, f)
3603
+ ),
3604
+ /* @__PURE__ */ i("li", { children: /* @__PURE__ */ b(
3605
+ Ae,
3606
+ {
3607
+ page: m + 1,
3608
+ getHref: a,
3609
+ onChange: r,
3610
+ disabled: m === t,
3611
+ className: u,
3612
+ children: [
3613
+ /* @__PURE__ */ i("span", { className: "sr-only ui-sm:not-sr-only", children: c["pagination.next"] }),
3614
+ /* @__PURE__ */ i(Pe, { className: "size-4 rtl:-scale-x-100" })
3615
+ ]
3616
+ }
3617
+ ) })
3618
+ ] }) });
3619
+ }
3620
+ function cs({
3621
+ toggleLabel: e,
3622
+ autoComplete: t = "current-password",
3623
+ ...r
3624
+ }) {
3625
+ const a = I(), [n, s] = E(!1), o = L(), { id: d, disabled: c } = V(r), m = d ?? `password-${o}`;
3626
+ return /* @__PURE__ */ i(
3627
+ _e,
3628
+ {
3629
+ ...r,
3630
+ id: m,
3631
+ type: n ? "text" : "password",
3632
+ autoComplete: t,
3633
+ spellCheck: !1,
3634
+ autoCapitalize: "none",
3635
+ autoCorrect: "off",
3636
+ endAdornment: /* @__PURE__ */ i(
3637
+ Se,
3638
+ {
3639
+ "aria-label": e ?? a["passwordInput.show"],
3640
+ "aria-pressed": n,
3641
+ "aria-controls": m,
3642
+ disabled: c,
3643
+ onClick: () => s((u) => !u),
3644
+ className: "-me-1",
3645
+ children: n ? /* @__PURE__ */ i(Tr, { size: "sm" }) : /* @__PURE__ */ i(Ar, { size: "sm" })
3646
+ }
3647
+ )
3648
+ }
3649
+ );
3650
+ }
3651
+ const vi = P(null);
3652
+ function us({
3653
+ value: e,
3654
+ children: t,
3655
+ description: r,
3656
+ size: a,
3657
+ className: n,
3658
+ id: s,
3659
+ "aria-describedby": o,
3660
+ onChange: d,
3661
+ ...c
3662
+ }) {
3663
+ const m = B(vi), u = ue("radio", { id: s, description: r, describedBy: o }), f = a ?? m?.size ?? "md", g = m?.invalid === !0, x = (p) => {
3664
+ p.currentTarget.checked && m?.select(e), d?.(p);
3665
+ };
3666
+ return /* @__PURE__ */ i(
3667
+ Ke,
3668
+ {
3669
+ id: u.id,
3670
+ size: f,
3671
+ className: n,
3672
+ description: r,
3673
+ descriptionId: u.descriptionId,
3674
+ control: /* @__PURE__ */ b(R, { children: [
3675
+ /* @__PURE__ */ i(
3676
+ "input",
3677
+ {
3678
+ type: "radio",
3679
+ id: u.id,
3680
+ value: e,
3681
+ name: m?.name,
3682
+ checked: m ? m.value === e : void 0,
3683
+ required: m?.required || void 0,
3684
+ "aria-describedby": u.describedBy,
3685
+ "aria-invalid": g || void 0,
3686
+ onChange: x,
3687
+ className: l(
3688
+ ai(f, g),
3689
+ "rounded-full checked:border-ui-primary enabled:checked:hover:border-ui-primary-hover",
3690
+ "disabled:checked:border-ui-fg-disabled"
3691
+ ),
3692
+ ...c
3693
+ }
3694
+ ),
3695
+ /* @__PURE__ */ i(
3696
+ "svg",
3697
+ {
3698
+ viewBox: "0 0 16 16",
3699
+ "aria-hidden": "true",
3700
+ focusable: "false",
3701
+ className: l(
3702
+ "pointer-events-none absolute inset-0 m-auto hidden size-[0.5em] text-ui-primary",
3703
+ "peer-checked:block peer-disabled:text-ui-fg-disabled"
3704
+ ),
3705
+ children: /* @__PURE__ */ i("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" })
3706
+ }
3707
+ )
3708
+ ] }),
3709
+ children: t
3710
+ }
3711
+ );
3712
+ }
3713
+ function ms({
3714
+ value: e,
3715
+ defaultValue: t,
3716
+ onChange: r,
3717
+ name: a,
3718
+ size: n = "md",
3719
+ required: s = !1,
3720
+ id: o,
3721
+ description: d,
3722
+ error: c,
3723
+ "aria-describedby": m,
3724
+ ...u
3725
+ }) {
3726
+ const f = ue("radio-group", { id: o, description: d, error: c, describedBy: m }), g = L(), [x, p] = E(t ?? null), y = e === void 0 ? x : e, v = Ne(
3727
+ () => ({
3728
+ name: a ?? `radio-${g}`,
3729
+ value: y,
3730
+ size: n,
3731
+ required: s,
3732
+ invalid: f.hasError,
3733
+ select: (h) => {
3734
+ e === void 0 && p(h), r?.(h);
3735
+ }
3736
+ }),
3737
+ [a, g, y, n, s, f.hasError, e, r]
3738
+ );
3739
+ return /* @__PURE__ */ i(vi, { value: v, children: /* @__PURE__ */ i(
3740
+ ni,
3741
+ {
3742
+ ids: f,
3743
+ role: "radiogroup",
3744
+ "aria-required": s || void 0,
3745
+ "aria-invalid": f.hasError || void 0,
3746
+ required: s,
3747
+ description: d,
3748
+ error: c,
3749
+ ...u
3750
+ }
3751
+ ) });
3752
+ }
3753
+ function Oa(e, t) {
3754
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(e, t), e.dispatchEvent(new Event("input", { bubbles: !0 }));
3755
+ }
3756
+ function fs({
3757
+ onClear: e,
3758
+ clearLabel: t,
3759
+ onChange: r,
3760
+ onKeyDown: a,
3761
+ ref: n,
3762
+ ...s
3763
+ }) {
3764
+ const o = I(), d = M(null), c = s.value !== void 0, [m, u] = E(
3765
+ !!s.defaultValue
3766
+ ), f = c ? String(s.value).length > 0 : m, g = !!s.disabled, x = f && !g && !s.readOnly, p = () => {
3767
+ const h = d.current;
3768
+ h && (Oa(h, ""), h.focus(), e?.());
3769
+ }, y = (h) => {
3770
+ c || u(h.target.value.length > 0), r?.(h);
3771
+ }, v = (h) => {
3772
+ a?.(h), h.key === "Escape" && x && !h.defaultPrevented && (h.preventDefault(), h.stopPropagation(), p());
3773
+ };
3774
+ return /* @__PURE__ */ i(
3775
+ _e,
3776
+ {
3777
+ ...s,
3778
+ ref: q(d, n),
3779
+ type: "search",
3780
+ enterKeyHint: s.enterKeyHint ?? "search",
3781
+ onChange: y,
3782
+ onKeyDown: v,
3783
+ startIcon: /* @__PURE__ */ i($r, { size: "sm" }),
3784
+ inputClassName: "[&::-webkit-search-cancel-button]:appearance-none",
3785
+ endAdornment: x ? /* @__PURE__ */ i(Se, { "aria-label": t ?? o["searchInput.clear"], onClick: p, className: "-me-1", children: /* @__PURE__ */ i(ee, { size: "sm" }) }) : void 0
3786
+ }
3787
+ );
3788
+ }
3789
+ const Fa = {
3790
+ sm: "size-4",
3791
+ md: "size-4",
3792
+ lg: "size-5"
3793
+ };
3794
+ function bs({
3795
+ children: e,
3796
+ value: t,
3797
+ defaultValue: r,
3798
+ onChange: a,
3799
+ open: n,
3800
+ defaultOpen: s,
3801
+ onOpenChange: o,
3802
+ placeholder: d,
3803
+ name: c,
3804
+ className: m,
3805
+ ref: u,
3806
+ "aria-label": f,
3807
+ "aria-labelledby": g,
3808
+ ...x
3809
+ }) {
3810
+ const p = I(), y = ze(), { size: v, invalid: h, disabled: N, required: C, id: S, "aria-describedby": z } = V(x), w = g ?? y, k = L();
3811
+ return /* @__PURE__ */ b(
3812
+ lr,
3813
+ {
3814
+ ...t !== void 0 && { selectedKey: t },
3815
+ ...r !== void 0 && { defaultSelectedKey: r },
3816
+ onSelectionChange: (D) => a?.(D === null ? null : String(D)),
3817
+ ...n !== void 0 && { isOpen: n },
3818
+ ...s !== void 0 && { defaultOpen: s },
3819
+ ...o && { onOpenChange: o },
3820
+ placeholder: d ?? p["select.placeholder"],
3821
+ ...c && { name: c },
3822
+ isDisabled: !!N,
3823
+ isRequired: !!C,
3824
+ isInvalid: h,
3825
+ ...w ? { "aria-labelledby": w } : f && { "aria-label": f },
3826
+ ...z && { "aria-describedby": z },
3827
+ validationBehavior: "aria",
3828
+ className: "flex w-full",
3829
+ children: [
3830
+ /* @__PURE__ */ b(
3831
+ W,
3832
+ {
3833
+ ref: u,
3834
+ ...S && { id: S },
3835
+ ...w && { "aria-labelledby": `${w} ${k}` },
3836
+ className: l(
3837
+ ie({ invalid: h, disabled: !!N, readOnly: !1 }),
3838
+ me[v],
3839
+ "flex cursor-pointer items-center justify-between text-start",
3840
+ T,
3841
+ N && "cursor-not-allowed",
3842
+ m
3843
+ ),
3844
+ children: [
3845
+ /* @__PURE__ */ i(
3846
+ dr,
3847
+ {
3848
+ id: k,
3849
+ className: "min-w-0 flex-1 truncate data-placeholder:text-ui-fg-muted",
3850
+ children: ({ isPlaceholder: D, selectedText: A, defaultChildren: F }) => D ? F : A
3851
+ }
3852
+ ),
3853
+ /* @__PURE__ */ i(
3854
+ Y,
3855
+ {
3856
+ className: l("text-ui-fg-muted", N && "text-ui-fg-disabled", Fa[v])
3857
+ }
3858
+ )
3859
+ ]
3860
+ }
3861
+ ),
3862
+ /* @__PURE__ */ i(
3863
+ J,
3864
+ {
3865
+ offset: 4,
3866
+ className: l(re, "flex min-w-(--trigger-width) flex-col"),
3867
+ children: /* @__PURE__ */ i(ke, { value: v, children: /* @__PURE__ */ i(Re, { className: oi, children: e }) })
3868
+ }
3869
+ )
3870
+ ]
3871
+ }
3872
+ );
3873
+ }
3874
+ const se = "data-sidenav-item";
3875
+ function yi(e) {
3876
+ return te.toArray(e).some((t) => je(t) ? !!t.props.current || yi(t.props.children) : !1);
3877
+ }
3878
+ function Ha(e) {
3879
+ return Array.from(e.querySelectorAll(`[${se}]`)).filter((t) => !t.closest("[hidden]"));
3880
+ }
3881
+ function gs({ children: e, className: t, "aria-label": r, ref: a, ...n }) {
3882
+ const s = I(), o = M(null), d = (c) => {
3883
+ const m = o.current, u = c.target;
3884
+ if (!m || !u.hasAttribute(se)) return;
3885
+ const f = Ha(m), g = f.indexOf(u), p = getComputedStyle(m).direction === "rtl" ? { ArrowLeft: "ArrowRight", ArrowRight: "ArrowLeft" }[c.key] ?? c.key : c.key, y = u.getAttribute("aria-expanded");
3886
+ let v;
3887
+ if (p === "ArrowDown") v = f[g + 1];
3888
+ else if (p === "ArrowUp") v = f[g - 1];
3889
+ else if (p === "Home") v = f[0];
3890
+ else if (p === "End") v = f.at(-1);
3891
+ else if (p === "ArrowRight" && y === "false")
3892
+ u.click();
3893
+ else if (p === "ArrowRight" && y === "true")
3894
+ v = f[g + 1];
3895
+ else if (p === "ArrowLeft" && y === "true")
3896
+ u.click();
3897
+ else if (p === "ArrowLeft")
3898
+ v = u.closest("ul")?.closest("li")?.querySelector(`:scope > [${se}]`) ?? void 0;
3899
+ else
3900
+ return;
3901
+ v?.focus(), c.preventDefault();
3902
+ };
3903
+ return /* @__PURE__ */ i(
3904
+ "nav",
3905
+ {
3906
+ ref: q(o, a),
3907
+ "aria-label": r ?? s["sideNav.label"],
3908
+ onKeyDown: d,
3909
+ className: l("flex flex-col", t),
3910
+ ...n,
3911
+ children: /* @__PURE__ */ i("ul", { className: "flex flex-col gap-ui-xs", children: e })
3912
+ }
3913
+ );
3914
+ }
3915
+ const wi = l(
3916
+ "relative flex min-h-10 w-full items-center gap-ui-sm rounded-md px-ui-sm text-start text-ui-label font-ui-medium text-ui-fg",
3917
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard hover:bg-ui-surface-muted",
3918
+ T
3919
+ );
3920
+ function xs({ current: e = !1, icon: t, className: r, children: a, ...n }) {
3921
+ return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ b(
3922
+ "a",
3923
+ {
3924
+ [se]: "",
3925
+ ...e && { "aria-current": "page" },
3926
+ className: l(
3927
+ wi,
3928
+ // La actual: fondo, peso y una barra al inicio, no solo color
3929
+ "aria-[current=page]:bg-ui-primary-soft aria-[current=page]:font-ui-semibold aria-[current=page]:text-ui-primary",
3930
+ "aria-[current=page]:before:absolute aria-[current=page]:before:inset-y-2 aria-[current=page]:before:start-0",
3931
+ "aria-[current=page]:before:w-1 aria-[current=page]:before:rounded-full aria-[current=page]:before:bg-ui-primary",
3932
+ r
3933
+ ),
3934
+ ...n,
3935
+ children: [
3936
+ t && /* @__PURE__ */ i("span", { className: "flex shrink-0 [&_svg]:size-4", children: t }),
3937
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: a })
3938
+ ]
3939
+ }
3940
+ ) });
3941
+ }
3942
+ function ps({
3943
+ label: e,
3944
+ children: t,
3945
+ icon: r,
3946
+ open: a,
3947
+ defaultOpen: n,
3948
+ onOpenChange: s,
3949
+ className: o
3950
+ }) {
3951
+ const d = L(), [c, m] = E(() => n ?? yi(t)), u = a ?? c, f = () => {
3952
+ a === void 0 && m(!u), s?.(!u);
3953
+ };
3954
+ return /* @__PURE__ */ b("li", { children: [
3955
+ /* @__PURE__ */ b(
3956
+ "button",
3957
+ {
3958
+ type: "button",
3959
+ [se]: "",
3960
+ "aria-expanded": u,
3961
+ "aria-controls": d,
3962
+ onClick: f,
3963
+ className: l(wi, "cursor-pointer", o),
3964
+ children: [
3965
+ r && /* @__PURE__ */ i("span", { className: "flex shrink-0 [&_svg]:size-4", children: r }),
3966
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1", children: e }),
3967
+ /* @__PURE__ */ i(
3968
+ Y,
3969
+ {
3970
+ className: l(
3971
+ "size-4 shrink-0 text-ui-fg-muted transition-transform duration-(--ui-duration-fast) ease-ui-standard",
3972
+ u && "rotate-180"
3973
+ )
3974
+ }
3975
+ )
3976
+ ]
3977
+ }
3978
+ ),
3979
+ /* @__PURE__ */ i(
3980
+ "ul",
3981
+ {
3982
+ id: d,
3983
+ hidden: !u,
3984
+ className: "ms-ui-md mt-ui-xs flex flex-col gap-ui-xs border-s border-ui-border-subtle ps-ui-xs",
3985
+ children: t
3986
+ }
3987
+ )
3988
+ ] });
3989
+ }
3990
+ const ht = (
3991
+ // Borde transparente: en colores forzados el navegador lo pinta y la forma se sigue viendo
3992
+ "block border border-transparent bg-ui-surface-muted animate-pulse motion-reduce:animate-none"
3993
+ ), Ka = {
3994
+ rect: "h-24 w-full rounded-md",
3995
+ circle: "size-10 rounded-full"
3996
+ };
3997
+ function hs({ shape: e = "text", lines: t = 1, className: r, ...a }) {
3998
+ if (e !== "text")
3999
+ return /* @__PURE__ */ i(
4000
+ "span",
4001
+ {
4002
+ "aria-hidden": "true",
4003
+ "data-slot": "skeleton",
4004
+ className: l(ht, Ka[e], r),
4005
+ ...a
4006
+ }
4007
+ );
4008
+ const n = Math.max(1, Math.floor(t));
4009
+ return /* @__PURE__ */ i(
4010
+ "span",
4011
+ {
4012
+ "aria-hidden": "true",
4013
+ "data-slot": "skeleton",
4014
+ className: l("flex w-full flex-col gap-2", r),
4015
+ ...a,
4016
+ children: Array.from({ length: n }, (s, o) => /* @__PURE__ */ i(
4017
+ "span",
4018
+ {
4019
+ className: l(
4020
+ ht,
4021
+ // Alto de una línea de texto del cuerpo
4022
+ "h-[1lh] rounded-sm text-ui-body",
4023
+ n > 1 && o === n - 1 ? "w-3/5" : "w-full"
4024
+ )
4025
+ },
4026
+ o
4027
+ ))
4028
+ }
4029
+ );
4030
+ }
4031
+ function vs({
4032
+ as: e = "div",
4033
+ gap: t = "md",
4034
+ align: r = "stretch",
4035
+ justify: a,
4036
+ className: n,
4037
+ ref: s,
4038
+ ...o
4039
+ }) {
4040
+ return /* @__PURE__ */ i(
4041
+ e,
4042
+ {
4043
+ ref: s,
4044
+ role: Ye(e),
4045
+ className: l(
4046
+ "m-0 flex flex-col p-0",
4047
+ Qe[t],
4048
+ fi[r],
4049
+ a && bi[a],
4050
+ n
4051
+ ),
4052
+ ...o
4053
+ }
4054
+ );
4055
+ }
4056
+ const Ni = P(null);
4057
+ function ys({
4058
+ children: e,
4059
+ current: t,
4060
+ onChange: r,
4061
+ orientation: a = "horizontal",
4062
+ className: n,
4063
+ "aria-label": s,
4064
+ ...o
4065
+ }) {
4066
+ const d = I(), c = te.toArray(e);
4067
+ return /* @__PURE__ */ i(
4068
+ "ol",
4069
+ {
4070
+ "aria-label": s ?? d["stepper.label"],
4071
+ className: l(
4072
+ "flex",
4073
+ a === "horizontal" ? "flex-row" : "flex-col",
4074
+ n
4075
+ ),
4076
+ ...o,
4077
+ children: c.map((m, u) => /* @__PURE__ */ i(
4078
+ Ni,
4079
+ {
4080
+ value: {
4081
+ index: u,
4082
+ last: u === c.length - 1,
4083
+ status: u < t ? "complete" : u === t ? "current" : "upcoming",
4084
+ orientation: a,
4085
+ onChange: r
4086
+ },
4087
+ children: m
4088
+ },
4089
+ u
4090
+ ))
4091
+ }
4092
+ );
4093
+ }
4094
+ const Ua = {
4095
+ complete: "border-ui-primary bg-ui-primary text-ui-surface",
4096
+ current: "border-ui-primary bg-ui-surface text-ui-primary ring-2 ring-ui-primary-soft",
4097
+ upcoming: "border-ui-border bg-ui-surface text-ui-fg-muted",
4098
+ invalid: "border-ui-danger bg-ui-danger-soft text-ui-danger"
4099
+ };
4100
+ function ws({
4101
+ label: e,
4102
+ description: t,
4103
+ invalid: r = !1,
4104
+ className: a
4105
+ }) {
4106
+ const n = I(), s = B(Ni);
4107
+ if (!s) throw new Error("Step va dentro de un Stepper.");
4108
+ const { index: o, last: d, status: c, orientation: m, onChange: u } = s, f = m === "horizontal", g = r ? "invalid" : c, x = !!u && c === "complete", p = /* @__PURE__ */ b(R, { children: [
4109
+ /* @__PURE__ */ i(
4110
+ "span",
4111
+ {
4112
+ "aria-hidden": "true",
4113
+ className: l(
4114
+ "flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-ui-label font-ui-semibold",
4115
+ Ua[g]
4116
+ ),
4117
+ children: g === "invalid" ? /* @__PURE__ */ i(we, { className: "size-4" }) : g === "complete" ? /* @__PURE__ */ i(le, { className: "size-4" }) : o + 1
4118
+ }
4119
+ ),
4120
+ /* @__PURE__ */ b(
4121
+ "span",
4122
+ {
4123
+ className: l(
4124
+ "flex min-w-0 flex-col",
4125
+ f ? "pt-ui-xs" : "pt-1"
4126
+ ),
4127
+ children: [
4128
+ /* @__PURE__ */ b(
4129
+ "span",
4130
+ {
4131
+ className: l(
4132
+ "text-ui-label",
4133
+ c === "current" ? "font-ui-semibold text-ui-fg" : "font-ui-medium",
4134
+ c === "upcoming" && !r && "text-ui-fg-muted",
4135
+ r && "text-ui-danger"
4136
+ ),
4137
+ children: [
4138
+ e,
4139
+ (r || c !== "current") && /* @__PURE__ */ b(X, { children: [
4140
+ ",",
4141
+ " ",
4142
+ n["stepper.status"](
4143
+ r ? "invalid" : c
4144
+ )
4145
+ ] })
4146
+ ]
4147
+ }
4148
+ ),
4149
+ t && /* @__PURE__ */ i("span", { className: "text-ui-caption text-ui-fg-muted", children: t })
4150
+ ]
4151
+ }
4152
+ )
4153
+ ] }), y = l(
4154
+ "flex gap-ui-sm text-start",
4155
+ f ? "flex-col items-start" : "flex-row items-start"
4156
+ );
4157
+ return /* @__PURE__ */ b(
4158
+ "li",
4159
+ {
4160
+ ...c === "current" && { "aria-current": "step" },
4161
+ className: l(
4162
+ "relative flex",
4163
+ f ? d ? "min-w-0 flex-none" : "min-w-0 flex-1 pe-ui-sm" : "pb-ui-lg last:pb-0",
4164
+ a
4165
+ ),
4166
+ children: [
4167
+ !d && /* @__PURE__ */ i(
4168
+ "span",
4169
+ {
4170
+ "aria-hidden": "true",
4171
+ className: l(
4172
+ "absolute rounded-full",
4173
+ c === "complete" ? "bg-ui-primary" : "bg-ui-border",
4174
+ f ? "start-10 end-2 top-4 h-0.5" : "start-4 top-10 bottom-1 w-0.5 -translate-x-1/2 rtl:translate-x-1/2"
4175
+ )
4176
+ }
4177
+ ),
4178
+ x ? /* @__PURE__ */ i(
4179
+ "button",
4180
+ {
4181
+ type: "button",
4182
+ onClick: () => u?.(o),
4183
+ className: l(
4184
+ y,
4185
+ "cursor-pointer rounded-md hover:[&>span:last-child]:underline",
4186
+ T
4187
+ ),
4188
+ children: p
4189
+ }
4190
+ ) : /* @__PURE__ */ i("div", { className: y, children: p })
4191
+ ]
4192
+ }
4193
+ );
4194
+ }
4195
+ const $e = {
4196
+ sm: { track: "h-4 w-7", thumb: "size-3 start-0.5 peer-checked:start-3.5", indent: "ps-9" },
4197
+ md: { track: "h-5 w-9", thumb: "size-4 start-0.5 peer-checked:start-4.5", indent: "ps-11" },
4198
+ lg: { track: "h-6 w-11", thumb: "size-5 start-0.5 peer-checked:start-5.5", indent: "ps-13" }
4199
+ };
4200
+ function Ns({
4201
+ children: e,
4202
+ description: t,
4203
+ size: r = "md",
4204
+ className: a,
4205
+ id: n,
4206
+ "aria-describedby": s,
4207
+ ...o
4208
+ }) {
4209
+ const d = ue("switch", { id: n, description: t, describedBy: s });
4210
+ return /* @__PURE__ */ i(
4211
+ Ke,
4212
+ {
4213
+ id: d.id,
4214
+ size: r,
4215
+ className: a,
4216
+ description: t,
4217
+ descriptionId: d.descriptionId,
4218
+ indentClassName: $e[r].indent,
4219
+ control: /* @__PURE__ */ b(R, { children: [
4220
+ /* @__PURE__ */ i(
4221
+ "input",
4222
+ {
4223
+ type: "checkbox",
4224
+ role: "switch",
4225
+ id: d.id,
4226
+ "aria-describedby": d.describedBy,
4227
+ className: l(
4228
+ "peer m-0 shrink-0 cursor-[inherit] appearance-none rounded-full border",
4229
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard",
4230
+ $e[r].track,
4231
+ "border-ui-border bg-ui-surface-muted enabled:hover:border-ui-border-hover",
4232
+ "checked:border-ui-primary checked:bg-ui-primary enabled:checked:hover:bg-ui-primary-hover",
4233
+ "disabled:border-ui-border-subtle disabled:bg-ui-surface-disabled",
4234
+ "disabled:checked:border-ui-fg-disabled disabled:checked:bg-ui-fg-disabled",
4235
+ T
4236
+ ),
4237
+ ...o
4238
+ }
4239
+ ),
4240
+ /* @__PURE__ */ i(
4241
+ "svg",
4242
+ {
4243
+ viewBox: "0 0 16 16",
4244
+ "aria-hidden": "true",
4245
+ focusable: "false",
4246
+ className: l(
4247
+ "pointer-events-none absolute inset-y-0 my-auto text-ui-fg-muted",
4248
+ "transition-[inset-inline-start] duration-(--ui-duration-fast) ease-ui-standard",
4249
+ "peer-checked:text-ui-surface peer-disabled:text-ui-fg-disabled peer-disabled:peer-checked:text-ui-surface-disabled",
4250
+ $e[r].thumb
4251
+ ),
4252
+ children: /* @__PURE__ */ i("circle", { cx: "8", cy: "8", r: "8", fill: "currentColor" })
4253
+ }
4254
+ )
4255
+ ] }),
4256
+ children: e
4257
+ }
4258
+ );
4259
+ }
4260
+ const Ie = P("horizontal");
4261
+ function Cs({
4262
+ children: e,
4263
+ value: t,
4264
+ defaultValue: r,
4265
+ onChange: a,
4266
+ orientation: n = "horizontal",
4267
+ activation: s = "automatic",
4268
+ disabled: o,
4269
+ className: d
4270
+ }) {
4271
+ const c = M(r ?? null);
4272
+ return /* @__PURE__ */ i(Ie, { value: n, children: /* @__PURE__ */ i(
4273
+ fr,
4274
+ {
4275
+ ...t !== void 0 && { selectedKey: t },
4276
+ ...r !== void 0 && { defaultSelectedKey: r },
4277
+ onSelectionChange: (u) => {
4278
+ const f = String(u), g = t !== void 0 ? t : c.current;
4279
+ c.current = f, !(g === null || f === g) && a?.(f);
4280
+ },
4281
+ orientation: n,
4282
+ keyboardActivation: s,
4283
+ ...o && { isDisabled: !0 },
4284
+ className: l("flex", n === "horizontal" ? "flex-col" : "flex-row gap-ui-lg", d),
4285
+ children: e
4286
+ }
4287
+ ) });
4288
+ }
4289
+ function zs(e) {
4290
+ const { children: t, className: r } = e, a = B(Ie);
4291
+ return /* @__PURE__ */ i(
4292
+ ur,
4293
+ {
4294
+ ...e["aria-label"] !== void 0 ? { "aria-label": e["aria-label"] } : { "aria-labelledby": e["aria-labelledby"] },
4295
+ className: l(
4296
+ "flex shrink-0",
4297
+ a === "horizontal" ? (
4298
+ // Si no entran, se desplazan en vez de pasar a otra línea
4299
+ "gap-ui-xs overflow-x-auto overflow-y-hidden border-b border-ui-border [scrollbar-width:thin]"
4300
+ ) : "flex-col gap-px border-e border-ui-border",
4301
+ r
4302
+ ),
4303
+ children: t
4304
+ }
4305
+ );
4306
+ }
4307
+ function ks({ value: e, children: t, icon: r, disabled: a, className: n, ref: s }) {
4308
+ const o = B(Ie);
4309
+ return /* @__PURE__ */ b(
4310
+ cr,
4311
+ {
4312
+ id: e,
4313
+ ref: s,
4314
+ ...a && { isDisabled: !0 },
4315
+ className: l(
4316
+ // 40 px de alto: área táctil cómoda (WCAG 2.5.8 pide 24)
4317
+ "relative inline-flex min-h-10 shrink-0 cursor-pointer items-center gap-ui-xs whitespace-nowrap px-ui-md text-ui-body-sm font-ui-medium text-ui-fg-muted",
4318
+ "transition-colors duration-(--ui-duration-fast) ease-ui-standard hover:text-ui-fg",
4319
+ // La elegida se marca con una barra y el color del texto, no solo con color
4320
+ "data-selected:text-ui-fg",
4321
+ "after:absolute after:rounded-full after:bg-transparent data-selected:after:bg-ui-primary",
4322
+ o === "horizontal" ? "after:inset-x-ui-xs after:bottom-0 after:h-0.5" : "justify-start after:inset-y-ui-xs after:-end-px after:w-0.5",
4323
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
4324
+ "rounded-sm",
4325
+ T,
4326
+ n
4327
+ ),
4328
+ children: [
4329
+ r && /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "inline-flex shrink-0 [&_svg]:size-4", children: r }),
4330
+ t
4331
+ ]
4332
+ }
4333
+ );
4334
+ }
4335
+ function Ss({ value: e, children: t, className: r }) {
4336
+ const a = B(Ie);
4337
+ return /* @__PURE__ */ i(
4338
+ mr,
4339
+ {
4340
+ id: e,
4341
+ className: l("min-w-0 flex-1 rounded-sm", a === "horizontal" && "pt-ui-md", T, r),
4342
+ children: t
4343
+ }
4344
+ );
4345
+ }
4346
+ const Be = P({
4347
+ size: "md",
4348
+ sortDescriptor: void 0,
4349
+ onSortChange: void 0
4350
+ });
4351
+ function Is({
4352
+ caption: e,
4353
+ size: t = "md",
4354
+ sortDescriptor: r,
4355
+ onSortChange: a,
4356
+ className: n,
4357
+ children: s,
4358
+ "aria-label": o,
4359
+ ...d
4360
+ }) {
4361
+ const c = L();
4362
+ return /* @__PURE__ */ i(Be, { value: { size: t, sortDescriptor: r, onSortChange: a }, children: /* @__PURE__ */ i(Wt, { orientation: "horizontal", ...e ? { "aria-labelledby": c } : { "aria-label": o }, children: /* @__PURE__ */ b(
4363
+ "table",
4364
+ {
4365
+ "aria-label": o,
4366
+ className: l(
4367
+ "w-full border-collapse text-ui-fg",
4368
+ t === "sm" ? "text-ui-body-sm" : "text-ui-body",
4369
+ n
4370
+ ),
4371
+ ...d,
4372
+ children: [
4373
+ e && /* @__PURE__ */ i(
4374
+ "caption",
4375
+ {
4376
+ id: c,
4377
+ className: "caption-top pb-ui-sm text-start font-ui-semibold",
4378
+ children: /* @__PURE__ */ i("span", { className: "sticky start-0", children: e })
4379
+ }
4380
+ ),
4381
+ s
4382
+ ]
4383
+ }
4384
+ ) }) });
4385
+ }
4386
+ function Bs({ className: e, ...t }) {
4387
+ return /* @__PURE__ */ i("thead", { className: l("bg-ui-surface-muted", e), ...t });
4388
+ }
4389
+ function Ds(e) {
4390
+ return /* @__PURE__ */ i("tbody", { ...e });
4391
+ }
4392
+ function Ts({ className: e, ...t }) {
4393
+ return /* @__PURE__ */ i(
4394
+ "tfoot",
4395
+ {
4396
+ className: l(
4397
+ "border-t-2 border-ui-border font-ui-semibold [&_td]:border-b-0 [&_th]:border-b-0",
4398
+ e
4399
+ ),
4400
+ ...t
4401
+ }
4402
+ );
4403
+ }
4404
+ function As(e) {
4405
+ return /* @__PURE__ */ i("tr", { ...e });
4406
+ }
4407
+ const Je = {
4408
+ sm: "px-ui-sm py-ui-xs",
4409
+ md: "px-ui-md py-ui-sm",
4410
+ lg: "px-ui-md py-ui-md"
4411
+ }, et = {
4412
+ start: "text-start",
4413
+ center: "text-center",
4414
+ // Números: al final, con cifras del mismo ancho y sin partirse
4415
+ end: "text-end tabular-nums whitespace-nowrap"
4416
+ }, _a = {
4417
+ ascending: Rt,
4418
+ descending: Et
4419
+ };
4420
+ function $s({
4421
+ id: e,
4422
+ sortable: t = !1,
4423
+ align: r = "start",
4424
+ className: a,
4425
+ children: n,
4426
+ ...s
4427
+ }) {
4428
+ const { size: o, sortDescriptor: d, onSortChange: c } = B(Be);
4429
+ hi(
4430
+ t && !e,
4431
+ "TableColumn: una columna `sortable` necesita `id` para saber por cuál se ordena."
4432
+ );
4433
+ const m = t && e !== void 0, u = m && d?.column === e ? d.direction : void 0, f = u ? _a[u] : Lt;
4434
+ return /* @__PURE__ */ i(
4435
+ "th",
4436
+ {
4437
+ scope: "col",
4438
+ "aria-sort": u,
4439
+ className: l(
4440
+ "border-b border-ui-border font-ui-semibold whitespace-nowrap text-ui-fg-muted",
4441
+ Je[o],
4442
+ et[r],
4443
+ a
4444
+ ),
4445
+ ...s,
4446
+ children: m ? /* @__PURE__ */ b(
4447
+ "button",
4448
+ {
4449
+ type: "button",
4450
+ className: l(
4451
+ // Área táctil de 24 px; el margen negativo compensa el padding
4452
+ "-mx-ui-xs inline-flex min-h-6 cursor-pointer items-center gap-ui-xs rounded-sm px-ui-xs font-ui-semibold hover:text-ui-fg",
4453
+ u && "text-ui-fg",
4454
+ r === "end" && "flex-row-reverse",
4455
+ T
4456
+ ),
4457
+ onClick: () => c?.({
4458
+ column: e,
4459
+ direction: u === "ascending" ? "descending" : "ascending"
4460
+ }),
4461
+ children: [
4462
+ n,
4463
+ /* @__PURE__ */ i(
4464
+ f,
4465
+ {
4466
+ className: l("size-4 shrink-0", !u && "opacity-60")
4467
+ }
4468
+ )
4469
+ ]
4470
+ }
4471
+ ) : n
4472
+ }
4473
+ );
4474
+ }
4475
+ function Ms({
4476
+ align: e = "start",
4477
+ className: t,
4478
+ ...r
4479
+ }) {
4480
+ const { size: a } = B(Be);
4481
+ return /* @__PURE__ */ i(
4482
+ "td",
4483
+ {
4484
+ className: l(
4485
+ "border-b border-ui-border-subtle align-top",
4486
+ Je[a],
4487
+ et[e],
4488
+ t
4489
+ ),
4490
+ ...r
4491
+ }
4492
+ );
4493
+ }
4494
+ function Es({
4495
+ align: e = "start",
4496
+ className: t,
4497
+ ...r
4498
+ }) {
4499
+ const { size: a } = B(Be);
4500
+ return /* @__PURE__ */ i(
4501
+ "th",
4502
+ {
4503
+ scope: "row",
4504
+ className: l(
4505
+ "border-b border-ui-border-subtle align-top font-ui-medium",
4506
+ Je[a],
4507
+ et[e],
4508
+ t
4509
+ ),
4510
+ ...r
4511
+ }
4512
+ );
4513
+ }
4514
+ const qa = {
4515
+ caption: "text-ui-caption",
4516
+ "body-sm": "text-ui-body-sm",
4517
+ body: "text-ui-body",
4518
+ "body-lg": "text-ui-body-lg",
4519
+ label: "text-ui-label"
4520
+ }, Va = {
4521
+ neutral: "text-ui-fg",
4522
+ muted: "text-ui-fg-muted",
4523
+ primary: "text-ui-primary",
4524
+ success: "text-ui-success",
4525
+ warning: "text-ui-warning",
4526
+ danger: "text-ui-danger"
4527
+ }, Wa = {
4528
+ regular: "font-ui-regular",
4529
+ medium: "font-ui-medium",
4530
+ semibold: "font-ui-semibold",
4531
+ bold: "font-ui-bold"
4532
+ };
4533
+ function Rs({
4534
+ as: e = "p",
4535
+ variant: t = "body",
4536
+ tone: r = "neutral",
4537
+ weight: a,
4538
+ className: n,
4539
+ ref: s,
4540
+ ...o
4541
+ }) {
4542
+ return /* @__PURE__ */ i(
4543
+ e,
4544
+ {
4545
+ ref: s,
4546
+ className: l(
4547
+ "m-0",
4548
+ qa[t],
4549
+ Va[r],
4550
+ a && Wa[a],
4551
+ n
4552
+ ),
4553
+ ...o
4554
+ }
4555
+ );
4556
+ }
4557
+ const Xa = {
4558
+ sm: "px-2.5 py-1.5 text-ui-body ui-sm:text-ui-body-sm",
4559
+ md: "px-3 py-2 text-ui-body ui-sm:text-ui-body-sm",
4560
+ lg: "px-4 py-3 text-ui-body"
4561
+ };
4562
+ function Ls({ className: e, rows: t = 3, readOnly: r = !1, ...a }) {
4563
+ const { size: n, invalid: s, ...o } = V(a);
4564
+ return /* @__PURE__ */ i(
4565
+ "textarea",
4566
+ {
4567
+ rows: t,
4568
+ readOnly: r,
4569
+ className: l(
4570
+ "block resize-y outline-hidden placeholder:text-ui-fg-muted",
4571
+ ie({ invalid: s, disabled: !!o.disabled, readOnly: r }),
4572
+ // el anillo de foco va en el propio textarea (no hay contenedor)
4573
+ "focus-visible:outline-solid focus-visible:outline-[length:var(--ui-focus-ring-width)] focus-visible:outline-offset-[var(--ui-focus-ring-offset)] focus-visible:outline-ui-focus",
4574
+ Xa[n],
4575
+ e
4576
+ ),
4577
+ ...o
4578
+ }
4579
+ );
4580
+ }
4581
+ const vt = 5e3, oe = new gr({ maxVisibleToasts: 5 });
4582
+ function Qa({ timeout: e, action: t, tone: r }) {
4583
+ if (e !== !1 && !(e === void 0 && (t || r === "danger")))
4584
+ return Math.max(vt, e ?? vt);
4585
+ }
4586
+ function Ci(e) {
4587
+ const { timeout: t, onClose: r, ...a } = e, n = Qa(e);
4588
+ return oe.add(a, {
4589
+ ...n !== void 0 && { timeout: n },
4590
+ ...r && { onClose: r }
4591
+ });
4592
+ }
4593
+ Ci.dismiss = (e) => oe.close(e);
4594
+ Ci.dismissAll = () => oe.clear();
4595
+ const Ya = {
4596
+ neutral: null,
4597
+ primary: /* @__PURE__ */ i(Me, {}),
4598
+ success: /* @__PURE__ */ i(At, {}),
4599
+ warning: /* @__PURE__ */ i(Tt, {}),
4600
+ danger: /* @__PURE__ */ i(we, {})
4601
+ }, Za = {
4602
+ neutral: "",
4603
+ primary: "text-ui-primary",
4604
+ success: "text-ui-success",
4605
+ warning: "text-ui-warning",
4606
+ danger: "text-ui-danger"
4607
+ };
4608
+ function Ps({ "aria-label": e, className: t }) {
4609
+ const r = I();
4610
+ return /* @__PURE__ */ i(
4611
+ br,
4612
+ {
4613
+ queue: oe,
4614
+ "aria-label": e ?? r["toast.region"],
4615
+ className: l(
4616
+ "fixed inset-x-ui-md bottom-ui-md z-(--ui-z-toast) flex flex-col-reverse gap-ui-sm",
4617
+ "ui-sm:start-auto ui-sm:w-(--container-ui-sm)",
4618
+ "rounded-lg",
4619
+ T,
4620
+ t
4621
+ ),
4622
+ children: ({ toast: a }) => {
4623
+ const { title: n, description: s, tone: o = "neutral", action: d } = a.content, c = Ya[o], m = () => oe.close(a.key);
4624
+ return /* @__PURE__ */ b(
4625
+ xr,
4626
+ {
4627
+ toast: a,
4628
+ className: l(
4629
+ "flex items-start gap-ui-sm rounded-lg border border-ui-border-subtle bg-ui-surface-raised p-ui-md text-ui-fg shadow-ui-overlay",
4630
+ // Entra con un fundido corto; con "reducir movimiento" la duración es 0
4631
+ "transition-[opacity,translate] duration-(--ui-duration-slow) ease-ui-enter starting:translate-y-2 starting:opacity-0",
4632
+ T
4633
+ ),
4634
+ children: [
4635
+ c && /* @__PURE__ */ i(
4636
+ "span",
4637
+ {
4638
+ "aria-hidden": "true",
4639
+ className: l("inline-flex h-[1lh] shrink-0 items-center text-ui-body-sm [&_svg]:size-5", Za[o]),
4640
+ children: c
4641
+ }
4642
+ ),
4643
+ /* @__PURE__ */ b(pr, { className: "flex min-w-0 flex-1 flex-col gap-ui-xs", children: [
4644
+ /* @__PURE__ */ b(rt, { slot: "title", className: "text-ui-body-sm font-ui-semibold", children: [
4645
+ o !== "neutral" && /* @__PURE__ */ b(R, { children: [
4646
+ /* @__PURE__ */ b(X, { children: [
4647
+ r["alert.tone"](o),
4648
+ ":"
4649
+ ] }),
4650
+ " "
4651
+ ] }),
4652
+ n
4653
+ ] }),
4654
+ s != null && /* @__PURE__ */ i(rt, { slot: "description", className: "text-ui-body-sm text-ui-fg-muted", children: s }),
4655
+ d && /* @__PURE__ */ i("div", { className: "mt-ui-xs", children: /* @__PURE__ */ i(
4656
+ ne,
4657
+ {
4658
+ size: "sm",
4659
+ variant: "outline",
4660
+ onClick: () => {
4661
+ d.onAction(), m();
4662
+ },
4663
+ children: d.label
4664
+ }
4665
+ ) })
4666
+ ] }),
4667
+ /* @__PURE__ */ i(
4668
+ Ce,
4669
+ {
4670
+ size: "sm",
4671
+ variant: "ghost",
4672
+ label: r["toast.close"],
4673
+ onClick: m,
4674
+ className: "-me-ui-xs -mt-ui-xs",
4675
+ children: /* @__PURE__ */ i(ee, {})
4676
+ }
4677
+ )
4678
+ ]
4679
+ }
4680
+ );
4681
+ }
4682
+ }
4683
+ );
4684
+ }
4685
+ function js({
4686
+ content: e,
4687
+ children: t,
4688
+ placement: r = "top",
4689
+ delay: a = 700,
4690
+ closeDelay: n = 300,
4691
+ open: s,
4692
+ defaultOpen: o,
4693
+ onOpenChange: d,
4694
+ disabled: c = !1,
4695
+ className: m,
4696
+ ref: u
4697
+ }) {
4698
+ return /* @__PURE__ */ b(
4699
+ hr,
4700
+ {
4701
+ delay: a,
4702
+ closeDelay: n,
4703
+ isDisabled: c,
4704
+ ...s !== void 0 && { isOpen: s },
4705
+ ...o !== void 0 && { defaultOpen: o },
4706
+ ...d && { onOpenChange: d },
4707
+ children: [
4708
+ /* @__PURE__ */ i(vr, { children: t }),
4709
+ /* @__PURE__ */ b(
4710
+ yr,
4711
+ {
4712
+ ref: u,
4713
+ placement: r,
4714
+ offset: 8,
4715
+ className: l(
4716
+ "z-(--ui-z-tooltip) max-w-(--container-ui-xs) rounded-md border border-transparent bg-ui-fg px-ui-sm py-ui-xs text-ui-body-sm text-ui-surface shadow-ui-overlay",
4717
+ "transition-opacity duration-(--ui-duration-fast) ease-ui-enter data-entering:opacity-0 data-exiting:opacity-0 data-exiting:ease-ui-exit",
4718
+ m
4719
+ ),
4720
+ children: [
4721
+ /* @__PURE__ */ i(wr, { children: /* @__PURE__ */ i(
4722
+ "svg",
4723
+ {
4724
+ width: 8,
4725
+ height: 8,
4726
+ viewBox: "0 0 8 8",
4727
+ "aria-hidden": "true",
4728
+ className: "block fill-ui-fg in-data-[placement=bottom]:rotate-180 in-data-[placement=left]:-rotate-90 in-data-[placement=right]:rotate-90",
4729
+ children: /* @__PURE__ */ i("path", { d: "M0 0 L4 4 L8 0" })
4730
+ }
4731
+ ) }),
4732
+ e
4733
+ ]
4734
+ }
4735
+ )
4736
+ ]
4737
+ }
4738
+ );
4739
+ }
4740
+ function yt(e) {
4741
+ if (e !== void 0)
4742
+ return e === null ? [] : typeof e == "string" ? [e] : e;
4743
+ }
4744
+ const Ja = {
4745
+ sm: "min-h-ui-control-sm text-ui-body-sm",
4746
+ md: "min-h-ui-control-md text-ui-body",
4747
+ lg: "min-h-ui-control-lg text-ui-body"
4748
+ }, zi = P("md"), en = "1.25rem";
4749
+ function Gs(e) {
4750
+ const {
4751
+ children: t,
4752
+ size: r = "md",
4753
+ expanded: a,
4754
+ defaultExpanded: n,
4755
+ onExpandedChange: s,
4756
+ onAction: o,
4757
+ emptyState: d,
4758
+ className: c,
4759
+ ref: m
4760
+ } = e, u = I(), f = M(null), g = e.selectionMode ?? "none", x = (v) => {
4761
+ let h;
4762
+ if (v === "all") {
4763
+ const N = f.current;
4764
+ h = N ? Array.from(N.collection.getKeys()).filter(
4765
+ (C) => N.collection.getItem(C)?.type === "item" && N.selectionManager.canSelectItem(C)
4766
+ ).map(String) : [];
4767
+ } else
4768
+ h = Array.from(v, String);
4769
+ e.selectionMode === "multiple" ? e.onChange?.(h) : e.selectionMode === "single" && e.onChange?.(h[0] ?? null);
4770
+ }, p = yt(e.value), y = yt(e.defaultValue);
4771
+ return /* @__PURE__ */ i(zi, { value: r, children: /* @__PURE__ */ i(
4772
+ Nr,
4773
+ {
4774
+ ref: m,
4775
+ ...e["aria-label"] !== void 0 ? { "aria-label": e["aria-label"] } : { "aria-labelledby": e["aria-labelledby"] },
4776
+ selectionMode: g,
4777
+ selectionBehavior: "toggle",
4778
+ ...p && { selectedKeys: p },
4779
+ ...y && { defaultSelectedKeys: y },
4780
+ onSelectionChange: x,
4781
+ ...a && { expandedKeys: a },
4782
+ ...n && { defaultExpandedKeys: n },
4783
+ ...s && {
4784
+ onExpandedChange: (v) => s(Array.from(v, String))
4785
+ },
4786
+ ...o && { onAction: (v) => o(String(v)) },
4787
+ renderEmptyState: () => /* @__PURE__ */ i("div", { className: "px-ui-sm py-ui-sm text-ui-body-sm text-ui-fg-muted", children: d ?? u["tree.empty"] }),
4788
+ className: ({ state: v }) => (f.current = v, l(
4789
+ "flex flex-col gap-px overflow-auto rounded-md border border-ui-border bg-ui-surface p-ui-xs text-ui-fg",
4790
+ "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:outline-offset-[var(--ui-focus-ring-offset)] data-focus-visible:outline-ui-focus",
4791
+ c
4792
+ )),
4793
+ children: t
4794
+ }
4795
+ ) });
4796
+ }
4797
+ function Os({
4798
+ id: e,
4799
+ label: t,
4800
+ textValue: r,
4801
+ icon: a,
4802
+ disabled: n,
4803
+ children: s,
4804
+ className: o
4805
+ }) {
4806
+ const d = I(), c = B(zi);
4807
+ return /* @__PURE__ */ b(
4808
+ Cr,
4809
+ {
4810
+ id: e,
4811
+ textValue: r ?? (typeof t == "string" ? t : ""),
4812
+ ...n && { isDisabled: !0 },
4813
+ className: l(
4814
+ "flex cursor-default items-center rounded-sm pe-ui-sm",
4815
+ "data-hovered:bg-ui-surface-muted data-selected:bg-ui-primary-soft",
4816
+ "data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
4817
+ // Anillo hacia adentro: las filas van pegadas
4818
+ "outline-hidden data-focus-visible:outline-solid data-focus-visible:outline-[length:var(--ui-focus-ring-width)] data-focus-visible:-outline-offset-[var(--ui-focus-ring-width)] data-focus-visible:outline-ui-focus",
4819
+ Ja[c],
4820
+ o
4821
+ ),
4822
+ children: [
4823
+ /* @__PURE__ */ i(zr, { children: ({ hasChildItems: u, isExpanded: f, level: g, selectionMode: x, isSelected: p }) => /* @__PURE__ */ b(
4824
+ "div",
4825
+ {
4826
+ className: "flex min-w-0 flex-1 items-center gap-ui-xs",
4827
+ style: {
4828
+ paddingInlineStart: `calc(${g - 1} * ${en})`
4829
+ },
4830
+ children: [
4831
+ u ? /* @__PURE__ */ i(
4832
+ W,
4833
+ {
4834
+ slot: "chevron",
4835
+ "aria-label": f ? d["tree.collapse"] : d["tree.expand"],
4836
+ className: "inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-sm text-ui-fg-muted data-hovered:text-ui-fg data-disabled:cursor-not-allowed data-disabled:text-ui-fg-disabled",
4837
+ children: /* @__PURE__ */ i(
4838
+ Y,
4839
+ {
4840
+ className: l(
4841
+ "size-4 transition-transform duration-(--ui-duration-fast) ease-ui-standard motion-reduce:transition-none",
4842
+ // Cerrado apunta hacia donde avanza el texto
4843
+ !f && "ltr:-rotate-90 rtl:rotate-90"
4844
+ )
4845
+ }
4846
+ )
4847
+ }
4848
+ ) : /* @__PURE__ */ i("span", { "aria-hidden": "true", className: "size-6 shrink-0" }),
4849
+ x === "multiple" && /* @__PURE__ */ i(qe, { label: d["tree.select"] }),
4850
+ a && /* @__PURE__ */ i(
4851
+ "span",
4852
+ {
4853
+ "aria-hidden": "true",
4854
+ className: "inline-flex shrink-0 text-ui-fg-muted [&_svg]:size-4",
4855
+ children: a
4856
+ }
4857
+ ),
4858
+ /* @__PURE__ */ i("span", { className: "min-w-0 flex-1 truncate", children: t }),
4859
+ x === "single" && /* @__PURE__ */ i(
4860
+ le,
4861
+ {
4862
+ className: l(
4863
+ "size-4 shrink-0 text-ui-primary",
4864
+ !p && "invisible"
4865
+ )
4866
+ }
4867
+ )
4868
+ ]
4869
+ }
4870
+ ) }),
4871
+ s
4872
+ ]
4873
+ }
4874
+ );
4875
+ }
4876
+ export {
4877
+ cn as Accordion,
4878
+ un as AccordionItem,
4879
+ fn as Alert,
4880
+ xn as AlertDialog,
4881
+ pn as AppShell,
4882
+ hn as Avatar,
4883
+ vn as Badge,
4884
+ wn as BreadcrumbItem,
4885
+ yn as Breadcrumbs,
4886
+ ne as Button,
4887
+ Nn as ButtonGroup,
4888
+ Cn as Calendar,
4889
+ zn as Card,
4890
+ Sn as CardBody,
4891
+ In as CardFooter,
4892
+ kn as CardHeader,
4893
+ Bn as Checkbox,
4894
+ Dn as CheckboxGroup,
4895
+ Rn as Combobox,
4896
+ Ln as Container,
4897
+ Hn as ContextMenuTrigger,
4898
+ Kn as DataGrid,
4899
+ qn as DataGridBody,
4900
+ Wn as DataGridCell,
4901
+ _n as DataGridColumn,
4902
+ Xn as DataGridEditableCell,
4903
+ Un as DataGridHeader,
4904
+ Vn as DataGridRow,
4905
+ Qn as DatePicker,
4906
+ gn as Dialog,
4907
+ Qt as DialogBody,
4908
+ ia as DialogFooter,
4909
+ bn as DialogTrigger,
4910
+ dn as Disclosure,
4911
+ Yn as Divider,
4912
+ za as Drawer,
4913
+ Fe as ErrorMessage,
4914
+ ma as Field,
4915
+ Zn as FileUpload,
4916
+ Jn as Footer,
4917
+ ts as FooterLink,
4918
+ es as FooterSection,
4919
+ Aa as Grid,
4920
+ as as Header,
4921
+ ce as Heading,
4922
+ He as HelpText,
4923
+ Ce as IconButton,
4924
+ ns as Inline,
4925
+ _e as Input,
4926
+ ua as Label,
4927
+ Jt as Link,
4928
+ $n as ListBox,
4929
+ Mn as ListBoxItem,
4930
+ En as ListBoxSection,
4931
+ mn as LocaleProvider,
4932
+ jn as Menu,
4933
+ Gn as MenuItem,
4934
+ On as MenuSection,
4935
+ Fn as MenuSeparator,
4936
+ Pn as MenuTrigger,
4937
+ ss as Multiselect,
4938
+ os as NativeSelect,
4939
+ xt as NavBar,
4940
+ is as NavBarLink,
4941
+ rs as NavBarMenu,
4942
+ ls as PageHeader,
4943
+ ds as Pagination,
4944
+ cs as PasswordInput,
4945
+ An as Popover,
4946
+ Tn as PopoverTrigger,
4947
+ us as Radio,
4948
+ ms as RadioGroup,
4949
+ Wt as ScrollArea,
4950
+ fs as SearchInput,
4951
+ bs as Select,
4952
+ gs as SideNav,
4953
+ ps as SideNavGroup,
4954
+ xs as SideNavLink,
4955
+ hs as Skeleton,
4956
+ Gr as Spinner,
4957
+ vs as Stack,
4958
+ ws as Step,
4959
+ ys as Stepper,
4960
+ Ns as Switch,
4961
+ ks as Tab,
4962
+ zs as TabList,
4963
+ Ss as TabPanel,
4964
+ Is as Table,
4965
+ Ds as TableBody,
4966
+ Ms as TableCell,
4967
+ $s as TableColumn,
4968
+ Ts as TableFooter,
4969
+ Bs as TableHeader,
4970
+ As as TableRow,
4971
+ Es as TableRowHeader,
4972
+ Cs as Tabs,
4973
+ Ea as Tag,
4974
+ Rs as Text,
4975
+ Ls as Textarea,
4976
+ Ps as ToastRegion,
4977
+ js as Tooltip,
4978
+ Gs as Tree,
4979
+ Os as TreeItem,
4980
+ X as VisuallyHidden,
4981
+ Ci as toast,
4982
+ V as useFieldControl,
4983
+ ze as useFieldLabelId,
4984
+ Kt as useLocale
4985
+ };