import{_ as f}from"./DomainEntityNav.b582554d.js";import{f as _,B as h,n as y,k as b,q as l,s as m,v as u,x as v,y as g,_ as w,o as x,c as U,a as n,d as N,t as $,b as p,z as k}from"./entry.cc52a3f2.js";import{u as B}from"./api.8d75df99.js";import{i as F}from"./utils.65cfe9e7.js";import"./index.20c05cdd.js";import{u as S}from"./object.62d64729.js";import"./nuxt-link.83112a4b.js";const P=_({async setup(){let e,s;const d=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Users",icon:"fas fa-users",urlSuffix:"users"}],t=h(),c=y(),a=b(null);try{a.value=([e,s]=l(()=>B().role.getOne(c.params.id)),e=await e,s(),e)}catch{throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({})}const i=v(),{realmManagement:r}=g(i);if(!F(r.value,a.value.realm_id))throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({});return{entity:a,items:d,handleUpdated:o=>{t&&t.success({body:"The role was successfully updated."}),S(a,o)},handleFailed:o=>{t&&t.warning({body:o.message})}}}},"$661tUZZfJV"),R={class:"title no-border mb-3"},T=n("i",{class:"fa-solid fa-theater-masks me-1"},null,-1),V=n("span",{class:"sub-title ms-1"},"Details",-1),A={class:"mb-2"};function D(e,s,d,t,c,a){const i=f,r=k;return x(),U("div",null,[n("h1",R,[T,N(" "+$(e.entity.name)+" ",1),V]),n("div",A,[p(i,{path:"/admin/roles/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),n("div",null,[p(r,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const J=w(P,[["render",D]]);export{J as default};
