import{d as _,ex as y,F as z,b as O,c as w,e as c,er as h,bu as k,bw as v,t as x}from"./registerWidgets.92d2f644.js";import{e as C,f as I}from"./icons.f7e2c66d.js";import{a as N}from"./asyncComputed.969e5e52.js";import"./gateway.b5fd6e0f.js";import{O as d}from"./organization.677061f5.js";import"./index.a8106eac.js";import{C as D}from"./CrudView.bf94fe37.js";import{N as A}from"./Navbar.807fddfe.js";import"./passwordlessManager.d1484834.js";import"./pubsub.cabffe13.js";import"./storage.63ab52ef.js";import"./activeRecord.1a640186.js";import"./DropdownMenu.737d17d7.js";import"./Modal.2ef1e90a.js";import"./LoadingIndicator.6e991a44.js";import"./lottie.8475a642.js";import"./logo.084e5d7c.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="db8133cc-778d-40b4-af08-ce892ff111d3",n._sentryDebugIdIdentifier="sentry-dbid-db8133cc-778d-40b4-af08-ce892ff111d3")}catch{}})();const B={class:"organizations"},E=_({__name:"Organizations",setup(n){const o=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=y(),{loading:m,result:r,refetch:p}=N(()=>d.list()),s=({key:e})=>{l.push({name:"organization",params:{organizationId:e}})},u=async e=>{const t=await d.create(e.name);s({key:t.id})},g=async({key:e})=>{var t,a;confirm("Are you sure you want to delete this organization?")&&(await((a=(t=r.value)==null?void 0:t.find(b=>b.id===e))==null?void 0:a.delete()),p())},f=z(()=>{var e,t;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(t=(e=r.value)==null?void 0:e.map(a=>({key:a.id,cells:[{text:a.name,classes:["title","centered"],link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",classes:["centered"],actions:[{icon:C,label:"Delete",onClick:g,dangerous:!0},{icon:I,label:"Edit Organization",onClick:s}]}]})))!=null?t:[]}});return(e,t)=>(O(),w(v,null,[c(A,{breadcrumb:o}),h("div",B,[c(D,{"entity-name":"organization",loading:k(m),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:f.value,fields:i,onCreate:u},null,8,["loading","table"])])],64))}});const W=x(E,[["__scopeId","data-v-29b5921d"]]);export{W as default};
//# sourceMappingURL=Organizations.0be95e5f.js.map
