import{_ as L}from"./nuxt-link.3625b369.js";import{f as x,D as C,L as T,B as g,W as P,aw as k,E,T as R,y as B,z as v,P as p,_ as N,r as l,o as S,g as U,w as o,b as a,a as W}from"./entry.27446522.js";import{i as q}from"./utils.23d0a223.js";const $=x({components:{ListTitle:C,ListPagination:T,ListSearch:g,BTable:P,UserList:k,EntityDelete:E,Timeago:R},emits:["deleted"],setup(t,{emit:u}){const _=n=>{u("deleted",n)},i=B(),{realm:b,realmManagementId:f}=v(i),r={filter:{realm_id:[f.value,null]}},m=n=>q(b.value,n.realm_id),c=i.has(p.USER_EDIT),d=i.has(p.USER_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"created_at",label:"Created At",thClass:"text-center",tdClass:"text-center"},{key:"updated_at",label:"Updated At",thClass:"text-left",tdClass:"text-left"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:m,hasEditPermission:c,hasDropPermission:d,handleDeleted:_,query:r}}},"$VqpaJbAmv2"),w=W("i",{class:"fa-solid fa-bars"},null,-1);function A(t,u,_,i,b,f){const r=l("ListTitle"),m=l("ListSearch"),c=l("ListPagination"),d=l("Timeago"),y=L,n=l("EntityDelete"),h=l("BTable"),D=l("UserList");return S(),U(D,{query:t.query,body:{tag:"div"},footer:!0,onDeleted:t.handleDeleted},{header:o(e=>[a(r),a(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:o(e=>[a(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:o(e=>[a(h,{items:e.data,fields:t.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":o(s=>[a(d,{datetime:s.item.created_at},null,8,["datetime"])]),"cell(updated_at)":o(s=>[a(d,{datetime:s.item.created_at},null,8,["datetime"])]),"cell(options)":o(s=>[a(y,{to:"/admin/users/"+s.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!t.hasEditPermission||!t.isResourceWritable(s.item)},{default:o(()=>[w]),_:2},1032,["to","disabled"]),a(n,{class:"btn btn-xs btn-outline-danger","entity-id":s.item.id,"entity-type":"user","with-text":!1,disabled:!t.hasDropPermission||!t.isResourceWritable(s.item),onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const J=N($,[["render",A]]);export{J as default};
