{"version":3,"sources":["webpack:///./ClientApp/components/Pages/Resources/Login/Login.tsx","webpack:///./ClientApp/components/Pages/Resources/Login/LoginForm.tsx"],"names":["Login","match","className","href","withSeo","state","loginPage","validationSchema","Yup","email","required","password","matches","LoginForm","setIsLogged","React","loginError","setLoginError","history","useHistory","PasswordError","setTimeout","onSubmit","values","rest","post","then","res","success","push","params","topic","error","initialValues","render","formikBag","name","placeholder","type"],"mappings":"oWAOMA,EAAQ,SAAC,GAAY,IAAXC,EAAW,EAAXA,MAEf,OACC,uBAAKC,UAAU,kBACd,uBAAKA,UAAU,SACd,uBAAKA,UAAU,cACd,uDACA,kFACA,gBAAC,IAAD,CAAWD,MAAOA,IAClB,uBAAKC,UAAU,gBACd,yDACA,qBAAGC,KAAK,kCAAR,gC,EAUSC,YAAQJ,GAAO,SAAAK,GAAK,OAAIA,EAAMC,YAAW,YAAa,8BAAtD,a,6FArBTN,E,wmDCgBAO,EAAmBC,SAAW,CACnCC,MAAOD,WAAaC,MAAM,uCAAuCC,SAAS,6BAC1EC,SAAUH,WACRI,QAAQ,mBAAoB,oDAC5BF,SAAS,kCAGNG,EAAsC,SAAC,GAAyB,EAAxBC,YAAwB,IAAXb,EAAW,EAAXA,MAAW,IACjCc,WAAmC,IADF,GAC9DC,EAD8D,KAClDC,EADkD,KAE/DC,EAAUC,uBAEVC,EAAgB,SAAC,GAAiB,IAAhBJ,EAAgB,EAAhBA,WACTK,YAAW,WACxBJ,EAAc,MACZ,KACH,OACC,uBAAKf,UAAU,4BAA4Bc,IAI7C,OACC,gBAAC,SAAD,CACCM,SAAU,SAACC,GACVC,IAAKC,KAAe,8BAA+BF,GACjDG,MAAK,SAACC,GAAQ,MACdA,EAAIC,QACJV,EAAQW,KAAR,iCAAsC,UAAA5B,EAAM6B,cAAN,eAAcC,OAAQ9B,EAAM6B,OAAOC,MAAQ,QAAjF,WAAmG,CAACA,MAAO9B,EAAQA,EAAM6B,OAAOC,MAAQ,KACxId,EAAcU,EAAIK,WAGrBC,cAAe,CACdxB,MAAO,GACPE,SAAU,IAEXJ,iBAAkBA,EAElB2B,OAAQ,SAACC,GACR,OACC,gBAAC,OAAD,CACCjC,UAAU,cAEV,uBAAKA,UAAU,sBACd,gBAAC,IAAD,CAAakC,KAAK,QAAQC,YAAY,QAAQF,UAAWA,IACzD,gBAAC,IAAD,CAAaC,KAAK,WAAWC,YAAY,WAAWC,KAAK,WAAWH,UAAWA,IAE9EnB,EAAa,gBAACI,EAAD,CAAeJ,WAAYA,IAAgB,MAI1D,0BACCsB,KAAM,SACNpC,UAAU,0BAFX,e,EA1CAW,E,oFAEWM,iB,UAsDFN,EAAA,O,6FA/DTN,E,wIAOAM,E","file":"chunks/Login.chunk.0c498f0cb10db1e24122.js","sourcesContent":["import * as React from 'react';\r\n\r\nimport LoginForm from '@app/components/Pages/Resources/Login/LoginForm';\r\nimport withSeo from '@app/components/LocalCommon/HigherOrderComponents/WithSeo';\r\n\r\nimport '@app/scss/components/login.scss';\r\n\r\nconst Login = ({match}) => {\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t

Veterinarian Portal Login

\r\n\t\t\t\t\t
Log in to see exclusive resources for veterinarians.
\r\n\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t
Forgot your password? Email
\r\n\t\t\t\t\t\tResources@LapofLove.com\r\n\t\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t
\r\n\r\n\t);\r\n};\r\n\r\nexport default withSeo(Login, state => state.loginPage, 'loginPage', 'veterinary-resources/login');","import * as React from 'react';\r\n\r\nimport {Form, Formik, FormikProps} from 'formik';\r\n\r\nimport {useHistory} from 'react-router-dom';\r\n\r\nimport * as Yup from 'yup';\r\n\r\nimport CustomInput from '@app/components/UI/CustomInput/CustomInput';\r\nimport {rest} from '@app/components/Api';\r\n\r\nimport '@app/scss/components/login.scss';\r\n\r\ninterface LoginFormProps {\r\n\tsetIsLogged?: any;\r\n\tmatch?: any;\r\n}\r\n\r\ninterface LoginRes {\r\n\tsuccess: boolean;\r\n\terror?: string;\r\n}\r\n\r\nconst validationSchema = Yup.object({\r\n\temail: Yup.string().email('Value must be a valid Email address').required('Email is a required field'),\r\n\tpassword: Yup.string()\r\n\t\t.matches(/^([0-9a-zA-Z])+$/, 'Password should only contain numbers and letters')\r\n\t\t.required('Password is a required field'),\r\n});\r\n\r\nconst LoginForm: React.FC = ({setIsLogged, match}) => {\r\n\tconst [loginError, setLoginError] = React.useState('');\r\n\tconst history = useHistory();\r\n\r\n\tconst PasswordError = ({loginError}) => {\r\n\t\tconst timer = setTimeout(() => {\r\n\t\t\tsetLoginError('');\r\n\t\t}, 5000);\r\n\t\treturn (\r\n\t\t\t
{loginError}
\r\n\t\t);\r\n\t};\r\n\t\r\n\treturn (\r\n\t\t {\r\n\t\t\t\trest.post('v1/veterinarianPortal/login', values)\r\n\t\t\t\t\t.then((res) => {\r\n\t\t\t\t\t\tres.success ?\r\n\t\t\t\t\t\thistory.push(`/veterinary-resources/${match.params?.topic ? match.params.topic : 'about'}/logged`, {topic: match ? match.params.topic : ''}) :\r\n\t\t\t\t\t\tsetLoginError(res.error);\r\n\t\t\t\t\t});\r\n\t\t\t}}\r\n\t\t\tinitialValues={{\r\n\t\t\t\temail: '',\r\n\t\t\t\tpassword: ''\r\n\t\t\t}}\r\n\t\t\tvalidationSchema={validationSchema}\r\n\r\n\t\t\trender={(formikBag: FormikProps) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tloginError ? : null\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t
\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tLog in\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n};\r\n\r\nexport default LoginForm;"],"sourceRoot":""}