"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[433],{9433:(e,s,t)=>{t.r(s),t.d(s,{default:()=>o});var a=t(5043),n=t(3216),r=t(4556),i=(t(872),t(5495)),l=t(7710),c=t(579);function o(){var e;const s=(0,n.zy)(),t=(null===s||void 0===s||null===(e=s.state)||void 0===e?void 0:e.email)||"",o=(0,n.Zp)(),u=(0,r.wA)(),[p,d]=(0,a.useState)(["","","",""]),m=[(0,a.useRef)(),(0,a.useRef)(),(0,a.useRef)(),(0,a.useRef)()];return(0,c.jsx)("div",{className:"otp-wrapper",children:(0,c.jsxs)("div",{className:"otp-card",children:[(0,c.jsx)("h2",{className:"otp-title",children:"Verification"}),(0,c.jsx)("p",{className:"otp-subtitle",children:"Enter the verification code sent to:"}),(0,c.jsx)("h3",{className:"otp-number",children:t}),(0,c.jsx)("p",{className:"enter-text",children:"Enter OTP here"}),(0,c.jsx)("div",{className:"otp-box-group",children:p.map(((e,s)=>(0,c.jsx)("input",{ref:m[s],maxLength:1,className:"otp-input",value:e,onChange:e=>((e,s)=>{if(isNaN(e))return;const t=[...p];t[s]=e,d(t),e&&s<3&&m[s+1].current.focus()})(e.target.value,s)},s)))}),(0,c.jsx)("button",{className:"confirm-btn",onClick:async()=>{const e=p.join("");if(4!==e.length)return void alert("Please enter valid OTP");const s={emailID:t,emailOtp:e},a=await u((0,i.m5)(s));null!==a&&void 0!==a&&a.error||o("/reset-password",{state:{email:t}})},children:"CONFIRM"}),(0,c.jsxs)("p",{className:"change-number",children:["Didn\u2019t receive OTP?"," ",(0,c.jsx)("span",{onClick:async()=>{const e={emailID:t||""};await u((0,l.NO)(e)),o("/otp-verification",{state:{email:t}})},style:{cursor:"pointer",color:"blue"},children:"Resend OTP"})]})]})})}},872:()=>{}}]);
//# sourceMappingURL=433.2c3776f9.chunk.js.map