"use strict";var React=require("react");const getCountDownTime=e=>new Date(e).getTime()-new Date().getTime(),useCountdown=e=>{let[t,u]=React.useState(getCountDownTime(e));return React.useEffect(()=>{let n=null;return t>0&&(n=setInterval(()=>{t>0?u(getCountDownTime(e)):n&&(clearInterval(n),n=null)},1e3)),()=>{n&&clearInterval(n)}},[t,e]),React.useEffect(()=>{u(getCountDownTime(e))},[e]),getReturnValues(t)},getReturnValues=e=>{let t=Math.floor(e/6e4),u=Math.floor(e%6e4/1e3),n=`${t<10?"0":""}${t}:${u<10?"0":""}${u}`;return{isExpired:t+u<=0,format:n}},useGetTextExpired=e=>{let{isExpired:t,expiredText:u,conditionText:n,format:r}=e,o=React.useMemo(()=>t?u:`${n} ${r}`,[t,r,n,u]);return{text:o}};exports.useCountdown=useCountdown,exports.useGetTextExpired=useGetTextExpired;
