import{_ as f}from"./DomainEntityNav.05a2f50d.js";import{f as _,n as h,q as y,k as b,s as l,v as u,x as m,y as v,z as g,_ as w,o as x,c as N,a as n,d as S,t as U,b as p,A as $}from"./entry.c7cd0af6.js";import{u as k}from"./api.45358b0b.js";import{i as F}from"./utils.1db1ba01.js";import"./index.20c05cdd.js";import{u as R}from"./object.62d64729.js";import"./nuxt-link.40687dc5.js";const A=_({async setup(){let e,t;const c=[{name:"General",icon:"fas fa-bars",urlSuffix:""},{name:"Scopes",icon:"fa-solid fa-meteor",urlSuffix:"/scopes"},{name:"URL",icon:"fa-solid fa-link",urlSuffix:"/url"}],a=h(),d=y(),s=b(null);try{s.value=([e,t]=l(()=>k().client.getOne(d.params.id,{fields:["+secret"]})),e=await e,t(),e)}catch{throw[e,t]=l(()=>u({path:"/admin/clients"})),await e,t(),m({})}const i=v(),{realmManagement:r}=g(i);if(!F(r.value,s.value.realm_id))throw[e,t]=l(()=>u({path:"/admin/clients"})),await e,t(),m({});return{entity:s,items:c,handleUpdated:o=>{a&&a.success({body:"The client was successfully updated."}),R(s,o)},handleFailed:o=>{a&&a.warning({body:o.message})}}}},"$ufKM444D2Q"),D={class:"title no-border mb-3"},T=n("i",{class:"fa-solid fa-ghost me-1"},null,-1),B=n("span",{class:"sub-title ms-1"},"Details",-1),E={class:"mb-2"};function P(e,t,c,a,d,s){const i=f,r=$;return x(),N("div",null,[n("h1",D,[T,S(" "+U(e.entity.name)+" ",1),B]),n("div",E,[p(i,{path:"/admin/clients/"+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 K=w(A,[["render",P]]);export{K as default};
