import{_ as A}from"./nuxt-link.CpFeHJNO.js";import{f as D,D as P,q as x,C as E,E as T,F as g,S as k,M as R,j as S,s as N,P as p,_ as B,l as n,o as I,m as q,w as l,b as a,a as V}from"./entry.2l8qV6vk.js";import{i as $}from"./utils.RlM3h-HS.js";const v=D({components:{ATitle:P,APagination:x,ASearch:E,BTable:T,AEntityDelete:g,APermissions:k,VCTimeago:R},emits:["deleted"],setup(s,{emit:u}){const _=o=>{u("deleted",o)},i=S(),{realm:b,realmManagementId:f}=N(i),r={filters:{realm_id:[f.value,null]}},m=o=>$(b.value,o.realm_id),c=i.has(p.PERMISSION_EDIT),d=i.has(p.PERMISSION_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}}},"$ODlEjoelBE"),M=V("i",{class:"fa-solid fa-bars"},null,-1);function O(s,u,_,i,b,f){const r=n("ATitle"),m=n("ASearch"),c=n("APagination"),d=n("VCTimeago"),y=A,o=n("AEntityDelete"),h=n("BTable"),C=n("APermissions");return I(),q(C,{query:s.query,onDeleted:s.handleDeleted},{header:l(e=>[a(r),a(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:l(e=>[a(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:l(e=>[a(h,{items:e.data,fields:s.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":l(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":l(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":l(t=>[a(y,{to:"/admin/permissions/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!s.hasEditPermission||!s.isResourceWritable(t.item)},{default:l(()=>[M]),_:2},1032,["to","disabled"]),a(o,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"permission","with-text":!1,disabled:t.item.built_in||!s.hasDropPermission||!s.isResourceWritable(t.item),onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const F=B(v,[["render",O]]);export{F as default};
