"use strict";(self.webpackChunkwheelsmart_admin_react=self.webpackChunkwheelsmart_admin_react||[]).push([[3912],{3912(e,a,s){s.r(a),s.d(a,{default:()=>y});var l=s(5544),r=s(65043),i=s(62582),n=s(44394),o=s(89421),t=s(11645),d=s(68493),m=s(5835),c=s(47419),h=s(51238),p=s(8738),u=s(91688),g=s(97508),x=s(96709),v=s(71494),w=s(32806),j=s(70579);const y=(0,g.Ng)(function(e){let a=e.login;return{loginError:a.loginError,loginData:a.loginData,loading:a.loading}},{checkLogin:w.wD,InputChangeValue:w.O2,cleardata:w.oe})(function(e){var a,s,g,w,y,A,b;const N=(0,u.useHistory)(),f=(0,h.A)(),k=d.A.useForm(),D=(0,l.A)(k,1)[0];function _(a){e.InputChangeValue({key:a.target.name,value:a.target.value})}return(0,r.useEffect)(()=>{e.cleardata(),localStorage.getItem("access_token")&&N.push("/")},[]),(0,r.useEffect)(()=>{D.setFieldsValue({password:e.loginData.password,username:e.loginData.username})},[e.loginData]),(0,j.jsxs)(c.A,{gutter:[32,0],className:"hp-authentication-page",children:[(0,j.jsx)(v.A,{}),(0,j.jsx)(t.A,{lg:12,span:24,className:"hp-py-sm-0 hp-py-md-64",children:(0,j.jsx)(c.A,{className:"hp-h-100",align:"middle",justify:"center",children:(0,j.jsxs)(t.A,{children:[(0,j.jsx)("div",{className:"hp-m-0 hp-p-0",children:(0,j.jsx)("img",{src:x.A,style:{height:150,width:500},alt:"Logo"})}),(0,j.jsxs)("div",{xxl:11,xl:15,lg:20,md:20,sm:24,className:"hp-px-sm-8 hp-pt-24 hp-pb-48",children:[(0,j.jsx)("h1",{className:"hp-mb-sm-0",children:"Login"}),(0,j.jsx)("p",{className:"hp-mt-sm-0 hp-mt-8 hp-text-color-black-60",children:"Welcome back, please login to your account."}),(0,j.jsxs)(d.A,{layout:"vertical",name:"loginWithUsername",className:"hp-mt-sm-16 hp-mt-32",initialValues:{remember:!0},form:D,onFinish:()=>{var a={password:e.loginData.password,username:e.loginData.username,device_uuid:f,device_name:p.C0,device_type:3};e.checkLogin({loginData:a,history:N})},onFinishFailed:e=>{console.log("Failed:",e)},children:[(0,j.jsx)(d.A.Item,{label:"User Name :",name:"username",rules:[{required:!0,message:"Please input your User Name!"},{pattern:new RegExp("^[a-zA-Z0-9]([._-](?![._-])|[a-zA-Z0-9]){0,18}$"),message:"field does not accept Special Characters"}],hasFeedback:!0,children:(0,j.jsx)(m.A,{id:"username",name:"username",style:{width:"100%"},placeholder:"User Name",value:null==e.loginData.username?"":null===(a=e.loginData)||void 0===a?void 0:a.username,onChange:_})}),(0,j.jsx)(d.A.Item,{label:"Password :",name:"password",rules:[{required:!0,message:"Please input your password!"}],hasFeedback:!0,children:(0,j.jsx)(m.A.Password,{id:"password",name:"password",style:{width:"100%"},placeholder:"Password",value:null==(null===(s=e.loginData)||void 0===s?void 0:s.password)?"":null===(g=e.loginData)||void 0===g?void 0:g.password,onChange:_})}),(null===(w=e.loginError)||void 0===w?void 0:w.password)&&(0,j.jsx)(n.A,{message:null===(y=e.loginError)||void 0===y?void 0:y.password,type:"error"}),(null===(A=e.loginError)||void 0===A?void 0:A.detail)&&(0,j.jsx)(n.A,{message:null===(b=e.loginError)||void 0===b?void 0:b.detail,type:"error"}),(0,j.jsx)(d.A.Item,{className:"hp-mt-16 hp-mb-8",children:(0,j.jsx)(o.A,{block:!0,type:"primary",htmlType:"submit",disabled:e.loading,children:"Sign in"})})]}),(0,j.jsx)("div",{className:"hp-form-info hp-mt-16",children:(0,j.jsx)(i.N_,{className:"hp-text-color-primary-1 hp-text-color-dark-primary-2 hp-caption",to:"/mobilelogin",children:"Login with Mobile"})})]})]})})})]})})}}]);
//# sourceMappingURL=3912.47e9c686.chunk.js.map