PageSourceSearch

https://bankingapp-kpgywg5z.manus.space/assets/Dashboard-Cj0_F2tN.js

js bankingapp-kpgywg5z.manus.space collected 2026-10-03 05:00:13 UTC 16,070 bytes, 6 lines download raw bytes

1import{g as v,t as j,j as s,C as l,a as d,b as x,c as o,d as m,B as t,n as r,A as y,u as A,r as C,T as w}from"./index-CMjSxCKv.js";import{S as F,a as n,D as S}from"./DashboardLayout-DRtOb4Ng.js";import{A as k,a as L,b as z,R}from"./alert-IlXuAYfF.js";import{B as T}from"./badge-E7WmV-qe.js";import{W as B}from"./wallet-cards-DDMTaArs.js";import{L as $}from"./lightbulb-B_IiXImn.js";import{a as E,E as M}from"./eye-DEIja6ZV.js";import{W}from"./wallet-JBG50VLT.js";import{S as I}from"./send-nvXETkoF.js";import{A as u,a as O}from"./arrow-up-left-DiKhR30U.js";import"./dialog-DBoB1lEi.js";import"./shield-check-DD5U_9mZ.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const P=v("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);function Q(){const e=j.advisor.getSpendingAnalysis.useQuery({days:90}),i=Object.entries(e.data?.spending??{}).sort(([,g],[,p])=>Number(p.total)-Number(g.total))[0],c=Number(e.data?.totalSpent??0);return s.jsxs(l,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:19",className:"overflow-hidden border-blue-200/70 bg-gradient-to-br from-blue-50 via-white to-indigo-50/70 shadow-sm",children:[s.jsx(d,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:20",className:"pb-3",children:s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:21",className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:22",children:[s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:23",className:"mb-2 flex items-center gap-2",children:[s.jsx("span",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:24",className:"rounded-lg bg-blue-600 p-2 text-white shadow-sm",children:s.jsx(F,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:24",className:"h-4 w-4"})}),s.jsx(T,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:25",variant:"secondary",className:"bg-blue-100 text-blue-700",children:"AI financial assistant"})]}),s.jsx(x,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:27",className:"text-xl",children:"A clearer view of your money"}),s.jsx(o,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:28",className:"mt-1",children:"Personalized insights from your recent account activity."})]}),s.jsx(B,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:30",className:"h-7 w-7 text-blue-500"})]})}),s.jsx(m,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:33",children:e.isLoading?s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:35",className:"space-y-3",children:[s.jsx(n,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:35",className:"h-5 w-3/4"}),s.jsx(n,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:35",className:"h-4 w-full"}),s.jsx(n,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:35",className:"h-10 w-40"})]}):e.isError?s.jsxs(k,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:37",variant:"destructive",children:[s.jsx(L,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:38",children:"We couldn’t load your spending summary."}),s.jsxs(z,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:39",className:"flex flex-wrap items-center gap-3",children:["Try again when your connection is restored.",s.jsxs(t,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:41",variant:"outline",size:"sm",onClick:()=>e.refetch(),children:[s.jsx(R,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:41",className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]})]}):s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:45",className:"space-y-4",children:[s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:46",className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:47",className:"rounded-xl border border-blue-100 bg-white/80 p-4",children:[s.jsx("p",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:47",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"90-day outflow"}),s.jsxs("p",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:47",className:"mt-1 text-2xl font-semibold text-slate-900",children:["$",c.toFixed(2)]})]}),s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:48",className:"rounded-xl border border-blue-100 bg-white/80 p-4",children:[s.jsx("p",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:48",className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Top activity"}),s.jsx("p",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:48",className:"mt-1 text-2xl font-semibold capitalize text-slate-900",children:i?i[0].replaceAll("_"," "):"No data yet"})]})]}),s.jsxs("div",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:50",className:"flex items-start gap-3 rounded-xl bg-blue-600/10 p-4 text-sm text-blue-950",children:[s.jsx($,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:50",className:"mt-0.5 h-4 w-4 shrink-0 text-blue-600"}),s.jsx("p",{"data-loc":"client/src/components/FinancialAssistantCard.tsx:50",children:i?`Your ${i[0].replaceAll("_"," ")} activity is currently the largest recorded category. Ask the advisor for a realistic savings target.`:"Once you have account activity, the advisor can identify patterns and suggest practical savings goals."})]}),s.jsx(t,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:51",asChild:!0,className:"group bg-blue-600 hover:bg-blue-700",children:s.jsxs(r,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:51",href:"/advisor",children:["Open financial advisor",s.jsx(y,{"data-loc":"client/src/components/FinancialAssistantCard.tsx:51",className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-1"})]})})]})})]})}function as(){const{user:e}=A(),[h,i]=C.useState(!0),{data:c,isLoading:g}=j.accounts.list.useQuery(void 0,{enabled:!!e}),p=c?.[0]?.id,{data:b,isLoading:D}=j.transactions.list.useQuery({accountId:p||0},{enabled:!!p}),N=c?.reduce((a,f)=>a+parseFloat(f.balance),0)||0;return s.jsx(S,{"data-loc":"client/src/pages/Dashboard.tsx:34",children:s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:35",className:"space-y-8",children:[s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:37",children:[s.jsxs("h1",{"data-loc":"client/src/pages/Dashboard.tsx:38",className:"text-3xl font-bold tracking-tight",children:["Welcome back, ",e?.name||"User"]}),s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:39",className:"text-muted-foreground mt-2",children:"Manage your accounts and transactions"})]}),s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:43",className:"bg-gradient-to-br from-blue-600 to-blue-700 border-0 text-white",children:s.jsx(d,{"data-loc":"client/src/pages/Dashboard.tsx:44",children:s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:45",className:"flex items-center justify-between",children:[s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:46",children:[s.jsx(o,{"data-loc":"client/src/pages/Dashboard.tsx:47",className:"text-blue-100",children:"Total Balance"}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:48",className:"flex items-center gap-2 mt-2",children:[s.jsx("h2",{"data-loc":"client/src/pages/Dashboard.tsx:49",className:"text-4xl font-bold",children:h?`$${N.toFixed(2)}`:"••••••"}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:52",variant:"ghost",size:"icon",onClick:()=>i(!h),className:"text-blue-100 hover:text-white hover:bg-blue-500",children:h?s.jsx(E,{"data-loc":"client/src/pages/Dashboard.tsx:58",className:"h-4 w-4"}):s.jsx(M,{"data-loc":"client/src/pages/Dashboard.tsx:58",className:"h-4 w-4"})})]})]}),s.jsx(W,{"data-loc":"client/src/pages/Dashboard.tsx:62",className:"h-12 w-12 text-blue-200"})]})})}),s.jsx(Q,{"data-loc":"client/src/pages/Dashboard.tsx:68"}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:71",className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:72",asChild:!0,className:"h-auto flex-col gap-2 py-6",variant:"outline",children:s.jsxs(r,{"data-loc":"client/src/pages/Dashboard.tsx:73",to:"/transfer",children:[s.jsx(I,{"data-loc":"client/src/pages/Dashboard.tsx:74",className:"h-5 w-5"}),s.jsx("span",{"data-loc":"client/src/pages/Dashboard.tsx:75",children:"Send Money"})]})}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:78",asChild:!0,className:"h-auto flex-col gap-2 py-6",variant:"outline",children:s.jsxs(r,{"data-loc":"client/src/pages/Dashboard.tsx:79",to:"/deposit",children:[s.jsx(u,{"data-loc":"client/src/pages/Dashboard.tsx:80",className:"h-5 w-5"}),s.jsx("span",{"data-loc":"client/src/pages/Dashboard.tsx:81",children:"Request Money"})]})}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:84",asChild:!0,className:"h-auto flex-col gap-2 py-6",variant:"outline",children:s.jsxs(r,{"data-loc":"client/src/pages/Dashboard.tsx:85",to:"/settings",children:[s.jsx(P,{"data-loc":"client/src/pages/Dashboard.tsx:86",className:"h-5 w-5"}),s.jsx("span",{"data-loc":"client/src/pages/Dashboard.tsx:87",children:"Add Account"})]})})]}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:93",children:[s.jsx("h3",{"data-loc":"client/src/pages/Dashboard.tsx:94",className:"text-lg font-semibold mb-4",children:"Your Accounts"}),s.jsx("div",{"data-loc":"client/src/pages/Dashboard.tsx:95",className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:g?s.jsxs(s.Fragment,{children:[s.jsx(n,{"data-loc":"client/src/pages/Dashboard.tsx:98",className:"h-32"}),s.jsx(n,{"data-loc":"client/src/pages/Dashboard.tsx:99",className:"h-32"})]}):c&&c.length>0?c.map(a=>s.jsxs(l,{"data-loc":"client/src/pages/Dashboard.tsx:103",className:"hover:shadow-lg transition-shadow",children:[s.jsx(d,{"data-loc":"client/src/pages/Dashboard.tsx:104",children:s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:105",className:"flex items-center justify-between",children:[s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:106",children:[s.jsxs(o,{"data-loc":"client/src/pages/Dashboard.tsx:107",className:"capitalize",children:[a.accountType," Account"]}),s.jsx(x,{"data-loc":"client/src/pages/Dashboard.tsx:108",className:"mt-2",children:a.accountNumber})]}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:110",className:"text-right",children:[s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:111",className:"text-xs text-muted-foreground",children:a.currency}),s.jsxs("p",{"data-loc":"client/src/pages/Dashboard.tsx:112",className:"text-2xl font-bold",children:["$",parseFloat(a.balance).toFixed(2)]})]})]})}),s.jsx(m,{"data-loc":"client/src/pages/Dashboard.tsx:116",children:s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:117",className:"flex gap-2",children:[s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:118",asChild:!0,size:"sm",variant:"outline",className:"flex-1",children:s.jsx(r,{"data-loc":"client/src/pages/Dashboard.tsx:119",to:"/transfer",children:"Send"})}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:121",asChild:!0,size:"sm",variant:"outline",className:"flex-1",children:s.jsx(r,{"data-loc":"client/src/pages/Dashboard.tsx:122",to:"/deposit",children:"Receive"})})]})})]},a.id)):s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:129",children:s.jsxs(m,{"data-loc":"client/src/pages/Dashboard.tsx:130",className:"pt-6 text-center",children:[s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:131",className:"text-muted-foreground mb-4",children:"No accounts yet"}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:132",asChild:!0,children:s.jsx(r,{"data-loc":"client/src/pages/Dashboard.tsx:133",to:"/settings",children:"Create Account"})})]})})})]}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:142",children:[s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:143",className:"flex items-center justify-between mb-4",children:[s.jsx("h3",{"data-loc":"client/src/pages/Dashboard.tsx:144",className:"text-lg font-semibold",children:"Recent Transactions"}),s.jsx(t,{"data-loc":"client/src/pages/Dashboard.tsx:145",asChild:!0,variant:"ghost",size:"sm",children:s.jsx(r,{"data-loc":"client/src/pages/Dashboard.tsx:146",to:"/transactions",children:"View All"})})]}),s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:149",children:s.jsx(m,{"data-loc":"client/src/pages/Dashboard.tsx:150",className:"pt-6",children:D?s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:152",className:"space-y-4",children:[s.jsx(n,{"data-loc":"client/src/pages/Dashboard.tsx:153",className:"h-12"}),s.jsx(n,{"data-loc":"client/src/pages/Dashboard.tsx:154",className:"h-12"}),s.jsx(n,{"data-loc":"client/src/pages/Dashboard.tsx:155",className:"h-12"})]}):b&&b.length>0?s.jsx("div",{"data-loc":"client/src/pages/Dashboard.tsx:158",className:"space-y-4",children:b.slice(0,5).map(a=>s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:160",className:"flex items-center justify-between py-3 border-b last:border-0",children:[s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:161",className:"flex items-center gap-3",children:[s.jsx("div",{"data-loc":"client/src/pages/Dashboard.tsx:162",className:"p-2 bg-muted rounded-lg",children:a.type==="transfer"||a.type==="withdrawal"?s.jsx(O,{"data-loc":"client/src/pages/Dashboard.tsx:164",className:"h-4 w-4 text-red-500"}):s.jsx(u,{"data-loc":"client/src/pages/Dashboard.tsx:166",className:"h-4 w-4 text-green-500"})}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:169",children:[s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:170",className:"font-medium capitalize",children:a.type}),s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:171",className:"text-sm text-muted-foreground",children:new Date(a.createdAt).toLocaleDateString()})]})]}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:176",className:"text-right",children:[s.jsxs("p",{"data-loc":"client/src/pages/Dashboard.tsx:177",className:`font-semibold ${a.type==="transfer"||a.type==="withdrawal"?"text-red-600":"text-green-600"}`,children:[a.type==="transfer"||a.type==="withdrawal"?"-":"+",a.currency," ",parseFloat(a.amount).toFixed(2)]}),s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:185",className:"text-xs text-muted-foreground capitalize",children:a.status})]})]},a.id))}):s.jsx("p",{"data-loc":"client/src/pages/Dashboard.tsx:191",className:"text-center text-muted-foreground py-8",children:"No transactions yet"})})})]}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:198",className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:199",children:s.jsxs(d,{"data-loc":"client/src/pages/Dashboard.tsx:200",children:[s.jsx(o,{"data-loc":"client/src/pages/Dashboard.tsx:201",children:"Monthly Spending"}),s.jsx(x,{"data-loc":"client/src/pages/Dashboard.tsx:202",className:"text-2xl",children:"$2,450"})]})}),s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:205",children:s.jsxs(d,{"data-loc":"client/src/pages/Dashboard.tsx:206",children:[s.jsx(o,{"data-loc":"client/src/pages/Dashboard.tsx:207",children:"Accounts"}),s.jsx(x,{"data-loc":"client/src/pages/Dashboard.tsx:208",className:"text-2xl",children:c?.length||0})]})}),s.jsx(l,{"data-loc":"client/src/pages/Dashboard.tsx:211",children:s.jsxs(d,{"data-loc":"client/src/pages/Dashboard.tsx:212",children:[s.jsx(o,{"data-loc":"client/src/pages/Dashboard.tsx:213",children:"Growth"}),s.jsxs("div",{"data-loc":"client/src/pages/Dashboard.tsx:214",className:"flex items-center gap-2 mt-2",children:[s.jsx(w,{"data-loc":"client/src/pages/Dashboard.tsx:215",className:"h-4 w-4 text-green-600"}),s.jsx(x,{"data-loc":"client/src/pages/Dashboard.tsx:216",className:"text-2xl text-green-600",children:"+12.5%"})]})]})})]})]})})}export{as as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.