import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{dt as t}from"./vendor-primevue-CIZeDNer.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-DOjudfJ1.js";import"./useFeatureFlags-CwpAZwBL.js";import"./api-pyyMp5An.js";import"./vendor-markdown-th9BvURy.js";import"./colorUtil-CaOYwqZT.js";import{n as d}from"./vendor-i18n-CpHGo1Sd.js";import"./i18n-qK6isbxx.js";import"./vendor-reka-ui-NsM8zEZd.js";import{t as f}from"./Button-BonqIZfE.js";import{Ji as p,Ti as m}from"./dialogService-Dz-57Tpg.js";import"./extensionStore-CGI8V8NM.js";import"./userStore-Db3V002h.js";import"./useErrorHandling-w2dl_Z1z.js";import"./useCopyToClipboard-DeXt33ef.js";import"./useExternalLink-C7QBjeHM.js";import"./vendor-tiptap-nOCIQysJ.js";import"./markdownRendererUtil-DO0bU-vH.js";import"./Popover-CTWL6O4Q.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:`p-4`},b={class:`m-0 text-sm text-muted-foreground`},x={class:`flex items-center justify-end gap-4 p-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`)})}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:`focus-visible:ring-secondary-foreground cursor-pointer rounded-sm border-none bg-transparent p-0 text-muted-foreground transition-colors hover:text-base-foreground focus-visible:ring-1 focus-visible:outline-none`,"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-CR0pemUU.js.map