@oneclick.dev/cms-core-modules 0.0.100 → 0.0.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Acquisition-D_Qx7XRY.mjs → Acquisition-BJXNY4ko.mjs} +1 -1
- package/dist/Acquisition-DPScJD4t.js +1 -0
- package/dist/{Audience-BdlrWkY-.mjs → Audience-CIzVtUvV.mjs} +2 -2
- package/dist/Audience-Csw1QLmw.js +1 -0
- package/dist/{Content-DW6xvbUo.mjs → Content-CWhjurn_.mjs} +1 -1
- package/dist/Content-dYr7kYT0.js +1 -0
- package/dist/{Overview-gJSvftdE.mjs → Overview-CGo4jaaA.mjs} +1 -1
- package/dist/Overview-DBu86Ikb.js +1 -0
- package/dist/SendPush-COns44j7.js +1 -0
- package/dist/SendPush-CPIOjVX4.mjs +184 -0
- package/dist/SeoHealth-DVFDz3em.mjs +615 -0
- package/dist/SeoHealth-DzftZW1m.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/index-CJQQBRLY.js +1 -0
- package/dist/{index-D7JBu6iT.mjs → index-CZn2nDLv.mjs} +6 -6
- package/dist/index-CsVeM3PA.mjs +24 -0
- package/dist/index-DjWuIBxh.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +99 -78
- package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +10 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +5 -0
- package/dist/src/googleAnalytics/components/seo-health/utils.d.ts +6 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +28 -0
- package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +28 -0
- package/dist/src/push-notifications/components/PushPreview.vue.d.ts +28 -0
- package/dist/src/push-notifications/config.d.ts +13 -0
- package/dist/src/push-notifications/index.d.ts +25 -0
- package/dist/src/push-notifications/index.vue.d.ts +22 -0
- package/dist/src/push-notifications/metadata.d.ts +2 -0
- package/dist/src/push-notifications/pages/SendPush.vue.d.ts +14 -0
- package/dist/src/push-notifications/permissions.d.ts +5 -0
- package/dist/src/push-notifications/routes.d.ts +5 -0
- package/dist/src/push-notifications/tools.d.ts +1 -0
- package/dist/src/push-notifications/types.d.ts +0 -0
- package/package.json +2 -2
- package/src/push-notifications/tools.ts +24 -0
- package/dist/Acquisition-_-cq972V.js +0 -1
- package/dist/Audience-QnFQs93n.js +0 -1
- package/dist/Content-C-4Cdniz.js +0 -1
- package/dist/Overview-Da0XexiT.js +0 -1
- package/dist/SeoHealth-Bc5chnaa.mjs +0 -523
- package/dist/SeoHealth-BkpJ1F2Y.js +0 -1
- package/dist/index-DwHYfZl_.js +0 -1
|
@@ -3,7 +3,7 @@ import { useModule as ee, useModuleRoute as te, useModuleBreadcrumbs as se } fro
|
|
|
3
3
|
import "./index-CMk3uhUt.mjs";
|
|
4
4
|
import { RefreshCw as oe, Loader2 as ne, Share2 as ae, ExternalLink as T, Megaphone as V } from "lucide-vue-next";
|
|
5
5
|
import { b as le, E as re } from "./index-DjDCYQ_6.mjs";
|
|
6
|
-
const ie = { class: "w-full max-w-7xl mx-auto py-8
|
|
6
|
+
const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue = { class: "flex items-center justify-between" }, de = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "flex items-center gap-2"
|
|
9
9
|
}, ce = { class: "flex items-center border rounded-lg overflow-hidden" }, me = ["onClick"], fe = { class: "text-sm text-destructive font-medium" }, xe = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const d=require("lucide-vue-next"),B=require("./index-D3L8WAJI.js"),q={class:"flex flex-col gap-6 w-full max-w-7xl mx-auto py-8"},L={class:"flex items-center justify-between"},U={key:0,class:"flex items-center gap-2"},F={class:"flex items-center border rounded-lg overflow-hidden"},A=["onClick"],G={class:"text-sm text-destructive font-medium"},T={key:2,class:"flex items-center justify-center py-20"},j={class:"grid @lg:grid-cols-3 gap-6"},O={class:"relative"},P={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},H={class:"text-center"},I={class:"text-2xl font-bold tabular-nums"},K={class:"mt-4 grid grid-cols-2 gap-x-4 gap-y-1.5 w-full"},W={class:"text-xs truncate"},J={class:"text-xs text-muted-foreground ml-auto tabular-nums"},Q={class:"overflow-x-auto"},X={class:"w-full text-sm"},Y={class:"divide-y"},Z={class:"px-6 py-3"},ee={class:"flex items-center gap-2"},te={class:"font-medium"},oe={class:"px-4 py-3 text-right tabular-nums"},se={class:"px-4 py-3 text-right tabular-nums"},ne={class:"px-4 py-3 text-right tabular-nums"},ae={class:"px-4 py-3 text-right tabular-nums"},re={class:"px-4 py-3 text-right tabular-nums"},le={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},ce={class:"flex items-center gap-4"},ie=["onClick"],de={key:0,class:"divide-y"},ue={class:"overflow-x-auto"},me={class:"w-full text-sm"},pe={class:"divide-y"},xe={class:"px-6 py-3 text-muted-foreground"},fe={class:"px-4 py-3 font-mono text-xs"},ge={class:"px-4 py-3 text-right tabular-nums"},he={class:"px-4 py-3 text-right tabular-nums"},_e={class:"px-4 py-3 text-right tabular-nums"},ye={class:"px-4 py-3 text-right tabular-nums"},ve={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},Ne={key:1,class:"divide-y"},Ve={class:"flex items-center gap-3 min-w-0"},ke={class:"text-muted-foreground w-5 text-right shrink-0"},Ee={class:"truncate font-medium"},Ce={class:"flex items-center gap-6 shrink-0 tabular-nums text-xs text-muted-foreground"},be={class:"w-20 text-right"},Be={class:"w-16 text-right"},we={class:"w-16 text-right"},De={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},Se={key:2,class:"divide-y"},Me={class:"flex items-center gap-3 min-w-0"},$e={class:"text-muted-foreground w-5 text-right shrink-0"},Re={class:"truncate font-medium"},ze={class:"flex items-center gap-6 shrink-0 tabular-nums text-xs text-muted-foreground"},qe={class:"w-20 text-right"},Le={class:"w-16 text-right"},Ue={class:"w-16 text-right"},Fe={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},Ae=e.defineComponent({__name:"Acquisition",setup(Ge){const{config:b}=C.useModule(),{moduleId:w}=C.useModuleRoute();C.useModuleBreadcrumbs(()=>[{label:"Acquisition"}]);const u=e.ref(!0),p=e.ref(null),x=e.ref("30"),m=e.ref("sources"),i=e.ref([]),v=e.ref([]),N=e.ref([]),V=e.ref([]),f=e.computed(()=>!!(b.serviceAccount&&b.propertyId));function g(s){return`/api/v1/modules/${w}${s}`}const D=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}],c=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#06b6d4","#ec4899","#84cc16","#f97316","#6366f1","#14b8a6","#e11d48","#a855f7","#22c55e","#eab308"],S=e.computed(()=>{const s={};return i.value.forEach((o,r)=>{const l=(o.sessionDefaultChannelGroup||"other").toLowerCase().replace(/[^a-z0-9]/g,"_");s[l]={label:o.sessionDefaultChannelGroup||"Other",color:c[r%c.length]}}),s}),M=e.computed(()=>i.value.map((s,o)=>({key:(s.sessionDefaultChannelGroup||"other").toLowerCase().replace(/[^a-z0-9]/g,"_"),label:s.sessionDefaultChannelGroup||"Other",sessions:s.sessions||0,fill:c[o%c.length]}))),$=e.computed(()=>i.value.reduce((s,o)=>s+(o.sessions||0),0));function n(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${(s/1e3).toFixed(1)}K`:Math.round(s).toString()}function h(s){return`${(s*100).toFixed(1)}%`}function R(s){const o=Math.floor(s/60),r=Math.round(s%60);return o>0?`${o}m ${r}s`:`${r}s`}async function _(){if(!f.value)return;u.value=!0,p.value=null;const s=`${x.value}daysAgo`;try{const[o,r,l,y]=await Promise.all([$fetch(g(`/acquisition/channels?startDate=${s}&endDate=today`)),$fetch(g(`/acquisition/source-medium?startDate=${s}&endDate=today`)),$fetch(g(`/acquisition/referrals?startDate=${s}&endDate=today`)).catch(()=>({rows:[]})),$fetch(g(`/acquisition/campaigns?startDate=${s}&endDate=today`)).catch(()=>({rows:[]}))]);i.value=o.rows||[],v.value=r.rows||[],N.value=l.rows||[],V.value=y.rows||[]}catch(o){p.value=o?.data?.statusMessage||o?.message||"Failed to load acquisition data"}finally{u.value=!1}}return e.watch(x,()=>_()),e.onMounted(()=>{f.value?_():u.value=!1}),(s,o)=>{const r=e.resolveComponent("Button"),l=e.resolveComponent("Card"),y=e.resolveComponent("CardTitle"),k=e.resolveComponent("CardHeader"),z=e.resolveComponent("ChartContainer"),E=e.resolveComponent("CardContent");return e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",L,[o[0]||(o[0]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"Acquisition"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Where your traffic comes from")],-1)),f.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",F,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(D,t=>e.createElementVNode("button",{key:t.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",x.value===t.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:a=>x.value=t.value},e.toDisplayString(t.label),11,A)),64))]),e.createVNode(r,{variant:"outline",size:"icon",onClick:_,disabled:u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(d.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":u.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),f.value?p.value?(e.openBlock(),e.createBlock(l,{key:1,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",G,e.toDisplayString(p.value),1),e.createVNode(r,{variant:"outline",size:"sm",class:"mt-3",onClick:_},{default:e.withCtx(()=>[...o[2]||(o[2]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):u.value?(e.openBlock(),e.createElementBlock("div",T,[e.createVNode(e.unref(d.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",j,[e.createVNode(l,{class:"@lg:col-span-1"},{default:e.withCtx(()=>[e.createVNode(k,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(y,{class:"text-base"},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("Channel Mix",-1)])]),_:1})]),_:1}),e.createVNode(E,{class:"flex flex-col items-center"},{default:e.withCtx(()=>[e.createElementVNode("div",O,[e.createVNode(z,{config:S.value,class:"mx-auto aspect-square max-h-[220px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.b),{data:M.value,margin:{top:20,bottom:20,left:20,right:20}},{default:e.withCtx(()=>[e.createVNode(e.unref(B.E),{value:t=>t.sessions,color:t=>t.fill,arcWidth:40,padAngle:.02,cornerRadius:4},null,8,["value","color"])]),_:1},8,["data"])]),_:1},8,["config"]),e.createElementVNode("div",P,[e.createElementVNode("div",H,[e.createElementVNode("p",I,e.toDisplayString(n($.value)),1),o[4]||(o[4]=e.createElementVNode("p",{class:"text-xs text-muted-foreground"},"sessions",-1))])])]),e.createElementVNode("div",K,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.slice(0,8),(t,a)=>(e.openBlock(),e.createElementBlock("div",{key:t.sessionDefaultChannelGroup,class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"size-2.5 rounded-full shrink-0",style:e.normalizeStyle({backgroundColor:c[a%c.length]})},null,4),e.createElementVNode("span",W,e.toDisplayString(t.sessionDefaultChannelGroup),1),e.createElementVNode("span",J,e.toDisplayString(n(t.sessions)),1)]))),128))])]),_:1})]),_:1}),e.createVNode(l,{class:"@lg:col-span-2"},{default:e.withCtx(()=>[e.createVNode(k,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(y,{class:"text-base"},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("Channels Performance",-1)])]),_:1})]),_:1}),e.createVNode(E,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createElementVNode("table",X,[o[6]||(o[6]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-6 py-3 font-medium text-muted-foreground"},"Channel"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Sessions"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"New Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Engage Rate"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Avg Duration")])],-1)),e.createElementVNode("tbody",Y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(t,a)=>(e.openBlock(),e.createElementBlock("tr",{key:t.sessionDefaultChannelGroup,class:"hover:bg-muted/50"},[e.createElementVNode("td",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",{class:"size-2.5 rounded-full shrink-0",style:e.normalizeStyle({backgroundColor:c[a%c.length]})},null,4),e.createElementVNode("span",te,e.toDisplayString(t.sessionDefaultChannelGroup),1)])]),e.createElementVNode("td",oe,e.toDisplayString(n(t.sessions)),1),e.createElementVNode("td",se,e.toDisplayString(n(t.totalUsers)),1),e.createElementVNode("td",ne,e.toDisplayString(n(t.newUsers)),1),e.createElementVNode("td",ae,e.toDisplayString(h(t.engagementRate||0)),1),e.createElementVNode("td",re,e.toDisplayString(R(t.averageSessionDuration||0)),1)]))),128))])])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",le,"No channel data available"))]),_:1})]),_:1})]),e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(k,{class:"pb-0"},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([{key:"sources",label:"Source / Medium",icon:e.unref(d.Share2)},{key:"referrals",label:"Referrals",icon:e.unref(d.ExternalLink)},{key:"campaigns",label:"Campaigns",icon:e.unref(d.Megaphone)}],t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-md transition-colors",m.value===t.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"]),onClick:a=>m.value=t.key},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{class:"size-3.5"})),e.createTextVNode(" "+e.toDisplayString(t.label),1)],10,ie))),128))])]),_:1}),e.createVNode(E,{class:"p-0 mt-4"},{default:e.withCtx(()=>[m.value==="sources"?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("div",ue,[e.createElementVNode("table",me,[o[7]||(o[7]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-6 py-3 font-medium text-muted-foreground"},"#"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground"},"Source / Medium"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Sessions"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"New Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Bounce Rate")])],-1)),e.createElementVNode("tbody",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(t,a)=>(e.openBlock(),e.createElementBlock("tr",{key:t.sessionSourceMedium,class:"hover:bg-muted/50"},[e.createElementVNode("td",xe,e.toDisplayString(a+1),1),e.createElementVNode("td",fe,e.toDisplayString(t.sessionSourceMedium),1),e.createElementVNode("td",ge,e.toDisplayString(n(t.sessions)),1),e.createElementVNode("td",he,e.toDisplayString(n(t.totalUsers)),1),e.createElementVNode("td",_e,e.toDisplayString(n(t.newUsers)),1),e.createElementVNode("td",ye,e.toDisplayString(h(t.bounceRate||0)),1)]))),128))])])]),v.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ve,"No data available"))])):e.createCommentVNode("",!0),m.value==="referrals"?(e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(t,a)=>(e.openBlock(),e.createElementBlock("div",{key:t.sessionSource,class:"flex items-center justify-between px-6 py-3 text-sm hover:bg-muted/50"},[e.createElementVNode("div",Ve,[e.createElementVNode("span",ke,e.toDisplayString(a+1),1),e.createVNode(e.unref(d.ExternalLink),{class:"size-3.5 text-muted-foreground shrink-0"}),e.createElementVNode("span",Ee,e.toDisplayString(t.sessionSource),1)]),e.createElementVNode("div",Ce,[e.createElementVNode("span",be,e.toDisplayString(n(t.sessions))+" sessions",1),e.createElementVNode("span",Be,e.toDisplayString(n(t.totalUsers))+" users",1),e.createElementVNode("span",we,e.toDisplayString(h(t.engagementRate||0))+" eng.",1)])]))),128)),N.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,"No referral data available"))])):e.createCommentVNode("",!0),m.value==="campaigns"?(e.openBlock(),e.createElementBlock("div",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(t,a)=>(e.openBlock(),e.createElementBlock("div",{key:t.sessionCampaignName,class:"flex items-center justify-between px-6 py-3 text-sm hover:bg-muted/50"},[e.createElementVNode("div",Me,[e.createElementVNode("span",$e,e.toDisplayString(a+1),1),e.createVNode(e.unref(d.Megaphone),{class:"size-3.5 text-muted-foreground shrink-0"}),e.createElementVNode("span",Re,e.toDisplayString(t.sessionCampaignName),1)]),e.createElementVNode("div",ze,[e.createElementVNode("span",qe,e.toDisplayString(n(t.sessions))+" sessions",1),e.createElementVNode("span",Le,e.toDisplayString(n(t.totalUsers))+" users",1),e.createElementVNode("span",Ue,e.toDisplayString(h(t.engagementRate||0))+" eng.",1)])]))),128)),V.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Fe,"No campaign data. Use UTM parameters in your URLs to track campaigns."))])):e.createCommentVNode("",!0)]),_:1})]),_:1})],64)):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-2"},"Configure your GA4 property in module settings.",-1)])]),_:1}))])}}});exports.default=Ae;
|
|
@@ -4,7 +4,7 @@ import "./index-CMk3uhUt.mjs";
|
|
|
4
4
|
import { RefreshCw as ce, Loader2 as me, UserPlus as fe, UserCheck as ge, Clock as xe, Chrome as ve, Cpu as _e, Monitor as pe, Languages as be, MapPin as he } from "lucide-vue-next";
|
|
5
5
|
import { b as ye, E as ke } from "./index-DjDCYQ_6.mjs";
|
|
6
6
|
import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
7
|
-
const Ce = { class: "w-full max-w-7xl mx-auto py-8
|
|
7
|
+
const Ce = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, $e = { class: "flex items-center justify-between" }, Re = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "flex items-center gap-2"
|
|
10
10
|
}, De = { class: "flex items-center border rounded-lg overflow-hidden" }, Ue = ["onClick"], ze = { class: "text-sm text-destructive font-medium" }, Me = {
|
|
@@ -483,7 +483,7 @@ const Ce = { class: "w-full max-w-7xl mx-auto py-8 px-4 space-y-6" }, $e = { cla
|
|
|
483
483
|
]);
|
|
484
484
|
};
|
|
485
485
|
}
|
|
486
|
-
}), Bt = /* @__PURE__ */ we(Ut, [["__scopeId", "data-v-
|
|
486
|
+
}), Bt = /* @__PURE__ */ we(Ut, [["__scopeId", "data-v-4c7905b1"]]);
|
|
487
487
|
export {
|
|
488
488
|
Bt as default
|
|
489
489
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),D=require("@oneclick.dev/cms-kit");require("./index-BuzLn4Km.js");const r=require("lucide-vue-next"),z=require("./index-D3L8WAJI.js"),H=require("./_plugin-vue_export-helper-BHFhmbuH.js"),I={class:"flex flex-col gap-6 w-full max-w-7xl mx-auto py-8"},K={class:"flex items-center justify-between"},G={key:0,class:"flex items-center gap-2"},J={class:"flex items-center border rounded-lg overflow-hidden"},Q=["onClick"],X={class:"text-sm text-destructive font-medium"},Y={key:2,class:"flex items-center justify-center py-20"},Z={class:"grid @lg:grid-cols-3 gap-6"},ee={class:"relative"},te={class:"absolute inset-0 flex items-center justify-center pointer-events-none"},se={class:"text-center"},oe={class:"text-xl font-bold tabular-nums"},ne={class:"mt-4 flex items-center gap-6"},le={class:"flex items-center gap-2"},ae={class:"text-sm font-semibold tabular-nums"},re={key:0,class:"text-xs text-muted-foreground"},de={class:"flex items-center gap-2"},ce={class:"text-sm font-semibold tabular-nums"},ie={key:0,class:"text-xs text-muted-foreground"},ue={class:"overflow-x-auto"},me={class:"w-full text-sm"},xe={class:"divide-y"},fe={class:"px-4 py-3"},ge={class:"flex items-center gap-2"},pe={class:"font-medium capitalize"},ve={class:"px-4 py-3 text-right tabular-nums"},he={class:"px-4 py-3 text-right tabular-nums"},Ve={class:"px-4 py-3 text-right tabular-nums"},_e={class:"px-4 py-3 text-right tabular-nums"},Ne={class:"px-4 py-3 text-right tabular-nums"},ye={class:"overflow-x-auto"},be={class:"min-w-[600px]"},Ee={class:"flex items-center mb-1.5"},ke={class:"flex-1 grid grid-cols-24 gap-0.5"},Ce={class:"w-10 shrink-0 text-xs text-muted-foreground"},we={class:"flex-1 grid grid-cols-24 gap-0.5"},Be=["title"],De={class:"grid @lg:grid-cols-3 gap-6"},Se={class:"flex items-center justify-between"},$e={class:"flex items-center gap-1"},ze=["onClick","title"],Re={class:"space-y-3"},Ue={class:"text-sm flex-1 truncate"},Te={class:"flex-1 h-2 bg-muted rounded-full overflow-hidden"},Fe={class:"text-xs tabular-nums text-muted-foreground w-12 text-right"},Me={key:0,class:"py-4 text-center text-muted-foreground text-sm"},Le={class:"space-y-3"},Ae={class:"text-sm flex-1 truncate"},qe={class:"flex-1 h-2 bg-muted rounded-full overflow-hidden"},Pe={class:"text-xs tabular-nums text-muted-foreground w-12 text-right"},Oe={key:0,class:"py-4 text-center text-muted-foreground text-sm"},je={class:"space-y-2.5"},We={class:"flex-1 min-w-0"},He={class:"text-sm truncate block"},Ie={class:"text-xs text-muted-foreground truncate block"},Ke={class:"flex-1 h-2 bg-muted rounded-full overflow-hidden"},Ge={class:"text-xs tabular-nums text-muted-foreground w-12 text-right"},Je={key:0,class:"py-4 text-center text-muted-foreground text-sm"},Qe=e.defineComponent({__name:"Audience",setup(Ye){const{config:S}=D.useModule(),{moduleId:R}=D.useModuleRoute();D.useModuleBreadcrumbs(()=>[{label:"Audience"}]);const u=e.ref(!0),h=e.ref(null),g=e.ref("30"),i=e.ref("browser"),V=e.ref([]),p=e.ref([]),_=e.ref([]),$=e.ref([]),N=e.ref([]),y=e.computed(()=>!!(S.serviceAccount&&S.propertyId));function m(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"}];function d(o){return o>=1e6?`${(o/1e6).toFixed(1)}M`:o>=1e3?`${(o/1e3).toFixed(1)}K`:Math.round(o).toString()}function T(o){return`${(o*100).toFixed(1)}%`}function F(o){const t=Math.floor(o/60),n=Math.round(o%60);return t>0?`${t}m ${n}s`:`${n}s`}const x={new:"#3b82f6",returning:"#8b5cf6"},M={new:{label:"New Users",color:x.new},returning:{label:"Returning Users",color:x.returning}},b=e.computed(()=>V.value.find(t=>t.newVsReturning==="new")?.totalUsers||0),E=e.computed(()=>V.value.find(t=>t.newVsReturning==="returning")?.totalUsers||0),L=e.computed(()=>[{key:"new",label:"New",value:b.value,fill:x.new},{key:"returning",label:"Returning",value:E.value,fill:x.returning}]),v=e.computed(()=>b.value+E.value),A=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],q=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],B=e.computed(()=>{const o=Array.from({length:7},()=>Array(24).fill(0));let t=1;return $.value.forEach(n=>{const l=A.indexOf(n.dayOfWeekName),a=parseInt(n.hour,10);l>=0&&a>=0&&a<24&&(o[l][a]=n.sessions||0,n.sessions>t&&(t=n.sessions))}),{matrix:o,maxVal:t}});function P(o,t){if(o===0)return"bg-muted";const n=o/t;return n>.75?"bg-blue-600 dark:bg-blue-500":n>.5?"bg-blue-500 dark:bg-blue-400":n>.25?"bg-blue-400/70 dark:bg-blue-400/60":"bg-blue-300/50 dark:bg-blue-300/30"}const O=[{key:"browser",label:"Browser",icon:r.Chrome},{key:"operatingSystem",label:"OS",icon:r.Cpu},{key:"screenResolution",label:"Screen",icon:r.Monitor}];async function k(){if(!y.value)return;u.value=!0,h.value=null;const o=`${g.value}daysAgo`;try{const[t,n,l,a,c]=await Promise.all([$fetch(m(`/audience/overview?startDate=${o}&endDate=today`)),$fetch(m(`/audience/technology?startDate=${o}&endDate=today&dimension=${i.value}`)),$fetch(m(`/audience/languages?startDate=${o}&endDate=today`)),$fetch(m(`/audience/hours?startDate=${o}&endDate=today`)),$fetch(m(`/audience/cities?startDate=${o}&endDate=today`))]);V.value=t.rows||[],p.value=n.rows||[],_.value=l.rows||[],$.value=a.rows||[],N.value=c.rows||[]}catch(t){h.value=t?.data?.statusMessage||t?.message||"Failed to load audience data"}finally{u.value=!1}}async function j(){const o=`${g.value}daysAgo`;try{const t=await $fetch(m(`/audience/technology?startDate=${o}&endDate=today&dimension=${i.value}`));p.value=t.rows||[]}catch{}}return e.watch(g,()=>k()),e.watch(i,()=>j()),e.onMounted(()=>{y.value?k():u.value=!1}),(o,t)=>{const n=e.resolveComponent("Button"),l=e.resolveComponent("Card"),a=e.resolveComponent("CardTitle"),c=e.resolveComponent("CardHeader"),W=e.resolveComponent("ChartContainer"),f=e.resolveComponent("CardContent");return e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",K,[t[0]||(t[0]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"Audience"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"Who visits your site")],-1)),y.value?(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",J,[(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",g.value===s.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:C=>g.value=s.value},e.toDisplayString(s.label),11,Q)),64))]),e.createVNode(n,{variant:"outline",size:"icon",onClick:k,disabled:u.value},{default:e.withCtx(()=>[e.createVNode(e.unref(r.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":u.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),y.value?h.value?(e.openBlock(),e.createBlock(l,{key:1,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",X,e.toDisplayString(h.value),1),e.createVNode(n,{variant:"outline",size:"sm",class:"mt-3",onClick:k},{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):u.value?(e.openBlock(),e.createElementBlock("div",Y,[e.createVNode(e.unref(r.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Z,[e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(a,{class:"text-base"},{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode("New vs Returning",-1)])]),_:1})]),_:1}),e.createVNode(f,{class:"flex flex-col items-center"},{default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(W,{config:M,class:"mx-auto aspect-square max-h-[200px]"},{default:e.withCtx(()=>[e.createVNode(e.unref(z.b),{data:L.value,margin:{top:16,bottom:16,left:16,right:16}},{default:e.withCtx(()=>[e.createVNode(e.unref(z.E),{value:s=>s.value,color:s=>s.fill,arcWidth:35,padAngle:.03,cornerRadius:4},null,8,["value","color"])]),_:1},8,["data"])]),_:1}),e.createElementVNode("div",te,[e.createElementVNode("div",se,[e.createElementVNode("p",oe,e.toDisplayString(d(v.value)),1),t[4]||(t[4]=e.createElementVNode("p",{class:"text-xs text-muted-foreground"},"total users",-1))])])]),e.createElementVNode("div",ne,[e.createElementVNode("div",le,[e.createElementVNode("div",{class:"size-2.5 rounded-full",style:e.normalizeStyle({backgroundColor:x.new})},null,4),t[5]||(t[5]=e.createElementVNode("span",{class:"text-sm"},"New",-1)),e.createElementVNode("span",ae,e.toDisplayString(d(b.value)),1),v.value?(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(Math.round(b.value/v.value*100))+"%",1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",de,[e.createElementVNode("div",{class:"size-2.5 rounded-full",style:e.normalizeStyle({backgroundColor:x.returning})},null,4),t[6]||(t[6]=e.createElementVNode("span",{class:"text-sm"},"Returning",-1)),e.createElementVNode("span",ce,e.toDisplayString(d(E.value)),1),v.value?(e.openBlock(),e.createElementBlock("span",ie,e.toDisplayString(Math.round(E.value/v.value*100))+"%",1)):e.createCommentVNode("",!0)])])]),_:1})]),_:1}),e.createVNode(l,{class:"@lg:col-span-2"},{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(a,{class:"text-base"},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Engagement by Visitor Type",-1)])]),_:1})]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createElementVNode("table",me,[t[8]||(t[8]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground"},"Type"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Sessions"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Engagement Rate"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Avg Duration"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Pages/Session")])],-1)),e.createElementVNode("tbody",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,s=>(e.openBlock(),e.createElementBlock("tr",{key:s.newVsReturning,class:"hover:bg-muted/50"},[e.createElementVNode("td",fe,[e.createElementVNode("div",ge,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.newVsReturning==="new"?e.unref(r.UserPlus):e.unref(r.UserCheck)),{class:"size-4 text-muted-foreground"})),e.createElementVNode("span",pe,e.toDisplayString(s.newVsReturning),1)])]),e.createElementVNode("td",ve,e.toDisplayString(d(s.totalUsers)),1),e.createElementVNode("td",he,e.toDisplayString(d(s.sessions)),1),e.createElementVNode("td",Ve,e.toDisplayString(T(s.engagementRate||0)),1),e.createElementVNode("td",_e,e.toDisplayString(F(s.averageSessionDuration||0)),1),e.createElementVNode("td",Ne,e.toDisplayString((s.screenPageViewsPerSession||0).toFixed(1)),1)]))),128))])])])]),_:1})]),_:1})]),e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(a,{class:"text-base flex items-center gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Clock),{class:"size-4"}),t[9]||(t[9]=e.createTextVNode(" Peak Hours ",-1))]),_:1}),t[10]||(t[10]=e.createElementVNode("p",{class:"text-xs text-muted-foreground mt-1"},"When your visitors are most active (based on sessions)",-1))]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createElementVNode("div",ye,[e.createElementVNode("div",be,[e.createElementVNode("div",Ee,[t[11]||(t[11]=e.createElementVNode("div",{class:"w-10 shrink-0"},null,-1)),e.createElementVNode("div",ke,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(24,s=>e.createElementVNode("div",{key:s,class:"text-[10px] text-muted-foreground text-center"},e.toDisplayString(s-1),1)),64))])]),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(q,(s,C)=>e.createElementVNode("div",{key:s,class:"flex items-center mb-0.5"},[e.createElementVNode("div",Ce,e.toDisplayString(s),1),e.createElementVNode("div",we,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(24,w=>e.createElementVNode("div",{key:w,class:e.normalizeClass(["aspect-square rounded-sm transition-colors",P(B.value.matrix[C]?.[w-1]||0,B.value.maxVal)]),title:`${s} ${w-1}:00 — ${B.value.matrix[C]?.[w-1]||0} sessions`},null,10,Be)),64))])])),64)),t[12]||(t[12]=e.createElementVNode("div",{class:"flex items-center justify-end gap-1.5 mt-3"},[e.createElementVNode("span",{class:"text-[10px] text-muted-foreground"},"Less"),e.createElementVNode("div",{class:"size-3 rounded-sm bg-muted"}),e.createElementVNode("div",{class:"size-3 rounded-sm bg-blue-300/50 dark:bg-blue-300/30"}),e.createElementVNode("div",{class:"size-3 rounded-sm bg-blue-400/70 dark:bg-blue-400/60"}),e.createElementVNode("div",{class:"size-3 rounded-sm bg-blue-500 dark:bg-blue-400"}),e.createElementVNode("div",{class:"size-3 rounded-sm bg-blue-600 dark:bg-blue-500"}),e.createElementVNode("span",{class:"text-[10px] text-muted-foreground"},"More")],-1))])])]),_:1})]),_:1}),e.createElementVNode("div",De,[e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createElementVNode("div",Se,[e.createVNode(a,{class:"text-base"},{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode("Technology",-1)])]),_:1}),e.createElementVNode("div",$e,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(O,s=>e.createElementVNode("button",{key:s.key,class:e.normalizeClass(["p-1.5 rounded-md transition-colors",i.value===s.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"]),onClick:C=>i.value=s.key,title:s.label},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.icon),{class:"size-3.5"}))],10,ze)),64))])])]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createElementVNode("div",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s[i.value],class:"flex items-center gap-3"},[e.createElementVNode("span",Ue,e.toDisplayString(s[i.value]||"(not set)"),1),e.createElementVNode("div",Te,[e.createElementVNode("div",{class:"h-full bg-primary rounded-full transition-all",style:e.normalizeStyle({width:`${s.totalUsers/(p.value[0]?.totalUsers||1)*100}%`})},null,4)]),e.createElementVNode("span",Fe,e.toDisplayString(d(s.totalUsers)),1)]))),128)),p.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Me,"No data"))])]),_:1})]),_:1}),e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(a,{class:"text-base flex items-center gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Languages),{class:"size-4"}),t[14]||(t[14]=e.createTextVNode(" Languages ",-1))]),_:1})]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createElementVNode("div",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.language,class:"flex items-center gap-3"},[e.createElementVNode("span",Ae,e.toDisplayString(s.language),1),e.createElementVNode("div",qe,[e.createElementVNode("div",{class:"h-full bg-primary rounded-full transition-all",style:e.normalizeStyle({width:`${s.totalUsers/(_.value[0]?.totalUsers||1)*100}%`})},null,4)]),e.createElementVNode("span",Pe,e.toDisplayString(d(s.totalUsers)),1)]))),128)),_.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Oe,"No data"))])]),_:1})]),_:1}),e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(c,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(a,{class:"text-base flex items-center gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.MapPin),{class:"size-4"}),t[15]||(t[15]=e.createTextVNode(" Top Cities ",-1))]),_:1})]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createElementVNode("div",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,s=>(e.openBlock(),e.createElementBlock("div",{key:`${s.city}-${s.country}`,class:"flex items-center gap-3"},[e.createElementVNode("div",We,[e.createElementVNode("span",He,e.toDisplayString(s.city),1),e.createElementVNode("span",Ie,e.toDisplayString(s.country),1)]),e.createElementVNode("div",Ke,[e.createElementVNode("div",{class:"h-full bg-primary rounded-full transition-all",style:e.normalizeStyle({width:`${s.totalUsers/(N.value[0]?.totalUsers||1)*100}%`})},null,4)]),e.createElementVNode("span",Ge,e.toDisplayString(d(s.totalUsers)),1)]))),128)),N.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Je,"No data"))])]),_:1})]),_:1})])],64)):(e.openBlock(),e.createBlock(l,{key:0,class:"p-8 text-center"},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1)])]),_:1}))])}}}),Xe=H._export_sfc(Qe,[["__scopeId","data-v-4c7905b1"]]);exports.default=Xe;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
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";
|
|
2
2
|
import { useModule as Z, useModuleRoute as tt, useModuleBreadcrumbs as et } from "@oneclick.dev/cms-kit";
|
|
3
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: "w-full max-w-7xl mx-auto py-8
|
|
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 = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex items-center gap-2"
|
|
7
7
|
}, ct = { class: "flex items-center border rounded-lg overflow-hidden" }, mt = ["onClick"], xt = { class: "text-sm text-destructive font-medium" }, gt = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("@oneclick.dev/cms-kit"),i=require("lucide-vue-next"),$={class:"flex flex-col gap-6 w-full max-w-7xl mx-auto py-8"},z={class:"flex items-center justify-between"},T={key:0,class:"flex items-center gap-2"},L={class:"flex items-center border rounded-lg overflow-hidden"},M=["onClick"],F={class:"text-sm text-destructive font-medium"},j={key:2,class:"flex items-center justify-center py-20"},A={class:"flex items-center justify-between gap-4"},U={class:"flex items-center gap-2"},q=["onClick"],H={key:0,class:"relative"},I={class:"overflow-x-auto"},O={class:"w-full text-sm"},Q={class:"divide-y"},K={class:"px-6 py-3 text-muted-foreground"},W={class:"px-4 py-3 max-w-[300px]"},G={class:"truncate font-mono text-xs"},J={key:0,class:"truncate text-xs text-muted-foreground mt-0.5"},X={class:"px-4 py-3 text-right tabular-nums"},Y={class:"px-4 py-3 text-right tabular-nums"},Z={class:"px-4 py-3 text-right tabular-nums"},ee={class:"px-4 py-3 text-right tabular-nums"},te={class:"px-4 py-3 text-right tabular-nums"},oe={class:"px-4 py-3 text-right"},ne={class:"flex items-center justify-end gap-2"},ae={class:"w-12 h-1.5 bg-muted rounded-full overflow-hidden"},re={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},se={class:"overflow-x-auto"},le={class:"w-full text-sm"},de={class:"divide-y"},ce={class:"px-6 py-3 text-muted-foreground"},ie={class:"px-4 py-3 font-mono text-xs truncate max-w-[300px]"},ue={class:"px-4 py-3 text-right tabular-nums"},me={class:"px-4 py-3 text-right tabular-nums"},xe={class:"px-4 py-3 text-right tabular-nums"},ge={class:"px-4 py-3 text-right tabular-nums"},pe={class:"px-4 py-3 text-right tabular-nums"},fe={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},he={class:"overflow-x-auto"},ye={class:"w-full text-sm"},ve={class:"divide-y"},Ve={class:"px-6 py-3 text-muted-foreground"},Ne={class:"px-4 py-3 font-mono text-xs truncate max-w-[300px]"},_e={class:"px-4 py-3 text-right tabular-nums"},Ee={class:"px-4 py-3 text-right tabular-nums"},ke={class:"px-4 py-3 text-right"},be={class:"flex items-center justify-end gap-2"},Ce={class:"w-16 h-1.5 bg-muted rounded-full overflow-hidden"},we={key:0,class:"px-6 py-8 text-center text-muted-foreground text-sm"},Be=e.defineComponent({__name:"Content",setup(Se){const{config:k}=E.useModule(),{moduleId:S}=E.useModuleRoute();E.useModuleBreadcrumbs(()=>[{label:"Content"}]);const l=e.ref(!0),x=e.ref(null),g=e.ref("30"),d=e.ref("all"),u=e.ref(""),y=e.ref([]),v=e.ref([]),V=e.ref([]),p=e.computed(()=>!!(k.serviceAccount&&k.propertyId));function N(n){return`/api/v1/modules/${S}${n}`}const D=[{label:"7d",value:"7"},{label:"14d",value:"14"},{label:"30d",value:"30"},{label:"90d",value:"90"}];function c(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:Math.round(n).toString()}function m(n){return`${(n*100).toFixed(1)}%`}function b(n){const o=Math.floor(n/60),a=Math.round(n%60);return o>0?`${o}m ${a}s`:`${a}s`}function f(n){const o=n.engagementRate||0,a=Math.min((n.averageSessionDuration||0)/300,1),r=Math.min((n.screenPageViews||0)/1e3,1);return(o*.4+a*.35+r*.25)*100}function P(n){return n>=70?"text-emerald-600 dark:text-emerald-400":n>=40?"text-amber-600 dark:text-amber-400":"text-red-500 dark:text-red-400"}function R(n){return n>=70?"bg-emerald-500":n>=40?"bg-amber-500":"bg-red-500"}const C=e.computed(()=>{if(!u.value)return y.value;const n=u.value.toLowerCase();return y.value.filter(o=>(o.pagePath||"").toLowerCase().includes(n)||(o.pageTitle||"").toLowerCase().includes(n))});async function h(){if(!p.value)return;l.value=!0,x.value=null;const n=`${g.value}daysAgo`;try{const[o,a,r]=await Promise.all([$fetch(N(`/content/all-pages?startDate=${n}&endDate=today&limit=50`)),$fetch(N(`/content/landing-pages?startDate=${n}&endDate=today`)),$fetch(N(`/content/exit-pages?startDate=${n}&endDate=today`))]);y.value=o.rows||[],v.value=a.rows||[],V.value=r.rows||[]}catch(o){x.value=o?.data?.statusMessage||o?.message||"Failed to load content data"}finally{l.value=!1}}return e.watch(g,()=>h()),e.onMounted(()=>{p.value?h():l.value=!1}),(n,o)=>{const a=e.resolveComponent("Button"),r=e.resolveComponent("Card"),_=e.resolveComponent("CardContent"),w=e.resolveComponent("CardTitle"),B=e.resolveComponent("CardHeader");return e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",z,[o[1]||(o[1]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold"},"Content Performance"),e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"},"How your pages perform")],-1)),p.value?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",L,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(D,t=>e.createElementVNode("button",{key:t.value,class:e.normalizeClass(["px-3 py-1.5 text-xs font-medium transition-colors",g.value===t.value?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"]),onClick:s=>g.value=t.value},e.toDisplayString(t.label),11,M)),64))]),e.createVNode(a,{variant:"outline",size:"icon",onClick:h,disabled:l.value},{default:e.withCtx(()=>[e.createVNode(e.unref(i.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":l.value}])},null,8,["class"])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),p.value?x.value?(e.openBlock(),e.createBlock(r,{key:1,class:"p-6 border-destructive/50 bg-destructive/5"},{default:e.withCtx(()=>[e.createElementVNode("p",F,e.toDisplayString(x.value),1),e.createVNode(a,{variant:"outline",size:"sm",class:"mt-3",onClick:h},{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("Retry",-1)])]),_:1})]),_:1})):l.value?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(i.Loader2),{class:"size-8 animate-spin text-muted-foreground"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",A,[e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([{key:"all",label:"All Pages",icon:e.unref(i.FileText)},{key:"landing",label:"Landing Pages",icon:e.unref(i.LogIn)},{key:"exit",label:"Exit Pages",icon:e.unref(i.LogOut)}],t=>(e.openBlock(),e.createElementBlock("button",{key:t.key,class:e.normalizeClass(["flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-md transition-colors",d.value===t.key?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"]),onClick:s=>d.value=t.key},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{class:"size-3.5"})),e.createTextVNode(" "+e.toDisplayString(t.label),1)],10,q))),128))]),d.value==="all"?(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(e.unref(i.Search),{class:"absolute left-2.5 top-1/2 -translate-y-1/2 size-3.5 text-muted-foreground"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=t=>u.value=t),type:"text",placeholder:"Filter pages...",class:"pl-8 pr-3 py-1.5 text-sm border rounded-md bg-transparent w-48 focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[e.vModelText,u.value]])])):e.createCommentVNode("",!0)]),d.value==="all"?(e.openBlock(),e.createBlock(r,{key:0},{default:e.withCtx(()=>[e.createVNode(_,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",I,[e.createElementVNode("table",O,[o[4]||(o[4]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-6 py-3 font-medium text-muted-foreground w-8"},"#"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground"},"Page"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Views"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Avg Time"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Bounce"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Engagement"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Score")])],-1)),e.createElementVNode("tbody",Q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(t,s)=>(e.openBlock(),e.createElementBlock("tr",{key:t.pagePath,class:"hover:bg-muted/50 group"},[e.createElementVNode("td",K,e.toDisplayString(s+1),1),e.createElementVNode("td",W,[e.createElementVNode("div",G,e.toDisplayString(t.pagePath),1),t.pageTitle?(e.openBlock(),e.createElementBlock("div",J,e.toDisplayString(t.pageTitle),1)):e.createCommentVNode("",!0)]),e.createElementVNode("td",X,e.toDisplayString(c(t.screenPageViews)),1),e.createElementVNode("td",Y,e.toDisplayString(c(t.totalUsers)),1),e.createElementVNode("td",Z,e.toDisplayString(b(t.averageSessionDuration||0)),1),e.createElementVNode("td",ee,e.toDisplayString(m(t.bounceRate||0)),1),e.createElementVNode("td",te,e.toDisplayString(m(t.engagementRate||0)),1),e.createElementVNode("td",oe,[e.createElementVNode("div",ne,[e.createElementVNode("div",ae,[e.createElementVNode("div",{class:e.normalizeClass(["h-full rounded-full transition-all",R(f(t))]),style:e.normalizeStyle({width:`${Math.min(f(t),100)}%`})},null,6)]),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-medium tabular-nums w-8 text-right",P(f(t))])},e.toDisplayString(Math.round(f(t))),3)])])]))),128))])])]),C.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",re,e.toDisplayString(u.value?"No pages matching your search":"No page data available"),1))]),_:1})]),_:1})):e.createCommentVNode("",!0),d.value==="landing"?(e.openBlock(),e.createBlock(r,{key:1},{default:e.withCtx(()=>[e.createVNode(B,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(w,{class:"text-base"},{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("Top Landing Pages",-1)])]),_:1}),o[6]||(o[6]=e.createElementVNode("p",{class:"text-xs text-muted-foreground mt-1"},"Where users first enter your site. Low bounce + high engagement = great landing page.",-1))]),_:1}),e.createVNode(_,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",se,[e.createElementVNode("table",le,[o[7]||(o[7]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-6 py-3 font-medium text-muted-foreground w-8"},"#"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground"},"Landing Page"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Sessions"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Users"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Bounce"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Avg Time"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Engagement")])],-1)),e.createElementVNode("tbody",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(t,s)=>(e.openBlock(),e.createElementBlock("tr",{key:t.landingPagePlusQueryString,class:"hover:bg-muted/50"},[e.createElementVNode("td",ce,e.toDisplayString(s+1),1),e.createElementVNode("td",ie,e.toDisplayString(t.landingPagePlusQueryString),1),e.createElementVNode("td",ue,e.toDisplayString(c(t.sessions)),1),e.createElementVNode("td",me,e.toDisplayString(c(t.totalUsers)),1),e.createElementVNode("td",xe,[e.createElementVNode("span",{class:e.normalizeClass((t.bounceRate||0)>.6?"text-red-500":(t.bounceRate||0)<.3?"text-emerald-600 dark:text-emerald-400":"")},e.toDisplayString(m(t.bounceRate||0)),3)]),e.createElementVNode("td",ge,e.toDisplayString(b(t.averageSessionDuration||0)),1),e.createElementVNode("td",pe,[e.createElementVNode("span",{class:e.normalizeClass((t.engagementRate||0)>.6?"text-emerald-600 dark:text-emerald-400":"")},e.toDisplayString(m(t.engagementRate||0)),3)])]))),128))])])]),v.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",fe,"No landing page data"))]),_:1})]),_:1})):e.createCommentVNode("",!0),d.value==="exit"?(e.openBlock(),e.createBlock(r,{key:2},{default:e.withCtx(()=>[e.createVNode(B,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(w,{class:"text-base"},{default:e.withCtx(()=>[...o[8]||(o[8]=[e.createTextVNode("Top Exit Pages",-1)])]),_:1}),o[9]||(o[9]=e.createElementVNode("p",{class:"text-xs text-muted-foreground mt-1"},"Where users leave your site. High exit rate might indicate issues.",-1))]),_:1}),e.createVNode(_,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",he,[e.createElementVNode("table",ye,[o[10]||(o[10]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b text-left"},[e.createElementVNode("th",{class:"px-6 py-3 font-medium text-muted-foreground w-8"},"#"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground"},"Page"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Sessions"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Page Views"),e.createElementVNode("th",{class:"px-4 py-3 font-medium text-muted-foreground text-right"},"Bounce Rate")])],-1)),e.createElementVNode("tbody",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(t,s)=>(e.openBlock(),e.createElementBlock("tr",{key:t.pagePath,class:"hover:bg-muted/50"},[e.createElementVNode("td",Ve,e.toDisplayString(s+1),1),e.createElementVNode("td",Ne,e.toDisplayString(t.pagePath),1),e.createElementVNode("td",_e,e.toDisplayString(c(t.sessions)),1),e.createElementVNode("td",Ee,e.toDisplayString(c(t.screenPageViews)),1),e.createElementVNode("td",ke,[e.createElementVNode("div",be,[e.createElementVNode("div",Ce,[e.createElementVNode("div",{class:e.normalizeClass(["h-full rounded-full transition-all",(t.exitRate||0)>.7?"bg-red-500":(t.exitRate||0)>.4?"bg-amber-500":"bg-emerald-500"]),style:e.normalizeStyle({width:`${(t.exitRate||0)*100}%`})},null,6)]),e.createElementVNode("span",{class:e.normalizeClass(["text-xs tabular-nums",(t.exitRate||0)>.7?"text-red-500":""])},e.toDisplayString(m(t.exitRate||0)),3)])])]))),128))])])]),V.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",we,"No exit page data"))]),_:1})]),_:1})):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(r,{key:0,class:"p-8 text-center"},{default:e.withCtx(()=>[...o[2]||(o[2]=[e.createElementVNode("p",{class:"text-lg font-medium"},"Setup required",-1)])]),_:1}))])}}});exports.default=Be;
|
|
@@ -5,7 +5,7 @@ import { componentToString as oe, ChartTooltipContent as ae } from "@oneclick.de
|
|
|
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: "w-full max-w-7xl mx-auto py-8
|
|
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 = {
|
|
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 = {
|
|
@@ -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-6 w-full max-w-7xl mx-auto py-8"},J={class:"flex items-center justify-between"},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 @sm: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:"grid @lg:grid-cols-2 gap-6"},pe={class:"grid @lg:grid-cols-2 gap-6"},fe={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-6"},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)}%`,f=s>0;return{text:n,cls:(t?f:!f)?"text-emerald-600 dark:text-emerald-400":"text-red-500 dark:text-red-400",icon:f?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,f,u,p]=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=f.rows||[],C.value=u.rows||[],w.value=p.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"),f=e.resolveComponent("Badge"),u=e.resolveComponent("CardTitle"),p=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(f,{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(p,{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(p,{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",pe,[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(p,{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",fe,[(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(p,{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(p,{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(p,{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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("@oneclick.dev/cms-kit"),_=require("./_plugin-vue_export-helper-BHFhmbuH.js"),v={class:"preview-iphone"},V={class:"push-container"},f={class:"inner"},N={class:"head"},h={class:"app-name"},y={class:"body"},x={class:"push-title"},S={class:"push-message"},E=e.defineComponent({__name:"PreviewIPhone",props:{app:{type:String,required:!0},title:{type:String,required:!0},message:{type:String,required:!0}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",V,[e.createElementVNode("div",f,[e.createElementVNode("div",N,[e.createElementVNode("span",h,e.toDisplayString(t.app),1),o[0]||(o[0]=e.createElementVNode("span",null,"now",-1))]),e.createElementVNode("div",y,[e.createElementVNode("span",x,e.toDisplayString(t.title),1),e.createElementVNode("span",S,e.toDisplayString(t.message),1)])])])]))}}),w=_._export_sfc(E,[["__scopeId","data-v-8c84cde9"]]),C={class:"preview-android"},B={class:"push-container"},k={class:"inner"},P={class:"head"},$={class:"app-name"},q={class:"body"},b={class:"push-title"},T={class:"push-message"},D=e.defineComponent({__name:"PreviewAndroid",props:{app:{type:String,required:!0},title:{type:String,required:!0},message:{type:String,required:!0}},setup(t){return(l,o)=>(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("div",B,[e.createElementVNode("div",k,[e.createElementVNode("div",P,[o[0]||(o[0]=e.createElementVNode("span",{class:"notification-badge"},null,-1)),e.createElementVNode("span",$,e.toDisplayString(t.app),1),o[1]||(o[1]=e.createElementVNode("span",null,null,-1))]),e.createElementVNode("div",q,[e.createElementVNode("span",b,e.toDisplayString(t.title),1),e.createElementVNode("span",T,e.toDisplayString(t.message),1)])])])]))}}),I=_._export_sfc(D,[["__scopeId","data-v-202b94a8"]]),M={class:"flex flex-col"},O=e.defineComponent({__name:"PushPreview",props:{app:{type:String,required:!0},title:{type:String,required:!0},message:{type:String,required:!0}},setup(t){const l=t,o=e.ref("ios"),i=e.computed(()=>l.title.length>0?l.title:"Notification Preview"),d=e.computed(()=>l.message.length>0?l.message:"Preview your push notification");return(r,s)=>{const p=e.resolveComponent("SegmentedControlButton"),n=e.resolveComponent("SegmentedControl");return e.openBlock(),e.createElementBlock("div",M,[e.createVNode(n,{modelValue:e.unref(o),"onUpdate:modelValue":s[0]||(s[0]=a=>e.isRef(o)?o.value=a:null),class:"mx-auto mb-3"},{default:e.withCtx(()=>[e.createVNode(p,{value:"ios"},{default:e.withCtx(()=>[...s[1]||(s[1]=[e.createTextVNode(" iOS ",-1)])]),_:1}),e.createVNode(p,{value:"android"},{default:e.withCtx(()=>[...s[2]||(s[2]=[e.createTextVNode(" Android ",-1)])]),_:1})]),_:1},8,["modelValue"]),e.unref(o)=="ios"?(e.openBlock(),e.createBlock(w,{key:0,app:t.app,title:e.unref(i),message:e.unref(d)},null,8,["app","title","message"])):(e.openBlock(),e.createBlock(I,{key:1,app:t.app,title:e.unref(i),message:e.unref(d)},null,8,["app","title","message"]))])}}}),A={class:"relative"},L={class:"flex gap-12 bg-background rounded-lg p-6 shadow"},U={class:"flex flex-col gap-2 w-96"},j=e.defineComponent({__name:"SendPush",props:{config:{type:Object,required:!0}},setup(t){const{hasPermission:l}=m.useModulePermissions(),{log:o,logWarning:i,logError:d}=m.useLogs(),r=e.ref(""),s=e.ref("");return(p,n)=>{const a=e.resolveComponent("Label"),u=e.resolveComponent("Input"),g=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",L,[e.createElementVNode("div",U,[e.createVNode(a,{for:"send_push_title"},{default:e.withCtx(()=>[...n[2]||(n[2]=[e.createTextVNode("Title",-1)])]),_:1}),e.createVNode(u,{type:"text",modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=c=>r.value=c),id:"send_push_title"},null,8,["modelValue"]),e.createVNode(a,{for:"send_push_message"},{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("Message",-1)])]),_:1}),e.createVNode(u,{type:"text",modelValue:s.value,"onUpdate:modelValue":n[1]||(n[1]=c=>s.value=c),id:"send_push_message"},null,8,["modelValue"]),e.createVNode(g,null,{default:e.withCtx(()=>[...n[4]||(n[4]=[e.createTextVNode("Send Push",-1)])]),_:1})]),e.createVNode(O,{class:"preview",app:t.config.appName,title:r.value,message:s.value},null,8,["app","title","message"])])])}}});exports.default=j;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { defineComponent as g, openBlock as r, createElementBlock as v, createElementVNode as e, toDisplayString as d, ref as x, computed as w, resolveComponent as p, createVNode as i, isRef as q, unref as a, withCtx as u, createTextVNode as c, createBlock as P } from "vue";
|
|
2
|
+
import { useModulePermissions as B, useLogs as C } from "@oneclick.dev/cms-kit";
|
|
3
|
+
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
|
+
const k = { class: "preview-iphone" }, I = { class: "push-container" }, N = { class: "inner" }, A = { class: "head" }, E = { class: "app-name" }, L = { class: "body" }, M = { class: "push-title" }, O = { class: "push-message" }, T = /* @__PURE__ */ g({
|
|
5
|
+
__name: "PreviewIPhone",
|
|
6
|
+
props: {
|
|
7
|
+
app: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: !0
|
|
10
|
+
},
|
|
11
|
+
title: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: !0
|
|
14
|
+
},
|
|
15
|
+
message: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: !0
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(t) {
|
|
21
|
+
return (l, s) => (r(), v("div", k, [
|
|
22
|
+
e("div", I, [
|
|
23
|
+
e("div", N, [
|
|
24
|
+
e("div", A, [
|
|
25
|
+
e("span", E, d(t.app), 1),
|
|
26
|
+
s[0] || (s[0] = e("span", null, "now", -1))
|
|
27
|
+
]),
|
|
28
|
+
e("div", L, [
|
|
29
|
+
e("span", M, d(t.title), 1),
|
|
30
|
+
e("span", O, d(t.message), 1)
|
|
31
|
+
])
|
|
32
|
+
])
|
|
33
|
+
])
|
|
34
|
+
]));
|
|
35
|
+
}
|
|
36
|
+
}), U = /* @__PURE__ */ V(T, [["__scopeId", "data-v-8c84cde9"]]), j = { class: "preview-android" }, D = { class: "push-container" }, R = { class: "inner" }, W = { class: "head" }, z = { class: "app-name" }, F = { class: "body" }, G = { class: "push-title" }, H = { class: "push-message" }, J = /* @__PURE__ */ g({
|
|
37
|
+
__name: "PreviewAndroid",
|
|
38
|
+
props: {
|
|
39
|
+
app: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: !0
|
|
42
|
+
},
|
|
43
|
+
title: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: !0
|
|
46
|
+
},
|
|
47
|
+
message: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: !0
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(t) {
|
|
53
|
+
return (l, s) => (r(), v("div", j, [
|
|
54
|
+
e("div", D, [
|
|
55
|
+
e("div", R, [
|
|
56
|
+
e("div", W, [
|
|
57
|
+
s[0] || (s[0] = e("span", { class: "notification-badge" }, null, -1)),
|
|
58
|
+
e("span", z, d(t.app), 1),
|
|
59
|
+
s[1] || (s[1] = e("span", null, null, -1))
|
|
60
|
+
]),
|
|
61
|
+
e("div", F, [
|
|
62
|
+
e("span", G, d(t.title), 1),
|
|
63
|
+
e("span", H, d(t.message), 1)
|
|
64
|
+
])
|
|
65
|
+
])
|
|
66
|
+
])
|
|
67
|
+
]));
|
|
68
|
+
}
|
|
69
|
+
}), K = /* @__PURE__ */ V(J, [["__scopeId", "data-v-202b94a8"]]), Q = { class: "flex flex-col" }, X = /* @__PURE__ */ g({
|
|
70
|
+
__name: "PushPreview",
|
|
71
|
+
props: {
|
|
72
|
+
app: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: !0
|
|
75
|
+
},
|
|
76
|
+
title: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: !0
|
|
79
|
+
},
|
|
80
|
+
message: {
|
|
81
|
+
type: String,
|
|
82
|
+
required: !0
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
setup(t) {
|
|
86
|
+
const l = t, s = x("ios"), f = w(() => l.title.length > 0 ? l.title : "Notification Preview"), h = w(() => l.message.length > 0 ? l.message : "Preview your push notification");
|
|
87
|
+
return (m, o) => {
|
|
88
|
+
const y = p("SegmentedControlButton"), n = p("SegmentedControl");
|
|
89
|
+
return r(), v("div", Q, [
|
|
90
|
+
i(n, {
|
|
91
|
+
modelValue: a(s),
|
|
92
|
+
"onUpdate:modelValue": o[0] || (o[0] = (_) => q(s) ? s.value = _ : null),
|
|
93
|
+
class: "mx-auto mb-3"
|
|
94
|
+
}, {
|
|
95
|
+
default: u(() => [
|
|
96
|
+
i(y, { value: "ios" }, {
|
|
97
|
+
default: u(() => [...o[1] || (o[1] = [
|
|
98
|
+
c(" iOS ", -1)
|
|
99
|
+
])]),
|
|
100
|
+
_: 1
|
|
101
|
+
}),
|
|
102
|
+
i(y, { value: "android" }, {
|
|
103
|
+
default: u(() => [...o[2] || (o[2] = [
|
|
104
|
+
c(" Android ", -1)
|
|
105
|
+
])]),
|
|
106
|
+
_: 1
|
|
107
|
+
})
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}, 8, ["modelValue"]),
|
|
111
|
+
a(s) == "ios" ? (r(), P(U, {
|
|
112
|
+
key: 0,
|
|
113
|
+
app: t.app,
|
|
114
|
+
title: a(f),
|
|
115
|
+
message: a(h)
|
|
116
|
+
}, null, 8, ["app", "title", "message"])) : (r(), P(K, {
|
|
117
|
+
key: 1,
|
|
118
|
+
app: t.app,
|
|
119
|
+
title: a(f),
|
|
120
|
+
message: a(h)
|
|
121
|
+
}, null, 8, ["app", "title", "message"]))
|
|
122
|
+
]);
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}), Y = { class: "relative" }, Z = { class: "flex gap-12 bg-background rounded-lg p-6 shadow" }, ee = { class: "flex flex-col gap-2 w-96" }, oe = /* @__PURE__ */ g({
|
|
126
|
+
__name: "SendPush",
|
|
127
|
+
props: {
|
|
128
|
+
config: {
|
|
129
|
+
type: Object,
|
|
130
|
+
required: !0
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
setup(t) {
|
|
134
|
+
const { hasPermission: l } = B(), { log: s, logWarning: f, logError: h } = C(), m = x(""), o = x("");
|
|
135
|
+
return (y, n) => {
|
|
136
|
+
const _ = p("Label"), $ = p("Input"), b = p("Button");
|
|
137
|
+
return r(), v("div", Y, [
|
|
138
|
+
e("div", Z, [
|
|
139
|
+
e("div", ee, [
|
|
140
|
+
i(_, { for: "send_push_title" }, {
|
|
141
|
+
default: u(() => [...n[2] || (n[2] = [
|
|
142
|
+
c("Title", -1)
|
|
143
|
+
])]),
|
|
144
|
+
_: 1
|
|
145
|
+
}),
|
|
146
|
+
i($, {
|
|
147
|
+
type: "text",
|
|
148
|
+
modelValue: m.value,
|
|
149
|
+
"onUpdate:modelValue": n[0] || (n[0] = (S) => m.value = S),
|
|
150
|
+
id: "send_push_title"
|
|
151
|
+
}, null, 8, ["modelValue"]),
|
|
152
|
+
i(_, { for: "send_push_message" }, {
|
|
153
|
+
default: u(() => [...n[3] || (n[3] = [
|
|
154
|
+
c("Message", -1)
|
|
155
|
+
])]),
|
|
156
|
+
_: 1
|
|
157
|
+
}),
|
|
158
|
+
i($, {
|
|
159
|
+
type: "text",
|
|
160
|
+
modelValue: o.value,
|
|
161
|
+
"onUpdate:modelValue": n[1] || (n[1] = (S) => o.value = S),
|
|
162
|
+
id: "send_push_message"
|
|
163
|
+
}, null, 8, ["modelValue"]),
|
|
164
|
+
i(b, null, {
|
|
165
|
+
default: u(() => [...n[4] || (n[4] = [
|
|
166
|
+
c("Send Push", -1)
|
|
167
|
+
])]),
|
|
168
|
+
_: 1
|
|
169
|
+
})
|
|
170
|
+
]),
|
|
171
|
+
i(X, {
|
|
172
|
+
class: "preview",
|
|
173
|
+
app: t.config.appName,
|
|
174
|
+
title: m.value,
|
|
175
|
+
message: o.value
|
|
176
|
+
}, null, 8, ["app", "title", "message"])
|
|
177
|
+
])
|
|
178
|
+
]);
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
export {
|
|
183
|
+
oe as default
|
|
184
|
+
};
|