import{_ as C}from"./nuxt-link.40687dc5.js";import{f as x,P as D,E as k,S as R,T as g,y as E,z as P,D as p,_ as T,r as i,o as h,g as M,w as n,b as l,c as v,V as B,a as y,W as N}from"./entry.c7cd0af6.js";import{i as L}from"./utils.1db1ba01.js";const $=x({components:{BTable:D,EntityDelete:k,RealmList:R,Timeago:g},emits:["deleted"],setup(t,{emit:c}){const s=E(),{realm:_,realmManagementId:b}=P(s),f=a=>{c("deleted",a)},o=a=>L(_.value,a.id),d=s.has(p.REALM_EDIT),m=s.has(p.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:o,hasEditPermission:d,hasDropPermission:m,handleDeleted:f,realmManagementId:b,setRealmManagement:s.setRealmManagement}}},"$5Pfr7dJVmY"),w=["onClick"],A=y("i",{class:"fa-solid fa-check"},null,-1),V=[A],I=y("i",{class:"fa-solid fa-bars"},null,-1);function W(t,c,s,_,b,f){const o=i("Timeago"),d=C,m=i("EntityDelete"),u=i("BTable"),a=i("RealmList");return h(),M(a,{"header-title":{icon:"fa-solid fa-list pe-1",content:"Overview"},onDeleted:t.handleDeleted},{body:n(r=>[l(u,{items:r.data,fields:t.fields,busy:r.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":n(e=>[l(o,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(updated_at)":n(e=>[l(o,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(options)":n(e=>[t.realmManagementId!==e.item.id?(h(),v("button",{key:0,class:"btn btn-xs btn-primary me-1",onClick:N(O=>t.setRealmManagement(e.item),["prevent"])},V,8,w)):B("",!0),l(d,{to:"/admin/realms/"+e.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!t.hasEditPermission},{default:n(()=>[I]),_:2},1032,["to","disabled"]),l(m,{class:"btn btn-xs btn-outline-danger","entity-id":e.item.id,"entity-type":"realm","with-text":!1,disabled:!e.item.built_in||!t.hasDropPermission,onDeleted:r.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["onDeleted"])}const U=T($,[["render",W]]);export{U as default};
