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AIJ,MAAK,IAClCJ,EAAoB9C,IAE7B,CACA4C,EAAoBW,KAAO,IAAOC,OAAOD,KAAKZ,GAC9CC,EAAoB5C,GAAK,gGACzByD,EAAOC,QAAUd,C","sources":["webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/components/progress-spinner.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/components/tip.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/hooks/use-tips/use-tips.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/progress-steps.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/progress.generated.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/progress-page.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/apollo-query-error-propagation.ts","webpack://aurora-new-frontend/./packages/lead-capture/src/utils/text-constants.tsx","webpack://aurora-new-frontend/./packages/lead-capture/src/pages/progress/components/tips/ lazy ^\\.\\/.*\\.lottie$ chunkName: lcai-tips prefetchOrder: 0 namespace object"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport * as DS from '@aurorasolar/ds';\nimport { x } from '@xstyled/styled-components';\n\n// Borrowed this from DS for the time being - will ask them to expose it\nexport function ProgressSpinner({\n handleAdvance,\n timeout,\n}: {\n handleAdvance: () => void;\n timeout: number;\n}) {\n const [progress, setProgress] = useState(0);\n const cb = useRef(handleAdvance);\n\n useEffect(() => {\n // Caching this separately so we don't need to declare it in the interval dependency array\n // otherwise whenever the cb changes it would restart the interval, which we don't want.\n if (cb.current !== handleAdvance) cb.current = handleAdvance;\n }, [handleAdvance]);\n\n useEffect(() => {\n const progressInterval = 100;\n\n let invocations = 0;\n\n const innerHandle = setInterval(() => {\n invocations += 1;\n setProgress((invocations / (timeout / progressInterval)) * 100);\n }, progressInterval);\n\n const outerHandle = setInterval(() => {\n cb.current();\n invocations = 0;\n setProgress(0);\n }, timeout);\n\n return () => {\n clearInterval(innerHandle);\n clearInterval(outerHandle);\n setProgress(0);\n };\n }, [timeout]);\n\n const size = 30;\n const strokeWidth = 1;\n const center = size / 2;\n const radius = center - strokeWidth;\n const arcLength = 2 * Math.PI * radius;\n const arcOffset = arcLength * ((100 - progress) / 100);\n\n return (\n \n \n \n \n \n \n );\n}\n","import { lazy, memo, Suspense, useEffect, useState } from 'react';\n\nconst lazyLoadLottie: (name: string) => Promise = async (name) => {\n const lottie = (\n await import(\n /* webpackChunkName: 'lcai-tips' */\n /* webpackPrefetch: true */\n `./tips/${name}.lottie`\n )\n ).default;\n return lottie as string;\n};\n\ninterface TipProps {\n color: string;\n name: string;\n}\n\nexport const Tip = memo(({ color, name }: TipProps) => {\n const Lottie = lazy(() => import('react-lottie-player/dist/LottiePlayerLight'));\n\n const [tip, setTip] = useState();\n\n useEffect(() => {\n const loadTip = async () => {\n const tipData = await lazyLoadLottie(name);\n setTip(tipData);\n };\n\n loadTip();\n }, [name, tip]);\n\n return (\n \n \n \n );\n});\n","import isChromatic from 'chromatic';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { GetLeadCaptureProjectTemplateDataQuery } from '../../../../lead-capture.generated';\nimport { TEXT } from '../../../../utils/text-constants';\n\ninterface IUseTipsArgs {\n customSettings: GetLeadCaptureProjectTemplateDataQuery['getLeadCaptureProjectTemplateData']['customSettings'];\n}\n\nexport const useTips = ({ customSettings }: IUseTipsArgs) => {\n const [isAutoRotate, setIsAutoRotate] = useState(!(isChromatic() || CYPRESS_BUILD));\n const [currentTipIndex, setCurrentTipIndex] = useState(0);\n\n const tips = useMemo(() => getTips(customSettings), [customSettings]);\n const currentTip = tips[currentTipIndex];\n\n const prevTipHandler = () => {\n setCurrentTipIndex(currentTipIndex === 0 ? tips.length - 1 : currentTipIndex - 1);\n setIsAutoRotate(false);\n };\n\n const nextTipHandler = useCallback(\n (autoRotate: boolean = true) => {\n setCurrentTipIndex(currentTipIndex + 1 >= tips.length ? 0 : currentTipIndex + 1);\n setIsAutoRotate(autoRotate);\n },\n [tips, currentTipIndex],\n );\n\n useEffect(() => {\n let timer: NodeJS.Timer;\n if (isAutoRotate) {\n timer = setInterval(nextTipHandler, 5000);\n }\n\n return () => {\n if (timer) {\n clearInterval(timer);\n }\n };\n }, [isAutoRotate, nextTipHandler]);\n\n return {\n currentTip,\n isAutoRotate,\n nextTipHandler,\n prevTipHandler,\n };\n};\n\nexport const getTips = (\n customSettings: GetLeadCaptureProjectTemplateDataQuery['getLeadCaptureProjectTemplateData']['customSettings'],\n) => [\n {\n color: '#ffda93',\n header: customSettings?.progressPageTip1Header || TEXT?.progress?.tips?.[0].primaryHeader,\n message: customSettings?.progressPageTip1Message || TEXT?.progress?.tips?.[0].message,\n name: 'invest',\n },\n {\n color: '#d3bdf9',\n header: customSettings?.progressPageTip2Header || TEXT?.progress?.tips?.[1].primaryHeader,\n message: customSettings?.progressPageTip2Message || TEXT?.progress?.tips?.[1].message,\n name: 'decision',\n },\n {\n color: '#8fddfd',\n header: customSettings?.progressPageTip3Header || TEXT?.progress?.tips?.[2].primaryHeader,\n message: customSettings?.progressPageTip3Message || TEXT?.progress?.tips?.[2].message,\n name: 'resilience',\n },\n {\n color: '#831f57',\n header: customSettings?.progressPageTip4Header || TEXT?.progress?.tips?.[3].primaryHeader,\n message: customSettings?.progressPageTip4Message || TEXT?.progress?.tips?.[3].message,\n name: 'heating',\n },\n {\n color: '#ffda93',\n header: customSettings?.progressPageTip5Header || TEXT?.progress?.tips?.[4].primaryHeader,\n message: customSettings?.progressPageTip5Message || TEXT?.progress?.tips?.[4].message,\n name: 'prices',\n },\n];\n","import { useEffect, useState } from 'react';\nimport { Box, Flex } from 'reflexbox/styled-components';\nimport styled from 'styled-components';\n\nimport { Colors } from '@aurorasolar/common-core/src/colors';\nimport { ColoredBar } from '@aurorasolar/common-core/src/horizontal-bar';\nimport { AuroraIcon, AuroraIconType } from '@aurorasolar/common-core/src/icon';\n\nimport { LCAIText } from '../../typography/lcai-text/lcai-text';\nimport { PROGRESS_BAR_HEIGHT, PROGRESS_COLOR, PROGRESS_VALUES } from '../../utils/constants';\n\nconst ProgressStep = ({ text }: { text: string }) => {\n return (\n \n \n \n {text}\n \n \n );\n};\n\nconst ProgressContainer = styled(Box)`\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n background: ${Colors.GRAY_800};\n height: ${PROGRESS_BAR_HEIGHT};\n`;\n\nconst ProgressBar = styled(ColoredBar)`\n && {\n height: 4px;\n border-radius: 0;\n background-color: ${Colors.GRAY_800};\n\n .bp3-progress-meter {\n border-radius: 0;\n background-color: ${PROGRESS_COLOR};\n }\n }\n`;\n\ninterface ProgressStepsProps {\n roofFinish: boolean;\n panelFinish: boolean;\n productionFinish: boolean;\n}\n\nexport const ProgressSteps = ({\n roofFinish,\n panelFinish,\n productionFinish,\n}: ProgressStepsProps) => {\n const [progressValue, setProgressValue] = useState(PROGRESS_VALUES.PROGRESS_INITIAL);\n const [progressText, setProgressText] = useState('Drawing your roof');\n\n useEffect(() => {\n const timeout = setInterval(() => {\n // No special reasoning for 0.005 outside of it being just enough to show continuous progress to allow the next status to come back finished\n setProgressValue(progressValue + 0.005);\n }, 1000);\n\n return () => clearInterval(timeout);\n }, [progressValue]);\n\n useEffect(() => {\n if (roofFinish) {\n setProgressValue(PROGRESS_VALUES.PROGRESS_ROOF);\n setProgressText('Adding solar panels');\n }\n }, [roofFinish]);\n\n useEffect(() => {\n if (panelFinish) {\n setProgressValue(PROGRESS_VALUES.PROGRESS_PANEL);\n setProgressText('Finalizing free estimate');\n }\n }, [panelFinish]);\n\n useEffect(() => {\n if (productionFinish) {\n setProgressValue(PROGRESS_VALUES.PROGRESS_PRODUCTION);\n }\n }, [productionFinish]);\n\n return (\n \n \n \n \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 GetLeadCaptureProjectProgressQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type GetLeadCaptureProjectProgressQuery = { __typename: 'Query', progressData: { __typename: 'LeadCaptureProject', id: string, error?: string | null | undefined, progress?: number | null | undefined, pointCloud?: { __typename: 'LeadCapturePointCloud', id: string, progress: number } | null | undefined, image?: { __typename: 'LeadCaptureImage', id: string, progress: number } | null | undefined, site?: { __typename: 'LeadCaptureSite', id: string, progress: number } | null | undefined, scenarios: Array<{ __typename: 'LeadCaptureScenario', design?: { __typename: 'LeadCaptureDesign', id: string, progress: number } | null | undefined, performance?: { __typename: 'LeadCapturePerformance', id: string, progress: number } | null | undefined, avoidedCost?: { __typename: 'LeadCaptureAvoidedCost', id: string, progress: number } | null | undefined }> } };\n\n\nexport const GetLeadCaptureProjectProgressDocument = gql`\n query GetLeadCaptureProjectProgress($id: ID!) @trace_info(traceInfo: {pod: leads}) {\n progressData: getLeadCaptureProjectData(id: $id) {\n id\n error\n progress\n pointCloud {\n id\n progress\n }\n image {\n id\n progress\n }\n site {\n id\n progress\n }\n scenarios {\n design {\n id\n progress\n }\n performance {\n id\n progress\n }\n avoidedCost {\n id\n progress\n }\n }\n }\n}\n `;\n\n/**\n * __useGetLeadCaptureProjectProgressQuery__\n *\n * To run a query within a React component, call `useGetLeadCaptureProjectProgressQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetLeadCaptureProjectProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetLeadCaptureProjectProgressQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useGetLeadCaptureProjectProgressQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetLeadCaptureProjectProgressDocument, options);\n }\nexport function useGetLeadCaptureProjectProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetLeadCaptureProjectProgressDocument, options);\n }\nexport type GetLeadCaptureProjectProgressQueryHookResult = ReturnType;\nexport type GetLeadCaptureProjectProgressLazyQueryHookResult = ReturnType;\nexport type GetLeadCaptureProjectProgressQueryResult = Apollo.QueryResult;","import { useEffect, useState } from 'react';\nimport { Flex } from 'reflexbox/styled-components';\nimport styled from 'styled-components';\n\nimport { AuroraIcon, AuroraIconType } from '@aurorasolar/common-core/src/icon';\nimport {\n Analytics,\n AnalyticsPageTypes,\n AppRouterNavigation,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\n\nimport { useRouteData } from '../../hooks';\nimport { AnimateView, BoxWithMargin, SplitView, TopRail } from '../../shared-components';\nimport { LCAIButton, LCAIButtonIntent, LCAIText } from '../../typography';\nimport { apolloQueryErrorPropagation } from '../../utils/apollo-query-error-propagation';\nimport { HEADER_COLOR, PARAGRAPH_COLOR } from '../../utils/constants';\nimport { SourcePage } from '../../utils/source-page';\nimport { ProgressTestIds } from '../../utils/test-ids';\nimport { ProgressSpinner, Tip } from './components';\nimport { useTips } from './hooks';\nimport { ProgressSteps } from './progress-steps';\nimport { useGetLeadCaptureProjectProgressQuery } from './progress.generated';\n\nconst useDelayProgress = (\n resource: { progress: number } | null | undefined,\n previousReady: boolean,\n time = 1000,\n) => {\n // Wait for `time` ms after previous resource is ready.\n const [doneWaiting, setDoneWaiting] = useState(false);\n useEffect(() => {\n let timer: NodeJS.Timeout;\n if (previousReady) {\n timer = setTimeout(() => {\n setDoneWaiting(true);\n }, time);\n }\n return () => clearTimeout(timer);\n }, [previousReady, time]);\n\n // Then return whether the resource is ready.\n return resource?.progress === 100 && doneWaiting;\n};\n\nexport interface ProgressPageProps {\n projectId: string;\n sourcePage: SourcePage;\n}\n\nexport const ProgressPage = ({ projectId, sourcePage }: ProgressPageProps) => {\n const analytics = useAppModule(Analytics);\n const navigation = useAppModule(AppRouterNavigation);\n const { templateId, customSettings } = useRouteData();\n const { currentTip, isAutoRotate, prevTipHandler, nextTipHandler } = useTips({ customSettings });\n\n const { data, stopPolling } = useGetLeadCaptureProjectProgressQuery({\n fetchPolicy: 'network-only',\n onError: apolloQueryErrorPropagation,\n pollInterval: 500,\n variables: { id: projectId },\n });\n\n const onLoadingComplete = () => {\n navigation?.navigate(`/projects/${projectId}/cad`, { replace: true });\n };\n\n const onError = () => {\n navigation?.navigate(`/projects/${projectId}/error`, { replace: true });\n };\n\n useEffect(() => {\n analytics?.page(AnalyticsPageTypes.LeadCaptureProgress, {\n project_id: projectId,\n });\n }, [analytics, projectId]);\n\n const projectData = data?.progressData;\n const scenario = projectData?.scenarios[0];\n const roofFinish = useDelayProgress(projectData?.site, true);\n const panelFinish = useDelayProgress(scenario?.design, roofFinish);\n const productionFinish = useDelayProgress(scenario?.avoidedCost, panelFinish);\n\n const [hasError, setHasError] = useState(false);\n\n if (projectData?.error) {\n stopPolling();\n if (!hasError) {\n setHasError(true);\n onError();\n }\n }\n\n if (productionFinish) {\n stopPolling();\n setTimeout(() => {\n onLoadingComplete();\n }, 500);\n }\n\n return (\n <>\n \n \n <>\n \n \n \n \n nextTipHandler(false)}\n >\n \n \n {isAutoRotate && }\n \n }\n isProgressPage\n leftContent={\n <>\n \n {currentTip.header}\n \n \n \n {currentTip.message}\n \n \n \n }\n rightContent={}\n />\n \n \n \n \n );\n};\n\nconst PrevProgressButton = styled(LCAIButton)`\n margin-right: 6px !important;\n`;\n\nconst NextProgressButton = styled(LCAIButton)`\n margin-left: 6px !important;\n margin-right: 0 !important;\n`;\n\nexport default ProgressPage;\n","// In order for the ErrorBoundary to be able to catch Graphql errors\n// we need to re-throw the error in the context of the component\n// from the onError callback provided by the Apollo Client.\n\nexport const apolloQueryErrorPropagation = (error: Error): void => {\n if (error) {\n throw error;\n }\n};\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","var map = {\n\t\"./decision.lottie\": [\n\t\t\"./packages/lead-capture/src/pages/progress/components/tips/decision.lottie\",\n\t\t\"lcai-tips\"\n\t],\n\t\"./heating.lottie\": [\n\t\t\"./packages/lead-capture/src/pages/progress/components/tips/heating.lottie\",\n\t\t\"lcai-tips\"\n\t],\n\t\"./invest.lottie\": [\n\t\t\"./packages/lead-capture/src/pages/progress/components/tips/invest.lottie\",\n\t\t\"lcai-tips\"\n\t],\n\t\"./prices.lottie\": [\n\t\t\"./packages/lead-capture/src/pages/progress/components/tips/prices.lottie\",\n\t\t\"lcai-tips\"\n\t],\n\t\"./resilience.lottie\": [\n\t\t\"./packages/lead-capture/src/pages/progress/components/tips/resilience.lottie\",\n\t\t\"lcai-tips\"\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = \"./packages/lead-capture/src/pages/progress/components/tips lazy recursive ^\\\\.\\\\/.*\\\\.lottie$\";\nmodule.exports = webpackAsyncContext;"],"names":["ProgressSpinner","handleAdvance","timeout","progress","setProgress","useState","cb","useRef","useEffect","current","invocations","innerHandle","setInterval","outerHandle","clearInterval","arcLength","Math","PI","center","arcOffset","theme","x","svg","display","fill","h","ml","opacity","transform","transitionDuration","transitionProperty","transitionTimingFunction","verticalAlign","viewBox","w","circle","cx","size","cy","r","stroke","strokeDashoffset","strokeWidth","style","strokeDasharray","Tip","memo","color","name","Lottie","lazy","tip","setTip","async","tipData","default","lazyLoadLottie","loadTip","Suspense","fallback","className","loop","path","play","rendererSettings","preserveAspectRatio","backgroundColor","height","width","getTips","customSettings","header","progressPageTip1Header","tips","primaryHeader","message","progressPageTip1Message","progressPageTip2Header","progressPageTip2Message","progressPageTip3Header","progressPageTip3Message","progressPageTip4Header","progressPageTip4Message","progressPageTip5Header","progressPageTip5Message","ProgressStep","text","alignItems","flexDirection","m","p","fillColor","PROGRESS_SPINNER","spin","weight","WHITE","fontWeight","marginLeft","type","ProgressContainer","GRAY_800","ProgressBar","ProgressSteps","roofFinish","panelFinish","productionFinish","progressValue","setProgressValue","PROGRESS_INITIAL","progressText","setProgressText","PROGRESS_ROOF","PROGRESS_PANEL","PROGRESS_PRODUCTION","stripes","value","defaultOptions","GetLeadCaptureProjectProgressDocument","useDelayProgress","resource","previousReady","time","doneWaiting","setDoneWaiting","timer","setTimeout","clearTimeout","ProgressPage","projectId","sourcePage","analytics","navigation","templateId","currentTip","isAutoRotate","prevTipHandler","nextTipHandler","setIsAutoRotate","isChromatic","currentTipIndex","setCurrentTipIndex","useMemo","useCallback","autoRotate","length","useTips","data","stopPolling","baseOptions","options","useGetLeadCaptureProjectProgressQuery","fetchPolicy","onError","pollInterval","variables","id","page","LeadCaptureProgress","project_id","projectData","progressData","scenario","scenarios","site","design","avoidedCost","hasError","setHasError","error","navigate","replace","buttons","PrevProgressButton","PREV_TIP_BUTTON","intent","SECONDARY_LIGHT","onClick","flip","BTN_ARROW","NextProgressButton","NEXT_TIP_BUTTON","isProgressPage","leftContent","rightContent","apolloQueryErrorPropagation","TEXT","common","endFlowButton","alternatePrimaryButtonText","subheader","landing","profileComplete","primaryButtonText","profileReview","quote","disclaimer","results","secondaryHeader","map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","keys","Object","module","exports"],"sourceRoot":""}