(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5271,6905],{9172:function(e,t,r){Promise.resolve().then(r.bind(r,8811))},2389:function(e,t,r){"use strict";var s=r(7437);r(2265),t.Z=e=>{let{children:t,size:r="md",color:l="blue",width:a="auto",shape:n="rounded-md",...i}=e;return(0,s.jsx)("button",{className:"".concat(n," font-poppins ").concat({full:"w-full",auto:"w-full max-w-[100px] md:max-w-[130px]",fit:"w-fit"}[a]," text-center ").concat({sm:"px-3 md:px-5 py-2 sm:py-[9px] text-sm font-medium",md:"px-3.5 md:px-5 py-4 text-sm font-medium",lg:"px-6 py-3 text-base"}[r]," ").concat({green:"bg-primary hover:bg-green-700 text-white border-[1.2px] border-primary disabled:bg-[#1E1E1E4D]",outline:"bg-transparent border border-primary text-primary disabled:bg-[#1E1E1E4D]",outlineGrey:"bg-transparent border-[1.2px] border-grey/50 text-gray-700 disabled:bg-[#1E1E1E4D]/20",red:"bg-red-500 text-white",yellow:"bg-pending text-white"}[l]," disabled:text-[#F8F8F8D9] disabled:cursor-not-allowed disabled:!border-none cursor-pointer whitespace-nowrap"),...i,children:t})}},5740:function(e,t,r){"use strict";var s=r(7437),l=r(7087),a=r(6716),n=r(7913),i=r(2265);t.Z=e=>{let{validationError:t,isValid:r,handleInputChange:o,inputWidth:c,status:m="default",type:d,showPword:u=!1,...p}=e,[f,x]=(0,i.useState)(!1),h=()=>x(!f),g={success:"#06C270",warning:"#FFCC00",danger:"#FF3B3B",default:"#1E1E1E60"}[m];return(0,s.jsxs)("div",{className:"space-y-1 w-full",style:{width:"string"==typeof c?c:"number"==typeof c?"".concat(c,"px"):""},children:[(0,s.jsxs)("div",{className:"flex relative items-center w-full",children:[(0,s.jsx)("input",{type:"password"===d&&f?"text":d,...p,style:{width:"100%",border:"1.5px solid ".concat(g),outline:"none",appearance:"none"}}),u&&f?(0,s.jsx)(l.Z,{className:"absolute right-5 top-1/2 -translate-y-1/2 !text-grey/60 !text-[1.4rem] !z-50 bg-transparent",onClick:h}):u&&!f?(0,s.jsx)(a.Z,{className:"absolute right-5 top-1/2 -translate-y-1/2 !text-grey/60 !text-[1.4rem] !z-50 bg-transparent",onClick:h}):""]}),t&&r&&(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,s.jsx)("span",{className:"flex items-center",children:(0,s.jsx)(n.Z,{sx:{fontSize:"1.2rem",color:"".concat(g)}})}),(0,s.jsx)("p",{style:{color:"".concat(g)},children:t})]})]})}},8811:function(e,t,r){"use strict";var s=r(7437),l=r(7138),a=r(2265),n=r(5740),i=r(2389),o=r(5219),c=r(6648),m=r(4531),d=r(3345);t.default=()=>{let e=(0,o.useRouter)(),[t,r]=(0,a.useState)({email:"",password:"",firstName:"",lastName:"",phoneNumber:"",gender:"male"}),[u,p]=(0,a.useState)({emailError:"",passwordError:"",internetError:"",successError:""}),[f,x]=(0,a.useState)(!0),[h,g]=(0,a.useState)(!1),A=e=>{let{target:{name:s,value:l}}=e;r(e=>({...e,[s]:l})),x(!t.email||!t.password)};(0,a.useEffect)(()=>{""===t.email||""===t.password||""===t.firstName||""===t.lastName||""===t.phoneNumber?x(!0):x(!1)},[t.password,t.email,t.firstName,t.lastName,t.phoneNumber]);let b=e=>{if(navigator.onLine||p(e=>({...e,internetError:"No internet connection"})),!t.email.trim()){p(e=>({...e,emailError:"Email field cannot be empty"}));return}if(!t.password.trim()){p(e=>({...e,passwordError:"Password field cannot be empty"}));return}setTimeout(()=>{p({internetError:"",emailError:"",passwordError:"",successError:""})},4e3)},N=async s=>{s.preventDefault(),g(!0);let{email:l,password:a,firstName:n,lastName:i,phoneNumber:o,gender:c}=t;try{let e=await fetch("/api/auth/signup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,password:a,first_name:n,last_name:i,phone_number:o,gender:c})});if(!e.ok){let t=await e.json();b(t),p(e=>({...e,emailError:t.message}));return}r({email:"",password:"",firstName:"",lastName:"",phoneNumber:"",gender:"male"}),p(e=>({...e,successError:"Account Created Successfully."}))}catch(e){b(e)}finally{g(!1),setTimeout(()=>{e.push("/"),p({internetError:"",emailError:"",passwordError:"",successError:""})},4e3)}};return(0,s.jsxs)("div",{className:"flex flex-col justify-center items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center w-full md:w-[400px]",children:[(0,s.jsx)(l.default,{href:"/",className:"w-28 mb-4",children:(0,s.jsx)(c.default,{src:m.Z,alt:"Logo",width:"100",height:"100",className:"w-full h-full object-cover cursor-pointer"})}),(0,s.jsx)("span",{className:"text-dark font-poppins font-bold text-[20px] sm:text-[28px] text-center max-w-[466px]",children:"Welcome to Socio"}),(0,s.jsx)("span",{className:"text-grey/60 font-poppins font-normal text-sm md:text-base text-center !mb-2 sm:!mb-3 w-[88%]",children:"Africa and Asia largest social network. Connect with your family and friends."})]}),u.internetError&&(0,s.jsx)("span",{className:"flex items-center gap-x-1 text-sm font-poppins font-semibold text-[#C73E1D] capitalize mt-2 mb-5",children:u.internetError}),u.successError&&(0,s.jsx)("span",{className:"flex items-center gap-x-1 text-sm font-roboto font-semibold text-primary capitalize mt-2 mb-5",children:u.successError}),u.emailError&&(0,s.jsx)("span",{className:"flex items-center gap-x-1 text-sm font-poppins font-semibold text-[#C73E1D] capitalize mt-2 mb-5",children:u.emailError}),u.passwordError&&(0,s.jsx)("span",{className:"flex items-center gap-x-1 text-sm font-poppins font-semibold text-[#C73E1D] capitalize mt-2 mb-5",children:u.passwordError}),(0,s.jsx)("div",{className:"flex flex-col space-y-5 w-[92%] md:w-auto rounded-3xl transition-all duration-300",children:(0,s.jsxs)("form",{onSubmit:N,className:"flex flex-col mx-auto gap-y-5 w-full md:w-[490px]",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-center w-full space-x-0 space-y-4 sm:space-y-0 sm:space-x-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,s.jsx)("label",{htmlFor:"firstName",className:"font-medium font-poppins text-sm text-dark/60",children:"First Name"}),(0,s.jsx)(n.Z,{type:"text",name:"firstName",value:t.firstName,onChange:A,placeholder:"Enter First Name",required:!0,className:"input"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,s.jsx)("label",{htmlFor:"lastName",className:"font-medium font-poppins text-sm text-dark/60",children:"Last Name"}),(0,s.jsx)(n.Z,{type:"text",name:"lastName",value:t.lastName,onChange:A,placeholder:"Enter Last Name",required:!0,className:"input"})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{htmlFor:"email",className:"font-medium font-poppins text-sm text-dark/60",children:"Email"}),(0,s.jsx)(n.Z,{type:"text",name:"email",value:t.email,onChange:A,placeholder:"Enter Email",required:!0,className:"input"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{htmlFor:"phoneNumber",className:"font-medium font-poppins text-sm text-dark/60",children:"Phone Number"}),(0,s.jsx)(n.Z,{type:"tel",name:"phoneNumber",value:t.phoneNumber,onChange:A,placeholder:"Enter Phone Number",required:!0,className:"input"})]}),(0,s.jsx)("div",{className:"flex flex-col gap-2 h-full",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,s.jsx)("label",{htmlFor:"gender",className:"font-medium font-poppins text-sm text-dark/60",children:"Gender"}),(0,s.jsxs)("select",{value:t.gender,name:"gender",onChange:A,required:!0,className:"flex items-center px-2 sm:px-2.5 py-3.5 rounded-xl bg-transparent !border-[#D0D5DD] font-inter font-normal h-full outline-none border-[1.5px] border-dark/60 w-full text-xs sm:text-sm placeholder:text-xs sm:placeholder:text-sm placeholder:text-grey/60 first-letter:!uppercase text-grey/60",children:[(0,s.jsx)("option",{value:"male",className:"h-full",children:"Male"}),(0,s.jsx)("option",{value:"female",className:"h-full",children:"Female"})]})]})}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("label",{htmlFor:"password",className:"font-medium font-poppins text-sm text-dark/60",children:"Password"}),(0,s.jsx)(n.Z,{type:"password",name:"password",showPword:!0,value:t.password,onChange:A,placeholder:"Enter Password",required:!0,className:"input"})]}),(0,s.jsx)(i.Z,{shape:"rounded-full",size:"md",width:"full",type:"submit",color:"green",disabled:f||h,children:h?"Signing Up...":"Sign Up"}),(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-1 font-medium font-poppins text-grey/60 text-sm",children:[(0,s.jsx)("span",{children:"Already have an account?"}),(0,s.jsx)(l.default,{className:"text-primary/70 underline underline-offset-2",href:"/auth/signin",children:"Login here"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-2 text-xs",children:[(0,s.jsx)("span",{className:"w-full bg-grey/40 h-[0.5px]"}),(0,s.jsx)("span",{className:"",children:"OR"}),(0,s.jsx)("span",{className:"w-full bg-grey/40 h-[0.5px]"})]}),(0,s.jsx)(i.Z,{shape:"rounded-full",size:"md",width:"full",type:"button",color:"outlineGrey",disabled:!0,children:(0,s.jsxs)("div",{className:"flex items-center justify-center space-x-4 font-poppins",children:[(0,s.jsx)("span",{className:"text-sm",children:"Continue with Google"}),(0,s.jsx)(c.default,{src:d.Z,alt:"google",className:"w-4"})]})})]})})]})}},7913:function(e,t,r){"use strict";var s=r(8708),l=r(7437);t.Z=(0,s.Z)((0,l.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},6716:function(e,t,r){"use strict";var s=r(8708),l=r(7437);t.Z=(0,s.Z)((0,l.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6m-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14M2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13m-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53"}),"VisibilityOffOutlined")},7087:function(e,t,r){"use strict";var s=r(8708),l=r(7437);t.Z=(0,s.Z)((0,l.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}),"VisibilityOutlined")},8708:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var s=r(2988),l=r(2265),a=r(3950),n=r(4839),i=r(6990),o=r(7434).Z,c=r(6463),m=r(9445),d=r(2296),u=r(9379);function p(e){return(0,u.ZP)("MuiSvgIcon",e)}(0,d.Z)("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);var f=r(7437);let x=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],h=e=>{let{color:t,fontSize:r,classes:s}=e,l={root:["root","inherit"!==t&&"color".concat(o(t)),"fontSize".concat(o(r))]};return(0,i.Z)(l,p,s)},g=(0,m.ZP)("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t["color".concat(o(r.color))],t["fontSize".concat(o(r.fontSize))]]}})(e=>{var t,r,s,l,a,n,i,o,c,m,d,u,p;let{theme:f,ownerState:x}=e;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:x.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(t=f.transitions)||null==(r=t.create)?void 0:r.call(t,"fill",{duration:null==(s=f.transitions)||null==(s=s.duration)?void 0:s.shorter}),fontSize:({inherit:"inherit",small:(null==(l=f.typography)||null==(a=l.pxToRem)?void 0:a.call(l,20))||"1.25rem",medium:(null==(n=f.typography)||null==(i=n.pxToRem)?void 0:i.call(n,24))||"1.5rem",large:(null==(o=f.typography)||null==(c=o.pxToRem)?void 0:c.call(o,35))||"2.1875rem"})[x.fontSize],color:null!=(m=null==(d=(f.vars||f).palette)||null==(d=d[x.color])?void 0:d.main)?m:({action:null==(u=(f.vars||f).palette)||null==(u=u.action)?void 0:u.active,disabled:null==(p=(f.vars||f).palette)||null==(p=p.action)?void 0:p.disabled,inherit:void 0})[x.color]}}),A=l.forwardRef(function(e,t){let r=(0,c.i)({props:e,name:"MuiSvgIcon"}),{children:i,className:o,color:m="inherit",component:d="svg",fontSize:u="medium",htmlColor:p,inheritViewBox:A=!1,titleAccess:b,viewBox:N="0 0 24 24"}=r,w=(0,a.Z)(r,x),y=l.isValidElement(i)&&"svg"===i.type,v=(0,s.Z)({},r,{color:m,component:d,fontSize:u,instanceFontSize:e.fontSize,inheritViewBox:A,viewBox:N,hasSvgAsChild:y}),j={};A||(j.viewBox=N);let E=h(v);return(0,f.jsxs)(g,(0,s.Z)({as:d,className:(0,n.Z)(E.root,o),focusable:"false",color:p,"aria-hidden":!b||void 0,role:b?"img":void 0,ref:t},j,w,y&&i.props,{ownerState:v,children:[y?i.props.children:i,b?(0,f.jsx)("title",{children:b}):null]}))});function b(e,t){function r(r,l){return(0,f.jsx)(A,(0,s.Z)({"data-testid":"".concat(t,"Icon"),ref:l},r,{children:e}))}return r.muiName=A.muiName,l.memo(l.forwardRef(r))}A.muiName="SvgIcon"},6648:function(e,t,r){"use strict";r.d(t,{default:function(){return l.a}});var s=r(5601),l=r.n(s)},5219:function(e,t,r){"use strict";var s=r(1169);r.o(s,"redirect")&&r.d(t,{redirect:function(){return s.redirect}}),r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}})},5601:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return o},getImageProps:function(){return i}});let s=r(9920),l=r(497),a=r(8173),n=s._(r(1241));function i(e){let{props:t}=(0,l.getImgProps)(e,{defaultLoader:n.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let o=a.Image},3345:function(e,t){"use strict";t.Z={src:"/_next/static/media/google.a70eb2c0.png",height:22,width:23,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAZlBMVEWkYWFfc8r7wABagMILkVjUJi8XnVIaoFrjNilWfb7wuQRbf8PlMyjcOS/iNSfpMiriNCf3lgy1tRoPnlgPn0VYfr4SnU5LiatYfbxZfLoAlVgVmVPgOCzhOi3bKy5FsUv8ViX0Oys+Ml/gAAAAH3RSTlMBJtzTGBij+vu/zvsyYbnWoI6S1zClvPGWqEuup69Hi0JuFwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAEJJREFUeJwdxkcSgCAQAMFBwoKomHP8/yetok8NtvW+qcCm7zp9Dd17kxUlbCGsOUFHTf/soOKEGeRwsigwTmQe+QFfbgKTEf4AIgAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:8}},4531:function(e,t){"use strict";t.Z={src:"/_next/static/media/logo.83d3c436.png",height:86,width:173,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAAM1BMVEVMaXEanFqDkZkNfAV8nnMNfw0IiipyknuIqHYbm1MxnFsXiiYCfwRAo1+Bqm1ukXiAn3Q8fIFFAAAAEXRSTlMAdCNgsEyvPBQXnHi82j9m2WgV93AAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAnSURBVHicY2Bg4OTk4GAAAUYuFj4QzczGK8DCzsDAwMrDzcTPzgAACkMApckCpkoAAAAASUVORK5CYII=",blurWidth:8,blurHeight:4}}},function(e){e.O(0,[6946,7138,8173,2971,7023,1744],function(){return e(e.s=9172)}),_N_E=e.O()}]);