module.exports=[972,a=>{"use strict";var b=a.i(87924),c=a.i(72131);function d(){let[a,d]=(0,c.useState)(null),[f,g]=(0,c.useState)(!0);return((0,c.useEffect)(()=>{fetch("/api/admin/stats").then(a=>a.json()).then(d).catch(console.error).finally(()=>g(!1))},[]),f)?(0,b.jsx)("div",{className:"py-20 text-center text-white/50",children:"Loading admin dashboard..."}):a?(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold",children:"Admin Overview"}),(0,b.jsx)("p",{className:"text-sm text-white/50",children:"Platform-wide metrics and activity"})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,b.jsx)(e,{label:"Total Users",value:a.totalUsers,sub:`+${a.signups7d} this week`}),(0,b.jsx)(e,{label:"MRR",value:`$${a.mrr}`,sub:`${a.usersByPlan?.starter||0} starter \xb7 ${a.usersByPlan?.pro||0} pro`}),(0,b.jsx)(e,{label:"Active Bots",value:a.activeBots,sub:`${a.totalBots} total`}),(0,b.jsx)(e,{label:"Conversations (24h)",value:a.conversations24h,sub:`${a.conversations7d} this week`}),(0,b.jsx)(e,{label:"Leads (7d)",value:a.leads7d,sub:`${a.totalLeads} total`}),(0,b.jsx)(e,{label:"Knowledge Chunks",value:a.totalChunks,sub:"Total stored"})]}),(0,b.jsx)("div",{className:"grid gap-4 md:grid-cols-3",children:["free","starter","pro"].map(c=>(0,b.jsxs)("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[(0,b.jsx)("p",{className:"text-xs font-semibold uppercase text-white/40",children:c}),(0,b.jsx)("p",{className:"mt-1 text-3xl font-bold",children:a.usersByPlan?.[c]||0}),(0,b.jsx)("p",{className:"text-xs text-white/40",children:"users"})]},c))}),(0,b.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,b.jsxs)("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[(0,b.jsx)("p",{className:"mb-3 text-sm font-semibold text-white/70",children:"Recent Signups"}),0===a.recentSignups.length?(0,b.jsx)("p",{className:"text-sm text-white/30",children:"No recent signups"}):(0,b.jsx)("div",{className:"space-y-2",children:a.recentSignups.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-white/5 px-3 py-2 text-sm",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-white/40",children:a.email})]}),(0,b.jsxs)("div",{className:"text-right",children:[(0,b.jsx)("span",{className:"rounded-full bg-[var(--color-bg-brand)]/20 px-2 py-0.5 text-xs text-[var(--color-accent-green-light)]",children:a.plan}),(0,b.jsx)("p",{className:"mt-1 text-xs text-white/30",children:new Date(a.createdAt).toLocaleDateString()})]})]},c))})]}),(0,b.jsxs)("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[(0,b.jsx)("p",{className:"mb-3 text-sm font-semibold text-white/70",children:"Recent Bots Created"}),0===a.recentActivity.length?(0,b.jsx)("p",{className:"text-sm text-white/30",children:"No recent bots"}):(0,b.jsx)("div",{className:"space-y-2",children:a.recentActivity.map((a,c)=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-xl bg-white/5 px-3 py-2 text-sm",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:a.name}),(0,b.jsx)("p",{className:"text-xs text-white/40",children:a.userId?.email})]}),(0,b.jsx)("span",{className:`rounded-full px-2 py-0.5 text-xs ${"active"===a.status?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"}`,children:a.status})]},c))})]})]})]}):(0,b.jsx)("div",{className:"py-20 text-center text-red-400",children:"Failed to load stats"})}function e({label:a,value:c,sub:d}){return(0,b.jsxs)("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[(0,b.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider text-white/40",children:a}),(0,b.jsx)("p",{className:"mt-2 text-3xl font-bold",children:c}),(0,b.jsx)("p",{className:"mt-1 text-xs text-white/40",children:d})]})}a.s(["default",()=>d])}];

//# sourceMappingURL=src_app_%28admin%29_thisistheaeyesecretlogin_page_tsx_417292ea._.js.map