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