1import{j as m}from"./jsx-runtime-u17CrQMm.js";import{u as g}from"./QueryClientProvider-CC4TKqza.js";import{a as e}from"./chunk-EPOLDU6W-Cy0pbNoL.js";import{g as d}from"./sbs-login-instance-QtxHg8-X.js";const a=e.createContext(void 0);function x({children:s}){const[o,r]=e.useState({id:void 0,name:void 0,loggedIn:!1,emailHash:void 0}),n=g();e.useEffect(()=>{d().isLoggedIn().then(t=>{r(i=>({...i,loggedIn:t}))})},[]),e.useEffect(()=>{o.loggedIn||n.invalidateQueries()},[o.loggedIn,n]),e.useEffect(()=>{o.loggedIn&&d().getUserData().then(t=>{r(i=>({...i,id:t.id??void 0,name:t.name??void 0,emailHash:t.emailHash??void 0}))})},[o.loggedIn]);const u=e.useMemo(()=>({user:o,setUser:r}),[o,r]);return m.jsx(a.Provider,{value:u,children:s})}const U=()=>{const s=e.useContext(a);if(!s)throw new Error("useUser must be used within a UserProvider");return s};export{x as U,U as u};
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.