|
Server : Apache/2.4.41 (Ubuntu) System : Linux vmi1525618.contaboserver.net 5.4.0-105-generic #119-Ubuntu SMP Mon Mar 7 18:49:24 UTC 2022 x86_64 User : www-data ( 33) PHP Version : 8.2.12 Disable Function : NONE Directory : /var/www/sbaedu/test.sbaedu.com/static/js/ |
Upload File : |
"use strict";(self.webpackChunktechwind=self.webpackChunktechwind||[]).push([[615],{9172:(e,r,a)=>{a.d(r,{aX:()=>d,c0:()=>c,gF:()=>l,k6:()=>m});var s=a(3402),t=a(4592),n=a(1822);s.Z.defaults.baseURL=n.gA;const o=t.Z.get("icp_authData")?JSON.parse(t.Z.get("icp_authData")):null,i=o?o.token:null,d=async e=>{try{const r=await s.Z.post("/register",e,{headers:{apikey:n.vo,domain:n.nw}});r.data.data;return localStorage.setItem("icp_islogin","true"),r}catch(r){return console.log("Registration failed:",r),r||{status:500,data:{message:"An unexpected error occurred."}}}},l=async e=>{try{return await s.Z.post("/forgot-password",e,{headers:{apikey:n.vo,domain:n.nw}})}catch(r){return r||{status:500,data:{message:"An unexpected error occurred."}}}},c=async e=>{try{return await s.Z.post("/forgot-password-continue",e,{headers:{apikey:n.vo,domain:n.nw}})}catch(r){return r||{status:500,data:{message:"An unexpected error occurred."}}}},m=async e=>{try{return await s.Z.post("/update-profile",e,{headers:{apikey:n.vo,domain:n.nw,token:i}})}catch(r){return r||{status:500,data:{message:"An unexpected error occurred."}}}}},615:(e,r,a)=>{a.r(r),a.d(r,{default:()=>p});var s=a(9867),t=a(4670),n=a(5644),o=a(9172),i=a(3402),d=a(8700),l=a(8057),c=a.n(l),m=a(4436),u=a(8960),g=(a(1461),a(2834));const p=s.memo((function(){const e=(0,m.v9)((e=>e.websiteReducer.data.data.site_logo)),[r,a]=(0,s.useState)({}),[l,p]=(0,s.useState)(null),[x,h]=(0,s.useState)(null),[b,f]=(0,s.useState)(null),[w,y]=(0,s.useState)(null),j=(0,t.s0)(),N=new d.Z,[v,k]=(0,s.useState)({state:!1,title:"",icon:"default",message:""});(0,s.useEffect)((()=>{i.Z.get("https://api.ipify.org?format=json").then((e=>{h(e.data.ip)})).catch((e=>{console.error("Error fetching IP address:",e)}))}),[]);const A=e=>{const r=e.target;return 0===r.value||""===r.value?a((e=>({...e,state:!0,name:r.name,error:"This field is required !"}))):a((e=>({...e,state:!1,name:r.name,error:""})))},_=()=>(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(c(),{show:v.state,title:v.title,type:v.icon,customButtons:(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("div",{className:"flex flex-row justify-between items-center",children:[(0,g.jsx)("div",{children:(0,g.jsx)("button",{onClick:()=>k({state:!1}),className:"bg-blue-700 text-white px-3 py-1 border",sx:{py:1,mr:2},children:"Cancel"})}),(0,g.jsx)("div",{children:w?(0,g.jsx)(n.rU,{to:"/verify-otp",className:" bg-green-500 text-white px-3 py-2 border",sx:{py:1},children:"Login"}):null})]})}),onConfirm:()=>{},children:v.message})});return(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)("section",{className:"md:h-screen py-36 pb-36 flex items-center bg-no-repeat bg-center bg-cover",children:[(0,g.jsx)(u.Ix,{}),(0,g.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent to-black"}),(0,g.jsxs)("div",{className:"container relative lg:mt-24",children:[(0,g.jsx)("div",{className:"flex justify-center",children:(0,g.jsxs)("div",{className:"max-w-[400px] w-full m-auto px-6 bg-white dark:bg-slate-900 shadow-md dark:shadow-gray-800 rounded-md",children:[(0,g.jsx)(n.rU,{to:"/index",children:(0,g.jsx)("img",{src:e||"",className:"mx-auto w-24 pt-6",alt:"logo"})}),(0,g.jsx)("h5",{className:"my-2 text-xl font-semibold",children:"Signup"}),(0,g.jsx)("form",{onSubmit:async e=>{e.preventDefault();const r=e.target,s=r.fullname.value,t=r.email.value,n=r.mobile.value,i=r.password.value,d=r.confirm_password.value,l=r.accept.value;var c=0;if(isNaN(r.mobile.value))return c++,a({state:!1,name:"mobile",error:"Please enter a valid phone number !"});if(i.length<6)return c++,a({state:!1,name:"password",error:"Password must be more than 6 digits"});if(i!==d)return c++,a({state:!1,name:"confirm_password",error:"Password not match !"});if(!l)return c++,a({state:!1,name:"accept",error:"Please tick the checkbox !"});if(0===c){const e={username:s,email:t,phone:n,password:i,c_password:d,ip_address:x},r=await(0,o.aX)(e);if(200===r.status){if(1===r.data.status){f(r.data.data.message_id),y(!0);let e=r.data.data.message_id;console.log(e);const a={username:s,email:t,phone:n,password:i,c_password:d,ip_address:x,message_id:e},o={otp:!0},l=(new Date).getTime()+72e4;N.set("authData",JSON.stringify(a),{maxAge:l}),N.set("icp_otpVerify",JSON.stringify(o),{maxAge:l}),u.Am.success("Verify Your Registration"),setTimeout((function(){u.Am.error("Verify Your Registration")}),1500),N.get("icp_otpVerify")&&j("/verify-otp")}}else{if(0===r.response.data.status){let e=r.response.data.message;y(!1),u.Am.error(e)}if(500===r.response.status){let e=r.response.statusText;y(!1),u.Am.error(e)}}}},className:"text-start",children:(0,g.jsxs)("div",{className:"grid grid-cols-1",children:[(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsx)("label",{className:"font-semibold",htmlFor:"RegisterName",children:"Your Name:"}),(0,g.jsx)("input",{id:"RegisterName",name:"fullname",type:"text",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",placeholder:"Name",onChange:A,required:!0}),(0,g.jsx)("div",{className:"text-red-700",children:"fullname"===r.name?r.error:null})]}),(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsx)("label",{className:"font-semibold",htmlFor:"LoginEmail",children:"Email Address:"}),(0,g.jsx)("input",{id:"LoginEmail",name:"email",type:"email",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",placeholder:"name@example.com",onChange:A,required:!0}),(0,g.jsx)("div",{className:"text-red-700",children:"email"===r.name?r.error:null})]}),(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsx)("label",{className:"font-semibold",htmlFor:"phone",children:"Mobile"}),(0,g.jsx)("input",{id:"mobile",name:"mobile",type:"mobile",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",placeholder:"+91",onChange:A,required:!0}),(0,g.jsx)("div",{className:"text-red-700",children:"mobile"===r.name?r.error:null})]}),(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsx)("label",{className:"font-semibold",htmlFor:"LoginPassword",children:"Password:"}),(0,g.jsx)("input",{id:"LoginPassword",type:"password",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",name:"password",required:!0,placeholder:"*****",onChange:A}),(0,g.jsx)("div",{className:"text-red-700",children:"password"===r.name?r.error:null})]}),(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsx)("label",{className:"font-semibold",htmlFor:"LoginPassword",children:"Confirm Password:"}),(0,g.jsx)("input",{id:"confirmPassword",type:"password",className:"form-input mt-3 w-full py-2 px-3 h-10 bg-transparent dark:bg-slate-900 dark:text-slate-200 rounded outline-none border border-gray-200 focus:border-indigo-600 dark:border-gray-800 dark:focus:border-indigo-600 focus:ring-0",name:"confirm_password",placeholder:"*****",required:!0}),(0,g.jsx)("div",{className:"text-red-700",children:"confirm_password"===r.name?r.error:null})]}),(0,g.jsxs)("div",{className:"mb-4",children:[(0,g.jsxs)("div",{className:"flex items-center w-full mb-0",children:[(0,g.jsx)("input",{name:"accept",className:"form-checkbox rounded border-gray-200 dark:border-gray-800 text-indigo-600 focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50 me-2",type:"checkbox",value:"accept",id:"AcceptT&C"}),(0,g.jsxs)("label",{className:"form-check-label text-slate-400",htmlFor:"AcceptT&C",children:["I Accept ",(0,g.jsx)(n.rU,{className:"text-indigo-600",children:"Terms And Condition"})]})]}),(0,g.jsx)("div",{className:"text-red-700",children:"accept"===r.name?r.error:null})]}),(0,g.jsx)("div",{className:"mb-4",children:(0,g.jsx)("button",{type:"submit",className:"py-2 px-5 inline-block font-semibold tracking-wide border align-middle duration-500 text-base text-center bg-indigo-600 hover:bg-indigo-700 border-indigo-600 hover:border-indigo-700 text-white rounded-md w-full",value:"Register",onClick:A,children:"Register"})}),(0,g.jsxs)("div",{className:"text-center",children:[(0,g.jsx)("span",{className:"text-slate-400 me-2",children:"Already have an account ? "})," ",(0,g.jsx)(n.rU,{to:"/login",className:"text-black dark:text-white font-bold inline-block",children:"Sign in"})]})]})})]})}),(0,g.jsx)(_,{})]})]})})}))},1461:()=>{}}]);
//# sourceMappingURL=615.d651410a.chunk.js.map