import{_ as f}from"./DomainEntityNav.WTBtLm35.js";import{f as _,q as h,l as y,s as l,v as m,x as u,y as v,z as b,_ as w,o as g,c as x,a as o,d as U,t as N,b as p,B as $}from"./entry.eQZ3auYG.js";import{u as F}from"./api.2o71dS_j.js";import{u as S}from"./toast.xQvLCn8q.js";import{i as T}from"./utils.kGqDb192.js";import"./index.w-DIluOk.js";import{u as k}from"./object.9wxptNlh.js";import"./nuxt-link.f01z1rl7.js";const B=_({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=S(),c=h(),a=y(null);try{a.value=([e,s]=l(()=>F().role.getOne(c.params.id)),e=await e,s(),e)}catch{throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({})}const r=v(),{realmManagement:i}=b(r);if(!T(i.value,a.value.realm_id))throw[e,s]=l(()=>m({path:"/admin/roles"})),await e,s(),u({});return{entity:a,items:d,handleUpdated:n=>{t&&t.show({variant:"success",body:"The role was successfully updated."}),k(a,n)},handleFailed:n=>{t&&t.show({variant:"warning",body:n.message})}}}},"$661tUZZfJV"),P={class:"title no-border mb-3"},R=o("i",{class:"fa-solid fa-theater-masks me-1"},null,-1),V=o("span",{class:"sub-title ms-1"},"Details",-1),A={class:"mb-2"};function D(e,s,d,t,c,a){const r=f,i=$;return g(),x("div",null,[o("h1",P,[R,U(" "+N(e.entity.name)+" ",1),V]),o("div",A,[p(r,{path:"/admin/roles/"+e.entity.id,items:e.items,"prev-link":!0},null,8,["path","items"])]),o("div",null,[p(i,{entity:e.entity,onUpdated:e.handleUpdated,onFailed:e.handleFailed},null,8,["entity","onUpdated","onFailed"])])])}const M=w(B,[["render",D]]);export{M as default};
