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Y1B,EAAI0B,SAAW,SAMlE,OALKL,EAAIC,KAAWD,EAAIC,GAAY,IACpCD,EAAIC,GAAUxJ,KAAK,CACjB+B,IAAKmG,EAAI0B,SACTX,aAAcf,EAAIiB,UAEbI,IACN,KAaE,SAAeM,EAAtB,oC,wCAAO,WAA6BC,EAAYpJ,GAAzC,gGAEqBoJ,EAAMC,OAF3B,cAEGC,EAFH,yBAGIZ,EACLY,EAAU/L,QAAU+L,EAAUC,eAC9BvJ,IALC,yDAQIwI,EAAyBY,IAR7B,0D,sBAYA,SAASI,EACdC,EACAC,GAEAX,OAAOC,KAAKS,GAAkBE,SAAQ,SAACb,GACjB,oBAAbY,GACLA,EAASZ,EAAU,CACjBL,QAASgB,EAAiBX,GAAU,GAAGP,oB,uBCvE1CqB,OAAOC,SAAWD,OAAOC,UAAY,IAAIvK,KAAK,CAC7C,aACA,WACE,OAAO,EAAQ,Y","sources":["webpack://_N_E/./pages/locations.tsx","webpack://_N_E/./src/components/layout/Form.tsx","webpack://_N_E/./src/components/layout/PageContent.tsx","webpack://_N_E/./src/components/shared/AccessibleLocation.tsx","webpack://_N_E/./src/components/shared/LaneInfo.tsx","webpack://_N_E/./src/components/shared/Modal.tsx","webpack://_N_E/./src/components/shared/Spinner.tsx","webpack://_N_E/./src/components/shared/TopBanner.tsx","webpack://_N_E/./src/hooks/useTokenVerification.ts","webpack://_N_E/./src/hooks/useSessionTimer.ts","webpack://_N_E/./src/utils/apiErrorMessages.tsx","webpack://_N_E/?c5e8"],"sourcesContent":["import React, { ChangeEvent, useCallback, useEffect, useState } from 'react'\n\nimport { useRouter } from 'next/router'\nimport { Box, Button, Flex, Text, Link, InputGroup } from '@clear/design-system'\nimport { Map } from '@components/storybook'\nimport PageContent from '@components/layout/PageContent'\nimport Spinner from '@components/shared/Spinner'\nimport TopBanner from '@components/shared/TopBanner'\nimport getEnrollmentLocations from '@api/getEnrollmentLocations'\nimport {\n determineMapZoomLevel,\n getNearbyEnrollmentLocations,\n EnrollmentLocation,\n} from '@utils/getNearbyEnrollmentLocations'\nimport { useEnrollmentContext } from '@components/EnrollmentContext'\nimport { HeadTitle } from '@components/layout/HeadTitle'\nimport { getGlobalErrorMessage } from '@utils/apiErrorMessages'\nimport { ErrorMessage } from '@components/layout/Form'\nimport { useJsApiLoader } from '@react-google-maps/api'\nimport { GeoLocate } from '@components/shared/GeoLocate'\nimport { LaneInfo } from '@components/shared/LaneInfo'\n\nconst LocationsPage: React.FC = () => {\n const router = useRouter()\n const { setSelectedPlan } = useEnrollmentContext()\n const [isLoading, setIsLoading] = useState(false)\n const [errors] = useState({})\n const [searchLocation, setSearchLocation] = useState<\n google.maps.LatLng | google.maps.LatLngLiteral | null\n >(null)\n const [searchInput, setSearchInput] = useState('')\n const [mapSearchError, setMapSearchError] = useState(false)\n const [enrollmentLocations, setEnrollmentLocations] =\n useState>()\n const [locationsWithinRange, setLocationsWithinRange] = useState<\n EnrollmentLocation[]\n >([])\n\n const handleSearch = useCallback(\n async (searchCriteria: string) => {\n setIsLoading(true)\n try {\n setIsLoading(true)\n const { enrollmentLocationsNearSearch, location } =\n await getNearbyEnrollmentLocations(\n enrollmentLocations,\n searchInput || searchCriteria\n )\n const sortedEnrollmentLocationsNearSearch =\n enrollmentLocationsNearSearch.sort((a, b) => a.distance - b.distance)\n setLocationsWithinRange(sortedEnrollmentLocationsNearSearch)\n setSearchLocation(location)\n setIsLoading(false)\n setSearchInput('')\n } catch (e) {\n console.log(e)\n setIsLoading(false)\n setMapSearchError(true)\n }\n },\n [\n setLocationsWithinRange,\n setSearchLocation,\n setMapSearchError,\n searchInput,\n enrollmentLocations,\n setIsLoading,\n ]\n )\n\n const { isLoaded } = useJsApiLoader({\n id: 'google-map-script',\n googleMapsApiKey: process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY || '',\n })\n\n const handleSelectPlan = async (plan: string) => {\n setSelectedPlan(plan)\n await router.push(\n `/enroll/you${router.query.test === 'true' ? '?test=true' : ''}`\n )\n }\n\n const updateSearchBar = useCallback(\n (e: ChangeEvent) => {\n setSearchInput(e.target.value)\n },\n [setSearchInput]\n )\n\n useEffect(() => {\n const fetchData = async () => {\n const response = await getEnrollmentLocations()\n setEnrollmentLocations(response.data)\n }\n fetchData()\n }, [])\n\n useEffect(() => {\n if (\n router.query.code &&\n enrollmentLocations &&\n !locationsWithinRange.length &&\n !isLoading &&\n isLoaded\n ) {\n const codeQuery =\n typeof router.query.code === 'string' ? router.query.code : ''\n setSearchInput(codeQuery)\n handleSearch(codeQuery)\n }\n }, [\n enrollmentLocations,\n handleSearch,\n isLoaded,\n isLoading,\n locationsWithinRange.length,\n router.query.code,\n ])\n\n const geoLocateSuccessHandler = (position: GeolocationPosition) => {\n handleSearch(`${position.coords.latitude},${position.coords.longitude}`)\n }\n\n const handleKeyDown = (e: any) => {\n if (e.key === 'Enter') {\n handleSearch(searchInput)\n }\n }\n\n return (\n <>\n \n \n \n \n \n \n Find an Enrollment Location\n \n \n <>\n \n {\n handleKeyDown(e)\n }}\n iconClick={() => handleSearch(searchInput)}\n onChange={updateSearchBar}\n label=\"Search for locations\"\n value={searchInput}\n placeholder=\"Zip / City / Airport Code\"\n autoComplete=\"off\"\n data-cy=\"searchBar\"\n />\n \n \n {mapSearchError && (\n \n Sorry, that's not a valid search. Please try again.\n \n )}\n {locationsWithinRange.length ? (\n \n \n {locationsWithinRange?.map((location: EnrollmentLocation) => (\n \n \n {location?.name}\n \n \n {location?.distance} miles away •{' '}\n \n {location?.address}\n \n \n \n Open Daily\n \n \n {location?.lanes.map(\n ({\n name,\n description,\n isAccessible,\n availability,\n id,\n }) => (\n \n )\n )}\n \n \n ))}\n \n {isLoaded ? (\n \n \n \n ) : (\n <>Loading google maps\n )}\n \n ) : null}\n \n \n \n \n No locations found\n \n \n Please adjust your search for better results or visit the{' '}\n \n TSA website\n {' '}\n for more enrollment location options.\n \n \n \n \n\n \n {locationsWithinRange && locationsWithinRange[0]?.distance > 40 && (\n \n \n Need a closer location?\n \n \n Visit the{' '}\n \n TSA website\n {' '}\n for more enrollment location options.\n \n \n )}\n \n To expedite in-person enrollment, fill out an application online\n before heading to an enrollment location near you. If you choose\n not to complete an online application, you can still enroll\n in-person at one of our enrollment locations—no appointment\n needed. Be sure to bring any required documentation with you. Find\n out what to bring under the Application section of FAQs{' '}\n \n here\n \n .\n \n handleSelectPlan('tpc-enroll-5-plan')}\n data-cy=\"enroll-button\"\n />\n \n {isLoading && }\n {getGlobalErrorMessage(errors) && (\n {getGlobalErrorMessage(errors)}\n )}\n \n \n \n )\n}\n\nexport default LocationsPage\n","import React, { FormHTMLAttributes } from 'react'\nimport { Text, TextProps, Flex, FlexProps } from '@clear/design-system'\n\ntype FormProps = FlexProps & FormHTMLAttributes\n\nexport const Form: React.FC = (props) => (\n \n)\n\nexport const Row: React.FC = (props) => (\n \n)\n\nexport const Actions: React.FC = (props) => (\n \n)\n\nexport const StepTitle: React.FC = (props) => (\n \n)\n\nexport const StepSubTitle: React.FC = (props) => (\n \n)\n\nexport const ErrorMessage = React.forwardRef(\n ({ children, ...props }, ref) => (\n \n Error: {children}\n \n )\n)\n\nErrorMessage.displayName = 'ErrorMessage'\n","import React, { useState, useEffect } from 'react'\nimport { useRouter } from 'next/router'\nimport { Box, BoxProps } from '@clear/design-system'\nimport { Modal } from '@components/shared/Modal'\nimport useEnrollmentApi from '@hooks/useEnrollmentApi'\nimport { useSessionTimer } from '@hooks/useSessionTimer'\n\ntype PageContentProps = BoxProps\nconst PageContent: React.FC = ({ ...props }) => {\n const { clearState: clearEnrollmentState } = useEnrollmentApi()\n const router = useRouter()\n const sessionTimeout =\n (router && router.query && router.query.sessionTimeout) || ''\n const pathname = (router && router.pathname) || ''\n const [showSessionModal, setShowSessionModal] = useState(false)\n\n const successClickFunction = () => {\n router.push('/')\n }\n\n useEffect(() => {\n const shouldShowModal = sessionTimeout === 'true' && pathname !== '/'\n if (shouldShowModal) {\n setShowSessionModal(true)\n }\n }, [pathname, sessionTimeout])\n\n useSessionTimer(clearEnrollmentState)\n\n return (\n \n \n \n \n )\n}\n\nexport default PageContent\n","import React from 'react'\nimport { Text } from '@clear/design-system'\n\nexport const AccessibleLocation = () => {\n return (\n \n \n \"Accessible\n Accessible Enrollment Location\n \n \n )\n}\n","import React from 'react'\nimport { Box, Text } from '@clear/design-system'\nimport { AccessibleLocation } from './AccessibleLocation'\n\ninterface Availability {\n days?: string\n hours: string\n}\n\nexport interface LaneInfo {\n name: string\n description: string\n isAccessible: boolean\n availability: Availability[]\n id: number\n}\n\nexport const LaneInfo = ({\n name,\n description,\n isAccessible,\n availability,\n}: LaneInfo) => {\n return (\n <>\n \n {name}\n \n {description}\n \n {availability.map(({ hours, days }) => (\n
\n {days && {days}} {hours}\n
\n ))}\n
\n {isAccessible && }\n \n )\n}\n","import React, { SetStateAction, ReactNode } from 'react'\nimport { Flex, Text, Button } from '@clear/design-system'\nimport { ColorType } from '@clear/design-system/lib/theme/colors'\nimport Link from 'next/link'\n\nexport interface ModalProps {\n header?: string\n body: string | ReactNode\n bodyNote?: string\n showModal: boolean\n setShowModal: React.Dispatch>\n canClose?: boolean\n successButtonText?: string\n closeButtonText?: string\n successLink?: string\n successClick?: () => void\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {}\n\nexport function Modal(props: ModalProps) {\n const {\n header,\n body,\n bodyNote,\n showModal,\n setShowModal,\n canClose,\n successButtonText = 'success',\n successLink,\n successClick,\n } = props\n\n const handleCloseModal = () => setShowModal(false)\n\n return (\n <>\n {showModal ? (\n <>\n \n e.stopPropagation()}\n mx={[6, null]}\n >\n {/* header */}\n \n {header && (\n \n {header}\n \n )}\n \n {body}\n \n {bodyNote && (\n \n {bodyNote}\n \n )}\n \n \n {successLink ? (\n \n \n \n ) : (\n \n )}\n \n
\n \n
\n \n ) : null}\n \n )\n}\n","import React from 'react'\n\nexport default function Spinner() {\n return (\n
\n
\n
\n
\n
\n
\n \n
\n
\n )\n}\n","import React from 'react'\nimport { Banner } from '@components/storybook'\n\nconst TopBanner = () => (\n \n)\n\nexport default TopBanner\n","import { useRouter } from 'next/router'\nimport { useEffect } from 'react'\nimport { getAccessToken, setAccessToken } from '@api/utils'\n\nconst beforeUnloadListener = (event: any) => {\n event.preventDefault()\n return (event.returnValue = 'Are you sure you want to exit?')\n}\n\nexport function useTokenVerification(disabled = false) {\n const router = useRouter()\n\n useEffect(() => {\n if (!disabled) {\n try {\n const token = getAccessToken()\n if (token) {\n addEventListener('beforeunload', beforeUnloadListener, {\n capture: true,\n })\n }\n } catch (err) {\n console.log({ tokenError: err })\n setAccessToken('')\n router.push('/')\n }\n return () => {\n removeEventListener('beforeunload', beforeUnloadListener, {\n capture: true,\n })\n }\n }\n }, [router, disabled])\n}\n","import { useRouter } from 'next/router'\nimport { useIdleTimer } from 'react-idle-timer'\nimport { useTokenVerification } from './useTokenVerification'\nimport { setAccessToken, setSessionId } from '@api/utils'\n\nconst FIFTEEN_MINUTES_IN_MILLIS = 1000 * 60 * 15\n\nexport const getInactivityTimeout = (\n INACTIVITY_TIMEOUT = FIFTEEN_MINUTES_IN_MILLIS\n) => INACTIVITY_TIMEOUT\n\nexport function useSessionTimer(\n timeoutCallback?: () => void,\n disableTokenVerification?: boolean,\n inactivityTimeout?: number\n) {\n const router = useRouter()\n\n useTokenVerification(disableTokenVerification)\n\n const sessionTimeoutHandler = async () => {\n timeoutCallback && timeoutCallback()\n // Sign out of cognito\n setAccessToken('')\n setSessionId('')\n await router.push(\n {\n pathname: router.route,\n query: { sessionTimeout: 'true' },\n },\n undefined,\n { shallow: true }\n )\n }\n\n const idleTimerFunctions = useIdleTimer({\n timeout: getInactivityTimeout(inactivityTimeout),\n onIdle: sessionTimeoutHandler,\n debounce: 500,\n })\n\n return {\n ...idleTimerFunctions,\n sessionTimeoutHandler,\n }\n}\n","import { Enrollment } from '@clear-denver/tpc-openapi-typescript'\n\ninterface ErrorMessage {\n key: string\n errorMessage: string\n}\n\nexport const getGlobalErrorMessage = (errors: any) => {\n return errors?.global?.length ? errors?.global[0].errorMessage : undefined\n}\n\nexport const createGlobalErrorMessage = (e: any) => {\n const globalError = {\n global: [\n {\n key: 'global',\n errorMessage: e.message,\n },\n ],\n }\n return globalError\n}\n\nexport interface ErrorsByProperty {\n [key: string]: Array\n}\n\nexport const getApiErrorsByProperty = (\n errors: Array,\n formState: { [key: string]: any }\n): ErrorsByProperty => {\n const errorsByProperty = errors.reduce((acc: any, err: any) => {\n const formKeys = Object.keys(formState)\n const errorKey = formKeys.includes(err.property) ? err.property : 'global'\n if (!acc[errorKey]) acc[errorKey] = []\n acc[errorKey].push({\n key: err.property,\n errorMessage: err.message,\n })\n return acc\n }, {})\n\n return errorsByProperty\n}\n\nexport async function extractErrors(\n error: Response,\n data: any\n): Promise\nexport async function extractErrors(\n error: Error,\n data: any\n): Promise\nexport async function extractErrors(error: any, data: any) {\n try {\n const errorBody = await error.json()\n return getApiErrorsByProperty(\n errorBody.errors || errorBody.businessErrors,\n data\n )\n } catch {\n return createGlobalErrorMessage(error)\n }\n}\n\nexport function setFormErrors(\n errorsByProperty: ErrorsByProperty,\n setError: T\n) {\n Object.keys(errorsByProperty).forEach((errorKey) => {\n typeof setError === 'function' &&\n setError(errorKey, {\n message: errorsByProperty[errorKey][0].errorMessage,\n })\n })\n}\n","\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/locations\",\n function () {\n return require(\"private-next-pages/locations.tsx\");\n }\n ]);\n "],"names":["router","useRouter","setSelectedPlan","useEnrollmentContext","useState","isLoading","setIsLoading","errors","searchLocation","setSearchLocation","searchInput","setSearchInput","mapSearchError","setMapSearchError","enrollmentLocations","setEnrollmentLocations","locationsWithinRange","setLocationsWithinRange","handleSearch","useCallback","searchCriteria","getNearbyEnrollmentLocations","enrollmentLocationsNearSearch","location","sortedEnrollmentLocationsNearSearch","sort","a","b","distance","console","log","isLoaded","useJsApiLoader","id","googleMapsApiKey","process","handleSelectPlan","plan","push","query","test","updateSearchBar","e","target","value","useEffect","getEnrollmentLocations","response","data","fetchData","code","length","codeQuery","title","description","flexDirection","mt","textAlign","mb","as","variant","color","fontSize","display","alignItems","justifyContent","width","icon","onKeyDown","key","handleKeyDown","iconClick","onChange","label","placeholder","autoComplete","onSuccessHandler","position","coords","latitude","longitude","pr","map","name","href","encodeURI","address","className","lanes","isAccessible","availability","airportCode","height","center","zoom","determineMapZoomLevel","locationMarkers","full","ml","src","alt","pb","text","textProps","onClick","getGlobalErrorMessage","Form","props","Row","mx","Actions","StepTitle","StepSubTitle","my","ErrorMessage","React","ref","children","displayName","clearEnrollmentState","useEnrollmentApi","clearState","sessionTimeout","pathname","showSessionModal","setShowSessionModal","useSessionTimer","px","showModal","setShowModal","header","body","successButtonText","successClick","canClose","AccessibleLocation","LaneInfo","hours","days","noop","Modal","bodyNote","successLink","p","backgroundColor","stopPropagation","passHref","size","Spinner","backgroundImage","heading","subHeading","gradientStart","showGradient","beforeUnloadListener","event","preventDefault","returnValue","FIFTEEN_MINUTES_IN_MILLIS","getInactivityTimeout","INACTIVITY_TIMEOUT","timeoutCallback","disableTokenVerification","inactivityTimeout","disabled","getAccessToken","addEventListener","capture","err","tokenError","setAccessToken","removeEventListener","useTokenVerification","sessionTimeoutHandler","setSessionId","route","undefined","shallow","useIdleTimer","timeout","onIdle","debounce","global","errorMessage","createGlobalErrorMessage","message","getApiErrorsByProperty","formState","reduce","acc","errorKey","Object","keys","includes","property","extractErrors","error","json","errorBody","businessErrors","setFormErrors","errorsByProperty","setError","forEach","window","__NEXT_P"],"sourceRoot":""}