{"version":3,"file":"index-1540d9fe.js","sources":["../../../../src/scripts/react-components/distributor-locator/distributor-filters.tsx","../../../../src/scripts/react-components/distributor-locator/index.tsx"],"sourcesContent":["import React from 'react';\nimport PropTypes, { InferProps } from 'prop-types';\n\nfunction DistributorFilters({\n  selectedDistributorTypes,\n  allDistributorTypes,\n  distributorTypesLabels,\n  filtersLabel\n}: InferProps<typeof DistributorFilters.propTypes>) {\n  const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n    const selectedDistributorType = event.target.name.split('-')[1];\n\n    dispatchEvent(\n      new CustomEvent('distributorFiltersChanged', {\n        detail: {\n          selectedDistributorTypes: selectedDistributorTypes,\n          selectedDistributorType: selectedDistributorType\n        },\n        bubbles: true\n      })\n    );\n  };\n\n  return (\n    <div className=\"distributor-filters\">\n      <div className=\"distributor-filters__container\">\n        <div className=\"distributor-filters__heading\">\n          <label\n            className=\"distributor-filters__label field__label\"\n            htmlFor=\"distributor-filters\"\n          >\n            {filtersLabel}\n          </label>\n        </div>\n        <div className=\"distributor-filters__content-wrapper\">\n          <ul className=\"distributor-filters__list\">\n            {allDistributorTypes.map((type, index) => {\n              return (\n                <li key={index} className=\"distributor-filters__list-item\">\n                  <div className=\"field field--checkbox distributor-filters__checkbox\">\n                    <input\n                      className=\"field__checkbox-input\"\n                      type=\"checkbox\"\n                      name={`checkbox-${type}-${index}`}\n                      id={`checkbox-${type}-${index}`}\n                      checked={selectedDistributorTypes.includes(type)}\n                      onChange={handleOnChange}\n                      disabled={false}\n                    />\n                    <div className=\"field__checkbox-label-wrapper\">\n                      <label\n                        className=\"field__checkbox-label distributor-filters__checkbox-label\"\n                        htmlFor={`checkbox-${type}-${index}`}\n                      >\n                        {type ? distributorTypesLabels[index] : ''}\n                      </label>\n                    </div>\n                  </div>\n                </li>\n              );\n            })}\n          </ul>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nDistributorFilters.propTypes = {\n  distributorType: PropTypes.string.isRequired,\n  selectedDistributorTypes: PropTypes.arrayOf(PropTypes.string).isRequired,\n  allDistributorTypes: PropTypes.arrayOf(PropTypes.string).isRequired,\n  filtersLabel: PropTypes.string.isRequired,\n  distributorTypesLabels: PropTypes.arrayOf(PropTypes.string).isRequired\n};\n\nexport default DistributorFilters;\n","import React, { useId, useEffect, useState } from 'react';\nimport PropTypes, { InferProps } from 'prop-types';\nimport { useFetch } from '../../hooks/useFetch';\nimport { GeolocationType } from '../../helpers/global-storage';\nimport {\n  COUNTRY_VALUES,\n  getLocationDataFromLatLong,\n  getLatLongFromZip,\n  getGeolocationDataFromBrowserAndGoogle,\n  getLocationByIpAddress,\n  updateGeolocationDataProperties,\n  getZipAndCountryFromUrl,\n  getStoredGeolocationCountryAndZip\n} from '../../helpers/geolocation';\n\nimport {\n  getUrlParamValue,\n  setUrlParamValue,\n  updateEndpointWithQueryString,\n  setUrlParams\n} from '../../helpers/queryString';\n\nimport DistributorCard from './distributor-card';\nimport DistributorMap from './distributor-map';\nimport DistributorFilters from './distributor-filters';\nimport Pagination from '../pagination';\nimport Loader from '../listing-states/loader';\nimport Error from '../listing-states/error';\nimport ZipForm from '../zip-form';\nimport ToggleSwitch from '../toggle-switch';\nimport { isTabletLandscape } from '../../helpers/breakpoints';\nimport { debounce } from '../../helpers/debounce';\nimport { ExtendedWindowType } from '../../helpers/global-types';\n\ninterface DynamicData {\n  Address1: string;\n  Address2: string;\n  City: string;\n  DistributorTypeDisplayName: string;\n  Fax: string;\n  Phone: string;\n  PostalCode: string;\n  ProductTypes: string[];\n  State: string;\n  StoreNumber: string;\n  Website: string;\n}\ninterface DistributorCardItems {\n  name: string;\n  latitude: number;\n  longitude: number;\n  milesFromSearchPoint: number;\n  customerId: string;\n  distributorId: string;\n  distributorType: string;\n  dynamicData: DynamicData;\n}\n\ninterface DistributorResponse {\n  page: number;\n  pageSize: number;\n  latitude: number;\n  longitude: number;\n  searchRadius: number;\n  totalResultCount: number;\n  distributors: DistributorCardItems[];\n}\n\ntype DistanceOptions = {\n  title: string;\n  values: {\n    value: number;\n    label: string;\n    default?: boolean;\n  }[];\n};\n\ntype DistributorTypes = {\n  residential: {\n    value: string;\n    label: string;\n  }[];\n  comercial: {\n    value: string;\n    label: string;\n  }[];\n};\n\nlet lastWidth = window.innerWidth;\n\ntype SchemaItem = {\n  '@type': string;\n  position: number;\n  item: {\n    '@type': string;\n    name: string;\n    url: string;\n    logo: string;\n    contactPoint: {\n      '@type': string;\n      telephone: string;\n      contactType: string;\n      areaServed: string;\n    };\n  };\n};\n\nfunction DistributorLocator({\n  endpointUrl,\n  loadingLabel,\n  noResultsMessage,\n  noResultsKeywordMessage,\n  noResultsAdditionalMessage,\n  errorMessage,\n  zipPlaceholders,\n  zipRegex,\n  defaultZipLocation,\n  zipInvalidMessage,\n  defaultValues,\n  distanceOptions,\n  toggleResidentialLabel,\n  toggleCommercialLabel,\n  distributorTypes,\n  defaultToggleValue,\n  defaultCountry,\n  getDirectionsLabel,\n  filtersLabel,\n  googleMapsApiKey,\n  nextPageLabel,\n  previousPageLabel,\n  pageLabel,\n  websiteLabel,\n  searchThisAreaLabel,\n  imagesPath\n}: InferProps<typeof DistributorLocator.propTypes>) {\n  // Variables and States ----------------------------------------------------\n  const placeholders = JSON.parse(zipPlaceholders);\n  const regex = JSON.parse(zipRegex);\n  const defaultLocation = JSON.parse(defaultZipLocation);\n  const defaultParams = JSON.parse(defaultValues);\n  const defaultDistanceOptions = JSON.parse(distanceOptions) as DistanceOptions;\n  const allDistributorTypes = JSON.parse(distributorTypes) as DistributorTypes;\n  const selectId = useId();\n\n  const [noResults, setNoResults] = useState(false);\n  const [userInteracted, setUserInteracted] = useState(false);\n  const [loadingComplete, setLoadingComplete] = useState(false);\n  const [distance, setDistance] = useState(\n    getUrlParamValue('searchRadiusInMiles') ||\n      defaultDistanceOptions.values.find(val => val.default)?.value ||\n      '50'\n  );\n  const [locationData, setLocationData] = useState<GeolocationType | null>(\n    null\n  );\n  const [toggleValue, setToggleValue] = useState<string>(defaultToggleValue);\n  const [toggleSwitchKey, setToggleSwitchKey] = useState(0);\n  const [distributorFiltersChanged, setDistributorFiltersChanged] =\n    useState<string>('');\n  const distributorTypesFromUrl = getUrlParamValue('selectedTypes');\n  let selectedDistributorTypes =\n    distributorTypesFromUrl?.split(',') ||\n    allDistributorTypes[defaultToggleValue as keyof DistributorTypes].map(\n      type => type.value\n    );\n  let pageLoad = true;\n  const pageParam = getUrlParamValue('page');\n  const [page, setPage] = useState(Number(pageParam) || 1);\n  const [endpoint, setEndpoint] = useState('');\n  const { data, error } = useFetch<DistributorResponse>(endpoint);\n  enum TabOption {\n    List = 'list',\n    Map = 'map'\n  }\n  const [activeTab, setActiveTab] = useState<TabOption>(TabOption.List);\n\n  const getDistributorLocatorLocationData = async () => {\n    // Data from URL\n    const dataFromUrl = getZipAndCountryFromUrl();\n    if (dataFromUrl) {\n      return dataFromUrl;\n    }\n    // Stored Data\n    const storedData = getStoredGeolocationCountryAndZip();\n    if (storedData) {\n      storedData.zip = storedData.zip.split('-')[0];\n      return storedData;\n    }\n    // Maxmind Data\n    const maxmindData = await getLocationByIpAddress();\n    if (maxmindData) {\n      return maxmindData;\n    }\n    // Browser Data\n    const browserData = await getGeolocationDataFromBrowserAndGoogle();\n    if (browserData) {\n      return browserData;\n    }\n\n    return null;\n  };\n\n  // Functions ----------------------------------------------------------------\n  const fillLocationData = async () => {\n    let location = {\n      country: defaultCountry,\n      zip: defaultLocation[defaultCountry]\n    };\n\n    const locationData: GeolocationType | null =\n      await getDistributorLocatorLocationData();\n\n    if (locationData) {\n      location = {\n        country: locationData.country,\n        zip: locationData.zip\n      };\n      (window as ExtendedWindowType).dataLayer.push({\n        event: 'zip_code',\n        event_action: 'zip code automatically detected',\n        event_category: 'geo info',\n        event_attributes: {\n          zip_code: location.zip,\n          zip_code_country: location.country.toLowerCase()\n        }\n      });\n    } else {\n      // Get default location\n      location = {\n        country: defaultCountry,\n        zip: defaultLocation[defaultCountry]\n      };\n    }\n\n    setLocationData(location);\n  };\n\n  const handleTabChange = (selectedTab: TabOption) => {\n    setActiveTab(selectedTab);\n  };\n\n  const calcTotalPages = (totalResults: number, pageSize: number) => {\n    return Math.ceil(totalResults / pageSize);\n  };\n\n  const pageSummary = (totalResults: number, pageSize: number) => {\n    let returnSummary = `Showing`;\n    if (page === 1) {\n      returnSummary += ` <strong>1</strong> `;\n    } else {\n      returnSummary += ` <strong>${pageSize * (page - 1) + 1} </strong>`;\n    }\n    if (pageSize * page > totalResults) {\n      returnSummary += `- <strong>${totalResults}</strong> of <strong>${totalResults}</strong> Results for <span class=\"distributor-locator__summary--type\">${toggleValue}</span>`;\n    } else {\n      returnSummary += `- <strong>${\n        pageSize * page\n      }</strong> of <strong>${totalResults}</strong> Results for <span class=\"distributor-locator__summary--type\">${toggleValue}</span>`;\n    }\n    return returnSummary;\n  };\n\n  const updateLocationValues = async () => {\n    if (getUrlParamValue('selectedTypes') === 'undefined') {\n      callAllToggleDistributorTypes();\n    }\n\n    if (locationData) {\n      const { latitude, longitude } = await getLatLongFromZip(\n        locationData.zip,\n        locationData.country\n      );\n\n      if (userInteracted) {\n        updateGeolocationDataProperties({\n          latitude,\n          longitude,\n          country: locationData.country,\n          zip: locationData.zip\n        });\n      }\n\n      setUrlParams({\n        latitude,\n        longitude,\n        page: page,\n        tenant: defaultParams.tenant,\n        searchRadiusInMiles: distance,\n        pageSize: isTabletLandscape\n          ? defaultParams.pageSizeMobile\n          : defaultParams.pageSizeDesktop\n      });\n\n      callAllToggleDistributorTypes(pageLoad ? undefined : toggleValue);\n    }\n  };\n\n  const callAllToggleDistributorTypes = (value?: string) => {\n    let queryStrings = '';\n\n    if (value) {\n      const distributorTypes =\n        allDistributorTypes[value as keyof DistributorTypes];\n      queryStrings = distributorTypes\n        .map((distributorType: { value: string }) => {\n          return `&DistributorTypes=${distributorType.value}`;\n        })\n        .join('');\n      selectedDistributorTypes = distributorTypes.map(d => d.value);\n      setUrlParamValue(\n        'selectedTypes',\n        distributorTypes.map(d => d.value).join(',')\n      );\n    } else {\n      pageLoad = false;\n      queryStrings = selectedDistributorTypes\n        .map(type => `&DistributorTypes=${type}`)\n        .join('');\n      setUrlParamValue('selectedTypes', selectedDistributorTypes.join(','));\n    }\n    updateToggleSwitch();\n    setEndpoint(`${updateEndpointWithQueryString(endpointUrl)}${queryStrings}`);\n  };\n\n  const handleZipSubmit = (zip: string, country: string) => {\n    setNoResults(false);\n    setUserInteracted(true);\n\n    setNoResults(false);\n    //set new lat long from zip\n    setLocationData({\n      country,\n      zip\n    });\n    // if new location data is setted, then update endpoint\n    if (locationData) {\n      setEndpoint(\n        `${updateEndpointWithQueryString(\n          endpointUrl\n        )}&zip=${zip}&country=${country}`\n      );\n    }\n  };\n\n  const handleToggleChange = (value: string) => {\n    setNoResults(false);\n\n    callAllToggleDistributorTypes(value);\n    setToggleValue(value);\n    setPage(1);\n  };\n\n  const handlePageChange = (newPage: number) => {\n    setPage(newPage);\n    setUrlParamValue('page', page.toString());\n    updateLocationValues();\n  };\n\n  const handleDistanceChange = (\n    event: React.ChangeEvent<HTMLSelectElement>\n  ) => {\n    const selectedValue = event.target.value;\n    setDistance(selectedValue);\n    setPage(1);\n  };\n\n  const handleResize = () => {\n    //only if is width resize\n    if (window.innerWidth !== lastWidth) {\n      lastWidth = window.innerWidth;\n      const randomString = Math.random().toString(36).substring(7);\n      setDistributorFiltersChanged(randomString);\n    }\n  };\n\n  const handleSearchThisArea = async (event: CustomEvent) => {\n    (window as ExtendedWindowType).dataLayer.push({\n      event: 'locator_search_area',\n      event_category: 'search this area',\n      event_action: 'distributor locator',\n      event_attributes: {\n        distance_filter: distance\n      }\n    });\n\n    try {\n      const { latitude, longitude } = event.detail;\n      setUrlParams({\n        latitude,\n        longitude\n      });\n\n      const data = await getLocationDataFromLatLong(latitude, longitude);\n\n      if (data) {\n        //if there is data different from undefined, then set the url params\n        if (data.zip !== undefined) {\n          setNoResults(false);\n          setUrlParams({\n            zip: data.zip,\n            country: data.country\n          });\n          setLocationData(data);\n        } else {\n          setNoResults(true);\n          //clear the url params\n          setUrlParams({\n            zip: '',\n            country: '',\n            latitude: '',\n            longitude: ''\n          });\n        }\n        setPage(1); //to refresh the results\n      }\n    } catch (error) {\n      console.error(' There is an error: ', error);\n      const dataWithNoResults = {\n        country: 'US',\n        zip: '00000'\n      };\n      setLocationData(dataWithNoResults);\n      setNoResults(true);\n    }\n  };\n\n  const handleZoomChanged = () => {\n    const selectElement = document.getElementById(\n      selectId\n    ) as HTMLSelectElement;\n    if (selectElement) {\n      selectElement.value = 'custom';\n    }\n  };\n  const updateToggleSwitch = async () => {\n    const distributorTypesFromUrl = getUrlParamValue('selectedTypes');\n    const selectedDistributorTypes =\n      distributorTypesFromUrl?.split(',') ||\n      allDistributorTypes[defaultToggleValue as keyof DistributorTypes].map(\n        type => type.value\n      );\n    if (selectedDistributorTypes.includes('LSDISTRIB')) {\n      setToggleValue('commercial');\n      // Increment the key to remount the ToggleSwitch component\n      setToggleSwitchKey(prevKey => prevKey + 1);\n    }\n  };\n\n  const filterEventListener = (event: CustomEvent) => {\n    const selectedDistributorTypes = event.detail.selectedDistributorTypes;\n    const selectedDistributorType = event.detail.selectedDistributorType;\n    const value = selectedDistributorType;\n\n    if (selectedDistributorTypes.includes(value)) {\n      const index = selectedDistributorTypes.indexOf(value);\n      if (index > -1) {\n        selectedDistributorTypes.splice(index, 1);\n      }\n    } else {\n      selectedDistributorTypes.push(value);\n    }\n\n    //check if selectedDistributorTypes is empty so dont add the comma on join\n    if (selectedDistributorTypes.length === 0) {\n      setUrlParamValue('selectedTypes', 'undefined');\n    } else {\n      setUrlParamValue('selectedTypes', selectedDistributorTypes.join(','));\n    }\n\n    const randomString = Math.random().toString(36).substring(7);\n    setDistributorFiltersChanged(randomString);\n    setPage(1);\n  };\n\n  // Effects ---------------------------------------------------\n  useEffect(() => {\n    fillLocationData();\n\n    // Event listeners\n    const resizeEvent = debounce(handleResize, 500);\n    window.addEventListener('resize', resizeEvent);\n    window.addEventListener(\n      'searchThisArea',\n      handleSearchThisArea as unknown as EventListener\n    );\n    window.addEventListener(\n      'mapZoomChanged',\n      handleZoomChanged as unknown as EventListener\n    );\n    window.addEventListener(\n      'distributorFiltersChanged',\n      filterEventListener as unknown as EventListener\n    );\n\n    return () => {\n      // Remove event listeners\n      window.removeEventListener('resize', resizeEvent);\n      window.removeEventListener(\n        'searchThisArea',\n        handleSearchThisArea as unknown as EventListener\n      );\n      window.removeEventListener(\n        'mapZoomChanged',\n        handleSearchThisArea as unknown as EventListener\n      );\n      window.removeEventListener(\n        'distributorFiltersChanged',\n        filterEventListener as unknown as EventListener\n      );\n    };\n  }, []);\n\n  useEffect(() => {\n    updateLocationValues();\n  }, [locationData, distance, toggleValue, distributorFiltersChanged]);\n\n  const generateItemList = (distributor: DistributorCardItems[]) => {\n    const resultList: SchemaItem[] = [];\n\n    distributor.forEach((distributor, index) => {\n      resultList.push({\n        '@type': 'ListItem',\n        position: index + 1,\n        item: {\n          '@type': 'Organization',\n          name: distributor.name,\n          url: distributor.dynamicData.Website,\n          logo: imagesPath\n            ? `${imagesPath}${distributor.distributorType}.png`\n            : `/Areas/GAF/images/${distributor.distributorType}.png`,\n          contactPoint: {\n            '@type': 'ContactPoint',\n            telephone: distributor.dynamicData.Phone,\n            contactType: 'sales',\n            areaServed: distributor.dynamicData.City\n          }\n        }\n      });\n    });\n    return resultList;\n  };\n\n  useEffect(() => {\n    if (data) {\n      setLoadingComplete(true);\n      if (data.distributors) {\n        (window as ExtendedWindowType).dataLayer.push({\n          event_attributes: {\n            zip_code: locationData?.zip,\n            zip_code_country: locationData?.country,\n            distributor_type: selectedDistributorTypes.reduce(\n              (list, val) => (list = list + val.toString().toLowerCase),\n              ''\n            ),\n            distance_filter: distance,\n            listing_view: undefined\n          },\n          event: 'results_viewed',\n          event_category: 'results page viewed',\n          event_action: 'distributor locator',\n          event_failure: 'success'\n        });\n\n        const jsonldScript = document.createElement('script');\n        jsonldScript.setAttribute('type', 'application/ld+json');\n\n        const structuredData = {\n          '@context': 'https://schema.org',\n          '@type': 'ItemList',\n          name: document\n            .querySelector(\"meta[property='og:title']\")\n            ?.getAttribute('content'),\n          description: document\n            .querySelector(\"meta[property='og:description']\")\n            ?.getAttribute('content'),\n          url: window.location.href,\n          itemListElement: generateItemList(data.distributors)\n        };\n\n        const jsonldScripts = document.querySelectorAll(\n          'script[type=\"application/ld+json\"]'\n        );\n\n        jsonldScripts.forEach(script => {\n          if (script.textContent?.includes(`\"@type\":\"ItemList\"`))\n            script.remove();\n        });\n\n        jsonldScript.textContent = JSON.stringify(structuredData);\n        document.head.appendChild(jsonldScript);\n      } else {\n        (window as ExtendedWindowType).dataLayer.push({\n          event_attributes: {\n            zip_code: locationData?.zip,\n            zip_code_country: locationData?.country,\n            distributor_type: selectedDistributorTypes.toString(),\n            distance_filter: distance,\n            listing_view: undefined // list view OR map view OR undefined\n          },\n          event: 'results_viewed',\n          event_category: 'results page viewed',\n          event_action: 'distributor locator',\n          event_failure: 'failure'\n        });\n      }\n    }\n  }, [data]);\n\n  // Render Results -------------------------------------------------------\n  return (\n    <div className=\"distributor-locator__container container\">\n      <div className=\"distributor-locator__sidebar\">\n        <div className=\"distributor-locator__top-container\">\n          {locationData && (\n            <>\n              <ZipForm\n                zipPlaceholders={placeholders}\n                zipRegex={regex}\n                defaultCountryValue={\n                  locationData?.country &&\n                  COUNTRY_VALUES.includes(locationData.country.toLowerCase())\n                    ? locationData.country.toLowerCase()\n                    : defaultCountry\n                }\n                defaultZipValue={locationData.zip}\n                invalidZipMessage={zipInvalidMessage}\n                onSubmit={handleZipSubmit}\n              />\n\n              <div className=\"distributor-locator__switch\">\n                <ToggleSwitch\n                  key={toggleSwitchKey}\n                  values={[\n                    {\n                      value: 'residential',\n                      label: toggleResidentialLabel\n                    },\n                    {\n                      value: 'commercial',\n                      label: toggleCommercialLabel\n                    }\n                  ]}\n                  onValueChange={handleToggleChange}\n                  defaultValue={toggleValue}\n                />\n              </div>\n              {!noResults && loadingComplete && (\n                <>\n                  <div className=\"distributor-locator__summary\">\n                    <span\n                      dangerouslySetInnerHTML={{\n                        __html: pageSummary(\n                          data?.totalResultCount || 0,\n                          isTabletLandscape\n                            ? defaultParams.pageSizeMobile\n                            : defaultParams.pageSizeDesktop\n                        )\n                      }}\n                    />\n                  </div>\n\n                  {isTabletLandscape && (\n                    <DistributorFilters\n                      distributorType={toggleValue}\n                      selectedDistributorTypes={selectedDistributorTypes}\n                      allDistributorTypes={allDistributorTypes[\n                        toggleValue as keyof DistributorTypes\n                      ].map(type => type.value)}\n                      filtersLabel={filtersLabel}\n                      distributorTypesLabels={allDistributorTypes[\n                        toggleValue as keyof DistributorTypes\n                      ].map(type => type.label)}\n                    />\n                  )}\n                  <div className=\"distributor-locator__mobile-filters\">\n                    <div className=\"field field--select\">\n                      <label htmlFor=\"select\" className=\"field__label\">\n                        Distance\n                      </label>\n                      <select\n                        name=\"distance\"\n                        id={selectId}\n                        className=\"field__select distributor-locator__select\"\n                        aria-label=\"Distance\"\n                        value={distance}\n                        onChange={handleDistanceChange}\n                      >\n                        <option value=\"10\">10 mi</option>\n                        <option value=\"25\">25 mi</option>\n                        <option value=\"50\">50 mi</option>\n                        <option value=\"100\">100 mi</option>\n                        <option value=\"custom\" disabled>\n                          Custom\n                        </option>\n                      </select>\n                    </div>\n                  </div>\n                </>\n              )}\n            </>\n          )}\n        </div>\n\n        {!noResults && error ? (\n          <Error\n            errorMessage={errorMessage}\n            noResultsMessage={noResultsMessage}\n            noResultsKeywordMessage={noResultsKeywordMessage}\n            showError={true}\n          />\n        ) : (\n          <>\n            {!data ? (\n              <Loader loaderText={loadingLabel} />\n            ) : (\n              <>\n                {noResults || data.distributors.length < 1 ? (\n                  <Error\n                    errorMessage={errorMessage}\n                    noResultsMessage={noResultsMessage}\n                    noResultsKeywordMessage={noResultsKeywordMessage}\n                    noResultsAdditionalMessage={\n                      noResultsAdditionalMessage as string\n                    }\n                  />\n                ) : (\n                  <>\n                    {isTabletLandscape ? (\n                      <div className=\"distributor-locator__bottom-container\">\n                        <div className=\"distributor-locator__tab-bar\">\n                          <button\n                            className={`distributor-locator__tab ${\n                              activeTab === TabOption.List ? 'active' : ''\n                            }`}\n                            onClick={() => handleTabChange(TabOption.List)}\n                          >\n                            List View\n                          </button>\n                          <button\n                            className={`distributor-locator__tab ${\n                              activeTab === TabOption.Map ? 'active' : ''\n                            }`}\n                            onClick={() => handleTabChange(TabOption.Map)}\n                          >\n                            Map View\n                          </button>\n                        </div>\n                        <div className=\"distributor-locator__tab-bar-container\">\n                          {activeTab === TabOption.List && (\n                            <>\n                              <ul\n                                className=\"distributor-locator__list\"\n                                role=\"list\"\n                              >\n                                {data.distributors.map((item, index) => (\n                                  <li\n                                    key={index}\n                                    className=\"distributor-locator__list-item\"\n                                  >\n                                    <DistributorCard\n                                      key={index}\n                                      {...item}\n                                      getDirectionsLabel={getDirectionsLabel}\n                                      websiteLabel={websiteLabel}\n                                      imagesPath={imagesPath}\n                                    />\n                                  </li>\n                                ))}\n                              </ul>\n                              {calcTotalPages(\n                                data.totalResultCount,\n                                data.pageSize\n                              ) > 1 && (\n                                <Pagination\n                                  currentPage={page}\n                                  totalPages={calcTotalPages(\n                                    data.totalResultCount,\n                                    data.pageSize\n                                  )}\n                                  onPageChange={handlePageChange}\n                                  nextPageLabel={nextPageLabel}\n                                  previousPageLabel={previousPageLabel}\n                                  pageLabel={pageLabel}\n                                />\n                              )}\n                            </>\n                          )}\n                          {activeTab === TabOption.Map && (\n                            <>\n                              <div className=\"distributor-locator__map-container\">\n                                <div className=\"distributor-locator__map-container\">\n                                  <DistributorMap\n                                    apiKey={googleMapsApiKey}\n                                    data={data}\n                                    zoomRadius={\n                                      defaultDistanceOptions.values.find(\n                                        val => val.default\n                                      )?.value\n                                    }\n                                    websiteLabel={websiteLabel}\n                                    searchThisAreaLabel={searchThisAreaLabel}\n                                    imagesPath={imagesPath}\n                                  />\n                                </div>\n                              </div>\n                            </>\n                          )}\n                        </div>\n                      </div>\n                    ) : (\n                      <>\n                        <ul className=\"distributor-locator__list\" role=\"list\">\n                          {data.distributors.map((item, index) => (\n                            <li\n                              key={index}\n                              className=\"distributor-locator__list-item\"\n                            >\n                              <DistributorCard\n                                key={index}\n                                {...item}\n                                getDirectionsLabel={getDirectionsLabel}\n                                websiteLabel={websiteLabel}\n                                imagesPath={imagesPath}\n                              />\n                            </li>\n                          ))}\n                        </ul>\n                        {calcTotalPages(data.totalResultCount, data.pageSize) >\n                          1 && (\n                          <Pagination\n                            currentPage={page}\n                            totalPages={calcTotalPages(\n                              data.totalResultCount,\n                              data.pageSize\n                            )}\n                            onPageChange={handlePageChange}\n                            nextPageLabel={nextPageLabel}\n                            previousPageLabel={previousPageLabel}\n                            pageLabel={pageLabel}\n                          />\n                        )}\n                      </>\n                    )}\n                  </>\n                )}\n              </>\n            )}\n          </>\n        )}\n      </div>\n      {loadingComplete &&\n        (!isTabletLandscape ? (\n          <div className=\"distributor-locator__map-container\">\n            <DistributorFilters\n              distributorType={toggleValue}\n              selectedDistributorTypes={selectedDistributorTypes}\n              allDistributorTypes={allDistributorTypes[\n                toggleValue as keyof DistributorTypes\n              ].map(type => type.value)}\n              filtersLabel={filtersLabel}\n              distributorTypesLabels={allDistributorTypes[\n                toggleValue as keyof DistributorTypes\n              ].map(type => type.label)}\n            />\n            <DistributorMap\n              apiKey={googleMapsApiKey}\n              data={data}\n              zoomRadius={\n                defaultDistanceOptions.values.find(val => val.default)?.value\n              }\n              websiteLabel={websiteLabel}\n              searchThisAreaLabel={searchThisAreaLabel}\n              imagesPath={imagesPath}\n            />\n          </div>\n        ) : (\n          ''\n        ))}\n    </div>\n  );\n}\n\nDistributorLocator.propTypes = {\n  endpointUrl: PropTypes.string.isRequired,\n  loadingLabel: PropTypes.string.isRequired,\n  noResultsMessage: PropTypes.string.isRequired,\n  noResultsKeywordMessage: PropTypes.string.isRequired,\n  noResultsAdditionalMessage: PropTypes.string,\n  errorMessage: PropTypes.string.isRequired,\n  zipPlaceholders: PropTypes.string.isRequired,\n  zipRegex: PropTypes.string.isRequired,\n  defaultZipLocation: PropTypes.string.isRequired,\n  zipInvalidMessage: PropTypes.string.isRequired,\n  defaultValues: PropTypes.string.isRequired,\n  distanceOptions: PropTypes.string.isRequired,\n  toggleResidentialLabel: PropTypes.string.isRequired,\n  toggleCommercialLabel: PropTypes.string.isRequired,\n  distributorTypes: PropTypes.string.isRequired,\n  defaultToggleValue: PropTypes.string.isRequired,\n  defaultCountry: PropTypes.string.isRequired,\n  getDirectionsLabel: PropTypes.string.isRequired,\n  filtersLabel: PropTypes.string.isRequired,\n  googleMapsApiKey: PropTypes.string.isRequired,\n  nextPageLabel: PropTypes.string.isRequired,\n  previousPageLabel: PropTypes.string.isRequired,\n  pageLabel: PropTypes.string.isRequired,\n  websiteLabel: PropTypes.string.isRequired,\n  searchThisAreaLabel: PropTypes.string.isRequired,\n  imagesPath: PropTypes.string.isRequired\n};\n\nexport default DistributorLocator;\n"],"names":["DistributorFilters","selectedDistributorTypes","allDistributorTypes","distributorTypesLabels","filtersLabel","handleOnChange","event","selectedDistributorType","React","type","index","PropTypes","lastWidth","DistributorLocator","endpointUrl","loadingLabel","noResultsMessage","noResultsKeywordMessage","noResultsAdditionalMessage","errorMessage","zipPlaceholders","zipRegex","defaultZipLocation","zipInvalidMessage","defaultValues","distanceOptions","toggleResidentialLabel","toggleCommercialLabel","distributorTypes","defaultToggleValue","defaultCountry","getDirectionsLabel","googleMapsApiKey","nextPageLabel","previousPageLabel","pageLabel","websiteLabel","searchThisAreaLabel","imagesPath","placeholders","regex","defaultLocation","defaultParams","defaultDistanceOptions","selectId","useId","noResults","setNoResults","useState","userInteracted","setUserInteracted","loadingComplete","setLoadingComplete","distance","setDistance","getUrlParamValue","_a","val","locationData","setLocationData","toggleValue","setToggleValue","toggleSwitchKey","setToggleSwitchKey","distributorFiltersChanged","setDistributorFiltersChanged","distributorTypesFromUrl","pageLoad","pageParam","page","setPage","endpoint","setEndpoint","data","error","useFetch","TabOption","activeTab","setActiveTab","getDistributorLocatorLocationData","dataFromUrl","getZipAndCountryFromUrl","storedData","getStoredGeolocationCountryAndZip","maxmindData","getLocationByIpAddress","browserData","getGeolocationDataFromBrowserAndGoogle","fillLocationData","location","handleTabChange","selectedTab","calcTotalPages","totalResults","pageSize","pageSummary","returnSummary","updateLocationValues","callAllToggleDistributorTypes","latitude","longitude","getLatLongFromZip","updateGeolocationDataProperties","setUrlParams","isTabletLandscape","value","queryStrings","distributorType","d","setUrlParamValue","updateToggleSwitch","updateEndpointWithQueryString","handleZipSubmit","zip","country","handleToggleChange","handlePageChange","newPage","handleDistanceChange","selectedValue","handleResize","randomString","handleSearchThisArea","getLocationDataFromLatLong","handleZoomChanged","selectElement","prevKey","filterEventListener","useEffect","resizeEvent","debounce","generateItemList","distributor","resultList","list","jsonldScript","structuredData","_b","script","ZipForm","COUNTRY_VALUES","ToggleSwitch","Error","item","DistributorCard","Pagination","DistributorMap","Loader","_c"],"mappings":"0zBAGA,SAASA,EAAmB,CAC1B,yBAAAC,EACA,oBAAAC,EACA,uBAAAC,EACA,aAAAC,CACF,EAAoD,CAC5C,MAAAC,EAAkBC,GAA+C,CACrE,MAAMC,EAA0BD,EAAM,OAAO,KAAK,MAAM,GAAG,EAAE,CAAC,EAE9D,cACE,IAAI,YAAY,4BAA6B,CAC3C,OAAQ,CACN,yBAAAL,EACA,wBAAAM,CACF,EACA,QAAS,EAAA,CACV,CAAA,CACH,EAIA,OAAAC,EAAA,cAAC,MAAI,CAAA,UAAU,qBACb,EAAAA,EAAA,cAAC,MAAI,CAAA,UAAU,gCACb,EAAAA,EAAA,cAAC,MAAI,CAAA,UAAU,gCACbA,EAAA,cAAC,QAAA,CACC,UAAU,0CACV,QAAQ,qBAAA,EAEPJ,CAAA,CAEL,EACCI,EAAA,cAAA,MAAA,CAAI,UAAU,sCACb,EAAAA,EAAA,cAAC,KAAG,CAAA,UAAU,2BACX,EAAAN,EAAoB,IAAI,CAACO,EAAMC,IAE5BF,EAAA,cAAC,MAAG,IAAKE,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