1import{r as e}from"./vendor-react-aMKJrssV.js";import{b as m,s as d,u as a}from"./index-CgmaCIwJ.js";import"./vendor-ui-x7D0iLe8.js";import"./vendor-data-LOeL2b27.js";const l=30*60*1e3,T=5*60*1e3,f=["mousedown","keydown","scroll","touchstart"],v=()=>{const{user:n}=m(),t=e.useRef(null),r=e.useRef(null),s=e.useRef(!1),i=e.useCallback(async()=>{await d.auth.signOut(),a.info("You've been signed out due to inactivity.",{duration:6e3}),window.location.href="/login"},[]),o=e.useCallback(()=>{n&&(t.current&&clearTimeout(t.current),r.current&&clearTimeout(r.current),s.current=!1,r.current=setTimeout(()=>{s.current=!0,a.warning("Your session will expire in 5 minutes due to inactivity.",{duration:1e4,action:{label:"Stay Signed In",onClick:()=>o()}})},l-T),t.current=setTimeout(i,l))},[n,i]);return e.useEffect(()=>{if(!n)return;o();const c=()=>o();for(const u of f)document.addEventListener(u,c,{passive:!0});return()=>{for(const u of f)document.removeEventListener(u,c);t.current&&clearTimeout(t.current),r.current&&clearTimeout(r.current)}},[n,o]),null};export{v as default};
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.