@open-xamu-co/ui-components-vue 2.0.0 → 3.0.0-next.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.
@@ -0,0 +1,3737 @@
1
+ import { defineComponent as q, inject as me, computed as T, openBlock as a, createBlock as _, resolveDynamicComponent as ye, normalizeProps as X, guardReactiveProps as ae, mergeProps as M, unref as l, withCtx as C, renderSlot as G, createElementBlock as v, Fragment as K, createTextVNode as ne, toDisplayString as P, createCommentVNode as z, watch as pe, setBlockTracking as He, createElementVNode as A, renderList as se, ref as H, onMounted as ze, onUnmounted as Me, normalizeClass as j, createVNode as $, withModifiers as ue, reactive as ut, normalizeStyle as Ve, Teleport as dt, withDirectives as Oe, vShow as Fe, Transition as je, getCurrentInstance as De, resolveComponent as Ge, useSlots as mt, onBeforeUnmount as pt } from "vue";
2
+ import { useUtils as Y, useI18n as Z, toOption as ke, useSwal as Le, standardImageMimeTypes as ct, fileMatchesMimeTypes as ft, renameFile as ht, getBase64FromImageFile as vt, timeAgo as gt, useForm as Ke } from "@open-xamu-co/ui-common-helpers";
3
+ import { u as O, a as te } from "./theme-sIbn2pce.js";
4
+ import { nanoid as yt } from "nanoid";
5
+ import x from "lodash";
6
+ import { eColors as ve, eFormType as F, eFormTypeSimple as Ee } from "@open-xamu-co/ui-common-enums";
7
+ import be from "validator";
8
+ const Te = /* @__PURE__ */ q({
9
+ name: "BaseImg",
10
+ inheritAttrs: !1,
11
+ __name: "Img",
12
+ props: {
13
+ /**
14
+ * image url or path
15
+ */
16
+ src: {
17
+ type: String,
18
+ default: null
19
+ },
20
+ alt: {
21
+ type: String,
22
+ default: null
23
+ },
24
+ format: {
25
+ type: String,
26
+ default: null
27
+ },
28
+ loading: {
29
+ type: String,
30
+ default: "lazy"
31
+ }
32
+ },
33
+ setup(p) {
34
+ const t = p, e = me("xamu"), m = T(() => (e == null ? void 0 : e.imageComponent) || "img");
35
+ return (r, B) => (a(), _(ye(m.value), X(ae({ ...r.$attrs, ...t })), null, 16));
36
+ }
37
+ }), fe = /* @__PURE__ */ q({
38
+ name: "BaseAction",
39
+ inheritAttrs: !1,
40
+ __name: "Action",
41
+ props: {
42
+ to: {},
43
+ href: {},
44
+ target: {},
45
+ tel: {},
46
+ disabled: { type: Boolean },
47
+ mailto: {},
48
+ type: {},
49
+ tag: {},
50
+ toggle: {},
51
+ round: {},
52
+ toggleState: {},
53
+ indicative: {},
54
+ whatsapp: { type: Boolean },
55
+ download: {}
56
+ },
57
+ setup(p) {
58
+ const t = p, e = me("xamu"), { getModifierClasses: m, getClassesString: r } = O(Y), B = T(() => !t.mailto && !t.tel && !t.href ? t.tag ?? "button" : "a"), s = T(() => t.to && (e == null ? void 0 : e.routerComponent) || B.value), u = T(() => {
59
+ const g = t.round || typeof t.round == "string" && !t.round.length;
60
+ return [
61
+ g ? m(g, { modifier: "round" }) : [],
62
+ t.toggle ? m([t.toggle], { prefix: "toggle" }) : [],
63
+ t.toggleState ? m([t.toggleState].flat(2), { prefix: "is" }) : []
64
+ ].flat(2);
65
+ }), o = T(() => {
66
+ const { indicative: g = "CO+57" } = t;
67
+ return (g == null ? void 0 : g.toString().split("+")[1]) || g;
68
+ }), d = T(() => {
69
+ const g = t.tel || "", L = `${g.substring(0, 3)}-${g.substring(3, 6)}-${g.substring(6)}`;
70
+ return `(+${o.value}) ${L}`;
71
+ }), h = T(() => t.to || !t.mailto ? "" : `mailto:${t.mailto}`), b = T(() => {
72
+ if (t.to || !t.tel)
73
+ return "";
74
+ const g = `https://web.whatsapp.com/send/?phone=${o.value}${t.tel}`, L = `tel:+(${o.value})${t.tel}`;
75
+ return t.whatsapp ? g : L;
76
+ }), y = T(() => {
77
+ const g = t.href || h.value || b.value;
78
+ return g ? { to: void 0, href: g, target: "_blank" } : {};
79
+ });
80
+ return (g, L) => (a(), _(ye(s.value), M({ ...g.$attrs, ...t, ...y.value }, {
81
+ type: B.value === "button" && !g.to && !g.href ? g.type || "button" : null,
82
+ tabindex: t.disabled && "-1" || null,
83
+ class: l(r)([u.value])
84
+ }), {
85
+ default: C(() => [
86
+ G(g.$slots, "default", {}, () => [
87
+ g.mailto ? (a(), v(K, { key: 0 }, [
88
+ ne(P(g.mailto), 1)
89
+ ], 64)) : g.tel ? (a(), v(K, { key: 1 }, [
90
+ ne(P(d.value), 1)
91
+ ], 64)) : z("", !0)
92
+ ])
93
+ ]),
94
+ _: 3
95
+ }, 16, ["type", "tabindex", "class"]));
96
+ }
97
+ });
98
+ function Pe() {
99
+ try {
100
+ self.crypto || window.crypto;
101
+ } catch {
102
+ global.crypto = global.crypto || require("crypto");
103
+ }
104
+ return { uuid: yt };
105
+ }
106
+ const Ae = /* @__PURE__ */ q({
107
+ name: "BaseInput",
108
+ inheritAttrs: !1,
109
+ __name: "Input",
110
+ props: {
111
+ modelValue: {},
112
+ type: {},
113
+ autocomplete: {},
114
+ id: {},
115
+ name: {},
116
+ placeholder: {},
117
+ title: {},
118
+ required: { type: Boolean },
119
+ disabled: { type: Boolean }
120
+ },
121
+ emits: ["update:model-value"],
122
+ setup(p, { emit: t }) {
123
+ const e = p, m = t, { uuid: r } = Pe(), B = r().replace("-", "").substring(0, 8), s = T(() => e.type === "checkbox" || e.type === "radio"), u = T(() => e.id ?? `input${B}`);
124
+ function o(d) {
125
+ const { target: h } = d;
126
+ return m("update:model-value", s.value ? h.checked : h.value);
127
+ }
128
+ return (d, h) => (a(), v(K, null, [
129
+ (a(), _(ye(d.type !== "textarea" ? "input" : "textarea"), M({
130
+ ...d.$attrs,
131
+ id: u.value,
132
+ name: d.name ?? u.value,
133
+ type: d.type ?? "text",
134
+ placeholder: d.placeholder,
135
+ title: d.title,
136
+ autocomplete: d.autocomplete ?? "on",
137
+ required: d.required,
138
+ disabled: d.disabled || void 0,
139
+ tabindex: d.disabled && "-1" || void 0,
140
+ ...s.value ? { checked: d.modelValue ?? d.$attrs.checked } : { value: d.modelValue }
141
+ }, { onInput: o }), null, 16)),
142
+ G(d.$slots, "default", X(ae({ id: u.value, name: d.name, modelValue: d.modelValue })))
143
+ ], 64));
144
+ }
145
+ }), bt = ["value"], wt = ["value"], Qe = /* @__PURE__ */ q({
146
+ name: "BaseSelect",
147
+ inheritAttrs: !1,
148
+ __name: "Select",
149
+ props: {
150
+ modelValue: {},
151
+ options: {},
152
+ multiple: { type: Boolean },
153
+ id: {},
154
+ name: {},
155
+ placeholder: {},
156
+ title: {},
157
+ required: { type: Boolean },
158
+ disabled: { type: Boolean }
159
+ },
160
+ emits: ["update:model-value"],
161
+ setup(p, { emit: t }) {
162
+ const e = p, m = t, { t: r } = O(Z), { uuid: B } = Pe(), s = B().replace("-", "").substring(0, 8), u = T(() => (e.options ?? []).map(ke)), o = T(() => e.id ?? `select${s}`);
163
+ function d(h) {
164
+ const { target: b } = h;
165
+ return m("update:model-value", b.value);
166
+ }
167
+ return u.value.length === 1 && m("update:model-value", u.value[0].value), pe(
168
+ u,
169
+ (h) => {
170
+ h.length || m("update:model-value", ""), h.length === 1 && m("update:model-value", h[0].value);
171
+ },
172
+ { immediate: !1 }
173
+ ), (h, b) => (a(), v("select", M({
174
+ ...h.$attrs,
175
+ id: o.value,
176
+ name: h.name ?? o.value,
177
+ title: h.title,
178
+ required: h.required,
179
+ disabled: !!h.modelValue && u.value.length === 1 || h.disabled || void 0,
180
+ tabindex: h.disabled && "-1" || void 0
181
+ }, {
182
+ value: h.modelValue,
183
+ onInput: d
184
+ }), [
185
+ b[0] || (He(-1), b[0] = A("option", {
186
+ hidden: "",
187
+ disabled: "",
188
+ value: ""
189
+ }, [
190
+ ne(P(l(r)("select_placeholder")), 1)
191
+ ]), He(1), b[0]),
192
+ (a(!0), v(K, null, se(u.value, ({ value: y, alias: g }, L) => (a(), v("option", {
193
+ key: L,
194
+ value: y
195
+ }, P(g || y), 9, wt))), 128))
196
+ ], 16, bt));
197
+ }
198
+ }), $e = /* @__PURE__ */ q({
199
+ name: "BaseWrapper",
200
+ inheritAttrs: !1,
201
+ __name: "Wrapper",
202
+ props: {
203
+ /**
204
+ * Wheter or not render the wrapper
205
+ */
206
+ wrap: {
207
+ type: Boolean,
208
+ required: !0
209
+ },
210
+ /**
211
+ * Component or tag to render
212
+ */
213
+ el: {
214
+ type: [String, Object, Function],
215
+ default: "div"
216
+ }
217
+ },
218
+ setup(p) {
219
+ return (t, e) => p.wrap ? (a(), _(ye(p.el), X(M({ key: 0 }, t.$attrs)), {
220
+ default: C(() => [
221
+ G(t.$slots, "default")
222
+ ]),
223
+ _: 3
224
+ }, 16)) : G(t.$slots, "default", { key: 1 });
225
+ }
226
+ });
227
+ function ie(p) {
228
+ const { getModifierClasses: t } = O(Y);
229
+ return { modifiersClasses: T(() => {
230
+ const m = p.hidden || typeof p.hidden == "string" && !p.hidden.length;
231
+ return [
232
+ p.size ? t([String(p.size)], { modifier: "size", divider: "-" }) : [],
233
+ m ? t(m, { modifier: "hidden" }) : []
234
+ ].flat(2);
235
+ }) };
236
+ }
237
+ const Xe = /* @__PURE__ */ q({
238
+ name: "IconSimple",
239
+ inheritAttrs: !1,
240
+ __name: "Simple",
241
+ props: {
242
+ indicator: { type: Boolean },
243
+ hidden: {},
244
+ size: {}
245
+ },
246
+ setup(p) {
247
+ const t = p, { getClassesString: e, getModifierClasses: m } = O(Y), { modifiersClasses: r } = ie(t), B = T(() => t.indicator ? m(["indicator"]) : []);
248
+ return (s, u) => (a(), v("i", M({
249
+ "aria-hidden": "true",
250
+ class: l(e)([
251
+ l(r),
252
+ B.value,
253
+ s.$slots.default ? "svg" : "icon"
254
+ ])
255
+ }, s.$attrs), [
256
+ G(s.$slots, "default")
257
+ ], 16));
258
+ }
259
+ }), U = /* @__PURE__ */ q({
260
+ name: "IconFa",
261
+ inheritAttrs: !1,
262
+ __name: "Fa",
263
+ props: {
264
+ name: {},
265
+ regular: { type: Boolean },
266
+ brand: { type: Boolean },
267
+ indicator: { type: Boolean },
268
+ forceRegular: { type: Boolean },
269
+ hidden: {},
270
+ size: {}
271
+ },
272
+ setup(p) {
273
+ const t = p, e = me("xamu"), { getClassesString: m } = O(Y), r = T(() => t.forceRegular || (e == null ? void 0 : e.fontAwesomePro) && t.regular), B = T(() => t.brand && "fab" || r.value && "far" || "fas");
274
+ return (s, u) => (a(), _(Xe, M({
275
+ class: l(m)([`fa-${s.name ?? "cubes"}`, B.value])
276
+ }, { ...s.$attrs, hidden: s.hidden, size: s.size, indicator: s.indicator }), null, 16, ["class"]));
277
+ }
278
+ });
279
+ function de(p) {
280
+ const { getModifierClasses: t } = O(Y);
281
+ return { stateClasses: T(() => {
282
+ const m = [
283
+ { ...p.state, active: p.active || !1, invalid: p.invalid || !1 }
284
+ ];
285
+ return p.state || p.active || p.invalid ? t(m, { prefix: "is" }) : [];
286
+ }) };
287
+ }
288
+ const re = /* @__PURE__ */ q({
289
+ name: "ActionButton",
290
+ inheritAttrs: !1,
291
+ __name: "Button",
292
+ props: {
293
+ to: {},
294
+ href: {},
295
+ target: {},
296
+ tel: {},
297
+ disabled: { type: Boolean },
298
+ mailto: {},
299
+ type: {},
300
+ tag: {},
301
+ toggle: {},
302
+ round: {},
303
+ toggleState: {},
304
+ indicative: {},
305
+ whatsapp: { type: Boolean },
306
+ download: {},
307
+ hidden: {},
308
+ size: {},
309
+ active: { type: Boolean },
310
+ invalid: { type: Boolean },
311
+ state: {},
312
+ theme: {},
313
+ tooltip: {},
314
+ tooltipPosition: {},
315
+ tooltipAsText: { type: Boolean }
316
+ },
317
+ setup(p) {
318
+ const t = p, { getClassesString: e } = O(Y), { modifiersClasses: m } = ie(t), { stateClasses: r } = de(t), { themeClasses: B, tooltipAttributes: s } = te({
319
+ ...t,
320
+ themeAsUnion: !0
321
+ });
322
+ return (u, o) => (a(), _(fe, M({ ...u.$attrs, ...t, ...l(s) }, {
323
+ class: [l(e)([l(m), l(r), l(B)]), "bttn"]
324
+ }), {
325
+ default: C(() => [
326
+ G(u.$slots, "default")
327
+ ]),
328
+ _: 3
329
+ }, 16, ["class"]));
330
+ }
331
+ }), le = /* @__PURE__ */ q({
332
+ name: "ActionButtonToggle",
333
+ inheritAttrs: !1,
334
+ __name: "ButtonToggle",
335
+ props: {
336
+ shadow: { type: Boolean },
337
+ to: {},
338
+ href: {},
339
+ target: {},
340
+ tel: {},
341
+ disabled: { type: Boolean },
342
+ mailto: {},
343
+ type: {},
344
+ tag: {},
345
+ toggle: {},
346
+ round: {},
347
+ toggleState: {},
348
+ indicative: {},
349
+ whatsapp: { type: Boolean },
350
+ download: {},
351
+ hidden: {},
352
+ size: {},
353
+ active: { type: Boolean },
354
+ invalid: { type: Boolean },
355
+ state: {},
356
+ theme: {},
357
+ tooltip: {},
358
+ tooltipPosition: {},
359
+ tooltipAsText: { type: Boolean }
360
+ },
361
+ setup(p) {
362
+ const t = p, { getModifierClasses: e, getClassesString: m } = O(Y), { modifiersClasses: r } = ie(t), { stateClasses: B } = de(t), { themeClasses: s, tooltipAttributes: u } = te(t), o = T(() => t.shadow ? e(t.shadow, { modifier: "shadow" }) : []);
363
+ return (d, h) => (a(), _(fe, M({ ...d.$attrs, ...t, ...l(u) }, {
364
+ class: [l(m)([l(r), l(B), l(s), o.value]), "bttnToggle"]
365
+ }), {
366
+ default: C(() => [
367
+ G(d.$slots, "default")
368
+ ]),
369
+ _: 3
370
+ }, 16, ["class"]));
371
+ }
372
+ }), ee = /* @__PURE__ */ q({
373
+ name: "ActionLink",
374
+ inheritAttrs: !1,
375
+ __name: "Link",
376
+ props: {
377
+ shadow: { type: Boolean },
378
+ to: {},
379
+ href: {},
380
+ target: {},
381
+ tel: {},
382
+ disabled: { type: Boolean },
383
+ mailto: {},
384
+ type: {},
385
+ tag: {},
386
+ toggle: {},
387
+ round: {},
388
+ toggleState: {},
389
+ indicative: {},
390
+ whatsapp: { type: Boolean },
391
+ download: {},
392
+ hidden: {},
393
+ size: {},
394
+ active: { type: Boolean },
395
+ invalid: { type: Boolean },
396
+ state: {},
397
+ theme: {},
398
+ tooltip: {},
399
+ tooltipPosition: {},
400
+ tooltipAsText: { type: Boolean }
401
+ },
402
+ setup(p) {
403
+ const t = p, { getModifierClasses: e, getClassesString: m } = O(Y), { modifiersClasses: r } = ie(t), { stateClasses: B } = de(t), { themeClasses: s, tooltipAttributes: u } = te(t), o = T(() => t.shadow ? e(t.shadow, { modifier: "shadow" }) : []);
404
+ return (d, h) => (a(), _(fe, M({ ...d.$attrs, ...t, ...l(u) }, {
405
+ class: [l(m)([l(r), l(B), l(s), o.value]), "link"]
406
+ }), {
407
+ default: C(() => [
408
+ G(d.$slots, "default")
409
+ ]),
410
+ _: 3
411
+ }, 16, ["class"]));
412
+ }
413
+ });
414
+ function Ie(p) {
415
+ return function(t) {
416
+ p.value = t.matches;
417
+ };
418
+ }
419
+ function Ne(p) {
420
+ return window.matchMedia(`(max-width: ${p}px)`);
421
+ }
422
+ function Ye() {
423
+ const { mediaQueryPixels: p } = me("xamu") || {}, { isBrowser: t } = O(Y), e = H(!1), m = H(!1), r = H(!1), B = Ie(e), s = Ie(m), u = Ie(r);
424
+ if (t) {
425
+ const o = Ne((p == null ? void 0 : p.laptop) ?? 1080), d = Ne((p == null ? void 0 : p.tablet) ?? 768), h = Ne((p == null ? void 0 : p.mobile) ?? 576);
426
+ ze(() => {
427
+ o.addEventListener("change", B, !0), d.addEventListener("change", s, !0), h.addEventListener("change", u, !0), B(o), s(d), u(h);
428
+ }), Me(() => {
429
+ o.removeEventListener("change", B, !0), d.removeEventListener("change", s, !0), h.removeEventListener("change", u, !0);
430
+ });
431
+ }
432
+ return { laptopMqRange: e, tabletMqRange: m, mobileMqRange: r };
433
+ }
434
+ const Ct = /* @__PURE__ */ q({
435
+ name: "ActionButtonLink",
436
+ inheritAttrs: !1,
437
+ __name: "ButtonLink",
438
+ props: {
439
+ asToggle: { type: Boolean },
440
+ to: {},
441
+ href: {},
442
+ target: {},
443
+ tel: {},
444
+ disabled: { type: Boolean },
445
+ mailto: {},
446
+ type: {},
447
+ tag: {},
448
+ toggle: {},
449
+ round: {},
450
+ toggleState: {},
451
+ indicative: {},
452
+ whatsapp: { type: Boolean },
453
+ download: {},
454
+ hidden: {},
455
+ size: {},
456
+ active: { type: Boolean },
457
+ invalid: { type: Boolean },
458
+ state: {},
459
+ theme: {},
460
+ tooltip: {},
461
+ tooltipPosition: {},
462
+ tooltipAsText: { type: Boolean }
463
+ },
464
+ setup(p) {
465
+ const t = p, { tabletMqRange: e } = Ye();
466
+ return (m, r) => l(e) ? (a(), v(K, { key: 0 }, [
467
+ m.asToggle ? (a(), _(le, X(M({ key: 0 }, { ...m.$attrs, ...t })), {
468
+ default: C(() => [
469
+ G(m.$slots, "default")
470
+ ]),
471
+ _: 3
472
+ }, 16)) : (a(), _(re, X(M({ key: 1 }, { ...m.$attrs, ...t })), {
473
+ default: C(() => [
474
+ G(m.$slots, "default")
475
+ ]),
476
+ _: 3
477
+ }, 16))
478
+ ], 64)) : (a(), _(ee, X(M({ key: 1 }, { ...m.$attrs, ...t })), {
479
+ default: C(() => [
480
+ G(m.$slots, "default")
481
+ ]),
482
+ _: 3
483
+ }, 16));
484
+ }
485
+ }), kt = {
486
+ key: 0,
487
+ class: "flx --flxRow --flx-start-center --gap-10"
488
+ }, $t = { class: "flx --flxRow-wrap --flx-start-center --gap-10" }, _t = { class: "back" }, Bt = { class: "--txtWrap-nowrap" }, St = ["for"], At = { class: "txt --txtAlignFlx-center" }, Vt = { class: "--txtSize-xs" }, Rt = { key: 1 }, Je = /* @__PURE__ */ q({
489
+ name: "InputFile",
490
+ inheritAttrs: !1,
491
+ __name: "File",
492
+ props: {
493
+ filePrefix: {},
494
+ min: {},
495
+ max: {},
496
+ maxSize: {},
497
+ accept: {},
498
+ modelValue: {},
499
+ classes: {},
500
+ type: {},
501
+ autocomplete: {},
502
+ id: {},
503
+ name: {},
504
+ placeholder: {},
505
+ title: {},
506
+ required: { type: Boolean },
507
+ disabled: { type: Boolean },
508
+ hidden: {},
509
+ size: {},
510
+ active: { type: Boolean },
511
+ invalid: { type: Boolean },
512
+ state: {},
513
+ theme: {}
514
+ },
515
+ emits: ["update:model-value"],
516
+ setup(p, { emit: t }) {
517
+ const e = p, m = t, { t: r } = O(Z), { getClassesString: B, isBrowser: s } = O(Y), u = O(Le), { modifiersClasses: o } = ie(e), { stateClasses: d } = de(e), { themeClasses: h } = te(e), b = H(), y = H([]), g = H(!1), L = H(!1), f = H(!1), V = T(() => e.min ?? 1), S = T(() => e.max ?? 100), n = T(() => e.maxSize ?? 1e7);
518
+ function D(k = [], E = []) {
519
+ y.value = E, m("update:model-value", k);
520
+ }
521
+ function W() {
522
+ const k = document.createElement("div");
523
+ return ("draggable" in k || "ondragstart" in k && "ondrop" in k) && "FormData" in window && "FileReader" in window;
524
+ }
525
+ async function J(k) {
526
+ L.value = !0;
527
+ const E = [...e.modelValue], Q = [...y.value];
528
+ try {
529
+ for (let oe = 0; oe < k.length; oe++) {
530
+ if (E.length >= S.value) {
531
+ u.fire({
532
+ title: r("swal.file_limit"),
533
+ text: r("swal.file_limit_text", {
534
+ count: S.value,
535
+ amount: S.value
536
+ }),
537
+ icon: "warning"
538
+ });
539
+ break;
540
+ }
541
+ if (await ft(k[oe], ct))
542
+ if (k[oe].size < n.value) {
543
+ const it = `${e.filePrefix ?? "image"}_${oe}`;
544
+ E.push(ht(k[oe], it)), Q.push(await vt(k[oe]));
545
+ } else
546
+ u.fire({
547
+ title: r("swal.file_too_big"),
548
+ text: r("swal.file_too_big_text"),
549
+ icon: "warning"
550
+ });
551
+ else
552
+ u.fire({
553
+ title: r("swal.file_wrong_format_image"),
554
+ text: r("swal.file_wrong_format_image_text"),
555
+ icon: "warning"
556
+ });
557
+ }
558
+ D(E, Q);
559
+ } catch (oe) {
560
+ console.log(oe), u.fire({
561
+ title: r("swal.file_unknown_error"),
562
+ text: r("swal.file_unknown_error_text"),
563
+ icon: "error",
564
+ timer: void 0,
565
+ showConfirmButton: !0
566
+ });
567
+ }
568
+ L.value = !1;
569
+ }
570
+ const c = x.debounce((k) => {
571
+ D(e.modelValue.toSpliced(k, 1), y.value.toSpliced(k, 1));
572
+ });
573
+ function I(k) {
574
+ g.value && (k.preventDefault(), k.stopPropagation());
575
+ }
576
+ function N(k) {
577
+ I(k), f.value = !0;
578
+ }
579
+ function i(k) {
580
+ I(k), f.value = !1;
581
+ }
582
+ function R(k) {
583
+ const { dataTransfer: E, originalEvent: Q } = k;
584
+ i(k), J((E == null ? void 0 : E.files) || Q.dataTransfer.files);
585
+ }
586
+ function w(k) {
587
+ const { target: E } = k;
588
+ E.files && (I(k), J(E.files));
589
+ }
590
+ return s && (g.value = W()), (k, E) => (a(), v("div", {
591
+ class: j([[k.classes, l(B)([l(o), l(d), l(h)])], "box --button flx --flxColumn --flx-start-stretch --gap-10 --width"])
592
+ }, [
593
+ V.value !== S.value && y.value.length ? (a(), v("div", kt, [
594
+ A("ul", $t, [
595
+ (a(!0), v(K, null, se(y.value, (Q, oe) => (a(), v("li", {
596
+ key: oe,
597
+ class: "flx --flxRow --flx-start-center --gap-5"
598
+ }, [
599
+ $(fe, {
600
+ class: "avatar --index --bdr",
601
+ tooltip: l(r)("file_delete_files", 1),
602
+ "tooltip-position": "bottom",
603
+ onClick: ue((rt) => l(c)(oe), ["prevent"])
604
+ }, {
605
+ default: C(() => [
606
+ A("div", _t, [
607
+ $(Te, {
608
+ src: Q,
609
+ alt: l(r)("file_thumb")
610
+ }, null, 8, ["src", "alt"])
611
+ ]),
612
+ $(ee, {
613
+ theme: l(ve).LIGHT,
614
+ class: "--shadow"
615
+ }, {
616
+ default: C(() => [
617
+ $(U, {
618
+ name: "xmark",
619
+ size: "20"
620
+ })
621
+ ]),
622
+ _: 1
623
+ }, 8, ["theme"])
624
+ ]),
625
+ _: 2
626
+ }, 1032, ["tooltip", "onClick"])
627
+ ]))), 128))
628
+ ]),
629
+ A("span", Bt, P(l(r)("file_one_of_amount", {
630
+ count: k.modelValue.length,
631
+ amount: S.value
632
+ })), 1)
633
+ ])) : z("", !0),
634
+ $(Ae, M({
635
+ ref_key: "fileInput",
636
+ ref: b,
637
+ style: { display: "none" }
638
+ }, {
639
+ ...k.$attrs,
640
+ type: "file",
641
+ accept: (k.accept ?? ["image/*"]).join(","),
642
+ multiple: S.value > 1,
643
+ disabled: k.disabled
644
+ }, { onChange: w }), {
645
+ default: C(({ id: Q }) => [
646
+ L.value ? (a(), v("div", {
647
+ key: 1,
648
+ class: j([l(h), "box --bdr-solid --size-xs --bgColor-none flx --flxRow --flx-center"])
649
+ }, P(l(r)("file_loading_files", S.value)), 3)) : (a(), v(K, { key: 0 }, [
650
+ k.modelValue.length < S.value ? (a(), v("label", {
651
+ key: 0,
652
+ for: Q,
653
+ class: j([[...l(h), { "--bgColor-none": !f.value }], "box --bdr-dashed --size-xs flx --flxColumn --flx-center --minHeight-90"]),
654
+ onDrag: I,
655
+ onDragstart: I,
656
+ onDragend: i,
657
+ onDragleave: i,
658
+ onDrop: R,
659
+ onDragover: N,
660
+ onDragenter: N
661
+ }, [
662
+ A("div", At, [
663
+ f.value ? (a(), v("p", Rt, [
664
+ A("b", null, P(l(r)("file_drop_files_here", S.value)), 1)
665
+ ])) : (a(), v(K, { key: 0 }, [
666
+ A("p", null, [
667
+ A("b", null, P(l(r)("file_choose_file", S.value)), 1),
668
+ ne(" " + P(g.value && !f.value && l(r)("file_or_drop_files_here", S.value) || ""), 1)
669
+ ]),
670
+ A("p", Vt, P(l(r)("file_max_file_size_mb", { size: n.value / 1e6 })), 1)
671
+ ], 64))
672
+ ])
673
+ ], 42, St)) : (a(), v("div", {
674
+ key: 1,
675
+ class: j([l(h), "box --bdr-solid --size-xs --bgColor-none flx --flxRow --flx-center"])
676
+ }, [
677
+ A("p", null, P(l(r)("file_completed")), 1),
678
+ $(re, {
679
+ theme: k.theme,
680
+ "aria-label": l(r)("file_delete_files", S.value),
681
+ onClick: E[0] || (E[0] = ue((oe) => D(), ["prevent"]))
682
+ }, {
683
+ default: C(() => [
684
+ ne(P(l(r)("file_delete_files", S.value)), 1)
685
+ ]),
686
+ _: 1
687
+ }, 8, ["theme", "aria-label"])
688
+ ], 2))
689
+ ], 64))
690
+ ]),
691
+ _: 1
692
+ }, 16)
693
+ ], 2));
694
+ }
695
+ }), ce = /* @__PURE__ */ q({
696
+ name: "InputText",
697
+ inheritAttrs: !1,
698
+ __name: "Text",
699
+ props: {
700
+ type: {},
701
+ placeholder: {},
702
+ icon: {},
703
+ iconProps: {},
704
+ textarea: { type: Boolean },
705
+ min: {},
706
+ max: {},
707
+ modelValue: {},
708
+ autocomplete: {},
709
+ id: {},
710
+ name: {},
711
+ title: {},
712
+ required: { type: Boolean },
713
+ disabled: { type: Boolean },
714
+ hidden: {},
715
+ size: {},
716
+ active: { type: Boolean },
717
+ invalid: { type: Boolean },
718
+ state: {},
719
+ theme: {}
720
+ },
721
+ emits: ["update:model-value"],
722
+ setup(p, { emit: t }) {
723
+ const e = p, m = t, { t: r } = O(Z), { getClassesString: B } = O(Y), { modifiersClasses: s } = ie(e), { stateClasses: u } = de(e), { themeClasses: o } = te(e), d = T(() => e.type ?? "text"), h = T(() => Number(e.min) || 0), b = T(() => Number(e.max) || 9e9), y = T(() => ["number", "tel"].includes(d.value)), g = T(() => d.value === "tel"), L = T({
724
+ get: () => {
725
+ const n = e.modelValue;
726
+ return d.value !== "number" ? n : Number(n);
727
+ },
728
+ set: (n) => m("update:model-value", n)
729
+ }), f = T(() => [
730
+ "iTxt",
731
+ B([s.value, u.value, o.value])
732
+ ]);
733
+ function V() {
734
+ typeof L.value == "number" && L.value < b.value && L.value++;
735
+ }
736
+ function S() {
737
+ typeof L.value == "number" && L.value > h.value && L.value--;
738
+ }
739
+ return (n, D) => (a(), v("div", {
740
+ class: j([n.$attrs.class, "flx --flxRow --flx-center --gap-5"])
741
+ }, [
742
+ $($e, {
743
+ wrap: !!n.icon && !n.textarea,
744
+ disabled: n.disabled,
745
+ class: j(f.value)
746
+ }, {
747
+ default: C(() => [
748
+ $(Ae, M({
749
+ modelValue: L.value,
750
+ "onUpdate:modelValue": D[0] || (D[0] = (W) => L.value = W)
751
+ }, {
752
+ ...l(x).omit(n.$attrs, "class"),
753
+ type: n.textarea ? "textarea" : d.value,
754
+ placeholder: n.placeholder,
755
+ disabled: n.disabled,
756
+ ...(y.value || g.value) && {
757
+ pattern: "[0-9]*",
758
+ oninput: "this.value = this.value.replace(/[^0-9]/g,'')"
759
+ },
760
+ ...!y.value && { min: void 0, max: void 0 },
761
+ ...!(n.icon && !n.textarea) && { class: f.value }
762
+ }), null, 16, ["modelValue"]),
763
+ n.icon && !n.textarea ? (a(), _(U, M({ key: 0 }, n.iconProps, {
764
+ name: n.icon ?? "user-group"
765
+ }), null, 16, ["name"])) : z("", !0)
766
+ ]),
767
+ _: 1
768
+ }, 8, ["wrap", "disabled", "class"]),
769
+ n.type === "number" && (Number.isInteger(n.min) || Number.isInteger(n.max)) ? (a(), v(K, { key: 0 }, [
770
+ $(le, {
771
+ disabled: Number(L.value) <= h.value,
772
+ size: n.size,
773
+ theme: n.theme,
774
+ "aria-label": l(r)("decrease"),
775
+ tooltip: l(r)("decrease"),
776
+ "tooltip-position": "left",
777
+ "tooltip-as-text": "",
778
+ round: "",
779
+ onClick: S
780
+ }, {
781
+ default: C(() => [
782
+ $(U, { name: "minus" }),
783
+ $(U, {
784
+ name: "minus",
785
+ regular: ""
786
+ })
787
+ ]),
788
+ _: 1
789
+ }, 8, ["disabled", "size", "theme", "aria-label", "tooltip"]),
790
+ $(le, {
791
+ disabled: Number(L.value) >= b.value,
792
+ size: n.size,
793
+ theme: n.theme,
794
+ tooltip: l(r)("increase"),
795
+ "tooltip-position": "left",
796
+ round: "",
797
+ onClick: V
798
+ }, {
799
+ default: C(() => [
800
+ $(U, { name: "plus" }),
801
+ $(U, {
802
+ name: "plus",
803
+ regular: ""
804
+ })
805
+ ]),
806
+ _: 1
807
+ }, 8, ["disabled", "size", "theme", "tooltip"])
808
+ ], 64)) : z("", !0)
809
+ ], 2));
810
+ }
811
+ }), zt = ["for"], Lt = {
812
+ key: 0,
813
+ class: "flx --flxColumn --flx-start --flx --gap-none"
814
+ }, Tt = { key: 0 }, Pt = { key: 1 }, _e = /* @__PURE__ */ q({
815
+ name: "InputToggle",
816
+ inheritAttrs: !1,
817
+ __name: "Toggle",
818
+ props: {
819
+ type: {},
820
+ label: {},
821
+ showPlaceholder: { type: Boolean },
822
+ fullWidth: { type: Boolean },
823
+ autocomplete: {},
824
+ id: {},
825
+ name: {},
826
+ placeholder: {},
827
+ title: {},
828
+ required: { type: Boolean },
829
+ disabled: { type: Boolean },
830
+ hidden: {},
831
+ size: {},
832
+ active: { type: Boolean },
833
+ invalid: { type: Boolean },
834
+ state: {},
835
+ theme: {}
836
+ },
837
+ setup(p) {
838
+ const t = p, { t: e } = O(Z), { getClassesString: m } = O(Y), { modifiersClasses: r } = ie(t), { stateClasses: B } = de(t), { themeClasses: s } = te(t), u = T(() => t.type || "checkbox");
839
+ return (o, d) => (a(), v("div", {
840
+ class: j({ "--width": o.fullWidth })
841
+ }, [
842
+ $(Ae, M({
843
+ class: [
844
+ l(m)([
845
+ l(r),
846
+ l(B),
847
+ l(s),
848
+ `i${l(x).capitalize(u.value)}`
849
+ ]),
850
+ "--full"
851
+ ]
852
+ }, { ...o.$attrs, type: u.value, disabled: o.disabled }), {
853
+ default: C(({ id: h, modelValue: b }) => [
854
+ A("label", {
855
+ for: h,
856
+ class: "flx --flxRow --flx-start-center --gap-none"
857
+ }, [
858
+ o.label || o.showPlaceholder || o.$slots.default ? (a(), v("div", Lt, [
859
+ o.label ? (a(), v("span", Tt, P(o.label), 1)) : o.showPlaceholder ? (a(), v("span", Pt, P(l(e)(b ? "yes" : "no")), 1)) : z("", !0),
860
+ G(o.$slots, "default")
861
+ ])) : z("", !0)
862
+ ], 8, zt)
863
+ ]),
864
+ _: 3
865
+ }, 16, ["class"])
866
+ ], 2));
867
+ }
868
+ }), he = /* @__PURE__ */ q({
869
+ name: "SelectSimple",
870
+ inheritAttrs: !1,
871
+ __name: "Simple",
872
+ props: {
873
+ options: {},
874
+ multiple: { type: Boolean },
875
+ id: {},
876
+ name: {},
877
+ placeholder: {},
878
+ title: {},
879
+ required: { type: Boolean },
880
+ disabled: { type: Boolean },
881
+ hidden: {},
882
+ size: {},
883
+ active: { type: Boolean },
884
+ invalid: { type: Boolean },
885
+ state: {},
886
+ theme: {}
887
+ },
888
+ setup(p) {
889
+ const t = p, { getClassesString: e } = O(Y), { modifiersClasses: m } = ie(t), { stateClasses: r } = de(t), { themeClasses: B } = te({ ...t, themeAsUnion: !0 });
890
+ return (s, u) => (a(), _(Qe, M({
891
+ class: [l(e)([l(m), l(r), l(B)]), "iSelect"]
892
+ }, { ...s.$attrs, options: s.options, required: s.required, disabled: s.disabled }), null, 16, ["class"]));
893
+ }
894
+ }), Et = ["id"], we = /* @__PURE__ */ q({
895
+ name: "SelectFilter",
896
+ inheritAttrs: !1,
897
+ __name: "Filter",
898
+ props: {
899
+ icon: {},
900
+ iconProps: {},
901
+ modelValue: {},
902
+ options: {},
903
+ multiple: { type: Boolean },
904
+ id: {},
905
+ name: {},
906
+ placeholder: {},
907
+ title: {},
908
+ required: { type: Boolean },
909
+ disabled: { type: Boolean },
910
+ hidden: {},
911
+ size: {},
912
+ active: { type: Boolean },
913
+ invalid: { type: Boolean },
914
+ state: {},
915
+ theme: {}
916
+ },
917
+ emits: ["update:model-value"],
918
+ setup(p, { emit: t }) {
919
+ const e = p, m = t, { t: r } = O(Z), { isBrowser: B } = O(Y), { uuid: s } = Pe(), u = s().replace("-", "").substring(0, 8), o = H(!0), d = T(() => e.name ?? `select-filter${u}`), h = T(() => (e.options ?? []).map(ke)), b = H(e.modelValue || ""), y = T({
920
+ get: () => e.modelValue,
921
+ set: (f = "") => {
922
+ const V = (n) => x.deburr(n).toLowerCase(), S = h.value.find(({ value: n, alias: D }) => {
923
+ const W = D ?? n;
924
+ return typeof f == "string" && typeof W == "string" && V(W) === V(f) ? !0 : W === f;
925
+ });
926
+ S ? (b.value = S.alias || S.value, m("update:model-value", S.value)) : f === "" && (b.value = f, m("update:model-value", f));
927
+ }
928
+ }), g = T(() => {
929
+ const f = h.value.find(({ value: V }) => V === y.value);
930
+ return y.value && !f || e.invalid;
931
+ });
932
+ function L(f) {
933
+ const { target: V } = f;
934
+ y.value = V.value;
935
+ }
936
+ return B && (o.value = !!HTMLDataListElement), (f, V) => (a(), v(K, null, [
937
+ A("datalist", { id: d.value }, [
938
+ $(he, M({
939
+ modelValue: y.value,
940
+ "onUpdate:modelValue": V[0] || (V[0] = (S) => y.value = S)
941
+ }, {
942
+ ...f.$attrs,
943
+ options: h.value.map(({ value: S, alias: n }) => ({
944
+ alias: n,
945
+ value: n ?? S
946
+ })),
947
+ placeholder: f.placeholder ?? l(r)("select_placeholder"),
948
+ disabled: f.disabled,
949
+ hidden: f.hidden,
950
+ size: f.size,
951
+ active: f.active,
952
+ invalid: f.invalid,
953
+ state: f.state,
954
+ theme: f.theme
955
+ }), null, 16, ["modelValue"])
956
+ ], 8, Et),
957
+ o.value ? (a(), v("div", M({
958
+ key: 0,
959
+ class: "flx --flxRow --flx-start-center --gap-5"
960
+ }, f.$attrs), [
961
+ $(ce, M({
962
+ modelValue: b.value,
963
+ "onUpdate:modelValue": V[1] || (V[1] = (S) => b.value = S),
964
+ list: d.value
965
+ }, {
966
+ type: "text",
967
+ placeholder: l(r)("select_filter_options"),
968
+ disabled: !!y.value && !g.value || f.disabled,
969
+ hidden: f.hidden,
970
+ size: f.size,
971
+ active: f.active,
972
+ invalid: g.value,
973
+ state: f.state,
974
+ theme: f.theme,
975
+ icon: f.icon,
976
+ iconProps: f.iconProps
977
+ }, {
978
+ class: "--flx",
979
+ onChange: L
980
+ }), null, 16, ["modelValue", "list"]),
981
+ y.value && h.value.length > 1 ? (a(), _(ee, {
982
+ key: 0,
983
+ theme: f.theme,
984
+ "aria-label": l(r)("select_restablish_field"),
985
+ title: l(r)("select_restablish_field"),
986
+ onClick: V[2] || (V[2] = ue((S) => y.value = "", ["prevent"]))
987
+ }, {
988
+ default: C(() => [
989
+ $(U, {
990
+ name: "xmark",
991
+ size: "20"
992
+ })
993
+ ]),
994
+ _: 1
995
+ }, 8, ["theme", "aria-label", "title"])) : z("", !0)
996
+ ], 16)) : z("", !0)
997
+ ], 64));
998
+ }
999
+ }), It = { class: "flx --flxColumn --flx-center" }, Nt = {
1000
+ key: 0,
1001
+ class: "txt --txtAlign-center"
1002
+ }, Re = /* @__PURE__ */ q({
1003
+ name: "LoaderSimple",
1004
+ inheritAttrs: !0,
1005
+ __name: "Simple",
1006
+ props: {
1007
+ label: {},
1008
+ size: {},
1009
+ margin: {},
1010
+ radius: {},
1011
+ speed: {},
1012
+ theme: {}
1013
+ },
1014
+ setup(p) {
1015
+ const t = p, { themeValues: e } = te(t), m = T(() => t.size || "0.5rem"), r = ut({
1016
+ width: m.value,
1017
+ height: m.value,
1018
+ margin: t.margin || "2px",
1019
+ borderRadius: t.radius || "100%",
1020
+ display: "inline-block",
1021
+ animationDuration: (t.speed || 1e3) + "ms"
1022
+ });
1023
+ return (B, s) => (a(), v("span", It, [
1024
+ A("span", null, [
1025
+ A("span", {
1026
+ class: j([`--bgColor-${l(e)[0]}`, "a-pulse is--animated --iterations-infinite"]),
1027
+ style: Ve(r)
1028
+ }, null, 6),
1029
+ A("span", {
1030
+ class: j([`--bgColor-${l(e)[0]}`, "a-pulse is--animated --iterations-infinite --delay-2"]),
1031
+ style: Ve(r)
1032
+ }, null, 6),
1033
+ A("span", {
1034
+ class: j([`--bgColor-${l(e)[0]}`, "a-pulse is--animated --iterations-infinite --delay-4"]),
1035
+ style: Ve(r)
1036
+ }, null, 6)
1037
+ ]),
1038
+ G(B.$slots, "default", {}, () => [
1039
+ B.label ? (a(), v("span", Nt, [
1040
+ A("p", null, P(B.label), 1)
1041
+ ])) : z("", !0)
1042
+ ])
1043
+ ]));
1044
+ }
1045
+ }), Ut = {
1046
+ key: 0,
1047
+ class: "flx --flxRow --flx-between-center"
1048
+ }, Mt = { class: "txt --gaping-none" }, Ot = {
1049
+ key: 0,
1050
+ class: "--txtSize-xs"
1051
+ }, Ft = { class: "scroll --vertical" }, Dt = {
1052
+ key: 0,
1053
+ class: "flx --flxRow --flx-end-center"
1054
+ }, Wt = { class: "--hidden-full:sm-inv" }, qt = {
1055
+ key: 0,
1056
+ class: "txt --txtAlignFlx-center --gaping-5"
1057
+ }, Ht = { class: "--txtColor-light --txtShadow --txtSize-sm" }, Be = /* @__PURE__ */ q({
1058
+ name: "ModalSimple",
1059
+ inheritAttrs: !1,
1060
+ __name: "Modal",
1061
+ props: {
1062
+ loading: { type: Boolean },
1063
+ title: {},
1064
+ subtitle: {},
1065
+ modalClass: {},
1066
+ saveButton: {},
1067
+ cancelButton: {},
1068
+ hide: { type: Boolean },
1069
+ hideMessage: {},
1070
+ hideFooter: { type: Boolean },
1071
+ disabled: { type: Boolean },
1072
+ modelValue: { type: Boolean },
1073
+ target: {},
1074
+ theme: {}
1075
+ },
1076
+ emits: ["save", "close", "update:model-value"],
1077
+ setup(p, { emit: t }) {
1078
+ const e = p, m = t, { t: r } = O(Z), B = O(Le), { themeValues: s } = te(e), { uuid: u } = Pe(), o = u().replace("-", "").substring(0, 8), d = H(), h = H(), b = H(!1), y = T(() => {
1079
+ var n;
1080
+ return {
1081
+ title: r("ok"),
1082
+ visible: !!((n = e.saveButton) != null && n.title),
1083
+ btnClass: "",
1084
+ ...!!e.saveButton && e.saveButton
1085
+ };
1086
+ }), g = T(() => ({
1087
+ title: r("close"),
1088
+ visible: !0,
1089
+ btnClass: "",
1090
+ ...!!e.cancelButton && e.cancelButton
1091
+ }));
1092
+ function L() {
1093
+ var n;
1094
+ (n = h.value) == null || n.close(), b.value = !1, m("update:model-value", !1), m("close");
1095
+ }
1096
+ function f(n) {
1097
+ h.value === n.target && L();
1098
+ }
1099
+ function V(n = !0) {
1100
+ S.value = n;
1101
+ }
1102
+ const S = T({
1103
+ get() {
1104
+ return !e.disabled && d.value;
1105
+ },
1106
+ set(n) {
1107
+ var D;
1108
+ n ? ((D = h.value) == null || D.showModal(), !e.loading && e.hide && (n = !1, L(), B.fire({
1109
+ title: r("swal.modal_unauthorized"),
1110
+ text: e.hideMessage || r("swal.modal_unauthorized_text"),
1111
+ icon: "warning"
1112
+ })), setTimeout(() => b.value = e.loading, 3e3)) : L(), d.value = n;
1113
+ }
1114
+ });
1115
+ return ze(() => {
1116
+ e.modelValue && (S.value = e.modelValue);
1117
+ }), Me(L), pe(
1118
+ () => e.modelValue,
1119
+ (n) => S.value = n,
1120
+ { immediate: !1 }
1121
+ ), (n, D) => (a(), v(K, null, [
1122
+ n.$slots.toggle ? G(n.$slots, "toggle", X(M({ key: 0 }, { setModel: V, model: S.value }))) : z("", !0),
1123
+ n.disabled ? G(n.$slots, "default", X(M({ key: 2 }, { model: S.value }))) : (a(), _(dt, {
1124
+ id: l(o),
1125
+ key: l(o),
1126
+ to: n.target || "body"
1127
+ }, [
1128
+ A("dialog", {
1129
+ ref_key: "modalRef",
1130
+ ref: h,
1131
+ onClose: L,
1132
+ onMousedown: f
1133
+ }, [
1134
+ Oe(A("div", M({
1135
+ class: ["modal", [
1136
+ n.modalClass ?? "flx --flxColumn --flx-start-stretch --width",
1137
+ `--bgColor-${l(s)[1]}`
1138
+ ]],
1139
+ role: "document"
1140
+ }, n.$attrs), [
1141
+ G(n.$slots, "modal-header", X(ae({ model: S.value })), () => [
1142
+ n.title ? (a(), v("div", Ut, [
1143
+ A("div", Mt, [
1144
+ A("h5", null, P(n.title), 1),
1145
+ n.subtitle ? (a(), v("p", Ot, P(n.subtitle), 1)) : z("", !0)
1146
+ ]),
1147
+ $(ee, {
1148
+ theme: n.theme,
1149
+ "aria-label": g.value.title,
1150
+ onClick: ue(L, ["stop"])
1151
+ }, {
1152
+ default: C(() => [
1153
+ $(U, {
1154
+ name: "xmark",
1155
+ size: "20"
1156
+ })
1157
+ ]),
1158
+ _: 1
1159
+ }, 8, ["theme", "aria-label"])
1160
+ ])) : z("", !0)
1161
+ ]),
1162
+ A("div", Ft, [
1163
+ G(n.$slots, "default", X(ae({ model: S.value })))
1164
+ ]),
1165
+ G(n.$slots, "modal-footer", X(ae({ model: S.value })), () => [
1166
+ n.hideFooter ? z("", !0) : (a(), v("div", Dt, [
1167
+ y.value.visible ? (a(), _(re, {
1168
+ key: 0,
1169
+ theme: n.theme,
1170
+ "aria-label": y.value.title,
1171
+ class: j(y.value.btnClass),
1172
+ onClick: D[0] || (D[0] = (W) => m("save", L, W))
1173
+ }, {
1174
+ default: C(() => [
1175
+ ne(P(y.value.title), 1)
1176
+ ]),
1177
+ _: 1
1178
+ }, 8, ["theme", "aria-label", "class"])) : z("", !0),
1179
+ g.value.visible ? (a(), _(le, {
1180
+ key: 1,
1181
+ theme: n.theme,
1182
+ "aria-label": g.value.title,
1183
+ class: j(g.value.btnClass),
1184
+ "data-dismiss": "modal",
1185
+ round: ":sm-inv",
1186
+ onClick: ue(L, ["stop"])
1187
+ }, {
1188
+ default: C(() => [
1189
+ $(U, {
1190
+ name: "xmark",
1191
+ hidden: "-full:sm"
1192
+ }),
1193
+ $(U, {
1194
+ name: "xmark",
1195
+ regular: "",
1196
+ hidden: "-full:sm"
1197
+ }),
1198
+ A("span", Wt, P(g.value.title), 1)
1199
+ ]),
1200
+ _: 1
1201
+ }, 8, ["theme", "aria-label", "class"])) : z("", !0)
1202
+ ]))
1203
+ ])
1204
+ ], 16), [
1205
+ [Fe, !n.loading && !n.hide]
1206
+ ]),
1207
+ n.loading || n.hide ? (a(), _(Re, {
1208
+ key: 0,
1209
+ theme: n.theme
1210
+ }, {
1211
+ default: C(() => [
1212
+ $(je, { name: "fade" }, {
1213
+ default: C(() => [
1214
+ b.value || e.hide && e.hideMessage ? (a(), v("div", qt, [
1215
+ A("p", Ht, P(e.hideMessage ? e.hideMessage : l(r)("modal_taking_too_long")), 1),
1216
+ $(re, {
1217
+ theme: n.theme,
1218
+ "aria-label": l(r)("close"),
1219
+ onClick: L
1220
+ }, {
1221
+ default: C(() => [
1222
+ ne(P(l(r)("close")), 1)
1223
+ ]),
1224
+ _: 1
1225
+ }, 8, ["theme", "aria-label"])
1226
+ ])) : z("", !0)
1227
+ ]),
1228
+ _: 1
1229
+ })
1230
+ ]),
1231
+ _: 1
1232
+ }, 8, ["theme"])) : z("", !0)
1233
+ ], 544)
1234
+ ], 8, ["id", "to"]))
1235
+ ], 64));
1236
+ }
1237
+ }), jt = ["title"], Gt = { key: 5 }, Ze = /* @__PURE__ */ q({
1238
+ name: "ValueSimple",
1239
+ inheritAttrs: !1,
1240
+ __name: "Simple",
1241
+ props: {
1242
+ value: {},
1243
+ property: {},
1244
+ readOnly: { type: Boolean },
1245
+ classes: {},
1246
+ modalTarget: {},
1247
+ modalTheme: {},
1248
+ theme: {}
1249
+ },
1250
+ setup(p) {
1251
+ const t = me("xamu"), { t: e } = O(Z), m = T(() => {
1252
+ const s = (t == null ? void 0 : t.lang) || "en", u = (t == null ? void 0 : t.country) || "US";
1253
+ return `${s}-${u}`;
1254
+ });
1255
+ function r(s) {
1256
+ const [u] = s.split("?");
1257
+ if (t != null && t.imageHosts && be.isURL(u)) {
1258
+ const o = new URL(u);
1259
+ if (t.imageHosts.includes(o.host))
1260
+ return !0;
1261
+ }
1262
+ return /\.(jpg|jpeg|png|webp|avif|gif)$/.test(u);
1263
+ }
1264
+ function B(s) {
1265
+ return be.isDate(s) || !isNaN(Date.parse(s));
1266
+ }
1267
+ return (s, u) => {
1268
+ var o;
1269
+ return a(), v("div", {
1270
+ class: j(["flx --flxRow --flx-start-center --gap-5", s.classes])
1271
+ }, [
1272
+ typeof s.value == "boolean" ? (a(), _(_e, {
1273
+ key: 0,
1274
+ checked: s.value,
1275
+ theme: s.theme,
1276
+ disabled: ""
1277
+ }, null, 8, ["checked", "theme"])) : typeof s.value == "string" && B(s.value) || s.value instanceof Date ? (a(), v("span", {
1278
+ key: 1,
1279
+ title: String(s.value)
1280
+ }, P(l(gt)(new Date(s.value), m.value)), 9, jt)) : typeof s.value == "string" && l(be).isEmail(s.value) ? (a(), _(ee, {
1281
+ key: 2,
1282
+ mailto: s.value,
1283
+ theme: s.theme
1284
+ }, null, 8, ["mailto", "theme"])) : typeof s.value == "string" && l(be).isURL(s.value, { require_host: !1 }) ? (a(), v(K, { key: 3 }, [
1285
+ r(s.value) ? (a(), _(fe, {
1286
+ key: 0,
1287
+ class: "avatar",
1288
+ href: s.value,
1289
+ target: "_blank"
1290
+ }, {
1291
+ default: C(() => [
1292
+ $(Te, {
1293
+ preset: "avatar",
1294
+ src: s.value,
1295
+ alt: s.value
1296
+ }, null, 8, ["src", "alt"])
1297
+ ]),
1298
+ _: 1
1299
+ }, 8, ["href"])) : (a(), _(ee, {
1300
+ key: 1,
1301
+ theme: s.theme,
1302
+ href: s.value,
1303
+ target: "_blank"
1304
+ }, {
1305
+ default: C(() => [
1306
+ ne(P(l(e)("table_open_url")), 1)
1307
+ ]),
1308
+ _: 1
1309
+ }, 8, ["theme", "href"]))
1310
+ ], 64)) : typeof s.value == "string" && s.value.length > 66 ? (a(), _(Be, {
1311
+ key: 4,
1312
+ class: "--txtSize",
1313
+ theme: s.modalTheme || s.theme,
1314
+ title: (o = s.property) == null ? void 0 : o.alias,
1315
+ target: s.modalTarget
1316
+ }, {
1317
+ toggle: C(({ setModel: d }) => [
1318
+ $(ee, {
1319
+ theme: s.theme,
1320
+ tooltip: l(e)("see_value"),
1321
+ "tooltip-as-text": "",
1322
+ "tooltip-position": "bottom",
1323
+ onClick: (h) => d()
1324
+ }, {
1325
+ default: C(() => [
1326
+ ne(P(s.value.substring(0, 33)) + "... ", 1)
1327
+ ]),
1328
+ _: 2
1329
+ }, 1032, ["theme", "tooltip", "onClick"])
1330
+ ]),
1331
+ default: C(({ model: d }) => [
1332
+ d ? (a(), v("div", {
1333
+ key: 0,
1334
+ class: j(["txt", s.classes])
1335
+ }, [
1336
+ A("p", null, P(s.value), 1)
1337
+ ], 2)) : z("", !0)
1338
+ ]),
1339
+ _: 1
1340
+ }, 8, ["theme", "title", "target"])) : (a(), v("span", Gt, P(typeof s.value == "string" || typeof s.value == "number" ? s.value ?? "-" : "-"), 1))
1341
+ ], 2);
1342
+ };
1343
+ }
1344
+ }), Kt = { class: "txt --txtAlign-center --width" }, Qt = ["innerHTML"], Se = /* @__PURE__ */ q({
1345
+ name: "BoxMessage",
1346
+ inheritAttrs: !1,
1347
+ __name: "Message",
1348
+ props: {
1349
+ text: {},
1350
+ asButton: { type: Boolean },
1351
+ to: {},
1352
+ href: {},
1353
+ target: {},
1354
+ tel: {},
1355
+ disabled: { type: Boolean },
1356
+ mailto: {},
1357
+ type: {},
1358
+ tag: {},
1359
+ toggle: {},
1360
+ round: {},
1361
+ toggleState: {},
1362
+ indicative: {},
1363
+ whatsapp: { type: Boolean },
1364
+ download: {},
1365
+ hidden: {},
1366
+ size: {},
1367
+ active: { type: Boolean },
1368
+ invalid: { type: Boolean },
1369
+ state: {},
1370
+ theme: {}
1371
+ },
1372
+ setup(p) {
1373
+ const t = p, { getModifierClasses: e, getClassesString: m } = O(Y), { modifiersClasses: r } = ie(t), { stateClasses: B } = de(t), { themeClasses: s, themeValues: u } = te(t);
1374
+ return (o, d) => (a(), v("div", M({
1375
+ class: [l(r), "flx --flxColumn --flx-center --width"]
1376
+ }, o.$attrs), [
1377
+ A("div", Kt, [
1378
+ A("div", {
1379
+ class: j([
1380
+ l(m)([
1381
+ l(r),
1382
+ l(B),
1383
+ l(s),
1384
+ l(e)([l(u)[0]], { modifier: "txtColor", divider: "-" }),
1385
+ l(e)(o.asButton ?? !1, { modifier: "button" })
1386
+ ]),
1387
+ "box"
1388
+ ])
1389
+ }, [
1390
+ o.text ? (a(), v("p", {
1391
+ key: 0,
1392
+ innerHTML: o.text
1393
+ }, null, 8, Qt)) : G(o.$slots, "default", { key: 1 })
1394
+ ], 2)
1395
+ ])
1396
+ ], 16));
1397
+ }
1398
+ }), xe = /* @__PURE__ */ q({
1399
+ name: "DropdownSimple",
1400
+ inheritAttrs: !1,
1401
+ __name: "Dropdown",
1402
+ props: {
1403
+ position: {},
1404
+ el: {},
1405
+ modelValue: { type: Boolean },
1406
+ hidden: {},
1407
+ size: {},
1408
+ theme: {}
1409
+ },
1410
+ emits: ["close", "update:model-value"],
1411
+ setup(p, { emit: t }) {
1412
+ const e = p, m = t, { getModifierClasses: r, getClassesString: B } = O(Y), { themeValues: s } = te(e), { tabletMqRange: u } = Ye(), { modifiersClasses: o } = ie(e), d = H(), h = H(), b = H(!1), y = H(e.modelValue), g = T(() => B([
1413
+ "dropdown",
1414
+ `--bgColor-${s.value[1]}`,
1415
+ r([{ active: e.modelValue }], { prefix: "is" }),
1416
+ r([[e.position ?? "bottom"].flat(2).join("-")], {
1417
+ modifier: "position",
1418
+ divider: "-"
1419
+ })
1420
+ ]));
1421
+ function L(n = !y.value) {
1422
+ return y.value = n;
1423
+ }
1424
+ function f() {
1425
+ m("close"), m("update:model-value", L(!1));
1426
+ }
1427
+ function V(n) {
1428
+ const D = n.target, W = d.value, J = h.value;
1429
+ J === D || J != null && J.contains(D) || W != null && W.contains(D) || f();
1430
+ }
1431
+ const S = T({
1432
+ get: () => e.modelValue || y.value,
1433
+ set: f
1434
+ });
1435
+ return pe(
1436
+ u,
1437
+ (n) => {
1438
+ b.value = n && e.modelValue !== null, f();
1439
+ },
1440
+ { immediate: !1 }
1441
+ ), ze(() => {
1442
+ document.addEventListener("click", V, !0);
1443
+ }), Me(() => {
1444
+ document.removeEventListener("click", V, !0);
1445
+ }), (n, D) => (a(), _($e, {
1446
+ wrap: !!n.$slots.toggle,
1447
+ el: n.el
1448
+ }, {
1449
+ default: C(() => [
1450
+ n.$slots.toggle ? (a(), v("div", {
1451
+ key: 0,
1452
+ ref_key: "toggleRef",
1453
+ ref: d,
1454
+ class: j(["only--active toggle--dropdown", { "is--active": S.value }])
1455
+ }, [
1456
+ G(n.$slots, "toggle", X(ae({ model: y.value, setModel: L })))
1457
+ ], 2)) : z("", !0),
1458
+ $(Be, {
1459
+ modelValue: S.value,
1460
+ "onUpdate:modelValue": D[0] || (D[0] = (W) => S.value = W),
1461
+ disabled: !b.value,
1462
+ theme: n.theme
1463
+ }, {
1464
+ default: C(() => [
1465
+ A("div", {
1466
+ ref_key: "dropdownRef",
1467
+ ref: h,
1468
+ class: j({ [l(B)([l(o), g.value])]: !b.value })
1469
+ }, [
1470
+ G(n.$slots, "default", X(ae({ model: y.value, setModel: L })))
1471
+ ], 2)
1472
+ ]),
1473
+ _: 3
1474
+ }, 8, ["modelValue", "disabled", "theme"])
1475
+ ]),
1476
+ _: 3
1477
+ }, 8, ["wrap", "el"]));
1478
+ }
1479
+ }), Xt = {
1480
+ key: 0,
1481
+ class: "flx --flxRow --flx-end-center"
1482
+ }, Yt = { class: "--txtAlign --txtSize-sm" }, Jt = { class: "flx --flxRow --flx-start-center --gap-10" }, Zt = { key: 1 }, xt = /* @__PURE__ */ A("span", null, "#", -1), el = ["data-column-name", "data-column", "width"], tl = ["title"], ll = {
1483
+ key: 0,
1484
+ class: "--sticky --txtAlign-center",
1485
+ "data-column-name": "modify",
1486
+ "data-column": "modify"
1487
+ }, al = { class: "flx --flxRow --flx-start-center --gap-10" }, ol = ["title"], sl = ["data-column-name", "data-column"], nl = ["data-column"], rl = { class: "flx --flxRow --flx-center --gap-10" }, il = { class: "flx --flxColumn --flx-start-stretch --gap-5" }, ul = { key: 0 }, dl = { key: 1 }, ml = {
1488
+ key: 0,
1489
+ class: "no--hover"
1490
+ }, pl = { class: "--sticky --pX-10 --pY-5 --vAlign" }, cl = { class: "flx --flxRow --flx-center-end --gap-10 --bdr" }, fl = ["colspan"], hl = { class: "flx --flxRow --flx-start --flx --width" }, vl = {
1491
+ key: 0,
1492
+ class: "--width --pRight --boxSizing --overflow-hidden"
1493
+ }, gl = { class: "flx --flxRow --flx-center" }, et = /* @__PURE__ */ q({
1494
+ name: "TableSimple",
1495
+ inheritAttrs: !1,
1496
+ __name: "Table",
1497
+ props: {
1498
+ nodes: {},
1499
+ properties: {},
1500
+ readOnly: { type: Boolean },
1501
+ canSort: { type: Boolean },
1502
+ updateNode: {},
1503
+ deleteNode: {},
1504
+ cloneNode: {},
1505
+ createNodeChildren: {},
1506
+ classes: {},
1507
+ refresh: { type: Function },
1508
+ extraCols: { type: Boolean },
1509
+ childrenName: {},
1510
+ childrenCountKey: {},
1511
+ modalTheme: {},
1512
+ omitRefresh: { type: Boolean },
1513
+ theme: {}
1514
+ },
1515
+ setup(p) {
1516
+ var N;
1517
+ const t = p, { t: e, tet: m } = O(Z), r = O(Le), { themeClasses: B, themeValues: s } = te({ ...t, themeAsUnion: !0 }), u = (N = De()) == null ? void 0 : N.appContext.config.globalProperties.$router, o = H(), d = H(L(t.nodes.length)), h = T(() => d.value.filter(([i]) => i).length), b = T(() => {
1518
+ var R;
1519
+ const i = { name: "id", asc: !0 };
1520
+ if (u) {
1521
+ const w = u.currentRoute.value;
1522
+ if (!w.query.orderBy)
1523
+ return i;
1524
+ const E = (R = String(w.query.orderBy).split(",")[0]) == null ? void 0 : R.split(":");
1525
+ i.name = E[0], String(E[1]).toUpperCase() === "DESC" && (i.asc = !1);
1526
+ }
1527
+ return i;
1528
+ }), y = T(() => t.readOnly || !t.nodes.length || !t.updateNode && !t.cloneNode && !t.deleteNode), g = T(() => Object.entries(t.nodes[0]).sort(([i], [R]) => i.endsWith("At") || i.endsWith("By") || R.endsWith("At") || R.endsWith("By") ? i.endsWith("At") || i.endsWith("By") ? 1 : -1 : i > R ? 1 : i < R ? -1 : 0).map(([i]) => {
1529
+ const R = (t.properties || []).map(ke), w = ke(R.find((E) => E.value === i) || i), k = x.snakeCase(i);
1530
+ return {
1531
+ ...w,
1532
+ alias: x.capitalize(x.startCase(w.alias || m(k)))
1533
+ };
1534
+ }).filter((i) => i.value !== "id"));
1535
+ function L(i) {
1536
+ return Array.from({ length: i }, () => [!1, !1]);
1537
+ }
1538
+ function f(i) {
1539
+ return t.childrenCountKey ? i[t.childrenCountKey] : 0;
1540
+ }
1541
+ function V(i = !0) {
1542
+ d.value.forEach((R, w) => d.value[w][0] = i);
1543
+ }
1544
+ function S(i) {
1545
+ const [R, w] = d.value[i];
1546
+ d.value[i] = [R, !w];
1547
+ }
1548
+ function n(i) {
1549
+ return b.value.name === i;
1550
+ }
1551
+ function D(i) {
1552
+ var R = "ASC";
1553
+ b.value.name === i && b.value.asc && (R = "DESC");
1554
+ const w = `${i}:${R}`;
1555
+ if (!u)
1556
+ return;
1557
+ const k = u.currentRoute.value;
1558
+ u.push({ path: k.path, hash: k.hash, query: { ...k.query, orderBy: w } });
1559
+ }
1560
+ async function W(i) {
1561
+ var w, k;
1562
+ r.fireLoader({});
1563
+ const R = await ((w = t.updateNode) == null ? void 0 : w.call(t, i));
1564
+ if (R === void 0) {
1565
+ r.isLoading() && r.close();
1566
+ return;
1567
+ }
1568
+ R ? r.fire({
1569
+ icon: "success",
1570
+ title: e("swal.table_updated")
1571
+ }) : r.fire({
1572
+ icon: "warning",
1573
+ title: e("swal.table_updated"),
1574
+ text: e("swal.table_possibly_not_updated")
1575
+ }), t.omitRefresh || (k = t.refresh) == null || k.call(t);
1576
+ }
1577
+ async function J(i, R) {
1578
+ var k, E;
1579
+ R(!1), r.fireLoader({});
1580
+ const w = await ((k = t.cloneNode) == null ? void 0 : k.call(t, i));
1581
+ if (w === void 0) {
1582
+ r.isLoading() && r.close();
1583
+ return;
1584
+ }
1585
+ w ? r.fire({
1586
+ icon: "success",
1587
+ title: e("swal.table_cloned")
1588
+ }) : r.fire({
1589
+ icon: "warning",
1590
+ title: e("swal.table_cloned"),
1591
+ text: e("swal.table_possibly_not_cloned")
1592
+ }), t.omitRefresh || (E = t.refresh) == null || E.call(t);
1593
+ }
1594
+ async function c(i, R) {
1595
+ var E, Q;
1596
+ const { value: w } = await r.firePrevent({
1597
+ title: e("table_delete"),
1598
+ text: e("swal.table_delete_node_title"),
1599
+ footer: e("swal.table_delete_node_disclaimer")
1600
+ });
1601
+ if (!w)
1602
+ return;
1603
+ R(!1), r.fireLoader({});
1604
+ const k = await ((E = t.deleteNode) == null ? void 0 : E.call(t, i));
1605
+ if (k === void 0) {
1606
+ r.isLoading() && r.close();
1607
+ return;
1608
+ }
1609
+ k ? r.fire({
1610
+ icon: "success",
1611
+ title: e("swal.table_deleted")
1612
+ }) : r.fire({
1613
+ icon: "warning",
1614
+ title: e("swal.table_deleted"),
1615
+ text: e("swal.table_possibly_not_deleted")
1616
+ }), t.omitRefresh || (Q = t.refresh) == null || Q.call(t);
1617
+ }
1618
+ async function I() {
1619
+ var w;
1620
+ const { value: i } = await r.firePrevent({
1621
+ title: e("table_delete"),
1622
+ text: e("swal.table_delete_nodes_title", h.value),
1623
+ footer: e("swal.table_delete_nodes_disclaimer")
1624
+ });
1625
+ if (!i)
1626
+ return;
1627
+ r.fireLoader({});
1628
+ const R = await Promise.all(
1629
+ t.nodes.filter((k, E) => d.value[E][0]).map(async (k) => {
1630
+ var E;
1631
+ return await ((E = t.deleteNode) == null ? void 0 : E.call(t, k));
1632
+ })
1633
+ );
1634
+ if (R.every((k) => k === void 0)) {
1635
+ r.isLoading() && r.close();
1636
+ return;
1637
+ }
1638
+ R.every((k) => k) ? r.fire({
1639
+ icon: "success",
1640
+ title: e("swal.table_deleted")
1641
+ }) : r.fire({
1642
+ icon: "warning",
1643
+ title: e("swal.table_deleted"),
1644
+ text: e("swal.table_possibly_not_deleted", t.nodes.length)
1645
+ }), t.omitRefresh || (w = t.refresh) == null || w.call(t);
1646
+ }
1647
+ return pe(
1648
+ () => t.nodes,
1649
+ (i) => d.value = L(i.length),
1650
+ { immediate: !1 }
1651
+ ), (i, R) => i.nodes.length ? (a(), v("div", {
1652
+ key: 0,
1653
+ ref_key: "valueRootRef",
1654
+ ref: o,
1655
+ class: "flx --flxColumn --flx-start-stretch --width"
1656
+ }, [
1657
+ y.value ? z("", !0) : (a(), v("div", Xt, [
1658
+ i.deleteNode ? (a(), _(re, {
1659
+ key: 0,
1660
+ tooltip: l(e)("table_delete"),
1661
+ "tooltip-as-text": "",
1662
+ "tooltip-position": "bottom",
1663
+ theme: [l(ve).DANGER, l(s)[1]],
1664
+ disabled: !d.value.some(([w]) => w),
1665
+ onClick: I
1666
+ }, {
1667
+ default: C(() => [
1668
+ A("span", null, P(h.value === d.value.length ? l(e)("delete_all") : l(e)("delete", h.value)), 1),
1669
+ $(U, { name: "trash-can" })
1670
+ ]),
1671
+ _: 1
1672
+ }, 8, ["tooltip", "theme", "disabled"])) : z("", !0)
1673
+ ])),
1674
+ A("div", M(i.$attrs, { class: "scroll --horizontal --always" }), [
1675
+ A("table", {
1676
+ class: j(["tbl", l(B)])
1677
+ }, [
1678
+ A("thead", null, [
1679
+ A("tr", Yt, [
1680
+ A("th", {
1681
+ class: j(["--sticky", { "is--selected": i.canSort && n("id") }]),
1682
+ "data-column-name": "id",
1683
+ "data-column": "id"
1684
+ }, [
1685
+ A("div", Jt, [
1686
+ y.value ? z("", !0) : (a(), _(_e, {
1687
+ key: 0,
1688
+ theme: i.theme,
1689
+ title: l(e)("table_select_all"),
1690
+ checked: d.value.every(([w]) => w),
1691
+ "onUpdate:modelValue": V
1692
+ }, null, 8, ["theme", "title", "checked"])),
1693
+ y.value || !i.canSort ? (a(), v("span", Zt, "#")) : (a(), _(ee, {
1694
+ key: 2,
1695
+ theme: i.theme,
1696
+ title: "id",
1697
+ tooltip: l(e)("table_sort_by_name", { name: "Id" }),
1698
+ "tooltip-as-text": "",
1699
+ "tooltip-position": "bottom",
1700
+ onClick: R[0] || (R[0] = (w) => D("id"))
1701
+ }, {
1702
+ default: C(() => [
1703
+ xt,
1704
+ n("id") ? (a(), v(K, { key: 0 }, [
1705
+ b.value.asc ? (a(), _(U, {
1706
+ key: 0,
1707
+ name: "arrow-down"
1708
+ })) : z("", !0),
1709
+ b.value.asc ? z("", !0) : (a(), _(U, {
1710
+ key: 1,
1711
+ name: "arrow-up"
1712
+ }))
1713
+ ], 64)) : z("", !0)
1714
+ ]),
1715
+ _: 1
1716
+ }, 8, ["theme", "tooltip"]))
1717
+ ])
1718
+ ], 2),
1719
+ (a(!0), v(K, null, se(g.value, (w, k) => (a(), v("td", {
1720
+ key: k,
1721
+ class: j(["--txtSize-sm --maxWidth-440", { "is--selected": i.canSort && n(w.value) }]),
1722
+ "data-column-name": w.value,
1723
+ "data-column": w.alias,
1724
+ width: i.extraCols && k === g.value.length - 1 ? "99%" : "auto"
1725
+ }, [
1726
+ i.canSort ? (a(), _(ee, {
1727
+ key: 1,
1728
+ theme: i.theme,
1729
+ title: w.value,
1730
+ tooltip: l(e)("table_sort_by_name", { name: w.alias }),
1731
+ "tooltip-as-text": "",
1732
+ "tooltip-position": "bottom",
1733
+ onClick: (E) => D(w.value)
1734
+ }, {
1735
+ default: C(() => [
1736
+ A("span", null, P(w.alias), 1),
1737
+ n(w.value) ? (a(), v(K, { key: 0 }, [
1738
+ b.value.asc ? (a(), _(U, {
1739
+ key: 0,
1740
+ name: "arrow-down"
1741
+ })) : (a(), _(U, {
1742
+ key: 1,
1743
+ name: "arrow-up"
1744
+ }))
1745
+ ], 64)) : z("", !0)
1746
+ ]),
1747
+ _: 2
1748
+ }, 1032, ["theme", "title", "tooltip", "onClick"])) : (a(), v("span", {
1749
+ key: 0,
1750
+ title: String(w.value)
1751
+ }, P(w.alias), 9, tl))
1752
+ ], 10, el))), 128)),
1753
+ !y.value && (i.updateNode || i.deleteNode || i.cloneNode) ? (a(), v("th", ll, [
1754
+ A("span", null, P(l(e)("table_modify")), 1)
1755
+ ])) : z("", !0)
1756
+ ])
1757
+ ]),
1758
+ A("tbody", {
1759
+ class: j(i.classes)
1760
+ }, [
1761
+ (a(!0), v(K, null, se(i.nodes, (w, k) => (a(), v(K, { key: k }, [
1762
+ A("tr", {
1763
+ class: j(["--txtAlign --txtSize-sm", { "is--selected": d.value[k][0] }])
1764
+ }, [
1765
+ A("th", {
1766
+ class: j(["--sticky", { "is--selected": n("id") }]),
1767
+ "data-column-name": "id",
1768
+ "data-column": "id"
1769
+ }, [
1770
+ A("div", al, [
1771
+ y.value ? z("", !0) : (a(), _(_e, {
1772
+ key: 0,
1773
+ modelValue: d.value[k][0],
1774
+ "onUpdate:modelValue": (E) => d.value[k][0] = E,
1775
+ theme: i.theme,
1776
+ title: l(e)("table_select")
1777
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "theme", "title"])),
1778
+ A("span", {
1779
+ title: String(w.id ?? k)
1780
+ }, P(w.id && typeof w.id == "number" ? w.id : k + 1), 9, ol)
1781
+ ])
1782
+ ], 2),
1783
+ (a(!0), v(K, null, se(g.value, (E) => (a(), v("td", {
1784
+ key: E.value,
1785
+ "data-column-name": E.value,
1786
+ "data-column": E.alias,
1787
+ class: j([{
1788
+ "is--selected": b.value.name === E.value
1789
+ }, "--txtSize-sm --maxWidth-440"])
1790
+ }, [
1791
+ o.value ? (a(), _(tt, X(M({ key: 0 }, {
1792
+ value: w[E.value],
1793
+ property: E,
1794
+ node: w,
1795
+ readOnly: y.value,
1796
+ theme: i.theme,
1797
+ modalTheme: i.modalTheme,
1798
+ classes: i.classes,
1799
+ modalTarget: o.value,
1800
+ refresh: i.refresh,
1801
+ omitRefresh: i.omitRefresh
1802
+ })), null, 16)) : z("", !0)
1803
+ ], 10, sl))), 128)),
1804
+ !y.value && (i.updateNode || i.deleteNode || i.cloneNode) ? (a(), v("th", {
1805
+ key: 0,
1806
+ class: "--sticky --txtAlign-center",
1807
+ "data-column-name": "modify",
1808
+ "data-column": l(e)("table_modify")
1809
+ }, [
1810
+ A("div", rl, [
1811
+ i.updateNode ? (a(), _(re, {
1812
+ key: 0,
1813
+ tooltip: l(e)("table_update"),
1814
+ "tooltip-as-text": "",
1815
+ "tooltip-position": "left",
1816
+ theme: i.theme,
1817
+ size: "sm",
1818
+ round: "",
1819
+ disabled: d.value.some(([E]) => E),
1820
+ onClick: (E) => W(w)
1821
+ }, {
1822
+ default: C(() => [
1823
+ $(U, { name: "pencil" })
1824
+ ]),
1825
+ _: 2
1826
+ }, 1032, ["tooltip", "theme", "disabled", "onClick"])) : z("", !0),
1827
+ $(xe, {
1828
+ class: "flx --flxRow --flx-center",
1829
+ position: ["left", "center"],
1830
+ theme: i.modalTheme,
1831
+ size: "sm"
1832
+ }, {
1833
+ toggle: C(({ setModel: E }) => [
1834
+ $(ee, {
1835
+ "aria-label": l(e)("table_options"),
1836
+ title: l(e)("table_options"),
1837
+ theme: i.theme,
1838
+ size: "sm",
1839
+ disabled: d.value.some(([Q]) => Q),
1840
+ toggle: "dropdown",
1841
+ onClick: (Q) => E()
1842
+ }, {
1843
+ default: C(() => [
1844
+ $(U, { name: "ellipsis-vertical" })
1845
+ ]),
1846
+ _: 2
1847
+ }, 1032, ["aria-label", "title", "theme", "disabled", "onClick"])
1848
+ ]),
1849
+ default: C(({ setModel: E }) => [
1850
+ A("ul", il, [
1851
+ i.cloneNode ? (a(), v("li", ul, [
1852
+ $(ee, {
1853
+ theme: i.theme,
1854
+ size: "sm",
1855
+ "aria-label": l(e)("table_duplicate"),
1856
+ onClick: (Q) => J(w, E)
1857
+ }, {
1858
+ default: C(() => [
1859
+ $(U, { name: "clone" }),
1860
+ A("span", null, P(l(e)("table_duplicate")), 1)
1861
+ ]),
1862
+ _: 2
1863
+ }, 1032, ["theme", "aria-label", "onClick"])
1864
+ ])) : z("", !0),
1865
+ i.deleteNode ? (a(), v("li", dl, [
1866
+ $(ee, {
1867
+ theme: [l(ve).DANGER, l(s)[1]],
1868
+ size: "sm",
1869
+ "aria-label": l(e)("table_delete"),
1870
+ onClick: (Q) => c(w, E)
1871
+ }, {
1872
+ default: C(() => [
1873
+ $(U, { name: "trash-can" }),
1874
+ A("span", null, P(l(e)("table_delete")), 1)
1875
+ ]),
1876
+ _: 2
1877
+ }, 1032, ["theme", "aria-label", "onClick"])
1878
+ ])) : z("", !0)
1879
+ ])
1880
+ ]),
1881
+ _: 2
1882
+ }, 1032, ["theme"])
1883
+ ])
1884
+ ], 8, nl)) : z("", !0)
1885
+ ], 2),
1886
+ i.$slots.default ? (a(), v("tr", ml, [
1887
+ A("th", pl, [
1888
+ A("div", cl, [
1889
+ $(ee, {
1890
+ theme: i.theme,
1891
+ size: "sm",
1892
+ active: d.value[k][1],
1893
+ tooltip: l(e)("table_see_name", {
1894
+ name: i.childrenName || i.childrenCountKey || String(w.id ?? k).split("/")[0]
1895
+ }),
1896
+ "tooltip-position": "right",
1897
+ disabled: i.childrenCountKey && !f(w),
1898
+ class: "--p-5",
1899
+ onClick: (E) => S(k)
1900
+ }, {
1901
+ default: C(() => [
1902
+ $(U, {
1903
+ name: "chevron-up",
1904
+ indicator: ""
1905
+ })
1906
+ ]),
1907
+ _: 2
1908
+ }, 1032, ["theme", "active", "tooltip", "disabled", "onClick"]),
1909
+ $(ee, {
1910
+ theme: i.theme,
1911
+ size: "sm",
1912
+ tooltip: l(e)("table_create_new"),
1913
+ "tooltip-position": "right",
1914
+ disabled: !i.createNodeChildren,
1915
+ class: "--p-5",
1916
+ onClick: (E) => {
1917
+ var Q;
1918
+ return (Q = i.createNodeChildren) == null ? void 0 : Q.call(i, w);
1919
+ }
1920
+ }, {
1921
+ default: C(() => [
1922
+ $(U, { name: "plus" })
1923
+ ]),
1924
+ _: 2
1925
+ }, 1032, ["theme", "tooltip", "disabled", "onClick"])
1926
+ ])
1927
+ ]),
1928
+ A("td", {
1929
+ colspan: g.value.length + 1,
1930
+ class: "--pY-5 --index-1 --pRight"
1931
+ }, [
1932
+ Oe(A("div", hl, [
1933
+ G(i.$slots, "default", X(ae({ node: w, show: d.value[k][1] })))
1934
+ ], 512), [
1935
+ [Fe, d.value[k][1]]
1936
+ ]),
1937
+ d.value[k][1] ? z("", !0) : (a(), v("div", vl, [
1938
+ A("hr", {
1939
+ class: j(`--tm-${l(s)[0]}`)
1940
+ }, null, 2)
1941
+ ]))
1942
+ ], 8, fl)
1943
+ ])) : z("", !0)
1944
+ ], 64))), 128))
1945
+ ], 2)
1946
+ ], 2)
1947
+ ], 16)
1948
+ ], 512)) : i.canSort ? z("", !0) : (a(), _(Se, {
1949
+ key: 1,
1950
+ theme: i.theme
1951
+ }, {
1952
+ default: C(() => [
1953
+ A("div", gl, [
1954
+ A("span", null, P(l(e)("nothing_to_show")), 1),
1955
+ i.refresh ? (a(), _(le, {
1956
+ key: 0,
1957
+ theme: i.theme,
1958
+ tooltip: l(e)("refresh"),
1959
+ round: "",
1960
+ onClick: R[1] || (R[1] = (w) => i.refresh())
1961
+ }, {
1962
+ default: C(() => [
1963
+ $(U, { name: "rotate-right" }),
1964
+ $(U, {
1965
+ name: "rotate-right",
1966
+ regular: ""
1967
+ })
1968
+ ]),
1969
+ _: 1
1970
+ }, 8, ["theme", "tooltip"])) : z("", !0)
1971
+ ])
1972
+ ]),
1973
+ _: 1
1974
+ }, 8, ["theme"]));
1975
+ }
1976
+ }), yl = ["title"], bl = { class: "--txtWrap-nowrap" }, wl = { key: 1 }, Cl = { key: 2 }, tt = /* @__PURE__ */ q({
1977
+ name: "ValueComplex",
1978
+ inheritAttrs: !1,
1979
+ __name: "Complex",
1980
+ props: {
1981
+ value: {},
1982
+ property: {},
1983
+ node: {},
1984
+ readOnly: { type: Boolean },
1985
+ classes: {},
1986
+ refresh: { type: Function },
1987
+ modalTarget: {},
1988
+ modalTheme: {},
1989
+ omitRefresh: { type: Boolean },
1990
+ theme: {}
1991
+ },
1992
+ setup(p) {
1993
+ const t = p, { themeValues: e } = te(t), { t: m } = O(Z), r = O(Le);
1994
+ function B(o) {
1995
+ return o.map((d) => typeof d == "object" && d !== null ? d : { value: d });
1996
+ }
1997
+ async function s() {
1998
+ var d, h, b;
1999
+ r.fireLoader({});
2000
+ const o = await ((h = (d = t.property) == null ? void 0 : d.createNode) == null ? void 0 : h.call(d, t.node));
2001
+ if (o === void 0) {
2002
+ r.isLoading() && r.close();
2003
+ return;
2004
+ }
2005
+ o ? r.fire({
2006
+ icon: "success",
2007
+ title: m("swal.table_created")
2008
+ }) : r.fire({
2009
+ icon: "warning",
2010
+ title: m("swal.table_created"),
2011
+ text: m("swal.table_possibly_not_created")
2012
+ }), t.omitRefresh || (b = t.refresh) == null || b.call(t);
2013
+ }
2014
+ function u(o) {
2015
+ return Object.entries(o).sort(([d], [h]) => d.endsWith("At") || d.endsWith("By") || h.endsWith("At") || h.endsWith("By") ? d.endsWith("At") || d.endsWith("By") ? 1 : -1 : d > h ? 1 : d < h ? -1 : 0).filter(([d]) => d !== "id");
2016
+ }
2017
+ return (o, d) => {
2018
+ var b, y, g, L;
2019
+ const h = Ge("Complex", !0);
2020
+ return Array.isArray(o.value) ? (a(), v("div", {
2021
+ key: 0,
2022
+ class: "flx --flxRow --flx-start-center --gap-5",
2023
+ title: o.value.length ? l(m)("table_quantity", o.value.length) : ""
2024
+ }, [
2025
+ !o.readOnly && ((b = o.property) != null && b.createNode) ? (a(), _(re, {
2026
+ key: 0,
2027
+ theme: o.theme,
2028
+ tooltip: l(m)("table_create_new"),
2029
+ "tooltip-as-text": "",
2030
+ "tooltip-position": "bottom",
2031
+ round: "",
2032
+ onClick: s
2033
+ }, {
2034
+ default: C(() => [
2035
+ $(U, { name: "plus" })
2036
+ ]),
2037
+ _: 1
2038
+ }, 8, ["theme", "tooltip"])) : z("", !0),
2039
+ o.value.length ? (a(), v(K, { key: 1 }, [
2040
+ A("span", bl, [
2041
+ A("b", {
2042
+ class: j(`--txtColor-${l(e)[0]}`)
2043
+ }, P(o.value.length), 3),
2044
+ ne(" ⋅ ")
2045
+ ]),
2046
+ o.value.every((f) => typeof f == "object") || o.value.length > 3 ? (a(), _(Be, {
2047
+ key: 0,
2048
+ class: "--txtSize",
2049
+ theme: o.modalTheme || o.theme,
2050
+ title: (y = o.property) == null ? void 0 : y.alias,
2051
+ target: o.modalTarget
2052
+ }, {
2053
+ toggle: C(({ setModel: f }) => {
2054
+ var V, S;
2055
+ return [
2056
+ $(le, {
2057
+ theme: o.theme,
2058
+ "aria-label": l(m)("table_see_values", { name: (S = (V = o.property) == null ? void 0 : V.alias) == null ? void 0 : S.toLowerCase() }),
2059
+ size: "sm",
2060
+ onClick: (n) => f()
2061
+ }, {
2062
+ default: C(() => {
2063
+ var n, D;
2064
+ return [
2065
+ ne(P(l(m)("table_see_values", { name: (D = (n = o.property) == null ? void 0 : n.alias) == null ? void 0 : D.toLowerCase() })), 1)
2066
+ ];
2067
+ }),
2068
+ _: 2
2069
+ }, 1032, ["theme", "aria-label", "onClick"])
2070
+ ];
2071
+ }),
2072
+ default: C(({ model: f }) => [
2073
+ f ? (a(), _(et, {
2074
+ key: 0,
2075
+ nodes: B(o.value),
2076
+ theme: o.theme,
2077
+ "modal-theme": o.modalTheme,
2078
+ classes: o.classes
2079
+ }, null, 8, ["nodes", "theme", "modal-theme", "classes"])) : z("", !0)
2080
+ ]),
2081
+ _: 1
2082
+ }, 8, ["theme", "title", "target"])) : (a(), v("span", wl, P(o.value.join(", ")), 1))
2083
+ ], 64)) : (g = o.property) != null && g.createNode ? z("", !0) : (a(), v("span", Cl, "-"))
2084
+ ], 8, yl)) : typeof o.value == "object" && o.value !== null && Object.keys(o.value).length ? (a(), _(Be, {
2085
+ key: 1,
2086
+ class: "--txtSize",
2087
+ theme: o.modalTheme || o.theme,
2088
+ title: (L = o.property) == null ? void 0 : L.alias,
2089
+ target: o.modalTarget
2090
+ }, {
2091
+ toggle: C(({ setModel: f }) => [
2092
+ "name" in o.value ? (a(), _(ee, {
2093
+ key: 0,
2094
+ theme: o.theme,
2095
+ tooltip: l(m)("see_value"),
2096
+ "tooltip-as-text": "",
2097
+ "tooltip-position": "bottom",
2098
+ size: "sm",
2099
+ onClick: (V) => f()
2100
+ }, {
2101
+ default: C(() => [
2102
+ $(U, {
2103
+ name: "lemon",
2104
+ "force-regular": ""
2105
+ }),
2106
+ A("span", null, P(o.value.name), 1)
2107
+ ]),
2108
+ _: 2
2109
+ }, 1032, ["theme", "tooltip", "onClick"])) : (a(), _(le, {
2110
+ key: 1,
2111
+ theme: o.theme,
2112
+ tooltip: l(m)("see_value"),
2113
+ "tooltip-as-text": "",
2114
+ "tooltip-position": "bottom",
2115
+ size: "sm",
2116
+ round: "",
2117
+ onClick: (V) => f()
2118
+ }, {
2119
+ default: C(() => [
2120
+ $(U, { name: "lemon" }),
2121
+ $(U, {
2122
+ name: "lemon",
2123
+ "force-regular": ""
2124
+ })
2125
+ ]),
2126
+ _: 2
2127
+ }, 1032, ["theme", "tooltip", "onClick"]))
2128
+ ]),
2129
+ default: C(({ model: f }) => [
2130
+ f ? (a(), v("ul", {
2131
+ key: 0,
2132
+ class: j(["flx --flxColumn --minWidth-220 --txtSize-sm", o.classes])
2133
+ }, [
2134
+ (a(!0), v(K, null, se(u(o.value), ([V, S], n) => (a(), v("li", {
2135
+ key: n,
2136
+ class: "flx --flxColumn --flx-center-start --gap-5 --flx-fit"
2137
+ }, [
2138
+ A("span", {
2139
+ class: j(["--txtSize-xs", `--txtColor-${l(e)[0]}`])
2140
+ }, P(l(x).capitalize(l(x).startCase(V))), 3),
2141
+ $(h, M({
2142
+ value: S,
2143
+ node: o.node,
2144
+ property: {
2145
+ value: V,
2146
+ alias: l(x).capitalize(l(x).startCase(V))
2147
+ },
2148
+ readOnly: o.readOnly,
2149
+ theme: o.theme,
2150
+ modalTheme: o.modalTheme,
2151
+ modalTarget: o.modalTarget
2152
+ }, { class: o.classes }), null, 16, ["class"])
2153
+ ]))), 128))
2154
+ ], 2)) : z("", !0)
2155
+ ]),
2156
+ _: 1
2157
+ }, 8, ["theme", "title", "target"])) : (a(), _(Ze, X(M({ key: 2 }, { value: o.value, property: o.property, readOnly: o.readOnly, theme: o.theme, modalTheme: o.modalTheme, classes: o.classes, modalTarget: o.modalTarget })), null, 16));
2158
+ };
2159
+ }
2160
+ }), kl = /* @__PURE__ */ q({
2161
+ name: "BoxAction",
2162
+ inheritAttrs: !1,
2163
+ __name: "Action",
2164
+ props: {
2165
+ icon: {},
2166
+ iconProps: {},
2167
+ src: {},
2168
+ text: {},
2169
+ to: {},
2170
+ href: {},
2171
+ target: {},
2172
+ tel: {},
2173
+ disabled: { type: Boolean },
2174
+ mailto: {},
2175
+ type: {},
2176
+ tag: {},
2177
+ toggle: {},
2178
+ round: {},
2179
+ toggleState: {},
2180
+ indicative: {},
2181
+ whatsapp: { type: Boolean },
2182
+ download: {},
2183
+ hidden: {},
2184
+ size: {},
2185
+ active: { type: Boolean },
2186
+ invalid: { type: Boolean },
2187
+ state: {},
2188
+ theme: {},
2189
+ tooltip: {},
2190
+ tooltipPosition: {},
2191
+ tooltipAsText: { type: Boolean }
2192
+ },
2193
+ setup(p) {
2194
+ const t = p, { getClassesString: e } = O(Y), { modifiersClasses: m } = ie(t), { stateClasses: r } = de(t), { themeClasses: B, tooltipAttributes: s } = te(t), { themeClasses: u } = te({ theme: ve.LIGHT });
2195
+ return (o, d) => (a(), _(fe, M({ ...o.$attrs, ...t, ...l(s) }, {
2196
+ class: [l(e)([l(m), l(r), l(B)]), "box --button"]
2197
+ }), {
2198
+ default: C(() => [
2199
+ A("div", {
2200
+ class: j([l(e)([l(u)]), "box --square-sm"])
2201
+ }, [
2202
+ o.src ? (a(), _(Te, {
2203
+ key: 1,
2204
+ class: "--bgColor-light --width --height",
2205
+ src: o.src,
2206
+ alt: o.text
2207
+ }, null, 8, ["src", "alt"])) : (a(), _(U, X(M({ key: 0 }, { ...o.iconProps, name: o.icon ?? "cubes", size: 50 })), null, 16))
2208
+ ], 2),
2209
+ A("p", null, [
2210
+ A("b", null, P(o.text), 1)
2211
+ ])
2212
+ ]),
2213
+ _: 1
2214
+ }, 16, ["class"]));
2215
+ }
2216
+ }), $l = { class: "flx --flxRow --flx-center" }, _l = { class: "flx --flxRow --flx-center" }, Bl = {
2217
+ key: 0,
2218
+ class: "back --overlay is--active"
2219
+ }, We = /* @__PURE__ */ q({
2220
+ name: "LoaderContent",
2221
+ inheritAttrs: !1,
2222
+ __name: "Content",
2223
+ props: {
2224
+ content: { type: Boolean },
2225
+ loading: { type: Boolean },
2226
+ errors: { type: Boolean },
2227
+ noContentMessage: {},
2228
+ label: {},
2229
+ refresh: { type: Function },
2230
+ unwrap: { type: Boolean },
2231
+ el: {},
2232
+ loaderClasses: {},
2233
+ theme: {}
2234
+ },
2235
+ setup(p) {
2236
+ const { t } = O(Z);
2237
+ return (e, m) => (a(), _($e, {
2238
+ el: je,
2239
+ wrap: !e.unwrap,
2240
+ name: "fade",
2241
+ appear: ""
2242
+ }, {
2243
+ default: C(() => [
2244
+ !e.content || e.errors ? (a(), v("div", {
2245
+ key: 0,
2246
+ class: j(["flx --flxColumn --flx-center --width", e.loaderClasses])
2247
+ }, [
2248
+ e.loading ? (a(), _(Re, {
2249
+ key: 1,
2250
+ label: e.label,
2251
+ theme: e.theme
2252
+ }, null, 8, ["label", "theme"])) : (a(), v(K, { key: 0 }, [
2253
+ e.errors ? (a(), _(Se, {
2254
+ key: 0,
2255
+ theme: l(ve).DANGER
2256
+ }, {
2257
+ default: C(() => [
2258
+ A("div", $l, [
2259
+ A("span", null, P(l(t)("could_not_get_data")), 1),
2260
+ e.refresh ? (a(), _(le, {
2261
+ key: 0,
2262
+ theme: l(ve).DANGER,
2263
+ tooltip: l(t)("refresh"),
2264
+ round: "",
2265
+ onClick: m[0] || (m[0] = (r) => e.refresh())
2266
+ }, {
2267
+ default: C(() => [
2268
+ $(U, { name: "rotate-right" }),
2269
+ $(U, {
2270
+ name: "rotate-right",
2271
+ regular: ""
2272
+ })
2273
+ ]),
2274
+ _: 1
2275
+ }, 8, ["theme", "tooltip"])) : z("", !0)
2276
+ ])
2277
+ ]),
2278
+ _: 1
2279
+ }, 8, ["theme"])) : (a(), _(Se, {
2280
+ key: 1,
2281
+ theme: e.theme
2282
+ }, {
2283
+ default: C(() => [
2284
+ A("div", _l, [
2285
+ A("span", null, P(e.noContentMessage || l(t)("nothing_to_show")), 1),
2286
+ e.refresh ? (a(), _(le, {
2287
+ key: 0,
2288
+ theme: e.theme,
2289
+ tooltip: l(t)("refresh"),
2290
+ round: "",
2291
+ onClick: m[1] || (m[1] = (r) => e.refresh())
2292
+ }, {
2293
+ default: C(() => [
2294
+ $(U, { name: "rotate-right" }),
2295
+ $(U, {
2296
+ name: "rotate-right",
2297
+ regular: ""
2298
+ })
2299
+ ]),
2300
+ _: 1
2301
+ }, 8, ["theme", "tooltip"])) : z("", !0)
2302
+ ])
2303
+ ]),
2304
+ _: 1
2305
+ }, 8, ["theme"]))
2306
+ ], 64))
2307
+ ], 2)) : (a(), _($e, M({
2308
+ key: 1,
2309
+ wrap: !e.unwrap,
2310
+ el: e.el
2311
+ }, e.$attrs), {
2312
+ default: C(() => [
2313
+ e.loading ? (a(), v("div", Bl, [
2314
+ $(Re, {
2315
+ label: e.label,
2316
+ theme: e.theme
2317
+ }, null, 8, ["label", "theme"])
2318
+ ])) : z("", !0),
2319
+ G(e.$slots, "default")
2320
+ ]),
2321
+ _: 3
2322
+ }, 16, ["wrap", "el"]))
2323
+ ]),
2324
+ _: 3
2325
+ }, 8, ["wrap"]));
2326
+ }
2327
+ }), ge = /* @__PURE__ */ q({
2328
+ name: "LoaderContentFetch",
2329
+ inheritAttrs: !1,
2330
+ __name: "ContentFetch",
2331
+ props: {
2332
+ promise: { type: [Boolean, Function] },
2333
+ url: { type: [Boolean, String] },
2334
+ fallback: {},
2335
+ unwrap: { type: Boolean },
2336
+ payload: {},
2337
+ el: {},
2338
+ preventAutoload: { type: Boolean },
2339
+ theme: {}
2340
+ },
2341
+ emits: ["refresh"],
2342
+ setup(p, { emit: t }) {
2343
+ const e = p, m = t, r = H(!1), B = H(), s = H(), u = H(!1), o = H(!1), d = (b, y) => {
2344
+ if (s.value && !o.value)
2345
+ return o.value = !0;
2346
+ !e.preventAutoload && !u.value || (s.value = b, B.value = y);
2347
+ };
2348
+ async function h(b) {
2349
+ if (b && (s.value = b), !!(e.promise || e.url)) {
2350
+ try {
2351
+ if (r.value = !0, e.promise)
2352
+ s.value = await e.promise(d, ...e.payload || []);
2353
+ else if (e.url) {
2354
+ const y = await (await fetch(e.url)).json(), g = "data" in y ? y.data : y;
2355
+ if (y.error)
2356
+ throw new Error(y.error);
2357
+ g && (s.value = g);
2358
+ }
2359
+ B.value = void 0;
2360
+ } catch (y) {
2361
+ console.error(y), s.value = void 0, B.value = y;
2362
+ }
2363
+ u.value = !0, r.value = !1, m("refresh", h);
2364
+ }
2365
+ }
2366
+ return e.preventAutoload || h(e.fallback), pe(
2367
+ [() => e.url, () => e.promise],
2368
+ (b, y) => {
2369
+ const g = b[0] === y[0], L = b[1] === y[1], f = b[1] && y[1];
2370
+ g && L || f || (!r.value && (b[1] || b[0]) ? h() : e.fallback && (s.value = e.fallback));
2371
+ },
2372
+ { immediate: !1 }
2373
+ ), pe(
2374
+ () => e.preventAutoload,
2375
+ (b) => {
2376
+ !b && !u.value && h();
2377
+ },
2378
+ { immediate: !1 }
2379
+ ), pe(
2380
+ () => e.payload,
2381
+ (b, y) => {
2382
+ u.value && !x.isEqual(b, y) && h();
2383
+ },
2384
+ { immediate: !1 }
2385
+ ), (b, y) => (a(), _(We, X(ae({
2386
+ ...b.$attrs,
2387
+ content: !!s.value,
2388
+ errors: !!B.value,
2389
+ loading: r.value,
2390
+ refresh: h,
2391
+ unwrap: b.unwrap,
2392
+ theme: b.theme
2393
+ })), {
2394
+ default: C(() => [
2395
+ s.value ? G(b.$slots, "default", X(M({ key: 0 }, { content: s.value, refresh: h, loading: r.value, errors: B.value }))) : z("", !0)
2396
+ ]),
2397
+ _: 3
2398
+ }, 16));
2399
+ }
2400
+ }), Sl = {
2401
+ key: 0,
2402
+ class: "flx --flxRow-wrap --flx-center --gap-5 --gap:sm"
2403
+ }, Al = { key: 0 }, Vl = { class: "--txtSize-sm" }, Rl = { key: 1 }, zl = { class: "flx --flxRow-wrap --flx-center --gap-5 --gap:sm" }, Ll = { key: 0 }, Tl = { class: "--hidden-full:sm-inv" }, Pl = { class: "--hidden-full:sm-inv" }, lt = /* @__PURE__ */ q({
2404
+ name: "PaginationSimple",
2405
+ inheritAttrs: !1,
2406
+ __name: "Simple",
2407
+ props: {
2408
+ withRoute: { type: Boolean },
2409
+ hidePageLength: { type: Boolean },
2410
+ pagination: {},
2411
+ currentPage: {},
2412
+ theme: {}
2413
+ },
2414
+ setup(p) {
2415
+ var s;
2416
+ const t = p, { t: e } = O(Z), m = (s = De()) == null ? void 0 : s.appContext.config.globalProperties.$router;
2417
+ function r(u) {
2418
+ if (!m)
2419
+ return;
2420
+ const o = m.currentRoute.value;
2421
+ m.push({ path: o.path, query: { ...o.query, at: u } });
2422
+ }
2423
+ const B = T({
2424
+ get: () => {
2425
+ var u;
2426
+ return String((u = t.pagination) == null ? void 0 : u.first);
2427
+ },
2428
+ set(u) {
2429
+ if (!m)
2430
+ return;
2431
+ const o = m.currentRoute.value;
2432
+ m.push({ path: o.path, query: { first: u } });
2433
+ }
2434
+ });
2435
+ return (u, o) => {
2436
+ var d, h;
2437
+ return u.currentPage ? (a(), v("ul", Sl, [
2438
+ (d = u.pagination) != null && d.first ? (a(), v("li", Al, [
2439
+ A("p", Vl, P(l(e)("pagination_items", u.currentPage.totalCount)) + " ⋅ " + P(l(e)("pagination_pages", Math.ceil(u.currentPage.totalCount / ((h = u.pagination) == null ? void 0 : h.first)))), 1)
2440
+ ])) : z("", !0),
2441
+ u.withRoute ? (a(), v("li", Rl, [
2442
+ A("ul", zl, [
2443
+ !u.hidePageLength && u.currentPage.totalCount > 5 ? (a(), v("li", Ll, [
2444
+ $(he, {
2445
+ id: "order",
2446
+ modelValue: B.value,
2447
+ "onUpdate:modelValue": o[0] || (o[0] = (b) => B.value = b),
2448
+ theme: u.theme,
2449
+ class: "--maxWidthVw-60",
2450
+ name: "order",
2451
+ options: [5, 10, 25, 50, 100]
2452
+ }, null, 8, ["modelValue", "theme"])
2453
+ ])) : z("", !0),
2454
+ u.currentPage.totalCount > u.currentPage.edges.length ? (a(), v(K, { key: 1 }, [
2455
+ A("li", null, [
2456
+ $(le, {
2457
+ theme: u.theme,
2458
+ "aria-label": l(e)("previous"),
2459
+ disabled: !u.currentPage.pageInfo.hasPreviousPage,
2460
+ round: ":sm-inv",
2461
+ onClick: o[1] || (o[1] = (b) => {
2462
+ var y;
2463
+ return u.currentPage && r((y = u.currentPage.pageInfo) == null ? void 0 : y.previousCursor);
2464
+ })
2465
+ }, {
2466
+ default: C(() => [
2467
+ $(U, { name: "arrow-left" }),
2468
+ $(U, {
2469
+ name: "arrow-left",
2470
+ regular: ""
2471
+ }),
2472
+ A("span", Tl, P(l(e)("previous")), 1)
2473
+ ]),
2474
+ _: 1
2475
+ }, 8, ["theme", "aria-label", "disabled"])
2476
+ ]),
2477
+ A("li", null, [
2478
+ $(le, {
2479
+ theme: u.theme,
2480
+ "aria-label": l(e)("next"),
2481
+ disabled: !u.currentPage.pageInfo.hasNextPage,
2482
+ round: ":sm-inv",
2483
+ onClick: o[2] || (o[2] = (b) => {
2484
+ var y;
2485
+ return u.currentPage && r((y = u.currentPage.pageInfo) == null ? void 0 : y.nextCursor);
2486
+ })
2487
+ }, {
2488
+ default: C(() => [
2489
+ A("span", Pl, P(l(e)("next")), 1),
2490
+ $(U, { name: "arrow-right" }),
2491
+ $(U, {
2492
+ name: "arrow-left",
2493
+ regular: ""
2494
+ })
2495
+ ]),
2496
+ _: 1
2497
+ }, 8, ["theme", "aria-label", "disabled"])
2498
+ ])
2499
+ ], 64)) : z("", !0)
2500
+ ])
2501
+ ])) : z("", !0)
2502
+ ])) : z("", !0);
2503
+ };
2504
+ }
2505
+ }), El = /* @__PURE__ */ q({
2506
+ name: "PaginationContent",
2507
+ inheritAttrs: !1,
2508
+ __name: "Content",
2509
+ props: {
2510
+ page: {},
2511
+ withProps: { type: Boolean },
2512
+ withRoute: { type: Boolean },
2513
+ hideControls: { type: Boolean },
2514
+ preventAutoload: { type: Boolean },
2515
+ at: {},
2516
+ first: {},
2517
+ orderBy: {},
2518
+ theme: {}
2519
+ },
2520
+ setup(p) {
2521
+ var u;
2522
+ const t = p, e = me("xamu"), m = (u = De()) == null ? void 0 : u.appContext.config.globalProperties.$router, r = T(() => {
2523
+ const { orderBy: o, first: d, at: h } = t;
2524
+ return { orderBy: o, first: d || (e == null ? void 0 : e.first), at: h };
2525
+ }), B = T(() => {
2526
+ if (!m)
2527
+ return {};
2528
+ const o = m.currentRoute.value, d = { ...r.value }, [h, b] = Array.isArray(o.query.orderBy) ? o.query.orderBy : [], g = [h ?? "createdAt", b === "asc" || b === "desc" ? b : "desc"], L = o.query.first, f = o.query.at;
2529
+ if (d.orderBy = g, L && !Array.isArray(L) && (d.first = Number(L)), f && !Array.isArray(f)) {
2530
+ const V = Number(f);
2531
+ d.at = isNaN(V) ? f : V;
2532
+ }
2533
+ return d;
2534
+ }), s = T(() => {
2535
+ if (t.withProps)
2536
+ return r.value;
2537
+ if (t.withRoute)
2538
+ return B.value;
2539
+ });
2540
+ return (o, d) => (a(), _(ge, M({
2541
+ promise: o.page,
2542
+ payload: [s.value]
2543
+ }, { ...o.$attrs, preventAutoload: o.preventAutoload, theme: o.theme }), {
2544
+ default: C(({ content: h, refresh: b }) => [
2545
+ G(o.$slots, "default", X(ae({
2546
+ content: h.edges.map(({ node: y }) => y),
2547
+ pagination: s.value,
2548
+ currentPage: h,
2549
+ refresh: b
2550
+ }))),
2551
+ o.hideControls ? z("", !0) : (a(), _(lt, X(M({ key: 0 }, { pagination: s.value, currentPage: h, withRoute: o.withRoute, theme: o.theme })), null, 16))
2552
+ ]),
2553
+ _: 3
2554
+ }, 16, ["promise", "payload"]));
2555
+ }
2556
+ }), Il = /* @__PURE__ */ q({
2557
+ name: "InputColor",
2558
+ inheritAttrs: !1,
2559
+ __name: "Color",
2560
+ props: {
2561
+ type: {},
2562
+ autocomplete: {},
2563
+ id: {},
2564
+ name: {},
2565
+ placeholder: {},
2566
+ title: {},
2567
+ required: { type: Boolean },
2568
+ disabled: { type: Boolean },
2569
+ hidden: {},
2570
+ size: {},
2571
+ active: { type: Boolean },
2572
+ invalid: { type: Boolean },
2573
+ state: {},
2574
+ theme: {}
2575
+ },
2576
+ setup(p) {
2577
+ const t = p, { getClassesString: e } = O(Y), { modifiersClasses: m } = ie(t), { stateClasses: r } = de(t), { themeClasses: B } = te(t);
2578
+ return (s, u) => (a(), _(Ae, M({
2579
+ type: "color",
2580
+ disabled: s.disabled,
2581
+ class: l(e)([l(m), l(r), l(B), "iColor"])
2582
+ }, s.$attrs), null, 16, ["disabled", "class"]));
2583
+ }
2584
+ }), Nl = {
2585
+ key: 1,
2586
+ class: "--txtColor-danger"
2587
+ }, Ue = /* @__PURE__ */ q({
2588
+ name: "FormInputOptions",
2589
+ inheritAttrs: !0,
2590
+ __name: "InputOptions",
2591
+ props: {
2592
+ input: {}
2593
+ },
2594
+ setup(p) {
2595
+ const { t } = O(Z);
2596
+ return (e, m) => {
2597
+ var r;
2598
+ return (r = e.input.options) != null && r.length ? G(e.$slots, "default", X(M({ key: 0 }, { options: e.input.options.map(l(ke)) }))) : (a(), v("p", Nl, P(l(t)("form_required_options")), 1));
2599
+ };
2600
+ }
2601
+ }), Ul = {
2602
+ key: 0,
2603
+ class: "flx --flxColumn --flxRow-wrap:md --flx-start-stretch --gap-5 --flx"
2604
+ }, Ml = {
2605
+ key: 1,
2606
+ class: "--txtColor-danger"
2607
+ }, Ce = /* @__PURE__ */ q({
2608
+ name: "FormInputNValues",
2609
+ inheritAttrs: !0,
2610
+ __name: "InputNValues",
2611
+ props: {
2612
+ model: {},
2613
+ values: {}
2614
+ },
2615
+ setup(p) {
2616
+ const t = p, { t: e } = O(Z), m = T(() => t.values.some((r) => Array.isArray(t.model) && t.model.length === r));
2617
+ return (r, B) => Array.isArray(r.model) && m.value ? (a(), v("div", Ul, [
2618
+ G(r.$slots, "default")
2619
+ ])) : (a(), v("p", Ml, P(r.values.map((s) => l(e)("form_requires_n_values", s)).join(" | ")), 1));
2620
+ }
2621
+ });
2622
+ function at({ input: p }) {
2623
+ const { t, tet: e } = O(Z);
2624
+ function m() {
2625
+ switch (p.type) {
2626
+ case F.EMAIL:
2627
+ return t("form_use_valid_email");
2628
+ case F.PHONE:
2629
+ return t("form_use_valid_phone");
2630
+ case F.CELLPHONE:
2631
+ return t("form_use_valid_cellphone");
2632
+ case F.NEW_PASSWORD:
2633
+ return t("form_unmatching_passwords");
2634
+ default:
2635
+ return t("form_invalid_data");
2636
+ }
2637
+ }
2638
+ function r() {
2639
+ switch (p.type) {
2640
+ case F.PASSWORD:
2641
+ return "password";
2642
+ case F.EMAIL:
2643
+ return "email";
2644
+ case F.NUMBER:
2645
+ return "number";
2646
+ case F.PHONE:
2647
+ case F.CELLPHONE:
2648
+ return "tel";
2649
+ default:
2650
+ return "text";
2651
+ }
2652
+ }
2653
+ function B(u = 0) {
2654
+ const o = (d) => p.placeholder ? `${e(p.placeholder).replace("...", "")}...` : `${t(d)}...`;
2655
+ switch (p.type) {
2656
+ case F.LOCATION:
2657
+ return [o("form_country"), o("form_state"), o("form_city")][u];
2658
+ case F.NEW_PASSWORD:
2659
+ return [o("form_desired_password"), o("form_confirm_password")][u];
2660
+ case F.PASSWORD:
2661
+ return [o("form_password")][u];
2662
+ case F.EMAIL:
2663
+ return [o("form_email")][u];
2664
+ case F.PHONE:
2665
+ return [o("form_phone_line")][u];
2666
+ case F.CELLPHONE:
2667
+ return [o("form_cellphone")][u];
2668
+ case F.ID:
2669
+ return [o("form_id_number")][u];
2670
+ default:
2671
+ return [o("form_complete_the_field")][u];
2672
+ }
2673
+ }
2674
+ function s() {
2675
+ if (p.autocomplete)
2676
+ return p.autocomplete;
2677
+ switch (p.type) {
2678
+ case F.NEW_PASSWORD:
2679
+ return "new-password";
2680
+ case F.PASSWORD:
2681
+ return "current-password";
2682
+ case F.EMAIL:
2683
+ return "email";
2684
+ case F.PHONE:
2685
+ return "tel-local";
2686
+ case F.CELLPHONE:
2687
+ return "tel-national";
2688
+ default:
2689
+ return "on";
2690
+ }
2691
+ }
2692
+ return {
2693
+ getInputError: m,
2694
+ getInputAutocomplete: s,
2695
+ getInputPlaceholder: B,
2696
+ getInputTextType: r
2697
+ };
2698
+ }
2699
+ const Ol = { class: "flx --flxRow --flx-start-center --gap-5" }, Fl = {
2700
+ key: 0,
2701
+ class: "--txtColor-danger --txtSize-sm"
2702
+ }, Dl = /* @__PURE__ */ q({
2703
+ name: "FormInputLoop",
2704
+ inheritAttrs: !0,
2705
+ __name: "InputLoop",
2706
+ props: {
2707
+ input: {},
2708
+ models: {},
2709
+ theme: {}
2710
+ },
2711
+ setup(p) {
2712
+ const t = p, { t: e } = O(Z), { isValidValue: m, notEmptyValue: r } = O(Ke).utils, { getInputError: B } = at(t);
2713
+ return (s, u) => (a(), v(K, null, [
2714
+ (a(!0), v(K, null, se(s.models, (o, d) => {
2715
+ var h, b, y, g;
2716
+ return a(), v("div", {
2717
+ key: ((b = (h = s.input.defaults) == null ? void 0 : h[d]) == null ? void 0 : b.placeholder) || ((g = (y = s.input.defaults) == null ? void 0 : y[d]) == null ? void 0 : g.type) || d,
2718
+ class: "--width"
2719
+ }, [
2720
+ A("div", Ol, [
2721
+ G(s.$slots, "default", X(ae({ i: d }))),
2722
+ s.input.multiple && s.input.min < s.input.values.length ? (a(), _(ee, {
2723
+ key: 0,
2724
+ "aria-label": l(e)("clear"),
2725
+ theme: s.theme,
2726
+ onClick: (L) => s.input.removeValue(d)
2727
+ }, {
2728
+ default: C(() => [
2729
+ $(U, {
2730
+ name: "trash-can",
2731
+ size: "20"
2732
+ })
2733
+ ]),
2734
+ _: 2
2735
+ }, 1032, ["aria-label", "theme", "onClick"])) : z("", !0)
2736
+ ]),
2737
+ l(r)(o.value, s.input.defaults) && !l(m)(o.value, s.input) ? (a(), v("p", Fl, P(l(B)()), 1)) : z("", !0)
2738
+ ]);
2739
+ }), 128)),
2740
+ s.input.multiple && s.input.max > s.models.length ? (a(), _(re, {
2741
+ key: 0,
2742
+ "aria-label": l(e)("add"),
2743
+ theme: s.theme,
2744
+ onClick: u[0] || (u[0] = (o) => s.input.addValue())
2745
+ }, {
2746
+ default: C(() => [
2747
+ ne(P(l(e)("add")), 1)
2748
+ ]),
2749
+ _: 1
2750
+ }, 8, ["aria-label", "theme"])) : z("", !0)
2751
+ ], 64));
2752
+ }
2753
+ });
2754
+ function ot() {
2755
+ const { lang: p } = me("xamu") || {};
2756
+ function t(m = {}) {
2757
+ return new URLSearchParams({ ...m, ...p && p !== "en" ? { lang: p } : {} });
2758
+ }
2759
+ function e(m) {
2760
+ return (r, ...B) => m(...B);
2761
+ }
2762
+ return {
2763
+ getUrlParams: t,
2764
+ unHydrate: e
2765
+ };
2766
+ }
2767
+ function qe() {
2768
+ const { country: p } = me("xamu") || {}, { getUrlParams: t } = ot(), e = "https://countries.xamu.com.co/api/v1", m = {};
2769
+ async function r() {
2770
+ const d = `${e}?${t()}`, { data: h, error: b } = await (await fetch(d)).json();
2771
+ if (b)
2772
+ throw new Error(b);
2773
+ return h;
2774
+ }
2775
+ async function B(d) {
2776
+ if (!d)
2777
+ throw new Error("A valid country is required");
2778
+ const h = `${e}/${d}?${t({ states: "" })}`, { data: b, error: y } = await (await fetch(h)).json();
2779
+ if (y)
2780
+ throw new Error(y);
2781
+ return b;
2782
+ }
2783
+ async function s(d) {
2784
+ return (await B(d)).states;
2785
+ }
2786
+ async function u(d, h) {
2787
+ if (!d || !h)
2788
+ throw new Error("A valid country and state are required");
2789
+ const b = `${e}/${d}/${h}?${t({ cities: "" })}`, { data: y, error: g } = await (await fetch(b)).json();
2790
+ if (g)
2791
+ throw new Error(g);
2792
+ return y;
2793
+ }
2794
+ async function o(d, h) {
2795
+ return (await u(d, h)).cities;
2796
+ }
2797
+ return {
2798
+ defaultCountry: p,
2799
+ fallbackCountry: m,
2800
+ getCountries: r,
2801
+ getCountry: B,
2802
+ getCountryStates: s,
2803
+ getState: u,
2804
+ getStateCities: o
2805
+ };
2806
+ }
2807
+ const Wl = /* @__PURE__ */ q({
2808
+ name: "FormInputCountriesApi",
2809
+ inheritAttrs: !0,
2810
+ __name: "InputCountriesAPI",
2811
+ props: {
2812
+ model: {},
2813
+ states: {},
2814
+ theme: {}
2815
+ },
2816
+ setup(p) {
2817
+ const t = p, { unHydrate: e } = ot(), { defaultCountry: m, getCountryStates: r, getStateCities: B } = qe(), s = T(() => t.model[0] || m || "");
2818
+ return (u, o) => (a(), _(Ce, {
2819
+ model: u.model,
2820
+ values: [1, 3]
2821
+ }, {
2822
+ default: C(() => [
2823
+ $(ge, {
2824
+ theme: u.theme,
2825
+ promise: !u.states && !!s.value && l(e)(l(r)),
2826
+ payload: [s.value],
2827
+ fallback: [],
2828
+ unwrap: ""
2829
+ }, {
2830
+ default: C((d) => [
2831
+ $(ge, {
2832
+ theme: u.theme,
2833
+ promise: !!(s.value && u.model[0]) && u.model[0] !== u.model[0] && !!(d.content.length || u.states) && l(e)(l(B)),
2834
+ payload: [s.value, u.model[1]],
2835
+ fallback: [],
2836
+ unwrap: ""
2837
+ }, {
2838
+ default: C((h) => [
2839
+ G(u.$slots, "default", X(ae({ statesReq: d, citiesReq: h })))
2840
+ ]),
2841
+ _: 2
2842
+ }, 1032, ["theme", "promise", "payload"])
2843
+ ]),
2844
+ _: 3
2845
+ }, 8, ["theme", "promise", "payload"])
2846
+ ]),
2847
+ _: 3
2848
+ }, 8, ["model"]));
2849
+ }
2850
+ }), ql = { class: "flx --flxColumn --flx-start --gap-5" }, Hl = {
2851
+ key: 0,
2852
+ class: "flx --flxRow-wrap --flx-center --flx-start-center:md --maxWidth-440"
2853
+ }, jl = {
2854
+ key: 0,
2855
+ class: "flx --flxColumn --flxRow-wrap:md --flx-start-stretch --flx"
2856
+ }, Gl = {
2857
+ key: 1,
2858
+ class: "flx --flxColumn --flxRow-wrap:md --flx-start-stretch --gap-5 --flx"
2859
+ }, Kl = /* @__PURE__ */ A("p", null, "Schedule Component Here", -1), Ql = {
2860
+ key: 6,
2861
+ class: "--flx"
2862
+ }, Xl = {
2863
+ key: 0,
2864
+ class: "--txtSize-sm --txtWeight --txtWrap"
2865
+ }, Yl = {
2866
+ key: 3,
2867
+ class: "--txtColor-danger --txtSize-sm"
2868
+ }, st = /* @__PURE__ */ q({
2869
+ name: "FormInput",
2870
+ inheritAttrs: !1,
2871
+ __name: "Input",
2872
+ props: {
2873
+ modelValue: {},
2874
+ input: {},
2875
+ invalid: {},
2876
+ countries: {},
2877
+ states: {},
2878
+ theme: {}
2879
+ },
2880
+ emits: ["update:model-value"],
2881
+ setup(p, { emit: t }) {
2882
+ const e = p, m = t, { t: r, tet: B } = O(Z), { isValidFormInputValue: s, notEmptyValue: u } = O(Ke).utils, { getInputPlaceholder: o, getInputAutocomplete: d, getInputTextType: h } = at(e), { defaultCountry: b } = qe(), y = T(() => (e.countries || []).map(({ code: c, name: I }) => ({ value: c, alias: I }))), g = T(() => (e.countries || []).map(({ name: c, code: I, indicative: N }) => ({
2883
+ value: I + N,
2884
+ alias: c
2885
+ }))), L = T(() => {
2886
+ var c;
2887
+ return (c = e.states) == null ? void 0 : c.map(({ code: I, name: N }) => ({ value: I, alias: N }));
2888
+ }), f = T(() => e.input.values.every((I) => u(I, e.input.defaults))), V = T(() => {
2889
+ const c = e.input.values, I = !!e.invalid && x.isEqual(e.invalid.invalidValue, c), N = f.value && !s(e.input);
2890
+ return I || N;
2891
+ }), S = T(() => {
2892
+ var N;
2893
+ const [c, I] = ((N = e.input) == null ? void 0 : N.icon) || [];
2894
+ return {
2895
+ ...x.omit(e.input, ["type"]),
2896
+ invalid: V.value,
2897
+ autocomplete: d(),
2898
+ icon: c,
2899
+ iconProps: I
2900
+ };
2901
+ }), n = T(() => e.modelValue.map(
2902
+ (c, I) => T({
2903
+ get: () => c,
2904
+ set: (N) => {
2905
+ m("update:model-value", e.modelValue.toSpliced(I, 1, N));
2906
+ }
2907
+ })
2908
+ ));
2909
+ function D(c) {
2910
+ if (e.input.multiple)
2911
+ if (e.modelValue.includes(c)) {
2912
+ const I = e.modelValue.indexOf(c);
2913
+ I > -1 && e.input.removeValue(I);
2914
+ } else
2915
+ e.input.addValue(c);
2916
+ else
2917
+ n.value[0].value = c;
2918
+ }
2919
+ function W(c) {
2920
+ return { value: c.code, alias: c.name };
2921
+ }
2922
+ function J(c) {
2923
+ return { value: c.name };
2924
+ }
2925
+ return (c, I) => {
2926
+ const N = Ge("Input", !0);
2927
+ return a(), v("div", ql, [
2928
+ !c.input.defaults && c.input.type === l(F).CHOICE ? (a(), _(Ue, {
2929
+ key: 0,
2930
+ input: c.input
2931
+ }, {
2932
+ default: C(({ options: i }) => {
2933
+ var R;
2934
+ return [
2935
+ (R = c.input.options) != null && R.length ? (a(), v("div", Hl, [
2936
+ (a(!0), v(K, null, se(i, (w, k) => (a(), _(ye(c.input.multiple ? le : re), {
2937
+ key: k,
2938
+ size: "md",
2939
+ theme: c.theme,
2940
+ "aria-label": w.alias || w.value,
2941
+ active: c.modelValue.includes(w.value),
2942
+ disabled: !c.input.multiple && c.modelValue.includes(w.value),
2943
+ onClick: (E) => D(w.value)
2944
+ }, {
2945
+ default: C(() => [
2946
+ A("span", null, P(w.alias || w.value), 1),
2947
+ w.icon ? (a(), v(K, { key: 0 }, [
2948
+ $(U, {
2949
+ name: w.icon
2950
+ }, null, 8, ["name"]),
2951
+ c.input.multiple ? (a(), _(U, {
2952
+ key: 0,
2953
+ name: w.icon,
2954
+ regular: ""
2955
+ }, null, 8, ["name"])) : z("", !0)
2956
+ ], 64)) : w.pattern ? (a(), v("figure", {
2957
+ key: 1,
2958
+ class: "avatar --size-xs --bdr --bdrColor-light",
2959
+ style: Ve(
2960
+ l(be).isURL(w.pattern) ? { backgroundImage: `url('${w.pattern}')` } : { backgroundColor: w.pattern }
2961
+ )
2962
+ }, null, 4)) : z("", !0)
2963
+ ]),
2964
+ _: 2
2965
+ }, 1032, ["theme", "aria-label", "active", "disabled", "onClick"]))), 128))
2966
+ ])) : z("", !0)
2967
+ ];
2968
+ }),
2969
+ _: 1
2970
+ }, 8, ["input"])) : !c.input.defaults && c.input.type === l(F).FILE ? (a(), _(Je, {
2971
+ key: 1,
2972
+ theme: c.theme,
2973
+ class: "--flx",
2974
+ min: c.input.min,
2975
+ max: c.input.max,
2976
+ "file-prefix": l(x).snakeCase(c.input.placeholder),
2977
+ "model-value": c.modelValue,
2978
+ "onUpdate:modelValue": I[0] || (I[0] = (i) => c.$emit("update:model-value", i))
2979
+ }, null, 8, ["theme", "min", "max", "file-prefix", "model-value"])) : (a(), _(Dl, {
2980
+ key: 2,
2981
+ models: n.value,
2982
+ input: c.input,
2983
+ theme: c.theme
2984
+ }, {
2985
+ default: C(({ i }) => [
2986
+ c.input.defaults && c.input.defaults.length >= 2 ? (a(), v("div", jl, [
2987
+ (a(!0), v(K, null, se(n.value[i].value, (R, w) => {
2988
+ var k, E;
2989
+ return a(), _(N, {
2990
+ key: ((k = c.input.defaults) == null ? void 0 : k[w].placeholder) || ((E = c.input.defaults) == null ? void 0 : E[w].type) || w,
2991
+ input: c.input.setRerender(c.$forceUpdate).clone({
2992
+ ...c.input.defaults[w],
2993
+ // sub input
2994
+ multiple: !1,
2995
+ defaults: void 0,
2996
+ values: [n.value[i].value[w]]
2997
+ }),
2998
+ theme: c.theme,
2999
+ class: "--width-180 --flx",
3000
+ invalid: c.invalid,
3001
+ "model-value": [R],
3002
+ "onUpdate:modelValue": (Q) => n.value[i].value = n.value[i].value.toSpliced(w, 1, Q[0])
3003
+ }, null, 8, ["input", "theme", "invalid", "model-value", "onUpdate:modelValue"]);
3004
+ }), 128))
3005
+ ])) : c.input.type === l(F).NEW_PASSWORD ? (a(), _(Ce, {
3006
+ key: 1,
3007
+ model: n.value[i].value,
3008
+ values: [2]
3009
+ }, {
3010
+ default: C(() => [
3011
+ $(ce, M({
3012
+ modelValue: n.value[i].value[0],
3013
+ "onUpdate:modelValue": (R) => n.value[i].value[0] = R
3014
+ }, S.value, {
3015
+ theme: c.theme,
3016
+ placeholder: l(o)(),
3017
+ type: "password",
3018
+ class: "--width-180 --flx"
3019
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder"]),
3020
+ $(ce, M({
3021
+ modelValue: n.value[i].value[1],
3022
+ "onUpdate:modelValue": (R) => n.value[i].value[1] = R
3023
+ }, S.value, {
3024
+ theme: c.theme,
3025
+ placeholder: l(o)(),
3026
+ type: "password",
3027
+ class: "--width-180 --flx"
3028
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder"])
3029
+ ]),
3030
+ _: 2
3031
+ }, 1032, ["model"])) : c.input.type === l(F).ID ? (a(), _(Ce, {
3032
+ key: 2,
3033
+ model: n.value[i].value,
3034
+ values: [2]
3035
+ }, {
3036
+ default: C(() => [
3037
+ $(he, M({
3038
+ modelValue: n.value[i].value[0],
3039
+ "onUpdate:modelValue": (R) => n.value[i].value[0] = R
3040
+ }, { options: c.input.options, theme: c.theme }, { class: "--width-180 --flx" }), null, 16, ["modelValue", "onUpdate:modelValue"]),
3041
+ $(ce, M({
3042
+ modelValue: n.value[i].value[1],
3043
+ "onUpdate:modelValue": (R) => n.value[i].value[1] = R
3044
+ }, S.value, {
3045
+ theme: c.theme,
3046
+ placeholder: l(o)(),
3047
+ type: "number",
3048
+ class: "--width-180 --flx"
3049
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder"])
3050
+ ]),
3051
+ _: 2
3052
+ }, 1032, ["model"])) : c.input.type === l(F).PHONE || c.input.type === l(F).CELLPHONE ? (a(), _(Ce, {
3053
+ key: 3,
3054
+ model: n.value[i].value,
3055
+ values: [2]
3056
+ }, {
3057
+ default: C(() => [
3058
+ $(he, {
3059
+ modelValue: n.value[i].value[0],
3060
+ "onUpdate:modelValue": (R) => n.value[i].value[0] = R,
3061
+ theme: c.theme,
3062
+ options: g.value,
3063
+ class: "--width-180 --flx"
3064
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "theme", "options"]),
3065
+ $(ce, M({
3066
+ modelValue: n.value[i].value[1],
3067
+ "onUpdate:modelValue": (R) => n.value[i].value[1] = R
3068
+ }, S.value, {
3069
+ theme: c.theme,
3070
+ placeholder: l(o)(),
3071
+ type: "tel",
3072
+ class: "--width-180 --flx"
3073
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder"])
3074
+ ]),
3075
+ _: 2
3076
+ }, 1032, ["model"])) : c.input.type === l(F).LOCATION ? (a(), _(Wl, {
3077
+ key: 4,
3078
+ states: L.value,
3079
+ model: n.value[i].value,
3080
+ values: [1, 3]
3081
+ }, {
3082
+ default: C(({ statesReq: R, citiesReq: w }) => [
3083
+ !l(b) || n.value[i].value.length === 1 ? (a(), _(we, {
3084
+ key: 0,
3085
+ modelValue: n.value[i].value[0],
3086
+ "onUpdate:modelValue": (k) => n.value[i].value[0] = k,
3087
+ options: y.value,
3088
+ value: l(b),
3089
+ icon: "earth-americas",
3090
+ theme: c.theme,
3091
+ placeholder: l(o)(),
3092
+ class: "--width-180 --flx"
3093
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "value", "theme", "placeholder"])) : z("", !0),
3094
+ n.value[i].value.length === 3 ? (a(), v("div", Gl, [
3095
+ $(we, {
3096
+ modelValue: n.value[i].value[1],
3097
+ "onUpdate:modelValue": (k) => n.value[i].value[1] = k,
3098
+ options: L.value || (R.loading || R.content.length ? R.content.map(W) : [n.value[i].value[0] || l(b)]),
3099
+ icon: "mountain-sun",
3100
+ theme: c.theme,
3101
+ disabled: !(n.value[i].value[0] || l(b)),
3102
+ placeholder: l(o)(1),
3103
+ class: "--width-180 --flx"
3104
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "theme", "disabled", "placeholder"]),
3105
+ $(we, {
3106
+ modelValue: n.value[i].value[2],
3107
+ "onUpdate:modelValue": (k) => n.value[i].value[2] = k,
3108
+ options: w.loading || w.content.length ? w.content.map(J) : [n.value[i].value[1]],
3109
+ icon: "city",
3110
+ theme: c.theme,
3111
+ disabled: !n.value[i].value[1],
3112
+ placeholder: l(o)(2),
3113
+ class: "--width-180 --flx"
3114
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "theme", "disabled", "placeholder"])
3115
+ ])) : z("", !0)
3116
+ ]),
3117
+ _: 2
3118
+ }, 1032, ["states", "model"])) : c.input.type === l(F).SCHEDULE ? (a(), _(Ce, {
3119
+ key: 5,
3120
+ model: n.value[i].value,
3121
+ values: []
3122
+ }, {
3123
+ default: C(() => [
3124
+ Kl
3125
+ ]),
3126
+ _: 2
3127
+ }, 1032, ["model"])) : c.input.type === l(F).BOOLEAN ? (a(), v("label", Ql, [
3128
+ $(Se, {
3129
+ theme: c.theme,
3130
+ class: "--txtAlign"
3131
+ }, {
3132
+ default: C(() => [
3133
+ $(_e, M({
3134
+ modelValue: n.value[i].value,
3135
+ "onUpdate:modelValue": (R) => n.value[i].value = R
3136
+ }, S.value, {
3137
+ placeholder: l(o)(),
3138
+ type: "checkbox",
3139
+ theme: c.theme,
3140
+ "full-width": "",
3141
+ "show-placeholder": ""
3142
+ }), {
3143
+ default: C(() => [
3144
+ c.input.placeholder ? (a(), v("p", Xl, P(l(B)(c.input.placeholder)), 1)) : z("", !0)
3145
+ ]),
3146
+ _: 2
3147
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "theme"])
3148
+ ]),
3149
+ _: 2
3150
+ }, 1032, ["theme"])
3151
+ ])) : c.input.type === l(F).SELECT ? (a(), _(Ue, {
3152
+ key: 7,
3153
+ input: c.input
3154
+ }, {
3155
+ default: C(({ options: R }) => [
3156
+ $(he, M({
3157
+ modelValue: n.value[i].value,
3158
+ "onUpdate:modelValue": (w) => n.value[i].value = w
3159
+ }, S.value, {
3160
+ theme: c.theme,
3161
+ placeholder: c.input.placeholder,
3162
+ options: R,
3163
+ class: "--flx"
3164
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder", "options"])
3165
+ ]),
3166
+ _: 2
3167
+ }, 1032, ["input"])) : c.input.type === l(F).SELECT_FILTER ? (a(), _(Ue, {
3168
+ key: 8,
3169
+ input: c.input
3170
+ }, {
3171
+ default: C(({ options: R }) => [
3172
+ $(we, M({
3173
+ modelValue: n.value[i].value,
3174
+ "onUpdate:modelValue": (w) => n.value[i].value = w
3175
+ }, S.value, {
3176
+ theme: c.theme,
3177
+ placeholder: c.input.placeholder,
3178
+ options: R,
3179
+ class: "--flx"
3180
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder", "options"])
3181
+ ]),
3182
+ _: 2
3183
+ }, 1032, ["input"])) : c.input.type === l(F).COLOR ? (a(), _(Il, M({
3184
+ key: 9,
3185
+ modelValue: n.value[i].value,
3186
+ "onUpdate:modelValue": (R) => n.value[i].value = R
3187
+ }, S.value, { theme: c.theme }), null, 16, ["modelValue", "onUpdate:modelValue", "theme"])) : (a(), _(ce, M({
3188
+ key: 10,
3189
+ modelValue: n.value[i].value,
3190
+ "onUpdate:modelValue": (R) => n.value[i].value = R
3191
+ }, {
3192
+ ...S.value,
3193
+ ...c.input.type === l(F).LONGTEXT ? { textarea: !0 } : { type: l(h)() }
3194
+ }, {
3195
+ theme: c.theme,
3196
+ placeholder: l(o)(),
3197
+ class: "--flx"
3198
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "theme", "placeholder"]))
3199
+ ]),
3200
+ _: 1
3201
+ }, 8, ["models", "input", "theme"])),
3202
+ c.input.required && !f.value && V.value ? (a(), v("p", Yl, P(l(r)("form_required_field")), 1)) : z("", !0)
3203
+ ]);
3204
+ };
3205
+ }
3206
+ }), Jl = { key: 0 }, Zl = {
3207
+ key: 0,
3208
+ class: "--txtSize-sm"
3209
+ }, nt = /* @__PURE__ */ q({
3210
+ name: "FormSimple",
3211
+ inheritAttrs: !0,
3212
+ __name: "Simple",
3213
+ props: {
3214
+ title: {},
3215
+ modelValue: {},
3216
+ noForm: { type: Boolean },
3217
+ invalid: {},
3218
+ make: {},
3219
+ theme: {}
3220
+ },
3221
+ emits: ["update:invalid", "update:model-value"],
3222
+ setup(p, { emit: t }) {
3223
+ const e = p, m = t, { t: r, tet: B } = O(Z), { defaultCountry: s, getCountries: u, getCountryStates: o } = qe(), d = T(() => {
3224
+ var f;
3225
+ return (f = e.modelValue) == null ? void 0 : f.some(({ type: V }) => V === F.LOCATION);
3226
+ }), h = T(() => {
3227
+ var f;
3228
+ return (f = e.modelValue) == null ? void 0 : f.some(({ type: V }) => V === F.CELLPHONE || V === F.PHONE);
3229
+ });
3230
+ function b(f, V) {
3231
+ var S, n;
3232
+ y.value[f].values = V, m("update:model-value", (S = e.modelValue) == null ? void 0 : S.toSpliced(f, 1, y.value[f])), (n = e.invalid) != null && n.length && m(
3233
+ "update:invalid",
3234
+ e.invalid.filter(({ invalidValue: D, name: W }) => y.value[f].name !== W || x.isEqual(D, V))
3235
+ );
3236
+ }
3237
+ const y = T(
3238
+ () => (e.modelValue || []).filter(({ type: f, options: V, required: S }) => !((Ee.SELECT === f || Ee.SELECT_FILTER === f || Ee.CHOICE === f) && !(V != null && V.length) && !S))
3239
+ );
3240
+ function g({ type: f, title: V, required: S }) {
3241
+ if (V)
3242
+ V = B(V);
3243
+ else
3244
+ switch (f) {
3245
+ case F.LOCATION:
3246
+ V = r("form_location");
3247
+ break;
3248
+ case F.NEW_PASSWORD:
3249
+ V = r("form_desired_password");
3250
+ break;
3251
+ case F.PASSWORD:
3252
+ V = r("form_password");
3253
+ break;
3254
+ case F.ID:
3255
+ V = r("form_id_number");
3256
+ break;
3257
+ case F.PHONE:
3258
+ V = r("form_phone_line");
3259
+ break;
3260
+ case F.CELLPHONE:
3261
+ V = r("form_cellphone");
3262
+ break;
3263
+ case F.EMAIL:
3264
+ V = r("form_email");
3265
+ break;
3266
+ }
3267
+ return S && V && (V += "*"), V || "";
3268
+ }
3269
+ function L(f) {
3270
+ var V;
3271
+ return (V = e.invalid) == null ? void 0 : V.find((S) => S.name === f);
3272
+ }
3273
+ return pe(
3274
+ () => e.make,
3275
+ (f, V) => {
3276
+ !V || f != null && f.every((S, n) => S.isEqual(V[n])) || m("update:model-value", f);
3277
+ },
3278
+ { immediate: !0 }
3279
+ ), (f, V) => (a(), _(ge, {
3280
+ theme: f.theme,
3281
+ promise: (d.value && !l(s) || h.value) && l(u),
3282
+ class: "flx --flxColumn --flx-start-stretch --gap-10 --maxWidth-full",
3283
+ fallback: [],
3284
+ el: f.noForm ? "fieldset" : "form"
3285
+ }, {
3286
+ default: C((S) => [
3287
+ $(ge, {
3288
+ theme: f.theme,
3289
+ promise: d.value && !!l(s) && (() => l(o)(l(s) || "")),
3290
+ fallback: [],
3291
+ unwrap: ""
3292
+ }, {
3293
+ default: C((n) => [
3294
+ f.title ? (a(), v("legend", Jl, [
3295
+ A("h4", null, P(f.title) + ":", 1)
3296
+ ])) : z("", !0),
3297
+ (a(!0), v(K, null, se(y.value, (D, W) => (a(), v("div", {
3298
+ key: W,
3299
+ class: "flx --flxColumn --flx-start-stretch --gap-5"
3300
+ }, [
3301
+ g(D) ? (a(), v("p", Zl, P(g(D)), 1)) : z("", !0),
3302
+ $(st, {
3303
+ theme: f.theme,
3304
+ input: D,
3305
+ invalid: L(D.name),
3306
+ countries: S.content,
3307
+ states: d.value && !!l(s) && n.content || void 0,
3308
+ "model-value": y.value[W].values,
3309
+ "onUpdate:modelValue": (J) => b(W, J)
3310
+ }, null, 8, ["theme", "input", "invalid", "countries", "states", "model-value", "onUpdate:modelValue"])
3311
+ ]))), 128))
3312
+ ]),
3313
+ _: 2
3314
+ }, 1032, ["theme", "promise"])
3315
+ ]),
3316
+ _: 1
3317
+ }, 8, ["theme", "promise", "el"]));
3318
+ }
3319
+ }), xl = { class: "flx --flxColumn --gap-30" }, ea = {
3320
+ key: 0,
3321
+ class: "flx --flxColumn"
3322
+ }, ta = { class: "--txtSize-xs" }, la = { class: "flx --flxRow --flx-end-center --width" }, aa = {
3323
+ key: 0,
3324
+ class: "flx --flxRow --flx-start-center --flx --gap-5 --gap:md"
3325
+ }, oa = { class: "--hidden-full:sm-inv" }, sa = { class: "--hidden-full:sm-inv" }, na = /* @__PURE__ */ q({
3326
+ name: "FormStages",
3327
+ inheritAttrs: !0,
3328
+ __name: "Stages",
3329
+ props: {
3330
+ submitLabel: {},
3331
+ stages: {},
3332
+ showConformity: { type: Boolean },
3333
+ hideRequiredDisclaimer: { type: Boolean },
3334
+ stagesClasses: {},
3335
+ submitFn: { type: Function },
3336
+ theme: {}
3337
+ },
3338
+ emits: ["inputValues", "submited", "update:activeStage"],
3339
+ setup(p, { emit: t }) {
3340
+ const e = p, m = t, { t: r } = O(Z), { isBrowser: B } = O(Y), s = H(!1), u = H(0), o = H([]), d = T({
3341
+ get() {
3342
+ return e.stages || [];
3343
+ },
3344
+ set(g) {
3345
+ g && g.length && (!s.value && (s.value = !0), g.forEach((L, f) => {
3346
+ L.forEach(({ listen: V, inputs: S }) => {
3347
+ if (V && f === u.value) {
3348
+ const n = S.reduce((D, W) => ({ ...D, [W.name]: W.values }), {});
3349
+ m("inputValues", n);
3350
+ }
3351
+ });
3352
+ }));
3353
+ }
3354
+ }), h = H(!1), b = x.debounce(async () => {
3355
+ var f;
3356
+ h.value = !0;
3357
+ const g = (e.stages || []).map((V) => V.map(({ inputs: S }) => S)), L = await ((f = e.submitFn) == null ? void 0 : f.call(e, g.flat(2)));
3358
+ h.value = !1, Array.isArray(L) ? o.value = L : m("submited", L);
3359
+ });
3360
+ function y(g) {
3361
+ u.value = g, window.scrollTo({ top: 0, behavior: "smooth" });
3362
+ }
3363
+ return B && m("update:activeStage", y), (g, L) => {
3364
+ var f;
3365
+ return a(), _(We, {
3366
+ loading: h.value,
3367
+ content: !!((f = g.stages) != null && f.length),
3368
+ theme: g.theme,
3369
+ tag: "form",
3370
+ method: "post",
3371
+ class: "flx --flxColumn --flx-start-stretch --gap-30 --maxWidth-full"
3372
+ }, {
3373
+ default: C(() => {
3374
+ var V;
3375
+ return [
3376
+ (a(!0), v(K, null, se(d.value.filter((S) => S.length), (S, n) => Oe((a(), v("div", {
3377
+ key: `stage-${n}`,
3378
+ class: j(g.stagesClasses ?? "flx --flxColumn --flx-start-stretch --gap-30")
3379
+ }, [
3380
+ (a(!0), v(K, null, se(S, (D, W) => (a(), _(nt, {
3381
+ key: `form-${W}`,
3382
+ modelValue: d.value[n][W].inputs,
3383
+ "onUpdate:modelValue": (J) => d.value[n][W].inputs = J,
3384
+ modelModifiers: { lazy: !0 },
3385
+ theme: g.theme,
3386
+ invalid: o.value,
3387
+ "no-form": "",
3388
+ title: D.title,
3389
+ "onUpdate:invalid": L[0] || (L[0] = (J) => o.value = J)
3390
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "theme", "invalid", "title"]))), 128))
3391
+ ], 2)), [
3392
+ [Fe, u.value == n]
3393
+ ])), 128)),
3394
+ A("div", xl, [
3395
+ g.hideRequiredDisclaimer ? z("", !0) : (a(), v("div", ea, [
3396
+ A("p", ta, P(l(r)("required_verification")), 1)
3397
+ ])),
3398
+ A("div", la, [
3399
+ (V = g.stages) != null && V.length ? (a(), v("div", aa, [
3400
+ G(g.$slots, "primary-actions", X(ae({
3401
+ activeStage: u.value,
3402
+ stagesLength: g.stages && g.stages.length,
3403
+ setActiveStage: y,
3404
+ canSubmit: s.value
3405
+ })), () => [
3406
+ d.value.length > 1 && u.value ? (a(), _(le, {
3407
+ key: "button-back",
3408
+ theme: g.theme,
3409
+ "aria-label": l(r)("previous"),
3410
+ round: ":sm",
3411
+ onClick: L[1] || (L[1] = ue((S) => y(u.value - 1), ["prevent"]))
3412
+ }, {
3413
+ default: C(() => [
3414
+ $(U, { name: "arrow-left" }),
3415
+ $(U, {
3416
+ name: "arrow-left",
3417
+ regular: ""
3418
+ }),
3419
+ A("span", oa, P(l(r)("previous")), 1)
3420
+ ]),
3421
+ _: 1
3422
+ }, 8, ["theme", "aria-label"])) : z("", !0),
3423
+ g.submitLabel && (u.value === d.value.length - 1 || !d.value.length) ? (a(), _(re, {
3424
+ key: "button-submit",
3425
+ theme: g.theme,
3426
+ "aria-label": l(r)("send"),
3427
+ disabled: !s.value || !g.submitFn,
3428
+ onClick: ue(l(b), ["prevent"])
3429
+ }, {
3430
+ default: C(() => [
3431
+ ne(P(g.submitLabel || l(r)("send")), 1)
3432
+ ]),
3433
+ _: 1
3434
+ }, 8, ["theme", "aria-label", "disabled", "onClick"])) : z("", !0),
3435
+ d.value.length > 1 && u.value < d.value.length - 1 ? (a(), _(le, {
3436
+ key: "button-next",
3437
+ theme: g.theme,
3438
+ "aria-label": l(r)("next"),
3439
+ round: ":sm",
3440
+ onClick: L[2] || (L[2] = ue((S) => y(u.value + 1), ["prevent"]))
3441
+ }, {
3442
+ default: C(() => [
3443
+ A("span", sa, P(l(r)("next")), 1),
3444
+ $(U, { name: "arrow-right" }),
3445
+ $(U, {
3446
+ name: "arrow-right",
3447
+ regular: ""
3448
+ })
3449
+ ]),
3450
+ _: 1
3451
+ }, 8, ["theme", "aria-label"])) : z("", !0)
3452
+ ])
3453
+ ])) : z("", !0),
3454
+ G(g.$slots, "secondary-actions", X(ae({
3455
+ activeStage: u.value,
3456
+ stagesLength: g.stages && g.stages.length,
3457
+ setActiveStage: y,
3458
+ canSubmit: s.value
3459
+ })))
3460
+ ])
3461
+ ])
3462
+ ];
3463
+ }),
3464
+ _: 3
3465
+ }, 8, ["loading", "content", "theme"]);
3466
+ };
3467
+ }
3468
+ }), ra = { class: "flx --flxColumn --flx-start-center --gap-10" }, ia = {
3469
+ key: 0,
3470
+ class: "flx --flxRow --flx-center"
3471
+ }, ua = { key: 0 }, da = {
3472
+ key: 0,
3473
+ class: "--txtSize-sm"
3474
+ }, ma = { key: 1 }, pa = /* @__PURE__ */ q({
3475
+ name: "SliderSimple",
3476
+ inheritAttrs: !0,
3477
+ __name: "Slider",
3478
+ props: {
3479
+ /**
3480
+ * Show controls
3481
+ */
3482
+ controls: {
3483
+ type: [Boolean, String],
3484
+ default: !0
3485
+ },
3486
+ /**
3487
+ * Auto-animate
3488
+ */
3489
+ animate: {
3490
+ type: Boolean,
3491
+ default: !0
3492
+ },
3493
+ /**
3494
+ * Transition duration in ms
3495
+ * @values 100 - 1000
3496
+ */
3497
+ transitionDuration: {
3498
+ type: Number,
3499
+ default: 700
3500
+ },
3501
+ /**
3502
+ * Interval duration in ms
3503
+ */
3504
+ intervalDuration: {
3505
+ type: Number,
3506
+ default: 7e3
3507
+ },
3508
+ visibleSlides: {
3509
+ type: Number,
3510
+ default: 3
3511
+ },
3512
+ /**
3513
+ * is gallery (border radius)
3514
+ * TODO: allow opening overlay with picture gallery
3515
+ */
3516
+ gallery: {
3517
+ type: Boolean,
3518
+ default: !1
3519
+ },
3520
+ enumerate: {
3521
+ type: Boolean,
3522
+ default: !1
3523
+ }
3524
+ },
3525
+ setup(p) {
3526
+ const t = p, e = mt(), m = me("xamu"), { t: r } = O(Z), { isBrowser: B } = O(Y), s = H(), u = H(), o = H(!1), d = H(!1), h = H(), b = H("slide-1"), y = H(0), g = T(() => !(m != null && m.disableAutoAnimate) && t.animate), L = T(() => {
3527
+ var I;
3528
+ const c = ((I = e.default) == null ? void 0 : I.call(e)) || [];
3529
+ return c.length && c[0].type === "li" ? "ul" : "div";
3530
+ });
3531
+ function f() {
3532
+ if (!u.value || !s.value)
3533
+ throw new Error("Missing containers");
3534
+ o.value = !0;
3535
+ const c = Array.from(u.value.children || []), I = u.value.offsetWidth, N = c[0].offsetWidth;
3536
+ return s.value.style.width = `${I}px`, u.value.style.left = "0", {
3537
+ slides: c,
3538
+ sliderWidth: I,
3539
+ slideWidth: N,
3540
+ slider: u.value,
3541
+ sliderContainer: s.value
3542
+ };
3543
+ }
3544
+ function V() {
3545
+ if (!u.value || !s.value)
3546
+ throw new Error("Missing containers");
3547
+ u.value.style.transition = "none", s.value.style.width = "auto", u.value.style.left = "0", o.value = !1;
3548
+ }
3549
+ const S = (c) => new Promise((I) => {
3550
+ const { slides: N, slideWidth: i, slider: R } = f();
3551
+ N[N.length - 1].after(N[0].cloneNode(!0)), R.style.transition = `left ${c}ms ease`, setTimeout(() => {
3552
+ R.style.left = `-${i}px`, setTimeout(() => {
3553
+ N[0].remove();
3554
+ const w = R.children[0];
3555
+ w.dataset.id && (b.value = w.dataset.id), I(!0);
3556
+ }, c);
3557
+ }, 1);
3558
+ }), n = (c) => new Promise((I) => {
3559
+ const { slides: N, slideWidth: i, slider: R } = f();
3560
+ R.style.left = `-${i}px`, N[0].before(N[N.length - 1].cloneNode(!0)), setTimeout(() => {
3561
+ R.style.transition = `left ${c}ms ease`, setTimeout(() => {
3562
+ R.style.left = "0", setTimeout(() => {
3563
+ N[N.length - 1].remove();
3564
+ const w = R.children[0];
3565
+ w.dataset.id && (b.value = w.dataset.id), I(!0);
3566
+ }, c);
3567
+ }, 1);
3568
+ }, 1);
3569
+ });
3570
+ async function D(c, I, N = t.transitionDuration) {
3571
+ if (!u.value || !s.value)
3572
+ return;
3573
+ const i = Array.from(u.value.children || []);
3574
+ if (!(!i.length || o.value)) {
3575
+ if (I) {
3576
+ const R = i.findIndex((Q) => Q.dataset.id === I);
3577
+ if (R < 1)
3578
+ return;
3579
+ const w = R > Math.floor(i.length / 2), k = w ? i.length - R : R, E = N / k;
3580
+ for (const Q of Array(k).fill(() => D(w, "", E)))
3581
+ await Q(Q);
3582
+ } else if (await (c ? n(N) : S(N)))
3583
+ return V();
3584
+ }
3585
+ }
3586
+ const W = x.debounce(D);
3587
+ function J() {
3588
+ if (!u.value || !s.value)
3589
+ return;
3590
+ const c = Array.from(u.value.children || []);
3591
+ c.length && (y.value = c.length, c.forEach((I, N) => {
3592
+ I.dataset.id = `slide-${N + 1}`, I.style.flex = `0 0 ${100 / t.visibleSlides}%`;
3593
+ }), !(!g.value || y.value <= 1) && (h.value = setInterval(
3594
+ () => !d.value && W(!1),
3595
+ t.intervalDuration
3596
+ )));
3597
+ }
3598
+ return B && (ze(() => {
3599
+ J();
3600
+ }), pt(() => {
3601
+ clearInterval(h.value);
3602
+ })), (c, I) => (a(), v("header", {
3603
+ onMouseover: I[2] || (I[2] = (N) => d.value = !0),
3604
+ onMouseleave: I[3] || (I[3] = (N) => d.value = !1)
3605
+ }, [
3606
+ A("div", ra, [
3607
+ A("div", {
3608
+ ref_key: "sliderContainerRef",
3609
+ ref: s,
3610
+ class: j([{ "avatarAureo --size-lg": p.gallery }, "--overflow-hidden"])
3611
+ }, [
3612
+ (a(), _(ye(L.value), {
3613
+ ref_key: "sliderRef",
3614
+ ref: u,
3615
+ class: "flx --flxRow --flx-start-stretch --gap-none --overflow"
3616
+ }, {
3617
+ default: C(() => [
3618
+ G(c.$slots, "default")
3619
+ ]),
3620
+ _: 3
3621
+ }, 512))
3622
+ ], 2),
3623
+ y.value > 1 && p.controls ? (a(), v("ul", ia, [
3624
+ p.controls === "full" ? (a(), v("li", ua, [
3625
+ $(re, {
3626
+ "aria-label": l(r)("previous"),
3627
+ round: "",
3628
+ onClick: I[0] || (I[0] = ue((N) => l(W)(!0), ["prevent"]))
3629
+ }, {
3630
+ default: C(() => [
3631
+ $(U, { name: "arrow-left" })
3632
+ ]),
3633
+ _: 1
3634
+ }, 8, ["aria-label"])
3635
+ ])) : z("", !0),
3636
+ (a(!0), v(K, null, se(y.value, (N) => (a(), v("li", { key: N }, [
3637
+ $(le, {
3638
+ id: `slide-${N}`,
3639
+ tooltip: l(r)("pick"),
3640
+ active: b.value === `slide-${N}`,
3641
+ size: "xs",
3642
+ round: "",
3643
+ onClick: ue((i) => l(W)(!1, `slide-${N}`), ["prevent"])
3644
+ }, {
3645
+ default: C(() => [
3646
+ p.enumerate ? (a(), v("span", da, P(N), 1)) : z("", !0)
3647
+ ]),
3648
+ _: 2
3649
+ }, 1032, ["id", "tooltip", "active", "onClick"])
3650
+ ]))), 128)),
3651
+ p.controls === "full" ? (a(), v("li", ma, [
3652
+ $(re, {
3653
+ "aria-label": l(r)("next"),
3654
+ round: "",
3655
+ onClick: I[1] || (I[1] = ue((N) => l(W)(!1), ["prevent"]))
3656
+ }, {
3657
+ default: C(() => [
3658
+ $(U, { name: "arrow-right" })
3659
+ ]),
3660
+ _: 1
3661
+ }, 8, ["aria-label"])
3662
+ ])) : z("", !0)
3663
+ ])) : z("", !0)
3664
+ ])
3665
+ ], 32));
3666
+ }
3667
+ }), wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3668
+ __proto__: null,
3669
+ ActionButton: re,
3670
+ ActionButtonLink: Ct,
3671
+ ActionButtonToggle: le,
3672
+ ActionLink: ee,
3673
+ BaseAction: fe,
3674
+ BaseImg: Te,
3675
+ BaseInput: Ae,
3676
+ BaseSelect: Qe,
3677
+ BaseWrapper: $e,
3678
+ BoxAction: kl,
3679
+ BoxMessage: Se,
3680
+ Dropdown: xe,
3681
+ Form: nt,
3682
+ FormInput: st,
3683
+ FormStages: na,
3684
+ Icon: Xe,
3685
+ IconFa: U,
3686
+ InputFile: Je,
3687
+ InputText: ce,
3688
+ InputToggle: _e,
3689
+ Loader: Re,
3690
+ LoaderContent: We,
3691
+ LoaderContentFetch: ge,
3692
+ Modal: Be,
3693
+ Pagination: lt,
3694
+ PaginationContent: El,
3695
+ Select: he,
3696
+ SelectFilter: we,
3697
+ Slider: pa,
3698
+ Table: et,
3699
+ Value: Ze,
3700
+ ValueComplex: tt,
3701
+ useTheme: te
3702
+ }, Symbol.toStringTag, { value: "Module" }));
3703
+ export {
3704
+ nt as A,
3705
+ na as B,
3706
+ Be as C,
3707
+ xe as D,
3708
+ et as E,
3709
+ pa as F,
3710
+ Te as _,
3711
+ fe as a,
3712
+ Ae as b,
3713
+ wa as c,
3714
+ Qe as d,
3715
+ $e as e,
3716
+ Xe as f,
3717
+ U as g,
3718
+ re as h,
3719
+ Ct as i,
3720
+ le as j,
3721
+ ee as k,
3722
+ Je as l,
3723
+ ce as m,
3724
+ _e as n,
3725
+ he as o,
3726
+ we as p,
3727
+ Ze as q,
3728
+ tt as r,
3729
+ kl as s,
3730
+ Se as t,
3731
+ Re as u,
3732
+ We as v,
3733
+ ge as w,
3734
+ lt as x,
3735
+ El as y,
3736
+ st as z
3737
+ };