import{_ as D}from"./nuxt-link.7a09a473.js";import{f as k,D as g,L as R,B as T,W as P,E,X as B,T as M,y as N,z as $,P as h,_ as v,r as n,o as p,g as A,w as l,b as s,c as w,Y as I,a as y,Z as S}from"./entry.78b0ee06.js";import{i as V}from"./utils.88c67cf5.js";const W=k({components:{ListTitle:g,ListPagination:R,ListSearch:T,BTable:P,EntityDelete:E,RealmList:B,Timeago:M},emits:["deleted"],setup(a,{emit:_}){const o=N(),{realm:u,realmManagementId:b}=$(o),f=i=>{_("deleted",i)},d=i=>V(u.value,i.id),m=o.has(h.REALM_EDIT),c=o.has(h.REALM_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"updated_at",label:"Updated At",thClass:"text-center",tdClass:"text-center"},{key:"created_at",label:"Created At",thClass:"text-center",tdClass:"text-center"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:d,hasEditPermission:m,hasDropPermission:c,handleDeleted:f,realmManagementId:b,setRealmManagement:o.setRealmManagement}}},"$5Pfr7dJVmY"),Y=["onClick"],z=y("i",{class:"fa-solid fa-check"},null,-1),J=[z],O=y("i",{class:"fa-solid fa-bars"},null,-1);function U(a,_,o,u,b,f){const d=n("ListTitle"),m=n("ListSearch"),c=n("ListPagination"),r=n("Timeago"),i=D,C=n("EntityDelete"),L=n("BTable"),x=n("RealmList");return p(),A(x,{onDeleted:a.handleDeleted},{header:l(e=>[s(d),s(m,{load:e.load,busy:e.busy},null,8,["load","busy"])]),footer:l(e=>[s(c,{busy:e.busy,meta:e.meta,load:e.load},null,8,["busy","meta","load"])]),body:l(e=>[s(L,{items:e.data,fields:a.fields,busy:e.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":l(t=>[s(r,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(updated_at)":l(t=>[s(r,{datetime:t.item.created_at},null,8,["datetime"])]),"cell(options)":l(t=>[a.realmManagementId!==t.item.id?(p(),w("button",{key:0,class:"btn btn-xs btn-primary me-1",onClick:S(X=>a.setRealmManagement(t.item),["prevent"])},J,8,Y)):I("",!0),s(i,{to:"/admin/realms/"+t.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!a.hasEditPermission},{default:l(()=>[O]),_:2},1032,["to","disabled"]),s(C,{class:"btn btn-xs btn-outline-danger","entity-id":t.item.id,"entity-type":"realm","with-text":!1,disabled:!t.item.built_in||!a.hasDropPermission,onDeleted:e.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["onDeleted"])}const F=v(W,[["render",U]]);export{F as default};
