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.ca57da3e.js";import{e as x,b as C}from"./icons.1efe7950.js";import{a as I}from"./asyncComputed.ae0b6a3c.js";import"./gateway.b88d532a.js";import{O as d}from"./organization.ac190c20.js";import"./index.27945116.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.0bbf63d7.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.7b5510ae.js";import{B as M}from"./BaseLayout.6a4d2025.js";import{M as A}from"./index.4a64f329.js";import"./passwordlessManager.8d47b009.js";import"./pubsub.277d05a3.js";import"./storage.2a7aac1e.js";import"./activeRecord.f8743cd4.js";import"./logo.084e5d7c.js";import"./Text.1f2709b6.js";import"./Title.e5d7f1b0.js";import"./transButton.a2961478.js";import"./index.9943ced7.js";import"./index.3efb162e.js";import"./Modal.db45c3f3.js";import"./index.b0c465bd.js";import"./index.e15362b2.js";import"./index.64def94a.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]="f6e1080d-4a19-4f05-891e-cfd921e86d28",o._sentryDebugIdIdentifier="sentry-dbid-f6e1080d-4a19-4f05-891e-cfd921e86d28")}catch{}})();const et=z({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],l=_(),{loading:p,result:r,refetch:u}=I(()=>d.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},f=async t=>{const e=await d.create(t.name);s({key:e.id})},g=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:g,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:f},null,8,["loading","table"])]),_:1}))}});export{et as default};
//# sourceMappingURL=Organizations.c134e87b.js.map
