import{d as _,ez as w,J as h,b as k,c as C,w as m,f as d,u as O}from"./outputWidgets.dcbaec6c.js";import{e as x,b as I}from"./icons.eaf14b7d.js";import{a as v}from"./asyncComputed.05eefdbd.js";import"./router.fe36cb8d.js";import{O as l}from"./organization.4e8f2f68.js";import"./index.2b422cbf.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.7fcc10cd.js";import{C as A}from"./CrudView.4ac6b440.js";import{B}from"./BaseLayout.7aa9f430.js";import{a as N}from"./ant-design.f602ec67.js";import"./Title.137468a8.js";import"./index.678801af.js";import"./gateway.f4357ae1.js";import"./activeRecord.d9292c93.js";import"./pubsub.999268d8.js";import"./logo.084e5d7c.js";import"./index.9fcba2ca.js";import"./index.a56c5205.js";import"./index.3c7c5d6b.js";import"./Form.94b2db91.js";import"./url.5c03711e.js";import"./index.69bd7c01.js";import"./index.12134aed.js";import"./index.87a757a5.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]="979b06c0-0170-4f73-959c-9dabce697166",a._sentryDebugIdIdentifier="sentry-dbid-979b06c0-0170-4f73-959c-9dabce697166")}catch{}})();const ot=_({__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:t})=>{p.push({name:"organization",params:{organizationId:t}})},f=async t=>{const o=await l.create(t.name);s({key:o.id})},b=async({key:t})=>{var e,c;await N("Are you sure you want to delete this organization?")&&(await((c=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:c.delete()),g())},y=h(()=>{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:b,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(k(),C(B,null,{navbar:m(()=>[d(D,{breadcrumb:n})]),content:m(()=>[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:f},null,8,["loading","table"])]),_:1}))}});export{ot as default};
//# sourceMappingURL=Organizations.073f533f.js.map
