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.397b3720.js";import{e as x,b as I}from"./icons.5e65f599.js";import{a as v}from"./asyncComputed.28fc9d36.js";import"./router.3bc1b205.js";import{O as l}from"./organization.28915124.js";import"./columns.37df3c3d.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.8eb1ce41.js";import{C as A}from"./CrudView.77c1d16d.js";import{B}from"./BaseLayout.a83edf4c.js";import{a as N}from"./ant-design.29edbf4a.js";import"./Title.382247fb.js";import"./index.06276212.js";import"./gateway.b868389d.js";import"./activeRecord.6bb6b853.js";import"./pubsub.fe0f0397.js";import"./index.f4ac7424.js";import"./logo.084e5d7c.js";import"./index.19008df2.js";import"./index.e12747aa.js";import"./index.65a47e55.js";import"./Form.5ce50c8f.js";import"./url.53bc193a.js";import"./index.4acaedbb.js";import"./index.c9ea7155.js";import"./index.40ca2e79.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]="c70bdb5b-4db9-4818-a740-1ebfbda05781",o._sentryDebugIdIdentifier="sentry-dbid-c70bdb5b-4db9-4818-a740-1ebfbda05781")}catch{}})();const ot=_({__name:"Organizations",setup(o){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}})},b=async t=>{const a=await l.create(t.name);s({key:a.id})},f=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())},y=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:f,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:y.value,fields:i,onCreate:b},null,8,["loading","table"])]),_:1}))}});export{ot as default};
//# sourceMappingURL=Organizations.488a359d.js.map
