import{r as e}from"./vendor-EnoIVk-c.js";import{u as m}from"./AuthContext-CYne_gJM.js";function r(){const{session:a,isLoading:n}=m();return e.useMemo(()=>{var o,l;const i=!!a,t=(a==null?void 0:a.user)??null;return{session:a,user:t,backendUser:t,token:(a==null?void 0:a.token)??null,isLoading:n,isAuthenticated:i,hasValidBackendToken:!!(a!=null&&a.token),isFullyAuthenticated:i,userDomain:(t==null?void 0:t.domain)||((o=t==null?void 0:t.email)==null?void 0:o.split("@")[1]),displayName:(t==null?void 0:t.name)??((l=t==null?void 0:t.email)==null?void 0:l.split("@")[0])??"User",avatarUrl:(t==null?void 0:t.image)??null,isAdmin:(t==null?void 0:t.isAdmin)??!1,isModerator:(t==null?void 0:t.isModerator)??!1}},[a,n])}export{r as u};
//# sourceMappingURL=useAuth-CqtZE9nt.js.map
