@aminnausin/cedar-ui 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cedar-ui.mjs CHANGED
@@ -1,2921 +1,606 @@
1
- var _t = Object.defineProperty;
2
- var Rt = (n, e, t) => e in n ? _t(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var q = (n, e, t) => Rt(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { defineComponent as K, createElementBlock as C, openBlock as m, Fragment as X, createElementVNode as x, createCommentVNode as R, normalizeClass as D, toDisplayString as j, renderSlot as F, renderList as ge, resolveComponent as gt, createBlock as Y, withCtx as B, createVNode as M, unref as b, createTextVNode as Z, withModifiers as re, ref as w, Transition as pe, withDirectives as G, normalizeStyle as ze, resolveDynamicComponent as De, vShow as Q, watch as W, Teleport as Ue, computed as J, mergeModels as $e, useModel as We, vModelDynamic as Vt, reactive as be, shallowRef as jt, getCurrentScope as Yt, onScopeDispose as bt, toRef as Kt, readonly as Ht, customRef as zt, h as ht, withKeys as ie, normalizeProps as Ut, guardReactiveProps as Wt, createSlots as Je, nextTick as qe, vModelText as qt, useTemplateRef as Oe, onMounted as Ce, mergeProps as yt, onBeforeUnmount as wt, watchEffect as Gt } from "vue";
5
- import { RouterLink as Zt, useRouter as Xt } from "vue-router";
6
- const Qt = ["for"], Jt = {
7
- key: 0,
8
- class: "text-sm/6 text-gray-500 dark:text-gray-400"
9
- }, kt = /* @__PURE__ */ K({
10
- __name: "FormInputLabel",
11
- props: {
12
- field: {},
13
- textSize: {},
14
- class: {}
15
- },
16
- setup(n) {
17
- const e = n;
18
- return (t, a) => {
19
- var r, o, s;
20
- return m(), C(X, null, [
21
- x("label", {
22
- for: (r = t.field) == null ? void 0 : r.name,
23
- class: D([
24
- "leading-none block font-medium text-gray-700 dark:text-neutral-200",
25
- t.textSize ? t.textSize : "text-sm",
26
- `${e.class ?? ""}`
27
- ])
28
- }, j((o = t.field) == null ? void 0 : o.text), 11, Qt),
29
- (s = t.field) != null && s.subtext ? (m(), C("p", Jt, j(t.field.subtext), 1)) : R("", !0)
30
- ], 64);
31
- };
32
- }
33
- }), ea = {
34
- key: 0,
35
- class: "text-rose-600 dark:text-rose-500 text-sm"
36
- }, ta = /* @__PURE__ */ K({
37
- __name: "FormErrorList",
38
- props: {
39
- errors: {},
40
- fieldName: {}
41
- },
42
- setup(n) {
43
- return (e, t) => (e.fieldName ? e.errors[e.fieldName] : Object.keys(e.errors).length > 0) ? (m(), C("ul", ea, [
44
- F(e.$slots, "default", {}, () => [
45
- (m(!0), C(X, null, ge(e.fieldName ? e.errors[e.fieldName] : e.errors, (a, r) => (m(), C("li", { key: r }, j(a), 1))), 128))
46
- ])
47
- ])) : R("", !0);
48
- }
49
- }), aa = ["for"], Rr = /* @__PURE__ */ K({
50
- __name: "InputLabel",
51
- props: {
52
- name: {},
53
- text: {},
54
- subtext: {},
55
- class: {},
56
- subtextClass: {}
57
- },
58
- setup(n) {
59
- const e = n;
60
- return (t, a) => (m(), C(X, null, [
61
- x("label", {
62
- for: t.name,
63
- class: D(["font-medium text-gray-700 dark:text-neutral-200", e.class])
64
- }, j(t.text), 11, aa),
65
- t.subtext ? (m(), C("p", {
66
- key: 0,
67
- class: D(["text-sm/6 text-gray-500 dark:text-gray-400", t.subtextClass])
68
- }, j(t.subtext), 3)) : R("", !0)
69
- ], 64));
70
- }
71
- }), ee = (n, e) => {
72
- const t = n.__vccOpts || n;
73
- for (const [a, r] of e)
74
- t[a] = r;
75
- return t;
76
- }, na = {}, ra = {
77
- class: "w-5 h-5",
78
- xmlns: "http://www.w3.org/2000/svg",
79
- fill: "none",
80
- viewBox: "0 0 24 24",
81
- "stroke-width": "1.5",
82
- stroke: "currentColor"
83
- };
84
- function sa(n, e) {
85
- return m(), C("svg", ra, e[0] || (e[0] = [
86
- x("path", {
87
- "stroke-linecap": "round",
88
- "stroke-linejoin": "round",
89
- d: "M6 18L18 6M6 6l12 12"
90
- }, null, -1)
91
- ]));
92
- }
93
- const et = /* @__PURE__ */ ee(na, [["render", sa]]), oa = {}, la = {
94
- xmlns: "http://www.w3.org/2000/svg",
95
- width: "1em",
96
- height: "1em",
97
- viewBox: "0 0 24 24"
98
- };
99
- function ia(n, e) {
100
- return m(), C("svg", la, e[0] || (e[0] = [
101
- x("g", { fill: "none" }, [
102
- x("path", {
103
- stroke: "currentColor",
104
- "stroke-linecap": "round",
105
- "stroke-linejoin": "round",
106
- "stroke-width": "1.5",
107
- d: "M7.09 2.75a4 4 0 0 0-4 4v6.208a4 4 0 0 0 4 4h.093v3.792a.5.5 0 0 0 .839.368l4.52-4.16h4.369a4 4 0 0 0 4-4V6.75a4 4 0 0 0-4-4z"
108
- }),
109
- x("path", {
110
- stroke: "currentColor",
111
- "stroke-linecap": "round",
112
- "stroke-width": "1.5",
113
- d: "M12 6.25v4"
114
- }),
115
- x("circle", {
116
- cx: "12",
117
- cy: "13.25",
118
- r: "1",
119
- fill: "currentColor"
120
- })
121
- ], -1)
122
- ]));
123
- }
124
- const xt = /* @__PURE__ */ ee(oa, [["render", ia]]), ua = {}, ca = {
125
- xmlns: "http://www.w3.org/2000/svg",
126
- width: "1em",
127
- height: "1em",
128
- viewBox: "0 0 24 24"
129
- };
130
- function da(n, e) {
131
- return m(), C("svg", ca, e[0] || (e[0] = [
132
- x("path", {
133
- fill: "none",
134
- stroke: "currentColor",
135
- "stroke-linecap": "round",
136
- "stroke-linejoin": "round",
137
- "stroke-width": "1.5",
138
- d: "m9.75 4.75l6.19 6.19a1.5 1.5 0 0 1 0 2.12l-6.19 6.19"
139
- }, null, -1)
140
- ]));
141
- }
142
- const tt = /* @__PURE__ */ ee(ua, [["render", da]]), fa = {}, va = {
143
- xmlns: "http://www.w3.org/2000/svg",
144
- width: "1em",
145
- height: "1em",
146
- viewBox: "0 0 24 24"
147
- };
148
- function ma(n, e) {
149
- return m(), C("svg", va, e[0] || (e[0] = [
150
- x("path", {
151
- fill: "none",
152
- stroke: "currentColor",
153
- "stroke-linecap": "round",
154
- "stroke-linejoin": "round",
155
- "stroke-width": "1.5",
156
- d: "m14.25 4.75l-6.19 6.19a1.5 1.5 0 0 0 0 2.12l6.19 6.19"
157
- }, null, -1)
158
- ]));
159
- }
160
- const at = /* @__PURE__ */ ee(fa, [["render", ma]]), pa = {}, ga = {
161
- xmlns: "http://www.w3.org/2000/svg",
162
- width: "1em",
163
- height: "1em",
164
- viewBox: "0 0 256 256"
165
- };
166
- function ba(n, e) {
167
- return m(), C("svg", ga, e[0] || (e[0] = [
168
- x("path", {
169
- fill: "currentColor",
170
- d: "M42 128a6 6 0 0 1 6-6h72a6 6 0 0 1 0 12H48a6 6 0 0 1-6-6m6-58h56a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m136 116H48a6 6 0 0 0 0 12h136a6 6 0 0 0 0-12m44.24-102.24l-40-40a6 6 0 0 0-8.48 0l-40 40a6 6 0 0 0 8.48 8.48L178 62.49V144a6 6 0 0 0 12 0V62.49l29.76 29.75a6 6 0 0 0 8.48-8.48"
171
- }, null, -1)
172
- ]));
173
- }
174
- const ha = /* @__PURE__ */ ee(pa, [["render", ba]]), ya = {}, wa = {
175
- xmlns: "http://www.w3.org/2000/svg",
176
- width: "1em",
177
- height: "1em",
178
- viewBox: "0 0 256 256"
179
- };
180
- function ka(n, e) {
181
- return m(), C("svg", wa, e[0] || (e[0] = [
182
- x("path", {
183
- fill: "currentColor",
184
- d: "M126 128a6 6 0 0 1-6 6H48a6 6 0 0 1 0-12h72a6 6 0 0 1 6 6M48 70h136a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m56 116H48a6 6 0 0 0 0 12h56a6 6 0 0 0 0-12m124.24-22.24a6 6 0 0 0-8.48 0L190 193.51V112a6 6 0 0 0-12 0v81.51l-29.76-29.75a6 6 0 0 0-8.48 8.48l40 40a6 6 0 0 0 8.48 0l40-40a6 6 0 0 0 0-8.48"
185
- }, null, -1)
186
- ]));
187
- }
188
- const xa = /* @__PURE__ */ ee(ya, [["render", ka]]), Ca = {}, Ta = {
189
- xmlns: "http://www.w3.org/2000/svg",
190
- width: "1em",
191
- height: "1em",
192
- viewBox: "0 0 24 24"
193
- };
194
- function Ia(n, e) {
195
- return m(), C("svg", Ta, e[0] || (e[0] = [
196
- x("path", {
197
- fill: "currentColor",
198
- d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
199
- opacity: "0.25"
200
- }, null, -1),
201
- x("path", {
202
- fill: "currentColor",
203
- d: "M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
204
- }, [
205
- x("animateTransform", {
206
- attributeName: "transform",
207
- dur: "0.75s",
208
- repeatCount: "indefinite",
209
- type: "rotate",
210
- values: "0 12 12;360 12 12"
211
- })
212
- ], -1)
213
- ]));
214
- }
215
- const $a = /* @__PURE__ */ ee(Ca, [["render", Ia]]), Pa = ["aria-label", "title", "disabled"], Ve = /* @__PURE__ */ K({
216
- __name: "ButtonCorner",
217
- props: ["positionClasses", "colourClasses", "textClasses", "to", "label", "disabled"],
218
- setup(n) {
219
- const e = n;
220
- return (t, a) => {
221
- const r = gt("router-link");
222
- return n.to ? (m(), Y(r, {
223
- key: 0,
224
- "aria-label": n.label ?? "Link",
225
- title: n.label ?? "Link",
226
- to: n.to ?? "/",
227
- class: D(["flex items-center justify-center rounded-full aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:opacity-60", `${n.positionClasses ?? " absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(e == null ? void 0 : e.colourClasses) ?? "hover:bg-gray-50 hover:dark:bg-gray-700"} ${(e == null ? void 0 : e.textClasses) ?? "text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),
228
- "aria-disabled": n.disabled
229
- }, {
230
- default: B(() => [
231
- F(t.$slots, "icon", {}, () => [
232
- M(b(et))
233
- ])
234
- ]),
235
- _: 3
236
- }, 8, ["aria-label", "title", "to", "class", "aria-disabled"])) : (m(), C("button", {
237
- key: 1,
238
- "aria-label": (e == null ? void 0 : e.label) ?? "Close Modal",
239
- title: (e == null ? void 0 : e.label) ?? "Close Modal",
240
- class: D(["flex items-center justify-center rounded-full disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60", `${(e == null ? void 0 : e.positionClasses) ?? "absolute top-0 right-0 w-8 h-8 mt-5 mr-5"} ${(e == null ? void 0 : e.colourClasses) ?? "hover:bg-gray-50 hover:dark:bg-gray-700"} ${(e == null ? void 0 : e.textClasses) ?? "text-gray-600 dark:text-gray-400 hover:text-gray-800 hover:dark:text-gray-200"}`]),
241
- disabled: n.disabled,
242
- type: "button"
243
- }, [
244
- F(t.$slots, "icon", {}, () => [
245
- M(b(et))
246
- ])
247
- ], 10, Pa));
248
- };
249
- }
250
- }), Vr = /* @__PURE__ */ K({
251
- __name: "ChipTag",
252
- props: ["label", "colour", "textClass", "URL", "removeable"],
253
- setup(n) {
254
- const e = n;
255
- return (t, a) => e.URL ? (m(), Y(b(Zt), {
256
- key: 0,
257
- class: D(`p-1 px-2 text-sm ${e.textClass ? `${e.textClass} ` : ""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${e.colour ? `${e.colour}` : "bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 `),
258
- to: e.URL
259
- }, {
260
- default: B(() => [
261
- F(t.$slots, "content", {}, () => [
262
- Z(j(e.label), 1)
263
- ]),
264
- n.removeable ? (m(), Y(Ve, {
265
- key: 0,
266
- positionClasses: "w-4 h-4",
267
- textClasses: "text-white dark:text-rose-700",
268
- colourClasses: "dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",
269
- label: "Remove",
270
- onClick: a[0] || (a[0] = re((r) => t.$emit("clickAction"), ["stop", "prevent"]))
271
- })) : R("", !0)
272
- ]),
273
- _: 3
274
- }, 8, ["class", "to"])) : (m(), C("p", {
275
- key: 1,
276
- class: D(`p-1 px-2 text-sm ${e.textClass ? `${e.textClass} ` : ""}leading-none rounded-xl truncate lowercase text-neutral-100 dark:text-neutral-300 ${e.colour ? `${e.colour}` : "bg-violet-600 dark:bg-violet-900"} shrink-0 transition-colors duration-200 cursor-default ${n.removeable ? "flex gap-1 items-center justify-between" : ""}`)
277
- }, [
278
- F(t.$slots, "content", {}, () => [
279
- Z(j(e.label), 1)
280
- ]),
281
- n.removeable ? (m(), Y(Ve, {
282
- key: 0,
283
- positionClasses: "w-4 h-4",
284
- textClasses: `text-white dark:text-rose-700 ${n.textClass ?? ""}`,
285
- colourClasses: "dark:bg-neutral-900/20 dark:hover:bg-rose-700 hover:bg-rose-300 hover:text-rose-700 dark:hover:text-white drop-shadow",
286
- label: "Remove",
287
- onClick: a[1] || (a[1] = re((r) => t.$emit("clickAction"), ["stop", "prevent"]))
288
- }, null, 8, ["textClasses"])) : R("", !0)
289
- ], 2));
290
- }
291
- }), Sa = { class: "text-pretty h-fit w-full break-words whitespace-pre-wrap" }, jr = /* @__PURE__ */ K({
292
- __name: "RelativeHoverCard",
293
- props: {
294
- content: {},
295
- positionClasses: {},
296
- hoverCardDelay: { default: 600 },
297
- hoverCardLeaveDelay: { default: 500 },
298
- iconHidden: { type: Boolean },
299
- icon: { default: xt }
300
- },
301
- setup(n) {
302
- const e = n, t = w(!1), a = w(null), r = w(null), o = w({}), s = w(!1), l = () => {
303
- e.content !== "" && (r.value && clearTimeout(r.value), !t.value && (a.value && clearTimeout(a.value), s.value || (s.value = !0), a.value = window.setTimeout(() => {
304
- t.value = !0;
305
- }, e.hoverCardDelay)));
306
- }, c = () => {
307
- e.content !== "" && (a.value && clearTimeout(a.value), t.value && (r.value && clearTimeout(r.value), r.value = window.setTimeout(() => {
308
- t.value = !1;
309
- }, e.hoverCardLeaveDelay)));
310
- };
311
- return (i, d) => (m(), C("div", {
312
- class: "relative",
313
- onMouseover: l,
314
- onMouseleave: c
315
- }, [
316
- F(i.$slots, "trigger", {}, () => [
317
- d[0] || (d[0] = x("a", {
318
- href: "#_",
319
- class: "hover:underline"
320
- }, "@thedevdojo", -1))
321
- ]),
322
- M(pe, {
323
- "enter-from-class": "opacity-0",
324
- "enter-to-class": "opacity-100",
325
- "leave-from-class": "opacity-100",
326
- "leave-to-class": "opacity-0"
327
- }, {
328
- default: B(() => [
329
- s.value ? G((m(), C("div", {
330
- key: 0,
331
- onMouseover: l,
332
- onMouseleave: c,
333
- class: D(`${i.positionClasses ?? ""} z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center`),
334
- style: ze(o.value)
335
- }, [
336
- F(i.$slots, "icon", {}, () => [
337
- i.iconHidden ? R("", !0) : (m(), Y(De(i.icon), {
338
- key: 0,
339
- class: "h-5 w-5 mb-auto shrink-0"
340
- }))
341
- ]),
342
- F(i.$slots, "content", {}, () => [
343
- x("p", Sa, j(i.content), 1)
344
- ])
345
- ], 38)), [
346
- [Q, t.value]
347
- ]) : R("", !0)
348
- ]),
349
- _: 3
350
- })
351
- ], 32));
352
- }
353
- }), Aa = {}, Ea = { class: "flex gap-3 p-3 sm:p-6 flex-wrap sm:flex-nowrap rounded-xl shadow-md dark:bg-primary-dark-800/70 bg-white ring-1 ring-gray-900/5" };
354
- function Da(n, e) {
355
- return m(), C("section", Ea, [
356
- F(n.$slots, "heading"),
357
- F(n.$slots, "content")
358
- ]);
359
- }
360
- const Yr = /* @__PURE__ */ ee(Aa, [["render", Da]]), Ma = { class: "flex flex-col gap-2" }, Na = { key: 0 }, Oa = {
361
- key: 1,
362
- class: "dark:text-neutral-400 text-pretty whitespace-pre-wrap w-full"
363
- }, Kr = /* @__PURE__ */ K({
364
- __name: "HoverCard",
365
- props: {
366
- content: {},
367
- contentTitle: {},
368
- positionClasses: {},
369
- hoverCardDelay: { default: 600 },
370
- hoverCardLeaveDelay: { default: 500 },
371
- margin: { default: 0 },
372
- iconHidden: { type: Boolean },
373
- paddingLeft: { default: 0 },
374
- scrollContainer: { default: "body" },
375
- disabled: { type: Boolean, default: !1 },
376
- icon: { default: xt }
377
- },
378
- setup(n) {
379
- const e = n, t = w(!1), a = w(null), r = w(null), o = w({}), s = w(!1), l = (d) => {
380
- e.content === "" || e.disabled || (r.value && clearTimeout(r.value), !t.value && (a.value && clearTimeout(a.value), s.value || (s.value = !0), a.value = window.setTimeout(() => {
381
- t.value = !0, i(d);
382
- }, e.hoverCardDelay)));
383
- }, c = () => {
384
- a.value && clearTimeout(a.value), t.value && (r.value && clearTimeout(r.value), r.value = window.setTimeout(() => {
385
- t.value = !1;
386
- }, e.hoverCardLeaveDelay));
387
- }, i = (d) => {
388
- var P;
389
- const g = d.target, h = (P = g.parentElement) == null ? void 0 : P.getBoundingClientRect();
390
- let v = g.getBoundingClientRect();
391
- h && h.height < v.height && (v = h);
392
- const p = e.scrollContainer === "body" ? document.body.scrollTop : window.scrollY, T = e.scrollContainer === "body" ? document.body.scrollLeft : window.scrollX;
393
- o.value = { left: `${v.left + T + e.paddingLeft}px`, top: `${v.bottom + e.margin + p}px` };
394
- };
395
- return W(
396
- () => e.content,
397
- () => {
398
- (!e.content || e.content.trim() === "") && c();
399
- }
400
- ), (d, g) => (m(), C("div", {
401
- class: "",
402
- onMouseover: l,
403
- onMouseleave: c
404
- }, [
405
- F(d.$slots, "trigger", {}, () => [
406
- g[0] || (g[0] = x("a", {
407
- href: "#_",
408
- class: "hover:underline"
409
- }, null, -1))
410
- ]),
411
- s.value ? (m(), Y(Ue, {
412
- key: 0,
413
- to: "body"
414
- }, [
415
- M(pe, {
416
- "enter-from-class": "opacity-0",
417
- "enter-to-class": "opacity-100",
418
- "leave-from-class": "opacity-100",
419
- "leave-to-class": "opacity-0"
420
- }, {
421
- default: B(() => [
422
- G(x("div", {
423
- onMouseover: l,
424
- onMouseleave: c,
425
- class: D([
426
- d.positionClasses,
427
- "z-30 flex absolute overflow-auto transition-opacity ease-in-out duration-200 md:max-w-xl xl:max-w-3xl text-sm p-3 h-fit max-h-[50vh] scrollbar-minimal bg-white dark:odd:bg-primary-dark-600/70 dark:bg-neutral-800/70 backdrop-blur-lg border dark:border-none rounded-md shadow-md border-neutral-200/70 gap-2 items-center"
428
- ]),
429
- style: ze(o.value)
430
- }, [
431
- F(d.$slots, "icon", {}, () => [
432
- d.iconHidden ? R("", !0) : (m(), Y(De(d.icon), {
433
- key: 0,
434
- class: "h-5 w-5 mb-auto shrink-0"
435
- }))
436
- ]),
437
- F(d.$slots, "content", {}, () => [
438
- x("div", Ma, [
439
- d.contentTitle ? (m(), C("h4", Na, j(d.contentTitle), 1)) : R("", !0),
440
- d.content ? (m(), C("p", Oa, j(d.content), 1)) : R("", !0)
441
- ])
442
- ])
443
- ], 38), [
444
- [Q, t.value]
445
- ])
446
- ]),
447
- _: 3
448
- })
449
- ])) : R("", !0)
450
- ], 32));
451
- }
452
- }), La = ["type", "disabled"], nt = /* @__PURE__ */ K({
453
- __name: "ButtonForm",
454
- props: {
455
- disabled: { type: Boolean, default: !1 },
456
- type: { default: "button" },
457
- variant: {}
458
- },
459
- setup(n) {
460
- const e = n, t = J(() => {
461
- switch (e.variant) {
462
- case "submit":
463
- return [
464
- "inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium text-white transition-colors border border-transparent rounded-md focus:outline-none",
465
- "focus:ring-1 focus:ring-violet-900 focus:ring-offset-1 bg-neutral-950 hover:bg-neutral-800 dark:hover:bg-neutral-900",
466
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
467
- ];
468
- case "reset":
469
- return [
470
- "inline-flex items-center justify-center h-10 max-h-full px-4 py-2 font-medium transition-colors border dark:border-neutral-600 rounded-md focus:outline-none",
471
- "focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900",
472
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
473
- ];
474
- case "auth":
475
- return [
476
- "inline-flex items-center px-4 py-2",
477
- "bg-gray-800 dark:bg-gray-200",
478
- "border border-transparent rounded-md font-semibold text-xs uppercase tracking-widest",
479
- "text-white dark:text-gray-800 hover:bg-gray-700 dark:hover:bg-white",
480
- "focus:bg-gray-700 dark:focus:bg-white active:bg-gray-900 dark:active:bg-gray-300",
481
- "focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800",
482
- "transition ease-in-out duration-150"
483
- ];
484
- default:
485
- return [
486
- "inline-flex items-center justify-center px-4 py-2 text-sm transition-colors border dark:border-neutral-600 rounded-md focus:outline-none",
487
- "focus:ring-1 focus:ring-neutral-100 dark:focus:ring-neutral-400 focus:ring-offset-1 hover:bg-neutral-100 dark:hover:bg-neutral-900",
488
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
489
- ];
490
- }
491
- });
492
- return (a, r) => (m(), C("button", {
493
- type: a.type,
494
- class: D([...t.value]),
495
- disabled: a.disabled
496
- }, [
497
- F(a.$slots, "text"),
498
- F(a.$slots, "default")
499
- ], 10, La));
500
- }
501
- }), Ba = ["name", "title", "type", "required", "placeholder", "autocomplete", "aria-autocomplete", "min", "max"], Fa = /* @__PURE__ */ K({
502
- __name: "FormInput",
503
- props: /* @__PURE__ */ $e({
504
- field: {}
505
- }, {
506
- modelValue: {},
507
- modelModifiers: {}
508
- }),
509
- emits: ["update:modelValue"],
510
- setup(n) {
511
- const e = We(n, "modelValue");
512
- return (t, a) => G((m(), C("input", {
513
- class: D([
514
- "rounded-md shadow-sm block mt-1 w-full text-sm",
515
- "focus:outline-none border-none",
516
- "disabled:cursor-not-allowed disabled:opacity-50",
517
- "text-gray-900 dark:text-neutral-100 bg-white dark:bg-neutral-700 placeholder:text-neutral-400",
518
- "ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700",
519
- "focus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500"
520
- ]),
521
- name: t.field.name,
522
- title: t.field.text ?? t.field.name,
523
- type: t.field.type,
524
- required: t.field.required ? "true" : "false",
525
- placeholder: t.field.placeholder,
526
- autocomplete: t.field.autocomplete,
527
- "aria-autocomplete": t.field.ariaAutocomplete ?? (t.field.autocomplete ? "list" : "none"),
528
- min: t.field.min ?? "",
529
- max: t.field.max ?? "",
530
- "onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r)
531
- }, null, 8, Ba)), [
532
- [Vt, e.value]
533
- ]);
534
- }
535
- });
536
- function Ge() {
537
- const n = w(!1), e = w(!1), t = w(300), a = w(null), r = be({}), o = jt(null);
538
- function s(c, i = {}) {
539
- a.value && clearTimeout(a.value), o.value = c, Object.assign(r, i), e.value = !0, n.value = !0, a.value = window.setTimeout(() => {
540
- n.value = !1;
541
- }, t.value);
542
- }
543
- function l() {
544
- a.value && clearTimeout(a.value), e.value = !1, n.value = !0, a.value = window.setTimeout(() => {
545
- n.value = !1;
546
- }, t.value);
547
- }
548
- return { isOpen: e, isAnimating: n, animationTime: t, props: r, component: o, open: s, close: l };
549
- }
550
- function Ct(n = "pv_id_") {
551
- return n + Math.random().toString(16).slice(2);
552
- }
553
- class _a {
554
- constructor() {
555
- q(this, "subscribers");
556
- q(this, "toasts");
557
- // We use arrow functions to maintain the correct `this` reference
558
- q(this, "subscribe", (e) => (this.subscribers.push(e), () => {
559
- const t = this.subscribers.indexOf(e);
560
- this.subscribers.splice(t, 1);
561
- }));
562
- q(this, "publish", (e) => {
563
- this.subscribers.forEach((t) => t(e));
564
- });
565
- q(this, "addToast", (e) => {
566
- this.publish(e), this.toasts = [...this.toasts, e];
567
- });
568
- q(this, "create", (e, t) => {
569
- const a = t.id ?? Ct("toast_");
570
- return this.toasts.find((o) => o.id === a) ? this.toasts = this.toasts.map((o) => o.id === a ? (this.publish({ ...o, ...t, id: a, title: e }), {
571
- ...o,
572
- ...t,
573
- id: a,
574
- title: e
575
- }) : o) : this.addToast({
576
- title: e,
577
- id: a,
578
- scale: 1,
579
- zIndex: 200,
580
- offsetY: 0,
581
- ...t
582
- }), a;
583
- });
584
- q(this, "dismiss", (e) => {
585
- e ? (this.publish({ id: e, dismiss: !0 }), this.toasts = this.toasts.filter((t) => t.id !== e)) : (this.toasts.forEach((t) => {
586
- this.publish({ id: t.id, dismiss: !0 });
587
- }), this.toasts = []);
588
- });
589
- q(this, "add", (e, t) => this.create(e, { ...t }));
590
- q(this, "success", (e, t) => this.create(e, { type: "success", ...t }));
591
- q(this, "error", (e, t) => this.create(e, { type: "danger", ...t }));
592
- q(this, "info", (e, t) => this.create(e, { type: "info", ...t }));
593
- q(this, "warning", (e, t) => this.create(e, { type: "warning", ...t }));
594
- this.subscribers = [], this.toasts = [];
595
- }
596
- }
597
- const te = new _a();
598
- function Ra(n, e) {
599
- const t = Ct("toast_");
600
- return te.create(n, { ...e, id: t }), t;
601
- }
602
- const Tt = Object.assign(Ra, {
603
- add: te.add,
604
- success: te.success,
605
- error: te.error,
606
- info: te.info,
607
- warning: te.warning,
608
- dismiss: te.dismiss
609
- }), Va = { class: "flex flex-col gap-4" }, ja = /* @__PURE__ */ K({
610
- __name: "BaseForm",
611
- props: {
612
- footerClass: {}
613
- },
614
- setup(n) {
615
- return (e, t) => (m(), C("form", Va, [
616
- F(e.$slots, "default"),
617
- e.$slots.footer ? (m(), C("footer", {
618
- key: 0,
619
- class: D(["mt-4", e.footerClass])
620
- }, [
621
- F(e.$slots, "footer")
622
- ], 2)) : R("", !0)
623
- ]));
624
- }
625
- }), Ya = {}, Ka = { class: "grid gap-2" };
626
- function Ha(n, e) {
627
- return m(), C("div", Ka, [
628
- F(n.$slots, "default")
629
- ]);
630
- }
631
- const za = /* @__PURE__ */ ee(Ya, [["render", Ha]]);
632
- function Ua(n) {
633
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
634
- }
635
- var Le, rt;
636
- function Wa() {
637
- return rt || (rt = 1, Le = function n(e, t) {
638
- if (e === t) return !0;
639
- if (e && t && typeof e == "object" && typeof t == "object") {
640
- if (e.constructor !== t.constructor) return !1;
641
- var a, r, o;
642
- if (Array.isArray(e)) {
643
- if (a = e.length, a != t.length) return !1;
644
- for (r = a; r-- !== 0; )
645
- if (!n(e[r], t[r])) return !1;
646
- return !0;
647
- }
648
- if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
649
- if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
650
- if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
651
- if (o = Object.keys(e), a = o.length, a !== Object.keys(t).length) return !1;
652
- for (r = a; r-- !== 0; )
653
- if (!Object.prototype.hasOwnProperty.call(t, o[r])) return !1;
654
- for (r = a; r-- !== 0; ) {
655
- var s = o[r];
656
- if (!n(e[s], t[s])) return !1;
657
- }
658
- return !0;
659
- }
660
- return e !== e && t !== t;
661
- }), Le;
662
- }
663
- var qa = Wa();
664
- const Ga = /* @__PURE__ */ Ua(qa);
665
- function Za(n) {
666
- let e = n, t;
667
- const a = be({
668
- fields: structuredClone(n),
669
- errors: {},
670
- dirty: !1,
671
- hasErrors: !1,
672
- processing: !1,
673
- wasSuccessful: !1,
674
- recentlySuccessful: !1,
675
- async submit(r, o = {}) {
676
- if (this.processing) return;
677
- const s = {
678
- onBefore: async () => {
679
- this.processing = !0, this.wasSuccessful = !1, this.recentlySuccessful = !1, clearTimeout(t), o.onBefore && await o.onBefore();
680
- },
681
- onSuccess: async (l) => {
682
- this.clearErrors(), this.wasSuccessful = !0, this.recentlySuccessful = !0, t = window.setTimeout(() => {
683
- this.recentlySuccessful = !1;
684
- }, 2e3), o.onSuccess && await o.onSuccess(l), e = structuredClone(this.fields);
685
- },
686
- onError: async (l) => {
687
- var c, i, d, g, h;
688
- this.hasErrors = !0, (((c = l == null ? void 0 : l.response) == null ? void 0 : c.status) === 422 || ((i = l == null ? void 0 : l.response) == null ? void 0 : i.status) === 401) && (this.clearErrors(), this.setErrors({
689
- message: (d = l == null ? void 0 : l.response) == null ? void 0 : d.data.message,
690
- ...(h = (g = l == null ? void 0 : l.response) == null ? void 0 : g.data) == null ? void 0 : h.errors
691
- })), o.onError && await o.onError(l);
692
- },
693
- onFinish: async () => {
694
- this.processing = !1, o.onFinish && await o.onFinish();
695
- }
696
- };
697
- await s.onBefore();
698
- try {
699
- const l = await r(this.fields);
700
- await s.onSuccess(l);
701
- } catch (l) {
702
- await s.onError(l);
703
- } finally {
704
- await s.onFinish();
705
- }
706
- },
707
- reset(...r) {
708
- const o = structuredClone(e);
709
- r.length === 0 ? this.fields = o : r.forEach((s) => {
710
- o[s] !== void 0 && (this.fields[s] = o[s]);
711
- });
712
- },
713
- clearErrors(...r) {
714
- r.length === 0 ? this.errors = {} : r.forEach((o) => delete this.errors[o]), this.hasErrors = Object.keys(this.errors).length > 0;
715
- },
716
- setErrors(r) {
717
- this.errors = { ...this.errors, ...r }, this.hasErrors = Object.keys(this.errors).length > 0;
718
- }
719
- });
720
- return W(
721
- () => a.fields,
722
- () => {
723
- a.dirty = !Ga(a.fields, e);
724
- },
725
- { immediate: !0, deep: !0 }
726
- ), a;
727
- }
728
- const It = /* @__PURE__ */ K({
729
- __name: "PasswordConfirm",
730
- props: {
731
- action: {},
732
- successAction: {},
733
- successMessage: {},
734
- confirmText: { default: "Confirm" },
735
- cancelText: { default: "Cancel" },
736
- passwordLabel: {}
737
- },
738
- emits: ["confirm", "cancel"],
739
- setup(n, { emit: e }) {
740
- const t = e, a = n, r = [
741
- {
742
- name: "password",
743
- text: "Confirm Password",
744
- placeholder: "Password",
745
- autocomplete: "current-password",
746
- ariaAutocomplete: "inline",
747
- type: "password",
748
- required: !0,
749
- max: 255
750
- }
751
- ], o = Za({
752
- password: ""
753
- }), s = async () => {
754
- o.submit(
755
- async (l) => a.action(l),
756
- {
757
- onSuccess: (l) => {
758
- a.successMessage && Tt.success(a.successMessage), a.successAction && a.successAction(l), t("confirm");
759
- },
760
- onError() {
761
- o.reset("password");
762
- }
763
- }
764
- );
765
- };
766
- return (l, c) => (m(), Y(ja, {
767
- onSubmit: re(s, ["prevent"]),
768
- "footer-class": "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 text-sm"
769
- }, {
770
- footer: B(() => [
771
- M(nt, {
772
- variant: "reset",
773
- type: "button",
774
- disabled: b(o).processing,
775
- class: "!capitalize",
776
- onClick: c[0] || (c[0] = (i) => l.$emit("cancel"))
777
- }, {
778
- default: B(() => [
779
- Z(j(l.cancelText), 1)
780
- ]),
781
- _: 1
782
- }, 8, ["disabled"]),
783
- M(nt, {
784
- variant: "submit",
785
- type: "button",
786
- onClick: s,
787
- disabled: b(o).processing,
788
- class: "!capitalize !bg-rose-600 hover:!bg-rose-500"
789
- }, {
790
- default: B(() => [
791
- Z(j(l.confirmText), 1)
792
- ]),
793
- _: 1
794
- }, 8, ["disabled"])
795
- ]),
796
- default: B(() => [
797
- (m(), C(X, null, ge(r, (i, d) => M(za, { key: d }, {
798
- default: B(() => [
799
- l.passwordLabel ? (m(), Y(kt, {
800
- key: 0,
801
- field: { ...i, text: l.passwordLabel }
802
- }, null, 8, ["field"])) : R("", !0),
803
- M(Fa, {
804
- modelValue: b(o).fields[i.name],
805
- "onUpdate:modelValue": (g) => b(o).fields[i.name] = g,
806
- field: i,
807
- class: "!mt-0"
808
- }, null, 8, ["modelValue", "onUpdate:modelValue", "field"]),
809
- M(ta, {
810
- errors: b(o).errors,
811
- "field-name": i.name
812
- }, null, 8, ["errors", "field-name"])
813
- ]),
814
- _: 2
815
- }, 1024)), 64))
816
- ]),
817
- _: 1
818
- }));
819
- }
820
- }), Xa = { class: "flex flex-wrap gap-2 items-center" }, Qa = {
821
- ref: "modalTitle",
822
- id: "modalTitle",
823
- class: "text-xl font-semibold scroll-mt-16 sm:scroll-mt-12 flex-1"
824
- }, Ja = {
825
- key: 0,
826
- class: "text-neutral-500 dark:text-neutral-400 text-sm w-full",
827
- id: "modalDescription"
828
- }, $t = /* @__PURE__ */ K({
829
- __name: "BaseModal",
830
- props: {
831
- modal: {}
832
- },
833
- setup(n) {
834
- return (e, t) => (m(), C(X, null, [
835
- x("section", Xa, [
836
- x("h3", Qa, [
837
- F(e.$slots, "title", {}, () => {
838
- var a;
839
- return [
840
- Z(j(((a = e.modal.props) == null ? void 0 : a.title) ?? "Modal Title"), 1)
841
- ];
842
- })
843
- ], 512),
844
- M(Ve, {
845
- onClick: e.modal.close,
846
- class: "!m-0 !static"
847
- }, null, 8, ["onClick"]),
848
- e.$slots.description ? (m(), C("p", Ja, [
849
- F(e.$slots, "description")
850
- ])) : R("", !0)
851
- ]),
852
- F(e.$slots, "default")
853
- ], 64));
854
- }
855
- }), Hr = /* @__PURE__ */ K({
856
- __name: "LogoutSessionsModal",
857
- props: {
858
- onSuccess: { type: Function }
859
- },
860
- setup(n) {
861
- const e = n, t = Ge();
862
- function a() {
863
- var r;
864
- t.close(), (r = e.onSuccess) == null || r.call(e);
865
- }
866
- return (r, o) => (m(), Y($t, { modal: b(t) }, {
867
- title: B(() => o[0] || (o[0] = [
868
- Z("Sign Out of Other Devices", -1)
869
- ])),
870
- description: B(() => o[1] || (o[1] = [
871
- Z("Are you sure you want to sign out of other devices? You won't be able to undo this action.", -1)
872
- ])),
873
- default: B(() => [
874
- M(It, {
875
- action: async () => {
876
- },
877
- "success-message": "Other Sessions Logged Out Successfully",
878
- onConfirm: a,
879
- onCancel: b(t).close
880
- }, null, 8, ["onCancel"])
881
- ]),
882
- _: 1
883
- }, 8, ["modal"]));
884
- }
885
- }), zr = /* @__PURE__ */ K({
886
- __name: "DeleteAccountModal",
887
- setup(n) {
888
- const e = Ge(), t = Xt();
889
- function a() {
890
- e.close(), t.push("/");
891
- }
892
- async function r() {
893
- }
894
- return (o, s) => (m(), Y($t, { modal: b(e) }, {
895
- title: B(() => s[0] || (s[0] = [
896
- Z("Are you sure you want to delete your account?", -1)
897
- ])),
898
- description: B(() => s[1] || (s[1] = [
899
- Z(" Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account. ", -1)
900
- ])),
901
- default: B(() => [
902
- M(It, {
903
- action: r,
904
- "success-message": "Account Deleted...",
905
- onConfirm: a,
906
- onCancel: b(e).close
907
- }, null, 8, ["onCancel"])
908
- ]),
909
- _: 1
910
- }, 8, ["modal"]));
911
- }
912
- });
913
- function Ze(n) {
914
- return Yt() ? (bt(n), !0) : !1;
915
- }
916
- function ce(n) {
917
- return typeof n == "function" ? n() : b(n);
918
- }
919
- const Xe = typeof window < "u" && typeof document < "u";
920
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
921
- const en = Object.prototype.toString, Pt = (n) => en.call(n) === "[object Object]", me = () => {
922
- }, je = /* @__PURE__ */ tn();
923
- function tn() {
924
- var n, e;
925
- return Xe && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
926
- }
927
- function an(...n) {
928
- if (n.length !== 1)
929
- return Kt(...n);
930
- const e = n[0];
931
- return typeof e == "function" ? Ht(zt(() => ({ get: e, set: me }))) : w(e);
932
- }
933
- function ke(n) {
934
- var e;
935
- const t = ce(n);
936
- return (e = t == null ? void 0 : t.$el) != null ? e : t;
937
- }
938
- const St = Xe ? window : void 0;
939
- function Be(...n) {
940
- let e, t, a, r;
941
- if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([t, a, r] = n, e = St) : [e, t, a, r] = n, !e)
942
- return me;
943
- Array.isArray(t) || (t = [t]), Array.isArray(a) || (a = [a]);
944
- const o = [], s = () => {
945
- o.forEach((d) => d()), o.length = 0;
946
- }, l = (d, g, h, v) => (d.addEventListener(g, h, v), () => d.removeEventListener(g, h, v)), c = W(
947
- () => [ke(e), ce(r)],
948
- ([d, g]) => {
949
- if (s(), !d)
950
- return;
951
- const h = Pt(g) ? { ...g } : g;
952
- o.push(
953
- ...t.flatMap((v) => a.map((p) => l(d, v, p, h)))
954
- );
955
- },
956
- { immediate: !0, flush: "post" }
957
- ), i = () => {
958
- c(), s();
959
- };
960
- return Ze(i), i;
961
- }
962
- let st = !1;
963
- function nn(n, e, t = {}) {
964
- const { window: a = St, ignore: r = [], capture: o = !0, detectIframe: s = !1 } = t;
965
- if (!a)
966
- return me;
967
- je && !st && (st = !0, Array.from(a.document.body.children).forEach((h) => h.addEventListener("click", me)), a.document.documentElement.addEventListener("click", me));
968
- let l = !0;
969
- const c = (h) => r.some((v) => {
970
- if (typeof v == "string")
971
- return Array.from(a.document.querySelectorAll(v)).some((p) => p === h.target || h.composedPath().includes(p));
972
- {
973
- const p = ke(v);
974
- return p && (h.target === p || h.composedPath().includes(p));
975
- }
976
- }), d = [
977
- Be(a, "click", (h) => {
978
- const v = ke(n);
979
- if (!(!v || v === h.target || h.composedPath().includes(v))) {
980
- if (h.detail === 0 && (l = !c(h)), !l) {
981
- l = !0;
982
- return;
983
- }
984
- e(h);
985
- }
986
- }, { passive: !0, capture: o }),
987
- Be(a, "pointerdown", (h) => {
988
- const v = ke(n);
989
- l = !c(h) && !!(v && !h.composedPath().includes(v));
990
- }, { passive: !0 }),
991
- s && Be(a, "blur", (h) => {
992
- setTimeout(() => {
993
- var v;
994
- const p = ke(n);
995
- ((v = a.document.activeElement) == null ? void 0 : v.tagName) === "IFRAME" && !(p != null && p.contains(a.document.activeElement)) && e(h);
996
- }, 0);
997
- })
998
- ].filter(Boolean);
999
- return () => d.forEach((h) => h());
1000
- }
1001
- const At = /* @__PURE__ */ K({
1002
- name: "OnClickOutside",
1003
- props: ["as", "options"],
1004
- emits: ["trigger"],
1005
- setup(n, { slots: e, emit: t }) {
1006
- const a = w();
1007
- return nn(a, (r) => {
1008
- t("trigger", r);
1009
- }, n.options), () => {
1010
- if (e.default)
1011
- return ht(n.as || "div", { ref: a }, e.default());
1012
- };
1013
- }
1014
- });
1015
- function rn(n) {
1016
- var e;
1017
- const t = ce(n);
1018
- return (e = t == null ? void 0 : t.$el) != null ? e : t;
1019
- }
1020
- const sn = Xe ? window : void 0;
1021
- function on(...n) {
1022
- let e, t, a, r;
1023
- if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([t, a, r] = n, e = sn) : [e, t, a, r] = n, !e)
1024
- return me;
1025
- Array.isArray(t) || (t = [t]), Array.isArray(a) || (a = [a]);
1026
- const o = [], s = () => {
1027
- o.forEach((d) => d()), o.length = 0;
1028
- }, l = (d, g, h, v) => (d.addEventListener(g, h, v), () => d.removeEventListener(g, h, v)), c = W(
1029
- () => [rn(e), ce(r)],
1030
- ([d, g]) => {
1031
- if (s(), !d)
1032
- return;
1033
- const h = Pt(g) ? { ...g } : g;
1034
- o.push(
1035
- ...t.flatMap((v) => a.map((p) => l(d, v, p, h)))
1036
- );
1037
- },
1038
- { immediate: !0, flush: "post" }
1039
- ), i = () => {
1040
- c(), s();
1041
- };
1042
- return Ze(i), i;
1043
- }
1044
- function Fe(n) {
1045
- return typeof Window < "u" && n instanceof Window ? n.document.documentElement : typeof Document < "u" && n instanceof Document ? n.documentElement : n;
1046
- }
1047
- function Et(n) {
1048
- const e = window.getComputedStyle(n);
1049
- if (e.overflowX === "scroll" || e.overflowY === "scroll" || e.overflowX === "auto" && n.clientWidth < n.scrollWidth || e.overflowY === "auto" && n.clientHeight < n.scrollHeight)
1050
- return !0;
1051
- {
1052
- const t = n.parentNode;
1053
- return !t || t.tagName === "BODY" ? !1 : Et(t);
1054
- }
1055
- }
1056
- function ln(n) {
1057
- const e = n || window.event, t = e.target;
1058
- return Et(t) ? !1 : e.touches.length > 1 ? !0 : (e.preventDefault && e.preventDefault(), !1);
1059
- }
1060
- const _e = /* @__PURE__ */ new WeakMap();
1061
- function un(n, e = !1) {
1062
- const t = w(e);
1063
- let a = null, r = "";
1064
- W(an(n), (l) => {
1065
- const c = Fe(ce(l));
1066
- if (c) {
1067
- const i = c;
1068
- if (_e.get(i) || _e.set(i, i.style.overflow), i.style.overflow !== "hidden" && (r = i.style.overflow), i.style.overflow === "hidden")
1069
- return t.value = !0;
1070
- if (t.value)
1071
- return i.style.overflow = "hidden";
1072
- }
1073
- }, {
1074
- immediate: !0
1075
- });
1076
- const o = () => {
1077
- const l = Fe(ce(n));
1078
- !l || t.value || (je && (a = on(
1079
- l,
1080
- "touchmove",
1081
- (c) => {
1082
- ln(c);
1083
- },
1084
- { passive: !1 }
1085
- )), l.style.overflow = "hidden", t.value = !0);
1086
- }, s = () => {
1087
- const l = Fe(ce(n));
1088
- !l || !t.value || (je && (a == null || a()), l.style.overflow = r, _e.delete(l), t.value = !1);
1089
- };
1090
- return Ze(s), J({
1091
- get() {
1092
- return t.value;
1093
- },
1094
- set(l) {
1095
- l ? o() : s();
1096
- }
1097
- });
1098
- }
1099
- function cn() {
1100
- let n = !1;
1101
- const e = w(!1);
1102
- return (t, a) => {
1103
- if (e.value = a.value, n)
1104
- return;
1105
- n = !0;
1106
- const r = un(t, a.value);
1107
- W(e, (o) => r.value = o);
1108
- };
1109
- }
1110
- cn();
1111
- function dn(n) {
1112
- return typeof n == "function" ? n() : b(n);
1113
- }
1114
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1115
- function fn(n) {
1116
- var e;
1117
- const t = dn(n);
1118
- return (e = t == null ? void 0 : t.$el) != null ? e : t;
1119
- }
1120
- /*!
1121
- * tabbable 6.2.0
1122
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
1123
- */
1124
- var Dt = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"], Pe = /* @__PURE__ */ Dt.join(","), Mt = typeof Element > "u", de = Mt ? function() {
1125
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Se = !Mt && Element.prototype.getRootNode ? function(n) {
1126
- var e;
1127
- return n == null || (e = n.getRootNode) === null || e === void 0 ? void 0 : e.call(n);
1128
- } : function(n) {
1129
- return n == null ? void 0 : n.ownerDocument;
1130
- }, Ae = function n(e, t) {
1131
- var a;
1132
- t === void 0 && (t = !0);
1133
- var r = e == null || (a = e.getAttribute) === null || a === void 0 ? void 0 : a.call(e, "inert"), o = r === "" || r === "true", s = o || t && e && n(e.parentNode);
1134
- return s;
1135
- }, vn = function(e) {
1136
- var t, a = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
1137
- return a === "" || a === "true";
1138
- }, Nt = function(e, t, a) {
1139
- if (Ae(e))
1140
- return [];
1141
- var r = Array.prototype.slice.apply(e.querySelectorAll(Pe));
1142
- return t && de.call(e, Pe) && r.unshift(e), r = r.filter(a), r;
1143
- }, Ot = function n(e, t, a) {
1144
- for (var r = [], o = Array.from(e); o.length; ) {
1145
- var s = o.shift();
1146
- if (!Ae(s, !1))
1147
- if (s.tagName === "SLOT") {
1148
- var l = s.assignedElements(), c = l.length ? l : s.children, i = n(c, !0, a);
1149
- a.flatten ? r.push.apply(r, i) : r.push({
1150
- scopeParent: s,
1151
- candidates: i
1152
- });
1153
- } else {
1154
- var d = de.call(s, Pe);
1155
- d && a.filter(s) && (t || !e.includes(s)) && r.push(s);
1156
- var g = s.shadowRoot || // check for an undisclosed shadow
1157
- typeof a.getShadowRoot == "function" && a.getShadowRoot(s), h = !Ae(g, !1) && (!a.shadowRootFilter || a.shadowRootFilter(s));
1158
- if (g && h) {
1159
- var v = n(g === !0 ? s.children : g.children, !0, a);
1160
- a.flatten ? r.push.apply(r, v) : r.push({
1161
- scopeParent: s,
1162
- candidates: v
1163
- });
1164
- } else
1165
- o.unshift.apply(o, s.children);
1166
- }
1167
- }
1168
- return r;
1169
- }, Lt = function(e) {
1170
- return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
1171
- }, ue = function(e) {
1172
- if (!e)
1173
- throw new Error("No node provided");
1174
- return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || vn(e)) && !Lt(e) ? 0 : e.tabIndex;
1175
- }, mn = function(e, t) {
1176
- var a = ue(e);
1177
- return a < 0 && t && !Lt(e) ? 0 : a;
1178
- }, pn = function(e, t) {
1179
- return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
1180
- }, Bt = function(e) {
1181
- return e.tagName === "INPUT";
1182
- }, gn = function(e) {
1183
- return Bt(e) && e.type === "hidden";
1184
- }, bn = function(e) {
1185
- var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(a) {
1186
- return a.tagName === "SUMMARY";
1187
- });
1188
- return t;
1189
- }, hn = function(e, t) {
1190
- for (var a = 0; a < e.length; a++)
1191
- if (e[a].checked && e[a].form === t)
1192
- return e[a];
1193
- }, yn = function(e) {
1194
- if (!e.name)
1195
- return !0;
1196
- var t = e.form || Se(e), a = function(l) {
1197
- return t.querySelectorAll('input[type="radio"][name="' + l + '"]');
1198
- }, r;
1199
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
1200
- r = a(window.CSS.escape(e.name));
1201
- else
1202
- try {
1203
- r = a(e.name);
1204
- } catch (s) {
1205
- return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", s.message), !1;
1206
- }
1207
- var o = hn(r, e.form);
1208
- return !o || o === e;
1209
- }, wn = function(e) {
1210
- return Bt(e) && e.type === "radio";
1211
- }, kn = function(e) {
1212
- return wn(e) && !yn(e);
1213
- }, xn = function(e) {
1214
- var t, a = e && Se(e), r = (t = a) === null || t === void 0 ? void 0 : t.host, o = !1;
1215
- if (a && a !== e) {
1216
- var s, l, c;
1217
- for (o = !!((s = r) !== null && s !== void 0 && (l = s.ownerDocument) !== null && l !== void 0 && l.contains(r) || e != null && (c = e.ownerDocument) !== null && c !== void 0 && c.contains(e)); !o && r; ) {
1218
- var i, d, g;
1219
- a = Se(r), r = (i = a) === null || i === void 0 ? void 0 : i.host, o = !!((d = r) !== null && d !== void 0 && (g = d.ownerDocument) !== null && g !== void 0 && g.contains(r));
1220
- }
1221
- }
1222
- return o;
1223
- }, ot = function(e) {
1224
- var t = e.getBoundingClientRect(), a = t.width, r = t.height;
1225
- return a === 0 && r === 0;
1226
- }, Cn = function(e, t) {
1227
- var a = t.displayCheck, r = t.getShadowRoot;
1228
- if (getComputedStyle(e).visibility === "hidden")
1229
- return !0;
1230
- var o = de.call(e, "details>summary:first-of-type"), s = o ? e.parentElement : e;
1231
- if (de.call(s, "details:not([open]) *"))
1232
- return !0;
1233
- if (!a || a === "full" || a === "legacy-full") {
1234
- if (typeof r == "function") {
1235
- for (var l = e; e; ) {
1236
- var c = e.parentElement, i = Se(e);
1237
- if (c && !c.shadowRoot && r(c) === !0)
1238
- return ot(e);
1239
- e.assignedSlot ? e = e.assignedSlot : !c && i !== e.ownerDocument ? e = i.host : e = c;
1240
- }
1241
- e = l;
1242
- }
1243
- if (xn(e))
1244
- return !e.getClientRects().length;
1245
- if (a !== "legacy-full")
1246
- return !0;
1247
- } else if (a === "non-zero-area")
1248
- return ot(e);
1249
- return !1;
1250
- }, Tn = function(e) {
1251
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
1252
- for (var t = e.parentElement; t; ) {
1253
- if (t.tagName === "FIELDSET" && t.disabled) {
1254
- for (var a = 0; a < t.children.length; a++) {
1255
- var r = t.children.item(a);
1256
- if (r.tagName === "LEGEND")
1257
- return de.call(t, "fieldset[disabled] *") ? !0 : !r.contains(e);
1258
- }
1259
- return !0;
1260
- }
1261
- t = t.parentElement;
1262
- }
1263
- return !1;
1264
- }, Ee = function(e, t) {
1265
- return !(t.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
1266
- // because we're limited in the type of selectors we can use in JSDom (see related
1267
- // note related to `candidateSelectors`)
1268
- Ae(t) || gn(t) || Cn(t, e) || // For a details element with a summary, the summary element gets the focus
1269
- bn(t) || Tn(t));
1270
- }, Ye = function(e, t) {
1271
- return !(kn(t) || ue(t) < 0 || !Ee(e, t));
1272
- }, In = function(e) {
1273
- var t = parseInt(e.getAttribute("tabindex"), 10);
1274
- return !!(isNaN(t) || t >= 0);
1275
- }, $n = function n(e) {
1276
- var t = [], a = [];
1277
- return e.forEach(function(r, o) {
1278
- var s = !!r.scopeParent, l = s ? r.scopeParent : r, c = mn(l, s), i = s ? n(r.candidates) : l;
1279
- c === 0 ? s ? t.push.apply(t, i) : t.push(l) : a.push({
1280
- documentOrder: o,
1281
- tabIndex: c,
1282
- item: r,
1283
- isScope: s,
1284
- content: i
1285
- });
1286
- }), a.sort(pn).reduce(function(r, o) {
1287
- return o.isScope ? r.push.apply(r, o.content) : r.push(o.content), r;
1288
- }, []).concat(t);
1289
- }, Pn = function(e, t) {
1290
- t = t || {};
1291
- var a;
1292
- return t.getShadowRoot ? a = Ot([e], t.includeContainer, {
1293
- filter: Ye.bind(null, t),
1294
- flatten: !1,
1295
- getShadowRoot: t.getShadowRoot,
1296
- shadowRootFilter: In
1297
- }) : a = Nt(e, t.includeContainer, Ye.bind(null, t)), $n(a);
1298
- }, Sn = function(e, t) {
1299
- t = t || {};
1300
- var a;
1301
- return t.getShadowRoot ? a = Ot([e], t.includeContainer, {
1302
- filter: Ee.bind(null, t),
1303
- flatten: !0,
1304
- getShadowRoot: t.getShadowRoot
1305
- }) : a = Nt(e, t.includeContainer, Ee.bind(null, t)), a;
1306
- }, ve = function(e, t) {
1307
- if (t = t || {}, !e)
1308
- throw new Error("No node provided");
1309
- return de.call(e, Pe) === !1 ? !1 : Ye(t, e);
1310
- }, An = /* @__PURE__ */ Dt.concat("iframe").join(","), Re = function(e, t) {
1311
- if (t = t || {}, !e)
1312
- throw new Error("No node provided");
1313
- return de.call(e, An) === !1 ? !1 : Ee(t, e);
1314
- };
1315
- /*!
1316
- * focus-trap 7.6.5
1317
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
1318
- */
1319
- function Ke(n, e) {
1320
- (e == null || e > n.length) && (e = n.length);
1321
- for (var t = 0, a = Array(e); t < e; t++) a[t] = n[t];
1322
- return a;
1323
- }
1324
- function En(n) {
1325
- if (Array.isArray(n)) return Ke(n);
1326
- }
1327
- function Dn(n, e, t) {
1328
- return (e = Bn(e)) in n ? Object.defineProperty(n, e, {
1329
- value: t,
1330
- enumerable: !0,
1331
- configurable: !0,
1332
- writable: !0
1333
- }) : n[e] = t, n;
1334
- }
1335
- function Mn(n) {
1336
- if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null) return Array.from(n);
1337
- }
1338
- function Nn() {
1339
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
1340
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1341
- }
1342
- function lt(n, e) {
1343
- var t = Object.keys(n);
1344
- if (Object.getOwnPropertySymbols) {
1345
- var a = Object.getOwnPropertySymbols(n);
1346
- e && (a = a.filter(function(r) {
1347
- return Object.getOwnPropertyDescriptor(n, r).enumerable;
1348
- })), t.push.apply(t, a);
1349
- }
1350
- return t;
1351
- }
1352
- function it(n) {
1353
- for (var e = 1; e < arguments.length; e++) {
1354
- var t = arguments[e] != null ? arguments[e] : {};
1355
- e % 2 ? lt(Object(t), !0).forEach(function(a) {
1356
- Dn(n, a, t[a]);
1357
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : lt(Object(t)).forEach(function(a) {
1358
- Object.defineProperty(n, a, Object.getOwnPropertyDescriptor(t, a));
1359
- });
1360
- }
1361
- return n;
1362
- }
1363
- function On(n) {
1364
- return En(n) || Mn(n) || Fn(n) || Nn();
1365
- }
1366
- function Ln(n, e) {
1367
- if (typeof n != "object" || !n) return n;
1368
- var t = n[Symbol.toPrimitive];
1369
- if (t !== void 0) {
1370
- var a = t.call(n, e);
1371
- if (typeof a != "object") return a;
1372
- throw new TypeError("@@toPrimitive must return a primitive value.");
1373
- }
1374
- return (e === "string" ? String : Number)(n);
1375
- }
1376
- function Bn(n) {
1377
- var e = Ln(n, "string");
1378
- return typeof e == "symbol" ? e : e + "";
1379
- }
1380
- function Fn(n, e) {
1381
- if (n) {
1382
- if (typeof n == "string") return Ke(n, e);
1383
- var t = {}.toString.call(n).slice(8, -1);
1384
- return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Ke(n, e) : void 0;
1385
- }
1386
- }
1387
- var ut = {
1388
- activateTrap: function(e, t) {
1389
- if (e.length > 0) {
1390
- var a = e[e.length - 1];
1391
- a !== t && a._setPausedState(!0);
1392
- }
1393
- var r = e.indexOf(t);
1394
- r === -1 || e.splice(r, 1), e.push(t);
1395
- },
1396
- deactivateTrap: function(e, t) {
1397
- var a = e.indexOf(t);
1398
- a !== -1 && e.splice(a, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
1399
- }
1400
- }, _n = function(e) {
1401
- return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
1402
- }, Rn = function(e) {
1403
- return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
1404
- }, xe = function(e) {
1405
- return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
1406
- }, Vn = function(e) {
1407
- return xe(e) && !e.shiftKey;
1408
- }, jn = function(e) {
1409
- return xe(e) && e.shiftKey;
1410
- }, ct = function(e) {
1411
- return setTimeout(e, 0);
1412
- }, we = function(e) {
1413
- for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
1414
- a[r - 1] = arguments[r];
1415
- return typeof e == "function" ? e.apply(void 0, a) : e;
1416
- }, Ie = function(e) {
1417
- return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
1418
- }, Yn = [], Kn = function(e, t) {
1419
- var a = (t == null ? void 0 : t.document) || document, r = (t == null ? void 0 : t.trapStack) || Yn, o = it({
1420
- returnFocusOnDeactivate: !0,
1421
- escapeDeactivates: !0,
1422
- delayInitialFocus: !0,
1423
- isKeyForward: Vn,
1424
- isKeyBackward: jn
1425
- }, t), s = {
1426
- // containers given to createFocusTrap()
1427
- // @type {Array<HTMLElement>}
1428
- containers: [],
1429
- // list of objects identifying tabbable nodes in `containers` in the trap
1430
- // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
1431
- // is active, but the trap should never get to a state where there isn't at least one group
1432
- // with at least one tabbable node in it (that would lead to an error condition that would
1433
- // result in an error being thrown)
1434
- // @type {Array<{
1435
- // container: HTMLElement,
1436
- // tabbableNodes: Array<HTMLElement>, // empty if none
1437
- // focusableNodes: Array<HTMLElement>, // empty if none
1438
- // posTabIndexesFound: boolean,
1439
- // firstTabbableNode: HTMLElement|undefined,
1440
- // lastTabbableNode: HTMLElement|undefined,
1441
- // firstDomTabbableNode: HTMLElement|undefined,
1442
- // lastDomTabbableNode: HTMLElement|undefined,
1443
- // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
1444
- // }>}
1445
- containerGroups: [],
1446
- // same order/length as `containers` list
1447
- // references to objects in `containerGroups`, but only those that actually have
1448
- // tabbable nodes in them
1449
- // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
1450
- // the same length
1451
- tabbableGroups: [],
1452
- nodeFocusedBeforeActivation: null,
1453
- mostRecentlyFocusedNode: null,
1454
- active: !1,
1455
- paused: !1,
1456
- manuallyPaused: !1,
1457
- // timer ID for when delayInitialFocus is true and initial focus in this trap
1458
- // has been delayed during activation
1459
- delayInitialFocusTimer: void 0,
1460
- // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
1461
- recentNavEvent: void 0
1462
- }, l, c = function(f, u, y) {
1463
- return f && f[u] !== void 0 ? f[u] : o[y || u];
1464
- }, i = function(f, u) {
1465
- var y = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
1466
- return s.containerGroups.findIndex(function(I) {
1467
- var S = I.container, O = I.tabbableNodes;
1468
- return S.contains(f) || // fall back to explicit tabbable search which will take into consideration any
1469
- // web components if the `tabbableOptions.getShadowRoot` option was used for
1470
- // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
1471
- // look inside web components even if open)
1472
- (y == null ? void 0 : y.includes(S)) || O.find(function(A) {
1473
- return A === f;
1474
- });
1475
- });
1476
- }, d = function(f) {
1477
- var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = u.hasFallback, I = y === void 0 ? !1 : y, S = u.params, O = S === void 0 ? [] : S, A = o[f];
1478
- if (typeof A == "function" && (A = A.apply(void 0, On(O))), A === !0 && (A = void 0), !A) {
1479
- if (A === void 0 || A === !1)
1480
- return A;
1481
- throw new Error("`".concat(f, "` was specified but was not a node, or did not return a node"));
1482
- }
1483
- var L = A;
1484
- if (typeof A == "string") {
1485
- try {
1486
- L = a.querySelector(A);
1487
- } catch (z) {
1488
- throw new Error("`".concat(f, '` appears to be an invalid selector; error="').concat(z.message, '"'));
1489
- }
1490
- if (!L && !I)
1491
- throw new Error("`".concat(f, "` as selector refers to no known node"));
1492
- }
1493
- return L;
1494
- }, g = function() {
1495
- var f = d("initialFocus", {
1496
- hasFallback: !0
1497
- });
1498
- if (f === !1)
1499
- return !1;
1500
- if (f === void 0 || f && !Re(f, o.tabbableOptions))
1501
- if (i(a.activeElement) >= 0)
1502
- f = a.activeElement;
1503
- else {
1504
- var u = s.tabbableGroups[0], y = u && u.firstTabbableNode;
1505
- f = y || d("fallbackFocus");
1506
- }
1507
- else f === null && (f = d("fallbackFocus"));
1508
- if (!f)
1509
- throw new Error("Your focus-trap needs to have at least one focusable element");
1510
- return f;
1511
- }, h = function() {
1512
- if (s.containerGroups = s.containers.map(function(f) {
1513
- var u = Pn(f, o.tabbableOptions), y = Sn(f, o.tabbableOptions), I = u.length > 0 ? u[0] : void 0, S = u.length > 0 ? u[u.length - 1] : void 0, O = y.find(function(z) {
1514
- return ve(z);
1515
- }), A = y.slice().reverse().find(function(z) {
1516
- return ve(z);
1517
- }), L = !!u.find(function(z) {
1518
- return ue(z) > 0;
1519
- });
1520
- return {
1521
- container: f,
1522
- tabbableNodes: u,
1523
- focusableNodes: y,
1524
- /** True if at least one node with positive `tabindex` was found in this container. */
1525
- posTabIndexesFound: L,
1526
- /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
1527
- firstTabbableNode: I,
1528
- /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
1529
- lastTabbableNode: S,
1530
- // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
1531
- // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
1532
- // because that API doesn't work with Shadow DOM as well as it should (@see
1533
- // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
1534
- // to address an edge case related to positive tabindex support, this seems like a much easier,
1535
- // "close enough most of the time" alternative for positive tabindexes which should generally
1536
- // be avoided anyway...
1537
- /** First tabbable node in container, __DOM__ order; `undefined` if none. */
1538
- firstDomTabbableNode: O,
1539
- /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
1540
- lastDomTabbableNode: A,
1541
- /**
1542
- * Finds the __tabbable__ node that follows the given node in the specified direction,
1543
- * in this container, if any.
1544
- * @param {HTMLElement} node
1545
- * @param {boolean} [forward] True if going in forward tab order; false if going
1546
- * in reverse.
1547
- * @returns {HTMLElement|undefined} The next tabbable node, if any.
1548
- */
1549
- nextTabbableNode: function(oe) {
1550
- var he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, ne = u.indexOf(oe);
1551
- return ne < 0 ? he ? y.slice(y.indexOf(oe) + 1).find(function(ye) {
1552
- return ve(ye);
1553
- }) : y.slice(0, y.indexOf(oe)).reverse().find(function(ye) {
1554
- return ve(ye);
1555
- }) : u[ne + (he ? 1 : -1)];
1556
- }
1557
- };
1558
- }), s.tabbableGroups = s.containerGroups.filter(function(f) {
1559
- return f.tabbableNodes.length > 0;
1560
- }), s.tabbableGroups.length <= 0 && !d("fallbackFocus"))
1561
- throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
1562
- if (s.containerGroups.find(function(f) {
1563
- return f.posTabIndexesFound;
1564
- }) && s.containerGroups.length > 1)
1565
- throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
1566
- }, v = function(f) {
1567
- var u = f.activeElement;
1568
- if (u)
1569
- return u.shadowRoot && u.shadowRoot.activeElement !== null ? v(u.shadowRoot) : u;
1570
- }, p = function(f) {
1571
- if (f !== !1 && f !== v(document)) {
1572
- if (!f || !f.focus) {
1573
- p(g());
1574
- return;
1575
- }
1576
- f.focus({
1577
- preventScroll: !!o.preventScroll
1578
- }), s.mostRecentlyFocusedNode = f, _n(f) && f.select();
1579
- }
1580
- }, T = function(f) {
1581
- var u = d("setReturnFocus", {
1582
- params: [f]
1583
- });
1584
- return u || (u === !1 ? !1 : f);
1585
- }, P = function(f) {
1586
- var u = f.target, y = f.event, I = f.isBackward, S = I === void 0 ? !1 : I;
1587
- u = u || Ie(y), h();
1588
- var O = null;
1589
- if (s.tabbableGroups.length > 0) {
1590
- var A = i(u, y), L = A >= 0 ? s.containerGroups[A] : void 0;
1591
- if (A < 0)
1592
- S ? O = s.tabbableGroups[s.tabbableGroups.length - 1].lastTabbableNode : O = s.tabbableGroups[0].firstTabbableNode;
1593
- else if (S) {
1594
- var z = s.tabbableGroups.findIndex(function(Me) {
1595
- var Ne = Me.firstTabbableNode;
1596
- return u === Ne;
1597
- });
1598
- if (z < 0 && (L.container === u || Re(u, o.tabbableOptions) && !ve(u, o.tabbableOptions) && !L.nextTabbableNode(u, !1)) && (z = A), z >= 0) {
1599
- var oe = z === 0 ? s.tabbableGroups.length - 1 : z - 1, he = s.tabbableGroups[oe];
1600
- O = ue(u) >= 0 ? he.lastTabbableNode : he.lastDomTabbableNode;
1601
- } else xe(y) || (O = L.nextTabbableNode(u, !1));
1602
- } else {
1603
- var ne = s.tabbableGroups.findIndex(function(Me) {
1604
- var Ne = Me.lastTabbableNode;
1605
- return u === Ne;
1606
- });
1607
- if (ne < 0 && (L.container === u || Re(u, o.tabbableOptions) && !ve(u, o.tabbableOptions) && !L.nextTabbableNode(u)) && (ne = A), ne >= 0) {
1608
- var ye = ne === s.tabbableGroups.length - 1 ? 0 : ne + 1, Qe = s.tabbableGroups[ye];
1609
- O = ue(u) >= 0 ? Qe.firstTabbableNode : Qe.firstDomTabbableNode;
1610
- } else xe(y) || (O = L.nextTabbableNode(u));
1611
- }
1612
- } else
1613
- O = d("fallbackFocus");
1614
- return O;
1615
- }, k = function(f) {
1616
- var u = Ie(f);
1617
- if (!(i(u, f) >= 0)) {
1618
- if (we(o.clickOutsideDeactivates, f)) {
1619
- l.deactivate({
1620
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
1621
- // which will result in the outside click setting focus to the node
1622
- // that was clicked (and if not focusable, to "nothing"); by setting
1623
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
1624
- // on activation (or the configured `setReturnFocus` node), whether the
1625
- // outside click was on a focusable node or not
1626
- returnFocus: o.returnFocusOnDeactivate
1627
- });
1628
- return;
1629
- }
1630
- we(o.allowOutsideClick, f) || f.preventDefault();
1631
- }
1632
- }, E = function(f) {
1633
- var u = Ie(f), y = i(u, f) >= 0;
1634
- if (y || u instanceof Document)
1635
- y && (s.mostRecentlyFocusedNode = u);
1636
- else {
1637
- f.stopImmediatePropagation();
1638
- var I, S = !0;
1639
- if (s.mostRecentlyFocusedNode)
1640
- if (ue(s.mostRecentlyFocusedNode) > 0) {
1641
- var O = i(s.mostRecentlyFocusedNode), A = s.containerGroups[O].tabbableNodes;
1642
- if (A.length > 0) {
1643
- var L = A.findIndex(function(z) {
1644
- return z === s.mostRecentlyFocusedNode;
1645
- });
1646
- L >= 0 && (o.isKeyForward(s.recentNavEvent) ? L + 1 < A.length && (I = A[L + 1], S = !1) : L - 1 >= 0 && (I = A[L - 1], S = !1));
1647
- }
1648
- } else
1649
- s.containerGroups.some(function(z) {
1650
- return z.tabbableNodes.some(function(oe) {
1651
- return ue(oe) > 0;
1652
- });
1653
- }) || (S = !1);
1654
- else
1655
- S = !1;
1656
- S && (I = P({
1657
- // move FROM the MRU node, not event-related node (which will be the node that is
1658
- // outside the trap causing the focus escape we're trying to fix)
1659
- target: s.mostRecentlyFocusedNode,
1660
- isBackward: o.isKeyBackward(s.recentNavEvent)
1661
- })), p(I || s.mostRecentlyFocusedNode || g());
1662
- }
1663
- s.recentNavEvent = void 0;
1664
- }, V = function(f) {
1665
- var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1666
- s.recentNavEvent = f;
1667
- var y = P({
1668
- event: f,
1669
- isBackward: u
1670
- });
1671
- y && (xe(f) && f.preventDefault(), p(y));
1672
- }, U = function(f) {
1673
- (o.isKeyForward(f) || o.isKeyBackward(f)) && V(f, o.isKeyBackward(f));
1674
- }, _ = function(f) {
1675
- Rn(f) && we(o.escapeDeactivates, f) !== !1 && (f.preventDefault(), l.deactivate());
1676
- }, $ = function(f) {
1677
- var u = Ie(f);
1678
- i(u, f) >= 0 || we(o.clickOutsideDeactivates, f) || we(o.allowOutsideClick, f) || (f.preventDefault(), f.stopImmediatePropagation());
1679
- }, H = function() {
1680
- if (s.active)
1681
- return ut.activateTrap(r, l), s.delayInitialFocusTimer = o.delayInitialFocus ? ct(function() {
1682
- p(g());
1683
- }) : p(g()), a.addEventListener("focusin", E, !0), a.addEventListener("mousedown", k, {
1684
- capture: !0,
1685
- passive: !1
1686
- }), a.addEventListener("touchstart", k, {
1687
- capture: !0,
1688
- passive: !1
1689
- }), a.addEventListener("click", $, {
1690
- capture: !0,
1691
- passive: !1
1692
- }), a.addEventListener("keydown", U, {
1693
- capture: !0,
1694
- passive: !1
1695
- }), a.addEventListener("keydown", _), l;
1696
- }, Te = function() {
1697
- if (s.active)
1698
- return a.removeEventListener("focusin", E, !0), a.removeEventListener("mousedown", k, !0), a.removeEventListener("touchstart", k, !0), a.removeEventListener("click", $, !0), a.removeEventListener("keydown", U, !0), a.removeEventListener("keydown", _), l;
1699
- }, fe = function(f) {
1700
- var u = f.some(function(y) {
1701
- var I = Array.from(y.removedNodes);
1702
- return I.some(function(S) {
1703
- return S === s.mostRecentlyFocusedNode;
1704
- });
1705
- });
1706
- u && p(g());
1707
- }, se = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(fe) : void 0, ae = function() {
1708
- se && (se.disconnect(), s.active && !s.paused && s.containers.map(function(f) {
1709
- se.observe(f, {
1710
- subtree: !0,
1711
- childList: !0
1712
- });
1713
- }));
1714
- };
1715
- return l = {
1716
- get active() {
1717
- return s.active;
1718
- },
1719
- get paused() {
1720
- return s.paused;
1721
- },
1722
- activate: function(f) {
1723
- if (s.active)
1724
- return this;
1725
- var u = c(f, "onActivate"), y = c(f, "onPostActivate"), I = c(f, "checkCanFocusTrap");
1726
- I || h(), s.active = !0, s.paused = !1, s.nodeFocusedBeforeActivation = v(a), u == null || u();
1727
- var S = function() {
1728
- I && h(), H(), ae(), y == null || y();
1729
- };
1730
- return I ? (I(s.containers.concat()).then(S, S), this) : (S(), this);
1731
- },
1732
- deactivate: function(f) {
1733
- if (!s.active)
1734
- return this;
1735
- var u = it({
1736
- onDeactivate: o.onDeactivate,
1737
- onPostDeactivate: o.onPostDeactivate,
1738
- checkCanReturnFocus: o.checkCanReturnFocus
1739
- }, f);
1740
- clearTimeout(s.delayInitialFocusTimer), s.delayInitialFocusTimer = void 0, Te(), s.active = !1, s.paused = !1, ae(), ut.deactivateTrap(r, l);
1741
- var y = c(u, "onDeactivate"), I = c(u, "onPostDeactivate"), S = c(u, "checkCanReturnFocus"), O = c(u, "returnFocus", "returnFocusOnDeactivate");
1742
- y == null || y();
1743
- var A = function() {
1744
- ct(function() {
1745
- O && p(T(s.nodeFocusedBeforeActivation)), I == null || I();
1746
- });
1747
- };
1748
- return O && S ? (S(T(s.nodeFocusedBeforeActivation)).then(A, A), this) : (A(), this);
1749
- },
1750
- pause: function(f) {
1751
- return s.active ? (s.manuallyPaused = !0, this._setPausedState(!0, f)) : this;
1752
- },
1753
- unpause: function(f) {
1754
- return s.active ? (s.manuallyPaused = !1, r[r.length - 1] !== this ? this : this._setPausedState(!1, f)) : this;
1755
- },
1756
- updateContainerElements: function(f) {
1757
- var u = [].concat(f).filter(Boolean);
1758
- return s.containers = u.map(function(y) {
1759
- return typeof y == "string" ? a.querySelector(y) : y;
1760
- }), s.active && h(), ae(), this;
1761
- }
1762
- }, Object.defineProperties(l, {
1763
- _isManuallyPaused: {
1764
- value: function() {
1765
- return s.manuallyPaused;
1766
- }
1767
- },
1768
- _setPausedState: {
1769
- value: function(f, u) {
1770
- if (s.paused === f)
1771
- return this;
1772
- if (s.paused = f, f) {
1773
- var y = c(u, "onPause"), I = c(u, "onPostPause");
1774
- y == null || y(), Te(), ae(), I == null || I();
1775
- } else {
1776
- var S = c(u, "onUnpause"), O = c(u, "onPostUnpause");
1777
- S == null || S(), h(), H(), ae(), O == null || O();
1778
- }
1779
- return this;
1780
- }
1781
- }
1782
- }), l.updateContainerElements(e), l;
1783
- };
1784
- const Hn = /* @__PURE__ */ K({
1785
- name: "UseFocusTrap",
1786
- props: ["as", "options"],
1787
- setup(n, { slots: e }) {
1788
- let t;
1789
- const a = w(), r = () => t && t.activate(), o = () => t && t.deactivate();
1790
- return W(
1791
- () => fn(a),
1792
- (s) => {
1793
- s && (t = Kn(s, n.options || {}), r());
1794
- },
1795
- { flush: "post" }
1796
- ), bt(() => o()), () => {
1797
- if (e.default)
1798
- return ht(n.as || "div", { ref: a }, e.default());
1799
- };
1800
- }
1801
- }), zn = {
1802
- class: "modal fixed top-0 left-0 z-[300] flex items-center justify-center w-screen h-screen text-gray-900 dark:text-neutral-200 bg-transparent",
1803
- "aria-modal": "true",
1804
- "aria-labelledby": "modalTitle",
1805
- "aria-describedby": "modalDescription"
1806
- }, Un = {
1807
- key: 0,
1808
- class: "absolute inset-0 w-full h-full backdrop-blur-sm bg-opacity-70"
1809
- }, Ur = /* @__PURE__ */ K({
1810
- __name: "GlobalModal",
1811
- setup(n) {
1812
- const e = Ge();
1813
- return (t, a) => (m(), Y(Ue, { to: "body" }, [
1814
- G(x("dialog", zn, [
1815
- M(pe, {
1816
- "enter-active-class": "ease-out duration-300",
1817
- "enter-from-class": "opacity-0",
1818
- "enter-to-class": "opacity-100",
1819
- "leave-active-class": "ease-in duration-300",
1820
- "leave-from-class": "opacity-100",
1821
- "leave-to-class": "opacity-0"
1822
- }, {
1823
- default: B(() => [
1824
- b(e).isOpen ? (m(), C("div", Un)) : R("", !0)
1825
- ]),
1826
- _: 1
1827
- }),
1828
- M(pe, {
1829
- "enter-active-class": "ease-out duration-300",
1830
- "enter-from-class": "opacity-0 sm:scale-95",
1831
- "enter-to-class": "opacity-100 sm:scale-100",
1832
- "leave-active-class": "ease-in duration-200",
1833
- "leave-from-class": "opacity-100 sm:scale-100",
1834
- "leave-to-class": "opacity-0 sm:scale-95"
1835
- }, {
1836
- default: B(() => [
1837
- b(e).isOpen ? (m(), Y(b(Hn), {
1838
- key: 0,
1839
- class: "relative w-full px-6 py-10 sm:py-6 max-h-screen h-full overflow-y-scroll scrollbar-hide flex items-center"
1840
- }, {
1841
- default: B(() => [
1842
- M(b(At), {
1843
- onTrigger: b(e).close,
1844
- onKeydown: ie(b(e).close, ["esc"]),
1845
- class: "gap-4 flex flex-col drop-shadow-md m-auto w-full p-6 bg-white dark:bg-neutral-800/90 backdrop-blur-lg border shadow-lg border-neutral-200 dark:border-neutral-700 sm:max-w-lg xl:max-w-xl 3xl:max-w-2xl rounded-md sm:rounded-lg",
1846
- tabindex: "-1"
1847
- }, {
1848
- default: B(() => [
1849
- (m(), Y(De(b(e).component), Ut(Wt(b(e).props)), null, 16))
1850
- ]),
1851
- _: 1
1852
- }, 8, ["onTrigger", "onKeydown"])
1853
- ]),
1854
- _: 1
1855
- })) : R("", !0)
1856
- ]),
1857
- _: 1
1858
- })
1859
- ], 512), [
1860
- [Q, b(e).isOpen || b(e).isAnimating]
1861
- ])
1862
- ]));
1863
- }
1864
- }), Wn = ["disabled"], le = /* @__PURE__ */ K({
1865
- __name: "TablePaginationButton",
1866
- props: {
1867
- currentPage: {},
1868
- pageNumber: {},
1869
- text: {},
1870
- underline: { type: Boolean, default: !1 },
1871
- sticky: { type: Boolean, default: !1 },
1872
- disabled: { type: Boolean, default: !1 }
1873
- },
1874
- setup(n) {
1875
- const e = n;
1876
- return (t, a) => (m(), C("li", {
1877
- class: D([{ hidden: e.currentPage !== e.pageNumber && !e.text && !e.sticky }, "h-full md:block z-0"])
1878
- }, [
1879
- x("button", {
1880
- class: D(["relative inline-flex items-center h-full px-3 group hover:text-gray-900 hover:dark:text-white disabled:dark:text-neutral-500 disabled:text-neutral-400 disabled:cursor-not-allowed", { "text-gray-900 dark:text-white bg-gray-50 dark:bg-neutral-900": e.currentPage === e.pageNumber }]),
1881
- disabled: e.disabled ?? !1
1882
- }, [
1883
- F(t.$slots, "content", {}, () => [
1884
- x("span", null, j((e == null ? void 0 : e.text) ?? e.pageNumber), 1)
1885
- ]),
1886
- !e.text || e.underline ? (m(), C("span", {
1887
- key: 0,
1888
- class: D(["box-content absolute bottom-0 w-0 h-px -mx-px duration-200 ease-out translate-y-px border-transparent group-hover:left-0 group-hover:w-full group-hover:border-l group-hover:border-r bg-violet-600 group-hover:border-violet-600", {
1889
- "left-0 w-full border-l border-r": e.currentPage === e.pageNumber,
1890
- "left-1/2": e.currentPage !== e.pageNumber
1891
- }]),
1892
- "bg-neutral-900": "",
1893
- "dark:bg-violet-600": "",
1894
- "group-hover:border-neutral-900": "",
1895
- "group-hover:dark:border-violet-600": ""
1896
- }, null, 2)) : R("", !0)
1897
- ], 10, Wn)
1898
- ], 2));
1899
- }
1900
- }), qn = { class: "dark:text-neutral-300 line-clamp-1 text-sm" }, Gn = { class: "font-medium dark:text-white" }, Zn = { class: "font-medium dark:text-white" }, Xn = { class: "font-medium dark:text-white" }, Qn = { class: "flex items-center text-sm leading-tight bg-white dark:bg-primary-dark-800/70 border divide-x rounded h-9 text-neutral-500 dark:text-neutral-300 divide-neutral-200 dark:divide-neutral-700 border-neutral-200 dark:border-neutral-700" }, Jn = /* @__PURE__ */ K({
1901
- __name: "TablePagination",
1902
- props: {
1903
- listLength: {},
1904
- currentPage: {},
1905
- itemsPerPage: {},
1906
- useIcons: { type: Boolean },
1907
- maxVisiblePages: { default: 5 }
1908
- },
1909
- emits: ["setPage"],
1910
- setup(n, { emit: e }) {
1911
- const t = n, a = w(null), r = e, o = J(() => Math.ceil(t.listLength / t.itemsPerPage)), s = J(() => {
1912
- const c = o.value, i = t.currentPage, d = t.maxVisiblePages, g = Math.max(d - 1, 3), h = Math.max(d - 1, 2);
1913
- if (c <= d) return Array.from({ length: c }, (v, p) => p + 1);
1914
- if (i < g) return Array.from({ length: h }, (v, p) => p + 1);
1915
- if (o.value - i < g - 1) {
1916
- let v = [];
1917
- for (let p = o.value - h + 1; p <= o.value; p++)
1918
- v = [...v, p];
1919
- return v;
1920
- }
1921
- return d >= 5 ? [i - 1, i, i + 1] : [i];
1922
- }), l = async (c) => {
1923
- var i;
1924
- r("setPage", c), await qe(), (i = a.value) == null || i.scrollIntoView({ behavior: "instant", block: "end" });
1925
- };
1926
- return (c, i) => (m(), C("div", {
1927
- class: D("flex items-center flex-col sm:flex-row sm:justify-between flex-wrap gap-2 scroll-mb-12"),
1928
- ref_key: "$element",
1929
- ref: a
1930
- }, [
1931
- x("p", qn, [
1932
- i[6] || (i[6] = Z(" Showing ", -1)),
1933
- x("span", Gn, j(t.listLength ? t.itemsPerPage * (c.currentPage - 1) + 1 : 0), 1),
1934
- i[7] || (i[7] = Z(" to ", -1)),
1935
- x("span", Zn, j(Math.min(t.itemsPerPage * c.currentPage, t.listLength)), 1),
1936
- i[8] || (i[8] = Z(" of ", -1)),
1937
- x("span", Xn, j(c.listLength), 1)
1938
- ]),
1939
- x("ul", Qn, [
1940
- M(le, {
1941
- pageNumber: -1,
1942
- text: "Previous",
1943
- disabled: t.currentPage === 1,
1944
- onClick: i[0] || (i[0] = (d) => l(Math.max(1, t.currentPage - 1))),
1945
- title: "Previous Page"
1946
- }, Je({ _: 2 }, [
1947
- c.useIcons ? {
1948
- name: "content",
1949
- fn: B(() => [
1950
- M(b(at), {
1951
- class: "w-4 h-4",
1952
- title: "Previous"
1953
- })
1954
- ]),
1955
- key: "0"
1956
- } : {
1957
- name: "content",
1958
- fn: B(() => [
1959
- i[9] || (i[9] = x("span", { class: "hidden sm:block" }, j("Previous"), -1)),
1960
- M(b(at), {
1961
- class: "w-4 h-4 sm:hidden",
1962
- title: "Previous"
1963
- })
1964
- ]),
1965
- key: "1"
1966
- }
1967
- ]), 1032, ["disabled"]),
1968
- o.value > t.maxVisiblePages && t.currentPage > Math.max(t.maxVisiblePages - 2, 2) ? (m(), C(X, { key: 0 }, [
1969
- c.maxVisiblePages > 3 ? (m(), Y(le, {
1970
- key: 0,
1971
- pageNumber: 1,
1972
- currentPage: t.currentPage,
1973
- onClick: i[1] || (i[1] = (d) => l(1)),
1974
- sticky: !0
1975
- }, null, 8, ["currentPage"])) : R("", !0),
1976
- M(le, {
1977
- pageNumber: -1,
1978
- text: "...",
1979
- onClick: i[2] || (i[2] = (d) => l(Math.floor(c.currentPage / 2))),
1980
- underline: !0,
1981
- title: `Page ${Math.floor(c.currentPage / 2)}`
1982
- }, null, 8, ["title"])
1983
- ], 64)) : R("", !0),
1984
- (m(!0), C(X, null, ge(s.value, (d) => (m(), Y(le, {
1985
- key: d,
1986
- pageNumber: d,
1987
- currentPage: t.currentPage,
1988
- onClick: (g) => l(d),
1989
- title: `Page ${d}`
1990
- }, null, 8, ["pageNumber", "currentPage", "onClick", "title"]))), 128)),
1991
- o.value > t.maxVisiblePages && o.value - t.currentPage > Math.max(t.maxVisiblePages - 3, 1) ? (m(), C(X, { key: 1 }, [
1992
- M(le, {
1993
- pageNumber: -1,
1994
- text: "...",
1995
- title: `Page ${Math.floor((o.value - c.currentPage) / 2 + c.currentPage)}`,
1996
- onClick: i[3] || (i[3] = (d) => l(Math.floor((o.value - c.currentPage) / 2 + c.currentPage))),
1997
- underline: !0
1998
- }, null, 8, ["title"]),
1999
- c.maxVisiblePages > 3 ? (m(), Y(le, {
2000
- key: 0,
2001
- pageNumber: o.value,
2002
- currentPage: t.currentPage,
2003
- onClick: i[4] || (i[4] = (d) => l(o.value)),
2004
- sticky: !0
2005
- }, null, 8, ["pageNumber", "currentPage"])) : R("", !0)
2006
- ], 64)) : R("", !0),
2007
- M(le, {
2008
- pageNumber: -1,
2009
- text: "Next",
2010
- disabled: t.currentPage === o.value,
2011
- onClick: i[5] || (i[5] = (d) => l(Math.min(o.value, t.currentPage + 1))),
2012
- title: "Next Page"
2013
- }, Je({ _: 2 }, [
2014
- c.useIcons ? {
2015
- name: "content",
2016
- fn: B(() => [
2017
- M(b(tt), {
2018
- class: "w-4 h-4",
2019
- title: "Next"
2020
- })
2021
- ]),
2022
- key: "0"
2023
- } : {
2024
- name: "content",
2025
- fn: B(() => [
2026
- i[10] || (i[10] = x("span", { class: "hidden sm:block" }, j("Next"), -1)),
2027
- M(b(tt), {
2028
- class: "w-4 h-4 sm:hidden",
2029
- title: "Next"
2030
- })
2031
- ]),
2032
- key: "1"
2033
- }
2034
- ]), 1032, ["disabled"])
2035
- ])
2036
- ], 512));
2037
- }
2038
- }), er = { class: "flex flex-col justify-center gap-2 text-sm" }, tr = ["name", "id", "placeholder"], ar = /* @__PURE__ */ K({
2039
- __name: "TextInputLabelled",
2040
- props: /* @__PURE__ */ $e(["text", "placeholder", "id"], {
2041
- modelValue: {},
2042
- modelModifiers: {}
2043
- }),
2044
- emits: ["update:modelValue"],
2045
- setup(n) {
2046
- const e = We(n, "modelValue");
2047
- return (t, a) => (m(), C("div", er, [
2048
- M(kt, {
2049
- field: { name: n.id, text: n.text, type: "text" }
2050
- }, null, 8, ["field"]),
2051
- G(x("input", {
2052
- type: "text",
2053
- "onUpdate:modelValue": a[0] || (a[0] = (r) => e.value = r),
2054
- name: n.id,
2055
- id: n.id,
2056
- placeholder: n.placeholder,
2057
- class: D(`h-10 p-2 px-3 shadow-sm rounded-md w-full text-sm
2058
- border-none outline-none
2059
- disabled:cursor-not-allowed disabled:opacity-50
2060
- text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800 placeholder:text-neutral-400
2061
- ring-inset focus:ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700
2062
- hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700`)
2063
- }, null, 8, tr), [
2064
- [qt, e.value]
2065
- ])
2066
- ]));
2067
- }
2068
- });
2069
- function nr(n, e) {
2070
- const t = be({
2071
- selectOpen: !1,
2072
- selectedItem: "",
2073
- selectableItems: n,
2074
- selectableItemActive: null,
2075
- selectId: "select-12",
2076
- selectKeydownValue: "",
2077
- selectKeydownTimeout: 1e3,
2078
- selectKeydownClearTimeout: null,
2079
- selectDropdownPosition: "bottom",
2080
- selectableItemsList: e.selectableItemsList,
2081
- selectButton: e.selectButton,
2082
- toggleSelect(r) {
2083
- r !== void 0 ? this.selectOpen = r === !0 : this.selectOpen = !this.selectOpen;
2084
- },
2085
- updateRefs(r) {
2086
- this.selectButton = r.selectButton, this.selectableItemsList = r.selectableItemsList;
2087
- },
2088
- selectableItemIsActive(r) {
2089
- return this.selectableItemActive && this.selectableItemActive.value == r.value;
2090
- },
2091
- selectableItemActiveNext() {
2092
- let r = this.selectableItems.indexOf(this.selectableItemActive);
2093
- r < this.selectableItems.length - 1 && (this.selectableItemActive = this.selectableItems[r + 1], this.selectScrollToActiveItem());
2094
- },
2095
- selectableItemActivePrevious() {
2096
- let r = this.selectableItems.indexOf(this.selectableItemActive);
2097
- r > 0 && (this.selectableItemActive = this.selectableItems[r - 1], this.selectScrollToActiveItem());
2098
- },
2099
- selectScrollToActiveItem() {
2100
- if (!this.selectableItemActive) return;
2101
- let r = document.getElementById(this.selectableItemActive.value + "-" + this.selectId);
2102
- r && r.focus();
2103
- },
2104
- selectKeydown(r) {
2105
- if (r.keyCode >= 65 && r.keyCode <= 90) {
2106
- this.selectKeydownValue += r.key;
2107
- let o = this.selectItemsFindBestMatch();
2108
- o && (this.selectOpen ? (this.selectableItemActive = o, this.selectScrollToActiveItem()) : this.selectedItem = this.selectableItemActive === o), this.selectKeydownValue != "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
2109
- this.selectKeydownValue = "";
2110
- }, this.selectKeydownTimeout));
2111
- }
2112
- },
2113
- selectItemsFindBestMatch() {
2114
- let r = this.selectKeydownValue.toLowerCase(), o = null, s = -1;
2115
- for (const l of this.selectableItems) {
2116
- let i = l.title.toLowerCase().indexOf(r);
2117
- i > -1 && (s == -1 || i < s) && !l.disabled && (o = l, s = i);
2118
- }
2119
- return o;
2120
- },
2121
- selectPositionUpdate() {
2122
- var o;
2123
- if (!this.selectableItemsList || !this.selectButton) return;
2124
- let r = ((o = this.selectButton) == null ? void 0 : o.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
2125
- window.innerHeight < r ? this.selectDropdownPosition = "top" : this.selectDropdownPosition = "bottom";
2126
- }
2127
- }), a = () => {
2128
- t.selectOpen && t.selectPositionUpdate();
2129
- };
2130
- return W(
2131
- () => t.selectOpen,
2132
- function(r) {
2133
- if (t.selectedItem ? t.selectableItemActive = t.selectedItem : t.selectableItemActive = t.selectableItems[0], !r) {
2134
- window.removeEventListener("resize", a);
2135
- return;
2136
- }
2137
- window.setTimeout(function() {
2138
- t.selectScrollToActiveItem();
2139
- }, 10), a(), window.addEventListener("resize", a);
2140
- },
2141
- { immediate: !1 }
2142
- ), t;
2143
- }
2144
- const rr = ["id", "disabled", "title"], sr = { class: "truncate" }, or = { class: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none" }, lr = ["onClick", "onKeydown", "onFocus", "onMousemove", "id", "title", "data-disabled", "tabindex", "aria-selected"], ir = {
2145
- key: 0,
2146
- class: "absolute left-0 w-4 h-4 ml-2 stroke-current text-neutral-400",
2147
- xmlns: "http://www.w3.org/2000/svg",
2148
- viewBox: "0 0 24 24",
2149
- fill: "none",
2150
- stroke: "currentColor",
2151
- "stroke-width": "2",
2152
- "stroke-linecap": "round",
2153
- "stroke-linejoin": "round"
2154
- }, ur = { class: "block font-medium truncate" }, cr = /* @__PURE__ */ K({
2155
- __name: "InputSelect",
2156
- props: {
2157
- name: {},
2158
- class: { default: "" },
2159
- rootClass: { default: "" },
2160
- placeholder: {},
2161
- defaultItem: { default: null },
2162
- options: { default: () => [
2163
- {
2164
- title: "Title",
2165
- value: "title",
2166
- disabled: !1
2167
- },
2168
- {
2169
- title: "Date Uploaded",
2170
- value: "date",
2171
- disabled: !1
2172
- },
2173
- {
2174
- title: "Date released",
2175
- value: "date_released",
2176
- disabled: !1
2177
- },
2178
- {
2179
- title: "Episode",
2180
- value: "episode",
2181
- disabled: !0
2182
- },
2183
- {
2184
- title: "Season",
2185
- value: "season",
2186
- disabled: !0
2187
- }
2188
- ] },
2189
- disabled: { type: Boolean },
2190
- title: {},
2191
- prefix: { default: "" },
2192
- menuMargin: {}
2193
- },
2194
- emits: ["selectItem"],
2195
- setup(n, { emit: e }) {
2196
- const t = n, a = e, r = Oe("selectButton"), o = Oe("selectableItemsList"), s = Oe("selectableItemsRoot"), l = nr(t.options, { selectableItemsList: o, selectButton: r }), c = w(null), i = (v, p = !0) => {
2197
- var T;
2198
- l.selectedItem = v, l.toggleSelect(!1), p && ((T = r.value) == null || T.focus()), a("selectItem", l.selectedItem);
2199
- }, d = (v) => {
2200
- l.selectableItemActive = v, l.selectScrollToActiveItem();
2201
- }, g = (v) => {
2202
- l.selectableItemActive = v;
2203
- }, h = () => {
2204
- c.value && clearTimeout(c.value), c.value = window.setTimeout(() => {
2205
- if (!s.value) return;
2206
- const v = document.activeElement;
2207
- s.value.contains(v) || l.toggleSelect(!1);
2208
- }, 0);
2209
- };
2210
- return Ce(() => {
2211
- t.disabled || t.defaultItem != null && t.defaultItem < t.options.length && t.defaultItem >= 0 && i(t.options[t.defaultItem], !1);
2212
- }), W(
2213
- () => t.options,
2214
- () => {
2215
- l.selectableItems = t.options;
2216
- }
2217
- ), W(
2218
- r,
2219
- () => {
2220
- r.value && (l.selectButton = r);
2221
- },
2222
- { immediate: !0 }
2223
- ), W(
2224
- () => o.value,
2225
- () => {
2226
- o.value && (l.selectableItemsList = o);
2227
- },
2228
- { immediate: !0 }
2229
- ), (v, p) => (m(), C("section", {
2230
- class: D(["relative", v.rootClass]),
2231
- onFocusout: h,
2232
- ref_key: "selectableItemsRoot",
2233
- ref: s
2234
- }, [
2235
- x("button", {
2236
- id: v.name ?? "Select",
2237
- ref_key: "selectButton",
2238
- ref: r,
2239
- onClick: p[0] || (p[0] = (T) => b(l).toggleSelect()),
2240
- class: D([
2241
- { "hocus:ring-0": b(l).selectOpen },
2242
- { "!text-neutral-400": v.placeholder && !b(l).selectedItem },
2243
- "relative h-10 flex items-center justify-between w-full py-2 pl-3 pr-10",
2244
- "text-left rounded-md shadow-sm cursor-pointer text-sm border-none focus:outline-none",
2245
- "ring-inset ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-purple-400 dark:focus:ring-purple-500",
2246
- "text-gray-900 dark:text-neutral-100 bg-white dark:bg-primary-dark-800",
2247
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:opacity-60",
2248
- t.class
2249
- ]),
2250
- disabled: v.disabled,
2251
- type: "button",
2252
- title: v.title ?? "Make Selection"
2253
- }, [
2254
- x("span", sr, j(
2255
- //@ts-ignore
2256
- b(l).selectedItem ? `${v.prefix}${b(l).selectedItem.title}` : v.placeholder
2257
- ), 1),
2258
- x("span", or, [
2259
- F(v.$slots, "selectButtonIcon", {}, () => [
2260
- p[7] || (p[7] = x("svg", {
2261
- xmlns: "http://www.w3.org/2000/svg",
2262
- viewBox: "0 0 20 20",
2263
- fill: "currentColor",
2264
- "aria-hidden": "true",
2265
- class: "w-5 h-5 text-gray-400"
2266
- }, [
2267
- x("path", {
2268
- "fill-rule": "evenodd",
2269
- d: "M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z",
2270
- "clip-rule": "evenodd"
2271
- })
2272
- ], -1))
2273
- ])
2274
- ])
2275
- ], 10, rr),
2276
- M(pe, {
2277
- "enter-active-class": "transition ease-out duration-50",
2278
- "enter-from-class": "opacity-0 -translate-y-1",
2279
- "enter-to-class": "opacity-100"
2280
- }, {
2281
- default: B(() => {
2282
- var T, P;
2283
- return [
2284
- b(l).selectOpen ? (m(), Y(b(At), {
2285
- key: 0,
2286
- class: D([[
2287
- b(l).selectDropdownPosition == "top" ? `bottom-0 ${((T = v.menuMargin) == null ? void 0 : T.bottom) ?? "mb-11"}` : `top-0 ${((P = v.menuMargin) == null ? void 0 : P.top) ?? "mt-11"}`
2288
- ], "z-30 absolute w-full mt-1 overflow-clip text-sm rounded-md shadow-md max-h-56 ring-1 ring-opacity-5 ring-black dark:ring-neutral-700 bg-white dark:bg-neutral-800/70 backdrop-blur-lg"]),
2289
- onTrigger: p[1] || (p[1] = (k) => b(l).toggleSelect(!1)),
2290
- onKeydown: [
2291
- p[2] || (p[2] = ie(re(
2292
- (k) => {
2293
- b(l).selectOpen && (b(l).toggleSelect(!1), k.stopPropagation());
2294
- },
2295
- ["stop"]
2296
- ), ["esc"])),
2297
- p[3] || (p[3] = ie(re(
2298
- (k) => {
2299
- b(l).selectOpen ? b(l).selectableItemActiveNext() : b(l).toggleSelect(!0), k.preventDefault();
2300
- },
2301
- ["stop", "prevent"]
2302
- ), ["down"])),
2303
- p[4] || (p[4] = ie(re(
2304
- (k) => {
2305
- b(l).selectOpen ? b(l).selectableItemActivePrevious() : b(l).toggleSelect(!0), k.preventDefault();
2306
- },
2307
- ["stop", "prevent"]
2308
- ), ["up"])),
2309
- p[5] || (p[5] = ie(re((k) => {
2310
- b(l).selectedItem = b(l).selectableItemActive, b(l).toggleSelect(!1);
2311
- }, ["stop"]), ["enter"])),
2312
- p[6] || (p[6] = re((k) => b(l).selectKeydown(k), ["stop"]))
2313
- ]
2314
- }, {
2315
- default: B(() => [
2316
- x("ul", {
2317
- ref_key: "selectableItemsList",
2318
- ref: o,
2319
- class: "w-full overflow-auto max-h-56 scrollbar-thin focus:outline-none",
2320
- tabindex: "-1",
2321
- role: "listbox"
2322
- }, [
2323
- (m(!0), C(X, null, ge(b(l).selectableItems, (k) => (m(), C("li", {
2324
- key: k.value,
2325
- onClick: (E) => i(k),
2326
- onKeydown: [
2327
- ie((E) => i(k), ["enter"]),
2328
- ie((E) => i(k), ["space"])
2329
- ],
2330
- onFocus: (E) => g(k),
2331
- onMousemove: (E) => d(k),
2332
- id: k.value + "-" + b(l).selectId,
2333
- title: k.title,
2334
- "data-disabled": k.disabled ? k.disabled : "",
2335
- tabindex: b(l).selectableItemIsActive(k) ? 0 : -1,
2336
- class: D([{
2337
- "bg-neutral-100 dark:bg-neutral-900/70 text-gray-900 dark:text-neutral-100": b(l).selectableItemIsActive(k),
2338
- "text-gray-700 dark:text-neutral-300": !b(l).selectableItemIsActive(k)
2339
- }, "focus:rounded-md relative flex items-center h-full py-2 pl-8 cursor-pointer data-[disabled=true]:opacity-50 data-[disabled=true]:pointer-events-none"]),
2340
- role: "option",
2341
- "aria-selected": b(l).selectableItemIsActive(k) ? "true" : "false"
2342
- }, [
2343
- //@ts-ignore
2344
- b(l).selectedItem.value == k.value ? (m(), C("svg", ir, p[8] || (p[8] = [
2345
- x("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2346
- ]))) : R("", !0),
2347
- x("span", ur, j(k.title), 1)
2348
- ], 42, lr))), 128))
2349
- ], 512)
2350
- ]),
2351
- _: 1
2352
- }, 8, ["class"])) : R("", !0)
2353
- ];
2354
- }),
2355
- _: 1
2356
- })
2357
- ], 34));
2358
- }
2359
- }), dr = ["type", "disabled", "title"], fr = /* @__PURE__ */ K({
2360
- __name: "ButtonIcon",
2361
- props: {
2362
- type: { default: "button" },
2363
- disabled: { type: Boolean },
2364
- title: {},
2365
- variant: { default: "default" },
2366
- to: {},
2367
- target: { default: "_self" }
2368
- },
2369
- setup(n) {
2370
- const e = n, t = J(() => {
2371
- switch (e.variant) {
2372
- case "ghost":
2373
- return "";
2374
- case "transparent":
2375
- return [
2376
- "transition",
2377
- "hover:bg-white hover:dark:bg-primary-dark-800",
2378
- "focus:outline-none hover:text-gray-900 dark:text-neutral-100",
2379
- "hocus:ring-[0.125rem] hover:ring-violet-400 hover:dark:ring-violet-700 focus:ring-white",
2380
- "aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60",
2381
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:hover:ring-1 disabled:opacity-60"
2382
- ].join(" ");
2383
- default:
2384
- return [
2385
- "h-10 max-h-full aspect-square rounded-md ",
2386
- "p-2 shadow-sm",
2387
- "focus:outline-none text-gray-900 dark:text-neutral-100",
2388
- "ring-1 ring-neutral-200 dark:ring-neutral-700 hocus:ring-[0.125rem] focus:ring-purple-400 dark:focus:ring-purple-500 hover:ring-violet-400 hover:dark:ring-violet-700",
2389
- "bg-white dark:bg-primary-dark-800",
2390
- "aria-disabled:cursor-not-allowed aria-disabled:hover:ring-neutral-200 aria-disabled:hover:dark:ring-neutral-700 aria-disabled:ring-1 aria-disabled:opacity-60",
2391
- "disabled:cursor-not-allowed disabled:hover:ring-neutral-200 disabled:hover:dark:ring-neutral-700 disabled:ring-1 disabled:opacity-60"
2392
- ].join(" ");
2393
- }
2394
- });
2395
- return (a, r) => {
2396
- const o = gt("router-link");
2397
- return a.to ? (m(), Y(o, {
2398
- key: 0,
2399
- to: a.to,
2400
- class: D(["flex items-center justify-center cursor-pointer", t.value]),
2401
- type: e.type,
2402
- title: e.title ?? "Button",
2403
- "aria-disabled": a.disabled,
2404
- target: a.target
2405
- }, {
2406
- default: B(() => [
2407
- F(a.$slots, "text"),
2408
- F(a.$slots, "icon")
2409
- ]),
2410
- _: 3
2411
- }, 8, ["to", "class", "type", "title", "aria-disabled", "target"])) : (m(), C("button", {
2412
- key: 1,
2413
- class: D(["flex items-center justify-center cursor-pointer", t.value]),
2414
- type: e.type,
2415
- disabled: e.disabled,
2416
- title: e.title ?? "Icon"
2417
- }, [
2418
- F(a.$slots, "text"),
2419
- F(a.$slots, "icon")
2420
- ], 10, dr));
2421
- };
2422
- }
2423
- });
2424
- function vr(n) {
2425
- const e = w(1), t = w(n.itemsPerPage ?? 10), a = w(n.searchQuery ?? ""), r = be({
2426
- filteredPage: J(() => {
2427
- const o = t.value * (e.value - 1), s = Math.min(t.value * e.value, n.data.length);
2428
- return n.data.slice(o, s);
2429
- }),
2430
- props: n,
2431
- fields: { currentPage: e, itemsPerPage: t, searchQuery: a },
2432
- handlePageChange(o) {
2433
- e.value = o;
2434
- },
2435
- handlePageReset() {
2436
- e.value = 1;
2437
- }
2438
- });
2439
- return W(
2440
- () => n.data,
2441
- (o, s) => {
2442
- var l, c;
2443
- ((o == null ? void 0 : o.length) !== (s == null ? void 0 : s.length) || o[0] && s[0] && ((l = o[0]) == null ? void 0 : l.id) !== ((c = s[0]) == null ? void 0 : c.id)) && r.handlePageReset();
2444
- },
2445
- { immediate: !0 }
2446
- ), r;
2447
- }
2448
- const mr = { class: "flex flex-col gap-4 w-full" }, pr = {
2449
- key: 0,
2450
- class: "flex justify-center sm:justify-between flex-col sm:flex-row gap-2"
2451
- }, gr = { class: "flex items-end gap-2 flex-wrap" }, br = { class: "flex gap-2 flex-col w-full sm:w-40 flex-1" }, hr = {
2452
- key: 0,
2453
- class: "col-span-full flex items-center justify-center text-center text-lg text-gray-500 dark:text-gray-400 uppercase tracking-wider w-full gap-2"
2454
- }, Wr = /* @__PURE__ */ K({
2455
- __name: "TableBase",
2456
- props: /* @__PURE__ */ $e({
2457
- useToolbar: { type: Boolean, default: !0 },
2458
- usePagination: { type: Boolean, default: !0 },
2459
- usePaginationIcons: { type: Boolean, default: !1 },
2460
- useGrid: {},
2461
- data: {},
2462
- row: {},
2463
- rowAttributes: {},
2464
- loading: { type: Boolean },
2465
- clickAction: {},
2466
- otherAction: {},
2467
- sortAction: {},
2468
- sortingOptions: {},
2469
- itemsPerPage: { default: 12 },
2470
- itemName: {},
2471
- searchQuery: { default: "" },
2472
- selectedID: { default: null },
2473
- tableStyles: {},
2474
- startAscending: { type: Boolean, default: !0 },
2475
- paginationClass: {},
2476
- maxVisiblePages: { default: 5 },
2477
- noResultsMessage: { default: "No Results" }
2478
- }, {
2479
- modelValue: {
2480
- required: !1,
2481
- default: void 0
2482
- },
2483
- modelModifiers: {}
2484
- }),
2485
- emits: /* @__PURE__ */ $e(["search"], ["update:modelValue"]),
2486
- setup(n, { emit: e }) {
2487
- const t = n, a = e, r = vr(t), o = w(t.startAscending), s = w(""), l = We(n, "modelValue"), c = (d) => {
2488
- var g;
2489
- d != null && d.value && (s.value = d.value), s.value && ((g = t.sortAction) == null || g.call(t, s.value, o.value ? 1 : -1));
2490
- }, i = (d) => {
2491
- const h = d.target.value;
2492
- l.value !== void 0 ? l.value = h : r.fields.searchQuery = h, a("search", h);
2493
- };
2494
- return Ce(() => {
2495
- t.useToolbar && t.sortAction && t.sortAction(s.value, t.startAscending ? 1 : -1);
2496
- }), (d, g) => {
2497
- var h;
2498
- return m(), C("section", mr, [
2499
- t.useToolbar ? (m(), C("section", pr, [
2500
- M(ar, {
2501
- value: l.value ?? b(r).fields.searchQuery,
2502
- text: "",
2503
- placeholder: `Search ${t.itemName ? `${t.itemName}...` : ""}`,
2504
- id: "table-search",
2505
- class: "w-full sm:w-80",
2506
- title: "Search with...",
2507
- onInput: i
2508
- }, null, 8, ["value", "placeholder"]),
2509
- x("span", gr, [
2510
- x("div", br, [
2511
- M(cr, {
2512
- name: "sort",
2513
- placeholder: "Sort by...",
2514
- prefix: "By ",
2515
- options: d.sortingOptions,
2516
- defaultItem: 0,
2517
- class: "w-full",
2518
- title: "Sort by...",
2519
- onSelectItem: c
2520
- }, null, 8, ["options"])
2521
- ]),
2522
- M(fr, {
2523
- onClick: g[0] || (g[0] = (v) => {
2524
- o.value = !o.value, c();
2525
- }),
2526
- title: "Reorder Results...",
2527
- "aria-label": "Reorder Results",
2528
- class: "ring-inset"
2529
- }, {
2530
- icon: B(() => [
2531
- o.value ? (m(), Y(b(ha), {
2532
- key: 0,
2533
- width: "24",
2534
- height: "24"
2535
- })) : (m(), Y(b(xa), {
2536
- key: 1,
2537
- width: "24",
2538
- height: "24"
2539
- }))
2540
- ]),
2541
- _: 1
2542
- })
2543
- ])
2544
- ])) : R("", !0),
2545
- x("section", {
2546
- class: D([d.useGrid || `flex w-full flex-wrap gap-2 ${d.tableStyles ?? ""}`])
2547
- }, [
2548
- d.loading || b(r).filteredPage.length === 0 ? (m(), C("div", hr, [
2549
- x("p", null, j(d.loading ? "...Loading" : d.noResultsMessage), 1),
2550
- G(M(b($a), null, null, 512), [
2551
- [Q, d.loading]
2552
- ])
2553
- ])) : (m(!0), C(X, { key: 1 }, ge(b(r).filteredPage, (v, p) => F(d.$slots, "row", {
2554
- key: (v == null ? void 0 : v.id) ?? p,
2555
- row: v,
2556
- index: p,
2557
- selectedID: t.selectedID
2558
- }, () => [
2559
- (m(), Y(De(t.row), yt({
2560
- data: v,
2561
- index: p,
2562
- currentID: t.selectedID ?? null
2563
- }, { ref_for: !0 }, d.rowAttributes, {
2564
- onClickAction: (...T) => {
2565
- var P;
2566
- return (P = t.clickAction) == null ? void 0 : P.call(t, v == null ? void 0 : v.id, ...T);
2567
- },
2568
- onOtherAction: (...T) => {
2569
- var P;
2570
- return (P = t.otherAction) == null ? void 0 : P.call(t, v == null ? void 0 : v.id, ...T);
2571
- }
2572
- }), null, 16, ["data", "index", "currentID", "onClickAction", "onOtherAction"]))
2573
- ])), 128))
2574
- ], 2),
2575
- d.usePagination ? (m(), Y(Jn, {
2576
- key: 1,
2577
- class: D(d.paginationClass),
2578
- listLength: ((h = t.data) == null ? void 0 : h.length) ?? 0,
2579
- itemsPerPage: b(r).fields.itemsPerPage,
2580
- currentPage: b(r).fields.currentPage,
2581
- useIcons: t.usePaginationIcons,
2582
- "max-visible-pages": t.maxVisiblePages,
2583
- onSetPage: b(r).handlePageChange
2584
- }, null, 8, ["class", "listLength", "itemsPerPage", "currentPage", "useIcons", "max-visible-pages", "onSetPage"])) : R("", !0)
2585
- ]);
2586
- };
2587
- }
2588
- });
2589
- function qr({ options: n, defaultItems: e }, t) {
2590
- const a = be({
1
+ var me = Object.defineProperty;
2
+ var ve = (l, t, s) => t in l ? me(l, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : l[t] = s;
3
+ var O = (l, t, s) => ve(l, typeof t != "symbol" ? t + "" : t, s);
4
+ import { reactive as _, watch as $, ref as r, computed as K, onMounted as W, nextTick as ae, onBeforeUnmount as re, shallowRef as pe, defineComponent as ue, createElementBlock as L, openBlock as B, unref as S, normalizeStyle as he, normalizeClass as N, createVNode as ge, Transition as we, withCtx as ye, withDirectives as V, createElementVNode as P, createCommentVNode as G, vShow as F, toDisplayString as Z, watchEffect as be, createBlock as ee, Teleport as Te, Fragment as xe, renderList as Ie, mergeProps as Ce } from "vue";
5
+ function Qe({ options: l, defaultItems: t }, s) {
6
+ const e = _({
2591
7
  selectOpen: !1,
2592
- selectedItems: e,
2593
- selectableItems: n,
8
+ selectedItems: t,
9
+ selectableItems: l,
2594
10
  selectableItemActive: null,
2595
11
  selectId: "select-12",
2596
12
  selectKeydownValue: "",
2597
13
  selectKeydownTimeout: 1e3,
2598
14
  selectKeydownClearTimeout: null,
2599
15
  selectDropdownPosition: "bottom",
2600
- selectableItemsList: t.selectableItemsList,
2601
- selectButton: t.selectButton,
2602
- toggleSelect(o) {
2603
- o !== void 0 ? this.selectOpen = o === !0 : this.selectOpen = !this.selectOpen;
16
+ selectableItemsList: s.selectableItemsList,
17
+ selectButton: s.selectButton,
18
+ toggleSelect(i) {
19
+ i !== void 0 ? this.selectOpen = i === !0 : this.selectOpen = !this.selectOpen;
2604
20
  },
2605
- updateRefs(o) {
2606
- this.selectButton = o.selectButton, this.selectableItemsList = o.selectableItemsList, this.selectPositionUpdate();
21
+ updateRefs(i) {
22
+ this.selectButton = i.selectButton, this.selectableItemsList = i.selectableItemsList, this.selectPositionUpdate();
2607
23
  },
2608
24
  // In a multiselect (combobox) nothing is ever selected in the list. It appears elsewhere and is removed from the list
2609
25
  selectableItemIsActive() {
2610
26
  return !1;
2611
27
  },
2612
- async selectScrollToActiveItem(o, s = !0) {
2613
- let l = document.getElementById(o + "-" + this.selectId);
2614
- l && (l.scrollIntoView({ behavior: "smooth", block: "center" }), s && l.focus({ preventScroll: !1 }));
28
+ async selectScrollToActiveItem(i, o = !0) {
29
+ let a = document.getElementById(i + "-" + this.selectId);
30
+ a && (a.scrollIntoView({ behavior: "smooth", block: "center" }), o && a.focus({ preventScroll: !1 }));
2615
31
  },
2616
- selectKeydown(o) {
2617
- if (o.keyCode < 65 || o.keyCode > 90) return;
2618
- this.selectKeydownValue += o.key;
2619
- let s = this.selectItemsFindBestMatch();
2620
- s && this.selectOpen && (this.selectableItemActive = s), this.selectKeydownValue !== "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
32
+ selectKeydown(i) {
33
+ if (i.keyCode < 65 || i.keyCode > 90) return;
34
+ this.selectKeydownValue += i.key;
35
+ let o = this.selectItemsFindBestMatch();
36
+ o && this.selectOpen && (this.selectableItemActive = o), this.selectKeydownValue !== "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
2621
37
  this.selectKeydownValue = "";
2622
38
  }, this.selectKeydownTimeout));
2623
39
  },
2624
40
  selectItemsFindBestMatch() {
2625
- let o = this.selectKeydownValue.toLowerCase(), s = null, l = -1;
41
+ let i = this.selectKeydownValue.toLowerCase(), o = null, a = -1;
2626
42
  for (const c of this.selectableItems) {
2627
- let d = c.name.toLowerCase().indexOf(o);
2628
- d > -1 && (l == -1 || d < l) && !c.disabled && (s = c, l = d);
43
+ let b = c.name.toLowerCase().indexOf(i);
44
+ b > -1 && (a == -1 || b < a) && !c.disabled && (o = c, a = b);
2629
45
  }
2630
- return s;
46
+ return o;
2631
47
  },
2632
48
  selectPositionUpdate() {
2633
- var s;
49
+ var o;
2634
50
  if (!this.selectButton || !this.selectableItemsList) return;
2635
- let o = ((s = this.selectButton) == null ? void 0 : s.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
2636
- this.selectDropdownPosition = window.innerHeight < o ? "top" : "bottom";
51
+ let i = ((o = this.selectButton) == null ? void 0 : o.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
52
+ this.selectDropdownPosition = window.innerHeight < i ? "top" : "bottom";
2637
53
  },
2638
- setOptions(o) {
2639
- Array.isArray(o) && (this.selectableItems = o);
54
+ setOptions(i) {
55
+ Array.isArray(i) && (this.selectableItems = i);
2640
56
  }
2641
- }), r = () => {
2642
- a.selectOpen && a.selectPositionUpdate();
57
+ }), n = () => {
58
+ e.selectOpen && e.selectPositionUpdate();
2643
59
  };
2644
- return W(
2645
- () => a.selectOpen,
2646
- function(o) {
2647
- if (a.selectedItems ? a.selectableItemActive = a.selectedItem : a.selectableItemActive = a.selectableItems[0], !o) {
2648
- window.removeEventListener("resize", r);
60
+ return $(
61
+ () => e.selectOpen,
62
+ function(i) {
63
+ if (e.selectedItems ? e.selectableItemActive = e.selectedItem : e.selectableItemActive = e.selectableItems[0], !i) {
64
+ window.removeEventListener("resize", n);
2649
65
  return;
2650
66
  }
2651
- r(), window.addEventListener("resize", r);
67
+ n(), window.addEventListener("resize", n);
2652
68
  },
2653
69
  { immediate: !1 }
2654
- ), a;
2655
- }
2656
- function Gr(n, e, t) {
2657
- var f;
2658
- const a = w(!1), r = w(((f = n.model) == null ? void 0 : f.value) ?? n.defaultDate ?? ""), o = w("F d, Y"), s = w(0), l = w(0), c = w(0), i = w([]), d = w([]), g = w("bottom"), h = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], v = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], p = w("D"), T = J(() => {
2659
- let u = Math.max(s.value, 0);
2660
- return u >= h.length && (u = 0), h[u];
2661
- }), P = J(() => {
2662
- const u = Math.floor(l.value / 10) * 10;
2663
- return Array.from({ length: 10 }, (y, I) => u + I);
70
+ ), e;
71
+ }
72
+ function Ge(l, t, s) {
73
+ var Q;
74
+ const e = r(!1), n = r(((Q = l.model) == null ? void 0 : Q.value) ?? l.defaultDate ?? ""), i = r("F d, Y"), o = r(0), a = r(0), c = r(0), m = r([]), b = r([]), v = r("bottom"), T = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], C = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], x = r("D"), f = K(() => {
75
+ let d = Math.max(o.value, 0);
76
+ return d >= T.length && (d = 0), T[d];
77
+ }), h = K(() => {
78
+ const d = Math.floor(a.value / 10) * 10;
79
+ return Array.from({ length: 10 }, (E, D) => d + D);
2664
80
  });
2665
- function k(u) {
2666
- a.value = u ?? !a.value, p.value = "D";
81
+ function w(d) {
82
+ e.value = d ?? !e.value, x.value = "D";
2667
83
  }
2668
- function E(u = "D") {
2669
- p.value = u;
84
+ function p(d = "D") {
85
+ x.value = d;
2670
86
  }
2671
- function V(u) {
2672
- const y = v[u.getDay()], I = ("0" + u.getDate()).slice(-2), S = h[u.getMonth()], O = S.substring(0, 3), A = ("0" + (u.getMonth() + 1)).slice(-2), L = u.getFullYear();
2673
- switch (o.value) {
87
+ function y(d) {
88
+ const E = C[d.getDay()], D = ("0" + d.getDate()).slice(-2), Y = T[d.getMonth()], z = Y.substring(0, 3), j = ("0" + (d.getMonth() + 1)).slice(-2), A = d.getFullYear();
89
+ switch (i.value) {
2674
90
  case "F d, Y":
2675
- return `${S} ${I}, ${L}`;
91
+ return `${Y} ${D}, ${A}`;
2676
92
  case "d M, Y":
2677
- return `${I} ${O}, ${L}`;
93
+ return `${D} ${z}, ${A}`;
2678
94
  case "Y M d":
2679
- return `${L} ${O} ${I}`;
95
+ return `${A} ${z} ${D}`;
2680
96
  case "MM-DD-YYYY":
2681
- return `${A}-${I}-${L}`;
97
+ return `${j}-${D}-${A}`;
2682
98
  case "DD-MM-YYYY":
2683
- return `${I}-${A}-${L}`;
99
+ return `${D}-${j}-${A}`;
2684
100
  case "YYYY-MM-DD":
2685
- return `${L}-${A}-${I}`;
101
+ return `${A}-${j}-${D}`;
2686
102
  case "D d M, Y":
2687
- return `${y} ${I} ${O} ${L}`;
103
+ return `${E} ${D} ${z} ${A}`;
2688
104
  default:
2689
- return `${S} ${I}, ${L}`;
105
+ return `${Y} ${D}, ${A}`;
2690
106
  }
2691
107
  }
2692
- function U(u) {
2693
- switch (p.value) {
108
+ function M(d) {
109
+ switch (x.value) {
2694
110
  case "Y":
2695
- l.value = u, p.value = "M";
111
+ a.value = d, x.value = "M";
2696
112
  break;
2697
113
  case "M":
2698
- s.value = u, p.value = "D", fe();
114
+ o.value = d, x.value = "D", H();
2699
115
  break;
2700
116
  default:
2701
- c.value = u, r.value = V(new Date(l.value, s.value, u)), a.value = !1, n.model && (n.model.value = r.value);
117
+ c.value = d, n.value = y(new Date(a.value, o.value, d)), e.value = !1, l.model && (l.model.value = n.value);
2702
118
  break;
2703
119
  }
2704
120
  }
2705
- function _() {
2706
- switch (p.value) {
121
+ function g() {
122
+ switch (x.value) {
2707
123
  case "Y":
2708
- l.value -= 10;
124
+ a.value -= 10;
2709
125
  break;
2710
126
  case "M":
2711
- l.value -= 1;
127
+ a.value -= 1;
2712
128
  break;
2713
129
  default:
2714
- s.value === 0 ? (l.value--, s.value = 11) : s.value--, fe();
130
+ o.value === 0 ? (a.value--, o.value = 11) : o.value--, H();
2715
131
  break;
2716
132
  }
2717
133
  }
2718
- function $() {
2719
- switch (p.value) {
134
+ function u() {
135
+ switch (x.value) {
2720
136
  case "Y":
2721
- l.value += 10;
137
+ a.value += 10;
2722
138
  break;
2723
139
  case "M":
2724
- l.value += 1;
140
+ a.value += 1;
2725
141
  break;
2726
142
  default:
2727
- s.value === 11 ? (s.value = 0, l.value++) : s.value++, fe();
143
+ o.value === 11 ? (o.value = 0, a.value++) : o.value++, H();
2728
144
  break;
2729
145
  }
2730
146
  }
2731
- function H(u) {
2732
- const y = new Date(l.value, s.value, u);
2733
- return r.value === V(y);
147
+ function I(d) {
148
+ const E = new Date(a.value, o.value, d);
149
+ return n.value === y(E);
2734
150
  }
2735
- function Te(u) {
2736
- const y = /* @__PURE__ */ new Date(), I = new Date(l.value, s.value, u);
2737
- return y.toDateString() === I.toDateString();
151
+ function de(d) {
152
+ const E = /* @__PURE__ */ new Date(), D = new Date(a.value, o.value, d);
153
+ return E.toDateString() === D.toDateString();
2738
154
  }
2739
- function fe() {
2740
- const u = new Date(l.value, s.value + 1, 0).getDate(), y = new Date(l.value, s.value).getDay();
2741
- d.value = Array.from({ length: y }, (I, S) => S + 1), i.value = Array.from({ length: u }, (I, S) => S + 1);
155
+ function H() {
156
+ const d = new Date(a.value, o.value + 1, 0).getDate(), E = new Date(a.value, o.value).getDay();
157
+ b.value = Array.from({ length: E }, (D, Y) => Y + 1), m.value = Array.from({ length: d }, (D, Y) => Y + 1);
2742
158
  }
2743
- function se() {
2744
- if (!e.value || !t.value || !a.value) return;
2745
- const u = e.value.getBoundingClientRect(), y = t.value.offsetHeight, I = u.top + u.height + y;
2746
- g.value = I > window.innerHeight ? "top" : "bottom";
159
+ function R() {
160
+ if (!t.value || !s.value || !e.value) return;
161
+ const d = t.value.getBoundingClientRect(), E = s.value.offsetHeight, D = d.top + d.height + E;
162
+ v.value = D > window.innerHeight ? "top" : "bottom";
2747
163
  }
2748
- function ae(u, y = !0) {
2749
- s.value = u.getMonth(), l.value = u.getFullYear(), c.value = u.getDate(), y && (r.value = V(u)), fe();
164
+ function J(d, E = !0) {
165
+ o.value = d.getMonth(), a.value = d.getFullYear(), c.value = d.getDate(), E && (n.value = y(d)), H();
2750
166
  }
2751
- function N() {
2752
- if (r.value)
2753
- return ae(new Date(Date.parse(r.value)));
2754
- ae(/* @__PURE__ */ new Date(), n.useDefaultDate);
167
+ function X() {
168
+ if (n.value)
169
+ return J(new Date(Date.parse(n.value)));
170
+ J(/* @__PURE__ */ new Date(), l.useDefaultDate);
2755
171
  }
2756
- return Ce(() => {
2757
- N();
2758
- }), W(a, async (u) => {
2759
- if (!u) {
2760
- window.removeEventListener("resize", se);
172
+ return W(() => {
173
+ X();
174
+ }), $(e, async (d) => {
175
+ if (!d) {
176
+ window.removeEventListener("resize", R);
2761
177
  return;
2762
178
  }
2763
- await qe(), N(), se(), window.addEventListener("resize", se);
179
+ await ae(), X(), R(), window.addEventListener("resize", R);
2764
180
  }), {
2765
- datePickerInput: e,
2766
- datePickerCalendar: t,
2767
- datePickerOpen: a,
2768
- datePickerValue: r,
2769
- datePickerPanel: p,
2770
- datePickerFormat: o,
2771
- datePickerMonth: s,
2772
- datePickerMonthVerbose: T,
2773
- datePickerYear: l,
2774
- datePickerDecade: P,
181
+ datePickerInput: t,
182
+ datePickerCalendar: s,
183
+ datePickerOpen: e,
184
+ datePickerValue: n,
185
+ datePickerPanel: x,
186
+ datePickerFormat: i,
187
+ datePickerMonth: o,
188
+ datePickerMonthVerbose: f,
189
+ datePickerYear: a,
190
+ datePickerDecade: h,
2775
191
  datePickerDay: c,
2776
- datePickerDaysInMonth: i,
2777
- datePickerBlankDaysInMonth: d,
2778
- datePickerMonthNames: h,
2779
- datePickerDays: v,
2780
- datePickerPosition: g,
2781
- toggleDatePicker: k,
2782
- datePickerValueClicked: U,
2783
- datePickerPrevious: _,
2784
- datePickerNext: $,
2785
- datePickerIsSelectedDate: H,
2786
- datePickerIsToday: Te,
2787
- showDatePickerPanel: E
192
+ datePickerDaysInMonth: m,
193
+ datePickerBlankDaysInMonth: b,
194
+ datePickerMonthNames: T,
195
+ datePickerDays: C,
196
+ datePickerPosition: v,
197
+ toggleDatePicker: w,
198
+ datePickerValueClicked: M,
199
+ datePickerPrevious: g,
200
+ datePickerNext: u,
201
+ datePickerIsSelectedDate: I,
202
+ datePickerIsToday: de,
203
+ showDatePickerPanel: p
2788
204
  };
2789
205
  }
2790
- function Zr(n) {
2791
- const e = w(!1);
206
+ function ce(l = "pv_id_") {
207
+ return l + Math.random().toString(16).slice(2);
208
+ }
209
+ class De {
210
+ constructor() {
211
+ O(this, "subscribers");
212
+ O(this, "toasts");
213
+ // We use arrow functions to maintain the correct `this` reference
214
+ O(this, "subscribe", (t) => (this.subscribers.push(t), () => {
215
+ const s = this.subscribers.indexOf(t);
216
+ this.subscribers.splice(s, 1);
217
+ }));
218
+ O(this, "publish", (t) => {
219
+ this.subscribers.forEach((s) => s(t));
220
+ });
221
+ O(this, "addToast", (t) => {
222
+ this.publish(t), this.toasts = [...this.toasts, t];
223
+ });
224
+ O(this, "create", (t, s) => {
225
+ const e = s.id ?? ce("toast_");
226
+ return this.toasts.find((i) => i.id === e) ? this.toasts = this.toasts.map((i) => i.id === e ? (this.publish({ ...i, ...s, id: e, title: t }), {
227
+ ...i,
228
+ ...s,
229
+ id: e,
230
+ title: t
231
+ }) : i) : this.addToast({
232
+ title: t,
233
+ id: e,
234
+ scale: 1,
235
+ zIndex: 200,
236
+ offsetY: 0,
237
+ ...s
238
+ }), e;
239
+ });
240
+ O(this, "dismiss", (t) => {
241
+ t ? (this.publish({ id: t, dismiss: !0 }), this.toasts = this.toasts.filter((s) => s.id !== t)) : (this.toasts.forEach((s) => {
242
+ this.publish({ id: s.id, dismiss: !0 });
243
+ }), this.toasts = []);
244
+ });
245
+ O(this, "add", (t, s) => this.create(t, { ...s }));
246
+ O(this, "success", (t, s) => this.create(t, { type: "success", ...s }));
247
+ O(this, "error", (t, s) => this.create(t, { type: "danger", ...s }));
248
+ O(this, "info", (t, s) => this.create(t, { type: "info", ...s }));
249
+ O(this, "warning", (t, s) => this.create(t, { type: "warning", ...s }));
250
+ this.subscribers = [], this.toasts = [];
251
+ }
252
+ }
253
+ const k = new De();
254
+ function Me(l, t) {
255
+ const s = ce("toast_");
256
+ return k.create(l, { ...t, id: s }), s;
257
+ }
258
+ const Oe = Object.assign(Me, {
259
+ add: k.add,
260
+ success: k.success,
261
+ error: k.error,
262
+ info: k.info,
263
+ warning: k.warning,
264
+ dismiss: k.dismiss
265
+ });
266
+ function et(l) {
267
+ const t = r(!1);
2792
268
  return {
2793
- copyNotification: e,
269
+ copyNotification: t,
2794
270
  copyToClipboard: async () => {
2795
271
  try {
2796
- await navigator.clipboard.writeText(n.value), e.value = !0, setTimeout(() => {
2797
- e.value = !1;
272
+ await navigator.clipboard.writeText(l.value), t.value = !0, setTimeout(() => {
273
+ t.value = !1;
2798
274
  }, 3e3);
2799
- } catch (a) {
2800
- console.error(a), Tt.error("Error", {
275
+ } catch (e) {
276
+ console.error(e), Oe.error("Error", {
2801
277
  description: "Unable to copy. Network is not secure."
2802
278
  });
2803
279
  }
2804
280
  }
2805
281
  };
2806
282
  }
2807
- function Xr(n) {
2808
- const e = w(null);
2809
- return be({
283
+ function tt(l, t) {
284
+ const s = _({
285
+ selectOpen: !1,
286
+ selectedItem: "",
287
+ selectableItems: l,
288
+ selectableItemActive: null,
289
+ selectId: "select-12",
290
+ selectKeydownValue: "",
291
+ selectKeydownTimeout: 1e3,
292
+ selectKeydownClearTimeout: null,
293
+ selectDropdownPosition: "bottom",
294
+ selectableItemsList: t.selectableItemsList,
295
+ selectButton: t.selectButton,
296
+ toggleSelect(n) {
297
+ n !== void 0 ? this.selectOpen = n === !0 : this.selectOpen = !this.selectOpen;
298
+ },
299
+ updateRefs(n) {
300
+ this.selectButton = n.selectButton, this.selectableItemsList = n.selectableItemsList;
301
+ },
302
+ selectableItemIsActive(n) {
303
+ return this.selectableItemActive && this.selectableItemActive.value == n.value;
304
+ },
305
+ selectableItemActiveNext() {
306
+ let n = this.selectableItems.indexOf(this.selectableItemActive);
307
+ n < this.selectableItems.length - 1 && (this.selectableItemActive = this.selectableItems[n + 1], this.selectScrollToActiveItem());
308
+ },
309
+ selectableItemActivePrevious() {
310
+ let n = this.selectableItems.indexOf(this.selectableItemActive);
311
+ n > 0 && (this.selectableItemActive = this.selectableItems[n - 1], this.selectScrollToActiveItem());
312
+ },
313
+ selectScrollToActiveItem() {
314
+ if (!this.selectableItemActive) return;
315
+ let n = document.getElementById(this.selectableItemActive.value + "-" + this.selectId);
316
+ n && n.focus();
317
+ },
318
+ selectKeydown(n) {
319
+ if (n.keyCode >= 65 && n.keyCode <= 90) {
320
+ this.selectKeydownValue += n.key;
321
+ let i = this.selectItemsFindBestMatch();
322
+ i && (this.selectOpen ? (this.selectableItemActive = i, this.selectScrollToActiveItem()) : this.selectedItem = this.selectableItemActive === i), this.selectKeydownValue != "" && (clearTimeout(this.selectKeydownClearTimeout), this.selectKeydownClearTimeout = window.setTimeout(() => {
323
+ this.selectKeydownValue = "";
324
+ }, this.selectKeydownTimeout));
325
+ }
326
+ },
327
+ selectItemsFindBestMatch() {
328
+ let n = this.selectKeydownValue.toLowerCase(), i = null, o = -1;
329
+ for (const a of this.selectableItems) {
330
+ let m = a.title.toLowerCase().indexOf(n);
331
+ m > -1 && (o == -1 || m < o) && !a.disabled && (i = a, o = m);
332
+ }
333
+ return i;
334
+ },
335
+ selectPositionUpdate() {
336
+ var i;
337
+ if (!this.selectableItemsList || !this.selectButton) return;
338
+ let n = ((i = this.selectButton) == null ? void 0 : i.getBoundingClientRect().top) + this.selectButton.offsetHeight + parseInt(window.getComputedStyle(this.selectableItemsList).maxHeight);
339
+ window.innerHeight < n ? this.selectDropdownPosition = "top" : this.selectDropdownPosition = "bottom";
340
+ }
341
+ }), e = () => {
342
+ s.selectOpen && s.selectPositionUpdate();
343
+ };
344
+ return $(
345
+ () => s.selectOpen,
346
+ function(n) {
347
+ if (s.selectedItem ? s.selectableItemActive = s.selectedItem : s.selectableItemActive = s.selectableItems[0], !n) {
348
+ window.removeEventListener("resize", e);
349
+ return;
350
+ }
351
+ window.setTimeout(function() {
352
+ s.selectScrollToActiveItem();
353
+ }, 10), e(), window.addEventListener("resize", e);
354
+ },
355
+ { immediate: !1 }
356
+ ), s;
357
+ }
358
+ function st(l) {
359
+ const t = r(null);
360
+ return _({
2810
361
  title: "",
2811
- ...n,
362
+ ...l,
2812
363
  modalOpen: !1,
2813
364
  isAnimating: !1,
2814
- animationTime: n.animationTime ?? 300,
2815
- toggleModal(t = null) {
2816
- this.isAnimating || (e.value && clearTimeout(e.value), t != null ? this.modalOpen = t : this.modalOpen = !this.modalOpen, this.isAnimating = !0, e.value = window.setTimeout(() => {
365
+ animationTime: l.animationTime ?? 300,
366
+ toggleModal(s = null) {
367
+ this.isAnimating || (t.value && clearTimeout(t.value), s != null ? this.modalOpen = s : this.modalOpen = !this.modalOpen, this.isAnimating = !0, t.value = window.setTimeout(() => {
2817
368
  this.isAnimating = !1;
2818
369
  }, this.animationTime));
2819
370
  },
2820
- setTitle(t) {
2821
- this.title = t;
371
+ setTitle(s) {
372
+ this.title = s;
2822
373
  }
2823
374
  });
2824
375
  }
2825
- function yr({ directions: n, threshold: e, onSwipeOut: t }) {
2826
- const a = w(!1), r = w({ x: 0, y: 0 }), o = w(), s = w({ x: 0, y: 0 }), l = (g) => 1 / (1.5 + Math.abs(g) / 20);
2827
- function c(g) {
2828
- o.value = Date.now(), g.target.setPointerCapture(g.pointerId), !g.target.closest("button, a, input, textarea, select") && (s.value = { x: g.clientX, y: g.clientY }, a.value = !0);
2829
- }
2830
- function i(g) {
2831
- if (!a.value) return;
2832
- const h = { x: 0, y: 0 }, v = g.clientX - s.value.x, p = g.clientY - s.value.y;
2833
- if (n.value.includes("left") && v < 0 || n.value.includes("right") && v > 0)
2834
- h.x = v;
376
+ function nt(l) {
377
+ const t = r(1), s = r(l.itemsPerPage ?? 10), e = r(l.searchQuery ?? ""), n = _({
378
+ filteredPage: K(() => {
379
+ const i = s.value * (t.value - 1), o = Math.min(s.value * t.value, l.data.length);
380
+ return l.data.slice(i, o);
381
+ }),
382
+ props: l,
383
+ fields: { currentPage: t, itemsPerPage: s, searchQuery: e },
384
+ handlePageChange(i) {
385
+ t.value = i;
386
+ },
387
+ handlePageReset() {
388
+ t.value = 1;
389
+ }
390
+ });
391
+ return $(
392
+ () => l.data,
393
+ (i, o) => {
394
+ var a, c;
395
+ ((i == null ? void 0 : i.length) !== (o == null ? void 0 : o.length) || i[0] && o[0] && ((a = i[0]) == null ? void 0 : a.id) !== ((c = o[0]) == null ? void 0 : c.id)) && n.handlePageReset();
396
+ },
397
+ { immediate: !0 }
398
+ ), n;
399
+ }
400
+ function Se(l) {
401
+ return l && l.__esModule && Object.prototype.hasOwnProperty.call(l, "default") ? l.default : l;
402
+ }
403
+ var U, te;
404
+ function Ee() {
405
+ return te || (te = 1, U = function l(t, s) {
406
+ if (t === s) return !0;
407
+ if (t && s && typeof t == "object" && typeof s == "object") {
408
+ if (t.constructor !== s.constructor) return !1;
409
+ var e, n, i;
410
+ if (Array.isArray(t)) {
411
+ if (e = t.length, e != s.length) return !1;
412
+ for (n = e; n-- !== 0; )
413
+ if (!l(t[n], s[n])) return !1;
414
+ return !0;
415
+ }
416
+ if (t.constructor === RegExp) return t.source === s.source && t.flags === s.flags;
417
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === s.valueOf();
418
+ if (t.toString !== Object.prototype.toString) return t.toString() === s.toString();
419
+ if (i = Object.keys(t), e = i.length, e !== Object.keys(s).length) return !1;
420
+ for (n = e; n-- !== 0; )
421
+ if (!Object.prototype.hasOwnProperty.call(s, i[n])) return !1;
422
+ for (n = e; n-- !== 0; ) {
423
+ var o = i[n];
424
+ if (!l(t[o], s[o])) return !1;
425
+ }
426
+ return !0;
427
+ }
428
+ return t !== t && s !== s;
429
+ }), U;
430
+ }
431
+ var Pe = Ee();
432
+ const Be = /* @__PURE__ */ Se(Pe);
433
+ function it(l) {
434
+ let t = l, s;
435
+ const e = _({
436
+ fields: structuredClone(l),
437
+ errors: {},
438
+ dirty: !1,
439
+ hasErrors: !1,
440
+ processing: !1,
441
+ wasSuccessful: !1,
442
+ recentlySuccessful: !1,
443
+ async submit(n, i = {}) {
444
+ if (this.processing) return;
445
+ const o = {
446
+ onBefore: async () => {
447
+ this.processing = !0, this.wasSuccessful = !1, this.recentlySuccessful = !1, clearTimeout(s), i.onBefore && await i.onBefore();
448
+ },
449
+ onSuccess: async (a) => {
450
+ this.clearErrors(), this.wasSuccessful = !0, this.recentlySuccessful = !0, s = window.setTimeout(() => {
451
+ this.recentlySuccessful = !1;
452
+ }, 2e3), i.onSuccess && await i.onSuccess(a), t = structuredClone(this.fields);
453
+ },
454
+ onError: async (a) => {
455
+ var c, m, b, v, T;
456
+ this.hasErrors = !0, (((c = a == null ? void 0 : a.response) == null ? void 0 : c.status) === 422 || ((m = a == null ? void 0 : a.response) == null ? void 0 : m.status) === 401) && (this.clearErrors(), this.setErrors({
457
+ message: (b = a == null ? void 0 : a.response) == null ? void 0 : b.data.message,
458
+ ...(T = (v = a == null ? void 0 : a.response) == null ? void 0 : v.data) == null ? void 0 : T.errors
459
+ })), i.onError && await i.onError(a);
460
+ },
461
+ onFinish: async () => {
462
+ this.processing = !1, i.onFinish && await i.onFinish();
463
+ }
464
+ };
465
+ await o.onBefore();
466
+ try {
467
+ const a = await n(this.fields);
468
+ await o.onSuccess(a);
469
+ } catch (a) {
470
+ await o.onError(a);
471
+ } finally {
472
+ await o.onFinish();
473
+ }
474
+ },
475
+ reset(...n) {
476
+ const i = structuredClone(t);
477
+ n.length === 0 ? this.fields = i : n.forEach((o) => {
478
+ i[o] !== void 0 && (this.fields[o] = i[o]);
479
+ });
480
+ },
481
+ clearErrors(...n) {
482
+ n.length === 0 ? this.errors = {} : n.forEach((i) => delete this.errors[i]), this.hasErrors = Object.keys(this.errors).length > 0;
483
+ },
484
+ setErrors(n) {
485
+ this.errors = { ...this.errors, ...n }, this.hasErrors = Object.keys(this.errors).length > 0;
486
+ }
487
+ });
488
+ return $(
489
+ () => e.fields,
490
+ () => {
491
+ e.dirty = !Be(e.fields, t);
492
+ },
493
+ { immediate: !0, deep: !0 }
494
+ ), e;
495
+ }
496
+ function ke({ directions: l, threshold: t, onSwipeOut: s }) {
497
+ const e = r(!1), n = r({ x: 0, y: 0 }), i = r(), o = r({ x: 0, y: 0 }), a = (v) => 1 / (1.5 + Math.abs(v) / 20);
498
+ function c(v) {
499
+ i.value = Date.now(), v.target.setPointerCapture(v.pointerId), !v.target.closest("button, a, input, textarea, select") && (o.value = { x: v.clientX, y: v.clientY }, e.value = !0);
500
+ }
501
+ function m(v) {
502
+ if (!e.value) return;
503
+ const T = { x: 0, y: 0 }, C = v.clientX - o.value.x, x = v.clientY - o.value.y;
504
+ if (l.value.includes("left") && C < 0 || l.value.includes("right") && C > 0)
505
+ T.x = C;
2835
506
  else {
2836
- const T = v * l(v);
2837
- h.x = Math.abs(T) < Math.abs(v) ? T : v;
507
+ const f = C * a(C);
508
+ T.x = Math.abs(f) < Math.abs(C) ? f : C;
2838
509
  }
2839
- if (n.value.includes("top") && p < 0 || n.value.includes("bottom") && p > 0)
2840
- h.y = p;
510
+ if (l.value.includes("top") && x < 0 || l.value.includes("bottom") && x > 0)
511
+ T.y = x;
2841
512
  else {
2842
- const T = p * l(p);
2843
- h.y = Math.abs(T) < Math.abs(p) ? T : p;
513
+ const f = x * a(x);
514
+ T.y = Math.abs(f) < Math.abs(x) ? f : x;
2844
515
  }
2845
- r.value = h;
516
+ n.value = T;
2846
517
  }
2847
- function d() {
2848
- if (!a.value) return;
2849
- const g = Date.now() - (o.value ?? 0), h = r.value.x, v = Math.abs(h) / g;
2850
- if (Math.abs(h) >= e || v > 0.11) {
2851
- t();
518
+ function b() {
519
+ if (!e.value) return;
520
+ const v = Date.now() - (i.value ?? 0), T = n.value.x, C = Math.abs(T) / v;
521
+ if (Math.abs(T) >= t || C > 0.11) {
522
+ s();
2852
523
  return;
2853
524
  }
2854
- a.value = !1, r.value = { x: 0, y: 0 };
525
+ e.value = !1, n.value = { x: 0, y: 0 };
2855
526
  }
2856
527
  return {
2857
- offset: r,
2858
- isSwiping: a,
528
+ offset: n,
529
+ isSwiping: e,
2859
530
  onPointerDown: c,
2860
- onPointerMove: i,
2861
- onPointerUp: d
531
+ onPointerMove: m,
532
+ onPointerUp: b
2862
533
  };
2863
534
  }
2864
- function wr({ duration: n, isPaused: e, onTimeout: t, immediate: a = !0 }) {
2865
- const r = w(), o = w(0), s = w(n);
2866
- function l() {
2867
- s.value === 1 / 0 || e() || (o.value = Date.now(), r.value = window.setTimeout(() => {
2868
- t();
2869
- }, s.value));
535
+ function Ae({ duration: l, isPaused: t, onTimeout: s, immediate: e = !0 }) {
536
+ const n = r(), i = r(0), o = r(l);
537
+ function a() {
538
+ o.value === 1 / 0 || t() || (i.value = Date.now(), n.value = window.setTimeout(() => {
539
+ s();
540
+ }, o.value));
2870
541
  }
2871
542
  function c() {
2872
- i();
2873
- const d = Date.now() - o.value;
2874
- s.value -= d;
543
+ m();
544
+ const b = Date.now() - i.value;
545
+ o.value -= b;
2875
546
  }
2876
- function i() {
2877
- r.value && (clearTimeout(r.value), r.value = null);
547
+ function m() {
548
+ n.value && (clearTimeout(n.value), n.value = null);
2878
549
  }
2879
- return W(
2880
- e,
2881
- (d) => {
2882
- if (d) {
550
+ return $(
551
+ t,
552
+ (b) => {
553
+ if (b) {
2883
554
  c();
2884
555
  return;
2885
556
  }
2886
- l();
557
+ a();
2887
558
  },
2888
- { immediate: a }
2889
- ), wt(() => {
2890
- i();
2891
- }), { cancel: i };
559
+ { immediate: e }
560
+ ), re(() => {
561
+ m();
562
+ }), { cancel: m };
2892
563
  }
2893
- function Qr(n, e) {
2894
- if (!n) return !1;
2895
- let t = ["INPUT", "TEXTAREA", "SELECT"];
2896
- return (e === " " || e === "Enter") && (t = [...t, "BUTTON"]), t.includes(n.tagName);
564
+ function lt() {
565
+ const l = r(!1), t = r(!1), s = r(300), e = r(null), n = _({}), i = pe(null);
566
+ function o(c, m = {}) {
567
+ e.value && clearTimeout(e.value), i.value = c, Object.assign(n, m), t.value = !0, l.value = !0, e.value = window.setTimeout(() => {
568
+ l.value = !1;
569
+ }, s.value);
570
+ }
571
+ function a() {
572
+ e.value && clearTimeout(e.value), t.value = !1, l.value = !0, e.value = window.setTimeout(() => {
573
+ l.value = !1;
574
+ }, s.value);
575
+ }
576
+ return { isOpen: t, isAnimating: l, animationTime: s, props: n, component: i, open: o, close: a };
2897
577
  }
2898
- const Ft = 3, kr = "24px", xr = "16px", dt = 0, ft = 3e3, Cr = 16, Tr = 45, vt = 10, mt = 0.06, He = 16, Ir = ["id", "data-isSwiping"], $r = {
578
+ function ot(l, t) {
579
+ if (!l) return !1;
580
+ let s = ["INPUT", "TEXTAREA", "SELECT"];
581
+ return (t === " " || t === "Enter") && (s = [...s, "BUTTON"]), s.includes(l.tagName);
582
+ }
583
+ const fe = 3, Le = "24px", $e = "16px", se = 0, ne = 3e3, Ye = 16, Ve = 45, ie = 10, le = 0.06, q = 16, Fe = ["id", "data-isSwiping"], Ne = {
2899
584
  class: "w-[18px] h-[18px] mr-1.5 -ml-1",
2900
585
  viewBox: "0 0 24 24",
2901
586
  fill: "none",
2902
587
  xmlns: "http://www.w3.org/2000/svg"
2903
- }, Pr = {
588
+ }, _e = {
2904
589
  class: "w-[18px] h-[18px] mr-1.5 -ml-1",
2905
590
  viewBox: "0 0 24 24",
2906
591
  fill: "none",
2907
592
  xmlns: "http://www.w3.org/2000/svg"
2908
- }, Sr = {
593
+ }, Ke = {
2909
594
  class: "w-[18px] h-[18px] mr-1.5 -ml-1",
2910
595
  viewBox: "0 0 24 24",
2911
596
  fill: "none",
2912
597
  xmlns: "http://www.w3.org/2000/svg"
2913
- }, Ar = {
598
+ }, He = {
2914
599
  class: "w-[18px] h-[18px] mr-1.5 -ml-1",
2915
600
  viewBox: "0 0 24 24",
2916
601
  fill: "none",
2917
602
  xmlns: "http://www.w3.org/2000/svg"
2918
- }, Er = ["title"], Dr = /* @__PURE__ */ K({
603
+ }, Re = ["title"], ze = /* @__PURE__ */ ue({
2919
604
  __name: "ToastNotification",
2920
605
  props: {
2921
606
  id: {},
@@ -2924,13 +609,13 @@ const Ft = 3, kr = "24px", xr = "16px", dt = 0, ft = 3e3, Cr = 16, Tr = 45, vt =
2924
609
  position: { default: "bottom-center" },
2925
610
  toastCount: {},
2926
611
  expanded: { type: Boolean },
2927
- maxVisibleToasts: { default: Ft },
612
+ maxVisibleToasts: { default: fe },
2928
613
  swipeDirections: { default: () => [] },
2929
614
  style: { default: "" },
2930
615
  title: { default: "Title" },
2931
616
  description: {},
2932
617
  type: { default: "default" },
2933
- life: { default: ft },
618
+ life: { default: ne },
2934
619
  html: { default: "" },
2935
620
  component: {},
2936
621
  scale: {},
@@ -2939,82 +624,82 @@ const Ft = 3, kr = "24px", xr = "16px", dt = 0, ft = 3e3, Cr = 16, Tr = 45, vt =
2939
624
  positionY: {}
2940
625
  },
2941
626
  emits: ["close"],
2942
- setup(n, { emit: e }) {
2943
- const t = e, a = n, r = w("translate-y-0"), o = J(() => {
2944
- if (a.swipeDirections.length > 0) return a.swipeDirections;
2945
- const [_, $] = a.position.split("-"), H = [];
2946
- return U(_) && H.push(_), U($) && H.push($), $ === "center" && H.push("left", "right"), H;
2947
- }), s = J(() => a.position.includes("bottom")), l = w(null), c = w(null), i = w(!1), d = w(!1), { offset: g, isSwiping: h, onPointerDown: v, onPointerMove: p, onPointerUp: T } = yr({
2948
- directions: o,
2949
- threshold: Tr,
2950
- onSwipeOut: E
2951
- }), { cancel: P } = wr({
2952
- duration: a.life || ft,
2953
- isPaused: () => a.expanded || a.type === "loading" || !a.life || a.life === 1 / 0 || i.value,
2954
- onTimeout: E
627
+ setup(l, { emit: t }) {
628
+ const s = t, e = l, n = r("translate-y-0"), i = K(() => {
629
+ if (e.swipeDirections.length > 0) return e.swipeDirections;
630
+ const [g, u] = e.position.split("-"), I = [];
631
+ return M(g) && I.push(g), M(u) && I.push(u), u === "center" && I.push("left", "right"), I;
632
+ }), o = K(() => e.position.includes("bottom")), a = r(null), c = r(null), m = r(!1), b = r(!1), { offset: v, isSwiping: T, onPointerDown: C, onPointerMove: x, onPointerUp: f } = ke({
633
+ directions: i,
634
+ threshold: Ve,
635
+ onSwipeOut: p
636
+ }), { cancel: h } = Ae({
637
+ duration: e.life || ne,
638
+ isPaused: () => e.expanded || e.type === "loading" || !e.life || e.life === 1 / 0 || m.value,
639
+ onTimeout: p
2955
640
  });
2956
- function k() {
2957
- return h.value ? g.value.x > 0 ? "translate-x-full" : "-translate-x-full" : a.toastCount === 1 ? s.value ? "translate-y-full" : "-translate-y-full" : "translate-y-0";
641
+ function w() {
642
+ return T.value ? v.value.x > 0 ? "translate-x-full" : "-translate-x-full" : e.toastCount === 1 ? o.value ? "translate-y-full" : "-translate-y-full" : "translate-y-0";
2958
643
  }
2959
- function E() {
2960
- l.value || (r.value = k(), d.value = !1, P(), l.value = window.setTimeout(() => {
2961
- t("close", a.id);
644
+ function p() {
645
+ a.value || (n.value = w(), b.value = !1, h(), a.value = window.setTimeout(() => {
646
+ s("close", e.id);
2962
647
  }, 350));
2963
648
  }
2964
- function V() {
2965
- c.value && (clearTimeout(c.value), c.value = null), l.value && (clearTimeout(l.value), l.value = null);
649
+ function y() {
650
+ c.value && (clearTimeout(c.value), c.value = null), a.value && (clearTimeout(a.value), a.value = null);
2966
651
  }
2967
- function U(_) {
2968
- return ["top", "right", "bottom", "left"].includes(_);
652
+ function M(g) {
653
+ return ["top", "right", "bottom", "left"].includes(g);
2969
654
  }
2970
- return Ce(() => {
2971
- d.value = !0, c.value && clearTimeout(c.value), c.value = window.setTimeout(() => {
2972
- a.stack();
655
+ return W(() => {
656
+ b.value = !0, c.value && clearTimeout(c.value), c.value = window.setTimeout(() => {
657
+ e.stack();
2973
658
  });
2974
- }), wt(() => {
2975
- V();
2976
- }), (_, $) => (m(), C("li", {
659
+ }), re(() => {
660
+ y();
661
+ }), (g, u) => (B(), L("li", {
2977
662
  ref: "toastEl",
2978
- id: a.id,
2979
- class: D([
663
+ id: e.id,
664
+ class: N([
2980
665
  "toast w-full absolute duration-300 transition-all ease-out",
2981
- { "toast-no-description": !_.description },
2982
- { "opacity-0 pointer-events-none": _.index >= _.maxVisibleToasts },
2983
- _.style
666
+ { "toast-no-description": !g.description },
667
+ { "opacity-0 pointer-events-none": g.index >= g.maxVisibleToasts },
668
+ g.style
2984
669
  ]),
2985
- style: ze({
2986
- "--offset-x": `${b(g).x}px`,
2987
- "--offset-y": `${_.offsetY}px`,
2988
- "--scale": _.scale,
2989
- "--z-index": _.zIndex,
2990
- "--position-top": `${_.expanded ? s.value ? "auto" : _.positionY : "inherit"}`,
2991
- "--position-bottom": `${s.value && _.expanded ? _.positionY : "inherit"}`
670
+ style: he({
671
+ "--offset-x": `${S(v).x}px`,
672
+ "--offset-y": `${g.offsetY}px`,
673
+ "--scale": g.scale,
674
+ "--z-index": g.zIndex,
675
+ "--position-top": `${g.expanded ? o.value ? "auto" : g.positionY : "inherit"}`,
676
+ "--position-bottom": `${o.value && g.expanded ? g.positionY : "inherit"}`
2992
677
  }),
2993
- "data-isSwiping": b(h),
2994
- onMouseover: $[0] || ($[0] = (H) => i.value = !0),
2995
- onMouseout: $[1] || ($[1] = (H) => i.value = !1),
2996
- onDragend: $[2] || ($[2] = //@ts-ignore
2997
- (...H) => b(T) && b(T)(...H)),
2998
- onPointerdown: $[3] || ($[3] = //@ts-ignore
2999
- (...H) => b(v) && b(v)(...H)),
3000
- onPointermove: $[4] || ($[4] = //@ts-ignore
3001
- (...H) => b(p) && b(p)(...H)),
3002
- onPointerup: $[5] || ($[5] = //@ts-ignore
3003
- (...H) => b(T) && b(T)(...H)),
678
+ "data-isSwiping": S(T),
679
+ onMouseover: u[0] || (u[0] = (I) => m.value = !0),
680
+ onMouseout: u[1] || (u[1] = (I) => m.value = !1),
681
+ onDragend: u[2] || (u[2] = //@ts-ignore
682
+ (...I) => S(f) && S(f)(...I)),
683
+ onPointerdown: u[3] || (u[3] = //@ts-ignore
684
+ (...I) => S(C) && S(C)(...I)),
685
+ onPointermove: u[4] || (u[4] = //@ts-ignore
686
+ (...I) => S(x) && S(x)(...I)),
687
+ onPointerup: u[5] || (u[5] = //@ts-ignore
688
+ (...I) => S(f) && S(f)(...I)),
3004
689
  role: "alert"
3005
690
  }, [
3006
- M(pe, {
691
+ ge(we, {
3007
692
  "enter-active-class": "",
3008
- "enter-from-class": `opacity-0 ${s.value ? "translate-y-full" : "-translate-y-full"}`,
693
+ "enter-from-class": `opacity-0 ${o.value ? "translate-y-full" : "-translate-y-full"}`,
3009
694
  "enter-to-class": "opacity-100 translate-y-0",
3010
695
  "leave-active-class": "",
3011
696
  "leave-from-class": "opacity-100 translate-y-0",
3012
- "leave-to-class": `opacity-0 ${r.value}`
697
+ "leave-to-class": `opacity-0 ${n.value}`
3013
698
  }, {
3014
- default: B(() => [
3015
- G(x("span", {
3016
- class: D([
3017
- { "p-4": !a.html, "p-0": a.html },
699
+ default: ye(() => [
700
+ V(P("span", {
701
+ class: N([
702
+ { "p-4": !e.html, "p-0": e.html },
3018
703
  "flex flex-col items-start backdrop-blur-lg rounded-md ",
3019
704
  "group relative select-text",
3020
705
  "transition-all duration-300 ease-out",
@@ -3023,83 +708,83 @@ const Ft = 3, kr = "24px", xr = "16px", dt = 0, ft = 3e3, Cr = 16, Tr = 45, vt =
3023
708
  "!outline-none focus:ring-gray-400 dark:focus:ring-purple-500 focus:ring-2"
3024
709
  ])
3025
710
  }, [
3026
- a.html ? R("", !0) : (m(), C("div", {
711
+ e.html ? G("", !0) : (B(), L("div", {
3027
712
  key: 0,
3028
- class: D(["flex items-center", {
3029
- "text-green-500": a.type === "success",
3030
- "text-blue-500": a.type === "info",
3031
- "text-orange-400": a.type === "warning",
3032
- "text-rose-500": a.type === "danger",
3033
- "dark:text-neutral-100 text-gray-800": a.type === "default"
713
+ class: N(["flex items-center", {
714
+ "text-green-500": e.type === "success",
715
+ "text-blue-500": e.type === "info",
716
+ "text-orange-400": e.type === "warning",
717
+ "text-rose-500": e.type === "danger",
718
+ "dark:text-neutral-100 text-gray-800": e.type === "default"
3034
719
  }])
3035
720
  }, [
3036
- G((m(), C("svg", $r, $[6] || ($[6] = [
3037
- x("path", {
721
+ V((B(), L("svg", Ne, u[6] || (u[6] = [
722
+ P("path", {
3038
723
  "fill-rule": "evenodd",
3039
724
  "clip-rule": "evenodd",
3040
725
  d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM16.7744 9.63269C17.1238 9.20501 17.0604 8.57503 16.6327 8.22559C16.2051 7.87615 15.5751 7.93957 15.2256 8.36725L10.6321 13.9892L8.65936 12.2524C8.24484 11.8874 7.61295 11.9276 7.248 12.3421C6.88304 12.7566 6.92322 13.3885 7.33774 13.7535L9.31046 15.4903C10.1612 16.2393 11.4637 16.1324 12.1808 15.2547L16.7744 9.63269Z",
3041
726
  fill: "currentColor"
3042
727
  }, null, -1)
3043
728
  ]), 512)), [
3044
- [Q, a.type === "success"]
729
+ [F, e.type === "success"]
3045
730
  ]),
3046
- G((m(), C("svg", Pr, $[7] || ($[7] = [
3047
- x("path", {
731
+ V((B(), L("svg", _e, u[7] || (u[7] = [
732
+ P("path", {
3048
733
  "fill-rule": "evenodd",
3049
734
  "clip-rule": "evenodd",
3050
735
  d: "M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9ZM13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V12Z",
3051
736
  fill: "currentColor"
3052
737
  }, null, -1)
3053
738
  ]), 512)), [
3054
- [Q, a.type === "info"]
739
+ [F, e.type === "info"]
3055
740
  ]),
3056
- G((m(), C("svg", Sr, $[8] || ($[8] = [
3057
- x("path", {
741
+ V((B(), L("svg", Ke, u[8] || (u[8] = [
742
+ P("path", {
3058
743
  "fill-rule": "evenodd",
3059
744
  "clip-rule": "evenodd",
3060
745
  d: "M9.44829 4.46472C10.5836 2.51208 13.4105 2.51168 14.5464 4.46401L21.5988 16.5855C22.7423 18.5509 21.3145 21 19.05 21L4.94967 21C2.68547 21 1.25762 18.5516 2.4004 16.5862L9.44829 4.46472ZM11.9995 8C12.5518 8 12.9995 8.44772 12.9995 9V13C12.9995 13.5523 12.5518 14 11.9995 14C11.4473 14 10.9995 13.5523 10.9995 13V9C10.9995 8.44772 11.4473 8 11.9995 8ZM12.0009 15.99C11.4486 15.9892 11.0003 16.4363 10.9995 16.9886L10.9995 16.9986C10.9987 17.5509 11.4458 17.9992 11.9981 18C12.5504 18.0008 12.9987 17.5537 12.9995 17.0014L12.9995 16.9914C13.0003 16.4391 12.5532 15.9908 12.0009 15.99Z",
3061
746
  fill: "currentColor"
3062
747
  }, null, -1)
3063
748
  ]), 512)), [
3064
- [Q, a.type === "warning"]
749
+ [F, e.type === "warning"]
3065
750
  ]),
3066
- G((m(), C("svg", Ar, $[9] || ($[9] = [
3067
- x("path", {
751
+ V((B(), L("svg", He, u[9] || (u[9] = [
752
+ P("path", {
3068
753
  "fill-rule": "evenodd",
3069
754
  "clip-rule": "evenodd",
3070
755
  d: "M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM11.9996 7C12.5519 7 12.9996 7.44772 12.9996 8V12C12.9996 12.5523 12.5519 13 11.9996 13C11.4474 13 10.9996 12.5523 10.9996 12V8C10.9996 7.44772 11.4474 7 11.9996 7ZM12.001 14.99C11.4488 14.9892 11.0004 15.4363 10.9997 15.9886L10.9996 15.9986C10.9989 16.5509 11.446 16.9992 11.9982 17C12.5505 17.0008 12.9989 16.5537 12.9996 16.0014L12.9996 15.9914C13.0004 15.4391 12.5533 14.9908 12.001 14.99Z",
3071
756
  fill: "currentColor"
3072
757
  }, null, -1)
3073
758
  ]), 512)), [
3074
- [Q, a.type === "danger"]
759
+ [F, e.type === "danger"]
3075
760
  ]),
3076
- x("p", {
761
+ P("p", {
3077
762
  class: "text-[13px] font-medium leading-none",
3078
- title: a.title
3079
- }, j(b(He) + " : " + a.title), 9, Er)
763
+ title: e.title
764
+ }, Z(S(q) + " : " + e.title), 9, Re)
3080
765
  ], 2)),
3081
- G(x("p", {
3082
- class: D([{ "pl-5": a.type !== "default" }, "mt-1.5 text-xs leading-tight opacity-70 w-full whitespace-pre-wrap break-words overflow-y-auto scrollbar-minimal max-h-32 min-h-3 pe-2"])
3083
- }, j(_.description), 3), [
3084
- [Q, a.description]
766
+ V(P("p", {
767
+ class: N([{ "pl-5": e.type !== "default" }, "mt-1.5 text-xs leading-tight opacity-70 w-full whitespace-pre-wrap break-words overflow-y-auto scrollbar-minimal max-h-32 min-h-3 pe-2"])
768
+ }, Z(g.description), 3), [
769
+ [F, e.description]
3085
770
  ]),
3086
- a.html ? R("", !0) : (m(), C("span", {
771
+ e.html ? G("", !0) : (B(), L("span", {
3087
772
  key: 1,
3088
- onClick: E,
3089
- class: D(["absolute right-0 p-1.5 mr-2.5 text-gray-400 dark:text-rose-700 duration-100 ease-in-out rounded-full opacity-0 cursor-pointer hover:bg-gray-50 dark:bg-gray-800/50 hover:text-gray-500 dark:hover:text-rose-600", {
3090
- "top-1/2 -translate-y-1/2": !a.description && !a.html,
3091
- "top-0 mt-2.5": a.description || a.html,
3092
- "opacity-100": i.value,
3093
- "opacity-0": !i.value
773
+ onClick: p,
774
+ class: N(["absolute right-0 p-1.5 mr-2.5 text-gray-400 dark:text-rose-700 duration-100 ease-in-out rounded-full opacity-0 cursor-pointer hover:bg-gray-50 dark:bg-gray-800/50 hover:text-gray-500 dark:hover:text-rose-600", {
775
+ "top-1/2 -translate-y-1/2": !e.description && !e.html,
776
+ "top-0 mt-2.5": e.description || e.html,
777
+ "opacity-100": m.value,
778
+ "opacity-0": !m.value
3094
779
  }])
3095
- }, $[10] || ($[10] = [
3096
- x("svg", {
780
+ }, u[10] || (u[10] = [
781
+ P("svg", {
3097
782
  class: "w-3 h-3",
3098
783
  fill: "currentColor",
3099
784
  viewBox: "0 0 20 20",
3100
785
  xmlns: "http://www.w3.org/2000/svg"
3101
786
  }, [
3102
- x("path", {
787
+ P("path", {
3103
788
  "fill-rule": "evenodd",
3104
789
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
3105
790
  "clip-rule": "evenodd"
@@ -3107,233 +792,222 @@ const Ft = 3, kr = "24px", xr = "16px", dt = 0, ft = 3e3, Cr = 16, Tr = 45, vt =
3107
792
  ], -1)
3108
793
  ]), 2))
3109
794
  ], 2), [
3110
- [Q, d.value]
795
+ [F, b.value]
3111
796
  ])
3112
797
  ]),
3113
798
  _: 1
3114
799
  }, 8, ["enter-from-class", "leave-to-class"])
3115
- ], 46, Ir));
800
+ ], 46, Fe));
3116
801
  }
3117
- }), Mr = /* @__PURE__ */ ee(Dr, [["__scopeId", "data-v-68f0a34c"]]), Nr = { class: "absolute top-0 left-0 text-3xl p-4 bg-amber-400/50 text-white" }, Jr = /* @__PURE__ */ K({
802
+ }), je = (l, t) => {
803
+ const s = l.__vccOpts || l;
804
+ for (const [e, n] of t)
805
+ s[e] = n;
806
+ return s;
807
+ }, Ue = /* @__PURE__ */ je(ze, [["__scopeId", "data-v-68f0a34c"]]), Ze = { class: "absolute top-0 left-0 text-3xl p-4 bg-amber-400/50 text-white" }, at = /* @__PURE__ */ ue({
3118
808
  __name: "ToastController",
3119
809
  props: {
3120
810
  layout: { default: "default" },
3121
811
  position: { default: "bottom-right" },
3122
812
  defaultLife: { default: 3e3 },
3123
- viewportOffset: { default: kr },
3124
- mobileViewportOffset: { default: xr },
3125
- paddingBetweenToasts: { default: Cr },
3126
- maxVisibleToasts: { default: Ft },
813
+ viewportOffset: { default: Le },
814
+ mobileViewportOffset: { default: $e },
815
+ paddingBetweenToasts: { default: Ye },
816
+ maxVisibleToasts: { default: fe },
3127
817
  closeButton: { type: Boolean },
3128
818
  icons: {}
3129
819
  },
3130
- setup(n) {
3131
- const e = n, t = w(), a = w([]), r = w(e.position), o = w(e.layout), s = w(!1), l = w(e.layout === "expanded"), c = w(e.paddingBetweenToasts), i = w(null);
3132
- w(null);
3133
- function d(T) {
3134
- a.value = a.value.filter((P) => P.id !== T), te.dismiss(T), g();
3135
- }
3136
- function g(T) {
3137
- a.value.length > 0 && h(), v(), i.value && clearTimeout(i.value), l.value && (i.value = window.setTimeout(() => {
3138
- v();
820
+ setup(l) {
821
+ const t = l, s = r(), e = r([]), n = r(t.position), i = r(t.layout), o = r(!1), a = r(t.layout === "expanded"), c = r(t.paddingBetweenToasts), m = r(null);
822
+ r(null);
823
+ function b(f) {
824
+ e.value = e.value.filter((h) => h.id !== f), k.dismiss(f), v();
825
+ }
826
+ function v(f) {
827
+ e.value.length > 0 && T(), C(), m.value && clearTimeout(m.value), a.value && (m.value = window.setTimeout(() => {
828
+ C();
3139
829
  }, 100));
3140
830
  }
3141
- function h(T) {
831
+ function T(f) {
3142
832
  try {
3143
- const P = r.value.includes("bottom"), k = [];
3144
- let E = 0, V = 1 + mt, U = -He, _ = 200 + vt;
3145
- for (const $ of a.value) {
3146
- const H = document.getElementById($.id);
3147
- if (!H) return;
3148
- if (_ -= vt, V -= mt, U += He, $.scale = V, $.offsetY = U, $.zIndex = _, k.push(H), l.value) {
3149
- E = E + (E ? c.value : 0), $.positionY = E + "px", $.scale = 1, $.offsetY = 0, E += H.offsetHeight;
833
+ const h = n.value.includes("bottom"), w = [];
834
+ let p = 0, y = 1 + le, M = -q, g = 200 + ie;
835
+ for (const u of e.value) {
836
+ const I = document.getElementById(u.id);
837
+ if (!I) return;
838
+ if (g -= ie, y -= le, M += q, u.scale = y, u.offsetY = M, u.zIndex = g, w.push(I), a.value) {
839
+ p = p + (p ? c.value : 0), u.positionY = p + "px", u.scale = 1, u.offsetY = 0, p += I.offsetHeight;
3150
840
  continue;
3151
841
  }
3152
- $.scale = V, P ? $.offsetY *= -1 : p(k[0], $);
842
+ u.scale = y, h ? u.offsetY *= -1 : x(w[0], u);
3153
843
  }
3154
- } catch (P) {
3155
- console.log(P);
844
+ } catch (h) {
845
+ console.log(h);
3156
846
  }
3157
847
  }
3158
- function v() {
3159
- var V, U;
3160
- if (!t.value) return;
3161
- if (a.value.length == 0) {
3162
- t.value.style.height = "0px";
848
+ function C() {
849
+ var y, M;
850
+ if (!s.value) return;
851
+ if (e.value.length == 0) {
852
+ s.value.style.height = "0px";
3163
853
  return;
3164
854
  }
3165
- const T = a.value[Math.max(Math.min(a.value.length - 1, e.maxVisibleToasts - 1), 0)], P = (V = document.getElementById(`${T == null ? void 0 : T.id}`)) == null ? void 0 : V.getBoundingClientRect(), k = a.value[0], E = (U = document.getElementById(`${k == null ? void 0 : k.id}`)) == null ? void 0 : U.getBoundingClientRect();
3166
- if (!(!E || !P)) {
3167
- if (!s.value) {
3168
- t.value.style.height = E.height + "px";
855
+ const f = e.value[Math.max(Math.min(e.value.length - 1, t.maxVisibleToasts - 1), 0)], h = (y = document.getElementById(`${f == null ? void 0 : f.id}`)) == null ? void 0 : y.getBoundingClientRect(), w = e.value[0], p = (M = document.getElementById(`${w == null ? void 0 : w.id}`)) == null ? void 0 : M.getBoundingClientRect();
856
+ if (!(!p || !h)) {
857
+ if (!o.value) {
858
+ s.value.style.height = p.height + "px";
3169
859
  return;
3170
860
  }
3171
- if (r.value.includes("bottom")) {
3172
- t.value.style.height = E.top + E.height - P.top + "px";
861
+ if (n.value.includes("bottom")) {
862
+ s.value.style.height = p.top + p.height - h.top + "px";
3173
863
  return;
3174
864
  }
3175
- t.value.style.height = P.top + P.height - E.top + "px";
865
+ s.value.style.height = h.top + h.height - p.top + "px";
3176
866
  }
3177
867
  }
3178
- function p(T, P) {
3179
- const k = document.getElementById(P.id);
3180
- if (!k) return;
3181
- const E = T.offsetTop, V = T.offsetHeight, U = k.offsetHeight, _ = E + (V - U);
3182
- P.positionY = _ + "px";
868
+ function x(f, h) {
869
+ const w = document.getElementById(h.id);
870
+ if (!w) return;
871
+ const p = f.offsetTop, y = f.offsetHeight, M = w.offsetHeight, g = p + (y - M);
872
+ h.positionY = g + "px";
3183
873
  }
3184
- return Ce(() => {
3185
- g();
3186
- }), W(
3187
- () => s.value,
3188
- (T) => {
3189
- if (o.value === "default") {
3190
- if (T) {
3191
- l.value = !0, g();
874
+ return W(() => {
875
+ v();
876
+ }), $(
877
+ () => o.value,
878
+ (f) => {
879
+ if (i.value === "default") {
880
+ if (f) {
881
+ a.value = !0, v();
3192
882
  return;
3193
883
  }
3194
- l.value = !1, g();
884
+ a.value = !1, v();
3195
885
  }
3196
886
  }
3197
- ), W(
3198
- () => a.value,
887
+ ), $(
888
+ () => e.value,
3199
889
  () => {
3200
- a.value.length <= 1 && (l.value = !1);
3201
- }
3202
- ), Gt((T) => {
3203
- const P = te.subscribe((k) => {
3204
- k.dismiss || qe(() => {
3205
- const E = a.value.findIndex((U) => U.id === k.id);
3206
- if (E !== -1) {
3207
- a.value = [
3208
- ...a.value.slice(0, E),
3209
- { ...a.value[E], ...k },
3210
- ...a.value.slice(E + 1)
890
+ e.value.length <= 1 && (a.value = !1);
891
+ }
892
+ ), be((f) => {
893
+ const h = k.subscribe((w) => {
894
+ w.dismiss || ae(() => {
895
+ const p = e.value.findIndex((M) => M.id === w.id);
896
+ if (p !== -1) {
897
+ e.value = [
898
+ ...e.value.slice(0, p),
899
+ { ...e.value[p], ...w },
900
+ ...e.value.slice(p + 1)
3211
901
  ];
3212
902
  return;
3213
903
  }
3214
- const V = k;
3215
- V.position && (r.value = V.position), a.value.unshift({
3216
- ...V,
3217
- id: V.id,
3218
- type: V.type ?? "default",
3219
- position: V.position ?? r.value,
3220
- life: V.life ?? e.defaultLife,
3221
- title: V.title
904
+ const y = w;
905
+ y.position && (n.value = y.position), e.value.unshift({
906
+ ...y,
907
+ id: y.id,
908
+ type: y.type ?? "default",
909
+ position: y.position ?? n.value,
910
+ life: y.life ?? t.defaultLife,
911
+ title: y.title
3222
912
  });
3223
913
  });
3224
914
  });
3225
- T(P);
3226
- }), (T, P) => (m(), Y(Ue, { to: "body" }, [
3227
- x("p", Nr, "toastsHovered: " + j(s.value), 1),
3228
- x("ol", {
915
+ f(h);
916
+ }), (f, h) => (B(), ee(Te, { to: "body" }, [
917
+ P("p", Ze, "toastsHovered: " + Z(o.value), 1),
918
+ P("ol", {
3229
919
  ref_key: "container",
3230
- ref: t,
3231
- class: D([
3232
- `fixed w-full group z-[500] [&>*]:px-4 [&>*]:px-[${T.mobileViewportOffset ?? T.viewportOffset}] [&>*]:sm:px-6 [&>*]:sm:px-[${T.viewportOffset}] my-4 sm:my-6 my-[${T.mobileViewportOffset ?? T.viewportOffset}] sm:my-[${T.viewportOffset}]`,
3233
- `${b(dt) ? `sm:w-[${b(dt)}px]` : "sm:max-w-sm"}`,
3234
- `${r.value == "top-right" ? "right-0 top-0" : ""}`,
3235
- `${r.value == "top-left" ? "left-0 top-0" : ""}`,
3236
- `${r.value == "top-center" ? "left-1/2 -translate-x-1/2 top-0" : ""}`,
3237
- `${r.value == "bottom-right" ? "right-0 bottom-0" : ""}`,
3238
- `${r.value == "bottom-left" ? "left-0 bottom-0" : ""}`,
3239
- `${r.value == "bottom-center" ? "left-1/2 -translate-x-1/2 bottom-0" : ""}`
920
+ ref: s,
921
+ class: N([
922
+ `fixed w-full group z-[500] [&>*]:px-4 [&>*]:px-[${f.mobileViewportOffset ?? f.viewportOffset}] [&>*]:sm:px-6 [&>*]:sm:px-[${f.viewportOffset}] my-4 sm:my-6 my-[${f.mobileViewportOffset ?? f.viewportOffset}] sm:my-[${f.viewportOffset}]`,
923
+ `${S(se) ? `sm:w-[${S(se)}px]` : "sm:max-w-sm"}`,
924
+ `${n.value == "top-right" ? "right-0 top-0" : ""}`,
925
+ `${n.value == "top-left" ? "left-0 top-0" : ""}`,
926
+ `${n.value == "top-center" ? "left-1/2 -translate-x-1/2 top-0" : ""}`,
927
+ `${n.value == "bottom-right" ? "right-0 bottom-0" : ""}`,
928
+ `${n.value == "bottom-left" ? "left-0 bottom-0" : ""}`,
929
+ `${n.value == "bottom-center" ? "left-1/2 -translate-x-1/2 bottom-0" : ""}`
3240
930
  ]),
3241
- onMouseenter: P[0] || (P[0] = (k) => s.value = !0),
3242
- onMouseleave: P[1] || (P[1] = (k) => s.value = !1)
931
+ onMouseenter: h[0] || (h[0] = (w) => o.value = !0),
932
+ onMouseleave: h[1] || (h[1] = (w) => o.value = !1)
3243
933
  }, [
3244
- (m(!0), C(X, null, ge(a.value, (k, E) => (m(), Y(Mr, yt({ ref_for: !0 }, k, {
3245
- key: k.id,
934
+ (B(!0), L(xe, null, Ie(e.value, (w, p) => (B(), ee(Ue, Ce({ ref_for: !0 }, w, {
935
+ key: w.id,
3246
936
  stack: () => {
3247
- g();
937
+ v();
3248
938
  },
3249
- toastCount: a.value.length,
3250
- position: r.value,
3251
- expanded: l.value,
3252
- index: E,
3253
- maxVisibleToasts: T.maxVisibleToasts,
3254
- onClose: d
939
+ toastCount: e.value.length,
940
+ position: n.value,
941
+ expanded: a.value,
942
+ index: p,
943
+ maxVisibleToasts: f.maxVisibleToasts,
944
+ onClose: b
3255
945
  }), null, 16, ["stack", "toastCount", "position", "expanded", "index", "maxVisibleToasts"]))), 128))
3256
946
  ], 34)
3257
947
  ]));
3258
948
  }
3259
- }), Or = {
3260
- stringInsensitive: (n, e) => pt(n).localeCompare(pt(e)),
3261
- date: (n, e) => new Date(n).getTime() - new Date(e).getTime(),
3262
- number: (n, e) => parseFloat(n) - parseFloat(e)
949
+ }), qe = {
950
+ stringInsensitive: (l, t) => oe(l).localeCompare(oe(t)),
951
+ date: (l, t) => new Date(l).getTime() - new Date(t).getTime(),
952
+ number: (l, t) => parseFloat(l) - parseFloat(t)
3263
953
  };
3264
- function pt(n) {
3265
- return String(n ?? "").toLowerCase().replace(/\s+/g, " ").trim();
3266
- }
3267
- function es(n, e = 1, t = ["date", "date_released"]) {
3268
- return (a, r) => {
3269
- const o = a[n], s = r[n];
3270
- if (o instanceof Date && s instanceof Date || t.includes(String(n))) {
3271
- const i = new Date(String(o));
3272
- return (new Date(String(s)).getTime() - i.getTime()) * e;
3273
- }
3274
- const l = parseFloat(o), c = parseFloat(s);
3275
- return !isNaN(l) && !isNaN(c) ? (l - c) * e : String(o).toLowerCase().replace(/\s+/g, " ").localeCompare(String(s).toLowerCase().replace(/\s+/g, " ")) * e;
954
+ function oe(l) {
955
+ return String(l ?? "").toLowerCase().replace(/\s+/g, " ").trim();
956
+ }
957
+ function rt(l, t = 1, s = ["date", "date_released"]) {
958
+ return (e, n) => {
959
+ const i = e[l], o = n[l];
960
+ if (i instanceof Date && o instanceof Date || s.includes(String(l))) {
961
+ const m = new Date(String(i));
962
+ return (new Date(String(o)).getTime() - m.getTime()) * t;
963
+ }
964
+ const a = parseFloat(i), c = parseFloat(o);
965
+ return !isNaN(a) && !isNaN(c) ? (a - c) * t : String(i).toLowerCase().replace(/\s+/g, " ").localeCompare(String(o).toLowerCase().replace(/\s+/g, " ")) * t;
3276
966
  };
3277
967
  }
3278
- function ts(n, e = 1) {
3279
- return (t, a) => {
3280
- for (const { key: r, compareFn: o } of n) {
3281
- const s = r ? t[r] ?? "" : void 0, l = r ? a[r] ?? "" : void 0;
968
+ function ut(l, t = 1) {
969
+ return (s, e) => {
970
+ for (const { key: n, compareFn: i } of l) {
971
+ const o = n ? s[n] ?? "" : void 0, a = n ? e[n] ?? "" : void 0;
3282
972
  let c;
3283
- if (o ? c = r ? o(s, l) : o(t, a) : c = Lr(s, l), c !== 0) return c * e;
973
+ if (i ? c = n ? i(o, a) : i(s, e) : c = We(o, a), c !== 0) return c * t;
3284
974
  }
3285
975
  return 0;
3286
976
  };
3287
977
  }
3288
- function Lr(n, e) {
3289
- const t = parseFloat(n), a = parseFloat(e);
3290
- if (!isNaN(t) && !isNaN(a))
3291
- return t - a;
3292
- const r = new Date(n), o = new Date(e);
3293
- return !isNaN(r.getTime()) && !isNaN(o.getTime()) ? r.getTime() - o.getTime() : Or.stringInsensitive(n, e);
978
+ function We(l, t) {
979
+ const s = parseFloat(l), e = parseFloat(t);
980
+ if (!isNaN(s) && !isNaN(e))
981
+ return s - e;
982
+ const n = new Date(l), i = new Date(t);
983
+ return !isNaN(n.getTime()) && !isNaN(i.getTime()) ? n.getTime() - i.getTime() : qe.stringInsensitive(l, t);
3294
984
  }
3295
985
  export {
3296
- $t as BaseModal,
3297
- nt as ButtonForm,
3298
- Vr as ChipTag,
3299
- Or as CompareStrategies,
3300
- Cr as DEFAULT_GAP,
3301
- zr as DeleteAccountModal,
3302
- ta as FormErrorList,
3303
- Fa as FormInput,
3304
- kt as FormInputLabel,
3305
- Ur as GlobalModal,
3306
- Kr as HoverCard,
3307
- Rr as InputLabel,
3308
- Hr as LogoutSessionsModal,
3309
- xr as MOBILE_VIEWPORT_OFFSET,
3310
- jr as RelativeHoverCard,
3311
- mt as SCALE_STEP,
3312
- Tr as SWIPE_THRESHOLD,
3313
- Yr as SettingsCard,
3314
- ft as TOAST_LIFE,
3315
- dt as TOAST_WIDTH,
3316
- Wr as TableBase,
3317
- Jn as TablePagination,
3318
- le as TablePaginationButton,
3319
- Jr as ToastController,
3320
- te as ToastState,
3321
- kr as VIEWPORT_OFFSET,
3322
- Ft as VISIBLE_TOASTS_AMOUNT,
3323
- He as Y_OFFSET_STEP,
3324
- vt as Z_STEP,
3325
- Ge as createModalCore,
3326
- Qr as isInputLikeElement,
3327
- es as sortObject,
3328
- ts as sortObjectNew,
3329
- Tt as toast,
3330
- Zr as useClipboard,
3331
- Gr as useDatePicker,
3332
- Za as useForm,
3333
- Xr as useModal,
3334
- qr as useMultiSelect,
3335
- nr as useSelect,
3336
- yr as useSwipeHandler,
3337
- vr as useTable,
3338
- wr as useToastTimer
986
+ qe as CompareStrategies,
987
+ Ye as DEFAULT_GAP,
988
+ $e as MOBILE_VIEWPORT_OFFSET,
989
+ le as SCALE_STEP,
990
+ Ve as SWIPE_THRESHOLD,
991
+ ne as TOAST_LIFE,
992
+ se as TOAST_WIDTH,
993
+ at as ToastController,
994
+ k as ToastState,
995
+ Le as VIEWPORT_OFFSET,
996
+ fe as VISIBLE_TOASTS_AMOUNT,
997
+ q as Y_OFFSET_STEP,
998
+ ie as Z_STEP,
999
+ lt as createModalCore,
1000
+ ot as isInputLikeElement,
1001
+ rt as sortObject,
1002
+ ut as sortObjectNew,
1003
+ Oe as toast,
1004
+ et as useClipboard,
1005
+ Ge as useDatePicker,
1006
+ it as useForm,
1007
+ st as useModal,
1008
+ Qe as useMultiSelect,
1009
+ tt as useSelect,
1010
+ ke as useSwipeHandler,
1011
+ nt as useTable,
1012
+ Ae as useToastTimer
3339
1013
  };