import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{ft as t}from"./vendor-primevue-DyvCA8Nd.js";import"./vendor-firebase-yTFzdAQf.js";import{F as n,Ht as r,I as i,O as a,Ot as o,R as s,_t as c,et as l,j as u}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-Q0G0D0d6.js";import"./useFeatureFlags-BfqxvwHy.js";import"./api-C840HmAF.js";import"./vendor-markdown-8POvMhty.js";import"./colorUtil-Q3kaA72Z.js";import{n as d}from"./vendor-i18n-NwyZMF0q.js";import"./i18n-B8CRKNXU.js";import"./vendor-reka-ui-Dfvl2gA8.js";import{t as f}from"./Button-uSZXZovG.js";import{Kr as p,wr as m}from"./dialogService-J-k0CeI4.js";import"./systemStatsStore-BJOd4X3d.js";import"./userStore-o2bxxBJt.js";import"./useErrorHandling-t4kNWELW.js";import"./vendor-tiptap-BZCaYoPl.js";import"./Popover-BV6_S20i.js";import"./markdownRendererUtil-DH1PCfUd.js";import"./useExternalLink-Cxwyf6Kb.js";var h={class:`flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background`},g={class:`flex h-12 items-center justify-between border-b border-border-default px-4`},_={class:`m-0 text-sm font-normal text-base-foreground`},v=[`aria-label`],y={class:`px-4 py-4`},b={class:`m-0 text-sm text-muted-foreground`},x={class:`flex items-center justify-end gap-4 px-4 py-4`},S=s({__name:`DeleteWorkspaceDialogContent`,props:{workspaceId:{},workspaceName:{}},setup(e){let{t:s}=d(),S=t(),C=p(),w=m(),T=o(!1);function onCancel(){C.closeDialog({key:`delete-workspace`})}async function onDelete(){T.value=!0;try{await w.deleteWorkspace(e.workspaceId),C.closeDialog({key:`delete-workspace`}),window.location.reload()}catch(e){console.error(`[DeleteWorkspaceDialog] Failed to delete workspace:`,e),S.add({severity:`error`,summary:s(`workspacePanel.toast.failedToDeleteWorkspace`),detail:e instanceof Error?e.message:s(`g.unknownError`),life:5e3})}finally{T.value=!1}}return(e,t)=>(l(),u(`div`,h,[a(`div`,g,[a(`h2`,_,r(e.$t(`workspacePanel.deleteDialog.title`)),1),a(`button`,{class:`cursor-pointer rounded border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-secondary-foreground`,"aria-label":e.$t(`g.close`),onClick:onCancel},t[0]||=[a(`i`,{class:`pi pi-times size-4`},null,-1)],8,v)]),a(`div`,y,[a(`p`,b,r(e.workspaceName?e.$t(`workspacePanel.deleteDialog.messageWithName`,{name:e.workspaceName}):e.$t(`workspacePanel.deleteDialog.message`)),1)]),a(`div`,x,[i(f,{variant:`muted-textonly`,onClick:onCancel},{default:c(()=>[n(r(e.$t(`g.cancel`)),1)]),_:1}),i(f,{variant:`destructive`,size:`lg`,loading:T.value,onClick:onDelete},{default:c(()=>[n(r(e.$t(`g.delete`)),1)]),_:1},8,[`loading`])])]))}});export{S as default};
//# sourceMappingURL=DeleteWorkspaceDialogContent-B3ynu2EP.js.map