@base-framework/ui 1.2.15 → 1.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4573 @@
1
+ import { I as Y, Span as f, Button as w, OnState as T, Div as o, Legend as nt, Fieldset as at, H4 as Ae, P as k, Label as V, Checkbox as ce, Input as p, Textarea as ot, UseParent as W, Img as de, H5 as lt, H2 as J, Form as rt, Header as Z, Footer as ue, A as Ee, H3 as he, Nav as fe, Ul as X, Li as ge, OnStateOpen as me, On as Q, Dialog as it, Th as Ue, Thead as ct, Tr as dt, Table as xe, Time as ut, H1 as ht } from "@base-framework/atoms";
2
+ import { Atom as r, Jot as M, Component as C, Html as ft, Data as z, Events as L, DateTime as ee, NavLink as gt, router as we, DataTracker as Ye } from "@base-framework/base";
3
+ import { Icons as g } from "./icons.es.js";
4
+ import { Timer as mt, TableBody as xt, DataTableBody as bt, ScrollableTableBody as pt, List as yt } from "@base-framework/organisms";
5
+ import { F as U } from "./format-DE4rFWuD.js";
6
+ import { F as wt } from "./bside-template-C7AQgQ6H.js";
7
+ const vt = {
8
+ xs: "w-4 h-4",
9
+ sm: "w-6 h-6",
10
+ md: "w-8 h-8",
11
+ lg: "w-10 h-10",
12
+ xl: "w-12 h-12",
13
+ "2xl": "w-14 h-14",
14
+ "3xl": "w-16 h-16"
15
+ }, ie = r((e, t) => {
16
+ const s = vt[e.size || "sm"];
17
+ return Y({
18
+ ...e,
19
+ // @ts-ignore
20
+ class: `stroke-current icon-size ${s} ${e.class || ""}`,
21
+ html: t[0]?.textContent
22
+ });
23
+ }), ve = {
24
+ xs: "w-4 h-4",
25
+ // 16px - matches Icon
26
+ sm: "w-6 h-6",
27
+ // 24px - matches Icon
28
+ md: "w-8 h-8",
29
+ // 32px - matches Icon
30
+ lg: "w-10 h-10",
31
+ // 40px - matches Icon
32
+ xl: "w-12 h-12",
33
+ // 48px - matches Icon
34
+ "2xl": "w-14 h-14",
35
+ // 56px - matches Icon
36
+ "3xl": "w-16 h-16"
37
+ // 64px - matches Icon
38
+ }, ke = {
39
+ xs: "16px",
40
+ sm: "24px",
41
+ md: "32px",
42
+ lg: "40px",
43
+ xl: "48px",
44
+ "2xl": "56px",
45
+ "3xl": "64px"
46
+ }, Ce = {
47
+ outlined: "material-symbols-outlined",
48
+ filled: "material-symbols-filled",
49
+ rounded: "material-symbols-rounded",
50
+ sharp: "material-symbols-sharp"
51
+ }, Se = r((e) => {
52
+ const t = e.size || "sm", s = e.variant || "outlined", n = ve[t] || ve.sm, a = ke[t] || ke.sm, l = Ce[s] || Ce.outlined;
53
+ return f({
54
+ ...e,
55
+ // @ts-ignore
56
+ class: `inline-flex items-center justify-center ${l} ${n} ${e.class || ""}`,
57
+ // @ts-ignore
58
+ style: `font-size: ${a}; ${e.style || ""}`,
59
+ // Remove props that shouldn't be passed to the DOM element
60
+ size: void 0,
61
+ variant: void 0,
62
+ name: void 0
63
+ // @ts-ignore
64
+ }, e.name);
65
+ }), b = (e = {}, t) => t ? typeof t == "string" && t.includes("<svg") ? ie(e, t) : typeof t == "object" && t.name ? Se({
66
+ ...e,
67
+ name: t.name,
68
+ variant: t.variant || e.variant || "outlined"
69
+ }) : typeof t == "string" ? Se({
70
+ ...e,
71
+ name: t
72
+ }) : ie(e, t) : null, oa = (e) => e ? !!(typeof e == "object" && e.name || typeof e == "string" && !e.includes("<svg")) : !1, la = (e) => typeof e == "string" && e.includes("<svg"), $e = {
73
+ gray: {
74
+ backgroundColor: "bg-gray-50",
75
+ textColor: "text-gray-600",
76
+ ringColor: "ring-gray-500/10"
77
+ },
78
+ red: {
79
+ backgroundColor: "bg-red-50",
80
+ textColor: "text-red-700",
81
+ ringColor: "ring-red-600/10"
82
+ },
83
+ yellow: {
84
+ backgroundColor: "bg-yellow-50",
85
+ textColor: "text-yellow-800",
86
+ ringColor: "ring-yellow-600/20"
87
+ },
88
+ green: {
89
+ backgroundColor: "bg-green-50",
90
+ textColor: "text-green-700",
91
+ ringColor: "ring-green-600/20"
92
+ },
93
+ blue: {
94
+ backgroundColor: "bg-blue-50",
95
+ textColor: "text-blue-700",
96
+ ringColor: "ring-blue-700/10"
97
+ },
98
+ indigo: {
99
+ backgroundColor: "bg-indigo-50",
100
+ textColor: "text-indigo-700",
101
+ ringColor: "ring-indigo-700/10"
102
+ },
103
+ purple: {
104
+ backgroundColor: "bg-purple-50",
105
+ textColor: "text-purple-700",
106
+ ringColor: "ring-purple-700/10"
107
+ },
108
+ pink: {
109
+ backgroundColor: "bg-pink-50",
110
+ textColor: "text-pink-700",
111
+ ringColor: "ring-pink-700/10"
112
+ },
113
+ primary: {
114
+ backgroundColor: "bg-primary",
115
+ textColor: "text-primary-foreground",
116
+ ringColor: "ring-primary/10"
117
+ },
118
+ secondary: {
119
+ backgroundColor: "bg-secondary",
120
+ textColor: "text-secondary-foreground",
121
+ ringColor: "ring-secondary/10"
122
+ },
123
+ destructive: {
124
+ backgroundColor: "bg-destructive",
125
+ textColor: "text-destructive-foreground",
126
+ ringColor: "ring-destructive/10"
127
+ },
128
+ warning: {
129
+ backgroundColor: "bg-warning",
130
+ textColor: "text-warning-foreground",
131
+ ringColor: "ring-warning/10"
132
+ },
133
+ outline: {
134
+ backgroundColor: "bg-background",
135
+ textColor: "text-primary",
136
+ ringColor: "ring-input"
137
+ },
138
+ ghost: {
139
+ backgroundColor: "bg-background",
140
+ textColor: "text-primary",
141
+ ringColor: "ring-background"
142
+ },
143
+ link: {
144
+ backgroundColor: "bg-background",
145
+ textColor: "text-primary",
146
+ ringColor: "ring-background"
147
+ },
148
+ blur: {
149
+ backgroundColor: "bg-background/40 backdrop-blur-sm",
150
+ textColor: "text-foreground",
151
+ ringColor: "ring-white/10"
152
+ }
153
+ }, kt = (e) => $e[e] || $e.gray, Ct = (e, t = {}) => {
154
+ const s = kt(e), n = t.backgroundColor ?? s.backgroundColor, a = t.textColor ?? s.textColor, l = t.ringColor ?? s.ringColor;
155
+ return `inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors ${n} ${a} ${l}`;
156
+ }, ra = r((e, t) => {
157
+ const { type: s, icon: n, size: a = "xs", backgroundColor: l, textColor: i, ringColor: c, ...u } = e, m = Ct(s, { backgroundColor: l, textColor: i, ringColor: c });
158
+ return f({ ...u, class: m }, [
159
+ n ? b({ size: a, class: "mr-1" }, n) : null,
160
+ ...t || []
161
+ ]);
162
+ });
163
+ class Ve extends C {
164
+ /**
165
+ * This will set the component context.
166
+ *
167
+ * @param {object|null} context
168
+ * @returns {object|null}
169
+ */
170
+ setContext(t) {
171
+ if (this.data)
172
+ return null;
173
+ const s = this?.parent?.data ?? this?.parent?.context?.data ?? this?.parent?.state ?? null;
174
+ return s ? { data: s } : null;
175
+ }
176
+ }
177
+ const O = (e) => (
178
+ /** @type {VeilComponentConstructor} */
179
+ M(e, Ve)
180
+ );
181
+ class ia extends Ve {
182
+ /**
183
+ * Declare public props and their defaults.
184
+ */
185
+ declareProps() {
186
+ this.icon = null, this.activeIcon = null, this.value = null, this.dataKey = null, this.active = !1, this.toggle = null, this.size = "sm", this.formatType = "number";
187
+ }
188
+ /**
189
+ * Set up internal states.
190
+ *
191
+ * @returns {object}
192
+ */
193
+ setupStates() {
194
+ return {
195
+ active: this.active ?? !1
196
+ };
197
+ }
198
+ /**
199
+ * Toggle the active state and fire the callback.
200
+ *
201
+ * @returns {void}
202
+ */
203
+ handleToggle() {
204
+ this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
205
+ }
206
+ /**
207
+ * Render the toggle button.
208
+ *
209
+ * @returns {object}
210
+ */
211
+ render() {
212
+ const t = this.size, s = this.icon, n = this.activeIcon || this.icon, a = (() => {
213
+ if (this.dataKey) {
214
+ let l = `[[${this.dataKey}]]`;
215
+ return this.formatType === "number" ? l = U.number(l, "0") : this.formatType === "money" ? l = U.roundMoney(l) : this.formatType === "date" ? l = U.date(l) : this.formatType === "percent" && (l = U.percentage(l)), f({ class: "toggle-btn-value text-sm tabular-nums capitalize" }, l);
216
+ }
217
+ return this.value !== null && this.value !== void 0 ? f({ class: "toggle-btn-value text-sm tabular-nums" }, String(this.value)) : null;
218
+ })();
219
+ return w({
220
+ click: () => this.handleToggle(),
221
+ // @ts-ignore
222
+ class: `toggle-btn inline-flex items-center gap-1.5 bg-transparent border-0 p-0 cursor-pointer text-foreground/70 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${this.class || ""}`
223
+ }, [
224
+ T(
225
+ "active",
226
+ (l) => b({ size: t }, l ? n : s)
227
+ ),
228
+ a
229
+ ]);
230
+ }
231
+ }
232
+ const ne = {
233
+ xs: "w-6 h-6",
234
+ sm: "w-8 h-8",
235
+ md: "w-10 h-10",
236
+ lg: "w-12 h-12",
237
+ xl: "w-14 h-14",
238
+ "2xl": "w-16 h-16"
239
+ };
240
+ class ca extends C {
241
+ /**
242
+ * Declare public props.
243
+ */
244
+ declareProps() {
245
+ this.icon = null, this.activeIcon = null, this.active = !1, this.size = "md", this.activeClass = "", this.toggle = null;
246
+ }
247
+ /**
248
+ * Set up internal states.
249
+ *
250
+ * @returns {object}
251
+ */
252
+ setupStates() {
253
+ return {
254
+ active: this.active ?? !1
255
+ };
256
+ }
257
+ /**
258
+ * Toggle active state and fire callback.
259
+ *
260
+ * @returns {void}
261
+ */
262
+ handleToggle() {
263
+ this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
264
+ }
265
+ /**
266
+ * Render the circular toggle button.
267
+ *
268
+ * @returns {object}
269
+ */
270
+ render() {
271
+ const t = this.icon, s = this.activeIcon || this.icon, n = ne[this.size] || ne.md, a = ["xs", "sm"].includes(this.size) ? "xs" : "sm", l = this.class ?? "bg-background/40 backdrop-blur-sm", i = "text-foreground", c = this.activeClass || i, u = this.circle ?? !1;
272
+ return w({
273
+ click: () => this.handleToggle(),
274
+ // @ts-ignore
275
+ class: `circle-toggle-btn inline-flex items-center justify-center rounded-full border-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${n} ${l}${u ? " rounded-full w-[40px] h-[40px] max-w-[40px]" : ""}`
276
+ }, [
277
+ T("active", (m) => [
278
+ b({
279
+ size: a,
280
+ class: `transition-colors ${m ? c : i}`
281
+ }, m ? s : t)
282
+ ])
283
+ ]);
284
+ }
285
+ }
286
+ const da = r((e, t) => {
287
+ const s = e.size || "md", n = ne[s] || ne.md, a = ["xs", "sm"].includes(s) ? "xs" : "sm";
288
+ return w({
289
+ ...e,
290
+ // @ts-ignore
291
+ class: `circle-btn inline-flex items-center justify-center rounded-full border-0 bg-background/40 backdrop-blur-sm text-foreground cursor-pointer transition-colors hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${n} ${e.class || ""}`
292
+ }, [
293
+ // @ts-ignore
294
+ e.icon ? b({ size: a }, e.icon) : null,
295
+ ...t || []
296
+ ]);
297
+ }), F = (e) => r((t, s) => w({
298
+ ...e,
299
+ ...t,
300
+ // @ts-ignore
301
+ class: `bttn ${e.class} ${t.class || ""}`
302
+ }, s)), We = r(
303
+ (e, t) => w({
304
+ ...e,
305
+ // @ts-ignore
306
+ class: e.class
307
+ }, [
308
+ // @ts-ignore
309
+ e.icon && e.position !== "right" ? b({ size: e.size || "sm", class: e.animation ?? null }, e.icon) : null,
310
+ ...t || [],
311
+ // @ts-ignore
312
+ e.icon && e.position === "right" ? b({ size: e.size || "sm", class: e.animation ?? null }, e.icon) : null
313
+ ])
314
+ ), De = (e) => r((t, s) => We({
315
+ ...e,
316
+ ...t,
317
+ // @ts-ignore
318
+ class: `bttn ${e.class} ${t.class || ""}`
319
+ }, s)), St = (e) => () => {
320
+ if (e.allowHistory === !0 && globalThis.history.length > 2) {
321
+ globalThis.history.back();
322
+ return;
323
+ }
324
+ e.backUrl && app.navigate(e.backUrl);
325
+ }, $t = (e) => r((t, s) => (t.icon = t.icon || g.arrows.left, t.click = t.click || St(t), We({
326
+ ...e,
327
+ ...t
328
+ }, s))), Dt = r((e, t) => {
329
+ const s = e.size || "md", n = {
330
+ xs: "w-6 h-6",
331
+ sm: "w-8 h-8",
332
+ md: "w-10 h-10",
333
+ lg: "w-12 h-12",
334
+ xl: "w-14 h-14"
335
+ }, a = e.backgroundClass || "bg-background/30 hover:bg-background/50";
336
+ return w({
337
+ ...e,
338
+ // @ts-ignore
339
+ class: `circle-icon-btn inline-flex items-center justify-center rounded-full ${a} text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ring-offset-background transition-colors disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${n[s] || n.md} ${e.class || ""}`
340
+ }, [
341
+ // @ts-ignore
342
+ e.icon ? b({ size: s === "xs" ? "xs" : "sm" }, e.icon) : null,
343
+ ...t || []
344
+ ]);
345
+ }), Ie = {
346
+ primary: F({ class: "primary" }),
347
+ secondary: F({ class: "secondary" }),
348
+ destructive: F({ class: "destructive" }),
349
+ warning: F({ class: "warning" }),
350
+ outline: F({ class: "outline" }),
351
+ ghost: F({ class: "ghost" }),
352
+ link: F({ class: "link" }),
353
+ icon: De({ class: "icon" }),
354
+ withIcon: De({ class: "with-icon" }),
355
+ back: $t({ class: "with-icon back-button" }),
356
+ circleIcon: Dt
357
+ }, x = r((e, t) => (Ie[e.variant] || Ie.primary)(e, t)), ua = r((e, t) => x({ ...e, variant: "withIcon", icon: g.loading, animation: "animate-spin" }, t)), It = r((e, t) => {
358
+ const s = e.margin ?? "my-5 mx-5", n = e.padding ?? "p-4", a = e.border ?? "border-border";
359
+ return e.hover && (e.class += " hover:shadow-lg hover:bg-muted/50"), o({
360
+ ...e,
361
+ // @ts-ignore
362
+ class: `rounded-lg ${a} bg-card text-card-foreground shadow-md min-w-[120px] min-h-[80px] ${s} ${n} ${e.class || ""}`
363
+ }, t);
364
+ }), Tt = r((e, t) => nt({
365
+ ...e,
366
+ // @ts-ignore
367
+ class: ` font-medium -mt-4 -mx-1 px-2 py-2 ${e.class || ""}`
368
+ }, t)), ha = r((e, t) => {
369
+ const s = e.border === "full" ? "border rounded-md" : "border-t";
370
+ return at({
371
+ ...e,
372
+ // @ts-ignore
373
+ class: `p-6 ${s} ${e.class || ""}`
374
+ }, [
375
+ // @ts-ignore
376
+ e.legend && Tt(e.legend),
377
+ o({ class: "flex flex-auto flex-col gap-y-6" }, t)
378
+ ]);
379
+ }), Mt = r((e, t) => {
380
+ const s = e.border === !0 ? "border-t" : "";
381
+ return o({
382
+ ...e,
383
+ // @ts-ignore
384
+ class: `grid grid-cols-1 gap-y-4 sm:grid-cols-[1fr_2fr] sm:gap-x-6 pt-8 ${s} ${e.class || ""}`
385
+ }, [
386
+ // @ts-ignore
387
+ e.label && o({
388
+ // @ts-ignore
389
+ ...e.labelProps,
390
+ // @ts-ignore
391
+ class: `flex flex-auto flex-col gap-y-1 ${e.labelProps?.class || ""}`
392
+ }, [
393
+ // @ts-ignore
394
+ Ae({ class: "text-base" }, e.label),
395
+ // @ts-ignore
396
+ e.description && k({ class: "text-sm text-muted-foreground" }, e.description)
397
+ ]),
398
+ // Controls container: grows to fill remaining space, spacing between items
399
+ o({ class: "flex flex-col gap-y-4" }, t)
400
+ ]);
401
+ }), Bt = "flex h-10 w-full px-3 py-2 text-sm", B = "rounded-md border border-border bg-input", I = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background", D = "disabled:cursor-not-allowed disabled:opacity-50 [&:user-invalid]:border-destructive", H = "placeholder:text-muted-foreground", be = `${Bt} ${B} ${I} ${H} ${D}`, Pt = ({ id: e, checked: t, bind: s, required: n }) => ce({
402
+ id: e,
403
+ cache: "checkbox",
404
+ class: "absolute opacity-0 w-full h-full cursor-pointer pointer-events-none",
405
+ aria: {
406
+ checked: ["checked"]
407
+ },
408
+ required: n,
409
+ checked: t,
410
+ bind: s
411
+ }), zt = () => f({ class: "absolute text-xs pointer-events-none" }, [
412
+ T(
413
+ "checked",
414
+ (e) => e ? Y({
415
+ class: "w-2 h-2 pointer-events-none",
416
+ html: g.check
417
+ }) : null
418
+ )
419
+ ]), Ot = ({ id: e, bind: t, checked: s, required: n, clickHandler: a }) => o({
420
+ class: `relative flex items-center justify-center w-5 h-5 transition-colors duration-200 hover:border-accent-foreground
421
+ rounded-md border
422
+ ${I}
423
+ ${D}`.trim(),
424
+ onState: [
425
+ "checked",
426
+ {
427
+ "bg-primary": !0,
428
+ "text-primary-foreground": !0,
429
+ "border-primary": !0
430
+ }
431
+ ],
432
+ role: "checkbox",
433
+ aria: {
434
+ checked: ["checked"]
435
+ },
436
+ tabIndex: 0,
437
+ click: a
438
+ }, [
439
+ Pt({ bind: t, checked: s, id: e, required: n }),
440
+ zt()
441
+ ]), Nt = ({ id: e, label: t, clickHandler: s }) => V({
442
+ class: "text-base cursor-pointer",
443
+ htmlFor: e,
444
+ click: s
445
+ }, t), Rt = M(
446
+ {
447
+ /**
448
+ * This will initialize the state of the checkbox.
449
+ *
450
+ * @returns {object}
451
+ */
452
+ state() {
453
+ return {
454
+ // @ts-ignore
455
+ checked: this.checked ?? !1
456
+ };
457
+ },
458
+ /**
459
+ * This is added to check the checkbox after the component is rendered
460
+ * to see if the bind updated the checked value.
461
+ *
462
+ * @returns {void}
463
+ */
464
+ after() {
465
+ this.state.checked = this.checkbox.checked;
466
+ },
467
+ /**
468
+ * This will handle the click event for the checkbox.
469
+ *
470
+ * @param {object} e
471
+ * @returns {void}
472
+ */
473
+ clickHandler(e) {
474
+ e.preventDefault(), e.stopPropagation(), this.state.toggle("checked"), this.checkbox.checked = this.state.checked, typeof this.onChange == "function" && this.onChange(this.state.checked, this);
475
+ },
476
+ /**
477
+ * This will render the checkbox component.
478
+ *
479
+ * @returns {object}
480
+ */
481
+ render() {
482
+ const e = this.getId(), t = (s) => this.clickHandler(s);
483
+ return o({ class: `flex items-center gap-x-2 cursor-pointer ${this.class || ""}` }, [
484
+ Ot({
485
+ id: e,
486
+ // @ts-ignore
487
+ bind: this.bind,
488
+ // @ts-ignore
489
+ checked: this.state.checked,
490
+ // @ts-ignore
491
+ required: this.required,
492
+ // @ts-ignore
493
+ clickHandler: t
494
+ }),
495
+ // @ts-ignore
496
+ this.label && Nt({ id: e, label: this.label, clickHandler: t })
497
+ ]);
498
+ }
499
+ }
500
+ ), Ft = (e) => {
501
+ if (!e || e.length === 0) return "";
502
+ const s = e.replace(/\D/g, "").match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/);
503
+ return s ? s[2] ? `(${s[1]}) ${s[2]}${s[3] ? "-" + s[3] : ""}` : s[1] || "" : e;
504
+ }, jt = (e) => {
505
+ const t = e.target, s = Ft(t.value);
506
+ s && (t.value = s);
507
+ }, N = r((e) => p({
508
+ ...e,
509
+ // @ts-ignore
510
+ class: `${be} ${e.class || ""}`.trim()
511
+ })), fa = r((e) => N({
512
+ ...e,
513
+ type: "tel",
514
+ // @ts-ignore
515
+ name: e.name || "Phone",
516
+ // @ts-ignore
517
+ label: e.label || "Phone",
518
+ placeholder: "(555) 555-5555",
519
+ // @ts-ignore
520
+ pattern: e.pattern || "\\(\\d{3}\\) \\d{3}-\\d{4}",
521
+ keyup: jt
522
+ })), ga = r((e) => N({
523
+ ...e,
524
+ type: "email",
525
+ // @ts-ignore
526
+ name: e.name || "Email",
527
+ // @ts-ignore
528
+ label: e.label || "Email",
529
+ placeholder: "Email address"
530
+ })), ma = r((e) => ot({
531
+ ...e,
532
+ as: "textarea",
533
+ // @ts-ignore
534
+ class: `flex w-full h-24 px-3 py-2 text-sm ${B} ${I} ${H} ${D} ${e.class || ""}`.trim()
535
+ })), xa = (e = {}) => o({ class: "flex items-center gap-x-2" }, [
536
+ p({
537
+ ...e,
538
+ type: "radio",
539
+ class: "cursor-pointer appearance-none h-4 w-4 border rounded-full checked:border-primary checked:bg-primary focus:ring focus:ring-primary".trim()
540
+ }),
541
+ e.label && V({ forHTML: e.value, class: "cursor-pointer" }, e.label)
542
+ ]), ba = r((e) => p({
543
+ ...e,
544
+ type: "date",
545
+ // @ts-ignore
546
+ class: `${B} ${I} ${H} ${D} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
547
+ })), pa = r((e) => p({
548
+ ...e,
549
+ type: "time",
550
+ // @ts-ignore
551
+ class: `${B} ${I} ${H} ${D} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
552
+ })), ya = r((e) => p({
553
+ ...e,
554
+ type: "datetime-local",
555
+ // @ts-ignore
556
+ class: `${B} ${I} ${H} ${D} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
557
+ })), wa = r((e) => p({
558
+ ...e,
559
+ type: "month",
560
+ // @ts-ignore
561
+ class: `${B} ${I} ${H} ${D} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
562
+ })), va = r((e) => p({
563
+ ...e,
564
+ type: "week",
565
+ // @ts-ignore
566
+ class: `${B} ${I} ${H} ${D} px-3 py-2 text-sm ring-offset-background ${e.class || ""}`.trim()
567
+ })), ka = r((e) => N({
568
+ ...e,
569
+ type: "number"
570
+ })), Ca = r((e) => N({
571
+ ...e,
572
+ type: "password"
573
+ }));
574
+ r((e) => N({
575
+ ...e,
576
+ type: "search"
577
+ }));
578
+ const Sa = r((e) => N({
579
+ ...e,
580
+ type: "url"
581
+ })), $a = r((e) => N({
582
+ ...e,
583
+ type: "hidden"
584
+ })), Da = r((e) => p({
585
+ ...e,
586
+ type: "color",
587
+ // @ts-ignore
588
+ class: `${B} text-foreground p-0 ${D} ${e.class || ""}`.trim()
589
+ }));
590
+ r((e) => ce({
591
+ ...e,
592
+ // @ts-ignore
593
+ class: `flex h-4 w-4 text-foreground ${B} ${I} ${D} ${e.class || ""}`.trim()
594
+ }));
595
+ const Lt = "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", Ia = r((e) => p({
596
+ ...e,
597
+ type: "file",
598
+ // @ts-ignore
599
+ class: `${be} ${Lt} ${e.class || ""}`.trim()
600
+ })), Ta = O(
601
+ {
602
+ /**
603
+ * This will create the initial state of the RangeSlider.
604
+ *
605
+ * @returns {object}
606
+ */
607
+ state() {
608
+ return {
609
+ value: this.value ?? 0,
610
+ min: this.min ?? 0,
611
+ max: this.max ?? 100,
612
+ filledPercentage: this.getFillPercentage(this.value)
613
+ };
614
+ },
615
+ /**
616
+ * This will get the fill percentage of the range slider.
617
+ *
618
+ * @param {number} value
619
+ * @returns {number}
620
+ */
621
+ getFillPercentage(e) {
622
+ return (e - this.min) / (this.max - this.min) * 100;
623
+ },
624
+ /**
625
+ * This will render the RangeSlider component.
626
+ *
627
+ * @returns {object}
628
+ */
629
+ render() {
630
+ return o({ class: "relative w-full h-4 flex items-center" }, [
631
+ // Track
632
+ o({ class: "absolute h-2 w-full rounded-full bg-muted" }),
633
+ W(({ state: e }) => [
634
+ // Filled Track
635
+ o({
636
+ class: "absolute h-2 bg-primary rounded-full",
637
+ style: ["width: [[filledPercentage]]%", e]
638
+ }),
639
+ // Thumb
640
+ o({
641
+ class: `
642
+ absolute block h-5 w-5 rounded-full border-2 border-primary bg-background
643
+ ring-offset-background transition-colors focus-visible:outline-none
644
+ focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
645
+ disabled:pointer-events-none disabled:opacity-50 transform -translate-x-1/2
646
+ `.trim(),
647
+ style: ["left: [[filledPercentage]]%", e]
648
+ }),
649
+ // Hidden Range Input
650
+ p({
651
+ type: "range",
652
+ min: ["[[min]]", e],
653
+ max: ["[[max]]", e],
654
+ value: ["[[value]]", e],
655
+ // Incorporate your new classes here
656
+ class: `
657
+ absolute w-full h-full opacity-0 cursor-pointer
658
+ ${I}
659
+ ${D}
660
+ ${this.class || ""}
661
+ `.trim(),
662
+ bind: this.bind,
663
+ input: (t) => {
664
+ const s = Number(t.target.value);
665
+ this.state.value = s, this.state.filledPercentage = this.getFillPercentage(s), typeof this.change == "function" && this.change(s);
666
+ }
667
+ })
668
+ ])
669
+ ]);
670
+ }
671
+ }
672
+ ), Ma = r((e) => ({
673
+ tag: "select",
674
+ onCreated(t) {
675
+ e.options && ft.setupSelectOptions(t, e.options);
676
+ },
677
+ ...e,
678
+ // @ts-ignore
679
+ class: `${be} ${e.class || ""}`.trim()
680
+ })), Ht = r(({ src: e, alt: t, class: s, checkPath: n = !0 }) => !e || (s = s || "", n && e.indexOf(".") === -1 && e.indexOf("[[") === -1) ? null : de({
681
+ class: `absolute w-full h-full object-cover fadeIn ${s}`,
682
+ src: e,
683
+ alt: t,
684
+ load: (a) => a.target.style.visibility = "visible",
685
+ /**
686
+ * If there's an error loading the image, hide it.
687
+ */
688
+ error: (a) => a.target.style.visibility = "hidden"
689
+ })), At = (e) => !e || isNaN(e) ? null : e, Te = (e, t) => {
690
+ const s = e, n = 16, a = 2 * Math.PI * n, l = s / 100 * a, i = `
691
+ <svg class="w-40 h-40 mx-auto" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
692
+ <!-- Background Circle -->
693
+ <circle
694
+ cx="18"
695
+ cy="18"
696
+ r="${n}"
697
+ fill="none"
698
+ stroke="currentColor"
699
+ stroke-width="4"
700
+ class="bg-muted"
701
+ stroke-opacity="0.2"
702
+ />
703
+ <!-- Progress Circle -->
704
+ <circle
705
+ cx="18"
706
+ cy="18"
707
+ r="${n}"
708
+ fill="none"
709
+ stroke="currentColor"
710
+ stroke-width="4"
711
+ class="stroke-primary"
712
+ stroke-dasharray="${a}"
713
+ stroke-dashoffset="${a - l}"
714
+ stroke-linecap="round"
715
+ class="${t}"
716
+ />
717
+ <!-- Percentage Text -->
718
+ <text
719
+ x="18"
720
+ y="20"
721
+ class="text-[0.25em] font-medium fill-primary"
722
+ text-anchor="middle"
723
+ dominant-baseline="middle">
724
+ ${s}%
725
+ </text>
726
+ </svg>
727
+ `;
728
+ return o({
729
+ class: "circle-graph text-inherit",
730
+ html: i
731
+ });
732
+ }, Ba = r((e) => {
733
+ const t = e.progress || 0, s = e.class || "", n = Te(t, s);
734
+ return o({
735
+ class: "circle-graph-wrap",
736
+ onSet: [
737
+ // @ts-ignore
738
+ e.prop,
739
+ (a) => (a = At(a), a ? Te(a, s) : n)
740
+ ]
741
+ }, [n]);
742
+ }), Et = () => W(({ state: e }) => o({
743
+ class: "absolute h-full rounded-full bg-primary transition-all duration-300",
744
+ style: ["width: [[progress]]%;", e]
745
+ })), Pa = O(
746
+ {
747
+ /**
748
+ * This will render the progress bar component.
749
+ *
750
+ * @returns {object}
751
+ */
752
+ render() {
753
+ return o({ class: "relative w-full h-4 rounded-full bg-muted" }, [
754
+ Et()
755
+ ]);
756
+ },
757
+ /**
758
+ * This will initialize the state.
759
+ *
760
+ * @returns {object}
761
+ */
762
+ state() {
763
+ return {
764
+ progress: this.progress ?? 0
765
+ };
766
+ },
767
+ /**
768
+ * This will reset the progress bar.
769
+ *
770
+ * @returns {void}
771
+ */
772
+ reset() {
773
+ this.state.progress = 0;
774
+ },
775
+ /**
776
+ * This will update the progress bar from a file upload.
777
+ *
778
+ * @param {object} evt
779
+ * @returns {void}
780
+ */
781
+ uploadProgress(e) {
782
+ if (e.lengthComputable) {
783
+ const s = Math.round(e.loaded * 100 / e.total);
784
+ this.set(s);
785
+ }
786
+ },
787
+ /**
788
+ * This will set the progress of the progress bar.
789
+ *
790
+ * @param {number} progress
791
+ * @returns {void}
792
+ */
793
+ set(e) {
794
+ e < 0 && (e = 0), e > 100 && (e = 100), this.state.progress = e;
795
+ }
796
+ }
797
+ ), za = r((e = {}) => {
798
+ const {
799
+ class: t = "",
800
+ background: s = !0,
801
+ blur: n = !0,
802
+ backgroundClass: a = "bg-background/95",
803
+ blurClass: l = "backdrop-blur",
804
+ zIndexClass: i = "z-9999",
805
+ style: c = ""
806
+ } = e, u = [
807
+ "sticky bottom-0 left-0 right-0 w-full",
808
+ i,
809
+ s ? a : "",
810
+ n ? l : "",
811
+ t
812
+ ].filter(Boolean).join(" "), m = `height: env(safe-area-inset-bottom, 0px);${c ? ` ${c}` : ""}`;
813
+ return o({
814
+ class: u,
815
+ style: m,
816
+ "aria-hidden": "true"
817
+ });
818
+ }), Oa = r((e = {}) => {
819
+ const {
820
+ class: t = "",
821
+ background: s = !0,
822
+ blur: n = !0,
823
+ backgroundClass: a = "bg-background/95",
824
+ blurClass: l = "backdrop-blur",
825
+ zIndexClass: i = "z-9999",
826
+ style: c = ""
827
+ } = e, u = [
828
+ "fixed top-0 left-0 right-0 w-full",
829
+ i,
830
+ s ? a : "",
831
+ n ? l : "",
832
+ t
833
+ ].filter(Boolean).join(" "), m = `height: env(safe-area-inset-top, 0px);${c ? ` ${c}` : ""}`;
834
+ return o({
835
+ class: u,
836
+ style: m,
837
+ "aria-hidden": "true"
838
+ });
839
+ }), Me = {
840
+ top: "bottom-full left-1/2 transform -translate-x-1/2 mb-2",
841
+ "top-right": "bottom-full left-full transform -translate-x-1 mb-2",
842
+ "top-left": "bottom-full right-full transform translate-x-1 mb-2",
843
+ bottom: "top-full left-1/2 transform -translate-x-1/2 mt-2",
844
+ "bottom-right": "top-full left-full transform -translate-x-1 mt-2",
845
+ "bottom-left": "top-full right-full transform translate-x-1 mt-2",
846
+ left: "top-1/2 right-full transform -translate-y-1/2 mr-2",
847
+ right: "top-1/2 left-full transform -translate-y-1/2 ml-2"
848
+ }, Ut = (e) => Me[String(e)] || Me.top, Na = r(({ position: e = "top", content: t }, s) => {
849
+ const n = Ut(e);
850
+ return Array.isArray(s) === !1 && (s = [s]), o({ class: "relative group inline-block" }, [
851
+ ...s,
852
+ // Tooltip box
853
+ f({
854
+ class: `
855
+ absolute z-20 px-2 py-1 border text-sm bg-background rounded shadow-md opacity-0 whitespace-nowrap
856
+ group-hover:opacity-100 transition-opacity duration-200 ${n} pointer-events-none
857
+ `
858
+ }, t)
859
+ ]);
860
+ }), Be = {
861
+ info: {
862
+ borderColor: "border-blue-500",
863
+ bgColor: "bg-muted/10",
864
+ iconColor: "text-blue-500"
865
+ },
866
+ warning: {
867
+ bgColor: "bg-muted/10",
868
+ borderColor: "border-warning",
869
+ iconColor: "text-warning"
870
+ },
871
+ destructive: {
872
+ bgColor: "bg-muted/10",
873
+ borderColor: "border-destructive",
874
+ iconColor: "text-red-500"
875
+ },
876
+ success: {
877
+ bgColor: "bg-muted/10",
878
+ borderColor: "border-emerald-500",
879
+ iconColor: "text-emerald-500"
880
+ },
881
+ default: {
882
+ borderColor: "border",
883
+ bgColor: "bg-muted/10",
884
+ iconColor: "text-muted-foreground"
885
+ }
886
+ }, Yt = (e, t) => o({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
887
+ b({ size: "sm" }, e)
888
+ ]), Vt = (e) => lt({ class: "font-semibold" }, e), Wt = (e) => k({ class: "text-sm text-muted-foreground" }, e), Ra = r(({ title: e, description: t, icon: s, type: n = "default" }) => {
889
+ const { borderColor: a, bgColor: l, iconColor: i } = Be[n] || Be.default;
890
+ return o({ class: `flex items-start p-4 border rounded-lg ${l} ${a}` }, [
891
+ // Icon and content
892
+ s && Yt(s, i),
893
+ o({ class: "flex flex-col" }, [
894
+ Vt(e),
895
+ Wt(t)
896
+ ])
897
+ ]);
898
+ }), qt = (e, t) => {
899
+ const s = e ? e.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, n = t.getBoundingClientRect(), a = 10, l = globalThis.scrollX, i = globalThis.scrollY;
900
+ let c = s.left + l, u = s.bottom + i;
901
+ const m = globalThis.innerHeight - s.bottom, v = s.top;
902
+ return c + n.width > globalThis.innerWidth && (c = globalThis.innerWidth - n.width - a), m < n.height && v > m ? u = s.top + i - n.height - a : m < n.height && (u = s.bottom + i - (n.height - m) - a), { x: c, y: u };
903
+ };
904
+ class te extends C {
905
+ /**
906
+ * This will set up the data.
907
+ *
908
+ * @returns {object}
909
+ */
910
+ setData() {
911
+ const t = this.parent.data || new z();
912
+ return t.set({
913
+ position: { x: 0, y: 0 }
914
+ }), t;
915
+ }
916
+ /**
917
+ * This will get the class size.
918
+ *
919
+ * @returns {string}
920
+ */
921
+ getSize() {
922
+ switch (this.size || "lg") {
923
+ // @ts-ignore
924
+ case "sm":
925
+ return "w-48";
926
+ // @ts-ignore
927
+ case "md":
928
+ return "w-64";
929
+ case "lg":
930
+ return "w-[250px]";
931
+ // @ts-ignore
932
+ case "xl":
933
+ return "w-96";
934
+ // @ts-ignore
935
+ case "2xl":
936
+ return "w-[400px]";
937
+ // @ts-ignore
938
+ case "fit":
939
+ return "w-fit";
940
+ // @ts-ignore
941
+ case "full":
942
+ return "w-full";
943
+ }
944
+ }
945
+ /**
946
+ * This will render the modal component.
947
+ *
948
+ * @returns {object}
949
+ */
950
+ render() {
951
+ const t = this.getSize();
952
+ return o({
953
+ class: `absolute inset-auto fadeIn mt-2 rounded-md p-0 shadow-lg bg-popover min-h-12 backdrop:bg-transparent text-inherit r z-30 ${t}`,
954
+ popover: "manual",
955
+ toggle: (s, { state: n }) => s.newState === "closed" ? n.open = !1 : null,
956
+ style: "top: [[position.y]]px; left: [[position.x]]px"
957
+ // @ts-ignore
958
+ }, this.children);
959
+ }
960
+ /**
961
+ * This will setup the states.
962
+ *
963
+ * @returns {object}
964
+ */
965
+ setupStates() {
966
+ return {
967
+ open: {
968
+ id: this.parent.getId(),
969
+ callBack: (n) => {
970
+ this.state.open === !1 && this.destroy();
971
+ }
972
+ }
973
+ };
974
+ }
975
+ /**
976
+ * Updates the dropdown position.
977
+ *
978
+ * @returns {void}
979
+ */
980
+ updatePosition() {
981
+ const t = this.button ?? null, s = this.panel, n = qt(t, s);
982
+ this.data.position = n;
983
+ }
984
+ /**
985
+ * This will run after the setup.
986
+ *
987
+ * @returns {void}
988
+ */
989
+ afterSetup() {
990
+ this.panel.showPopover(), this.updatePosition();
991
+ }
992
+ /**
993
+ * This will check if the element clicked was in the
994
+ * component of the button.
995
+ *
996
+ * @param {object} element
997
+ * @returns {boolean}
998
+ */
999
+ isOutsideClick(t) {
1000
+ return !this.panel.contains(t) && this.button && !this.button.contains(t);
1001
+ }
1002
+ /**
1003
+ * This will set up the events.
1004
+ *
1005
+ * @returns {array}
1006
+ */
1007
+ setupEvents() {
1008
+ return [
1009
+ ["click", document, (t) => {
1010
+ this.isOutsideClick(t.target) && (this.state.open = !1);
1011
+ }],
1012
+ ["resize", globalThis, (t) => this.updatePosition()],
1013
+ ["scroll", document, (t) => this.updatePosition()]
1014
+ ];
1015
+ }
1016
+ /**
1017
+ * This will override the set up to use the app shell.
1018
+ *
1019
+ * @param {object} container
1020
+ */
1021
+ setContainer(t) {
1022
+ this.container = app.root;
1023
+ }
1024
+ /**
1025
+ * This will hide the popover before destroying.
1026
+ *
1027
+ * @returns {void}
1028
+ */
1029
+ beforeDestroy() {
1030
+ this?.panel?.hidePopover();
1031
+ }
1032
+ }
1033
+ const Gt = r((e, t) => o({ ...e, class: "flex flex-auto flex-col gap-y-2" }, t)), _t = r((e, t) => V({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), Kt = r((e, t) => k({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Qt = r((e, t) => k({ ...e, class: "text-sm text-destructive" }, t)), Fa = r((e, t = []) => It({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
1034
+ // @ts-ignore
1035
+ e.title && J({ class: "text-lg font-semibold py-4 px-6" }, e.title),
1036
+ // @ts-ignore
1037
+ e.description && k({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, e.description),
1038
+ ...t
1039
+ ])), ja = r((e, t = []) => (
1040
+ // @ts-ignore
1041
+ Mt({ label: e.label, description: e.description, class: "py-4 px-6", border: e.border }, [
1042
+ o({ class: "flex flex-col gap-y-6" }, t)
1043
+ ])
1044
+ )), La = r((e, t = []) => {
1045
+ const s = e.border ? "border-t" : "";
1046
+ return o({ ...e, class: `flex flex-col pb-4 px-6 gap-y-4 ${s} ${e.class || ""}` }, t);
1047
+ }), Jt = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", qe = (e, t, s) => e.map((n) => !n || (n.children && n.children.length > 0 && (n.children = qe(n.children, t, s)), !n.required) ? n : Jt(n) ? {
1048
+ ...n,
1049
+ aria: {
1050
+ invalid: ["hasError"]
1051
+ },
1052
+ invalid: s,
1053
+ input: t
1054
+ } : n), Zt = r((e, t) => {
1055
+ const a = qe(t, (l) => {
1056
+ l.target.checkValidity() && e.setError(null);
1057
+ }, (l) => {
1058
+ e.setError(l.target.validationMessage);
1059
+ });
1060
+ return o({
1061
+ ...e,
1062
+ class: "w-full"
1063
+ }, a);
1064
+ }), Ha = O(
1065
+ {
1066
+ /**
1067
+ * The initial state of the FormField.
1068
+ *
1069
+ * @member {object} state
1070
+ * @returns {object}
1071
+ */
1072
+ state() {
1073
+ return {
1074
+ error: null,
1075
+ hasError: !1,
1076
+ value: this.defaultValue ?? ""
1077
+ };
1078
+ },
1079
+ /**
1080
+ * Renders the FormField component.
1081
+ *
1082
+ * @returns {object}
1083
+ */
1084
+ render() {
1085
+ const e = this.name, t = this.getId(`${e}`), { label: s, description: n } = this, a = (l) => {
1086
+ this.state.error = l, this.state.hasError = !!l;
1087
+ };
1088
+ return o({ class: "flex flex-auto gap-y-4" }, [
1089
+ Gt([
1090
+ _t({ htmlFor: t }, s),
1091
+ Zt({
1092
+ id: t,
1093
+ name: e,
1094
+ value: this.state.value,
1095
+ setError: a
1096
+ }, this.children),
1097
+ n && Kt({ id: this.getId("description") }, n),
1098
+ o({ onState: ["error", (l) => l && Qt(l)] })
1099
+ ])
1100
+ ]);
1101
+ }
1102
+ }
1103
+ ), Xt = (e, t, s = null) => {
1104
+ e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
1105
+ }, Ge = r(
1106
+ (e, t) => (
1107
+ // @ts-ignore
1108
+ rt({ ...e, submit: (s, n) => Xt(s, n, e.submit), class: `w-full ${e.class ?? ""}` }, t)
1109
+ )
1110
+ ), Aa = r((e, t) => (
1111
+ // @ts-ignore
1112
+ o({ ...e, class: `flex flex-auto flex-col gap-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)
1113
+ )), Ea = r((e, t = []) => o({ class: "flex flex-col gap-y-3 py-4" }, [
1114
+ // @ts-ignore
1115
+ e.title && J({ class: "font-semibold" }, e.title),
1116
+ ...t
1117
+ ])), Ua = (e, t) => o({ class: "flex justify-between" }, [
1118
+ f({ class: "text-muted-foreground" }, e),
1119
+ f(t)
1120
+ ]), Ya = (e, t) => o({ class: "flex" }, [
1121
+ f({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
1122
+ f(t)
1123
+ ]), es = r(({ title: e, description: t, back: s, icon: n, options: a = [] }) => Z({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10 min-w-0" }, [
1124
+ /**
1125
+ * Back Button (Mobile Only)
1126
+ */
1127
+ s && x({
1128
+ variant: "icon",
1129
+ icon: g.arrows.left,
1130
+ class: "mr-2 p-0 flex sm:hidden",
1131
+ click: (l, i) => i.close()
1132
+ }),
1133
+ /**
1134
+ * Icon Container
1135
+ */
1136
+ n && o({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
1137
+ b({ size: "md" }, n)
1138
+ ]),
1139
+ o({ class: "flex flex-auto flex-row justify-between ml-2 gap-2 min-w-0" }, [
1140
+ o({ class: "flex flex-auto flex-col min-w-0" }, [
1141
+ J({ class: "text-lg font-semibold m-0 truncate" }, e),
1142
+ t && o({ class: "text-sm text-muted-foreground truncate" }, t)
1143
+ ]),
1144
+ o({ class: "flex flex-none items-center gap-2" }, a)
1145
+ ])
1146
+ ])), Va = r((e, t) => {
1147
+ const s = e.class?.includes("drawer");
1148
+ return o({
1149
+ popover: "manual",
1150
+ // @ts-ignore
1151
+ class: `modal ${s ? "" : "m-auto top-0 right-0 bottom-0 left-0"} ${s ? "" : "h-full max-h-screen"} fixed z-20 grid w-full gap-2 lg:border bg-background text-foreground shadow-xl wrap-break-words p-0 overflow-y-auto ${e.class}`,
1152
+ click: (l, i) => {
1153
+ l.target === i.panel && (l.preventDefault(), l.stopPropagation(), i.state.open = !1);
1154
+ }
1155
+ }, [
1156
+ Ge({
1157
+ class: "modal-content relative bg-background z-1 flex flex-auto flex-col gap-y-4 min-w-0",
1158
+ // @ts-ignore
1159
+ submit: (l, i) => e.onSubmit && e.onSubmit(i),
1160
+ cache: "modalContent",
1161
+ // @ts-ignore
1162
+ ...e.gestureHandlers
1163
+ }, [
1164
+ es(e),
1165
+ o({ class: "modal-body flex grow flex-col py-0 px-6 z-0", cache: "modalBody" }, t),
1166
+ // @ts-ignore
1167
+ !e.hideFooter && ue({ class: "modal-footer sticky bottom-0 bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
1168
+ ])
1169
+ ]);
1170
+ }), Pe = {
1171
+ info: {
1172
+ bgColor: "bg-muted/10",
1173
+ borderColor: "border-blue-500",
1174
+ iconColor: "text-blue-500"
1175
+ },
1176
+ warning: {
1177
+ bgColor: "bg-muted/10",
1178
+ borderColor: "border-warning",
1179
+ iconColor: "text-warning"
1180
+ },
1181
+ destructive: {
1182
+ bgColor: "bg-muted/10",
1183
+ borderColor: "border-destructive",
1184
+ iconColor: "text-red-500"
1185
+ },
1186
+ success: {
1187
+ bgColor: "bg-muted/10",
1188
+ borderColor: "border-emerald-500",
1189
+ iconColor: "text-emerald-500"
1190
+ },
1191
+ default: {
1192
+ bgColor: "bg-muted/10",
1193
+ borderColor: "border",
1194
+ iconColor: "text-muted-foreground"
1195
+ }
1196
+ }, ts = (e) => Z({ class: "flex justify-center" }, [
1197
+ he({ class: "text-lg font-bold mb-0" }, e)
1198
+ ]), ss = r(({ href: e, class: t }, s) => Ee({
1199
+ class: `bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
1200
+ href: e,
1201
+ animateIn: "pullRightIn",
1202
+ animateOut: "pullRight",
1203
+ role: "alert"
1204
+ }, s)), ns = r(({ close: e, class: t }, s) => o({
1205
+ class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
1206
+ click: () => e(),
1207
+ animateIn: "pullRightIn",
1208
+ animateOut: "pullRight",
1209
+ role: "alert"
1210
+ }, s));
1211
+ class Wa extends C {
1212
+ /**
1213
+ * This will declare the props for the compiler.
1214
+ *
1215
+ * @returns {void}
1216
+ */
1217
+ declareProps() {
1218
+ this.secondaryAction = null, this.primaryAction = null, this.primary = !1, this.secondary = !1, this.title = null, this.description = null, this.icon = null, this.onClick = null;
1219
+ }
1220
+ /**
1221
+ * This will be called when the component is created.
1222
+ *
1223
+ * @returns {void}
1224
+ */
1225
+ onCreated() {
1226
+ this.duration = this.duration || 4e3;
1227
+ }
1228
+ /**
1229
+ * This will render the component.
1230
+ *
1231
+ * @returns {object}
1232
+ */
1233
+ render() {
1234
+ const { bgColor: t, borderColor: s, iconColor: n } = this.getTypeStyles(), a = this.href || null, l = this.getChildren(n);
1235
+ return a ? ss({
1236
+ href: a,
1237
+ class: `${t} ${s}`
1238
+ }, l) : ns({
1239
+ close: this.close.bind(this),
1240
+ class: `${t} ${s}`
1241
+ }, l);
1242
+ }
1243
+ /**
1244
+ * This will be called after the component is set up.
1245
+ *
1246
+ * @returns {void}
1247
+ */
1248
+ afterSetup() {
1249
+ const t = this.duration;
1250
+ t !== "infinite" && (this.timer = new mt(t, this.close.bind(this)), this.timer.start());
1251
+ }
1252
+ /**
1253
+ * This will get the style properties based on the notification type.
1254
+ *
1255
+ * @returns {object}
1256
+ */
1257
+ getTypeStyles() {
1258
+ const t = this.type || "default";
1259
+ return Pe[t] || Pe.default;
1260
+ }
1261
+ /**
1262
+ * This will get the buttons for the notification.
1263
+ *
1264
+ * @returns {array}
1265
+ */
1266
+ getButtons() {
1267
+ return [
1268
+ o({ class: "flex flex-row mt-6 gap-2" }, [
1269
+ this.secondary && x({ variant: "outline", click: () => this.secondaryAction && this.secondaryAction() }, this.secondary),
1270
+ this.primary && x({ click: () => this.primaryAction && this.primaryAction() }, this.primary)
1271
+ ])
1272
+ ];
1273
+ }
1274
+ /**
1275
+ * This will get the children for the notification.
1276
+ *
1277
+ * @param {string} iconColor
1278
+ * @returns {array}
1279
+ */
1280
+ getChildren(t) {
1281
+ return [
1282
+ o({ class: "flex items-start" }, [
1283
+ this.icon && o({ class: `mr-4 ${t}` }, [
1284
+ b({ size: "md" }, this.icon)
1285
+ ]),
1286
+ o({ class: "flex flex-auto flex-col" }, [
1287
+ o({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
1288
+ this.title && ts(this.title)
1289
+ ]),
1290
+ k({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
1291
+ (this.primary || this.secondary) && ue({ class: "margin-top-24 flex align-center" }, this.getButtons())
1292
+ ])
1293
+ ]),
1294
+ x({
1295
+ class: "absolute top-[12px] right-[12px]",
1296
+ variant: "icon",
1297
+ icon: g.x,
1298
+ click: this.close.bind(this)
1299
+ })
1300
+ ];
1301
+ }
1302
+ /**
1303
+ * This will close the notification.
1304
+ *
1305
+ * @param {object} e The event object.
1306
+ * @returns {void}
1307
+ */
1308
+ close(t) {
1309
+ t && t.stopPropagation(), this.duration !== "infinite" && this.timer.stop(), this.onClick && this.onClick(), this.destroy();
1310
+ }
1311
+ }
1312
+ const ze = globalThis.matchMedia, ae = r(({ value: e, label: t, icon: s }) => w({
1313
+ class: 'text-sm gap-1 font-medium leading-none disabled:cursor-not-allowed disabled:opacity-70 flex flex-col items-center justify-between rounded-md border-2 bg-popover p-4 hover:bg-accent hover:text-accent-foreground data-[state="active"]:border-primary [&:has([data-state="active"])]:border-primary',
1314
+ onState: ["method", { active: e }],
1315
+ dataSet: ["method", ["state", e, "active"]],
1316
+ click: (n, { state: a }) => {
1317
+ a.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), as(e);
1318
+ }
1319
+ }, [
1320
+ b({}, s),
1321
+ f(t)
1322
+ ])), as = (e) => {
1323
+ const t = document.documentElement;
1324
+ if (e === "system" && (e = globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"), ze && !ze("(prefers-color-scheme: " + e + ")").matches) {
1325
+ t.classList.add(e);
1326
+ return;
1327
+ }
1328
+ const s = e === "light" ? "dark" : "light";
1329
+ t.classList.remove(s);
1330
+ }, qa = M(
1331
+ {
1332
+ /**
1333
+ * This will render the component.
1334
+ *
1335
+ * @returns {object}
1336
+ */
1337
+ render() {
1338
+ return o({ class: "flex flex-auto flex-col" }, [
1339
+ o({ class: "grid grid-cols-3 gap-4" }, [
1340
+ ae({ label: "System", value: "system", icon: g.adjustments.horizontal }),
1341
+ ae({ label: "Light", value: "light", icon: g.sun }),
1342
+ ae({ label: "Dark", value: "dark", icon: g.moon })
1343
+ ])
1344
+ ]);
1345
+ },
1346
+ /**
1347
+ * This will setup the states.
1348
+ *
1349
+ * @returns {object}
1350
+ */
1351
+ state() {
1352
+ return {
1353
+ method: globalThis.localStorage.getItem("theme") ?? "system"
1354
+ };
1355
+ }
1356
+ }
1357
+ ), Ga = O(
1358
+ {
1359
+ /**
1360
+ * The initial state of the Toggle.
1361
+ *
1362
+ * @returns {object}
1363
+ */
1364
+ state() {
1365
+ return {
1366
+ active: this.active ?? !1
1367
+ };
1368
+ },
1369
+ /**
1370
+ * This is added to check the checkbox after the component is rendered.
1371
+ * to see if the bind updated the checked value.
1372
+ *
1373
+ * @returns {void}
1374
+ */
1375
+ after() {
1376
+ this.state.active = this.checkbox.checked;
1377
+ },
1378
+ /**
1379
+ * Renders the Toggle component.
1380
+ *
1381
+ * @returns {object}
1382
+ */
1383
+ render() {
1384
+ return w({
1385
+ class: "relative inline-flex h-6 w-11 min-w-11 items-center rounded-full bg-muted transition-colors focus:outline-none",
1386
+ onState: ["active", { "bg-primary": !0, "bg-muted": !1 }],
1387
+ click: (t, { state: s }) => {
1388
+ s.toggle("active"), this.checkbox.checked = s.active, this.change && this.change(s.active, t, this);
1389
+ }
1390
+ }, [
1391
+ ce({
1392
+ cache: "checkbox",
1393
+ class: "opacity-0 absolute top-0 left-0 bottom-0 right-0 w-full h-full",
1394
+ /**
1395
+ * This will add the default checked before binding.
1396
+ * If binding it will override the default checked value.
1397
+ */
1398
+ checked: this.state.active,
1399
+ bind: this.bind,
1400
+ required: this.required
1401
+ }),
1402
+ f({
1403
+ class: "absolute h-5 w-5 bg-background rounded-full shadow-md transform transition-transform",
1404
+ onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
1405
+ })
1406
+ ]);
1407
+ }
1408
+ }
1409
+ ), os = r(({ src: e, alt: t }) => !e || e.indexOf(".") === -1 && e.indexOf("[[") === -1 ? null : Ht({
1410
+ src: e,
1411
+ alt: t,
1412
+ class: "rounded-full"
1413
+ })), ls = (e) => e && (Array.isArray(e) && (e = e.join(" ")), typeof e != "string" && (e = String(e)), e.split(" ").map((t) => t.charAt(0)).join("").toUpperCase()), _e = (e) => !e || e.length < 2 ? e : ls(e), rs = (e) => f([e, (t, s) => {
1414
+ s.textContent = _e(t);
1415
+ }]), Oe = {
1416
+ xs: "h-6 w-6",
1417
+ sm: "h-8 w-8",
1418
+ md: "h-12 w-12",
1419
+ lg: "h-16 w-16",
1420
+ xl: "h-24 w-24",
1421
+ "2xl": "h-32 w-32",
1422
+ "3xl": "h-48 w-48",
1423
+ "4xl": "h-64 w-64",
1424
+ default: "h-12 w-12"
1425
+ }, Ne = {
1426
+ xs: "text-[7px]",
1427
+ sm: "text-xs",
1428
+ md: "text-base",
1429
+ lg: "text-xl",
1430
+ xl: "text-2xl",
1431
+ "2xl": "text-3xl",
1432
+ "3xl": "text-4xl",
1433
+ "4xl": "text-5xl",
1434
+ default: "text-base"
1435
+ }, is = (e) => Oe[e] || Oe.default, cs = (e) => Ne[e] || Ne.default, ds = (e, t = null, s = "md") => {
1436
+ const n = _e(String(e)), a = cs(s);
1437
+ return o(
1438
+ {
1439
+ class: `
1440
+ flex items-center justify-center w-full h-full rounded-full
1441
+ bg-muted text-muted-foreground font-medium
1442
+ ${a}
1443
+ `
1444
+ },
1445
+ [
1446
+ t ? rs(t) : f({ class: "uppercase" }, n)
1447
+ ]
1448
+ );
1449
+ }, us = r(({ src: e, alt: t, fallbackText: s, watcherFallback: n, size: a }) => {
1450
+ const l = is(a);
1451
+ return o(
1452
+ {
1453
+ class: `relative flex items-center justify-center ${l}`
1454
+ },
1455
+ [
1456
+ os({ src: e, alt: t }),
1457
+ ds(s, n, a)
1458
+ ]
1459
+ );
1460
+ }), hs = (e) => e.indexOf(".") === -1 && e.indexOf("[[") === -1 && e.indexOf("blob:") === -1, _a = M(
1461
+ {
1462
+ /**
1463
+ * Get the initial state for the component.
1464
+ *
1465
+ * @returns {object} Initial state for the component
1466
+ */
1467
+ state() {
1468
+ return {
1469
+ // @ts-ignore
1470
+ loaded: !!this.src
1471
+ };
1472
+ },
1473
+ /**
1474
+ * This will open the file browse dialog.
1475
+ *
1476
+ * @returns {void}
1477
+ */
1478
+ openFileBrowse() {
1479
+ const e = this.input;
1480
+ e && (e.value = "", L.trigger("click", e));
1481
+ },
1482
+ /**
1483
+ * Get the URL for the uploaded file.
1484
+ *
1485
+ * @param {File} file - The file to get the URL for.
1486
+ * @returns {string} The object URL for the file.
1487
+ */
1488
+ getFileUrl(e) {
1489
+ return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(e);
1490
+ },
1491
+ /**
1492
+ * Render the component.
1493
+ *
1494
+ * @returns {object} Rendered component
1495
+ */
1496
+ render() {
1497
+ const e = "image-upload", t = this.onChange || null;
1498
+ return o({ class: "flex-none items-center" }, [
1499
+ p({
1500
+ id: e,
1501
+ cache: "input",
1502
+ type: "file",
1503
+ accept: "image/*",
1504
+ class: "hidden",
1505
+ change: (s) => {
1506
+ const n = s.target.files?.[0];
1507
+ n && t && (this.state.loaded = !1, t(n, this.parent), this.src = this.getFileUrl(n), this.state.loaded = !0);
1508
+ }
1509
+ }),
1510
+ o({
1511
+ class: "relative w-32 h-32 rounded-full border flex items-center justify-center cursor-pointer hover:bg-muted transition-colors duration-150 overflow-hidden group",
1512
+ click: (s) => {
1513
+ s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
1514
+ }
1515
+ }, [
1516
+ T("loaded", (s) => s === !1 || hs(this.src) ? V({
1517
+ htmlFor: e,
1518
+ class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
1519
+ }, [
1520
+ ie(g.upload),
1521
+ o("Upload Image")
1522
+ ]) : de({
1523
+ // @ts-ignore
1524
+ src: this.src,
1525
+ class: "absolute inset-0 w-full h-full object-cover rounded-full"
1526
+ }))
1527
+ ])
1528
+ ]);
1529
+ }
1530
+ }
1531
+ ), Ka = M(
1532
+ {
1533
+ /**
1534
+ * Get the initial state for the component.
1535
+ *
1536
+ * @returns {object} Initial state for the component
1537
+ */
1538
+ state() {
1539
+ return {
1540
+ // @ts-ignore
1541
+ loaded: !!this.src
1542
+ };
1543
+ },
1544
+ /**
1545
+ * This will open the file browse dialog.
1546
+ *
1547
+ * @returns {void}
1548
+ */
1549
+ openFileBrowse() {
1550
+ const e = this.input;
1551
+ e && (e.value = "", L.trigger("click", e));
1552
+ },
1553
+ /**
1554
+ * Get the URL for the uploaded file.
1555
+ *
1556
+ * @param {File} file - The file to get the URL for.
1557
+ * @returns {string} The object URL for the file.
1558
+ */
1559
+ getFileUrl(e) {
1560
+ return this.url && URL.revokeObjectURL(this.url), this.url = URL.createObjectURL(e);
1561
+ },
1562
+ /**
1563
+ * Render the component.
1564
+ *
1565
+ * @returns {object} Rendered component
1566
+ */
1567
+ render() {
1568
+ const e = "logo-upload", t = this.onChange || null;
1569
+ return o({ class: "flex-none items-center" }, [
1570
+ p({
1571
+ id: e,
1572
+ cache: "input",
1573
+ type: "file",
1574
+ accept: "image/*",
1575
+ class: "hidden",
1576
+ change: (s) => {
1577
+ const n = s.target.files?.[0];
1578
+ n && t && (this.state.loaded = !1, t(n, this.parent), this.src = this.getFileUrl(n), this.state.loaded = !0);
1579
+ }
1580
+ }),
1581
+ o({
1582
+ class: "relative w-32 h-32 rounded-full border flex items-center justify-center cursor-pointer hover:bg-muted transition-colors duration-150 overflow-hidden group",
1583
+ click: (s) => {
1584
+ s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
1585
+ }
1586
+ }, [
1587
+ T(
1588
+ "loaded",
1589
+ (s) => s ? de({
1590
+ // @ts-ignore
1591
+ src: this.src,
1592
+ class: "absolute inset-0 w-full h-full object-cover rounded-full"
1593
+ }) : V({
1594
+ htmlFor: e,
1595
+ class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
1596
+ }, [
1597
+ b({}, g.upload),
1598
+ o("Upload logo")
1599
+ ])
1600
+ )
1601
+ ])
1602
+ ]);
1603
+ },
1604
+ /**
1605
+ * Cleanup before destroying the component.
1606
+ *
1607
+ * @returns {void}
1608
+ */
1609
+ destroy() {
1610
+ this.input = null;
1611
+ }
1612
+ }
1613
+ ), fs = (e, t) => Ee(
1614
+ {
1615
+ href: e,
1616
+ "aria-current": t === "Breadcrumb" && "page",
1617
+ // Only set aria-current on the last item
1618
+ class: "text-muted-foreground font-medium hover:text-foreground"
1619
+ },
1620
+ [f(t)]
1621
+ ), gs = () => b({
1622
+ class: "mx-3 text-muted-foreground",
1623
+ "aria-hidden": !0,
1624
+ size: "xs"
1625
+ }, g.chevron.single.right), ms = (e) => o({ class: "flex items-center" }, [
1626
+ e.href ? fs(e.href, e.label) : f(e.label),
1627
+ e.separator && gs()
1628
+ ]), Qa = M(
1629
+ {
1630
+ /**
1631
+ * Set initial data
1632
+ *
1633
+ * @returns {Data}
1634
+ */
1635
+ setData() {
1636
+ return new z({
1637
+ // @ts-ignore
1638
+ items: this.items || []
1639
+ });
1640
+ },
1641
+ /**
1642
+ * Render Breadcrumb Component
1643
+ *
1644
+ * @returns {object}
1645
+ */
1646
+ render() {
1647
+ const e = this.data.items.length - 1;
1648
+ return fe(
1649
+ {
1650
+ "aria-label": "Breadcrumb",
1651
+ class: "flex items-center gap-x-1 text-sm"
1652
+ },
1653
+ [
1654
+ o({
1655
+ role: "list",
1656
+ class: "flex items-center",
1657
+ for: ["items", (t, s) => ms({
1658
+ href: t.href,
1659
+ label: t.label,
1660
+ separator: s < e
1661
+ })]
1662
+ })
1663
+ ]
1664
+ );
1665
+ }
1666
+ }
1667
+ ), Re = {
1668
+ xs: "h-1 w-1",
1669
+ sm: "h-2 w-2",
1670
+ md: "h-4 w-4",
1671
+ lg: "h-8 w-8",
1672
+ xl: "h-12 w-12",
1673
+ "2xl": "h-16 w-16",
1674
+ "3xl": "h-24 w-24",
1675
+ default: "h-4 w-4"
1676
+ }, xs = (e) => Re[e] || Re.default, bs = ({ index: e, size: t }) => o({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
1677
+ f({
1678
+ class: "block w-full h-full rounded-full transition-colors",
1679
+ onSet: ["activeIndex", {
1680
+ "bg-primary": e,
1681
+ "shadow-md": e
1682
+ }],
1683
+ click: (s, { data: n, onClick: a }) => {
1684
+ n.activeIndex = e, a && a(e);
1685
+ }
1686
+ })
1687
+ ]), ps = (e, t) => Array.from({ length: e }, (s, n) => bs({
1688
+ index: n,
1689
+ size: t
1690
+ })), Ja = M(
1691
+ {
1692
+ /**
1693
+ * Defines component data (props).
1694
+ *
1695
+ * @returns {Data}
1696
+ */
1697
+ setData() {
1698
+ return new z({
1699
+ // @ts-ignore
1700
+ count: this.count || 4,
1701
+ // total dots
1702
+ // @ts-ignore
1703
+ activeIndex: this.activeIndex || 0
1704
+ });
1705
+ },
1706
+ /**
1707
+ * Renders the dots.
1708
+ *
1709
+ * @returns {object}
1710
+ */
1711
+ render() {
1712
+ const e = this.gap || "gap-2", t = xs(this.size || "sm"), s = ps(this.data.count, t);
1713
+ return o(
1714
+ { class: "flex justify-center items-center py-2" },
1715
+ [
1716
+ o({ class: `flex ${e}` }, s)
1717
+ ]
1718
+ );
1719
+ }
1720
+ }
1721
+ ), ys = ({ toggleDropdown: e }) => w(
1722
+ {
1723
+ cache: "button",
1724
+ class: "relative z-2 inline-flex items-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border bg-input hover:bg-muted h-10 px-4 py-2 justify-between",
1725
+ click: e
1726
+ },
1727
+ [
1728
+ f({ onState: ["selectedLabel", (t) => t || "Select item..."] }),
1729
+ b({ size: "sm" }, g.chevron.upDown)
1730
+ ]
1731
+ ), ws = (e, t, s) => ge({
1732
+ class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
1733
+ click: () => t(e),
1734
+ onState: [s, "selectedValue", { "bg-secondary": e.value }]
1735
+ }, [
1736
+ e.icon && f({ class: "mr-2 flex items-baseline" }, [b({ size: "xs" }, e.icon)]),
1737
+ f({ class: "text-base font-normal" }, e.label)
1738
+ ]), vs = (e, t) => o({ class: "w-full border rounded-md" }, [
1739
+ X({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => ws(s, e, t)] })
1740
+ ]), ks = ({ onSelect: e, state: t }) => o({ class: "flex flex-auto flex-col" }, [
1741
+ T(
1742
+ "open",
1743
+ (s, n, a) => s ? new te({
1744
+ cache: "dropdown",
1745
+ parent: a,
1746
+ button: a.button
1747
+ }, [
1748
+ vs(e, t)
1749
+ ]) : null
1750
+ )
1751
+ ]), Za = M(
1752
+ {
1753
+ /**
1754
+ * This will set up the data.
1755
+ *
1756
+ * @returns {Data}
1757
+ */
1758
+ setData() {
1759
+ return new z({
1760
+ // @ts-ignore
1761
+ items: this.items || []
1762
+ });
1763
+ },
1764
+ /**
1765
+ * This will set up the states.
1766
+ *
1767
+ * @returns {object}
1768
+ */
1769
+ state() {
1770
+ return {
1771
+ open: !1,
1772
+ selectedLabel: "",
1773
+ selectedValue: ""
1774
+ };
1775
+ },
1776
+ /**
1777
+ * This will set the state item.
1778
+ *
1779
+ * @param {object} item
1780
+ * @returns {void}
1781
+ */
1782
+ setStateItem(e) {
1783
+ const t = this.state;
1784
+ t.selectedValue = e.value, t.selectedLabel = e.label, t.open = !1;
1785
+ },
1786
+ /**
1787
+ * Handles the selection of an item.
1788
+ *
1789
+ * @param {object} item
1790
+ * @returns {void}
1791
+ */
1792
+ select(e) {
1793
+ this.setStateItem(e), typeof this.onSelect == "function" && this.onSelect(e, this.parent);
1794
+ },
1795
+ /**
1796
+ * Selects the first item in the list.
1797
+ *
1798
+ * @returns {void}
1799
+ */
1800
+ selectFirstItem() {
1801
+ const e = this.data.items[0];
1802
+ this.select(e);
1803
+ },
1804
+ /**
1805
+ * Toggles the dropdown open state.
1806
+ *
1807
+ * @returns {void}
1808
+ */
1809
+ toggleDropdown() {
1810
+ this.state.toggle("open");
1811
+ },
1812
+ /**
1813
+ * This will run after the component is set up.
1814
+ *
1815
+ * @returns {void}
1816
+ */
1817
+ after() {
1818
+ if (this.selectFirst === !0 && this.state.selectedValue === "") {
1819
+ const e = this.data.items[0];
1820
+ e && this.setStateItem(e);
1821
+ }
1822
+ },
1823
+ /**
1824
+ * This will render the component.
1825
+ *
1826
+ * @returns {object}
1827
+ */
1828
+ render() {
1829
+ const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
1830
+ return o({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
1831
+ // @ts-ignore
1832
+ ys({ toggleDropdown: this.toggleDropdown.bind(this) }),
1833
+ ks({
1834
+ // @ts-ignore
1835
+ state: this.state,
1836
+ // @ts-ignore
1837
+ onSelect: this.select.bind(this)
1838
+ }),
1839
+ // Hidden required input for form validation
1840
+ // @ts-ignore
1841
+ this.required && p({
1842
+ class: "opacity-0 absolute top-0 left-0 z-1",
1843
+ type: "text",
1844
+ // @ts-ignore
1845
+ name: this.name,
1846
+ required: !0,
1847
+ // @ts-ignore
1848
+ value: ["[[selectedValue]]", this.state]
1849
+ })
1850
+ ]);
1851
+ }
1852
+ }
1853
+ ), Ke = ({ icon: e, click: t, ariaLabel: s }) => x({
1854
+ variant: "icon",
1855
+ class: "flex flex-none",
1856
+ click: t,
1857
+ icon: e,
1858
+ "aria-label": s
1859
+ }), Cs = ({ click: e }) => Ke({
1860
+ icon: g.circleMinus,
1861
+ click: e,
1862
+ ariaLabel: "Decrement"
1863
+ }), Ss = ({ click: e }) => Ke({
1864
+ icon: g.circlePlus,
1865
+ click: e,
1866
+ ariaLabel: "Increment"
1867
+ }), $s = ({ bind: e, min: t, max: s, readonly: n = !1 }) => W(({ state: a }) => p({
1868
+ value: ["[[count]]", a],
1869
+ bind: e,
1870
+ blur: (l, { state: i }) => {
1871
+ let c = parseInt(l.target.value, 10);
1872
+ isNaN(c) && (c = t ?? 0), t !== void 0 && (c = Math.max(c, t)), s !== void 0 && (c = Math.min(c, s)), i.count = c;
1873
+ },
1874
+ class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
1875
+ readonly: n,
1876
+ min: t,
1877
+ max: s,
1878
+ type: "number",
1879
+ "aria-label": "Counter"
1880
+ })), Xa = O(
1881
+ {
1882
+ /**
1883
+ * Initial state for the counter component.
1884
+ *
1885
+ * @member {object} state
1886
+ */
1887
+ state() {
1888
+ return {
1889
+ count: {
1890
+ state: this.initialCount ?? 0,
1891
+ callBack: (e) => this.change && this.change(e)
1892
+ }
1893
+ };
1894
+ },
1895
+ /**
1896
+ * Renders the Counter component.
1897
+ *
1898
+ * @returns {object}
1899
+ */
1900
+ render() {
1901
+ const e = this.class ?? "";
1902
+ return o({ class: `flex flex-auto items-center justify-between gap-x-4 p-4 ${e}` }, [
1903
+ Cs({ click: () => this.state.decrement("count") }),
1904
+ $s({
1905
+ bind: this.bind,
1906
+ readonly: this.readonly,
1907
+ min: this.min,
1908
+ max: this.max
1909
+ }),
1910
+ Ss({ click: () => this.state.increment("count") })
1911
+ ]);
1912
+ }
1913
+ }
1914
+ ), Ds = ({ currentMonth: e, currentYear: t, onSelect: s }) => o(
1915
+ { class: "grid grid-cols-3 gap-2" },
1916
+ ee.monthNames.map(
1917
+ (n, a) => x(
1918
+ {
1919
+ click: (l) => {
1920
+ l.preventDefault(), l.stopPropagation(), s(a);
1921
+ },
1922
+ variant: e === a ? "primary" : "ghost",
1923
+ "aria-label": `Select ${n} ${t}`
1924
+ },
1925
+ n.substring(0, 3)
1926
+ )
1927
+ )
1928
+ ), P = (e) => (e *= 1, e < 10 ? `0${e}` : String(e)), Is = (e) => (e.indexOf("T") === -1 && e.indexOf(" ") === -1 && (e += "T00:00:01"), e.replace(" ", "T"), e), j = (e, t, s) => `${e}-${P(t + 1)}-${P(s)}`, Ts = (e) => e ? "bg-accent text-primary" : "", Ms = (e) => e ? "text-muted-foreground opacity-50" : "", Bs = (e, t) => e === t, Ps = (e, t) => Bs(e, t) ? "bg-primary text-primary-foreground" : "", zs = (e, t, s, n) => {
1929
+ const a = Ps(t, n);
1930
+ return a || (e ? Ts(e) : s ? Ms(s) : "text-foreground");
1931
+ }, oe = (e) => {
1932
+ const {
1933
+ day: t,
1934
+ currentDate: s,
1935
+ date: n,
1936
+ isToday: a,
1937
+ isOutsideMonth: l,
1938
+ select: i,
1939
+ disabled: c
1940
+ } = e;
1941
+ return w(
1942
+ {
1943
+ class: `
1944
+ flex items-center justify-center h-9 w-auto p-0 font-normal text-sm rounded-md cursor-pointer
1945
+ ${zs(a, s, l, n)}
1946
+ hover:bg-muted/50 hover:text-muted-foreground focus:z-10
1947
+ disabled:pointer-events-none disabled:opacity-50
1948
+ `,
1949
+ disabled: c || t === null,
1950
+ "aria-label": t ? `Day ${t}` : null,
1951
+ // Only call select if it's not disabled.
1952
+ click: () => !c && i(n)
1953
+ },
1954
+ t.toString()
1955
+ );
1956
+ }, le = (e, t, s, n) => e === n.date && t === n.month && s === n.year, Os = (e, t, s, n = !1) => {
1957
+ const { year: a, month: l } = e, i = j(a, l, e.date), c = new Date(a, l, 1).getDay(), u = new Date(a, l + 1, 0).getDate(), m = new Date(a, l, 0).getDate(), v = [], q = l === 0 ? 11 : l - 1, A = l === 0 ? a - 1 : a;
1958
+ for (let d = c - 1; d >= 0; d--) {
1959
+ const y = m - d, S = le(y, q, A, t), $ = new Date(A, q, y) < new Date(t.year, t.month, t.date), R = n && $;
1960
+ v.push(
1961
+ oe({
1962
+ day: y,
1963
+ currentDate: i,
1964
+ date: j(A, q, y),
1965
+ isToday: S,
1966
+ isOutsideMonth: !0,
1967
+ select: s,
1968
+ disabled: R
1969
+ })
1970
+ );
1971
+ }
1972
+ for (let d = 1; d <= u; d++) {
1973
+ const y = le(d, l, a, t), S = new Date(a, l, d) < new Date(t.year, t.month, t.date), $ = n && S;
1974
+ v.push(
1975
+ oe({
1976
+ day: d,
1977
+ currentDate: i,
1978
+ date: j(a, l, d),
1979
+ isToday: y,
1980
+ isOutsideMonth: !1,
1981
+ select: s,
1982
+ disabled: $
1983
+ })
1984
+ );
1985
+ }
1986
+ const E = l === 11 ? 0 : l + 1, se = l === 11 ? a + 1 : a, h = (7 - v.length % 7) % 7;
1987
+ for (let d = 1; d <= h; d++) {
1988
+ const y = le(d, E, se, t), S = new Date(se, E, d) < new Date(t.year, t.month, t.date), $ = n && S;
1989
+ v.push(
1990
+ oe({
1991
+ day: d,
1992
+ currentDate: i,
1993
+ date: j(se, E, d),
1994
+ isToday: y,
1995
+ isOutsideMonth: !0,
1996
+ select: s,
1997
+ disabled: $
1998
+ })
1999
+ );
2000
+ }
2001
+ return v;
2002
+ }, Fe = ({ label: e, click: t }) => x(
2003
+ {
2004
+ class: `
2005
+ inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
2006
+ opacity-50 hover:opacity-100 text-muted-foreground absolute
2007
+ ${e === "Previous" ? "left-1" : "right-1"}
2008
+ focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
2009
+ `,
2010
+ click: t,
2011
+ "aria-label": `${e} month`,
2012
+ variant: "icon",
2013
+ icon: e === "Previous" ? g.chevron.single.left : g.chevron.single.right
2014
+ }
2015
+ ), Ns = ({ onMonthClick: e, onYearClick: t, next: s, previous: n }) => o({ class: "flex items-center justify-center gap-x-2 relative min-h-12 text-sm font-medium" }, [
2016
+ x({ click: e, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
2017
+ x({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
2018
+ Fe({ label: "Previous", click: n }),
2019
+ Fe({ label: "Next", click: s })
2020
+ ]), Rs = (e) => o(
2021
+ { class: "flex items-center justify-center h-9 w-auto text-[0.8rem] font-normal text-muted-foreground" },
2022
+ e
2023
+ ), Fs = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(Rs), js = (e) => o({ class: "rdp flex flex-auto flex-col w-full gap-y-1" }, [
2024
+ Ns({
2025
+ onMonthClick: e.onMonthClick,
2026
+ onYearClick: e.onYearClick,
2027
+ next: e.next,
2028
+ previous: e.previous
2029
+ }),
2030
+ o({
2031
+ class: "flex flex-auto flex-col w-full",
2032
+ onSet: [
2033
+ "currentDate",
2034
+ () => [
2035
+ o({ class: "grid grid-cols-7" }, Fs()),
2036
+ o(
2037
+ { class: "grid grid-cols-7" },
2038
+ Os(
2039
+ e.current,
2040
+ e.today,
2041
+ e.select,
2042
+ e.blockPriorDates
2043
+ )
2044
+ )
2045
+ ]
2046
+ ]
2047
+ })
2048
+ ]), Ls = ({ currentMonth: e, currentYear: t, onSelect: s }) => {
2049
+ const n = t - 50, a = Array.from({ length: 101 }, (l, i) => n + i);
2050
+ return o(
2051
+ { class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
2052
+ a.map(
2053
+ (l) => x(
2054
+ {
2055
+ click: (i) => {
2056
+ i.preventDefault(), i.stopPropagation(), s(l);
2057
+ },
2058
+ variant: l === t ? "primary" : "ghost",
2059
+ "aria-label": `Select ${l}`
2060
+ },
2061
+ l.toString()
2062
+ )
2063
+ )
2064
+ );
2065
+ };
2066
+ class Hs extends C {
2067
+ /**
2068
+ * This will declare the props for the compiler.
2069
+ *
2070
+ * @returns {void}
2071
+ */
2072
+ declareProps() {
2073
+ this.selectedDate = null, this.selectedCallBack = null, this.blockPriorDates = !1;
2074
+ }
2075
+ /**
2076
+ * This will get the selected data.
2077
+ *
2078
+ * @param {object} today
2079
+ * @returns {Date}
2080
+ */
2081
+ getSelectedDate(t) {
2082
+ const s = this.selectedDate ? new Date(Is(this.selectedDate)) : t;
2083
+ return new Date(s.getFullYear(), s.getMonth(), s.getDate());
2084
+ }
2085
+ /**
2086
+ * This will set up the data for the calendar.
2087
+ *
2088
+ * @returns {Data}
2089
+ */
2090
+ setData() {
2091
+ const t = /* @__PURE__ */ new Date(), s = this.getSelectedDate(t), n = s.getMonth();
2092
+ return new z({
2093
+ monthName: this.getMonthName(n),
2094
+ currentDate: `${s.getFullYear()}-${n + 1}-${s.getDate()}`,
2095
+ current: {
2096
+ date: s.getDate(),
2097
+ year: s.getFullYear(),
2098
+ month: n
2099
+ },
2100
+ today: {
2101
+ date: t.getDate(),
2102
+ month: t.getMonth(),
2103
+ year: t.getFullYear()
2104
+ }
2105
+ });
2106
+ }
2107
+ /**
2108
+ * This will set up the states for the calendar.
2109
+ *
2110
+ * @return {object}
2111
+ */
2112
+ setupStates() {
2113
+ return {
2114
+ view: "calendar"
2115
+ // 'calendar' | 'months' | 'years'
2116
+ };
2117
+ }
2118
+ /**
2119
+ * This will get the name of the month.
2120
+ *
2121
+ * @param {number} month
2122
+ * @returns {string}
2123
+ */
2124
+ getMonthName(t) {
2125
+ return ee.monthNames[t];
2126
+ }
2127
+ /**
2128
+ * This will go to the previous month.
2129
+ *
2130
+ * @returns {void}
2131
+ */
2132
+ goToPreviousMonth() {
2133
+ const t = this.data;
2134
+ let s = t.current.month, n = t.current.year;
2135
+ s === 0 ? (s = 11, n--) : s--, this.setCurrentDate(s, n);
2136
+ }
2137
+ /**
2138
+ * This will go to the next month.
2139
+ *
2140
+ * @returns {void}
2141
+ */
2142
+ goToNextMonth() {
2143
+ const t = this.data;
2144
+ let s = t.current.month, n = t.current.year;
2145
+ s === 11 ? (s = 0, n++) : s++, this.setCurrentDate(s, n);
2146
+ }
2147
+ /**
2148
+ * This will set the current month and year.
2149
+ *
2150
+ * @param {number} month
2151
+ * @param {number} year
2152
+ * @param {number|null} [date=null]
2153
+ * @returns {void}
2154
+ */
2155
+ setCurrentDate(t, s, n = null) {
2156
+ const a = this.data;
2157
+ a.current.month = t, a.current.year = s, typeof n == "number" && (a.current.date = P(n)), a.currentDate = `${s}-${P(t + 1)}-${a.current.date}`, a.monthName = this.getMonthName(t);
2158
+ }
2159
+ /**
2160
+ * This will select a date.
2161
+ *
2162
+ * @param {string} date
2163
+ * @returns {void}
2164
+ */
2165
+ selectDate(t) {
2166
+ const s = /* @__PURE__ */ new Date(t + "T00:00:00");
2167
+ this.setCurrentDate(s.getMonth(), s.getFullYear(), s.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(this.data.currentDate);
2168
+ }
2169
+ /**
2170
+ * This will render the calendar.
2171
+ *
2172
+ * @returns {object}
2173
+ */
2174
+ render() {
2175
+ return o({ class: "calendar-container p-3 rounded-md border min-w-80" }, [
2176
+ T("view", (t) => {
2177
+ switch (t) {
2178
+ case "months":
2179
+ return Ds(
2180
+ {
2181
+ // @ts-ignore
2182
+ currentMonth: this.data.current.month,
2183
+ // @ts-ignore
2184
+ currentYear: this.data.current.year,
2185
+ onSelect: (s) => {
2186
+ this.setCurrentDate(s, this.data.current.year), this.state.view = "calendar";
2187
+ }
2188
+ }
2189
+ );
2190
+ case "years":
2191
+ return Ls(
2192
+ {
2193
+ // @ts-ignore
2194
+ currentMonth: this.data.current.month,
2195
+ // @ts-ignore
2196
+ currentYear: this.data.current.year,
2197
+ onSelect: (s) => {
2198
+ this.setCurrentDate(this.data.current.month, s), this.state.view = "calendar";
2199
+ }
2200
+ }
2201
+ );
2202
+ default:
2203
+ return js({
2204
+ // @ts-ignore
2205
+ current: this.data.current,
2206
+ // @ts-ignore
2207
+ today: this.data.today,
2208
+ select: (s) => this.selectDate(s),
2209
+ next: () => this.goToNextMonth(),
2210
+ previous: () => this.goToPreviousMonth(),
2211
+ blockPriorDates: this.blockPriorDates || !1,
2212
+ onMonthClick: (s) => {
2213
+ s.preventDefault(), s.stopPropagation(), this.state.view = "months";
2214
+ },
2215
+ onYearClick: (s) => {
2216
+ s.preventDefault(), s.stopPropagation(), this.state.view = "years";
2217
+ }
2218
+ });
2219
+ }
2220
+ })
2221
+ ]);
2222
+ }
2223
+ }
2224
+ const As = (e) => {
2225
+ let t = "";
2226
+ return e.length > 0 && (t = e.substring(0, 2), e.length > 2 && (t += "/" + e.substring(2, 4), e.length > 4 && (t += "/" + e.substring(4, 8)))), t;
2227
+ }, Es = (e) => {
2228
+ if (e.length !== 8)
2229
+ return null;
2230
+ const t = parseInt(e.substring(0, 2), 10), s = parseInt(e.substring(2, 4), 10), n = parseInt(e.substring(4, 8), 10);
2231
+ return t >= 1 && t <= 12 && s >= 1 && s <= 31 && n >= 1900 ? `${n}-${t.toString().padStart(2, "0")}-${s.toString().padStart(2, "0")}` : null;
2232
+ }, Us = ({ bind: e, required: t }) => p({
2233
+ cache: "input",
2234
+ class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
2235
+ bind: e,
2236
+ required: t
2237
+ }), Ys = ({ placeholder: e, handleInputChange: t, handleInputFocus: s }) => p({
2238
+ cache: "dateInput",
2239
+ class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
2240
+ placeholder: e || "mm/dd/yyyy",
2241
+ input: t,
2242
+ focus: s,
2243
+ onState: ["selectedDate", (n) => n ? ee.format("standard", n) : ""]
2244
+ }), Vs = ({ bind: e, required: t, toggleOpen: s, handleInputChange: n, handleInputFocus: a, placeholder: l }) => o(
2245
+ {
2246
+ class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
2247
+ },
2248
+ [
2249
+ Us({ bind: e, required: t }),
2250
+ Ys({ placeholder: l, handleInputChange: n, handleInputFocus: a }),
2251
+ w(
2252
+ {
2253
+ class: "shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
2254
+ click: s
2255
+ },
2256
+ [
2257
+ Y({ html: g.calendar.days })
2258
+ ]
2259
+ )
2260
+ ]
2261
+ ), Ws = ({ handleDateSelect: e, blockPriorDates: t }) => me(
2262
+ (s, n, a) => new te({
2263
+ cache: "dropdown",
2264
+ parent: a,
2265
+ button: a.panel,
2266
+ size: "fit"
2267
+ }, [
2268
+ new Hs({
2269
+ selectedDate: a.state.selectedDate,
2270
+ selectedCallBack: e,
2271
+ blockPriorDates: t
2272
+ })
2273
+ ])
2274
+ ), eo = O(
2275
+ {
2276
+ /**
2277
+ * The initial state of the DatePicker.
2278
+ *
2279
+ * @member {object} state
2280
+ */
2281
+ state() {
2282
+ return {
2283
+ selectedDate: this.selectedDate ?? null,
2284
+ open: !1
2285
+ };
2286
+ },
2287
+ /**
2288
+ * This is added to check the input after the component is rendered.
2289
+ * to see if the bind updated the input value.
2290
+ *
2291
+ * @returns {void}
2292
+ */
2293
+ after() {
2294
+ this.input.value && (this.state.selectedDate = this.input.value);
2295
+ },
2296
+ /**
2297
+ * Handles direct input changes and formats the date.
2298
+ *
2299
+ * @param {Event} e
2300
+ */
2301
+ handleInputChange(e) {
2302
+ const s = e.target.value.replace(/\D/g, "");
2303
+ e.target.value = As(s);
2304
+ const n = Es(s);
2305
+ n && (this.state.selectedDate = n, this.input.value = n, L.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(n));
2306
+ },
2307
+ /**
2308
+ * Handles input focus - select all text for easy editing.
2309
+ *
2310
+ * @param {Event} e
2311
+ */
2312
+ handleInputFocus(e) {
2313
+ e.target.select();
2314
+ },
2315
+ /**
2316
+ * Handles date selection from calendar.
2317
+ *
2318
+ * @param {string} date
2319
+ */
2320
+ handleDateSelect(e) {
2321
+ this.state.selectedDate = e, this.state.open = !1, this.input.value = e, L.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(e);
2322
+ },
2323
+ /**
2324
+ * Toggles the calendar popover.
2325
+ *
2326
+ * @param {Event} e
2327
+ * @param {object} context
2328
+ */
2329
+ toggleOpen(e, { state: t }) {
2330
+ t.toggle("open");
2331
+ },
2332
+ /**
2333
+ * Renders the DatePicker component.
2334
+ *
2335
+ * @returns {object}
2336
+ */
2337
+ render() {
2338
+ return o(
2339
+ { class: "relative w-full max-w-[320px]" },
2340
+ [
2341
+ Vs({
2342
+ toggleOpen: this.toggleOpen.bind(this),
2343
+ bind: this.bind,
2344
+ required: this.required,
2345
+ handleInputChange: this.handleInputChange.bind(this),
2346
+ handleInputFocus: this.handleInputFocus.bind(this),
2347
+ placeholder: this.placeholder
2348
+ }),
2349
+ Ws({
2350
+ handleDateSelect: this.handleDateSelect.bind(this),
2351
+ blockPriorDates: this.blockPriorDates || !1
2352
+ })
2353
+ ]
2354
+ );
2355
+ }
2356
+ }
2357
+ ), je = ({ label: e, click: t }) => x(
2358
+ {
2359
+ class: `
2360
+ inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
2361
+ opacity-50 hover:opacity-100 text-muted-foreground absolute
2362
+ ${e === "Previous" ? "left-1" : "right-1"}
2363
+ focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
2364
+ `,
2365
+ click: t,
2366
+ "aria-label": `${e} month`,
2367
+ variant: "icon",
2368
+ icon: e === "Previous" ? g.chevron.single.left : g.chevron.single.right
2369
+ }
2370
+ ), qs = ({ onMonthClick: e, onYearClick: t, next: s, previous: n }) => o({ class: "flex items-center justify-center gap-x-2 relative min-h-12 text-sm font-medium" }, [
2371
+ x({ click: e, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
2372
+ x({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
2373
+ je({ label: "Previous", click: n }),
2374
+ je({ label: "Next", click: s })
2375
+ ]), Gs = (e) => o({ class: "h-9 flex items-center justify-center font-medium" }, e), _s = () => o(
2376
+ { class: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-muted-foreground mb-2" },
2377
+ ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(Gs)
2378
+ ), Ks = ({ day: e, iso: t, disabled: s, isStart: n, isEnd: a, isBetween: l, isOtherMonth: i, click: c }) => {
2379
+ let u = "ghost", m = "";
2380
+ return n || a ? (u = "default", m = "bg-primary text-primary-foreground hover:bg-primary/90") : l && (m = "bg-accent text-accent-foreground hover:bg-accent/80"), s && (m += " opacity-50 cursor-not-allowed"), i && (m += " text-muted-foreground opacity-50"), x(
2381
+ {
2382
+ class: `flex items-center justify-center p-0 text-sm font-medium rounded-md transition-colors ${m}`,
2383
+ variant: u,
2384
+ disabled: s,
2385
+ click: (v) => {
2386
+ v.preventDefault(), v.stopPropagation(), s || c();
2387
+ }
2388
+ },
2389
+ e.toString()
2390
+ );
2391
+ }, Qs = ({ today: e, current: t, blockPriorDates: s, onDateClick: n }) => {
2392
+ const { start: a, end: l } = t, i = new Date(t.year, t.month, 1).getDay(), c = new Date(t.year, t.month + 1, 0).getDate(), u = [], m = t.month === 0 ? 11 : t.month - 1, v = t.month === 0 ? t.year - 1 : t.year, q = new Date(v, m + 1, 0).getDate(), A = t.month === 11 ? 0 : t.month + 1, E = t.month === 11 ? t.year + 1 : t.year;
2393
+ for (let h = i - 1; h >= 0; h--) {
2394
+ const d = q - h, y = j(v, m, d), S = new Date(v, m, d), $ = new Date(e.year, e.month, e.date), R = S < $, G = s && R, _ = a === y, K = l === y, st = a && l && y > a && y < l;
2395
+ u.push({
2396
+ day: d,
2397
+ iso: y,
2398
+ disabled: G,
2399
+ isStart: _,
2400
+ isEnd: K,
2401
+ isBetween: st,
2402
+ isOtherMonth: !0,
2403
+ click: () => n(y)
2404
+ });
2405
+ }
2406
+ for (let h = 1; h <= c; h++) {
2407
+ const d = j(t.year, t.month, h), y = new Date(t.year, t.month, h), S = new Date(e.year, e.month, e.date), $ = y < S, R = s && $, G = a === d, _ = l === d, K = a && l && d > a && d < l;
2408
+ u.push({
2409
+ day: h,
2410
+ iso: d,
2411
+ disabled: R,
2412
+ isStart: G,
2413
+ isEnd: _,
2414
+ isBetween: K,
2415
+ isOtherMonth: !1,
2416
+ click: () => {
2417
+ n(d);
2418
+ }
2419
+ });
2420
+ }
2421
+ const ye = (7 - u.length % 7) % 7;
2422
+ for (let h = 1; h <= ye; h++) {
2423
+ const d = j(E, A, h), y = new Date(E, A, h), S = new Date(e.year, e.month, e.date), $ = y < S, R = s && $, G = a === d, _ = l === d, K = a && l && d > a && d < l;
2424
+ u.push({
2425
+ day: h,
2426
+ iso: d,
2427
+ disabled: R,
2428
+ isStart: G,
2429
+ isEnd: _,
2430
+ isBetween: K,
2431
+ isOtherMonth: !0,
2432
+ click: () => n(d)
2433
+ });
2434
+ }
2435
+ return o(
2436
+ { class: "grid grid-cols-7 gap-1" },
2437
+ u.map(
2438
+ (h, d) => Ks({
2439
+ day: h.day,
2440
+ iso: h.iso,
2441
+ disabled: h.disabled,
2442
+ isStart: h.isStart,
2443
+ isEnd: h.isEnd,
2444
+ isBetween: h.isBetween,
2445
+ isOtherMonth: h.isOtherMonth,
2446
+ click: h.click
2447
+ })
2448
+ )
2449
+ );
2450
+ }, Js = r((e, t) => o({ class: "flex flex-auto flex-col" }, [
2451
+ qs({
2452
+ // @ts-ignore
2453
+ onMonthClick: e.onMonthClick,
2454
+ // @ts-ignore
2455
+ onYearClick: e.onYearClick,
2456
+ // @ts-ignore
2457
+ next: e.next,
2458
+ // @ts-ignore
2459
+ previous: e.previous
2460
+ }),
2461
+ o({
2462
+ class: "flex flex-auto flex-col w-full",
2463
+ onSet: [
2464
+ "currentDate",
2465
+ () => [
2466
+ _s(),
2467
+ Qs({
2468
+ // @ts-ignore
2469
+ today: e.today,
2470
+ // @ts-ignore
2471
+ current: e.current,
2472
+ // @ts-ignore
2473
+ blockPriorDates: e.blockPriorDates,
2474
+ // @ts-ignore
2475
+ onDateClick: e.onDateClick
2476
+ })
2477
+ ]
2478
+ ]
2479
+ })
2480
+ ])), Zs = ({ currentMonth: e, currentYear: t, onSelect: s }) => o(
2481
+ { class: "grid grid-cols-3 gap-2" },
2482
+ ee.monthNames.map(
2483
+ (n, a) => x(
2484
+ {
2485
+ click: (l) => {
2486
+ l.preventDefault(), l.stopPropagation(), s(a);
2487
+ },
2488
+ variant: e === a ? "primary" : "ghost",
2489
+ "aria-label": `Select ${n} ${t}`
2490
+ },
2491
+ n.substring(0, 3)
2492
+ )
2493
+ )
2494
+ ), Xs = ({ start: e, end: t, selecting: s, onSelectStart: n, onSelectEnd: a }) => o({ class: "flex gap-x-2 mb-4" }, [
2495
+ Q("selecting", (l) => x({
2496
+ click: n,
2497
+ variant: l === "start" ? "primary" : "outline",
2498
+ class: "flex-1"
2499
+ }, [
2500
+ o({ class: "font-medium" }, Le("current.start", "Start Date"))
2501
+ ])),
2502
+ Q("selecting", (l) => x({
2503
+ click: a,
2504
+ variant: l === "end" ? "primary" : "outline",
2505
+ class: "flex-1"
2506
+ }, [
2507
+ o({ class: "font-medium" }, Le("current.end", "End Date"))
2508
+ ]))
2509
+ ]), Le = (e, t) => [`[[${e}]]`, (s) => s == null ? t : en(s)], en = (e) => {
2510
+ const t = /* @__PURE__ */ new Date(e + "T00:00:00"), s = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2511
+ return `${s[t.getDay()]}, ${t.getDate()} ${n[t.getMonth()]}`;
2512
+ }, tn = ({ currentYear: e, onSelect: t }) => {
2513
+ const s = e - 50, n = Array.from({ length: 101 }, (a, l) => s + l);
2514
+ return o(
2515
+ { class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
2516
+ n.map(
2517
+ (a) => x(
2518
+ {
2519
+ click: (l) => {
2520
+ l.preventDefault(), l.stopPropagation(), t(a);
2521
+ },
2522
+ variant: a === e ? "primary" : "ghost",
2523
+ "aria-label": `Select ${a}`
2524
+ },
2525
+ a.toString()
2526
+ )
2527
+ )
2528
+ );
2529
+ };
2530
+ class sn extends C {
2531
+ /**
2532
+ * Declare compiler props.
2533
+ *
2534
+ * @returns {void}
2535
+ */
2536
+ declareProps() {
2537
+ this.startDate = null, this.endDate = null, this.onRangeSelect = null, this.blockPriorDates = !1;
2538
+ }
2539
+ /**
2540
+ * Initialize reactive data for today and current view.
2541
+ *
2542
+ * @returns {Data}
2543
+ */
2544
+ setData() {
2545
+ const t = /* @__PURE__ */ new Date(), s = this.startDate ? /* @__PURE__ */ new Date(this.startDate + "T00:00:00") : t, n = s.getMonth(), a = s.getFullYear();
2546
+ return new z({
2547
+ today: {
2548
+ date: t.getDate(),
2549
+ month: t.getMonth(),
2550
+ year: t.getFullYear()
2551
+ },
2552
+ monthName: this.getMonthName(n),
2553
+ currentData: `${s.getFullYear()}-${P(s.getMonth() + 1)}-${P(s.getDate())}`,
2554
+ current: {
2555
+ date: t.getDate(),
2556
+ month: n,
2557
+ year: a,
2558
+ start: this.startDate,
2559
+ end: this.endDate
2560
+ },
2561
+ selecting: "start"
2562
+ });
2563
+ }
2564
+ /**
2565
+ * This will get the name of the month.
2566
+ *
2567
+ * @param {number} month
2568
+ * @returns {string}
2569
+ */
2570
+ getMonthName(t) {
2571
+ return ee.monthNames[t];
2572
+ }
2573
+ /**
2574
+ * Initialize component state.
2575
+ *
2576
+ * @returns {{view:string}}
2577
+ */
2578
+ setupStates() {
2579
+ return {
2580
+ view: "calendar"
2581
+ // 'calendar', 'months', or 'years'
2582
+ };
2583
+ }
2584
+ /**
2585
+ * Handle a date cell click.
2586
+ *
2587
+ * @param {string} isoDate
2588
+ * @returns {void}
2589
+ */
2590
+ handleClick(t) {
2591
+ if (this.data.selecting === "start") {
2592
+ this.data.current.start = t, this.data.current.end = null, this.data.selecting = "end";
2593
+ const s = /* @__PURE__ */ new Date(t + "T00:00:00");
2594
+ this.setCurrent({
2595
+ month: s.getMonth(),
2596
+ year: s.getFullYear(),
2597
+ date: s.getDate()
2598
+ });
2599
+ } else {
2600
+ this.data.current.start && t < this.data.current.start ? (this.data.current.end = this.data.current.start, this.data.current.start = t) : this.data.current.end = t, this.data.selecting = "start";
2601
+ const s = /* @__PURE__ */ new Date(t + "T00:00:00");
2602
+ this.setCurrent({
2603
+ month: s.getMonth(),
2604
+ year: s.getFullYear(),
2605
+ date: s.getDate()
2606
+ }), typeof this.onRangeSelect == "function" && this.onRangeSelect(this.data.current.start, this.data.current.end);
2607
+ }
2608
+ }
2609
+ /**
2610
+ * Update current month/year in data.
2611
+ *
2612
+ * @param {object} obj
2613
+ * @returns {void}
2614
+ */
2615
+ setCurrent({ month: t, year: s, date: n = null }) {
2616
+ const a = this.data.current;
2617
+ a.month = (t + 12) % 12, a.year = s + (t < 0 ? -1 : t > 11 ? 1 : 0), n !== null && (a.date = n), this.data.monthName = this.getMonthName(a.month), this.data.currentDate = `${s}-${P(t + 1)}-${P(a.date)}`;
2618
+ }
2619
+ /**
2620
+ * Render the range calendar.
2621
+ *
2622
+ * @returns {object}
2623
+ */
2624
+ render() {
2625
+ const { today: t, current: s, selecting: n } = this.data, { start: a, end: l } = s;
2626
+ return o({ class: "range-calendar border border-border rounded-lg shadow-md p-4 w-full max-w-sm min-w-80" }, [
2627
+ Xs({
2628
+ start: a,
2629
+ end: l,
2630
+ selecting: n,
2631
+ onSelectStart: (i) => {
2632
+ i.preventDefault(), i.stopPropagation(), this.data.selecting = "start";
2633
+ },
2634
+ onSelectEnd: (i) => {
2635
+ i.preventDefault(), i.stopPropagation(), this.data.selecting = "end";
2636
+ }
2637
+ }),
2638
+ T("view", (i) => {
2639
+ switch (i) {
2640
+ case "months":
2641
+ return Zs(
2642
+ {
2643
+ currentMonth: s.month,
2644
+ currentYear: s.year,
2645
+ onSelect: (c) => {
2646
+ this.setCurrent({ month: c, year: s.year }), this.state.view = "calendar";
2647
+ }
2648
+ }
2649
+ );
2650
+ case "years":
2651
+ return tn(
2652
+ {
2653
+ currentYear: s.year,
2654
+ onSelect: (c) => {
2655
+ this.setCurrent({ month: s.month, year: c }), this.state.view = "calendar";
2656
+ }
2657
+ }
2658
+ );
2659
+ default:
2660
+ return Js({
2661
+ // @ts-ignore
2662
+ monthName: this.data.monthName,
2663
+ year: s.year,
2664
+ today: t,
2665
+ current: s,
2666
+ blockPriorDates: this.blockPriorDates,
2667
+ onDateClick: (c) => this.handleClick(c),
2668
+ onMonthClick: (c) => {
2669
+ c.preventDefault(), c.stopPropagation(), this.state.view = "months";
2670
+ },
2671
+ onYearClick: (c) => {
2672
+ c.preventDefault(), c.stopPropagation(), this.state.view = "years";
2673
+ },
2674
+ next: () => {
2675
+ const c = this.data.current, u = c.month === 11 ? { month: 0, year: c.year + 1 } : { month: c.month + 1, year: c.year };
2676
+ this.setCurrent(u);
2677
+ },
2678
+ previous: () => {
2679
+ const c = this.data.current, u = c.month === 0 ? { month: 11, year: c.year - 1 } : { month: c.month - 1, year: c.year };
2680
+ this.setCurrent(u);
2681
+ }
2682
+ });
2683
+ }
2684
+ })
2685
+ ]);
2686
+ }
2687
+ }
2688
+ const nn = ({ bind: e, required: t }) => p({
2689
+ cache: "input",
2690
+ class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
2691
+ bind: e,
2692
+ required: t
2693
+ }), an = ({ bind: e, required: t, toggleOpen: s }) => w({
2694
+ class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 px-4 py-2",
2695
+ click: s
2696
+ }, [
2697
+ nn({ bind: e, required: t }),
2698
+ W(({ state: n }) => [
2699
+ f(U.date(["[[start]]", n], "Start Date")),
2700
+ f(" - "),
2701
+ f(U.date(["[[end]]", n], "End Date"))
2702
+ ]),
2703
+ Y({ html: g.calendar.days })
2704
+ ]), on = ({ handleDateSelect: e, blockPriorDates: t }) => me((s, n, a) => new te({
2705
+ cache: "dropdown",
2706
+ parent: a,
2707
+ button: a.panel,
2708
+ size: "xl"
2709
+ }, [
2710
+ new sn({
2711
+ startDate: a.state.start,
2712
+ endDate: a.state.end,
2713
+ onRangeSelect: e,
2714
+ blockPriorDates: t
2715
+ })
2716
+ ])), to = O(
2717
+ {
2718
+ /**
2719
+ * The initial state of the DateRangePicker.
2720
+ *
2721
+ * @member {object} state
2722
+ */
2723
+ state() {
2724
+ return {
2725
+ start: this.start ?? null,
2726
+ end: this.end ?? null,
2727
+ open: !1
2728
+ };
2729
+ },
2730
+ /**
2731
+ * This is added to check the input after the component is rendered.
2732
+ * to see if the bind updated the input value.
2733
+ *
2734
+ * @returns {void}
2735
+ */
2736
+ after() {
2737
+ if (this.input.value) {
2738
+ const e = this.input.value.split("-");
2739
+ this.state.start = e[0], this.state.end = e[1];
2740
+ }
2741
+ },
2742
+ /**
2743
+ * Renders the DatePicker component.
2744
+ *
2745
+ * @returns {object}
2746
+ */
2747
+ render() {
2748
+ const e = (s, { state: n }) => n.toggle("open"), t = (s, n) => {
2749
+ this.state.start = s, this.state.end = n, this.state.open = !1, this.input.value = `${s}-${n}`, L.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: n }, this.parent);
2750
+ };
2751
+ return o({ class: "relative w-full max-w-[320px]" }, [
2752
+ an({
2753
+ toggleOpen: e,
2754
+ bind: this.bind,
2755
+ required: this.required
2756
+ }),
2757
+ on({
2758
+ handleDateSelect: t,
2759
+ blockPriorDates: this.blockPriorDates || !1
2760
+ })
2761
+ ]);
2762
+ }
2763
+ }
2764
+ );
2765
+ function ln(e) {
2766
+ let t = "";
2767
+ return e.length > 0 && (t = e.substring(0, 2), e.length > 2 && (t += ":" + e.substring(2, 4))), t;
2768
+ }
2769
+ function rn(e) {
2770
+ if (e.length < 4)
2771
+ return { formattedTime: null, hour: null, minute: null, meridian: null };
2772
+ const t = parseInt(e.substring(0, 2), 10), s = parseInt(e.substring(2, 4), 10);
2773
+ if (t < 0 || t > 23 || s < 0 || s > 59)
2774
+ return { formattedTime: null, hour: null, minute: null, meridian: null };
2775
+ let n = t, a = "AM";
2776
+ return t === 0 ? n = 12 : t > 12 ? (n = t - 12, a = "PM") : t === 12 && (a = "PM"), {
2777
+ formattedTime: `${n.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${a}`,
2778
+ hour: n.toString().padStart(2, "0"),
2779
+ minute: s.toString().padStart(2, "0"),
2780
+ meridian: a
2781
+ };
2782
+ }
2783
+ function cn({ bind: e, required: t }) {
2784
+ return p({
2785
+ cache: "input",
2786
+ class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
2787
+ bind: e,
2788
+ required: t
2789
+ });
2790
+ }
2791
+ function dn({ placeholder: e, handleInputChange: t, handleInputFocus: s }) {
2792
+ return p({
2793
+ cache: "timeInput",
2794
+ class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
2795
+ placeholder: e || "hh:mm AM/PM",
2796
+ input: t,
2797
+ focus: s,
2798
+ onState: ["selectedTime", (n) => n || ""]
2799
+ });
2800
+ }
2801
+ function un({ bind: e, required: t, toggleOpen: s, handleInputChange: n, handleInputFocus: a, placeholder: l }) {
2802
+ return o(
2803
+ {
2804
+ class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
2805
+ },
2806
+ [
2807
+ cn({ bind: e, required: t }),
2808
+ dn({ placeholder: l, handleInputChange: n, handleInputFocus: a }),
2809
+ w(
2810
+ {
2811
+ class: "shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
2812
+ click: s
2813
+ },
2814
+ [
2815
+ Y({ html: g.clock })
2816
+ ]
2817
+ )
2818
+ ]
2819
+ );
2820
+ }
2821
+ function re({ items: e, handleTimeSelect: t, state: s, stateValue: n, pad: a = !1 }) {
2822
+ return o(
2823
+ { class: "flex flex-col max-h-[200px] overflow-y-auto" },
2824
+ e.map((l) => {
2825
+ let i = a ? l.toString().padStart(2, "0") : l.toString();
2826
+ return w({
2827
+ text: i,
2828
+ class: "hover:bg-muted/50 rounded-md pr-2 py-1",
2829
+ click: () => t({ [n]: i }),
2830
+ onState: [s, n, { "bg-muted": i }]
2831
+ });
2832
+ })
2833
+ );
2834
+ }
2835
+ function hn({ handleTimeSelect: e }) {
2836
+ return me(
2837
+ (t, s, n) => new te(
2838
+ {
2839
+ cache: "dropdown",
2840
+ parent: n,
2841
+ button: n.panel,
2842
+ size: "fit"
2843
+ },
2844
+ [
2845
+ o(
2846
+ { class: "flex flex-auto flex-col border rounded-md shadow-md" },
2847
+ [
2848
+ o(
2849
+ { class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
2850
+ [
2851
+ // Hours column
2852
+ re({
2853
+ items: Array.from({ length: 12 }, (a, l) => l + 1),
2854
+ handleTimeSelect: e,
2855
+ state: n.state,
2856
+ stateValue: "hour",
2857
+ pad: !0
2858
+ }),
2859
+ // Minutes column
2860
+ re({
2861
+ items: Array.from({ length: 60 }, (a, l) => l),
2862
+ handleTimeSelect: e,
2863
+ state: n.state,
2864
+ stateValue: "minute",
2865
+ pad: !0
2866
+ }),
2867
+ // AM/PM column
2868
+ re({
2869
+ items: ["AM", "PM"],
2870
+ handleTimeSelect: e,
2871
+ state: n.state,
2872
+ stateValue: "meridian"
2873
+ })
2874
+ ]
2875
+ )
2876
+ ]
2877
+ )
2878
+ ]
2879
+ )
2880
+ );
2881
+ }
2882
+ function He(e) {
2883
+ if (!e)
2884
+ return { hour: null, minute: null, meridian: null };
2885
+ const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
2886
+ if (!s)
2887
+ return { hour: null, minute: null, meridian: null };
2888
+ let [, n, a, , l] = s, i = parseInt(n, 10), c = parseInt(a, 10);
2889
+ return i < 0 || i > 23 || c < 0 || c > 59 ? { hour: null, minute: null, meridian: null } : (l ? (l = l.toUpperCase(), l === "PM" && i < 12 ? i += 12 : l === "AM" && i === 12 && (i = 12)) : i === 0 ? (l = "AM", i = 12) : i < 12 ? l = "AM" : i === 12 ? l = "PM" : (l = "PM", i -= 12), {
2890
+ hour: i.toString().padStart(2, "0"),
2891
+ minute: c.toString().padStart(2, "0"),
2892
+ meridian: l
2893
+ });
2894
+ }
2895
+ const so = O(
2896
+ {
2897
+ /**
2898
+ * The initial shallow state of the TimePicker.
2899
+ *
2900
+ * @member {object} state
2901
+ */
2902
+ state() {
2903
+ const e = this.selectedTime ?? null, { hour: t, minute: s, meridian: n } = He(e);
2904
+ return {
2905
+ selectedTime: e,
2906
+ open: !1,
2907
+ hour: t,
2908
+ minute: s,
2909
+ meridian: n
2910
+ };
2911
+ },
2912
+ /**
2913
+ * Updates the state after the input is rendered.
2914
+ *
2915
+ * @returns {void}
2916
+ */
2917
+ after() {
2918
+ if (this.input.value) {
2919
+ const { hour: e, minute: t, meridian: s } = He(this.input.value);
2920
+ this.state.set({
2921
+ hour: e,
2922
+ minute: t,
2923
+ meridian: s,
2924
+ selectedTime: this.input.value
2925
+ });
2926
+ }
2927
+ },
2928
+ /**
2929
+ * Toggles the time picker popover.
2930
+ *
2931
+ * @param {Event} e
2932
+ * @param {object} context
2933
+ */
2934
+ toggleOpen(e, { state: t }) {
2935
+ t.toggle("open");
2936
+ },
2937
+ /**
2938
+ * Handles direct input changes and formats the time.
2939
+ *
2940
+ * @param {Event} e
2941
+ */
2942
+ handleInputChange(e) {
2943
+ let t = e.target.value.replace(/[^\d]/g, ""), s = ln(t);
2944
+ const n = rn(t);
2945
+ n.formattedTime && (s = n.formattedTime, this.state.set({
2946
+ hour: n.hour,
2947
+ minute: n.minute,
2948
+ meridian: n.meridian,
2949
+ selectedTime: n.formattedTime
2950
+ }), this.input.value = n.formattedTime, L.trigger("change", this.input), typeof this.change == "function" && this.change(n.formattedTime)), e.target.value = s;
2951
+ },
2952
+ /**
2953
+ * Handles input focus - select all text for easy editing.
2954
+ *
2955
+ * @param {Event} e
2956
+ */
2957
+ handleInputFocus(e) {
2958
+ e.target.select();
2959
+ },
2960
+ /**
2961
+ * Handles time selection from the picker columns.
2962
+ *
2963
+ * @param {object} params
2964
+ */
2965
+ handleTimeSelect({ hour: e, minute: t, meridian: s }) {
2966
+ if (e && (this.state.hour = e), t && (this.state.minute = t), s && (this.state.meridian = s), this.state.hour && this.state.minute && this.state.meridian) {
2967
+ const n = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
2968
+ this.state.selectedTime = n, this.state.open = !1, this.input.value = n, L.trigger("change", this.input), typeof this.change == "function" && this.change(n);
2969
+ }
2970
+ },
2971
+ /**
2972
+ * Renders the TimePicker component.
2973
+ *
2974
+ * @returns {object}
2975
+ */
2976
+ render() {
2977
+ return o(
2978
+ { class: "relative w-full max-w-[320px]" },
2979
+ [
2980
+ un({
2981
+ toggleOpen: this.toggleOpen.bind(this),
2982
+ bind: this.bind,
2983
+ required: this.required,
2984
+ handleInputChange: this.handleInputChange.bind(this),
2985
+ handleInputFocus: this.handleInputFocus.bind(this),
2986
+ placeholder: this.placeholder
2987
+ }),
2988
+ hn({
2989
+ handleTimeSelect: this.handleTimeSelect.bind(this)
2990
+ })
2991
+ ]
2992
+ );
2993
+ }
2994
+ }
2995
+ ), fn = (e, t) => o({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
2996
+ b({ size: "lg" }, e)
2997
+ ]), gn = ({ title: e }) => Z({ class: "flex flex-auto items-center" }, [
2998
+ J({ class: "text-lg font-semibold" }, e)
2999
+ ]), no = r((e, t) => it(
3000
+ {
3001
+ class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
3002
+ rounded-lg flex flex-auto flex-col
3003
+ bottom-4 top-auto inset-auto m-auto md:bottom-0 md:top-0 left-0 right-0 ${e.class}`,
3004
+ // @ts-ignore
3005
+ click: e.click,
3006
+ aria: { expanded: ["open"] }
3007
+ },
3008
+ [
3009
+ o({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
3010
+ // Icon and content
3011
+ // @ts-ignore
3012
+ e.icon && fn(e.icon, e.iconColor),
3013
+ o({ class: "flex flex-auto flex-col gap-4" }, [
3014
+ o({ class: "flex flex-auto flex-col gap-y-2" }, [
3015
+ gn(e),
3016
+ // @ts-ignore
3017
+ e.description && k({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
3018
+ o({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
3019
+ ]),
3020
+ // @ts-ignore
3021
+ e.buttons && ue({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:gap-x-2" }, e.buttons)
3022
+ ])
3023
+ ])
3024
+ ]
3025
+ )), ao = r((e, t = []) => o({ class: "w-full max-w-md p-6 m-auto" }, [
3026
+ Ge({ class: "flex flex-auto flex-col" }, [
3027
+ o({ class: "flex flex-auto flex-col gap-y-4" }, [
3028
+ o({ class: "flex flex-auto items-center justify-center" }, [
3029
+ // @ts-ignore
3030
+ e.icon && o({ class: "w-16 h-16 mb-2 text-primary" }, [
3031
+ // @ts-ignore
3032
+ b({ size: "lg" }, e.icon)
3033
+ ])
3034
+ ]),
3035
+ Z({ class: "py-4 text-center" }, [
3036
+ // @ts-ignore
3037
+ J({ class: "text-xl font-bold" }, e.title),
3038
+ // @ts-ignore
3039
+ k({ class: "pb-8 text-muted-foreground" }, e.description || ""),
3040
+ ...t
3041
+ ])
3042
+ ])
3043
+ ])
3044
+ ]));
3045
+ r((e, t) => ({
3046
+ class: "flex items-center px-4 py-2",
3047
+ ...e,
3048
+ children: t
3049
+ }));
3050
+ r(({ value: e, label: t }) => w({
3051
+ class: "inline-flex flex-auto items-center justify-center whitespace-nowrap rounded-md px-8 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
3052
+ onState: ["performance", { active: e }],
3053
+ dataSet: ["performance", ["state", e, "active"]],
3054
+ click: (s, { state: n }) => n.performance = e
3055
+ }, t));
3056
+ const mn = (e, t) => {
3057
+ const s = e.toggleAllSelectedRows();
3058
+ t.state.checked = !s;
3059
+ }, xn = (e) => Ue({ class: `cursor-pointer py-3 px-4 text-base w-10 ${e.class || ""}` }, [
3060
+ W((t) => new Rt({ class: "mr-2", onChange: (s, n) => mn(t, n) }))
3061
+ ]), bn = ({ align: e, sortable: t, key: s, label: n, sort: a, class: l }) => {
3062
+ const i = e || "justify-start";
3063
+ return Ue({
3064
+ class: `cursor-pointer py-3 px-4 text-base ${l || ""}`,
3065
+ click: t && (() => a(s))
3066
+ }, [
3067
+ o({ class: `flex flex-auto w-full items-center ${i}` }, [
3068
+ f(n),
3069
+ t && Y({ class: "ml-2", html: g.arrows.upDown })
3070
+ ])
3071
+ ]);
3072
+ }, pe = (e) => ct([
3073
+ dt({
3074
+ class: "text-muted-foreground border-b",
3075
+ map: [
3076
+ e.headers,
3077
+ (t) => t.label === "checkbox" ? xn({ toggle: e.toggle }) : bn({
3078
+ align: t.align,
3079
+ sortable: t.sortable,
3080
+ key: t.key,
3081
+ label: t.label,
3082
+ sort: e.sort
3083
+ })
3084
+ ]
3085
+ })
3086
+ ]), pn = ({ key: e, rows: t, selectRow: s, rowItem: n, emptyState: a, skeleton: l, columnCount: i }) => new xt({
3087
+ cache: "list",
3088
+ key: e,
3089
+ items: t,
3090
+ rowItem: (c) => n(c, s),
3091
+ class: "divide-y divide-border",
3092
+ emptyState: a,
3093
+ skeleton: l,
3094
+ columnCount: i
3095
+ });
3096
+ class Qe extends C {
3097
+ /**
3098
+ * Initializes component data.
3099
+ *
3100
+ * @returns {Data}
3101
+ */
3102
+ setData() {
3103
+ let t = this.rows && this.rows.length > 0;
3104
+ return (this.loadMoreItems || this.tableData) && !t && (t = null), new z({
3105
+ selectedRows: [],
3106
+ // @ts-ignore
3107
+ hasItems: t,
3108
+ selected: !1
3109
+ });
3110
+ }
3111
+ /**
3112
+ * This will toggle all selected rows.
3113
+ *
3114
+ * @returns {boolean}
3115
+ */
3116
+ toggleAllSelectedRows() {
3117
+ const t = this.list.getRows(), s = this.data.selectedRows.length === t.length, n = s ? [] : t;
3118
+ return this.data.selectedRows = n, this.updateSelected(), this.updateTable(!s), s;
3119
+ }
3120
+ /**
3121
+ * This will update the selected state.
3122
+ *
3123
+ * @returns {void}
3124
+ */
3125
+ updateSelected() {
3126
+ const t = this.data.get("selectedRows");
3127
+ this.data.selected = t.length > 0;
3128
+ }
3129
+ /**
3130
+ * This will get the selected rows.
3131
+ *
3132
+ * @returns {Array<object>}
3133
+ */
3134
+ getSelectedRows() {
3135
+ return this.data.get("selectedRows");
3136
+ }
3137
+ /**
3138
+ * This will update the table rows.
3139
+ *
3140
+ * @protected
3141
+ * @param {boolean} selected
3142
+ * @returns {void}
3143
+ */
3144
+ updateTable(t) {
3145
+ const s = this.list.getRows();
3146
+ s.forEach((n) => n.selected = t), this.list.setRows(s);
3147
+ }
3148
+ /**
3149
+ * Handles row selection.
3150
+ *
3151
+ * @param {object} row
3152
+ */
3153
+ selectRow(t) {
3154
+ const s = t.selected ?? !1;
3155
+ t.selected = !s;
3156
+ const n = this.data.get("selectedRows"), a = t.selected ? [...n, t] : n.filter((l) => l !== t);
3157
+ this.data.selectedRows = a, this.updateSelected();
3158
+ }
3159
+ /**
3160
+ * Gets the number of header columns.
3161
+ *
3162
+ * @returns {number}
3163
+ */
3164
+ getHeaderColCount() {
3165
+ return this.customHeader ? this.customHeader?.children[0]?.children?.length : this.headers ? this.headers.length : 3;
3166
+ }
3167
+ /**
3168
+ * Renders the DataTable component.
3169
+ *
3170
+ * @returns {object}
3171
+ */
3172
+ render() {
3173
+ const t = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
3174
+ return o({ class: "w-full flex flex-auto flex-col" }, [
3175
+ Q("hasItems", (n) => n === !1 && this.emptyState ? this.emptyState() : null),
3176
+ o({ class: `w-full rounded-md ${t} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
3177
+ xe({ class: "w-full" }, [
3178
+ // @ts-ignore
3179
+ this.headers && pe({ headers: this.headers, sort: (n) => this.sortRows(n) }),
3180
+ // @ts-ignore
3181
+ this.customHeader ?? null,
3182
+ pn({
3183
+ // @ts-ignore
3184
+ key: this.key,
3185
+ // @ts-ignore
3186
+ rows: this.rows,
3187
+ // @ts-ignore
3188
+ selectRow: this.selectRow.bind(this),
3189
+ // @ts-ignore
3190
+ rowItem: this.rowItem,
3191
+ // @ts-ignore
3192
+ emptyState: this.emptyState,
3193
+ // @ts-ignore
3194
+ skeleton: this.skeleton,
3195
+ columnCount: s
3196
+ })
3197
+ ])
3198
+ ])
3199
+ ]);
3200
+ }
3201
+ /**
3202
+ * This will remove items from the list.
3203
+ *
3204
+ * @public
3205
+ * @param {array} items
3206
+ * @returns {void}
3207
+ */
3208
+ remove(t) {
3209
+ this.list.remove(t);
3210
+ }
3211
+ /**
3212
+ * This will set the items in the list.
3213
+ *
3214
+ * @public
3215
+ * @param {array} rows
3216
+ * @returns {void}
3217
+ */
3218
+ setRows(t) {
3219
+ this.list.setRows(t);
3220
+ }
3221
+ /**
3222
+ * This will append items to the list.
3223
+ *
3224
+ * @public
3225
+ * @param {array|object} items
3226
+ * @returns {void}
3227
+ */
3228
+ append(t) {
3229
+ this.list.append(t);
3230
+ }
3231
+ /**
3232
+ * This will mingle the new items with the old items.
3233
+ *
3234
+ * @public
3235
+ * @param {Array<Object>} newItems
3236
+ * @param {boolean} withDelete
3237
+ * @returns {void}
3238
+ */
3239
+ mingle(t, s = !1) {
3240
+ this.list.mingle(t, s);
3241
+ }
3242
+ /**
3243
+ * This will prepend items to the list.
3244
+ *
3245
+ * @public
3246
+ * @param {array|object} items
3247
+ * @returns {void}
3248
+ */
3249
+ prepend(t) {
3250
+ this.list.prepend(t);
3251
+ }
3252
+ /**
3253
+ * This will remove the selected rows.
3254
+ *
3255
+ * @returns {void}
3256
+ */
3257
+ beforeDestroy() {
3258
+ this.data.selectedRows = [];
3259
+ }
3260
+ }
3261
+ const yn = (e) => new bt({
3262
+ cache: "list",
3263
+ loadMoreItems: e.loadMoreItems,
3264
+ offset: e.offset,
3265
+ limit: e.limit,
3266
+ key: e.key,
3267
+ tableData: e.tableData,
3268
+ items: e.items,
3269
+ rowItem: (t) => e.rowItem(t, e.selectRow),
3270
+ class: "divide-y divide-border",
3271
+ skeleton: e.skeleton,
3272
+ columnCount: e.columnCount
3273
+ });
3274
+ class wn extends Qe {
3275
+ /**
3276
+ * Renders the DataTable component.
3277
+ *
3278
+ * @returns {object}
3279
+ */
3280
+ render() {
3281
+ const t = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
3282
+ return o({ class: "w-full flex flex-auto flex-col" }, [
3283
+ Q("hasItems", (n) => n === !1 && this.emptyState ? this.emptyState() : null),
3284
+ o({ class: `w-full rounded-md ${t} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
3285
+ xe({ class: "w-full" }, [
3286
+ // @ts-ignore
3287
+ this.headers && pe({ headers: this.headers, sort: (n) => this.sortRows(n) }),
3288
+ // @ts-ignore
3289
+ this.customHeader ?? null,
3290
+ yn({
3291
+ // @ts-ignore
3292
+ loadMoreItems: this.loadMoreItems,
3293
+ // @ts-ignore
3294
+ offset: this.offset,
3295
+ // @ts-ignore
3296
+ limit: this.limit,
3297
+ // @ts-ignore
3298
+ class: this.class,
3299
+ // @ts-ignore
3300
+ tableData: this.tableData,
3301
+ // @ts-ignore
3302
+ key: this.key,
3303
+ // @ts-ignore
3304
+ items: this.rows,
3305
+ // @ts-ignore
3306
+ selectRow: this.selectRow.bind(this),
3307
+ // @ts-ignore
3308
+ rowItem: this.rowItem,
3309
+ // @ts-ignore
3310
+ skeleton: this.skeleton,
3311
+ columnCount: s
3312
+ })
3313
+ ])
3314
+ ])
3315
+ ]);
3316
+ }
3317
+ /**
3318
+ * Refreshes the list.
3319
+ *
3320
+ * @returns {void}
3321
+ */
3322
+ refresh() {
3323
+ this.list.refresh();
3324
+ }
3325
+ }
3326
+ const oo = r((e) => new wn(
3327
+ {
3328
+ // @ts-ignore
3329
+ cache: e.cache ?? "list",
3330
+ // @ts-ignore
3331
+ tableData: e.data,
3332
+ // @ts-ignore
3333
+ loadMoreItems: e.loadMoreItems,
3334
+ // @ts-ignore
3335
+ offset: e.offset,
3336
+ // @ts-ignore
3337
+ limit: e.limit,
3338
+ // @ts-ignore
3339
+ class: e.class,
3340
+ // @ts-ignore
3341
+ key: e.key,
3342
+ // @ts-ignore
3343
+ rows: e.rows,
3344
+ // @ts-ignore
3345
+ rowItem: e.rowItem,
3346
+ // @ts-ignore
3347
+ headers: e.headers,
3348
+ // @ts-ignore
3349
+ customHeader: e.customHeader,
3350
+ // @ts-ignore
3351
+ border: e.border,
3352
+ // @ts-ignore
3353
+ emptyState: e.emptyState,
3354
+ // @ts-ignore
3355
+ skeleton: e.skeleton
3356
+ }
3357
+ )), vn = (e) => new pt({
3358
+ cache: "list",
3359
+ scrollContainer: e.scrollContainer,
3360
+ loadMoreItems: e.loadMoreItems,
3361
+ offset: e.offset,
3362
+ limit: e.limit,
3363
+ key: e.key,
3364
+ tableData: e.tableData,
3365
+ items: e.items,
3366
+ rowItem: (t) => e.rowItem(t, e.selectRow),
3367
+ class: "divide-y divide-border",
3368
+ skeleton: e.skeleton,
3369
+ columnCount: e.columnCount
3370
+ });
3371
+ class kn extends Qe {
3372
+ /**
3373
+ * Renders the DataTable component.
3374
+ *
3375
+ * @returns {object}
3376
+ */
3377
+ render() {
3378
+ const t = this.border !== !1 ? "border" : "", s = this.getHeaderColCount();
3379
+ return o({ class: "w-full flex flex-auto flex-col" }, [
3380
+ Q("hasItems", (n) => n === !1 && this.emptyState ? this.emptyState() : null),
3381
+ o({ class: `w-full rounded-md ${t} overflow-x-auto`, onSet: ["hasItems", { hidden: !1 }] }, [
3382
+ xe({ class: "w-full" }, [
3383
+ // @ts-ignore
3384
+ this.headers && pe({ headers: this.headers, sort: (n) => this.sortRows(n) }),
3385
+ // @ts-ignore
3386
+ this.customHeader ?? null,
3387
+ vn({
3388
+ // @ts-ignore
3389
+ scrollContainer: this.scrollContainer,
3390
+ // @ts-ignore
3391
+ loadMoreItems: this.loadMoreItems,
3392
+ // @ts-ignore
3393
+ offset: this.offset,
3394
+ // @ts-ignore
3395
+ limit: this.limit,
3396
+ // @ts-ignore
3397
+ class: this.class,
3398
+ // @ts-ignore
3399
+ tableData: this.tableData,
3400
+ // @ts-ignore
3401
+ key: this.key,
3402
+ // @ts-ignore
3403
+ items: this.rows,
3404
+ // @ts-ignore
3405
+ selectRow: this.selectRow.bind(this),
3406
+ // @ts-ignore
3407
+ rowItem: this.rowItem,
3408
+ // @ts-ignore
3409
+ skeleton: this.skeleton,
3410
+ columnCount: s
3411
+ })
3412
+ ])
3413
+ ])
3414
+ ]);
3415
+ }
3416
+ /**
3417
+ * Refreshes the list.
3418
+ *
3419
+ * @returns {void}
3420
+ */
3421
+ refresh() {
3422
+ this.list.refresh();
3423
+ }
3424
+ }
3425
+ const lo = r((e) => new kn(
3426
+ {
3427
+ // @ts-ignore
3428
+ cache: e.cache ?? "list",
3429
+ // @ts-ignore
3430
+ tableData: e.data,
3431
+ // @ts-ignore
3432
+ scrollContainer: e.scrollContainer,
3433
+ // @ts-ignore
3434
+ loadMoreItems: e.loadMoreItems,
3435
+ // @ts-ignore
3436
+ offset: e.offset,
3437
+ // @ts-ignore
3438
+ limit: e.limit,
3439
+ // @ts-ignore
3440
+ class: e.class,
3441
+ // @ts-ignore
3442
+ key: e.key,
3443
+ // @ts-ignore
3444
+ rows: e.rows,
3445
+ // @ts-ignore
3446
+ rowItem: e.rowItem,
3447
+ // @ts-ignore
3448
+ headers: e.headers,
3449
+ // @ts-ignore
3450
+ customHeader: e.customHeader,
3451
+ // @ts-ignore
3452
+ border: e.border,
3453
+ // @ts-ignore
3454
+ emptyState: e.emptyState,
3455
+ // @ts-ignore
3456
+ skeleton: e.skeleton
3457
+ }
3458
+ )), Cn = r(({ name: e, email: t }) => o({ class: "min-w-0 flex-auto" }, [
3459
+ k({ class: "text-base font-semibold leading-6 m-0" }, e),
3460
+ k({ class: "truncate text-sm leading-5 text-muted-foreground m-0" }, t)
3461
+ ])), Sn = () => o({ class: "flex items-center gap-x-1.5" }, [
3462
+ o({ class: "flex-none rounded-full bg-emerald-500/20 p-1" }, [
3463
+ o({ class: "h-1.5 w-1.5 rounded-full bg-emerald-500" })
3464
+ ]),
3465
+ k({ class: "text-xs leading-5 text-gray-500" }, "Online")
3466
+ ]), $n = (e) => k({ class: "text-xs leading-5 text-muted-foreground" }, [
3467
+ f("Last seen "),
3468
+ ut({ datetime: e }, "3h ago")
3469
+ ]), Dn = (e, t) => e === "online" ? Sn() : $n(t), In = r(({ role: e, lastSeen: t, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
3470
+ k({ class: "text-sm leading-6 m-0" }, e),
3471
+ Dn(s, t)
3472
+ ])), Tn = (e) => e.split(" ").map((s) => s[0]).join(""), Mn = r((e) => ge({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
3473
+ o({ class: "flex min-w-0 gap-x-4" }, [
3474
+ // @ts-ignore
3475
+ us({ src: e.image, alt: e.name, fallbackText: Tn(e.name) }),
3476
+ // @ts-ignore
3477
+ Cn({ name: e.name, email: e.email })
3478
+ ]),
3479
+ In({
3480
+ // @ts-ignore
3481
+ role: e.role,
3482
+ // @ts-ignore
3483
+ lastSeen: e.lastSeen,
3484
+ // @ts-ignore
3485
+ status: e.status
3486
+ })
3487
+ ])), ro = r((e) => new yt({
3488
+ cache: "list",
3489
+ key: "name",
3490
+ // @ts-ignore
3491
+ items: e.users,
3492
+ role: "list",
3493
+ class: "divide-y divide-border",
3494
+ rowItem: Mn
3495
+ }));
3496
+ class Bn extends C {
3497
+ /**
3498
+ * This will declare the props for the compiler.
3499
+ *
3500
+ * @returns {void}
3501
+ */
3502
+ declareProps() {
3503
+ this.class = "", this.checkCallBack = null;
3504
+ }
3505
+ /**
3506
+ * This will render the component.
3507
+ *
3508
+ * @override
3509
+ * @returns {object}
3510
+ */
3511
+ render() {
3512
+ const t = this.state;
3513
+ return w({
3514
+ class: this.class || "",
3515
+ onState: [
3516
+ ["selected", {
3517
+ selected: !0
3518
+ }],
3519
+ ["active", {
3520
+ active: !0
3521
+ }]
3522
+ ],
3523
+ click: () => {
3524
+ if (t.toggle("active"), !this.checkCallBack)
3525
+ return;
3526
+ const s = t.active ? this : null;
3527
+ this.checkCallBack(s);
3528
+ }
3529
+ }, this.children);
3530
+ }
3531
+ /**
3532
+ * This will set up the states.
3533
+ *
3534
+ * @override
3535
+ * @protected
3536
+ * @returns {object}
3537
+ */
3538
+ setupStates() {
3539
+ return {
3540
+ selected: !1,
3541
+ active: !1
3542
+ };
3543
+ }
3544
+ /**
3545
+ * This will update the states.
3546
+ *
3547
+ * @param {object} selected
3548
+ * @returns {void}
3549
+ */
3550
+ update(t) {
3551
+ this.state.set({
3552
+ selected: t,
3553
+ active: t
3554
+ });
3555
+ }
3556
+ }
3557
+ const Pn = r(({ options: e, click: t }, s) => ({
3558
+ tag: "li",
3559
+ ...{
3560
+ class: `relative flex flex-row w-auto text-left p-0 transition-all cursor-pointer min-w-[48px] option${e ? " sub" : ""}`,
3561
+ click: t
3562
+ },
3563
+ children: s
3564
+ })), zn = (e, t = null, s = !1) => [
3565
+ t && o({
3566
+ class: "icon w-12 rounded-md flex items-center justify-center min-w-12",
3567
+ onState: ["selected", {
3568
+ selected: !0
3569
+ }]
3570
+ }, [
3571
+ b({ size: "sm" }, t)
3572
+ ]),
3573
+ V({ class: "label flex flex-auto text-sm items-center cursor-pointer whitespace-nowrap" }, e),
3574
+ s && f(
3575
+ {
3576
+ class: "flex justify-center items-center px-1 transition-all text-muted-foreground mr-2",
3577
+ onState: [
3578
+ ["selected", {
3579
+ rotate: !0
3580
+ }],
3581
+ ["active", {
3582
+ rotate: !0
3583
+ }]
3584
+ ]
3585
+ },
3586
+ [
3587
+ b({ size: "xs" }, g.chevron.single.down)
3588
+ ]
3589
+ )
3590
+ ];
3591
+ class Je extends C {
3592
+ /**
3593
+ * This will declare the props for the compiler.
3594
+ *
3595
+ * @returns {void}
3596
+ */
3597
+ declareProps() {
3598
+ this.label = "", this.icon = null, this.href = null, this.exact = !1, this.options = null, this.content = null, this.callBack = null, this.checkCallBack = null, this.link = null;
3599
+ }
3600
+ /**
3601
+ * This will render the component.
3602
+ *
3603
+ * @override
3604
+ * @returns {object}
3605
+ */
3606
+ render() {
3607
+ const t = !this.options && this.callBack;
3608
+ return Pn(
3609
+ { options: this.options, click: t },
3610
+ [
3611
+ this.addLink()
3612
+ ]
3613
+ );
3614
+ }
3615
+ /**
3616
+ * This will add the link.
3617
+ *
3618
+ * @returns {object}
3619
+ * @protected
3620
+ */
3621
+ addLink() {
3622
+ const t = this.options && this.options.length > 0, s = this.content || zn(String(this.label), this.icon, t);
3623
+ return this.href ? new gt(
3624
+ {
3625
+ class: "flex flex-auto flex-row rounded-md transition-all overflow-x-hidden",
3626
+ cache: "link",
3627
+ href: this.href,
3628
+ activeClass: "selected",
3629
+ exact: this.exact || !1
3630
+ },
3631
+ s
3632
+ ) : new Bn({
3633
+ class: "flex flex-auto flex-row rounded-md transition-all overflow-x-hidden",
3634
+ cache: "link",
3635
+ checkCallBack: this.checkCallBack
3636
+ }, s);
3637
+ }
3638
+ /**
3639
+ * This will check if the link is selected.
3640
+ *
3641
+ * @returns {boolean}
3642
+ */
3643
+ isSelected() {
3644
+ return this.link.state.get("selected");
3645
+ }
3646
+ update(t) {
3647
+ this.link.update(t);
3648
+ }
3649
+ }
3650
+ const On = r(({ map: e }, t) => X({ class: "navigation-group flex flex-col gap-2 list-none m-0 py-2 px-0", map: e }, [
3651
+ Ae({ class: "text-muted-foreground text-sm py-0 px-4 whitespace-nowrap" }, t)
3652
+ ]));
3653
+ class Nn extends C {
3654
+ /**
3655
+ * This will declare the props for the compiler.
3656
+ *
3657
+ * @returns {void}
3658
+ */
3659
+ declareProps() {
3660
+ this.options = [], this.class = "", this.mobileBorder = !1;
3661
+ }
3662
+ /**
3663
+ * This will render the component.
3664
+ *
3665
+ * @returns {object}
3666
+ */
3667
+ render() {
3668
+ const t = this.mapOptions(this.options), s = this.class || "", n = this.mobileBorder ? "border md:border-0 rounded-md" : "";
3669
+ return fe({ class: `navigation flex flex-auto flex-col ${s}` }, [
3670
+ X({
3671
+ class: `relative group flex flex-col gap-2 py-2 px-2 list-none m-0 ${n}`,
3672
+ map: t
3673
+ }),
3674
+ ...this.addSubs()
3675
+ ]);
3676
+ }
3677
+ /**
3678
+ * This will get the options.
3679
+ *
3680
+ * @param {array} options
3681
+ * @returns {array}
3682
+ */
3683
+ mapOptions(t = []) {
3684
+ return [t.map((n) => n.group ? this.addGroup(n) : this.addLink(n)), (n) => n];
3685
+ }
3686
+ /**
3687
+ * This will get the subs.
3688
+ *
3689
+ * @returns {array}
3690
+ */
3691
+ addSubs() {
3692
+ return [];
3693
+ }
3694
+ /**
3695
+ * This will add a group.
3696
+ *
3697
+ * @param {object} option
3698
+ * @returns {object}
3699
+ */
3700
+ addGroup(t) {
3701
+ const s = this.mapOptions(t.options);
3702
+ return On({ map: s }, t.group);
3703
+ }
3704
+ /**
3705
+ * This will add a link.
3706
+ *
3707
+ * @param {object} option
3708
+ * @returns {object}
3709
+ */
3710
+ addLink(t) {
3711
+ return new Je(t);
3712
+ }
3713
+ }
3714
+ class Ze extends Nn {
3715
+ onCreated() {
3716
+ this.links = [];
3717
+ }
3718
+ /**
3719
+ * This will set up the sub nav.
3720
+ *
3721
+ * @param {object} link
3722
+ * @returns {object}
3723
+ */
3724
+ setupSubNav(t) {
3725
+ return new jn(
3726
+ {
3727
+ parentLink: t,
3728
+ options: t.options
3729
+ }
3730
+ );
3731
+ }
3732
+ /**
3733
+ * This will add a sub navigation.
3734
+ *
3735
+ * @param {object} link
3736
+ * @returns {object}
3737
+ */
3738
+ addSubNav(t) {
3739
+ const s = this.setupSubNav(t);
3740
+ return t.sub = s, s;
3741
+ }
3742
+ /**
3743
+ * This will add a link.
3744
+ *
3745
+ * @param {object} option
3746
+ * @returns {object}
3747
+ */
3748
+ addLink(t) {
3749
+ const s = new Je(t);
3750
+ if (this.links.push(s), !s.options)
3751
+ return s;
3752
+ const n = this.addSubNav(s);
3753
+ return {
3754
+ class: "child-group",
3755
+ link: s,
3756
+ sub: n
3757
+ };
3758
+ }
3759
+ }
3760
+ const Rn = (e, t) => new RegExp(`${e}($|/|\\.).*`).test(t), Fn = (e, t) => {
3761
+ const s = e.link.panel.pathname;
3762
+ return !s && e.isSelected() ? !0 : e.exact ? t === s : Rn(s, t);
3763
+ };
3764
+ class jn extends Ze {
3765
+ /**
3766
+ * This will declare the props for the compiler.
3767
+ *
3768
+ * @returns {void}
3769
+ */
3770
+ declareProps() {
3771
+ super.declareProps(), this.parentLink = null, this.mainClassName = "";
3772
+ }
3773
+ /**
3774
+ * This will render the component.
3775
+ *
3776
+ * @returns {object}
3777
+ */
3778
+ render() {
3779
+ const t = `navigation flex flex-auto flex-col sub ${this.mainClassName || ""}`, s = this.mapOptions(this.options);
3780
+ return fe({ class: t, onState: this.onState() }, [
3781
+ X({ class: "relative group flex flex-col gap-2 py-2 px-0 list-none m-0" }, [...s, ...this.addSubs(), this.addWatcher()])
3782
+ ]);
3783
+ }
3784
+ /**
3785
+ * This will add awatcher to update the links
3786
+ * when the path changes.
3787
+ *
3788
+ * @returns {object}
3789
+ */
3790
+ addWatcher() {
3791
+ return {
3792
+ watch: {
3793
+ value: ["[[path]]", we.data],
3794
+ callBack: this.updateLinks.bind(this)
3795
+ }
3796
+ };
3797
+ }
3798
+ /**
3799
+ * This will set up the on state.
3800
+ *
3801
+ * @returns {array}
3802
+ */
3803
+ onState() {
3804
+ return [
3805
+ ["selected", { active: !0 }],
3806
+ ["active", { active: !0 }]
3807
+ ];
3808
+ }
3809
+ /**
3810
+ * This will set up the states.
3811
+ *
3812
+ * @returns {object}
3813
+ */
3814
+ setupStates() {
3815
+ return {
3816
+ remotes: [
3817
+ {
3818
+ /**
3819
+ * This will link the state to the parent link.
3820
+ */
3821
+ id: this.parentLink.link.getId(),
3822
+ selected: null,
3823
+ active: null
3824
+ }
3825
+ ]
3826
+ };
3827
+ }
3828
+ /**
3829
+ * This will update the links after setup.
3830
+ *
3831
+ * @returns {void}
3832
+ */
3833
+ afterSetup() {
3834
+ const t = we.data.path;
3835
+ this.updateLinks(t);
3836
+ }
3837
+ /**
3838
+ * This will update the links.
3839
+ *
3840
+ * @param {string} value
3841
+ * @returns {void}
3842
+ */
3843
+ updateLinks(t) {
3844
+ let s = !1;
3845
+ for (const n of this.links)
3846
+ if (n.rendered && (s = Fn(n, t), s === !0))
3847
+ break;
3848
+ this.parentLink.update(s);
3849
+ }
3850
+ }
3851
+ const Ln = (e) => he({ class: "text-lg ml-2" }, e), Hn = (e) => o({ class: "sticky flex flex-row items-center bg-popover lg:hidden top-0 z-10 border-0 border-b" }, [
3852
+ x({
3853
+ variant: "icon",
3854
+ class: "m-2",
3855
+ click: (t, { state: s }) => s.toggle("open"),
3856
+ icon: g.arrows.left
3857
+ }),
3858
+ e.title && Ln(e.title)
3859
+ ]), An = () => o({
3860
+ class: `
3861
+ absolute inset-0 bg-black/40 z-[-1] fadeIn
3862
+ transition-opacity duration-200
3863
+ `,
3864
+ click: (e, { state: t }) => t.open = !1
3865
+ });
3866
+ class En extends C {
3867
+ /**
3868
+ * This will declare the props for the compiler.
3869
+ *
3870
+ * @returns {void}
3871
+ */
3872
+ declareProps() {
3873
+ this.title = "";
3874
+ }
3875
+ /**
3876
+ * This will render the modal component.
3877
+ *
3878
+ * @returns {object}
3879
+ */
3880
+ render() {
3881
+ return o({
3882
+ class: "fixed inset-0 z-50",
3883
+ style: "[[typeClass]]"
3884
+ }, [
3885
+ An(),
3886
+ // Popover Content
3887
+ o({
3888
+ class: `
3889
+ absolute popIn w-auto p-0 bg-popover m-auto shadow-lg rounded-md top-0 bottom-0 left-2 right-2 max-h-[85vh] text-inherit block
3890
+ `,
3891
+ dataSet: ["open", ["expanded", !0, "true"]]
3892
+ }, [
3893
+ o({ class: "flex flex-auto flex-col w-full h-full overflow-y-auto max-h-[85vh] rounded-md bg-popover border" }, [
3894
+ Hn({ title: this.title }),
3895
+ o({ class: "flex flex-auto flex-col" }, this.children)
3896
+ ])
3897
+ ])
3898
+ ]);
3899
+ }
3900
+ /**
3901
+ * This will setup the states.
3902
+ *
3903
+ * @returns {object}
3904
+ */
3905
+ setupStates() {
3906
+ return {
3907
+ open: {
3908
+ id: this.parent.getId(),
3909
+ callBack: (n) => {
3910
+ n === !1 && (document.documentElement.style.overflowY = "auto", this.destroy());
3911
+ }
3912
+ }
3913
+ };
3914
+ }
3915
+ /**
3916
+ * This will add the body scroll lock.
3917
+ *
3918
+ * @returns {void}
3919
+ */
3920
+ afterSetup() {
3921
+ document.documentElement.style.overflowY = "hidden";
3922
+ }
3923
+ /**
3924
+ * This will override the set up to use the body.
3925
+ *
3926
+ * @param {object} container
3927
+ */
3928
+ setContainer(t) {
3929
+ this.container = app.root;
3930
+ }
3931
+ }
3932
+ const Xe = () => x({ class: "m-2", variant: "ghost", addState() {
3933
+ return {
3934
+ open: !1
3935
+ };
3936
+ }, click: (e, { state: t }) => t.toggle("open") }, [
3937
+ b({}, g.bar.three)
3938
+ ]), Un = (e) => he({ class: "text-lg ml-2" }, e), Yn = (e) => o({ class: "flex flex-auto flex-row items-center lg:hidden" }, [
3939
+ Xe(),
3940
+ e.title && Un(e.title)
3941
+ ]), et = (e, t) => {
3942
+ e.forEach((s) => {
3943
+ if (s.options) {
3944
+ et(s.options, t);
3945
+ return;
3946
+ }
3947
+ s.callBack = t;
3948
+ });
3949
+ }, tt = (e) => o({ class: "bg-background flex flex-auto flex-col w-full relative" }, [
3950
+ T(
3951
+ "open",
3952
+ (t) => t ? [
3953
+ new En({ title: e.title }, [
3954
+ W(({ state: s }) => {
3955
+ const n = (a) => s.open = !1;
3956
+ return et(e.options, n), new Ze(
3957
+ {
3958
+ options: e.options
3959
+ }
3960
+ );
3961
+ })
3962
+ ])
3963
+ ] : null
3964
+ )
3965
+ ]), io = r((e) => o({ cache: "mobileNav", class: "inline-flex relative lg:hidden" }, [
3966
+ o([
3967
+ Xe(),
3968
+ tt(e)
3969
+ ])
3970
+ ])), co = r((e) => o({ cache: "mobileNav", class: "flex flex-auto flex-col w-full relative lg:hidden" }, [
3971
+ o({ class: "flex flex-auto flex-col w-full" }, [
3972
+ Yn(e),
3973
+ tt(e)
3974
+ ])
3975
+ ])), uo = r((e) => {
3976
+ const t = e.margin || "m-4 ml-0";
3977
+ return e.allowHistory = e.allowHistory === !0, o({ class: `flex-none ${t}` }, [
3978
+ x({ variant: "back", class: "ghost", ...e })
3979
+ ]);
3980
+ });
3981
+ class Vn extends C {
3982
+ /**
3983
+ * This will declare the props for the compiler.
3984
+ *
3985
+ * @returns {void}
3986
+ */
3987
+ declareProps() {
3988
+ this.class = "";
3989
+ }
3990
+ /**
3991
+ * This will render the component.
3992
+ *
3993
+ * @returns {object}
3994
+ */
3995
+ render() {
3996
+ return o(
3997
+ {
3998
+ class: this.getClassName(),
3999
+ // @ts-ignore
4000
+ animateIn: this.animateIn ?? null,
4001
+ // @ts-ignore
4002
+ animateOut: this.animateOut ?? null,
4003
+ onSet: ["loading", {
4004
+ loading: !0
4005
+ }]
4006
+ },
4007
+ [
4008
+ this.addBody()
4009
+ ]
4010
+ );
4011
+ }
4012
+ /**
4013
+ * This will get the overlay className.
4014
+ *
4015
+ * @returns {string}
4016
+ */
4017
+ getClassName() {
4018
+ return `absolute flex flex-auto flex-col overlay left-0 top-0 right-0 z-20
4019
+ h-svh max-h-svh min-h-svh
4020
+ bg-background pointer-events-auto
4021
+ lg:left-16
4022
+ will-change-contents ${this.class || ""}`;
4023
+ }
4024
+ /**
4025
+ * This will setup and render the component.
4026
+ *
4027
+ * @param {object} container
4028
+ * @returns {void}
4029
+ */
4030
+ setContainer(t) {
4031
+ this.container = app.root;
4032
+ }
4033
+ /**
4034
+ * This will setup the overlay states.
4035
+ *
4036
+ * @returns {object}
4037
+ */
4038
+ setupStates() {
4039
+ return {
4040
+ loading: !1
4041
+ };
4042
+ }
4043
+ /**
4044
+ * This will set the loading state.= to true.
4045
+ *
4046
+ * @returns {void}
4047
+ */
4048
+ addLoading() {
4049
+ this.state.loading = !0;
4050
+ }
4051
+ /**
4052
+ * This will set the loading state to false.
4053
+ *
4054
+ * @returns {void}
4055
+ */
4056
+ removeLoading() {
4057
+ this.state.loading = !1;
4058
+ }
4059
+ /**
4060
+ * This will add the body of the overlay.
4061
+ *
4062
+ * @returns {object}
4063
+ */
4064
+ addBody() {
4065
+ return o({ class: "body fadeIn flex flex-auto flex-col bg-background" }, this.getContents());
4066
+ }
4067
+ /**
4068
+ * This will get the body contents.
4069
+ *
4070
+ * @returns {array|null}
4071
+ */
4072
+ getContents() {
4073
+ return this.children;
4074
+ }
4075
+ }
4076
+ Ye.addType("dockableOverlay", (e) => {
4077
+ if (!e)
4078
+ return;
4079
+ const t = e.component;
4080
+ t && t.rendered === !0 && t.state.docked === !1 && t.destroy();
4081
+ });
4082
+ class ho extends Vn {
4083
+ /**
4084
+ * This will stop presistence.
4085
+ *
4086
+ * @returns {void}
4087
+ */
4088
+ onCreated() {
4089
+ this.dockSize = this.maxSize || 1024;
4090
+ }
4091
+ /**
4092
+ * This will render the component.
4093
+ *
4094
+ * @returns {object}
4095
+ */
4096
+ render() {
4097
+ const t = this.container;
4098
+ return o(
4099
+ {
4100
+ // @ts-ignore
4101
+ animateIn: this.animateIn ?? null,
4102
+ // @ts-ignore
4103
+ animateOut: this.animateOut ?? null,
4104
+ onState: [
4105
+ ["loading", {
4106
+ loading: !0
4107
+ }],
4108
+ ["docked", (s, n) => {
4109
+ s ? (n.className = this.getDockedClassName(), t.appendChild(n)) : (n.className = this.getClassName(), app.root.appendChild(n));
4110
+ }]
4111
+ ]
4112
+ },
4113
+ [
4114
+ this.addBody()
4115
+ ]
4116
+ );
4117
+ }
4118
+ /**
4119
+ * This will get the docked className.
4120
+ *
4121
+ * @returns {string}
4122
+ */
4123
+ getDockedClassName() {
4124
+ return "flex flex-auto flex-col bg-background flex will-change-contents " + (this.class || "");
4125
+ }
4126
+ /**
4127
+ * This will setup and render the component.
4128
+ *
4129
+ * @param {object} container
4130
+ * @returns {void}
4131
+ */
4132
+ setup(t) {
4133
+ this.container = t, this.initialize();
4134
+ }
4135
+ /**
4136
+ * This will setup the overlay states.
4137
+ *
4138
+ * @returns {object}
4139
+ */
4140
+ setupStates() {
4141
+ return {
4142
+ loading: !1,
4143
+ docked: this.canDock()
4144
+ };
4145
+ }
4146
+ /**
4147
+ * This will check the dock size.
4148
+ *
4149
+ * @returns {void}
4150
+ */
4151
+ afterSetup() {
4152
+ Ye.add(
4153
+ this.container,
4154
+ "dockableOverlay",
4155
+ {
4156
+ component: this
4157
+ }
4158
+ ), this.onResize();
4159
+ }
4160
+ /**
4161
+ * This will setup the overlay events.
4162
+ *
4163
+ * @returns {Array<object>}
4164
+ */
4165
+ setupEvents() {
4166
+ return [
4167
+ ["resize", globalThis, () => this.onResize()]
4168
+ ];
4169
+ }
4170
+ /**
4171
+ * This will check if the overlay can dock.
4172
+ *
4173
+ * @returns {boolean}
4174
+ */
4175
+ canDock() {
4176
+ return globalThis.innerWidth >= this.dockSize;
4177
+ }
4178
+ /**
4179
+ * This will handle the overlay resize.
4180
+ *
4181
+ * @returns {void}
4182
+ */
4183
+ onResize() {
4184
+ this.state.docked = this.canDock();
4185
+ }
4186
+ }
4187
+ const Wn = r(({ index: e, click: t, state: s }, n) => ge({
4188
+ class: "p-2 cursor-pointer hover:bg-muted/50",
4189
+ onState: [
4190
+ [s, "selectedIndex", {
4191
+ "bg-accent": e,
4192
+ "text-white": e
4193
+ }]
4194
+ ],
4195
+ click: () => t(e)
4196
+ }, n)), qn = r(({ selectOption: e, state: t }) => X({
4197
+ class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
4198
+ for: ["filteredOptions", (s, n) => Wn({ index: n, click: e, state: t }, s.label)]
4199
+ })), Gn = r((e) => o({ class: "relative flex flex-auto items-center" }, [
4200
+ N({
4201
+ cache: "input",
4202
+ // @ts-ignore
4203
+ class: e.class ?? "",
4204
+ // @ts-ignore
4205
+ placeholder: e.placeholder ?? "Search...",
4206
+ // @ts-ignore
4207
+ bind: e.bind ?? [e.state, "searchQuery"],
4208
+ keyup: (t, s) => {
4209
+ s.state && (s.state.open = !1), typeof e.filterOptions == "function" && e.filterOptions(), s.dropdown && s.dropdown.updatePosition(), e.keyup && e.keyup(t, s);
4210
+ },
4211
+ pointerup: (t, s) => {
4212
+ typeof s.toggleDropdown == "function" && s.toggleDropdown();
4213
+ },
4214
+ keydown: (t) => [
4215
+ // @ts-ignore
4216
+ typeof e.handleKeyDown == "function" && e.handleKeyDown(t)
4217
+ ]
4218
+ }),
4219
+ // @ts-ignore
4220
+ e.icon && o({ class: "absolute flex right-0 mr-2" }, [
4221
+ // @ts-ignore
4222
+ b({ size: "sm" }, e.icon)
4223
+ ])
4224
+ ])), _n = (e) => o({
4225
+ class: "relative flex fle-auto flex-col",
4226
+ onState: ["open", (t, s, n) => {
4227
+ if (t)
4228
+ return new te({
4229
+ cache: "dropdown",
4230
+ parent: n,
4231
+ button: n.input,
4232
+ size: "xl"
4233
+ }, [
4234
+ qn(e)
4235
+ ]);
4236
+ }]
4237
+ }), fo = M(
4238
+ {
4239
+ /**
4240
+ * This will set up the data object.
4241
+ *
4242
+ * @returns {object} - The data object.
4243
+ */
4244
+ setData() {
4245
+ const e = this.options || [];
4246
+ return new z({
4247
+ options: e,
4248
+ filteredOptions: e
4249
+ });
4250
+ },
4251
+ /**
4252
+ * This will set up the state object.
4253
+ *
4254
+ * @returns {object} - The state object.
4255
+ */
4256
+ state() {
4257
+ return {
4258
+ searchQuery: "",
4259
+ selectedIndex: -1,
4260
+ open: !1
4261
+ };
4262
+ },
4263
+ /**
4264
+ * This will set the selected index by query.
4265
+ *
4266
+ * @returns {void}
4267
+ */
4268
+ setSelectedIndexByQuery() {
4269
+ const e = this.data.filteredOptions;
4270
+ let { searchQuery: t } = this.state;
4271
+ t = t.toLowerCase();
4272
+ const s = e.findIndex((n) => n.label.toLowerCase() === t);
4273
+ s >= 0 && (this.state.selectedIndex = s);
4274
+ },
4275
+ /**
4276
+ * This will filter the options.
4277
+ *
4278
+ * @returns {void}
4279
+ */
4280
+ filterOptions() {
4281
+ const e = this.state.searchQuery.toLowerCase();
4282
+ if (e === "" || e.length === 0) {
4283
+ this.data.filteredOptions = this.data.options;
4284
+ return;
4285
+ }
4286
+ const t = this.data.get("options");
4287
+ this.data.filteredOptions = t.filter(
4288
+ (s) => s.label.toLowerCase().includes(e)
4289
+ );
4290
+ },
4291
+ /**
4292
+ * This will get the selected value.
4293
+ *
4294
+ * @returns {object}
4295
+ */
4296
+ getValue() {
4297
+ const { selectedIndex: e } = this.state;
4298
+ return e < 0 ? null : this.data.get(`filteredOptions[${e}]`);
4299
+ },
4300
+ /**
4301
+ * This will select an option.
4302
+ *
4303
+ * @param {number} index - The index of the option.
4304
+ * @returns {void}
4305
+ */
4306
+ selectOption(e) {
4307
+ this.state.selectedIndex = e;
4308
+ const t = this.data.get(`filteredOptions[${e}]`);
4309
+ this.state.searchQuery = t.label, this.state.open = !1, typeof this.onSelect == "function" && this.onSelect(t);
4310
+ },
4311
+ /**
4312
+ * Toggles the dropdown open state.
4313
+ */
4314
+ toggleDropdown() {
4315
+ this.state.toggle("open"), this.state.open && this.setSelectedIndexByQuery();
4316
+ },
4317
+ /**
4318
+ * This will handle key down events.
4319
+ *
4320
+ * @param {object} event - The event object.
4321
+ * @returns {void}
4322
+ */
4323
+ handleKeyDown(e) {
4324
+ const t = this.data.filteredOptions, { selectedIndex: s } = this.state;
4325
+ e.key === "ArrowDown" ? (e.preventDefault(), this.state.selectedIndex = Math.min(s + 1, t.length - 1)) : e.key === "ArrowUp" ? (e.preventDefault(), this.state.selectedIndex = Math.max(s - 1, 0)) : e.key === "Enter" && s >= 0 && (e.preventDefault(), this.selectOption(s));
4326
+ },
4327
+ /**
4328
+ * This will render the component.
4329
+ *
4330
+ * @returns {object} - The rendered component.
4331
+ */
4332
+ render() {
4333
+ return o({ class: "relative w-full max-w-md" }, [
4334
+ Gn({
4335
+ // @ts-ignore
4336
+ state: this.state,
4337
+ // @ts-ignore
4338
+ icon: this.icon,
4339
+ // @ts-ignore
4340
+ placeholder: this.placeholder,
4341
+ // @ts-ignore
4342
+ filterOptions: this.filterOptions.bind(this),
4343
+ // @ts-ignore
4344
+ handleKeyDown: this.handleKeyDown.bind(this)
4345
+ }),
4346
+ _n({
4347
+ // @ts-ignore
4348
+ state: this.state,
4349
+ // @ts-ignore
4350
+ setSelected: this.setSelectedIndexByQuery.bind(this),
4351
+ // @ts-ignore
4352
+ selectOption: this.selectOption.bind(this)
4353
+ })
4354
+ ]);
4355
+ }
4356
+ }
4357
+ ), go = r((e) => {
4358
+ const t = e.icon ?? g.magnifyingGlass.default;
4359
+ return o({
4360
+ // @ts-ignore
4361
+ class: `relative flex items-center w-full rounded-xl bg-muted/30 focus-within:ring-2 focus-within:ring-ring transition-all ${e.containerClass || ""}`
4362
+ }, [
4363
+ o({ class: "absolute left-4 flex items-center pointer-events-none text-muted-foreground" }, [
4364
+ b({ size: "sm" }, t)
4365
+ ]),
4366
+ p({
4367
+ type: "text",
4368
+ // @ts-ignore
4369
+ cache: e.cache ?? "input",
4370
+ // @ts-ignore
4371
+ class: `w-full bg-transparent border-none outline-none pl-12 pr-4 py-4 text-base text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-0 ${e.class || ""}`,
4372
+ // @ts-ignore
4373
+ placeholder: e.placeholder ?? "Search...",
4374
+ // @ts-ignore
4375
+ bind: e.bind,
4376
+ // @ts-ignore
4377
+ value: e.value,
4378
+ // @ts-ignore
4379
+ keyup: e.keyup,
4380
+ // @ts-ignore
4381
+ keydown: e.keydown,
4382
+ // @ts-ignore
4383
+ input: e.input,
4384
+ // @ts-ignore
4385
+ change: e.change,
4386
+ // @ts-ignore
4387
+ focus: e.focus,
4388
+ // @ts-ignore
4389
+ blur: e.blur
4390
+ })
4391
+ ]);
4392
+ });
4393
+ class Kn extends C {
4394
+ /**
4395
+ * This will declare the props for the compiler.
4396
+ *
4397
+ * @returns {void}
4398
+ */
4399
+ declareProps() {
4400
+ this.class = "";
4401
+ }
4402
+ /**
4403
+ * This will render the page.
4404
+ *
4405
+ * @returns {object}
4406
+ */
4407
+ render() {
4408
+ return o({ class: `${this.class || ""}` }, this.children);
4409
+ }
4410
+ }
4411
+ class Qn extends Kn {
4412
+ /**
4413
+ * This will be called every time the route
4414
+ * is activated.
4415
+ *
4416
+ * @param {object} params
4417
+ */
4418
+ update(t) {
4419
+ }
4420
+ }
4421
+ const Jn = r((e, t) => (e.class = "basic-page pt-[80px] sm:pt-0 flex flex-auto flex-col " + (e.class || ""), {
4422
+ tag: "section",
4423
+ ...e,
4424
+ children: t
4425
+ })), Zn = r(({ title: e, description: t }) => Z({ class: "sm:py-8 px-6 md:px-5 flex flex-col" }, [
4426
+ ht({ class: "scroll-m-20 text-3xl font-bold tracking-tight" }, e),
4427
+ t && k({ class: "text-base text-muted-foreground py-2 max-w-[700px]" }, t)
4428
+ ]));
4429
+ class mo extends Qn {
4430
+ /**
4431
+ * This will declare the props for the compiler.
4432
+ *
4433
+ * @returns {void}
4434
+ */
4435
+ declareProps() {
4436
+ super.declareProps(), this.title = "", this.description = "";
4437
+ }
4438
+ /**
4439
+ * This will render the page.
4440
+ *
4441
+ * @returns {object}
4442
+ */
4443
+ render() {
4444
+ return Jn([
4445
+ Zn({
4446
+ title: this.title,
4447
+ description: this.description
4448
+ }),
4449
+ wt(this.children)
4450
+ ]);
4451
+ }
4452
+ }
4453
+ export {
4454
+ $a as $,
4455
+ Ra as A,
4456
+ uo as B,
4457
+ Hs as C,
4458
+ Qe as D,
4459
+ Ea as E,
4460
+ no as F,
4461
+ ho as G,
4462
+ Ja as H,
4463
+ oo as I,
4464
+ ga as J,
4465
+ ao as K,
4466
+ ha as L,
4467
+ Ia as M,
4468
+ Ge as N,
4469
+ Fa as O,
4470
+ La as P,
4471
+ ja as Q,
4472
+ Zt as R,
4473
+ Kt as S,
4474
+ Ha as T,
4475
+ Mt as U,
4476
+ Gt as V,
4477
+ _t as W,
4478
+ Qt as X,
4479
+ j as Y,
4480
+ mo as Z,
4481
+ bn as _,
4482
+ us as a,
4483
+ P as a$,
4484
+ ie as a0,
4485
+ Ht as a1,
4486
+ _a as a2,
4487
+ Ze as a3,
4488
+ N as a4,
4489
+ Tt as a5,
4490
+ ua as a6,
4491
+ Ka as a7,
4492
+ Je as a8,
4493
+ Jn as a9,
4494
+ fo as aA,
4495
+ Gn as aB,
4496
+ Ma as aC,
4497
+ go as aD,
4498
+ Ua as aE,
4499
+ jn as aF,
4500
+ pe as aG,
4501
+ fa as aH,
4502
+ ma as aI,
4503
+ qa as aJ,
4504
+ pa as aK,
4505
+ so as aL,
4506
+ Yn as aM,
4507
+ Ga as aN,
4508
+ ia as aO,
4509
+ Na as aP,
4510
+ b as aQ,
4511
+ Sa as aR,
4512
+ ro as aS,
4513
+ Mn as aT,
4514
+ Ve as aU,
4515
+ O as aV,
4516
+ va as aW,
4517
+ Is as aX,
4518
+ qt as aY,
4519
+ la as aZ,
4520
+ oa as a_,
4521
+ Se as aa,
4522
+ Cs as ab,
4523
+ io as ac,
4524
+ co as ad,
4525
+ js as ae,
4526
+ wa as af,
4527
+ Xe as ag,
4528
+ Bn as ah,
4529
+ Nn as ai,
4530
+ On as aj,
4531
+ En as ak,
4532
+ Wa as al,
4533
+ ka as am,
4534
+ Vn as an,
4535
+ Kn as ao,
4536
+ Ca as ap,
4537
+ Ss as aq,
4538
+ te as ar,
4539
+ Hn as as,
4540
+ Pa as at,
4541
+ xa as au,
4542
+ sn as av,
4543
+ Ta as aw,
4544
+ za as ax,
4545
+ Oa as ay,
4546
+ lo as az,
4547
+ An as b,
4548
+ Va as b0,
4549
+ ra as c,
4550
+ Qn as d,
4551
+ Qa as e,
4552
+ x as f,
4553
+ Os as g,
4554
+ It as h,
4555
+ Rt as i,
4556
+ xn as j,
4557
+ da as k,
4558
+ Ba as l,
4559
+ ca as m,
4560
+ Da as n,
4561
+ Ya as o,
4562
+ Za as p,
4563
+ $s as q,
4564
+ Xa as r,
4565
+ pn as s,
4566
+ ba as t,
4567
+ eo as u,
4568
+ to as v,
4569
+ ya as w,
4570
+ oe as x,
4571
+ Rs as y,
4572
+ Aa as z
4573
+ };