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.8a1294ac.js";import{e as x,b as I}from"./icons.25b21aee.js";import{a as v}from"./asyncComputed.3699cd44.js";import"./router.e765b2a2.js";import{O as l}from"./organization.d966701f.js";import"./columns.a2ad5768.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.cdc58fae.js";import{C as A}from"./CrudView.707fb9d1.js";import{B}from"./BaseLayout.5edfc1d1.js";import{a as N}from"./ant-design.8f569ff8.js";import"./Title.c5e29cf7.js";import"./index.04ab96ef.js";import"./gateway.ec720fac.js";import"./activeRecord.4f50a80e.js";import"./pubsub.5ff7800d.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.21148e20.js";import"./index.0f4f2049.js";import"./index.d1c22e15.js";import"./Form.1860c0ed.js";import"./url.9a5c0e6d.js";import"./index.d5d7d1dc.js";import"./index.4fc6eb1b.js";import"./index.91683b65.js";import"./index.bf7f5369.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="8f2d733a-bffa-412a-aea8-775894be2d9b",o._sentryDebugIdIdentifier="sentry-dbid-8f2d733a-bffa-412a-aea8-775894be2d9b")}catch{}})();const nt=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:f}=v(()=>l.list()),s=({key:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await l.create(t.name);s({key:e.id})},b=async({key:t})=>{var a,m;await N("Are you sure you want to delete this organization?")&&(await((m=(a=r.value)==null?void 0:a.find(z=>z.id===t))==null?void 0:m.delete()),f())},y=h(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(a=>({key:a.id,cells:[{text:a.name,link:`/organizations/${encodeURIComponent(a.id)}`},{text:a.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(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:y.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.6c2f7d5c.js.map
