(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8220],{48289:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register/emailVerified",function(){return i(56386)}])},56386:function(e,t,i){"use strict";i.r(t);var n=i(85893),r=i(41664),a=i.n(r),o=i(67294),l=i(99226),s=i(15861),d=i(90948),c=i(2734),u=i(98396),x=i(81805),m=i(87066),h=i(11163),p=i(86501),g=i(81406),f=i(11057),v=i(98456);(0,d.ZP)("img")(e=>{let{theme:t}=e;return{zIndex:2,maxHeight:650,marginTop:t.spacing(12),marginBottom:t.spacing(12),[t.breakpoints.down(1540)]:{maxHeight:550},[t.breakpoints.down("lg")]:{maxHeight:500}}}),(0,d.ZP)(l.Z)(e=>{let{theme:t}=e;return{width:"100%",[t.breakpoints.up("md")]:{maxWidth:450},[t.breakpoints.up("lg")]:{maxWidth:600},[t.breakpoints.up("xl")]:{maxWidth:750}}}),(0,d.ZP)(a())(e=>{let{theme:t}=e;return{display:"flex",alignItems:"center",textDecoration:"none",justifyContent:"center",color:t.palette.primary.main,fontSize:t.typography.body1.fontSize}});let EmailVerified=()=>{let e=(0,c.Z)(),[t,i]=(0,o.useState)(5),[r,a]=(0,o.useState)(!1),[d,x]=(0,o.useState)(),y=(0,h.useRouter)();(0,u.Z)(e.breakpoints.down("md"));let{token:j,email:Z}=y.query;(0,o.useEffect)(()=>{let e;let fetchDataAndStartTimer=async()=>{try{if(j&&Z){let e=await m.Z.post("".concat(g.Ao,"/api/organization/verifyOrg"),{token:j,emailId:Z});200===e.status&&x(e.data)}}catch(e){var n,o;a(!0),p.ZP.error((null===(o=e.response)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:n.message)||"An error occurred",{duration:2e3})}r||(null==d?void 0:d.isPaymentDone)||(null==d?void 0:d.isExpired)||!(t>0)||(e=setInterval(()=>{i(e=>e-1)},1e3))};return fetchDataAndStartTimer(),()=>clearInterval(e)},[j,Z,r]),console.log(d,"dataaa"),(0,o.useEffect)(()=>{r||0!==t||!d||(null==d?void 0:d.isPaymentDone)||(null==d?void 0:d.isExpired)||p.ZP.success("Successfully verified your account!",{duration:1e3})},[r,t,y,d]);let b=Math.max(0,Math.min(t,100));return(0,n.jsxs)(l.Z,{className:"content",sx:{background:"white",height:"100vh"},children:[(0,n.jsx)(l.Z,{sx:{p:[6],display:"flex",alignItems:"center",justifyContent:"end"}}),(0,n.jsx)(l.Z,{sx:{p:[6],display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(l.Z,{className:"content",sx:{height:"80vh",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsxs)(l.Z,{sx:{width:"100%",maxWidth:600,textAlign:"center"},children:[(0,n.jsx)("img",{width:"180",alt:"logo",src:"/images/logos/logo-chataak.jpg"}),(0,n.jsxs)(l.Z,{sx:{boxShadow:5,bgcolor:e=>"dark"===e.palette.mode?"#101010":"#fff",color:e=>"dark"===e.palette.mode?"grey.300":"grey.800",p:10,borderRadius:2,textAlign:"center",fontSize:"0.875rem",fontWeight:"700",minHeight:"200px",minWidth:"600px",alignContent:"center",marginTop:"10px"},children:[!r&&(null==d?void 0:d.verified)&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.Z,{sx:{color:"text.secondary",fontSize:"1rem",lineHeight:1.5,marginTop:"10px"},children:null==d?void 0:d.message})}),(null==d?void 0:d.verified)===!1&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(s.Z,{sx:{color:"text.secondary",fontSize:"1rem",lineHeight:1.5,marginTop:"10px"},children:null==d?void 0:d.message})}),t>0&&!r&&(null==d?void 0:d.verified)&&(0,n.jsxs)(l.Z,{sx:{position:"relative",display:"inline-flex",marginTop:"10px"},children:[(0,n.jsx)(v.Z,{value:b}),(0,n.jsx)(l.Z,{sx:{top:0,left:0,bottom:0,right:0,position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(s.Z,{sx:{color:"text.secondary",fontSize:"1rem",lineHeight:1.5},children:"".concat(Math.round(b))})})]}),t<=0&&!r&&(null==d?void 0:d.verified)&&(0,n.jsx)(f.Z,{variant:"contained",sx:{"& svg":{mr:2},borderColor:"#ddd",color:"white",marginTop:"20px"},onClick:()=>{y.push("https://chataak.in/")},children:"Explore"})]})]})})})]})};EmailVerified.getLayout=e=>(0,n.jsx)(x.Z,{children:e}),EmailVerified.guestGuard=!0,t.default=EmailVerified}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=48289)}),_N_E=e.O()}]);