import{i as e,n as t}from"./rolldown-runtime-BKYq3fBv.js";import{Cr as n,En as r,Nn as i,Rr as a,Tn as o,Xr as s,Zn as c,ar as l,er as u,ir as d,sr as f,ui as p}from"./vendor-primevue-D50rA9nL.js";import{ot as m,st as h}from"./vendor-other-BnH5nyVX.js";import{n as g,t as _}from"./Button-DzMg17Os.js";import{c as v,ca as y,s as b,sa as x}from"./dialogService-Cr3DyAja.js";var S,C,w,T,E,D,O,k,A=t((()=>{i(),o(),m(),g(),b(),x(),S={class:`flex w-full max-w-[360px] flex-col rounded-2xl border border-border-default bg-base-background`},C={class:`flex h-12 items-center justify-between border-b border-border-default px-4`},w={class:`m-0 text-sm font-normal text-base-foreground`},T=[`aria-label`],E={class:`px-4 py-4`},D={class:`m-0 text-sm text-muted-foreground`},O={class:`flex items-center justify-end gap-4 px-4 py-4`},k=f({__name:`LeaveWorkspaceDialogContent`,setup(e){let{t}=h(),i=r(),o=y(),f=v(),m=s(!1);function onCancel(){o.closeDialog({key:`leave-workspace`})}async function onLeave(){m.value=!0;try{await f.leaveWorkspace(),o.closeDialog({key:`leave-workspace`}),window.location.reload()}catch(e){console.error(`[LeaveWorkspaceDialog] Failed to leave workspace:`,e),i.add({severity:`error`,summary:t(`workspacePanel.toast.failedToLeaveWorkspace`),detail:e instanceof Error?e.message:t(`g.unknownError`),life:5e3})}finally{m.value=!1}}return(e,t)=>(n(),u(`div`,S,[c(`div`,C,[c(`h2`,w,p(e.$t(`workspacePanel.leaveDialog.title`)),1),c(`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]||=[c(`i`,{class:`pi pi-times size-4`},null,-1)],8,T)]),c(`div`,E,[c(`p`,D,p(e.$t(`workspacePanel.leaveDialog.message`)),1)]),c(`div`,O,[l(_,{variant:`muted-textonly`,onClick:onCancel},{default:a(()=>[d(p(e.$t(`g.cancel`)),1)]),_:1}),l(_,{variant:`destructive`,size:`lg`,loading:m.value,onClick:onLeave},{default:a(()=>[d(p(e.$t(`workspacePanel.leaveDialog.leave`)),1)]),_:1},8,[`loading`])])]))}})})),j;t((()=>{A(),A(),j=k}))();export{j as default};
//# sourceMappingURL=LeaveWorkspaceDialogContent-Bl9Po3oO.js.map