UNPKG

@afex-dapps/idle-timer

Version:

Idle Timer library for detecting user inactivity and managing session timeouts

1 lines 47.6 kB
{"version":3,"sources":["/Users/ibnlanre/Desktop/workspace/afex-dapps/apps/idle-timer/dist/index.cjs","../src/hooks/use-idle-timeout.ts","../../../node_modules/.pnpm/react-idle-timer@5.7.2_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/react-idle-timer/dist/index.esm.js","../src/hooks/use-idle-timer-prompt.ts","../src/hooks/use-idle-timer-countdown.ts","../src/constants/index.ts","../src/hooks/use-idle-timer-debug.ts","../src/utils/milliseconds-to-seconds/index.ts","../src/utils/format-time/index.ts","../src/utils/seconds-to-milliseconds/index.ts"],"names":["idleTimer","remainingTime","useCallback"],"mappings":"AAAA,6EAAI,UAAU,EAAE,MAAM,CAAC,cAAc;AACrC,IAAI,oBAAoB,EAAE,MAAM,CAAC,qBAAqB;AACtD,IAAI,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc;AAClD,IAAI,aAAa,EAAE,MAAM,CAAC,SAAS,CAAC,oBAAoB;AACxD,IAAI,gBAAgB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK;AAC/J,IAAI,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG;AAChC,EAAE,IAAI,CAAC,IAAI,KAAK,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAClC,IAAI,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC;AACnC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAA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;AACT;AN0rBoC;AACA;AOvuBE;AACH,EAAA;AACnC;APyuBoC;AACA;AQzuBc;AAC1B,EAAA;AAEG,EAAA;AACG,EAAA;AACD,EAAA;AAEZ,EAAA;AACc,IAAA;AAG7B,EAAA;AAE6B,EAAA;AAG/B;ARouBoC;AACA;ASxvBE;AACnB,EAAA;AACnB;AT0vBoC;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/ibnlanre/Desktop/workspace/afex-dapps/apps/idle-timer/dist/index.cjs","sourcesContent":[null,"import type { IdleTimerHandler, UseIdleTimer } from \"@/types\";\nimport type { IIdleTimerProps } from \"react-idle-timer\";\n\nimport { useState, useCallback } from \"react\";\nimport { useIdleTimer } from \"react-idle-timer\";\n\nimport { useIdleTimerPrompt } from \"@/hooks/use-idle-timer-prompt\";\nimport { useIdleTimerCountdown } from \"@/hooks/use-idle-timer-countdown\";\nimport {\n DEFAULT_INACTIVITY_TIME,\n DEFAULT_PROMPT_TIME,\n DEFAULT_SYNC_TIMERS,\n} from \"@/constants\";\n\n/**\n * Custom hook to manage idle timeout functionality\n *\n * @param config Configuration object for idle timer\n * @returns Object containing remaining time, continueUserSession function, and idle timer instance\n */\nexport function useIdleTimeout(config: IIdleTimerProps = {}): UseIdleTimer {\n const {\n timeout = DEFAULT_INACTIVITY_TIME,\n promptBeforeIdle = DEFAULT_PROMPT_TIME,\n syncTimers = DEFAULT_SYNC_TIMERS,\n crossTab = true,\n leaderElection = true,\n disabled = false,\n ...idleTimeConfigurationHandlers\n } = config;\n\n const [remainingTime, setRemainingTime] = useState(promptBeforeIdle);\n\n const { onIdle, onPrompt, onAction, ...idleTimeConfiguration } =\n idleTimeConfigurationHandlers;\n\n const { showIdleTimerPrompt, openIdleTimerPrompt, closeIdleTimerPrompt } =\n useIdleTimerPrompt();\n\n const { startIdleTimerCountdown, stopIdleTimerCountdown } =\n useIdleTimerCountdown((idleTimer) => {\n if (!idleTimer || !idleTimer.isPrompted()) return;\n\n const remainingTime = idleTimer.getRemainingTime();\n setRemainingTime(Math.max(0, remainingTime));\n });\n\n const handleIdle: IdleTimerHandler = useCallback(\n (event, idleTimer) => {\n if (!idleTimer || !idleTimer.isPrompted()) return;\n\n closeIdleTimerPrompt();\n stopIdleTimerCountdown();\n onIdle?.(event, idleTimer);\n },\n [closeIdleTimerPrompt, stopIdleTimerCountdown, onIdle]\n );\n\n const handlePrompt: IdleTimerHandler = useCallback(\n (event, idleTimer) => {\n if (!idleTimer) return;\n\n const remainingTime = idleTimer.getRemainingTime();\n\n setRemainingTime(remainingTime);\n openIdleTimerPrompt();\n startIdleTimerCountdown(idleTimer);\n onPrompt?.(event, idleTimer);\n },\n [openIdleTimerPrompt, startIdleTimerCountdown, onPrompt]\n );\n\n const handleAction: IdleTimerHandler = useCallback(\n (event, idleTimer) => {\n if (!idleTimer || idleTimer.isPrompted()) return;\n\n idleTimer.reset();\n onAction?.(event, idleTimer);\n },\n [onAction]\n );\n\n const idleTimer = useIdleTimer({\n timeout,\n promptBeforeIdle,\n onPrompt: handlePrompt,\n onIdle: handleIdle,\n onAction: handleAction,\n crossTab,\n leaderElection,\n syncTimers,\n disabled,\n ...idleTimeConfiguration,\n });\n\n const continueUserSession = useCallback(() => {\n closeIdleTimerPrompt();\n stopIdleTimerCountdown();\n idleTimer.reset();\n }, [closeIdleTimerPrompt, stopIdleTimerCountdown, idleTimer]);\n\n return {\n remainingTime,\n continueUserSession,\n showIdleTimerPrompt,\n idleTimer,\n };\n}\n","var Et=Object.create;var Ye=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var yt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty;var Lt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Pt=(n,e,r,i)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let o of gt(e))!wt.call(n,o)&&o!==r&&Ye(n,o,{get:()=>e[o],enumerable:!(i=bt(e,o))||i.enumerable});return n};var St=(n,e,r)=>(r=n!=null?Et(yt(n)):{},Pt(e||!n||!n.__esModule?Ye(r,\"default\",{value:n,enumerable:!0}):r,n));var je=Lt((he,Je)=>{(function(n,e){typeof he==\"object\"&&typeof Je<\"u\"?e(he):typeof define==\"function\"&&define.amd?define([\"exports\"],e):(n=typeof globalThis<\"u\"?globalThis:n||self,e(n.fastUniqueNumbers={}))})(he,function(n){\"use strict\";var e=function(l){return function(p){var f=l(p);return p.add(f),f}},r=function(l){return function(p,f){return l.set(p,f),f}},i=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=o*2,g=function(l,p){return function(f){var B=p.get(f),y=B===void 0?f.size:B<u?B+1:0;if(!f.has(y))return l(f,y);if(f.size<o){for(;f.has(y);)y=Math.floor(Math.random()*u);return l(f,y)}if(f.size>i)throw new Error(\"Congratulations, you created a collection of unique numbers which uses all available integers!\");for(;f.has(y);)y=Math.floor(Math.random()*i);return l(f,y)}},O=new WeakMap,W=r(O),m=g(W,O),a=e(m);n.addUniqueNumber=a,n.generateUniqueNumber=m})});import{Component as Mt,forwardRef as Rt}from\"react\";import{jsx as At}from\"react/jsx-runtime\";function kt(n){return Rt(function(r,i){let o={...r},u=se(o);return typeof i==\"function\"?i(u):i&&(i.current=u),At(n,{...r,...u})})}var Re=class extends Mt{},ke=class extends Re{constructor(e){super(e),this.onPresenceChange&&e.setOnPresenceChange(this.onPresenceChange.bind(this)),this.onPrompt&&e.setOnPrompt(this.onPrompt.bind(this)),this.onIdle&&e.setOnIdle(this.onIdle.bind(this)),this.onActive&&e.setOnActive(this.onActive.bind(this)),this.onAction&&e.setOnAction(this.onAction.bind(this)),this.onMessage&&e.setOnMessage(this.onMessage.bind(this))}};import{useEffect as b,useRef as c,useCallback as T,useMemo as Dt}from\"react\";var oe=St(je());var Xe=n=>n.method!==void 0&&n.method===\"call\";var ze=n=>n.error===null&&typeof n.id==\"number\";var Ke=n=>{let e=new Map([[0,()=>{}]]),r=new Map([[0,()=>{}]]),i=new Map,o=new Worker(n);return o.addEventListener(\"message\",({data:m})=>{if(Xe(m)){let{params:{timerId:a,timerType:d}}=m;if(d===\"interval\"){let l=e.get(a);if(typeof l==\"number\"){let p=i.get(l);if(p===void 0||p.timerId!==a||p.timerType!==d)throw new Error(\"The timer is in an undefined state.\")}else if(typeof l<\"u\")l();else throw new Error(\"The timer is in an undefined state.\")}else if(d===\"timeout\"){let l=r.get(a);if(typeof l==\"number\"){let p=i.get(l);if(p===void 0||p.timerId!==a||p.timerType!==d)throw new Error(\"The timer is in an undefined state.\")}else if(typeof l<\"u\")l(),r.delete(a);else throw new Error(\"The timer is in an undefined state.\")}}else if(ze(m)){let{id:a}=m,d=i.get(a);if(d===void 0)throw new Error(\"The timer is in an undefined state.\");let{timerId:l,timerType:p}=d;i.delete(a),p===\"interval\"?e.delete(l):r.delete(l)}else{let{error:{message:a}}=m;throw new Error(a)}}),{clearInterval:m=>{let a=(0,oe.generateUniqueNumber)(i);i.set(a,{timerId:m,timerType:\"interval\"}),e.set(m,a),o.postMessage({id:a,method:\"clear\",params:{timerId:m,timerType:\"interval\"}})},clearTimeout:m=>{let a=(0,oe.generateUniqueNumber)(i);i.set(a,{timerId:m,timerType:\"timeout\"}),r.set(m,a),o.postMessage({id:a,method:\"clear\",params:{timerId:m,timerType:\"timeout\"}})},setInterval:(m,a)=>{let d=(0,oe.generateUniqueNumber)(e);return e.set(d,()=>{m(),typeof e.get(d)==\"function\"&&o.postMessage({id:null,method:\"set\",params:{delay:a,now:performance.now(),timerId:d,timerType:\"interval\"}})}),o.postMessage({id:null,method:\"set\",params:{delay:a,now:performance.now(),timerId:d,timerType:\"interval\"}}),d},setTimeout:(m,a)=>{let d=(0,oe.generateUniqueNumber)(r);return r.set(d,m),o.postMessage({id:null,method:\"set\",params:{delay:a,now:performance.now(),timerId:d,timerType:\"timeout\"}}),d}}};var Qe=(n,e)=>{let r=null;return()=>{if(r!==null)return r;let i=new Blob([e],{type:\"application/javascript; charset=utf-8\"}),o=URL.createObjectURL(i);return r=n(o),setTimeout(()=>URL.revokeObjectURL(o)),r}};var Ze=`(()=>{\"use strict\";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:\"call\",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener(\"message\",(i=>{let{data:s}=i;try{if(\"clear\"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if(\"interval\"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error('There is no interval scheduled with the given id \"'.concat(t,'\".'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if(\"timeout\"!==i)throw new Error('The given type \"'.concat(i,'\" is not supported'));(e=>{const r=t.get(e);if(void 0===r)throw new Error('There is no timeout scheduled with the given id \"'.concat(e,'\".'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if(\"set\"!==s.method)throw new Error('The given method \"'.concat(s.method,'\" is not supported'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if(\"interval\"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,\"interval\"))})(i,a,n);else{if(\"timeout\"!==d)throw new Error('The given type \"'.concat(d,'\" is not supported'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,\"timeout\"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();`;var ve=Qe(Ke,Ze),et=n=>ve().clearInterval(n),tt=n=>ve().clearTimeout(n),rt=(n,e)=>ve().setInterval(n,e),nt=(n,e)=>ve().setTimeout(n,e);var M=(typeof window>\"u\"?\"undefined\":typeof window)==\"object\";var I={setTimeout:M?setTimeout.bind(window):setTimeout,clearTimeout:M?clearTimeout.bind(window):clearTimeout,setInterval:M?setInterval.bind(window):setInterval,clearInterval:M?clearInterval.bind(window):clearInterval},ae={setTimeout:nt,clearTimeout:tt,setInterval:rt,clearInterval:et};function Ot(){I.setTimeout=setTimeout,I.clearTimeout=clearTimeout,I.setInterval=setInterval,I.clearInterval=clearInterval,ae.setTimeout=setTimeout,ae.clearTimeout=clearTimeout,ae.setInterval=setInterval,ae.clearInterval=clearInterval}function it(n){I.setTimeout=n.setTimeout,I.clearTimeout=n.clearTimeout,I.setInterval=n.setInterval,I.clearInterval=n.clearInterval}var Q={},Ae=class{name;closed=!1;mc=new MessageChannel;constructor(e){this.name=e,Q[e]=Q[e]||[],Q[e].push(this),this.mc.port1.start(),this.mc.port2.start(),this.onStorage=this.onStorage.bind(this),window.addEventListener(\"storage\",this.onStorage)}onStorage(e){if(e.storageArea!==window.localStorage||e.key.substring(0,this.name.length)!==this.name||e.newValue===null)return;let r=JSON.parse(e.newValue);this.mc.port2.postMessage(r)}postMessage(e){if(this.closed)throw new Error(\"InvalidStateError\");let r=JSON.stringify(e),i=`${this.name}:${String(Date.now())}${String(Math.random())}`;window.localStorage.setItem(i,r),I.setTimeout(()=>{window.localStorage.removeItem(i)},500),Q[this.name].forEach(o=>{o!==this&&o.mc.port2.postMessage(JSON.parse(r))})}close(){if(this.closed)return;this.closed=!0,this.mc.port1.close(),this.mc.port2.close(),window.removeEventListener(\"storage\",this.onStorage);let e=Q[this.name].indexOf(this);Q[this.name].splice(e,1)}get onmessage(){return this.mc.port1.onmessage}set onmessage(e){this.mc.port1.onmessage=e}get onmessageerror(){return this.mc.port1.onmessageerror}set onmessageerror(e){this.mc.port1.onmessageerror=e}addEventListener(e,r){return this.mc.port1.addEventListener(e,r)}removeEventListener(e,r){return this.mc.port1.removeEventListener(e,r)}dispatchEvent(e){return this.mc.port1.dispatchEvent(e)}},st=typeof window>\"u\"?void 0:typeof window.BroadcastChannel==\"function\"?window.BroadcastChannel:Ae;function ot(n=0){return new Promise(e=>I.setTimeout(e,n))}function Te(){return Math.random().toString(36).substring(2)}var Ie=class{options;channel;token=Te();isLeader=!1;isDead=!1;isApplying=!1;reApply=!1;intervals=[];listeners=[];deferred;constructor(e,r){this.channel=e,this.options=r,this.apply=this.apply.bind(this),this.awaitLeadership=this.awaitLeadership.bind(this),this.sendAction=this.sendAction.bind(this)}async apply(){if(this.isLeader||this.isDead)return!1;if(this.isApplying)return this.reApply=!0,!1;this.isApplying=!0;let e=!1,r=i=>{let{token:o,action:u}=i.data;o!==this.token&&(u===0&&o>this.token&&(e=!0),u===1&&(e=!0))};this.channel.addEventListener(\"message\",r);try{return this.sendAction(0),await ot(this.options.responseTime),this.channel.removeEventListener(\"message\",r),this.isApplying=!1,e?this.reApply?this.apply():!1:(this.assumeLead(),!0)}catch{return!1}}awaitLeadership(){if(this.isLeader)return Promise.resolve();let e=!1,r=null;return new Promise(i=>{let o=()=>{if(e)return;e=!0;try{I.clearInterval(r)}catch{}let g=this.intervals.indexOf(r);g>=0&&this.intervals.splice(g,1),this.channel.removeEventListener(\"message\",u),i()};r=I.setInterval(()=>{this.apply().then(()=>{this.isLeader&&o()})},this.options.fallbackInterval),this.intervals.push(r);let u=g=>{let{action:O}=g.data;O===2&&this.apply().then(()=>{this.isLeader&&o()})};this.channel.addEventListener(\"message\",u)})}sendAction(e){this.channel.postMessage({action:e,token:this.token})}assumeLead(){this.isLeader=!0;let e=r=>{let{action:i}=r.data;i===0&&this.sendAction(1)};return this.channel.addEventListener(\"message\",e),this.listeners.push(e),this.sendAction(1)}waitForLeadership(){return this.deferred?this.deferred:(this.deferred=this.awaitLeadership(),this.deferred)}close(){if(!this.isDead){this.isDead=!0,this.isLeader=!1,this.sendAction(2);try{this.listeners.forEach(e=>this.channel.removeEventListener(\"message\",e)),this.intervals.forEach(e=>I.clearInterval(e))}catch{}}}};var Ee=class{channel;options;elector;token=Te();registry=new Map;allIdle=!1;isLastActive=!1;constructor(e){let{channelName:r}=e;if(this.options=e,this.channel=new st(r),this.registry.set(this.token,1),e.leaderElection){let i={fallbackInterval:2e3,responseTime:100};this.elector=new Ie(this.channel,i),this.elector.waitForLeadership()}this.channel.addEventListener(\"message\",i=>{let{action:o,token:u,data:g}=i.data;switch(o){case 3:this.registry.set(u,2);break;case 4:this.registry.delete(u);break;case 5:this.idle(u);break;case 6:this.active(u);break;case 7:this.prompt(u);break;case 8:this.start(u);break;case 9:this.reset(u);break;case 10:this.activate(u);break;case 11:this.pause(u);break;case 12:this.resume(u);break;case 13:this.options.onMessage(g);break}}),this.send(3)}get isLeader(){if(!this.elector)throw new Error('\\u274C Leader election is not enabled. To Enable it set the \"leaderElection\" property to true.');return this.elector.isLeader}prompt(e=this.token){this.registry.set(e,0);let r=[...this.registry.values()].every(i=>i===0);e===this.token&&this.send(7),r&&this.options.onPrompt()}idle(e=this.token){this.registry.set(e,2);let r=[...this.registry.values()].every(i=>i===2);e===this.token&&this.send(5),!this.allIdle&&r&&(this.allIdle=!0,this.options.onIdle())}active(e=this.token){this.allIdle=!1,this.registry.set(e,1);let r=[...this.registry.values()].some(i=>i===1);e===this.token&&this.send(6),r&&this.options.onActive(),this.isLastActive=e===this.token}start(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(8):this.options.start(!0),this.isLastActive=e===this.token}reset(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(9):this.options.reset(!0),this.isLastActive=e===this.token}activate(e=this.token){this.allIdle=!1,this.registry.set(e,1),e===this.token?this.send(10):this.options.activate(!0),this.isLastActive=e===this.token}pause(e=this.token){e===this.token?this.send(11):this.options.pause(!0)}resume(e=this.token){e===this.token?this.send(12):this.options.resume(!0)}message(e){try{this.channel.postMessage({action:13,token:this.token,data:e})}catch{}}send(e){try{this.channel.postMessage({action:e,token:this.token})}catch{}}close(){this.options.leaderElection&&this.elector.close(),this.send(4),this.channel.close()}};var at=M?document:null,xe=[\"mousemove\",\"keydown\",\"wheel\",\"DOMMouseScroll\",\"mousewheel\",\"mousedown\",\"touchstart\",\"touchmove\",\"MSPointerDown\",\"MSPointerMove\",\"visibilitychange\",\"focus\"];function ct(n,e){let r;function i(...o){r&&clearTimeout(r),r=setTimeout(()=>{n(...o),r=null},e)}return i.cancel=function(){clearTimeout(r)},i}function be(n,e){let r=0;return function(...i){let o=new Date().getTime();if(!(o-r<e))return r=o,n(...i)}}var v=()=>Date.now();var Z=2147483647;function se({timeout:n=1e3*60*20,promptTimeout:e=0,promptBeforeIdle:r=0,element:i=at,events:o=xe,timers:u=void 0,immediateEvents:g=[],onPresenceChange:O=()=>{},onPrompt:W=()=>{},onIdle:m=()=>{},onActive:a=()=>{},onAction:d=()=>{},onMessage:l=()=>{},debounce:p=0,throttle:f=0,eventsThrottle:B=200,startOnMount:y=!0,startManually:D=!1,stopOnIdle:ce=!1,crossTab:j=!1,name:Oe=\"idle-timer\",syncTimers:ee=0,leaderElection:Ce=!1,disabled:C=!1}={}){let De=c(v()),ue=c(v()),w=c(null),R=c(null),F=c(0),te=c(0),N=c(0),S=c(0),h=c(!1),E=c(!1),H=c(!1),_=c(!0),re=c(!1),U=c(null),s=c(null),k=c(n),G=c(0);b(()=>{if(e&&console.warn(\"\\u26A0\\uFE0F IdleTimer -- The `promptTimeout` property has been deprecated in favor of `promptBeforeIdle`. It will be removed in the next major release.\"),r&&e)throw new Error(\"\\u274C Both promptTimeout and promptBeforeIdle can not be set. The promptTimeout property will be deprecated in a future version.\");if(n>=Z)throw new Error(`\\u274C The value for the timeout property must fit in a 32 bit signed integer, ${Z}.`);if(e>=Z)throw new Error(`\\u274C The value for the promptTimeout property must fit in a 32 bit signed integer, ${Z}.`);if(r>=Z)throw new Error(`\\u274C The value for the promptBeforeIdle property must fit in a 32 bit signed integer, ${Z}.`);if(r>=n)throw new Error(`\\u274C The value for the promptBeforeIdle property must be less than the timeout property, ${n}.`);if(r?(k.current=n-r,G.current=r):(k.current=n,G.current=e),!_.current){if(D||C)return;h.current&&(X.current(null,L),s.current&&s.current.active()),J()}},[n,e,r,D,C]);let Ne=c(ce);b(()=>{Ne.current=ce},[ce]);let He=c(g),ne=c(i),ye=c([...new Set([...o,...g]).values()]),A=c(C);b(()=>{A.current=C,!_.current&&(C?fe():D||J())},[C]);let ie=c(O);b(()=>{ie.current=O},[O]);let le=c(W);b(()=>{le.current=W},[W]);let me=c(m);b(()=>{me.current=m},[m]);let X=c(a);b(()=>{X.current=a},[a]);let de=c(d);b(()=>{de.current=d},[d]);let z=c(l);b(()=>{z.current=l},[l]);let q=Dt(()=>{let t=(P,K)=>de.current(P,K);return p>0?ct(t,p):f>0?be(t,f):t},[f,p]),_e=c();b(()=>{j&&ee&&(_e.current=be(()=>{s.current.active()},ee))},[j,ee]);let x=()=>{U.current!==null&&(I.clearTimeout(U.current),U.current=null)},$=(t,P=!0)=>{x(),U.current=I.setTimeout(Le,t||k.current),P&&(R.current=v())},Ue=t=>{!E.current&&!h.current&&(le.current(t,L),ie.current({type:\"active\",prompted:!0},L)),S.current=0,N.current=v(),E.current=!0,$(G.current,!1)},Fe=()=>{x(),h.current||(me.current(null,L),ie.current({type:\"idle\"},L)),h.current=!0,w.current=v(),Ne.current?Y():E.current&&(N.current=0,E.current=!1)},we=t=>{x(),(h.current||E.current)&&(X.current(t,L),ie.current({type:\"active\",prompted:!1},L)),E.current=!1,N.current=0,h.current=!1,F.current+=v()-w.current,te.current+=v()-w.current,V(),$()},Le=t=>{if(!h.current){q.cancel&&q.cancel();let K=v()-R.current;if(!(k.current+G.current<K)&&G.current>0&&!E.current){s.current?s.current.prompt():Ue(t);return}s.current?s.current.idle():Fe();return}s.current?s.current.active():we(t)},Pe=t=>{if(!y&&!R.current&&(R.current=v(),X.current(null,L)),q(t,L),E.current)return;if(x(),!h.current&&He.current.includes(t.type)){Le(t);return}let P=v()-R.current;if(h.current&&!ce||!h.current&&P>=k.current){Le(t);return}H.current=!1,S.current=0,N.current=0,$(),j&&ee&&_e.current()},pe=c(Pe);b(()=>{let t=re.current;t&&Y(),B>0?pe.current=be(Pe,B):pe.current=Pe,t&&V()},[B,f,p,de,j,ee]);let V=()=>{M&&ne.current&&(re.current||(ye.current.forEach(t=>{ne.current.addEventListener(t,pe.current,{capture:!0,passive:!0})}),re.current=!0))},Y=(t=!1)=>{M&&ne.current&&(re.current||t)&&(ye.current.forEach(P=>{ne.current.removeEventListener(P,pe.current,{capture:!0})}),re.current=!1)},J=T(t=>A.current?!1:(x(),V(),h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,s.current&&!t&&s.current.start(),$(),!0),[U,h,A,k,s]),Se=T(t=>A.current?!1:(x(),V(),ue.current=v(),F.current+=v()-w.current,te.current+=v()-w.current,F.current=0,h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,s.current&&!t&&s.current.reset(),D||$(),!0),[U,h,k,D,A,s]),Ve=T(t=>A.current?!1:(x(),V(),(h.current||E.current)&&we(),h.current=!1,E.current=!1,H.current=!1,S.current=0,N.current=0,ue.current=v(),s.current&&!t&&s.current.activate(),$(),!0),[U,h,E,A,k,s]),fe=T((t=!1)=>A.current||H.current?!1:(S.current=We(),H.current=!0,Y(),x(),s.current&&!t&&s.current.pause(),!0),[U,A,s]),Me=T((t=!1)=>A.current||!H.current?!1:(H.current=!1,E.current||V(),h.current||$(S.current),N.current&&(N.current=v()),s.current&&!t&&s.current.resume(),!0),[U,k,A,S,s]),ut=T((t,P)=>(s.current?(P&&z.current(t,L),s.current.message(t)):P&&z.current(t,L),!0),[l]),lt=T(()=>h.current,[h]),mt=T(()=>E.current,[E]),dt=T(()=>s.current?s.current.isLeader:null,[s]),pt=T(()=>s.current?s.current.isLastActive:null,[s]),ft=T(()=>s.current?s.current.token:null,[s]),We=T(()=>{if(H.current)return S.current;let t=S.current?S.current:G.current+k.current,P=R.current?v()-R.current:0,K=Math.floor(t-P);return K<0?0:Math.abs(K)},[k,G,E,S,R]),Be=T(()=>Math.round(v()-ue.current),[ue]),Ge=T(()=>Math.round(v()-De.current),[De]),ht=T(()=>w.current?new Date(w.current):null,[w]),vt=T(()=>R.current?new Date(R.current):null,[R]),qe=T(()=>h.current?Math.round(v()-w.current+F.current):Math.round(F.current),[w,F]),$e=T(()=>h.current?Math.round(v()-w.current+te.current):Math.round(te.current),[w,te]),Tt=T(()=>{let t=Math.round(Be()-qe());return t>=0?t:0},[w,F]),It=T(()=>{let t=Math.round(Ge()-$e());return t>=0?t:0},[w,F]);b(()=>{if(p>0&&f>0)throw new Error(\"\\u274C onAction can either be throttled or debounced, not both.\");u&&it(u);let t=()=>{s.current&&s.current.close(),q.cancel&&q.cancel(),x(),Y(!0)};return M&&window.addEventListener(\"beforeunload\",t),()=>{M&&window.removeEventListener(\"beforeunload\",t),s.current&&s.current.close(),q.cancel&&q.cancel(),x(),Y(!0)}},[]),b(()=>{s.current&&s.current.close(),j?s.current=new Ee({channelName:Oe,leaderElection:Ce,onPrompt:()=>{Ue()},onIdle:()=>{Fe()},onActive:()=>{we()},onMessage:t=>{z.current(t,L)},start:J,reset:Se,activate:Ve,pause:fe,resume:Me}):s.current=null},[j,Oe,Ce,le,me,X,z,J,Se,fe,Me]),b(()=>{_.current||(x(),Y(!0)),!(D||C)&&(y?J():V())},[D,y,C,_]),b(()=>{if(!_.current){let t=[...new Set([...o,...g]).values()];if(Y(),ye.current=t,ne.current=i,He.current=g,D||C)return;y?J():V()}},[i,JSON.stringify(o),JSON.stringify(g),_,C,D,y]),b(()=>{_.current&&(_.current=!1)},[_]);let L={message:ut,start:J,reset:Se,activate:Ve,pause:fe,resume:Me,isIdle:lt,isPrompted:mt,isLeader:dt,isLastActiveTab:pt,getTabId:ft,getRemainingTime:We,getElapsedTime:Be,getTotalElapsedTime:Ge,getLastIdleTime:ht,getLastActiveTime:vt,getIdleTime:qe,getTotalIdleTime:$e,getActiveTime:Tt,getTotalActiveTime:It,setOnPresenceChange:t=>{O=t,ie.current=t},setOnPrompt:t=>{W=t,le.current=t},setOnIdle:t=>{m=t,me.current=t},setOnActive:t=>{a=t,X.current=t},setOnAction:t=>{d=t,de.current=t},setOnMessage:t=>{l=t,z.current=t}};return L}import{createContext as Nt,useContext as Ht}from\"react\";import{jsx as Vt}from\"react/jsx-runtime\";var ge=Nt(null);function _t(n){let e=se(n);return Vt(ge.Provider,{value:e,children:n.children})}var Ut=ge.Consumer;function Ft(){return Ht(ge)}export{xe as DEFAULT_EVENTS,ke as IdleTimerComponent,Ut as IdleTimerConsumer,ge as IdleTimerContext,_t as IdleTimerProvider,Ot as createMocks,se as useIdleTimer,Ft as useIdleTimerContext,kt as withIdleTimer,ae as workerTimers};\n","import { useState } from \"react\";\n\n/**\n * Custom hook to manage the visibility of an idle timer prompt\n *\n * @param initialValue Initial visibility state of the prompt (default: false)\n * @returns Object with methods to control the prompt visibility\n */\nexport function useIdleTimerPrompt(initialValue: boolean = false) {\n const [showIdleTimerPrompt, setOpened] = useState(initialValue);\n\n const openIdleTimerPrompt = () => setOpened(true);\n const closeIdleTimerPrompt = () => setOpened(false);\n\n return {\n showIdleTimerPrompt,\n openIdleTimerPrompt,\n closeIdleTimerPrompt,\n };\n}\n","import { useCallback, useEffect, useRef } from \"react\";\n\nimport type {\n IdleTimerCountdownCallback,\n UseIdleTimerCountdown,\n} from \"@/types\";\nimport type { IIdleTimer } from \"react-idle-timer\";\n\n/**\n * Custom hook for managing intervals with start/stop functionality\n *\n * @param callback Function to call on each interval\n * @param delay Interval delay in milliseconds (default: 1000)\n * @returns Object with interval control methods\n */\nexport const useIdleTimerCountdown = (\n callback: IdleTimerCountdownCallback,\n delay: number = 1000\n): UseIdleTimerCountdown => {\n const intervalId = useRef<NodeJS.Timeout | null>(null);\n const fn = useRef(callback);\n\n const startIdleTimerCountdown = useCallback(\n (timer?: IIdleTimer) => {\n if (intervalId.current) return;\n\n const handler = () => fn.current(timer);\n const id = setInterval(handler, delay);\n intervalId.current = id;\n },\n [delay]\n );\n\n const stopIdleTimerCountdown = useCallback(() => {\n if (intervalId.current) {\n clearInterval(intervalId.current);\n intervalId.current = null;\n }\n }, []);\n\n const interval = { startIdleTimerCountdown, stopIdleTimerCountdown };\n useEffect(() => stopIdleTimerCountdown, [stopIdleTimerCountdown]);\n\n return interval;\n};\n","export const DEFAULT_INACTIVITY_TIME = 1000 * 60 * 5; // 5 minutes\nexport const DEFAULT_PROMPT_TIME = 1000 * 60; // 60 seconds\nexport const DEFAULT_SYNC_TIMERS = 500; // 500 milliseconds\n","import type { IIdleTimer } from \"react-idle-timer\";\n\nimport { useEffect, useState } from \"react\";\n\nimport { useIdleTimerCountdown } from \"./use-idle-timer-countdown\";\n\n/**\n * Debug hook for idle timer - logs timer state at regular intervals\n *\n * @param timer The idle timer instance to debug\n * @param enabled Whether debugging is enabled (default: false)\n */\nexport const useIdleTimerDebug = (\n idleTimer: IIdleTimer,\n enabled: boolean = false\n) => {\n const extractIdleTimerState = (idleTimer: IIdleTimer) => ({\n isIdle: idleTimer.isIdle(),\n isPrompted: idleTimer.isPrompted(),\n remainingTime: idleTimer.getRemainingTime(),\n elapsedTime: idleTimer.getElapsedTime(),\n totalActiveTime: idleTimer.getTotalActiveTime(),\n totalIdleTime: idleTimer.getTotalIdleTime(),\n totalElapsedTime: idleTimer.getTotalElapsedTime(),\n });\n\n const [idleTimerState, setIdleTimerState] = useState(\n extractIdleTimerState(idleTimer)\n );\n\n const { startIdleTimerCountdown, stopIdleTimerCountdown } =\n useIdleTimerCountdown((idleTimer) => {\n if (!idleTimer || !enabled) return;\n\n setIdleTimerState(extractIdleTimerState(idleTimer));\n });\n\n useEffect(() => {\n if (idleTimer && enabled) {\n setIdleTimerState(extractIdleTimerState(idleTimer));\n startIdleTimerCountdown(idleTimer);\n } else {\n stopIdleTimerCountdown();\n }\n\n return stopIdleTimerCountdown;\n }, [idleTimer, enabled]);\n\n return idleTimerState;\n};\n","/**\n * Formats milliseconds to seconds\n * @param milliseconds Time in milliseconds\n * @returns Time in seconds\n */\nexport const millisecondsToSeconds = (milliseconds: number): number => {\n return Math.floor(milliseconds / 1000);\n};\n","import { millisecondsToSeconds } from \"../milliseconds-to-seconds\";\n\n/**\n * Formats time in milliseconds to a readable countdown format (MM:SS or H:MM:SS)\n *\n * @param ms Time in milliseconds to format\n * @returns Formatted time string (e.g., \"05:30\" or \"1:05:30\")\n */\nexport const formatTime = (ms: number): string => {\n const timeInSeconds = millisecondsToSeconds(ms);\n\n const hours = Math.floor(timeInSeconds / 3600);\n const minutes = Math.floor((timeInSeconds % 3600) / 60);\n const seconds = Math.floor(timeInSeconds % 60);\n\n if (hours > 0) {\n return `${hours}:${minutes.toString().padStart(2, \"0\")}:${seconds\n .toString()\n .padStart(2, \"0\")}`;\n }\n\n return `${minutes.toString().padStart(2, \"0\")}:${seconds\n .toString()\n .padStart(2, \"0\")}`;\n};\n","/**\n * Formats seconds to milliseconds\n * @param seconds Time in seconds\n * @returns Time in milliseconds\n */\nexport const secondsToMilliseconds = (seconds: number): number => {\n return seconds * 1000;\n};\n"]}