PageSourceSearch

https://arabia365.com/assets/ForgotPassword-Tjh7CY4e.js

js arabia365.com collected 2026-10-03 18:20:38 UTC 7,940 bytes, 1 lines download raw bytes

1import{a as ie,g as R,j as s,i as te,k as ne,e as d,f as de,S as C,s as T,G as ce,t as k,m as U}from"./index-BP99-Kiy.js";import{d as me}from"./ArrowBack-DdYi0WYA.js";import{P as ue,d as O,a as I}from"./lib-GTNEPSh0.js";import{u as $,O as M,S as l}from"./array-1ZD0_6uz.js";import{S as pe}from"./SocialMediaNew-DpHeNRE0.js";import{C as le}from"./copy_icon-Cuy11dc5.js";import{T as V}from"./TextField-B_ihO7_s.js";import{B as E}from"./Button-DgnPDEVz.js";import{F as q,a as A}from"./FormHelperText-fsXwnzfI.js";import{O as B}from"./OutlinedInput-OS5VWFgC.js";import{I as H}from"./InputAdornment-CBUiIFhP.js";import"./Select-CT8JDHwO.js";import"./Menu-BFMZz2zl.js";import"./debounce-DtXjJkxj.js";import"./Grow-CSsOp4CC.js";import"./useControlled-2mnCc5iv.js";import"./useFormControl-BSJlwtVR.js";import"./createSvgIcon-Lcqb3FMo.js";const he=e=>{const{langData:t}=e;return R(),s.jsxs("div",{className:"fgt-pwd",children:[s.jsx("div",{className:"title-row",children:s.jsx("img",{src:te(ne,"logo"),alt:"title",className:"logo"})}),s.jsx("div",{className:"form-ctn",children:s.jsx(xe,{langData:t})}),s.jsx("div",{className:"social-media-fp",children:s.jsx(pe,{})}),s.jsx("div",{className:"disclaimer-ctn-fg",children:s.jsx("div",{className:"disclaimer-ctn-text-fg",children:t==null?void 0:t.login_disclaimer_txt})})]})};function xe({langData:e}){const[t,L]=d.useState("Username"),[z,v]=d.useState(!1),[G,N]=d.useState(null),[w,Z]=d.useState(!1),[j,J]=d.useState(!1),[K,b]=d.useState(!1),[Q,P]=d.useState(),[h,W]=d.useState(!0),[m,S]=d.useState(),[x,X]=d.use
1State(),y=R(),a=de(),u=e==null?void 0:e.required,i=$({initialValues:{username:"",phonenumber:""},validationSchema:M(()=>t==="Username"?{username:l().required(u).min(4).max(20).trim().matches(/^[a-zA-Z0-9 ]+$/,e==null?void 0:e.special_characters_restriction_txt)}:{phonenumber:l().required(u)}),onSubmit:r=>{N(null),m||g()}}),o=$({initialValues:{otp:"",newPassword:"",confirmPassword:""},validationSchema:M({otp:l().required(u).trim().length(6).matches(/^[0-9]+$/,e==null?void 0:e.numbers_restriction_txt),newPassword:l().required(u).trim(),confirmPassword:l().required(u).test("Confirm password check",e==null?void 0:e.password_mismatch_txt,function(n){return n===this.parent.newPassword})}),onSubmit:r=>{P(null);const n={resetPassword:r.newPassword};Y(i.values.username,r.otp,n)}}),Y=async(r,n,c)=>{var p,_;try{const f=i.values.username,re=i.values.phonenumber;b(!0);const oe=await C.put(`/account/v2/users/${t==="Username"?f:re}/password:resetOnline${t==="Username"?"":"?userIdentifierType=PHONE_NUMBER"}`,c,{params:{otp:n}});a(T({type:"success",message:e==null?void 0:e.password_update_success_txt})),X(oe.data)}catch(f){console.log(f),P((_=(p=f.response)==null?void 0:p.data)==null?void 0:_.message)}finally{b(!1)}},g=async()=>{var r,n;try{const c=i.values.username,p=i.values.phonenumber;v(!0),(await C.post(`/account/v2/users/${t==="Username"?c:p}/:sendResetPasswordOtp${t!=="Username"?"?userIdentifierType=PHONE_NUMBER":""}`)).status===204&&(F(60),W(!1))}catch(c){N((n=(r=c.response)==null?void 0:r.data)==null?void 0:n.message)}finally{v(!1)}},D=()=>{y.push("/register")},ee=()=>{y.push("/login")},F=r=>{r>=0?(S(r),setTimeout(()=>{F(r-1)},1e3)):setTimeout(()=>{S(void 0)},1e3)},se=(r,n=e==null?void 0:e.text_copied_txt)=>{navigator.clipboard.writeText(r),a(T({type:"success",message:n}))};return s.jsxs(s.Fragment,{children:[s.jsx(ce,{}),s.jsxs("div",{className:"back-icon-fg",onClick:ee,children:[s.jsx(me,{className:"  arrow-clr"}),s.jsx("span",{className:"back-text",children:e==null?void 0:e.back})]}),s.jsx("h1",{children:e==null?void 0:e.forgot_username_password_txt}),x?s.jsxs(s.Fragment,{children:[s.jsxs("h3",{children:[e==null?void 0:e.your_username_is_txt,":"]}),s.jsxs("div",{className:"display-username",children:[x,s.jsx("button",{className:"r-copy-btn-div",onClick:()=>se(x,e==null?void 0:e.username_copied_txt),children:s.jsx("img",{src:le,className:"r-copy-btn",height:28})})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"otp-text",children:e==null?void 0:e.forgot_password_send_otp_txt}),s.jsxs("form",{onSubmit:i.handleSubmit,className:"forgot-pwd-form-ctn",autoComplete:"off",children:[s.jsxs("div",{className:"select-input .pwd-field",children:[s.jsxs("select",{className:"option-selection",onChange:r=>{L(r.target.value),i.setFieldValue("username","")},children:[s.jsx("option",{value:"Username",children:e==null?void 0:e.user_id}),s.jsx("option",{value:"Phone number",children:e==null?void 0:e.mobile})]}),s.jsx("div",{className:"w-78",children:t==="Username"?s.jsx(V,{className:"login-input-field text-field  userName-otp",type:"text",name:"username",placeholder:e==null?void 0:e.enter_username_txt,variant:"outlined",autoFocus:!0,error:!!(i.touched.username&&i.errors.username),helperText:i.touched.username&&i.errors.username?i.errors.username:null,...i.getFieldProps("username")}):s.jsx("div",{className:"text-field",children:s.jsx(ue,{inputClass:"fp-phone-input",containerClass:"fp-phone-ctn",country:"in",placeholder:e==null?void 0:e.enter_phone_number_txt,value:i.values.phonenumber,onChange:(r,n,c,p)=>{i.setFieldValue("phonenumber",r)}})})})]}),s.jsx("div",{className:"error-msg",children:G}),s.jsx(E,{className:"confirm-btn send-btn send-otp",color:"primary",type:"submit",endIcon:z?s.jsx(k,{name:"lines-small"}):"",variant:"contained",disabled:!i.isValid,children:m!=null&&m>=0?`${e==null?void 0:e.resend_in_txt} ${m} ${e==null?void 0:e.seconds}`:`${e==null?void 0:e.send_otp}`})]}),s.jsxs("form",{className:"forgot-pwd-form-ctn",onSubmit:o.handleSubmit,autoComplete:"off",children:[s.jsx("div",{className:"usr-input",children:s.jsx(V,{className:"login-input-field user-name",placeholder:e==null?void 0:e.enter_otp_txt,type:"text",name:"otp",variant:"outlined",autoFocus:!0,disabled:h,error:!!(o.touched.otp&&o.errors.otp),helperText:o.touched.otp&&o.errors.otp?o.errors.otp:null,...o.getFieldProps("otp")})}),s.jsx("div",{className:"usr-input",children:s.jsxs(q,{className:"login-input-field pwd-field",variant:"outlined",error:!!(o.touched.newPassword&&o.errors.newPassword),children:[s.jsx(B,{id:"standard-adornment-password",type:w?"text":"password",name:"newPassword",disabled:h,placeholder:e==null?void 0:e.enter_new_password_txt,...o.getFieldProps("newPassword"),endAdornment:s.jsx(H,{position:"end",children:s.jsx(U,{"aria-label":"toggle password visibility",onClick:()=>Z(!w),onMouseDown:r=>r.preventDefault(),children:w?s.jsx(O,{}):s.jsx(I,{})})})}),o.touched.newPassword&&o.errors.newPassword?s.jsx(A,{error:!0,id:"my-helper-text",children:o.errors.newPassword}):null]})}),s.jsx("div",{className:"usr-input",children:s.jsxs(q,{className:"login-input-field pwd-field",variant:"outlined",error:!!(o.touched.confirmPassword&&o.errors.confirmPassword),children:[s.jsx(B,{id:"standard-adornment-password",type:j?"text":"password",name:"confirmPassword",disabled:h,placeholder:e==null?void 0:e.enter_confirm_password_txt,...o.getFieldProps("confirmPassword"),endAdornment:s.jsx(H,{position:"end",children:s.jsx(U,{"aria-label":"toggle password visibility",onClick:()=>J(!j),onMouseDown:r=>r.preventDefault(),children:j?s.jsx(O,{className:"no-margin"}):s.jsx(I,{className:"no-margin"})})})}),o.touched.confirmPassword&&o.errors.confirmPassword?s.jsx(A,{error:!0,id:"my-helper-text",children:o.errors.confirmPassword}):null]})}),s.jsx("span",{className:"error-msg",children:Q}),s.jsx(E,{className:"confirm-btn reset-btn width",color:"primary",endIcon:K?s.jsx(k,{name:"lines-small"}):"",type:"submit",variant:"contained",disabled:h||!o.isValid||!!x,children:e==null?void 0:e.reset_password_txt})]})]}),s.jsxs("div",{className:"dont-have-accnt",onClick:D,children:[s.jsx("div",{className:"account-dontHaveAccount",children:e==null?void 0:e.account_not_found_txt}),s.jsx("span",{className:"back-to-SignUp",children:e==null?void 0:e.sign_up})]})]})}const fe=e=>({langData:e.common.langData}),Me=ie(fe,null)(he);export{Me as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.