1import{Q as e,Z as t,i as n,t as r,wt as i}from"./tCqEpUva.js";function a(){let a=e(),s=r(`auth-user`,()=>null),c=i(()=>s.value!==null);async function l(){let e=n();try{s.value=await e(`/api/auth/me`)}catch{s.value=null}return s.value}function u(e=`/`){let t=new URLSearchParams({return_to:e});window.location.href=`/api/auth/login?${t}`}async function d(e){s.value=null;let n=e??window.location.href;try{let{$csrfFetch:e}=t();await e(`/api/auth/logout`,{method:`DELETE`})}catch{}window.location.href=o(a.public.backofficeUrl,n)}return{user:s,isLoggedIn:c,login:u,logout:d,fetchMe:l}}function o(e,t){let n=String(e??``).trim().replace(/\/$/,``);if(!n)return t||`/`;let r=new URL(`${n}/admin/logout`);return r.searchParams.set(`redirect`,t),r.toString()}var s=[`ejecutivo`,`ejecutivo_admin`,`admin`],c=`customer`,l=[`colaborador`,`colaborador_supervisor`],u=`developer`;function d(){let{user:e}=a(),t=t=>i(()=>!!e.value?.roles?.some(e=>t.includes(e)));return{isEjecutivo:t(s),isCustomer:t([c]),isCollaborator:t(l),isDeveloper:t([u])}}var f=`/api/auth/login?target=portal`,p=[`es`];function m(){let t=e(),{isEjecutivo:n,isCustomer:r,isCollaborator:a,isDeveloper:o}=d(),s=i(()=>n.value||a.value||o.value),c=String(t.public.backofficeUrl??``).replace(/\/$/,``),l=i(()=>c?s.value?`${c}/admin`:r.value?`${c}/admin/client`:null:null),u=i(()=>s.value?`lang.menu.backoffice`:`lang.menu.clientPortal`);function p(e=!1){return l.value?l.value:e&&c?`${c}/register`:f}return{url:l,label:u,entryUrl:p}}export{m as n,a as r,p as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.