@oneclick.dev/cms-core-modules 0.0.101 → 0.0.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acquisition-Br1Pfny3.js +1 -0
- package/dist/{Acquisition-BJXNY4ko.mjs → Acquisition-CPlZzUBo.mjs} +40 -40
- package/dist/Audience-BfkrmBuQ.js +1 -0
- package/dist/{Audience-CIzVtUvV.mjs → Audience-DTblSAiL.mjs} +89 -89
- package/dist/Content-BHr_rPVY.js +1 -0
- package/dist/{Content-CWhjurn_.mjs → Content-CYOZKvWK.mjs} +56 -56
- package/dist/Overview-BrCwozey.js +1 -0
- package/dist/{Overview-CGo4jaaA.mjs → Overview-kaMhsIUq.mjs} +21 -21
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +2782 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +349 -0
- package/dist/SeoHealth-09sEOu3G.js +1 -0
- package/dist/{SeoHealth-DVFDz3em.mjs → SeoHealth-BzcWd_w7.mjs} +29 -29
- package/dist/{agenda-DMT75Qfo.mjs → agenda-CCOjPiwP.mjs} +1 -1
- package/dist/{agenda-DxD4RMsy.js → agenda-CNPQfaIQ.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{index-BbqRTXuU.js → index-BOnqrBfY.js} +1 -1
- package/dist/{index-D4GsbUId.mjs → index-Bj0qaL1N.mjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +8 -8
- package/dist/{orders-BRfXlWgV.mjs → orders-BJV5vRQr.mjs} +1 -1
- package/dist/{orders-CrCz1WTR.js → orders-C1C5IEIP.js} +1 -1
- package/package.json +2 -2
- package/dist/Acquisition-DPScJD4t.js +0 -1
- package/dist/Audience-Csw1QLmw.js +0 -1
- package/dist/Content-dYr7kYT0.js +0 -1
- package/dist/Overview-DBu86Ikb.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +0 -349
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs +0 -2383
- package/dist/SeoHealth-DzftZW1m.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as w, resolveComponent as M, openBlock as a, createElementBlock as m, createVNode as n, withCtx as v, createElementVNode as e, unref as s, createTextVNode as x, toDisplayString as d, normalizeClass as
|
|
1
|
+
import { defineComponent as w, resolveComponent as M, openBlock as a, createElementBlock as m, createVNode as n, withCtx as v, createElementVNode as e, unref as s, createTextVNode as x, toDisplayString as d, normalizeClass as b, computed as T, createBlock as k, normalizeStyle as z, createCommentVNode as $, Fragment as R, renderList as B, ref as _, watch as te, onMounted as se } from "vue";
|
|
2
2
|
import { useModule as oe, useModuleRoute as ne, useModuleBreadcrumbs as re } from "@oneclick.dev/cms-kit";
|
|
3
3
|
import { MousePointerClick as K, Eye as E, TrendingUp as le, Hash as ae, RefreshCw as ie, AlertTriangle as de, Loader2 as ue, Search as ce, FileText as me, ArrowUpRight as xe } from "lucide-vue-next";
|
|
4
4
|
import "./index-CMk3uhUt.mjs";
|
|
@@ -27,7 +27,7 @@ function Y(t) {
|
|
|
27
27
|
return t;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, ve = { class: "text-2xl font-bold tabular-nums" }, ye = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, he = { class: "text-2xl font-bold tabular-nums" }, _e = { class: "flex items-center gap-2 text-xs text-muted-foreground" },
|
|
30
|
+
const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "flex items-center flex-wrap gap-2 text-xs text-muted-foreground" }, ve = { class: "text-2xl font-bold tabular-nums" }, ye = { class: "flex items-center flex-wrap gap-2 text-xs text-muted-foreground" }, he = { class: "text-2xl font-bold tabular-nums" }, _e = { class: "flex items-center flex-wrap gap-2 text-xs text-muted-foreground" }, ke = { class: "text-2xl font-bold tabular-nums" }, be = { class: "flex items-center flex-wrap gap-2 text-xs text-muted-foreground" }, $e = /* @__PURE__ */ w({
|
|
31
31
|
__name: "SeoKpiCards",
|
|
32
32
|
props: {
|
|
33
33
|
totals: {}
|
|
@@ -39,7 +39,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
39
39
|
n(r, { class: "p-4 space-y-1" }, {
|
|
40
40
|
default: v(() => [
|
|
41
41
|
e("div", ge, [
|
|
42
|
-
n(s(K), { class: "size-3.5" }),
|
|
42
|
+
n(s(K), { class: "size-3.5 shrink-0" }),
|
|
43
43
|
c[0] || (c[0] = x(" Total Clicks ", -1))
|
|
44
44
|
]),
|
|
45
45
|
e("p", ve, d(s(S)(t.totals.clicks)), 1)
|
|
@@ -49,7 +49,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
49
49
|
n(r, { class: "p-4 space-y-1" }, {
|
|
50
50
|
default: v(() => [
|
|
51
51
|
e("div", ye, [
|
|
52
|
-
n(s(E), { class: "size-3.5" }),
|
|
52
|
+
n(s(E), { class: "size-3.5 shrink-0" }),
|
|
53
53
|
c[1] || (c[1] = x(" Total Impressions ", -1))
|
|
54
54
|
]),
|
|
55
55
|
e("p", he, d(s(S)(t.totals.impressions)), 1)
|
|
@@ -59,21 +59,21 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
59
59
|
n(r, { class: "p-4 space-y-1" }, {
|
|
60
60
|
default: v(() => [
|
|
61
61
|
e("div", _e, [
|
|
62
|
-
n(s(le), { class: "size-3.5" }),
|
|
62
|
+
n(s(le), { class: "size-3.5 shrink-0" }),
|
|
63
63
|
c[2] || (c[2] = x(" Average CTR ", -1))
|
|
64
64
|
]),
|
|
65
|
-
e("p",
|
|
65
|
+
e("p", ke, d(s(I)(t.totals.ctr)), 1)
|
|
66
66
|
]),
|
|
67
67
|
_: 1
|
|
68
68
|
}),
|
|
69
69
|
n(r, { class: "p-4 space-y-1" }, {
|
|
70
70
|
default: v(() => [
|
|
71
|
-
e("div",
|
|
72
|
-
n(s(ae), { class: "size-3.5" }),
|
|
71
|
+
e("div", be, [
|
|
72
|
+
n(s(ae), { class: "size-3.5 shrink-0" }),
|
|
73
73
|
c[3] || (c[3] = x(" Avg Position ", -1))
|
|
74
74
|
]),
|
|
75
75
|
e("p", {
|
|
76
|
-
class:
|
|
76
|
+
class: b(["text-2xl font-bold tabular-nums", s(pe)(t.totals.avgPosition)])
|
|
77
77
|
}, d(s(q)(t.totals.avgPosition)), 3)
|
|
78
78
|
]),
|
|
79
79
|
_: 1
|
|
@@ -93,7 +93,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
93
93
|
const p = t, c = T(() => p.keywords.filter((l) => l.position <= 3).length), r = T(() => p.keywords.filter((l) => l.position <= 10).length), f = T(() => p.keywords.filter((l) => l.position <= 20).length);
|
|
94
94
|
return (l, o) => {
|
|
95
95
|
const u = M("Card");
|
|
96
|
-
return a(),
|
|
96
|
+
return a(), k(u, { class: "p-4" }, {
|
|
97
97
|
default: v(() => [
|
|
98
98
|
o[8] || (o[8] = e("h3", { class: "text-sm font-medium mb-3" }, "Keyword Ranking Distribution", -1)),
|
|
99
99
|
e("div", we, [
|
|
@@ -172,7 +172,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
172
172
|
};
|
|
173
173
|
return (o, u) => {
|
|
174
174
|
const g = M("Card");
|
|
175
|
-
return a(),
|
|
175
|
+
return a(), k(g, { class: "p-4" }, {
|
|
176
176
|
default: v(() => [
|
|
177
177
|
u[0] || (u[0] = e("h3", { class: "text-sm font-medium mb-3" }, "Clicks Over Time", -1)),
|
|
178
178
|
t.trends.length > 1 ? (a(), m("div", Ae, [
|
|
@@ -241,7 +241,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
241
241
|
};
|
|
242
242
|
return (o, u) => {
|
|
243
243
|
const g = M("Card");
|
|
244
|
-
return a(),
|
|
244
|
+
return a(), k(g, { class: "p-4" }, {
|
|
245
245
|
default: v(() => [
|
|
246
246
|
u[0] || (u[0] = e("h3", { class: "text-sm font-medium mb-3" }, "Impressions Over Time", -1)),
|
|
247
247
|
t.trends.length > 1 ? (a(), m("div", Be, [
|
|
@@ -327,7 +327,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
327
327
|
]),
|
|
328
328
|
e("span", null, d(s(I)(l.ctr)), 1),
|
|
329
329
|
e("span", {
|
|
330
|
-
class:
|
|
330
|
+
class: b(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium", s(O)(l.position)])
|
|
331
331
|
}, " #" + d(s(q)(l.position)), 3)
|
|
332
332
|
])
|
|
333
333
|
])
|
|
@@ -379,7 +379,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
379
379
|
]),
|
|
380
380
|
e("span", null, d(s(I)(l.ctr)), 1),
|
|
381
381
|
e("span", {
|
|
382
|
-
class:
|
|
382
|
+
class: b(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium", s(O)(l.position)])
|
|
383
383
|
}, " #" + d(s(q)(l.position)), 3)
|
|
384
384
|
])
|
|
385
385
|
])
|
|
@@ -391,7 +391,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
391
391
|
}), xt = { class: "divide-y" }, pt = {
|
|
392
392
|
key: 0,
|
|
393
393
|
class: "p-8 text-center text-sm text-muted-foreground"
|
|
394
|
-
}, ft = { class: "flex items-start gap-3" }, gt = { class: "text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5" }, vt = { class: "flex-1 min-w-0" }, yt = { class: "flex flex-col @sm:flex-row @sm:items-center gap-2 @sm:gap-3" }, ht = { class: "flex-1 min-w-0 space-y-0.5" }, _t = { class: "text-sm font-medium" },
|
|
394
|
+
}, ft = { class: "flex items-start gap-3" }, gt = { class: "text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5" }, vt = { class: "flex-1 min-w-0" }, yt = { class: "flex flex-col @sm:flex-row @sm:items-center gap-2 @sm:gap-3" }, ht = { class: "flex-1 min-w-0 space-y-0.5" }, _t = { class: "text-sm font-medium" }, kt = ["title"], bt = { class: "flex items-center gap-3 @sm:gap-4 text-xs text-muted-foreground @sm:shrink-0 flex-wrap" }, $t = { class: "flex items-center gap-1" }, wt = /* @__PURE__ */ w({
|
|
395
395
|
__name: "SeoMappingTab",
|
|
396
396
|
props: {
|
|
397
397
|
queryPages: {}
|
|
@@ -412,15 +412,15 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
412
412
|
e("p", {
|
|
413
413
|
class: "text-xs text-muted-foreground truncate",
|
|
414
414
|
title: r.page
|
|
415
|
-
}, "→ " + d(s(Y)(r.page)), 9,
|
|
415
|
+
}, "→ " + d(s(Y)(r.page)), 9, kt)
|
|
416
416
|
]),
|
|
417
|
-
e("div",
|
|
417
|
+
e("div", bt, [
|
|
418
418
|
e("span", $t, [
|
|
419
419
|
n(s(K), { class: "size-3" }),
|
|
420
420
|
x(" " + d(s(S)(r.clicks)), 1)
|
|
421
421
|
]),
|
|
422
422
|
e("span", {
|
|
423
|
-
class:
|
|
423
|
+
class: b(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium", s(O)(r.position)])
|
|
424
424
|
}, " #" + d(s(q)(r.position)), 3)
|
|
425
425
|
])
|
|
426
426
|
])
|
|
@@ -489,7 +489,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
489
489
|
e("div", Pt, [
|
|
490
490
|
(a(), m(R, null, B(ee, (h) => e("button", {
|
|
491
491
|
key: h.value,
|
|
492
|
-
class:
|
|
492
|
+
class: b(["px-3 py-1.5 text-xs font-medium transition-colors", l.value === h.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
|
|
493
493
|
onClick: (At) => l.value = h.value
|
|
494
494
|
}, d(h.label), 11, Dt)), 64))
|
|
495
495
|
]),
|
|
@@ -501,14 +501,14 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
501
501
|
}, {
|
|
502
502
|
default: v(() => [
|
|
503
503
|
n(s(ie), {
|
|
504
|
-
class:
|
|
504
|
+
class: b(["size-4", { "animate-spin": r.value }])
|
|
505
505
|
}, null, 8, ["class"])
|
|
506
506
|
]),
|
|
507
507
|
_: 1
|
|
508
508
|
}, 8, ["disabled"])
|
|
509
509
|
])) : $("", !0)
|
|
510
510
|
]),
|
|
511
|
-
Z.value ? F.value ? f.value ? (a(),
|
|
511
|
+
Z.value ? F.value ? f.value ? (a(), k(D, {
|
|
512
512
|
key: 2,
|
|
513
513
|
class: "p-6 border-destructive/50 bg-destructive/5"
|
|
514
514
|
}, {
|
|
@@ -541,21 +541,21 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
541
541
|
e("div", Ft, [
|
|
542
542
|
e("div", Lt, [
|
|
543
543
|
e("button", {
|
|
544
|
-
class:
|
|
544
|
+
class: b(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2", y.value === "keywords" ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"]),
|
|
545
545
|
onClick: i[0] || (i[0] = (h) => y.value = "keywords")
|
|
546
546
|
}, [
|
|
547
547
|
n(s(ce), { class: "size-3.5 inline mr-1.5" }),
|
|
548
548
|
i[8] || (i[8] = x(" Keywords ", -1))
|
|
549
549
|
], 2),
|
|
550
550
|
e("button", {
|
|
551
|
-
class:
|
|
551
|
+
class: b(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2", y.value === "pages" ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"]),
|
|
552
552
|
onClick: i[1] || (i[1] = (h) => y.value = "pages")
|
|
553
553
|
}, [
|
|
554
554
|
n(s(me), { class: "size-3.5 inline mr-1.5" }),
|
|
555
555
|
i[9] || (i[9] = x(" Pages ", -1))
|
|
556
556
|
], 2),
|
|
557
557
|
e("button", {
|
|
558
|
-
class:
|
|
558
|
+
class: b(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2", y.value === "mapping" ? "border-primary text-primary" : "border-transparent text-muted-foreground hover:text-foreground"]),
|
|
559
559
|
onClick: i[2] || (i[2] = (h) => y.value = "mapping")
|
|
560
560
|
}, [
|
|
561
561
|
n(s(xe), { class: "size-3.5 inline mr-1.5" }),
|
|
@@ -563,22 +563,22 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
563
563
|
], 2)
|
|
564
564
|
])
|
|
565
565
|
]),
|
|
566
|
-
y.value === "keywords" ? (a(),
|
|
566
|
+
y.value === "keywords" ? (a(), k(Ze, {
|
|
567
567
|
key: 0,
|
|
568
568
|
keywords: g.value
|
|
569
569
|
}, null, 8, ["keywords"])) : $("", !0),
|
|
570
|
-
y.value === "pages" ? (a(),
|
|
570
|
+
y.value === "pages" ? (a(), k(mt, {
|
|
571
571
|
key: 1,
|
|
572
572
|
pages: P.value
|
|
573
573
|
}, null, 8, ["pages"])) : $("", !0),
|
|
574
|
-
y.value === "mapping" ? (a(),
|
|
574
|
+
y.value === "mapping" ? (a(), k(wt, {
|
|
575
575
|
key: 2,
|
|
576
576
|
queryPages: H.value
|
|
577
577
|
}, null, 8, ["queryPages"])) : $("", !0)
|
|
578
578
|
]),
|
|
579
579
|
_: 1
|
|
580
580
|
})
|
|
581
|
-
], 64)) : (a(),
|
|
581
|
+
], 64)) : (a(), k(D, {
|
|
582
582
|
key: 1,
|
|
583
583
|
class: "p-8 text-center"
|
|
584
584
|
}, {
|
|
@@ -587,7 +587,7 @@ const fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, ge = { class: "
|
|
|
587
587
|
e("p", { class: "text-sm text-muted-foreground mt-1" }, "Configure your service account, property ID, and site URL in module settings.", -1)
|
|
588
588
|
])]),
|
|
589
589
|
_: 1
|
|
590
|
-
})) : (a(),
|
|
590
|
+
})) : (a(), k(D, {
|
|
591
591
|
key: 0,
|
|
592
592
|
class: "p-8 text-center space-y-3"
|
|
593
593
|
}, {
|
|
@@ -3,7 +3,7 @@ import { c as ue, b as de } from "./DateFormatter-2B0R-DY4.mjs";
|
|
|
3
3
|
import { X as we, Search as Ee, Clock as ge, Users as he, ChevronLeft as ve, ChevronRight as ce, Asterisk as Ie, CalendarDays as Be } from "lucide-vue-next";
|
|
4
4
|
import { _ as Le } from "./EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs";
|
|
5
5
|
import { useModule as Se, useModuleRoute as $e, useFirebaseIntegration as Te, useModulePermissions as Ue } from "@oneclick.dev/cms-kit";
|
|
6
|
-
import { _ as je, F as Pe } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { _ as je, F as Pe } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs";
|
|
7
7
|
import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
8
|
import { _ as be } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs";
|
|
9
9
|
const Ne = { class: "mb-6" }, Oe = { class: "flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible" }, Fe = ["onClick"], Ae = { class: "absolute -top-8 left-1/2 -translate-x-1/2 bg-popover border shadow-md rounded px-2 py-1 text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10" }, Ve = { class: "font-medium" }, We = { class: "text-muted-foreground" }, He = { class: "w-full flex-1 flex items-end justify-center" }, Qe = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("./DateFormatter-DbtOLV0L.js"),C=require("lucide-vue-next"),te=require("./EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js"),j=require("@oneclick.dev/cms-kit"),K=require("./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Q=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js"),ne={class:"mb-6"},re={class:"flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible"},se=["onClick"],ae={class:"absolute -top-8 left-1/2 -translate-x-1/2 bg-popover border shadow-md rounded px-2 py-1 text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10"},le={class:"font-medium"},ie={class:"text-muted-foreground"},ce={class:"w-full flex-1 flex items-end justify-center"},de={key:1,class:"text-[10px] mt-1"},ue={key:0,class:"mt-2 text-sm text-muted-foreground flex items-center gap-2"},me={class:"font-medium text-foreground"},pe={class:"font-medium text-foreground"},fe=e.defineComponent({__name:"TimelineChart",props:{timeSlots:{},slotStats:{},selectedTimeSlot:{},maxSpots:{}},emits:["select","clear"],setup(u,{emit:h}){const v=h,y=r=>{v("select",r)},E=()=>{v("clear")};return(r,a)=>{const i=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",ne,[a[2]||(a[2]=e.createElementVNode("h3",{class:"font-semibold text-sm mb-2"},"Timeline",-1)),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.timeSlots,o=>(e.openBlock(),e.createElementBlock("div",{key:o.startTime,class:"flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",onClick:x=>y(o.startTime)},[e.createElementVNode("div",ae,[e.createElementVNode("div",le,e.toDisplayString(o.startTime),1),e.createElementVNode("div",ie,e.toDisplayString(u.slotStats[o.startTime]?.spots||0)+" spots",1)]),e.createElementVNode("div",ce,[e.createElementVNode("div",{class:e.normalizeClass(["w-full transition-all duration-200",[u.selectedTimeSlot===o.startTime?"bg-primary":u.slotStats[o.startTime]?.spots>0?"bg-primary/60 group-hover:bg-primary/80":"bg-muted-foreground/20 group-hover:bg-muted-foreground/30"]]),style:e.normalizeStyle({height:u.slotStats[o.startTime]?.spots>0?`${u.slotStats[o.startTime].spots/u.maxSpots*100}%`:"2px",minHeight:u.slotStats[o.startTime]?.spots>0?"4px":"2px"})},null,6)]),o.startTime.endsWith(":00")?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-[10px] text-muted-foreground mt-1 transition-colors truncate",{"text-primary font-medium":u.selectedTimeSlot===o.startTime}])},e.toDisplayString(o.label),3)):(e.openBlock(),e.createElementBlock("span",de," "))],8,se))),128))]),u.selectedTimeSlot?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(i,{variant:"ghost",size:"icon",class:"h-6 w-6 p-0",onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1}),e.createElementVNode("span",null,[a[0]||(a[0]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",me,e.toDisplayString(u.slotStats[u.selectedTimeSlot]?.bookings||0),1),a[1]||(a[1]=e.createTextVNode(" bookings at ",-1)),e.createElementVNode("span",pe,e.toDisplayString(u.selectedTimeSlot),1)])])):e.createCommentVNode("",!0)])}}}),ve={class:"flex items-center justify-between mb-3"},ge={class:"font-semibold"},he={key:0,class:"text-muted-foreground font-normal"},xe={class:"relative mb-3"},ye={key:0,class:"flex items-center justify-center py-8"},ke={key:1,class:"text-center py-8 text-muted-foreground"},be={key:2,class:"space-y-2 max-h-80 overflow-y-auto"},_e=["onClick"],Ne={class:"flex items-start justify-between"},Ee={class:"flex-1"},we={class:"font-medium"},Ve={class:"text-sm text-muted-foreground"},Se={class:"text-sm text-muted-foreground"},Ce={class:"flex items-center gap-4"},Be={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},$e={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},De={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},ze={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Me={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Ie={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Le={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Re={key:5,class:"text-sm font-medium mt-1"},Ue=e.defineComponent({__name:"BookingsList",props:{orders:{},filteredOrders:{},isLoading:{type:Boolean},selectedTimeSlot:{},searchQuery:{}},emits:["update:searchQuery","refresh"],setup(u,{emit:h}){const v=h,y=e.ref(null),E=i=>{v("update:searchQuery",i)},r=()=>{v("update:searchQuery","")},a=()=>{v("refresh")};return(i,o)=>{const x=e.resolveComponent("Input"),g=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ve,[e.createElementVNode("h3",ge,[o[0]||(o[0]=e.createTextVNode(" Bookings ",-1)),u.selectedTimeSlot||u.searchQuery?(e.openBlock(),e.createElementBlock("span",he," ("+e.toDisplayString(u.filteredOrders.length)+" of "+e.toDisplayString(u.orders.length)+") ",1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",xe,[e.createVNode(e.unref(C.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(x,{"model-value":u.searchQuery,placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9","onUpdate:modelValue":E},null,8,["model-value"]),u.searchQuery?(e.openBlock(),e.createBlock(g,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:r},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),u.isLoading?(e.openBlock(),e.createElementBlock("div",ye,[...o[1]||(o[1]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):u.filteredOrders.length===0?(e.openBlock(),e.createElementBlock("div",ke,e.toDisplayString(u.selectedTimeSlot?"No bookings for this time slot":"No bookings for this event"),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.filteredOrders,p=>(e.openBlock(),e.createElementBlock("div",{key:p.res_id||p.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors",onClick:w=>e.unref(y).openDialog(p)},[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.createElementVNode("div",we,e.toDisplayString(p.customerInfo.firstName+" "+p.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Ve,e.toDisplayString(p.customerInfo.email),1),e.createElementVNode("div",Se,e.toDisplayString(p.customerInfo.phone),1),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[e.createVNode(e.unref(C.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.startTime)+" - "+e.toDisplayString(p.endTime),1)]),e.createElementVNode("div",$e,[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.spots),1)])])]),e.createElementVNode("div",De,[p.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Te,"Needs Approval")):p.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",ze,"Approved")):p.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Me,"Rejected")):p.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ie,"Cancelled")):(e.openBlock(),e.createElementBlock("span",Le,"Pending")),p.reservationPrice||p.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Re," €"+e.toDisplayString(p.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,_e))),128))])),e.createVNode(K._sfc_main,{ref_key:"reservationDetailDialog",ref:y,onCancelled:a,onConfirmed:a,onRejected:a},null,512)])}}}),je={class:"flex items-center gap-4 mt-2 text-sm"},Fe={class:"flex items-center gap-1"},Pe={key:0,class:"flex items-center gap-1"},Oe={class:"flex items-center gap-1"},Ae={class:"py-4"},qe=e.defineComponent({__name:"EventDialog",props:{resources:{default:()=>[]}},setup(u,{expose:h}){const v=u,{config:y}=j.useModule(),{params:E}=j.useModuleRoute(),r=j.useFirebaseIntegration(y.project),a=e.ref(!1),i=e.ref(null),o=e.ref([]),x=e.ref(!1),g=e.ref(null),p=e.ref("");e.provide("event",i);const w=e.computed(()=>{if(!i.value)return[];const d=i.value.resource?.interval||60,n=[],[c,_]=i.value.startTime.split(":").map(Number),[T,b]=i.value.endTime.split(":").map(Number),$=c*60+_,t=T*60+b;for(let l=$;l<t;l+=d){const f=Math.floor(l/60),m=l%60,N=Math.min(l+d,t),D=Math.floor(N/60),s=N%60,z=`${f.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`,I=`${D.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;n.push({startTime:z,endTime:I,label:z})}return n}),k=d=>{const n=d.getFullYear(),c=String(d.getMonth()+1).padStart(2,"0"),_=String(d.getDate()).padStart(2,"0");return`${n}-${c}-${_}`},M=e.computed(()=>{const d={};return w.value.forEach(n=>{d[n.startTime]={bookings:0,spots:0,orders:[]}}),o.value.forEach(n=>{w.value.forEach(c=>{n.startTime<c.endTime&&n.endTime>c.startTime&&(d[c.startTime].bookings++,d[c.startTime].spots+=n.spots||0,d[c.startTime].orders.push(n))})}),d}),V=e.computed(()=>Math.max(1,...Object.values(M.value).map(d=>d.spots))),S=e.computed(()=>{let d=o.value;return g.value&&(d=M.value[g.value]?.orders||[]),p.value.trim()&&(d=new K.Fuse(d,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone"],threshold:.3,ignoreLocation:!0}).search(p.value).map(c=>c.item)),d}),B=e.computed(()=>({spots:o.value.reduce((d,n)=>d+(n.spots||0),0),bookings:o.value.length})),F=d=>{g.value===d?g.value=null:g.value=d},L=()=>{g.value=null},P=async d=>{a.value=!0,i.value=d,g.value=null,p.value="",await U()},U=async()=>{if(i.value){x.value=!0,o.value=[];try{const d=E.value.id,n=k(new Date(i.value.date)),c=new Set;v.resources?.forEach(b=>{const $=`${b.id}_${n}`;c.add($)});const _=await r.find(y.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:d},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(c)}]});let T=[];_.forEach(b=>{(b.reservations?.filter(t=>t.date===n)||[]).forEach(t=>{const l=v.resources.find(f=>f.id===t.resourceId);(t.status==="approved"||t.status==="needs_approval")&&T.push({customerInfo:b.customerInfo,amountDue:b.amountDue,amountPaid:b.amountPaid,status:b.status,reservationStatus:t.status,subtotal:b.subtotal,total:b.total,discount:b.discount,id:b.id,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:n,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:l?.name||"Unknown",resourceColor:l?.color})})}),o.value=T.sort((b,$)=>b.startTime?.localeCompare($.startTime||"")||0)}catch(d){console.error("Error loading orders:",d),o.value=[]}finally{x.value=!1}}},q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["January","February","March","April","May","June","July","August","September","October","November","December"];return h({openDialog:P}),(d,n)=>{const c=e.resolveComponent("DialogTitle"),_=e.resolveComponent("DialogDescription"),T=e.resolveComponent("DialogHeader"),b=e.resolveComponent("Button"),$=e.resolveComponent("DialogFooter"),t=e.resolveComponent("DialogScrollContent"),l=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(l,{open:a.value,"onUpdate:open":n[2]||(n[2]=f=>a.value=f)},{default:e.withCtx(()=>[e.createVNode(t,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[i.value?.date?(e.openBlock(),e.createBlock(c,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(q[new Date(i.value.date).getUTCDay()])+" "+e.toDisplayString(O[new Date(i.value.date).getUTCMonth()])+" "+e.toDisplayString(new Date(i.value.date).getUTCDate())+", "+e.toDisplayString(new Date(i.value.date).getUTCFullYear()),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(_,null,{default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(C.Clock),{size:14}),e.createElementVNode("span",null,e.toDisplayString(i.value?.startTime)+" – "+e.toDisplayString(i.value?.endTime),1)]),i.value?.resource?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",{class:"w-4 h-4 rounded-full",style:e.normalizeStyle({backgroundColor:i.value.resource.color||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(i.value.resource.name),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Oe,[e.createVNode(e.unref(C.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(B.value.spots)+" spots in "+e.toDisplayString(B.value.bookings)+" reservations",1)])])]),_:1})]),_:1}),e.createElementVNode("div",Ae,[w.value.length>1?(e.openBlock(),e.createBlock(fe,{key:0,"time-slots":w.value,"slot-stats":M.value,"selected-time-slot":g.value,"max-spots":V.value,onSelect:F,onClear:L},null,8,["time-slots","slot-stats","selected-time-slot","max-spots"])):e.createCommentVNode("",!0),e.createVNode(Ue,{orders:o.value,"filtered-orders":S.value,"is-loading":x.value,"selected-time-slot":g.value,"search-query":p.value,"onUpdate:searchQuery":n[0]||(n[0]=f=>p.value=f),onRefresh:U},null,8,["orders","filtered-orders","is-loading","selected-time-slot","search-query"])]),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(b,{variant:"outline",onClick:n[1]||(n[1]=f=>a.value=!1)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),He={class:"flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]"},We={class:"relative h-full min-h-[1536px]"},Qe={class:"divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80"},Xe={class:"absolute inset-0 pointer-events-none"},Ye={class:"relative mr-3 h-full ml-2"},Je=["onClick"],Ke={key:0,class:"absolute bottom-0 left-0 right-0 h-1 bg-black/20"},Ge={class:"flex items-start justify-between gap-2 mb-1"},Ze={class:"font-semibold text-sm leading-tight line-clamp-1 flex-1"},et={class:"flex items-center gap-1 shrink-0"},tt=["title"],ot={class:"font-medium"},X=e.defineComponent({__name:"EventTimeline",props:{date:{},events:{},firstDay:{type:Boolean,default:!1},resources:{default:()=>[]}},setup(u){const h=u,v=e.ref(null),y=a=>{const[i,o]=a.split(":").map(Number);return i*60+o};e.computed(()=>!h.events||!h.resources?[]:h.resources.map(a=>{const o=h.events.filter(x=>x.resourceId===a.id).map(x=>{const g=y(x.startTime),w=y(x.endTime)-g,k=g/1440*100,M=w/1440*100,V=(x.bookings??0)>0,S=x.maxBookings?(x.bookings??0)/x.maxBookings*100:0;return{...x,top:`${k}%`,height:`${M}%`,color:x.resource?.color||"#3b82f6",hasBookings:V,fillPercentage:S,isSmall:w<60}});return{resource:a,events:o}}));const E=e.computed(()=>h.events?h.events.map(a=>{const i=y(a.startTime),x=y(a.endTime)-i,g=i/1440*100,p=x/1440*100,w=(a.bookings??0)>0,k=a.maxBookings?(a.bookings??0)/a.maxBookings*100:0;return{...a,top:`${g}%`,height:`${p}%`,color:a.resource?.color||"#3b82f6",hasBookings:w,fillPercentage:k,isSmall:x<60}}):[]),r=Array.from({length:24},(a,i)=>({hour:i,label:`${i.toString().padStart(2,"0")}:00`}));return(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",He,[e.createElementVNode("div",We,[e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),o=>(e.openBlock(),e.createElementBlock("div",{key:o.hour,class:"flex-1 flex transition-all duration-200"},[...i[0]||(i[0]=[e.createElementVNode("div",{class:"flex-1 relative"},[e.createElementVNode("div",{class:"absolute top-1/2 left-0 right-0 border-t border-dashed border-input/50"})],-1)])]))),128))]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,style:e.normalizeStyle({top:o.top,height:o.height,opacity:o.hasBookings?"1":"0.5"}),class:"event-card absolute left-2 right-2 rounded-lg pointer-events-auto cursor-pointer group/event transition-all duration-200 hover:shadow-xl overflow-hidden",onClick:x=>v.value?.openDialog(o)},[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:o.color}),class:"absolute inset-0 shadow-lg"},[o.maxBookings?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{class:"h-full bg-white/40 transition-all duration-300",style:e.normalizeStyle({width:`${o.fillPercentage}%`})},null,4)])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:e.normalizeClass(["relative h-full p-3 flex flex-col",`${o.hasBookings?"text-white":"text-gray-600 dark:text-gray-100"}`])},[e.createElementVNode("div",Ge,[e.createElementVNode("h3",Ze,e.toDisplayString(o.title),1),e.createElementVNode("div",et,[o.resource?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold bg-white/30 backdrop-blur-sm text-white border border-white/40",title:o.resource.name},e.toDisplayString(o.resource.avatarLabel||o.resource.name.charAt(0).toUpperCase()),9,tt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",o.hasBookings?"bg-white text-black backdrop-blur-sm":"bg-black/10 backdrop-blur-sm"])},[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(o.bookings),1)],2)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 text-xs opacity-90 mt-auto",{"-translate-x-1 -translate-y-2 scale-80 origin-[0_0]":o.isSmall}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded backdrop-blur-sm",{"bg-black/10":!o.isSmall}])},[e.createVNode(e.unref(C.Clock),{size:10}),e.createElementVNode("span",ot,e.toDisplayString(o.startTime)+" – "+e.toDisplayString(o.endTime),1)],2)],2)],2),i[1]||(i[1]=e.createElementVNode("div",{class:"absolute inset-0 border-2 border-white/0 group-hover/event:border-white/30 rounded-lg transition-colors duration-200 pointer-events-none"},null,-1))],12,Je))),128))])])])]),e.createVNode(qe,{resources:u.resources,ref_key:"eventDialog",ref:v},null,8,["resources"])],64))}}),nt={class:"sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input"},rt={class:"flex-shrink-0 text-xs font-medium text-muted-foreground px-3 pb-3 border-r border-border/50 w-14"},st={class:"flex items-center gap-1.5"},Y=e.defineComponent({__name:"Event24hSidebar",setup(u){const h=Array.from({length:24},(v,y)=>({hour:y,label:`${y.toString().padStart(2,"0")}:00`}));return(v,y)=>(e.openBlock(),e.createElementBlock("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),E=>(e.openBlock(),e.createElementBlock("div",{key:E.hour,class:"flex-1 flex transition-all duration-200"},[e.createElementVNode("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("span",{class:e.normalizeClass({"-translate-y-1/2":E.hour!==0})},e.toDisplayString(E.label),3)])])]))),128))]))}}),at={class:"absolute top-0 w-full pointer-events-none"},lt={key:0,class:"absolute -right-2 -top-0.5 px-2 py-0.5 bg-red-500 text-white text-xs font-medium rounded shadow-lg"},J=e.defineComponent({__name:"EventTimeIndicator",props:{currentDate:{type:Object,required:!1}},setup(u){const h=e.ref(Date.now());let v;e.onMounted(()=>{v=window.setInterval(()=>{h.value=Date.now()},1e3)}),e.onUnmounted(()=>{v&&clearInterval(v)});const y=e.computed(()=>{const r=new Date(h.value);return`${(r.getHours()*60+r.getMinutes()+r.getSeconds()/60)/1440*100}%`}),E=e.computed(()=>new Date(h.value).getFullYear()+"-"+(new Date(h.value).getMonth()+1).toString().padStart(2,"0")+"-"+new Date(h.value).getDate().toString().padStart(2,"0"));return(r,a)=>(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",{class:"absolute left-0 right-0 h-0.5 bg-red-500 z-30 pointer-events-none transition-[top] duration-300 ease-linear",style:e.normalizeStyle({top:y.value})},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute -left-2 -top-1.5 w-3 h-3 bg-red-500 rounded-full shadow-lg shadow-red-500/50"},null,-1)),u.currentDate&&u.currentDate==E.value?(e.openBlock(),e.createElementBlock("div",lt," Now ")):e.createCommentVNode("",!0)],4)]))}}),it={key:0,class:"relative flex flex-1 min-w-0"},ct={key:1,class:"flex-1 min-w-0 relative"},dt={key:0,class:"absolute top-0 right-0 z-10 px-3 py-1.5 bg-primary/90 text-primary-foreground text-xs font-medium rounded-bl-lg shadow-lg backdrop-blur-sm flex items-center gap-1.5 animate-pulse-subtle"},ut={class:"flex pb-4 min-w-[200px]"},mt=["onClick"],pt={key:0,class:"absolute top-2 right-2 flex items-center gap-1 px-2 py-0.5 bg-primary/20 backdrop-blur-sm rounded-full border border-primary/30"},ft={class:"text-xs text-muted-foreground font-medium group-hover:text-foreground/70 transition-colors"},vt={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-orange-500"},gt=e.defineComponent({__name:"EventView",setup(u){const h=e.inject("activeDate",e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))),v=e.inject("viewMode",e.ref(1)),y=e.inject("events",e.ref([])),E=e.inject("resources",e.ref([])),r=e.ref(null),a=e.ref(!1),i=e.ref(!1);e.computed(()=>E.value.length>1);const o=e.computed(()=>{const n=[],c=h.value;for(let _=0;_<v.value;_++)n.push(c.add({days:_}));return n}),x=(n,c)=>{const _=`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`;return y.value?.filter(T=>T.date===_)||[]},g=n=>{const c=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2());return n.year===c.year&&n.month===c.month&&n.day===c.day},p=n=>{h.value=n,v.value=1};let w=null,k=null;const M=()=>{r.value&&(S(),r.value.scrollBy({left:-300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:-20,behavior:"auto"})},50)},300))},V=()=>{r.value&&(S(),r.value.scrollBy({left:300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:20,behavior:"auto"})},50)},300))},S=()=>{k&&(clearTimeout(k),k=null),w&&(clearInterval(w),w=null)},B=()=>{if(!r.value)return;const{scrollLeft:n,scrollWidth:c,clientWidth:_}=r.value;a.value=n>10,i.value=n<c-_-10},F=n=>{r.value&&Math.abs(n.deltaY)>Math.abs(n.deltaX)&&(n.preventDefault(),r.value.scrollBy({left:n.deltaY,behavior:"auto"}))},L=e.ref(!1),P=e.ref(0),U=e.ref(0),q=n=>{!r.value||v.value===1||n.target.closest(".event-card")||(L.value=!0,P.value=n.pageX,U.value=r.value.scrollLeft,r.value.style.userSelect="none",n.preventDefault())},O=n=>{if(!L.value||!r.value)return;const c=n.pageX,_=(P.value-c)*1.2;r.value.scrollLeft=U.value+_},d=()=>{r.value&&(L.value=!1,r.value.style.userSelect="")};return e.onMounted(()=>{r.value&&(r.value.addEventListener("scroll",B),r.value.addEventListener("wheel",F,{passive:!1}),e.nextTick(()=>{B(),setTimeout(B,50),setTimeout(B,150),setTimeout(B,300),setTimeout(B,500)})),document.addEventListener("mousemove",O),document.addEventListener("mouseup",d)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",d)}),e.watch(v,()=>{v.value>1?e.nextTick(()=>{setTimeout(()=>{if(!r.value)return;const{scrollWidth:n,clientWidth:c}=r.value;n>c&&(i.value=!0,a.value=!1)},100)}):r.value&&(r.value.style.cursor="")}),e.onUnmounted(()=>{S(),r.value&&(r.value.removeEventListener("scroll",B),r.value.removeEventListener("wheel",F))}),(n,c)=>{const _=e.resolveComponent("Button"),T=e.resolveComponent("TooltipTrigger"),b=e.resolveComponent("TooltipContent"),$=e.resolveComponent("Tooltip");return e.unref(v)===1?(e.openBlock(),e.createElementBlock("div",it,[e.createVNode(Y),e.createVNode(J,{class:"h-full","current-date":e.unref(h)},null,8,["current-date"]),e.createVNode(X,{date:e.unref(h),events:x(e.unref(h)),resources:e.unref(E)},null,8,["date","events","resources"])])):(e.openBlock(),e.createElementBlock("div",ct,[e.unref(v)===7?(e.openBlock(),e.createElementBlock("div",dt,[e.createVNode(e.unref(C.ChevronLeft),{size:12}),c[0]||(c[0]=e.createElementVNode("span",null,"Scroll to view all days",-1)),e.createVNode(e.unref(C.ChevronRight),{size:12})])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(_,{key:1,variant:"outline",size:"icon",onMousedown:M,onMouseup:S,onMouseleave:S,onTouchstart:M,onTouchend:S,class:"sticky top-1/2 left-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:20})]),_:1})):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(_,{key:2,variant:"outline",size:"icon",onMousedown:V,onMouseup:S,onMouseleave:S,onTouchstart:V,onTouchend:S,class:"sticky top-1/2 right-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2 float-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:20})]),_:1})):e.createCommentVNode("",!0),e.createVNode(J,{class:"h-[calc(100%-164px)] mt-[122px]"}),e.createElementVNode("div",{class:e.normalizeClass(["absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none transition-opacity duration-300",i.value?"opacity-100":"opacity-0"])},null,2),e.createElementVNode("div",{ref_key:"scrollContainer",ref:r,class:"absolute inset-0 overflow-x-auto overflow-y-visible",onScroll:B,onMousedown:q},[e.createElementVNode("div",ut,[e.createVNode(Y),c[5]||(c[5]=e.createElementVNode("div",{class:"absolute w-14 h-[125px] bg-input"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{key:t.toString(),class:e.normalizeClass(["flex-shrink-0",{"min-w-[200px] w-[33.33%]":e.unref(v)===3,"min-w-[280px]":e.unref(v)===7}])},[e.createElementVNode("div",{onClick:f=>p(t),class:e.normalizeClass(["relative p-3 border cursor-pointer transition-all duration-200 group relative",g(t)?"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/30 hover:from-primary/20 hover:to-primary/10 hover:border-primary/50 hover:shadow-md":"bg-gradient-to-br from-muted/50 to-muted/30 border-border hover:from-accent/50 hover:to-accent/30 hover:border-accent-foreground/20 hover:shadow-md"])},[g(t)?(e.openBlock(),e.createElementBlock("div",pt,[...c[1]||(c[1]=[e.createElementVNode("div",{class:"w-1.5 h-1.5 bg-primary rounded-full animate-pulse"},null,-1),e.createElementVNode("span",{class:"text-[9px] font-bold text-primary uppercase tracking-wide"},"Today",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["text-xs font-semibold uppercase tracking-wider transition-colors",g(t)?"text-primary group-hover:text-primary/80":"text-muted-foreground group-hover:text-foreground"])},e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{weekday:"short"})),3),e.createElementVNode("div",{class:e.normalizeClass(["text-2xl font-bold transition-colors",g(t)?"text-foreground":"text-foreground group-hover:text-primary"])},e.toDisplayString(t.day),3),e.createElementVNode("div",ft,e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{month:"long",year:"numeric"})),1),c[4]||(c[4]=e.createElementVNode("div",{class:"mt-2 pt-2 border-t border-border/0 group-hover:border-border/50 transition-all"},[e.createElementVNode("div",{class:"text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/100 uppercase tracking-wide transition-all"}," Click to view ")],-1)),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createBlock(e.unref(C.Asterisk),{key:0,class:"absolute top-3 right-3 size-4 text-orange-500"})):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createElementBlock("div",vt)):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[3]||(c[3]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024)],10,mt),e.createVNode(X,{date:t,events:x(t),resources:e.unref(E)},null,8,["date","events","resources"])],2))),128))])],544)]))}}}),ht=oe._export_sfc(gt,[["__scopeId","data-v-99339cf2"]]),xt={class:"flex flex-col gap-2 md:gap-4 w-full h-full"},yt={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-1"},kt={class:"flex items-center justify-between sm:justify-start gap-4"},bt={class:"flex flex-col"},_t={class:"flex items-center gap-2"},Nt={class:"text-lg sm:text-2xl font-bold tracking-tight truncate"},Et={class:"text-xs sm:text-sm text-muted-foreground ml-7 truncate"},wt={class:"flex items-center justify-between sm:justify-end gap-2"},Vt={class:"flex items-center gap-1 sm:mr-2"},St={key:0,class:"flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"},Ct=["onClick"],Bt={class:"flex gap-4 flex-1 min-h-0 md:min-h-[1700px]"},$t={class:"hidden md:flex flex-shrink-0 flex-col gap-4"},Dt={key:0,class:"rounded-md border p-3"},Tt={class:"space-y-1"},zt=["onClick"],Mt={class:"min-w-0 flex-1"},It={class:"text-sm font-medium truncate"},Lt={key:0,class:"pt-2 mt-2 border-t"},Rt={key:0,class:"mt-1 space-y-1"},Ut={class:"min-w-0 flex-1"},jt={class:"text-sm font-medium truncate text-muted-foreground"},Ft=e.defineComponent({__name:"agenda",setup(u){const{hasPermission:h}=j.useModulePermissions(),{params:v}=j.useModuleRoute(),{config:y}=j.useModule(),E=j.useFirebaseIntegration(y.project),r=e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),a=e.ref(1),i=e.ref(typeof window<"u"?window.innerWidth:1024),o=e.computed(()=>i.value<768),x=()=>{i.value=window.innerWidth};e.onMounted(()=>{window.addEventListener("resize",x)}),e.onUnmounted(()=>{window.removeEventListener("resize",x)}),e.watch(o,t=>{t&&a.value!==1&&(a.value=1)},{immediate:!0});const g=e.ref(null),p=e.ref(new Map),w=e.computed(()=>g.value?.resources||[]),k=e.computed(()=>w.value.filter(t=>t.isActive)),M=e.computed(()=>w.value.filter(t=>!t.isActive)),V=e.ref(null),S=e.ref(!1);e.watch(k,t=>{t.length>0&&!V.value&&(V.value=t[0].id)},{immediate:!0});const B=e.computed(()=>{if(!V.value)return k.value.length>0?[k.value[0]]:[];const t=k.value.find(l=>l.id===V.value);return t?[t]:k.value.length>0?[k.value[0]]:[]}),F=e.computed(()=>g.value?.pricingOptions?.find(l=>l.isDefault)?.duration||30),L=t=>{V.value=t};e.watch(r,()=>{$()});const P=e.computed(()=>{const t=r.value,l=new Date(t.year,t.month-1,t.day),f=l.toLocaleDateString("en-US",{weekday:"long"}).toUpperCase(),m=t.day,N=l.toLocaleDateString("en-US",{month:"short"}).toUpperCase();return{dayName:f,day:m,monthName:N,full:`${f} ${m} ${N}`}}),U=()=>{r.value=r.value.subtract({days:a.value})},q=()=>{r.value=r.value.add({days:a.value})},O=()=>{r.value=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())},d=t=>{const[l,f]=t.split(":").map(Number);return l*60+f},n=(t,l)=>(g.value?.exceptions||[]).find(m=>l>=m.startDate&&l<=m.endDate?m.resourceIds===null?!0:m.resourceIds?.includes(t):!1)||null,c=(t,l,f)=>{const m=n(t.id,f);if(m)return m.isClosed?[]:m.timeslots.map(s=>({startTime:s.startTime,endTime:s.endTime,isException:!0}));const N=l.getDay(),D=t.openingHours?.[N]||[];return D.length===0?[]:D.map(s=>({startTime:s.start,endTime:s.end,isException:!1}))},_=(t,l,f,m)=>{if(!g.value)return 0;const N=p.value.get(l);return N?N.filter(s=>s.resourceId===t).reduce((s,z)=>{const I=d(z.startTime),A=d(z.endTime),H=d(f),W=d(m);return I<W&&A>H?s+(z.reserved||0):s},0):0},T=e.computed(()=>{if(!g.value)return[];p.value.size;let t=[],l=[];for(let m=0;m<a.value;m++){const N=r.value.add({days:m});l.push(N)}const f=B.value.length>0?B.value:[];return f.length===0?[]:(l.forEach(m=>{let N=new Date(m.year,m.month-1,m.day);const D=`${m.year}-${String(m.month).padStart(2,"0")}-${String(m.day).padStart(2,"0")}`;f.forEach(s=>{const z=c(s,N,D);t=t.concat(z.map((I,A)=>{const H=_(s.id,D,I.startTime,I.endTime);return{id:`block-${D}-${s.id}-${A}`,title:g.value.serviceName,date:D,startTime:I.startTime,endTime:I.endTime,theme:s.color||"#3b82f6",bookings:H,maxBookings:s.capacity,isException:I.isException||!1,resourceId:s.id,resource:s,interval:s.interval||30,serviceDuration:F.value}}))})}),t)}),b=async()=>{g.value=await E.get(y.agendaCollection,v.value.id)},$=async()=>{const t=v.value.id,l=r.value;p.value.clear();const f=[];for(let m=0;m<a.value;m++){const N=l.add({days:m}),D=`${N.year}-${String(N.month).padStart(2,"0")}-${String(N.day).padStart(2,"0")}`,s=`${t}_${D}`;f.push(E.get(y.reservedSpotsCollection,s).then(z=>{if(z){let I=[];for(const A of k.value){const H=z?.[A.id]||{};Object.entries(H).forEach(([W,G])=>{const[Z,ee]=W.split("-");I.push({resourceId:A.id,startTime:Z,endTime:ee,reserved:G})})}p.value.set(D,I)}}).catch(()=>{}))}await Promise.all(f)};return b(),$(),e.watch(a,()=>{$()}),e.provide("agendaData",g),e.provide("activeDate",r),e.provide("viewMode",a),e.provide("events",T),e.provide("resources",B),e.provide("allResources",k),(t,l)=>{const f=e.resolveComponent("Button"),m=e.resolveComponent("SegmentedControlButton"),N=e.resolveComponent("SegmentedControl"),D=e.resolveComponent("Calendar");return e.openBlock(),e.createBlock(te._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",xt,[e.createElementVNode("div",yt,[e.createElementVNode("div",kt,[e.createElementVNode("div",bt,[e.createElementVNode("div",_t,[e.createVNode(e.unref(C.CalendarDays),{size:20,class:"text-primary flex-shrink-0"}),e.createElementVNode("h2",Nt,e.toDisplayString(P.value.full),1)]),e.createElementVNode("p",Et,e.toDisplayString(g.value?.serviceName),1)]),o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",wt,[e.createElementVNode("div",Vt,[e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:U},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:16})]),_:1}),e.createVNode(f,{variant:"outline",size:"sm",class:"h-8 sm:h-9 px-2 sm:px-3 text-xs sm:text-sm",onClick:O},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:16})]),_:1})]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(N,{key:0,modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=s=>a.value=s)},{default:e.withCtx(()=>[e.createVNode(m,{value:1},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"1 Day",-1)])]),_:1}),e.createVNode(m,{value:3},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"3 Days",-1)])]),_:1}),e.createVNode(m,{value:7},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"7 Days",-1)])]),_:1})]),_:1},8,["modelValue"])),!o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:1})):e.createCommentVNode("",!0)])]),o.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 px-3 py-1.5 rounded-full border text-sm whitespace-nowrap transition-colors flex-shrink-0",{"bg-primary text-primary-foreground border-primary":V.value===s.id,"bg-background hover:bg-muted":V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",style:e.normalizeStyle({backgroundColor:V.value===s.id?"rgba(255,255,255,0.3)":s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("span",null,e.toDisplayString(s.name),1)],10,Ct))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.createElementVNode("div",$t,[e.createVNode(D,{modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=s=>r.value=s),"weekday-format":"short",class:"rounded-md border"},null,8,["modelValue"]),w.value.length>0?(e.openBlock(),e.createElementBlock("div",Dt,[l[7]||(l[7]=e.createElementVNode("div",{class:"flex items-center justify-between mb-3"},[e.createElementVNode("span",{class:"text-sm font-medium"},"Resources")],-1)),e.createElementVNode("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",{"bg-muted ring-2 ring-primary/20":V.value===s.id,"opacity-50":V.value&&V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Mt,[e.createElementVNode("div",It,e.toDisplayString(s.name),1)]),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full flex-shrink-0",V.value===s.id?"bg-primary":"bg-muted-foreground/30"])},null,2)],10,zt))),128)),M.value.length>0?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("button",{class:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",onClick:l[2]||(l[2]=s=>S.value=!S.value)},[e.createVNode(e.unref(C.ChevronRight),{size:14,class:e.normalizeClass(["transition-transform",{"rotate-90":S.value}])},null,8,["class"]),e.createElementVNode("span",null,"Inactive ("+e.toDisplayString(M.value.length)+")",1)]),S.value?(e.openBlock(),e.createElementBlock("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"flex items-center gap-2 p-2 rounded-md opacity-50"},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0 grayscale",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Ut,[e.createElementVNode("div",jt,e.toDisplayString(s.name),1)])]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createVNode(ht)])])]),_:1})}}});exports.default=Ft;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("./DateFormatter-DbtOLV0L.js"),C=require("lucide-vue-next"),te=require("./EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js"),j=require("@oneclick.dev/cms-kit"),K=require("./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.js"),Q=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js"),ne={class:"mb-6"},re={class:"flex items-end gap-px h-24 bg-muted/30 rounded-lg p-2 overflow-visible"},se=["onClick"],ae={class:"absolute -top-8 left-1/2 -translate-x-1/2 bg-popover border shadow-md rounded px-2 py-1 text-xs whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10"},le={class:"font-medium"},ie={class:"text-muted-foreground"},ce={class:"w-full flex-1 flex items-end justify-center"},de={key:1,class:"text-[10px] mt-1"},ue={key:0,class:"mt-2 text-sm text-muted-foreground flex items-center gap-2"},me={class:"font-medium text-foreground"},pe={class:"font-medium text-foreground"},fe=e.defineComponent({__name:"TimelineChart",props:{timeSlots:{},slotStats:{},selectedTimeSlot:{},maxSpots:{}},emits:["select","clear"],setup(u,{emit:h}){const v=h,y=r=>{v("select",r)},E=()=>{v("clear")};return(r,a)=>{const i=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",ne,[a[2]||(a[2]=e.createElementVNode("h3",{class:"font-semibold text-sm mb-2"},"Timeline",-1)),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.timeSlots,o=>(e.openBlock(),e.createElementBlock("div",{key:o.startTime,class:"flex-1 min-w-0 flex flex-col items-center cursor-pointer group h-full relative",onClick:x=>y(o.startTime)},[e.createElementVNode("div",ae,[e.createElementVNode("div",le,e.toDisplayString(o.startTime),1),e.createElementVNode("div",ie,e.toDisplayString(u.slotStats[o.startTime]?.spots||0)+" spots",1)]),e.createElementVNode("div",ce,[e.createElementVNode("div",{class:e.normalizeClass(["w-full transition-all duration-200",[u.selectedTimeSlot===o.startTime?"bg-primary":u.slotStats[o.startTime]?.spots>0?"bg-primary/60 group-hover:bg-primary/80":"bg-muted-foreground/20 group-hover:bg-muted-foreground/30"]]),style:e.normalizeStyle({height:u.slotStats[o.startTime]?.spots>0?`${u.slotStats[o.startTime].spots/u.maxSpots*100}%`:"2px",minHeight:u.slotStats[o.startTime]?.spots>0?"4px":"2px"})},null,6)]),o.startTime.endsWith(":00")?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-[10px] text-muted-foreground mt-1 transition-colors truncate",{"text-primary font-medium":u.selectedTimeSlot===o.startTime}])},e.toDisplayString(o.label),3)):(e.openBlock(),e.createElementBlock("span",de," "))],8,se))),128))]),u.selectedTimeSlot?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(i,{variant:"ghost",size:"icon",class:"h-6 w-6 p-0",onClick:E},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1}),e.createElementVNode("span",null,[a[0]||(a[0]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",me,e.toDisplayString(u.slotStats[u.selectedTimeSlot]?.bookings||0),1),a[1]||(a[1]=e.createTextVNode(" bookings at ",-1)),e.createElementVNode("span",pe,e.toDisplayString(u.selectedTimeSlot),1)])])):e.createCommentVNode("",!0)])}}}),ve={class:"flex items-center justify-between mb-3"},ge={class:"font-semibold"},he={key:0,class:"text-muted-foreground font-normal"},xe={class:"relative mb-3"},ye={key:0,class:"flex items-center justify-center py-8"},ke={key:1,class:"text-center py-8 text-muted-foreground"},be={key:2,class:"space-y-2 max-h-80 overflow-y-auto"},_e=["onClick"],Ne={class:"flex items-start justify-between"},Ee={class:"flex-1"},we={class:"font-medium"},Ve={class:"text-sm text-muted-foreground"},Se={class:"text-sm text-muted-foreground"},Ce={class:"flex items-center gap-4"},Be={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},$e={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},De={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},ze={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Me={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Ie={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Le={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Re={key:5,class:"text-sm font-medium mt-1"},Ue=e.defineComponent({__name:"BookingsList",props:{orders:{},filteredOrders:{},isLoading:{type:Boolean},selectedTimeSlot:{},searchQuery:{}},emits:["update:searchQuery","refresh"],setup(u,{emit:h}){const v=h,y=e.ref(null),E=i=>{v("update:searchQuery",i)},r=()=>{v("update:searchQuery","")},a=()=>{v("refresh")};return(i,o)=>{const x=e.resolveComponent("Input"),g=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ve,[e.createElementVNode("h3",ge,[o[0]||(o[0]=e.createTextVNode(" Bookings ",-1)),u.selectedTimeSlot||u.searchQuery?(e.openBlock(),e.createElementBlock("span",he," ("+e.toDisplayString(u.filteredOrders.length)+" of "+e.toDisplayString(u.orders.length)+") ",1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",xe,[e.createVNode(e.unref(C.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(x,{"model-value":u.searchQuery,placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9","onUpdate:modelValue":E},null,8,["model-value"]),u.searchQuery?(e.openBlock(),e.createBlock(g,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:r},{default:e.withCtx(()=>[e.createVNode(e.unref(C.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),u.isLoading?(e.openBlock(),e.createElementBlock("div",ye,[...o[1]||(o[1]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):u.filteredOrders.length===0?(e.openBlock(),e.createElementBlock("div",ke,e.toDisplayString(u.selectedTimeSlot?"No bookings for this time slot":"No bookings for this event"),1)):(e.openBlock(),e.createElementBlock("div",be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.filteredOrders,p=>(e.openBlock(),e.createElementBlock("div",{key:p.res_id||p.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors",onClick:w=>e.unref(y).openDialog(p)},[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ee,[e.createElementVNode("div",we,e.toDisplayString(p.customerInfo.firstName+" "+p.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Ve,e.toDisplayString(p.customerInfo.email),1),e.createElementVNode("div",Se,e.toDisplayString(p.customerInfo.phone),1),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[e.createVNode(e.unref(C.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.startTime)+" - "+e.toDisplayString(p.endTime),1)]),e.createElementVNode("div",$e,[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(p.spots),1)])])]),e.createElementVNode("div",De,[p.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Te,"Needs Approval")):p.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",ze,"Approved")):p.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Me,"Rejected")):p.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ie,"Cancelled")):(e.openBlock(),e.createElementBlock("span",Le,"Pending")),p.reservationPrice||p.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Re," €"+e.toDisplayString(p.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,_e))),128))])),e.createVNode(K._sfc_main,{ref_key:"reservationDetailDialog",ref:y,onCancelled:a,onConfirmed:a,onRejected:a},null,512)])}}}),je={class:"flex items-center gap-4 mt-2 text-sm"},Fe={class:"flex items-center gap-1"},Pe={key:0,class:"flex items-center gap-1"},Oe={class:"flex items-center gap-1"},Ae={class:"py-4"},qe=e.defineComponent({__name:"EventDialog",props:{resources:{default:()=>[]}},setup(u,{expose:h}){const v=u,{config:y}=j.useModule(),{params:E}=j.useModuleRoute(),r=j.useFirebaseIntegration(y.project),a=e.ref(!1),i=e.ref(null),o=e.ref([]),x=e.ref(!1),g=e.ref(null),p=e.ref("");e.provide("event",i);const w=e.computed(()=>{if(!i.value)return[];const d=i.value.resource?.interval||60,n=[],[c,_]=i.value.startTime.split(":").map(Number),[T,b]=i.value.endTime.split(":").map(Number),$=c*60+_,t=T*60+b;for(let l=$;l<t;l+=d){const f=Math.floor(l/60),m=l%60,N=Math.min(l+d,t),D=Math.floor(N/60),s=N%60,z=`${f.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`,I=`${D.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;n.push({startTime:z,endTime:I,label:z})}return n}),k=d=>{const n=d.getFullYear(),c=String(d.getMonth()+1).padStart(2,"0"),_=String(d.getDate()).padStart(2,"0");return`${n}-${c}-${_}`},M=e.computed(()=>{const d={};return w.value.forEach(n=>{d[n.startTime]={bookings:0,spots:0,orders:[]}}),o.value.forEach(n=>{w.value.forEach(c=>{n.startTime<c.endTime&&n.endTime>c.startTime&&(d[c.startTime].bookings++,d[c.startTime].spots+=n.spots||0,d[c.startTime].orders.push(n))})}),d}),V=e.computed(()=>Math.max(1,...Object.values(M.value).map(d=>d.spots))),S=e.computed(()=>{let d=o.value;return g.value&&(d=M.value[g.value]?.orders||[]),p.value.trim()&&(d=new K.Fuse(d,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone"],threshold:.3,ignoreLocation:!0}).search(p.value).map(c=>c.item)),d}),B=e.computed(()=>({spots:o.value.reduce((d,n)=>d+(n.spots||0),0),bookings:o.value.length})),F=d=>{g.value===d?g.value=null:g.value=d},L=()=>{g.value=null},P=async d=>{a.value=!0,i.value=d,g.value=null,p.value="",await U()},U=async()=>{if(i.value){x.value=!0,o.value=[];try{const d=E.value.id,n=k(new Date(i.value.date)),c=new Set;v.resources?.forEach(b=>{const $=`${b.id}_${n}`;c.add($)});const _=await r.find(y.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:d},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(c)}]});let T=[];_.forEach(b=>{(b.reservations?.filter(t=>t.date===n)||[]).forEach(t=>{const l=v.resources.find(f=>f.id===t.resourceId);(t.status==="approved"||t.status==="needs_approval")&&T.push({customerInfo:b.customerInfo,amountDue:b.amountDue,amountPaid:b.amountPaid,status:b.status,reservationStatus:t.status,subtotal:b.subtotal,total:b.total,discount:b.discount,id:b.id,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:n,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:l?.name||"Unknown",resourceColor:l?.color})})}),o.value=T.sort((b,$)=>b.startTime?.localeCompare($.startTime||"")||0)}catch(d){console.error("Error loading orders:",d),o.value=[]}finally{x.value=!1}}},q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],O=["January","February","March","April","May","June","July","August","September","October","November","December"];return h({openDialog:P}),(d,n)=>{const c=e.resolveComponent("DialogTitle"),_=e.resolveComponent("DialogDescription"),T=e.resolveComponent("DialogHeader"),b=e.resolveComponent("Button"),$=e.resolveComponent("DialogFooter"),t=e.resolveComponent("DialogScrollContent"),l=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(l,{open:a.value,"onUpdate:open":n[2]||(n[2]=f=>a.value=f)},{default:e.withCtx(()=>[e.createVNode(t,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[i.value?.date?(e.openBlock(),e.createBlock(c,{key:0},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(q[new Date(i.value.date).getUTCDay()])+" "+e.toDisplayString(O[new Date(i.value.date).getUTCMonth()])+" "+e.toDisplayString(new Date(i.value.date).getUTCDate())+", "+e.toDisplayString(new Date(i.value.date).getUTCFullYear()),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(_,null,{default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(C.Clock),{size:14}),e.createElementVNode("span",null,e.toDisplayString(i.value?.startTime)+" – "+e.toDisplayString(i.value?.endTime),1)]),i.value?.resource?(e.openBlock(),e.createElementBlock("div",Pe,[e.createElementVNode("div",{class:"w-4 h-4 rounded-full",style:e.normalizeStyle({backgroundColor:i.value.resource.color||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(i.value.resource.name),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",Oe,[e.createVNode(e.unref(C.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(B.value.spots)+" spots in "+e.toDisplayString(B.value.bookings)+" reservations",1)])])]),_:1})]),_:1}),e.createElementVNode("div",Ae,[w.value.length>1?(e.openBlock(),e.createBlock(fe,{key:0,"time-slots":w.value,"slot-stats":M.value,"selected-time-slot":g.value,"max-spots":V.value,onSelect:F,onClear:L},null,8,["time-slots","slot-stats","selected-time-slot","max-spots"])):e.createCommentVNode("",!0),e.createVNode(Ue,{orders:o.value,"filtered-orders":S.value,"is-loading":x.value,"selected-time-slot":g.value,"search-query":p.value,"onUpdate:searchQuery":n[0]||(n[0]=f=>p.value=f),onRefresh:U},null,8,["orders","filtered-orders","is-loading","selected-time-slot","search-query"])]),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(b,{variant:"outline",onClick:n[1]||(n[1]=f=>a.value=!1)},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("Close",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),He={class:"flex-1 border-r shadow-sm overflow-hidden min-h-[1536px]"},We={class:"relative h-full min-h-[1536px]"},Qe={class:"divide-y divide-input/80 h-full flex flex-col min-h-[1536px] border-y border-input/80"},Xe={class:"absolute inset-0 pointer-events-none"},Ye={class:"relative mr-3 h-full ml-2"},Je=["onClick"],Ke={key:0,class:"absolute bottom-0 left-0 right-0 h-1 bg-black/20"},Ge={class:"flex items-start justify-between gap-2 mb-1"},Ze={class:"font-semibold text-sm leading-tight line-clamp-1 flex-1"},et={class:"flex items-center gap-1 shrink-0"},tt=["title"],ot={class:"font-medium"},X=e.defineComponent({__name:"EventTimeline",props:{date:{},events:{},firstDay:{type:Boolean,default:!1},resources:{default:()=>[]}},setup(u){const h=u,v=e.ref(null),y=a=>{const[i,o]=a.split(":").map(Number);return i*60+o};e.computed(()=>!h.events||!h.resources?[]:h.resources.map(a=>{const o=h.events.filter(x=>x.resourceId===a.id).map(x=>{const g=y(x.startTime),w=y(x.endTime)-g,k=g/1440*100,M=w/1440*100,V=(x.bookings??0)>0,S=x.maxBookings?(x.bookings??0)/x.maxBookings*100:0;return{...x,top:`${k}%`,height:`${M}%`,color:x.resource?.color||"#3b82f6",hasBookings:V,fillPercentage:S,isSmall:w<60}});return{resource:a,events:o}}));const E=e.computed(()=>h.events?h.events.map(a=>{const i=y(a.startTime),x=y(a.endTime)-i,g=i/1440*100,p=x/1440*100,w=(a.bookings??0)>0,k=a.maxBookings?(a.bookings??0)/a.maxBookings*100:0;return{...a,top:`${g}%`,height:`${p}%`,color:a.resource?.color||"#3b82f6",hasBookings:w,fillPercentage:k,isSmall:x<60}}):[]),r=Array.from({length:24},(a,i)=>({hour:i,label:`${i.toString().padStart(2,"0")}:00`}));return(a,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",He,[e.createElementVNode("div",We,[e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),o=>(e.openBlock(),e.createElementBlock("div",{key:o.hour,class:"flex-1 flex transition-all duration-200"},[...i[0]||(i[0]=[e.createElementVNode("div",{class:"flex-1 relative"},[e.createElementVNode("div",{class:"absolute top-1/2 left-0 right-0 border-t border-dashed border-input/50"})],-1)])]))),128))]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.id,style:e.normalizeStyle({top:o.top,height:o.height,opacity:o.hasBookings?"1":"0.5"}),class:"event-card absolute left-2 right-2 rounded-lg pointer-events-auto cursor-pointer group/event transition-all duration-200 hover:shadow-xl overflow-hidden",onClick:x=>v.value?.openDialog(o)},[e.createElementVNode("div",{style:e.normalizeStyle({backgroundColor:o.color}),class:"absolute inset-0 shadow-lg"},[o.maxBookings?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",{class:"h-full bg-white/40 transition-all duration-300",style:e.normalizeStyle({width:`${o.fillPercentage}%`})},null,4)])):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:e.normalizeClass(["relative h-full p-3 flex flex-col",`${o.hasBookings?"text-white":"text-gray-600 dark:text-gray-100"}`])},[e.createElementVNode("div",Ge,[e.createElementVNode("h3",Ze,e.toDisplayString(o.title),1),e.createElementVNode("div",et,[o.resource?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold bg-white/30 backdrop-blur-sm text-white border border-white/40",title:o.resource.name},e.toDisplayString(o.resource.avatarLabel||o.resource.name.charAt(0).toUpperCase()),9,tt)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium",o.hasBookings?"bg-white text-black backdrop-blur-sm":"bg-black/10 backdrop-blur-sm"])},[e.createVNode(e.unref(C.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(o.bookings),1)],2)])]),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 text-xs opacity-90 mt-auto",{"-translate-x-1 -translate-y-2 scale-80 origin-[0_0]":o.isSmall}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-1 px-2 py-0.5 rounded backdrop-blur-sm",{"bg-black/10":!o.isSmall}])},[e.createVNode(e.unref(C.Clock),{size:10}),e.createElementVNode("span",ot,e.toDisplayString(o.startTime)+" – "+e.toDisplayString(o.endTime),1)],2)],2)],2),i[1]||(i[1]=e.createElementVNode("div",{class:"absolute inset-0 border-2 border-white/0 group-hover/event:border-white/30 rounded-lg transition-colors duration-200 pointer-events-none"},null,-1))],12,Je))),128))])])])]),e.createVNode(qe,{resources:u.resources,ref_key:"eventDialog",ref:v},null,8,["resources"])],64))}}),nt={class:"sticky left-0 mt-auto z-10 divide-y divide-border/50 h-full flex flex-col min-h-[1536px] bg-input"},rt={class:"flex-shrink-0 text-xs font-medium text-muted-foreground px-3 pb-3 border-r border-border/50 w-14"},st={class:"flex items-center gap-1.5"},Y=e.defineComponent({__name:"Event24hSidebar",setup(u){const h=Array.from({length:24},(v,y)=>({hour:y,label:`${y.toString().padStart(2,"0")}:00`}));return(v,y)=>(e.openBlock(),e.createElementBlock("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),E=>(e.openBlock(),e.createElementBlock("div",{key:E.hour,class:"flex-1 flex transition-all duration-200"},[e.createElementVNode("div",rt,[e.createElementVNode("div",st,[e.createElementVNode("span",{class:e.normalizeClass({"-translate-y-1/2":E.hour!==0})},e.toDisplayString(E.label),3)])])]))),128))]))}}),at={class:"absolute top-0 w-full pointer-events-none"},lt={key:0,class:"absolute -right-2 -top-0.5 px-2 py-0.5 bg-red-500 text-white text-xs font-medium rounded shadow-lg"},J=e.defineComponent({__name:"EventTimeIndicator",props:{currentDate:{type:Object,required:!1}},setup(u){const h=e.ref(Date.now());let v;e.onMounted(()=>{v=window.setInterval(()=>{h.value=Date.now()},1e3)}),e.onUnmounted(()=>{v&&clearInterval(v)});const y=e.computed(()=>{const r=new Date(h.value);return`${(r.getHours()*60+r.getMinutes()+r.getSeconds()/60)/1440*100}%`}),E=e.computed(()=>new Date(h.value).getFullYear()+"-"+(new Date(h.value).getMonth()+1).toString().padStart(2,"0")+"-"+new Date(h.value).getDate().toString().padStart(2,"0"));return(r,a)=>(e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",{class:"absolute left-0 right-0 h-0.5 bg-red-500 z-30 pointer-events-none transition-[top] duration-300 ease-linear",style:e.normalizeStyle({top:y.value})},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute -left-2 -top-1.5 w-3 h-3 bg-red-500 rounded-full shadow-lg shadow-red-500/50"},null,-1)),u.currentDate&&u.currentDate==E.value?(e.openBlock(),e.createElementBlock("div",lt," Now ")):e.createCommentVNode("",!0)],4)]))}}),it={key:0,class:"relative flex flex-1 min-w-0"},ct={key:1,class:"flex-1 min-w-0 relative"},dt={key:0,class:"absolute top-0 right-0 z-10 px-3 py-1.5 bg-primary/90 text-primary-foreground text-xs font-medium rounded-bl-lg shadow-lg backdrop-blur-sm flex items-center gap-1.5 animate-pulse-subtle"},ut={class:"flex pb-4 min-w-[200px]"},mt=["onClick"],pt={key:0,class:"absolute top-2 right-2 flex items-center gap-1 px-2 py-0.5 bg-primary/20 backdrop-blur-sm rounded-full border border-primary/30"},ft={class:"text-xs text-muted-foreground font-medium group-hover:text-foreground/70 transition-colors"},vt={key:0,class:"absolute bottom-0 left-0 w-full h-1 bg-orange-500"},gt=e.defineComponent({__name:"EventView",setup(u){const h=e.inject("activeDate",e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()))),v=e.inject("viewMode",e.ref(1)),y=e.inject("events",e.ref([])),E=e.inject("resources",e.ref([])),r=e.ref(null),a=e.ref(!1),i=e.ref(!1);e.computed(()=>E.value.length>1);const o=e.computed(()=>{const n=[],c=h.value;for(let _=0;_<v.value;_++)n.push(c.add({days:_}));return n}),x=(n,c)=>{const _=`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`;return y.value?.filter(T=>T.date===_)||[]},g=n=>{const c=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2());return n.year===c.year&&n.month===c.month&&n.day===c.day},p=n=>{h.value=n,v.value=1};let w=null,k=null;const M=()=>{r.value&&(S(),r.value.scrollBy({left:-300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:-20,behavior:"auto"})},50)},300))},V=()=>{r.value&&(S(),r.value.scrollBy({left:300,behavior:"smooth"}),k=window.setTimeout(()=>{w=window.setInterval(()=>{r.value&&r.value.scrollBy({left:20,behavior:"auto"})},50)},300))},S=()=>{k&&(clearTimeout(k),k=null),w&&(clearInterval(w),w=null)},B=()=>{if(!r.value)return;const{scrollLeft:n,scrollWidth:c,clientWidth:_}=r.value;a.value=n>10,i.value=n<c-_-10},F=n=>{r.value&&Math.abs(n.deltaY)>Math.abs(n.deltaX)&&(n.preventDefault(),r.value.scrollBy({left:n.deltaY,behavior:"auto"}))},L=e.ref(!1),P=e.ref(0),U=e.ref(0),q=n=>{!r.value||v.value===1||n.target.closest(".event-card")||(L.value=!0,P.value=n.pageX,U.value=r.value.scrollLeft,r.value.style.userSelect="none",n.preventDefault())},O=n=>{if(!L.value||!r.value)return;const c=n.pageX,_=(P.value-c)*1.2;r.value.scrollLeft=U.value+_},d=()=>{r.value&&(L.value=!1,r.value.style.userSelect="")};return e.onMounted(()=>{r.value&&(r.value.addEventListener("scroll",B),r.value.addEventListener("wheel",F,{passive:!1}),e.nextTick(()=>{B(),setTimeout(B,50),setTimeout(B,150),setTimeout(B,300),setTimeout(B,500)})),document.addEventListener("mousemove",O),document.addEventListener("mouseup",d)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",d)}),e.watch(v,()=>{v.value>1?e.nextTick(()=>{setTimeout(()=>{if(!r.value)return;const{scrollWidth:n,clientWidth:c}=r.value;n>c&&(i.value=!0,a.value=!1)},100)}):r.value&&(r.value.style.cursor="")}),e.onUnmounted(()=>{S(),r.value&&(r.value.removeEventListener("scroll",B),r.value.removeEventListener("wheel",F))}),(n,c)=>{const _=e.resolveComponent("Button"),T=e.resolveComponent("TooltipTrigger"),b=e.resolveComponent("TooltipContent"),$=e.resolveComponent("Tooltip");return e.unref(v)===1?(e.openBlock(),e.createElementBlock("div",it,[e.createVNode(Y),e.createVNode(J,{class:"h-full","current-date":e.unref(h)},null,8,["current-date"]),e.createVNode(X,{date:e.unref(h),events:x(e.unref(h)),resources:e.unref(E)},null,8,["date","events","resources"])])):(e.openBlock(),e.createElementBlock("div",ct,[e.unref(v)===7?(e.openBlock(),e.createElementBlock("div",dt,[e.createVNode(e.unref(C.ChevronLeft),{size:12}),c[0]||(c[0]=e.createElementVNode("span",null,"Scroll to view all days",-1)),e.createVNode(e.unref(C.ChevronRight),{size:12})])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(_,{key:1,variant:"outline",size:"icon",onMousedown:M,onMouseup:S,onMouseleave:S,onTouchstart:M,onTouchend:S,class:"sticky top-1/2 left-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:20})]),_:1})):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createBlock(_,{key:2,variant:"outline",size:"icon",onMousedown:V,onMouseup:S,onMouseleave:S,onTouchstart:V,onTouchend:S,class:"sticky top-1/2 right-2 -translate-y-1/2 z-40 h-10 w-10 rounded-full shadow-lg bg-background/95 backdrop-blur-sm hover:bg-background border-2 float-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:20})]),_:1})):e.createCommentVNode("",!0),e.createVNode(J,{class:"h-[calc(100%-164px)] mt-[122px]"}),e.createElementVNode("div",{class:e.normalizeClass(["absolute right-0 top-0 bottom-0 w-8 bg-gradient-to-l from-background to-transparent z-10 pointer-events-none transition-opacity duration-300",i.value?"opacity-100":"opacity-0"])},null,2),e.createElementVNode("div",{ref_key:"scrollContainer",ref:r,class:"absolute inset-0 overflow-x-auto overflow-y-visible",onScroll:B,onMousedown:q},[e.createElementVNode("div",ut,[e.createVNode(Y),c[5]||(c[5]=e.createElementVNode("div",{class:"absolute w-14 h-[125px] bg-input"},null,-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{key:t.toString(),class:e.normalizeClass(["flex-shrink-0",{"min-w-[200px] w-[33.33%]":e.unref(v)===3,"min-w-[280px]":e.unref(v)===7}])},[e.createElementVNode("div",{onClick:f=>p(t),class:e.normalizeClass(["relative p-3 border cursor-pointer transition-all duration-200 group relative",g(t)?"bg-gradient-to-br from-primary/10 to-primary/5 border-primary/30 hover:from-primary/20 hover:to-primary/10 hover:border-primary/50 hover:shadow-md":"bg-gradient-to-br from-muted/50 to-muted/30 border-border hover:from-accent/50 hover:to-accent/30 hover:border-accent-foreground/20 hover:shadow-md"])},[g(t)?(e.openBlock(),e.createElementBlock("div",pt,[...c[1]||(c[1]=[e.createElementVNode("div",{class:"w-1.5 h-1.5 bg-primary rounded-full animate-pulse"},null,-1),e.createElementVNode("span",{class:"text-[9px] font-bold text-primary uppercase tracking-wide"},"Today",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["text-xs font-semibold uppercase tracking-wider transition-colors",g(t)?"text-primary group-hover:text-primary/80":"text-muted-foreground group-hover:text-foreground"])},e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{weekday:"short"})),3),e.createElementVNode("div",{class:e.normalizeClass(["text-2xl font-bold transition-colors",g(t)?"text-foreground":"text-foreground group-hover:text-primary"])},e.toDisplayString(t.day),3),e.createElementVNode("div",ft,e.toDisplayString(new Date(t.year,t.month-1,t.day).toLocaleDateString("en-US",{month:"long",year:"numeric"})),1),c[4]||(c[4]=e.createElementVNode("div",{class:"mt-2 pt-2 border-t border-border/0 group-hover:border-border/50 transition-all"},[e.createElementVNode("div",{class:"text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/100 uppercase tracking-wide transition-all"}," Click to view ")],-1)),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createBlock(e.unref(C.Asterisk),{key:0,class:"absolute top-3 right-3 size-4 text-orange-500"})):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[2]||(c[2]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(T,{"as-child":""},{default:e.withCtx(()=>[x(t).filter(f=>f.isException).length>0?(e.openBlock(),e.createElementBlock("div",vt)):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(b,null,{default:e.withCtx(()=>[...c[3]||(c[3]=[e.createElementVNode("p",null," This day has exceptions applied to it. ",-1)])]),_:1})]),_:2},1024)],10,mt),e.createVNode(X,{date:t,events:x(t),resources:e.unref(E)},null,8,["date","events","resources"])],2))),128))])],544)]))}}}),ht=oe._export_sfc(gt,[["__scopeId","data-v-99339cf2"]]),xt={class:"flex flex-col gap-2 md:gap-4 w-full h-full"},yt={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 px-1"},kt={class:"flex items-center justify-between sm:justify-start gap-4"},bt={class:"flex flex-col"},_t={class:"flex items-center gap-2"},Nt={class:"text-lg sm:text-2xl font-bold tracking-tight truncate"},Et={class:"text-xs sm:text-sm text-muted-foreground ml-7 truncate"},wt={class:"flex items-center justify-between sm:justify-end gap-2"},Vt={class:"flex items-center gap-1 sm:mr-2"},St={key:0,class:"flex items-center gap-2 px-1 overflow-x-auto pb-2 -mx-1 scrollbar-hide"},Ct=["onClick"],Bt={class:"flex gap-4 flex-1 min-h-0 md:min-h-[1700px]"},$t={class:"hidden md:flex flex-shrink-0 flex-col gap-4"},Dt={key:0,class:"rounded-md border p-3"},Tt={class:"space-y-1"},zt=["onClick"],Mt={class:"min-w-0 flex-1"},It={class:"text-sm font-medium truncate"},Lt={key:0,class:"pt-2 mt-2 border-t"},Rt={key:0,class:"mt-1 space-y-1"},Ut={class:"min-w-0 flex-1"},jt={class:"text-sm font-medium truncate text-muted-foreground"},Ft=e.defineComponent({__name:"agenda",setup(u){const{hasPermission:h}=j.useModulePermissions(),{params:v}=j.useModuleRoute(),{config:y}=j.useModule(),E=j.useFirebaseIntegration(y.project),r=e.ref(R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())),a=e.ref(1),i=e.ref(typeof window<"u"?window.innerWidth:1024),o=e.computed(()=>i.value<768),x=()=>{i.value=window.innerWidth};e.onMounted(()=>{window.addEventListener("resize",x)}),e.onUnmounted(()=>{window.removeEventListener("resize",x)}),e.watch(o,t=>{t&&a.value!==1&&(a.value=1)},{immediate:!0});const g=e.ref(null),p=e.ref(new Map),w=e.computed(()=>g.value?.resources||[]),k=e.computed(()=>w.value.filter(t=>t.isActive)),M=e.computed(()=>w.value.filter(t=>!t.isActive)),V=e.ref(null),S=e.ref(!1);e.watch(k,t=>{t.length>0&&!V.value&&(V.value=t[0].id)},{immediate:!0});const B=e.computed(()=>{if(!V.value)return k.value.length>0?[k.value[0]]:[];const t=k.value.find(l=>l.id===V.value);return t?[t]:k.value.length>0?[k.value[0]]:[]}),F=e.computed(()=>g.value?.pricingOptions?.find(l=>l.isDefault)?.duration||30),L=t=>{V.value=t};e.watch(r,()=>{$()});const P=e.computed(()=>{const t=r.value,l=new Date(t.year,t.month-1,t.day),f=l.toLocaleDateString("en-US",{weekday:"long"}).toUpperCase(),m=t.day,N=l.toLocaleDateString("en-US",{month:"short"}).toUpperCase();return{dayName:f,day:m,monthName:N,full:`${f} ${m} ${N}`}}),U=()=>{r.value=r.value.subtract({days:a.value})},q=()=>{r.value=r.value.add({days:a.value})},O=()=>{r.value=R.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(R.$14e0f24ef4ac5c92$export$aa8b41735afcabd2())},d=t=>{const[l,f]=t.split(":").map(Number);return l*60+f},n=(t,l)=>(g.value?.exceptions||[]).find(m=>l>=m.startDate&&l<=m.endDate?m.resourceIds===null?!0:m.resourceIds?.includes(t):!1)||null,c=(t,l,f)=>{const m=n(t.id,f);if(m)return m.isClosed?[]:m.timeslots.map(s=>({startTime:s.startTime,endTime:s.endTime,isException:!0}));const N=l.getDay(),D=t.openingHours?.[N]||[];return D.length===0?[]:D.map(s=>({startTime:s.start,endTime:s.end,isException:!1}))},_=(t,l,f,m)=>{if(!g.value)return 0;const N=p.value.get(l);return N?N.filter(s=>s.resourceId===t).reduce((s,z)=>{const I=d(z.startTime),A=d(z.endTime),H=d(f),W=d(m);return I<W&&A>H?s+(z.reserved||0):s},0):0},T=e.computed(()=>{if(!g.value)return[];p.value.size;let t=[],l=[];for(let m=0;m<a.value;m++){const N=r.value.add({days:m});l.push(N)}const f=B.value.length>0?B.value:[];return f.length===0?[]:(l.forEach(m=>{let N=new Date(m.year,m.month-1,m.day);const D=`${m.year}-${String(m.month).padStart(2,"0")}-${String(m.day).padStart(2,"0")}`;f.forEach(s=>{const z=c(s,N,D);t=t.concat(z.map((I,A)=>{const H=_(s.id,D,I.startTime,I.endTime);return{id:`block-${D}-${s.id}-${A}`,title:g.value.serviceName,date:D,startTime:I.startTime,endTime:I.endTime,theme:s.color||"#3b82f6",bookings:H,maxBookings:s.capacity,isException:I.isException||!1,resourceId:s.id,resource:s,interval:s.interval||30,serviceDuration:F.value}}))})}),t)}),b=async()=>{g.value=await E.get(y.agendaCollection,v.value.id)},$=async()=>{const t=v.value.id,l=r.value;p.value.clear();const f=[];for(let m=0;m<a.value;m++){const N=l.add({days:m}),D=`${N.year}-${String(N.month).padStart(2,"0")}-${String(N.day).padStart(2,"0")}`,s=`${t}_${D}`;f.push(E.get(y.reservedSpotsCollection,s).then(z=>{if(z){let I=[];for(const A of k.value){const H=z?.[A.id]||{};Object.entries(H).forEach(([W,G])=>{const[Z,ee]=W.split("-");I.push({resourceId:A.id,startTime:Z,endTime:ee,reserved:G})})}p.value.set(D,I)}}).catch(()=>{}))}await Promise.all(f)};return b(),$(),e.watch(a,()=>{$()}),e.provide("agendaData",g),e.provide("activeDate",r),e.provide("viewMode",a),e.provide("events",T),e.provide("resources",B),e.provide("allResources",k),(t,l)=>{const f=e.resolveComponent("Button"),m=e.resolveComponent("SegmentedControlButton"),N=e.resolveComponent("SegmentedControl"),D=e.resolveComponent("Calendar");return e.openBlock(),e.createBlock(te._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",xt,[e.createElementVNode("div",yt,[e.createElementVNode("div",kt,[e.createElementVNode("div",bt,[e.createElementVNode("div",_t,[e.createVNode(e.unref(C.CalendarDays),{size:20,class:"text-primary flex-shrink-0"}),e.createElementVNode("h2",Nt,e.toDisplayString(P.value.full),1)]),e.createElementVNode("p",Et,e.toDisplayString(g.value?.serviceName),1)]),o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:0})):e.createCommentVNode("",!0)]),e.createElementVNode("div",wt,[e.createElementVNode("div",Vt,[e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:U},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronLeft),{size:16})]),_:1}),e.createVNode(f,{variant:"outline",size:"sm",class:"h-8 sm:h-9 px-2 sm:px-3 text-xs sm:text-sm",onClick:O},{default:e.withCtx(()=>[...l[3]||(l[3]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(f,{variant:"outline",size:"icon",class:"size-8 sm:size-9",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(C.ChevronRight),{size:16})]),_:1})]),o.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(N,{key:0,modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=s=>a.value=s)},{default:e.withCtx(()=>[e.createVNode(m,{value:1},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"1 Day",-1)])]),_:1}),e.createVNode(m,{value:3},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"3 Days",-1)])]),_:1}),e.createVNode(m,{value:7},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createElementVNode("span",{class:"whitespace-nowrap"},"7 Days",-1)])]),_:1})]),_:1},8,["modelValue"])),!o.value&&e.unref(h)("manage-reservations")?(e.openBlock(),e.createBlock(Q._sfc_main,{key:1})):e.createCommentVNode("",!0)])]),o.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",St,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("button",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 px-3 py-1.5 rounded-full border text-sm whitespace-nowrap transition-colors flex-shrink-0",{"bg-primary text-primary-foreground border-primary":V.value===s.id,"bg-background hover:bg-muted":V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",style:e.normalizeStyle({backgroundColor:V.value===s.id?"rgba(255,255,255,0.3)":s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("span",null,e.toDisplayString(s.name),1)],10,Ct))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bt,[e.createElementVNode("div",$t,[e.createVNode(D,{modelValue:r.value,"onUpdate:modelValue":l[1]||(l[1]=s=>r.value=s),"weekday-format":"short",class:"rounded-md border"},null,8,["modelValue"]),w.value.length>0?(e.openBlock(),e.createElementBlock("div",Dt,[l[7]||(l[7]=e.createElementVNode("div",{class:"flex items-center justify-between mb-3"},[e.createElementVNode("span",{class:"text-sm font-medium"},"Resources")],-1)),e.createElementVNode("div",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors",{"bg-muted ring-2 ring-primary/20":V.value===s.id,"opacity-50":V.value&&V.value!==s.id}]),onClick:z=>L(s.id)},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Mt,[e.createElementVNode("div",It,e.toDisplayString(s.name),1)]),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full flex-shrink-0",V.value===s.id?"bg-primary":"bg-muted-foreground/30"])},null,2)],10,zt))),128)),M.value.length>0?(e.openBlock(),e.createElementBlock("div",Lt,[e.createElementVNode("button",{class:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground w-full py-1 transition-colors",onClick:l[2]||(l[2]=s=>S.value=!S.value)},[e.createVNode(e.unref(C.ChevronRight),{size:14,class:e.normalizeClass(["transition-transform",{"rotate-90":S.value}])},null,8,["class"]),e.createElementVNode("span",null,"Inactive ("+e.toDisplayString(M.value.length)+")",1)]),S.value?(e.openBlock(),e.createElementBlock("div",Rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"flex items-center gap-2 p-2 rounded-md opacity-50"},[e.createElementVNode("div",{class:"size-7 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0 grayscale",style:e.normalizeStyle({backgroundColor:s.color||"#6b7280"})},e.toDisplayString(s.avatarLabel||s.name.charAt(0).toUpperCase()),5),e.createElementVNode("div",Ut,[e.createElementVNode("div",jt,e.toDisplayString(s.name),1)])]))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),e.createVNode(ht)])])]),_:1})}}});exports.default=Ft;
|