(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,970065,e=>{"use strict";var t=e.i(843476),r=e.i(647163);e.s(["Card",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...s})},"CardContent",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...s})},"CardDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...s})},"CardHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...s})},"CardTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...s})}])},175379,e=>{"use strict";function t(e){if(e instanceof Date)return e;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){let[t,r,s]=e.split("-").map(Number);return new Date(t,r-1,s)}return new Date(e)}e.s(["formatCurrency",0,function(e){if(null==e||""===e)return"0.00";let t="string"==typeof e?parseFloat(e):e;return isNaN(t)?"0.00":t.toLocaleString("en-IN",{minimumFractionDigits:2,maximumFractionDigits:2})},"formatDate",0,function(e){if(!e)return"—";let r=t(e);if(isNaN(r.getTime()))return"—";let s=String(r.getDate()).padStart(2,"0"),a=String(r.getMonth()+1).padStart(2,"0"),n=r.getFullYear();return`${s}/${a}/${n}`},"formatDateTime",0,function(e){if(!e)return"—";let r=t(e);if(isNaN(r.getTime()))return"—";let s=String(r.getDate()).padStart(2,"0"),a=String(r.getMonth()+1).padStart(2,"0"),n=r.getFullYear(),d=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0");return`${s}/${a}/${n} ${d}:${i}`}])},340215,e=>{"use strict";var t=e.i(843476),r=e.i(522016),s=e.i(271645),a=e.i(618566),n=e.i(970065),d=e.i(167881),i=e.i(270598),o=e.i(272944),c=e.i(175379),l=e.i(551956);e.s(["default",0,function(){let e=(0,a.useParams)().id,u=(0,s.useMemo)(()=>(0,o.getApiService)(),[]),{error:m}=(0,i.useToast)(),[x,f]=(0,s.useState)(null),[g,p]=(0,s.useState)(!0);return(0,s.useEffect)(()=>{(async()=>{p(!0);let t=await u.getExpense(e);t.success&&t.data?f(t.data):m("Failed to load expense",t.error),p(!1)})()},[u,e,m]),(0,t.jsxs)("div",{className:"flex-1 space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-3xl font-bold text-foreground",children:"Expense Details"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:"View expense information"})]}),(0,t.jsx)(r.default,{href:"/accounts/expenses",children:(0,t.jsx)(d.Button,{variant:"outline",children:"Back"})})]}),(0,t.jsxs)(n.Card,{className:"bg-card border-border",children:[(0,t.jsx)(n.CardHeader,{children:(0,t.jsx)(n.CardTitle,{children:"Expense"})}),(0,t.jsx)(n.CardContent,{children:g?(0,t.jsx)("p",{className:"text-muted-foreground",children:"Loading expense..."}):x?(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Expense #"}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:x.expenseNumber})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Date"}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:(0,c.formatDate)(x.date)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Category"}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:x.category})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Payment Method"}),(0,t.jsx)("p",{className:"font-medium text-foreground capitalize",children:x.paymentMethod})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Expense Payee"}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:x.vendorName||"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Amount"}),(0,t.jsxs)("p",{className:"font-medium text-foreground",children:[l.config.locale.currencySymbol,x.amount.toLocaleString()]})]}),(0,t.jsxs)("div",{className:"md:col-span-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:"Description"}),(0,t.jsx)("p",{className:"font-medium text-foreground",children:x.description})]})]}):(0,t.jsx)("p",{className:"text-muted-foreground",children:"Expense not found."})})]})]})}])}]);