@oneclick.dev/cms-core-modules 0.0.124 → 0.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-DX1bTQKs.mjs → ContentEditor-D754iLJS.mjs} +8074 -27026
- package/dist/{Detail-B7pe808q.mjs → Detail-BOxWQ1QQ.mjs} +2 -2
- package/dist/{Detail-B_Q7Qkuz.mjs → Detail-BfKW0uZE.mjs} +2 -2
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/{Detail-t3tOcy3X.js → Detail-DJea_fCd.js} +1 -1
- package/dist/{Detail-CNiLIEh9.js → Detail-DPJacXfm.js} +1 -1
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/{Detail-BESGmY7z.js → Detail-DUGThL9Y.js} +1 -1
- package/dist/{Detail-DNxAzeCs.mjs → Detail-D_LlEeHu.mjs} +2 -2
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +237 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2055 -1123
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +4 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/{types-ibC3-e1N.mjs → types-B5MifmeF.mjs} +339 -273
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/{vee-validate-zod-BQElPD0m.js → vee-validate-zod-CWZwNTWE.js} +1 -1
- package/dist/{vee-validate-zod-CN16K2x9.mjs → vee-validate-zod-D0WaDgDZ.mjs} +1 -1
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-BcIUumah.js +0 -467
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-6mdrL3zx.js +0 -4
- package/dist/TableView-Du5nOE6R.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/types-BMraG1kN.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("@oneclick.dev/cms-kit"),c=require("lucide-vue-next"),oe=require("./fuse-_CGUd5Zq.js"),ne=require("./EditLayout.vue_vue_type_script_setup_true_lang-D1b9_iiN.js"),g=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-DzPOadcU.js"),ae=require("./_plugin-vue_export-helper-BHFhmbuH.js"),re={class:"space-y-6"},se={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},le={class:"text-2xl font-semibold tracking-tight flex items-center gap-2"},ce={class:"flex gap-1 border rounded-lg p-1 w-fit bg-card"},de={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},ie={class:"flex items-center gap-1"},ue={class:"flex items-center gap-1"},me={class:"flex items-center gap-2"},pe={class:"flex items-center gap-1"},fe={class:"mt-2 text-sm text-muted-foreground"},xe={class:"orders-date-trigger"},ve={class:"relative mb-4"},ge={key:0,class:"mb-3 text-sm text-muted-foreground"},ke={key:1,class:"flex items-center justify-center py-8"},_e={key:2,class:"text-center py-8 text-muted-foreground"},ye={key:3,class:"text-center py-8 text-muted-foreground"},he={key:4,class:"-mx-6 @5xl:mx-0 @5xl:space-y-2"},Ne=["onClick"],be={class:"flex items-start justify-between"},Ve={class:"flex-1"},we={class:"font-medium"},Ee={class:"text-sm text-muted-foreground"},De={class:"text-sm text-muted-foreground"},Ce={class:"flex items-center gap-4 flex-wrap mt-1"},Be={class:"flex items-center gap-2 text-xs text-muted-foreground"},Se={class:"flex items-center gap-2 text-xs text-muted-foreground"},Ie={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},Pe={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Ae={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},ze={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Oe={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},je={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Re={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Fe={key:5,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},qe={key:6,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Le={key:7,class:"text-sm font-medium mt-1"},Me={key:1},Ue=["onClick"],$e={class:"flex items-start justify-between"},He={class:"flex-1"},Ke={class:"flex items-center flex-wrap gap-x-2"},Qe={class:"font-medium"},Xe={class:"text-sm text-muted-foreground"},Ye={class:"text-sm text-muted-foreground"},Ge={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Je={class:"text-right"},We={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Ze={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},et={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},tt={class:"text-sm font-medium mt-1"},ot=["onClick"],nt={class:"flex items-center justify-between"},at={class:"flex items-center gap-4 flex-wrap"},rt={class:"flex items-center gap-2 text-xs text-muted-foreground"},st={class:"flex items-center gap-2 text-xs text-muted-foreground"},lt={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},ct={key:0,class:"text-right flex items-center gap-2"},dt={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},it={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},ut={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},mt={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},pt={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},ft={key:5,class:"text-sm font-medium"},xt=e.defineComponent({__name:"orders",setup(gt){const h=v.useRoute();v.useRouter();const A=v.useOverlayParams(),{params:V}=v.useModuleRoute(),{config:N}=v.useModule(),w=v.useFirebaseIntegration(N.project),T=e.computed(()=>V.value?.id??V.id??""),{metadataSchema:E}=g.useAgendaMetadataSchema(T),u=e.ref([]),k=e.ref([]),_=e.ref(!0),D=e.ref(null),p=e.ref(""),y=e.ref(null),C=e.ref(null),x=e.ref("confirmed"),z=new Date,d=e.ref(new Date),O=e.ref(null),U=e.computed(()=>({date:j(d.value),resource:null}));e.provide("event",U);const B=e.computed({get:()=>j(d.value),set:o=>{if(!o){d.value=new Date;return}d.value=new Date(`${o}T00:00:00`)}}),$=()=>{const o=O.value;if(o){if(typeof o.showPicker=="function"){o.showPicker();return}o.focus(),o.click()}},H=e.computed(()=>d.value.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})),K=()=>{const o=new Date(d.value);o.setDate(o.getDate()-1),d.value=o},Q=()=>{const o=new Date(d.value);o.setDate(o.getDate()+1),o<=z&&(d.value=o)},X=e.computed(()=>{const o=new Date(d.value);return o.setDate(o.getDate()+1),o<=z}),Y=()=>{d.value=new Date},j=o=>{const t=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),r=String(o.getDate()).padStart(2,"0");return`${t}-${a}-${r}`},R=o=>o?new Date(o).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",F=o=>o?new Date(o).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):"",q=(o,t)=>{const a=k.value.find(i=>i.id===t.resourceId),r=o.id||o.orderId||t.orderId||"";return{customerInfo:o.customerInfo,amountDue:o.amountDue,amountPaid:o.amountPaid,status:o.status,reservationStatus:t.status,subtotal:o.subtotal,total:o.total,discount:o.discount,id:r,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:t.date,createdAt:o.createdAt,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:a?.name,resourceColor:a?.color,metadata:o.metadata||{},reservationMetadata:t.metadata||{},refundStatus:t.refundStatus,refundedAt:t.refundedAt,refundedAmount:t.refundedAmount,refunds:Array.isArray(t.refunds)?t.refunds:[],adjustments:o.adjustments||[],reservationAdjustments:t.adjustments||[]}},S=async()=>{await e.nextTick(),await new Promise(o=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>o());return}o()})},I=e.computed(()=>p.value.trim()?new oe.Fuse(u.value,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone","resourceName"],threshold:.3,ignoreLocation:!0}).search(p.value).map(t=>t.item):u.value),L=e.computed(()=>{const o=new Map;for(const t of I.value){o.has(t.id)||o.set(t.id,{id:t.id,customerInfo:t.customerInfo,status:t.status,createdAt:t.createdAt,metadata:t.metadata||{},reservations:[],adjustments:t.adjustments||[],totalPrice:0,totalSpots:0});const a=o.get(t.id);a.reservations.push(t),a.totalPrice=typeof t.total=="number"?t.total:a.totalPrice+(t.reservationPrice||0),a.totalSpots+=t.spots||0}return Array.from(o.values())}),b=e.computed(()=>(console.log("orderssss",u.value),{spots:u.value.reduce((o,t)=>o+(t.spots||0),0),bookings:u.value.length,revenue:L.value.reduce((o,t)=>o+(t.totalPrice||0),0)})),G=()=>{p.value=""},J=async()=>{try{const o=await w.get(N.agendaCollection,T.value);D.value=o,k.value=o?.resources?.filter(t=>t.isActive)||[]}catch(o){console.error("Error loading resources:",o),k.value=[]}},f=async()=>{_.value=!0,u.value=[];try{const o=V.value.id,t=new Date(d.value);t.setHours(0,0,0,0);const a=new Date(d.value);a.setHours(23,59,59,999);const r=await w.find(N.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:o},{field:"createdAt",operator:">=",value:t.toISOString()},{field:"createdAt",operator:"<=",value:a.toISOString()},{field:"status",operator:"==",value:x.value}]});let i=[];r.forEach(l=>{(l.reservations||[]).forEach(P=>{i.push(q(l,P))})}),u.value=i.sort((l,m)=>(m.createdAt||"").localeCompare(l.createdAt||""))}catch(o){console.error("Error loading orders:",o),u.value=[]}finally{_.value=!1}},W=async()=>{await J(),await f()},M=async(o,t)=>{const a=await w.get(N.reservationsCollection,o);if(!a)return;const r={...a,id:a.id||o},i=(r.reservations||[]).map(l=>q(r,l));if(t){const l=i.find(m=>m.res_id===t);if(!l)return;await S(),y.value?.openDialog(l);return}i.length&&(await S(),C.value?.openDialog({id:r.id,customerInfo:r.customerInfo,status:r.status,createdAt:r.createdAt,metadata:r.metadata||{},reservations:i,adjustments:r.adjustments||[],totalPrice:typeof r.total=="number"?r.total:i.reduce((l,m)=>l+(m.reservationPrice||0),0),totalSpots:i.reduce((l,m)=>l+(m.spots||0),0)}))},Z=async o=>{await S(),y.value?.openDialog(o)};return W(),e.onMounted(async()=>{const o=typeof h.query.orderId=="string"&&!!h.query.orderId,t=o?h.query.orderId:A.value.orderId,a=o?h.query.reservationId:A.value.reservationId;if(t){const r=new URL(window.location.href);r.searchParams.delete("orderId"),r.searchParams.delete("reservationId"),window.history.replaceState(window.history.state,"",r.toString()),await M(t,a)}}),e.watch(d,()=>{f()}),e.watch(x,()=>{f()}),(o,t)=>{const a=e.resolveComponent("Button"),r=e.resolveComponent("Badge"),i=e.resolveComponent("CardTitle"),l=e.resolveComponent("CardDescription"),m=e.resolveComponent("CardHeader"),P=e.resolveComponent("Input"),ee=e.resolveComponent("CardContent"),te=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(ne._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.createElementVNode("div",se,[e.createElementVNode("div",null,[e.createElementVNode("h1",le,[e.createVNode(e.unref(c.ShoppingBag),{class:"size-6"}),t[4]||(t[4]=e.createTextVNode(" Orders ",-1))]),t[5]||(t[5]=e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"}," View orders by when they were placed ",-1))])]),e.createElementVNode("div",ce,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["confirmed","pending","cancelled"],n=>e.createVNode(a,{key:n,variant:e.unref(x)===n?"default":"ghost",size:"sm",class:"capitalize",onClick:s=>x.value=n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n),1)]),_:2},1032,["variant","onClick"])),64))]),e.createVNode(te,{class:"-mx-6 rounded-none border-x-0 @5xl:mx-0 @5xl:rounded-xl @5xl:border-x-[1px]"},{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",de,[e.createElementVNode("div",null,[e.createVNode(i,{class:"flex items-center gap-2"},{default:e.withCtx(()=>[t[6]||(t[6]=e.createTextVNode(" Orders received ",-1)),e.unref(b).bookings>0?(e.openBlock(),e.createBlock(r,{key:0,variant:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).bookings),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(l,{class:"flex items-center gap-4 mt-1"},{default:e.withCtx(()=>[e.createElementVNode("span",ie,[e.createVNode(e.unref(c.Users),{size:14}),e.createTextVNode(" "+e.toDisplayString(e.unref(b).spots)+" spots ",1)]),e.createElementVNode("span",ue," €"+e.toDisplayString(e.unref(b).revenue.toFixed(2))+e.toDisplayString(e.unref(x)==="pending"?" pending ":e.unref(x)==="cancelled"?" cancelled ":" ")+"revenue ",1)]),_:1})]),e.createElementVNode("div",me,[e.createElementVNode("div",pe,[e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:K},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ChevronLeft),{size:16})]),_:1}),e.createVNode(a,{variant:"outline",size:"sm",class:"h-8 px-3 text-xs",onClick:Y},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:Q,disabled:!e.unref(X)},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ChevronRight),{size:16})]),_:1},8,["disabled"])]),e.createVNode(a,{variant:"outline",size:"icon",onClick:f,disabled:e.unref(_)},{default:e.withCtx(()=>[e.createVNode(e.unref(c.RefreshCw),{size:16,class:e.normalizeClass({"animate-spin":e.unref(_)})},null,8,["class"])]),_:1},8,["disabled"])])]),e.createElementVNode("div",fe,[e.createElementVNode("div",xe,[e.createVNode(a,{type:"button",variant:"outline",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(c.CalendarIcon),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(e.unref(H)),1)]),_:1}),e.withDirectives(e.createElementVNode("input",{ref_key:"dateInputRef",ref:O,"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(B)?B.value=n:null),type:"date",class:"orders-date-picker","aria-label":"Select order date"},null,512),[[e.vModelText,e.unref(B)]])])])]),_:1}),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createElementVNode("div",ve,[e.createVNode(e.unref(c.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(P,{modelValue:e.unref(p),"onUpdate:modelValue":t[1]||(t[1]=n=>e.isRef(p)?p.value=n:null),placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9"},null,8,["modelValue"]),e.unref(p)?(e.openBlock(),e.createBlock(a,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:G},{default:e.withCtx(()=>[e.createVNode(e.unref(c.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),e.unref(p)?(e.openBlock(),e.createElementBlock("div",ge," Showing "+e.toDisplayString(e.unref(I).length)+" of "+e.toDisplayString(e.unref(u).length)+" orders ",1)):e.createCommentVNode("",!0),e.unref(_)?(e.openBlock(),e.createElementBlock("div",ke,[...t[8]||(t[8]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):e.unref(u).length===0?(e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(e.unref(c.ShoppingBag),{class:"size-12 mx-auto mb-3 opacity-50"}),t[9]||(t[9]=e.createElementVNode("p",null,"No orders received on this day",-1))])):e.unref(I).length===0?(e.openBlock(),e.createElementBlock("div",ye," No orders match your search ")):(e.openBlock(),e.createElementBlock("div",he,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(L),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"border-t last:border-b @5xl:border @5xl:rounded-lg overflow-hidden @5xl:shadow-sm"},[n.reservations.length===1?(e.openBlock(),e.createElementBlock("div",{key:0,class:"px-6 py-3 @5xl:px-3 hover:bg-muted/50 transition-colors cursor-pointer",onClick:s=>e.unref(y)?.openDialog(n.reservations[0])},[e.createElementVNode("div",be,[e.createElementVNode("div",Ve,[e.createElementVNode("div",we,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createElementVNode("div",Ee,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",De,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[e.createVNode(e.unref(c.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(n.reservations[0].date))+" · "+e.toDisplayString(n.reservations[0].startTime)+" - "+e.toDisplayString(n.reservations[0].endTime),1)]),e.createElementVNode("div",Se,[e.createVNode(e.unref(c.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].spots)+" spots",1)]),n.reservations[0].resourceName?(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:n.reservations[0].resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].resourceName),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Pe,[e.createVNode(e.unref(c.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(g._sfc_main,{metadata:{...n.reservations[0].metadata,...n.reservations[0].reservationMetadata},schema:e.unref(E),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Ae,[n.reservations[0].status==="pending"?(e.openBlock(),e.createElementBlock("span",Te,"Pending")):n.reservations[0].status==="cancelled"?(e.openBlock(),e.createElementBlock("span",ze,"Cancelled")):n.reservations[0].reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",Oe,"Needs Approval")):n.reservations[0].reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",je,"Approved")):n.reservations[0].reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",Re,"Cancelled")):n.reservations[0].reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Fe,"Rejected")):(e.openBlock(),e.createElementBlock("span",qe,"Pending")),n.reservations[0].reservationPrice||n.reservations[0].reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Le," €"+e.toDisplayString(n.totalPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,Ne)):(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("div",{class:"px-6 py-3 @5xl:px-3 bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",onClick:s=>e.unref(C)?.openDialog(n)},[e.createElementVNode("div",$e,[e.createElementVNode("div",He,[e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createVNode(r,{variant:"secondary",class:"text-xs whitespace-nowrap"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.reservations.length)+" reservations ",1)]),_:2},1024)]),e.createElementVNode("div",Xe,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",Ye,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Ge,[e.createVNode(e.unref(c.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(g._sfc_main,{metadata:n.metadata,schema:e.unref(E),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Je,[n.status==="pending"?(e.openBlock(),e.createElementBlock("span",We,"Pending")):n.status==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ze,"Cancelled")):(e.openBlock(),e.createElementBlock("span",et,"Confirmed")),e.createElementVNode("div",tt," €"+e.toDisplayString(n.totalPrice.toFixed(2)),1)])])],8,Ue),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.reservations,s=>(e.openBlock(),e.createElementBlock("div",{key:s.res_id,class:"px-6 py-3 @5xl:px-3 border-t bg-muted/50 dark:bg-transparent dark:hover:bg-muted/50 transition-colors cursor-pointer",onClick:kt=>e.unref(y)?.openDialog(s)},[e.createElementVNode("div",nt,[e.createElementVNode("div",at,[e.createElementVNode("div",rt,[e.createVNode(e.unref(c.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(s.date))+" · "+e.toDisplayString(s.startTime)+" - "+e.toDisplayString(s.endTime),1)]),e.createElementVNode("div",st,[e.createVNode(e.unref(c.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(s.spots)+" spots",1)]),s.resourceName?(e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:s.resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(s.resourceName),1)])):e.createCommentVNode("",!0)]),s.status==="confirmed"?(e.openBlock(),e.createElementBlock("div",ct,[s.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",dt,"Needs Approval")):s.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",it,"Approved")):s.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",ut,"Cancelled")):s.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",mt,"Rejected")):(e.openBlock(),e.createElementBlock("span",pt,"Pending")),s.reservationPrice||s.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",ft," €"+e.toDisplayString(s.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createVNode(g._sfc_main,{metadata:s.reservationMetadata,schema:e.unref(E),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])],8,ot))),128))]))]))),128))]))]),_:1})]),_:1})])]),_:1}),e.createVNode(g._sfc_main$1,{ref_key:"reservationDetailDialog",ref:y,"agenda-data":e.unref(D),resources:e.unref(k),"show-order-link":"",onCancelled:f,onConfirmed:f,onRejected:f,onTransferred:f,onOpenOrder:t[2]||(t[2]=n=>M(n))},null,8,["agenda-data","resources"]),e.createVNode(g._sfc_main$2,{ref_key:"orderDetailDialog",ref:C,"agenda-data":e.unref(D),resources:e.unref(k),onOpenReservation:t[3]||(t[3]=n=>Z(n))},null,8,["agenda-data","resources"])],64)}}}),vt=ae._export_sfc(xt,[["__scopeId","data-v-fcb7e1ac"]]);exports.default=vt;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as ke, computed as k, ref as g, provide as be, onMounted as we, watch as se, resolveComponent as b, openBlock as n, createElementBlock as l, Fragment as
|
|
1
|
+
import { defineComponent as ke, computed as k, ref as g, provide as be, onMounted as we, watch as se, resolveComponent as b, openBlock as n, createElementBlock as l, Fragment as O, createVNode as r, withCtx as f, createElementVNode as a, unref as o, createTextVNode as w, renderList as L, toDisplayString as d, createBlock as ae, createCommentVNode as D, normalizeClass as De, withDirectives as Ce, isRef as oe, vModelText as Ie, normalizeStyle as ne, nextTick as Se } from "vue";
|
|
2
2
|
import { useRoute as Pe, useRouter as Ae, useOverlayParams as Ne, useModuleRoute as ze, useModule as Oe, useFirebaseIntegration as je } from "@oneclick.dev/cms-kit";
|
|
3
|
-
import { ShoppingBag as re, Users as
|
|
3
|
+
import { ShoppingBag as re, Users as E, ChevronLeft as Te, ChevronRight as Re, RefreshCw as Fe, CalendarIcon as q, Search as Be, X as $e, Clock as le } from "lucide-vue-next";
|
|
4
4
|
import { F as Me } from "./fuse-Deb-Iq39.mjs";
|
|
5
5
|
import { _ as Ve } from "./EditLayout.vue_vue_type_script_setup_true_lang-4_t0PPqM.mjs";
|
|
6
6
|
import { u as Ue, _ as H, a as Le, b as Ee } from "./OrderDetailDialog.vue_vue_type_script_setup_true_lang-BdFa-xNf.mjs";
|
|
7
|
-
import { _ as
|
|
8
|
-
const
|
|
7
|
+
import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
8
|
+
const He = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Xe = { class: "text-2xl font-semibold tracking-tight flex items-center gap-2" }, Ye = { class: "flex gap-1 border rounded-lg p-1 w-fit bg-card" }, Ge = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Je = { class: "flex items-center gap-1" }, Ke = { class: "flex items-center gap-1" }, We = { class: "flex items-center gap-2" }, Ze = { class: "flex items-center gap-1" }, et = { class: "mt-2 text-sm text-muted-foreground" }, tt = { class: "orders-date-trigger" }, st = { class: "relative mb-4" }, at = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "mb-3 text-sm text-muted-foreground"
|
|
11
11
|
}, ot = {
|
|
@@ -56,7 +56,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
56
56
|
}, Vt = {
|
|
57
57
|
key: 2,
|
|
58
58
|
class: "inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"
|
|
59
|
-
}, Ut = { class: "text-sm font-medium mt-1" }, Lt = ["onClick"], Et = { class: "flex items-center justify-between" },
|
|
59
|
+
}, Ut = { class: "text-sm font-medium mt-1" }, Lt = ["onClick"], Et = { class: "flex items-center justify-between" }, qt = { class: "flex items-center gap-4 flex-wrap" }, Ht = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Qt = { class: "flex items-center gap-2 text-xs text-muted-foreground" }, Xt = {
|
|
60
60
|
key: 0,
|
|
61
61
|
class: "flex items-center gap-1 text-xs text-muted-foreground"
|
|
62
62
|
}, Yt = {
|
|
@@ -83,14 +83,14 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
83
83
|
}, ts = /* @__PURE__ */ ke({
|
|
84
84
|
__name: "orders",
|
|
85
85
|
setup(ss) {
|
|
86
|
-
const
|
|
86
|
+
const A = Pe();
|
|
87
87
|
Ae();
|
|
88
|
-
const Q = Ne(), { params:
|
|
88
|
+
const Q = Ne(), { params: j } = ze(), { config: N } = Oe(), T = je(N.project), X = k(() => j.value?.id ?? j.id ?? ""), { metadataSchema: R } = Ue(X), v = g([]), I = g([]), S = g(!0), F = g(null), h = g(""), P = g(null), B = g(null), C = g("confirmed"), Y = /* @__PURE__ */ new Date(), x = g(/* @__PURE__ */ new Date()), G = g(null), de = k(() => ({
|
|
89
89
|
date: J(x.value),
|
|
90
90
|
resource: null
|
|
91
91
|
}));
|
|
92
92
|
be("event", de);
|
|
93
|
-
const
|
|
93
|
+
const $ = k({
|
|
94
94
|
get: () => J(x.value),
|
|
95
95
|
set: (t) => {
|
|
96
96
|
if (!t) {
|
|
@@ -125,8 +125,8 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
125
125
|
}), xe = () => {
|
|
126
126
|
x.value = /* @__PURE__ */ new Date();
|
|
127
127
|
}, J = (t) => {
|
|
128
|
-
const e = t.getFullYear(), i = String(t.getMonth() + 1).padStart(2, "0"),
|
|
129
|
-
return `${e}-${i}-${
|
|
128
|
+
const e = t.getFullYear(), i = String(t.getMonth() + 1).padStart(2, "0"), c = String(t.getDate()).padStart(2, "0");
|
|
129
|
+
return `${e}-${i}-${c}`;
|
|
130
130
|
}, K = (t) => t ? new Date(t).toLocaleTimeString("en-US", {
|
|
131
131
|
hour: "2-digit",
|
|
132
132
|
minute: "2-digit",
|
|
@@ -136,7 +136,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
136
136
|
month: "short",
|
|
137
137
|
day: "numeric"
|
|
138
138
|
}) : "", Z = (t, e) => {
|
|
139
|
-
const i = I.value.find((p) => p.id === e.resourceId),
|
|
139
|
+
const i = I.value.find((p) => p.id === e.resourceId), c = t.id || t.orderId || e.orderId || "";
|
|
140
140
|
return {
|
|
141
141
|
customerInfo: t.customerInfo,
|
|
142
142
|
amountDue: t.amountDue,
|
|
@@ -146,7 +146,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
146
146
|
subtotal: t.subtotal,
|
|
147
147
|
total: t.total,
|
|
148
148
|
discount: t.discount,
|
|
149
|
-
id:
|
|
149
|
+
id: c,
|
|
150
150
|
res_id: e.id,
|
|
151
151
|
resourceId: e.resourceId,
|
|
152
152
|
spots: e.spots,
|
|
@@ -170,7 +170,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
170
170
|
adjustments: t.adjustments || [],
|
|
171
171
|
reservationAdjustments: e.adjustments || []
|
|
172
172
|
};
|
|
173
|
-
},
|
|
173
|
+
}, M = async () => {
|
|
174
174
|
await Se(), await new Promise((t) => {
|
|
175
175
|
if (typeof requestAnimationFrame == "function") {
|
|
176
176
|
requestAnimationFrame(() => t());
|
|
@@ -178,7 +178,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
178
178
|
}
|
|
179
179
|
t();
|
|
180
180
|
});
|
|
181
|
-
},
|
|
181
|
+
}, V = k(() => h.value.trim() ? new Me(v.value, {
|
|
182
182
|
keys: [
|
|
183
183
|
"customerInfo.firstName",
|
|
184
184
|
"customerInfo.lastName",
|
|
@@ -190,7 +190,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
190
190
|
ignoreLocation: !0
|
|
191
191
|
}).search(h.value).map((e) => e.item) : v.value), ee = k(() => {
|
|
192
192
|
const t = /* @__PURE__ */ new Map();
|
|
193
|
-
for (const e of
|
|
193
|
+
for (const e of V.value) {
|
|
194
194
|
t.has(e.id) || t.set(e.id, {
|
|
195
195
|
id: e.id,
|
|
196
196
|
customerInfo: e.customerInfo,
|
|
@@ -206,7 +206,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
206
206
|
i.reservations.push(e), i.totalPrice = typeof e.total == "number" ? e.total : i.totalPrice + (e.reservationPrice || 0), i.totalSpots += e.spots || 0;
|
|
207
207
|
}
|
|
208
208
|
return Array.from(t.values());
|
|
209
|
-
}),
|
|
209
|
+
}), z = k(() => (console.log("orderssss", v.value), {
|
|
210
210
|
spots: v.value.reduce((t, e) => t + (e.spots || 0), 0),
|
|
211
211
|
bookings: v.value.length,
|
|
212
212
|
revenue: ee.value.reduce((t, e) => t + (e.totalPrice || 0), 0)
|
|
@@ -214,19 +214,19 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
214
214
|
h.value = "";
|
|
215
215
|
}, ve = async () => {
|
|
216
216
|
try {
|
|
217
|
-
const t = await
|
|
218
|
-
|
|
217
|
+
const t = await T.get(N.agendaCollection, X.value);
|
|
218
|
+
F.value = t, I.value = t?.resources?.filter((e) => e.isActive) || [];
|
|
219
219
|
} catch (t) {
|
|
220
220
|
console.error("Error loading resources:", t), I.value = [];
|
|
221
221
|
}
|
|
222
222
|
}, y = async () => {
|
|
223
223
|
S.value = !0, v.value = [];
|
|
224
224
|
try {
|
|
225
|
-
const t =
|
|
225
|
+
const t = j.value.id, e = new Date(x.value);
|
|
226
226
|
e.setHours(0, 0, 0, 0);
|
|
227
227
|
const i = new Date(x.value);
|
|
228
228
|
i.setHours(23, 59, 59, 999);
|
|
229
|
-
const
|
|
229
|
+
const c = await T.find(N.reservationsCollection, {
|
|
230
230
|
filters: [
|
|
231
231
|
{ field: "agendaId", operator: "==", value: t },
|
|
232
232
|
{ field: "createdAt", operator: ">=", value: e.toISOString() },
|
|
@@ -235,9 +235,9 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
235
235
|
]
|
|
236
236
|
});
|
|
237
237
|
let p = [];
|
|
238
|
-
|
|
239
|
-
(m.reservations || []).forEach((
|
|
240
|
-
p.push(Z(m,
|
|
238
|
+
c.forEach((m) => {
|
|
239
|
+
(m.reservations || []).forEach((U) => {
|
|
240
|
+
p.push(Z(m, U));
|
|
241
241
|
});
|
|
242
242
|
}), v.value = p.sort((m, _) => (_.createdAt || "").localeCompare(m.createdAt || ""));
|
|
243
243
|
} catch (t) {
|
|
@@ -248,45 +248,45 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
248
248
|
}, _e = async () => {
|
|
249
249
|
await ve(), await y();
|
|
250
250
|
}, te = async (t, e) => {
|
|
251
|
-
const i = await
|
|
251
|
+
const i = await T.get(N.reservationsCollection, t);
|
|
252
252
|
if (!i) return;
|
|
253
|
-
const
|
|
253
|
+
const c = { ...i, id: i.id || t }, p = (c.reservations || []).map((m) => Z(c, m));
|
|
254
254
|
if (e) {
|
|
255
255
|
const m = p.find((_) => _.res_id === e);
|
|
256
256
|
if (!m) return;
|
|
257
|
-
await
|
|
257
|
+
await M(), P.value?.openDialog(m);
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
p.length && (await
|
|
261
|
-
id:
|
|
262
|
-
customerInfo:
|
|
263
|
-
status:
|
|
264
|
-
createdAt:
|
|
265
|
-
metadata:
|
|
260
|
+
p.length && (await M(), B.value?.openDialog({
|
|
261
|
+
id: c.id,
|
|
262
|
+
customerInfo: c.customerInfo,
|
|
263
|
+
status: c.status,
|
|
264
|
+
createdAt: c.createdAt,
|
|
265
|
+
metadata: c.metadata || {},
|
|
266
266
|
reservations: p,
|
|
267
|
-
adjustments:
|
|
268
|
-
totalPrice: typeof
|
|
267
|
+
adjustments: c.adjustments || [],
|
|
268
|
+
totalPrice: typeof c.total == "number" ? c.total : p.reduce((m, _) => m + (_.reservationPrice || 0), 0),
|
|
269
269
|
totalSpots: p.reduce((m, _) => m + (_.spots || 0), 0)
|
|
270
270
|
}));
|
|
271
271
|
}, ge = async (t) => {
|
|
272
|
-
await
|
|
272
|
+
await M(), P.value?.openDialog(t);
|
|
273
273
|
};
|
|
274
274
|
return _e(), we(async () => {
|
|
275
|
-
const t =
|
|
276
|
-
if (
|
|
277
|
-
const
|
|
278
|
-
|
|
275
|
+
const t = typeof A.query.orderId == "string" && !!A.query.orderId, e = t ? A.query.orderId : Q.value.orderId, i = t ? A.query.reservationId : Q.value.reservationId;
|
|
276
|
+
if (e) {
|
|
277
|
+
const c = new URL(window.location.href);
|
|
278
|
+
c.searchParams.delete("orderId"), c.searchParams.delete("reservationId"), window.history.replaceState(window.history.state, "", c.toString()), await te(e, i);
|
|
279
279
|
}
|
|
280
280
|
}), se(x, () => {
|
|
281
281
|
y();
|
|
282
282
|
}), se(C, () => {
|
|
283
283
|
y();
|
|
284
284
|
}), (t, e) => {
|
|
285
|
-
const i = b("Button"),
|
|
286
|
-
return n(), l(
|
|
285
|
+
const i = b("Button"), c = b("Badge"), p = b("CardTitle"), m = b("CardDescription"), _ = b("CardHeader"), U = b("Input"), he = b("CardContent"), ye = b("Card");
|
|
286
|
+
return n(), l(O, null, [
|
|
287
287
|
r(Ve, null, {
|
|
288
288
|
default: f(() => [
|
|
289
|
-
a("div",
|
|
289
|
+
a("div", He, [
|
|
290
290
|
a("div", Qe, [
|
|
291
291
|
a("div", null, [
|
|
292
292
|
a("h1", Xe, [
|
|
@@ -297,12 +297,12 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
297
297
|
])
|
|
298
298
|
]),
|
|
299
299
|
a("div", Ye, [
|
|
300
|
-
(n(), l(
|
|
300
|
+
(n(), l(O, null, L(["confirmed", "pending", "cancelled"], (s) => r(i, {
|
|
301
301
|
key: s,
|
|
302
302
|
variant: o(C) === s ? "default" : "ghost",
|
|
303
303
|
size: "sm",
|
|
304
304
|
class: "capitalize",
|
|
305
|
-
onClick: (
|
|
305
|
+
onClick: (u) => C.value = s
|
|
306
306
|
}, {
|
|
307
307
|
default: f(() => [
|
|
308
308
|
w(d(s), 1)
|
|
@@ -319,12 +319,12 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
319
319
|
r(p, { class: "flex items-center gap-2" }, {
|
|
320
320
|
default: f(() => [
|
|
321
321
|
e[6] || (e[6] = w(" Orders received ", -1)),
|
|
322
|
-
o(
|
|
322
|
+
o(z).bookings > 0 ? (n(), ae(c, {
|
|
323
323
|
key: 0,
|
|
324
324
|
variant: "secondary"
|
|
325
325
|
}, {
|
|
326
326
|
default: f(() => [
|
|
327
|
-
w(d(o(
|
|
327
|
+
w(d(o(z).bookings), 1)
|
|
328
328
|
]),
|
|
329
329
|
_: 1
|
|
330
330
|
})) : D("", !0)
|
|
@@ -334,10 +334,10 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
334
334
|
r(m, { class: "flex items-center gap-4 mt-1" }, {
|
|
335
335
|
default: f(() => [
|
|
336
336
|
a("span", Je, [
|
|
337
|
-
r(o(
|
|
338
|
-
w(" " + d(o(
|
|
337
|
+
r(o(E), { size: 14 }),
|
|
338
|
+
w(" " + d(o(z).spots) + " spots ", 1)
|
|
339
339
|
]),
|
|
340
|
-
a("span", Ke, " €" + d(o(
|
|
340
|
+
a("span", Ke, " €" + d(o(z).revenue.toFixed(2)) + d(o(C) === "pending" ? " pending " : o(C) === "cancelled" ? " cancelled " : " ") + "revenue ", 1)
|
|
341
341
|
]),
|
|
342
342
|
_: 1
|
|
343
343
|
})
|
|
@@ -403,7 +403,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
403
403
|
onClick: ie
|
|
404
404
|
}, {
|
|
405
405
|
default: f(() => [
|
|
406
|
-
r(o(
|
|
406
|
+
r(o(q), { class: "size-4" }),
|
|
407
407
|
w(" " + d(o(ce)), 1)
|
|
408
408
|
]),
|
|
409
409
|
_: 1
|
|
@@ -411,12 +411,12 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
411
411
|
Ce(a("input", {
|
|
412
412
|
ref_key: "dateInputRef",
|
|
413
413
|
ref: G,
|
|
414
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) => oe(
|
|
414
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => oe($) ? $.value = s : null),
|
|
415
415
|
type: "date",
|
|
416
416
|
class: "orders-date-picker",
|
|
417
417
|
"aria-label": "Select order date"
|
|
418
418
|
}, null, 512), [
|
|
419
|
-
[Ie, o(
|
|
419
|
+
[Ie, o($)]
|
|
420
420
|
])
|
|
421
421
|
])
|
|
422
422
|
])
|
|
@@ -430,7 +430,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
430
430
|
size: 16,
|
|
431
431
|
class: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
432
432
|
}),
|
|
433
|
-
r(
|
|
433
|
+
r(U, {
|
|
434
434
|
modelValue: o(h),
|
|
435
435
|
"onUpdate:modelValue": e[1] || (e[1] = (s) => oe(h) ? h.value = s : null),
|
|
436
436
|
placeholder: "Search by name, email, or phone...",
|
|
@@ -449,21 +449,21 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
449
449
|
_: 1
|
|
450
450
|
})) : D("", !0)
|
|
451
451
|
]),
|
|
452
|
-
o(h) ? (n(), l("div", at, " Showing " + d(o(
|
|
452
|
+
o(h) ? (n(), l("div", at, " Showing " + d(o(V).length) + " of " + d(o(v).length) + " orders ", 1)) : D("", !0),
|
|
453
453
|
o(S) ? (n(), l("div", ot, [...e[8] || (e[8] = [
|
|
454
454
|
a("div", { class: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary" }, null, -1)
|
|
455
455
|
])])) : o(v).length === 0 ? (n(), l("div", nt, [
|
|
456
456
|
r(o(re), { class: "size-12 mx-auto mb-3 opacity-50" }),
|
|
457
457
|
e[9] || (e[9] = a("p", null, "No orders received on this day", -1))
|
|
458
|
-
])) : o(
|
|
459
|
-
(n(!0), l(
|
|
458
|
+
])) : o(V).length === 0 ? (n(), l("div", rt, " No orders match your search ")) : (n(), l("div", lt, [
|
|
459
|
+
(n(!0), l(O, null, L(o(ee), (s) => (n(), l("div", {
|
|
460
460
|
key: s.id,
|
|
461
461
|
class: "border-t last:border-b @5xl:border @5xl:rounded-lg overflow-hidden @5xl:shadow-sm"
|
|
462
462
|
}, [
|
|
463
463
|
s.reservations.length === 1 ? (n(), l("div", {
|
|
464
464
|
key: 0,
|
|
465
465
|
class: "px-6 py-3 @5xl:px-3 hover:bg-muted/50 transition-colors cursor-pointer",
|
|
466
|
-
onClick: (
|
|
466
|
+
onClick: (u) => o(P)?.openDialog(s.reservations[0])
|
|
467
467
|
}, [
|
|
468
468
|
a("div", it, [
|
|
469
469
|
a("div", ct, [
|
|
@@ -472,11 +472,11 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
472
472
|
a("div", ft, d(s.customerInfo?.phone), 1),
|
|
473
473
|
a("div", xt, [
|
|
474
474
|
a("div", pt, [
|
|
475
|
-
r(o(
|
|
475
|
+
r(o(q), { size: 12 }),
|
|
476
476
|
a("span", null, d(W(s.reservations[0].date)) + " · " + d(s.reservations[0].startTime) + " - " + d(s.reservations[0].endTime), 1)
|
|
477
477
|
]),
|
|
478
478
|
a("div", vt, [
|
|
479
|
-
r(o(
|
|
479
|
+
r(o(E), { size: 12 }),
|
|
480
480
|
a("span", null, d(s.reservations[0].spots) + " spots", 1)
|
|
481
481
|
]),
|
|
482
482
|
s.reservations[0].resourceName ? (n(), l("div", _t, [
|
|
@@ -493,7 +493,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
493
493
|
]),
|
|
494
494
|
r(H, {
|
|
495
495
|
metadata: { ...s.reservations[0].metadata, ...s.reservations[0].reservationMetadata },
|
|
496
|
-
schema: o(
|
|
496
|
+
schema: o(R),
|
|
497
497
|
"display-filter": ["highlight", "badge"],
|
|
498
498
|
compact: "",
|
|
499
499
|
class: "mt-1"
|
|
@@ -507,13 +507,13 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
507
507
|
], 8, dt)) : (n(), l("div", Pt, [
|
|
508
508
|
a("div", {
|
|
509
509
|
class: "px-6 py-3 @5xl:px-3 bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",
|
|
510
|
-
onClick: (
|
|
510
|
+
onClick: (u) => o(B)?.openDialog(s)
|
|
511
511
|
}, [
|
|
512
512
|
a("div", Nt, [
|
|
513
513
|
a("div", zt, [
|
|
514
514
|
a("div", Ot, [
|
|
515
515
|
a("div", jt, d(s.customerInfo?.firstName || s.customerInfo?.lastName ? [s.customerInfo?.firstName, s.customerInfo?.lastName].filter(Boolean).join(" ") : "Unknown Customer"), 1),
|
|
516
|
-
r(
|
|
516
|
+
r(c, {
|
|
517
517
|
variant: "secondary",
|
|
518
518
|
class: "text-xs whitespace-nowrap"
|
|
519
519
|
}, {
|
|
@@ -531,7 +531,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
531
531
|
]),
|
|
532
532
|
r(H, {
|
|
533
533
|
metadata: s.metadata,
|
|
534
|
-
schema: o(
|
|
534
|
+
schema: o(R),
|
|
535
535
|
"display-filter": ["highlight", "badge"],
|
|
536
536
|
compact: "",
|
|
537
537
|
class: "mt-1"
|
|
@@ -543,37 +543,37 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
543
543
|
])
|
|
544
544
|
])
|
|
545
545
|
], 8, At),
|
|
546
|
-
(n(!0), l(
|
|
547
|
-
key:
|
|
546
|
+
(n(!0), l(O, null, L(s.reservations, (u) => (n(), l("div", {
|
|
547
|
+
key: u.res_id,
|
|
548
548
|
class: "px-6 py-3 @5xl:px-3 border-t bg-muted/50 dark:bg-transparent dark:hover:bg-muted/50 transition-colors cursor-pointer",
|
|
549
|
-
onClick: (as) => o(P)?.openDialog(
|
|
549
|
+
onClick: (as) => o(P)?.openDialog(u)
|
|
550
550
|
}, [
|
|
551
551
|
a("div", Et, [
|
|
552
|
-
a("div",
|
|
553
|
-
a("div",
|
|
554
|
-
r(o(
|
|
555
|
-
a("span", null, d(W(
|
|
552
|
+
a("div", qt, [
|
|
553
|
+
a("div", Ht, [
|
|
554
|
+
r(o(q), { size: 12 }),
|
|
555
|
+
a("span", null, d(W(u.date)) + " · " + d(u.startTime) + " - " + d(u.endTime), 1)
|
|
556
556
|
]),
|
|
557
557
|
a("div", Qt, [
|
|
558
|
-
r(o(
|
|
559
|
-
a("span", null, d(
|
|
558
|
+
r(o(E), { size: 12 }),
|
|
559
|
+
a("span", null, d(u.spots) + " spots", 1)
|
|
560
560
|
]),
|
|
561
|
-
|
|
561
|
+
u.resourceName ? (n(), l("div", Xt, [
|
|
562
562
|
a("div", {
|
|
563
563
|
class: "w-3 h-3 rounded-full",
|
|
564
|
-
style: ne({ backgroundColor:
|
|
564
|
+
style: ne({ backgroundColor: u.resourceColor || "#6b7280" })
|
|
565
565
|
}, null, 4),
|
|
566
|
-
a("span", null, d(
|
|
566
|
+
a("span", null, d(u.resourceName), 1)
|
|
567
567
|
])) : D("", !0)
|
|
568
568
|
]),
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
u.status === "confirmed" ? (n(), l("div", Yt, [
|
|
570
|
+
u.reservationStatus === "needs_approval" ? (n(), l("span", Gt, "Needs Approval")) : u.reservationStatus === "approved" ? (n(), l("span", Jt, "Approved")) : u.reservationStatus === "cancelled" ? (n(), l("span", Kt, "Cancelled")) : u.reservationStatus === "rejected" ? (n(), l("span", Wt, "Rejected")) : (n(), l("span", Zt, "Pending")),
|
|
571
|
+
u.reservationPrice || u.reservationPrice === 0 ? (n(), l("div", es, " €" + d(u.reservationPrice.toFixed(2)), 1)) : D("", !0)
|
|
572
572
|
])) : D("", !0)
|
|
573
573
|
]),
|
|
574
574
|
r(H, {
|
|
575
|
-
metadata:
|
|
576
|
-
schema: o(
|
|
575
|
+
metadata: u.reservationMetadata,
|
|
576
|
+
schema: o(R),
|
|
577
577
|
"display-filter": ["highlight", "badge"],
|
|
578
578
|
compact: "",
|
|
579
579
|
class: "mt-1"
|
|
@@ -595,7 +595,7 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
595
595
|
r(Le, {
|
|
596
596
|
ref_key: "reservationDetailDialog",
|
|
597
597
|
ref: P,
|
|
598
|
-
"agenda-data": o(
|
|
598
|
+
"agenda-data": o(F),
|
|
599
599
|
resources: o(I),
|
|
600
600
|
"show-order-link": "",
|
|
601
601
|
onCancelled: y,
|
|
@@ -606,15 +606,15 @@ const qe = { class: "space-y-6" }, Qe = { class: "flex flex-col sm:flex-row sm:i
|
|
|
606
606
|
}, null, 8, ["agenda-data", "resources"]),
|
|
607
607
|
r(Ee, {
|
|
608
608
|
ref_key: "orderDetailDialog",
|
|
609
|
-
ref:
|
|
610
|
-
"agenda-data": o(
|
|
609
|
+
ref: B,
|
|
610
|
+
"agenda-data": o(F),
|
|
611
611
|
resources: o(I),
|
|
612
612
|
onOpenReservation: e[3] || (e[3] = (s) => ge(s))
|
|
613
613
|
}, null, 8, ["agenda-data", "resources"])
|
|
614
614
|
], 64);
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
}), us = /* @__PURE__ */
|
|
617
|
+
}), us = /* @__PURE__ */ qe(ts, [["__scopeId", "data-v-fcb7e1ac"]]);
|
|
618
618
|
export {
|
|
619
619
|
us as default
|
|
620
620
|
};
|