1import{a as p,j as e,G as o,i as c,O as ne,h as m,Q as oe,R as ie,k as h,y as D,I as R,z as G,E as F,U}from"./vendor-mui-CYq-6ego.js";import{u as le,a as de,b as V,c as ce,d as me,e as xe,t as n,f as ue,C as l,g as T,h as H,s as ge,S as pe}from"./index-5sb0ZHD_.js";import{l as Y}from"./lock-UYdubhah.js";import{C as he}from"./Common-MultiSelect-Button-C6NWft2i.js";import{D as fe,P as je}from"./Place-Auto-Complete-Cw6UHncV.js";import{C as _,a as $}from"./check-box-DbTq2mLF.js";import{L as ye}from"./logo-BkSacLXu.js";import{m as be}from"./vendor-motion-BPjkBOu7.js";import"./vendor-three-B82KWFtT.js";import"./vendor-redux-CUeFAPXf.js";import"./vendor-query-C1eo258M.js";import"./debounce-Pq5Phufz.js";const Ce=({buttonList:x,value:w,label:f,onChange:j})=>{const[S,k]=p.useState(w||""),y=(d,g)=>{g!==null&&(k(g),j(g))};return e.jsxs(e.Fragment,{children:[e.jsx(o,{size:{xs:12,sm:12,lg:12,md:12},children:e.jsx(c,{variant:"h6",children:f})}),e.jsx(ne,{value:S,exclusive:!0,onChange:y,"aria-label":"radio button group",className:"mt-2",children:e.jsx(m,{display:"flex",gap:2,flexWrap:"wrap",children:x.map((d,g)=>e.jsx(m,{children:e.jsxs(oe,{value:d.label.toLowerCase(),"aria-label":d.label.toLowerCase(),sx:u=>({py:"3px",px:"8px",border:`1px solid ${u.palette.border.main}`,color:u.palette.border.main,backgroundColor:"transparent","&.Mui-selected":{backgroundColor:u.palette.primary.main,color:"#ffffff","&:hover":{backgroundColor:u.palette.primary.main}},"@media (hover: hover)":{"&:hover":{backgroundColor:u.palette.primary.main,color:"#ffffff"}},"&:active":{backgroundColor:u.palette.primary.main,color:"#ffffff"}}),children:[(d==null?void 0:d.icon)&&e.jsx(d.icon,{className:"h-[16px] w-[16px] mr-1",fontSize:"small"}),d.label]})},g))})})]})},Q=x=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-mars",...x,children:[e.jsx("path",{d:"M16 3h5v5"}),e.jsx("path",{d:"m21 3-6.75 6.75"}),e.jsx("circle",{cx:10,cy:14,r:6})]}),q=x=>e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-venus",...x,children:[e.jsx("path",{d:"M12 15v7"}),e.jsx("path",{d:"M9 19h6"}),e.jsx("circle",{cx:12,cy:9,r:6})]}),ve=()=>{var N,I;const{isDesktop:x}=le(),[w]=de(),f=w.get("code"),{mutateAsync:j,isPending:S}=V({url:"signUp"}),[k,y]=p.useState(!1),d=ce(),g=new Date;g.setFullYear(g.getFullYear()-22);const[u,Z]=p.useState(),[P,J]=p.useState(),[K,X]=p.useState(""),[z,b]=p.useState(""),{data:A,isFetching:we}=me({url:"template/allpolicy",key:["allpolicy"]}),{control:i,reset:ee,handleSubmit:se,setError:te,clearErrors:re,setValue:C,formState:{errors:a}}=xe({resolver:ge(pe),defaultValues:{dateOfBirth:void 0,city:"",confirmPassword:"",password:"",userName:"",emailAddress:"",interestedGender:[],gender:"",country:"IND",terms:0,emailAlert:0,state:"",referralCode:""}}),ae=p.useCallback(async s=>{try{const r={...s,profileImage:"",emailAlert:!s.emailAlert};let t=await j(r);t!=null&&t.status?(X(n.register.success.registerSuccess),setTimeout(()=>{y(!0)},2e3)):ue({text:n.message.error.somethingWentWrong,error:!0})}catch(r){console.log({error:r})}},[j]),{mutateAsync:B}=V({url:"verifyEmailAndUserName",onSuccess:s=>{var r,t;(r=s==null?void 0:s.data)!=null&&r.type&&re((t=s==null?void 0:s.data)==null?void 0:t.type)},onError:s=>{var t,v,L,M,O,W,E;const r=((v=(t=s==null?void 0:s.response)==null?void 0:t.data)==null?void 0:v.field)||((O=(M=(L=s==null?void 0:s.response)==null?void 0:L.data)==null?void 0:M.message)!=null&&O.includes("Email")?"emailAddress":"userName");te(r,{type:"manual",message:((E=(W=s==null?void 0:s.response)==null?void 0:W.data)==null?void 0:E.message)||"In Use"})}});return p.useEffect(()=>{f&&C("referralCode",f||"")},[f]),e.jsxs(o,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",className:"h-full !overflow-y-scroll",children:[e.jsx(o,{size:{xs:12,md:4},children:e.jsxs(be.div,{initial:{opacity:0}
1,animate:{opacity:1},className:`${x?"mb-2":""} motion-safe motion-div`,transition:{duration:.5,ease:"easeOut"},layout:!0,children:[e.jsxs(o,{size:{xs:12,md:12},mb:3,textAlign:"center",children:[e.jsx(m,{display:"flex",justifyContent:"center",marginTop:2,children:e.jsx(ye,{})}),e.jsx(m,{px:4,children:e.jsx(c,{variant:"h6",children:"Letâs meet new people around you."})})]}),e.jsx("form",{onSubmit:se(ae),children:e.jsxs(o,{container:!0,p:3,spacing:2,sx:s=>({backgroundColor:s.palette.background.paper,borderRadius:x?"44px":"0",marginBottom:x?"6px":"0"}),children:[e.jsx(o,{size:{xs:12,md:12},children:e.jsx(c,{variant:"h3",textAlign:"center",gutterBottom:!0,children:"Register"})}),e.jsx(o,{size:{xs:12,md:12},mt:1,children:e.jsx(l,{name:"userName",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.username,variant:"standard",error:!!a.userName,helperText:(r=a.userName)==null?void 0:r.message,onChange:t=>{const v=t.target.value.replace(/[^a-zA-Z0-9]/g,"");s.onChange(v)},inputProps:{maxLength:25},onBlur:t=>{s.onBlur(),t.target.value&&B({userName:t.target.value})}})}})}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"emailAddress",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.email,variant:"standard",inputProps:{maxLength:100},error:!!a.emailAddress,onBlur:t=>{s.onBlur(),t.target.value&&B({emailAddress:t.target.value})},helperText:(r=a.emailAddress)==null?void 0:r.message})}})}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"password",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.password,type:u?"text":"password",variant:"standard",inputProps:{maxLength:25},error:!!a.password,helperText:(r=a.password)==null?void 0:r.message,slotProps:{input:{endAdornment:e.jsx(D,{position:"end",sx:{mr:1},children:e.jsx(R,{onClick:()=>Z(t=>!t),edge:"end",children:u?e.jsx(G,{fontSize:"small",sx:{width:"16px",height:"16px"}}):e.jsx(F,{fontSize:"small",sx:{width:"16px",height:"16px"}})})})}}})}})}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"confirmPassword",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.confirmPassword,type:P?"text":"password",variant:"standard",inputProps:{maxLength:25},error:!!a.confirmPassword,helperText:(r=a.confirmPassword)==null?void 0:r.message,slotProps:{input:{endAdornment:e.jsx(D,{position:"end",sx:{mb:1,mr:1},children:e.jsx(R,{onClick:()=>J(t=>!t),edge:"end",children:P?e.jsx(G,{fontSize:"small",sx:{width:"16px",height:"16px"}}):e.jsx(F,{fontSize:"small",sx:{width:"16px",height:"16px"}})})})}}})}})}),e.jsxs(o,{size:{xs:12,md:12},children:[e.jsx(l,{name:"gender",control:i,render:({field:s})=>e.jsx(Ce,{label:"I am",buttonList:[{label:"Woman",icon:q},{label:"Man",icon:Q}],value:s.value,onChange:s.onChange})}),a.gender&&e.jsx(c,{sx:{fontSize:"0.7rem",fontWeight:400,marginTop:"4px"},color:"error",children:a.gender.message})]}),e.jsxs(o,{size:{xs:12,md:12},children:[e.jsx(l,{name:"interestedGender",control:i,render:({field:s})=>e.jsx(he,{label:"I am looking for",buttonList:[{label:"Woman",icon:q},{label:"Man",icon:Q}],value:s.value,onChange:s.onChange})}),a.interestedGender&&e.jsx(c,{sx:{fontSize:"0.7rem",fontWeight:400,marginTop:"4px"},color:"error",children:a.interestedGender.message})]}),e.jsxs(m,{children:[e.jsx(l,{name:"dateOfBirth",control:i,render:({field:s})=>e.jsx(fe,{onChange:r=>{s.onChange(new Date(r))},value:s.value})}),a.dateOfBirth&&e.jsx(c,{sx:{fontSize:"0.7rem",fontWeight:400},color:"error",children:a.dateOfBirth.message})]}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"city",control:i,render:({field:s})=>{var r;return e.jsx(je,{error:!!a.city,helperText:(r=a.city)==null?void 0:r.message,value:s.value,placeholder:n.register.label.city,onChange:t=>{s.onChange((t==null?void 0:t.name)||t||""),C("state",t.state||""),C("latitude",t!=null&&t.latitude?t.latitude.toString():""),C("longitude",t!=null&&t.longitude?t.longitude.toString():"")}})}})}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"state",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.state,variant:"standard",inputProps:{maxLength:25},error:!!a.state,helperText:(r=a.state)==null?void 0:r.message,onChange:t=>{s.onChange(t.target.value.replace(/\d/g,""))}})}})}),e.jsx(o,{size:{xs:12,md:12},children:e.jsx(l,{name:"referralCode",control:i,render:({field:s})=>{var r;return e.jsx(h,{...s,className:"w-full",placeholder:n.register.label.referralCodeOptional,variant:"standard",error:!!a.state,inputProps:{maxLength:25},helperText:(r=a.state)==null?void 0:r.message,onChange:t=>{console.log("asdsadas",t.target.value),s.onChange(t.target.value)}})}})}),e.jsxs(o,{size:{xs:12,md:12},children:[e.jsxs(m,{display:"flex",alignItems:"center",children:[e.jsx(l,{name:"terms",control:i,render:({field:s})=>e.jsx(U,{sx:{padding:"0px"},icon:e.jsx($,{}),checkedIcon:e.jsx(_,{}),checked:s.value===1,onChange:r=>s.onChange(r.target.checked?1:0)})}),e.jsxs(c,{variant:"h6",children:["I read & accept Sassy"," ",e.jsx("span",{onClick:()=>b("tos"),style:{color:"#007bff",cursor:"pointer",textDecoration:"underline"},children:n.register.wrapping.termsAndConditions})," "," &"," ",e.jsx("span",{onClick:()=>b("privacyPolicy"),style:{color:"#007bff",cursor:"pointer",textDecoration:"underline"},children:n.register.wrapping.privacyPolicy}),"."]})]}),a.terms&&e.jsx(c,{sx:{fontSize:"0.7rem",fontWeight:400},color:"error",children:a.terms.message})]}),e.jsxs(o,{size:{xs:12,md:12},mt:-2,children:[e.jsxs(m,{display:"flex",alignItems:"center",children:[e.jsx(l,{name:"emailAlert",control:i,render:({field:s})=>e.jsx(U,{sx:{padding:"0px"},icon:e.jsx($,{}),checkedIcon:e.jsx(_,{}),checked:s.value===1,onChange:r=>s.onChange(r.target.checked?1:0)})}),e.jsx(c,{variant:"h6",children:"I would not like to receive Sassy offers and updates"})]}),a.emailAlert&&e.jsx(c,{sx:{fontSize:"0.7rem",fontWeight:400,marginTop:"4px"},color:"error",children:a.emailAlert.message})]}),e.jsxs(o,{size:{sm:12,xs:12,md:12,lg:12},children:[e.jsx(T,{loading:S,successMessage:K,className:"w-full",variant:"contained",title:n.register.title,type:"submit"}),e.jsx(c,{sx:{color:s=>s.palette.text.secondary,fontSize:"14px"},marginTop:2,marginBottom:1,textAlign:"center",gutterBottom:!0,children:n.register.wrapping.alreadyHaveAccount}),e.jsx(T,{className:"w-full",theme:"secondary",variant:"contained",title:n.register.button.login,onClick:()=>d("/login")})]})]})})]})}),e.jsx(H,{icon:Y,handleClose:()=>{d("/login"),y(!1),ee()},buttonText:n.register.button.login,title:n.register.success.registerSuccess+" âï¸",subTitle:n.modal.subtitle.verifyEmail,open:k}),e.jsxs(H,{icon:Y,handleClose:()=>b(""),buttonText:n.register.button.agree,title:z=="tos"?n.legal.label.termsAndConditions:n.legal.label.privacyPolicy,subTitle:"",open:!!z,children:[e.jsx(m,{sx:s=>({color:"#fff",p:3,borderRadius:2,maxHeight:"400px",overflowY:"auto",mt:2,borderColor:s.palette.background.secondary}),className:"border-2",children:e.jsx(m,{mb:5,sx:s=>({"&":{color:s.palette.text.primary},"& *":{color:`${s.palette.text.primary} !important`}}),dangerouslySetInnerHTML:{__html:((I=(N=A==null?void 0:A.data)==null?void 0:N.find(s=>s.templateCode==z))==null?void 0:I.body)||""}})}),e.jsx(m,{display:"flex",justifyContent:"center",gap:2,alignContent:"center",mt:3,children:e.jsx(T,{variant:"contained",theme:"primary",title:n.modal.label.close,onClick:()=>{b("")}})})]})]})},We=ie.memo(ve);export{We 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.