"use strict";(self.webpackChunkaesirx_cmp=self.webpackChunkaesirx_cmp||[]).push([[910],{72910:(e,a,t)=>{t.r(a),t.d(a,{default:()=>b});var l=t(89698),s=t(87698),n=(t(24899),t(96540)),r=t(9072),m=t(51272),i=t(12664),c=t(2543),o=t(36402),u=t(20982),d=t(66188),b=({accountInfo:e})=>{const[a,t]=(0,n.useState)(!1),{handleOnData:b}=(0,n.useContext)(l.k),h=(0,n.useCallback)((0,c.debounce)(s.DT,200),[]),p=(0,m.Wx)({initialValues:{email:""},validationSchema:i.Ik((()=>{const e={};return e.email=i.Yj().email("Please enter valid email").required("Please enter your email").test("unique","This Email is already taken",(async e=>await h(e))),e})()),onSubmit:async a=>{t(!0);try{console.log("accountInfo",e);const l=await(0,s.ON)({id:e?.memberId,sendmail:1,...a},e?.data?.access_token);l?.result?.success?b(e?.data):(0,r.oR)(l?.result?.message,{closeOnClick:!1}),t(!1)}catch(e){console.error(e),t(!1)}}});return n.createElement(o.A,{onSubmit:p.handleSubmit},n.createElement("div",{className:"mb-4"},n.createElement("p",null,"Your account is missing an email address.",n.createElement("br",null),"Please update it to continue."),n.createElement(o.A.Group,{className:"mb-3 w-100"},n.createElement(o.A.Label,{className:"mb-2"},"Email address ",n.createElement("span",{className:"text-danger"},"*")),n.createElement("div",{className:"position-relative"},n.createElement(o.A.Control,{type:"email",name:"email",onChange:p.handleChange,onBlur:p.handleBlur,value:p.values.email,className:"py-13px lh-sm "+(p.touched.email&&p.errors.email?"border-danger":"")})),p.touched.email&&p.errors.email?n.createElement("p",{className:"mt-2 mb-0 p-0 border-0 text-danger d-flex align-items-center"},n.createElement(u.g,{icon:d.lEd,width:14,height:14}),n.createElement("span",{className:"fs-7 fw-semibold ms-2 lh-1"},p.errors.email)):null)),n.createElement("button",{type:"submit",className:"btn btn-success w-100 lh-sm text-white fw-semibold"},a?n.createElement(n.Fragment,null,n.createElement("span",{className:"spinner-border spinner-border-sm me-1",role:"status","aria-hidden":"true"}),"Waiting..."):"Update"))}}}]);