@oneclick.dev/cms-core-modules 0.0.101 → 0.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acquisition-Br1Pfny3.js +1 -0
- package/dist/{Acquisition-BJXNY4ko.mjs → Acquisition-CPlZzUBo.mjs} +40 -40
- package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
- package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
- package/dist/AppointmentListTable-Dieu9US_.js +1 -0
- package/dist/Audience-BfkrmBuQ.js +1 -0
- package/dist/{Audience-CIzVtUvV.mjs → Audience-DTblSAiL.mjs} +89 -89
- package/dist/Content-BHr_rPVY.js +1 -0
- package/dist/{Content-CWhjurn_.mjs → Content-CYOZKvWK.mjs} +56 -56
- package/dist/{ContentEditor-Cjqgb64R.mjs → ContentEditor-B1nfKG_5.mjs} +706 -677
- package/dist/{ContentEditor-YgOS3kxS.js → ContentEditor-DdFU8piH.js} +15 -16
- package/dist/{Create-6uT9HWar.mjs → Create-BRBh0xjM.mjs} +2 -2
- package/dist/{Create-DuZ5nZrX.js → Create-qPeQxkdl.js} +1 -1
- package/dist/{DateFormatter-2B0R-DY4.mjs → DateFormatter-Bw-87W31.mjs} +212 -227
- package/dist/DateFormatter-CYAD4GBN.js +1 -0
- package/dist/{Detail-BZ-iE9vf.js → Detail-C857g62L.js} +1 -1
- package/dist/{Detail-CJVMJDP7.mjs → Detail-CujdFApD.mjs} +2 -2
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
- package/dist/{Entries-DkRhOt95.js → Entries-BaS6H6ak.js} +1 -1
- package/dist/{Entries-dLlCrXXe.mjs → Entries-C8UJkrVC.mjs} +1 -1
- package/dist/{Find-Bd1uLqSa.mjs → Find-B24ZEhYM.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs} +37 -37
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js} +1 -1
- package/dist/{Overview-DoOASlNz.mjs → Overview-3HWhsqaz.mjs} +2 -2
- package/dist/Overview-BrCwozey.js +1 -0
- package/dist/{Overview-37nilXzE.js → Overview-CpHhuiaV.js} +1 -1
- package/dist/{Overview-DeQQ0FY3.js → Overview-DAxCu9XC.js} +1 -1
- package/dist/{Overview-C--dq51X.mjs → Overview-D_T3K6aq.mjs} +1 -1
- package/dist/{Overview-CGo4jaaA.mjs → Overview-kaMhsIUq.mjs} +21 -21
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +2927 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +349 -0
- package/dist/SeoHealth-09sEOu3G.js +1 -0
- package/dist/{SeoHealth-DVFDz3em.mjs → SeoHealth-BzcWd_w7.mjs} +29 -29
- package/dist/TableView-CPAw3h8g.js +4 -0
- package/dist/TableView-DXmEF6pY.mjs +6143 -0
- package/dist/agenda-BNG05SAq.js +1 -0
- package/dist/agenda-D1RxMxBS.mjs +1152 -0
- package/dist/availability-CMrRa5y2.mjs +269 -0
- package/dist/availability-Cf2YfMwM.js +1 -0
- package/dist/booking-data-DgJd0BcM.mjs +889 -0
- package/dist/booking-data-Di5GmH_8.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-Bp5BSvxO.js → exceptions-CI0B4xVj.js} +1 -1
- package/dist/{exceptions-C97cNZYl.mjs → exceptions-vo8SA5SE.mjs} +68 -68
- package/dist/index-BtujSJeg.js +35 -0
- package/dist/{index-CrGjxSwa.mjs → index-CrgzoTyR.mjs} +1 -1
- package/dist/{index-D2a6wEPh.js → index-DPd3waTN.js} +1 -1
- package/dist/{index-CABh6Qn6.mjs → index-DrXxXB2F.mjs} +15 -15
- package/dist/{index-B-lVEpFX.mjs → index-MYWjg0zi.mjs} +3 -3
- package/dist/index-dOdMm1pV.mjs +1105 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +201 -148
- package/dist/interpolation-DEDSLETn.mjs +128 -0
- package/dist/interpolation-DERg6Lwt.js +1 -0
- package/dist/orders-CzzcFQha.mjs +559 -0
- package/dist/orders-ETtbA4aQ.js +1 -0
- package/dist/{payment-Bosr0m3u.mjs → payment-C3ohkehF.mjs} +1 -1
- package/dist/{payment-DDnC03jb.js → payment-Dfr-Ro-a.js} +1 -1
- package/dist/{resources-BtF5RUUq.js → resources-CxeFd57z.js} +1 -1
- package/dist/{resources-B7qDBC91.mjs → resources-WI_4SO6T.mjs} +2 -2
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +457 -387
- package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
- package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +17 -5
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +1 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -3
- package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +3 -0
- package/dist/src/appointments/components/edit/EventView.vue.d.ts +6 -1
- package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
- package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/index.d.ts +53 -0
- package/dist/src/appointments/pages/edit/agenda.vue.d.ts +3 -1
- package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -26
- package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +7 -3
- package/dist/src/appointments/tools.d.ts +52 -0
- package/dist/src/appointments/types.d.ts +12 -0
- package/dist/src/table/config.d.ts +200 -0
- package/dist/src/table/get_data_flow-DEFAULT.json.d.ts +129 -0
- package/dist/src/table/index.d.ts +200 -0
- package/dist/utils-CanmrIWO.mjs +47 -0
- package/dist/utils-Yd6F5mea.js +3 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +38 -0
- package/dist/Acquisition-DPScJD4t.js +0 -1
- package/dist/AppointmentListTable-CQ0WIXtj.js +0 -1
- package/dist/AppointmentListTable-aV_UJd6j.mjs +0 -159
- package/dist/Audience-Csw1QLmw.js +0 -1
- package/dist/Content-dYr7kYT0.js +0 -1
- package/dist/DateFormatter-DbtOLV0L.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs +0 -74
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js +0 -1
- package/dist/Overview-DBu86Ikb.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-COfCOMsz.js +0 -349
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CYXkhhdp.mjs +0 -2383
- package/dist/SeoHealth-DzftZW1m.js +0 -1
- package/dist/TableView-CIJs118q.mjs +0 -5929
- package/dist/TableView-DzZYf34i.js +0 -4
- package/dist/agenda-DMT75Qfo.mjs +0 -1133
- package/dist/agenda-DxD4RMsy.js +0 -1
- package/dist/availability-B1D4Fyzi.mjs +0 -629
- package/dist/availability-DxrUcYbW.js +0 -1
- package/dist/index-BbqRTXuU.js +0 -35
- package/dist/index-D4GsbUId.mjs +0 -1091
- package/dist/interpolation-BBwG_ON6.mjs +0 -65
- package/dist/interpolation-CsOrww73.js +0 -1
- package/dist/orders-BRfXlWgV.mjs +0 -397
- package/dist/orders-CrCz1WTR.js +0 -1
- package/dist/regular-slots-Cc1jmKuC.mjs +0 -222
- package/dist/regular-slots-DBs1XVeN.js +0 -1
- package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +0 -2
- package/dist/utils-BVKy9S2J.mjs +0 -29
- package/dist/utils-D6CaKJbp.js +0 -2
|
@@ -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:"@container/charts flex flex-col gap-6 w-full max-w-7xl mx-auto py-8"},L={class:"flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center"},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:"flex flex-col @4xl/charts:grid @4xl/charts: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"},le={class:"px-4 py-3 text-right tabular-nums"},re={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,l)=>{const r=(o.sessionDefaultChannelGroup||"other").toLowerCase().replace(/[^a-z0-9]/g,"_");s[r]={label:o.sessionDefaultChannelGroup||"Other",color:c[l%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),l=Math.round(s%60);return o>0?`${o}m ${l}s`:`${l}s`}async function _(){if(!f.value)return;u.value=!0,p.value=null;const s=`${x.value}daysAgo`;try{const[o,l,r,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=l.rows||[],N.value=r.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 l=e.resolveComponent("Button"),r=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(l,{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(r,{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(l,{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(r,{class:"@4xl/charts: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(r,{class:"@4xl/charts: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",le,e.toDisplayString(R(t.averageSessionDuration||0)),1)]))),128))])])]),i.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",re,"No channel data available"))]),_:1})]),_:1})]),e.createVNode(r,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(r,{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;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as Q, ref as p, computed as U, watch as X, onMounted as Y, resolveComponent as b, openBlock as a, createElementBlock as l, createElementVNode as e, Fragment as
|
|
1
|
+
import { defineComponent as Q, ref as p, computed as U, watch as X, onMounted as Y, resolveComponent as b, openBlock as a, createElementBlock as l, createElementVNode as e, Fragment as h, renderList as v, normalizeClass as L, toDisplayString as o, createVNode as r, withCtx as i, unref as x, createCommentVNode as g, createBlock as E, createTextVNode as z, normalizeStyle as F, resolveDynamicComponent as Z } from "vue";
|
|
2
2
|
import { useModule as ee, useModuleRoute as te, useModuleBreadcrumbs as se } from "@oneclick.dev/cms-kit";
|
|
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: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue = { class: "flex items-center
|
|
6
|
+
const ie = { class: "@container/charts flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue = { class: "flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center" }, de = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "flex items-center gap-2"
|
|
9
|
-
}, ce = { class: "flex items-center border rounded-lg overflow-hidden" }, me = ["onClick"],
|
|
9
|
+
}, ce = { class: "flex items-center border rounded-lg overflow-hidden" }, me = ["onClick"], xe = { class: "text-sm text-destructive font-medium" }, fe = {
|
|
10
10
|
key: 2,
|
|
11
11
|
class: "flex items-center justify-center py-20"
|
|
12
|
-
}, pe = { class: "grid @
|
|
12
|
+
}, pe = { class: "flex flex-col @4xl/charts:grid @4xl/charts:grid-cols-3 gap-6" }, he = { class: "relative" }, ge = { class: "absolute inset-0 flex items-center justify-center pointer-events-none" }, _e = { class: "text-center" }, ve = { class: "text-2xl font-bold tabular-nums" }, ye = { class: "mt-4 grid grid-cols-2 gap-x-4 gap-y-1.5 w-full" }, be = { class: "text-xs truncate" }, Ce = { class: "text-xs text-muted-foreground ml-auto tabular-nums" }, ke = { class: "overflow-x-auto" }, we = { class: "w-full text-sm" }, De = { class: "divide-y" }, $e = { class: "px-6 py-3" }, Re = { class: "flex items-center gap-2" }, Me = { class: "font-medium" }, Se = { class: "px-4 py-3 text-right tabular-nums" }, Ue = { class: "px-4 py-3 text-right tabular-nums" }, ze = { class: "px-4 py-3 text-right tabular-nums" }, Ne = { class: "px-4 py-3 text-right tabular-nums" }, qe = { class: "px-4 py-3 text-right tabular-nums" }, Ae = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "px-6 py-8 text-center text-muted-foreground text-sm"
|
|
15
15
|
}, Ge = { class: "flex items-center gap-4" }, Be = ["onClick"], Le = {
|
|
@@ -44,7 +44,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
44
44
|
{ label: "14d", value: "14" },
|
|
45
45
|
{ label: "30d", value: "30" },
|
|
46
46
|
{ label: "90d", value: "90" }
|
|
47
|
-
],
|
|
47
|
+
], f = [
|
|
48
48
|
"#3b82f6",
|
|
49
49
|
"#8b5cf6",
|
|
50
50
|
"#10b981",
|
|
@@ -66,7 +66,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
66
66
|
const m = (s.sessionDefaultChannelGroup || "other").toLowerCase().replace(/[^a-z0-9]/g, "_");
|
|
67
67
|
n[m] = {
|
|
68
68
|
label: s.sessionDefaultChannelGroup || "Other",
|
|
69
|
-
color:
|
|
69
|
+
color: f[c % f.length]
|
|
70
70
|
};
|
|
71
71
|
}), n;
|
|
72
72
|
}), I = U(
|
|
@@ -74,7 +74,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
74
74
|
key: (n.sessionDefaultChannelGroup || "other").toLowerCase().replace(/[^a-z0-9]/g, "_"),
|
|
75
75
|
label: n.sessionDefaultChannelGroup || "Other",
|
|
76
76
|
sessions: n.sessions || 0,
|
|
77
|
-
fill:
|
|
77
|
+
fill: f[s % f.length]
|
|
78
78
|
}))
|
|
79
79
|
), W = U(
|
|
80
80
|
() => _.value.reduce((n, s) => n + (s.sessions || 0), 0)
|
|
@@ -119,7 +119,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
119
119
|
], -1)),
|
|
120
120
|
D.value ? (a(), l("div", de, [
|
|
121
121
|
e("div", ce, [
|
|
122
|
-
(a(), l(
|
|
122
|
+
(a(), l(h, null, v(P, (t) => e("button", {
|
|
123
123
|
key: t.value,
|
|
124
124
|
class: L(["px-3 py-1.5 text-xs font-medium transition-colors", w.value === t.value ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted"]),
|
|
125
125
|
onClick: (d) => w.value = t.value
|
|
@@ -132,20 +132,20 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
132
132
|
disabled: y.value
|
|
133
133
|
}, {
|
|
134
134
|
default: i(() => [
|
|
135
|
-
r(
|
|
135
|
+
r(x(oe), {
|
|
136
136
|
class: L(["size-4", { "animate-spin": y.value }])
|
|
137
137
|
}, null, 8, ["class"])
|
|
138
138
|
]),
|
|
139
139
|
_: 1
|
|
140
140
|
}, 8, ["disabled"])
|
|
141
|
-
])) :
|
|
141
|
+
])) : g("", !0)
|
|
142
142
|
]),
|
|
143
143
|
D.value ? k.value ? (a(), E(m, {
|
|
144
144
|
key: 1,
|
|
145
145
|
class: "p-6 border-destructive/50 bg-destructive/5"
|
|
146
146
|
}, {
|
|
147
147
|
default: i(() => [
|
|
148
|
-
e("p",
|
|
148
|
+
e("p", xe, o(k.value), 1),
|
|
149
149
|
r(c, {
|
|
150
150
|
variant: "outline",
|
|
151
151
|
size: "sm",
|
|
@@ -159,11 +159,11 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
159
159
|
})
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
|
-
})) : y.value ? (a(), l("div",
|
|
163
|
-
r(
|
|
164
|
-
])) : (a(), l(
|
|
162
|
+
})) : y.value ? (a(), l("div", fe, [
|
|
163
|
+
r(x(ne), { class: "size-8 animate-spin text-muted-foreground" })
|
|
164
|
+
])) : (a(), l(h, { key: 3 }, [
|
|
165
165
|
e("div", pe, [
|
|
166
|
-
r(m, { class: "@
|
|
166
|
+
r(m, { class: "@4xl/charts:col-span-1" }, {
|
|
167
167
|
default: i(() => [
|
|
168
168
|
r(G, { class: "pb-2" }, {
|
|
169
169
|
default: i(() => [
|
|
@@ -178,18 +178,18 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
178
178
|
}),
|
|
179
179
|
r(B, { class: "flex flex-col items-center" }, {
|
|
180
180
|
default: i(() => [
|
|
181
|
-
e("div",
|
|
181
|
+
e("div", he, [
|
|
182
182
|
r(J, {
|
|
183
183
|
config: H.value,
|
|
184
184
|
class: "mx-auto aspect-square max-h-[220px]"
|
|
185
185
|
}, {
|
|
186
186
|
default: i(() => [
|
|
187
|
-
r(
|
|
187
|
+
r(x(le), {
|
|
188
188
|
data: I.value,
|
|
189
189
|
margin: { top: 20, bottom: 20, left: 20, right: 20 }
|
|
190
190
|
}, {
|
|
191
191
|
default: i(() => [
|
|
192
|
-
r(
|
|
192
|
+
r(x(re), {
|
|
193
193
|
value: (t) => t.sessions,
|
|
194
194
|
color: (t) => t.fill,
|
|
195
195
|
arcWidth: 40,
|
|
@@ -202,7 +202,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
202
202
|
]),
|
|
203
203
|
_: 1
|
|
204
204
|
}, 8, ["config"]),
|
|
205
|
-
e("div",
|
|
205
|
+
e("div", ge, [
|
|
206
206
|
e("div", _e, [
|
|
207
207
|
e("p", ve, o(u(W.value)), 1),
|
|
208
208
|
s[4] || (s[4] = e("p", { class: "text-xs text-muted-foreground" }, "sessions", -1))
|
|
@@ -210,13 +210,13 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
210
210
|
])
|
|
211
211
|
]),
|
|
212
212
|
e("div", ye, [
|
|
213
|
-
(a(!0), l(
|
|
213
|
+
(a(!0), l(h, null, v(_.value.slice(0, 8), (t, d) => (a(), l("div", {
|
|
214
214
|
key: t.sessionDefaultChannelGroup,
|
|
215
215
|
class: "flex items-center gap-2"
|
|
216
216
|
}, [
|
|
217
217
|
e("div", {
|
|
218
218
|
class: "size-2.5 rounded-full shrink-0",
|
|
219
|
-
style: F({ backgroundColor:
|
|
219
|
+
style: F({ backgroundColor: f[d % f.length] })
|
|
220
220
|
}, null, 4),
|
|
221
221
|
e("span", be, o(t.sessionDefaultChannelGroup), 1),
|
|
222
222
|
e("span", Ce, o(u(t.sessions)), 1)
|
|
@@ -228,7 +228,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
228
228
|
]),
|
|
229
229
|
_: 1
|
|
230
230
|
}),
|
|
231
|
-
r(m, { class: "@
|
|
231
|
+
r(m, { class: "@4xl/charts:col-span-2" }, {
|
|
232
232
|
default: i(() => [
|
|
233
233
|
r(G, { class: "pb-2" }, {
|
|
234
234
|
default: i(() => [
|
|
@@ -256,7 +256,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
256
256
|
])
|
|
257
257
|
], -1)),
|
|
258
258
|
e("tbody", De, [
|
|
259
|
-
(a(!0), l(
|
|
259
|
+
(a(!0), l(h, null, v(_.value, (t, d) => (a(), l("tr", {
|
|
260
260
|
key: t.sessionDefaultChannelGroup,
|
|
261
261
|
class: "hover:bg-muted/50"
|
|
262
262
|
}, [
|
|
@@ -264,7 +264,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
264
264
|
e("div", Re, [
|
|
265
265
|
e("div", {
|
|
266
266
|
class: "size-2.5 rounded-full shrink-0",
|
|
267
|
-
style: F({ backgroundColor:
|
|
267
|
+
style: F({ backgroundColor: f[d % f.length] })
|
|
268
268
|
}, null, 4),
|
|
269
269
|
e("span", Me, o(t.sessionDefaultChannelGroup), 1)
|
|
270
270
|
])
|
|
@@ -278,7 +278,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
278
278
|
])
|
|
279
279
|
])
|
|
280
280
|
]),
|
|
281
|
-
_.value.length ?
|
|
281
|
+
_.value.length ? g("", !0) : (a(), l("div", Ae, "No channel data available"))
|
|
282
282
|
]),
|
|
283
283
|
_: 1
|
|
284
284
|
})
|
|
@@ -291,10 +291,10 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
291
291
|
r(G, { class: "pb-0" }, {
|
|
292
292
|
default: i(() => [
|
|
293
293
|
e("div", Ge, [
|
|
294
|
-
(a(!0), l(
|
|
295
|
-
{ key: "sources", label: "Source / Medium", icon:
|
|
296
|
-
{ key: "referrals", label: "Referrals", icon:
|
|
297
|
-
{ key: "campaigns", label: "Campaigns", icon:
|
|
294
|
+
(a(!0), l(h, null, v([
|
|
295
|
+
{ key: "sources", label: "Source / Medium", icon: x(ae) },
|
|
296
|
+
{ key: "referrals", label: "Referrals", icon: x(T) },
|
|
297
|
+
{ key: "campaigns", label: "Campaigns", icon: x(V) }
|
|
298
298
|
], (t) => (a(), l("button", {
|
|
299
299
|
key: t.key,
|
|
300
300
|
class: L(["flex items-center gap-1.5 px-3 py-2 text-sm font-medium rounded-md transition-colors", C.value === t.key ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"]),
|
|
@@ -323,7 +323,7 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
323
323
|
])
|
|
324
324
|
], -1)),
|
|
325
325
|
e("tbody", Fe, [
|
|
326
|
-
(a(!0), l(
|
|
326
|
+
(a(!0), l(h, null, v(N.value, (t, d) => (a(), l("tr", {
|
|
327
327
|
key: t.sessionSourceMedium,
|
|
328
328
|
class: "hover:bg-muted/50"
|
|
329
329
|
}, [
|
|
@@ -337,16 +337,16 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
337
337
|
])
|
|
338
338
|
])
|
|
339
339
|
]),
|
|
340
|
-
N.value.length ?
|
|
341
|
-
])) :
|
|
340
|
+
N.value.length ? g("", !0) : (a(), l("div", We, "No data available"))
|
|
341
|
+
])) : g("", !0),
|
|
342
342
|
C.value === "referrals" ? (a(), l("div", Ke, [
|
|
343
|
-
(a(!0), l(
|
|
343
|
+
(a(!0), l(h, null, v(q.value, (t, d) => (a(), l("div", {
|
|
344
344
|
key: t.sessionSource,
|
|
345
345
|
class: "flex items-center justify-between px-6 py-3 text-sm hover:bg-muted/50"
|
|
346
346
|
}, [
|
|
347
347
|
e("div", Je, [
|
|
348
348
|
e("span", Qe, o(d + 1), 1),
|
|
349
|
-
r(
|
|
349
|
+
r(x(T), { class: "size-3.5 text-muted-foreground shrink-0" }),
|
|
350
350
|
e("span", Xe, o(t.sessionSource), 1)
|
|
351
351
|
]),
|
|
352
352
|
e("div", Ye, [
|
|
@@ -355,16 +355,16 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
355
355
|
e("span", tt, o(R(t.engagementRate || 0)) + " eng.", 1)
|
|
356
356
|
])
|
|
357
357
|
]))), 128)),
|
|
358
|
-
q.value.length ?
|
|
359
|
-
])) :
|
|
358
|
+
q.value.length ? g("", !0) : (a(), l("div", st, "No referral data available"))
|
|
359
|
+
])) : g("", !0),
|
|
360
360
|
C.value === "campaigns" ? (a(), l("div", ot, [
|
|
361
|
-
(a(!0), l(
|
|
361
|
+
(a(!0), l(h, null, v(A.value, (t, d) => (a(), l("div", {
|
|
362
362
|
key: t.sessionCampaignName,
|
|
363
363
|
class: "flex items-center justify-between px-6 py-3 text-sm hover:bg-muted/50"
|
|
364
364
|
}, [
|
|
365
365
|
e("div", nt, [
|
|
366
366
|
e("span", at, o(d + 1), 1),
|
|
367
|
-
r(
|
|
367
|
+
r(x(V), { class: "size-3.5 text-muted-foreground shrink-0" }),
|
|
368
368
|
e("span", lt, o(t.sessionCampaignName), 1)
|
|
369
369
|
]),
|
|
370
370
|
e("div", rt, [
|
|
@@ -373,8 +373,8 @@ const ie = { class: "flex flex-col gap-6 w-full max-w-7xl mx-auto py-8" }, ue =
|
|
|
373
373
|
e("span", dt, o(R(t.engagementRate || 0)) + " eng.", 1)
|
|
374
374
|
])
|
|
375
375
|
]))), 128)),
|
|
376
|
-
A.value.length ?
|
|
377
|
-
])) :
|
|
376
|
+
A.value.length ? g("", !0) : (a(), l("div", ct, "No campaign data. Use UTM parameters in your URLs to track campaigns."))
|
|
377
|
+
])) : g("", !0)
|
|
378
378
|
]),
|
|
379
379
|
_: 1
|
|
380
380
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),C={class:"w-full"},V={key:0,class:"flex items-center gap-2 py-3"},b={key:1,class:"text-xs text-destructive py-2"},w={key:2,class:"rounded-xl border bg-background p-3 space-y-3"},D={class:"relative flex items-start gap-3"},S={class:"shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center"},I={class:"flex-1 min-w-0 pr-10"},M={class:"text-sm font-semibold truncate"},$={class:"text-xs text-muted-foreground"},T={key:0,class:"text-xs text-muted-foreground text-center py-2"},j={key:1,class:"space-y-2"},z={class:"flex items-center justify-between"},A={class:"text-xs font-medium"},L={key:0,class:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 uppercase"},F={key:0,class:"flex items-center gap-1.5 text-xs text-red-500"},q={key:1,class:"space-y-0.5"},O={key:2,class:"text-xs text-muted-foreground"},H=e.defineComponent({__name:"AgendaOpeningHoursCard",props:{toolName:{},projectSlug:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(r,{emit:f}){const{$useModuleApi:x}=useNuxtApp(),i=r,y=f,k=x(i.instanceId),u=e.ref(!0),a=e.ref(null),d=e.ref(null),v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];async function N(){const{agendaId:n,date:t}=i.resolvedArgs||{};if(!n||!t){a.value="Agenda ID and date are required",u.value=!1,m(`Error: ${a.value}`);return}u.value=!0,a.value=null;try{const o=await k.get(`/agendas/${n}/opening-hours?date=${t}`);d.value=o,m({agendaId:o.agendaId,serviceName:o.serviceName,date:o.date,resources:o.resources.map(s=>({resourceId:s.resourceId,resourceName:s.resourceName,isClosed:s.isClosed,hours:s.hours,isException:s.isException}))})}catch(o){a.value=o?.data?.statusMessage||o?.message||"Failed to load opening hours",m(`Error loading opening hours: ${a.value}`)}finally{u.value=!1}}e.onMounted(()=>{N()});function m(n){i.status!=="completed"&&y("submit",n)}const h=e.computed(()=>{if(!d.value?.date)return"";const n=new Date(d.value.date+"T00:00:00");return`${v[n.getDay()]}, ${n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}`});return(n,t)=>{const o=e.resolveComponent("DropdownMenuTrigger"),s=e.resolveComponent("NuxtLink"),p=e.resolveComponent("DropdownMenuItem"),_=e.resolveComponent("DropdownMenuContent"),E=e.resolveComponent("DropdownMenu");return e.openBlock(),e.createElementBlock("div",C,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),t[0]||(t[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading opening hours…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",b,e.toDisplayString(e.unref(a)),1)):e.unref(d)?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",D,[e.createElementVNode("div",S,[e.createVNode(e.unref(c.CalendarDays),{class:"size-5 text-primary"})]),e.createElementVNode("div",I,[e.createElementVNode("p",M,e.toDisplayString(e.unref(d).serviceName),1),e.createElementVNode("p",$,e.toDisplayString(e.unref(h)),1)]),e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(o,{class:"absolute top-2 right-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Settings),{class:"size-4 text-muted-foreground hover:text-foreground transition-colors"})]),_:1}),e.createVNode(_,{align:"end"},{default:e.withCtx(()=>[e.createVNode(p,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(s,{to:`/projects/${r.projectSlug}/modules/${r.instanceId}/edit/${r.resolvedArgs.agendaId}/resources`},{default:e.withCtx(()=>[e.createVNode(e.unref(c.CalendarCog),{class:"size-4"}),t[1]||(t[1]=e.createTextVNode(" Regular hours ",-1))]),_:1},8,["to"])]),_:1}),e.createVNode(p,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(s,{to:`/projects/${r.projectSlug}/modules/${r.instanceId}/edit/${r.resolvedArgs.agendaId}/exceptions`},{default:e.withCtx(()=>[e.createVNode(e.unref(c.CalendarCog),{class:"size-4"}),t[2]||(t[2]=e.createTextVNode(" Closures & exceptions ",-1))]),_:1},8,["to"])]),_:1})]),_:1})]),_:1})]),e.unref(d).resources.length===0?(e.openBlock(),e.createElementBlock("div",T," No active resources found for this agenda. ")):(e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).resources,l=>(e.openBlock(),e.createElementBlock("div",{key:l.resourceId,class:"rounded-lg border px-3 py-2 space-y-1"},[e.createElementVNode("div",z,[e.createElementVNode("span",A,e.toDisplayString(l.resourceName),1),l.isException?(e.openBlock(),e.createElementBlock("span",L," Exception ")):e.createCommentVNode("",!0)]),l.isClosed?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(c.BanIcon),{class:"size-3"}),t[3]||(t[3]=e.createElementVNode("span",null,"Closed",-1))])):l.hours.length>0?(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.hours,(g,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"flex items-center gap-1.5 text-xs text-muted-foreground"},[e.createVNode(e.unref(c.Clock),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(g.start)+" – "+e.toDisplayString(g.end),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",O," No hours set "))]))),128))]))])):e.createCommentVNode("",!0)])}}});exports.default=H;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineComponent as V, ref as _, onMounted as B, computed as F, resolveComponent as x, openBlock as t, createElementBlock as s, unref as e, createVNode as o, createElementVNode as r, toDisplayString as g, withCtx as m, createTextVNode as b, Fragment as N, renderList as C, createCommentVNode as I } from "vue";
|
|
2
|
+
import { Loader2 as H, CalendarDays as O, Settings as q, CalendarCog as D, BanIcon as R, Clock as U } from "lucide-vue-next";
|
|
3
|
+
const W = { class: "w-full" }, G = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "flex items-center gap-2 py-3"
|
|
6
|
+
}, J = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-xs text-destructive py-2"
|
|
9
|
+
}, K = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "rounded-xl border bg-background p-3 space-y-3"
|
|
12
|
+
}, P = { class: "relative flex items-start gap-3" }, Q = { class: "shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center" }, X = { class: "flex-1 min-w-0 pr-10" }, Y = { class: "text-sm font-semibold truncate" }, Z = { class: "text-xs text-muted-foreground" }, ee = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "text-xs text-muted-foreground text-center py-2"
|
|
15
|
+
}, te = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "space-y-2"
|
|
18
|
+
}, se = { class: "flex items-center justify-between" }, oe = { class: "text-xs font-medium" }, ne = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 uppercase"
|
|
21
|
+
}, ae = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "flex items-center gap-1.5 text-xs text-red-500"
|
|
24
|
+
}, re = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "space-y-0.5"
|
|
27
|
+
}, de = {
|
|
28
|
+
key: 2,
|
|
29
|
+
class: "text-xs text-muted-foreground"
|
|
30
|
+
}, le = /* @__PURE__ */ V({
|
|
31
|
+
__name: "AgendaOpeningHoursCard",
|
|
32
|
+
props: {
|
|
33
|
+
toolName: {},
|
|
34
|
+
projectSlug: {},
|
|
35
|
+
instanceId: {},
|
|
36
|
+
instanceName: {},
|
|
37
|
+
moduleType: {},
|
|
38
|
+
resolvedArgs: {},
|
|
39
|
+
status: {}
|
|
40
|
+
},
|
|
41
|
+
emits: ["submit"],
|
|
42
|
+
setup(u, { emit: w }) {
|
|
43
|
+
const { $useModuleApi: $ } = useNuxtApp(), y = u, M = w, S = $(y.instanceId), f = _(!0), l = _(null), c = _(null), z = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
44
|
+
async function A() {
|
|
45
|
+
const { agendaId: d, date: n } = y.resolvedArgs || {};
|
|
46
|
+
if (!d || !n) {
|
|
47
|
+
l.value = "Agenda ID and date are required", f.value = !1, v(`Error: ${l.value}`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
f.value = !0, l.value = null;
|
|
51
|
+
try {
|
|
52
|
+
const a = await S.get(`/agendas/${d}/opening-hours?date=${n}`);
|
|
53
|
+
c.value = a, v({
|
|
54
|
+
agendaId: a.agendaId,
|
|
55
|
+
serviceName: a.serviceName,
|
|
56
|
+
date: a.date,
|
|
57
|
+
resources: a.resources.map((i) => ({
|
|
58
|
+
resourceId: i.resourceId,
|
|
59
|
+
resourceName: i.resourceName,
|
|
60
|
+
isClosed: i.isClosed,
|
|
61
|
+
hours: i.hours,
|
|
62
|
+
isException: i.isException
|
|
63
|
+
}))
|
|
64
|
+
});
|
|
65
|
+
} catch (a) {
|
|
66
|
+
l.value = a?.data?.statusMessage || a?.message || "Failed to load opening hours", v(`Error loading opening hours: ${l.value}`);
|
|
67
|
+
} finally {
|
|
68
|
+
f.value = !1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
B(() => {
|
|
72
|
+
A();
|
|
73
|
+
});
|
|
74
|
+
function v(d) {
|
|
75
|
+
y.status !== "completed" && M("submit", d);
|
|
76
|
+
}
|
|
77
|
+
const E = F(() => {
|
|
78
|
+
if (!c.value?.date) return "";
|
|
79
|
+
const d = /* @__PURE__ */ new Date(c.value.date + "T00:00:00");
|
|
80
|
+
return `${z[d.getDay()]}, ${d.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" })}`;
|
|
81
|
+
});
|
|
82
|
+
return (d, n) => {
|
|
83
|
+
const a = x("DropdownMenuTrigger"), i = x("NuxtLink"), h = x("DropdownMenuItem"), j = x("DropdownMenuContent"), T = x("DropdownMenu");
|
|
84
|
+
return t(), s("div", W, [
|
|
85
|
+
e(f) ? (t(), s("div", G, [
|
|
86
|
+
o(e(H), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
87
|
+
n[0] || (n[0] = r("span", { class: "text-xs text-muted-foreground" }, "Loading opening hours…", -1))
|
|
88
|
+
])) : e(l) ? (t(), s("div", J, g(e(l)), 1)) : e(c) ? (t(), s("div", K, [
|
|
89
|
+
r("div", P, [
|
|
90
|
+
r("div", Q, [
|
|
91
|
+
o(e(O), { class: "size-5 text-primary" })
|
|
92
|
+
]),
|
|
93
|
+
r("div", X, [
|
|
94
|
+
r("p", Y, g(e(c).serviceName), 1),
|
|
95
|
+
r("p", Z, g(e(E)), 1)
|
|
96
|
+
]),
|
|
97
|
+
o(T, null, {
|
|
98
|
+
default: m(() => [
|
|
99
|
+
o(a, { class: "absolute top-2 right-2" }, {
|
|
100
|
+
default: m(() => [
|
|
101
|
+
o(e(q), { class: "size-4 text-muted-foreground hover:text-foreground transition-colors" })
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
}),
|
|
105
|
+
o(j, { align: "end" }, {
|
|
106
|
+
default: m(() => [
|
|
107
|
+
o(h, { "as-child": "" }, {
|
|
108
|
+
default: m(() => [
|
|
109
|
+
o(i, {
|
|
110
|
+
to: `/projects/${u.projectSlug}/modules/${u.instanceId}/edit/${u.resolvedArgs.agendaId}/resources`
|
|
111
|
+
}, {
|
|
112
|
+
default: m(() => [
|
|
113
|
+
o(e(D), { class: "size-4" }),
|
|
114
|
+
n[1] || (n[1] = b(" Regular hours ", -1))
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["to"])
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}),
|
|
121
|
+
o(h, { "as-child": "" }, {
|
|
122
|
+
default: m(() => [
|
|
123
|
+
o(i, {
|
|
124
|
+
to: `/projects/${u.projectSlug}/modules/${u.instanceId}/edit/${u.resolvedArgs.agendaId}/exceptions`
|
|
125
|
+
}, {
|
|
126
|
+
default: m(() => [
|
|
127
|
+
o(e(D), { class: "size-4" }),
|
|
128
|
+
n[2] || (n[2] = b(" Closures & exceptions ", -1))
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["to"])
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
})
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
})
|
|
141
|
+
]),
|
|
142
|
+
e(c).resources.length === 0 ? (t(), s("div", ee, " No active resources found for this agenda. ")) : (t(), s("div", te, [
|
|
143
|
+
(t(!0), s(N, null, C(e(c).resources, (p) => (t(), s("div", {
|
|
144
|
+
key: p.resourceId,
|
|
145
|
+
class: "rounded-lg border px-3 py-2 space-y-1"
|
|
146
|
+
}, [
|
|
147
|
+
r("div", se, [
|
|
148
|
+
r("span", oe, g(p.resourceName), 1),
|
|
149
|
+
p.isException ? (t(), s("span", ne, " Exception ")) : I("", !0)
|
|
150
|
+
]),
|
|
151
|
+
p.isClosed ? (t(), s("div", ae, [
|
|
152
|
+
o(e(R), { class: "size-3" }),
|
|
153
|
+
n[3] || (n[3] = r("span", null, "Closed", -1))
|
|
154
|
+
])) : p.hours.length > 0 ? (t(), s("div", re, [
|
|
155
|
+
(t(!0), s(N, null, C(p.hours, (k, L) => (t(), s("div", {
|
|
156
|
+
key: L,
|
|
157
|
+
class: "flex items-center gap-1.5 text-xs text-muted-foreground"
|
|
158
|
+
}, [
|
|
159
|
+
o(e(U), { class: "size-3" }),
|
|
160
|
+
r("span", null, g(k.start) + " – " + g(k.end), 1)
|
|
161
|
+
]))), 128))
|
|
162
|
+
])) : (t(), s("div", de, " No hours set "))
|
|
163
|
+
]))), 128))
|
|
164
|
+
]))
|
|
165
|
+
])) : I("", !0)
|
|
166
|
+
]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
export {
|
|
171
|
+
le as default
|
|
172
|
+
};
|