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