import{d as z,ex as _,H as O,b as w,c as k,w as m,f as c,u as h}from"./registerWidgets.faec4901.js";import{e as x,b as C}from"./icons.4b27c20b.js";import{a as I}from"./asyncComputed.04758d6d.js";import"./gateway.241cb512.js";import{O as l}from"./organization.c8963177.js";import"./index.a999bbce.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.8aef6ab1.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.3dfdcdc3.js";import{B as M}from"./BaseLayout.1ce77a8d.js";import{M as A}from"./index.404475cb.js";import"./passwordlessManager.90d3a316.js";import"./pubsub.c32c984e.js";import"./storage.02df2e1a.js";import"./activeRecord.64153c3d.js";import"./logo.084e5d7c.js";import"./Text.8913855c.js";import"./Title.38629c7e.js";import"./transButton.389d0ba4.js";import"./index.da74220a.js";import"./index.44ac919e.js";import"./Modal.c4a3eb37.js";import"./index.bd454869.js";import"./index.353431e1.js";import"./index.cf7f7ae3.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]="1191e35c-8b67-46e1-a411-a4253a62b580",o._sentryDebugIdIdentifier="sentry-dbid-1191e35c-8b67-46e1-a411-a4253a62b580")}catch{}})();const et=z({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],d=_(),{loading:p,result:r,refetch:u}=I(()=>l.list()),s=({key:t})=>{d.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await l.create(t.name);s({key:e.id})},f=async({key:t})=>{A.confirm({title:"Are you sure you want to delete this organization?",onOk:async()=>{var e,a;await((a=(e=r.value)==null?void 0:e.find(b=>b.id===t))==null?void 0:a.delete()),u()}})},y=O(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Organization Actions"}],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:C,label:"Delete",onClick:f,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(w(),k(M,null,{navbar:m(()=>[c(v,{breadcrumb:n})]),content:m(()=>[c(D,{"entity-name":"organization",loading:h(p),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{et as default};
//# sourceMappingURL=Organizations.250d146f.js.map
