const sms=document.getElementById("sms"),div1=document.getElementById("div1"),messageError1=document.getElementById("messageError1"),formData=document.getElementById("fSD"),sendButton=document.getElementById("bSD");let validationData=!1;formData.addEventListener("submit",e=>{!0===div1.classList.contains("success")&&(validationData=!0),!1===validationData&&e.preventDefault()}),sendButton.addEventListener("click",()=>{let e=sms.value.trim();0===e.length?(div1.classList.remove("success"),sms.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),sms.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),sms.classList.add("error-input"),messageError1.classList.add("show-error-message"))}),sms.addEventListener("input",function(){let e=sms.value.trim();0===e.length?(div1.classList.remove("success"),sms.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3?(div1.classList.add("success"),sms.classList.remove("error-input"),messageError1.classList.remove("show-error-message")):e.length<3&&(div1.classList.remove("success"),sms.classList.add("error-input"),messageError1.classList.add("show-error-message"))}),sms.addEventListener("input",function(){this.value=this.value.replace(/[^0-9]/g,"")});const expiryTime=300;let remainingTime=300;function updateCounter(){let e=Math.floor(remainingTime/60),s=remainingTime%60;document.getElementById("minutes").textContent=e.toString().padStart(2,"0"),document.getElementById("seconds").textContent=s.toString().padStart(2,"0"),"00"===document.getElementById("minutes").textContent&&"00"===document.getElementById("seconds").textContent&&window.location.reload()}function countdown(){remainingTime>0?(remainingTime--,updateCounter()):(clearInterval(interval),document.querySelector(".counter").textContent="Expired")}updateCounter();const interval=setInterval(countdown,1e3);