import{j as e,r as ds}from"./client-BbMi5ewG.js";import{C as ts}from"./Calender-DPznisyw.js";import{C as v,b as F,a as w,c as A}from"./card-CZBIFpqn.js";import{B as G}from"./Button-1dacbE2T.js";import{B as u}from"./badge-C2Ir4HoT.js";import{c as H,a as j,X as ns}from"./utils-Q0fnGDhj.js";import{E as bs}from"./Eye-1IT8gO2L.js";import{S as xs,a as ms,b as os,c as hs,f as C}from"./select-CPHcJnpt.js";import{C as Ns}from"./checkbox-BS_fWNWw.js";import{c as E,e as gs,f as ys,u as ps,p as js,L as vs,M as ws}from"./index-CM0LBdHD.js";import{A as _s,a as Ds,b as ks}from"./avatar-BMEAZdBR.js";import{T as Fs}from"./ticket-Kszp8SMK.js";import{C as Cs}from"./withIconDefaults-C8UfSjn1.js";import{S as a}from"./skeleton-ImO4uxQ7.js";import{L as n}from"./label-1wXMewvs.js";import{S as U}from"./separator-DZRbPm0x.js";import{u as rs,s as z,a as Ss}from"./store-jX25q14N.js";import{C as V}from"./calendar-CjyQ6Zau.js";import{b as q,C as $s,V as as}from"./CalenderCheck-BuHSX8YD.js";import{P as As}from"./PaymentSection-BdBEJKqf.js";import{f as N}from"./priceFormatter-Dg4GlACg.js";import{F as Ts}from"./file-text-DLx-plKT.js";import{C as Ps}from"./circle-check-big-uMTsaxsq.js";import{D as ls}from"./dollar-sign-DRtWdm2i.js";/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ls=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ms=H("badge-check",Ls);/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bs=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],O=H("server",Bs);/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Us=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],us=H("user-round",Us),B={confirmed:"bg-green-100 text-green-700 border-green-200",pending:"bg-yellow-100 text-yellow-700 border-yellow-200",cancelled:"bg-red-100 text-red-700 border-red-200",completed:"bg-blue-100 text-primary border-blue-200"};function cs({appointment:t,onStatusChange:s,isSelected:_,onSelectToggle:S}){var D,T,P;const p=d=>new Date(d).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),f=d=>new Date(`2000-01-01T${d}`).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),$=(d,o)=>{const m=new Date(`2000-01-01T${d}`),c=(new Date(`2000-01-01T${o}`).getTime()-m.getTime())/(1e3*60),i=Math.floor(c/60),x=c%60;return i>0&&x>0?`${i}h ${x}m`:i>0?`${i}h`:`${x}m`},b=(D=t==null?void 0:t.customer)==null?void 0:D.customer_info;return e.jsxs("div",{className:j("bg-white border border-border rounded-[10px] hover:shadow-lg transition-all duration-200 border-l-4 border-l-primary overflow-hidden",_&&"ring-2 ring-primary/30 bg-primary/[0.02]"),children:[e.jsx("div",{className:"p-[19px_15px]",children:e.jsxs("div",{className:"flex items-left justify-between gap-8 flex-col xl:flex-row",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1 min-w-0 flex-wrap",children:[S&&e.jsx("div",{className:"flex items-center",onClick:d=>d.stopPropagation(),children:e.jsx(Ns,{checked:_,onCheckedChange:()=>S(t.id)})}),e.jsxs("div",{className:"lg:flex-1 min-w-[80px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:"Appointment ID"}),e.jsxs("div",{className:"font-bold text-sm text-primary",children:["#",t.id]})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:"Customer Name"}),e.jsx("div",{className:"font-medium text-sm text-title2",children:b==null?void 0:b.name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[80px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:(t==null?void 0:t.booking_type)==="meeting"?"Meeting":(t==null?void 0:t.booking_type)==="event"?"Event":"Service"}),e.jsx("div",{className:"font-medium text-sm text-title2",children:(t==null?void 0:t.booking_type)==="meeting"?(t==null?void 0:t.meeting_type_name)||"Meeting":(t==null?void 0:t.booking_type)==="event"?(t==null?void 0:t.event_name)||`Event #${t==null?void 0:t.event_id}`:t==null?void 0:t.service_name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:"Staff"}),e.jsx("div",{className:"text-sm font-medium text-title",children:t==null?void 0:t.employee_name})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[100px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:"Date"}),e.jsx("div",{className:"font-medium text-sm text-title2",children:p(t==null?void 0:t.appointment_date)})]}),e.jsxs("div",{className:"lg:flex-1 min-w-[120px]",children:[e.jsx("div",{className:"font-normal text-sm text-small-font text-[13px]",children:"Time"}),e.jsxs("div",{className:"font-medium text-sm text-title2",children:[f(t.start_time)," - ",f(t.end_time)," (",$(t.start_time,t.end_time),")"]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 flex-shrink-0",children:[e.jsxs(xs,{value:t.status,onValueChange:d=>s(t.id,d),children:[e.jsx(ms,{className:"min-h-[31px] w-[120px] relative shadow-none border-none focus:border-none focus:outline-none focus:shadow-none",children:e.jsx(os,{children:e.jsx("span",{className:j("status-label-abs",`font-medium py-1 px-3 rounded-md text-xs  border ${B[t.status]}`),children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})})}),e.jsxs(hs,{children:[e.jsx(C,{value:"confirmed",children:e.jsx(u,{className:j("font-semibold capitalize text-xs border",B.confirmed),children:"Confirmed"})}),e.jsx(C,{value:"pending",children:e.jsx(u,{className:j("font-semibold capitalize text-xs border",B.pending),children:"Pending"})}),e.jsx(C,{value:"cancelled",children:e.jsx(u,{className:j("font-semibold capitalize text-xs border",B.cancelled),children:"Cancelled"})}),e.jsx(C,{value:"completed",children:e.jsx(u,{className:j("font-semibold capitalize text-xs border",B.completed),children:"Completed"})})]})]}),e.jsx(E,{to:`/appointment/${t.id}/details`,children:e.jsxs(G,{variant:"outline",size:"sm",className:"gap-1 text-title2 border-border hover:bg-blue-50 hover:border-blue-400 hover:text-primary transition-colors",children:[e.jsx(bs,{}),e.jsx("span",{className:"text-[13px]",children:"Details"})]})})]})]})}),(t==null?void 0:t.booking_type)==="event"&&((T=t==null?void 0:t.event_tickets)==null?void 0:T.length)>0&&e.jsx("div",{className:"px-[15px] py-2 bg-[#FAFBFC] border-t border-border/60",children:e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Fs,{className:"w-3.5 h-3.5 text-slate-400"}),t.event_tickets.map((d,o)=>e.jsxs("span",{className:"text-[12px] bg-slate-100 text-slate-600 px-2 py-0.5 rounded font-medium",children:[d.quantity,"x ",d.ticket_name,d.price>0&&` (${t.currency_symbol||"$"}${(d.price*d.quantity).toFixed(2)})`]},o))]}),((P=t.payment)==null?void 0:P.status)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("span",{className:j("text-[11px] font-medium px-2 py-0.5 rounded border",t.payment.status==="paid"?"bg-green-50 text-green-700 border-green-200":t.payment.status==="pending"?"bg-amber-50 text-amber-700 border-amber-200":"bg-red-50 text-red-700 border-red-200"),children:t.payment.status==="paid"?"Paid":t.payment.status==="pending"?"Payment Pending":t.payment.status.charAt(0).toUpperCase()+t.payment.status.slice(1)})]}),t.event_tickets.some(d=>d.checked_in_at)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-4 bg-border"}),e.jsx("span",{className:"text-[11px] font-medium px-2 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",children:"Checked In"})]})]})})]})}function xt({date:t,appointments:s,onStatusChange:_,defaultExpanded:S=!0,groupingType:p="date",selectedIds:f,onSelectToggle:$,renderRow:b}){const[D,T]=ds.useState(S),P=m=>{const l=new Date(m),c=new Date;switch(p){case"week":{const i=new Date(l);i.setDate(l.getDate()+6);const x=new Date(c);return x.setDate(c.getDate()-c.getDay()),l.toDateString()===x.toDateString()?"This Week":`Week of ${l.toLocaleDateString("en-US",{month:"short",day:"numeric"})} - ${i.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`}case"month":{const i=c.getMonth(),x=c.getFullYear();return l.getMonth()===i&&l.getFullYear()===x?"This Month":l.toLocaleDateString("en-US",{month:"long",year:"numeric"})}default:{const i=new Date(c);i.setDate(i.getDate()+1);const x=new Date(c);return x.setDate(x.getDate()-1),l.toDateString()===c.toDateString()?"Today":l.toDateString()===i.toDateString()?"Tomorrow":l.toDateString()===x.toDateString()?"Yesterday":l.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}}},o=(()=>{const m=s.reduce((l,c)=>(l[c.status]=(l[c.status]||0)+1,l),{});return{total:s.length,confirmed:m.confirmed||0,pending:m.pending||0,cancelled:m.cancelled||0,completed:m.completed||0}})();return e.jsxs(v,{className:"rtrb-card overflow-hidden rounded-[15px]",children:[e.jsx(F,{className:"pb-3",children:e.jsxs(G,{variant:"ghost",onClick:()=>T(!D),className:"w-full justify-between p-0 h-auto hover:bg-transparent",children:[e.jsxs("div",{className:"flex gap-3 flex-1 flex-wrap",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"bg-primary/10 rounded-lg flex pt-[7px]",children:e.jsx(ts,{size:"20px",className:"text-primary"})}),e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-lg font-semibold text-title whitespace-pre-wrap",children:P(t)}),e.jsxs("p",{className:"text-sm text-title2 font-normal",children:[p==="date"?t:p==="week"?`${s.length} appointment${s.length!==1?"s":""} this week`:`${s.length} appointment${s.length!==1?"s":""} this month`," • ",o.total," total"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 md:ml-auto",children:[o.confirmed>0&&e.jsxs(u,{className:"bg-green-100 text-green-800 text-xs",children:[o.confirmed," confirmed"]}),o.pending>0&&e.jsxs(u,{className:"bg-yellow-100 text-yellow-800 text-xs",children:[o.pending," pending"]}),o.cancelled>0&&e.jsxs(u,{className:"bg-red-100 text-red-800 text-xs",children:[o.cancelled," cancelled"]}),o.completed>0&&e.jsxs(u,{className:"bg-blue-100 text-primary text-xs",children:[o.completed," completed"]})]})]}),e.jsx("div",{className:"flex items-center gap-4",children:D?e.jsx(Cs,{className:"w-5 h-5 text-muted-foreground"}):e.jsx(gs,{className:"w-5 h-5 text-muted-foreground"})})]})}),D&&e.jsx(w,{className:"pt-0",children:e.jsx("div",{className:"space-y-3",children:p==="week"||p==="month"?(()=>{const m=s.reduce((l,c)=>{const i=c.appointment_date;return l[i]||(l[i]=[]),l[i].push(c),l},{});return Object.entries(m).sort(([l],[c])=>l.localeCompare(c)).map(([l,c])=>e.jsxs("div",{className:"space-y-2 ",children:[e.jsxs("div",{className:"flex items-center gap-2 py-2 border-b border-border/50",children:[e.jsx(ts,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("h4",{className:"font-medium text-sm",children:new Date(l).toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric",year:"numeric"})}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",c.length," appointment",c.length!==1?"s":"",")"]})]}),e.jsx("div",{className:"space-y-2",children:c.sort((i,x)=>i.start_time.localeCompare(x.start_time)).map(i=>{const x=b||cs;return e.jsx(x,{appointment:i,onStatusChange:_,isSelected:f==null?void 0:f.has(i.id),onSelectToggle:$},i.id)})})]},l))})():s.map(m=>{const l=b||cs;return e.jsx(l,{appointment:m,onStatusChange:_,isSelected:f==null?void 0:f.has(m.id),onSelectToggle:$},m.id)})})})]})}function mt({defaultExpanded:t=!0,appointmentCount:s=3,showSubGroups:_=!1}){return e.jsx("div",{className:"bg-white border border-border rounded-[10px] border-l-4 border-l-primary/20 overflow-hidden",children:e.jsx("div",{className:"p-[19px_15px]",children:e.jsxs("div",{className:"flex items-center justify-between gap-8 flex-col lg:flex-row",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0 flex-wrap",children:[e.jsxs("div",{className:"flex-1 min-w-[80px]",children:[e.jsx(a,{className:"h-3 w-16 mb-2"}),e.jsx(a,{className:"h-4 w-12"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(a,{className:"h-3 w-20 mb-2"}),e.jsx(a,{className:"h-4 w-28"})]}),e.jsxs("div",{className:"flex-1 min-w-[80px]",children:[e.jsx(a,{className:"h-3 w-14 mb-2"}),e.jsx(a,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(a,{className:"h-3 w-12 mb-2"}),e.jsx(a,{className:"h-4 w-24"})]}),e.jsxs("div",{className:"flex-1 min-w-[100px]",children:[e.jsx(a,{className:"h-3 w-10 mb-2"}),e.jsx(a,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex-1 min-w-[120px]",children:[e.jsx(a,{className:"h-3 w-10 mb-2"}),e.jsx(a,{className:"h-4 w-32"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx(a,{className:"h-[31px] w-[120px] rounded-md"}),e.jsx(a,{className:"h-[36px] w-[90px] rounded-md"})]})]})})})}function is(){return e.jsx("main",{className:"min-h-screen",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(a,{className:"h-8 w-48 mb-2"}),e.jsx(a,{className:"h-4 w-64"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(a,{className:"h-[48px] w-40 rounded-md"}),e.jsx(a,{className:"h-[48px] w-32 rounded-md"})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(V,{className:"w-5 h-5 text-primary/40"}),e.jsx(a,{className:"h-6 w-56"})]})}),e.jsxs(w,{className:"pt-6 space-y-6",children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[1,2,3,4].map(t=>e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-4",children:[e.jsx(a,{className:"h-4 w-4 rounded-full"}),e.jsx(a,{className:"h-4 w-32"})]}),e.jsx(a,{className:"h-5 w-40 mb-3"}),e.jsx(a,{className:"h-[29px] w-full max-w-[200px] rounded-[5px]"})]},t))}),e.jsx(U,{}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(a,{className:"h-4 w-24"}),e.jsx(a,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"text-right flex-1 space-y-2",children:[e.jsx(a,{className:"h-4 w-24 ml-auto"}),e.jsx(a,{className:"h-5 w-32 ml-auto"})]})]})]})]}),e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(us,{className:"w-5 h-5 text-primary/40"}),e.jsx(a,{className:"h-6 w-48"})]})}),e.jsx(w,{className:"pt-6 space-y-6",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[1,2,3,4].map(t=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{className:"h-4 w-28"}),e.jsx(a,{className:"h-6 w-48"})]},t))})})]})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(q,{className:"w-5 h-5 text-primary/40"}),e.jsx(a,{className:"h-6 w-48"})]})}),e.jsxs(w,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx(a,{className:"h-4 w-24"}),e.jsx(a,{className:"h-4 w-16"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(a,{className:"h-4 w-32"}),e.jsx(a,{className:"h-4 w-20"})]}),e.jsx(U,{}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(a,{className:"h-5 w-20"}),e.jsx(a,{className:"h-5 w-24"})]})]}),e.jsx(a,{className:"h-12 w-full rounded-md mt-4"})]})]})})]})]})})}const R={confirmed:"bg-green-100 text-green-800 border-green-200",completed:"bg-green-600 text-white border-green-600",pending:"bg-yellow-100 text-yellow-800 border-yellow-200",cancelled:"bg-red-100 text-red-800 border-red-200"},Es={confirmed:e.jsx(Ps,{className:"w-4 h-4"}),completed:e.jsx(Ms,{className:"w-4 h-4"}),pending:e.jsx(js,{className:"w-4 h-4"}),cancelled:e.jsx(ns,{className:"w-4 h-4"})},Is={paid:"bg-green-100 text-green-800",pending:"bg-yellow-100 text-yellow-800",failed:"bg-red-100 text-red-800",refunded:"bg-purple-100 text-purple-800",partially_paid:"bg-blue-100 text-primary"};function ot(){var d,o,m,l,c,i,x,W,Y,Z,J,X,Q,K,ee,se,te,re,ae,le,ce,ie,de,ne,xe,me,oe,he,je,ue,fe,be,Ne,ge,ye,pe,ve,we,_e,De,ke,Fe,Ce,Se,$e,Ae,Te,Pe,Le,Me,Be,Ue,Ee,Ie,ze,Oe,Re,Ve,qe,Ge,He;const{id:t}=ys();ps();const s=rs(r=>r(z).getAppointment(),[]),_=rs(r=>r(z).getAppointmentLoading(),[]),{getAppointment:S,setAppointmentData:p,updateAppointmentStatus:f}=Ss(z);ds.useEffect(()=>{let r=!1;async function h(){r||(r=!0,await S(t))}t&&h()},[t,S]);const $=r=>new Date(r).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),b=r=>new Date(`2000-01-01T${r}`).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),D=(r,h)=>{const k=new Date(`2000-01-01T${r}`),L=(new Date(`2000-01-01T${h}`).getTime()-k.getTime())/(1e3*60),y=Math.floor(L/60),M=L%60;return y>0&&M>0?`${y}h ${M}m`:y>0?`${y} hour${y>1?"s":""}`:`${M} minutes`},T=r=>{s&&(p({...s,status:r,updated_at:new Date().toISOString()}),f(s.id,r))},P=r=>{switch(r){case"credit_card":return e.jsx(q,{className:"w-4 h-4"});case"offline":return e.jsx(ls,{className:"w-4 h-4"});default:return e.jsx(ls,{className:"w-4 h-4"})}};return _?e.jsx(is,{}):s?e.jsx(e.Fragment,{children:Object.keys(s).length===0?e.jsx(is,{}):e.jsx("main",{className:"min-h-screen ",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-[24px] font-semibold text-title mb-1",children:["Appointment #",s.id]}),e.jsx("p",{className:"text-small-font",children:"View and manage appointment details"})]}),e.jsxs("div",{className:"flex flx-wrap items-center gap-3",children:[s.notify_customer==="1"&&e.jsxs(u,{variant:"secondary",className:"bg-[#F5FAFF] text-primary text-sm border-[#BDCFFF] h-[40px] lg:h-[48px] px-4 items-center justify-center",children:[e.jsx(js,{className:"w-4 h-4 mr-1 text-primary mt-[2px]"}),e.jsx("span",{className:"whitespace-nowrap",children:"Notifications On"})]}),e.jsxs(u,{className:j("text-sm py-2 font-medium h-[40px] lg:h-[48px] px-4 gap-1",R[s.status]),children:[Es[s.status],((d=s.status)==null?void 0:d.charAt(0).toUpperCase())+((o=s.status)==null?void 0:o.slice(1))]})]})]})}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 2xl:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"xl:col-span-1 2xl:col-span-2 space-y-6",children:[e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),"Appointment Information"]})}),e.jsxs(w,{className:"pt-6 space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx($s,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:"Date & Time"})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:$(s.appointment_date)}),e.jsxs("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:[b(s.start_time)," - ",b(s.end_time),"(",D(s.start_time,s.end_time),")"]})]}),e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(vs,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:(s==null?void 0:s.booking_type)==="meeting"?"Host":(s==null?void 0:s.booking_type)==="event"?"Organizer":"Service Provider"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsxs(_s,{className:"w-12 h-12",children:[e.jsx(Ds,{src:s.employee_image,alt:s.employee_name}),e.jsx(ks,{className:"bg-gray-100 text-title font-medium",children:(m=s.employee_name)==null?void 0:m.split(" ").map(r=>r[0]).join("")})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-title ",children:s.employee_name}),e.jsxs("p",{className:"text-sm text-title2",children:[(s==null?void 0:s.booking_type)==="meeting"||(s==null?void 0:s.booking_type)==="event"?"Host":"Staff"," ID: #",s.employee_id]})]})]})]}),(s==null?void 0:s.booking_type)==="meeting"?e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(O,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:"Meeting Type"})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.meeting_type_name||"N/A"}),e.jsxs("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:["Meeting Type ID: #",s.meeting_type_id]})]}):(s==null?void 0:s.booking_type)==="event"?e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(O,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:"Event"})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.event_name||`Event #${s.event_id}`}),e.jsxs("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:["Event ID: #",s.event_id]})]}):e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(O,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:"Service"})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2 mb-4",children:s.service_name}),e.jsxs("p",{className:"text-[13px] text-primary bg-[#F5FAFF] border border-[#BDCFFF] min-h-[29px] inline-flex items-center px-4 rounded-[5px]",children:["Service ID: #",s.service_id]})]}),s.location_info&&e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(ws,{className:"w-4 h-4 text-primary"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:"Location"})]}),e.jsx("p",{className:"text-sm font-medium text-title mt-2",children:((c=(l=s.location_info)==null?void 0:l.name)==null?void 0:c.trim())||`Location #${s.location_id}`}),e.jsx("p",{className:"text-sm text-title2 mt-1 ",children:(i=s.location_info)==null?void 0:i.address}),e.jsx("p",{className:"text-sm text-title2 mt-1 break-all",children:(x=s.location_info)==null?void 0:x.phone})]}),((W=s.meeting_link)==null?void 0:W.join_url)&&e.jsxs("div",{className:"p-4 rtrb-card",children:[e.jsxs("div",{className:"flex gap-2 items-center mb-2",children:[e.jsx(as,{className:"w-4 h-4 text-[#2D8CFF]"}),e.jsx(n,{className:"text-[16px] font-medium text-title2",children:s.meeting_link.provider==="google_calendar"?"Google Meet":"Zoom Meeting"})]}),e.jsxs("a",{href:s.meeting_link.join_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-[#2D8CFF] text-white text-sm font-medium rounded-md hover:bg-[#1a73e8] transition-colors",children:[e.jsx(as,{className:"w-4 h-4"}),"Join Meeting"]}),s.meeting_link.start_url&&e.jsx("a",{href:s.meeting_link.start_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 ml-2 bg-white text-[#2D8CFF] text-sm font-medium rounded-md border border-[#2D8CFF] hover:bg-[#EBF5FF] transition-colors",children:"Start as Host"})]})]}),s.notes&&e.jsxs("div",{className:"p-4 bg-gray-50 border border-border rounded-lg",children:[e.jsxs(n,{className:"text-sm font-medium text-title2 flex items-center gap-2",children:[e.jsx(Ts,{className:"w-4 h-4"}),"Notes"]}),e.jsx("p",{className:"mt-2 text-title",children:s.notes})]}),e.jsx(U,{}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(n,{className:"text-sm font-medium text-title2",children:"Update Status"}),e.jsxs(xs,{value:s.status,onValueChange:T,children:[e.jsx(ms,{children:e.jsx(os,{})}),e.jsxs(hs,{children:[e.jsx(C,{value:"pending",children:"Pending"}),e.jsx(C,{value:"confirmed",children:"Confirmed"}),e.jsx(C,{value:"completed",children:"Completed"}),e.jsx(C,{value:"cancelled",children:"Cancelled"})]})]})]}),e.jsxs("div",{className:"text-right flex-1",children:[e.jsx(n,{className:"text-sm font-medium text-title2",children:"Last Updated"}),e.jsx("p",{className:"text-sm font-medium text-title",children:new Date(s.updated_at).toLocaleString()})]})]}),(s==null?void 0:s.parent_appointment)&&e.jsxs("div",{children:["Parent Appointment ID: ",e.jsxs(E,{to:`/appointment/${s.parent_appointment}/details`,className:"underline text-primary",children:["#",s.parent_appointment]})]})]})]}),e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(us,{className:"w-5 h-5 text-primary"}),"Customer Information"]})}),e.jsxs(w,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-6",children:[e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"Customer Name"}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:(Z=(Y=s.customer)==null?void 0:Y.customer_info)!=null&&Z.first_name&&((X=(J=s==null?void 0:s.customer)==null?void 0:J.customer_info)!=null&&X.last_name)?`${(Q=s==null?void 0:s.customer.customer_info)==null?void 0:Q.first_name} ${(ee=(K=s==null?void 0:s.customer)==null?void 0:K.customer_info)==null?void 0:ee.last_name}`:"Not provided"})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font flex items-center gap-1",children:"Email"}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:((te=(se=s==null?void 0:s.customer)==null?void 0:se.customer_info)==null?void 0:te.email)||"Not provided"})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"Customer ID"}),e.jsxs("p",{className:"text-lg font-semibold text-title mt-1",children:["#",(re=s.customer)==null?void 0:re.customer_id]})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font flex items-center gap-1",children:"Number of Persons"}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:((ae=s==null?void 0:s.customer)==null?void 0:ae.persons)>1?parseInt((le=s==null?void 0:s.customer)==null?void 0:le.persons)+1:1})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"Booking Token"}),e.jsx("p",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded mt-1",children:(ce=s.customer)==null?void 0:ce.token})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"UTC Offset"}),e.jsx("p",{className:"text-lg font-semibold text-title mt-1",children:(ie=s.customer)==null?void 0:ie.utc_offset})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"Customer Status"}),e.jsx("div",{children:e.jsx(u,{className:j("mt-1",R[(de=s==null?void 0:s.customer)==null?void 0:de.status]),children:((xe=(ne=s.customer)==null?void 0:ne.status)==null?void 0:xe.charAt(0).toUpperCase())+((oe=(me=s.customer)==null?void 0:me.status)==null?void 0:oe.slice(1))})})]}),e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:"Duration (min)"}),e.jsxs("p",{className:"text-lg font-semibold text-title mt-1",children:[((he=s==null?void 0:s.customer)==null?void 0:he.duration)/60,"m"]})]})]}),((je=s==null?void 0:s.payment)==null?void 0:je.coupon_code)&&e.jsxs("div",{className:"p-3 bg-green-50 border border-green-200 rounded-lg",children:[e.jsx(n,{className:"text-sm font-medium text-green-800",children:"Coupon Applied"}),e.jsxs("p",{className:"text-green-700 font-mono mt-1",children:[s.payment.coupon_code,parseFloat(((ue=s==null?void 0:s.payment)==null?void 0:ue.discount_amount)||0)>0&&e.jsxs("span",{className:"ml-2 text-green-600 text-sm",children:["(-",N(parseFloat(s.payment.discount_amount).toFixed(2),s.currency),")"]})]})]}),(()=>{var k;const r=(k=s.customer)==null?void 0:k.custom_info,h=Array.isArray(r)?r:r&&typeof r=="object"?Object.values(r):[];return h.length?e.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[e.jsx("h4",{className:"text-sm font-semibold text-title mb-3",children:"Custom Fields"}),e.jsx("div",{className:"grid grid-cols-1 2xl:grid-cols-2 gap-4",children:h.map((g,L)=>e.jsxs("div",{children:[e.jsx(n,{className:"text-sm font-medium text-small-font",children:g.label}),e.jsx("p",{className:"text-base font-semibold text-title mt-1",children:g.type==="checkbox"?(g.value||"").split("||").join(", "):g.value})]},g.field_id||L))})]}):null})()]})]}),(s==null?void 0:s.child_appointments)&&s.child_appointments.length>0&&e.jsxs(v,{className:"shadow-sm border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border",children:e.jsxs(A,{className:"flex items-center gap-2 text-xl text-title",children:[e.jsx(V,{className:"w-5 h-5 text-title2"}),"Recurring Appointments"]})}),e.jsx(w,{className:"pt-3",children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border",children:[e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2",children:"ID"}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[150px]",children:"Date"}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[100px]",children:"Start Time"}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2 min-w-[100px]",children:"End Time"}),e.jsx("th",{className:"text-left py-2 px-3 text-sm font-medium text-title2",children:"Status"})]})}),e.jsx("tbody",{children:s.child_appointments.map(r=>e.jsxs("tr",{className:"border-b border-border hover:bg-gray-50",children:[e.jsx("td",{className:"py-3 px-4 text-sm underline text-blue-500",children:e.jsxs(E,{to:`/appointment/${r.id}/details`,children:["#",r.id]})}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:$(r.appointment_date)}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:b(r.start_time)}),e.jsx("td",{className:"py-3 px-4 text-sm text-title",children:b(r.end_time)}),e.jsx("td",{className:"py-3 px-4",children:e.jsx(u,{className:j("text-xs font-medium px-2 py-1",R[r.status]),children:r.status.charAt(0).toUpperCase()+r.status.slice(1)})})]},r.id))})]})})})]})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs(v,{className:"rtrb-card overflow-hidden border border-border",children:[e.jsx(F,{className:"pb-4 border-b border-border bg-lighter-2 py-0",children:e.jsxs(A,{className:"flex gap-2 text-xl text-title items-center h-[50px]",children:[e.jsx(q,{className:"text-primary w-5 h-5"}),"Payment Details"]})}),e.jsxs(w,{className:"pt-6 space-y-4",children:[e.jsxs("div",{className:"p-4 rtrb-card  rounded-[13px]",children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:((fe=s==null?void 0:s.customer)==null?void 0:fe.persons)>1?"Price per Person":(s==null?void 0:s.booking_type)==="meeting"?"Meeting Price":(s==null?void 0:s.booking_type)==="event"?"Event Price":"Service Price"}),e.jsx("span",{className:j("font-bold break-all",s!=null&&s.dynamic_pricing?"text-sm line-through text-title2":"text-xl text-title"),children:N(parseFloat(((be=s==null?void 0:s.payment)==null?void 0:be.total_amount)||((Ne=s==null?void 0:s.customer)==null?void 0:Ne.price)||0).toFixed(2),s.currency)})]}),(s==null?void 0:s.dynamic_pricing)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:"Dynamic Price"}),e.jsx("span",{className:"text-xl font-bold text-title break-all",children:N(parseFloat(s.dynamic_pricing.final_price).toFixed(2),s.currency)})]}),e.jsx("div",{className:"mb-3 p-2.5 bg-blue-50 border border-blue-200 rounded-lg",children:s.dynamic_pricing.applied_rules.map((r,h)=>e.jsxs("div",{className:"flex justify-between items-center text-xs",children:[e.jsxs("span",{className:"text-blue-700 font-medium",children:[r.name,e.jsxs("span",{className:"text-blue-500 ml-1",children:["(",r.adjustment_type==="percentage"?`${r.adjustment_value}%`:"fixed",")"]})]}),e.jsxs("span",{className:j("font-semibold",r.calculated>=0?"text-red-600":"text-emerald-600"),children:[r.calculated>=0?"+":"",N(parseFloat(Math.abs(r.calculated)).toFixed(2),s.currency)]})]},h))})]}),((ge=s==null?void 0:s.customer)==null?void 0:ge.persons)>1&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:"Number of Persons"}),e.jsxs("span",{className:"text-lg font-semibold text-title",children:["× ",parseInt(s.customer.persons)+1]})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:"Subtotal"}),e.jsx("span",{className:"text-lg font-semibold text-title break-all",children:N((parseFloat((ye=s==null?void 0:s.customer)==null?void 0:ye.price)*(parseInt(s.customer.persons)+1)).toFixed(2),s.currency)})]})]}),((pe=s==null?void 0:s.payment)==null?void 0:pe.coupon_code)&&parseFloat(((ve=s==null?void 0:s.payment)==null?void 0:ve.discount_amount)||0)>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:"Coupon Applied"}),e.jsx("span",{className:"text-sm font-semibold text-emerald-600 font-mono",children:s.payment.coupon_code})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:"Discount"}),e.jsxs("span",{className:"text-lg font-semibold text-emerald-600 break-all",children:["-",N(parseFloat(s.payment.discount_amount).toFixed(2),s.currency)]})]})]}),(()=>{var We,Ye,Ze,Je,Xe,Qe,Ke,es,ss;const r=parseFloat(((We=s==null?void 0:s.payment)==null?void 0:We.tax_amount)||0),h=parseFloat(((Ye=s==null?void 0:s.payment)==null?void 0:Ye.total_amount)||0),k=parseFloat(((Ze=s==null?void 0:s.payment)==null?void 0:Ze.amount)||0),g=parseFloat(((Je=s==null?void 0:s.payment)==null?void 0:Je.due_amount)||0),L=(Xe=s==null?void 0:s.payment)==null?void 0:Xe.tax_rate,y=!!((Ke=(Qe=window.radius_booking_param)==null?void 0:Qe.tax_settings)!=null&&Ke.inclusive),M=((ss=(es=window.radius_booking_param)==null?void 0:es.tax_settings)==null?void 0:ss.label)||"Tax",I=r>0,fs=I&&!y?h-r:h;return e.jsxs(e.Fragment,{children:[I&&!y&&e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:"Subtotal"}),e.jsx("span",{className:"text-lg font-semibold text-title break-all",children:N(fs.toFixed(2),s.currency)})]}),I&&e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsxs("span",{className:"text-sm font-medium text-title2",children:[M," (",L,"%)",y?" (incl.)":""]}),e.jsxs("span",{className:"text-sm font-semibold text-title2 break-all",children:[y?"":"+",N(r.toFixed(2),s.currency)]})]}),e.jsxs("div",{className:"flex justify-between items-center mb-3 pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-title",children:"Total"}),e.jsx("span",{className:"text-xl font-bold text-title break-all",children:N(h.toFixed(2),s.currency)})]}),k>0&&(s.payment.payment_method!=="offline"||g>0)&&e.jsxs("div",{className:"flex justify-between items-center mb-3 gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-title2",children:k>=h?"Paid":s.payment.payment_method==="offline"?"Deposit Required":"Deposit Paid"}),e.jsx("span",{className:"text-lg font-semibold text-green-600 break-all",children:N(k.toFixed(2),s.currency)})]}),g>0&&e.jsxs("div",{className:"flex justify-between items-center pt-2 border-t border-border gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-red-600",children:"Due Amount"}),e.jsx("span",{className:"text-lg font-semibold text-red-600 break-all",children:N(g.toFixed(2),s.currency)})]})]})})()]}),e.jsx(U,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Payment Status"}),e.jsx(u,{className:j("text-xs font-medium px-2 py-1",Is[((we=s==null?void 0:s.payment)==null?void 0:we.status)==="partial_payment"?"partially_paid":(_e=s==null?void 0:s.payment)==null?void 0:_e.status]),children:((De=s==null?void 0:s.payment)==null?void 0:De.status)==="partial_payment"?"Partially Paid":((Fe=(ke=s==null?void 0:s.payment)==null?void 0:ke.status)==null?void 0:Fe.charAt(0).toUpperCase())+((Se=(Ce=s==null?void 0:s.payment)==null?void 0:Ce.status)==null?void 0:Se.slice(1))})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Payment Method"}),e.jsxs("div",{className:"flex items-center gap-2",children:[P(($e=s==null?void 0:s.payment)==null?void 0:$e.payment_method),e.jsx("span",{className:"text-sm font-medium capitalize",children:(Te=(Ae=s==null?void 0:s.payment)==null?void 0:Ae.payment_method)==null?void 0:Te.replace("_"," ")})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Payment ID"}),e.jsxs("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:["#",(Pe=s==null?void 0:s.payment)==null?void 0:Pe.id]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Booking ID"}),e.jsxs("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:["#",(Le=s==null?void 0:s.payment)==null?void 0:Le.booking_id]})]}),((Me=s==null?void 0:s.payment)==null?void 0:Me.transaction_id)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Transaction ID"}),e.jsx("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:(Be=s==null?void 0:s.payment)==null?void 0:Be.transaction_id})]}),((Ue=s==null?void 0:s.payment)==null?void 0:Ue.invoice_id)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Invoice ID"}),e.jsx("span",{className:"text-xs font-mono bg-gray-100 px-2 py-1 rounded",children:(Ee=s==null?void 0:s.payment)==null?void 0:Ee.invoice_id})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Booking Type"}),e.jsx("span",{className:"text-sm capitalize text-title",children:(Ie=s==null?void 0:s.payment)==null?void 0:Ie.booking_type})]}),((ze=s==null?void 0:s.payment)==null?void 0:ze.paid_at)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Payment Date"}),e.jsx("span",{className:"text-xs text-title",children:new Date((Oe=s==null?void 0:s.payment)==null?void 0:Oe.paid_at).toLocaleDateString()})]}),((Re=s==null?void 0:s.payment)==null?void 0:Re.cancelled_at)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Cancelled Date"}),e.jsx("span",{className:"text-xs text-title",children:new Date((Ve=s==null?void 0:s.payment)==null?void 0:Ve.cancelled_at).toLocaleDateString()})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-normal text-title2",children:"Booking Date & Time"}),e.jsx("span",{className:"text-xs text-title",children:new Date((qe=s==null?void 0:s.payment)==null?void 0:qe.booking_date_time).toLocaleString()})]})]}),e.jsx(U,{}),e.jsx(As,{appointment:s}),e.jsx("div",{className:"pt-4 border-t border-border",children:e.jsxs("div",{className:"text-xs text-title2 space-y-1",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Created:"}),e.jsx("span",{children:new Date((Ge=s==null?void 0:s.payment)==null?void 0:Ge.created_at).toLocaleString()})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Updated:"}),e.jsx("span",{children:new Date((He=s==null?void 0:s.payment)==null?void 0:He.updated_at).toLocaleString()})]})]})})]})]})})]})]})})}):e.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:e.jsx(v,{className:"p-6 text-center shadow-lg",children:e.jsxs(w,{className:"pt-6",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-4 bg-red-100 rounded-full flex items-center justify-center",children:e.jsx(ns,{className:"w-8 h-8 text-red-600"})}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Appointment Not Found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"The appointment you're looking for doesn't exist."}),e.jsx(E,{to:"/appointments",children:e.jsx(G,{children:"Back to Appointments"})})]})})})}export{mt as A,cs as a,xt as b,ot as c};
//# sourceMappingURL=AppointmentDetails-cLofFl_4.js.map
