import{d as _,K as y,b as z,c as O,e as c,x as k,z as d,F as w,H as h,q as x}from"./registerWidgets.29e41a54.js";import{f as C,g as v}from"./icons.b931f659.js";import{a as I}from"./asyncComputed.0126d7e4.js";import"./gateway.dfba55d6.js";import{O as l}from"./organization.252003ea.js";import{C as N}from"./CrudView.3bd8b7de.js";import{N as D}from"./Navbar.bbfdac3f.js";import"./passwordlessManager.88f105f1.js";import"./activeRecord.d63d0be1.js";import"./DropdownMenu.7bd7adf5.js";import"./CircularLoading.0d1cd4f5.js";import"./Modal.7746640d.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]="9e57763b-0f76-4f68-9623-06410d6452b0",n._sentryDebugIdIdentifier="sentry-dbid-9e57763b-0f76-4f68-9623-06410d6452b0")}catch{}})();const A={class:"organizations"},B=_({__name:"Organizations",setup(n){const o=[{key:"name",label:"Organization Name"}],i=h(),{loading:m,result:r,refetch:u}=I(()=>l.list()),s=({key:e})=>{i.push({name:"organization",params:{organizationId:e}})},g=async e=>{const t=await l.create(e.name);s({key:t.id})},p=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()),u())},f=y(()=>{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:p,dangerous:!0},{icon:v,label:"Edit Organization",onClick:s}]}]})))!=null?t:[]}});return(e,t)=>(z(),O(w,null,[c(D),k("div",A,[c(N,{"entity-name":"organization",loading:d(m),"ask-name-on-create":!0,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:d(f),fields:o,onCreate:g},null,8,["loading","table"])])],64))}});const G=x(B,[["__scopeId","data-v-b120b69b"]]);export{G as default};
//# sourceMappingURL=Organizations.3d216ed6.js.map
