vicdev-ui-lib 1.0.0 → 1.0.2
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/README.md +78 -45
- package/dist/vicdev-ui-lib.cjs.js +20 -20
- package/dist/vicdev-ui-lib.es.js +626 -533
- package/package.json +1 -1
package/dist/vicdev-ui-lib.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { AnimatePresence as
|
|
4
|
-
import { X as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { DataTable as
|
|
7
|
-
import { Column as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as z } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as K, useState as C, useEffect as E, useContext as Y, useMemo as V, useRef as G } from "react";
|
|
3
|
+
import { AnimatePresence as Q, motion as j } from "framer-motion";
|
|
4
|
+
import { X as P, AlertTriangle as X, Info as ee, XCircle as te, CheckCircle as re, EyeOff as O, Eye as R, Search as ne, FileText as M, Upload as oe, Check as ae, File as _, Loader2 as se, AlertCircle as ie, Download as W, Image as le } from "lucide-react";
|
|
5
|
+
import { createPortal as ce } from "react-dom";
|
|
6
|
+
import { DataTable as de } from "primereact/datatable";
|
|
7
|
+
import { Column as ue } from "primereact/column";
|
|
8
|
+
const D = {
|
|
9
9
|
primary: "#0f172a",
|
|
10
10
|
primaryForeground: "#f8fafc",
|
|
11
|
-
secondary: "#
|
|
11
|
+
secondary: "#7ba63f",
|
|
12
12
|
secondaryForeground: "#0f172a",
|
|
13
13
|
accent: "#f1f5f9",
|
|
14
14
|
accentForeground: "#0f172a",
|
|
@@ -27,87 +27,140 @@ const j = {
|
|
|
27
27
|
popoverForeground: "#0f172a",
|
|
28
28
|
radio: "#e2e8f0",
|
|
29
29
|
radioForeground: "#0f172a"
|
|
30
|
-
},
|
|
31
|
-
colors:
|
|
30
|
+
}, me = {
|
|
31
|
+
colors: D,
|
|
32
32
|
name: "default",
|
|
33
33
|
description: "Tema por defecto de vicdev-ui-lib"
|
|
34
34
|
};
|
|
35
|
-
function
|
|
35
|
+
function We(t) {
|
|
36
36
|
return {
|
|
37
37
|
colors: {
|
|
38
|
-
...
|
|
39
|
-
...
|
|
38
|
+
...D,
|
|
39
|
+
...t
|
|
40
40
|
},
|
|
41
41
|
name: "custom"
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const { colors:
|
|
44
|
+
function fe(t) {
|
|
45
|
+
const { colors: r } = t;
|
|
46
46
|
return `:root {
|
|
47
|
-
${Object.entries(
|
|
47
|
+
${Object.entries(r).map(([n, a]) => ` --${n.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${a};`).join(`
|
|
48
48
|
`)}
|
|
49
49
|
}`;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
function
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const q = K(void 0);
|
|
52
|
+
function pe({
|
|
53
|
+
theme: t = me,
|
|
54
|
+
children: r,
|
|
55
|
+
injectCSS: o = !0
|
|
56
|
+
}) {
|
|
57
|
+
const [n, a] = C(t);
|
|
58
|
+
E(() => {
|
|
59
|
+
if (o && typeof document < "u") {
|
|
60
|
+
let c = document.getElementById("vicdev-ui-theme-variables");
|
|
61
|
+
return c || (c = document.createElement("style"), c.id = "vicdev-ui-theme-variables", document.head.appendChild(c)), c.textContent = fe(n), () => {
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}, [n, o]), E(() => {
|
|
65
|
+
a(t);
|
|
66
|
+
}, [t]);
|
|
67
|
+
const i = {
|
|
68
|
+
theme: n,
|
|
69
|
+
setTheme: a
|
|
56
70
|
};
|
|
57
|
-
return /* @__PURE__ */ e(
|
|
71
|
+
return /* @__PURE__ */ e(q.Provider, { value: i, children: r });
|
|
72
|
+
}
|
|
73
|
+
function Ze() {
|
|
74
|
+
return Y(q);
|
|
75
|
+
}
|
|
76
|
+
const J = K(void 0);
|
|
77
|
+
function He({
|
|
78
|
+
config: t = {},
|
|
79
|
+
children: r
|
|
80
|
+
}) {
|
|
81
|
+
const o = V(() => ({
|
|
82
|
+
theme: t.theme,
|
|
83
|
+
injectCSS: t.injectCSS ?? !0,
|
|
84
|
+
modalZIndex: t.modalZIndex ?? 0,
|
|
85
|
+
toastZIndex: t.toastZIndex ?? 0,
|
|
86
|
+
animationDuration: t.animationDuration ?? 300,
|
|
87
|
+
enableAnimations: t.enableAnimations ?? !0,
|
|
88
|
+
components: {
|
|
89
|
+
modal: {
|
|
90
|
+
defaultSize: t.components?.modal?.defaultSize ?? "lg"
|
|
91
|
+
},
|
|
92
|
+
button: {
|
|
93
|
+
defaultVariant: t.components?.button?.defaultVariant ?? "primary"
|
|
94
|
+
},
|
|
95
|
+
toast: {
|
|
96
|
+
defaultDuration: t.components?.toast?.defaultDuration ?? 3e3,
|
|
97
|
+
position: t.components?.toast?.position ?? "top-right"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}), [t]), n = V(() => ({
|
|
101
|
+
config: o,
|
|
102
|
+
updateConfig: (a) => {
|
|
103
|
+
console.warn("updateConfig: Esta funcionalidad está en desarrollo");
|
|
104
|
+
}
|
|
105
|
+
}), [o]);
|
|
106
|
+
return /* @__PURE__ */ e(J.Provider, { value: n, children: /* @__PURE__ */ e(
|
|
107
|
+
pe,
|
|
108
|
+
{
|
|
109
|
+
theme: t.theme,
|
|
110
|
+
injectCSS: t.injectCSS,
|
|
111
|
+
children: r
|
|
112
|
+
}
|
|
113
|
+
) });
|
|
58
114
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
if (r === void 0)
|
|
62
|
-
throw new Error("useTheme debe ser usado dentro de un ThemeProvider");
|
|
63
|
-
return r;
|
|
115
|
+
function he() {
|
|
116
|
+
return Y(J);
|
|
64
117
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
118
|
+
function ge(t) {
|
|
119
|
+
const r = { ...D, ...t };
|
|
67
120
|
return {
|
|
68
121
|
primary: {
|
|
69
|
-
DEFAULT:
|
|
70
|
-
foreground:
|
|
122
|
+
DEFAULT: r.primary,
|
|
123
|
+
foreground: r.primaryForeground
|
|
71
124
|
},
|
|
72
125
|
secondary: {
|
|
73
|
-
DEFAULT:
|
|
74
|
-
foreground:
|
|
126
|
+
DEFAULT: r.secondary,
|
|
127
|
+
foreground: r.secondaryForeground
|
|
75
128
|
},
|
|
76
129
|
accent: {
|
|
77
|
-
DEFAULT:
|
|
78
|
-
foreground:
|
|
130
|
+
DEFAULT: r.accent,
|
|
131
|
+
foreground: r.accentForeground
|
|
79
132
|
},
|
|
80
133
|
destructive: {
|
|
81
|
-
DEFAULT:
|
|
82
|
-
foreground:
|
|
134
|
+
DEFAULT: r.destructive,
|
|
135
|
+
foreground: r.destructiveForeground
|
|
83
136
|
},
|
|
84
|
-
background:
|
|
85
|
-
foreground:
|
|
137
|
+
background: r.background,
|
|
138
|
+
foreground: r.foreground,
|
|
86
139
|
card: {
|
|
87
|
-
DEFAULT:
|
|
88
|
-
foreground:
|
|
140
|
+
DEFAULT: r.card,
|
|
141
|
+
foreground: r.cardForeground
|
|
89
142
|
},
|
|
90
|
-
border:
|
|
91
|
-
input:
|
|
92
|
-
ring:
|
|
143
|
+
border: r.border,
|
|
144
|
+
input: r.input,
|
|
145
|
+
ring: r.ring,
|
|
93
146
|
muted: {
|
|
94
|
-
DEFAULT:
|
|
95
|
-
foreground:
|
|
147
|
+
DEFAULT: r.muted,
|
|
148
|
+
foreground: r.mutedForeground
|
|
96
149
|
},
|
|
97
150
|
popover: {
|
|
98
|
-
DEFAULT:
|
|
99
|
-
foreground:
|
|
151
|
+
DEFAULT: r.popover,
|
|
152
|
+
foreground: r.popoverForeground
|
|
100
153
|
},
|
|
101
154
|
radio: {
|
|
102
|
-
DEFAULT:
|
|
103
|
-
foreground:
|
|
155
|
+
DEFAULT: r.radio,
|
|
156
|
+
foreground: r.radioForeground
|
|
104
157
|
}
|
|
105
158
|
};
|
|
106
159
|
}
|
|
107
|
-
function
|
|
160
|
+
function Ke(t) {
|
|
108
161
|
return {
|
|
109
162
|
extend: {
|
|
110
|
-
colors:
|
|
163
|
+
colors: ge(t),
|
|
111
164
|
borderRadius: {
|
|
112
165
|
lg: "var(--radius)",
|
|
113
166
|
md: "calc(var(--radius) - 2px)",
|
|
@@ -116,76 +169,76 @@ function Ve(r) {
|
|
|
116
169
|
}
|
|
117
170
|
};
|
|
118
171
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
172
|
+
function be(t) {
|
|
173
|
+
const r = { ...D, ...t };
|
|
121
174
|
return `@theme {
|
|
122
|
-
${Object.entries(
|
|
175
|
+
${Object.entries(r).map(([n, a]) => ` --color-${n.replace(/([A-Z])/g, "-$1").toLowerCase()}: ${a};`).join(`
|
|
123
176
|
`)}
|
|
124
177
|
|
|
125
178
|
/* Border radius */
|
|
126
179
|
--radius: 0.5rem;
|
|
127
180
|
}`;
|
|
128
181
|
}
|
|
129
|
-
function
|
|
130
|
-
const
|
|
182
|
+
function xe(t) {
|
|
183
|
+
const r = { ...D, ...t };
|
|
131
184
|
return `:root {
|
|
132
|
-
${Object.entries(
|
|
133
|
-
const
|
|
134
|
-
return ` --${
|
|
185
|
+
${Object.entries(r).map(([n]) => {
|
|
186
|
+
const a = n.replace(/([A-Z])/g, "-$1").toLowerCase(), i = `color-${a}`;
|
|
187
|
+
return ` --${a}: var(--${i});`;
|
|
135
188
|
}).join(`
|
|
136
189
|
`)}
|
|
137
190
|
}`;
|
|
138
191
|
}
|
|
139
|
-
function
|
|
140
|
-
const
|
|
141
|
-
return `${
|
|
192
|
+
function Ye(t) {
|
|
193
|
+
const r = be(t), o = xe(t);
|
|
194
|
+
return `${r}
|
|
142
195
|
|
|
143
|
-
${
|
|
196
|
+
${o}`;
|
|
144
197
|
}
|
|
145
|
-
const
|
|
198
|
+
const Z = {
|
|
146
199
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90 font-bold shadow-lg",
|
|
147
200
|
secondary: "bg-white border-2 border-border/20 text-foreground hover:border-border/40 hover:bg-card shadow-sm",
|
|
148
201
|
accent: "bg-gradient-to-r from-accent to-accent/90 text-accent-foreground hover:shadow-lg",
|
|
149
202
|
danger: "bg-destructive text-destructive-foreground hover:bg-destructive/90 border-0 shadow-lg hover:shadow-destructive/25",
|
|
150
|
-
outline: "border-
|
|
203
|
+
outline: "border-1 border-border/30 text-foreground hover:bg-card hover:border-border/50 shadow-sm",
|
|
151
204
|
ghost: "text-foreground hover:bg-card hover:text-primary",
|
|
152
205
|
success: "bg-green-500 text-white hover:bg-green-600 hover:shadow-green-400/20"
|
|
153
206
|
}, B = ({
|
|
154
|
-
onClick:
|
|
155
|
-
icon:
|
|
156
|
-
label:
|
|
207
|
+
onClick: t,
|
|
208
|
+
icon: r,
|
|
209
|
+
label: o,
|
|
157
210
|
variant: n = "primary",
|
|
158
|
-
type:
|
|
211
|
+
type: a = "button",
|
|
159
212
|
className: i = "",
|
|
160
|
-
disabled:
|
|
161
|
-
children:
|
|
213
|
+
disabled: c = !1,
|
|
214
|
+
children: d,
|
|
162
215
|
...u
|
|
163
216
|
}) => /* @__PURE__ */ s(
|
|
164
217
|
"button",
|
|
165
218
|
{
|
|
166
|
-
onClick:
|
|
167
|
-
type:
|
|
168
|
-
disabled:
|
|
219
|
+
onClick: t,
|
|
220
|
+
type: a,
|
|
221
|
+
disabled: c,
|
|
169
222
|
className: `
|
|
170
223
|
flex items-center justify-center px-4 py-3 rounded-xl font-semibold text-sm
|
|
171
224
|
transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] group
|
|
172
|
-
disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100
|
|
173
|
-
${
|
|
225
|
+
disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 cursor-pointer hover:shadow-lg
|
|
226
|
+
${Z[n] ?? Z.primary} ${i}
|
|
174
227
|
`,
|
|
175
228
|
...u,
|
|
176
229
|
children: [
|
|
177
|
-
|
|
178
|
-
|
|
230
|
+
r && /* @__PURE__ */ e(
|
|
231
|
+
r,
|
|
179
232
|
{
|
|
180
233
|
size: 20,
|
|
181
|
-
className: `${
|
|
234
|
+
className: `${o ? "mr-2" : ""} ${c ? "" : "group-hover:rotate-12"} transition-transform duration-300`
|
|
182
235
|
}
|
|
183
236
|
),
|
|
184
|
-
|
|
185
|
-
|
|
237
|
+
o,
|
|
238
|
+
d
|
|
186
239
|
]
|
|
187
240
|
}
|
|
188
|
-
),
|
|
241
|
+
), H = {
|
|
189
242
|
sm: "max-w-sm",
|
|
190
243
|
md: "max-w-md",
|
|
191
244
|
lg: "max-w-2xl",
|
|
@@ -193,93 +246,110 @@ const V = {
|
|
|
193
246
|
full: "max-w-[90vw]",
|
|
194
247
|
fullscreen: "w-[95vw] h-[95vh]"
|
|
195
248
|
};
|
|
196
|
-
function
|
|
197
|
-
isOpen:
|
|
198
|
-
onClose:
|
|
199
|
-
title:
|
|
249
|
+
function ye({
|
|
250
|
+
isOpen: t,
|
|
251
|
+
onClose: r,
|
|
252
|
+
title: o = "",
|
|
200
253
|
tamaño: n = "lg",
|
|
201
|
-
children:
|
|
254
|
+
children: a,
|
|
202
255
|
canClose: i = !0
|
|
203
|
-
// Por defecto se puede cerrar
|
|
204
256
|
}) {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
257
|
+
const c = he(), d = c ? c.config.modalZIndex + 99999 : 99999;
|
|
258
|
+
E(() => {
|
|
259
|
+
if (t) {
|
|
260
|
+
const m = window.scrollY;
|
|
261
|
+
return document.body.style.position = "fixed", document.body.style.top = `-${m}px`, document.body.style.width = "100%", document.body.style.overflow = "hidden", () => {
|
|
262
|
+
const p = document.body.style.top;
|
|
263
|
+
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", document.body.style.overflow = "", p && window.scrollTo(0, parseInt(p || "0") * -1);
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}, [t]);
|
|
267
|
+
const u = /* @__PURE__ */ e(Q, { children: t && /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(
|
|
268
|
+
j.div,
|
|
269
|
+
{
|
|
270
|
+
initial: { opacity: 0 },
|
|
271
|
+
animate: { opacity: 1 },
|
|
272
|
+
exit: { opacity: 0 },
|
|
273
|
+
className: "fixed inset-0 bg-black/60 backdrop-blur-xs flex items-center justify-center p-4",
|
|
274
|
+
onClick: i ? r : (m) => m.stopPropagation(),
|
|
275
|
+
style: {
|
|
276
|
+
position: "fixed",
|
|
277
|
+
top: 0,
|
|
278
|
+
left: 0,
|
|
279
|
+
right: 0,
|
|
280
|
+
bottom: 0,
|
|
281
|
+
margin: 0,
|
|
282
|
+
padding: n === "fullscreen" ? "0.5rem" : "1rem",
|
|
283
|
+
zIndex: d
|
|
284
|
+
},
|
|
285
|
+
children: /* @__PURE__ */ s(
|
|
286
|
+
j.div,
|
|
287
|
+
{
|
|
288
|
+
initial: { opacity: 0, scale: 0.95, y: 20 },
|
|
289
|
+
animate: { opacity: 1, scale: 1, y: 0 },
|
|
290
|
+
exit: { opacity: 0, scale: 0.95, y: 20 },
|
|
291
|
+
transition: { type: "spring", damping: 20, stiffness: 300 },
|
|
292
|
+
className: `
|
|
293
|
+
bg-background shadow-2xl w-full overflow-hidden relative border border-border/50
|
|
294
|
+
${n === "fullscreen" ? "rounded-none h-[95vh]" : "rounded-2xl max-h-[95vh]"}
|
|
295
|
+
${H[n] || H.md}
|
|
296
|
+
`,
|
|
297
|
+
onClick: (m) => m.stopPropagation(),
|
|
298
|
+
style: {
|
|
299
|
+
maxHeight: "95vh",
|
|
300
|
+
display: "flex",
|
|
301
|
+
flexDirection: "column"
|
|
302
|
+
},
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ s("div", { className: "bg-linear-to-r from-primary to-secondary p-4 flex justify-between items-center sticky top-0 z-10 border-b border-primary-foreground/20", children: [
|
|
305
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
306
|
+
/* @__PURE__ */ e("div", { className: "w-8 h-8 bg-primary-foreground/20 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-4 h-4 bg-primary-foreground rounded-full" }) }),
|
|
307
|
+
/* @__PURE__ */ e("h2", { className: "text-lg font-bold text-primary-foreground", children: o })
|
|
250
308
|
] }),
|
|
251
|
-
/* @__PURE__ */ e(
|
|
252
|
-
"
|
|
309
|
+
i ? /* @__PURE__ */ e(
|
|
310
|
+
"button",
|
|
253
311
|
{
|
|
254
|
-
|
|
255
|
-
|
|
312
|
+
onClick: r,
|
|
313
|
+
className: "text-primary-foreground hover:text-primary-foreground/80 hover:bg-primary-foreground/10 p-2 rounded-lg transition-all duration-200",
|
|
314
|
+
children: /* @__PURE__ */ e(P, { size: 24 })
|
|
256
315
|
}
|
|
257
|
-
)
|
|
258
|
-
]
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
316
|
+
) : /* @__PURE__ */ e("div", { className: "w-10 h-10 flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "w-5 h-5 border-2 border-primary-foreground/30 border-t-primary-foreground rounded-full animate-spin" }) })
|
|
317
|
+
] }),
|
|
318
|
+
/* @__PURE__ */ e(
|
|
319
|
+
"div",
|
|
320
|
+
{
|
|
321
|
+
className: `overflow-y-auto bg-linear-to-b from-background to-card/30 ${n === "fullscreen" ? "p-8 flex-1" : "p-6 flex-1"}`,
|
|
322
|
+
style: {
|
|
323
|
+
maxHeight: "calc(95vh - 80px)",
|
|
324
|
+
minHeight: 0
|
|
325
|
+
},
|
|
326
|
+
children: a
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
) }) });
|
|
334
|
+
return typeof window < "u" ? ce(u, document.body) : u;
|
|
265
335
|
}
|
|
266
|
-
const
|
|
267
|
-
isOpen:
|
|
268
|
-
onClose:
|
|
269
|
-
onConfirm:
|
|
336
|
+
const Ge = ({
|
|
337
|
+
isOpen: t,
|
|
338
|
+
onClose: r,
|
|
339
|
+
onConfirm: o,
|
|
270
340
|
loading: n = !1,
|
|
271
|
-
entidad:
|
|
341
|
+
entidad: a
|
|
272
342
|
}) => {
|
|
273
|
-
if (!
|
|
343
|
+
if (!t) return null;
|
|
274
344
|
const {
|
|
275
345
|
tipo: i = "elemento",
|
|
276
346
|
// "categoría", "producto", etc.
|
|
277
|
-
nombre:
|
|
278
|
-
dependencias:
|
|
347
|
+
nombre: c = "",
|
|
348
|
+
dependencias: d = 0,
|
|
279
349
|
nombreDependencia: u = ""
|
|
280
|
-
} =
|
|
350
|
+
} = a || {};
|
|
281
351
|
return /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ s("div", { className: "bg-background rounded-2xl shadow-2xl max-w-md w-full p-6 transform transition-all", children: [
|
|
282
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-center w-16 h-16 mx-auto mb-4 bg-destructive/10 rounded-full", children: /* @__PURE__ */ e(
|
|
352
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-center w-16 h-16 mx-auto mb-4 bg-destructive/10 rounded-full", children: /* @__PURE__ */ e(X, { className: "w-8 h-8 text-destructive" }) }),
|
|
283
353
|
/* @__PURE__ */ s("h3", { className: "text-xl font-bold text-foreground text-center mb-2", children: [
|
|
284
354
|
"¿Eliminar ",
|
|
285
355
|
i,
|
|
@@ -292,13 +362,13 @@ const Ke = ({
|
|
|
292
362
|
/* @__PURE__ */ s("strong", { children: [
|
|
293
363
|
i,
|
|
294
364
|
' "',
|
|
295
|
-
|
|
365
|
+
c,
|
|
296
366
|
'"'
|
|
297
367
|
] }),
|
|
298
|
-
|
|
368
|
+
d > 0 && u ? /* @__PURE__ */ s(z, { children: [
|
|
299
369
|
" y afectará a ",
|
|
300
370
|
/* @__PURE__ */ s("strong", { children: [
|
|
301
|
-
|
|
371
|
+
d,
|
|
302
372
|
" ",
|
|
303
373
|
u
|
|
304
374
|
] }),
|
|
@@ -311,7 +381,7 @@ const Ke = ({
|
|
|
311
381
|
/* @__PURE__ */ e(
|
|
312
382
|
"button",
|
|
313
383
|
{
|
|
314
|
-
onClick: () =>
|
|
384
|
+
onClick: () => r(!1),
|
|
315
385
|
className: "flex-1 px-4 py-3 border border-border text-foreground rounded-xl hover:bg-card transition-colors",
|
|
316
386
|
children: "Cancelar"
|
|
317
387
|
}
|
|
@@ -319,7 +389,7 @@ const Ke = ({
|
|
|
319
389
|
/* @__PURE__ */ e(
|
|
320
390
|
"button",
|
|
321
391
|
{
|
|
322
|
-
onClick:
|
|
392
|
+
onClick: o,
|
|
323
393
|
disabled: n,
|
|
324
394
|
className: `flex-1 px-4 py-3 ${n ? "bg-destructive/70" : "bg-destructive hover:bg-destructive/90"} text-destructive-foreground rounded-xl transition-colors`,
|
|
325
395
|
children: n ? "Cargando..." : "Eliminar"
|
|
@@ -327,45 +397,45 @@ const Ke = ({
|
|
|
327
397
|
)
|
|
328
398
|
] })
|
|
329
399
|
] }) });
|
|
330
|
-
},
|
|
400
|
+
}, ve = {
|
|
331
401
|
success: {
|
|
332
402
|
container: "bg-primary/10 border-primary/30 text-primary",
|
|
333
|
-
icon:
|
|
403
|
+
icon: re
|
|
334
404
|
},
|
|
335
405
|
error: {
|
|
336
406
|
container: "bg-destructive/10 border-destructive/30 text-destructive",
|
|
337
|
-
icon:
|
|
407
|
+
icon: te
|
|
338
408
|
},
|
|
339
409
|
info: {
|
|
340
410
|
container: "bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",
|
|
341
|
-
icon:
|
|
411
|
+
icon: ee
|
|
342
412
|
},
|
|
343
413
|
warning: {
|
|
344
414
|
container: "bg-amber-500/10 border-amber-500/30 text-amber-700 dark:text-amber-400",
|
|
345
|
-
icon:
|
|
415
|
+
icon: X
|
|
346
416
|
}
|
|
347
417
|
};
|
|
348
|
-
function
|
|
349
|
-
message:
|
|
350
|
-
variant:
|
|
351
|
-
open:
|
|
418
|
+
function Xe({
|
|
419
|
+
message: t,
|
|
420
|
+
variant: r = "info",
|
|
421
|
+
open: o,
|
|
352
422
|
onClose: n,
|
|
353
|
-
autoClose:
|
|
423
|
+
autoClose: a,
|
|
354
424
|
className: i = ""
|
|
355
425
|
}) {
|
|
356
|
-
const { container:
|
|
357
|
-
return
|
|
358
|
-
if (!
|
|
359
|
-
const u = setTimeout(n,
|
|
426
|
+
const { container: c, icon: d } = ve[r];
|
|
427
|
+
return E(() => {
|
|
428
|
+
if (!o || !a) return;
|
|
429
|
+
const u = setTimeout(n, a);
|
|
360
430
|
return () => clearTimeout(u);
|
|
361
|
-
}, [
|
|
431
|
+
}, [o, a, n]), o ? /* @__PURE__ */ s(
|
|
362
432
|
"div",
|
|
363
433
|
{
|
|
364
434
|
role: "alert",
|
|
365
|
-
className: `fixed top-20 right-4 z-[9999] max-w-md flex items-center gap-3 px-4 py-3 rounded-xl border shadow-xl shadow-black/10 dark:shadow-black/30 animate-in slide-in-from-top-5 fade-in duration-300 ${
|
|
435
|
+
className: `fixed top-20 right-4 z-[9999] max-w-md flex items-center gap-3 px-4 py-3 rounded-xl border shadow-xl shadow-black/10 dark:shadow-black/30 animate-in slide-in-from-top-5 fade-in duration-300 ${c} ${i}`,
|
|
366
436
|
children: [
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
/* @__PURE__ */ e("p", { className: "font-medium flex-1", children:
|
|
437
|
+
/* @__PURE__ */ e(d, { className: "w-5 h-5 shrink-0", "aria-hidden": !0 }),
|
|
438
|
+
/* @__PURE__ */ e("p", { className: "font-medium flex-1", children: t }),
|
|
369
439
|
/* @__PURE__ */ e(
|
|
370
440
|
"button",
|
|
371
441
|
{
|
|
@@ -373,47 +443,47 @@ function Ge({
|
|
|
373
443
|
onClick: n,
|
|
374
444
|
className: "shrink-0 p-1 rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors focus:outline-none focus:ring-2 focus:ring-ring",
|
|
375
445
|
"aria-label": "Cerrar",
|
|
376
|
-
children: /* @__PURE__ */ e(
|
|
446
|
+
children: /* @__PURE__ */ e(P, { className: "w-4 h-4" })
|
|
377
447
|
}
|
|
378
448
|
)
|
|
379
449
|
]
|
|
380
450
|
}
|
|
381
451
|
) : null;
|
|
382
452
|
}
|
|
383
|
-
const
|
|
384
|
-
function
|
|
385
|
-
value:
|
|
386
|
-
columns:
|
|
387
|
-
dataKey:
|
|
388
|
-
emptyMessage: n =
|
|
389
|
-
loading:
|
|
453
|
+
const we = "No hay registros para mostrar.", Ne = 10, Ce = [10, 25, 50];
|
|
454
|
+
function ke({
|
|
455
|
+
value: t,
|
|
456
|
+
columns: r,
|
|
457
|
+
dataKey: o,
|
|
458
|
+
emptyMessage: n = we,
|
|
459
|
+
loading: a = !1,
|
|
390
460
|
paginator: i = !1,
|
|
391
|
-
rows:
|
|
392
|
-
rowsPerPageOptions:
|
|
461
|
+
rows: c = Ne,
|
|
462
|
+
rowsPerPageOptions: d = Ce,
|
|
393
463
|
size: u = "normal",
|
|
394
|
-
stripedRows:
|
|
395
|
-
showGridlines:
|
|
396
|
-
className:
|
|
464
|
+
stripedRows: m = !1,
|
|
465
|
+
showGridlines: p = !1,
|
|
466
|
+
className: h,
|
|
397
467
|
style: g
|
|
398
468
|
}) {
|
|
399
|
-
const x =
|
|
400
|
-
return /* @__PURE__ */ e("div", { className: `data-table-viva overflow-hidden rounded-lg border border-border bg-card ${
|
|
401
|
-
|
|
469
|
+
const x = r.filter((l) => !l.hidden);
|
|
470
|
+
return /* @__PURE__ */ e("div", { className: `data-table-viva overflow-hidden rounded-lg border border-border bg-card ${h ?? ""}`.trim(), style: g, children: /* @__PURE__ */ e(
|
|
471
|
+
de,
|
|
402
472
|
{
|
|
403
|
-
value:
|
|
404
|
-
dataKey:
|
|
405
|
-
loading:
|
|
473
|
+
value: t,
|
|
474
|
+
dataKey: o,
|
|
475
|
+
loading: a,
|
|
406
476
|
emptyMessage: n,
|
|
407
477
|
paginator: i,
|
|
408
|
-
rows:
|
|
409
|
-
rowsPerPageOptions:
|
|
478
|
+
rows: c,
|
|
479
|
+
rowsPerPageOptions: d,
|
|
410
480
|
size: u,
|
|
411
|
-
stripedRows:
|
|
412
|
-
showGridlines:
|
|
481
|
+
stripedRows: m,
|
|
482
|
+
showGridlines: p,
|
|
413
483
|
paginatorTemplate: "FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown",
|
|
414
484
|
currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords} registros",
|
|
415
485
|
children: x.map((l) => /* @__PURE__ */ e(
|
|
416
|
-
|
|
486
|
+
ue,
|
|
417
487
|
{
|
|
418
488
|
field: l.field,
|
|
419
489
|
header: l.header,
|
|
@@ -422,51 +492,51 @@ function ve({
|
|
|
422
492
|
alignHeader: l.alignHeader,
|
|
423
493
|
style: l.style,
|
|
424
494
|
bodyClassName: l.bodyClassName,
|
|
425
|
-
body: l.body ? (
|
|
495
|
+
body: l.body ? (b) => l.body(b) : void 0
|
|
426
496
|
},
|
|
427
497
|
String(l.field)
|
|
428
498
|
))
|
|
429
499
|
}
|
|
430
500
|
) });
|
|
431
501
|
}
|
|
432
|
-
function
|
|
433
|
-
return /* @__PURE__ */ e(
|
|
502
|
+
function qe(t) {
|
|
503
|
+
return /* @__PURE__ */ e(ke, { ...t });
|
|
434
504
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
label:
|
|
438
|
-
id:
|
|
439
|
-
name:
|
|
505
|
+
const $e = "w-full px-4 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm", Fe = "w-full pl-4 pr-12 py-3 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm", Te = "w-full px-4 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm", Ee = "w-full pl-4 pr-12 pt-6 pb-2 border text-base border-input rounded-xl focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-all bg-background shadow-sm";
|
|
506
|
+
function Je({
|
|
507
|
+
label: t,
|
|
508
|
+
id: r,
|
|
509
|
+
name: o,
|
|
440
510
|
type: n = "text",
|
|
441
|
-
value:
|
|
511
|
+
value: a = "",
|
|
442
512
|
onChange: i,
|
|
443
|
-
onBlur:
|
|
444
|
-
placeholder:
|
|
513
|
+
onBlur: c,
|
|
514
|
+
placeholder: d,
|
|
445
515
|
required: u = !1,
|
|
446
|
-
options:
|
|
447
|
-
rows:
|
|
448
|
-
className:
|
|
516
|
+
options: m = [],
|
|
517
|
+
rows: p = 4,
|
|
518
|
+
className: h = "",
|
|
449
519
|
floatingLabel: g = !1,
|
|
450
520
|
helperText: x,
|
|
451
521
|
disabled: l = !1,
|
|
452
|
-
inputMode:
|
|
522
|
+
inputMode: b
|
|
453
523
|
}) {
|
|
454
|
-
const [
|
|
455
|
-
|
|
524
|
+
const [T, k] = C(!1), [y, $] = C(!1), v = G(null), L = g && (T || a !== "" && a !== void 0 && a !== null), f = n === "password", w = f && y ? "text" : n, I = () => {
|
|
525
|
+
k(!0);
|
|
456
526
|
}, A = (N) => {
|
|
457
|
-
|
|
458
|
-
}, F = g ?
|
|
459
|
-
|
|
527
|
+
k(!1), c?.(N);
|
|
528
|
+
}, F = g ? f ? Ee : Te : f ? Fe : $e, U = () => {
|
|
529
|
+
$(!y);
|
|
460
530
|
};
|
|
461
|
-
return /* @__PURE__ */ s("div", { className:
|
|
531
|
+
return /* @__PURE__ */ s("div", { className: h, children: [
|
|
462
532
|
g ? /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
463
|
-
|
|
533
|
+
t && /* @__PURE__ */ s(
|
|
464
534
|
"label",
|
|
465
535
|
{
|
|
466
|
-
htmlFor:
|
|
536
|
+
htmlFor: r,
|
|
467
537
|
className: `absolute left-4 transition-all duration-200 pointer-events-none ${L ? "top-2 text-xs text-muted-foreground font-medium" : "top-1/2 -translate-y-1/2 text-base text-muted-foreground/70"}`,
|
|
468
538
|
children: [
|
|
469
|
-
|
|
539
|
+
t,
|
|
470
540
|
u && /* @__PURE__ */ e("span", { className: "text-destructive ml-1", children: "*" })
|
|
471
541
|
]
|
|
472
542
|
}
|
|
@@ -474,72 +544,81 @@ function Ze({
|
|
|
474
544
|
n === "textarea" ? /* @__PURE__ */ e(
|
|
475
545
|
"textarea",
|
|
476
546
|
{
|
|
477
|
-
ref:
|
|
478
|
-
id:
|
|
479
|
-
name:
|
|
480
|
-
value:
|
|
547
|
+
ref: v,
|
|
548
|
+
id: r,
|
|
549
|
+
name: o,
|
|
550
|
+
value: a,
|
|
481
551
|
onChange: i,
|
|
482
|
-
onFocus:
|
|
552
|
+
onFocus: I,
|
|
483
553
|
onBlur: A,
|
|
484
|
-
placeholder: L ?
|
|
485
|
-
rows:
|
|
554
|
+
placeholder: L ? d : "",
|
|
555
|
+
rows: p,
|
|
486
556
|
disabled: l,
|
|
487
557
|
className: `${F} resize-none`
|
|
488
558
|
}
|
|
489
559
|
) : n === "select" ? /* @__PURE__ */ s(
|
|
490
560
|
"select",
|
|
491
561
|
{
|
|
492
|
-
ref:
|
|
493
|
-
id:
|
|
494
|
-
name:
|
|
495
|
-
value:
|
|
562
|
+
ref: v,
|
|
563
|
+
id: r,
|
|
564
|
+
name: o,
|
|
565
|
+
value: a,
|
|
496
566
|
onChange: i,
|
|
497
|
-
onFocus:
|
|
567
|
+
onFocus: I,
|
|
498
568
|
onBlur: A,
|
|
499
569
|
disabled: l,
|
|
500
570
|
className: F,
|
|
501
571
|
children: [
|
|
502
572
|
/* @__PURE__ */ e("option", { value: "", children: "Seleccionar opción" }),
|
|
503
|
-
|
|
573
|
+
m.map((N) => /* @__PURE__ */ e("option", { value: N.value, children: N.label }, N.value))
|
|
504
574
|
]
|
|
505
575
|
}
|
|
506
|
-
) : /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
576
|
+
) : /* @__PURE__ */ s("div", { className: "relative", style: { position: "relative" }, children: [
|
|
507
577
|
/* @__PURE__ */ e(
|
|
508
578
|
"input",
|
|
509
579
|
{
|
|
510
|
-
ref:
|
|
580
|
+
ref: v,
|
|
511
581
|
type: w,
|
|
512
|
-
id:
|
|
513
|
-
name:
|
|
514
|
-
value:
|
|
582
|
+
id: r,
|
|
583
|
+
name: o,
|
|
584
|
+
value: a,
|
|
515
585
|
onChange: i,
|
|
516
|
-
onFocus:
|
|
586
|
+
onFocus: I,
|
|
517
587
|
onBlur: A,
|
|
518
|
-
placeholder: L ?
|
|
588
|
+
placeholder: L ? d : "",
|
|
519
589
|
disabled: l,
|
|
520
|
-
inputMode:
|
|
590
|
+
inputMode: b,
|
|
521
591
|
className: F
|
|
522
592
|
}
|
|
523
593
|
),
|
|
524
|
-
|
|
594
|
+
f && /* @__PURE__ */ e(
|
|
525
595
|
"button",
|
|
526
596
|
{
|
|
527
597
|
type: "button",
|
|
528
|
-
onClick:
|
|
529
|
-
className: "absolute
|
|
530
|
-
|
|
531
|
-
|
|
598
|
+
onClick: U,
|
|
599
|
+
className: "absolute text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1 z-10",
|
|
600
|
+
style: {
|
|
601
|
+
position: "absolute",
|
|
602
|
+
right: "0.75rem",
|
|
603
|
+
top: "50%",
|
|
604
|
+
transform: "translateY(-50%)",
|
|
605
|
+
display: "flex",
|
|
606
|
+
alignItems: "center",
|
|
607
|
+
justifyContent: "center"
|
|
608
|
+
},
|
|
609
|
+
"aria-label": y ? "Ocultar contraseña" : "Mostrar contraseña",
|
|
610
|
+
children: y ? /* @__PURE__ */ e(O, { className: "w-5 h-5", style: { width: "1.25rem", height: "1.25rem" } }) : /* @__PURE__ */ e(R, { className: "w-5 h-5", style: { width: "1.25rem", height: "1.25rem" } })
|
|
532
611
|
}
|
|
533
612
|
)
|
|
534
613
|
] })
|
|
535
|
-
] }) : /* @__PURE__ */ s(
|
|
536
|
-
|
|
614
|
+
] }) : /* @__PURE__ */ s(z, { children: [
|
|
615
|
+
t && /* @__PURE__ */ s(
|
|
537
616
|
"label",
|
|
538
617
|
{
|
|
539
|
-
htmlFor:
|
|
618
|
+
htmlFor: r,
|
|
540
619
|
className: "block text-base font-semibold text-foreground mb-2",
|
|
541
620
|
children: [
|
|
542
|
-
|
|
621
|
+
t,
|
|
543
622
|
u && /* @__PURE__ */ e("span", { className: "text-destructive ml-1", children: "*" })
|
|
544
623
|
]
|
|
545
624
|
}
|
|
@@ -547,134 +626,143 @@ function Ze({
|
|
|
547
626
|
n === "textarea" ? /* @__PURE__ */ e(
|
|
548
627
|
"textarea",
|
|
549
628
|
{
|
|
550
|
-
id:
|
|
551
|
-
name:
|
|
552
|
-
value:
|
|
629
|
+
id: r,
|
|
630
|
+
name: o,
|
|
631
|
+
value: a,
|
|
553
632
|
onChange: i,
|
|
554
|
-
placeholder:
|
|
555
|
-
rows:
|
|
633
|
+
placeholder: d,
|
|
634
|
+
rows: p,
|
|
556
635
|
disabled: l,
|
|
557
636
|
className: `${F} resize-none`
|
|
558
637
|
}
|
|
559
638
|
) : n === "select" ? /* @__PURE__ */ s(
|
|
560
639
|
"select",
|
|
561
640
|
{
|
|
562
|
-
id:
|
|
563
|
-
name:
|
|
564
|
-
value:
|
|
641
|
+
id: r,
|
|
642
|
+
name: o,
|
|
643
|
+
value: a,
|
|
565
644
|
onChange: i,
|
|
566
645
|
disabled: l,
|
|
567
646
|
className: F,
|
|
568
647
|
children: [
|
|
569
648
|
/* @__PURE__ */ e("option", { value: "", children: "Seleccionar opción" }),
|
|
570
|
-
|
|
649
|
+
m.map((N) => /* @__PURE__ */ e("option", { value: N.value, children: N.label }, N.value))
|
|
571
650
|
]
|
|
572
651
|
}
|
|
573
|
-
) : /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
652
|
+
) : /* @__PURE__ */ s("div", { className: "relative", style: { position: "relative" }, children: [
|
|
574
653
|
/* @__PURE__ */ e(
|
|
575
654
|
"input",
|
|
576
655
|
{
|
|
577
656
|
type: w,
|
|
578
|
-
id:
|
|
579
|
-
name:
|
|
580
|
-
value:
|
|
657
|
+
id: r,
|
|
658
|
+
name: o,
|
|
659
|
+
value: a,
|
|
581
660
|
onChange: i,
|
|
582
|
-
onFocus:
|
|
661
|
+
onFocus: I,
|
|
583
662
|
onBlur: A,
|
|
584
|
-
placeholder:
|
|
663
|
+
placeholder: d,
|
|
585
664
|
disabled: l,
|
|
586
|
-
inputMode:
|
|
665
|
+
inputMode: b,
|
|
587
666
|
className: F
|
|
588
667
|
}
|
|
589
668
|
),
|
|
590
|
-
|
|
669
|
+
f && /* @__PURE__ */ e(
|
|
591
670
|
"button",
|
|
592
671
|
{
|
|
593
672
|
type: "button",
|
|
594
|
-
onClick:
|
|
595
|
-
className: "absolute
|
|
596
|
-
|
|
597
|
-
|
|
673
|
+
onClick: U,
|
|
674
|
+
className: "absolute text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus:ring-2 focus:ring-ring rounded p-1 z-10",
|
|
675
|
+
style: {
|
|
676
|
+
position: "absolute",
|
|
677
|
+
right: "0.75rem",
|
|
678
|
+
top: "50%",
|
|
679
|
+
transform: "translateY(-50%)",
|
|
680
|
+
display: "flex",
|
|
681
|
+
alignItems: "center",
|
|
682
|
+
justifyContent: "center"
|
|
683
|
+
},
|
|
684
|
+
"aria-label": y ? "Ocultar contraseña" : "Mostrar contraseña",
|
|
685
|
+
children: y ? /* @__PURE__ */ e(O, { className: "w-5 h-5", style: { width: "1.25rem", height: "1.25rem" } }) : /* @__PURE__ */ e(R, { className: "w-5 h-5", style: { width: "1.25rem", height: "1.25rem" } })
|
|
598
686
|
}
|
|
599
687
|
)
|
|
600
688
|
] })
|
|
601
689
|
] }),
|
|
602
|
-
x && /* @__PURE__ */ e("p", { className: `mt-2 text-sm ${
|
|
690
|
+
x && /* @__PURE__ */ e("p", { className: `mt-2 text-sm ${h?.includes("border-red-500") ? "text-destructive" : "text-muted-foreground"}`, children: x })
|
|
603
691
|
] });
|
|
604
692
|
}
|
|
605
|
-
function
|
|
606
|
-
value:
|
|
607
|
-
onChange:
|
|
608
|
-
placeholder:
|
|
693
|
+
function Qe({
|
|
694
|
+
value: t,
|
|
695
|
+
onChange: r,
|
|
696
|
+
placeholder: o = "Buscar...",
|
|
609
697
|
className: n = ""
|
|
610
698
|
}) {
|
|
611
699
|
return /* @__PURE__ */ s("div", { className: `relative ${n}`, children: [
|
|
612
|
-
/* @__PURE__ */ e(
|
|
700
|
+
/* @__PURE__ */ e(ne, { className: "absolute left-4 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400" }),
|
|
613
701
|
/* @__PURE__ */ e(
|
|
614
702
|
"input",
|
|
615
703
|
{
|
|
616
704
|
type: "text",
|
|
617
|
-
value:
|
|
618
|
-
onChange: (
|
|
619
|
-
placeholder:
|
|
705
|
+
value: t,
|
|
706
|
+
onChange: (a) => r(a.target.value),
|
|
707
|
+
placeholder: o,
|
|
620
708
|
className: "w-full pl-12 pr-4 py-3 bg-white border-2 border-gray-200 rounded-xl focus:ring-2 focus:ring-uno focus:border-uno transition-all text-sm font-medium text-divisiones placeholder-gray-400"
|
|
621
709
|
}
|
|
622
710
|
),
|
|
623
|
-
|
|
711
|
+
t && /* @__PURE__ */ e(
|
|
624
712
|
"button",
|
|
625
713
|
{
|
|
626
|
-
onClick: () =>
|
|
714
|
+
onClick: () => r(""),
|
|
627
715
|
className: "absolute right-4 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-divisiones transition-colors",
|
|
628
716
|
type: "button",
|
|
629
|
-
children: /* @__PURE__ */ e(
|
|
717
|
+
children: /* @__PURE__ */ e(P, { className: "w-4 h-4" })
|
|
630
718
|
}
|
|
631
719
|
)
|
|
632
720
|
] });
|
|
633
721
|
}
|
|
634
|
-
function
|
|
635
|
-
id:
|
|
636
|
-
name:
|
|
637
|
-
label:
|
|
722
|
+
function et({
|
|
723
|
+
id: t,
|
|
724
|
+
name: r,
|
|
725
|
+
label: o,
|
|
638
726
|
accept: n = ".pdf,application/pdf",
|
|
639
|
-
required:
|
|
727
|
+
required: a = !1,
|
|
640
728
|
helperText: i,
|
|
641
|
-
onChange:
|
|
642
|
-
error:
|
|
729
|
+
onChange: c,
|
|
730
|
+
error: d,
|
|
643
731
|
disabled: u = !1,
|
|
644
|
-
maxSizeMB:
|
|
645
|
-
currentFileName:
|
|
732
|
+
maxSizeMB: m = 10,
|
|
733
|
+
currentFileName: p
|
|
646
734
|
}) {
|
|
647
|
-
const [
|
|
648
|
-
if (n.includes("pdf") &&
|
|
735
|
+
const [h, g] = C(null), [x, l] = C(!1), b = G(null), T = (f) => {
|
|
736
|
+
if (n.includes("pdf") && f.type !== "application/pdf")
|
|
649
737
|
return "El archivo debe ser un PDF";
|
|
650
|
-
const w =
|
|
651
|
-
return
|
|
652
|
-
},
|
|
653
|
-
if (!
|
|
654
|
-
g(null),
|
|
738
|
+
const w = m * 1024 * 1024;
|
|
739
|
+
return f.size > w ? `El archivo no debe superar ${m}MB` : null;
|
|
740
|
+
}, k = (f) => {
|
|
741
|
+
if (!f) {
|
|
742
|
+
g(null), c(null);
|
|
655
743
|
return;
|
|
656
744
|
}
|
|
657
|
-
if (
|
|
658
|
-
|
|
745
|
+
if (T(f)) {
|
|
746
|
+
c(null);
|
|
659
747
|
return;
|
|
660
748
|
}
|
|
661
|
-
g(
|
|
662
|
-
},
|
|
663
|
-
const w =
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
},
|
|
668
|
-
if (
|
|
669
|
-
const w =
|
|
670
|
-
w &&
|
|
671
|
-
},
|
|
672
|
-
g(null),
|
|
749
|
+
g(f), c(f);
|
|
750
|
+
}, y = (f) => {
|
|
751
|
+
const w = f.target.files?.[0] || null;
|
|
752
|
+
k(w);
|
|
753
|
+
}, $ = (f) => {
|
|
754
|
+
f.preventDefault(), f.stopPropagation(), f.type === "dragenter" || f.type === "dragover" ? l(!0) : f.type === "dragleave" && l(!1);
|
|
755
|
+
}, v = (f) => {
|
|
756
|
+
if (f.preventDefault(), f.stopPropagation(), l(!1), u) return;
|
|
757
|
+
const w = f.dataTransfer.files?.[0];
|
|
758
|
+
w && k(w);
|
|
759
|
+
}, S = () => {
|
|
760
|
+
g(null), c(null), b.current && (b.current.value = "");
|
|
673
761
|
};
|
|
674
762
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
675
|
-
/* @__PURE__ */ s("label", { htmlFor:
|
|
676
|
-
|
|
677
|
-
|
|
763
|
+
/* @__PURE__ */ s("label", { htmlFor: t, className: "block text-sm font-medium text-foreground", children: [
|
|
764
|
+
o,
|
|
765
|
+
a && /* @__PURE__ */ e("span", { className: "text-destructive ml-1", children: "*" })
|
|
678
766
|
] }),
|
|
679
767
|
/* @__PURE__ */ s(
|
|
680
768
|
"div",
|
|
@@ -683,36 +771,36 @@ function Ye({
|
|
|
683
771
|
relative border-2 border-dashed rounded-lg p-6 transition-all
|
|
684
772
|
${x ? "border-primary bg-primary/5" : "border-border"}
|
|
685
773
|
${u ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-primary/50"}
|
|
686
|
-
${
|
|
774
|
+
${d ? "border-destructive" : ""}
|
|
687
775
|
`,
|
|
688
|
-
onDragEnter:
|
|
689
|
-
onDragLeave:
|
|
690
|
-
onDragOver:
|
|
691
|
-
onDrop:
|
|
776
|
+
onDragEnter: $,
|
|
777
|
+
onDragLeave: $,
|
|
778
|
+
onDragOver: $,
|
|
779
|
+
onDrop: v,
|
|
692
780
|
onClick: () => {
|
|
693
|
-
u ||
|
|
781
|
+
u || b.current?.click();
|
|
694
782
|
},
|
|
695
783
|
children: [
|
|
696
784
|
/* @__PURE__ */ e(
|
|
697
785
|
"input",
|
|
698
786
|
{
|
|
699
|
-
ref:
|
|
700
|
-
id:
|
|
701
|
-
name:
|
|
787
|
+
ref: b,
|
|
788
|
+
id: t,
|
|
789
|
+
name: r,
|
|
702
790
|
type: "file",
|
|
703
791
|
accept: n,
|
|
704
|
-
onChange:
|
|
792
|
+
onChange: y,
|
|
705
793
|
disabled: u,
|
|
706
794
|
className: "hidden"
|
|
707
795
|
}
|
|
708
796
|
),
|
|
709
|
-
|
|
797
|
+
h || p ? /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
710
798
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
|
|
711
|
-
/* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-primary/10 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
799
|
+
/* @__PURE__ */ e("div", { className: "p-2 rounded-lg bg-primary/10 flex-shrink-0", children: /* @__PURE__ */ e(M, { className: "w-5 h-5 text-primary" }) }),
|
|
712
800
|
/* @__PURE__ */ s("div", { className: "flex-1 min-w-0", children: [
|
|
713
|
-
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children:
|
|
714
|
-
|
|
715
|
-
(
|
|
801
|
+
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground truncate", children: h?.name || p }),
|
|
802
|
+
h && /* @__PURE__ */ s("p", { className: "text-xs text-muted-foreground", children: [
|
|
803
|
+
(h.size / 1024 / 1024).toFixed(2),
|
|
716
804
|
" MB"
|
|
717
805
|
] })
|
|
718
806
|
] })
|
|
@@ -721,54 +809,54 @@ function Ye({
|
|
|
721
809
|
"button",
|
|
722
810
|
{
|
|
723
811
|
type: "button",
|
|
724
|
-
onClick: (
|
|
725
|
-
|
|
812
|
+
onClick: (f) => {
|
|
813
|
+
f.stopPropagation(), S();
|
|
726
814
|
},
|
|
727
815
|
className: "p-2 rounded-lg hover:bg-destructive/10 transition-colors flex-shrink-0",
|
|
728
|
-
children: /* @__PURE__ */ e(
|
|
816
|
+
children: /* @__PURE__ */ e(P, { className: "w-4 h-4 text-destructive" })
|
|
729
817
|
}
|
|
730
818
|
)
|
|
731
819
|
] }) : /* @__PURE__ */ s("div", { className: "text-center", children: [
|
|
732
|
-
/* @__PURE__ */ e(
|
|
820
|
+
/* @__PURE__ */ e(oe, { className: "mx-auto h-12 w-12 text-muted-foreground" }),
|
|
733
821
|
/* @__PURE__ */ s("div", { className: "mt-4", children: [
|
|
734
822
|
/* @__PURE__ */ s("p", { className: "text-sm text-foreground", children: [
|
|
735
823
|
"Arrastra y suelta tu archivo aquí, o",
|
|
736
824
|
" ",
|
|
737
825
|
/* @__PURE__ */ e("span", { className: "text-primary font-medium", children: "haz clic para seleccionar" })
|
|
738
826
|
] }),
|
|
739
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-2", children: n.includes("pdf") ? `Archivos PDF (máx. ${
|
|
827
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground mt-2", children: n.includes("pdf") ? `Archivos PDF (máx. ${m}MB)` : `Máximo ${m}MB` })
|
|
740
828
|
] })
|
|
741
829
|
] })
|
|
742
830
|
]
|
|
743
831
|
}
|
|
744
832
|
),
|
|
745
|
-
i && !
|
|
746
|
-
|
|
833
|
+
i && !d && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: i }),
|
|
834
|
+
d && /* @__PURE__ */ e("p", { className: "text-xs text-destructive", children: d })
|
|
747
835
|
] });
|
|
748
836
|
}
|
|
749
|
-
function
|
|
750
|
-
label:
|
|
751
|
-
id:
|
|
752
|
-
options:
|
|
837
|
+
function tt({
|
|
838
|
+
label: t,
|
|
839
|
+
id: r,
|
|
840
|
+
options: o,
|
|
753
841
|
selectedIds: n,
|
|
754
|
-
onChange:
|
|
842
|
+
onChange: a,
|
|
755
843
|
loading: i = !1,
|
|
756
|
-
disabled:
|
|
757
|
-
loadingMessage:
|
|
844
|
+
disabled: c = !1,
|
|
845
|
+
loadingMessage: d = "Cargando...",
|
|
758
846
|
emptyMessage: u,
|
|
759
|
-
renderLabel:
|
|
760
|
-
helperText:
|
|
761
|
-
itemName:
|
|
847
|
+
renderLabel: m,
|
|
848
|
+
helperText: p,
|
|
849
|
+
itemName: h = "item",
|
|
762
850
|
itemNamePlural: g,
|
|
763
851
|
maxHeight: x = "max-h-60",
|
|
764
852
|
headerAction: l,
|
|
765
|
-
emptyAction:
|
|
766
|
-
className:
|
|
853
|
+
emptyAction: b,
|
|
854
|
+
className: T = ""
|
|
767
855
|
}) {
|
|
768
|
-
const
|
|
769
|
-
return /* @__PURE__ */ s("div", { className: `space-y-2 ${
|
|
856
|
+
const k = g || `${h}s`, y = n.length, $ = y > 0;
|
|
857
|
+
return /* @__PURE__ */ s("div", { className: `space-y-2 ${T}`, children: [
|
|
770
858
|
/* @__PURE__ */ s("div", { className: l ? "flex items-center justify-between" : "", children: [
|
|
771
|
-
/* @__PURE__ */ e("label", { htmlFor:
|
|
859
|
+
/* @__PURE__ */ e("label", { htmlFor: r, className: "block text-sm font-medium text-foreground", children: t }),
|
|
772
860
|
l && /* @__PURE__ */ e(
|
|
773
861
|
B,
|
|
774
862
|
{
|
|
@@ -777,26 +865,26 @@ function qe({
|
|
|
777
865
|
icon: l.icon,
|
|
778
866
|
label: l.label,
|
|
779
867
|
onClick: l.onClick,
|
|
780
|
-
disabled:
|
|
868
|
+
disabled: c,
|
|
781
869
|
className: "text-xs"
|
|
782
870
|
}
|
|
783
871
|
)
|
|
784
872
|
] }),
|
|
785
|
-
/* @__PURE__ */ e("div", { className: `${x} overflow-y-auto border border-border rounded-lg p-3 bg-background`, children: i ? /* @__PURE__ */ e("div", { className: "text-center py-4 text-muted-foreground", children:
|
|
873
|
+
/* @__PURE__ */ e("div", { className: `${x} overflow-y-auto border border-border rounded-lg p-3 bg-background`, children: i ? /* @__PURE__ */ e("div", { className: "text-center py-4 text-muted-foreground", children: d }) : o.length === 0 ? /* @__PURE__ */ s("div", { className: "text-center py-4 space-y-3", children: [
|
|
786
874
|
u && /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: u }),
|
|
787
|
-
|
|
875
|
+
b && /* @__PURE__ */ e(
|
|
788
876
|
B,
|
|
789
877
|
{
|
|
790
878
|
type: "button",
|
|
791
|
-
variant:
|
|
792
|
-
icon:
|
|
793
|
-
label:
|
|
794
|
-
onClick:
|
|
795
|
-
disabled:
|
|
879
|
+
variant: b.variant || "primary",
|
|
880
|
+
icon: b.icon,
|
|
881
|
+
label: b.label,
|
|
882
|
+
onClick: b.onClick,
|
|
883
|
+
disabled: c
|
|
796
884
|
}
|
|
797
885
|
)
|
|
798
|
-
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children:
|
|
799
|
-
const
|
|
886
|
+
] }) : /* @__PURE__ */ e("div", { className: "space-y-2", children: o.map((v) => {
|
|
887
|
+
const S = n.includes(v.id);
|
|
800
888
|
return /* @__PURE__ */ s(
|
|
801
889
|
"label",
|
|
802
890
|
{
|
|
@@ -806,151 +894,154 @@ function qe({
|
|
|
806
894
|
"input",
|
|
807
895
|
{
|
|
808
896
|
type: "checkbox",
|
|
809
|
-
checked:
|
|
810
|
-
onChange: () =>
|
|
811
|
-
disabled:
|
|
897
|
+
checked: S,
|
|
898
|
+
onChange: () => a(v.id),
|
|
899
|
+
disabled: c,
|
|
812
900
|
className: "w-4 h-4 text-primary border-border rounded focus:ring-primary focus:ring-2"
|
|
813
901
|
}
|
|
814
902
|
),
|
|
815
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-foreground", children:
|
|
903
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-foreground", children: m(v) })
|
|
816
904
|
]
|
|
817
905
|
},
|
|
818
|
-
|
|
906
|
+
v.id
|
|
819
907
|
);
|
|
820
908
|
}) }) }),
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
909
|
+
p && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: p }),
|
|
910
|
+
$ && /* @__PURE__ */ s("p", { className: "text-xs text-primary", children: [
|
|
911
|
+
y,
|
|
824
912
|
" ",
|
|
825
|
-
|
|
913
|
+
y === 1 ? h : k,
|
|
826
914
|
" seleccionado",
|
|
827
|
-
|
|
915
|
+
y !== 1 ? "s" : ""
|
|
828
916
|
] })
|
|
829
917
|
] });
|
|
830
918
|
}
|
|
831
|
-
function
|
|
832
|
-
label:
|
|
833
|
-
description:
|
|
834
|
-
value:
|
|
919
|
+
function rt({
|
|
920
|
+
label: t,
|
|
921
|
+
description: r,
|
|
922
|
+
value: o,
|
|
835
923
|
onChange: n,
|
|
836
|
-
icon:
|
|
924
|
+
icon: a,
|
|
837
925
|
disabled: i = !1,
|
|
838
|
-
className:
|
|
926
|
+
className: c = ""
|
|
839
927
|
}) {
|
|
840
|
-
const
|
|
841
|
-
return /* @__PURE__ */ s("div", { className: `flex items-center justify-between p-4 bg-background rounded-xl border border-border hover:bg-card transition-colors duration-200 ${i ? "opacity-50 cursor-not-allowed" : ""} ${
|
|
928
|
+
const d = !!o;
|
|
929
|
+
return /* @__PURE__ */ s("div", { className: `flex items-center justify-between p-4 bg-background rounded-xl border border-border hover:bg-card transition-colors duration-200 ${i ? "opacity-50 cursor-not-allowed" : ""} ${c}`, children: [
|
|
842
930
|
/* @__PURE__ */ s("div", { className: "flex items-center gap-3 flex-1", children: [
|
|
843
|
-
|
|
931
|
+
a && /* @__PURE__ */ e("div", { className: "flex-shrink-0 w-10 h-10 bg-gradient-to-br from-primary/80 to-primary-foreground/20 rounded-lg flex items-center justify-center text-primary-foreground", children: a }),
|
|
844
932
|
/* @__PURE__ */ s("div", { className: "flex-1", children: [
|
|
845
|
-
/* @__PURE__ */ e("label", { className: "block text-sm font-semibold text-foreground mb-1", children:
|
|
846
|
-
|
|
933
|
+
/* @__PURE__ */ e("label", { className: "block text-sm font-semibold text-foreground mb-1 cursor-pointer", onClick: () => !i && n(!d), children: t }),
|
|
934
|
+
r && /* @__PURE__ */ e("span", { className: "text-xs text-muted-foreground", children: r })
|
|
847
935
|
] })
|
|
848
936
|
] }),
|
|
849
937
|
/* @__PURE__ */ e(
|
|
850
|
-
|
|
938
|
+
j.button,
|
|
851
939
|
{
|
|
852
940
|
type: "button",
|
|
853
|
-
onClick: () => !i && n(!
|
|
941
|
+
onClick: () => !i && n(!d),
|
|
854
942
|
disabled: i,
|
|
855
943
|
className: `
|
|
856
944
|
relative flex items-center w-14 h-8 rounded-full p-1 transition-colors duration-300
|
|
857
945
|
focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary/50
|
|
858
946
|
${i ? "cursor-not-allowed" : "cursor-pointer"}
|
|
859
|
-
${
|
|
947
|
+
${d ? "bg-gradient-to-r from-green-500 to-green-600" : "bg-muted"}
|
|
860
948
|
`,
|
|
861
949
|
whileTap: i ? {} : { scale: 0.95 },
|
|
950
|
+
"aria-label": d ? "Desactivar" : "Activar",
|
|
951
|
+
"aria-checked": d,
|
|
952
|
+
role: "switch",
|
|
862
953
|
children: /* @__PURE__ */ e(
|
|
863
|
-
|
|
954
|
+
j.div,
|
|
864
955
|
{
|
|
865
956
|
className: "w-6 h-6 bg-white rounded-full shadow-lg flex items-center justify-center",
|
|
866
957
|
animate: {
|
|
867
|
-
x:
|
|
958
|
+
x: d ? 26 : 0
|
|
868
959
|
},
|
|
869
960
|
transition: {
|
|
870
961
|
type: "spring",
|
|
871
962
|
stiffness: 500,
|
|
872
963
|
damping: 30
|
|
873
964
|
},
|
|
874
|
-
children:
|
|
965
|
+
children: d ? /* @__PURE__ */ e(ae, { className: "w-4 h-4 text-green-600" }) : /* @__PURE__ */ e(P, { className: "w-4 h-4 text-muted-foreground" })
|
|
875
966
|
}
|
|
876
967
|
)
|
|
877
968
|
}
|
|
878
969
|
)
|
|
879
970
|
] });
|
|
880
971
|
}
|
|
881
|
-
const
|
|
882
|
-
const
|
|
972
|
+
const je = (t) => {
|
|
973
|
+
const r = typeof t == "string" ? parseFloat(t) : t;
|
|
883
974
|
return new Intl.NumberFormat("es-CO", {
|
|
884
975
|
style: "currency",
|
|
885
976
|
currency: "COP",
|
|
886
977
|
minimumFractionDigits: 0,
|
|
887
978
|
maximumFractionDigits: 0
|
|
888
|
-
}).format(
|
|
979
|
+
}).format(r);
|
|
889
980
|
};
|
|
890
|
-
function
|
|
891
|
-
value:
|
|
892
|
-
className:
|
|
893
|
-
bold:
|
|
981
|
+
function nt({
|
|
982
|
+
value: t,
|
|
983
|
+
className: r = "",
|
|
984
|
+
bold: o = !1,
|
|
894
985
|
primary: n = !1,
|
|
895
|
-
secondary:
|
|
986
|
+
secondary: a = !1,
|
|
896
987
|
success: i = !1,
|
|
897
|
-
error:
|
|
898
|
-
size:
|
|
988
|
+
error: c = !1,
|
|
989
|
+
size: d = "base",
|
|
899
990
|
emptyText: u = "-"
|
|
900
991
|
}) {
|
|
901
|
-
if (
|
|
902
|
-
return /* @__PURE__ */ e("span", { className: `text-muted-foreground ${
|
|
903
|
-
const
|
|
904
|
-
if (isNaN(
|
|
905
|
-
return /* @__PURE__ */ e("span", { className: `text-muted-foreground ${
|
|
906
|
-
const
|
|
992
|
+
if (t == null)
|
|
993
|
+
return /* @__PURE__ */ e("span", { className: `text-muted-foreground ${r}`, children: u });
|
|
994
|
+
const m = typeof t == "string" ? parseFloat(t) : t;
|
|
995
|
+
if (isNaN(m))
|
|
996
|
+
return /* @__PURE__ */ e("span", { className: `text-muted-foreground ${r}`, children: u });
|
|
997
|
+
const p = je(m), h = {
|
|
907
998
|
sm: "text-sm",
|
|
908
999
|
base: "text-base",
|
|
909
1000
|
lg: "text-lg",
|
|
910
1001
|
xl: "text-xl",
|
|
911
1002
|
"2xl": "text-2xl"
|
|
912
|
-
}, g = n ? "text-primary" :
|
|
1003
|
+
}, g = n ? "text-primary" : a ? "text-secondary" : i ? "text-green-600 dark:text-green-400" : c ? "text-destructive" : "text-foreground", x = o ? "font-bold" : "font-normal";
|
|
913
1004
|
return /* @__PURE__ */ e(
|
|
914
1005
|
"span",
|
|
915
1006
|
{
|
|
916
|
-
className: `${
|
|
917
|
-
children:
|
|
1007
|
+
className: `${h[d]} ${g} ${x} ${r}`,
|
|
1008
|
+
children: p
|
|
918
1009
|
}
|
|
919
1010
|
);
|
|
920
1011
|
}
|
|
921
|
-
const
|
|
1012
|
+
const Pe = {
|
|
922
1013
|
small: { width: 60, height: 45 },
|
|
923
1014
|
default: { width: 120, height: 90 },
|
|
924
1015
|
large: { width: 180, height: 135 }
|
|
925
|
-
},
|
|
1016
|
+
}, De = {
|
|
926
1017
|
default: "/logo.png",
|
|
927
1018
|
logo2: "/logo2.png",
|
|
928
1019
|
white: "/logoW.png",
|
|
929
1020
|
whiteNoBg: "/logoW_sin_bg.png"
|
|
930
|
-
},
|
|
931
|
-
size:
|
|
932
|
-
variant:
|
|
933
|
-
src:
|
|
1021
|
+
}, ot = ({
|
|
1022
|
+
size: t = "default",
|
|
1023
|
+
variant: r = "whiteNoBg",
|
|
1024
|
+
src: o,
|
|
934
1025
|
alt: n = "Logo de Buenity",
|
|
935
|
-
className:
|
|
1026
|
+
className: a = "",
|
|
936
1027
|
fondoColor: i = "transparent",
|
|
937
1028
|
// valor por defecto: transparente
|
|
938
|
-
animated:
|
|
1029
|
+
animated: c = !1,
|
|
939
1030
|
// animaciones desactivadas por defecto
|
|
940
|
-
animationType:
|
|
1031
|
+
animationType: d = "fade",
|
|
941
1032
|
animationDuration: u = 1
|
|
942
1033
|
}) => {
|
|
943
|
-
const { width:
|
|
944
|
-
if (!
|
|
945
|
-
const
|
|
1034
|
+
const { width: m, height: p } = Pe[t], h = o || De[r], x = (() => {
|
|
1035
|
+
if (!c) return {};
|
|
1036
|
+
const b = {
|
|
946
1037
|
initial: { opacity: 0 },
|
|
947
1038
|
animate: { opacity: 1 },
|
|
948
1039
|
transition: { duration: u }
|
|
949
1040
|
};
|
|
950
|
-
switch (
|
|
1041
|
+
switch (d) {
|
|
951
1042
|
case "fade":
|
|
952
1043
|
return {
|
|
953
|
-
...
|
|
1044
|
+
...b,
|
|
954
1045
|
initial: { opacity: 0 },
|
|
955
1046
|
animate: { opacity: 1 }
|
|
956
1047
|
};
|
|
@@ -1001,109 +1092,109 @@ const Ce = {
|
|
|
1001
1092
|
}
|
|
1002
1093
|
};
|
|
1003
1094
|
default:
|
|
1004
|
-
return
|
|
1095
|
+
return b;
|
|
1005
1096
|
}
|
|
1006
1097
|
})(), l = {
|
|
1007
1098
|
className: "flex items-center rounded-xl justify-center",
|
|
1008
1099
|
style: { backgroundColor: i },
|
|
1009
|
-
...
|
|
1100
|
+
...c ? x : {}
|
|
1010
1101
|
};
|
|
1011
|
-
return
|
|
1102
|
+
return c ? /* @__PURE__ */ e(j.div, { ...l, children: /* @__PURE__ */ e(
|
|
1012
1103
|
"img",
|
|
1013
1104
|
{
|
|
1014
|
-
src:
|
|
1015
|
-
width:
|
|
1016
|
-
height:
|
|
1105
|
+
src: h,
|
|
1106
|
+
width: m,
|
|
1107
|
+
height: p,
|
|
1017
1108
|
alt: n,
|
|
1018
|
-
className: `object-contain ${
|
|
1109
|
+
className: `object-contain ${a}`
|
|
1019
1110
|
}
|
|
1020
1111
|
) }) : /* @__PURE__ */ e("div", { ...l, children: /* @__PURE__ */ e(
|
|
1021
1112
|
"img",
|
|
1022
1113
|
{
|
|
1023
|
-
src:
|
|
1024
|
-
width:
|
|
1025
|
-
height:
|
|
1114
|
+
src: h,
|
|
1115
|
+
width: m,
|
|
1116
|
+
height: p,
|
|
1026
1117
|
alt: n,
|
|
1027
|
-
className: `object-contain ${
|
|
1118
|
+
className: `object-contain ${a}`
|
|
1028
1119
|
}
|
|
1029
1120
|
) });
|
|
1030
1121
|
};
|
|
1031
|
-
function
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
const n =
|
|
1122
|
+
function Se(t) {
|
|
1123
|
+
const r = t.split("?")[0], o = r.match(/rp-(\d+)/i);
|
|
1124
|
+
if (o) return `rp-${o[1]}`;
|
|
1125
|
+
const n = r.split("/");
|
|
1035
1126
|
return (n[n.length - 1] || "").replace(/\.(pdf|jpg|jpeg|png|gif|webp)$/i, "") || "Soporte";
|
|
1036
1127
|
}
|
|
1037
|
-
function
|
|
1038
|
-
url:
|
|
1039
|
-
isOpen:
|
|
1040
|
-
onClose:
|
|
1128
|
+
function at({
|
|
1129
|
+
url: t,
|
|
1130
|
+
isOpen: r,
|
|
1131
|
+
onClose: o,
|
|
1041
1132
|
displayName: n
|
|
1042
1133
|
}) {
|
|
1043
|
-
const [
|
|
1044
|
-
|
|
1045
|
-
if (!
|
|
1046
|
-
|
|
1134
|
+
const [a, i] = C(!0), [c, d] = C(null), [u, m] = C("unknown");
|
|
1135
|
+
E(() => {
|
|
1136
|
+
if (!t) {
|
|
1137
|
+
m("unknown"), i(!1);
|
|
1047
1138
|
return;
|
|
1048
1139
|
}
|
|
1049
|
-
const l =
|
|
1050
|
-
l.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp)$/) ?
|
|
1051
|
-
}, [
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
},
|
|
1055
|
-
if (!
|
|
1140
|
+
const l = t.toLowerCase();
|
|
1141
|
+
l.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp)$/) ? m("image") : l.match(/\.pdf$/) || l.includes("application/pdf") ? m("pdf") : m("unknown"), i(!1), d(null);
|
|
1142
|
+
}, [t]);
|
|
1143
|
+
const p = () => {
|
|
1144
|
+
d("Error al cargar la imagen"), i(!1);
|
|
1145
|
+
}, h = () => {
|
|
1146
|
+
if (!t) return;
|
|
1056
1147
|
const l = document.createElement("a");
|
|
1057
|
-
l.href =
|
|
1058
|
-
}, g = n ?? (
|
|
1148
|
+
l.href = t, l.download = g, l.target = "_blank", document.body.appendChild(l), l.click(), document.body.removeChild(l);
|
|
1149
|
+
}, g = n ?? (t ? Se(t) : "Archivo"), x = () => {
|
|
1059
1150
|
switch (u) {
|
|
1060
1151
|
case "image":
|
|
1061
|
-
return /* @__PURE__ */ e(
|
|
1152
|
+
return /* @__PURE__ */ e(le, { className: "w-6 h-6 text-primary" });
|
|
1062
1153
|
case "pdf":
|
|
1063
|
-
return /* @__PURE__ */ e(
|
|
1154
|
+
return /* @__PURE__ */ e(M, { className: "w-6 h-6 text-primary" });
|
|
1064
1155
|
default:
|
|
1065
|
-
return /* @__PURE__ */ e(
|
|
1156
|
+
return /* @__PURE__ */ e(_, { className: "w-6 h-6 text-primary" });
|
|
1066
1157
|
}
|
|
1067
1158
|
};
|
|
1068
|
-
return
|
|
1069
|
-
|
|
1159
|
+
return r ? /* @__PURE__ */ e(
|
|
1160
|
+
ye,
|
|
1070
1161
|
{
|
|
1071
1162
|
isOpen: !0,
|
|
1072
|
-
onClose:
|
|
1163
|
+
onClose: o,
|
|
1073
1164
|
title: g,
|
|
1074
1165
|
tamaño: "fullscreen",
|
|
1075
1166
|
canClose: !0,
|
|
1076
1167
|
children: /* @__PURE__ */ e("div", { className: "flex flex-col h-full min-h-[90dvh]", children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-auto mt-4 bg-muted/30 rounded-xl p-4 min-h-[60vh]", children: [
|
|
1077
|
-
!
|
|
1078
|
-
/* @__PURE__ */ e(
|
|
1168
|
+
!t && /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center min-h-[400px] text-muted-foreground", children: [
|
|
1169
|
+
/* @__PURE__ */ e(_, { className: "w-12 h-12 mb-4 opacity-50" }),
|
|
1079
1170
|
/* @__PURE__ */ e("p", { children: "No hay archivo para visualizar." })
|
|
1080
1171
|
] }),
|
|
1081
|
-
|
|
1082
|
-
/* @__PURE__ */ e(
|
|
1172
|
+
t && a && /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center min-h-[400px] text-muted-foreground", children: [
|
|
1173
|
+
/* @__PURE__ */ e(se, { className: "w-12 h-12 text-primary animate-spin mb-4" }),
|
|
1083
1174
|
/* @__PURE__ */ e("p", { children: "Cargando archivo..." })
|
|
1084
1175
|
] }),
|
|
1085
|
-
|
|
1086
|
-
/* @__PURE__ */ e("div", { className: "w-16 h-16 bg-destructive/10 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(
|
|
1176
|
+
t && c && /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center min-h-[400px] text-center", children: [
|
|
1177
|
+
/* @__PURE__ */ e("div", { className: "w-16 h-16 bg-destructive/10 rounded-full flex items-center justify-center mx-auto mb-4", children: /* @__PURE__ */ e(ie, { className: "w-8 h-8 text-destructive" }) }),
|
|
1087
1178
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-foreground mb-2", children: "Error al cargar el archivo" }),
|
|
1088
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-4", children:
|
|
1179
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-4", children: c }),
|
|
1089
1180
|
/* @__PURE__ */ e(
|
|
1090
1181
|
B,
|
|
1091
1182
|
{
|
|
1092
1183
|
type: "button",
|
|
1093
1184
|
variant: "primary",
|
|
1094
|
-
icon:
|
|
1185
|
+
icon: W,
|
|
1095
1186
|
label: "Intentar descargar",
|
|
1096
|
-
onClick:
|
|
1187
|
+
onClick: h
|
|
1097
1188
|
}
|
|
1098
1189
|
)
|
|
1099
1190
|
] }),
|
|
1100
|
-
|
|
1191
|
+
t && !a && !c && /* @__PURE__ */ s(z, { children: [
|
|
1101
1192
|
u === "image" && /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[400px]", children: /* @__PURE__ */ e(
|
|
1102
1193
|
"img",
|
|
1103
1194
|
{
|
|
1104
|
-
src:
|
|
1195
|
+
src: t,
|
|
1105
1196
|
alt: g,
|
|
1106
|
-
onError:
|
|
1197
|
+
onError: p,
|
|
1107
1198
|
onLoad: () => i(!1),
|
|
1108
1199
|
className: "max-w-full max-h-[75vh] object-contain rounded-lg shadow-lg border border-border"
|
|
1109
1200
|
}
|
|
@@ -1111,7 +1202,7 @@ function rr({
|
|
|
1111
1202
|
u === "pdf" && /* @__PURE__ */ e("div", { className: "flex items-center justify-center min-h-[82dvh] w-full", children: /* @__PURE__ */ e(
|
|
1112
1203
|
"iframe",
|
|
1113
1204
|
{
|
|
1114
|
-
src:
|
|
1205
|
+
src: t,
|
|
1115
1206
|
onLoad: () => i(!1),
|
|
1116
1207
|
className: "w-full h-[75vh] rounded-lg shadow-lg bg-background border border-border",
|
|
1117
1208
|
title: g
|
|
@@ -1126,9 +1217,9 @@ function rr({
|
|
|
1126
1217
|
{
|
|
1127
1218
|
type: "button",
|
|
1128
1219
|
variant: "primary",
|
|
1129
|
-
icon:
|
|
1220
|
+
icon: W,
|
|
1130
1221
|
label: "Descargar archivo",
|
|
1131
|
-
onClick:
|
|
1222
|
+
onClick: h
|
|
1132
1223
|
}
|
|
1133
1224
|
)
|
|
1134
1225
|
] })
|
|
@@ -1137,47 +1228,47 @@ function rr({
|
|
|
1137
1228
|
}
|
|
1138
1229
|
) : null;
|
|
1139
1230
|
}
|
|
1140
|
-
function
|
|
1141
|
-
url:
|
|
1142
|
-
displayName:
|
|
1143
|
-
icon:
|
|
1231
|
+
function st({
|
|
1232
|
+
url: t,
|
|
1233
|
+
displayName: r,
|
|
1234
|
+
icon: o,
|
|
1144
1235
|
className: n = "inline-flex items-center gap-2 text-primary hover:text-primary/80 hover:underline font-medium"
|
|
1145
1236
|
}) {
|
|
1146
|
-
const
|
|
1237
|
+
const a = t.startsWith("http") || t.startsWith("//") ? t : `${typeof window < "u" ? window.location.origin : ""}${t.startsWith("/") ? t : `/${t}`}`;
|
|
1147
1238
|
return /* @__PURE__ */ s(
|
|
1148
1239
|
"a",
|
|
1149
1240
|
{
|
|
1150
|
-
href:
|
|
1241
|
+
href: a,
|
|
1151
1242
|
target: "_blank",
|
|
1152
1243
|
rel: "noopener noreferrer",
|
|
1153
1244
|
className: n,
|
|
1154
1245
|
children: [
|
|
1155
|
-
|
|
1156
|
-
|
|
1246
|
+
o ?? /* @__PURE__ */ e(M, { className: "w-4 h-4 shrink-0" }),
|
|
1247
|
+
r
|
|
1157
1248
|
]
|
|
1158
1249
|
}
|
|
1159
1250
|
);
|
|
1160
1251
|
}
|
|
1161
|
-
const
|
|
1252
|
+
const Le = {
|
|
1162
1253
|
sm: "h-4 w-4",
|
|
1163
1254
|
md: "h-6 w-6",
|
|
1164
1255
|
lg: "h-10 w-10",
|
|
1165
1256
|
xl: "h-16 w-16"
|
|
1166
|
-
},
|
|
1257
|
+
}, Ie = {
|
|
1167
1258
|
primary: "text-primary",
|
|
1168
1259
|
secondary: "text-secondary",
|
|
1169
1260
|
muted: "text-muted-foreground",
|
|
1170
1261
|
destructive: "text-destructive"
|
|
1171
1262
|
};
|
|
1172
|
-
function
|
|
1173
|
-
size:
|
|
1174
|
-
variant:
|
|
1175
|
-
className:
|
|
1263
|
+
function Ae({
|
|
1264
|
+
size: t = "md",
|
|
1265
|
+
variant: r = "muted",
|
|
1266
|
+
className: o = ""
|
|
1176
1267
|
}) {
|
|
1177
1268
|
return /* @__PURE__ */ s(
|
|
1178
1269
|
"svg",
|
|
1179
1270
|
{
|
|
1180
|
-
className: `${
|
|
1271
|
+
className: `${Le[t]} ${Ie[r]} animate-spin ${o}`,
|
|
1181
1272
|
viewBox: "0 0 24 24",
|
|
1182
1273
|
fill: "none",
|
|
1183
1274
|
"aria-hidden": "true",
|
|
@@ -1207,45 +1298,47 @@ function je({
|
|
|
1207
1298
|
}
|
|
1208
1299
|
);
|
|
1209
1300
|
}
|
|
1210
|
-
function
|
|
1211
|
-
text:
|
|
1212
|
-
size:
|
|
1213
|
-
variant:
|
|
1301
|
+
function it({
|
|
1302
|
+
text: t = "Cargando datos...",
|
|
1303
|
+
size: r = "lg",
|
|
1304
|
+
variant: o = "muted",
|
|
1214
1305
|
className: n = "",
|
|
1215
|
-
textClassName:
|
|
1306
|
+
textClassName: a = ""
|
|
1216
1307
|
}) {
|
|
1217
1308
|
return /* @__PURE__ */ e("div", { className: `w-full h-screen flex items-center justify-center p-6 ${n}`, children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-4", children: [
|
|
1218
|
-
/* @__PURE__ */ e(
|
|
1219
|
-
|
|
1309
|
+
/* @__PURE__ */ e(Ae, { size: r, variant: o }),
|
|
1310
|
+
t && /* @__PURE__ */ e("span", { className: `text-lg font-semibold text-muted-foreground ${a}`, children: t })
|
|
1220
1311
|
] }) });
|
|
1221
1312
|
}
|
|
1222
1313
|
export {
|
|
1223
1314
|
B as ActionButton,
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
fe as
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1315
|
+
nt as CurrencyDisplay,
|
|
1316
|
+
qe as DataTable,
|
|
1317
|
+
Ge as DeleteConfirmModal,
|
|
1318
|
+
st as FileLink,
|
|
1319
|
+
et as FileUpload,
|
|
1320
|
+
at as FileViewerModal,
|
|
1321
|
+
Je as FormField,
|
|
1322
|
+
Ae as Loader,
|
|
1323
|
+
it as LoaderScreen,
|
|
1324
|
+
ot as Logo,
|
|
1325
|
+
ye as Modal,
|
|
1326
|
+
tt as MultiSelectCheckbox,
|
|
1327
|
+
Qe as SearchBar,
|
|
1328
|
+
pe as ThemeProvider,
|
|
1329
|
+
Xe as Toast,
|
|
1330
|
+
rt as ToggleSwitch,
|
|
1331
|
+
He as VicdevUIProvider,
|
|
1332
|
+
We as createTheme,
|
|
1333
|
+
D as defaultColors,
|
|
1334
|
+
me as defaultTheme,
|
|
1335
|
+
fe as generateCSSVariables,
|
|
1336
|
+
xe as generateCompatibilityVariables,
|
|
1337
|
+
Ye as generateTailwindV4CSS,
|
|
1338
|
+
be as generateTailwindV4Theme,
|
|
1339
|
+
Se as getRpSoporteDisplayName,
|
|
1340
|
+
ge as getTailwindColors,
|
|
1341
|
+
Ke as getTailwindConfig,
|
|
1342
|
+
Ze as useTheme,
|
|
1343
|
+
he as useVicdevUIConfig
|
|
1251
1344
|
};
|