import{d as _,ez as w,J as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.df0b7764.js";import{e as x,b as I}from"./icons.649962e7.js";import{a as v}from"./asyncComputed.46396f29.js";import"./router.7d542f8a.js";import{O as l}from"./organization.f7e77816.js";import"./index.be0d60a2.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.5d2a3613.js";import{C as A}from"./CrudView.c17fe492.js";import{B}from"./BaseLayout.2f5857c5.js";import{a as N}from"./ant-design.3dd40e2b.js";import"./Title.d627f1f5.js";import"./index.8131d28d.js";import"./gateway.315bccd7.js";import"./activeRecord.af31c98a.js";import"./pubsub.82647744.js";import"./logo.084e5d7c.js";import"./index.0830e379.js";import"./index.317ac553.js";import"./index.ff998eb1.js";import"./Form.29bcac3f.js";import"./url.b34e96a5.js";import"./index.eb14364d.js";import"./index.b2e095c7.js";import"./index.5c49f4fd.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]="5f6015bf-75ee-4324-8650-57ade41da174",o._sentryDebugIdIdentifier="sentry-dbid-5f6015bf-75ee-4324-8650-57ade41da174")}catch{}})();const at=_({__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 a=await l.create(t.name);s({key:a.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()),f())},b=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(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?a:[]}});return(t,a)=>(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:g},null,8,["loading","table"])]),_:1}))}});export{at as default};
//# sourceMappingURL=Organizations.83188686.js.map
