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AAgBpE,IAGzB,OAAyB,MAArBgE,GAA6BE,GAAmB,MAARD,EAAqB,iCAG/D,gBAAC,EAAAmB,OAAM,CAACC,cAAe5B,EAAoB6B,SAAUnF,EAAWoF,iBAAkBX,IAC/E,EAAGY,QAAOC,UAASC,gBAClB,gCACG1B,IAAsBC,EAAK0B,aAAaC,aACvC,gBAAClE,EAAa,CACZ5B,aAAc0D,EAAakB,eAC3B3E,aAAcyF,GAASC,EACvBxE,SAAUgD,EAAK0B,YAAY1E,SAC3BjB,UAAWA,EACXG,UAAWuF,EACXxF,WAAYA,GAEZ,gBAACiC,EAAS,OAGZ,gBAACvC,EAAY,CACXE,aAAc0D,EAAamB,cAC3B1E,UAAWgE,EAAK0B,YAAYrJ,MAC5ByD,aAAcyF,GAASC,EACvBzF,UAAWA,EACXG,UAAWuF,EACXxF,WAAYA,GAEZ,gBAACiC,EAAS,SAOxB,CAEA,S,+UClHO,MAAM0D,EAAiC,CAC5CC,OAAQ,CACNC,cAAe,QAEjBzJ,MAAO,CACL0J,2BAA4B,aAC5BC,cAAe,oDACfC,UAAW,wEAEbC,QAAS,CACPF,cAAe,qCACfC,UACE,6GAEJE,gBAAiB,CACfC,kBAAmB,wBACnBJ,cAAe,4CACfC,UACE,wKAEJI,cAAe,CACbL,cAAe,6CACfC,UAAW,oFAEbK,SAAU,CACRC,KAAM,CACJ,CACEC,QACE,mKACFR,cAAe,yBAEjB,CACEQ,QACE,0KACFR,cAAe,gCAEjB,CACEQ,QACE,kJACFR,cAAe,+BAEjB,CACEQ,QACE,wJACFR,cAAe,gCAEjB,CACEQ,QACE,4GACFR,cAAe,kDAIrBS,MAAO,CACLhD,WACE,qQAEJiD,QAAS,CACPN,kBAAmB,4BACnBJ,cAAe,4BACfW,gBAAiB,0C","sources":["webpack://aurora-new-frontend/./packages/common/packages/core/src/checkbox/checkbox.tsx","webpack://aurora-new-frontend/./packages/common/packages/core/src/input/input-error.tsx","webpack://aurora-new-frontend/./packages/common/packages/core/src/input/text-input/text-input.tsx","webpack://aurora-new-frontend/./packages/common/packages/core/src/validator/use-validator.ts","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/quote/location/after-results.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/quote/location/before-results.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/quote/quote-form.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/quote/quote-page.generated.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/quote/quote-page.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/text-constants.tsx"],"sourcesContent":["import { darken } from 'polished';\nimport styled from 'styled-components';\n\nimport { Checkbox } from '@blueprintjs/core';\n\nimport { Colors } from '../colors';\n\nexport const AuroraCheckbox = styled(Checkbox)`\n color: ${Colors.GRAY_800};\n margin-bottom: 12;\n\n && {\n .bp3-control-indicator {\n border: 1px solid ${Colors.GRAY_400};\n border-radius: 3px;\n box-shadow: unset;\n background: white;\n font-size: 18px;\n margin-right: 11px;\n }\n\n input:checked ~ .bp3-control-indicator {\n box-shadow: unset;\n border: unset;\n background-color: #010619;\n\n &::before {\n /* stylelint-disable-next-line */\n font: normal normal normal 20px/1 FrontendV2;\n\n /* unicode for component-enabled */\n content: '\\f065';\n height: inherit;\n width: inherit;\n position: absolute;\n right: 1px;\n bottom: 1px;\n }\n }\n\n input:indeterminate ~ .bp3-control-indicator {\n box-shadow: unset;\n border: unset;\n background-color: #010619;\n\n &::before {\n /* stylelint-disable-next-line */\n font: normal normal normal 20px/1 FrontendV2;\n\n /* unicode for component-disabled */\n content: '\\f063';\n height: inherit;\n width: inherit;\n position: absolute;\n right: 1px;\n bottom: 1px;\n }\n }\n\n input:disabled:not(:checked) ~ .bp3-control-indicator {\n border: 1px solid ${Colors.GRAY_300};\n background: white;\n }\n\n input:disabled:checked ~ .bp3-control-indicator {\n background: ${Colors.GRAY_400};\n }\n }\n\n &:hover {\n input:checked:not(:disabled) ~ .bp3-control-indicator {\n background-color: ${darken(0.1, '#010619')};\n }\n\n input:indeterminate:not(:disabled) ~ .bp3-control-indicator {\n background-color: ${darken(0.1, '#010619')};\n box-shadow: unset !important;\n }\n\n input:not(:checked):not(:indeterminate):not(:disabled) ~ .bp3-control-indicator {\n box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);\n border: 1px solid ${Colors.GRAY_400};\n }\n }\n`;\n","import React from 'react';\nimport styled from 'styled-components';\n\nimport { Flex } from '@rebass/grid';\n\nimport { AuroraText, TextType } from '../typography';\n\nconst StyledInputError = styled(Flex)`\n height: 16px;\n`;\n\nexport const INPUT_ERROR_TESTID = 'input-error';\ninterface InputErrorProps {\n error: string | undefined;\n}\nexport const InputError = ({ error }: InputErrorProps) => (\n \n {error !== undefined && (\n <>\n \n {error}\n \n \n )}\n \n);\n","import React, { FC, useState } from 'react';\nimport styled from 'styled-components';\n\nimport { HTMLInputProps, IInputGroupProps, InputGroup } from '@blueprintjs/core';\nimport { Box, Flex } from '@rebass/grid';\n\nimport { Colors } from '../../colors';\nimport { Text } from '../../typography';\nimport { generateUuid } from '../../utils';\nimport { TextInputValidators, useValidator } from '../../validator';\nimport { DefaultInputCSS } from '../base';\nimport { InputError } from '../input-error';\n\nexport const MAX_INPUT_LENGTH = 255;\n\nconst StyledInputGroup = styled(InputGroup)`\n ${DefaultInputCSS}\n\n &.bp3-input-group {\n width: ${(props) => (!props.fill ? '300px' : '100%')};\n }\n`;\n\nexport interface AuroraInputGroupCustomProps {\n disableSelectAllOnFocus?: boolean;\n maxLength?: number;\n label?: string;\n validators?: TextInputValidators;\n noInlineErrors?: boolean;\n passedInErrors?: string[];\n}\n\nexport type AuroraInputGroupsProps = HTMLInputProps &\n IInputGroupProps &\n AuroraInputGroupCustomProps;\n\nexport const AuroraInputGroup: FC = ({\n disableSelectAllOnFocus,\n id,\n maxLength = MAX_INPUT_LENGTH,\n label,\n noInlineErrors = false,\n validators,\n passedInErrors = [],\n ...props\n}) => {\n const [inputId] = useState(id ?? generateUuid());\n const { disabled } = props;\n const [errors, validate] = useValidator(validators);\n\n return (\n \n {label && (\n \n \n {label}\n \n \n )}\n {\n const newValue = event.currentTarget.value;\n\n if (validate({ value: newValue })) {\n props.onInput?.(event);\n }\n }}\n onFocus={(e) => {\n if (!disableSelectAllOnFocus) {\n e.target.select();\n }\n return props.onFocus?.(e);\n }}\n {...props}\n />\n\n {!noInlineErrors && (\n \n \n \n )}\n \n );\n};\n","import { useCallback, useState } from 'react';\n\nimport { Validator, ValidatorProps, Validators } from './validators';\n\nconst renderResult = (\n failureResult: Validator['failureResult'],\n props: Props,\n) =>\n typeof failureResult === 'function'\n ? (failureResult as (props: Props) => Result)(props)\n : failureResult;\n\n// if validator arrays are built dynamicallly, they will never be the same twice.\n// convert the validators to a string, to check if it is the same from render to render\nconst hashValidators = (\n validators: Validators,\n) =>\n validators\n .map(({ failureResult }) => {\n if (typeof failureResult === 'object') {\n return JSON.stringify(failureResult);\n }\n return String(failureResult);\n })\n .join('-');\n\nexport const useValidator = (\n validators: Validator[] = [],\n) => {\n const [failures, setFailures] = useState([]);\n const validate = useCallback(\n (props: Props) => {\n const currentFailures = validators\n .filter(({ condition }) => !(condition?.(props) ?? false))\n .map(({ failureResult }) => renderResult(failureResult, props));\n\n setFailures(currentFailures);\n return currentFailures.length === 0;\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [hashValidators(validators)],\n );\n\n return [failures, validate] as const;\n};\n","import React from 'react';\n\nimport { useDebouncedCallback } from '@aurorasolar/common-core/src/hooks';\nimport {\n Analytics,\n AnalyticsEventTypes,\n AppRouterNavigation,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\n\nimport { useRouteData } from '../../../hooks';\nimport { AnimateView, Image, SplitView, TopRail } from '../../../shared-components';\nimport { LCAIButton, LCAIButtonIntent, LCAIText } from '../../../typography';\nimport { DEBOUNCE_TIME, HEADER_COLOR } from '../../../utils/constants';\nimport { LocationProps } from './location';\n\nexport function AfterResults({\n children,\n formLocation,\n isValidQuote,\n projectId,\n hasModel,\n sourcePage,\n saveQuote,\n}: LocationProps) {\n const navigation = useAppModule(AppRouterNavigation);\n const analytics = useAppModule(Analytics);\n\n const { customSettings, templateId, hasUtilityBillCapture } = useRouteData();\n\n const returnToModel = useDebouncedCallback(\n async () => {\n if (projectId != null) {\n await analytics?.track(AnalyticsEventTypes.LeadCaptureClickedBackToModel, {\n project_id: projectId,\n quote_submitted: true,\n });\n navigation?.navigate(`/projects/${projectId}/cad`, { replace: true });\n }\n },\n [analytics, navigation, projectId],\n DEBOUNCE_TIME,\n );\n\n const submitQuote = useDebouncedCallback(\n async () => {\n await saveQuote(formLocation);\n\n await analytics?.track(AnalyticsEventTypes.LeadCaptureEnteredQuoteInfo, {\n location: formLocation,\n project_id: projectId,\n });\n\n const nextRoute = hasUtilityBillCapture && hasModel ? 'bill-upload' : 'profile-review';\n navigation?.navigate(`/projects/${projectId}/${nextRoute}`, { replace: true });\n },\n [analytics, navigation, projectId, saveQuote, formLocation, hasUtilityBillCapture, hasModel],\n DEBOUNCE_TIME,\n );\n\n return (\n <>\n \n \n \n \n Submit\n \n {hasModel && (\n \n Cancel\n \n )}\n \n }\n leftContent={\n <>\n \n What's the best way to contact you?\n \n {children}\n \n }\n rightContent={\n \n }\n />\n \n \n );\n}\n","import React from 'react';\n\nimport { useDebouncedCallback } from '@aurorasolar/common-core/src/hooks';\nimport { AuroraIcon, AuroraIconType } from '@aurorasolar/common-core/src/icon';\nimport {\n Analytics,\n AnalyticsEventTypes,\n AppRouterNavigation,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\n\nimport { useRouteData } from '../../../hooks';\nimport { AnimateView, Map, SplitView, TopRail } from '../../../shared-components';\nimport { LCAIButton, LCAIButtonIntent, LCAIText } from '../../../typography';\nimport { DEBOUNCE_TIME, HEADER_COLOR } from '../../../utils/constants';\nimport { LocationProps } from './location';\n\nexport function BeforeResults({\n children,\n formLocation,\n isValidQuote,\n projectId,\n location,\n sourcePage,\n saveQuote,\n}: LocationProps) {\n const analytics = useAppModule(Analytics);\n const navigation = useAppModule(AppRouterNavigation);\n\n const { templateId } = useRouteData();\n\n const submitQuote = useDebouncedCallback(\n async () => {\n await saveQuote(formLocation);\n\n await analytics?.track(AnalyticsEventTypes.LeadCaptureEnteredQuoteInfo, {\n location: formLocation,\n project_id: projectId,\n });\n\n navigation?.navigate(`/projects/${projectId}/progress`, { replace: true });\n },\n [analytics, navigation, saveQuote, formLocation, projectId],\n DEBOUNCE_TIME,\n );\n\n return (\n <>\n \n \n \n \n Estimate your savings\n \n }\n leftContent={\n <>\n \n What's the best way to contact you?\n \n {children}\n \n }\n rightContent={\n <>\n {location && }\n \n }\n />\n \n \n );\n}\n","import { sanitize } from 'dompurify';\nimport { Field, Form } from 'formik';\nimport React from 'react';\nimport { Box } from 'reflexbox/styled-components';\nimport styled from 'styled-components';\n\nimport { AuroraCheckbox } from '@aurorasolar/common-core/src/checkbox/checkbox';\nimport { AuroraInputGroup } from '@aurorasolar/common-core/src/input';\n\nimport { useRouteData } from '../../hooks';\nimport { BoxWithMargin } from '../../shared-components';\nimport {\n DEFAULT_MARGIN,\n INPUT_FOCUS_STYLE,\n INPUT_PLACEHOLDER_COLOR,\n INPUT_PLACEHOLDER_STYLE,\n INPUT_STYLE,\n} from '../../utils/constants';\nimport { QuoteTestIds } from '../../utils/test-ids';\nimport { TEXT } from '../../utils/text-constants';\n\nenum Inputs {\n FIRST_NAME = 'First name',\n LAST_NAME = 'Last name',\n EMAIL = 'Email',\n PHONE_NUMBER = 'Phone number',\n}\n\nexport function QuoteForm() {\n const { customSettings } = useRouteData();\n\n return (\n
\n \n \n \n \n \n \n \n \n \n }\n name=\"disclaimer\"\n />\n \n \n
\n );\n}\n\nconst ContactInput = styled(AuroraInputGroup)`\n &&.bp3-input-group input.bp3-input {\n ${INPUT_STYLE}\n }\n\n &&.bp3-input-group input.bp3-input::placeholder {\n ${INPUT_PLACEHOLDER_STYLE}\n }\n\n &&.bp3-input-group input.bp3-input:focus {\n ${INPUT_FOCUS_STYLE}\n }\n`;\n\nconst CheckboxInput = styled(AuroraCheckbox)`\n color: ${INPUT_PLACEHOLDER_COLOR};\n font-size: 12px;\n line-height: 16px;\n\n &&.bp3-control.bp3-checkbox .bp3-control-indicator {\n margin-right: 8px;\n }\n`;\n\n// There is a 12px margin below the inputs that I think is coming from the Field component of which I can't find a way to remove\n// So making this be 12px for grid-row-gap to be 12 + 12 = 24px\nconst FormGrid = styled(Box)`\n display: grid;\n grid-column-gap: ${DEFAULT_MARGIN};\n grid-row-gap: 12px;\n grid-template-columns: auto;\n`;\n\nconst SplitNameInputs = styled(FormGrid)`\n grid-template-columns: auto auto;\n\n @media screen and (orientation: portrait) and (max-height: 811px) {\n grid-template-columns: auto;\n }\n\n @media screen and (orientation: landscape) and (max-height: 688px) {\n grid-template-columns: auto;\n }\n`;\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type SubmitLeadCaptureCustomerMutationVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n customer: Types.SubmittedLeadCaptureCustomer;\n}>;\n\n\nexport type SubmitLeadCaptureCustomerMutation = { __typename: 'Mutation', submitLeadCaptureCustomer: { __typename: 'LeadCaptureProject', id: string, error?: string | null | undefined, customer?: { __typename: 'LeadCaptureCustomer', email: string, firstName?: string | null | undefined, lastName?: string | null | undefined, name: string, phone: string } | null | undefined } };\n\n\nexport const SubmitLeadCaptureCustomerDocument = gql`\n mutation SubmitLeadCaptureCustomer($id: ID!, $customer: SubmittedLeadCaptureCustomer!) @trace_info(traceInfo: {pod: leads}) {\n submitLeadCaptureCustomer(id: $id, customer: $customer) {\n id\n error\n customer {\n email\n firstName\n lastName\n name\n phone\n }\n }\n}\n `;\nexport type SubmitLeadCaptureCustomerMutationFn = Apollo.MutationFunction;\n\n/**\n * __useSubmitLeadCaptureCustomerMutation__\n *\n * To run a mutation, you first call `useSubmitLeadCaptureCustomerMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useSubmitLeadCaptureCustomerMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [submitLeadCaptureCustomerMutation, { data, loading, error }] = useSubmitLeadCaptureCustomerMutation({\n * variables: {\n * id: // value for 'id'\n * customer: // value for 'customer'\n * },\n * });\n */\nexport function useSubmitLeadCaptureCustomerMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(SubmitLeadCaptureCustomerDocument, options);\n }\nexport type SubmitLeadCaptureCustomerMutationHookResult = ReturnType;\nexport type SubmitLeadCaptureCustomerMutationResult = Apollo.MutationResult;\nexport type SubmitLeadCaptureCustomerMutationOptions = Apollo.BaseMutationOptions;","import { Formik } from 'formik';\nimport React, { useCallback, useEffect } from 'react';\nimport * as yup from 'yup';\n\nimport { Analytics, AnalyticsPageTypes, useAppModule } from '@aurorasolar/common-module-loader';\n\nimport { useRouteData } from '../../hooks';\nimport { GetLeadCaptureDataQuery, useGetLeadCaptureDataQuery } from '../../lead-capture.generated';\nimport { ILeadCaptureLead, sendContactMessage, sendLeadMessage } from '../../message/message';\nimport { SourcePage } from '../../utils/source-page';\nimport { AfterResults, BeforeResults } from './location';\nimport { QuoteForm } from './quote-form';\nimport { useSubmitLeadCaptureCustomerMutation } from './quote-page.generated';\n\nenum FormLocation {\n AFTER_RESULTS = 'after_results',\n BEFORE_RESULTS = 'before_results',\n}\n\ninterface QuoteValues {\n disclaimer: boolean;\n email: string;\n firstName: string;\n lastName: string;\n phone: string;\n}\n\nconst InitialQuoteValues: QuoteValues = {\n disclaimer: false,\n email: '',\n firstName: '',\n lastName: '',\n phone: '',\n};\n\nexport interface QuotePageProps {\n projectId: string;\n sourcePage: SourcePage;\n}\n\nexport function QuotePage({ projectId, sourcePage }: QuotePageProps) {\n const analytics = useAppModule(Analytics);\n\n const { formBeforeResults, templateId } = useRouteData();\n\n const { data, loading } = useGetLeadCaptureDataQuery({\n variables: { id: projectId, templateId },\n });\n\n const [submitCustomer] = useSubmitLeadCaptureCustomerMutation();\n\n useEffect(() => {\n if (formBeforeResults != null) {\n analytics?.page(AnalyticsPageTypes.LeadCaptureQuote, {\n location: formBeforeResults ? FormLocation.BEFORE_RESULTS : FormLocation.AFTER_RESULTS,\n project_id: projectId,\n });\n }\n }, [analytics, projectId, formBeforeResults]);\n\n const schema = yup.object().shape({\n disclaimer: yup.boolean().isTrue(),\n email: yup.string().trim().email().required(),\n firstName: yup.string().trim().required(),\n lastName: yup.string().trim().required(),\n phone: yup.string().trim().required(),\n });\n\n const saveQuote = useCallback(\n async (values: QuoteValues) => {\n const lead: ILeadCaptureLead = {\n email: values.email,\n firstName: values.firstName,\n lastName: values.lastName,\n phone: values.phone,\n };\n\n submitCustomer({\n variables: {\n customer: {\n email: lead.email,\n firstName: lead.firstName,\n lastName: lead.lastName,\n name: `${lead.firstName} ${lead.lastName}`,\n phone: lead.phone,\n },\n id: projectId,\n },\n });\n\n sendContactMessage(data as GetLeadCaptureDataQuery, lead);\n sendLeadMessage(data as GetLeadCaptureDataQuery, lead);\n },\n [data, submitCustomer, projectId],\n );\n\n if (formBeforeResults == null || loading || data == null) return <>;\n\n return (\n \n {({ dirty, isValid, submitForm }) => (\n <>\n {formBeforeResults && !data.projectData?.disqualified ? (\n \n \n \n ) : (\n \n \n \n )}\n \n )}\n \n );\n}\n\nexport default QuotePage;\n","export interface Tip {\n message: string;\n primaryHeader: string;\n}\n\nexport interface LCAIText {\n alternatePrimaryButtonText?: string;\n endFlowButton?: string;\n primaryHeader?: string;\n placeholder?: string;\n secondaryHeader?: string;\n subheader?: string;\n disclaimer?: string;\n primaryButtonText?: string;\n tips?: Tip[];\n}\n\nexport const TEXT: Record = {\n common: {\n endFlowButton: 'Done',\n },\n error: {\n alternatePrimaryButtonText: 'Contact us',\n primaryHeader: 'Automated estimates are coming soon to your area.',\n subheader: \"Our solar experts will design a system that's perfect for your home.\",\n },\n landing: {\n primaryHeader: 'See solar on your home in minutes.',\n subheader:\n 'Bring solar to life on your home and learn how much you could save with solar in just a few simple steps.',\n },\n profileComplete: {\n primaryButtonText: 'Estimate your savings',\n primaryHeader: \"Thanks, now let's add solar to your home!\",\n subheader:\n 'Our advanced simulation engine is ready to build your home in 3D, automatically place solar panels, and estimate how much energy your house can generate every year.',\n },\n profileReview: {\n primaryHeader: 'Thank you, your profile is being reviewed.',\n subheader: 'If your home is a good fit for solar, a solar expert will reach out to you soon.',\n },\n progress: {\n tips: [\n {\n message:\n \"Solar panels save you money while you own the home, then add value when you're ready to sell. Homes with solar sell for 4.1% more on average than homes without.\",\n primaryHeader: 'Invest in your future',\n },\n {\n message:\n \"Solar is a clean, renewable source of energy that reduces your home's carbon footprint. A typical solar installation can reduce a home's CO2 impact by 6 tons per year.\",\n primaryHeader: 'Help build a better tomorrow',\n },\n {\n message:\n 'Pairing battery storage with solar panels helps ensure your home stays running even during outages, keeping your lights on and your food fresh.',\n primaryHeader: 'Power when you need it most',\n },\n {\n message:\n \"Air conditioning is the largest single contributor to most home's electricity bills. Going solar can help reduce high bills during hot summer months.\",\n primaryHeader: 'Take control over high bills',\n },\n {\n message:\n 'While electricity prices have increased 15% in the last decade, the cost of solar has decreased over 60%.',\n primaryHeader: \"There's never been a better time to go solar\",\n },\n ],\n },\n quote: {\n disclaimer:\n 'By checking the box, I am providing my electronic signature authorizing the company to contact me by email, text, or phone, including an automated technology, at the phone number or email provided above. This consent is not a required condition of purchase.',\n },\n results: {\n primaryButtonText: 'Get a more accurate quote',\n primaryHeader: 'With solar you could save',\n secondaryHeader: \"Here's how solar adds up for your home\",\n },\n};\n"],"names":["AuroraCheckbox","StyledInputError","InputError","error","alignItems","my","undefined","small","type","StyledInputGroup","props","fill","AuroraInputGroup","disableSelectAllOnFocus","id","maxLength","label","noInlineErrors","validators","passedInErrors","inputId","useState","disabled","errors","validate","mb","as","color","htmlFor","intent","length","onBlur","event","newValue","currentTarget","value","onInput","onFocus","e","target","select","mt","hashValidators","map","failureResult","JSON","stringify","String","join","useValidator","failures","setFailures","useCallback","currentFailures","filter","condition","renderResult","AfterResults","children","formLocation","isValidQuote","projectId","hasModel","sourcePage","saveQuote","navigation","analytics","customSettings","templateId","hasUtilityBillCapture","returnToModel","async","track","project_id","quote_submitted","navigate","replace","submitQuote","location","nextRoute","buttons","onClick","leftContent","fontWeight","rightContent","customImage","quotePageImage","BeforeResults","name","lat","latitude","lng","longitude","tilt45","viewOnly","Inputs","QuoteForm","Form","FormGrid","SplitNameInputs","Field","FIRST_NAME","ContactInput","placeholder","LAST_NAME","PHONE_NUMBER","EMAIL","CheckboxInput","labelElement","dangerouslySetInnerHTML","__html","sanitize","quotePageDisclaimer","ALLOWED_TAGS","display","defaultOptions","SubmitLeadCaptureCustomerDocument","FormLocation","InitialQuoteValues","disclaimer","email","firstName","lastName","phone","QuotePage","formBeforeResults","data","loading","variables","submitCustomer","baseOptions","options","useSubmitLeadCaptureCustomerMutation","useEffect","page","BEFORE_RESULTS","AFTER_RESULTS","schema","shape","isTrue","trim","required","values","lead","customer","Formik","initialValues","onSubmit","validationSchema","dirty","isValid","submitForm","projectData","disqualified","TEXT","common","endFlowButton","alternatePrimaryButtonText","primaryHeader","subheader","landing","profileComplete","primaryButtonText","profileReview","progress","tips","message","quote","results","secondaryHeader"],"sourceRoot":""}