@aeria-ui/ui 0.0.74 → 0.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3482 @@
1
+ import { defineComponent as E, ref as J, resolveDirective as oe, openBlock as t, createElementBlock as s, normalizeClass as X, Fragment as N, renderList as D, withDirectives as x, toDisplayString as k, createCommentVNode as y, createTextVNode as W, unref as e, renderSlot as O, inject as _e, computed as G, createElementVNode as C, mergeProps as Q, createBlock as $, resolveDynamicComponent as he, withCtx as v, useCssVars as It, Teleport as Je, onMounted as bt, watch as ue, createVNode as F, withModifiers as ze, vModelDynamic as At, onBeforeMount as $t, normalizeStyle as be, pushScopeId as De, popScopeId as Qe, provide as ye, createSlots as ce, normalizeProps as pe, guardReactiveProps as Ve, vModelCheckbox as Bt, onUnmounted as wt, isRef as _t, resolveComponent as St, Suspense as Tt, useSlots as jt, h as Rt } from "vue";
2
+ import { t as L, useI18n as Lt } from "@aeria-ui/i18n";
3
+ import { useScrollObserver as Ze, useBreakpoints as qe, useMask as zt, PAGINATION_PER_PAGE_DEFAULTS as Mt, API_URL as gt, request as qt, useDebounce as kt, isDocumentComplete as Ft, getObjectKey as Ut, convertToSearchQuery as Et, useAction as Ht, convertFromSearchQuery as Dt, useParentCollectionStore as Ke, usePasswordPolicy as Qt } from "@aeria-ui/core";
4
+ import { arraysIntersect as Vt, deepClone as ke, getReferenceProperty as me, convertConditionToQuery as Gt, freshItem as Wt, isRequired as Kt, evaluateCondition as Ye, deepMerge as Me } from "@aeriajs/common";
5
+ import { useStore as ie, getStoreId as Fe, useParentStore as Ie, STORE_ID as Ue, getGlobalStateManager as Pe } from "@aeria-ui/state-management";
6
+ import { useRouter as Ae } from "vue-router";
7
+ const Xt = ["onClick"], Yt = { key: 0 }, Jt = {
8
+ key: 0,
9
+ class: "accordion__content"
10
+ }, Zt = /* @__PURE__ */ E({
11
+ __name: "aeria-accordion",
12
+ props: {
13
+ enumerate: { type: Boolean },
14
+ noPadding: { type: Boolean },
15
+ headers: {}
16
+ },
17
+ setup(u) {
18
+ const r = J(null), l = (n) => typeof n == "string" ? n : n.title;
19
+ return (n, a) => {
20
+ const i = oe("clickable");
21
+ return t(), s("div", {
22
+ class: X({
23
+ accordion: !0,
24
+ "accordion--padded": !n.noPadding
25
+ })
26
+ }, [
27
+ (t(!0), s(N, null, D(Object.keys(n.$slots).filter((c) => c !== "default"), (c, _) => (t(), s("div", {
28
+ key: c,
29
+ class: "accordion__slot"
30
+ }, [
31
+ x((t(), s("div", {
32
+ class: "accordion__header",
33
+ onClick: (d) => r.value === c ? r.value = null : r.value = c
34
+ }, [
35
+ n.enumerate ? (t(), s("span", Yt, k(_ + 1) + ". ", 1)) : y("", !0),
36
+ W(" " + k(n.headers[c] ? l(n.headers[c]) : e(L)(c)), 1)
37
+ ], 8, Xt)), [
38
+ [i]
39
+ ]),
40
+ r.value === c ? (t(), s("div", Jt, [
41
+ O(n.$slots, c, {}, void 0, !0)
42
+ ])) : y("", !0)
43
+ ]))), 128))
44
+ ], 2);
45
+ };
46
+ }
47
+ });
48
+ const K = (u, r) => {
49
+ const l = u.__vccOpts || u;
50
+ for (const [n, a] of r)
51
+ l[n] = a;
52
+ return l;
53
+ }, Ul = /* @__PURE__ */ K(Zt, [["__scopeId", "data-v-3ea933d4"]]), Pt = /* @__PURE__ */ E({
54
+ __name: "aeria-badge",
55
+ props: {
56
+ large: { type: Boolean },
57
+ alt: { type: Boolean }
58
+ },
59
+ setup(u) {
60
+ return (r, l) => (t(), s("div", {
61
+ class: X(`
62
+ badge
63
+ ${r.large && "badge--large"}
64
+ ${r.alt && "badge--alt"}
65
+ `)
66
+ }, [
67
+ O(r.$slots, "default", {}, void 0, !0)
68
+ ], 2));
69
+ }
70
+ });
71
+ const $e = /* @__PURE__ */ K(Pt, [["__scopeId", "data-v-47f92648"]]), Nt = /* @__PURE__ */ E({
72
+ __name: "aeria-bare-button",
73
+ props: {
74
+ disabled: { type: Boolean }
75
+ },
76
+ emits: ["click"],
77
+ setup(u, { emit: r }) {
78
+ const l = u, n = r, a = (i) => {
79
+ l.disabled || n("click", i);
80
+ };
81
+ return (i, c) => (t(), s("button", {
82
+ class: X(`
83
+ barebutton
84
+ barebutton--${i.disabled ? "disabled" : "enabled"}
85
+ `),
86
+ onClick: a
87
+ }, [
88
+ O(i.$slots, "default", {}, void 0, !0)
89
+ ], 2));
90
+ }
91
+ });
92
+ const ve = /* @__PURE__ */ K(Nt, [["__scopeId", "data-v-35bc81ae"]]), xt = ["href"], en = {
93
+ key: 0,
94
+ "data-component": "icon-label"
95
+ }, tn = /* @__PURE__ */ E({
96
+ __name: "aeria-icon",
97
+ props: {
98
+ icon: {},
99
+ size: {},
100
+ medium: { type: Boolean },
101
+ reactive: { type: [Boolean, null] },
102
+ iconRight: { type: Boolean },
103
+ fill: {}
104
+ },
105
+ setup(u) {
106
+ const r = u, l = typeof r.reactive == "boolean" ? r.reactive : _e("iconReactive", !1), n = G(() => {
107
+ var a;
108
+ return (a = r.icon) != null && a.includes(":") ? r.icon : `regular:${r.icon}`;
109
+ });
110
+ return (a, i) => (t(), s("a", {
111
+ class: X(`
112
+ icon
113
+ ${e(l) && "icon--reactive"}
114
+ ${a.$slots.default ? "icon--centered" : "icon--standalone"}
115
+ `)
116
+ }, [
117
+ C("div", {
118
+ class: X(`
119
+ icon__icon
120
+ ${a.size && `icon__icon--${a.size}`}
121
+ ${a.iconRight && "icon__icon--right"}
122
+ `)
123
+ }, [
124
+ (t(), s("svg", Q({
125
+ width: "24",
126
+ height: "24",
127
+ viewBox: "0 0 256 256",
128
+ "data-component": "icon"
129
+ }, {
130
+ ...a.fill ? { fill: a.fill } : {}
131
+ }), [
132
+ C("use", {
133
+ href: `/assets/icons.svg#${n.value}`
134
+ }, null, 8, xt)
135
+ ], 16))
136
+ ], 2),
137
+ a.$slots.default ? (t(), s("div", en, [
138
+ O(a.$slots, "default", {}, void 0, !0)
139
+ ])) : y("", !0)
140
+ ], 2));
141
+ }
142
+ });
143
+ const Z = /* @__PURE__ */ K(tn, [["__scopeId", "data-v-4b763bd3"]]), nn = { class: "panel__header-left" }, on = { key: 1 }, an = {
144
+ key: 2,
145
+ style: { "margin-left": "auto" }
146
+ }, ln = /* @__PURE__ */ E({
147
+ __name: "aeria-panel",
148
+ props: {
149
+ closeHint: { type: Boolean, default: !1 },
150
+ modelValue: { default: !0 },
151
+ title: {},
152
+ float: { type: Boolean },
153
+ fixedRight: { type: Boolean },
154
+ floating: { type: Boolean },
155
+ loading: { type: Boolean },
156
+ bordered: { type: Boolean },
157
+ overlay: { type: Boolean },
158
+ invisibleOverlay: { type: Boolean },
159
+ collapsed: { type: Boolean },
160
+ collapsible: { type: Boolean, default: !1 },
161
+ fill: { type: Boolean },
162
+ fillFooter: { type: Boolean },
163
+ transparent: { type: Boolean },
164
+ transparentMobile: { type: Boolean },
165
+ outerHeader: { type: Boolean },
166
+ overlayLayer: {}
167
+ },
168
+ emits: ["update:modelValue", "update:collapsed", "update:closeHint", "overlayClick", "close"],
169
+ setup(u, { emit: r }) {
170
+ const l = u, n = r, a = G(() => l.floating || l.float), i = J(l.collapsed), c = J(null), { reachedEnd: _ } = Ze(c), d = () => {
171
+ n("update:modelValue", !1), n("close");
172
+ }, h = () => {
173
+ n("overlayClick");
174
+ }, p = (o) => {
175
+ n("update:collapsed", o), i.value = o;
176
+ };
177
+ return (o, m) => {
178
+ const A = oe("clickable"), b = oe("loading"), S = oe("overlay");
179
+ return o.modelValue ? x((t(), s("div", {
180
+ key: 0,
181
+ class: X(`
182
+ panel
183
+ ${o.fixedRight && "panel--fixed"}
184
+ `)
185
+ }, [
186
+ (t(), $(he(
187
+ a.value ? "dialog" : "div"
188
+ ), {
189
+ "data-component": "panel",
190
+ class: X(`
191
+ aeria-surface
192
+ panel__content
193
+ ${a.value && "panel__content--floating"}
194
+ ${o.bordered && "panel__content--bordered"}
195
+ ${o.fixedRight && "panel__content--fixed-right"}
196
+ ${o.transparent && "panel__content--transparent"}
197
+ ${o.transparentMobile && "panel__content--transparent-mobile"}
198
+ ${o.outerHeader && "panel__content--outer-header"}
199
+ `),
200
+ onClick: m[2] || (m[2] = (j) => j.stopPropagation())
201
+ }, {
202
+ default: v(() => [
203
+ o.$slots.header || o.title ? (t(), s("div", {
204
+ key: 0,
205
+ class: X(`
206
+ panel__header
207
+ ${i.value && "panel__header--collapsed"}
208
+ ${o.outerHeader && "panel__header--outer"}
209
+ `)
210
+ }, [
211
+ C("div", nn, [
212
+ o.$slots.header ? O(o.$slots, "header", { key: 0 }, void 0, !0) : o.title ? (t(), s("div", on, k(o.title), 1)) : y("", !0),
213
+ o.$slots.extra ? (t(), s("div", an, [
214
+ O(o.$slots, "extra", {}, void 0, !0)
215
+ ])) : y("", !0)
216
+ ]),
217
+ o.collapsible && i.value ? x((t(), $(Z, {
218
+ key: 0,
219
+ reactive: "",
220
+ icon: "plus",
221
+ onClick: m[0] || (m[0] = (j) => p(!i.value))
222
+ }, null, 512)), [
223
+ [A]
224
+ ]) : o.collapsible && !i.value ? x((t(), $(Z, {
225
+ key: 1,
226
+ reactive: "",
227
+ icon: "minus",
228
+ onClick: m[1] || (m[1] = (j) => p(!i.value))
229
+ }, null, 512)), [
230
+ [A]
231
+ ]) : o.closeHint ? x((t(), $(Z, {
232
+ key: 2,
233
+ reactive: "",
234
+ icon: "x",
235
+ onClick: d
236
+ }, null, 512)), [
237
+ [A]
238
+ ]) : y("", !0)
239
+ ], 2)) : y("", !0),
240
+ i.value ? y("", !0) : x((t(), s("div", {
241
+ key: 1,
242
+ ref_key: "body",
243
+ ref: c,
244
+ class: X(`
245
+ panel__body
246
+ ${o.fill || "panel__body--padded"}
247
+ `)
248
+ }, [
249
+ O(o.$slots, "default", {}, void 0, !0)
250
+ ], 2)), [
251
+ [b, o.loading]
252
+ ]),
253
+ o.$slots.footer ? (t(), s("div", {
254
+ key: 2,
255
+ class: X(`
256
+ panel__footer
257
+ ${o.fillFooter || "panel__footer--padded"}
258
+ ${e(_) || "panel__footer--shadowed"}
259
+ `)
260
+ }, [
261
+ O(o.$slots, "footer", {}, void 0, !0)
262
+ ], 2)) : y("", !0)
263
+ ]),
264
+ _: 3
265
+ }, 8, ["class"]))
266
+ ], 2)), [
267
+ [S, {
268
+ condition: o.overlay || o.fixedRight || a.value,
269
+ invisible: o.invisibleOverlay,
270
+ click: h,
271
+ layer: o.overlayLayer || (a.value ? 60 : o.fixedRight ? 50 : 0)
272
+ }]
273
+ ]) : y("", !0);
274
+ };
275
+ }
276
+ });
277
+ const Be = /* @__PURE__ */ K(ln, [["__scopeId", "data-v-73b47cf0"]]), sn = { class: "button__content" }, rn = {
278
+ key: 1,
279
+ class: "button__content"
280
+ }, un = /* @__PURE__ */ E({
281
+ __name: "aeria-button",
282
+ props: {
283
+ size: {},
284
+ variant: {},
285
+ small: { type: Boolean },
286
+ large: { type: Boolean },
287
+ icon: {},
288
+ disabled: { type: Boolean },
289
+ loading: { type: Boolean }
290
+ },
291
+ setup(u) {
292
+ const r = u, l = _e("buttonVariant", r.variant) || "primary", n = (() => {
293
+ switch (!0) {
294
+ case r.small:
295
+ return "small";
296
+ case r.large:
297
+ return "large";
298
+ }
299
+ return _e("buttonSize", r.size) || "medium";
300
+ })();
301
+ return (a, i) => (t(), $(ve, {
302
+ class: X(`
303
+ button
304
+ button--${e(l)}
305
+ button--${e(n)}
306
+ ${a.loading && "button--loading"}
307
+ `),
308
+ disabled: a.disabled
309
+ }, {
310
+ default: v(() => [
311
+ a.icon ? (t(), $(Z, {
312
+ key: 0,
313
+ icon: a.icon
314
+ }, {
315
+ default: v(() => [
316
+ C("div", sn, [
317
+ O(a.$slots, "default", {}, void 0, !0)
318
+ ])
319
+ ]),
320
+ _: 3
321
+ }, 8, ["icon"])) : (t(), s("div", rn, [
322
+ O(a.$slots, "default", {}, void 0, !0)
323
+ ]))
324
+ ]),
325
+ _: 3
326
+ }, 8, ["class", "disabled"]));
327
+ }
328
+ });
329
+ const re = /* @__PURE__ */ K(un, [["__scopeId", "data-v-c328251b"]]), cn = { class: "card__picture" }, dn = { class: "card__footer" }, pn = { class: "card__footer-upper" }, _n = { class: "card__badge" }, mn = /* @__PURE__ */ E({
330
+ __name: "aeria-card",
331
+ props: {
332
+ inactive: { type: Boolean },
333
+ horizontal: { type: Boolean }
334
+ },
335
+ setup(u) {
336
+ return (r, l) => (t(), s("div", {
337
+ class: X(`
338
+ card
339
+ ${r.inactive && "card--inactive"}
340
+ ${r.horizontal && "card--horizontal"}
341
+ `)
342
+ }, [
343
+ C("div", cn, [
344
+ O(r.$slots, "default", {}, void 0, !0)
345
+ ]),
346
+ C("div", dn, [
347
+ C("div", pn, [
348
+ C("div", null, [
349
+ O(r.$slots, "footer", {}, void 0, !0)
350
+ ]),
351
+ r.$slots.actions ? O(r.$slots, "actions", { key: 0 }, void 0, !0) : y("", !0)
352
+ ]),
353
+ C("div", _n, [
354
+ O(r.$slots, "badge", {}, void 0, !0)
355
+ ])
356
+ ])
357
+ ], 2));
358
+ }
359
+ });
360
+ const fn = /* @__PURE__ */ K(mn, [["__scopeId", "data-v-c1a322df"]]), vn = { class: "content__body" }, yn = {
361
+ key: 0,
362
+ class: "content__section"
363
+ }, hn = { class: "content__item" }, bn = /* @__PURE__ */ E({
364
+ __name: "aeria-context-menu",
365
+ props: {
366
+ actions: {},
367
+ subject: {},
368
+ overlayLayer: {}
369
+ },
370
+ emits: ["actionClick"],
371
+ setup(u, { emit: r }) {
372
+ It((d) => ({
373
+ "0cfe51de": _.value.x,
374
+ "0cfe51df": _.value.y
375
+ }));
376
+ const l = r, n = J(null), a = J(!1), i = (d) => d == null ? void 0 : d.filter((h) => {
377
+ if (h.roles) {
378
+ const p = ie("user");
379
+ return Vt(h.roles, p.currentUser.roles);
380
+ }
381
+ return !0;
382
+ }), c = (d, h) => {
383
+ const p = ke(h);
384
+ d.click(p), l("actionClick", {
385
+ action: d,
386
+ subject: p
387
+ }), a.value = !1;
388
+ }, _ = G(() => {
389
+ if (!n.value)
390
+ return {
391
+ x: 0,
392
+ y: 0
393
+ };
394
+ const d = n.value.getBoundingClientRect().top, h = n.value.getBoundingClientRect().left, p = n.value.offsetHeight;
395
+ return {
396
+ _: a.value,
397
+ x: Math.floor(h) + "px",
398
+ y: Math.floor(d + p) + "px"
399
+ };
400
+ });
401
+ return (d, h) => {
402
+ const p = oe("overlay");
403
+ return t(), s(N, null, [
404
+ Object.keys(d.$slots).some((o) => o !== "default") || d.actions !== void 0 && d.actions.length > 0 ? (t(), s("div", {
405
+ key: 0,
406
+ ref_key: "contextmenu",
407
+ ref: n,
408
+ class: "contextmenu"
409
+ }, [
410
+ C("a", {
411
+ class: "contextmenu__trigger",
412
+ onClick: h[0] || (h[0] = (o) => a.value = !0)
413
+ }, [
414
+ O(d.$slots, "default", {}, void 0, !0)
415
+ ])
416
+ ], 512)) : y("", !0),
417
+ a.value ? (t(), $(Je, {
418
+ key: 1,
419
+ to: "main"
420
+ }, [
421
+ x((t(), $(Be, {
422
+ modelValue: a.value,
423
+ "onUpdate:modelValue": h[4] || (h[4] = (o) => a.value = o),
424
+ fill: "",
425
+ bordered: "",
426
+ class: "content",
427
+ style: { "--panel-min-width": "0" }
428
+ }, {
429
+ default: v(() => [
430
+ C("div", vn, [
431
+ d.$slots.header ? (t(), s("div", yn, [
432
+ O(d.$slots, "header", {}, void 0, !0)
433
+ ])) : y("", !0),
434
+ Object.keys(d.$slots).filter((o) => !["default", "extra", "header"].includes(o)).length > 0 ? (t(), s("div", {
435
+ key: 1,
436
+ class: "content__section",
437
+ onClick: h[1] || (h[1] = (o) => a.value = !1)
438
+ }, [
439
+ (t(!0), s(N, null, D(Object.keys(d.$slots).filter((o) => !["default", "extra", "header"].includes(o)), (o, m) => (t(), $(ve, {
440
+ key: `slot-${m}`,
441
+ class: "content__item content__item--reactive"
442
+ }, {
443
+ default: v(() => [
444
+ O(d.$slots, o, {}, void 0, !0)
445
+ ]),
446
+ _: 2
447
+ }, 1024))), 128))
448
+ ])) : y("", !0),
449
+ d.actions !== void 0 && d.actions.length > 0 ? (t(), s("div", {
450
+ key: 2,
451
+ class: "content__section",
452
+ onClick: h[2] || (h[2] = (o) => a.value = !1)
453
+ }, [
454
+ (t(!0), s(N, null, D(i(d.actions), (o, m) => (t(), $(ve, {
455
+ key: `action-${m}`,
456
+ class: "content__item content__item--reactive",
457
+ onClick: (A) => c(o, d.subject)
458
+ }, {
459
+ default: v(() => [
460
+ o.icon ? (t(), $(Z, {
461
+ key: 0,
462
+ icon: o.icon
463
+ }, {
464
+ default: v(() => [
465
+ W(k(o.translate ? e(L)(o.label, { capitalize: !0 }) : o.label), 1)
466
+ ]),
467
+ _: 2
468
+ }, 1032, ["icon"])) : y("", !0)
469
+ ]),
470
+ _: 2
471
+ }, 1032, ["onClick"]))), 128))
472
+ ])) : y("", !0),
473
+ d.$slots.extra ? (t(), s("div", {
474
+ key: 3,
475
+ class: "content__section",
476
+ onClick: h[3] || (h[3] = (o) => a.value = !1)
477
+ }, [
478
+ C("div", hn, [
479
+ d.$slots.extra ? O(d.$slots, "extra", { key: 0 }, void 0, !0) : y("", !0)
480
+ ])
481
+ ])) : y("", !0)
482
+ ])
483
+ ]),
484
+ _: 3
485
+ }, 8, ["modelValue"])), [
486
+ [
487
+ p,
488
+ {
489
+ layer: d.overlayLayer,
490
+ click: () => {
491
+ a.value = !1;
492
+ }
493
+ },
494
+ void 0,
495
+ { invisibleOnLarge: !0 }
496
+ ]
497
+ ])
498
+ ])) : y("", !0)
499
+ ], 64);
500
+ };
501
+ }
502
+ });
503
+ const Ce = /* @__PURE__ */ K(bn, [["__scopeId", "data-v-66a4ee79"]]), $n = { class: "info__content" }, gn = /* @__PURE__ */ E({
504
+ __name: "aeria-info",
505
+ props: {
506
+ where: { default: "top" }
507
+ },
508
+ setup(u) {
509
+ const r = qe(), l = J(!1);
510
+ return (n, a) => e(r).md ? (t(), s("div", {
511
+ key: 0,
512
+ class: "info",
513
+ onMouseleave: a[1] || (a[1] = (i) => l.value = !1)
514
+ }, [
515
+ l.value ? (t(), s("div", {
516
+ key: 0,
517
+ class: X(`
518
+ info__bubble
519
+ info__bubble--${n.where}
520
+ `)
521
+ }, [
522
+ C("div", $n, [
523
+ O(n.$slots, "text", {}, void 0, !0)
524
+ ])
525
+ ], 2)) : y("", !0),
526
+ C("div", {
527
+ onMouseover: a[0] || (a[0] = (i) => l.value = !0)
528
+ }, [
529
+ O(n.$slots, "default", {}, void 0, !0)
530
+ ], 32)
531
+ ], 32)) : O(n.$slots, "default", { key: 1 }, void 0, !0);
532
+ }
533
+ });
534
+ const kn = /* @__PURE__ */ K(gn, [["__scopeId", "data-v-7e2a5440"]]), Vn = { class: "input" }, Cn = {
535
+ key: 0,
536
+ class: "input__label"
537
+ }, On = {
538
+ key: 1,
539
+ class: "input__hint"
540
+ }, In = ["placeholder", "readonly", "value"], An = ["value"], Bn = {
541
+ key: 1,
542
+ class: "input__clipboard"
543
+ }, wn = /* @__PURE__ */ E({
544
+ __name: "aeria-input",
545
+ props: {
546
+ modelValue: {},
547
+ property: {},
548
+ propertyName: {},
549
+ parentPropertyName: {},
550
+ parentCollection: {},
551
+ readOnly: { type: Boolean },
552
+ variant: {}
553
+ },
554
+ emits: ["update:modelValue", "input", "change", "clipboardCopy"],
555
+ setup(u, { emit: r }) {
556
+ var B;
557
+ const l = u, n = r, a = l.property || {}, i = "icon" in a || "inputType" in a && a.inputType === "search", c = _e("searchOnly", !1), _ = _e("innerInputLabel", !1), d = !c && (l.readOnly || a.readOnly), h = (R) => (n("clipboardCopy", R), navigator.clipboard.writeText(R)), p = _e("inputVariant", l.variant) || "normal", o = {
558
+ name: l.propertyName,
559
+ readonly: d,
560
+ type: (() => {
561
+ if ("type" in a)
562
+ switch (a.type) {
563
+ case "number":
564
+ case "integer":
565
+ return "number";
566
+ }
567
+ if (a.inputType)
568
+ return a.inputType;
569
+ switch (typeof l.modelValue) {
570
+ case "string":
571
+ return "text";
572
+ case "number":
573
+ return "number";
574
+ default:
575
+ return "text";
576
+ }
577
+ })(),
578
+ placeholder: _ ? a.description || l.propertyName : a.placeholder
579
+ };
580
+ "type" in a && ((a.type === "number" || a.type === "integer") && (a.minimum && (o.min = a.minimum), a.exclusiveMinimum && (o.min = a.exclusiveMinimum + 1), a.maximum && (o.max = a.maximum), a.exclusiveMaximum && (o.max = a.exclusiveMaximum - 1)), a.type === "string" && ((a.format === "date" || a.format === "date-time") && (o.type = !c && a.format === "date-time" ? "datetime-local" : "date"), o.minlength = a.minLength, o.maxlength = a.maxLength)), o.type === "text" && c && (o.type = "search"), bt(() => {
581
+ l.modelValue !== null && j(l.modelValue);
582
+ });
583
+ const m = (R) => {
584
+ try {
585
+ return typeof R == "string" ? new Date(R).toISOString().slice(0, 19) : "";
586
+ } catch {
587
+ return "";
588
+ }
589
+ }, A = J(""), b = ((B = l.property) == null ? void 0 : B.type) === "string" && l.property.mask ? zt(l.property.mask) : null;
590
+ ue(() => l.modelValue, (R) => {
591
+ A.value = (() => {
592
+ if (b)
593
+ return R ? b.enmask(String(R), void 0, {
594
+ defaultValue: !0
595
+ }) : "";
596
+ switch (o.type) {
597
+ case "date":
598
+ case "datetime-local":
599
+ return m(R);
600
+ }
601
+ switch (R) {
602
+ case null:
603
+ case void 0:
604
+ return "";
605
+ default:
606
+ return R;
607
+ }
608
+ })();
609
+ }, {
610
+ immediate: !0
611
+ });
612
+ const S = (R) => {
613
+ var Y;
614
+ return typeof A.value == "string" && ((Y = l.property) == null ? void 0 : Y.type) === "string" && b !== null ? (A.value = b.enmask(A.value, void 0, {
615
+ defaultValue: !0
616
+ }), l.property.maskedValue === !0 ? A.value : b.unmask(A.value)) : R;
617
+ }, j = (R) => {
618
+ const Y = (() => {
619
+ if (!R || typeof R != "string")
620
+ return R;
621
+ if (o.type === "number" || o.type === "integer")
622
+ return Number(R);
623
+ if (!("type" in a && a.type === "string"))
624
+ return S(R);
625
+ switch (a.format) {
626
+ case "date":
627
+ case "date-time":
628
+ return new Date(R);
629
+ default:
630
+ return S(R);
631
+ }
632
+ })();
633
+ n("input", Y), n("update:modelValue", Y);
634
+ }, P = (R) => {
635
+ const Y = R.target.value;
636
+ A.value = Y, j(Y);
637
+ };
638
+ return (R, Y) => {
639
+ const w = oe("focus"), te = oe("clickable");
640
+ return t(), s("label", Vn, [
641
+ e(_) ? y("", !0) : (t(), s("div", Cn, [
642
+ R.$slots.default ? O(R.$slots, "default", { key: 0 }, void 0, !0) : O(R.$slots, "description", { key: 1 }, void 0, !0)
643
+ ])),
644
+ R.$slots.hint ? (t(), s("div", On, [
645
+ O(R.$slots, "hint", {}, void 0, !0)
646
+ ])) : y("", !0),
647
+ "element" in e(a) && e(a).element === "textarea" ? (t(), s("div", {
648
+ key: 2,
649
+ class: X(`
650
+ input__container
651
+ input__container--${e(p)}
652
+ `)
653
+ }, [
654
+ x(C("textarea", {
655
+ placeholder: o.placeholder,
656
+ readonly: o.readonly,
657
+ value: R.modelValue,
658
+ class: X(`
659
+ input__textarea
660
+ input__input--${e(p)}
661
+ `),
662
+ onInput: P
663
+ }, null, 42, In), [
664
+ [w, e(a).focus]
665
+ ])
666
+ ], 2)) : (t(), s("div", {
667
+ key: 3,
668
+ class: X(`
669
+ input__container
670
+ input__container--${e(p)}
671
+ `)
672
+ }, [
673
+ x(C("input", Q(o, {
674
+ value: A.value,
675
+ "data-component": "input",
676
+ class: `
677
+ input__input
678
+ input__input--${e(p)}
679
+ ${e(i) && "input__input--icon"}
680
+ ${e(d) && "input__input--readOnly"}
681
+ `,
682
+ onInput: P,
683
+ onChange: Y[0] || (Y[0] = (V) => n("change", V))
684
+ }), null, 16, An), [
685
+ [w, e(a).focus]
686
+ ]),
687
+ e(i) ? (t(), $(Z, {
688
+ key: 0,
689
+ icon: e(a).icon || "magnifying-glass",
690
+ class: X(`
691
+ input__icon
692
+ input__icon--${e(p)}
693
+ `)
694
+ }, null, 8, ["icon", "class"])) : y("", !0),
695
+ e(d) ? (t(), s("div", Bn, [
696
+ F(kn, null, {
697
+ text: v(() => [
698
+ W("Copiar")
699
+ ]),
700
+ default: v(() => [
701
+ x(F(Z, {
702
+ reactive: "",
703
+ icon: "clipboard",
704
+ onClick: Y[1] || (Y[1] = ze((V) => h(String(R.modelValue || "")), ["prevent"]))
705
+ }, null, 512), [
706
+ [te]
707
+ ])
708
+ ]),
709
+ _: 1
710
+ })
711
+ ])) : y("", !0)
712
+ ], 2))
713
+ ]);
714
+ };
715
+ }
716
+ });
717
+ const Oe = /* @__PURE__ */ K(wn, [["__scopeId", "data-v-28a4ba0c"]]), Sn = ["value"], Tn = {
718
+ key: 1,
719
+ value: ""
720
+ }, jn = ["value", "data-selected"], Rn = /* @__PURE__ */ E({
721
+ __name: "aeria-select",
722
+ props: {
723
+ modelValue: {},
724
+ property: {},
725
+ propertyName: {},
726
+ parentPropertyName: {},
727
+ parentCollection: {},
728
+ readOnly: { type: Boolean },
729
+ booleanRef: { type: Boolean },
730
+ multiple: { type: [Boolean, Number] },
731
+ noOutline: { type: Boolean }
732
+ },
733
+ emits: ["update:modelValue", "change"],
734
+ setup(u, { emit: r }) {
735
+ const l = u, n = r, a = J(null), i = l.property, c = (p) => {
736
+ l.booleanRef && (_.value = p), n("update:modelValue", (p == null ? void 0 : p._id) || p), n("change", (p == null ? void 0 : p._id) || p);
737
+ }, _ = l.booleanRef ? (() => {
738
+ const p = J(l.modelValue);
739
+ return G({
740
+ get: () => {
741
+ switch (p.value) {
742
+ case "true":
743
+ return !0;
744
+ case "false":
745
+ return !1;
746
+ default:
747
+ return null;
748
+ }
749
+ },
750
+ set: (m) => {
751
+ p.value = m;
752
+ }
753
+ });
754
+ })() : G({
755
+ get: () => l.modelValue,
756
+ set: c
757
+ }), d = (p) => Array.isArray(l.modelValue) ? l.modelValue.includes(p) : l.modelValue === p, h = G(() => l.multiple ? typeof l.multiple == "number" ? l.multiple : 5 : 1);
758
+ return l.multiple && ue(() => l.modelValue, (p) => {
759
+ var m;
760
+ if (!a.value)
761
+ return;
762
+ const o = a.value.querySelector('option[data-selected="true"]');
763
+ o && o.removeAttribute("data-selected"), (m = a.value.querySelector(`option[value="${p}"]`)) == null || m.setAttribute("data-selected", "true");
764
+ }), (p, o) => (t(), s("select", Q({
765
+ ref_key: "select",
766
+ ref: a,
767
+ value: e(_)
768
+ }, {
769
+ size: h.value
770
+ }, {
771
+ class: {
772
+ select: !0,
773
+ "select--multiple": !!h.value,
774
+ "select--outline": !p.noOutline
775
+ },
776
+ onChange: o[0] || (o[0] = (m) => c(m.target.value))
777
+ }), [
778
+ e(i) && e(i).icon ? (t(), $(Z, {
779
+ key: 0,
780
+ icon: e(i).icon
781
+ }, null, 8, ["icon"])) : y("", !0),
782
+ l.multiple ? y("", !0) : (t(), s("option", Tn, k(e(L)("none")), 1)),
783
+ (t(!0), s(N, null, D(e(i) && "enum" in e(i) ? e(i).enum : [], (m) => {
784
+ var A;
785
+ return t(), s("option", {
786
+ key: m,
787
+ value: m,
788
+ "data-selected": d(m)
789
+ }, k((A = e(i)) != null && A.translate ? e(L)(m) : m), 9, jn);
790
+ }), 128)),
791
+ O(p.$slots, "default", {}, void 0, !0)
792
+ ], 16, Sn));
793
+ }
794
+ });
795
+ const Ge = /* @__PURE__ */ K(Rn, [["__scopeId", "data-v-c8f00a1a"]]), Ln = { class: "pagination" }, zn = ["value"], Mn = { class: "pagination__control" }, qn = { class: "pagination__page-input" }, Fn = /* @__PURE__ */ E({
796
+ __name: "aeria-pagination",
797
+ props: {
798
+ pagination: {}
799
+ },
800
+ emits: ["paginate"],
801
+ setup(u, { emit: r }) {
802
+ const l = u, n = r, a = G({
803
+ get: () => Math.floor(l.pagination.offset / l.pagination.limit),
804
+ set: (h) => {
805
+ l.pagination.offset = h * l.pagination.limit;
806
+ }
807
+ }), i = G({
808
+ get: () => l.pagination.limit,
809
+ set: (h) => {
810
+ l.pagination.limit = Number(h);
811
+ }
812
+ }), c = J(a.value ? a.value + 1 : 1), _ = G(() => Math.ceil(l.pagination.recordsTotal / l.pagination.limit)), d = (h) => {
813
+ a.value = h === "previous" ? a.value - 1 : a.value + 1;
814
+ };
815
+ return ue([
816
+ a,
817
+ i
818
+ ], ([h]) => {
819
+ c.value = h + 1, n("paginate", {
820
+ offset: a.value * i.value,
821
+ limit: i.value
822
+ });
823
+ }), (h, p) => (t(), s("div", Ln, [
824
+ F(Ge, {
825
+ modelValue: i.value,
826
+ "onUpdate:modelValue": p[0] || (p[0] = (o) => i.value = o),
827
+ property: {
828
+ enum: [],
829
+ icon: "list"
830
+ },
831
+ class: "pagination__control"
832
+ }, {
833
+ default: v(() => [
834
+ (t(!0), s(N, null, D(e(Mt), (o) => (t(), s("option", {
835
+ key: `limit-${o}`,
836
+ value: o
837
+ }, k(o), 9, zn))), 128))
838
+ ]),
839
+ _: 1
840
+ }, 8, ["modelValue"]),
841
+ C("div", Mn, [
842
+ F(ve, {
843
+ onClick: p[1] || (p[1] = (o) => a.value = 0)
844
+ }, {
845
+ default: v(() => [
846
+ F(Z, {
847
+ reactive: "",
848
+ icon: "caret-double-left"
849
+ })
850
+ ]),
851
+ _: 1
852
+ }),
853
+ F(ve, {
854
+ disabled: a.value === 0,
855
+ onClick: p[2] || (p[2] = (o) => d("previous"))
856
+ }, {
857
+ default: v(() => [
858
+ F(Z, {
859
+ reactive: "",
860
+ icon: "caret-left"
861
+ })
862
+ ]),
863
+ _: 1
864
+ }, 8, ["disabled"]),
865
+ C("div", qn, [
866
+ (t(), $(Oe, {
867
+ key: a.value,
868
+ modelValue: c.value,
869
+ "onUpdate:modelValue": p[3] || (p[3] = (o) => c.value = o),
870
+ property: {
871
+ type: "number",
872
+ minimum: 1
873
+ },
874
+ onChange: p[4] || (p[4] = (o) => {
875
+ a.value = c.value === 0 ? 0 : c.value - 1;
876
+ })
877
+ }, null, 8, ["modelValue"])),
878
+ C("span", null, k(e(L)("of")) + " " + k(_.value), 1)
879
+ ]),
880
+ F(ve, {
881
+ disabled: a.value === _.value - 1,
882
+ onClick: p[5] || (p[5] = (o) => d("next"))
883
+ }, {
884
+ default: v(() => [
885
+ F(Z, {
886
+ reactive: "",
887
+ icon: "caret-right"
888
+ })
889
+ ]),
890
+ _: 1
891
+ }, 8, ["disabled"]),
892
+ F(ve, {
893
+ onClick: p[6] || (p[6] = (o) => a.value = _.value - 1)
894
+ }, {
895
+ default: v(() => [
896
+ F(Z, {
897
+ reactive: "",
898
+ icon: "caret-double-right"
899
+ })
900
+ ]),
901
+ _: 1
902
+ })
903
+ ])
904
+ ]));
905
+ }
906
+ });
907
+ const Un = /* @__PURE__ */ K(Fn, [["__scopeId", "data-v-41aa1ffc"]]), En = { class: "checkbox__text" }, Hn = ["innerHTML"], Dn = { class: "checkbox__hint" }, Qn = ["innerHTML"], Gn = {
908
+ inheritAttrs: !1
909
+ }, Wn = /* @__PURE__ */ E({
910
+ ...Gn,
911
+ __name: "aeria-checkbox",
912
+ props: {
913
+ modelValue: {},
914
+ property: {},
915
+ propertyName: {},
916
+ parentPropertyName: {},
917
+ parentCollection: {},
918
+ readOnly: { type: Boolean },
919
+ value: {},
920
+ variant: {}
921
+ },
922
+ emits: ["update:modelValue", "change"],
923
+ setup(u, { emit: r }) {
924
+ const l = u, n = l.property, a = l.readOnly || (n == null ? void 0 : n.readOnly), i = (() => {
925
+ if (n && "type" in n)
926
+ switch (n.type) {
927
+ case "array":
928
+ case "boolean":
929
+ return "checkbox";
930
+ }
931
+ return "radio";
932
+ })(), c = r, _ = l.value || !1, d = G({
933
+ get: () => {
934
+ var p;
935
+ if (n) {
936
+ if ("type" in n && n.type === "boolean")
937
+ return !!l.value;
938
+ if ("items" in n)
939
+ return (p = l.modelValue) == null ? void 0 : p.includes(l.value);
940
+ }
941
+ return l.modelValue === l.value;
942
+ },
943
+ set: () => {
944
+ var p;
945
+ if (!a) {
946
+ if (n) {
947
+ if ("type" in n && n.type === "boolean") {
948
+ c("update:modelValue", !l.modelValue);
949
+ return;
950
+ }
951
+ if ("items" in n) {
952
+ if ((p = l.modelValue) != null && p.includes(_)) {
953
+ c("update:modelValue", l.modelValue.filter((o) => o !== _));
954
+ return;
955
+ }
956
+ c("update:modelValue", [_].concat(l.modelValue || []));
957
+ return;
958
+ }
959
+ }
960
+ c("update:modelValue", l.value);
961
+ }
962
+ }
963
+ }), h = (p) => {
964
+ a && p.preventDefault();
965
+ };
966
+ return (p, o) => {
967
+ var A, b;
968
+ const m = oe("clickable");
969
+ return x((t(), s("label", {
970
+ class: X(`
971
+ checkbox
972
+ ${e(a) && "checkbox--readOnly"}
973
+ `)
974
+ }, [
975
+ x(C("input", Q({
976
+ "onUpdate:modelValue": o[0] || (o[0] = (S) => d.value = S)
977
+ }, {
978
+ type: e(i),
979
+ readOnly: e(a),
980
+ checked: d.value
981
+ }, {
982
+ class: "checkbox__input",
983
+ onClick: h
984
+ }), null, 16), [
985
+ [At, d.value]
986
+ ]),
987
+ C("div", En, [
988
+ C("div", null, [
989
+ p.$slots.description ? O(p.$slots, "description", { key: 0 }, void 0, !0) : e(_) ? (t(), s("div", {
990
+ key: 1,
991
+ innerHTML: (A = e(n)) != null && A.translate ? e(L)(e(_)) : e(_)
992
+ }, null, 8, Hn)) : O(p.$slots, "default", { key: 2 }, void 0, !0)
993
+ ]),
994
+ C("div", Dn, [
995
+ p.$slots.hint ? O(p.$slots, "hint", { key: 0 }, void 0, !0) : (b = e(n)) != null && b.hint ? (t(), s("div", {
996
+ key: 1,
997
+ innerHTML: e(n).hint
998
+ }, null, 8, Qn)) : y("", !0)
999
+ ])
1000
+ ])
1001
+ ], 2)), [
1002
+ [m]
1003
+ ]);
1004
+ };
1005
+ }
1006
+ });
1007
+ const Kn = /* @__PURE__ */ K(Wn, [["__scopeId", "data-v-b9da4354"]]), Xn = {
1008
+ inheritAttrs: !1
1009
+ }, Yn = /* @__PURE__ */ E({
1010
+ ...Xn,
1011
+ __name: "aeria-options",
1012
+ props: {
1013
+ modelValue: {},
1014
+ propertyName: {},
1015
+ parentPropertyName: {},
1016
+ parentCollection: {},
1017
+ readOnly: { type: Boolean },
1018
+ property: {},
1019
+ columns: { default: 1 }
1020
+ },
1021
+ emits: ["update:modelValue"],
1022
+ setup(u, { emit: r }) {
1023
+ const l = u, n = r, a = l.readOnly || l.property.readOnly, i = "items" in l.property ? l.property.items.enum : l.property.enum, c = (_) => {
1024
+ n("update:modelValue", _);
1025
+ };
1026
+ return $t(() => {
1027
+ l.modelValue || n(
1028
+ "update:modelValue",
1029
+ "items" in l.property ? [] : ""
1030
+ );
1031
+ }), (_, d) => (t(), s("div", {
1032
+ class: "options",
1033
+ style: be(`
1034
+ --columns: ${_.columns};
1035
+ grid-template-columns: repeat(var(--columns), 1fr);
1036
+ `)
1037
+ }, [
1038
+ (t(!0), s(N, null, D(e(i), (h) => (t(), s("div", {
1039
+ key: `option-${h}`,
1040
+ class: "options__checkbox"
1041
+ }, [
1042
+ F(Kn, Q({ ref_for: !0 }, {
1043
+ value: h,
1044
+ readOnly: e(a),
1045
+ property: _.property
1046
+ }, {
1047
+ "model-value": _.modelValue,
1048
+ "onUpdate:modelValue": c
1049
+ }), null, 16, ["model-value"])
1050
+ ]))), 128))
1051
+ ], 4));
1052
+ }
1053
+ });
1054
+ const Jn = /* @__PURE__ */ K(Yn, [["__scopeId", "data-v-4aed0c5c"]]), Zn = (u) => (De("data-v-0e3564b6"), u = u(), Qe(), u), Pn = { class: "switch-wrapper" }, Nn = /* @__PURE__ */ Zn(() => /* @__PURE__ */ C("div", { class: "switch__slider" }, null, -1)), xn = { key: 1 }, eo = {
1055
+ inheritAttrs: !1
1056
+ }, to = /* @__PURE__ */ E({
1057
+ ...eo,
1058
+ __name: "aeria-switch",
1059
+ props: {
1060
+ modelValue: {},
1061
+ property: {},
1062
+ propertyName: {},
1063
+ parentPropertyName: {},
1064
+ parentCollection: {},
1065
+ readOnly: { type: Boolean }
1066
+ },
1067
+ emits: ["update:modelValue", "change"],
1068
+ setup(u, { emit: r }) {
1069
+ const l = u, n = r, a = l.property, i = l.readOnly || (a == null ? void 0 : a.readOnly), c = () => {
1070
+ i || (n("change", !l.modelValue), n("update:modelValue", !l.modelValue));
1071
+ };
1072
+ return (_, d) => {
1073
+ var p;
1074
+ const h = oe("clickable");
1075
+ return t(), s("div", Pn, [
1076
+ x((t(), s("a", {
1077
+ class: X(`
1078
+ switch
1079
+ ${_.modelValue && "switch--active"}
1080
+ ${e(i) && "switch--readOnly"}
1081
+ `),
1082
+ onClick: ze(c, ["stop"])
1083
+ }, [
1084
+ Nn,
1085
+ C("div", {
1086
+ class: X(`
1087
+ switch__dummy
1088
+ ${!_.modelValue && "switch__dummy--flex"}
1089
+ `)
1090
+ }, null, 2)
1091
+ ], 2)), [
1092
+ [h, {
1093
+ blocked: e(i)
1094
+ }]
1095
+ ]),
1096
+ _.$slots.default ? O(_.$slots, "default", { key: 0 }, void 0, !0) : (t(), s("div", xn, k(((p = e(a)) == null ? void 0 : p.description) || _.propertyName), 1))
1097
+ ]);
1098
+ };
1099
+ }
1100
+ });
1101
+ const no = /* @__PURE__ */ K(to, [["__scopeId", "data-v-0e3564b6"]]), Ct = (u) => (De("data-v-153a2e0f"), u = u(), Qe(), u), oo = { class: "picture" }, ao = {
1102
+ key: 0,
1103
+ style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }
1104
+ }, lo = ["src", "alt"], so = {
1105
+ key: 0,
1106
+ class: "picture__meta"
1107
+ }, io = ["src"], ro = /* @__PURE__ */ Ct(() => /* @__PURE__ */ C("line", {
1108
+ x1: "0",
1109
+ y1: "0",
1110
+ x2: "200",
1111
+ y2: "200",
1112
+ stroke: "#000",
1113
+ "vector-effect": "non-scaling-stroke"
1114
+ }, null, -1)), uo = /* @__PURE__ */ Ct(() => /* @__PURE__ */ C("line", {
1115
+ x1: "200",
1116
+ y1: "0",
1117
+ x2: "0",
1118
+ y2: "200",
1119
+ stroke: "#000",
1120
+ "vector-effect": "non-scaling-stroke"
1121
+ }, null, -1)), co = [
1122
+ ro,
1123
+ uo
1124
+ ], po = { key: 5 }, _o = /* @__PURE__ */ E({
1125
+ __name: "aeria-picture",
1126
+ props: {
1127
+ url: {},
1128
+ alt: {},
1129
+ fileId: {},
1130
+ modelValue: {},
1131
+ objectFit: {},
1132
+ bordered: { type: Boolean },
1133
+ width: {},
1134
+ height: {},
1135
+ expandable: { type: Boolean },
1136
+ meta: {}
1137
+ },
1138
+ setup(u) {
1139
+ const r = u, l = G(() => r.fileId ? `${gt}/file/${r.fileId}/picture` : r.url || r.modelValue), n = J(!1);
1140
+ return (a, i) => {
1141
+ var _;
1142
+ const c = oe("overlay");
1143
+ return t(), s("figure", oo, [
1144
+ l.value ? (t(), $(Je, {
1145
+ key: 0,
1146
+ to: "main"
1147
+ }, [
1148
+ n.value ? x((t(), s("div", ao, [
1149
+ C("img", {
1150
+ src: l.value,
1151
+ alt: a.alt,
1152
+ style: `
1153
+ max-height: 60vh;
1154
+ object-fit: contain;
1155
+ `,
1156
+ onClick: i[0] || (i[0] = (d) => n.value = !0)
1157
+ }, null, 8, lo),
1158
+ (_ = a.meta) != null && _.owner ? (t(), s("div", so, " Criado por " + k(a.meta.owner.name) + " em " + k(a.formatDateTime(a.meta.created_at, { hours: !0 })), 1)) : y("", !0)
1159
+ ])), [
1160
+ [c, {
1161
+ click: () => {
1162
+ n.value = !1;
1163
+ }
1164
+ }]
1165
+ ]) : y("", !0)
1166
+ ])) : y("", !0),
1167
+ l.value ? (t(), s("img", {
1168
+ key: 1,
1169
+ src: l.value,
1170
+ class: X(`
1171
+ picture__image
1172
+ ${a.bordered && "picture__image--bordered"}
1173
+ ${a.expandable && "picture__image--expandable"}
1174
+ `),
1175
+ style: be(`
1176
+ object-fit: ${a.objectFit || "cover"};
1177
+ width: ${a.width || "100%"};
1178
+ height: ${a.height || "100%"};
1179
+ `),
1180
+ onClick: i[1] || (i[1] = () => {
1181
+ a.expandable && (n.value = !0);
1182
+ })
1183
+ }, null, 14, io)) : a.$slots.fallback ? O(a.$slots, "fallback", { key: 2 }, void 0, !0) : a.$slots.default ? O(a.$slots, "default", { key: 3 }, void 0, !0) : (t(), s("svg", {
1184
+ key: 4,
1185
+ class: X(["picture__background", `
1186
+ ${a.bordered && "picture__image--bordered"}
1187
+ `]),
1188
+ xmlns: "http://www.w3.org/2000/svg",
1189
+ viewBox: "0 0 200 200",
1190
+ preserveAspectRatio: "none",
1191
+ style: be(`
1192
+ object-fit: ${a.objectFit || "cover"};
1193
+ width: ${a.width || "100%"};
1194
+ height: ${a.height || "100%"};
1195
+ `)
1196
+ }, co, 6)),
1197
+ a.$slots.caption ? (t(), s("figcaption", po, [
1198
+ O(a.$slots, "caption", {}, void 0, !0)
1199
+ ])) : y("", !0)
1200
+ ]);
1201
+ };
1202
+ }
1203
+ });
1204
+ const He = /* @__PURE__ */ K(_o, [["__scopeId", "data-v-153a2e0f"]]), mo = { class: "file" }, fo = { key: 0 }, vo = ["href"], yo = {
1205
+ key: 1,
1206
+ class: "file__actions"
1207
+ }, ho = ["accept"], bo = {
1208
+ key: 0,
1209
+ class: "file__buttons"
1210
+ }, $o = {
1211
+ key: 1,
1212
+ class: "file__buttons"
1213
+ }, go = /* @__PURE__ */ E({
1214
+ __name: "aeria-file",
1215
+ props: {
1216
+ modelValue: {},
1217
+ property: {},
1218
+ propertyName: {},
1219
+ parentPropertyName: {},
1220
+ parentCollection: {},
1221
+ readOnly: { type: Boolean },
1222
+ meta: {},
1223
+ content: {}
1224
+ },
1225
+ emits: ["update:content", "change", "update:modelValue"],
1226
+ setup(u, { emit: r }) {
1227
+ var A;
1228
+ const l = u, n = r, i = Fe() ? Ie() : null, c = J(((A = l.modelValue) == null ? void 0 : A.file) || null), _ = G(() => {
1229
+ var b;
1230
+ return c.value ? URL.createObjectURL(c.value) : (b = l.modelValue) == null ? void 0 : b.link;
1231
+ }), d = G(() => {
1232
+ var b, S, j;
1233
+ return /^image\//.test((b = l.modelValue) == null ? void 0 : b.type) && !((S = c.value) != null && S.type) || /^image\//.test((j = c.value) == null ? void 0 : j.type);
1234
+ }), h = (b) => new Promise((S) => {
1235
+ const j = new FileReader();
1236
+ j.onload = () => S(j.result), j.readAsArrayBuffer(b);
1237
+ }), p = () => {
1238
+ l.modelValue.tempId && n("update:modelValue", null), c.value = null;
1239
+ }, o = async (b) => {
1240
+ c.value = b.target.files[0];
1241
+ const S = c.value, j = await h(S);
1242
+ if (i) {
1243
+ const { data: { error: P, result: B } } = await qt(`${gt}/${i.$id}/upload?name=${S.name}`, j, {
1244
+ params: {
1245
+ method: "POST",
1246
+ headers: {
1247
+ "content-type": S.type || "application/octet-stream",
1248
+ "x-stream-request": "1"
1249
+ }
1250
+ }
1251
+ });
1252
+ if (P)
1253
+ return;
1254
+ n("update:modelValue", {
1255
+ tempId: B.tempId,
1256
+ file: S
1257
+ });
1258
+ } else
1259
+ n("update:modelValue", S);
1260
+ n("update:content", j), n("change", j);
1261
+ }, m = async () => {
1262
+ n("update:modelValue", null);
1263
+ };
1264
+ return (b, S) => {
1265
+ var j, P, B, R, Y, w;
1266
+ return t(), s("div", mo, [
1267
+ c.value || (j = b.modelValue) != null && j._id ? (t(), s("div", fo, [
1268
+ d.value ? (t(), $(He, {
1269
+ key: 0,
1270
+ modelValue: _.value,
1271
+ "onUpdate:modelValue": S[0] || (S[0] = (te) => _.value = te),
1272
+ alt: "Image preview",
1273
+ expandable: b.readOnly,
1274
+ class: X(`
1275
+ file__image
1276
+ ${!e(i) || ((P = b.modelValue) == null ? void 0 : P._id) || "file__image--unsent"}
1277
+ `)
1278
+ }, null, 8, ["modelValue", "expandable", "class"])) : y("", !0),
1279
+ (B = b.modelValue) != null && B._id ? (t(), s("a", {
1280
+ key: 1,
1281
+ href: b.modelValue.download_link
1282
+ }, k(b.modelValue.name), 9, vo)) : y("", !0)
1283
+ ])) : y("", !0),
1284
+ b.readOnly ? y("", !0) : (t(), s("div", yo, [
1285
+ C("input", {
1286
+ ref: "file",
1287
+ type: "file",
1288
+ accept: (Y = (R = b.property) == null ? void 0 : R.accept) == null ? void 0 : Y.join(","),
1289
+ onChange: o
1290
+ }, null, 40, ho),
1291
+ c.value ? (t(), s("div", bo, [
1292
+ F(re, {
1293
+ small: "",
1294
+ onClick: ze(p, ["prevent"])
1295
+ }, {
1296
+ default: v(() => [
1297
+ W(k(e(L)("action.clear", { capitalize: !0 })), 1)
1298
+ ]),
1299
+ _: 1
1300
+ })
1301
+ ])) : (w = b.modelValue) != null && w._id ? (t(), s("div", $o, [
1302
+ F(re, {
1303
+ small: "",
1304
+ onClick: ze(m, ["prevent"])
1305
+ }, {
1306
+ default: v(() => [
1307
+ W(k(e(L)("action.remove", { capitalize: !0 })), 1)
1308
+ ]),
1309
+ _: 1
1310
+ })
1311
+ ])) : y("", !0)
1312
+ ]))
1313
+ ]);
1314
+ };
1315
+ }
1316
+ });
1317
+ const ko = /* @__PURE__ */ K(go, [["__scopeId", "data-v-e6cdde77"]]), Vo = { class: "container" }, Co = {
1318
+ key: 1,
1319
+ class: "container__footer"
1320
+ }, Oo = /* @__PURE__ */ E({
1321
+ __name: "aeria-search-container",
1322
+ props: {
1323
+ observeScroll: { type: Boolean }
1324
+ },
1325
+ emits: ["endReached"],
1326
+ setup(u, { emit: r }) {
1327
+ const l = u, n = r, a = J(null), i = l.observeScroll ? Ze(a, {
1328
+ antecipate: 100
1329
+ }).reachedEnd : null;
1330
+ return i !== null && ue(i, (c) => {
1331
+ c && n("endReached", c);
1332
+ }), (c, _) => (t(), s("div", Vo, [
1333
+ c.$slots.default ? (t(), s("div", {
1334
+ key: 0,
1335
+ ref_key: "containerEl",
1336
+ ref: a,
1337
+ class: "container__content"
1338
+ }, [
1339
+ O(c.$slots, "default", {}, void 0, !0)
1340
+ ], 512)) : y("", !0),
1341
+ c.$slots.footer ? (t(), s("div", Co, [
1342
+ O(c.$slots, "footer", {}, void 0, !0)
1343
+ ])) : y("", !0)
1344
+ ]));
1345
+ }
1346
+ });
1347
+ const mt = /* @__PURE__ */ K(Oo, [["__scopeId", "data-v-c86e2d2a"]]), Io = { class: "item__values" }, Ao = /* @__PURE__ */ E({
1348
+ __name: "aeria-search-item",
1349
+ props: {
1350
+ item: {},
1351
+ indexes: {},
1352
+ modelValue: {},
1353
+ property: {},
1354
+ readOnly: { type: Boolean }
1355
+ },
1356
+ emits: ["update:modelValue", "change"],
1357
+ setup(u, { emit: r }) {
1358
+ const l = Ae(), n = u, a = r, i = n.property, c = me(i), _ = Ie(), d = G(() => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && Object.values(n.modelValue).some(({ _id: m }) => n.item._id === m) : n.modelValue && n.modelValue._id === n.item._id), h = () => {
1359
+ if (d.value)
1360
+ return;
1361
+ const m = (b) => b.filter((S) => !!(S != null && S._id)), A = "items" in i ? m(Array.isArray(n.modelValue) ? n.modelValue : [n.modelValue]) : n.modelValue;
1362
+ Array.isArray(A) ? a("update:modelValue", A.concat([n.item])) : a("update:modelValue", n.item), a("change", n.item);
1363
+ }, p = async (m) => {
1364
+ if (c.purge && (m != null && m.purge)) {
1365
+ const { _id: b } = n.item;
1366
+ await _.$actions.remove({
1367
+ filters: {
1368
+ _id: b
1369
+ }
1370
+ });
1371
+ }
1372
+ const A = () => {
1373
+ const b = [...n.modelValue], S = b.findIndex((j) => j._id === n.item._id);
1374
+ return b.splice(S, 1), b;
1375
+ };
1376
+ a("update:modelValue", "items" in i ? A() : null);
1377
+ }, o = () => {
1378
+ if (n.readOnly) {
1379
+ l.push({
1380
+ name: "/dashboard/crud/:id",
1381
+ params: {
1382
+ collection: c.$ref,
1383
+ id: n.item._id
1384
+ }
1385
+ });
1386
+ return;
1387
+ }
1388
+ return d.value ? p() : h();
1389
+ };
1390
+ return (m, A) => {
1391
+ const b = oe("clickable");
1392
+ return x((t(), s("div", {
1393
+ class: X({
1394
+ item: !0,
1395
+ "item--selected": d.value
1396
+ }),
1397
+ onClick: o
1398
+ }, [
1399
+ O(m.$slots, "default", {}, void 0, !0),
1400
+ C("div", Io, [
1401
+ (t(!0), s(N, null, D(m.indexes, (S, j) => (t(), s("div", {
1402
+ key: `index-${m.item._id}-${j}`,
1403
+ class: "item__value"
1404
+ }, k(m.item[S]), 1))), 128))
1405
+ ]),
1406
+ m.readOnly ? (t(), $(Z, {
1407
+ key: 0,
1408
+ icon: "arrow-square-out",
1409
+ style: { "--icon-color": "var(--theme-brand-color-contrast)" }
1410
+ })) : y("", !0)
1411
+ ], 2)), [
1412
+ [b]
1413
+ ]);
1414
+ };
1415
+ }
1416
+ });
1417
+ const Xe = /* @__PURE__ */ K(Ao, [["__scopeId", "data-v-5e6ec702"]]), Bo = { class: "search__panel" }, wo = { class: "search__input" }, So = ["value"], To = { style: { flex: "1" } }, jo = { key: 1 }, Ro = { key: 0 }, Lo = { key: 1 }, zo = { class: "search__summary" }, Mo = {
1418
+ key: 1,
1419
+ class: "search"
1420
+ }, qo = { key: 0 }, Ee = 10, Fo = /* @__PURE__ */ E({
1421
+ __name: "aeria-search",
1422
+ props: {
1423
+ modelValue: {},
1424
+ parentPropertyName: {},
1425
+ parentCollection: {},
1426
+ readOnly: { type: Boolean },
1427
+ property: {},
1428
+ propertyName: {},
1429
+ selectOnly: { type: Boolean },
1430
+ panel: { default: void 0 }
1431
+ },
1432
+ emits: ["update:modelValue", "change", "update:panel"],
1433
+ setup(u, { emit: r }) {
1434
+ const l = u, n = me(l.property), a = l.panel !== void 0 ? G(() => l.panel) : J(!1), i = r, c = ie(me(l.property).$ref), _ = Fe(), d = _ ? Ie() : null, h = n.indexes;
1435
+ ye(Ue, me(l.property).$ref), ye("innerInputLabel", !0), ye("omitInputLabels", !0);
1436
+ const p = J(l.modelValue), o = J({
1437
+ data: [],
1438
+ pagination: {}
1439
+ }), m = G(() => o.value.data), A = G(() => o.value.pagination), b = J(0), S = J(h[0]), j = J(!1), P = J({}), B = () => {
1440
+ const z = {};
1441
+ if (_) {
1442
+ const U = e(_);
1443
+ z[U] = d;
1444
+ }
1445
+ return n.constraints ? Gt(n.constraints, z) : {};
1446
+ }, R = () => {
1447
+ m.value.length < A.value.recordsTotal && (b.value += 1, w());
1448
+ }, Y = async () => {
1449
+ if (Object.values(P.value).every((U) => !(String(U).length > 0)))
1450
+ return c.$actions.custom("getAll", {
1451
+ limit: Ee,
1452
+ offset: b.value * Ee,
1453
+ filters: B()
1454
+ });
1455
+ const z = h.filter((U) => {
1456
+ var f;
1457
+ return ((f = P.value[U]) == null ? void 0 : f.length) > 0;
1458
+ }).map((U) => ({
1459
+ [U]: {
1460
+ $regex: P.value[U].trim().replace("(", "\\(").replace(")", "\\)"),
1461
+ $options: "i"
1462
+ }
1463
+ }));
1464
+ return c.$actions.custom("getAll", {
1465
+ limit: Ee,
1466
+ offset: b.value * Ee,
1467
+ filters: {
1468
+ ...B(),
1469
+ ...z.length > 0 && {
1470
+ $or: z
1471
+ }
1472
+ }
1473
+ });
1474
+ }, w = async () => {
1475
+ if (c.loading.getAll)
1476
+ return;
1477
+ const { error: z, result: U } = await Y();
1478
+ if (z) {
1479
+ ie("meta").$actions.spawnToast({
1480
+ text: "Request failed",
1481
+ icon: "warning"
1482
+ });
1483
+ return;
1484
+ }
1485
+ o.value.pagination = U.pagination, b.value === 0 && o.value.data.splice(0), o.value.data.push(...U.data);
1486
+ }, [te] = kt({
1487
+ delay: 800
1488
+ })(() => {
1489
+ b.value = 0, w(), j.value = !1;
1490
+ }), V = () => {
1491
+ j.value = !0, te();
1492
+ }, T = () => {
1493
+ "effect" in a ? i("update:panel", !0) : a.value = !0, w();
1494
+ }, ae = () => {
1495
+ b.value = 0, o.value.data.splice(0), "effect" in a ? i("update:panel", !1) : a.value = !1;
1496
+ }, le = G(() => !Object.values(P.value).some((z) => !!z));
1497
+ ue(le, (z, U) => {
1498
+ z && !U && w();
1499
+ }), bt(() => {
1500
+ l.selectOnly && w();
1501
+ });
1502
+ const ne = (z) => {
1503
+ p.value = z, l.selectOnly || i("update:modelValue", z);
1504
+ }, se = () => {
1505
+ ae(), i("update:modelValue", p.value);
1506
+ };
1507
+ return (z, U) => {
1508
+ const f = oe("clickable");
1509
+ return t(), s("div", null, [
1510
+ e(a) ? (t(), $(Je, {
1511
+ key: 0,
1512
+ to: "main"
1513
+ }, [
1514
+ F(Be, {
1515
+ float: "",
1516
+ "close-hint": "",
1517
+ title: `${e(L)("action.select", { capitalize: !0 })} ${e(L)(z.propertyName)}`,
1518
+ "overlay-layer": 65,
1519
+ "model-value": e(a),
1520
+ style: { "--panel-max-width": "36rem" },
1521
+ onClose: ae,
1522
+ onOverlayClick: ae
1523
+ }, {
1524
+ footer: v(() => [
1525
+ F(re, {
1526
+ large: "",
1527
+ onClick: se
1528
+ }, {
1529
+ default: v(() => [
1530
+ W(k(e(L)("action.save", { capitalize: !0 })), 1)
1531
+ ]),
1532
+ _: 1
1533
+ })
1534
+ ]),
1535
+ default: v(() => {
1536
+ var M, H;
1537
+ return [
1538
+ C("div", Bo, [
1539
+ C("div", wo, [
1540
+ e(h).length > 1 ? (t(), $(Ge, {
1541
+ key: 0,
1542
+ modelValue: S.value,
1543
+ "onUpdate:modelValue": U[0] || (U[0] = (g) => S.value = g),
1544
+ style: { width: "auto" },
1545
+ onChange: U[1] || (U[1] = (g) => P.value = {})
1546
+ }, {
1547
+ default: v(() => [
1548
+ (t(!0), s(N, null, D(e(h), (g) => (t(), s("option", {
1549
+ key: `searchfield-${g}`,
1550
+ value: g
1551
+ }, k(e(L)(g)), 9, So))), 128))
1552
+ ]),
1553
+ _: 1
1554
+ }, 8, ["modelValue"])) : y("", !0),
1555
+ C("div", To, [
1556
+ (t(), $(Oe, {
1557
+ key: `field-${S.value}`,
1558
+ modelValue: P.value[S.value],
1559
+ "onUpdate:modelValue": U[2] || (U[2] = (g) => P.value[S.value] = g),
1560
+ property: {
1561
+ ...e(c).properties[S.value],
1562
+ inputType: "search"
1563
+ },
1564
+ onInput: V
1565
+ }, null, 8, ["modelValue", "property"]))
1566
+ ])
1567
+ ]),
1568
+ m.value.length ? (t(), $(mt, {
1569
+ key: 0,
1570
+ "observe-scroll": "",
1571
+ onEndReached: R
1572
+ }, {
1573
+ default: v(() => [
1574
+ (t(!0), s(N, null, D(m.value, (g) => (t(), $(Xe, Q({ ref_for: !0 }, {
1575
+ item: g,
1576
+ indexes: e(h),
1577
+ property: z.property
1578
+ }, {
1579
+ key: `matching-${g._id}`,
1580
+ modelValue: p.value,
1581
+ "onUpdate:modelValue": U[3] || (U[3] = (I) => p.value = I)
1582
+ }), null, 16, ["modelValue"]))), 128))
1583
+ ]),
1584
+ _: 1
1585
+ })) : (t(), s("div", jo, [
1586
+ j.value ? (t(), s("div", Ro, k(e(L)("searching", { capitalize: !0 })) + "... ", 1)) : !e(c).loading.getAll && Object.values(P.value).filter((g) => !!g).length > 0 && !("items" in z.property && ((M = z.modelValue) != null && M.length) || !Array.isArray(z.modelValue) && ((H = z.modelValue) != null && H._id)) ? (t(), s("div", Lo, k(e(L)("no_results", { capitalize: !0 })), 1)) : y("", !0)
1587
+ ]))
1588
+ ]),
1589
+ C("div", zo, k(e(L)("showing", { capitalize: !0 })) + " " + k(m.value.length) + " " + k(e(L)("of")) + " " + k(A.value.recordsTotal), 1)
1590
+ ];
1591
+ }),
1592
+ _: 1
1593
+ }, 8, ["title", "model-value"])
1594
+ ])) : y("", !0),
1595
+ z.selectOnly ? y("", !0) : (t(), s("div", Mo, [
1596
+ F(mt, null, ce({
1597
+ default: v(() => {
1598
+ var M;
1599
+ return [
1600
+ "items" in z.property ? (t(), s("div", qo, [
1601
+ (t(!0), s(N, null, D(z.modelValue, (H) => (t(), $(Xe, Q({ ref_for: !0 }, {
1602
+ item: H,
1603
+ indexes: e(h),
1604
+ property: z.property,
1605
+ readOnly: z.readOnly,
1606
+ modelValue: z.modelValue
1607
+ }, {
1608
+ key: `selected-${H._id}`,
1609
+ "onUpdate:modelValue": ne
1610
+ }), null, 16))), 128))
1611
+ ])) : (M = z.modelValue) != null && M._id ? (t(), $(Xe, Q({ key: 1 }, {
1612
+ item: z.modelValue,
1613
+ indexes: e(h),
1614
+ property: e(n),
1615
+ readOnly: z.readOnly,
1616
+ modelValue: z.modelValue
1617
+ }, { "onUpdate:modelValue": ne }), null, 16)) : y("", !0)
1618
+ ];
1619
+ }),
1620
+ _: 2
1621
+ }, [
1622
+ z.readOnly ? void 0 : {
1623
+ name: "footer",
1624
+ fn: v(() => [
1625
+ x((t(), $(Z, {
1626
+ icon: "plus",
1627
+ onClick: T
1628
+ }, {
1629
+ default: v(() => [
1630
+ W(k(e(L)("action.select", { capitalize: !0 })), 1)
1631
+ ]),
1632
+ _: 1
1633
+ })), [
1634
+ [f]
1635
+ ])
1636
+ ]),
1637
+ key: "0"
1638
+ }
1639
+ ]), 1024)
1640
+ ]))
1641
+ ]);
1642
+ };
1643
+ }
1644
+ });
1645
+ const Uo = /* @__PURE__ */ K(Fo, [["__scopeId", "data-v-15bbe202"]]), ft = (u, r) => {
1646
+ const l = "items" in u ? u.items : u, n = {
1647
+ options: Jn,
1648
+ select: Ge,
1649
+ switch: no,
1650
+ file: ko,
1651
+ search: Uo,
1652
+ input: Oe,
1653
+ form: We
1654
+ }, a = (() => {
1655
+ if ("type" in l) {
1656
+ if (l.type === "object")
1657
+ return "form";
1658
+ if (l.type === "boolean")
1659
+ return "switch";
1660
+ }
1661
+ if ("element" in u) {
1662
+ if (u.element === "checkbox" || u.element === "radio")
1663
+ return "options";
1664
+ if (u.element === "select")
1665
+ return "select";
1666
+ }
1667
+ const i = me(u);
1668
+ return i ? i.inline ? "form" : i.$ref === "file" ? "file" : "search" : "items" in u && u.uniqueItems ? "options" : "enum" in l ? "select" : "input";
1669
+ })();
1670
+ return r[a] ? r[a] : n[a];
1671
+ }, Eo = (u, r, l) => {
1672
+ u ?? (u = []);
1673
+ const n = "items" in r ? r.items : r;
1674
+ if ("$ref" in n) {
1675
+ const a = ie(n.$ref, l), i = ke(a.$freshItem);
1676
+ return u.push(i);
1677
+ }
1678
+ return "properties" in n ? u.push(Wt(n)) : "type" in n && n.type === "boolean" ? u.push({}) : u.push(null);
1679
+ }, Ho = (u, r) => {
1680
+ u.splice(r, 1);
1681
+ }, Do = {
1682
+ key: 0,
1683
+ class: "form__header"
1684
+ }, Qo = { class: "form__fieldset" }, Go = { key: 0 }, Wo = ["innerHTML"], Ko = ["onInput"], Xo = { key: 4 }, Yo = { value: "true" }, Jo = { value: "false" }, Zo = {
1685
+ key: 5,
1686
+ style: { display: "grid", "row-gap": ".4rem" }
1687
+ }, Po = { key: 0 }, No = { class: "form__array" }, xo = { style: { "flex-grow": "1" } }, ea = {
1688
+ key: 7,
1689
+ class: "form__validation-error"
1690
+ }, ta = { key: 0 }, na = { key: 1 }, oa = {
1691
+ key: 2,
1692
+ class: "form__footer"
1693
+ }, aa = /* @__PURE__ */ E({
1694
+ __name: "aeria-form",
1695
+ props: {
1696
+ modelValue: {},
1697
+ property: {},
1698
+ propertyName: {},
1699
+ parentPropertyName: {},
1700
+ parentCollection: {},
1701
+ readOnly: { type: Boolean },
1702
+ form: {},
1703
+ collection: {},
1704
+ searchOnly: { type: Boolean },
1705
+ layout: {},
1706
+ formLayout: {},
1707
+ required: {},
1708
+ formComponents: {},
1709
+ propertyComponents: {},
1710
+ omitFormHeader: { type: Boolean },
1711
+ omitInputLabels: { type: Boolean },
1712
+ innerInputLabel: { type: Boolean },
1713
+ validationErrors: { default: null },
1714
+ highlightRequired: { type: Boolean, default: !0 },
1715
+ focus: { type: Boolean },
1716
+ includeId: { type: Boolean },
1717
+ includeTimestamps: { type: Boolean }
1718
+ },
1719
+ emits: ["update:modelValue", "input", "change", "clipboardCopy"],
1720
+ setup(u, { emit: r }) {
1721
+ var U;
1722
+ const l = Pe(), n = u, a = r;
1723
+ $t(() => {
1724
+ n.modelValue || a("update:modelValue", n.property && "items" in n.property ? [] : {});
1725
+ });
1726
+ const i = n.property && me(n.property), c = i ? i.$ref : n.collection || Fe(), _ = n.readOnly || ((U = n.property) == null ? void 0 : U.readOnly), d = c ? ie(e(c)) : null;
1727
+ !c && process.env.NODE_ENV !== "production" && console.warn(`aeria-form was used without providing storeId or specifying
1728
+ collection prop, some features may not work as intended`);
1729
+ const h = J(!1), p = G(() => {
1730
+ const f = (() => !n.form && n.property ? "properties" in n.property ? n.property.properties : d == null ? void 0 : d.properties : n.form)();
1731
+ if (!f)
1732
+ return;
1733
+ const M = {};
1734
+ if (n.includeId && (M._id = {
1735
+ type: "string",
1736
+ readOnly: !0
1737
+ }), n.includeTimestamps) {
1738
+ const H = {
1739
+ type: "string",
1740
+ format: "date-time",
1741
+ readOnly: !0,
1742
+ isTimestamp: !0
1743
+ };
1744
+ f.created_at || (M.created_at = H), f.created_at || (M.updated_at = H);
1745
+ }
1746
+ return Object.assign(M, f), M;
1747
+ }), o = G(() => n.layout || (d == null ? void 0 : d.description.formLayout)), m = (f) => {
1748
+ const M = _e(f, n[f]);
1749
+ return n[f] && ye(f, n[f]), M;
1750
+ }, A = G(() => n.validationErrors !== null ? n.validationErrors : d == null ? void 0 : d.validationErrors), b = m("formComponents") || {}, S = m("propertyComponents") || {}, j = m("omitFormHeader"), P = m("omitInputLabels"), B = m("innerInputLabel");
1751
+ c && ye(Ue, c), ye("searchOnly", n.searchOnly);
1752
+ const R = (f) => p.value ? Object.entries(p.value).filter(([M, H]) => !H.noForm && f([
1753
+ M,
1754
+ H
1755
+ ])) : null, Y = (f, M) => {
1756
+ var g;
1757
+ if (n.searchOnly || !c || n.includeId && f === "_id" || n.includeTimestamps && M.isTimestamp)
1758
+ return !0;
1759
+ const H = n.property && "properties" in n.property ? n.property.form : (g = d == null ? void 0 : d.description) == null ? void 0 : g.form;
1760
+ return !H || H.includes(f);
1761
+ }, w = R(([f, M]) => Y(f, M)), te = qe(), V = {}, T = (f, M) => {
1762
+ var q, fe, we, Se;
1763
+ const H = [], g = ((fe = (q = o.value) == null ? void 0 : q.fields) == null ? void 0 : fe[f]) || ((Se = (we = o.value) == null ? void 0 : we.fields) == null ? void 0 : Se.$default);
1764
+ if (!M)
1765
+ return;
1766
+ if (g != null && g.if && !n.searchOnly) {
1767
+ const Te = Ye(
1768
+ n.modelValue,
1769
+ g.if
1770
+ );
1771
+ Te.satisfied || (V[f] && (d ? n.modelValue[f] = typeof d.$freshItem[f] == "object" ? ke(d.$freshItem[f]) : d.$freshItem[f] : n.modelValue[f] = [
1772
+ void 0,
1773
+ null
1774
+ ].includes(n.modelValue[f]) ? null : n.modelValue[f].constructor()), H.push("display: none;")), V[f] = Te.satisfied;
1775
+ }
1776
+ const I = te.value.md && (g == null ? void 0 : g.span) || 6;
1777
+ return H.push(`
1778
+ --field-span: ${I};
1779
+ grid-column: span var(--field-span) / span var(--field-span);
1780
+ `), g && (g.verticalSpacing && H.push(`
1781
+ --vertical-spacing: ${g.verticalSpacing};
1782
+ padding: var(--vertical-spacing) 0;
1783
+ `), g.separator && H.push(`
1784
+ border-top: 1px solid var(--theme-border-color);
1785
+ border-width: 1px 0 1px 0;
1786
+ padding: 1rem 0;
1787
+ margin: 1rem 0;
1788
+ `)), H.join("");
1789
+ }, ae = (f) => f === null || f instanceof Object && !Object.keys(f).length, le = G(() => n.required ? n.required : n.property && "required" in n.property ? n.property.required : d == null ? void 0 : d.description.required), ne = G(() => n.form ? Ft(
1790
+ n.modelValue,
1791
+ n.form,
1792
+ le.value,
1793
+ d == null ? void 0 : d.description
1794
+ ) : !0), se = (f, M) => {
1795
+ var H;
1796
+ return (H = A.value) != null && H[f] && (typeof A.value[f].index != "number" || A.value[f].index === M) ? A.value[f].errors : null;
1797
+ }, z = (f) => {
1798
+ if (!(_ || f.readOnly) && !n.parentPropertyName && !n.parentCollection && !h.value)
1799
+ return h.value = !0, !0;
1800
+ };
1801
+ return (f, M) => {
1802
+ const H = oe("clickable"), g = oe("focus");
1803
+ return t(), s("form", {
1804
+ class: "form",
1805
+ style: be(`row-gap: ${e(j) ? ".8rem" : "var(--form-internal-gap, 1.6rem);"};`)
1806
+ }, [
1807
+ f.$slots.header && !e(j) ? (t(), s("header", Do, [
1808
+ O(f.$slots, "header", {}, void 0, !0)
1809
+ ])) : y("", !0),
1810
+ O(f.$slots, "default", {}, void 0, !0),
1811
+ C("fieldset", Qo, [
1812
+ (t(!0), s(N, null, D(e(w), ([I, q]) => {
1813
+ var fe, we, Se, Te, Ne, xe, et, tt, nt, ot, at, lt, st;
1814
+ return t(), s("div", {
1815
+ key: `field-${I}`,
1816
+ style: be(T(I, q)),
1817
+ class: "form__field"
1818
+ }, [
1819
+ (!("type" in q) || q.type !== "boolean" || f.searchOnly) && !q.noLabel && !e(P) && !e(B) ? (t(), s("label", Go, [
1820
+ C("div", {
1821
+ class: X({
1822
+ "form__field-label": !0,
1823
+ "form__field-label--section": "items" in q ? "properties" in q.items : "properties" in q,
1824
+ "form__field-required-hint": f.highlightRequired && !e(_) && !f.searchOnly && (!le.value || e(Kt)(I, le.value, f.modelValue))
1825
+ })
1826
+ }, k(q.description || e(L)(I)), 3),
1827
+ q.hint ? (t(), s("div", {
1828
+ key: 0,
1829
+ innerHTML: q.hint
1830
+ }, null, 8, Wo)) : y("", !0)
1831
+ ])) : y("", !0),
1832
+ f.$slots[`field-${I}`] ? O(f.$slots, `field-${I}`, Q({
1833
+ key: 1,
1834
+ ref_for: !0
1835
+ }, {
1836
+ propery: q,
1837
+ properyName: I,
1838
+ modelValue: f.modelValue
1839
+ }), void 0, !0) : (Se = (we = (fe = f.layout) == null ? void 0 : fe.fields) == null ? void 0 : we[I]) != null && Se.component && e(S)[f.layout.fields[I].component.name] ? (t(), $(he(e(S)[f.layout.fields[I].component.name]), Q({
1840
+ key: 2,
1841
+ modelValue: f.modelValue[I],
1842
+ "onUpdate:modelValue": (ee) => f.modelValue[I] = ee,
1843
+ ref_for: !0
1844
+ }, {
1845
+ readOnly: e(_),
1846
+ property: q,
1847
+ propertyName: I,
1848
+ ...f.layout.fields[I].component.props || {}
1849
+ }, {
1850
+ onInput: (ee) => a("input", I),
1851
+ onChange: M[0] || (M[0] = (ee) => a("change", ee))
1852
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])) : "format" in q && ["date", "date-time"].includes(q.format) && f.searchOnly ? (t(), s("div", {
1853
+ key: 3,
1854
+ style: { display: "grid", "grid-template-columns": "repeat(2, 1fr)", "column-gap": "1rem" },
1855
+ onInput: (ee) => a("input", I),
1856
+ onChange: M[1] || (M[1] = (ee) => a("change", ee))
1857
+ }, [
1858
+ F(Oe, Q({
1859
+ modelValue: f.modelValue[I].$gte,
1860
+ "onUpdate:modelValue": (ee) => f.modelValue[I].$gte = ee,
1861
+ ref_for: !0
1862
+ }, {
1863
+ property: q,
1864
+ propertyName: I
1865
+ }), null, 16, ["modelValue", "onUpdate:modelValue"]),
1866
+ F(Oe, Q({
1867
+ modelValue: f.modelValue[I].$lte,
1868
+ "onUpdate:modelValue": (ee) => f.modelValue[I].$lte = ee,
1869
+ ref_for: !0
1870
+ }, {
1871
+ property: q,
1872
+ propertyName: I
1873
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])
1874
+ ], 40, Ko)) : "type" in q && q.type === "boolean" && f.searchOnly ? (t(), s("div", Xo, [
1875
+ F(Ge, Q({ ref_for: !0 }, {
1876
+ property: q,
1877
+ propertyName: I
1878
+ }, {
1879
+ "boolean-ref": "",
1880
+ "model-value": f.modelValue[I],
1881
+ onChange: M[2] || (M[2] = (ee) => a("change", ee)),
1882
+ "onUpdate:modelValue": (ee) => {
1883
+ f.modelValue[I] = ee == "true" ? !0 : ee == "false" ? !1 : null;
1884
+ }
1885
+ }), {
1886
+ default: v(() => [
1887
+ C("option", Yo, k(e(L)("yes")), 1),
1888
+ C("option", Jo, k(e(L)("no")), 1)
1889
+ ]),
1890
+ _: 2
1891
+ }, 1040, ["model-value", "onUpdate:modelValue"])
1892
+ ])) : f.modelValue && "items" in q && !q.uniqueItems && (!("$ref" in q.items) || q.items.inline || q.items.$ref === "file") ? (t(), s("div", Zo, [
1893
+ e(_) ? y("", !0) : (t(), s("div", Po, [
1894
+ F(re, {
1895
+ small: "",
1896
+ variant: "alt",
1897
+ icon: "plus",
1898
+ disabled: !("inline" in q.items && q.items.inline) && (((Te = f.modelValue[I]) == null ? void 0 : Te.length) >= q.maxItems || ae((xe = f.modelValue[I]) == null ? void 0 : xe[((Ne = f.modelValue[I]) == null ? void 0 : Ne.length) - 1])),
1899
+ onClick: ze((ee) => {
1900
+ f.modelValue[I] || (f.modelValue[I] = []), e(Eo)(f.modelValue[I], q, e(l));
1901
+ }, ["prevent"])
1902
+ }, {
1903
+ default: v(() => [
1904
+ W(k(e(L)("action.add", { capitalize: !0 })), 1)
1905
+ ]),
1906
+ _: 2
1907
+ }, 1032, ["disabled", "onClick"])
1908
+ ])),
1909
+ C("div", No, [
1910
+ (t(!0), s(N, null, D(f.modelValue[I], (ee, je) => {
1911
+ var it, rt, ut, ct, dt, pt;
1912
+ return t(), s("div", {
1913
+ key: `rep-${I}-${e(Ut)(ee, je)}`,
1914
+ class: "form__array-item"
1915
+ }, [
1916
+ C("div", xo, [
1917
+ (t(), $(he(e(ft)(q, e(b))), Q({
1918
+ modelValue: f.modelValue[I][je],
1919
+ "onUpdate:modelValue": (Re) => f.modelValue[I][je] = Re,
1920
+ ref_for: !0
1921
+ }, {
1922
+ readOnly: e(_),
1923
+ property: q.items,
1924
+ propertyName: I,
1925
+ parentCollection: e(c),
1926
+ parentPropertyName: f.parentPropertyName,
1927
+ columns: ((ut = (rt = (it = f.layout) == null ? void 0 : it.fields) == null ? void 0 : rt[I]) == null ? void 0 : ut.optionsColumns) || ((pt = (dt = (ct = f.layout) == null ? void 0 : ct.fields) == null ? void 0 : dt.$default) == null ? void 0 : pt.optionsColumns),
1928
+ validationErrors: se(I, je),
1929
+ ...q.componentProps || {}
1930
+ }, {
1931
+ onInput: (Re) => a("input", I),
1932
+ onChange: M[3] || (M[3] = (Re) => a("change", Re))
1933
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"]))
1934
+ ]),
1935
+ e(_) ? y("", !0) : x((t(), $(Z, {
1936
+ key: 0,
1937
+ reactive: "",
1938
+ icon: "trash",
1939
+ onClick: (Re) => e(Ho)(f.modelValue[I], je)
1940
+ }, null, 8, ["onClick"])), [
1941
+ [H]
1942
+ ])
1943
+ ]);
1944
+ }), 128))
1945
+ ])
1946
+ ])) : f.modelValue ? x((t(), $(he(e(ft)(q, e(b))), Q({
1947
+ key: 6,
1948
+ modelValue: f.modelValue[I],
1949
+ "onUpdate:modelValue": (ee) => f.modelValue[I] = ee,
1950
+ ref_for: !0
1951
+ }, {
1952
+ readOnly: e(_),
1953
+ property: q,
1954
+ propertyName: I,
1955
+ parentPropertyName: f.parentPropertyName,
1956
+ parentCollection: e(c),
1957
+ columns: ((nt = (tt = (et = f.layout) == null ? void 0 : et.fields) == null ? void 0 : tt[I]) == null ? void 0 : nt.optionsColumns) || ((lt = (at = (ot = f.layout) == null ? void 0 : ot.fields) == null ? void 0 : at.$default) == null ? void 0 : lt.optionsColumns),
1958
+ ...q.componentProps || {},
1959
+ validationErrors: se(I)
1960
+ }, {
1961
+ onInput: (ee) => a("input", I),
1962
+ onChange: M[4] || (M[4] = (ee) => a("change", ee)),
1963
+ onClipboardCopy: M[5] || (M[5] = (ee) => a("clipboardCopy", ee))
1964
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])), [
1965
+ [g, z(q)]
1966
+ ]) : y("", !0),
1967
+ (st = A.value) != null && st[I] ? (t(), s("div", ea, [
1968
+ A.value[I].type ? (t(), s("span", ta, k(e(L)(`validation_error.${A.value[I].type}`)), 1)) : y("", !0),
1969
+ A.value[I].detail ? (t(), s("span", na, k(e(L)(A.value[I].detail)), 1)) : y("", !0)
1970
+ ])) : y("", !0)
1971
+ ], 4);
1972
+ }), 128))
1973
+ ]),
1974
+ f.$slots.after ? O(f.$slots, "after", { key: 1 }, void 0, !0) : y("", !0),
1975
+ f.$slots.footer ? (t(), s("div", oa, [
1976
+ O(f.$slots, "footer", pe(Ve({
1977
+ isInsertReady: ne.value
1978
+ })), void 0, !0)
1979
+ ])) : y("", !0)
1980
+ ], 4);
1981
+ };
1982
+ }
1983
+ });
1984
+ const We = /* @__PURE__ */ K(aa, [["__scopeId", "data-v-2b4560f7"]]), la = /* @__PURE__ */ E({
1985
+ __name: "aeria-filter-panel",
1986
+ emits: ["update:modelValue"],
1987
+ setup(u, { emit: r }) {
1988
+ const l = r, n = Ie(), a = Ae(), i = e(_e(Ue)), c = () => {
1989
+ n.pagination.offset = 0, n.$actions.filter(), l("update:modelValue", !1);
1990
+ const _ = Object.assign({
1991
+ query: {}
1992
+ }, a.currentRoute.value);
1993
+ for (const d of Object.keys(_.query))
1994
+ d.startsWith(`${i}.`) && delete _.query[d];
1995
+ a.currentRoute.value.query = {}, a.push(Me(_, {
1996
+ query: Et(n)
1997
+ }));
1998
+ };
1999
+ return (_, d) => (t(), $(Be, {
2000
+ "close-hint": "",
2001
+ "fixed-right": "",
2002
+ title: _.t("filter_by", { capitalize: !0 }),
2003
+ onClose: d[2] || (d[2] = (h) => l("update:modelValue", !1)),
2004
+ onOverlayClick: d[3] || (d[3] = (h) => l("update:modelValue", !1))
2005
+ }, {
2006
+ footer: v(() => [
2007
+ e(n).filtersCount > 0 ? (t(), $(re, {
2008
+ key: 0,
2009
+ variant: "transparent",
2010
+ onClick: d[1] || (d[1] = (h) => {
2011
+ e(n).$actions.clearFilters(), c(), l("update:modelValue", !1);
2012
+ })
2013
+ }, {
2014
+ default: v(() => [
2015
+ W(k(_.t("action.clear", { capitalize: !0 })) + " ", 1),
2016
+ F($e, null, {
2017
+ default: v(() => [
2018
+ W(k(e(n).filtersCount), 1)
2019
+ ]),
2020
+ _: 1
2021
+ })
2022
+ ]),
2023
+ _: 1
2024
+ })) : y("", !0),
2025
+ F(re, {
2026
+ large: "",
2027
+ icon: "funnel",
2028
+ disabled: !e(n).hasActiveFilters,
2029
+ onClick: c
2030
+ }, {
2031
+ default: v(() => [
2032
+ W(k(_.t("action.filter", { capitalize: !0 })), 1)
2033
+ ]),
2034
+ _: 1
2035
+ }, 8, ["disabled"])
2036
+ ]),
2037
+ default: v(() => [
2038
+ F(We, Q({
2039
+ modelValue: e(n).filters,
2040
+ "onUpdate:modelValue": d[0] || (d[0] = (h) => e(n).filters = h)
2041
+ }, {
2042
+ searchOnly: !0,
2043
+ form: e(n).availableFilters,
2044
+ layout: e(n).description.formLayout || {}
2045
+ }, { focus: "" }), null, 16, ["modelValue"])
2046
+ ]),
2047
+ _: 1
2048
+ }, 8, ["title"]));
2049
+ }
2050
+ }), sa = /* @__PURE__ */ E({
2051
+ __name: "aeria-insert-panel",
2052
+ props: {
2053
+ collection: {},
2054
+ modelValue: { type: [Boolean, String] },
2055
+ readOnly: { type: Boolean },
2056
+ includeId: { type: Boolean },
2057
+ includeTimestamps: { type: Boolean }
2058
+ },
2059
+ emits: ["update:modelValue", "cancel"],
2060
+ setup(u, { emit: r }) {
2061
+ const l = u, n = r, a = ie("meta"), i = ie(l.collection || a.view.collection), c = _e("individualActions", []), _ = async () => {
2062
+ const { error: o } = await i.$actions.deepInsert();
2063
+ o || n("update:modelValue", !1);
2064
+ }, { t: d } = Lt(), h = () => {
2065
+ a.$actions.ask({
2066
+ action: () => {
2067
+ i.$actions.clearItem(), i.validationErrors = {}, n("cancel");
2068
+ },
2069
+ body: d("prompt.close_panel")
2070
+ });
2071
+ }, p = () => a.$actions.spawnToast({
2072
+ icon: "info",
2073
+ text: d("copied_to_clipboard")
2074
+ });
2075
+ return ue(() => i.item._id, (o) => {
2076
+ o === null && n("update:modelValue", !1);
2077
+ }), (o, m) => {
2078
+ const A = oe("clickable");
2079
+ return t(), $(Be, {
2080
+ loading: e(i).loading.get,
2081
+ onOverlayClick: h
2082
+ }, ce({
2083
+ extra: v(() => [
2084
+ F(Ce, Q({
2085
+ subject: e(i).item,
2086
+ actions: e(c).filter(({ action: b }) => b !== "ui:spawnEdit")
2087
+ }, {
2088
+ onActionClick: m[2] || (m[2] = (b) => n("update:modelValue", !1))
2089
+ }), {
2090
+ default: v(() => [
2091
+ e(i).item._id ? x((t(), $(Z, {
2092
+ key: 0,
2093
+ reactive: "",
2094
+ icon: "dots-three"
2095
+ }, null, 512)), [
2096
+ [A]
2097
+ ]) : y("", !0)
2098
+ ]),
2099
+ _: 1
2100
+ }, 16)
2101
+ ]),
2102
+ default: v(() => [
2103
+ F(We, Q({
2104
+ modelValue: e(i).item,
2105
+ "onUpdate:modelValue": m[0] || (m[0] = (b) => e(i).item = b)
2106
+ }, {
2107
+ readOnly: o.readOnly,
2108
+ includeId: o.includeId,
2109
+ includeTimestamps: o.includeTimestamps,
2110
+ collection: e(a).view.collection,
2111
+ form: e(i).description.form ? e(i).$actions.useProperties(e(i).description.form) : e(i).properties,
2112
+ layout: e(i).description.formLayout || {}
2113
+ }, {
2114
+ focus: "",
2115
+ onClipboardCopy: p,
2116
+ onAdd: m[1] || (m[1] = (b) => b.preventDefault())
2117
+ }), ce({ _: 2 }, [
2118
+ D(Object.keys(o.$slots).filter((b) => b.startsWith("field-")), (b) => ({
2119
+ name: b,
2120
+ fn: v((S) => [
2121
+ O(o.$slots, b, pe(Ve(S)))
2122
+ ])
2123
+ }))
2124
+ ]), 1040, ["modelValue"])
2125
+ ]),
2126
+ _: 2
2127
+ }, [
2128
+ o.$slots.header ? {
2129
+ name: "header",
2130
+ fn: v(() => [
2131
+ O(o.$slots, "header")
2132
+ ]),
2133
+ key: "0"
2134
+ } : void 0,
2135
+ o.readOnly ? void 0 : {
2136
+ name: "footer",
2137
+ fn: v(() => [
2138
+ F(re, {
2139
+ variant: "transparent",
2140
+ onClick: h
2141
+ }, {
2142
+ default: v(() => [
2143
+ W(k(e(d)("action.cancel", { capitalize: !0 })), 1)
2144
+ ]),
2145
+ _: 1
2146
+ }),
2147
+ F(re, {
2148
+ large: "",
2149
+ disabled: !e(i).isInsertReady || e(i).loading.get,
2150
+ loading: e(i).loading.insert,
2151
+ onClick: _
2152
+ }, {
2153
+ default: v(() => [
2154
+ W(k(e(d)("action.insert", { capitalize: !0 })), 1)
2155
+ ]),
2156
+ _: 1
2157
+ }, 8, ["disabled", "loading"])
2158
+ ]),
2159
+ key: "1"
2160
+ }
2161
+ ]), 1032, ["loading"]);
2162
+ };
2163
+ }
2164
+ }), Ot = (u, r) => {
2165
+ if (r) {
2166
+ if (!u) {
2167
+ r.filtersPreset = {}, r.preferredTableProperties = [], r.pagination.offset = 0;
2168
+ return;
2169
+ }
2170
+ r.filtersPreset = u.filters || {}, r.preferredTableProperties = u.table ? Array.from(u.table) : [], r.pagination.offset = 0;
2171
+ }
2172
+ }, ia = (u, r = {
2173
+ persistInQuery: !0
2174
+ }) => {
2175
+ const n = Ae().currentRoute;
2176
+ return ue(() => n.value.query.section, (a) => {
2177
+ if (u) {
2178
+ if (u.description.filtersPresets) {
2179
+ const i = a || Object.keys(u.description.filtersPresets)[0];
2180
+ Ot(u.description.filtersPresets[i], u);
2181
+ }
2182
+ if (r.persistInQuery) {
2183
+ const i = n.value.query;
2184
+ i.offset && (u.pagination.offset = +i.offset), i.limit && (u.pagination.limit = +i.limit), i.search && (u.textQuery = i.search, u.filters.$text = {
2185
+ $search: `"${i.search}"`,
2186
+ $caseSensitive: !1
2187
+ });
2188
+ }
2189
+ }
2190
+ }, {
2191
+ immediate: !0
2192
+ });
2193
+ }, ra = (u) => (De("data-v-2a6c7067"), u = u(), Qe(), u), ua = {
2194
+ key: 0,
2195
+ class: "table aeria-surface"
2196
+ }, ca = { key: 0 }, da = { key: 1 }, pa = { key: 0 }, _a = ["checked"], ma = {
2197
+ key: 1,
2198
+ style: { "text-align": "right" }
2199
+ }, fa = { key: 2 }, va = { key: 3 }, ya = ["onClick"], ha = { key: 0 }, ba = ["value"], $a = { class: "table__cell-mobile-label" }, ga = {
2200
+ key: 0,
2201
+ class: "table__cell-container"
2202
+ }, ka = {
2203
+ key: 1,
2204
+ class: "table__cell-container"
2205
+ }, Va = { class: "table__cell-grid" }, Ca = { key: 0 }, Oa = { key: 1 }, Ia = { key: 0 }, Aa = ["href"], Ba = { key: 3 }, wa = { key: 1 }, Sa = { key: 2 }, Ta = { key: 0 }, ja = { key: 1 }, Ra = { key: 2 }, La = {
2206
+ key: 1,
2207
+ class: "no-print"
2208
+ }, za = { class: "table__cell-actions" }, Ma = {
2209
+ key: 2,
2210
+ class: "no-print table__mobile-actions"
2211
+ }, qa = ["id"], Fa = { key: 1 }, Ua = /* @__PURE__ */ ra(() => /* @__PURE__ */ C("td", { colspan: 10 }, [
2212
+ /* @__PURE__ */ C("div", { class: "table__empty" }, " Não foram encontrados resultados. ")
2213
+ ], -1)), Ea = [
2214
+ Ua
2215
+ ], Ha = /* @__PURE__ */ E({
2216
+ __name: "aeria-table",
2217
+ props: {
2218
+ columns: {},
2219
+ rows: {},
2220
+ collection: {},
2221
+ checkbox: { type: Boolean },
2222
+ actions: {},
2223
+ layout: {}
2224
+ },
2225
+ emits: ["itemClick"],
2226
+ setup(u, { emit: r }) {
2227
+ const l = u, n = r, a = qe(), i = l.collection || Fe(), c = i ? ie(typeof i == "string" ? i : i.value) : null, _ = G({
2228
+ get: () => c == null ? void 0 : c.selected,
2229
+ set: (m) => c == null ? void 0 : c.$actions.selectManyItems(m, !0)
2230
+ }), d = (m, A) => m != null && m.button ? typeof m.button == "object" ? Ye(A, m.button).satisfied : m.button : !1, h = (m) => {
2231
+ var A;
2232
+ return !a.value.xl || !((A = l.layout) != null && A.actions) || !l.actions ? [] : l.actions.filter((b) => {
2233
+ const S = l.layout.actions[b.action];
2234
+ return d(S, m);
2235
+ });
2236
+ }, p = (m) => {
2237
+ var A;
2238
+ return l.actions ? !a.value.xl || !((A = l.layout) != null && A.actions) ? l.actions : l.actions.filter((b) => {
2239
+ const S = l.layout.actions[b.action];
2240
+ if (b.roles) {
2241
+ const j = ie("user");
2242
+ if (!Vt(b.roles, j.currentUser.roles))
2243
+ return !1;
2244
+ }
2245
+ return !d(S, m);
2246
+ }) : [];
2247
+ }, o = (m, A) => {
2248
+ var j, P;
2249
+ const b = [], S = (P = (j = l.layout) == null ? void 0 : j.actions) == null ? void 0 : P[A.action];
2250
+ return S != null && S.if && (Ye(
2251
+ m,
2252
+ S.if
2253
+ ).satisfied || b.push("display: none;")), b.join("");
2254
+ };
2255
+ return (m, A) => {
2256
+ var S, j, P;
2257
+ const b = oe("clickable");
2258
+ return m.columns && Object.keys(m.columns).length > 0 || m.$slots.thead ? (t(), s("table", ua, [
2259
+ m.$slots.thead ? (t(), s("thead", ca, [
2260
+ O(m.$slots, "thead", {}, void 0, !0)
2261
+ ])) : (t(), s("thead", da, [
2262
+ C("tr", null, [
2263
+ m.checkbox && e(c) && e(a).md ? (t(), s("th", pa, [
2264
+ C("input", {
2265
+ type: "checkbox",
2266
+ checked: e(c).selected.length > 0 && e(c).selected.length === e(c).itemsCount,
2267
+ onChange: A[0] || (A[0] = (B) => e(c).$actions.selectAllItems(B.target.checked))
2268
+ }, null, 40, _a)
2269
+ ])) : y("", !0),
2270
+ (t(!0), s(N, null, D(Object.entries(m.columns), ([B, R], Y) => (t(), s("th", {
2271
+ key: `header-${Y}`,
2272
+ class: "table__header"
2273
+ }, k(R.description || e(L)(B)), 1))), 128)),
2274
+ (S = m.actions) != null && S.length ? (t(), s("th", ma)) : y("", !0)
2275
+ ])
2276
+ ])),
2277
+ m.$slots.tbody ? (t(), s("tbody", fa, [
2278
+ O(m.$slots, "tbody", {}, void 0, !0)
2279
+ ])) : (t(), s("tbody", va, [
2280
+ (t(!0), s(N, null, D(m.rows, (B) => {
2281
+ var R, Y;
2282
+ return t(), s("tr", {
2283
+ key: B._id,
2284
+ onClick: (w) => n("itemClick", B)
2285
+ }, [
2286
+ e(c) && m.checkbox && e(a).md ? (t(), s("td", ha, [
2287
+ x(C("input", {
2288
+ "onUpdate:modelValue": A[1] || (A[1] = (w) => _.value = w),
2289
+ type: "checkbox",
2290
+ value: B._id
2291
+ }, null, 8, ba), [
2292
+ [Bt, _.value]
2293
+ ])
2294
+ ])) : y("", !0),
2295
+ (t(!0), s(N, null, D(Object.entries(m.columns), ([w, te], V) => {
2296
+ var T, ae, le;
2297
+ return t(), s("td", {
2298
+ key: `column-${B._id}-${V}`
2299
+ }, [
2300
+ C("div", $a, k(te.description || e(L)(w)), 1),
2301
+ `row-${w}` in m.$slots ? (t(), s("div", ga, [
2302
+ O(m.$slots, `row-${w}`, Q({ ref_for: !0 }, {
2303
+ store: e(c),
2304
+ column: w,
2305
+ property: te,
2306
+ row: B
2307
+ }), void 0, !0)
2308
+ ])) : (t(), s("div", ka, [
2309
+ C("div", Va, [
2310
+ "type" in te && te.type === "boolean" ? (t(), s("div", Ca, [
2311
+ B[w] ? (t(), $(Z, {
2312
+ key: 0,
2313
+ icon: "check",
2314
+ "icon-classes": "aeria-blueish"
2315
+ }, {
2316
+ default: v(() => [
2317
+ W(k(e(L)("yes")), 1)
2318
+ ]),
2319
+ _: 1
2320
+ })) : (t(), $(Z, {
2321
+ key: 1,
2322
+ icon: "x",
2323
+ "icon-classes": "aeria-redish"
2324
+ }, {
2325
+ default: v(() => [
2326
+ W(k(e(L)("no")), 1)
2327
+ ]),
2328
+ _: 1
2329
+ }))
2330
+ ])) : ((T = e(me)(te)) == null ? void 0 : T.$ref) === "file" ? (t(), s("div", Oa, [
2331
+ B[w] ? (t(), s("div", Ia, [
2332
+ "items" in te && B[w][0] && /^image/.test(B[w][0].type) ? (t(), $(He, {
2333
+ key: 0,
2334
+ modelValue: B[w][0].link,
2335
+ "onUpdate:modelValue": (ne) => B[w][0].link = ne,
2336
+ expandable: "",
2337
+ meta: B[w][0],
2338
+ alt: "Row image",
2339
+ class: "table__picture"
2340
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : /^image/.test(B[w].type) ? (t(), $(He, {
2341
+ key: 1,
2342
+ modelValue: B[w].link,
2343
+ "onUpdate:modelValue": (ne) => B[w].link = ne,
2344
+ expandable: "",
2345
+ meta: B[w],
2346
+ alt: "Row image",
2347
+ class: "table__picture"
2348
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : B[w].link ? (t(), s("a", {
2349
+ key: 2,
2350
+ href: B[w].link,
2351
+ style: { "font-size": "10pt" }
2352
+ }, k(B[w].filename), 9, Aa)) : (t(), s("div", Ba, " - "))
2353
+ ])) : (t(), s("div", wa, " - "))
2354
+ ])) : (t(), s("div", Sa, [
2355
+ e(c) ? (t(), s("span", Ta, k(e(c).$actions.formatValue({
2356
+ value: B[w],
2357
+ key: w,
2358
+ property: te
2359
+ })), 1)) : (t(), s("span", ja, k(Array.isArray(B[w]) ? B[w].filter((ne) => !!ne).join(", ") : [void 0, null].includes(B[w]) ? "-" : B[w]), 1)),
2360
+ ((le = (ae = e(me)(te)) == null ? void 0 : ae.indexes) == null ? void 0 : le.length) > 1 ? (t(), s("div", Ra, [
2361
+ (t(!0), s(N, null, D(e(me)(te).indexes.slice(1, 2), (ne, se) => (t(), s("div", {
2362
+ key: `subvalue-${se}`,
2363
+ class: "table__cell-subvalue"
2364
+ }, k(e(c).$actions.formatValue({
2365
+ value: B[w],
2366
+ key: w,
2367
+ property: te,
2368
+ index: ne
2369
+ })), 1))), 128))
2370
+ ])) : y("", !0)
2371
+ ]))
2372
+ ])
2373
+ ]))
2374
+ ]);
2375
+ }), 128)),
2376
+ (R = m.actions) != null && R.length && e(a).md ? (t(), s("td", La, [
2377
+ C("div", za, [
2378
+ (t(!0), s(N, null, D(h(B), (w) => (t(), $(re, {
2379
+ key: `action-${w.action}`,
2380
+ small: "",
2381
+ variant: "transparent",
2382
+ icon: w.icon,
2383
+ style: be(o(B, w)),
2384
+ onClick: (te) => w.click(B)
2385
+ }, {
2386
+ default: v(() => [
2387
+ W(k(e(L)(w.label)), 1)
2388
+ ]),
2389
+ _: 2
2390
+ }, 1032, ["icon", "style", "onClick"]))), 128)),
2391
+ p(B).length > 0 ? (t(), $(Ce, Q({
2392
+ key: 0,
2393
+ ref_for: !0
2394
+ }, {
2395
+ subject: B,
2396
+ actions: p(B)
2397
+ }), {
2398
+ default: v(() => [
2399
+ x(F(Z, {
2400
+ reactive: "",
2401
+ icon: "dots-three"
2402
+ }, null, 512), [
2403
+ [b]
2404
+ ])
2405
+ ]),
2406
+ _: 2
2407
+ }, 1040)) : y("", !0)
2408
+ ])
2409
+ ])) : (Y = m.actions) != null && Y.length ? (t(), s("td", Ma, [
2410
+ C("div", {
2411
+ class: "table__mobile-actions-grid",
2412
+ style: be(`grid-template-columns: repeat(${h(B).length + (p(B).length ? 1 : 0)}, 1fr);`)
2413
+ }, [
2414
+ (t(!0), s(N, null, D(h(B), (w) => (t(), $(ve, {
2415
+ key: `action-${w.action}`,
2416
+ class: "table__mobile-actions-button",
2417
+ onClick: (te) => w.click(B)
2418
+ }, {
2419
+ default: v(() => [
2420
+ F(Z, {
2421
+ icon: w.icon || "gear"
2422
+ }, {
2423
+ default: v(() => [
2424
+ W(k(e(L)(w.label)), 1)
2425
+ ]),
2426
+ _: 2
2427
+ }, 1032, ["icon"])
2428
+ ]),
2429
+ _: 2
2430
+ }, 1032, ["onClick"]))), 128)),
2431
+ p(B).length > 0 ? (t(), $(Ce, Q({
2432
+ key: 0,
2433
+ ref_for: !0
2434
+ }, {
2435
+ subject: B,
2436
+ actions: p(B)
2437
+ }), {
2438
+ default: v(() => [
2439
+ F(Z, {
2440
+ icon: "dots-three",
2441
+ class: "table__mobile-actions-button"
2442
+ })
2443
+ ]),
2444
+ _: 2
2445
+ }, 1040)) : y("", !0)
2446
+ ], 4)
2447
+ ])) : y("", !0),
2448
+ C("div", {
2449
+ id: `dropdown-${B._id}`
2450
+ }, null, 8, qa)
2451
+ ], 8, ya);
2452
+ }), 128))
2453
+ ])),
2454
+ C("tfoot", null, [
2455
+ m.$slots.tfoot ? O(m.$slots, "tfoot", { key: 0 }, void 0, !0) : m.columns && !((j = m.rows) != null && j.length) && !((P = e(c)) != null && P.loading.getAll) ? (t(), s("tr", Fa, Ea)) : y("", !0)
2456
+ ])
2457
+ ])) : y("", !0);
2458
+ };
2459
+ }
2460
+ });
2461
+ const Da = /* @__PURE__ */ K(Ha, [["__scopeId", "data-v-2a6c7067"]]), Qa = /* @__PURE__ */ E({
2462
+ __name: "aeria-tabular",
2463
+ props: {
2464
+ individualActions: {},
2465
+ layoutOptions: {},
2466
+ componentProps: {}
2467
+ },
2468
+ setup(u) {
2469
+ const r = u, l = Ie(), n = Fe(), a = G(() => {
2470
+ const i = {
2471
+ collection: n,
2472
+ checkbox: l.hasSelectionActions,
2473
+ columns: l.tableProperties,
2474
+ rows: l.items,
2475
+ actions: r.individualActions,
2476
+ layout: l.tableLayout
2477
+ };
2478
+ return Object.assign(i, r.componentProps);
2479
+ });
2480
+ return (i, c) => (t(), s("div", null, [
2481
+ i.$slots.inner ? O(i.$slots, "inner", { key: 0 }) : y("", !0),
2482
+ e(l).properties ? (t(), $(Da, Q({ key: 1 }, a.value, {
2483
+ key: e(l).$id
2484
+ }), ce({ _: 2 }, [
2485
+ D(Object.keys(i.$slots).filter((_) => !["inner"].includes(_)), (_) => ({
2486
+ name: _,
2487
+ fn: v((d) => [
2488
+ O(i.$slots, _, pe(Ve(d)))
2489
+ ])
2490
+ }))
2491
+ ]), 1040)) : y("", !0)
2492
+ ]));
2493
+ }
2494
+ }), Ga = /* @__PURE__ */ E({
2495
+ __name: "aeria-grid",
2496
+ props: {
2497
+ list: { type: Boolean }
2498
+ },
2499
+ setup(u) {
2500
+ return (r, l) => (t(), s("div", {
2501
+ class: X(`
2502
+ grid
2503
+ ${r.list && "grid--list"}
2504
+ `)
2505
+ }, [
2506
+ O(r.$slots, "default", {}, void 0, !0)
2507
+ ], 2));
2508
+ }
2509
+ });
2510
+ const Wa = /* @__PURE__ */ K(Ga, [["__scopeId", "data-v-438c4aed"]]), Ka = { key: 0 }, Xa = {
2511
+ key: 1,
2512
+ class: "card__information"
2513
+ }, Ya = /* @__PURE__ */ E({
2514
+ __name: "aeria-grid",
2515
+ props: {
2516
+ individualActions: {},
2517
+ hasSelectionActions: { type: Boolean },
2518
+ layoutOptions: {},
2519
+ componentName: {}
2520
+ },
2521
+ setup(u) {
2522
+ const l = u.layoutOptions, n = Ie(), a = (i) => Array.isArray(i) ? i[0] : i;
2523
+ return (i, c) => {
2524
+ const _ = oe("clickable");
2525
+ return t(), $(Wa, {
2526
+ list: i.componentName === "list"
2527
+ }, {
2528
+ default: v(() => [
2529
+ (t(!0), s(N, null, D(e(n).items, (d) => (t(), $(fn, {
2530
+ key: d,
2531
+ inactive: !!(e(l).active && !d[e(l).active]),
2532
+ horizontal: i.componentName === "list"
2533
+ }, ce({
2534
+ footer: v(() => [
2535
+ e(l).title ? (t(), s("div", Ka, k(d[e(l).title]), 1)) : y("", !0),
2536
+ e(l).information ? (t(), s("div", Xa, k(d[e(l).information]), 1)) : y("", !0)
2537
+ ]),
2538
+ actions: v(() => [
2539
+ i.individualActions.length > 0 ? (t(), $(Ce, Q({
2540
+ key: 0,
2541
+ ref_for: !0
2542
+ }, {
2543
+ subject: d,
2544
+ actions: i.individualActions
2545
+ }), {
2546
+ default: v(() => [
2547
+ x(F(Z, {
2548
+ reactive: "",
2549
+ icon: "dots-three-vertical"
2550
+ }, null, 512), [
2551
+ [_]
2552
+ ])
2553
+ ]),
2554
+ _: 2
2555
+ }, 1040)) : y("", !0)
2556
+ ]),
2557
+ default: v(() => {
2558
+ var h;
2559
+ return [
2560
+ F(He, {
2561
+ alt: "Item picture",
2562
+ expandable: "",
2563
+ url: (h = a(d[e(l).picture])) == null ? void 0 : h.link,
2564
+ meta: a(d[e(l).picture])
2565
+ }, null, 8, ["url", "meta"])
2566
+ ];
2567
+ }),
2568
+ _: 2
2569
+ }, [
2570
+ e(l).badge && Array.isArray(d[e(l).badge]) ? {
2571
+ name: "badge",
2572
+ fn: v(() => [
2573
+ (t(!0), s(N, null, D(d[e(l).badge], (h) => (t(), $($e, {
2574
+ key: `${d._id}-${h}`,
2575
+ large: ""
2576
+ }, {
2577
+ default: v(() => [
2578
+ W(k(e(l).translateBadge ? e(L)(h) : h), 1)
2579
+ ]),
2580
+ _: 2
2581
+ }, 1024))), 128))
2582
+ ]),
2583
+ key: "0"
2584
+ } : e(l).badge ? {
2585
+ name: "badge",
2586
+ fn: v(() => [
2587
+ F($e, null, {
2588
+ default: v(() => [
2589
+ W(k(e(l).translateBadge ? e(L)(d[e(l).badge]) : d[e(l).badge]), 1)
2590
+ ]),
2591
+ _: 2
2592
+ }, 1024)
2593
+ ]),
2594
+ key: "1"
2595
+ } : void 0
2596
+ ]), 1032, ["inactive", "horizontal"]))), 128))
2597
+ ]),
2598
+ _: 1
2599
+ }, 8, ["list"]);
2600
+ };
2601
+ }
2602
+ });
2603
+ const vt = /* @__PURE__ */ K(Ya, [["__scopeId", "data-v-113dd7db"]]), Ja = (u) => ({
2604
+ tabular: Qa,
2605
+ grid: vt,
2606
+ list: vt
2607
+ })[u], de = J(!1);
2608
+ J(!1);
2609
+ const ge = J(!1), Le = J((...u) => null), yt = J(), Za = (u) => (De("data-v-21eeb8fd"), u = u(), Qe(), u), Pa = {
2610
+ key: 2,
2611
+ class: "crud__controls"
2612
+ }, Na = {
2613
+ key: 0,
2614
+ class: "crud__search"
2615
+ }, xa = { class: "crud__actions" }, el = { class: "crud__context-badge" }, tl = /* @__PURE__ */ Za(() => /* @__PURE__ */ C("div", null, "Filtros", -1)), nl = { key: 0 }, ol = {
2616
+ key: 3,
2617
+ class: "crud__pagination"
2618
+ }, ht = 30, al = /* @__PURE__ */ E({
2619
+ __name: "aeria-crud",
2620
+ props: {
2621
+ collection: {},
2622
+ noControls: { type: Boolean },
2623
+ noActions: { type: Boolean },
2624
+ noFetch: { type: Boolean },
2625
+ noLayoutToggle: { type: Boolean },
2626
+ layout: {},
2627
+ action: {},
2628
+ componentProps: {},
2629
+ scrollPagination: { type: Boolean },
2630
+ noQueryPersistence: { type: Boolean }
2631
+ },
2632
+ emits: ["uiEvent"],
2633
+ setup(u, { emit: r }) {
2634
+ const l = u, n = r, a = Ae(), i = kt({
2635
+ delay: 600
2636
+ }), c = ie("meta"), _ = qe(), { reachedEnd: d, detach: h } = Ze(null, {
2637
+ antecipate: 600
2638
+ }), p = !_.value.md || l.scrollPagination;
2639
+ p && ue(d, (V) => {
2640
+ V && o.pagination.recordsTotal > o.items.length && b.value < ht && (b.value += 1, j());
2641
+ });
2642
+ const o = ie(l.collection);
2643
+ ia(o, {
2644
+ persistInQuery: !l.noQueryPersistence
2645
+ });
2646
+ const m = Pe(), A = l.action ? e(l.action) : Ht(o, a, m);
2647
+ Le.value = A[0], yt.value = A[1];
2648
+ const b = J(0), S = J(!1), j = async (V) => {
2649
+ o.activeFilters = Object.assign({}, (V == null ? void 0 : V.filters) || o.$filters), Object.assign(o.activeFilters, o.filtersPreset);
2650
+ const T = {
2651
+ filters: o.activeFilters,
2652
+ limit: o.pagination.limit,
2653
+ offset: o.pagination.offset,
2654
+ project: o.preferredTableProperties.length > 0 ? o.preferredTableProperties : o.description.table || Object.keys(o.properties)
2655
+ };
2656
+ b.value > 0 && (T.limit = 15, T.offset = b.value * T.limit), o.description.tableMeta && (T.project = T.project.concat(o.description.tableMeta)), V && Object.assign(T, V), o.loading.getAll = !0;
2657
+ const { error: ae, result: le } = await o.$actions.retrieveItems(T);
2658
+ if (ae)
2659
+ return;
2660
+ const { data: ne, pagination: se } = le;
2661
+ o.pagination.recordsCount = se.recordsCount, o.pagination.recordsTotal = se.recordsTotal, b.value === 0 && o.items.splice(0), o.items.push(...ne), o.loading.getAll = !1, S.value = !0;
2662
+ }, P = async (V) => {
2663
+ a.push(Me(a.currentRoute.value, {
2664
+ query: {
2665
+ offset: V.offset,
2666
+ limit: V.limit
2667
+ }
2668
+ })), o.pagination.offset = V.offset, o.pagination.limit = V.limit, j();
2669
+ }, B = _e("noResultsComponent", null);
2670
+ ue(() => [
2671
+ a.currentRoute.value.path,
2672
+ a.currentRoute.value.query.section
2673
+ ], async (V, T) => {
2674
+ if (T && T[0] === V[0] && T[1] === V[1])
2675
+ return;
2676
+ const ae = a.currentRoute.value;
2677
+ if (c.view.title = l.collection, c.view.collection = l.collection, !l.noFetch && !ae.query._popstate) {
2678
+ const le = Dt(o, ae);
2679
+ Object.keys(le).length > 0 && Object.assign(o.filters, le), await j();
2680
+ }
2681
+ }, {
2682
+ immediate: !0,
2683
+ flush: "post"
2684
+ });
2685
+ const [R] = i((V) => (a.push(Me(a.currentRoute.value, {
2686
+ query: {
2687
+ search: V || void 0
2688
+ }
2689
+ })), V ? (o.filters = Object.assign(ke(o.freshFilters), {
2690
+ $text: {
2691
+ $search: `"${V}"`,
2692
+ $caseSensitive: !1
2693
+ }
2694
+ }), j({
2695
+ offset: 0
2696
+ })) : (o.filters = ke(o.freshFilters), b.value = 0, j())));
2697
+ ue(() => o.textQuery, (V) => {
2698
+ R(V);
2699
+ });
2700
+ const Y = (V) => {
2701
+ V.currentLayout = V.currentLayout === "tabular" ? V.description.layout.name : "tabular";
2702
+ };
2703
+ wt(() => {
2704
+ o.$actions.clearFilters(), o.textQuery = "", h();
2705
+ }), ue(() => yt.value, async (V) => {
2706
+ var le;
2707
+ const T = ke(V);
2708
+ let ae;
2709
+ if (T)
2710
+ if ((T.name === "spawnEdit" || T.name === "duplicate") && (ae = o.$actions.get({
2711
+ filters: {
2712
+ _id: T.params._id
2713
+ }
2714
+ })), T.name === "spawnAdd")
2715
+ o.$actions.clearItem(), (le = T.params) != null && le.item && (o.$actions.setItem(T.params.item), Object.keys(T.params.item).forEach((ne) => {
2716
+ delete o.referenceItem[ne];
2717
+ })), de.value = "add";
2718
+ else if (T.name === "spawnEdit")
2719
+ o.$actions.setItem(T.params), de.value = "edit";
2720
+ else if (T.name === "duplicate") {
2721
+ await ae;
2722
+ const ne = Object.entries(o.item).reduce((se, [z, U]) => {
2723
+ if (!(z in o.properties))
2724
+ return {
2725
+ ...se,
2726
+ [z]: U
2727
+ };
2728
+ const f = o.properties[z];
2729
+ if (f.readOnly)
2730
+ return se;
2731
+ const M = (H) => {
2732
+ const g = me(f);
2733
+ if (!g)
2734
+ return H;
2735
+ if (g.$ref === "file")
2736
+ return {};
2737
+ if (g.inline && H) {
2738
+ const { _id: I, ...q } = H;
2739
+ return q;
2740
+ }
2741
+ return H;
2742
+ };
2743
+ return U = Array.isArray(U) ? U.map(M) : M(U), {
2744
+ ...se,
2745
+ [z]: U
2746
+ };
2747
+ }, {});
2748
+ o.$actions.setItem(ne), delete o.item._id, o.referenceItem = {}, de.value = "duplicate";
2749
+ } else
2750
+ n("uiEvent", T);
2751
+ }, {
2752
+ deep: !0
2753
+ }), ue(() => de, ({ value: V }) => {
2754
+ V === !1 && (c.view.collection = l.collection, o.$actions.clearItem());
2755
+ });
2756
+ const w = G(() => o.individualActions.map((V) => ({
2757
+ click: Le.value(V),
2758
+ ...V
2759
+ }))), te = G(() => o.actions.filter((V) => !V.button));
2760
+ return ye(Ue, G(() => l.collection)), ye("individualActions", w), (V, T) => {
2761
+ var ne, se, z, U, f, M, H;
2762
+ const ae = oe("clickable"), le = oe("loading");
2763
+ return t(), s(N, null, [
2764
+ e(ge) ? (t(), $(la, {
2765
+ key: e(o).$id,
2766
+ modelValue: e(ge),
2767
+ "onUpdate:modelValue": T[0] || (T[0] = (g) => _t(ge) ? ge.value = g : null)
2768
+ }, null, 8, ["modelValue"])) : y("", !0),
2769
+ e(de) ? (t(), $(sa, {
2770
+ key: 1,
2771
+ modelValue: e(de),
2772
+ "onUpdate:modelValue": T[1] || (T[1] = (g) => _t(de) ? de.value = g : null),
2773
+ "fixed-right": "",
2774
+ onCancel: T[2] || (T[2] = (g) => de.value = !1)
2775
+ }, ce({
2776
+ header: v(() => [
2777
+ C("span", null, k((() => {
2778
+ switch (e(de)) {
2779
+ case "add":
2780
+ return e(L)("action.add", { capitalize: !0 });
2781
+ case "duplicate":
2782
+ return e(L)("action.duplicate", { capitalize: !0 });
2783
+ case "edit":
2784
+ default:
2785
+ return e(L)("action.edit", { capitalize: !0 });
2786
+ }
2787
+ })()), 1),
2788
+ C("span", null, " " + k(e(L)(e(c).view.collection)), 1)
2789
+ ]),
2790
+ _: 2
2791
+ }, [
2792
+ D(Object.keys(V.$slots).filter((g) => g.startsWith("field-")), (g) => ({
2793
+ name: g,
2794
+ fn: v((I) => [
2795
+ O(V.$slots, g, pe(Ve(I)), void 0, !0)
2796
+ ])
2797
+ }))
2798
+ ]), 1032, ["modelValue"])) : y("", !0),
2799
+ !V.noActions && (e(o).description.search || Object.keys(e(o).availableFilters).length > 0 || ((ne = e(o)) == null ? void 0 : ne.actions.length) > 0 || V.$slots.actions || !V.noLayoutToggle && e(o).description.layout && ((se = e(o).description.layout) == null ? void 0 : se.name) !== "tabular") ? (t(), s("div", Pa, [
2800
+ e(o).description.search ? (t(), s("div", Na, [
2801
+ F(Oe, Q({
2802
+ modelValue: e(o).textQuery,
2803
+ "onUpdate:modelValue": T[3] || (T[3] = (g) => e(o).textQuery = g)
2804
+ }, {
2805
+ property: {
2806
+ type: "string",
2807
+ placeholder: e(o).description.search.placeholder || "Pesquise aqui",
2808
+ inputType: "search"
2809
+ }
2810
+ }), null, 16, ["modelValue"])
2811
+ ])) : y("", !0),
2812
+ C("div", xa, [
2813
+ te.value.length > 0 || !V.noLayoutToggle && e(o).description.layout && ((z = e(o).description.layout) == null ? void 0 : z.name) !== "tabular" ? (t(), $(Ce, { key: 0 }, ce({
2814
+ default: v(() => [
2815
+ F(re, {
2816
+ variant: "alt",
2817
+ icon: "sliders"
2818
+ }, {
2819
+ default: v(() => [
2820
+ e(o).filtersCount ? (t(), $($e, { key: 0 }, {
2821
+ default: v(() => [
2822
+ W(k(e(o).filtersCount), 1)
2823
+ ]),
2824
+ _: 1
2825
+ })) : y("", !0)
2826
+ ]),
2827
+ _: 1
2828
+ })
2829
+ ]),
2830
+ _: 2
2831
+ }, [
2832
+ Object.keys(e(o).availableFilters).length > 0 ? {
2833
+ name: "filter",
2834
+ fn: v(() => [
2835
+ x((t(), $(Z, {
2836
+ icon: "funnel",
2837
+ onClick: T[4] || (T[4] = (g) => ge.value = !0)
2838
+ }, {
2839
+ default: v(() => [
2840
+ W(k(e(L)("filters", { capitalize: !0 })), 1)
2841
+ ]),
2842
+ _: 1
2843
+ })), [
2844
+ [ae]
2845
+ ]),
2846
+ C("div", el, [
2847
+ e(o).filtersCount ? (t(), $($e, { key: 0 }, {
2848
+ default: v(() => [
2849
+ W(k(e(o).filtersCount), 1)
2850
+ ]),
2851
+ _: 1
2852
+ })) : y("", !0)
2853
+ ])
2854
+ ]),
2855
+ key: "0"
2856
+ } : void 0,
2857
+ !V.noLayoutToggle && e(o).description.layout && ((U = e(o).description.layout) == null ? void 0 : U.name) !== "tabular" ? {
2858
+ name: "layout-toggle",
2859
+ fn: v(() => [
2860
+ x((t(), $(Z, {
2861
+ icon: "table",
2862
+ onClick: T[5] || (T[5] = (g) => Y(e(o)))
2863
+ }, {
2864
+ default: v(() => [
2865
+ W(k(e(L)("change_layout", { capitalize: !0 })), 1)
2866
+ ]),
2867
+ _: 1
2868
+ })), [
2869
+ [ae]
2870
+ ])
2871
+ ]),
2872
+ key: "1"
2873
+ } : void 0,
2874
+ D(te.value, (g, I) => ({
2875
+ name: `action-${I}`,
2876
+ fn: v(() => [
2877
+ g ? (t(), $(Z, {
2878
+ key: 0,
2879
+ icon: g.icon || "gear",
2880
+ disabled: e(o).selected.length === 0 && g.selection,
2881
+ onClick: (q) => e(Le)(g)({ _id: e(o).selected.map((fe) => fe._id) })
2882
+ }, {
2883
+ default: v(() => [
2884
+ W(k(e(L)(g.label, { capitalize: !0 })), 1)
2885
+ ]),
2886
+ _: 2
2887
+ }, 1032, ["icon", "disabled", "onClick"])) : y("", !0)
2888
+ ])
2889
+ }))
2890
+ ]), 1024)) : Object.keys(e(o).availableFilters).length > 0 ? (t(), $(re, {
2891
+ key: 1,
2892
+ variant: "alt",
2893
+ icon: "funnel",
2894
+ onClick: T[6] || (T[6] = (g) => ge.value = !0)
2895
+ }, {
2896
+ default: v(() => [
2897
+ tl,
2898
+ e(o).filtersCount ? (t(), $($e, { key: 0 }, {
2899
+ default: v(() => [
2900
+ W(k(e(o).filtersCount), 1)
2901
+ ]),
2902
+ _: 1
2903
+ })) : y("", !0)
2904
+ ]),
2905
+ _: 1
2906
+ })) : y("", !0),
2907
+ (t(!0), s(N, null, D(e(o).actions.filter((g) => g.button), (g, I) => (t(), $(re, {
2908
+ key: `action-${I}`,
2909
+ icon: g.icon,
2910
+ disabled: e(o).selected.length === 0 && g.selection,
2911
+ onClick: (q) => e(Le)(g)({ _id: e(o).selected.map((fe) => fe._id) })
2912
+ }, {
2913
+ default: v(() => [
2914
+ W(k(e(L)(g.label, { capitalize: !0 })), 1)
2915
+ ]),
2916
+ _: 2
2917
+ }, 1032, ["icon", "disabled", "onClick"]))), 128)),
2918
+ V.$slots.actions ? O(V.$slots, "actions", { key: 2 }, void 0, !0) : y("", !0)
2919
+ ])
2920
+ ])) : y("", !0),
2921
+ x((t(), s("div", null, [
2922
+ e(o).itemsCount === 0 && !e(o).loading.getAll && S.value && (e(B) || V.$slots.empty) ? (t(), s("div", nl, [
2923
+ e(B) ? (t(), $(he(e(B)), pe(Q({ key: 0 }, {
2924
+ collection: e(o).$id
2925
+ })), {
2926
+ default: v(() => [
2927
+ e(o).filtersCount === 0 && e(o).description.actions && "ui:spawnAdd" in e(o).description.actions ? (t(), $(re, {
2928
+ key: 0,
2929
+ icon: "plus",
2930
+ onClick: T[7] || (T[7] = (g) => e(Le)({
2931
+ action: "ui:spawnAdd"
2932
+ })())
2933
+ }, {
2934
+ default: v(() => [
2935
+ W(k(e(L)("add_first_item", { capitalize: !0 })), 1)
2936
+ ]),
2937
+ _: 1
2938
+ })) : y("", !0)
2939
+ ]),
2940
+ _: 1
2941
+ }, 16)) : O(V.$slots, "empty", pe(Q({ key: 1 }, {
2942
+ collection: e(o).$id
2943
+ })), void 0, !0)
2944
+ ])) : V.$slots.component ? O(V.$slots, "component", pe(Q({ key: 1 }, {
2945
+ store: e(o)
2946
+ })), void 0, !0) : (t(), $(he(e(Ja)(((f = V.layout) == null ? void 0 : f.name) || e(o).$currentLayout)), Q({ key: 2 }, {
2947
+ individualActions: w.value,
2948
+ layoutOptions: ((M = V.layout) == null ? void 0 : M.options) || e(o).layout.options,
2949
+ componentProps: V.componentProps
2950
+ }, {
2951
+ "component-name": ((H = V.layout) == null ? void 0 : H.name) || e(o).$currentLayout
2952
+ }), ce({ _: 2 }, [
2953
+ D(Object.keys(V.$slots).filter((g) => g.startsWith("row-")), (g) => ({
2954
+ name: g,
2955
+ fn: v((I) => [
2956
+ O(V.$slots, g, pe(Ve(I)), void 0, !0)
2957
+ ])
2958
+ })),
2959
+ V.$slots.tfoot ? {
2960
+ name: "tfoot",
2961
+ fn: v(() => [
2962
+ O(V.$slots, "tfoot", {}, void 0, !0)
2963
+ ]),
2964
+ key: "0"
2965
+ } : void 0
2966
+ ]), 1040, ["component-name"]))
2967
+ ])), [
2968
+ [le, (!e(p) || b.value === ht) && e(o).loading.getAll]
2969
+ ]),
2970
+ !e(o).loading.getAll && e(o).itemsCount > 0 ? (t(), s("div", ol, [
2971
+ F(Un, {
2972
+ pagination: e(o).pagination,
2973
+ onPaginate: P
2974
+ }, null, 8, ["pagination"])
2975
+ ])) : y("", !0)
2976
+ ], 64);
2977
+ };
2978
+ }
2979
+ });
2980
+ const El = /* @__PURE__ */ K(al, [["__scopeId", "data-v-21eeb8fd"]]), ll = { class: "prompt" }, sl = /* @__PURE__ */ E({
2981
+ __name: "aeria-prompt",
2982
+ props: {
2983
+ title: {},
2984
+ actions: {}
2985
+ },
2986
+ setup(u) {
2987
+ const r = ie("meta"), l = (n) => {
2988
+ r.$actions.fulfillPrompt(n);
2989
+ };
2990
+ return (n, a) => (t(), $(Be, {
2991
+ float: "",
2992
+ "fill-footer": "",
2993
+ "close-hint": !1,
2994
+ style: { "--panel-min-width": "32rem" }
2995
+ }, ce({
2996
+ footer: v(() => [
2997
+ C("div", {
2998
+ class: "prompt__actions",
2999
+ style: be(`grid-template-columns: repeat(${n.actions.length}, 1fr)`)
3000
+ }, [
3001
+ (t(!0), s(N, null, D(n.actions, (i, c) => (t(), $(ve, {
3002
+ key: `action-${c}`,
3003
+ class: X(`
3004
+ prompt__action
3005
+ prompt__action--${i.variant || "primary"}
3006
+ `),
3007
+ onClick: (_) => i.click ? i.click(i) : l(i)
3008
+ }, {
3009
+ default: v(() => [
3010
+ W(k(i.title || i.name), 1)
3011
+ ]),
3012
+ _: 2
3013
+ }, 1032, ["class", "onClick"]))), 128))
3014
+ ], 4)
3015
+ ]),
3016
+ default: v(() => [
3017
+ C("div", ll, [
3018
+ O(n.$slots, "default", {}, void 0, !0)
3019
+ ])
3020
+ ]),
3021
+ _: 2
3022
+ }, [
3023
+ n.title ? {
3024
+ name: "title",
3025
+ fn: v(() => [
3026
+ W(k(n.title), 1)
3027
+ ]),
3028
+ key: "0"
3029
+ } : void 0
3030
+ ]), 1024));
3031
+ }
3032
+ });
3033
+ const il = /* @__PURE__ */ K(sl, [["__scopeId", "data-v-5443f297"]]), rl = { class: "toast__content" }, ul = { class: "toast__time" }, cl = /* @__PURE__ */ E({
3034
+ __name: "aeria-toast",
3035
+ props: {
3036
+ idx: {},
3037
+ itr: {},
3038
+ date: {},
3039
+ icon: {}
3040
+ },
3041
+ setup(u) {
3042
+ const r = ie("meta");
3043
+ return (l, n) => {
3044
+ const a = oe("clickable");
3045
+ return x((t(), s("div", {
3046
+ class: X({
3047
+ toast: !0,
3048
+ "toast--animate": e(r).toasts[0].itr === l.itr
3049
+ }),
3050
+ onAnimationend: n[0] || (n[0] = (i) => e(r).$actions.popToast()),
3051
+ onClick: n[1] || (n[1] = (i) => e(r).$actions.popToast(l.itr))
3052
+ }, [
3053
+ F(Z, Q(
3054
+ l.icon ? { icon: l.icon } : { icon: "warning-circle" },
3055
+ { style: { "--icon-size": "4rem", "--icon-color": "var(--theme-brand-color-shade-3)" } }
3056
+ ), null, 16),
3057
+ C("div", rl, [
3058
+ O(l.$slots, "default", {}, void 0, !0),
3059
+ C("div", ul, k(l.formatDateTime(l.date, { hoursOnly: !0 })), 1)
3060
+ ])
3061
+ ], 34)), [
3062
+ [a]
3063
+ ]);
3064
+ };
3065
+ }
3066
+ });
3067
+ const dl = /* @__PURE__ */ K(cl, [["__scopeId", "data-v-21bbe178"]]), pl = ["innerHTML"], _l = { class: "main__toasts" }, ml = ["innerHTML"], fl = /* @__PURE__ */ E({
3068
+ __name: "aeria-main",
3069
+ setup(u) {
3070
+ const r = ie("meta"), l = G(() => r.themeOverride || r.theme);
3071
+ return (n, a) => {
3072
+ const i = St("router-view");
3073
+ return t(), s("main", {
3074
+ id: "main",
3075
+ class: X(`
3076
+ main
3077
+ main--${l.value}
3078
+ ${l.value === "dark" && "tw-dark"}
3079
+ `)
3080
+ }, [
3081
+ (t(), $(Tt, null, {
3082
+ default: v(() => [
3083
+ F(i, null, {
3084
+ default: v(({ Component: c }) => [
3085
+ (t(), $(he(c), null, ce({ _: 2 }, [
3086
+ D(Object.keys(n.$slots), (_) => ({
3087
+ name: _,
3088
+ fn: v(() => [
3089
+ O(n.$slots, _, {}, void 0, !0)
3090
+ ])
3091
+ }))
3092
+ ]), 1024))
3093
+ ]),
3094
+ _: 3
3095
+ })
3096
+ ]),
3097
+ _: 3
3098
+ })),
3099
+ O(n.$slots, "default", {}, void 0, !0),
3100
+ F(Be, Q({
3101
+ modelValue: e(r).modal.visible,
3102
+ "onUpdate:modelValue": a[0] || (a[0] = (c) => e(r).modal.visible = c),
3103
+ float: "",
3104
+ "close-hint": ""
3105
+ }, e(r).modal, {
3106
+ "overlay-layer": 70,
3107
+ onOverlayClick: a[1] || (a[1] = (c) => e(r).modal.visible = !1)
3108
+ }), {
3109
+ default: v(() => [
3110
+ e(r).modal.body ? (t(), s("div", {
3111
+ key: 0,
3112
+ style: { "white-space": "pre-wrap" },
3113
+ innerHTML: e(r).modal.body
3114
+ }, null, 8, pl)) : y("", !0),
3115
+ e(r).modal.component ? (t(), $(he(e(r).modal.component), { key: 1 })) : y("", !0)
3116
+ ]),
3117
+ _: 1
3118
+ }, 16, ["modelValue"]),
3119
+ e(r).prompt.visible ? (t(), $(il, pe(Q({ key: 0 }, e(r).prompt)), {
3120
+ default: v(() => [
3121
+ W(k(e(r).prompt.body), 1)
3122
+ ]),
3123
+ _: 1
3124
+ }, 16)) : y("", !0),
3125
+ C("div", _l, [
3126
+ (t(!0), s(N, null, D(e(r).toasts, (c) => (t(), $(dl, Q({ ref_for: !0 }, c, {
3127
+ key: `toast-${c.itr}`
3128
+ }), {
3129
+ default: v(() => [
3130
+ C("div", {
3131
+ innerHTML: e(L)(c.text)
3132
+ }, null, 8, ml)
3133
+ ]),
3134
+ _: 2
3135
+ }, 1040))), 128))
3136
+ ])
3137
+ ], 2);
3138
+ };
3139
+ }
3140
+ });
3141
+ const Hl = /* @__PURE__ */ K(fl, [["__scopeId", "data-v-1166be3d"]]);
3142
+ const vl = {}, yl = { class: "menu" };
3143
+ function hl(u, r) {
3144
+ return t(), s("menu", yl, [
3145
+ (t(!0), s(N, null, D(Object.keys(u.$slots), (l) => (t(), s("div", {
3146
+ key: l,
3147
+ class: "menu__entry"
3148
+ }, [
3149
+ O(u.$slots, l, {}, void 0, !0)
3150
+ ]))), 128))
3151
+ ]);
3152
+ }
3153
+ const Dl = /* @__PURE__ */ K(vl, [["render", hl], ["__scopeId", "data-v-3cfef7fb"]]), bl = { class: "tabs" }, $l = {
3154
+ key: 0,
3155
+ class: "tabs__horizontal"
3156
+ }, gl = {
3157
+ key: 0,
3158
+ class: "tabs__tab tabs__tab--info"
3159
+ }, kl = ["onClick"], Vl = {
3160
+ key: 1,
3161
+ class: "tabs__context-menu"
3162
+ }, Cl = ["onClick"], Ol = /* @__PURE__ */ E({
3163
+ __name: "aeria-tabs",
3164
+ props: {
3165
+ query: {},
3166
+ param: {},
3167
+ dropdown: { type: Boolean }
3168
+ },
3169
+ setup(u) {
3170
+ const r = u, l = jt(), n = Ae(), a = qe(), i = G(() => {
3171
+ if (r.query) {
3172
+ const _ = n.currentRoute.value.query[r.query];
3173
+ if (_)
3174
+ return _;
3175
+ } else if (r.param) {
3176
+ const _ = n.currentRoute.value.params[r.param];
3177
+ if (_)
3178
+ return _;
3179
+ }
3180
+ return Object.keys(l)[0];
3181
+ }), c = (_) => {
3182
+ r.query && n.push(Me(n.currentRoute.value, {
3183
+ query: {
3184
+ [r.query]: _
3185
+ }
3186
+ })), r.param && n.push(Me(n.currentRoute.value, {
3187
+ params: {
3188
+ [r.param]: _
3189
+ }
3190
+ }));
3191
+ };
3192
+ return (_, d) => {
3193
+ const h = oe("clickable");
3194
+ return t(), s("div", bl, [
3195
+ e(a).md && !_.dropdown ? (t(), s("div", $l, [
3196
+ _.$slots.default ? (t(), s("div", gl, [
3197
+ O(_.$slots, "default", {}, void 0, !0)
3198
+ ])) : y("", !0),
3199
+ (t(!0), s(N, null, D(Object.keys(_.$slots).filter((p) => p !== "default"), (p, o) => (t(), s("div", {
3200
+ key: p,
3201
+ class: X({
3202
+ tabs__tab: !0,
3203
+ "tabs__tab--current": p === i.value || !i.value && o === 0
3204
+ }),
3205
+ onClick: (m) => c(p)
3206
+ }, [
3207
+ O(_.$slots, p, {}, void 0, !0)
3208
+ ], 10, kl))), 128))
3209
+ ])) : (t(), s("div", Vl, [
3210
+ F(Ce, null, ce({
3211
+ default: v(() => [
3212
+ x((t(), $(Z, {
3213
+ "icon-right": "",
3214
+ icon: "caret-down",
3215
+ style: { "--icon-color": "var(--theme-brand-color-shade-1)" },
3216
+ class: "tabs__context-menu-icon"
3217
+ }, {
3218
+ default: v(() => [
3219
+ O(_.$slots, i.value, {}, void 0, !0)
3220
+ ]),
3221
+ _: 3
3222
+ })), [
3223
+ [h]
3224
+ ])
3225
+ ]),
3226
+ _: 2
3227
+ }, [
3228
+ D(Object.keys(_.$slots).filter((p) => p !== "default"), (p) => ({
3229
+ name: p,
3230
+ fn: v(() => [
3231
+ C("div", {
3232
+ onClick: (o) => c(p)
3233
+ }, [
3234
+ O(_.$slots, p, {}, void 0, !0)
3235
+ ], 8, Cl)
3236
+ ])
3237
+ }))
3238
+ ]), 1024)
3239
+ ]))
3240
+ ]);
3241
+ };
3242
+ }
3243
+ });
3244
+ const Il = /* @__PURE__ */ K(Ol, [["__scopeId", "data-v-bbc959bb"]]), Al = E({
3245
+ props: {
3246
+ initialValue: String,
3247
+ promise: Promise
3248
+ },
3249
+ setup(u) {
3250
+ const r = J(u.initialValue);
3251
+ return u.promise instanceof Promise && u.promise.then((l) => {
3252
+ r.value = l;
3253
+ }), () => Rt("div", r.value);
3254
+ }
3255
+ }), Bl = ["onClick"], wl = { key: 1 }, Sl = /* @__PURE__ */ E({
3256
+ __name: "aeria-crud-topbar",
3257
+ props: {
3258
+ collection: {}
3259
+ },
3260
+ setup(u) {
3261
+ const r = u, n = Ae().currentRoute, a = Pe(), i = G(() => r.collection ? Ke(r.collection, a) : typeof n.value.meta.collection == "string" ? Ke(n.value.meta.collection, a) : typeof n.value.params.collection == "string" ? Ke(n.value.params.collection, a) : null), c = async (_, d) => {
3262
+ const { error: h, result: p } = await d.$functions[_.badgeFunction]({
3263
+ filters: _.filters
3264
+ });
3265
+ return h ? 0 : p;
3266
+ };
3267
+ return (_, d) => i.value && i.value.description.filtersPresets ? (t(), $(Il, {
3268
+ key: 0,
3269
+ dropdown: "",
3270
+ query: "section"
3271
+ }, ce({ _: 2 }, [
3272
+ D(Object.entries(i.value.description.filtersPresets), ([h, p]) => ({
3273
+ name: h,
3274
+ fn: v(() => [
3275
+ C("div", {
3276
+ class: "topbar__preset",
3277
+ onClick: (o) => e(Ot)(p, i.value)
3278
+ }, [
3279
+ p.icon ? (t(), $(Z, {
3280
+ key: 0,
3281
+ icon: p.icon
3282
+ }, {
3283
+ default: v(() => [
3284
+ W(k(p.label || e(L)(h, { plural: !0 })), 1)
3285
+ ]),
3286
+ _: 2
3287
+ }, 1032, ["icon"])) : (t(), s("div", wl, k(p.label || e(L)(h, { plural: !0 })), 1)),
3288
+ p.badgeFunction ? (t(), $($e, { key: 2 }, {
3289
+ default: v(() => [
3290
+ F(e(Al), {
3291
+ "initial-value": "0",
3292
+ promise: c(p, i.value)
3293
+ }, null, 8, ["promise"])
3294
+ ]),
3295
+ _: 2
3296
+ }, 1024)) : y("", !0)
3297
+ ], 8, Bl)
3298
+ ])
3299
+ }))
3300
+ ]), 1024)) : y("", !0);
3301
+ }
3302
+ });
3303
+ const Tl = /* @__PURE__ */ K(Sl, [["__scopeId", "data-v-85c3b087"]]), jl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3304
+ __proto__: null,
3305
+ default: Tl
3306
+ }, Symbol.toStringTag, { value: "Module" })), Ql = /* @__PURE__ */ E({
3307
+ __name: "aeria-password-form",
3308
+ props: {
3309
+ modelValue: {}
3310
+ },
3311
+ emits: ["update:modelValue"],
3312
+ setup(u) {
3313
+ const r = u;
3314
+ ye(Ue, null);
3315
+ const l = Qt(), n = G(() => l(
3316
+ r.modelValue.password,
3317
+ r.modelValue.confirmation
3318
+ ));
3319
+ return (a, i) => (t(), $(We, {
3320
+ form: {
3321
+ password: {
3322
+ type: "string",
3323
+ icon: "key",
3324
+ inputType: "password"
3325
+ },
3326
+ confirmation: {
3327
+ type: "string",
3328
+ icon: "key",
3329
+ inputType: "password"
3330
+ }
3331
+ },
3332
+ "model-value": a.modelValue,
3333
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => a.$emit("update:modelValue", c))
3334
+ }, {
3335
+ after: v(() => [
3336
+ C("div", null, k(n.value || "Senhas conferem"), 1),
3337
+ O(a.$slots, "default", pe(Ve({ passwordError: n.value })))
3338
+ ]),
3339
+ _: 3
3340
+ }, 8, ["model-value"]));
3341
+ }
3342
+ }), Gl = (u, r = []) => ({
3343
+ path: "/user",
3344
+ name: "/builtin:user",
3345
+ component: u,
3346
+ children: r.concat([
3347
+ {
3348
+ path: "invite/:id",
3349
+ name: "/user/invite/:id",
3350
+ redirect: (l) => ({
3351
+ path: "/user/signup",
3352
+ params: {
3353
+ inviteId: l.params.id
3354
+ }
3355
+ })
3356
+ },
3357
+ {
3358
+ path: "signin",
3359
+ name: "/user/signin",
3360
+ component: () => import("./signin-1c13c187.js"),
3361
+ meta: {
3362
+ title: "Autenticação"
3363
+ }
3364
+ },
3365
+ {
3366
+ path: "signup",
3367
+ name: "/user/signup",
3368
+ component: () => import("./signup-88cb845a.js"),
3369
+ meta: {
3370
+ title: "Registro"
3371
+ }
3372
+ },
3373
+ {
3374
+ path: "activation",
3375
+ name: "/user/activation",
3376
+ component: () => import("./activation-e4385201.js"),
3377
+ meta: {
3378
+ title: "Ativação"
3379
+ }
3380
+ }
3381
+ ])
3382
+ }), Wl = (u, r = []) => ({
3383
+ path: "/dashboard",
3384
+ name: "/builtin:dashboard",
3385
+ component: u,
3386
+ redirect: {
3387
+ name: "/dashboard/"
3388
+ },
3389
+ meta: {
3390
+ title: "Dashboard"
3391
+ },
3392
+ children: r.concat([
3393
+ {
3394
+ path: "c/:collection",
3395
+ name: "/dashboard/crud",
3396
+ props: !0,
3397
+ components: {
3398
+ default: () => import("./index-f44785a1.js"),
3399
+ topbar: () => Promise.resolve().then(() => jl)
3400
+ },
3401
+ meta: {
3402
+ title: "%viewTitle%"
3403
+ }
3404
+ },
3405
+ {
3406
+ path: "c/:collection/:id/:section?",
3407
+ name: "/dashboard/crud/:id",
3408
+ props: !0,
3409
+ components: {
3410
+ default: () => import("./_id_-fe065dc0.js")
3411
+ },
3412
+ meta: {
3413
+ title: "%viewTitle%"
3414
+ }
3415
+ },
3416
+ {
3417
+ path: "user",
3418
+ name: "/dashboard/user",
3419
+ meta: {
3420
+ title: "user",
3421
+ icon: "users",
3422
+ collection: "user"
3423
+ },
3424
+ redirect: "/dashboard/c/user",
3425
+ children: [
3426
+ {
3427
+ path: "profile",
3428
+ component: () => import("./index-a64e672c.js"),
3429
+ meta: {
3430
+ title: "Meu perfil",
3431
+ icon: "user-square"
3432
+ }
3433
+ },
3434
+ {
3435
+ path: "changepass",
3436
+ name: "/dashboard/user/changepass",
3437
+ component: () => import("./index-afccd6d2.js"),
3438
+ meta: {
3439
+ title: "Mudar senha",
3440
+ icon: "lock"
3441
+ }
3442
+ }
3443
+ ]
3444
+ }
3445
+ ])
3446
+ });
3447
+ export {
3448
+ We as A,
3449
+ Al as B,
3450
+ il as C,
3451
+ dl as D,
3452
+ Tl as E,
3453
+ Gl as F,
3454
+ Wl as G,
3455
+ Ql as _,
3456
+ re as a,
3457
+ Z as b,
3458
+ Kn as c,
3459
+ El as d,
3460
+ sa as e,
3461
+ He as f,
3462
+ Dl as g,
3463
+ Be as h,
3464
+ K as i,
3465
+ Ul as j,
3466
+ $e as k,
3467
+ ve as l,
3468
+ fn as m,
3469
+ Ce as n,
3470
+ Wa as o,
3471
+ kn as p,
3472
+ Hl as q,
3473
+ Un as r,
3474
+ Da as s,
3475
+ Il as t,
3476
+ ko as u,
3477
+ Oe as v,
3478
+ Jn as w,
3479
+ Uo as x,
3480
+ Ge as y,
3481
+ no as z
3482
+ };