1import{u as D,j as e,a8 as G,P as O,I as H,r as y,b as V,m as J,d as v,l as K,n as _,aJ as Q,e as W,f as d,o as X,S as k,F as ee,g as ae,h as r,E as m,D as te,C as le,p as se,q as ie,k as q,N as ne,t as A}from"./index-DnzkrJT-.js";import{P as t}from"./EditProfile.module-C_sg8Wwn.js";const i={"edit-profile-modal-container":"_edit-profile-modal-container_1qyw8_1","edit-profile-close-icon":"_edit-profile-close-icon_1qyw8_21","edit-profile-icon-div":"_edit-profile-icon-div_1qyw8_43","edit-profile-icon":"_edit-profile-icon_1qyw8_43","edit-profile-msg":"_edit-profile-msg_1qyw8_71","edit-profile-msg-one":"_edit-profile-msg-one_1qyw8_79","edit-profile-msg-two":"_edit-profile-msg-two_1qyw8_101","upload-presc-modal-btn-container":"_upload-presc-modal-btn-container_1qyw8_121"};function oe({handleCloseModal:p}){const b=D();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:[i["edit-profile-modal-container"]].join(" "),children:[e.jsx(G,{onClick:p,className:[i["edit-profile-close-icon"]].join(" ")}),e.jsx("div",{className:[i["edit-profile-icon-div"]].join(" "),children:e.jsx("img",{className:[i["edit-profile-icon"]].join(" "),src:"/assets/images/edit_profile_modal_icon.svg",alt:"Eamil"})}),e.jsxs("div",{className:[i["edit-profile-msg"]].join(" "),children:[e.jsx("p",{className:[i["edit-profile-msg-one"]].join(" "),children:"This Email Id is associated with another account."}),e.jsx("p",{className:[i["edit-profile-msg-two"]].join(" "),children:"Please add another email id or contact our support team for further assistance"})]}),e.jsxs("div",{className:[i["upload-presc-modal-btn-container"]].join(" "),children:[e.jsx("button",{onClick:p,children:"Cancel"}),e.jsx("button",{onClick:()=>b(O.contactUs),children:"Contact Us"})]})]})})}function fe(){var C,E;const p=H(),[b,R]=y.useState(!1),[re,me]=y.useState(!1),{loginData:ce}=V(s=>s.appStoreData),P=()=>{R(!b)},n=J(),S=D();localStorage.getItem("token");const T=localStorage.getItem("selectedCityId");localStorage.getItem("mobileNumber");const[z,$]=y.useState(!1),B=()=>{$(!0)},M=()=>{$(!1)},{data:j}=v(K,`title?cityId=${T}`),{data:g}=v(_,"user"),a=g==null?void 0:g.result,{data:u}=v(_,"user/get-family"),o=(C=u==null?void 0:u.data)==null?void 0:C.familyMembers,I=j==null?void 0:j.data,U={title:a?a==null?void 0:a.title:"",name:a!=null&&a.name?a==null?void 0:a.name:"",dob:a!=null&&a.birthDay?(E=a==null?void 0:a.birthDay)!=null&&E.includes("-")?Q(a==null?void 0:a.birthDay):new Date(a==null?void 0:a.birthDay):"",gender:a!=null&&a.gender?a==null?void 0:a.gender:"",relation:o!=null&&o.relation?o==null?void 0:o.relation:"Self",email:a!=null&&a.email?a==null?void 0:a.email:""},c=new Date,w=new Date(c.getFullYear()-100,c.getMonth(),c.getDate()),Y=W().shape({title:d().required("Please Select Title"),name:d().trim().min(1,"Name must be at least 1 character").max(50,"Name must be of 50 characters").required("Please Enter Name").matches(/^[a-zA-Z\s]+$/,"Name should only contain alphabets"),dob:X().required("Please Enter Date of Birth").min(w,"Date cannot be more than 100 years in the past").max(c,"Date cannot be in the future").test("age","Should be greater than 18",function(s,N){const l=new Date(s);return new Date().getFullYear()-l.getFullYear()>=18}),gender:d().required("Please Enter Gender"),relation:d().required("Please Enter Relation"),email:d().trim().required("Please Enter Email address").email("Invalid Email Address").matches(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Email address must be valid")}),L=()=>{alert("Delete Your Profile")},Z=async s=>{var f,h,x,F;const N={title:s.title,name:s.name,birthDay:ie(s.dob),ageInDay:se(s.dob),gender:s.gender,relation:s.relation,email:s.email,mobileNumber:a!=null&&a.mobileNumber?a==null?void 0:a.mobileNumber:""},l=await _.put("/user",N);((f=l==null?void 0:l.data)==null?void 0:f.message)==="Email Already Exist"?B():((h=l==null?void 0:l.data)==null?void 0:h.code)===2e3?(q("Profile updated successfully",A.SUCCESS),p(ne("profileUpdate","auth",{})),(x=n==null?void 0:n.state)!=null&&x.url?S((F=n==null?void 0:n.state)==null?void 0:F.url):S(O.myProfile)):q("Operation Unsuccessfull",A.ERROR)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${t.my_profile_desktop_view}`,children:e.jsx(k,{})}),e.jsx("div",{className:`${t.my_profile_mobile_view}`,children:e.jsx(k,{isBannerVisible:!1})}),e.jsxs("div",{className:"container px-md-5",children:[e.jsxs("div",{className:`mt-lg-5 mt-md-4 mt-3 mb-lg-5 mb-md-4 mb-3 ${t.MyProfile_Main_Section}`,children:[e.jsxs("div",{className:`mb-lg-5 mb-md-4 mb-3 ${t.MyProfileHeading_Section}`,children:[e.jsx("p",{className:"",children:" My Profile"}),e.jsx("button",{type:"submit",form:"demo",className:` ${t.EditProfile_Section}`,children:e.jsxs("span",{className:` ${t.EditProfile_save_button}`,children:[e.jsx("i",{className:"far fa-bookmark"}),"Save"]})})]}),e.jsxs("div",{className:`${t.MyProfile_Section}`,children:[e.jsx("div",{div:!0,className:`${t.UserProfileIcon_Section}`,onClick:P,children:e.jsx("div",{div:!0,className:`${t.UserProfileIcon}`,onClick:P,children:e.jsx("span",{className:"fa fa-user"})})}),e.jsx(ee,{initialValues:U,validationSchema:Y,onSubmit:Z,enableReinitialize:!0,children:({setFieldValue:s,values:N})=>e.jsx(ae,{id:"demo",children:e.jsxs("div",{className:`${t.MyProfile_Details_Section}`,children:[e.jsxs("div",{className:`mb-2 mb-md-3 mt-2 mt-md-3 mt-lg-4 ${t.select_wrapper}`,children:[e.jsxs("label",{className:"form-label mb-0",htmlFor:"name",children:[" ","Title*"," "]}),e.jsx("div",{className:`${t.MyProfileInputStyle_div}`,children:e.jsx(r,{className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title}`,type:"text",name:"title",as:"select",autoComplete:"off",children:I&&I.map(l=>e.jsxs("option",{value:l.title,children:["Â ",l.title]},l._id))})}),e.jsx(m,{className:"text-danger",name:"title",component:"div"})]}),e.jsxs("div",{className:"mb-2 mb-md-3 mt-2 mt-md-3 mt-lg-4",children:[e.jsxs("label",{className:"form-label mb-0",htmlFor:"name",children:[" ","Full Name*"," "]}),e.jsx("div",{className:`${t.MyProfileInputStyle_div}`,children:e.jsx(r,{type:"text",className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title}`,name:"name",autoComplete:"off"})}),e.jsx(m,{className:"text-danger",name:"name",component:"div"})]}),e.jsxs("div",{className:`mb-2 mb-md-3 mt-2 mt-md-3 mt-lg-4 ${t.datepicker_container}`,children:[e.jsx("label",{className:"",children:"Date of Birth*"}),e.jsx("div",{className:`px-0 bg-transparent ${t.MyProfileInputStyle_div}`,children:e.jsx("div",{className:`${t.datePickerField}`,htmlFor:"dob",children:e.jsx(r,{name:"dob",children:({field:l,form:f,meta:h})=>e.jsx(te,{...l,className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title} ${t.aaaaa}`,name:"dob",placeholder:"",clearIcon:null,format:"dd/MM/yyyy",minDate:w,maxDate:c,onChange:x=>{s("dob",x)}})})})}),e.jsx(m,{className:"text-danger",name:"dob",component:"div"})]}),e.jsxs("div",{className:`mb-2 mb-md-3 mt-2 mt-md-3 mt-lg-4 ${t.select_wrapper}`,children:[e.jsxs("label",{className:"form-label px-0 mb-0",htmlFor:"gender",children:[" ","Gender*"," "]}),e.jsx("div",{className:`${t.MyProfileInputStyle_div}`,children:e.jsxs(r,{as:"select",name:"gender",autoComplete:"off",className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title}`,children:[e.jsx("option",{value:"M",children:"Â Male"}),e.jsx("option",{value:"F",children:"Â Female"}),e.jsx("option",{value:"O",children:"Â Other"})]})}),e.jsx(m,{name:"gender",component:"div",className:"text-danger"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"form-label mb-0",htmlFor:"relation",children:[" ","Relation*"," "]}),e.jsx("div",{className:`${t.MyProfileInputStyle_div}`,children:e.jsx(r,{name:"relation",autoComplete:"off",className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title}`,readOnly:!0})}),e.jsx(m,{name:"relation",component:"div",className:"text-danger"})]}),e.jsxs("div",{className:"mb-2 mb-md-3 mt-2 mt-md-3 mt-lg-4",children:[e.jsx("label",{className:"form-label mb-0",htmlFor:"email",children:"Email Address*"}),e.jsx("div",{className:`${t.MyProfileInputStyle_div}`,children:e.jsx(r,{type:"email",id:"email",name:"email",autoComplete:"off",className:`form-control px-0 bg-transparent ${t.MyProfileInputStyle_title}`})}),e.jsx(m,{name:"email",component:"div",className:"text-danger"})]})]})})})]})]}),e.jsx("div",{className:`${t.DeleteProfile_Section}`,onClick:L,children:e.jsxs("div",{className:`${t.DeleteProfile}`,children:[e.jsx("span",{className:"far fa-trash-alt",children:" "}),e.jsx("span",{className:"",children:" Delete account "})]})}),e.jsx(le,{show:z,handleClose:M,children:e.jsx(oe,{handleCloseModal:M})})]})]})}export{fe 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.