1import{c as S,j as e,e as D,o as t,r as L,B as r,L as l,_ as U}from"./index-OkXy-d5Y.js";import{A as P,a as T}from"./alert-0QuNooNy.js";import{B as _}from"./badge-D70DEMXH.js";import{C as c,a as p,c as u,b as o}from"./card-BOYNs0rn.js";import{S as x}from"./skeleton-CTnX7jIE.js";import{U as E}from"./UsageBar-Bpipzlxn.js";import{s as z,a as I,b as M,f as F}from"./dashboardSlice-Catn3u6Y.js";import{s as q,a as K,f as H}from"./usageSlice-CgepbOY5.js";import{a as O}from"./orgsSlice-mdJJI7Vn.js";import{P as v}from"./plus-CqeGYQIF.js";import{B as C}from"./boxes-BLoE49t_.js";import{K as R}from"./key-BiiylvYb.js";import{B as A}from"./brain-miUL15Zz.js";import{S as V}from"./search-Bi7-eThi.js";import{C as $}from"./circle-alert-CQF3oPcN.js";import"./progress-bFXLrkxf.js";/** 2 * @license lucide-react v0.487.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 Q=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],k=S("arrow-right",Q);/** 7 * @license lucide-react v0.487.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const W=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],Y=S("trending-up",W);function h({title:i,value:n,description:s,icon:d}){return e.jsxs(c,{children:[e.jsxs(p,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(u,{className:"text-sm",children:i}),e.jsx(d,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs(o,{children:[e.jsx("div",{className:"text-2xl",children:n}),s&&e.jsx("p",{className:"text-xs text-muted-foreground",children:s})]})]})}function G(){var y,b;const i=D(),n=t(O),s=t(z),d=t(I),N=t(M),j=t(q),B=t(K);L.useEffect(()=>
11{i(F()),n&&i(H(n))},[i,n]);const f=(j==null?void 0:j.usages)??[],w=((y=s==null?void 0:s.plan)==null?void 0:y.name)??null,m=((b=s==null?void 0:s.plan)==null?void 0:b.usagePercent)??null;return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl",children:"Dashboard"}),e.jsx("p",{className:"text-muted-foreground",children:"Welcome back â here's an overview of your account"})]}),e.jsx(r,{asChild:!0,className:"min-h-12 w-full sm:w-auto",children:e.jsxs(l,{to:"/dashboard/apps",children:[e.jsx(v,{className:"mr-2 h-4 w-4"})," New App"]})})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:d?e.jsx(e.Fragment,{children:[1,2,3,4].map(a=>e.jsx(x,{className:"h-28 rounded-lg"},a))}):e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Applications",value:(s==null?void 0:s.appsCount)??"â",icon:C,description:"Total apps"}),e.jsx(h,{title:"API Keys",value:(s==null?void 0:s.keysCount)??"â",icon:R,description:"Across all apps"}),e.jsx(h,{title:"Total Memories",value:(s==null?void 0:s.memoriesCount)!=null?s.memoriesCount.toLocaleString():"â",icon:A,description:"All-time stored memories"}),e.jsx(h,{title:"Total Searches",value:(s==null?void 0:s.searchesCount)!=null?s.searchesCount.toLocaleString():"â",icon:V,description:"All-time queries executed"})]})}),!d&&((s==null?void 0:s.appsCount)??0)===0&&e.jsx(c,{className:"border-dashed max-w-lg mx-auto",children:e.jsxs(o,{className:"flex flex-col items-center justify-center py-12 text-center gap-4",children:[e.jsx(U,{name:"smonku_empty_shelf",alt:"Smonku beside an empty shelf",loading:"lazy",width:512,height:512,className:"h-48 w-48 object-cover smonku-fade"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-lg font-semibold",children:"The shelves are empty â for now"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-xs mx-auto",children:"Smonku is ready to remember. Create your first app and give him something to hold onto."})]}),e.jsx(r,{asChild:!0,children:e.jsxs(l,{to:"/dashboard/apps/new/configure",children:[e.jsx(v,{className:"mr-2 h-4 w-4"})," Create Your First App"]})})]})}),N&&e.jsxs(P,{variant:"destructive",children:[e.jsx($,{className:"h-4 w-4"}),e.jsx(T,{children:N})]}),w&&e.jsxs(c,{children:[e.jsxs(p,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs(u,{className:"text-base flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4 text-primary"}),"Current Plan"]}),e.jsx(r,{variant:"ghost",size:"sm",asChild:!0,children:e.jsxs(l,{to:"/dashboard/usage",children:["View billing ",e.jsx(k,{className:"ml-1 h-3 w-3"})]})})]}),e.jsxs(o,{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(_,{variant:"secondary",className:"capitalize",children:w}),m!=null&&e.jsxs("span",{className:"text-sm text-muted-foreground",children:[m.toFixed(1),"% of quota used"]})]}),m!=null&&e.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:e.jsx("div",{className:"bg-primary h-2 rounded-full transition-all",style:{width:`${Math.min(m,100)}%`}})})]})]}),e.jsxs(c,{children:[e.jsxs(p,{className:"flex flex-row items-center justify-between",children:[e.jsx(u,{className:"text-base",children:"Usage Overview"}),e.jsx(r,{variant:"ghost",size:"sm",asChild:!0,children:e.jsxs(l,{to:"/dashboard/usage",children:["View details ",e.jsx(k,{className:"ml-1 h-3 w-3"})]})})]}),e.jsx(o,{children:B?e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{className:"h-8 w-full"}),e.jsx(x,{className:"h-8 w-full"}),e.jsx(x,{className:"h-8 w-full"})]}):f&&f.length>0?e.jsx("div",{className:"space-y-4",children:f.map(a=>{const g=a.type??"";return e.jsx(E,{label:g.charAt(0).toUpperCase()+g.slice(1),used:a.used??0,granted:a.granted??0,percentage:a.percentage??0},g)})}):e.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No usage data available yet. Create your first app to get started."})})]}),e.jsxs(c,{children:[e.jsx(p,{children:e.jsx(u,{className:"text-base",children:"Qu
11ick Actions"})}),e.jsx(o,{children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[e.jsx(r,{variant:"outline",className:"justify-start h-auto py-3",asChild:!0,children:e.jsxs(l,{to:"/dashboard/apps",children:[e.jsx(C,{className:"mr-2 h-4 w-4 text-primary"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-sm",children:"Manage Apps"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Create and configure applications"})]})]})}),e.jsx(r,{variant:"outline",className:"justify-start h-auto py-3",asChild:!0,children:e.jsxs(l,{to:"/dashboard/memories",children:[e.jsx(A,{className:"mr-2 h-4 w-4 text-primary"}),e.jsxs("div",{className:"text-left",children:[e.jsx("p",{className:"text-sm",children:"Memory Explorer"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Browse stored memories"})]})]})})]})})]})]})}function he(){return e.jsx(G,{})}export{he as DashboardHomePage};
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.