import{d as z,ex as _,H as O,b as w,c as k,w as c,f as m,u as h}from"./registerWidgets.5ceb46ef.js";import{e as x,b as C}from"./icons.b59fe784.js";import{a as I}from"./asyncComputed.fd157db2.js";import"./gateway.fadd845e.js";import{O as l}from"./organization.9116c226.js";import"./index.e1d2843e.js";import{_ as v}from"./Navbar.vue_vue_type_script_setup_true_lang.5cf2e83f.js";import{_ as D}from"./CrudView.vue_vue_type_script_setup_true_lang.af549d55.js";import{B as M}from"./BaseLayout.4bdff06f.js";import{M as A}from"./index.4c782ec6.js";import"./passwordlessManager.db35a950.js";import"./pubsub.451b7de0.js";import"./storage.4e9cf889.js";import"./activeRecord.693e9703.js";import"./logo.084e5d7c.js";import"./index.1a41b32a.js";import"./Title.d4cb8bc4.js";import"./index.4fdcdf65.js";import"./index.577eba83.js";import"./Modal.4e47c5c5.js";import"./index.f7704414.js";import"./Form.9c114a17.js";import"./FormItem.0abaafb1.js";import"./index.5183e138.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]="41bbc7d4-fe05-4930-9c9c-ef59597d21ff",a._sentryDebugIdIdentifier="sentry-dbid-41bbc7d4-fe05-4930-9c9c-ef59597d21ff")}catch{}})();const et=z({__name:"Organizations",setup(a){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}})},f=async t=>{const e=await l.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,o;await((o=(e=r.value)==null?void 0:e.find(b=>b.id===t))==null?void 0:o.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(o=>({key:o.id,cells:[{text:o.name,link:`/organizations/${encodeURIComponent(o.id)}`},{text:o.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:c(()=>[m(v,{breadcrumb:n})]),content:c(()=>[m(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.c42f673c.js.map
