import{C as g}from"./CrudView.6dee12dd.js";import{a as m}from"./ant-design.ab86670b.js";import{a as b}from"./asyncComputed.e840076d.js";import{d as w,ea as _,eo as h,f as I,o as k,c as v,u as x,ep as z}from"./vue-router.e3ef87f0.js";import{a as C}from"./gateway.e3730daa.js";import{M as n}from"./member.d7c647e6.js";import"./tables.8b5b16f2.js";import"./router.7553e78c.js";import"./DocsButton.vue_vue_type_script_setup_true_lang.7e26700d.js";import"./BookOutlined.2206ef88.js";import"./url.d7fc9f74.js";import"./PhDotsThreeVertical.vue.4a059a70.js";import"./Badge.e09547ac.js";import"./index.45410f8d.js";import"./popupNotifcation.bf248d47.js";import"./record.9f354c97.js";import"./string.5524ff61.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="2939dcb0-1a9d-4843-946c-7c7be5ec9139",o._sentryDebugIdIdentifier="sentry-dbid-2939dcb0-1a9d-4843-946c-7c7be5ec9139")}catch{}})();const P=w({__name:"Editors",setup(o){const a=_(),s=h(),r=a.params.organizationId,d=[{key:"email",label:"Email"}],l=async e=>{await n.create(r,e.email),c()};async function u(e){var t;if(((t=C.getAuthor())==null?void 0:t.claims.email)===e.email&&await m("You are about to remove your own access. You won't be able to access this organization anymore. Are you sure?")){await n.delete(r,e.authorId),await s.push({name:"organizations"});return}await m("Are you sure you want to remove this member's access?")&&(await n.delete(r,e.authorId),c())}const{loading:p,result:f,refetch:c}=b(()=>n.list(r)),y=I(()=>{var e,i;return{columns:[{name:"Email",align:"left"},{name:"Role"},{name:"",align:"right"}],rows:(i=(e=f.value)==null?void 0:e.map(t=>({key:t.email,cells:[{type:"text",text:t.email},{type:"text",text:t.role},{type:"actions",actions:[{icon:z,label:"Remove access",onClick:()=>u(t),dangerous:!0}]}]})))!=null?i:[]}});return(e,i)=>(k(),v(g,{"entity-name":"editors",loading:x(p),title:"Organization editors",description:"List all organization editors.","empty-title":"No editors yet",table:y.value,"create-button-text":"Add editors",fields:d,create:l},null,8,["loading","table"]))}});export{P as default};
//# sourceMappingURL=Editors.bd0869fb.js.map
