@oneclick.dev/cms-core-modules 0.0.124 → 0.0.125
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/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-DX1bTQKs.mjs → ContentEditor-D754iLJS.mjs} +8074 -27026
- package/dist/{Detail-B7pe808q.mjs → Detail-BOxWQ1QQ.mjs} +2 -2
- package/dist/{Detail-B_Q7Qkuz.mjs → Detail-BfKW0uZE.mjs} +2 -2
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/{Detail-t3tOcy3X.js → Detail-DJea_fCd.js} +1 -1
- package/dist/{Detail-CNiLIEh9.js → Detail-DPJacXfm.js} +1 -1
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/{Detail-BESGmY7z.js → Detail-DUGThL9Y.js} +1 -1
- package/dist/{Detail-DNxAzeCs.mjs → Detail-D_LlEeHu.mjs} +2 -2
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +237 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2055 -1123
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +4 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/{types-ibC3-e1N.mjs → types-B5MifmeF.mjs} +339 -273
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/{vee-validate-zod-BQElPD0m.js → vee-validate-zod-CWZwNTWE.js} +1 -1
- package/dist/{vee-validate-zod-CN16K2x9.mjs → vee-validate-zod-D0WaDgDZ.mjs} +1 -1
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-BcIUumah.js +0 -467
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-6mdrL3zx.js +0 -4
- package/dist/TableView-Du5nOE6R.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/types-BMraG1kN.js +0 -1
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { defineComponent as A, computed as L, ref as x, onMounted as j, resolveComponent as D, openBlock as d, createElementBlock as i, unref as o, createVNode as m, createElementVNode as t, toDisplayString as n, Fragment as P, renderList as z, normalizeClass as E, withCtx as F, createTextVNode as V } from "vue";
|
|
2
|
-
import { Loader2 as q, CalendarDays as M, ExternalLink as B } from "lucide-vue-next";
|
|
3
|
-
const R = { class: "w-full" }, U = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "flex items-center gap-2 py-3"
|
|
6
|
-
}, S = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "text-xs text-destructive py-2"
|
|
9
|
-
}, G = {
|
|
10
|
-
key: 2,
|
|
11
|
-
class: "rounded-xl border bg-background p-4 text-center"
|
|
12
|
-
}, H = {
|
|
13
|
-
key: 3,
|
|
14
|
-
class: "rounded-xl border bg-background overflow-hidden"
|
|
15
|
-
}, J = { class: "overflow-x-auto" }, K = { class: "w-full text-xs" }, O = { class: "px-3 py-2" }, Q = { class: "font-medium truncate max-w-[160px]" }, W = { class: "text-muted-foreground truncate max-w-[160px]" }, X = { class: "px-3 py-2 whitespace-nowrap" }, Y = { class: "px-3 py-2 whitespace-nowrap" }, Z = { class: "px-3 py-2 text-center" }, ee = { class: "px-3 py-2" }, te = { class: "px-3 py-2 text-right font-medium whitespace-nowrap" }, se = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, re = { class: "text-xs text-muted-foreground" }, ae = /* @__PURE__ */ A({
|
|
16
|
-
__name: "AppointmentListTable",
|
|
17
|
-
props: {
|
|
18
|
-
toolName: {},
|
|
19
|
-
instanceId: {},
|
|
20
|
-
instanceName: {},
|
|
21
|
-
moduleType: {},
|
|
22
|
-
resolvedArgs: {},
|
|
23
|
-
status: {}
|
|
24
|
-
},
|
|
25
|
-
emits: ["submit"],
|
|
26
|
-
setup(f, { emit: b }) {
|
|
27
|
-
const { $useRoute: h, $useModuleApi: v } = useNuxtApp(), u = f, y = b, _ = h(), k = L(() => _.params.slug), w = v(u.instanceId), p = x(!0), l = x(null), a = x([]);
|
|
28
|
-
async function I() {
|
|
29
|
-
const r = u.resolvedArgs?.quantity || 20, s = u.resolvedArgs?.status || "confirmed";
|
|
30
|
-
p.value = !0, l.value = null;
|
|
31
|
-
try {
|
|
32
|
-
const c = await w.get(`/appointments?quantity=${r}&status=${s}`);
|
|
33
|
-
a.value = c.appointments || [], g({
|
|
34
|
-
count: a.value.length,
|
|
35
|
-
appointments: a.value.map((e) => ({
|
|
36
|
-
orderId: e.orderId,
|
|
37
|
-
reservationId: e.reservationId,
|
|
38
|
-
customerName: `${e.customerInfo?.firstName || ""} ${e.customerInfo?.lastName || ""}`.trim(),
|
|
39
|
-
email: e.customerInfo?.email,
|
|
40
|
-
date: e.date,
|
|
41
|
-
startTime: e.startTime,
|
|
42
|
-
endTime: e.endTime,
|
|
43
|
-
spots: e.spots,
|
|
44
|
-
status: e.reservationStatus || e.status,
|
|
45
|
-
price: e.reservationPrice
|
|
46
|
-
}))
|
|
47
|
-
});
|
|
48
|
-
} catch (c) {
|
|
49
|
-
l.value = c?.data?.statusMessage || c?.message || "Failed to load appointments", g(`Error loading appointments: ${l.value}`);
|
|
50
|
-
} finally {
|
|
51
|
-
p.value = !1;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
j(() => {
|
|
55
|
-
I();
|
|
56
|
-
});
|
|
57
|
-
function g(r) {
|
|
58
|
-
u.status !== "completed" && y("submit", r);
|
|
59
|
-
}
|
|
60
|
-
const N = (r, s) => {
|
|
61
|
-
if (s !== "confirmed")
|
|
62
|
-
switch (s) {
|
|
63
|
-
case "pending":
|
|
64
|
-
return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
|
|
65
|
-
case "cancelled":
|
|
66
|
-
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
67
|
-
default:
|
|
68
|
-
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
69
|
-
}
|
|
70
|
-
switch (r || s) {
|
|
71
|
-
case "approved":
|
|
72
|
-
return "text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";
|
|
73
|
-
case "needs_approval":
|
|
74
|
-
return "text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";
|
|
75
|
-
case "rejected":
|
|
76
|
-
case "cancelled":
|
|
77
|
-
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
78
|
-
default:
|
|
79
|
-
return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
|
|
80
|
-
}
|
|
81
|
-
}, C = (r, s) => {
|
|
82
|
-
if (s !== "confirmed")
|
|
83
|
-
switch (s) {
|
|
84
|
-
case "pending":
|
|
85
|
-
return "Pending";
|
|
86
|
-
case "cancelled":
|
|
87
|
-
return "Cancelled";
|
|
88
|
-
default:
|
|
89
|
-
return s || "Unknown";
|
|
90
|
-
}
|
|
91
|
-
switch (r || s) {
|
|
92
|
-
case "approved":
|
|
93
|
-
return "Approved";
|
|
94
|
-
case "needs_approval":
|
|
95
|
-
return "Needs Approval";
|
|
96
|
-
case "rejected":
|
|
97
|
-
return "Rejected";
|
|
98
|
-
case "cancelled":
|
|
99
|
-
return "Cancelled";
|
|
100
|
-
case "confirmed":
|
|
101
|
-
return "Confirmed";
|
|
102
|
-
default:
|
|
103
|
-
return r || s || "Pending";
|
|
104
|
-
}
|
|
105
|
-
}, T = (r) => r == null ? "—" : `€${r.toFixed(2)}`, $ = (r) => {
|
|
106
|
-
if (!r) return "—";
|
|
107
|
-
try {
|
|
108
|
-
return new Date(r).toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric" });
|
|
109
|
-
} catch {
|
|
110
|
-
return r;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
return (r, s) => {
|
|
114
|
-
const c = D("NuxtLink");
|
|
115
|
-
return d(), i("div", R, [
|
|
116
|
-
o(p) ? (d(), i("div", U, [
|
|
117
|
-
m(o(q), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
118
|
-
s[0] || (s[0] = t("span", { class: "text-xs text-muted-foreground" }, "Loading appointments…", -1))
|
|
119
|
-
])) : o(l) ? (d(), i("div", S, n(o(l)), 1)) : o(a).length === 0 ? (d(), i("div", G, [
|
|
120
|
-
m(o(M), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
|
|
121
|
-
s[1] || (s[1] = t("p", { class: "text-sm text-muted-foreground" }, "No recent appointments found.", -1))
|
|
122
|
-
])) : (d(), i("div", H, [
|
|
123
|
-
t("div", J, [
|
|
124
|
-
t("table", K, [
|
|
125
|
-
s[2] || (s[2] = t("thead", null, [
|
|
126
|
-
t("tr", { class: "border-b bg-muted/40" }, [
|
|
127
|
-
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Customer"),
|
|
128
|
-
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Date"),
|
|
129
|
-
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Time"),
|
|
130
|
-
t("th", { class: "text-center px-3 py-2 font-medium text-muted-foreground" }, "Spots"),
|
|
131
|
-
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Status"),
|
|
132
|
-
t("th", { class: "text-right px-3 py-2 font-medium text-muted-foreground" }, "Price")
|
|
133
|
-
])
|
|
134
|
-
], -1)),
|
|
135
|
-
t("tbody", null, [
|
|
136
|
-
(d(!0), i(P, null, z(o(a), (e) => (d(), i("tr", {
|
|
137
|
-
key: e.reservationId || e.orderId,
|
|
138
|
-
class: "border-b last:border-b-0 hover:bg-muted/30 transition-colors"
|
|
139
|
-
}, [
|
|
140
|
-
t("td", O, [
|
|
141
|
-
t("div", Q, n(e.customerInfo?.firstName) + " " + n(e.customerInfo?.lastName), 1),
|
|
142
|
-
t("div", W, n(e.customerInfo?.email), 1)
|
|
143
|
-
]),
|
|
144
|
-
t("td", X, n($(e.date)), 1),
|
|
145
|
-
t("td", Y, n(e.startTime) + " – " + n(e.endTime), 1),
|
|
146
|
-
t("td", Z, n(e.spots || 1), 1),
|
|
147
|
-
t("td", ee, [
|
|
148
|
-
t("span", {
|
|
149
|
-
class: E(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap", N(e.reservationStatus, e.status)])
|
|
150
|
-
}, n(C(e.reservationStatus, e.status)), 3)
|
|
151
|
-
]),
|
|
152
|
-
t("td", te, n(T(e.reservationPrice)), 1)
|
|
153
|
-
]))), 128))
|
|
154
|
-
])
|
|
155
|
-
])
|
|
156
|
-
]),
|
|
157
|
-
t("div", se, [
|
|
158
|
-
t("span", re, n(o(a).length) + " appointment" + n(o(a).length === 1 ? "" : "s"), 1),
|
|
159
|
-
m(c, {
|
|
160
|
-
to: `/projects/${o(k)}/modules/${f.instanceId}`,
|
|
161
|
-
class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
|
|
162
|
-
}, {
|
|
163
|
-
default: F(() => [
|
|
164
|
-
m(o(B), { class: "size-3" }),
|
|
165
|
-
s[3] || (s[3] = V(" View all ", -1))
|
|
166
|
-
]),
|
|
167
|
-
_: 1
|
|
168
|
-
}, 8, ["to"])
|
|
169
|
-
])
|
|
170
|
-
]))
|
|
171
|
-
]);
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
export {
|
|
176
|
-
ae as default
|
|
177
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),E={class:"w-full"},V={key:0,class:"flex items-center gap-2 py-3"},w={key:1,class:"text-xs text-destructive py-2"},D={key:2,class:"rounded-xl border bg-background p-4 text-center"},I={key:3,class:"rounded-xl border bg-background overflow-hidden"},B={class:"overflow-x-auto"},S={class:"w-full text-xs"},T={class:"px-3 py-2"},C={class:"font-medium truncate max-w-[160px]"},$={class:"text-muted-foreground truncate max-w-[160px]"},A={class:"px-3 py-2 whitespace-nowrap"},L={class:"px-3 py-2 whitespace-nowrap"},j={class:"px-3 py-2 text-center"},P={class:"px-3 py-2"},q={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},z={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},F={class:"text-xs text-muted-foreground"},M=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(i,{emit:m}){const{$useRoute:p,$useModuleApi:x}=useNuxtApp(),d=i,f=m,g=p(),b=e.computed(()=>g.params.slug),y=x(d.instanceId),l=e.ref(!0),a=e.ref(null),o=e.ref([]);async function N(){const n=d.resolvedArgs?.quantity||20,r=d.resolvedArgs?.status||"confirmed";l.value=!0,a.value=null;try{const s=await y.get(`/appointments?quantity=${n}&status=${r}`);o.value=s.appointments||[],u({count:o.value.length,appointments:o.value.map(t=>({orderId:t.orderId,reservationId:t.reservationId,customerName:`${t.customerInfo?.firstName||""} ${t.customerInfo?.lastName||""}`.trim(),email:t.customerInfo?.email,date:t.date,startTime:t.startTime,endTime:t.endTime,spots:t.spots,status:t.reservationStatus||t.status,price:t.reservationPrice}))})}catch(s){a.value=s?.data?.statusMessage||s?.message||"Failed to load appointments",u(`Error loading appointments: ${a.value}`)}finally{l.value=!1}}e.onMounted(()=>{N()});function u(n){d.status!=="completed"&&f("submit",n)}const h=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20"}switch(n||r){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},k=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"Pending";case"cancelled":return"Cancelled";default:return r||"Unknown"}switch(n||r){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return n||r||"Pending"}},v=n=>n==null?"—":`€${n.toFixed(2)}`,_=n=>{if(!n)return"—";try{return new Date(n).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return n}};return(n,r)=>{const s=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",E,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),r[0]||(r[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(e.unref(a)),1)):e.unref(o).length===0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(c.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),r[1]||(r[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No recent appointments found.",-1))])):(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",B,[e.createElementVNode("table",S,[r[2]||(r[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b bg-muted/40"},[e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Customer"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Date"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Time"),e.createElementVNode("th",{class:"text-center px-3 py-2 font-medium text-muted-foreground"},"Spots"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Status"),e.createElementVNode("th",{class:"text-right px-3 py-2 font-medium text-muted-foreground"},"Price")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),t=>(e.openBlock(),e.createElementBlock("tr",{key:t.reservationId||t.orderId,class:"border-b last:border-b-0 hover:bg-muted/30 transition-colors"},[e.createElementVNode("td",T,[e.createElementVNode("div",C,e.toDisplayString(t.customerInfo?.firstName)+" "+e.toDisplayString(t.customerInfo?.lastName),1),e.createElementVNode("div",$,e.toDisplayString(t.customerInfo?.email),1)]),e.createElementVNode("td",A,e.toDisplayString(_(t.date)),1),e.createElementVNode("td",L,e.toDisplayString(t.startTime)+" – "+e.toDisplayString(t.endTime),1),e.createElementVNode("td",j,e.toDisplayString(t.spots||1),1),e.createElementVNode("td",P,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",h(t.reservationStatus,t.status)])},e.toDisplayString(k(t.reservationStatus,t.status)),3)]),e.createElementVNode("td",q,e.toDisplayString(v(t.reservationPrice)),1)]))),128))])])]),e.createElementVNode("div",z,[e.createElementVNode("span",F,e.toDisplayString(e.unref(o).length)+" appointment"+e.toDisplayString(e.unref(o).length===1?"":"s"),1),e.createVNode(s,{to:`/projects/${e.unref(b)}/modules/${i.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ExternalLink),{class:"size-3"}),r[3]||(r[3]=e.createTextVNode(" View all ",-1))]),_:1},8,["to"])])]))])}}});exports.default=M;
|