1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8954,8777],{88776:function(e,t,s){var a=s(85893);s(67294);var l=s(50657),r=s(33090),n=s(6514),o=s(93946),i=s(50594);let d=e=>{let{open:t,handleClose:s,title:d,content:c,actions:m,fullWidth:u=!0,maxWidth:h="sm"}=e;return(0,a.jsxs)(l.Z,{open:t,maxWidth:h,fullWidth:u,onClose:(e,t)=>{"backdropClick"!==t&&s()},children:[(0,a.jsx)(r.Z,{children:(0,a.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,a.jsxs)("b",{className:"text-primary",children:[" ",d]}),(0,a.jsx)(o.Z,{onClick:s,color:"error","aria-label":"Close",size:"small",children:(0,a.jsx)(i.Z,{})})]})}),(0,a.jsx)(n.Z,{children:(0,a.jsx)("div",{children:c})})]})};t.Z=d},78954:function(e,t,s){s.r(t);var a=s(85893),l=s(67294),r=s(43495),n=s(88777),o=s(76414),i=s(68015),d=s(15268),c=s(85574),m=s(82940),u=s(88776);let h={hidden:{opacity:0},visible:{opacity:1,transition:{when:"beforeChildren",staggerChildren:.1}}},x={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:100,damping:12}}},p=e=>{let{toggleAuthView:t,LoginRedirection:s,isRegistered:p,handleToggle:g,addressCount:b,userId:f,validationError:j,handleChange:y,handleFileChange:w,formData:N,setIsModalOpen:C,isModalOpen:v,formErrors:k,handleSendOtp:_,referalCode:S,setReferalCode:I,shippingStatus:P,schemeData:T,isSubmit:B}=e,[A,O]=(0,l.useState)([]),{jboId:E}=(0,i.useJobId)(),{token:L,userDetails:F}=(0,l.useContext)(c.UserContext),Z=(0,m.b)(),[R,U]=(0,l.useState)([]),[D,M]=(0,l.useState)(""),[z,J]=(0,l.useState)({open:!1,title:"",imageUrl:""}),V=e=>String(e.address_id),W=async()=>{let e={data:{client_id:E,jbo_id:E}},t={data:JSON.stringify(e.data)};try{let s=await Z.post("user/viewEmployeeReferalCode",t);1==s.data.status&&O(s.data.data)}catch(n){var a;let l={data:JSON.stringify(e.data)},r=(null==n?void 0:null===(a=n.response)||void 0===a?void 0:a.data)?n.response.data:"";(0,d.Z)({job_id:E,endpoint:"settings/payOverCounterAddress",payload:l,responseData:r,errorMsg:n})}},G=async()=>{let e={data:{jbo_id:E},token:L||""};try{let t=await Z.post("/settings/getBranchOptions",e);if(1===t.data.status){let s=t.data.data||[];U(s),s.length>0&&M(String(s[0].address_id))}}catch(r){var a;let l=(null==r?void 0:null===(a=r.response)||void 0===a?void 0:a.data)?r.response.data:"";(0,d.Z)({job_id:E,endpoint:"/settings/getBranchOptions",payload:e,responseData:l,errorMsg:r})}},[q,H]=(0,l.useState)(S||""),$=e=>{let t=e.target.value;"function"==typeof I?I(t):H(t)};(0,l.useEffect)(()=>{W(),G()},[]),(0,l.useEffect)(()=>{if(R.length>0&&!D){let e=R[0];M(V(e))}},[R,D]);let X=(e,t)=>{J({open:!0,title:e,imageUrl:t})},K=()=>{J({open:!1,title:"",imageUrl:""})};return(0,a.jsxs)(a.Fragment,{children:[v&&(0,a.jsx)(r.E.div,{variants:h,className:"fixed inset-0 bg-gray-700 bg-opacity-75 overflow-y-auto h-full w-full",style:{zIndex:1e3},children:(0,a.jsx)("div",{className:"flex justify-center items-center min-h-screen",children:"null"===f||j?(0,a.jsxs)("div",{className:"relative bg-white p-6 rounded-lg shadow-lg mx-4 md:mx-auto max-w-[80rem] w-full",children:[(0,a.jsx)("button",{onClick:()=>C(!1),className:"absolute top-3 right-3 text-gray-600 hover:text-gray-900",children:(0,a.jsx)("svg",{xmlns:"https://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),p?(0,a.jsx)(o.default,{dataValue:s,onRegisterClick:t,headingTag:"h2"}):(0,a.jsx)(n.default,{dataValue:s,onRegisterClick:t,headingTag:"h2"})]}):(0,a.jsxs)("div",{className:"relative bg-white p-6 rounded-lg shadow-lg mx-4 md:mx-auto max-w-5xl w-full",children:[(0,a.jsx)("button",{onClick:()=>C(!1),className:"absolute top-3 right-3 text-gray-600 hover:text-gray-900",children:(0,a.jsx)("svg",{xmlns:"https://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),(0,a.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Enter Your Details"}),(0,a.jsx)(r.E.div,{variants:x,className:"overflow-y-auto max-h-[48rem] scrollbar-thumb-gray-500 scrollbar-track-gray-100 scrollbar-thin",children:(0,a.jsxs)("form",{className:"space-y-4 p-2",children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"name",children:"Name:"}),(0,a.jsx)("input",{type:"text",name:"name",value:N.name,onChange:y,className:"w-full border rounded px-3 py-1"}),k.name&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.name})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"email",children:"Email:"}),(0,a.jsx)("input",{type:"email",name:"email",value:N.email,onChange:y,className:"w-full border rounded px-3 py-1"}),k.email&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.email})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"mobile",children:"Mobile:"}),(0,a.jsx)("input",{type:"text",name:"mobile",value:N.mobile,onChange:y,className:"w-full border rounded px-3 py-1"}),k.mobile&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.mobile})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"address",children:"Address:"}),(0,a.jsx)("textarea",{name:"address",value:N.address,onChange:y,className:"w-full border rounded px-3 py-1"}),k.address&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.address})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"landmark",children:"Landmark:"}),(0,a.jsx)("input",{type:"text",name:"landmark",value:N.landmark,onChange:y,className:"w-full border rounded px-3 py-1"}),k.landmark&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.landmark})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"city",children:"City:"}),(0,a.jsx)("input",{type:"text",name:"city",value:N.city,onChange:y,className:"w-full border rounded px-3 py-1"}),k.city&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.city})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"state",children:"State:"}),(0,a.jsx)("input",{type:"text",name:"state",value:N.state,onChange:y,className:"w-full border rounded px-3 py-1"}),k.state&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.state})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"country",children:"Country:"}),(0,a.jsx)("input",{type:"text",name:"country",value:N.country,onChange:y,className:"w-full border rounded px-3 py-1"}),k.country&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.country})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"pincode",children:"Pincode:"}),(0,a.jsx)("input",{type:"text",name:"pincode",value:N.pincode,onChange:y,className:"w-full border rounded px-3 py-1"}),k.pincode&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.pincode})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex justify-center items-center mr-2 rounded bg-gray-200 ".concat(N.showAadhar?"bg-blue-500":""," cursor-pointer"),onClick:()=>g("showAadhar"),children:N.showAadhar&&(0,a.jsx)("svg",{className:"fill-current text-blue-600 w-4 h-4",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M7.629 15.183L3.797 11.35l1.414-1.414 2.418 2.418L14.789 4.394l1.414 1.414z"})})}),(0,a.jsx)("label",{htmlFor:"aadharCheckbox",className:"flex-grow cursor-pointer",onClick:()=>g("showAadhar"),children:"Aadhar Details"}),(0,a.jsx)("input",{name:"aadharCheckbox",type:"checkbox",className:"hidden",checked:N.showAadhar,value:N.aadharNo,onChange:y})]}),N.showAadhar&&(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"aadharNo",className:"block mb-1",children:"Aadhar No"}),(0,a.jsx)("input",{type:"text",name:"aadharNo",className:"w-full border rounded px-3 py-1",placeholder:"Aadhar number",value:N.aadharNo,onChange:y}),k.aadharNo&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.aadharNo})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"aadharImage",className:"block mb-1",children:"Aadhar Image"}),(0,a.jsx)("input",{type:"file",name:"aadharImage",className:"w-full border rounded px-3 py-1",onChange:w}),"string"==typeof N.aadharImage&&N.aadharImage.trim()?(0,a.jsx)("button",{type:"button",onClick:()=>X("Uploaded Aadhaar Document",N.aadharImage),className:"mt-2 inline-block text-sm font-medium text-blue-600 underline",children:"Preview uploaded Aadhaar"}):null,k.aadharImage&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.aadharImage})]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center mb-4",children:[(0,a.jsx)("div",{className:"w-6 h-6 flex justify-center items-center mr-2 rounded bg-gray-200 ".concat(N.showPAN?"bg-blue-500":""," cursor-pointer"),onClick:()=>g("showPAN"),children:N.showPAN&&(0,a.jsx)("svg",{className:"fill-current text-blue-600 w-4 h-4",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M7.629 15.183L3.797 11.35l1.414-1.414 2.418 2.418L14.789 4.394l1.414 1.414z"})})}),(0,a.jsx)("label",{htmlFor:"panCheckbox",className:"flex-grow cursor-pointer",onClick:()=>g("showPAN"),children:"PAN Details"}),(0,a.jsx)("input",{name:"panCheckbox",type:"checkbox",className:"hidden",checked:N.showPAN,value:N.panNo,onChange:y})]}),N.showPAN&&(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"panNo",className:"block mb-1",children:"PAN No"}),(0,a.jsx)("input",{type:"text",name:"panNo",className:"w-full border rounded px-3 py-1",placeholder:"PAN number",value:N.panNo,onChange:y}),k.panNo&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.panNo})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"panImage",className:"block mb-1",children:"PAN Image"}),(0,a.jsx)("input",{type:"file",name:"panImage",className:"w-full border rounded px-3 py-1",onChange:w}),"string"==typeof N.panImage&&N.panImage.trim()?(0,a.jsx)("button",{type:"button",onClick:()=>X("Uploaded PAN Document",N.panImage),className:"mt-2 inline-block text-sm font-medium text-blue-600 underline",children:"Preview uploaded PAN"}):null,k.panImage&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.panImage})]})]})]}),k.aadharOrPan&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.aadharOrPan})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"nominee_name",className:"block mb-1",children:"Nominee Name"}),(0,a.jsx)("input",{type:"text",name:"nominee_name",className:"w-full border rounded px-3 py-1",placeholder:"Enter Nominee Name",maxLength:50,value:null==N?void 0:N.nominee_name,onChange:y}),k.nominee_name&&(0,a.jsx)("p",{className:"mt-2 text-sm text-red-500",children:k.nominee_name})]}),(0,a.jsx)("div",{className:"sm:flex sm:justify-between gap-4 mt-3",children:(0,a.jsx)("div",{className:"sm:order-2",children:(0,a.jsx)("div",{children:(null==F?void 0:F.user_t
1ype)!==2&&(null==F?void 0:F.user_type)!==3&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:" mb-2 block",children:["Jewel Consultant Referal Code (Optional)"," ",(0,a.jsx)("span",{className:"text-red-500"})]}),(0,a.jsxs)("select",{name:"referal_code",value:"function"==typeof I?S:q,onChange:$,className:"input-box",children:[(0,a.jsx)("option",{value:"",children:"Select Referal Code"}),A.map((e,t)=>(0,a.jsx)("option",{value:e.jc_referal_code_id,children:e.jc_referal_code},t))]})]})})})}),R.length>1&&(0,a.jsxs)("div",{className:"mb-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Select Branch"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-h-72 overflow-auto",children:R.map(e=>{let t=V(e),s=D===t;return(0,a.jsx)("div",{onClick:()=>M(t),className:"relative bg-white rounded-lg p-3 border cursor-pointer transition-all duration-200 ".concat(s?"border-primary shadow-md":"border-gray-300 hover:border-primary hover:shadow-sm"),children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"branch",checked:s,onChange:()=>M(t),className:"mt-1 text-primary"}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("p",{className:"font-semibold text-sm mb-1",children:e.name})})]})},t)})})]}),(0,a.jsx)("div",{className:"flex justify-between items-center",children:(0,a.jsx)("button",{type:"submit",onClick:e=>{_(e,{referal_code:("function"==typeof I?S:q)||"",branch_address_id:D||""})},className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Submit"})})]})})]})})}),(0,a.jsx)(u.Z,{open:z.open,handleClose:K,title:z.title,maxWidth:"md",content:z.imageUrl?(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("img",{src:z.imageUrl,alt:z.title,className:"max-h-[70vh] w-auto max-w-full rounded-lg object-contain"})}):null})]})};t.default=p},88777:function(e,t,s){s.r(t),s.d(t,{__N_SSP:function(){return E}});var a=s(85893),l=s(67294),r=s(87536),n=s(47533),o=s(16310),i=s(41664),d=s.n(i),c=s(11163);s(25675);var m=s(17913),u=s.n(m),h=s(79458),x=s(89583),p=s(53854),g=s(37351),b=s(85574),f=s(87066),j=s(82940);s(733);var y=s(43812),w=s(73658),N=s(59335),C=s(68015),v=s(15268),k=s(4422),_=s(11837),S=s(14762),I=s(42466);s(86426);var P=s(15643),T=s(6490);let B=y.BUILDER_URL,A=o.Ry().shape({email:o.Z_().email("Invalid email address").matches(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,10}$/,"Invalid email address").required("Email is required"),password:o.Z_().required("Password is required")}),O=e=>{let{dataValue:t,onRegisterClick:s,serverReferrer:o=""}=e,{register:i,handleSubmit:m,formState:{errors:O,isValid:E},reset:L}=(0,r.cI)({resolver:(0,n.X)(A),mode:"onChange"}),[F,Z]=(0,l.useState)(!1),R=(0,k.Z)("Sign In Page"),U=(0,l.useContext)(g.ThemeContext),[D,M]=(0,l.useState)(null),{fetchWishlist:z}=(0,l.useContext)(h.WishlistContext),[J,V]=(0,l.useState)(!0),W=(0,j.b)(),G=(0,c.useRouter)(),{setUserId:q,setToken:H,setUserDetails:$}=(0,l.useContext)(b.UserContext),{isOtpEnb:X}=(0,l.useContext)(T.m),[K,Y]=(0,l.useState)(""),[Q,ee]=(0,l.useState)(""),[et,es]=(0,l.useState)(""),[ea,el]=(0,l.useState)(!0),{jboId:er}=(0,C.useJobId)(),[en,eo]=(0,l.useState)(!1),[ei,ed]=(0,l.useState)({}),[ec,em]=(0,l.useState)(!1),[eu,eh]=(0,l.useState)(!1),[ex,ep]=(0,l.useState)(Array(6).fill("")),[eg,eb]=(0,l.useState)(null),[ef,ej]=(0,l.useState)(null),{login:ey,loading:ew,isGoogleAuth:eN,setIsGoogleAuth:eC,PhoneNumberModals:ev}=(0,I.E)({onOtpVerified:()=>{eh(!0)},setPhoneNumber:ej}),ek=e=>{ed(e),eo(!0)},e_=()=>{eo(!1)},eS=async e=>{eC(!1);try{let t=await W.post("login/userLogin",{phone_no:e});1==t.data.status?(eb(t.data.user_id),ek({type:"success",title:"Success",subText:t.data.msg||"OTP Send Successfully!",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_}),setTimeout(()=>{eh(!0)},3500)):ek({type:"error",title:"Error!",subText:t.data.msg,onConfirm:e_,onClose:e_,autoClose:2,confirmLabel:"Try again..",showConfirmButton:!1,showCancelButton:!1}),em(!1)}catch(s){em(!1),console.log(s),ek({type:"error",title:"Error!",subText:s.message,onConfirm:e_,onClose:e_,autoClose:2,confirmLabel:"Try again..",showConfirmButton:!1,showCancelButton:!1})}},eI=(e,t)=>{"Backspace"===e.key&&t>
10&&!ex[t]&&document.getElementById("otp-input-".concat(t-1)).focus()},eP=e=>{let t=e.clipboardData.getData("text").slice(0,6);/^\d{6}$/.test(t)&&ep(t.split(""))},eT=async()=>{try{let e=await W.post("/login/resendOtp",{login_user_id:eg});1===e.data.status?(ep(Array(6).fill("")),ek({type:"success",title:"Resent",subText:e.data.msg||"OTP Resent Successfully!",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})):ek({type:"error",title:"Error",subText:e.data.msg||"Unable to resend OTP. Please try again.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}catch(t){ek({type:"error",title:"API Error",subText:"Unable to resend OTP. Please try again later.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}},eB=(e,t)=>{let{value:s}=e.target;if(/^\d?$/.test(s)){let a=[...ex];a[t]=s,ep(a),s&&t<ex.length-1&&document.getElementById("otp-input-".concat(t+1)).focus()}},eA=async()=>{let e=ex.join("");try{let t=await W.post("/login/verifyOtp",{otp:e,login_user_id:eg});if(1===t.data.status){eh(!1),ep(Array(6).fill(""));let s=t.data.user_details[0],a={...s,user_type:t.data.user_type};q(t.data.user_details[0].user_id),H(t.data.token),$(a),localStorage.setItem("userId",t.data.user_details[0].user_id),localStorage.setItem("token",t.data.token),localStorage.setItem("userDetails",JSON.stringify(a)),localStorage.setItem("privilegeStatus",t.data.privilege_card||0),window.location.href=o,L(),ek({type:"success",title:"Success",subText:t.data.msg||"OTP Verified Successfully!",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}else ek({type:"error",title:"Error",subText:t.data.msg||"Invalid OTP. Please try again.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}catch(l){ek({type:"error",title:"API Error",subText:"Unable to verify OTP. Please try again later.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}},eO=async()=>{let e=ex.join("");try{let t=await W.post("/login/verifyMobileOtp",{otp:e,phone_no:ef});1===t.data.status?(eh(!1),eC(!1),ep(Array(6).fill("")),ek({type:"success",title:"Success",subText:t.data.msg||"OTP Verified Successfully!",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_}),setTimeout(()=>{G.push("/")},1e3)):ek({type:"error",title:"Error",subText:t.data.msg||"Invalid OTP. Please try again.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}catch(s){ek({type:"error",title:"API Error",subText:"Unable to verify OTP. Please try again later.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}},eE=async()=>{try{let e=await W.post("/login/resendMobileOtp",{phone_no:ef});1===e.data.status?(ep(Array(6).fill("")),ek({type:"success",title:"Resent",subText:e.data.msg||"OTP Resent Successfully!",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})):ek({type:"error",title:"Error",subText:e.data.msg||"Unable to resend OTP. Please try again.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}catch(t){ek({type:"error",title:"API Error",subText:"Unable to resend OTP. Please try again later.",showCloseIcon:!1,showCancelButton:!1,showConfirmButton:!1,autoClose:3,onClose:e_})}},eL=async e=>{el(!1);let{email:t,password:s}=e;try{let a=await W.post("user/user_login",{email:t,password:s,remember:"on"});200===a.status&&setTimeout(()=>{el(!0)},2e3);try{let l=a.data.user_details[0],r={...l,user_type:a.data.user_type};q(a.data.user_details[0].user_id),H(a.data.token),$(r),localStorage.setItem("userId",a.data.user_details[0].user_id),localStorage.setItem("token",a.data.token),localStorage.setItem("userDetails",JSON.stringify(r)),localStorage.setItem("privilegeStatus",a.data.privilege_card||0)}catch(d){var n;let i=(null==d?void 0:null===(n=d.response)||void 0===n?void 0:n.data)?d.response.data:"";(0,v.Z)({job_id:er,endpoint:"user/user_login",payload:{email:t,password:s,remember:"on"},responseData:i,errorMsg:d})}"0"===a.data.status?(el(!0),ek({type:"error",title:"Error!",subText:a.data.message,onConfirm:e_,onClose:e_,autoClose:2,confirmLabel:"Try again",showConfirmButton:!1,showCancelButton:!1})):(window.location.href=o,(0,_.kT)("initialReferrer")),L()}catch(c){(0,v.Z)({job_id:er,endpoint:"user/user_login",payload:"",responseData:"",errorMsg:c}),ek({type:"error",title:"Error!",subText:c.toString(),onConfirm:e_,onClose:e_,confirmLabel:"Try again",showConfirmButton:!1,autoClose:2,showCancelButton:!1})}};return(0,l.useEffect)(()=>{f.Z.get("".concat(B,"/auth-page"),{headers:{Authorization:"Bearer ".concat(U.token)}}).then(e=>{if(e.data&&e.data.length>0){let t=e.data[0];Y(t.website_name),ee(t.website_description),es(t.design_image_url),V(!1)}}).catch(e=>{V(!1)}),W.post("login/viewGoogleAuthuser").then(e=>{if(1==e.data.status){let{enb:t}=e.data.data;M(t)}else console.error("Failed to fetch Google Auth data")}
1).catch(e=>{console.log("Error fetching Google Auth data:",e)}),R()},[U]),(0,a.jsxs)(a.Fragment,{children:[J?(0,a.jsx)("div",{className:"w-full h-screen",children:(0,a.jsx)(w.Z,{})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex justify-center mt-10"}),(0,a.jsx)("div",{className:"flex flex-col md:flex-row justify-center items-center min-h-screen",children:(0,a.jsx)("div",{className:"max-w-[70rem] w-full m-auto md:m-0",children:(0,a.jsx)("div",{className:"items-center lg:py-10 lg:px-4",children:(0,a.jsxs)("div",{className:"m-auto bg-slate-50 rounded-md grid lg:grid-cols-2",children:[(0,a.jsx)("div",{className:"hidden lg:block h-full w-full overflow-hidden",children:(0,a.jsx)("img",{src:(0,y.setImageSrc)(et,""),alt:"Register",className:"sticky top-0 h-full w-full object-cover rounded-md"})}),(0,a.jsxs)("div",{className:"right flex flex-col justify-evenly overflow-y-auto custom-scrollbar max-h-screen",children:[(0,a.jsx)(d(),{href:o,className:"absolute top-0 left-0 mt-4 ml-4 inline-block bg-primary text-white font-bold py-2 px-4 rounded-lg shadow hover:shadow-lg transition duration-300 ease-in-out",children:(0,a.jsx)(x.x_l,{className:"inline-block mr-2"})}),(0,a.jsx)(d(),{href:"/",className:"absolute top-0 right-0 mt-4 inline-block bg-primary text-white font-bold py-2 px-4 rounded-lg shadow hover:shadow-lg transition duration-300 ease-in-out",children:(0,a.jsx)(x.xng,{className:"inline-block",size:20})}),(0,a.jsx)("div",{className:"text-center",children:(0,a.jsxs)("section",{className:"w-full mx-auto flex p-5 flex-col gap-10",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-primary text-4xl font-bold py-4",children:K}),(0,a.jsx)("div",{className:"title overflow-auto py-4",children:(0,a.jsx)("p",{name:Q,className:"w-3/4 mx-auto",dangerouslySetInnerHTML:{__html:Q}})})]}),1==D&&(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsxs)("button",{onClick:ey,className:"flex items-center justify-center w-full max-w-xs px-6 py-3 border-2 border-primary rounded-full shadow-md hover:shadow-lg transition-shadow duration-200 bg-white",children:[(0,a.jsx)("img",{src:"https://cdn-icons-png.flaticon.com/512/2702/2702602.png",alt:"Google",className:"w-6 h-6 mr-3"}),(0,a.jsx)("span",{className:"text-primary font-semibold",children:"SignIn with Google"})]})}),X&&(0,a.jsx)("div",{className:"flex flex-col items-center",children:(0,a.jsxs)("button",{onClick:em,className:"flex items-center justify-center w-full max-w-xs px-6 py-3 border-2 border-primary rounded-full shadow-md hover:shadow-lg transition-shadow duration-200 bg-white",children:[(0,a.jsx)(x.XEH,{className:"h-8 w-8 mr-3 "}),(0,a.jsx)("span",{className:"text-primary font-semibold",children:"SignIn with Mobile OTP"})]})}),(X||1==D)&&(0,a.jsxs)("div",{className:"flex items-center justify-center w-full max-w-xs mx-auto",children:[(0,a.jsx)("div",{className:"border-t border-gray-500 flex-grow"}),(0,a.jsx)("span",{className:"text-gray-500 mx-3 whitespace-nowrap",children:"Or SignIn with Account"}),(0,a.jsx)("div",{className:"border-t border-gray-500 flex-grow"})]}),(0,a.jsx)(ev,{}),(0,a.jsxs)("form",{onSubmit:m(eL),className:"flex flex-col gap-5",children:[(0,a.jsxs)("div",{className:u().input_group,children:[(0,a.jsx)("input",{type:"email",name:"email",placeholder:"Email",className:u().input_text,...i("email")}),(0,a.jsx)("span",{className:"icon flex items-center px-4",children:(0,a.jsx)(p.Swh,{size:25})})]}),O.email&&(0,a.jsx)("span",{className:"error text-error",children:O.email.message}),(0,a.jsxs)("div",{className:u().input_group,children:[(0,a.jsx)("input",{type:F?"text":"password",name:"password",placeholder:"Password",className:u().input_text,...i("password")}),(0,a.jsx)("span",{className:"icon flex items-center px-4",onClick:()=>Z(!F),children:F?(0,a.jsx)(p.y6T,{size:25}):(0,a.jsx)(p.Zp7,{size:25})})]}),O.password&&(0,a.jsx)("span",{className:"error text-error",children:O.password.message}),(0,a.jsx)("div",{className:"text-right",children:(0,a.jsx)(d(),{href:"/auth/ForgotPassword",children:(0,a.jsx)("span",{className:"text-lg text-primary ",children:"Forgot Password?"})})}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 mb-2 mt-2",children:[(0,a.jsx)("input",{id:"subscribe",type:"checkbox",name:"subscribe",defaultChecked:!0,className:"rounded text-primary focus:border-transparent ring-0 mt-1",...i("subscribe")}),(0,a.jsx)("label",{htmlFor:"subscribe",className:"mt-2 text-gray-500",children:"Remember me"})]}),(0,a.jsx)("div",{className:"input-button",children:(0,a.jsx)("button",{type:"submit",className:"font-bold ".concat(u().button," ").concat(E?"":"opacity-50 cursor-not-allowed"),disabled:!E,children:(0,a.jsx)("div",{className:"flex justify-center gap-2 items-center",children:ea?"Login":(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.Spinner,{color:"primary",className:"h-6 w-6"})," ",(0,a.jsx)("span",{children:" Login "})]})})})})]}),"1"!==t?(0,a.jsxs)("p",{className:"text-center text-gray-400",children:["don't have an account yet?",(0,a.jsx)(d(),{href:"/auth/Register",children:(0,a.jsx)("span",{className:"text-primary",children:" Sign Up"})})]}):(0,a.jsxs)("p",{className:"text-center text-gray-400",children:["don't have an account yet?",(0,a.jsxs)("a",{onClick:()=>
1s(),className:"text-primary cursor-pointer",children:[" ","Sign Up"]})]})]})})]})]})})})})]}),(0,a.jsx)(P.Z,{isOpen:ec,onClose:()=>em(!1),onSubmit:eS}),eu&&(0,a.jsx)("div",{onPaste:eP,className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full p-6 relative",children:[(0,a.jsx)("button",{onClick:()=>{eh(!1),ep(Array(6).fill(""))},className:"absolute top-3 right-3 text-red-500 focus:outline-none",children:(0,a.jsx)(x.aHS,{className:"text-lg"})}),(0,a.jsx)("h2",{className:"text-lg font-bold text-center",children:"Verify OTP"}),(0,a.jsx)("p",{className:"text-sm text-gray-600 text-center",children:"Enter the OTP sent to your mobile number."}),(0,a.jsx)("div",{className:"flex justify-center space-x-2 mt-4",children:Array.from({length:6}).map((e,t)=>(0,a.jsx)("input",{id:"otp-input-".concat(t),type:"text",maxLength:"1",className:"w-10 h-10 border border-gray-300 rounded-md text-center text-lg font-semibold focus:ring-2 focus:ring-primary",value:ex[t],onChange:e=>eB(e,t),onKeyDown:e=>eI(e,t)},t))}),(0,a.jsx)("button",{onClick:eN?eO:eA,className:"w-full mt-4 bg-primary text-white p-2 rounded-md hover:bg-primary-dark transition",children:"Verify OTP"}),(0,a.jsxs)("div",{className:"text-center mt-3",children:[(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Didnât receive the OTP?"}),(0,a.jsx)("button",{onClick:eN?eE:eT,className:"mt-2 text-primary font-semibold hover:underline",children:"Resend OTP"})]})]})}),(0,a.jsx)(S.Z,{isOpen:en,type:ei.type,title:ei.title,subText:ei.subText,onConfirm:ei.onConfirm,onClose:ei.onClose,autoClose:ei.autoClose,confirmLabel:ei.confirmLabel,cancelLabel:ei.cancelLabel,showConfirmButton:ei.showConfirmButton,showCancelButton:ei.showCancelButton,showCloseIcon:ei.showCloseIcon})]})};var E=!0;t.default=O}}]);
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.