import{_ as C}from"./nuxt-link.f01z1rl7.js";import{f as D,D as x,h as g,C as P,E as T,ax as k,F as E,y as R,z as v,P as p,_ as B,r as l,o as N,g as S,w as n,b as a,a as U}from"./entry.eQZ3auYG.js";import{i as q}from"./utils.kGqDb192.js";const V=D({components:{ATitle:x,APagination:g,ASearch:P,BTable:T,AUsers:k,AEntityDelete:E},emits:["deleted"],setup(t,{emit:u}){const _=o=>{u("deleted",o)},i=R(),{realm:b,realmManagementId:f}=v(i),r={filter:{realm_id:[f.value,null]}},m=o=>q(b.value,o.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"),$=U("i",{class:"fa-solid fa-bars"},null,-1);function W(t,u,_,i,b,f){const r=l("ATitle"),m=l("ASearch"),c=l("APagination"),d=l("VCTimeago"),y=C,o=l("AEntityDelete"),h=l("BTable"),A=l("AUsers");return N(),S(A,{query:t.query,body:{tag:"div"},footer:!0,onDeleted:t.handleDeleted},{header:n(e=>[a(r),a(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:n(e=>[a(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:n(e=>[a(h,{items:e.data,fields:t.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":n(s=>[a(d,{datetime:s.item.created_at},null,8,["datetime"])]),"cell(updated_at)":n(s=>[a(d,{datetime:s.item.created_at},null,8,["datetime"])]),"cell(options)":n(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:n(()=>[$]),_:2},1032,["to","disabled"]),a(o,{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 F=B(V,[["render",W]]);export{F as default};
