import{d as y,J as _,L as z,b as O,c as w,e as c,y as h,A as k,F as v,t as C}from"./registerWidgets.a9b9c198.js";import{e as x,f as I}from"./icons.e4ff78f2.js";import{a as N}from"./asyncComputed.380e0794.js";import"./gateway.ff7b2acd.js";import{O as d}from"./organization.bd8b615c.js";import"./index.6965b89d.js";import{C as A}from"./CrudView.17d5ced2.js";import{N as D}from"./Navbar.2c426f39.js";import"./passwordlessManager.18e9d509.js";import"./pubsub.d6cf90d7.js";import"./activeRecord.ded96690.js";import"./DropdownMenu.cf7e2976.js";import"./Modal.0c783a31.js";import"./LoadingIndicator.32e0b7e2.js";import"./lottie.cb2a87b3.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]="0ea8697a-a53e-49ba-9002-10b06ee01eb1",n._sentryDebugIdIdentifier="sentry-dbid-0ea8697a-a53e-49ba-9002-10b06ee01eb1")}catch{}})();const B={class:"organizations"},E=y({__name:"Organizations",setup(n){const o=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=_(),{loading:m,result:r,refetch:p}=N(()=>d.list()),s=({key:e})=>{l.push({name:"organization",params:{organizationId:e}})},u=async e=>{const a=await d.create(e.name);s({key:a.id})},g=async({key:e})=>{var a,t;confirm("Are you sure you want to delete this organization?")&&(await((t=(a=r.value)==null?void 0:a.find(f=>f.id===e))==null?void 0:t.delete()),p())},b=z(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,classes:["title","centered"],link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",classes:["centered"],actions:[{icon:x,label:"Delete",onClick:g,dangerous:!0},{icon:I,label:"Edit Organization",onClick:s}]}]})))!=null?a:[]}});return(e,a)=>(O(),w(v,null,[c(D,{breadcrumb:o}),h("div",B,[c(A,{"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:b.value,fields:i,onCreate:u},null,8,["loading","table"])])],64))}});const S=C(E,[["__scopeId","data-v-29b5921d"]]);export{S as default};
//# sourceMappingURL=Organizations.a75df110.js.map
