import{d as _,eA as w,G as C,b as h,c as k,w as c,f as d,u as O}from"./outputWidgets.32262ea4.js";import{v as x,C as I}from"./icons.f6f8ddd9.js";import{a as v}from"./asyncComputed.2515c9c2.js";import"./authorManager.bf87d9ac.js";import"./index.2dfe4d35.js";import{O as l}from"./organization.f1af1618.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.aeae481e.js";import{C as D}from"./CrudView.3a879739.js";import{B}from"./BaseLayout.6bbf44f6.js";import{a as N}from"./ant-design.295985b3.js";import"./index.cf4c23b9.js";import"./record.b25fae92.js";import"./pubsub.688bf9b2.js";import"./gateway.c70bbf22.js";import"./logo.084e5d7c.js";import"./Text.5738d3bb.js";import"./Title.4f1fbb5b.js";import"./index.3d4aee4e.js";import"./FormItem.dc863e60.js";import"./hasIn.4e5c4024.js";import"./Form.0ac7561e.js";import"./Modal.1c897574.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.db135e16.js";import"./router.24325fd4.js";import"./index.1d7a7a89.js";import"./url.bc186fa2.js";import"./index.e1a424df.js";import"./index.62cf3b9c.js";import"./index.0278a234.js";import"./index.df3792d3.js";import"./index.c9aa3d70.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="69808e2b-ee4e-4071-a040-aea2181157da",a._sentryDebugIdIdentifier="sentry-dbid-69808e2b-ee4e-4071-a040-aea2181157da")}catch{}})();const ct=_({__name:"Organizations",setup(a){const i=[{label:"My organizations",path:"/organizations"}],n=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const o=await l.create(t.name);s({key:o.id})},y=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),g())},b=C(()=>{var t,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(h(),k(B,null,{navbar:c(()=>[d(A,{breadcrumb:i})]),content:c(()=>[d(D,{"entity-name":"organization",loading:O(u),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:n,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{ct as default};
//# sourceMappingURL=Organizations.44eea6f4.js.map
