import{u as m}from"./sidebar.vue_vue_type_script_lang.a371e2e8.js";import{m as d,k as c,b as f,p,h as e,N as v}from"./entry.731fa101.js";import{d as b}from"./component.6c997487.js";import"./components.client.e8e3e180.js";import{b as h}from"./enity-nav.3debeb1d.js";import"./composables.3f41d4a8.js";import"./LoginSVG.150727e9.js";const S=b({async setup(){const o=[{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"}],n=d(),r=c(),s=f(null);try{s.value=await m().user.getOne(r.params.id,{fields:["+email"]})}catch{return p({path:"/admin/roles"})}const u=a=>{n.success("The user was successfully updated.");const i=Object.keys(a);for(let t=0;t<i.length;t++)s.value[i[t]]=a[i[t]]},l=a=>{n.warning(a.message)};return()=>e("div",[e("h1",{class:"title no-border mb-3"},[e("i",{class:"fa fa-user me-1"}),s.value.name,e("span",{class:"sub-title ms-1"},["Details"])]),e("div",{class:"mb-2"},[h(`/admin/users/${s.value.id}`,o,{prevLink:!0})]),e("div",[e(v,{onUpdated:u,onFailed:l,entity:s.value})])])}});export{S as default};
