{"version":3,"sources":["webpack:///./src/js/components/react/Dropdown.js","webpack:///./src/js/modules/partnerCardListingNew/components/PartnerFacetList.js","webpack:///./src/js/modules/partnerCardListingNew/components/PartnerCard.js","webpack:///./src/js/modules/partnerCardListingNew/hooks/useFetch.js","webpack:///./src/js/modules/partnerCardListingNew/index.js"],"names":["Dropdown","label","placeholder","selectedOption","options","onChange","disabled","compareAttr","style","useState","open","toggle","cursor","setCursor","guid","useRef","uuidv4","listboxGuid","nativeEl","dropdownEl","triggerEl","listingEl","useEffect","handleClickOutside","e","container","current","target","contains","document","addEventListener","removeEventListener","focus","index","findIndex","option","getDisplayLabel","className","htmlFor","isDevice","ref","id","find","value","Value","tabIndex","aria-label","map","i","key","role","type","aria-haspopup","aria-expanded","aria-controls","onClick","aria-activedescendant","onKeyDown","keyCode","preventDefault","length","aria-selected","handleOptionClick","propTypes","PropTypes","string","shape","oneOfType","number","bool","arrayOf","object","func","isRequired","PartnerFacetList","initialFacets","selectedFacets","onFiltersChange","onResetFilters","regionLabel","partnerTypeLabel","resetBtnLabel","regionDropdownDefaultLabel","typeDropdownDefaultLabel","getSelectedOption","facet","keyword","name","Object","keys","array","PartnerCard","imageUrlWebp","partner","imageUrl","imageAlt","title","url","indexOf","CommonInnerMarkup","srcSet","src","alt","parse","viewBox","href","useFetch","endpoint","language","filters","results","setResults","facets","setFacets","loading","setLoading","params","forEach","Axios","method","data","resultListing","updatedFacets","console","log","fetchData","PartnerCardListingNew","noResultsLabel","setSelectedFacets","React","memo"],"mappings":"i6CAKA,IAAMA,EAAW,SAAC,GASZ,IARJC,EAQI,EARJA,MACAC,EAOI,EAPJA,YACAC,EAMI,EANJA,eAMI,IALJC,eAKI,MALM,GAKN,EAJJC,EAII,EAJJA,SAII,IAHJC,gBAGI,aAFJC,mBAEI,MAFU,QAEV,EADJC,EACI,EADJA,MACI,IACmBC,oBAAS,GAD5B,GACGC,EADH,KACSC,EADT,SAEwBF,mBAAS,MAFjC,GAEGG,EAFH,KAEWC,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,OAAOQ,WAC3BsD,eAAgB/D,IAAUC,OAAOQ,WACjCM,YAAaf,IAAUC,OAAOQ,WAC9BO,iBAAkBhB,IAAUC,OAAOQ,WACnCQ,cAAejB,IAAUC,OAAOQ,WAChCS,2BAA4BlB,IAAUC,OAAOQ,WAC7CU,yBAA0BnB,IAAUC,OAAOQ,WAC3CuB,MAAOhC,IAAUC,QAGJgE,cAAMC,KAAKJ","file":"37.db8e4582abb43e6eba0a.js","sourcesContent":["import React, { useState, useEffect, useRef, useMemo } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { isDevice } from '../../helpers';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nconst Dropdown = ({\r\n label,\r\n placeholder,\r\n selectedOption,\r\n options = [],\r\n onChange,\r\n disabled = false,\r\n compareAttr = 'value',\r\n style\r\n}) => {\r\n const [open, toggle] = useState(false);\r\n const [cursor, setCursor] = useState(null);\r\n const guid = useRef(uuidv4());\r\n const listboxGuid = useRef(uuidv4());\r\n const nativeEl = useRef(null);\r\n const dropdownEl = useRef(null);\r\n const triggerEl = useRef(null);\r\n const listingEl = useRef(null);\r\n\r\n useEffect(() => {\r\n const handleClickOutside = e => {\r\n const container = dropdownEl.current;\r\n\r\n if (container) {\r\n if (container !== e.target && !container.contains(e.target)) {\r\n toggle(false);\r\n }\r\n }\r\n };\r\n\r\n document.addEventListener('click', handleClickOutside);\r\n\r\n return () => {\r\n document.removeEventListener('click', handleClickOutside);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (open) {\r\n listingEl.current.focus();\r\n }\r\n }, [open]);\r\n\r\n useEffect(() => {\r\n if (selectedOption) {\r\n const index = options.findIndex(\r\n option => option[compareAttr] === selectedOption[compareAttr]\r\n );\r\n setCursor(index);\r\n } else {\r\n setCursor(null);\r\n }\r\n }, [compareAttr, options, selectedOption]);\r\n\r\n const handleTriggerClick = e => {\r\n if (isDevice()) {\r\n return;\r\n }\r\n\r\n toggle(!open);\r\n };\r\n\r\n const handleOptionClick = option => {\r\n onChange(option);\r\n toggle(false);\r\n };\r\n\r\n const handleOptionChange = e => {\r\n const option = options.find(option => option.value === e.target.value);\r\n onChange(option);\r\n toggle(false);\r\n };\r\n\r\n const handleKeyDown = e => {\r\n /* eslint-disable indent */\r\n switch (e.keyCode) {\r\n case 38: // up\r\n e.preventDefault();\r\n if (cursor) {\r\n setCursor(cursor - 1);\r\n } else {\r\n setCursor(options.length - 1);\r\n }\r\n break;\r\n case 40: // down\r\n e.preventDefault();\r\n if (cursor !== null && cursor < options.length - 1) {\r\n setCursor(cursor + 1);\r\n } else {\r\n setCursor(0);\r\n }\r\n break;\r\n case 27: // esc\r\n e.preventDefault();\r\n toggle(false);\r\n triggerEl.current.focus();\r\n break;\r\n case 13: // enter\r\n e.preventDefault();\r\n if (cursor !== null) {\r\n onChange(options[cursor]);\r\n }\r\n toggle(false);\r\n triggerEl.current.focus();\r\n break;\r\n case 9: // tab\r\n toggle(false);\r\n break;\r\n }\r\n /* eslint-enable indent */\r\n };\r\n\r\n const getDisplayLabel = () => {\r\n if (selectedOption) {\r\n return `${selectedOption.label}`;\r\n }\r\n return placeholder || null;\r\n };\r\n\r\n return (\r\n
{noResultsLabel}
\r\n ) : (\r\n