(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5890],{3029:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>f});var r=t(5155),a=t(2907),n=t(6170),i=t(9937),o=t(7933),d=t(5626),l=t(3664),m=t(5299),u=t(5239),c=t(2619),p=t.n(c),h=t(63),x=t(2115),g=t(8720);function y(){var e;let s=(0,h.useRouter)(),t=null!=(e=(0,h.useSearchParams)().get("role"))?e:"super-admin",[c,y]=(0,x.useState)(""),[f,{isLoading:j}]=(0,o.Po)(),[P,{isLoading:v}]=(0,o.Ec)(),N=j||v,w=async e=>{if(e.preventDefault(),!c.trim())return void g.o.error("Please enter your email address");try{let e="super-admin"===t?f:P;await e({email:c}).unwrap(),g.o.success("OTP sent to your email address"),sessionStorage.setItem("resetEmail",c),sessionStorage.setItem("resetRole",t),s.push("/verify-otp?role=".concat(t,"&email=").concat(encodeURIComponent(c)))}catch(e){var r,a;g.o.error(null!=(a=null==e||null==(r=e.data)?void 0:r.message)?a:"Failed to send OTP. Please try again.")}};return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex lg:hidden items-center justify-center mb-8",children:[(0,r.jsx)(u.default,{src:"/t-coin.png",alt:"T-Coin",width:48,height:48,className:"object-contain"}),(0,r.jsx)("span",{className:"ml-3 text-2xl font-bold text-primary",children:"T-Coin Admin"})]}),(0,r.jsxs)(p(),{href:"/login",className:"inline-flex items-center text-sm text-muted-foreground hover:text-foreground mb-6 transition-colors",children:[(0,r.jsx)(d.A,{className:"mr-1.5 h-4 w-4"}),"Back to login"]}),(0,r.jsxs)("div",{className:"mb-8",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-foreground",children:"Forgot PIN?"}),(0,r.jsx)("p",{className:"text-muted-foreground mt-1.5",children:"Enter your registered email address and we'll send you an OTP."})]}),(0,r.jsxs)("form",{onSubmit:w,className:"space-y-5",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(i.J,{htmlFor:"email",children:"Email Address"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(l.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),(0,r.jsx)(n.p,{id:"email",type:"email",placeholder:"you@example.com",value:c,onChange:e=>y(e.target.value),className:"pl-10",autoFocus:!0})]})]}),(0,r.jsx)(a.$,{type:"submit",className:"w-full h-11 text-base font-semibold",disabled:N,children:N?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(m.A,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending OTP..."]}):"Send OTP"})]}),(0,r.jsxs)("p",{className:"mt-6 text-center text-xs text-muted-foreground",children:["Remember your PIN?"," ",(0,r.jsx)(p(),{href:"/login",className:"text-primary hover:underline font-medium",children:"Sign in"})]})]})}function f(){return(0,r.jsx)(x.Suspense,{children:(0,r.jsx)(y,{})})}},3399:(e,s,t)=>{Promise.resolve().then(t.bind(t,3029))},3664:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(1847).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},5626:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(1847).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},7933:(e,s,t)=>{"use strict";t.d(s,{Ec:()=>d,Gc:()=>m,Po:()=>a,UB:()=>r,gj:()=>l,hh:()=>i,nc:()=>n,v0:()=>o});let{useSuperAdminLoginMutation:r,useSuperAdminForgotPasswordMutation:a,useSuperAdminVerifyOtpMutation:n,useSuperAdminResetPasswordMutation:i,useAdminLoginMutation:o,useAdminForgotPasswordMutation:d,useAdminVerifyOtpMutation:l,useAdminResetPasswordMutation:m}=t(1067).p.injectEndpoints({endpoints:e=>({superAdminLogin:e.mutation({query:e=>({url:"/api/super-admin/signin",method:"POST",data:e})}),superAdminForgotPassword:e.mutation({query:e=>({url:"/api/super-admin/forgot-password",method:"POST",data:e})}),superAdminVerifyOtp:e.mutation({query:e=>({url:"/api/super-admin/verify-otp",method:"POST",data:e})}),superAdminResetPassword:e.mutation({query:e=>({url:"/api/super-admin/reset-password",method:"POST",data:e})}),adminLogin:e.mutation({query:e=>({url:"/api/admins/signin",method:"POST",data:e})}),adminForgotPassword:e.mutation({query:e=>({url:"/api/admins/forgot-password",method:"POST",data:e})}),adminVerifyOtp:e.mutation({query:e=>({url:"/api/admins/verify-otp",method:"POST",data:e})}),adminResetPassword:e.mutation({query:e=>({url:"/api/admins/reset-password",method:"POST",data:e})})})})}},e=>{e.O(0,[6206,6046,8720,9779,5239,2619,9048,8441,1255,7358],()=>e(e.s=3399)),_N_E=e.O()}]);