(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,259295,e=>{"use strict";var s=e.i(738776),r=e.i(482560),o=e.i(749943),t=e.i(451534),a=e.i(315775),i=e.i(962562),n=e.i(953700),l=e.i(137340),c=e.i(244644),d=e.i(106486),u=e.i(260218),m=e.i(917955),p=e.i(361031),x=e.i(233297),h=e.i(566531);function g({initialWorkspaces:e}){let j=(0,d.useTranslations)("workspaces");(0,d.useTranslations)("common");let f=(0,o.useRouter)(),k=(0,p.useWorkspaceStore)(e=>e.workspaces),b=(0,p.useWorkspaceStore)(e=>e.setWorkspaces),v=(0,p.useWorkspaceStore)(e=>e.removeWorkspace),N=(0,p.useWorkspaceStore)(e=>e.openWorkspaceDialog);(0,r.useEffect)(()=>{b(e)},[e,b]);let w=async e=>{confirm(j("deleteConfirm",{name:e.name}))&&(await h.sdk.workspace.delete(e.id),v(e.id))},y=async e=>{await h.sdk.workspace.reveal(e.id)};return(0,s.jsx)("div",{className:"flex min-h-dvh w-full flex-col",children:(0,s.jsxs)("main",{className:"mx-auto size-full max-w-7xl flex-1 px-4 py-6 sm:px-6",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center justify-between",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:j("title")}),(0,s.jsxs)(u.Button,{onClick:()=>N(),size:"sm",className:"rounded-full px-4",children:[(0,s.jsx)(n.Plus,{className:"size-3.5"}),j("newWorkspace")]})]}),0===k.length?(0,s.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-16 text-center",children:[(0,s.jsx)(t.FolderOpen,{className:"size-10 mx-auto text-muted-foreground/40 mb-4"}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:j("emptyMessage")})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:k.map(e=>(0,s.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>(0,x.tauriNavigate)(f,`/workspace/${e.id}`),onKeyDown:s=>{"Enter"===s.key&&(0,x.tauriNavigate)(f,`/workspace/${e.id}`)},className:"group relative cursor-pointer rounded-2xl border border-border bg-card p-5 hover:shadow-card-hover transition-all duration-200 block",children:[(0,s.jsxs)(m.DropdownMenu,{children:[(0,s.jsx)(m.DropdownMenuTrigger,{className:"absolute right-3 top-3 flex items-center justify-center rounded-md p-1 opacity-0 group-hover:opacity-100 hover:bg-accent transition-opacity cursor-pointer",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(a.MoreHorizontal,{className:"size-4 text-muted-foreground"})}),(0,s.jsxs)(m.DropdownMenuContent,{align:"end",children:[(0,s.jsxs)(m.DropdownMenuItem,{onClick:s=>{s.stopPropagation(),N(e)},children:[(0,s.jsx)(i.Pencil,{className:"size-3.5"}),j("edit")]}),(0,s.jsxs)(m.DropdownMenuItem,{onClick:s=>{s.stopPropagation(),y(e)},children:[(0,s.jsx)(c.FolderSearch,{className:"size-3.5"}),j("reveal")]}),(0,s.jsxs)(m.DropdownMenuItem,{variant:"destructive",onClick:s=>{s.stopPropagation(),w(e)},children:[(0,s.jsx)(l.Trash2,{className:"size-3.5"}),j("delete")]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 shrink-0 rounded-xl bg-primary/10 flex items-center justify-center",children:(0,s.jsx)(t.FolderOpen,{className:"size-5 text-primary"})}),(0,s.jsx)("h3",{className:"font-heading text-lg font-semibold truncate",children:e.name})]}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1 truncate",children:e.boundDirs.join(", ")})]},e.id))})]})})}var j=e.i(437122);e.s(["default",0,function(){let[e,o]=(0,r.useState)([]);return(0,r.useEffect)(()=>{fetch("/api/workspaces",{headers:(0,j.authHeaders)()}).then(e=>e.ok?e.json():[]).then(o)},[]),(0,s.jsx)(g,{initialWorkspaces:e})}],259295)}]);