import{u as g,j as s,P as i,M as n,O as S,c as f,au as h,av as p,m as j,r as E,aw as N,ax as w,ay as v,s as u,az as I,o as y,Q as L}from"./index-e867d936.js";import{aA as C,aB as R}from"./index-e867d936.js";const b=()=>{let l=f();const e=h(),{pathname:o}=p(),{t:x}=g(),t=j(),r=E.useMemo(()=>!e||!t?[]:[{title:"Profile",url:"/settings/profile",Icon:N},{title:n.USER_ROLES,url:"/settings/roles",Icon:w,canBeShown:(t==null?void 0:t.role.id)===0},{title:n.SYSTEM_SETTINGS,url:"/settings/system",Icon:v,canBeShown:!!(t!=null&&t.can({action:"read",targetModel:"settings"}))},{title:n.GENERAL_TRANSLATIONS,url:u.settings.translations(e==null?void 0:e.i18n.languages[1]).list,isInUrl(a){return a.startsWith(u.settings.translations(e==null?void 0:e.i18n.languages[1]).list.replace(e==null?void 0:e.i18n.languages[1],""))},Icon:I,canBeShown:e&&e.i18n.languages.length>=2}].filter(a=>a.canBeShown||a.canBeShown===void 0),[e,t]);return s.jsx("div",{className:"h-full px-5 pt-6",children:s.jsx("nav",{className:"mt-24 flex flex-none gap-3 lg:flex-col",children:r&&r.map(({url:a,title:d,Icon:m,isInUrl:c})=>s.jsx(y,{component:"a",size:"lg",variant:"subtle",color:o===a?"green":"blue",className:L((c===void 0?o===a:c(o))?"border-green-300 underline":"border-blue-200","border-2 bg-white"),styles:()=>({inner:{justifyContent:"space-between"}}),leftIcon:s.jsx(m,{className:"mr-auto aspect-square w-6"}),onClick:()=>l(a,{replace:!0}),children:x(d)},a))})})},T=()=>{const{t:l}=g();return s.jsxs(i,{withAside:!0,leftAside:s.jsx(b,{}),children:[s.jsx(i.Header,{title:l(n.SETTINGS)}),s.jsx(i.Section,{className:"mt-5 min-h-[500px] justify-evenly lg:flex",children:s.jsx("div",{className:"w-full",children:s.jsx(S,{})})})]})};export{i as PageLayout,T as ProfileLayout,C as SiteLayout,R as useConstructedMenuItems};
