import{_ as T}from"./nuxt-link.7a09a473.js";import{f as E,L as g,B as k,D as P,W as N,E as B,G as R,U as S,T as U,y as W,z as I,P as p,_ as $,r as i,o as q,g as v,w as s,b as a,d as h,t as w,a as V}from"./entry.78b0ee06.js";import{i as z}from"./utils.88c67cf5.js";const A=E({components:{ListPagination:g,ListSearch:k,ListTitle:P,BTable:N,EntityDelete:B,ClientList:R,UserEntity:S,Timeago:U},emits:["deleted"],setup(n,{emit:u}){const _=l=>{u("deleted",l)},o=W(),{realm:b,realmManagementId:y}=I(o),r={filter:{realm_id:[y.value,null]}},c=l=>z(b.value,l.realm_id),m=o.has(p.CLIENT_EDIT),d=o.has(p.CLIENT_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"user_id",label:"User",thClass:"text-center",tdClass:"text-center"},{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:c,hasEditPermission:m,hasDropPermission:d,handleDeleted:_,query:r}}},"$7HJniSYcgC"),G=V("i",{class:"fa-solid fa-bars"},null,-1);function H(n,u,_,o,b,y){const r=i("ListTitle"),c=i("ListSearch"),m=i("ListPagination"),d=i("Timeago"),f=i("UserEntity"),l=T,C=i("EntityDelete"),x=i("BTable"),D=i("ClientList");return q(),v(D,{query:n.query,onDeleted:n.handleDeleted},{header:s(e=>[a(r),a(c,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:s(e=>[a(m,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:s(e=>[a(x,{items:e.data,fields:n.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":s(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":s(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(user_id)":s(t=>[a(f,{"entity-id":t.item.user_id},{default:s(L=>[h(w(L.data.name),1)]),error:s(()=>[h(" - ")]),_:2},1032,["entity-id"])]),"cell(options)":s(t=>[a(l,{to:"/admin/clients/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!n.hasEditPermission||!n.isResourceWritable(t.item)},{default:s(()=>[G]),_:2},1032,["to","disabled"]),a(C,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"client","with-text":!1,disabled:!n.hasDropPermission||!n.isResourceWritable(t.item),onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const Y=$(A,[["render",H]]);export{Y as default};
