import"./main-v4-cG-pE7B4.js";var e=document.querySelectorAll(".otp-input");e.forEach((t,r)=>{t.addEventListener("input",t=>{t.target.value=t.target.value.replace(/\D/g,"").slice(0,1),t.target.value&&e.length-1>r&&e[r+1].focus(),6===Array.from(e).map(e=>e.value).join("").length&&document.getElementById("otp-form").requestSubmit()}),t.addEventListener("keydown",t=>{"Backspace"===t.key&&!t.target.value&&r>0?(e[r-1].focus(),e[r-1].value="",t.preventDefault()):"ArrowLeft"===t.key&&r>0?e[r-1].focus():"ArrowRight"===t.key&&e.length-1>r&&e[r+1].focus()}),t.addEventListener("paste",t=>{t.preventDefault();const r=(t.clipboardData?.getData("text")||"").replace(/\D/g,"").slice(0,6);r.split("").forEach((t,r)=>{e[r]&&(e[r].value=t)}),e[Math.min(r.length,e.length-1)].focus(),6===r.length&&document.getElementById("otp-form").requestSubmit()})}),document.getElementById("otp-form").addEventListener("submit",e=>{e.preventDefault(),e.stopPropagation(),window.location.href="index.html"});var t=299,r=document.getElementById("otp-timer"),n=setInterval(()=>{if(0>=(t-=1))return clearInterval(n),void(r.innerHTML='<a href="#">Code expired — resend</a>');r.innerHTML=`Expires in <strong>${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}</strong>`},1e3);