@oneclick.dev/cms-core-modules 0.0.83 → 0.0.84

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.
Files changed (63) hide show
  1. package/dist/{ContentEditor-CxKirDdL.mjs → ContentEditor-DPhhOkx3.mjs} +7068 -5926
  2. package/dist/{ContentEditor-CRFkD4tE.js → ContentEditor-DrxtH_Hq.js} +42 -42
  3. package/dist/{Create-CsqVYhPO.mjs → Create-6uT9HWar.mjs} +35 -35
  4. package/dist/{Create-ip0MnS0o.js → Create-DuZ5nZrX.js} +1 -1
  5. package/dist/{DateFormatter-CvOfaUnU.mjs → DateFormatter-2B0R-DY4.mjs} +204 -400
  6. package/dist/DateFormatter-DbtOLV0L.js +1 -0
  7. package/dist/{Detail-RMXFuSRQ.js → Detail-BZ-iE9vf.js} +1 -1
  8. package/dist/{Detail-B4b_FLDa.mjs → Detail-C1Blq61w.mjs} +90 -90
  9. package/dist/{Detail-BayNaAg9.js → Detail-C8wQiDcv.js} +1 -1
  10. package/dist/{Detail-CbLk1v37.mjs → Detail-CJVMJDP7.mjs} +17 -17
  11. package/dist/{Detail-CnK-qbhE.js → Detail-CPqug27l.js} +1 -1
  12. package/dist/Detail-CjuhjPby.js +1 -0
  13. package/dist/{Detail-U0mgLKt6.mjs → Detail-CtItxMX4.mjs} +62 -63
  14. package/dist/{Detail-CVgWHbMC.mjs → Detail-Dnpnmy4-.mjs} +158 -158
  15. package/dist/{Entries-D7MHylQE.mjs → Entries-BkOPae4R.mjs} +49 -49
  16. package/dist/Entries-CcEW98F5.js +1 -0
  17. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CDc8MIq2.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs} +1 -1
  18. package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-StaNp-3y.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js} +1 -1
  19. package/dist/{Overview-CwCAeBnX.js → Overview-CA8wh_BI.js} +1 -1
  20. package/dist/{Overview-CgViRnNc.mjs → Overview-D4MFwRI_.mjs} +67 -68
  21. package/dist/{Overview-B2bFNGhH.js → Overview-Da0XexiT.js} +1 -1
  22. package/dist/Overview-DeQQ0FY3.js +1 -0
  23. package/dist/{Overview--XpvBbqz.mjs → Overview-DoOASlNz.mjs} +1 -3
  24. package/dist/{Overview-Cczt_dcE.mjs → Overview-gJSvftdE.mjs} +34 -34
  25. package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs} +0 -1
  26. package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js} +1 -1
  27. package/dist/{SeoHealth-ZpvB7CS2.mjs → SeoHealth-Bc5chnaa.mjs} +14 -14
  28. package/dist/{SeoHealth-DFZ0LLBH.js → SeoHealth-BkpJ1F2Y.js} +1 -1
  29. package/dist/TableView-BPWAx--G.mjs +5743 -0
  30. package/dist/TableView-D63QrVlK.js +4 -0
  31. package/dist/View-BL70u98U.js +1 -0
  32. package/dist/{View-DDXN0tKD.mjs → View-BO5N911y.mjs} +5 -5
  33. package/dist/{agenda-Cl3s_FIE.mjs → agenda-C5grvzSa.mjs} +166 -169
  34. package/dist/agenda-DXMwVWpN.js +1 -0
  35. package/dist/{availability-B-tRp8hB.mjs → availability-C1NqOFsQ.mjs} +81 -81
  36. package/dist/{availability-BiBbzEIM.js → availability-D_wnfLsH.js} +1 -1
  37. package/dist/cms-core-modules.css +1 -1
  38. package/dist/{exceptions-DQPSFSj7.mjs → exceptions-BIwMhYa4.mjs} +1 -1
  39. package/dist/{exceptions-BA3PsW4n.js → exceptions-Cn7zooEu.js} +1 -1
  40. package/dist/{index-CBC9dWZ9.js → index-C9pSS15N.js} +2 -2
  41. package/dist/{index-YOOlBEZB.mjs → index-MwjeLHPP.mjs} +3 -3
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.mjs +22 -22
  44. package/dist/orders-CG1QUCN8.js +1 -0
  45. package/dist/{orders-DZzdsHOW.mjs → orders-CeixEBcU.mjs} +57 -58
  46. package/dist/server-handlers.cjs.js +1 -1
  47. package/dist/server-handlers.mjs +142 -147
  48. package/package.json +2 -2
  49. package/dist/DateFormatter-ls6HfWpS.js +0 -1
  50. package/dist/Detail-BcboL7NF.js +0 -1
  51. package/dist/Entries-BPkZ7Jg5.js +0 -1
  52. package/dist/Overview-B-8TLLjh.js +0 -1
  53. package/dist/TableView-BUPPcHUW.mjs +0 -89505
  54. package/dist/TableView-CksiPsTL.js +0 -586
  55. package/dist/View-DfzaVOzS.js +0 -1
  56. package/dist/agenda-rlFma_wn.js +0 -1
  57. package/dist/floating-ui.dom-B9WYoHj2.js +0 -1
  58. package/dist/floating-ui.dom-fpIfhXTZ.mjs +0 -1291
  59. package/dist/index-DYpruS-A-Cw57iwdY.mjs +0 -4210
  60. package/dist/index-DYpruS-A-DwDXo9Tq.js +0 -88
  61. package/dist/index-YMaY4uuk-BgpTtr73.js +0 -1
  62. package/dist/index-YMaY4uuk-C_xV5K9Z.mjs +0 -1300
  63. package/dist/orders-tP4WdF5q.js +0 -1
@@ -1,8 +1,8 @@
1
- import { defineComponent as _e, ref as m, computed as te, watch as he, onMounted as ye, resolveComponent as h, openBlock as n, createElementBlock as i, createElementVNode as s, toDisplayString as u, unref as r, Fragment as w, renderList as D, normalizeClass as L, createVNode as t, withCtx as l, createCommentVNode as P, createBlock as T, createTextVNode as y, resolveDynamicComponent as W, normalizeStyle as se } from "vue";
1
+ import { defineComponent as _e, ref as m, computed as te, watch as he, onMounted as ye, resolveComponent as h, openBlock as n, createElementBlock as i, createElementVNode as s, toDisplayString as u, unref as r, Fragment as w, renderList as D, normalizeClass as L, createVNode as t, withCtx as l, createCommentVNode as T, createBlock as P, createTextVNode as y, resolveDynamicComponent as W, normalizeStyle as se } from "vue";
2
2
  import { useModule as be, useModuleRoute as we, useModuleBreadcrumbs as Ce } from "@oneclick.dev/cms-kit";
3
3
  import "./index-CMk3uhUt.mjs";
4
- import { g as oe, h as ae } from "./index-DYpruS-A-Cw57iwdY.mjs";
5
- import { MousePointerClick as ke, Users as $e, Eye as De, Clock as Pe, Zap as Te, TrendingDown as le, TrendingUp as ne, UserPlus as Ue, Activity as Se, RefreshCw as Ve, Loader2 as Re, ArrowUpRight as Me, Globe as Fe, Minus as Ae, Smartphone as ze, Tablet as Ne, Monitor as Be } from "lucide-vue-next";
4
+ import { componentToString as oe, ChartTooltipContent as ae } from "@oneclick.dev/cms-kit/charts";
5
+ import { MousePointerClick as ke, Users as $e, Eye as De, Clock as Te, Zap as Pe, TrendingDown as le, TrendingUp as ne, UserPlus as Se, Activity as Ue, RefreshCw as Ve, Loader2 as Re, ArrowUpRight as Me, Globe as Fe, Minus as Ae, Smartphone as ze, Tablet as Ne, Monitor as Be } from "lucide-vue-next";
6
6
  import { S as re, C as j, A as ie, z as ue } from "./index-_2lRVt_k.mjs";
7
7
  import { C as ce, a as H } from "./index-p5Uqu8c2.mjs";
8
8
  const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { class: "flex items-center justify-between" }, Ge = { class: "text-muted-foreground text-sm mt-1" }, Ie = {
@@ -23,15 +23,15 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
23
23
  }, _t = { class: "grid @lg:grid-cols-2 gap-6" }, ht = { class: "space-y-3" }, yt = { class: "text-sm capitalize flex-1" }, bt = { class: "flex-1 h-2 bg-muted rounded-full overflow-hidden" }, wt = { class: "text-xs tabular-nums text-muted-foreground w-16 text-right" }, Ct = {
24
24
  key: 0,
25
25
  class: "py-4 text-center text-muted-foreground text-sm"
26
- }, kt = { class: "space-y-3" }, $t = { class: "text-sm flex-1" }, Dt = { class: "flex-1 h-2 bg-muted rounded-full overflow-hidden" }, Pt = { class: "text-xs tabular-nums text-muted-foreground w-16 text-right" }, Tt = {
26
+ }, kt = { class: "space-y-3" }, $t = { class: "text-sm flex-1" }, Dt = { class: "flex-1 h-2 bg-muted rounded-full overflow-hidden" }, Tt = { class: "text-xs tabular-nums text-muted-foreground w-16 text-right" }, Pt = {
27
27
  key: 0,
28
28
  class: "py-4 text-center text-muted-foreground text-sm"
29
29
  }, Nt = /* @__PURE__ */ _e({
30
30
  __name: "Overview",
31
- setup(Ut) {
31
+ setup(St) {
32
32
  const { config: G } = be(), { moduleId: de } = we();
33
33
  Ce(() => [{ label: "Overview" }]);
34
- const C = m(!0), V = m(null), R = m("30"), U = m([]), f = m({}), me = m({}), v = m({}), q = m(0), I = m([]), X = m([]), M = m([]), F = m([]), A = te(() => !!(G.serviceAccount && G.propertyId));
34
+ const C = m(!0), V = m(null), R = m("30"), S = m([]), f = m({}), me = m({}), v = m({}), q = m(0), I = m([]), X = m([]), M = m([]), F = m([]), A = te(() => !!(G.serviceAccount && G.propertyId));
35
35
  function k(a) {
36
36
  return `/api/v1/modules/${de}${a}`;
37
37
  }
@@ -49,13 +49,13 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
49
49
  totalUsers: { label: "Users", color: x.users }
50
50
  }, O = {
51
51
  screenPageViews: { label: "Page Views", color: x.pageViews }
52
- }, S = (a, e) => e, K = (a) => a.sessions || 0, ve = (a) => a.totalUsers || 0, Z = (a) => a.screenPageViews || 0, J = (a) => {
53
- const e = U.value[Math.round(a)];
52
+ }, U = (a, e) => e, K = (a) => a.sessions || 0, ve = (a) => a.totalUsers || 0, Z = (a) => a.screenPageViews || 0, J = (a) => {
53
+ const e = S.value[Math.round(a)];
54
54
  if (!e) return "";
55
55
  const d = new Date(e.date);
56
56
  return `${d.getDate()}/${d.getMonth() + 1}`;
57
57
  }, Q = (a) => {
58
- const e = U.value[Math.round(Number(a))];
58
+ const e = S.value[Math.round(Number(a))];
59
59
  return e ? new Date(e.date).toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) : "";
60
60
  }, pe = te(() => [
61
61
  {
@@ -79,13 +79,13 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
79
79
  {
80
80
  label: "Avg. Duration",
81
81
  value: ge(f.value.averageSessionDuration || 0),
82
- icon: Pe,
82
+ icon: Te,
83
83
  change: v.value.averageSessionDuration
84
84
  },
85
85
  {
86
86
  label: "Engagement",
87
87
  value: `${((f.value.engagementRate || 0) * 100).toFixed(1)}%`,
88
- icon: Te,
88
+ icon: Pe,
89
89
  change: v.value.engagementRate,
90
90
  positive: !0
91
91
  },
@@ -99,13 +99,13 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
99
99
  {
100
100
  label: "New Users",
101
101
  value: p(f.value.newUsers || 0),
102
- icon: Ue,
102
+ icon: Se,
103
103
  change: v.value.newUsers
104
104
  },
105
105
  {
106
106
  label: "Pages / Session",
107
107
  value: (f.value.screenPageViewsPerSession || 0).toFixed(1),
108
- icon: Se,
108
+ icon: Ue,
109
109
  change: v.value.screenPageViewsPerSession
110
110
  }
111
111
  ]);
@@ -143,7 +143,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
143
143
  $fetch(k(`/devices?startDate=${a}&endDate=today`)),
144
144
  $fetch(k(`/countries?startDate=${a}&endDate=today`))
145
145
  ]);
146
- U.value = e.rows || [], f.value = e.totals || {}, me.value = e.previousTotals || {}, v.value = e.changes || {}, q.value = d.activeUsers || 0, I.value = c.rows || [], X.value = b.rows || [], M.value = g.rows || [], F.value = _.rows || [];
146
+ S.value = e.rows || [], f.value = e.totals || {}, me.value = e.previousTotals || {}, v.value = e.changes || {}, q.value = d.activeUsers || 0, I.value = c.rows || [], X.value = b.rows || [], M.value = g.rows || [], F.value = _.rows || [];
147
147
  } catch (e) {
148
148
  console.error("Failed to fetch analytics data:", e), V.value = e?.data?.statusMessage || e?.message || "Failed to load analytics data";
149
149
  } finally {
@@ -181,9 +181,9 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
181
181
  ]),
182
182
  _: 1
183
183
  }, 8, ["disabled"])
184
- ])) : P("", !0)
184
+ ])) : T("", !0)
185
185
  ]),
186
- A.value ? V.value ? (n(), T(c, {
186
+ A.value ? V.value ? (n(), P(c, {
187
187
  key: 1,
188
188
  class: "p-6 border-destructive/50 bg-destructive/5"
189
189
  }, {
@@ -230,25 +230,25 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
230
230
  _: 1
231
231
  }),
232
232
  s("div", Ze, [
233
- (n(!0), i(w, null, D(pe.value, (o) => (n(), T(c, {
233
+ (n(!0), i(w, null, D(pe.value, (o) => (n(), P(c, {
234
234
  key: o.label,
235
235
  class: "p-4"
236
236
  }, {
237
237
  default: l(() => [
238
238
  s("div", Je, [
239
- (n(), T(W(o.icon), { class: "size-3.5" })),
239
+ (n(), P(W(o.icon), { class: "size-3.5" })),
240
240
  s("span", Qe, u(o.label), 1)
241
241
  ]),
242
242
  s("p", Ye, u(o.value), 1),
243
243
  o.change !== void 0 ? (n(), i("div", et, [
244
- (n(), T(W(z(o.change, o.positive !== !1).icon), {
244
+ (n(), P(W(z(o.change, o.positive !== !1).icon), {
245
245
  class: L(["size-3", z(o.change, o.positive !== !1).cls])
246
246
  }, null, 8, ["class"])),
247
247
  s("span", {
248
248
  class: L(["text-xs font-medium", z(o.change, o.positive !== !1).cls])
249
249
  }, u(z(o.change, o.positive !== !1).text), 3),
250
250
  e[6] || (e[6] = s("span", { class: "text-xs text-muted-foreground" }, "vs prev.", -1))
251
- ])) : P("", !0)
251
+ ])) : T("", !0)
252
252
  ]),
253
253
  _: 2
254
254
  }, 1024))), 128))
@@ -275,26 +275,26 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
275
275
  }, {
276
276
  default: l(() => [
277
277
  t(r(re), {
278
- data: U.value,
278
+ data: S.value,
279
279
  margin: { top: 8, right: 8, bottom: 24, left: 40 }
280
280
  }, {
281
281
  default: l(() => [
282
282
  t(r(ce), {
283
- x: S,
283
+ x: U,
284
284
  y: K,
285
285
  color: x.sessions,
286
286
  opacity: 0.1,
287
287
  curveType: "monotoneX"
288
288
  }, null, 8, ["color"]),
289
289
  t(r(H), {
290
- x: S,
290
+ x: U,
291
291
  y: K,
292
292
  color: x.sessions,
293
293
  lineWidth: 2,
294
294
  curveType: "monotoneX"
295
295
  }, null, 8, ["color"]),
296
296
  t(r(H), {
297
- x: S,
297
+ x: U,
298
298
  y: ve,
299
299
  color: x.users,
300
300
  lineWidth: 2,
@@ -347,19 +347,19 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
347
347
  }, {
348
348
  default: l(() => [
349
349
  t(r(re), {
350
- data: U.value,
350
+ data: S.value,
351
351
  margin: { top: 8, right: 8, bottom: 24, left: 40 }
352
352
  }, {
353
353
  default: l(() => [
354
354
  t(r(ce), {
355
- x: S,
355
+ x: U,
356
356
  y: Z,
357
357
  color: x.pageViews,
358
358
  opacity: 0.15,
359
359
  curveType: "monotoneX"
360
360
  }, null, 8, ["color"]),
361
361
  t(r(H), {
362
- x: S,
362
+ x: U,
363
363
  y: Z,
364
364
  color: x.pageViews,
365
365
  lineWidth: 2,
@@ -422,7 +422,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
422
422
  s("span", ut, u(p(o.totalUsers)) + " users", 1)
423
423
  ])
424
424
  ]))), 128)),
425
- I.value.length ? P("", !0) : (n(), i("div", ct, "No data available"))
425
+ I.value.length ? T("", !0) : (n(), i("div", ct, "No data available"))
426
426
  ])
427
427
  ]),
428
428
  _: 1
@@ -459,7 +459,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
459
459
  s("span", gt, u(p(o.sessions)) + " sessions", 1)
460
460
  ])
461
461
  ]))), 128)),
462
- X.value.length ? P("", !0) : (n(), i("div", xt, "No data available"))
462
+ X.value.length ? T("", !0) : (n(), i("div", xt, "No data available"))
463
463
  ])
464
464
  ]),
465
465
  _: 1
@@ -489,7 +489,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
489
489
  key: o.deviceCategory,
490
490
  class: "flex items-center gap-3"
491
491
  }, [
492
- (n(), T(W(xe(o.deviceCategory)), { class: "size-4 text-muted-foreground shrink-0" })),
492
+ (n(), P(W(xe(o.deviceCategory)), { class: "size-4 text-muted-foreground shrink-0" })),
493
493
  s("span", yt, u(o.deviceCategory), 1),
494
494
  s("div", bt, [
495
495
  s("div", {
@@ -499,7 +499,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
499
499
  ]),
500
500
  s("span", wt, u(p(o.sessions)), 1)
501
501
  ]))), 128)),
502
- M.value.length ? P("", !0) : (n(), i("div", Ct, "No data available"))
502
+ M.value.length ? T("", !0) : (n(), i("div", Ct, "No data available"))
503
503
  ])
504
504
  ]),
505
505
  _: 1
@@ -535,9 +535,9 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
535
535
  style: se({ width: `${o.sessions / (F.value[0]?.sessions || 1) * 100}%` })
536
536
  }, null, 4)
537
537
  ]),
538
- s("span", Pt, u(p(o.sessions)), 1)
538
+ s("span", Tt, u(p(o.sessions)), 1)
539
539
  ]))), 128)),
540
- F.value.length ? P("", !0) : (n(), i("div", Tt, "No data available"))
540
+ F.value.length ? T("", !0) : (n(), i("div", Pt, "No data available"))
541
541
  ])
542
542
  ]),
543
543
  _: 1
@@ -546,7 +546,7 @@ const Le = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, je = { cla
546
546
  _: 1
547
547
  })
548
548
  ])
549
- ], 64)) : (n(), T(c, {
549
+ ], 64)) : (n(), P(c, {
550
550
  key: 0,
551
551
  class: "p-8 text-center"
552
552
  }, {
@@ -2008,7 +2008,6 @@ We would love to see you another time!`);
2008
2008
  p.value = !1;
2009
2009
  }
2010
2010
  }, be = () => {
2011
- console.log("Cancel with coupon:", s.value?.id);
2012
2011
  };
2013
2012
  return e({
2014
2013
  openDialog: x
@@ -346,4 +346,4 @@ We've got everything ready for you and look forward to your visit! If you need t
346
346
 
347
347
  Thank you for your interest in booking with us. Unfortunately, we are unable to confirm your request for ${new Date(f.date)?.toDateString()} at ${f.startTime}.
348
348
 
349
- We would love to see you another time!`)},x=()=>{if(!c.value){if(!d.value||!s.value||!p.value)return alert("Please fill in all the fields.");i({to:d.value,subject:s.value,body:p.value})}r.value=!1;const{$confetti:f}=useNuxtApp();f(),l("confirm")};return t({openDialog:v}),(f,u)=>{const g=e.resolveComponent("DialogTitle"),b=e.resolveComponent("DialogDescription"),E=e.resolveComponent("DialogHeader"),w=e.resolveComponent("Checkbox"),D=e.resolveComponent("Label"),V=e.resolveComponent("Input"),S=e.resolveComponent("Textarea"),$=e.resolveComponent("Button"),y=e.resolveComponent("DialogFooter"),A=e.resolveComponent("DialogScrollContent"),k=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(k,{open:r.value,"onUpdate:open":u[5]||(u[5]=N=>r.value=N)},{default:e.withCtx(()=>[e.createVNode(A,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...u[6]||(u[6]=[e.createTextVNode(" Reject Reservation Request ",-1)])]),_:1}),e.createVNode(b)]),_:1}),e.createElementVNode("div",Mt,[e.createVNode(w,{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=N=>c.value=N),id:"reject-dialog-skip-mail",class:"border-black/80 dark:border-gray-200",disabled:!e.unref(a).mailAccount},null,8,["modelValue","disabled"]),e.createVNode(D,{for:"reject-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...u[7]||(u[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":c.value}])},[e.createElementVNode("div",$t,[e.createVNode(D,{for:"reject-dialog-email"},{default:e.withCtx(()=>[...u[8]||(u[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(V,{modelValue:d.value,"onUpdate:modelValue":u[1]||(u[1]=N=>d.value=N),disabled:c.value,id:"reject-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Ft,[e.createVNode(D,{for:"reject-dialog-subject"},{default:e.withCtx(()=>[...u[9]||(u[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(V,{modelValue:s.value,"onUpdate:modelValue":u[2]||(u[2]=N=>s.value=N),disabled:c.value,id:"reject-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",St,[e.createVNode(D,{for:"reject-dialog-body"},{default:e.withCtx(()=>[...u[10]||(u[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(S,{modelValue:p.value,"onUpdate:modelValue":u[3]||(u[3]=N=>p.value=N),disabled:c.value,id:"reject-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode($,{variant:"outline",onClick:u[4]||(u[4]=N=>r.value=!1)},{default:e.withCtx(()=>[...u[11]||(u[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode($,{variant:"destructive",onClick:x},{default:e.withCtx(()=>[...u[12]||(u[12]=[e.createTextVNode("Reject reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),It={key:0,class:"space-y-6 py-4"},Tt={class:"space-y-3"},jt={class:"bg-muted/30 rounded-lg p-4 space-y-3"},Ot={class:"flex items-center gap-3"},Lt={class:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center"},Pt={class:"font-medium"},zt={class:"grid gap-2 text-sm"},Ut={key:0,class:"flex items-center gap-2 text-muted-foreground"},Ht=["href"],Wt={key:1,class:"flex items-center gap-2 text-muted-foreground"},Kt=["href"],Gt={class:"space-y-3"},Yt={class:"grid grid-cols-2 gap-3"},Qt={class:"bg-muted/30 rounded-lg p-3"},Jt={class:"flex items-center gap-2 text-muted-foreground mb-1"},Xt={class:"font-medium"},Zt={class:"bg-muted/30 rounded-lg p-3"},qt={class:"flex items-center gap-2 text-muted-foreground mb-1"},eo={class:"font-medium"},to={key:0,class:"space-y-3"},oo={class:"bg-muted/30 rounded-lg p-4"},no={class:"flex items-start justify-between"},so={class:"flex items-start gap-3"},ao={class:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5"},ro={class:"font-medium"},io={class:"text-sm text-muted-foreground"},lo={class:"font-semibold"},co={class:"space-y-3"},uo={class:"bg-muted/30 rounded-lg p-4 space-y-3"},po={class:"space-y-2 text-sm"},mo={class:"flex justify-between"},fo={key:0,class:"flex justify-between"},vo={key:1,class:"flex justify-between text-green-600 dark:text-green-400"},go={class:"flex justify-between font-semibold"},ho={key:1,class:"space-y-2 text-sm"},xo={key:0,class:"flex justify-between"},Co={class:"text-muted-foreground flex items-center gap-1.5"},No={class:"text-green-600 dark:text-green-400"},Do={key:1,class:"flex justify-between"},yo={class:"text-muted-foreground flex items-center gap-1.5"},_o={class:"text-orange-600 dark:text-orange-400 font-medium"},Vo=e.defineComponent({__name:"ReservationDetailDialog",emits:["cancelled","confirmed","rejected"],setup(o,{expose:t,emit:n}){const{hasPermission:a}=I.useModulePermissions(),{config:i}=I.useModule(),l=I.useFirebaseIntegration(i.project),r=e.inject("event",e.ref(null)),c=n,d=e.ref(!1),s=e.ref(null),p=e.ref(!1),v=e.useTemplateRef("cancelReservationDialog"),x=e.useTemplateRef("approveReservationDialog"),f=e.useTemplateRef("rejectReservationDialog"),u=e.useTemplateRef("transferReservationDialog"),g=C=>{s.value=C,d.value=!0},b=e.computed(()=>s.value?.customerInfo&&`${s.value.customerInfo.firstName} ${s.value.customerInfo.lastName}`.trim()||"Unknown Customer"),E=e.computed(()=>{let C=s.value?.status;const m=s.value?.reservationStatus;switch(["needs_approval","rejected","approved","cancelled"].includes(m)&&(C=m),C){case"needs_approval":return{label:"Needs Approval",class:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"};case"rejected":return{label:"Rejected",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};case"approved":return{label:"Approved",class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"};case"pending":return{label:"Pending",class:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"};case"cancelled":return{label:"Cancelled",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};default:return{label:C||"Unknown",class:"bg-muted text-muted-foreground"}}}),w=e.computed(()=>s.value?.status==="cancelled"),D=C=>C==null||typeof C!="number"?"—":`€${C?.toFixed(2)}`,V=C=>{if(!C)return"—";if(C<60)return`${C} min`;const m=Math.floor(C/60),_=C%60;return _>0?`${m}h ${_}min`:`${m}h`},S=()=>{if(!s.value)return;let C="";const m=r?.value?.date;if(m)try{C=new Date(m).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}catch{C=m}const _={date:C,resourceName:r?.value?.resource?.name};Ct(s.value,_)},$=()=>{x.value?.openDialog(s.value)},y=()=>{f.value?.openDialog(s.value)},A=()=>{x.value?.openDialog(s.value)},k=()=>{v.value?.openDialog(s.value)},N=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="cancelled",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="cancelled",z.toast.success("Reservation cancelled successfully"),c("cancelled"),d.value=!1}catch(C){console.error("Error cancelling reservation:",C),z.toast.error("Failed to cancel reservation")}finally{p.value=!1}},B=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="approved",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="approved",z.toast.success("Reservation approved successfully"),c("confirmed"),d.value=!1}catch(C){console.error("Error approving reservation:",C),z.toast.error("Failed to approve reservation")}finally{p.value=!1}},j=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="rejected",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="rejected",z.toast.success("Reservation rejected successfully"),c("rejected"),d.value=!1}catch(C){console.error("Error rejecting reservation:",C),z.toast.error("Failed to reject reservation")}finally{p.value=!1}},re=()=>{console.log("Cancel with coupon:",s.value?.id)};return t({openDialog:g}),(C,m)=>{const _=e.resolveComponent("DialogTitle"),Y=e.resolveComponent("DialogDescription"),Ve=e.resolveComponent("DialogHeader"),ie=e.resolveComponent("Separator"),Q=e.resolveComponent("Button"),be=e.resolveComponent("DropdownMenuTrigger"),J=e.resolveComponent("DropdownMenuLabel"),H=e.resolveComponent("DropdownMenuItem"),X=e.resolveComponent("DropdownMenuGroup"),le=e.resolveComponent("DropdownMenuSeparator"),we=e.resolveComponent("DropdownMenuContent"),Ee=e.resolveComponent("DropdownMenu"),Ae=e.resolveComponent("DialogFooter"),ke=e.resolveComponent("DialogScrollContent"),Be=e.resolveComponent("Dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Be,{open:d.value,"onUpdate:open":m[0]||(m[0]=Me=>d.value=Me)},{default:e.withCtx(()=>[e.createVNode(ke,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(Ve,null,{default:e.withCtx(()=>[e.createVNode(_,{class:"flex items-center gap-3"},{default:e.withCtx(()=>[m[1]||(m[1]=e.createElementVNode("span",null,"Reservation Details",-1)),e.createElementVNode("span",{class:e.normalizeClass(["px-2.5 py-1 text-xs font-medium rounded-full",E.value.class])},e.toDisplayString(E.value.label),3)]),_:1}),e.createVNode(Y,null,{default:e.withCtx(()=>[e.createTextVNode(" Booking #"+e.toDisplayString(s.value?.id?.slice(0,8)||"—"),1)]),_:1})]),_:1}),s.value?(e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Tt,[m[2]||(m[2]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Customer",-1)),e.createElementVNode("div",jt,[e.createElementVNode("div",Ot,[e.createElementVNode("div",Lt,[e.createVNode(e.unref(M.User),{size:20,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",Pt,e.toDisplayString(b.value),1)])]),e.createElementVNode("div",zt,[s.value.customerInfo?.email?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(e.unref(M.Mail),{size:14}),e.createElementVNode("a",{href:`mailto:${s.value.customerInfo.email}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(s.value.customerInfo.email),9,Ht)])):e.createCommentVNode("",!0),s.value.customerInfo?.phone?(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(e.unref(M.Phone),{size:14}),e.createElementVNode("a",{href:`tel:${s.value.customerInfo.phone}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(s.value.customerInfo.phone),9,Kt)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Gt,[m[5]||(m[5]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Reservation",-1)),e.createElementVNode("div",Yt,[e.createElementVNode("div",Qt,[e.createElementVNode("div",Jt,[e.createVNode(e.unref(M.Clock),{size:14}),m[3]||(m[3]=e.createElementVNode("span",{class:"text-xs"},"Time",-1))]),e.createElementVNode("p",Xt,e.toDisplayString(s.value.startTime)+" - "+e.toDisplayString(s.value.endTime),1)]),e.createElementVNode("div",Zt,[e.createElementVNode("div",qt,[e.createVNode(e.unref(M.Users),{size:14}),m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs"},"Spots",-1))]),e.createElementVNode("p",eo,e.toDisplayString(s.value.spots||1)+" "+e.toDisplayString(s.value.spots===1?"person":"people"),1)])])]),s.value.pricingOption?(e.openBlock(),e.createElementBlock("div",to,[m[6]||(m[6]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Package",-1)),e.createElementVNode("div",oo,[e.createElementVNode("div",no,[e.createElementVNode("div",so,[e.createElementVNode("div",ao,[e.createVNode(e.unref(M.Tag),{size:18,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",ro,e.toDisplayString(s.value.pricingOption.name),1),e.createElementVNode("p",io,e.toDisplayString(V(s.value.pricingOption.duration)),1)])]),e.createElementVNode("p",lo,e.toDisplayString(D(s.value.pricingOption.price)),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",co,[m[13]||(m[13]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Payment",-1)),e.createElementVNode("div",uo,[e.createElementVNode("div",po,[e.createElementVNode("div",mo,[m[7]||(m[7]=e.createElementVNode("span",{class:"text-muted-foreground"},"Base price",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationBasePrice)),1)]),s.value.reservationAddOnsPrice?(e.openBlock(),e.createElementBlock("div",fo,[m[8]||(m[8]=e.createElementVNode("span",{class:"text-muted-foreground"},"Add-ons",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationAddOnsPrice)),1)])):e.createCommentVNode("",!0),s.value.discount?(e.openBlock(),e.createElementBlock("div",vo,[m[9]||(m[9]=e.createElementVNode("span",null,"Discount",-1)),e.createElementVNode("span",null,"-"+e.toDisplayString(D(s.value.discount)),1)])):e.createCommentVNode("",!0)]),e.createVNode(ie),e.createElementVNode("div",go,[m[10]||(m[10]=e.createElementVNode("span",null,"Reservation Total",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationPrice)),1)]),s.value.amountPaid!==void 0||s.value.amountDue!==void 0?(e.openBlock(),e.createBlock(ie,{key:0})):e.createCommentVNode("",!0),s.value.amountPaid!==void 0||s.value.amountDue!==void 0?(e.openBlock(),e.createElementBlock("div",ho,[s.value.amountPaid!==void 0?(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("span",Co,[e.createVNode(e.unref(M.CreditCard),{size:14}),m[11]||(m[11]=e.createTextVNode(" Amount paid ",-1))]),e.createElementVNode("span",No,e.toDisplayString(D(s.value.amountPaid)),1)])):e.createCommentVNode("",!0),s.value.amountDue!==void 0&&s.value.amountDue>0?(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("span",yo,[e.createVNode(e.unref(M.Receipt),{size:14}),m[12]||(m[12]=e.createTextVNode(" Amount due ",-1))]),e.createElementVNode("span",_o,e.toDisplayString(D(s.value.amountDue)),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createVNode(Ae,{class:"gap-2 sm:justify-between"},{default:e.withCtx(()=>[s.value.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Q,{variant:"destructive",onClick:y},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Ban),{size:16}),m[14]||(m[14]=e.createTextVNode(" Reject Reservation ",-1))]),_:1}),e.createVNode(Q,{onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(M.ClockCheck),{size:16}),m[15]||(m[15]=e.createTextVNode(" Approve Reservation ",-1))]),_:1})],64)):s.value.reservationStatus==="approved"?(e.openBlock(),e.createBlock(Ee,{key:1},{default:e.withCtx(()=>[e.createVNode(be,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(Q,{variant:"outline",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MoreHorizontal),{size:16}),m[16]||(m[16]=e.createTextVNode(" Actions ",-1))]),_:1})]),_:1}),e.createVNode(we,{class:"w-60",align:"start"},{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[17]||(m[17]=[e.createTextVNode(" Reservation Actions ",-1)])]),_:1}),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(H,{onClick:S,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Download),{size:16,class:"text-muted-foreground"}),m[18]||(m[18]=e.createElementVNode("span",null,"Download PDF",-1))]),_:1})]),_:1}),e.createVNode(le),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[19]||(m[19]=[e.createTextVNode(" Communication ",-1)])]),_:1}),e.createVNode(H,{onClick:A,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MailCheck),{size:16,class:"text-muted-foreground"}),m[20]||(m[20]=e.createElementVNode("span",null,"(Re)send Confirmation Mail",-1))]),_:1})]),_:1}),e.unref(a)("manage-reservations")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(le),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[21]||(m[21]=[e.createTextVNode(" Cancellation ",-1)])]),_:1}),e.createVNode(H,{onClick:k,class:"gap-2 cursor-pointer",variant:"destructive",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.XCircle),{size:16}),m[22]||(m[22]=e.createElementVNode("span",null,"Cancel Reservation",-1))]),_:1},8,["disabled"]),s.value?.reservationPrice&&s.value.reservationPrice>0?(e.openBlock(),e.createBlock(H,{key:0,onClick:re,class:"gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Gift),{class:"text-inherit",size:16}),m[23]||(m[23]=e.createElementVNode("span",null,"Cancel & Send Coupon",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})],64)):e.createCommentVNode("",!0)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["open"]),e.createVNode(Vt,{ref_key:"cancelReservationDialog",ref:v,onConfirm:N},null,512),e.createVNode(Bt,{ref_key:"approveReservationDialog",ref:x,onConfirm:B},null,512),e.createVNode(Rt,{ref_key:"rejectReservationDialog",ref:f,onConfirm:j},null,512),e.createVNode(bt,{ref_key:"transferReservationDialog",ref:u},null,512)],64)}}});exports.Fuse=U;exports._sfc_main=Vo;
349
+ We would love to see you another time!`)},x=()=>{if(!c.value){if(!d.value||!s.value||!p.value)return alert("Please fill in all the fields.");i({to:d.value,subject:s.value,body:p.value})}r.value=!1;const{$confetti:f}=useNuxtApp();f(),l("confirm")};return t({openDialog:v}),(f,u)=>{const g=e.resolveComponent("DialogTitle"),b=e.resolveComponent("DialogDescription"),E=e.resolveComponent("DialogHeader"),w=e.resolveComponent("Checkbox"),D=e.resolveComponent("Label"),V=e.resolveComponent("Input"),S=e.resolveComponent("Textarea"),$=e.resolveComponent("Button"),y=e.resolveComponent("DialogFooter"),A=e.resolveComponent("DialogScrollContent"),k=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(k,{open:r.value,"onUpdate:open":u[5]||(u[5]=N=>r.value=N)},{default:e.withCtx(()=>[e.createVNode(A,{class:"sm:max-w-3xl"},{default:e.withCtx(()=>[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[...u[6]||(u[6]=[e.createTextVNode(" Reject Reservation Request ",-1)])]),_:1}),e.createVNode(b)]),_:1}),e.createElementVNode("div",Mt,[e.createVNode(w,{modelValue:c.value,"onUpdate:modelValue":u[0]||(u[0]=N=>c.value=N),id:"reject-dialog-skip-mail",class:"border-black/80 dark:border-gray-200",disabled:!e.unref(a).mailAccount},null,8,["modelValue","disabled"]),e.createVNode(D,{for:"reject-dialog-skip-mail",class:"py-4 pl-2 pr-4"},{default:e.withCtx(()=>[...u[7]||(u[7]=[e.createTextVNode("Do not send email to customer",-1)])]),_:1})]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4 py-4",{"opacity-50":c.value}])},[e.createElementVNode("div",$t,[e.createVNode(D,{for:"reject-dialog-email"},{default:e.withCtx(()=>[...u[8]||(u[8]=[e.createTextVNode("To:",-1)])]),_:1}),e.createVNode(V,{modelValue:d.value,"onUpdate:modelValue":u[1]||(u[1]=N=>d.value=N),disabled:c.value,id:"reject-dialog-email"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",Ft,[e.createVNode(D,{for:"reject-dialog-subject"},{default:e.withCtx(()=>[...u[9]||(u[9]=[e.createTextVNode("Subject:",-1)])]),_:1}),e.createVNode(V,{modelValue:s.value,"onUpdate:modelValue":u[2]||(u[2]=N=>s.value=N),disabled:c.value,id:"reject-dialog-subject"},null,8,["modelValue","disabled"])]),e.createElementVNode("div",St,[e.createVNode(D,{for:"reject-dialog-body"},{default:e.withCtx(()=>[...u[10]||(u[10]=[e.createTextVNode("Body:",-1)])]),_:1}),e.createVNode(S,{modelValue:p.value,"onUpdate:modelValue":u[3]||(u[3]=N=>p.value=N),disabled:c.value,id:"reject-dialog-body"},null,8,["modelValue","disabled"])])],2),e.createVNode(y,null,{default:e.withCtx(()=>[e.createVNode($,{variant:"outline",onClick:u[4]||(u[4]=N=>r.value=!1)},{default:e.withCtx(()=>[...u[11]||(u[11]=[e.createTextVNode("Close",-1)])]),_:1}),e.createVNode($,{variant:"destructive",onClick:x},{default:e.withCtx(()=>[...u[12]||(u[12]=[e.createTextVNode("Reject reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}}),It={key:0,class:"space-y-6 py-4"},Tt={class:"space-y-3"},jt={class:"bg-muted/30 rounded-lg p-4 space-y-3"},Ot={class:"flex items-center gap-3"},Lt={class:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center"},Pt={class:"font-medium"},zt={class:"grid gap-2 text-sm"},Ut={key:0,class:"flex items-center gap-2 text-muted-foreground"},Ht=["href"],Wt={key:1,class:"flex items-center gap-2 text-muted-foreground"},Kt=["href"],Gt={class:"space-y-3"},Yt={class:"grid grid-cols-2 gap-3"},Qt={class:"bg-muted/30 rounded-lg p-3"},Jt={class:"flex items-center gap-2 text-muted-foreground mb-1"},Xt={class:"font-medium"},Zt={class:"bg-muted/30 rounded-lg p-3"},qt={class:"flex items-center gap-2 text-muted-foreground mb-1"},eo={class:"font-medium"},to={key:0,class:"space-y-3"},oo={class:"bg-muted/30 rounded-lg p-4"},no={class:"flex items-start justify-between"},so={class:"flex items-start gap-3"},ao={class:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mt-0.5"},ro={class:"font-medium"},io={class:"text-sm text-muted-foreground"},lo={class:"font-semibold"},co={class:"space-y-3"},uo={class:"bg-muted/30 rounded-lg p-4 space-y-3"},po={class:"space-y-2 text-sm"},mo={class:"flex justify-between"},fo={key:0,class:"flex justify-between"},vo={key:1,class:"flex justify-between text-green-600 dark:text-green-400"},go={class:"flex justify-between font-semibold"},ho={key:1,class:"space-y-2 text-sm"},xo={key:0,class:"flex justify-between"},Co={class:"text-muted-foreground flex items-center gap-1.5"},No={class:"text-green-600 dark:text-green-400"},Do={key:1,class:"flex justify-between"},yo={class:"text-muted-foreground flex items-center gap-1.5"},_o={class:"text-orange-600 dark:text-orange-400 font-medium"},Vo=e.defineComponent({__name:"ReservationDetailDialog",emits:["cancelled","confirmed","rejected"],setup(o,{expose:t,emit:n}){const{hasPermission:a}=I.useModulePermissions(),{config:i}=I.useModule(),l=I.useFirebaseIntegration(i.project),r=e.inject("event",e.ref(null)),c=n,d=e.ref(!1),s=e.ref(null),p=e.ref(!1),v=e.useTemplateRef("cancelReservationDialog"),x=e.useTemplateRef("approveReservationDialog"),f=e.useTemplateRef("rejectReservationDialog"),u=e.useTemplateRef("transferReservationDialog"),g=C=>{s.value=C,d.value=!0},b=e.computed(()=>s.value?.customerInfo&&`${s.value.customerInfo.firstName} ${s.value.customerInfo.lastName}`.trim()||"Unknown Customer"),E=e.computed(()=>{let C=s.value?.status;const m=s.value?.reservationStatus;switch(["needs_approval","rejected","approved","cancelled"].includes(m)&&(C=m),C){case"needs_approval":return{label:"Needs Approval",class:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"};case"rejected":return{label:"Rejected",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};case"approved":return{label:"Approved",class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"};case"pending":return{label:"Pending",class:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"};case"cancelled":return{label:"Cancelled",class:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"};default:return{label:C||"Unknown",class:"bg-muted text-muted-foreground"}}}),w=e.computed(()=>s.value?.status==="cancelled"),D=C=>C==null||typeof C!="number"?"—":`€${C?.toFixed(2)}`,V=C=>{if(!C)return"—";if(C<60)return`${C} min`;const m=Math.floor(C/60),_=C%60;return _>0?`${m}h ${_}min`:`${m}h`},S=()=>{if(!s.value)return;let C="";const m=r?.value?.date;if(m)try{C=new Date(m).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}catch{C=m}const _={date:C,resourceName:r?.value?.resource?.name};Ct(s.value,_)},$=()=>{x.value?.openDialog(s.value)},y=()=>{f.value?.openDialog(s.value)},A=()=>{x.value?.openDialog(s.value)},k=()=>{v.value?.openDialog(s.value)},N=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="cancelled",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="cancelled",z.toast.success("Reservation cancelled successfully"),c("cancelled"),d.value=!1}catch(C){console.error("Error cancelling reservation:",C),z.toast.error("Failed to cancel reservation")}finally{p.value=!1}},B=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="approved",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="approved",z.toast.success("Reservation approved successfully"),c("confirmed"),d.value=!1}catch(C){console.error("Error approving reservation:",C),z.toast.error("Failed to approve reservation")}finally{p.value=!1}},j=async()=>{try{if(p.value||!s.value?.id)throw new Error("Invalid state");p.value=!0;let m=(await l.get(i.reservationsCollection,s.value.id))?.reservations||[];if(!m.find(_=>_.id===s.value.res_id))throw new Error("Reservation not found");m.find(_=>_.id===s.value.res_id).status="rejected",await l.update(i.reservationsCollection,s.value.id,{reservations:m}),s.value.status="rejected",z.toast.success("Reservation rejected successfully"),c("rejected"),d.value=!1}catch(C){console.error("Error rejecting reservation:",C),z.toast.error("Failed to reject reservation")}finally{p.value=!1}},re=()=>{};return t({openDialog:g}),(C,m)=>{const _=e.resolveComponent("DialogTitle"),Y=e.resolveComponent("DialogDescription"),Ve=e.resolveComponent("DialogHeader"),ie=e.resolveComponent("Separator"),Q=e.resolveComponent("Button"),be=e.resolveComponent("DropdownMenuTrigger"),J=e.resolveComponent("DropdownMenuLabel"),H=e.resolveComponent("DropdownMenuItem"),X=e.resolveComponent("DropdownMenuGroup"),le=e.resolveComponent("DropdownMenuSeparator"),we=e.resolveComponent("DropdownMenuContent"),Ee=e.resolveComponent("DropdownMenu"),Ae=e.resolveComponent("DialogFooter"),ke=e.resolveComponent("DialogScrollContent"),Be=e.resolveComponent("Dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(Be,{open:d.value,"onUpdate:open":m[0]||(m[0]=Me=>d.value=Me)},{default:e.withCtx(()=>[e.createVNode(ke,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(Ve,null,{default:e.withCtx(()=>[e.createVNode(_,{class:"flex items-center gap-3"},{default:e.withCtx(()=>[m[1]||(m[1]=e.createElementVNode("span",null,"Reservation Details",-1)),e.createElementVNode("span",{class:e.normalizeClass(["px-2.5 py-1 text-xs font-medium rounded-full",E.value.class])},e.toDisplayString(E.value.label),3)]),_:1}),e.createVNode(Y,null,{default:e.withCtx(()=>[e.createTextVNode(" Booking #"+e.toDisplayString(s.value?.id?.slice(0,8)||"—"),1)]),_:1})]),_:1}),s.value?(e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Tt,[m[2]||(m[2]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Customer",-1)),e.createElementVNode("div",jt,[e.createElementVNode("div",Ot,[e.createElementVNode("div",Lt,[e.createVNode(e.unref(M.User),{size:20,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",Pt,e.toDisplayString(b.value),1)])]),e.createElementVNode("div",zt,[s.value.customerInfo?.email?(e.openBlock(),e.createElementBlock("div",Ut,[e.createVNode(e.unref(M.Mail),{size:14}),e.createElementVNode("a",{href:`mailto:${s.value.customerInfo.email}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(s.value.customerInfo.email),9,Ht)])):e.createCommentVNode("",!0),s.value.customerInfo?.phone?(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(e.unref(M.Phone),{size:14}),e.createElementVNode("a",{href:`tel:${s.value.customerInfo.phone}`,class:"hover:text-foreground transition-colors"},e.toDisplayString(s.value.customerInfo.phone),9,Kt)])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Gt,[m[5]||(m[5]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Reservation",-1)),e.createElementVNode("div",Yt,[e.createElementVNode("div",Qt,[e.createElementVNode("div",Jt,[e.createVNode(e.unref(M.Clock),{size:14}),m[3]||(m[3]=e.createElementVNode("span",{class:"text-xs"},"Time",-1))]),e.createElementVNode("p",Xt,e.toDisplayString(s.value.startTime)+" - "+e.toDisplayString(s.value.endTime),1)]),e.createElementVNode("div",Zt,[e.createElementVNode("div",qt,[e.createVNode(e.unref(M.Users),{size:14}),m[4]||(m[4]=e.createElementVNode("span",{class:"text-xs"},"Spots",-1))]),e.createElementVNode("p",eo,e.toDisplayString(s.value.spots||1)+" "+e.toDisplayString(s.value.spots===1?"person":"people"),1)])])]),s.value.pricingOption?(e.openBlock(),e.createElementBlock("div",to,[m[6]||(m[6]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Package",-1)),e.createElementVNode("div",oo,[e.createElementVNode("div",no,[e.createElementVNode("div",so,[e.createElementVNode("div",ao,[e.createVNode(e.unref(M.Tag),{size:18,class:"text-primary"})]),e.createElementVNode("div",null,[e.createElementVNode("p",ro,e.toDisplayString(s.value.pricingOption.name),1),e.createElementVNode("p",io,e.toDisplayString(V(s.value.pricingOption.duration)),1)])]),e.createElementVNode("p",lo,e.toDisplayString(D(s.value.pricingOption.price)),1)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",co,[m[13]||(m[13]=e.createElementVNode("h3",{class:"text-sm font-semibold text-muted-foreground uppercase tracking-wide"},"Payment",-1)),e.createElementVNode("div",uo,[e.createElementVNode("div",po,[e.createElementVNode("div",mo,[m[7]||(m[7]=e.createElementVNode("span",{class:"text-muted-foreground"},"Base price",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationBasePrice)),1)]),s.value.reservationAddOnsPrice?(e.openBlock(),e.createElementBlock("div",fo,[m[8]||(m[8]=e.createElementVNode("span",{class:"text-muted-foreground"},"Add-ons",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationAddOnsPrice)),1)])):e.createCommentVNode("",!0),s.value.discount?(e.openBlock(),e.createElementBlock("div",vo,[m[9]||(m[9]=e.createElementVNode("span",null,"Discount",-1)),e.createElementVNode("span",null,"-"+e.toDisplayString(D(s.value.discount)),1)])):e.createCommentVNode("",!0)]),e.createVNode(ie),e.createElementVNode("div",go,[m[10]||(m[10]=e.createElementVNode("span",null,"Reservation Total",-1)),e.createElementVNode("span",null,e.toDisplayString(D(s.value.reservationPrice)),1)]),s.value.amountPaid!==void 0||s.value.amountDue!==void 0?(e.openBlock(),e.createBlock(ie,{key:0})):e.createCommentVNode("",!0),s.value.amountPaid!==void 0||s.value.amountDue!==void 0?(e.openBlock(),e.createElementBlock("div",ho,[s.value.amountPaid!==void 0?(e.openBlock(),e.createElementBlock("div",xo,[e.createElementVNode("span",Co,[e.createVNode(e.unref(M.CreditCard),{size:14}),m[11]||(m[11]=e.createTextVNode(" Amount paid ",-1))]),e.createElementVNode("span",No,e.toDisplayString(D(s.value.amountPaid)),1)])):e.createCommentVNode("",!0),s.value.amountDue!==void 0&&s.value.amountDue>0?(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("span",yo,[e.createVNode(e.unref(M.Receipt),{size:14}),m[12]||(m[12]=e.createTextVNode(" Amount due ",-1))]),e.createElementVNode("span",_o,e.toDisplayString(D(s.value.amountDue)),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createVNode(Ae,{class:"gap-2 sm:justify-between"},{default:e.withCtx(()=>[s.value.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(Q,{variant:"destructive",onClick:y},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Ban),{size:16}),m[14]||(m[14]=e.createTextVNode(" Reject Reservation ",-1))]),_:1}),e.createVNode(Q,{onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(M.ClockCheck),{size:16}),m[15]||(m[15]=e.createTextVNode(" Approve Reservation ",-1))]),_:1})],64)):s.value.reservationStatus==="approved"?(e.openBlock(),e.createBlock(Ee,{key:1},{default:e.withCtx(()=>[e.createVNode(be,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(Q,{variant:"outline",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MoreHorizontal),{size:16}),m[16]||(m[16]=e.createTextVNode(" Actions ",-1))]),_:1})]),_:1}),e.createVNode(we,{class:"w-60",align:"start"},{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[17]||(m[17]=[e.createTextVNode(" Reservation Actions ",-1)])]),_:1}),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(H,{onClick:S,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Download),{size:16,class:"text-muted-foreground"}),m[18]||(m[18]=e.createElementVNode("span",null,"Download PDF",-1))]),_:1})]),_:1}),e.createVNode(le),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[19]||(m[19]=[e.createTextVNode(" Communication ",-1)])]),_:1}),e.createVNode(H,{onClick:A,class:"gap-2 cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(M.MailCheck),{size:16,class:"text-muted-foreground"}),m[20]||(m[20]=e.createElementVNode("span",null,"(Re)send Confirmation Mail",-1))]),_:1})]),_:1}),e.unref(a)("manage-reservations")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(le),e.createVNode(X,null,{default:e.withCtx(()=>[e.createVNode(J,{class:"text-xs text-muted-foreground font-normal"},{default:e.withCtx(()=>[...m[21]||(m[21]=[e.createTextVNode(" Cancellation ",-1)])]),_:1}),e.createVNode(H,{onClick:k,class:"gap-2 cursor-pointer",variant:"destructive",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.XCircle),{size:16}),m[22]||(m[22]=e.createElementVNode("span",null,"Cancel Reservation",-1))]),_:1},8,["disabled"]),s.value?.reservationPrice&&s.value.reservationPrice>0?(e.openBlock(),e.createBlock(H,{key:0,onClick:re,class:"gap-2 cursor-pointer text-orange-600 dark:text-orange-400 focus:text-orange-600 dark:focus:text-orange-400",disabled:w.value},{default:e.withCtx(()=>[e.createVNode(e.unref(M.Gift),{class:"text-inherit",size:16}),m[23]||(m[23]=e.createElementVNode("span",null,"Cancel & Send Coupon",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),_:1})],64)):e.createCommentVNode("",!0)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1},8,["open"]),e.createVNode(Vt,{ref_key:"cancelReservationDialog",ref:v,onConfirm:N},null,512),e.createVNode(Bt,{ref_key:"approveReservationDialog",ref:x,onConfirm:B},null,512),e.createVNode(Rt,{ref_key:"rejectReservationDialog",ref:f,onConfirm:j},null,512),e.createVNode(bt,{ref_key:"transferReservationDialog",ref:u},null,512)],64)}}});exports.Fuse=U;exports._sfc_main=Vo;
@@ -1,8 +1,8 @@
1
- import { defineComponent as ce, ref as f, computed as b, watch as me, onMounted as xe, resolveComponent as W, openBlock as a, createElementBlock as i, createElementVNode as e, Fragment as $, renderList as U, normalizeClass as v, toDisplayString as r, createVNode as o, withCtx as u, unref as n, createCommentVNode as y, createBlock as H, createTextVNode as d, normalizeStyle as C } from "vue";
1
+ import { defineComponent as ce, ref as f, computed as b, watch as me, onMounted as xe, resolveComponent as W, openBlock as a, createElementBlock as i, createElementVNode as e, Fragment as $, renderList as N, normalizeClass as v, toDisplayString as r, createVNode as o, withCtx as u, unref as n, createCommentVNode as y, createBlock as H, createTextVNode as d, normalizeStyle as C } from "vue";
2
2
  import { useModule as pe, useModuleRoute as fe, useModuleBreadcrumbs as ve } from "@oneclick.dev/cms-kit";
3
3
  import "./index-CMk3uhUt.mjs";
4
- import { g as Y, h as Z } from "./index-DYpruS-A-Cw57iwdY.mjs";
5
- import { RefreshCw as ge, AlertTriangle as ye, Loader2 as he, MousePointerClick as N, Eye as V, TrendingUp as _e, Hash as be, Search as ke, FileText as we, ArrowUpRight as Ce } from "lucide-vue-next";
4
+ import { componentToString as Y, ChartTooltipContent as Z } from "@oneclick.dev/cms-kit/charts";
5
+ import { RefreshCw as ge, AlertTriangle as ye, Loader2 as he, MousePointerClick as U, Eye as V, TrendingUp as _e, Hash as be, Search as ke, FileText as we, ArrowUpRight as Ce } from "lucide-vue-next";
6
6
  import { S as ee, C as B, A as te, z as se } from "./index-_2lRVt_k.mjs";
7
7
  import { C as oe, a as le } from "./index-p5Uqu8c2.mjs";
8
8
  const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { class: "flex items-center justify-between" }, ze = {
@@ -11,7 +11,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
11
11
  }, Se = { class: "flex items-center border rounded-lg overflow-hidden" }, De = ["onClick"], Pe = { class: "text-sm text-destructive font-medium" }, Re = {
12
12
  key: 3,
13
13
  class: "flex items-center justify-center py-20"
14
- }, Fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, Me = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ae = { class: "text-2xl font-bold tabular-nums" }, Le = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ue = { class: "text-2xl font-bold tabular-nums" }, Ne = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Be = { class: "text-2xl font-bold tabular-nums" }, je = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ee = { class: "flex items-center gap-4" }, Ke = { class: "flex items-center gap-2" }, Oe = { class: "text-xs" }, Ie = { class: "flex items-center gap-2" }, He = { class: "text-xs" }, Ve = { class: "flex items-center gap-2" }, Xe = { class: "text-xs" }, qe = { class: "flex items-center gap-2" }, Ge = { class: "text-xs" }, Je = {
14
+ }, Fe = { class: "grid grid-cols-2 @3xl:grid-cols-4 gap-4" }, Me = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ae = { class: "text-2xl font-bold tabular-nums" }, Le = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ne = { class: "text-2xl font-bold tabular-nums" }, Ue = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Be = { class: "text-2xl font-bold tabular-nums" }, je = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Ee = { class: "flex items-center gap-4" }, Ke = { class: "flex items-center gap-2" }, Oe = { class: "text-xs" }, Ie = { class: "flex items-center gap-2" }, He = { class: "text-xs" }, Ve = { class: "flex items-center gap-2" }, Xe = { class: "text-xs" }, qe = { class: "flex items-center gap-2" }, Ge = { class: "text-xs" }, Je = {
15
15
  key: 0,
16
16
  class: "flex h-3 rounded-full overflow-hidden mt-3"
17
17
  }, Qe = { class: "grid grid-cols-1 @3xl:grid-cols-2 gap-4" }, We = {
@@ -127,7 +127,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
127
127
  ], -1)),
128
128
  P.value ? (a(), i("div", ze, [
129
129
  e("div", Se, [
130
- (a(), i($, null, U(ae, (l) => e("button", {
130
+ (a(), i($, null, N(ae, (l) => e("button", {
131
131
  key: l.value,
132
132
  class: v(["px-3 py-1.5 text-xs font-medium transition-colors", S.value === l.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
133
133
  onClick: (p) => S.value = l.value
@@ -174,7 +174,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
174
174
  o(m, { class: "p-4 space-y-1" }, {
175
175
  default: u(() => [
176
176
  e("div", Me, [
177
- o(n(N), { class: "size-3.5" }),
177
+ o(n(U), { class: "size-3.5" }),
178
178
  t[8] || (t[8] = d(" Total Clicks ", -1))
179
179
  ]),
180
180
  e("p", Ae, r(_(w.value.clicks)), 1)
@@ -187,13 +187,13 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
187
187
  o(n(V), { class: "size-3.5" }),
188
188
  t[9] || (t[9] = d(" Total Impressions ", -1))
189
189
  ]),
190
- e("p", Ue, r(_(w.value.impressions)), 1)
190
+ e("p", Ne, r(_(w.value.impressions)), 1)
191
191
  ]),
192
192
  _: 1
193
193
  }),
194
194
  o(m, { class: "p-4 space-y-1" }, {
195
195
  default: u(() => [
196
- e("div", Ne, [
196
+ e("div", Ue, [
197
197
  o(n(_e), { class: "size-3.5" }),
198
198
  t[10] || (t[10] = d(" Average CTR ", -1))
199
199
  ]),
@@ -387,7 +387,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
387
387
  ]),
388
388
  x.value === "keywords" ? (a(), i("div", ot, [
389
389
  c.value.length === 0 ? (a(), i("div", lt, " No keyword data found for this period. ")) : y("", !0),
390
- (a(!0), i($, null, U(c.value, (l, p) => (a(), i("div", {
390
+ (a(!0), i($, null, N(c.value, (l, p) => (a(), i("div", {
391
391
  key: p,
392
392
  class: "px-4 py-3 hover:bg-muted/30 transition-colors"
393
393
  }, [
@@ -404,7 +404,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
404
404
  ]),
405
405
  e("div", ut, [
406
406
  e("span", ct, [
407
- o(n(N), { class: "size-3" }),
407
+ o(n(U), { class: "size-3" }),
408
408
  d(" " + r(_(l.clicks)), 1)
409
409
  ]),
410
410
  e("span", mt, [
@@ -421,7 +421,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
421
421
  ])) : y("", !0),
422
422
  x.value === "pages" ? (a(), i("div", pt, [
423
423
  D.value.length === 0 ? (a(), i("div", ft, " No page data found for this period. ")) : y("", !0),
424
- (a(!0), i($, null, U(D.value, (l, p) => (a(), i("div", {
424
+ (a(!0), i($, null, N(D.value, (l, p) => (a(), i("div", {
425
425
  key: p,
426
426
  class: "px-4 py-3 hover:bg-muted/30 transition-colors"
427
427
  }, [
@@ -441,7 +441,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
441
441
  ]),
442
442
  e("div", bt, [
443
443
  e("span", kt, [
444
- o(n(N), { class: "size-3" }),
444
+ o(n(U), { class: "size-3" }),
445
445
  d(" " + r(_(l.clicks)), 1)
446
446
  ]),
447
447
  e("span", wt, [
@@ -458,7 +458,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
458
458
  ])) : y("", !0),
459
459
  x.value === "mapping" ? (a(), i("div", $t, [
460
460
  j.value.length === 0 ? (a(), i("div", Tt, " No query-page data found for this period. ")) : y("", !0),
461
- (a(!0), i($, null, U(j.value, (l, p) => (a(), i("div", {
461
+ (a(!0), i($, null, N(j.value, (l, p) => (a(), i("div", {
462
462
  key: p,
463
463
  class: "px-4 py-3 hover:bg-muted/30 transition-colors"
464
464
  }, [
@@ -473,7 +473,7 @@ const $e = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, Te = { cla
473
473
  ]),
474
474
  e("div", Ft, [
475
475
  e("span", Mt, [
476
- o(n(N), { class: "size-3" }),
476
+ o(n(U), { class: "size-3" }),
477
477
  d(" " + r(_(l.clicks)), 1)
478
478
  ]),
479
479
  e("span", {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const b=require("./index-DYpruS-A-DwDXo9Tq.js"),r=require("lucide-vue-next"),a=require("./index-DQYBP8Js.js"),w=require("./index-C4YUVWzJ.js"),O={class:"w-full max-w-7xl mx-auto py-8 px-4 space-y-6"},I={class:"flex items-center justify-between"},H={key:0,class:"flex items-center gap-2"},X={class:"flex items-center border rounded-lg overflow-hidden"},G=["onClick"],Y={class:"text-sm text-destructive font-medium"},J={key:3,class:"flex items-center justify-center py-20"},Q={class:"grid grid-cols-2 @3xl:grid-cols-4 gap-4"},W={class:"flex items-center gap-2 text-xs text-muted-foreground"},Z={class:"text-2xl font-bold tabular-nums"},ee={class:"flex items-center gap-2 text-xs text-muted-foreground"},te={class:"text-2xl font-bold tabular-nums"},oe={class:"flex items-center gap-2 text-xs text-muted-foreground"},se={class:"text-2xl font-bold tabular-nums"},re={class:"flex items-center gap-2 text-xs text-muted-foreground"},ne={class:"flex items-center gap-4"},le={class:"flex items-center gap-2"},ae={class:"text-xs"},ie={class:"flex items-center gap-2"},de={class:"text-xs"},ce={class:"flex items-center gap-2"},ue={class:"text-xs"},me={class:"flex items-center gap-2"},pe={class:"text-xs"},xe={key:0,class:"flex h-3 rounded-full overflow-hidden mt-3"},fe={class:"grid grid-cols-1 @3xl:grid-cols-2 gap-4"},ge={key:0,class:"h-48"},ve={key:1,class:"text-xs text-muted-foreground text-center py-10"},ye={key:0,class:"h-48"},Ne={key:1,class:"text-xs text-muted-foreground text-center py-10"},Ve={class:"border-b"},he={class:"flex"},ke={key:0,class:"divide-y"},Ee={key:0,class:"p-8 text-center text-sm text-muted-foreground"},_e={class:"flex items-center gap-3"},be={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},we={class:"flex-1 min-w-0"},Ce={class:"text-sm font-medium truncate"},Be={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Se={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},De={class:"flex items-center gap-1 w-16 justify-end"},Te={class:"flex items-center gap-1 w-16 justify-end"},ze={class:"w-14 text-right"},$e={key:1,class:"divide-y"},Pe={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Fe={class:"flex items-center gap-3"},Me={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Le={class:"flex-1 min-w-0"},Re=["title"],Ae={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Ue={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},je={class:"flex items-center gap-1 w-16 justify-end"},qe={class:"flex items-center gap-1 w-16 justify-end"},Ke={class:"w-14 text-right"},Oe={key:2,class:"divide-y"},Ie={key:0,class:"p-8 text-center text-sm text-muted-foreground"},He={class:"flex items-start gap-3"},Xe={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5"},Ge={class:"flex-1 min-w-0 space-y-0.5"},Ye={class:"text-sm font-medium"},Je=["title"],Qe={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},We={class:"flex items-center gap-1"},Ze=e.defineComponent({__name:"SeoHealth",setup(et){const{config:f}=z.useModule(),{moduleId:R}=z.useModuleRoute();z.useModuleBreadcrumbs(()=>[{label:"SEO Health"}]);const p=e.ref(!0),g=e.ref(null),v=e.ref("30"),u=e.ref([]),x=e.ref({clicks:0,impressions:0,ctr:0,avgPosition:0}),n=e.ref([]),y=e.ref([]),C=e.ref([]),N=e.computed(()=>!!(f.serviceAccount&&f.propertyId&&f.siteUrl)),A=e.computed(()=>!!f.siteUrl);function V(o){return`/api/v1/modules/${R}${o}`}const U=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}],h=(o,t)=>t,$=o=>o.clicks||0,P=o=>o.impressions||0,F=o=>{const t=u.value[Math.round(o)];if(!t)return"";const c=new Date(t.date);return`${c.getDate()}/${c.getMonth()+1}`},M=o=>{const t=u.value[Math.round(Number(o))];return t?new Date(t.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};function m(o){return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:Math.round(o).toString()}function B(o){return`${(o*100).toFixed(1)}%`}function k(o){return o.toFixed(1)}function j(o){return o<=3?"text-emerald-600 dark:text-emerald-400":o<=10?"text-blue-600 dark:text-blue-400":o<=20?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function S(o){return o<=3?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":o<=10?"bg-blue-500/10 text-blue-600 dark:text-blue-400":o<=20?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-red-500/10 text-red-600 dark:text-red-400"}function L(o){try{return new URL(o).pathname}catch{return o}}const D=e.computed(()=>n.value.filter(o=>o.position<=3).length),T=e.computed(()=>n.value.filter(o=>o.position<=10).length),E=e.computed(()=>n.value.filter(o=>o.position<=20).length),q=e.computed(()=>Math.max(...n.value.map(o=>o.clicks),1)),K=e.computed(()=>Math.max(...y.value.map(o=>o.clicks),1));async function _(){if(!N.value)return;p.value=!0,g.value=null;const o=`${v.value}daysAgo`;try{const[t,c,l,s]=await Promise.all([$fetch(V(`/seo/trends?startDate=${o}&endDate=today`)),$fetch(V(`/seo/keywords?startDate=${o}&endDate=today&limit=50`)),$fetch(V(`/seo/pages?startDate=${o}&endDate=today&limit=30`)),$fetch(V(`/seo/query-pages?startDate=${o}&endDate=today`))]);u.value=t.rows||[],x.value=t.totals||{clicks:0,impressions:0,ctr:0,avgPosition:0},n.value=c.rows||[],y.value=l.rows||[],C.value=s.rows||[]}catch(t){g.value=t?.data?.statusMessage||t?.message||"Failed to load SEO data"}finally{p.value=!1}}e.watch(v,()=>_()),e.onMounted(()=>{N.value?_():p.value=!1});const i=e.ref("keywords");return(o,t)=>{const c=e.resolveComponent("Button"),l=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",I,[t[3]||(t[3]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"SEO Health"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Search Console performance & keyword rankings")],-1)),N.value?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",X,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,s=>e.createElementVNode("button",{key:s.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",v.value===s.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:d=>v.value=s.value},e.toDisplayString(s.label),11,G)),64))]),e.createVNode(c,{variant:"outline",size:"icon",onClick:_,disabled:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(r.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":p.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),A.value?N.value?g.value?(e.openBlock(),e.createBlock(l,{key:2,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",Y,e.toDisplayString(g.value),1),e.createVNode(c,{variant:"outline",size:"sm",class:"mt-3",onClick:_},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):p.value?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(e.unref(r.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Q,[e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",W,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3.5"}),t[8]||(t[8]=e.createTextVNode(" Total Clicks ",-1))]),e.createElementVNode("p",Z,e.toDisplayString(m(x.value.clicks)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(e.unref(r.Eye),{class:"size-3.5"}),t[9]||(t[9]=e.createTextVNode(" Total Impressions ",-1))]),e.createElementVNode("p",te,e.toDisplayString(m(x.value.impressions)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(r.TrendingUp),{class:"size-3.5"}),t[10]||(t[10]=e.createTextVNode(" Average CTR ",-1))]),e.createElementVNode("p",se,e.toDisplayString(B(x.value.ctr)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.createVNode(e.unref(r.Hash),{class:"size-3.5"}),t[11]||(t[11]=e.createTextVNode(" Avg Position ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["text-2xl font-bold tabular-nums",j(x.value.avgPosition)])},e.toDisplayString(k(x.value.avgPosition)),3)]),_:1})]),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[20]||(t[20]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Keyword Ranking Distribution",-1)),e.createElementVNode("div",ne,[e.createElementVNode("div",le,[t[13]||(t[13]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-emerald-500"},null,-1)),e.createElementVNode("span",ae,[t[12]||(t[12]=e.createTextVNode("Top 3: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(D.value),1)])]),e.createElementVNode("div",ie,[t[15]||(t[15]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",de,[t[14]||(t[14]=e.createTextVNode("Top 10: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(T.value),1)])]),e.createElementVNode("div",ce,[t[17]||(t[17]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"},null,-1)),e.createElementVNode("span",ue,[t[16]||(t[16]=e.createTextVNode("Top 20: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(E.value),1)])]),e.createElementVNode("div",me,[t[19]||(t[19]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"},null,-1)),e.createElementVNode("span",pe,[t[18]||(t[18]=e.createTextVNode("20+: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(n.value.length-E.value),1)])])]),n.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:"bg-emerald-500 transition-all",style:e.normalizeStyle({width:`${D.value/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-blue-500 transition-all",style:e.normalizeStyle({width:`${(T.value-D.value)/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-amber-500 transition-all",style:e.normalizeStyle({width:`${(E.value-T.value)/n.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-red-500 transition-all",style:e.normalizeStyle({width:`${(n.value.length-E.value)/n.value.length*100}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",fe,[e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[21]||(t[21]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Clicks Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(w.C),{x:h,y:$,color:"#3b82f6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(w.C$1),{x:h,y:$,color:"#3b82f6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.st)(e.unref(b.Ue),{namePayload:[{name:"Clicks",value:s.clicks,color:"#3b82f6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",ve,"Not enough data for chart"))]),_:1}),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[22]||(t[22]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Impressions Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(w.C),{x:h,y:P,color:"#8b5cf6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(w.C$1),{x:h,y:P,color:"#8b5cf6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.st)(e.unref(b.Ue),{namePayload:[{name:"Impressions",value:s.impressions,color:"#8b5cf6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",Ne,"Not enough data for chart"))]),_:1})]),e.createVNode(l,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.createElementVNode("div",he,[e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="keywords"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[0]||(t[0]=s=>i.value="keywords")},[e.createVNode(e.unref(r.Search),{class:"size-3.5 inline mr-1.5"}),t[23]||(t[23]=e.createTextVNode(" Keywords ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[1]||(t[1]=s=>i.value="pages")},[e.createVNode(e.unref(r.FileText),{class:"size-3.5 inline mr-1.5"}),t[24]||(t[24]=e.createTextVNode(" Pages ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="mapping"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[2]||(t[2]=s=>i.value="mapping")},[e.createVNode(e.unref(r.ArrowUpRight),{class:"size-3.5 inline mr-1.5"}),t[25]||(t[25]=e.createTextVNode(" Keyword → Page ",-1))],2)])]),i.value==="keywords"?(e.openBlock(),e.createElementBlock("div",ke,[n.value.length===0?(e.openBlock(),e.createElementBlock("div",Ee," No keyword data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",_e,[e.createElementVNode("span",be,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",we,[e.createElementVNode("p",Ce,e.toDisplayString(s.query),1),e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70",style:e.normalizeStyle({width:`${s.clicks/q.value*100}%`})},null,4)])]),e.createElementVNode("div",Se,[e.createElementVNode("span",De,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",Te,[e.createVNode(e.unref(r.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",ze,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="pages"?(e.openBlock(),e.createElementBlock("div",$e,[y.value.length===0?(e.openBlock(),e.createElementBlock("div",Pe," No page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Fe,[e.createElementVNode("span",Me,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Le,[e.createElementVNode("p",{class:"text-sm font-medium truncate",title:s.page},e.toDisplayString(L(s.page)),9,Re),e.createElementVNode("div",Ae,[e.createElementVNode("div",{class:"h-full rounded-full bg-violet-500/70",style:e.normalizeStyle({width:`${s.clicks/K.value*100}%`})},null,4)])]),e.createElementVNode("div",Ue,[e.createElementVNode("span",je,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",qe,[e.createVNode(e.unref(r.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",Ke,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="mapping"?(e.openBlock(),e.createElementBlock("div",Oe,[C.value.length===0?(e.openBlock(),e.createElementBlock("div",Ie," No query-page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",He,[e.createElementVNode("span",Xe,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ge,[e.createElementVNode("p",Ye,e.toDisplayString(s.query),1),e.createElementVNode("p",{class:"text-xs text-muted-foreground truncate",title:s.page},"→ "+e.toDisplayString(L(s.page)),9,Je)]),e.createElementVNode("div",Qe,[e.createElementVNode("span",We,[e.createVNode(e.unref(r.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0)]),_:1})],64)):(e.openBlock(),e.createBlock(l,{key:1,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Configure your service account, property ID, and site URL in module settings.",-1)])]),_:1})):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center space-y-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.AlertTriangle),{class:"size-10 text-amber-500 mx-auto"}),t[4]||(t[4]=e.createElementVNode("p",{class:"text-lg font-medium"},"Search Console not configured",-1)),t[5]||(t[5]=e.createElementVNode("p",{class:"text-sm text-muted-foreground max-w-md mx-auto"},[e.createTextVNode(" Add your "),e.createElementVNode("strong",null,"Search Console Site URL"),e.createTextVNode(" in the module settings to enable SEO data. Use the exact format from Google Search Console (e.g. "),e.createElementVNode("code",null,"https://example.com"),e.createTextVNode(" or "),e.createElementVNode("code",null,"sc-domain:example.com"),e.createTextVNode("). ")],-1))]),_:1}))])}}});exports.default=Ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const b=require("@oneclick.dev/cms-kit/charts"),n=require("lucide-vue-next"),a=require("./index-DQYBP8Js.js"),C=require("./index-C4YUVWzJ.js"),O={class:"w-full max-w-7xl mx-auto py-8 px-4 space-y-6"},I={class:"flex items-center justify-between"},H={key:0,class:"flex items-center gap-2"},X={class:"flex items-center border rounded-lg overflow-hidden"},G=["onClick"],J={class:"text-sm text-destructive font-medium"},Q={key:3,class:"flex items-center justify-center py-20"},W={class:"grid grid-cols-2 @3xl:grid-cols-4 gap-4"},Y={class:"flex items-center gap-2 text-xs text-muted-foreground"},Z={class:"text-2xl font-bold tabular-nums"},ee={class:"flex items-center gap-2 text-xs text-muted-foreground"},te={class:"text-2xl font-bold tabular-nums"},oe={class:"flex items-center gap-2 text-xs text-muted-foreground"},se={class:"text-2xl font-bold tabular-nums"},ne={class:"flex items-center gap-2 text-xs text-muted-foreground"},re={class:"flex items-center gap-4"},le={class:"flex items-center gap-2"},ae={class:"text-xs"},ie={class:"flex items-center gap-2"},de={class:"text-xs"},ce={class:"flex items-center gap-2"},ue={class:"text-xs"},me={class:"flex items-center gap-2"},pe={class:"text-xs"},xe={key:0,class:"flex h-3 rounded-full overflow-hidden mt-3"},fe={class:"grid grid-cols-1 @3xl:grid-cols-2 gap-4"},ge={key:0,class:"h-48"},ve={key:1,class:"text-xs text-muted-foreground text-center py-10"},ye={key:0,class:"h-48"},Ne={key:1,class:"text-xs text-muted-foreground text-center py-10"},Ve={class:"border-b"},he={class:"flex"},ke={key:0,class:"divide-y"},Ee={key:0,class:"p-8 text-center text-sm text-muted-foreground"},_e={class:"flex items-center gap-3"},be={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Ce={class:"flex-1 min-w-0"},we={class:"text-sm font-medium truncate"},Be={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Se={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},Te={class:"flex items-center gap-1 w-16 justify-end"},De={class:"flex items-center gap-1 w-16 justify-end"},ze={class:"w-14 text-right"},$e={key:1,class:"divide-y"},Pe={key:0,class:"p-8 text-center text-sm text-muted-foreground"},Fe={class:"flex items-center gap-3"},Me={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0"},Le={class:"flex-1 min-w-0"},Re=["title"],Ae={class:"h-1.5 rounded-full bg-muted overflow-hidden mt-1.5 max-w-xs"},Ue={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},je={class:"flex items-center gap-1 w-16 justify-end"},qe={class:"flex items-center gap-1 w-16 justify-end"},Ke={class:"w-14 text-right"},Oe={key:2,class:"divide-y"},Ie={key:0,class:"p-8 text-center text-sm text-muted-foreground"},He={class:"flex items-start gap-3"},Xe={class:"text-xs font-medium text-muted-foreground w-6 text-right shrink-0 mt-0.5"},Ge={class:"flex-1 min-w-0 space-y-0.5"},Je={class:"text-sm font-medium"},Qe=["title"],We={class:"flex items-center gap-4 text-xs text-muted-foreground shrink-0"},Ye={class:"flex items-center gap-1"},Ze=e.defineComponent({__name:"SeoHealth",setup(et){const{config:f}=z.useModule(),{moduleId:R}=z.useModuleRoute();z.useModuleBreadcrumbs(()=>[{label:"SEO Health"}]);const p=e.ref(!0),g=e.ref(null),v=e.ref("30"),u=e.ref([]),x=e.ref({clicks:0,impressions:0,ctr:0,avgPosition:0}),r=e.ref([]),y=e.ref([]),w=e.ref([]),N=e.computed(()=>!!(f.serviceAccount&&f.propertyId&&f.siteUrl)),A=e.computed(()=>!!f.siteUrl);function V(o){return`/api/v1/modules/${R}${o}`}const U=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}],h=(o,t)=>t,$=o=>o.clicks||0,P=o=>o.impressions||0,F=o=>{const t=u.value[Math.round(o)];if(!t)return"";const c=new Date(t.date);return`${c.getDate()}/${c.getMonth()+1}`},M=o=>{const t=u.value[Math.round(Number(o))];return t?new Date(t.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""};function m(o){return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:Math.round(o).toString()}function B(o){return`${(o*100).toFixed(1)}%`}function k(o){return o.toFixed(1)}function j(o){return o<=3?"text-emerald-600 dark:text-emerald-400":o<=10?"text-blue-600 dark:text-blue-400":o<=20?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}function S(o){return o<=3?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":o<=10?"bg-blue-500/10 text-blue-600 dark:text-blue-400":o<=20?"bg-amber-500/10 text-amber-600 dark:text-amber-400":"bg-red-500/10 text-red-600 dark:text-red-400"}function L(o){try{return new URL(o).pathname}catch{return o}}const T=e.computed(()=>r.value.filter(o=>o.position<=3).length),D=e.computed(()=>r.value.filter(o=>o.position<=10).length),E=e.computed(()=>r.value.filter(o=>o.position<=20).length),q=e.computed(()=>Math.max(...r.value.map(o=>o.clicks),1)),K=e.computed(()=>Math.max(...y.value.map(o=>o.clicks),1));async function _(){if(!N.value)return;p.value=!0,g.value=null;const o=`${v.value}daysAgo`;try{const[t,c,l,s]=await Promise.all([$fetch(V(`/seo/trends?startDate=${o}&endDate=today`)),$fetch(V(`/seo/keywords?startDate=${o}&endDate=today&limit=50`)),$fetch(V(`/seo/pages?startDate=${o}&endDate=today&limit=30`)),$fetch(V(`/seo/query-pages?startDate=${o}&endDate=today`))]);u.value=t.rows||[],x.value=t.totals||{clicks:0,impressions:0,ctr:0,avgPosition:0},r.value=c.rows||[],y.value=l.rows||[],w.value=s.rows||[]}catch(t){g.value=t?.data?.statusMessage||t?.message||"Failed to load SEO data"}finally{p.value=!1}}e.watch(v,()=>_()),e.onMounted(()=>{N.value?_():p.value=!1});const i=e.ref("keywords");return(o,t)=>{const c=e.resolveComponent("Button"),l=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",I,[t[3]||(t[3]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"SEO Health"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Search Console performance & keyword rankings")],-1)),N.value?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",X,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(U,s=>e.createElementVNode("button",{key:s.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",v.value===s.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:d=>v.value=s.value},e.toDisplayString(s.label),11,G)),64))]),e.createVNode(c,{variant:"outline",size:"icon",onClick:_,disabled:p.value},{default:e.withCtx(()=>[e.createVNode(e.unref(n.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":p.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),A.value?N.value?g.value?(e.openBlock(),e.createBlock(l,{key:2,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",J,e.toDisplayString(g.value),1),e.createVNode(c,{variant:"outline",size:"sm",class:"mt-3",onClick:_},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):p.value?(e.openBlock(),e.createElementBlock("div",Q,[e.createVNode(e.unref(n.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",W,[e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3.5"}),t[8]||(t[8]=e.createTextVNode(" Total Clicks ",-1))]),e.createElementVNode("p",Z,e.toDisplayString(m(x.value.clicks)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(e.unref(n.Eye),{class:"size-3.5"}),t[9]||(t[9]=e.createTextVNode(" Total Impressions ",-1))]),e.createElementVNode("p",te,e.toDisplayString(m(x.value.impressions)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",oe,[e.createVNode(e.unref(n.TrendingUp),{class:"size-3.5"}),t[10]||(t[10]=e.createTextVNode(" Average CTR ",-1))]),e.createElementVNode("p",se,e.toDisplayString(B(x.value.ctr)),1)]),_:1}),e.createVNode(l,{class:"p-4 space-y-1"},{default:e.withCtx(()=>[e.createElementVNode("div",ne,[e.createVNode(e.unref(n.Hash),{class:"size-3.5"}),t[11]||(t[11]=e.createTextVNode(" Avg Position ",-1))]),e.createElementVNode("p",{class:e.normalizeClass(["text-2xl font-bold tabular-nums",j(x.value.avgPosition)])},e.toDisplayString(k(x.value.avgPosition)),3)]),_:1})]),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[20]||(t[20]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Keyword Ranking Distribution",-1)),e.createElementVNode("div",re,[e.createElementVNode("div",le,[t[13]||(t[13]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-emerald-500"},null,-1)),e.createElementVNode("span",ae,[t[12]||(t[12]=e.createTextVNode("Top 3: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(T.value),1)])]),e.createElementVNode("div",ie,[t[15]||(t[15]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",de,[t[14]||(t[14]=e.createTextVNode("Top 10: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(D.value),1)])]),e.createElementVNode("div",ce,[t[17]||(t[17]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-amber-500"},null,-1)),e.createElementVNode("span",ue,[t[16]||(t[16]=e.createTextVNode("Top 20: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(E.value),1)])]),e.createElementVNode("div",me,[t[19]||(t[19]=e.createElementVNode("span",{class:"inline-block w-3 h-3 rounded-full bg-red-500"},null,-1)),e.createElementVNode("span",pe,[t[18]||(t[18]=e.createTextVNode("20+: ",-1)),e.createElementVNode("strong",null,e.toDisplayString(r.value.length-E.value),1)])])]),r.value.length>0?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:"bg-emerald-500 transition-all",style:e.normalizeStyle({width:`${T.value/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-blue-500 transition-all",style:e.normalizeStyle({width:`${(D.value-T.value)/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-amber-500 transition-all",style:e.normalizeStyle({width:`${(E.value-D.value)/r.value.length*100}%`})},null,4),e.createElementVNode("div",{class:"bg-red-500 transition-all",style:e.normalizeStyle({width:`${(r.value.length-E.value)/r.value.length*100}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",fe,[e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[21]||(t[21]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Clicks Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ge,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(C.C),{x:h,y:$,color:"#3b82f6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(C.C$1),{x:h,y:$,color:"#3b82f6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.componentToString)(e.unref(b.ChartTooltipContent),{namePayload:[{name:"Clicks",value:s.clicks,color:"#3b82f6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",ve,"Not enough data for chart"))]),_:1}),e.createVNode(l,{class:"p-4"},{default:e.withCtx(()=>[t[22]||(t[22]=e.createElementVNode("h3",{class:"text-sm font-medium mb-3"},"Impressions Over Time",-1)),u.value.length>1?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(a.S),{data:u.value,height:180},{default:e.withCtx(()=>[e.createVNode(e.unref(C.C),{x:h,y:P,color:"#8b5cf6",opacity:.1,curveType:"monotoneX"}),e.createVNode(e.unref(C.C$1),{x:h,y:P,color:"#8b5cf6",curveType:"monotoneX"}),e.createVNode(e.unref(a.C),{type:"x",tickFormat:F,numTicks:5,gridLine:!1}),e.createVNode(e.unref(a.C),{type:"y",gridLine:!0,numTicks:4}),e.createVNode(e.unref(a.A),{template:s=>e.unref(b.componentToString)(e.unref(b.ChartTooltipContent),{namePayload:[{name:"Impressions",value:s.impressions,color:"#8b5cf6"}],labelFormatter:M})},null,8,["template"]),e.createVNode(e.unref(a.z))]),_:1},8,["data"])])):(e.openBlock(),e.createElementBlock("p",Ne,"Not enough data for chart"))]),_:1})]),e.createVNode(l,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createElementVNode("div",Ve,[e.createElementVNode("div",he,[e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="keywords"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[0]||(t[0]=s=>i.value="keywords")},[e.createVNode(e.unref(n.Search),{class:"size-3.5 inline mr-1.5"}),t[23]||(t[23]=e.createTextVNode(" Keywords ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[1]||(t[1]=s=>i.value="pages")},[e.createVNode(e.unref(n.FileText),{class:"size-3.5 inline mr-1.5"}),t[24]||(t[24]=e.createTextVNode(" Pages ",-1))],2),e.createElementVNode("button",{class:e.normalizeClass(["px-4 py-2.5 text-sm font-medium transition-colors border-b-2",i.value==="mapping"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"]),onClick:t[2]||(t[2]=s=>i.value="mapping")},[e.createVNode(e.unref(n.ArrowUpRight),{class:"size-3.5 inline mr-1.5"}),t[25]||(t[25]=e.createTextVNode(" Keyword → Page ",-1))],2)])]),i.value==="keywords"?(e.openBlock(),e.createElementBlock("div",ke,[r.value.length===0?(e.openBlock(),e.createElementBlock("div",Ee," No keyword data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",_e,[e.createElementVNode("span",be,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ce,[e.createElementVNode("p",we,e.toDisplayString(s.query),1),e.createElementVNode("div",Be,[e.createElementVNode("div",{class:"h-full rounded-full bg-blue-500/70",style:e.normalizeStyle({width:`${s.clicks/q.value*100}%`})},null,4)])]),e.createElementVNode("div",Se,[e.createElementVNode("span",Te,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",De,[e.createVNode(e.unref(n.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",ze,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="pages"?(e.openBlock(),e.createElementBlock("div",$e,[y.value.length===0?(e.openBlock(),e.createElementBlock("div",Pe," No page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",Fe,[e.createElementVNode("span",Me,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Le,[e.createElementVNode("p",{class:"text-sm font-medium truncate",title:s.page},e.toDisplayString(L(s.page)),9,Re),e.createElementVNode("div",Ae,[e.createElementVNode("div",{class:"h-full rounded-full bg-violet-500/70",style:e.normalizeStyle({width:`${s.clicks/K.value*100}%`})},null,4)])]),e.createElementVNode("div",Ue,[e.createElementVNode("span",je,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",qe,[e.createVNode(e.unref(n.Eye),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.impressions)),1)]),e.createElementVNode("span",Ke,e.toDisplayString(B(s.ctr)),1),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium w-14 justify-center",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0),i.value==="mapping"?(e.openBlock(),e.createElementBlock("div",Oe,[w.value.length===0?(e.openBlock(),e.createElementBlock("div",Ie," No query-page data found for this period. ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(s,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"px-4 py-3 hover:bg-muted/30 transition-colors"},[e.createElementVNode("div",He,[e.createElementVNode("span",Xe,e.toDisplayString(d+1)+".",1),e.createElementVNode("div",Ge,[e.createElementVNode("p",Je,e.toDisplayString(s.query),1),e.createElementVNode("p",{class:"text-xs text-muted-foreground truncate",title:s.page},"→ "+e.toDisplayString(L(s.page)),9,Qe)]),e.createElementVNode("div",We,[e.createElementVNode("span",Ye,[e.createVNode(e.unref(n.MousePointerClick),{class:"size-3"}),e.createTextVNode(" "+e.toDisplayString(m(s.clicks)),1)]),e.createElementVNode("span",{class:e.normalizeClass(["inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium",S(s.position)])}," #"+e.toDisplayString(k(s.position)),3)])])]))),128))])):e.createCommentVNode("",!0)]),_:1})],64)):(e.openBlock(),e.createBlock(l,{key:1,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Configure your service account, property ID, and site URL in module settings.",-1)])]),_:1})):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center space-y-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.AlertTriangle),{class:"size-10 text-amber-500 mx-auto"}),t[4]||(t[4]=e.createElementVNode("p",{class:"text-lg font-medium"},"Search Console not configured",-1)),t[5]||(t[5]=e.createElementVNode("p",{class:"text-sm text-muted-foreground max-w-md mx-auto"},[e.createTextVNode(" Add your "),e.createElementVNode("strong",null,"Search Console Site URL"),e.createTextVNode(" in the module settings to enable SEO data. Use the exact format from Google Search Console (e.g. "),e.createElementVNode("code",null,"https://example.com"),e.createTextVNode(" or "),e.createElementVNode("code",null,"sc-domain:example.com"),e.createTextVNode("). ")],-1))]),_:1}))])}}});exports.default=Ze;