@oneclick.dev/cms-core-modules 0.0.101 → 0.0.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/Acquisition-Br1Pfny3.js +1 -0
  2. package/dist/{Acquisition-BJXNY4ko.mjs → Acquisition-CPlZzUBo.mjs} +40 -40
  3. package/dist/Audience-BfkrmBuQ.js +1 -0
  4. package/dist/{Audience-CIzVtUvV.mjs → Audience-DTblSAiL.mjs} +89 -89
  5. package/dist/Content-BHr_rPVY.js +1 -0
  6. package/dist/{Content-CWhjurn_.mjs → Content-CYOZKvWK.mjs} +56 -56
  7. package/dist/Overview-BrCwozey.js +1 -0
  8. package/dist/{Overview-CGo4jaaA.mjs → Overview-kaMhsIUq.mjs} +21 -21
  9. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +2782 -0
  10. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +349 -0
  11. package/dist/SeoHealth-09sEOu3G.js +1 -0
  12. package/dist/{SeoHealth-DVFDz3em.mjs → SeoHealth-BzcWd_w7.mjs} +29 -29
  13. package/dist/{agenda-DMT75Qfo.mjs → agenda-CCOjPiwP.mjs} +1 -1
  14. package/dist/{agenda-DxD4RMsy.js → agenda-CNPQfaIQ.js} +1 -1
  15. package/dist/cms-core-modules.css +1 -1
  16. package/dist/{index-BbqRTXuU.js → index-BOnqrBfY.js} +1 -1
  17. package/dist/{index-D4GsbUId.mjs → index-Bj0qaL1N.mjs} +1 -1
  18. package/dist/index.cjs.js +1 -1
  19. package/dist/index.mjs +8 -8
  20. package/dist/{orders-BRfXlWgV.mjs → orders-BJV5vRQr.mjs} +1 -1
  21. package/dist/{orders-CrCz1WTR.js → orders-C1C5IEIP.js} +1 -1
  22. package/package.json +2 -2
  23. package/dist/Acquisition-DPScJD4t.js +0 -1
  24. package/dist/Audience-Csw1QLmw.js +0 -1
  25. package/dist/Content-dYr7kYT0.js +0 -1
  26. package/dist/Overview-DBu86Ikb.js +0 -1
  27. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +0 -349
  28. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs +0 -2383
  29. package/dist/SeoHealth-DzftZW1m.js +0 -1
@@ -1,10 +1,10 @@
1
- import { defineComponent as W, ref as x, computed as j, watch as K, onMounted as G, resolveComponent as k, openBlock as a, createElementBlock as r, createElementVNode as t, Fragment as y, renderList as C, normalizeClass as c, toDisplayString as n, createVNode as d, withCtx as l, unref as _, createCommentVNode as m, createBlock as v, createTextVNode as M, resolveDynamicComponent as J, withDirectives as X, vModelText as Y, normalizeStyle as H } from "vue";
1
+ import { defineComponent as W, ref as m, computed as j, watch as K, onMounted as G, resolveComponent as k, openBlock as n, createElementBlock as r, createElementVNode as t, Fragment as y, renderList as C, normalizeClass as c, toDisplayString as a, createVNode as d, withCtx as l, unref as _, createCommentVNode as x, createBlock as v, createTextVNode as M, resolveDynamicComponent as J, withDirectives as X, vModelText as Y, normalizeStyle as H } from "vue";
2
2
  import { useModule as Z, useModuleRoute as tt, useModuleBreadcrumbs as et } from "@oneclick.dev/cms-kit";
3
- import { RefreshCw as st, Loader2 as ot, FileText as nt, LogIn as at, LogOut as rt, Search as lt } from "lucide-vue-next";
4
- const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut = { class: "flex items-center justify-between" }, it = {
3
+ import { RefreshCw as st, Loader2 as ot, FileText as at, LogIn as nt, LogOut as rt, Search as lt } from "lucide-vue-next";
4
+ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut = { class: "flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center" }, it = {
5
5
  key: 0,
6
6
  class: "flex items-center gap-2"
7
- }, ct = { class: "flex items-center border rounded-lg overflow-hidden" }, mt = ["onClick"], xt = { class: "text-sm text-destructive font-medium" }, gt = {
7
+ }, ct = { class: "flex items-center border rounded-lg overflow-hidden" }, xt = ["onClick"], mt = { class: "text-sm text-destructive font-medium" }, gt = {
8
8
  key: 2,
9
9
  class: "flex items-center justify-center py-20"
10
10
  }, ft = { class: "flex items-center justify-between gap-4" }, pt = { class: "flex items-center gap-2" }, ht = ["onClick"], yt = {
@@ -27,7 +27,7 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
27
27
  setup(oe) {
28
28
  const { config: z } = Z(), { moduleId: I } = tt();
29
29
  et(() => [{ label: "Content" }]);
30
- const f = x(!0), P = x(null), R = x("30"), p = x("all"), b = x(""), T = x([]), L = x([]), B = x([]), $ = j(() => !!(z.serviceAccount && z.propertyId));
30
+ const f = m(!0), P = m(null), R = m("30"), p = m("all"), b = m(""), T = m([]), L = m([]), B = m([]), $ = j(() => !!(z.serviceAccount && z.propertyId));
31
31
  function V(o) {
32
32
  return `/api/v1/modules/${I}${o}`;
33
33
  }
@@ -85,19 +85,19 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
85
85
  $.value ? D() : f.value = !1;
86
86
  }), (o, s) => {
87
87
  const u = k("Button"), i = k("Card"), N = k("CardContent"), E = k("CardTitle"), U = k("CardHeader");
88
- return a(), r("div", dt, [
88
+ return n(), r("div", dt, [
89
89
  t("div", ut, [
90
90
  s[1] || (s[1] = t("div", null, [
91
91
  t("h1", { class: "text-2xl font-semibold" }, "Content Performance"),
92
92
  t("p", { class: "text-muted-foreground text-sm mt-1" }, "How your pages perform")
93
93
  ], -1)),
94
- $.value ? (a(), r("div", it, [
94
+ $.value ? (n(), r("div", it, [
95
95
  t("div", ct, [
96
- (a(), r(y, null, C(Q, (e) => t("button", {
96
+ (n(), r(y, null, C(Q, (e) => t("button", {
97
97
  key: e.value,
98
98
  class: c(["px-3 py-1.5 text-xs font-medium transition-colors", R.value === e.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
99
99
  onClick: (g) => R.value = e.value
100
- }, n(e.label), 11, mt)), 64))
100
+ }, a(e.label), 11, xt)), 64))
101
101
  ]),
102
102
  d(u, {
103
103
  variant: "outline",
@@ -112,14 +112,14 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
112
112
  ]),
113
113
  _: 1
114
114
  }, 8, ["disabled"])
115
- ])) : m("", !0)
115
+ ])) : x("", !0)
116
116
  ]),
117
- $.value ? P.value ? (a(), v(i, {
117
+ $.value ? P.value ? (n(), v(i, {
118
118
  key: 1,
119
119
  class: "p-6 border-destructive/50 bg-destructive/5"
120
120
  }, {
121
121
  default: l(() => [
122
- t("p", xt, n(P.value), 1),
122
+ t("p", mt, a(P.value), 1),
123
123
  d(u, {
124
124
  variant: "outline",
125
125
  size: "sm",
@@ -133,25 +133,25 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
133
133
  })
134
134
  ]),
135
135
  _: 1
136
- })) : f.value ? (a(), r("div", gt, [
136
+ })) : f.value ? (n(), r("div", gt, [
137
137
  d(_(ot), { class: "size-8 animate-spin text-muted-foreground" })
138
- ])) : (a(), r(y, { key: 3 }, [
138
+ ])) : (n(), r(y, { key: 3 }, [
139
139
  t("div", ft, [
140
140
  t("div", pt, [
141
- (a(!0), r(y, null, C([
142
- { key: "all", label: "All Pages", icon: _(nt) },
143
- { key: "landing", label: "Landing Pages", icon: _(at) },
141
+ (n(!0), r(y, null, C([
142
+ { key: "all", label: "All Pages", icon: _(at) },
143
+ { key: "landing", label: "Landing Pages", icon: _(nt) },
144
144
  { key: "exit", label: "Exit Pages", icon: _(rt) }
145
- ], (e) => (a(), r("button", {
145
+ ], (e) => (n(), r("button", {
146
146
  key: e.key,
147
147
  class: c(["flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-md transition-colors", p.value === e.key ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"]),
148
148
  onClick: (g) => p.value = e.key
149
149
  }, [
150
- (a(), v(J(e.icon), { class: "size-3.5" })),
151
- M(" " + n(e.label), 1)
150
+ (n(), v(J(e.icon), { class: "size-3.5" })),
151
+ M(" " + a(e.label), 1)
152
152
  ], 10, ht))), 128))
153
153
  ]),
154
- p.value === "all" ? (a(), r("div", yt, [
154
+ p.value === "all" ? (n(), r("div", yt, [
155
155
  d(_(lt), { class: "absolute left-2.5 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground" }),
156
156
  X(t("input", {
157
157
  "onUpdate:modelValue": s[0] || (s[0] = (e) => b.value = e),
@@ -161,9 +161,9 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
161
161
  }, null, 512), [
162
162
  [Y, b.value]
163
163
  ])
164
- ])) : m("", !0)
164
+ ])) : x("", !0)
165
165
  ]),
166
- p.value === "all" ? (a(), v(i, { key: 0 }, {
166
+ p.value === "all" ? (n(), v(i, { key: 0 }, {
167
167
  default: l(() => [
168
168
  d(N, { class: "p-0" }, {
169
169
  default: l(() => [
@@ -182,20 +182,20 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
182
182
  ])
183
183
  ], -1)),
184
184
  t("tbody", bt, [
185
- (a(!0), r(y, null, C(A.value, (e, g) => (a(), r("tr", {
185
+ (n(!0), r(y, null, C(A.value, (e, g) => (n(), r("tr", {
186
186
  key: e.pagePath,
187
187
  class: "hover:bg-muted/50 group"
188
188
  }, [
189
- t("td", wt, n(g + 1), 1),
189
+ t("td", wt, a(g + 1), 1),
190
190
  t("td", kt, [
191
- t("div", Ct, n(e.pagePath), 1),
192
- e.pageTitle ? (a(), r("div", Pt, n(e.pageTitle), 1)) : m("", !0)
191
+ t("div", Ct, a(e.pagePath), 1),
192
+ e.pageTitle ? (n(), r("div", Pt, a(e.pageTitle), 1)) : x("", !0)
193
193
  ]),
194
- t("td", Rt, n(h(e.screenPageViews)), 1),
195
- t("td", $t, n(h(e.totalUsers)), 1),
196
- t("td", St, n(F(e.averageSessionDuration || 0)), 1),
197
- t("td", Dt, n(w(e.bounceRate || 0)), 1),
198
- t("td", Mt, n(w(e.engagementRate || 0)), 1),
194
+ t("td", Rt, a(h(e.screenPageViews)), 1),
195
+ t("td", $t, a(h(e.totalUsers)), 1),
196
+ t("td", St, a(F(e.averageSessionDuration || 0)), 1),
197
+ t("td", Dt, a(w(e.bounceRate || 0)), 1),
198
+ t("td", Mt, a(w(e.engagementRate || 0)), 1),
199
199
  t("td", Tt, [
200
200
  t("div", Lt, [
201
201
  t("div", Bt, [
@@ -206,21 +206,21 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
206
206
  ]),
207
207
  t("span", {
208
208
  class: c(["text-xs font-medium tabular-nums w-8 text-right", q(S(e))])
209
- }, n(Math.round(S(e))), 3)
209
+ }, a(Math.round(S(e))), 3)
210
210
  ])
211
211
  ])
212
212
  ]))), 128))
213
213
  ])
214
214
  ])
215
215
  ]),
216
- A.value.length ? m("", !0) : (a(), r("div", Vt, n(b.value ? "No pages matching your search" : "No page data available"), 1))
216
+ A.value.length ? x("", !0) : (n(), r("div", Vt, a(b.value ? "No pages matching your search" : "No page data available"), 1))
217
217
  ]),
218
218
  _: 1
219
219
  })
220
220
  ]),
221
221
  _: 1
222
- })) : m("", !0),
223
- p.value === "landing" ? (a(), v(i, { key: 1 }, {
222
+ })) : x("", !0),
223
+ p.value === "landing" ? (n(), v(i, { key: 1 }, {
224
224
  default: l(() => [
225
225
  d(U, { class: "pb-2" }, {
226
226
  default: l(() => [
@@ -250,37 +250,37 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
250
250
  ])
251
251
  ], -1)),
252
252
  t("tbody", Ft, [
253
- (a(!0), r(y, null, C(L.value, (e, g) => (a(), r("tr", {
253
+ (n(!0), r(y, null, C(L.value, (e, g) => (n(), r("tr", {
254
254
  key: e.landingPagePlusQueryString,
255
255
  class: "hover:bg-muted/50"
256
256
  }, [
257
- t("td", At, n(g + 1), 1),
258
- t("td", Et, n(e.landingPagePlusQueryString), 1),
259
- t("td", Ut, n(h(e.sessions)), 1),
260
- t("td", jt, n(h(e.totalUsers)), 1),
257
+ t("td", At, a(g + 1), 1),
258
+ t("td", Et, a(e.landingPagePlusQueryString), 1),
259
+ t("td", Ut, a(h(e.sessions)), 1),
260
+ t("td", jt, a(h(e.totalUsers)), 1),
261
261
  t("td", Ht, [
262
262
  t("span", {
263
263
  class: c((e.bounceRate || 0) > 0.6 ? "text-red-500" : (e.bounceRate || 0) < 0.3 ? "text-emerald-600 dark:text-emerald-400" : "")
264
- }, n(w(e.bounceRate || 0)), 3)
264
+ }, a(w(e.bounceRate || 0)), 3)
265
265
  ]),
266
- t("td", It, n(F(e.averageSessionDuration || 0)), 1),
266
+ t("td", It, a(F(e.averageSessionDuration || 0)), 1),
267
267
  t("td", Qt, [
268
268
  t("span", {
269
269
  class: c((e.engagementRate || 0) > 0.6 ? "text-emerald-600 dark:text-emerald-400" : "")
270
- }, n(w(e.engagementRate || 0)), 3)
270
+ }, a(w(e.engagementRate || 0)), 3)
271
271
  ])
272
272
  ]))), 128))
273
273
  ])
274
274
  ])
275
275
  ]),
276
- L.value.length ? m("", !0) : (a(), r("div", qt, "No landing page data"))
276
+ L.value.length ? x("", !0) : (n(), r("div", qt, "No landing page data"))
277
277
  ]),
278
278
  _: 1
279
279
  })
280
280
  ]),
281
281
  _: 1
282
- })) : m("", !0),
283
- p.value === "exit" ? (a(), v(i, { key: 2 }, {
282
+ })) : x("", !0),
283
+ p.value === "exit" ? (n(), v(i, { key: 2 }, {
284
284
  default: l(() => [
285
285
  d(U, { class: "pb-2" }, {
286
286
  default: l(() => [
@@ -308,14 +308,14 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
308
308
  ])
309
309
  ], -1)),
310
310
  t("tbody", Kt, [
311
- (a(!0), r(y, null, C(B.value, (e, g) => (a(), r("tr", {
311
+ (n(!0), r(y, null, C(B.value, (e, g) => (n(), r("tr", {
312
312
  key: e.pagePath,
313
313
  class: "hover:bg-muted/50"
314
314
  }, [
315
- t("td", Gt, n(g + 1), 1),
316
- t("td", Jt, n(e.pagePath), 1),
317
- t("td", Xt, n(h(e.sessions)), 1),
318
- t("td", Yt, n(h(e.screenPageViews)), 1),
315
+ t("td", Gt, a(g + 1), 1),
316
+ t("td", Jt, a(e.pagePath), 1),
317
+ t("td", Xt, a(h(e.sessions)), 1),
318
+ t("td", Yt, a(h(e.screenPageViews)), 1),
319
319
  t("td", Zt, [
320
320
  t("div", te, [
321
321
  t("div", ee, [
@@ -326,21 +326,21 @@ const dt = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ut =
326
326
  ]),
327
327
  t("span", {
328
328
  class: c(["text-xs tabular-nums", (e.exitRate || 0) > 0.7 ? "text-red-500" : ""])
329
- }, n(w(e.exitRate || 0)), 3)
329
+ }, a(w(e.exitRate || 0)), 3)
330
330
  ])
331
331
  ])
332
332
  ]))), 128))
333
333
  ])
334
334
  ])
335
335
  ]),
336
- B.value.length ? m("", !0) : (a(), r("div", se, "No exit page data"))
336
+ B.value.length ? x("", !0) : (n(), r("div", se, "No exit page data"))
337
337
  ]),
338
338
  _: 1
339
339
  })
340
340
  ]),
341
341
  _: 1
342
- })) : m("", !0)
343
- ], 64)) : (a(), v(i, {
342
+ })) : x("", !0)
343
+ ], 64)) : (n(), v(i, {
344
344
  key: 0,
345
345
  class: "p-8 text-center"
346
346
  }, {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),U=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const D=require("@oneclick.dev/cms-kit/charts"),a=require("lucide-vue-next"),c=require("./index-DQYBP8Js.js"),N=require("./index-C4YUVWzJ.js"),Z={class:"flex flex-col gap-4 w-full max-w-7xl mx-auto py-8"},J={class:"flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center"},Q={class:"text-muted-foreground text-sm mt-1"},Y={key:0,class:"flex items-center gap-2"},ee={class:"flex items-center border rounded-lg overflow-hidden"},te=["onClick"],oe={class:"text-sm text-destructive font-medium"},se={key:2,class:"flex items-center justify-center py-20"},ae={class:"flex items-start justify-between"},ne={class:"flex items-center gap-2"},le={class:"text-sm font-medium"},re={class:"grid grid-cols-2 @md:grid-cols-3 @xl:grid-cols-4 gap-4"},ce={class:"flex items-center gap-1.5 text-muted-foreground mb-2"},ie={class:"text-xs font-medium uppercase tracking-wide"},de={class:"text-2xl font-semibold tabular-nums"},ue={key:0,class:"flex items-center gap-1 mt-1"},me={class:"flex flex-col @xl:grid @xl:grid-cols-2 gap-4 max-w-full"},fe={class:"flex flex-col @lg:grid @lg:grid-cols-2 gap-4"},pe={class:"divide-y"},xe={class:"flex items-center gap-3 min-w-0"},ge={class:"text-muted-foreground w-5 text-right shrink-0"},ve={class:"truncate font-mono text-xs"},he={class:"flex items-center gap-4 shrink-0 tabular-nums"},Ve={class:"text-muted-foreground text-xs w-16 text-right"},Ne={class:"text-muted-foreground text-xs w-16 text-right"},_e={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},ye={class:"divide-y"},Ce={class:"flex items-center gap-3 min-w-0"},we={class:"text-muted-foreground w-5 text-right shrink-0"},ke={class:"truncate"},be={class:"flex items-center gap-4 shrink-0 tabular-nums"},Ee={class:"text-muted-foreground text-xs w-20 text-right"},Be={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},De={class:"grid @lg:grid-cols-2 gap-4"},Se={class:"space-y-3"},Te={class:"text-sm capitalize flex-1"},$e={class:"flex-1 h-2 bg-muted rounded-full overflow-hidden"},Pe={class:"text-xs tabular-nums text-muted-foreground w-16 text-right"},Fe={key:0,class:"py-4 text-center text-muted-foreground text-sm"},Ue={class:"space-y-3"},ze={class:"text-sm flex-1"},Re={class:"flex-1 h-2 bg-muted rounded-full overflow-hidden"},Me={class:"text-xs tabular-nums text-muted-foreground w-16 text-right"},Ae={key:0,class:"py-4 text-center text-muted-foreground text-sm"},Le=e.defineComponent({__name:"Overview",setup(qe){const{config:S}=U.useModule(),{moduleId:G}=U.useModuleRoute();U.useModuleBreadcrumbs(()=>[{label:"Overview"}]);const x=e.ref(!0),_=e.ref(null),y=e.ref("30"),h=e.ref([]),r=e.ref({}),I=e.ref({}),i=e.ref({}),z=e.ref(0),T=e.ref([]),$=e.ref([]),C=e.ref([]),w=e.ref([]),k=e.computed(()=>!!(S.serviceAccount&&S.propertyId));function g(s){return`/api/v1/modules/${G}${s}`}const O=[{label:"7 days",value:"7"},{label:"14 days",value:"14"},{label:"30 days",value:"30"},{label:"90 days",value:"90"}],m={sessions:"#3b82f6",users:"#8b5cf6",pageViews:"#10b981"},P={sessions:{label:"Sessions",color:m.sessions},totalUsers:{label:"Users",color:m.users}},F={screenPageViews:{label:"Page Views",color:m.pageViews}},V=(s,t)=>t,R=s=>s.sessions||0,X=s=>s.totalUsers||0,M=s=>s.screenPageViews||0,A=s=>{const t=h.value[Math.round(s)];if(!t)return"";const l=new Date(t.date);return`${l.getDate()}/${l.getMonth()+1}`},L=s=>{const t=h.value[Math.round(Number(s))];return t?new Date(t.date).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"}):""},W=e.computed(()=>[{label:"Sessions",value:d(r.value.sessions||0),icon:a.MousePointerClick,change:i.value.sessions},{label:"Users",value:d(r.value.totalUsers||0),icon:a.Users,change:i.value.totalUsers},{label:"Page Views",value:d(r.value.screenPageViews||0),icon:a.Eye,change:i.value.screenPageViews},{label:"Avg. Duration",value:H(r.value.averageSessionDuration||0),icon:a.Clock,change:i.value.averageSessionDuration},{label:"Engagement",value:`${((r.value.engagementRate||0)*100).toFixed(1)}%`,icon:a.Zap,change:i.value.engagementRate,positive:!0},{label:"Bounce Rate",value:`${((r.value.bounceRate||0)*100).toFixed(1)}%`,icon:(r.value.bounceRate||0)>.5?a.TrendingDown:a.TrendingUp,change:i.value.bounceRate,positive:!1},{label:"New Users",value:d(r.value.newUsers||0),icon:a.UserPlus,change:i.value.newUsers},{label:"Pages / Session",value:(r.value.screenPageViewsPerSession||0).toFixed(1),icon:a.Activity,change:i.value.screenPageViewsPerSession}]);function d(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:Math.round(s).toString()}function H(s){const t=Math.floor(s/60),l=Math.round(s%60);return t>0?`${t}m ${l}s`:`${l}s`}function b(s,t=!0){if(s==null)return{text:"—",cls:"text-muted-foreground",icon:a.Minus};const n=`${Math.abs(s).toFixed(1)}%`,p=s>0;return{text:n,cls:(t?p:!p)?"text-emerald-600 dark:text-emerald-400":"text-red-500 dark:text-red-400",icon:p?a.TrendingUp:a.TrendingDown}}function K(s){const t=s.toLowerCase();return t==="mobile"?a.Smartphone:t==="tablet"?a.Tablet:a.Monitor}async function E(){if(!k.value)return;x.value=!0,_.value=null;const s=`${y.value}daysAgo`;try{const[t,l,n,p,u,f]=await Promise.all([$fetch(g(`/report?startDate=${s}&endDate=today`)),$fetch(g("/realtime")).catch(()=>({activeUsers:0})),$fetch(g(`/top-pages?startDate=${s}&endDate=today&limit=10`)),$fetch(g(`/top-sources?startDate=${s}&endDate=today`)),$fetch(g(`/devices?startDate=${s}&endDate=today`)),$fetch(g(`/countries?startDate=${s}&endDate=today`))]);h.value=t.rows||[],r.value=t.totals||{},I.value=t.previousTotals||{},i.value=t.changes||{},z.value=l.activeUsers||0,T.value=n.rows||[],$.value=p.rows||[],C.value=u.rows||[],w.value=f.rows||[]}catch(t){console.error("Failed to fetch analytics data:",t),_.value=t?.data?.statusMessage||t?.message||"Failed to load analytics data"}finally{x.value=!1}}return e.watch(y,()=>E()),e.onMounted(()=>{k.value?E():x.value=!1}),(s,t)=>{const l=e.resolveComponent("Button"),n=e.resolveComponent("Card"),p=e.resolveComponent("Badge"),u=e.resolveComponent("CardTitle"),f=e.resolveComponent("CardHeader"),q=e.resolveComponent("ChartLegendContent"),j=e.resolveComponent("ChartContainer"),v=e.resolveComponent("CardContent");return e.openBlock(),e.createElementBlock("div",Z,[e.createElementVNode("div",J,[e.createElementVNode("div",null,[t[0]||(t[0]=e.createElementVNode("h1",{class:"text-2xl font-semibold"},"Analytics Overview",-1)),e.createElementVNode("p",Q,"Property "+e.toDisplayString(e.unref(S).propertyId||"—"),1)]),k.value?(e.openBlock(),e.createElementBlock("div",Y,[e.createElementVNode("div",ee,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,o=>e.createElementVNode("button",{key:o.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",y.value===o.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:B=>y.value=o.value},e.toDisplayString(o.label),11,te)),64))]),e.createVNode(l,{variant:"outline",size:"icon",onClick:E,disabled:x.value},{default:e.withCtx(()=>[e.createVNode(e.unref(a.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":x.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),k.value?_.value?(e.openBlock(),e.createBlock(n,{key:1,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",oe,e.toDisplayString(_.value),1),e.createVNode(l,{variant:"outline",size:"sm",class:"mt-3",onClick:E},{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):x.value?(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(e.unref(a.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createVNode(n,{class:"p-4"},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",ne,[t[3]||(t[3]=e.createElementVNode("span",{class:"relative flex h-2.5 w-2.5"},[e.createElementVNode("span",{class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),e.createElementVNode("span",{class:"relative inline-flex rounded-full h-2.5 w-2.5 bg-green-500"})],-1)),e.createElementVNode("span",le,e.toDisplayString(z.value)+" visitors",1),t[4]||(t[4]=e.createElementVNode("span",{class:"text-xs text-muted-foreground translate-y-0.25"},"in the last 30 minutes",-1))]),e.createVNode(p,{variant:"outline",class:"text-xs"},{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode("Live",-1)])]),_:1})])]),_:1}),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,o=>(e.openBlock(),e.createBlock(n,{key:o.label,class:"p-4"},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{class:"size-3.5"})),e.createElementVNode("span",ie,e.toDisplayString(o.label),1)]),e.createElementVNode("p",de,e.toDisplayString(o.value),1),o.change!==void 0?(e.openBlock(),e.createElementBlock("div",ue,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(b(o.change,o.positive!==!1).icon),{class:e.normalizeClass(["size-3",b(o.change,o.positive!==!1).cls])},null,8,["class"])),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-medium",b(o.change,o.positive!==!1).cls])},e.toDisplayString(b(o.change,o.positive!==!1).text),3),t[6]||(t[6]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"vs prev.",-1))])):e.createCommentVNode("",!0)]),_:2},1024))),128))]),e.createElementVNode("div",me,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Sessions & Users",-1)])]),_:1})]),_:1}),e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(j,{config:P,class:"h-[240px] w-full"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.S),{data:h.value,margin:{top:8,right:8,bottom:24,left:40}},{default:e.withCtx(()=>[e.createVNode(e.unref(N.C),{x:V,y:R,color:m.sessions,opacity:.1,curveType:"monotoneX"},null,8,["color"]),e.createVNode(e.unref(N.C$1),{x:V,y:R,color:m.sessions,lineWidth:2,curveType:"monotoneX"},null,8,["color"]),e.createVNode(e.unref(N.C$1),{x:V,y:X,color:m.users,lineWidth:2,curveType:"monotoneX"},null,8,["color"]),e.createVNode(e.unref(c.C),{type:"x",tickFormat:A,numTicks:6}),e.createVNode(e.unref(c.C),{type:"y",numTicks:4}),e.createVNode(e.unref(c.A),{template:e.unref(D.componentToString)(P,e.unref(D.ChartTooltipContent),{labelFormatter:L})},null,8,["template"]),e.createVNode(e.unref(c.z))]),_:1},8,["data"]),e.createVNode(q,{config:P})]),_:1})]),_:1})]),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("Page Views",-1)])]),_:1})]),_:1}),e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(j,{config:F,class:"h-[240px] w-full"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.S),{data:h.value,margin:{top:8,right:8,bottom:24,left:40}},{default:e.withCtx(()=>[e.createVNode(e.unref(N.C),{x:V,y:M,color:m.pageViews,opacity:.15,curveType:"monotoneX"},null,8,["color"]),e.createVNode(e.unref(N.C$1),{x:V,y:M,color:m.pageViews,lineWidth:2,curveType:"monotoneX"},null,8,["color"]),e.createVNode(e.unref(c.C),{type:"x",tickFormat:A,numTicks:6}),e.createVNode(e.unref(c.C),{type:"y",numTicks:4}),e.createVNode(e.unref(c.A),{template:e.unref(D.componentToString)(F,e.unref(D.ChartTooltipContent),{labelFormatter:L})},null,8,["template"]),e.createVNode(e.unref(c.z))]),_:1},8,["data"]),e.createVNode(q,{config:F})]),_:1})]),_:1})]),_:1})]),e.createElementVNode("div",fe,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("Top Pages",-1)])]),_:1})]),_:1}),e.createVNode(v,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(o,B)=>(e.openBlock(),e.createElementBlock("div",{key:o.pagePath,class:"flex items-center justify-between px-6 py-3 text-sm"},[e.createElementVNode("div",xe,[e.createElementVNode("span",ge,e.toDisplayString(B+1),1),e.createElementVNode("span",ve,e.toDisplayString(o.pagePath),1)]),e.createElementVNode("div",he,[e.createElementVNode("span",Ve,e.toDisplayString(d(o.screenPageViews))+" views",1),e.createElementVNode("span",Ne,e.toDisplayString(d(o.totalUsers))+" users",1)])]))),128)),T.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_e,"No data available"))])]),_:1})]),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("Traffic Sources",-1)])]),_:1})]),_:1}),e.createVNode(v,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,B)=>(e.openBlock(),e.createElementBlock("div",{key:o.sessionSource,class:"flex items-center justify-between px-6 py-3 text-sm"},[e.createElementVNode("div",Ce,[e.createElementVNode("span",we,e.toDisplayString(B+1),1),e.createVNode(e.unref(a.ArrowUpRight),{class:"size-3.5 text-muted-foreground shrink-0"}),e.createElementVNode("span",ke,e.toDisplayString(o.sessionSource||"(direct)"),1)]),e.createElementVNode("div",be,[e.createElementVNode("span",Ee,e.toDisplayString(d(o.sessions))+" sessions",1)])]))),128)),$.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Be,"No data available"))])]),_:1})]),_:1})]),e.createElementVNode("div",De,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode("Devices",-1)])]),_:1})]),_:1}),e.createVNode(v,null,{default:e.withCtx(()=>[e.createElementVNode("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.deviceCategory,class:"flex items-center gap-3"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(K(o.deviceCategory)),{class:"size-4 text-muted-foreground shrink-0"})),e.createElementVNode("span",Te,e.toDisplayString(o.deviceCategory),1),e.createElementVNode("div",$e,[e.createElementVNode("div",{class:"h-full bg-primary rounded-full transition-all",style:e.normalizeStyle({width:`${o.sessions/(C.value[0]?.sessions||1)*100}%`})},null,4)]),e.createElementVNode("span",Pe,e.toDisplayString(d(o.sessions)),1)]))),128)),C.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fe,"No data available"))])]),_:1})]),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(f,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(u,{class:"text-base"},{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Top Countries",-1)])]),_:1})]),_:1}),e.createVNode(v,null,{default:e.withCtx(()=>[e.createElementVNode("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,o=>(e.openBlock(),e.createElementBlock("div",{key:o.country,class:"flex items-center gap-3"},[e.createVNode(e.unref(a.Globe),{class:"size-4 text-muted-foreground shrink-0"}),e.createElementVNode("span",ze,e.toDisplayString(o.country),1),e.createElementVNode("div",Re,[e.createElementVNode("div",{class:"h-full bg-primary rounded-full transition-all",style:e.normalizeStyle({width:`${o.sessions/(w.value[0]?.sessions||1)*100}%`})},null,4)]),e.createElementVNode("span",Me,e.toDisplayString(d(o.sessions)),1)]))),128)),w.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ae,"No data available"))])]),_:1})]),_:1})])],64)):(e.openBlock(),e.createBlock(n,{key:0,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createElementVNode("div",{class:"mx-auto max-w-md space-y-3"},[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required"),e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"Connect a Google Service Account and enter your GA4 Property ID in the module settings to start seeing analytics.")],-1)])]),_:1}))])}}});exports.default=Le;
@@ -1,26 +1,26 @@
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";
1
+ import { defineComponent as _e, ref as f, 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
4
  import { componentToString as oe, ChartTooltipContent as ae } from "@oneclick.dev/cms-kit/charts";
5
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
- const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je = { class: "flex items-center justify-between" }, Ge = { class: "text-muted-foreground text-sm mt-1" }, Ie = {
8
+ const Le = { class: "flex flex-col gap-4 w-full max-w-7xl mx-auto py-8" }, je = { class: "flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center" }, Ge = { class: "text-muted-foreground text-sm mt-1" }, Ie = {
9
9
  key: 0,
10
10
  class: "flex items-center gap-2"
11
11
  }, Xe = { class: "flex items-center border rounded-lg overflow-hidden" }, Ee = ["onClick"], Oe = { class: "text-sm text-destructive font-medium" }, We = {
12
12
  key: 2,
13
13
  class: "flex items-center justify-center py-20"
14
- }, He = { class: "flex items-start justify-between" }, qe = { class: "flex items-center gap-2" }, Ke = { class: "text-sm font-medium" }, Ze = { class: "grid grid-cols-2 @sm:grid-cols-4 gap-4" }, Je = { class: "flex items-center gap-1.5 text-muted-foreground mb-2" }, Qe = { class: "text-xs font-medium uppercase tracking-wide" }, Ye = { class: "text-2xl font-semibold tabular-nums" }, et = {
14
+ }, He = { class: "flex items-start justify-between" }, qe = { class: "flex items-center gap-2" }, Ke = { class: "text-sm font-medium" }, Ze = { class: "grid grid-cols-2 @md:grid-cols-3 @xl:grid-cols-4 gap-4" }, Je = { class: "flex items-center gap-1.5 text-muted-foreground mb-2" }, Qe = { class: "text-xs font-medium uppercase tracking-wide" }, Ye = { class: "text-2xl font-semibold tabular-nums" }, et = {
15
15
  key: 0,
16
16
  class: "flex items-center gap-1 mt-1"
17
- }, tt = { class: "grid @lg:grid-cols-2 gap-6" }, st = { class: "grid @lg:grid-cols-2 gap-6" }, ot = { class: "divide-y" }, at = { class: "flex items-center gap-3 min-w-0" }, lt = { class: "text-muted-foreground w-5 text-right shrink-0" }, nt = { class: "truncate font-mono text-xs" }, rt = { class: "flex items-center gap-4 shrink-0 tabular-nums" }, it = { class: "text-muted-foreground text-xs w-16 text-right" }, ut = { class: "text-muted-foreground text-xs w-16 text-right" }, ct = {
17
+ }, tt = { class: "flex flex-col @xl:grid @xl:grid-cols-2 gap-4 max-w-full" }, st = { class: "flex flex-col @lg:grid @lg:grid-cols-2 gap-4" }, ot = { class: "divide-y" }, at = { class: "flex items-center gap-3 min-w-0" }, lt = { class: "text-muted-foreground w-5 text-right shrink-0" }, nt = { class: "truncate font-mono text-xs" }, rt = { class: "flex items-center gap-4 shrink-0 tabular-nums" }, it = { class: "text-muted-foreground text-xs w-16 text-right" }, ut = { class: "text-muted-foreground text-xs w-16 text-right" }, ct = {
18
18
  key: 0,
19
19
  class: "px-6 py-8 text-center text-muted-foreground text-sm"
20
- }, dt = { class: "divide-y" }, mt = { class: "flex items-center gap-3 min-w-0" }, ft = { class: "text-muted-foreground w-5 text-right shrink-0" }, vt = { class: "truncate" }, pt = { class: "flex items-center gap-4 shrink-0 tabular-nums" }, gt = { class: "text-muted-foreground text-xs w-20 text-right" }, xt = {
20
+ }, dt = { class: "divide-y" }, ft = { class: "flex items-center gap-3 min-w-0" }, mt = { class: "text-muted-foreground w-5 text-right shrink-0" }, vt = { class: "truncate" }, pt = { class: "flex items-center gap-4 shrink-0 tabular-nums" }, gt = { class: "text-muted-foreground text-xs w-20 text-right" }, xt = {
21
21
  key: 0,
22
22
  class: "px-6 py-8 text-center text-muted-foreground text-sm"
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 = {
23
+ }, _t = { class: "grid @lg:grid-cols-2 gap-4" }, 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
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 = {
@@ -31,11 +31,11 @@ const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je =
31
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"), 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));
34
+ const C = f(!0), V = f(null), R = f("30"), S = f([]), m = f({}), fe = f({}), v = f({}), q = f(0), I = f([]), X = f([]), M = f([]), F = f([]), A = te(() => !!(G.serviceAccount && G.propertyId));
35
35
  function k(a) {
36
36
  return `/api/v1/modules/${de}${a}`;
37
37
  }
38
- const fe = [
38
+ const me = [
39
39
  { label: "7 days", value: "7" },
40
40
  { label: "14 days", value: "14" },
41
41
  { label: "30 days", value: "30" },
@@ -60,51 +60,51 @@ const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je =
60
60
  }, pe = te(() => [
61
61
  {
62
62
  label: "Sessions",
63
- value: p(f.value.sessions || 0),
63
+ value: p(m.value.sessions || 0),
64
64
  icon: ke,
65
65
  change: v.value.sessions
66
66
  },
67
67
  {
68
68
  label: "Users",
69
- value: p(f.value.totalUsers || 0),
69
+ value: p(m.value.totalUsers || 0),
70
70
  icon: $e,
71
71
  change: v.value.totalUsers
72
72
  },
73
73
  {
74
74
  label: "Page Views",
75
- value: p(f.value.screenPageViews || 0),
75
+ value: p(m.value.screenPageViews || 0),
76
76
  icon: De,
77
77
  change: v.value.screenPageViews
78
78
  },
79
79
  {
80
80
  label: "Avg. Duration",
81
- value: ge(f.value.averageSessionDuration || 0),
81
+ value: ge(m.value.averageSessionDuration || 0),
82
82
  icon: Te,
83
83
  change: v.value.averageSessionDuration
84
84
  },
85
85
  {
86
86
  label: "Engagement",
87
- value: `${((f.value.engagementRate || 0) * 100).toFixed(1)}%`,
87
+ value: `${((m.value.engagementRate || 0) * 100).toFixed(1)}%`,
88
88
  icon: Pe,
89
89
  change: v.value.engagementRate,
90
90
  positive: !0
91
91
  },
92
92
  {
93
93
  label: "Bounce Rate",
94
- value: `${((f.value.bounceRate || 0) * 100).toFixed(1)}%`,
95
- icon: (f.value.bounceRate || 0) > 0.5 ? le : ne,
94
+ value: `${((m.value.bounceRate || 0) * 100).toFixed(1)}%`,
95
+ icon: (m.value.bounceRate || 0) > 0.5 ? le : ne,
96
96
  change: v.value.bounceRate,
97
97
  positive: !1
98
98
  },
99
99
  {
100
100
  label: "New Users",
101
- value: p(f.value.newUsers || 0),
101
+ value: p(m.value.newUsers || 0),
102
102
  icon: Se,
103
103
  change: v.value.newUsers
104
104
  },
105
105
  {
106
106
  label: "Pages / Session",
107
- value: (f.value.screenPageViewsPerSession || 0).toFixed(1),
107
+ value: (m.value.screenPageViewsPerSession || 0).toFixed(1),
108
108
  icon: Ue,
109
109
  change: v.value.screenPageViewsPerSession
110
110
  }
@@ -143,7 +143,7 @@ const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je =
143
143
  $fetch(k(`/devices?startDate=${a}&endDate=today`)),
144
144
  $fetch(k(`/countries?startDate=${a}&endDate=today`))
145
145
  ]);
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 || [];
146
+ S.value = e.rows || [], m.value = e.totals || {}, fe.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 {
@@ -162,7 +162,7 @@ const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je =
162
162
  ]),
163
163
  A.value ? (n(), i("div", Ie, [
164
164
  s("div", Xe, [
165
- (n(), i(w, null, D(fe, (o) => s("button", {
165
+ (n(), i(w, null, D(me, (o) => s("button", {
166
166
  key: o.value,
167
167
  class: L(["px-3 py-1.5 text-xs font-medium transition-colors", R.value === o.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
168
168
  onClick: (B) => R.value = o.value
@@ -450,8 +450,8 @@ const Le = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, je =
450
450
  key: o.sessionSource,
451
451
  class: "flex items-center justify-between px-6 py-3 text-sm"
452
452
  }, [
453
- s("div", mt, [
454
- s("span", ft, u(B + 1), 1),
453
+ s("div", ft, [
454
+ s("span", mt, u(B + 1), 1),
455
455
  t(r(Me), { class: "size-3.5 text-muted-foreground shrink-0" }),
456
456
  s("span", vt, u(o.sessionSource || "(direct)"), 1)
457
457
  ]),