import{u as c}from"./object.62d64729.js";import{u as d}from"./api.160776dd.js";import{a as f,j as p,k as b,b as v,l as o,m as h,s as g,h as e,N as x}from"./entry.e097670d.js";import{i as y}from"./utils.c307b373.js";/* empty css                    */import{b as R}from"./enity-nav.bde0d636.js";import"./nuxt-link.1a4e25e4.js";const k=f({async setup(){const r=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Permissions",icon:"fas fa-user-secret",urlSuffix:"permissions"},{name:"Roles",icon:"fa-solid fa-user-group",urlSuffix:"roles"}],t=p(),i=b(),s=v(null);try{s.value=await d().robot.getOne(i.params.id,{fields:["+secret"]})}catch{return o({path:"/admin/robots"})}const n=h(),{realmManagement:u}=g(n);if(!y(u.value,s.value.realm_id))return o({path:"/admin/robots"});const l=a=>{t.success("The robot was successfully updated."),c(s,a)},m=a=>{t.warning(a.message)};return()=>e("div",[e("h1",{class:"title no-border mb-3"},[e("i",{class:"fa fa-robot me-1"}),s.value.name,e("span",{class:"sub-title ms-1"},["Details"])]),e("div",{class:"mb-2"},[R(`/admin/robots/${s.value.id}`,r,{prevLink:!0})]),e("div",[e(x,{onUpdated:l,onFailed:m,entity:s.value})])])}});export{k as default};
