{"version":3,"sources":["webpack:///./src/pages/no-reference-id/lookup/mortgage.js"],"names":["LookupMortgagePage","_ref","location","handleSubmit","fetchBorrower","useFetchBorrower","React","createElement","SubmitInsuranceLayout","Formik","initialValues","firstpart_street","last_name","loan_number","postal_code","onSubmit","async","values","bag","fetch","method","headers","then","res","ok","json","status","Error","data","refId","ReferenceIds","catch","error","navigate","validationSchema","Yup","shape","required","props","Form","noValidate","AppLayout","leftSide","Fragment","Paragraph","mb","typeStyle","textAlign","color","H1","className","fontSize","rightSide","InfoBox","H2","fontWeight","Flex","Col","colWidth","FormGroup","id","mt","focusStyleTest","Label","visible","Span","ml","InputGroup","Input","Caption","hint","Hint","content","footerButtons","ButtonGroup","display","justifyContent","BackButton","NextButton","formikProps"],"mappings":"4FAAA,wGAgOeA,UAxMYC,IAAmB,IAAlB,SAAEC,GAAUD,EACtC,MAAQE,aAAcC,GAAkBC,YACtC,sCAkCF,OACEC,IAAAC,cAACC,IAAqB,CAACN,SAAUA,GAC/BI,IAAAC,cAACE,SAAM,CACLC,cAAe,CACbC,iBAAkB,GAClBC,UAAW,GACXC,YAAa,GACbC,YAAa,IAEfC,SAxCeC,MAAOC,EAAQC,IAIhCC,MAAM,2FAAmEF,EAAOJ,kCAAkCI,EAAON,6BAA6BM,EAAOL,kCAAkCK,EAAOH,cAAe,CACnNM,OAAQ,MACRC,QAAS,CACP,eAAgB,mBAChB,mCAAoC,UAIrCC,KAAKC,IACJ,GAAIA,EAAIC,GAAI,OAAOD,EAAIE,OAEvB,GAAmB,MAAfF,EAAIG,OAAgB,MAAM,IAAIC,MAAM,gBAIzCL,KAAKM,IACJxB,EAAc,CAAEyB,MAAOD,EAAKE,aAAa,IAAMZ,KAIhDa,MAAMC,IAELC,mBAAS,yDAeXC,iBAAkBC,MAAaC,MAAM,CACnCzB,iBAAkBwB,MAAaE,SAC7B,+BAEFzB,UAAWuB,MAAaE,SAAS,+BACjCxB,YAAasB,MAAaE,SAAS,+BACnCvB,YAAaqB,MAAa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oD,YAAUQ,WAAU,KACnB7D,IAAAC,cAACoD,YAAUQ,WAAWC,MAAK,OAE7B9D,IAAAC,cAACoD,YAAUU,QAAO,QAGtB/D,IAAAC,cAACiD,OAAKC,IAAG,CAACC,SAAU,CAAC,OACnBpD,IAAAC,cAACoD,YAAS,CACRC,GAAG,mBACHC,GAAI,EACJxB,UAAQ,EACRyB,gBAAc,GAEdxD,IAAAC,cAACoD,YAAUI,MAAK,CACdC,SAAO,EACPM,KACEhE,IAAAC,cAACgE,IAAI,CACHX,GAAG,qBACHY,QAAQ,4GAGb,8BAEClE,IAAAC,cAAC0D,OAAI,CAACV,WAAW,OAAOW,GAAI,EAAGlB,MAAM,WAAU,MAIjD1C,IAAAC,cAACoD,YAAUQ,WAAU,KACnB7D,IAAAC,cAACoD,YAAUQ,WAAWC,MAAK,OAE7B9D,IAAAC,cAACoD,YAAUU,QAAO,QAGtB/D,IAAAC,cAACiD,OAAKC,IAAG,KACPnD,IAAAC,cAACoD,YAAS,CACRC,GAAG,cACHC,GAAI,EACJxB,UAAQ,EACRyB,gBAAc,GAEdxD,IAAAC,cAACoD,YAAUI,MAAK,CACdC,SAAO,EACPM,KACEhE,IAAAC,cAACgE,IAAI,CACHX,GAAG,iCACHY,QAAQ,sIAGb,cAEClE,IAAAC,cAAC0D,OAAI,CAACV,WAAW,OAAOW,GAAI,EAAGlB,MAAM,WAAU,MAIjD1C,IAAAC,cAACoD,YAAUQ,WAAU,KACnB7D,IAAAC,cAACoD,YAAUQ,WAAWC,MAAK,OAE7B9D,IAAAC,cAACoD,YAAUU,QAAO,UAM5BI,cACEnE,IAAAC,cAACmE,IAAW,CAACC,QAAQ,OAAOC,eAAe,YACzCtE,IAAAC,cAACsE,IAAU,CAACjB,GAAG,kCACftD,IAAAC,cAACuE,IAAU,CACTC,YAAazC,EACbsB,GAAG","file":"component---src-pages-no-reference-id-lookup-mortgage-js-da9b9b087c59fef97561.js","sourcesContent":["import React from 'react'\r\nimport { Form, Formik } from 'formik'\r\nimport * as Yup from 'yup'\r\nimport { navigate } from 'gatsby'\r\n\r\nimport {\r\n FormGroup,\r\n Paragraph,\r\n H1,\r\n H2,\r\n Flex,\r\n Span,\r\n} from '@allied-solutions/affinity'\r\n\r\nimport { useFetchBorrower } from '../../../hooks'\r\nimport {\r\n AppLayout,\r\n BackButton,\r\n ButtonGroup,\r\n Hint,\r\n InfoBox,\r\n NextButton,\r\n SubmitInsuranceLayout,\r\n} from '../../../components'\r\nconst LookupMortgagePage = ({ location }) => {\r\n const { handleSubmit: fetchBorrower } = useFetchBorrower(\r\n '/no-reference-id/confirm-identity/'\r\n )\r\n\r\n const handleSubmit = async (values, bag) => {\r\n\r\n return (\r\n\r\n fetch(`${process.env.GATSBY_API_URL}/reference-ids/mortgage?LoanNumber=${values.loan_number}&Address1StartsWith=${values.firstpart_street}&LastName=${values.last_name}&PostalCodeStartsWith=${values.postal_code}`, {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Access-Control-Allow-Credentials': 'true'\r\n }\r\n })\r\n // handle HTTP status codes\r\n .then(res => {\r\n if (res.ok) return res.json()\r\n\r\n if (res.status === 404) throw new Error('Not found.')\r\n })\r\n\r\n // success\r\n .then(data => {\r\n fetchBorrower({ refId: data.ReferenceIds[0] }, bag)\r\n })\r\n\r\n // error\r\n .catch(error => {\r\n //console.log(error)\r\n navigate('/submit-insurance/no-reference-id/upload-documents/')\r\n })\r\n )\r\n }\r\n\r\n return (\r\n \r\n \r\n {props => (\r\n
\r\n \r\n \r\n Look up my account\r\n \r\n

\r\n You chose to look up a loan on a home.\r\n

\r\n \r\n Check your loan documents and fill out this information.\r\n Fill out the information as it appears on your loan.\r\n \r\n \r\n }\r\n rightSide={\r\n \r\n \r\n Loan lookup for home\r\n \r\n\r\n \r\n \r\n \r\n \r\n Last Name\r\n \r\n *\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Zip Code\r\n \r\n *\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n Street Number (number only)\r\n \r\n *\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n >\r\n Loan Number\r\n \r\n *\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }\r\n footerButtons={\r\n \r\n \r\n \r\n \r\n }\r\n />\r\n \r\n )}\r\n \r\n
\r\n )\r\n}\r\n\r\nexport default LookupMortgagePage\r\n"],"sourceRoot":""}