import{d as _,ey as w,H as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.a4629ff8.js";import{e as x,b as I}from"./icons.73bff2ab.js";import{a as v}from"./asyncComputed.fb8b9ba6.js";import"./router.ab2ac3ba.js";import{O as l}from"./organization.6571a8a9.js";import"./columns.464a3bb5.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.d4c1eb85.js";import{C as A}from"./CrudView.a5b1a4eb.js";import{B}from"./BaseLayout.4a3e21df.js";import{a as N}from"./ant-design.523e8417.js";import"./Title.cf2a531e.js";import"./index.339c7421.js";import"./gateway.68939de7.js";import"./activeRecord.a2b7d343.js";import"./pubsub.25dc8c41.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./Text.eb216708.js";import"./index.fda4c602.js";import"./index.dc4c5f56.js";import"./Form.ab59726f.js";import"./url.d6a620b9.js";import"./index.874565bb.js";import"./index.48817ebe.js";import"./index.0f6dde5f.js";import"./index.46db6cb2.js";import"./index.56cfba6d.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="175e8fed-ee20-4b0e-930e-a38834a00052",a._sentryDebugIdIdentifier="sentry-dbid-175e8fed-ee20-4b0e-930e-a38834a00052")}catch{}})();const ie=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:g}=v(()=>l.list()),s=({key:e})=>{p.push({name:"organization",params:{organizationId:e}})},f=async e=>{const o=await l.create(e.name);s({key:o.id})},y=async({key:e})=>{var t,m;await N("Are you sure you want to delete this organization?")&&(await((m=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:m.delete()),g())},b=h(()=>{var e,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:y,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(k(),C(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[d(A,{"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:i,onCreate:f},null,8,["loading","table"])]),_:1}))}});export{ie as default};
//# sourceMappingURL=Organizations.fdfb56b8.js.map
