import{_ as C}from"./nuxt-link.3625b369.js";import{f as L,D as x,L as P,B as S,W as T,ar as g,E as k,T as E,r as o,y as B,z as R,P as y,_ as N,o as W,g as q,w as i,b as a,a as $}from"./entry.27446522.js";import{i as v}from"./utils.23d0a223.js";const w=L({components:{ListTitle:x,ListPagination:P,ListSearch:S,BTable:T,ScopeList:g,EntityDelete:k,Timeago:E},emits:["deleted"],setup(s,{emit:u}){o("ScopeList");const _=l=>{u("deleted",l)},n=B(),{realm:b,realmManagementId:f}=R(n),r={filter:{realm_id:[f.value,null]}},c=l=>v(b.value,l.realm_id),m=n.has(y.SCOPE_EDIT),d=n.has(y.SCOPE_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:c,hasEditPermission:m,hasDropPermission:d,handleDeleted:_,query:r}}},"$D8SzSqXfX6"),I=$("i",{class:"fa-solid fa-bars"},null,-1);function O(s,u,_,n,b,f){const r=o("ListTitle"),c=o("ListSearch"),m=o("ListPagination"),d=o("Timeago"),p=C,l=o("EntityDelete"),h=o("BTable"),D=o("ScopeList");return W(),q(D,{query:s.query,onDeleted:s.handleDeleted},{header:i(e=>[a(r),a(c,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:i(e=>[a(m,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:i(e=>[a(h,{items:e.data,fields:s.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":i(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":i(t=>[a(d,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":i(t=>[a(p,{to:"/admin/scopes/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!s.hasEditPermission||!s.isResourceWritable(t.item)},{default:i(()=>[I]),_:2},1032,["to","disabled"]),a(l,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"scope","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 A=N(w,[["render",O]]);export{A as default};
