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S,CAAC,CAAA,OAAE,CAAM,CAAE,IACxC,GAAgB,CAAC,EAAa,QAAQ,CAAC,KACzC,EAAa,SAAS,CAAC,MAAM,CAAC,UAC9B,EAAe,KAEnB,EAAG,CAAE,QAAS,CAAA,CAAK,GAEnB,EACG,aAAa,CAAC,UACd,gBAAgB,CAAC,QAAS,EAAY,SAEzC,EAAY,gBAAgB,CAAC,QAAS,EAAY,YAElD,EAAqB,OAAO,CAAC,AAAC,IAC5B,EAAc,gBAAgB,CAAC,QAAS,EAC1C,GAEA,EAAY,OAAO,CAAC,AAAC,IACnB,EAAsB,GACtB,EAAiB,GACjB,GACF,GAEA,EAAK,OAAO,CAAC,AAAC,GAAQ,EAAI,gBAAgB,CAAC,QAAS,CAAC,CAAA,cAAE,CAAa,CAAE,IACpE,GAAM,CAAA,QAAE,CAAO,CAAE,CAAG,EACd,EAAa,EAAc,GAEjC,MACA,CAAM,CAAC,EAAW,CAAG,CAAC,CAAO,CAAC,EAAW,CAAC,CAC1C,EAAsB,GACtB,EAAiB,GACjB,IACA,SAAS,aAAa,CAAC,mBAAmB,cAAc,CAAC,CAAE,MAAO,MAAO,SAAU,QAAS,EAC9F","sources":["","src/public/js/cases.js"],"sourcesContent":["var $478a66e2828d03bc$exports = {};\nconst $478a66e2828d03bc$var$capturesMap = {\n 'cases': \"\\u041A\\u0435\\u0439\\u0441\\u044B \\u043D\\u0430\\u0448\\u0438\\u0445 \\u043A\\u043B\\u0438\\u0435\\u043D\\u0442\\u043E\\u0432\\xa0\\u2014\\xa0\\u043A\\u0430\\u043A \\u0444\\u0438\\u0434\\u0431\\u0435\\u043A \\u0443\\u043B\\u0443\\u0447\\u0448\\u0430\\u0435\\u0442 \\u043F\\u0440\\u043E\\u0434\\u0443\\u043A\\u0442\\u044B\",\n 'clients': \"\\u041D\\u0430\\u043C \\u0434\\u043E\\u0432\\u0435\\u0440\\u044F\\u044E\\u0442 90+ \\u0432\\u0435\\u0434\\u0443\\u0449\\u0438\\u0445 \\u043A\\u043E\\u043C\\u043F\\u0430\\u043D\\u0438\\u0439 \\u0432\\xa0\\u0420\\u043E\\u0441\\u0441\\u0438\\u0438\\xa0\\u0438\\xa0\\u043C\\u0438\\u0440\\u0435\"\n};\nconst $478a66e2828d03bc$var$capture = document.querySelector(`h1.capture`);\nconst $478a66e2828d03bc$var$cases = [\n ...document.querySelector('.content .cases').children\n];\nconst $478a66e2828d03bc$var$filtersSelects = [\n ...document.querySelectorAll('.filtersWrapper .filter .select .currentValue')\n];\nconst $478a66e2828d03bc$var$emptyBlock = document.querySelector('.empty');\nconst $478a66e2828d03bc$var$tabs = [\n ...document.querySelectorAll('.casesClients [data-tab]')\n];\nconst $478a66e2828d03bc$var$hash = location.hash.slice(1);\nconst $478a66e2828d03bc$var$activeTab = !$478a66e2828d03bc$var$hash || $478a66e2828d03bc$var$hash === 'form-demo' ? 'cases' : $478a66e2828d03bc$var$hash;\nconst $478a66e2828d03bc$var$queryParams = new URLSearchParams(location.search);\nconst $478a66e2828d03bc$var$activePageNodes = [\n ...document.querySelectorAll(`[data-tab=\"${$478a66e2828d03bc$var$activeTab}\"]`)\n];\nconst $478a66e2828d03bc$var$allFilterOptionsList = [\n ...document.querySelectorAll('.selectList li')\n];\nconst $478a66e2828d03bc$var$resetButton = document.querySelector('.resetButton');\nconst $478a66e2828d03bc$var$tags = [\n ...document.querySelectorAll('.tags .tag')\n];\nconst $478a66e2828d03bc$var$YM_ID = 49633516;\nconst $478a66e2828d03bc$var$sectionName = window.location.href.includes('https://uxfeedback.ru') ? 'cases' : 'test_cases';\nlet $478a66e2828d03bc$var$openedFilter = null;\nconst $478a66e2828d03bc$var$filterTypes = [\n 'format',\n 'product',\n 'sphere'\n];\nconst $478a66e2828d03bc$var$filter = {\n format: $478a66e2828d03bc$var$queryParams.get('format')?.split(',') || [\n 'all'\n ],\n product: $478a66e2828d03bc$var$queryParams.get('product')?.split(',') || [\n 'all'\n ],\n sphere: $478a66e2828d03bc$var$queryParams.get('sphere')?.split(',') || [\n 'all'\n ]\n};\nif ($478a66e2828d03bc$var$activePageNodes.length > 0) {\n $478a66e2828d03bc$var$capture.innerHTML = $478a66e2828d03bc$var$capturesMap[$478a66e2828d03bc$var$activeTab];\n [\n ...document.querySelectorAll(`.active[data-tab]`)\n ].map((node)=>{\n node.classList.remove('active');\n });\n $478a66e2828d03bc$var$activePageNodes.map((node)=>{\n node.classList.add('active');\n });\n}\nconst $478a66e2828d03bc$var$filterCases = ()=>{\n const hiddenCases = $478a66e2828d03bc$var$cases.filter((item)=>!Object.values($478a66e2828d03bc$var$filter).every((filterValues)=>filterValues.some((value)=>item.dataset.types.includes(value))));\n $478a66e2828d03bc$var$cases.forEach((item)=>item.classList.remove('hide'));\n hiddenCases.forEach((item)=>item.classList.add('hide'));\n if ([\n ...new Set(Object.values($478a66e2828d03bc$var$filter).reduce((acc, filterValues)=>[\n ...acc,\n ...filterValues\n ], []))\n ].length > 1) $478a66e2828d03bc$var$resetButton.classList.add('active');\n else $478a66e2828d03bc$var$resetButton.classList.remove('active');\n if (hiddenCases.length === $478a66e2828d03bc$var$cases.length) $478a66e2828d03bc$var$emptyBlock.classList.add('show');\n else $478a66e2828d03bc$var$emptyBlock.classList.remove('show');\n const url = new URL(window.location.href);\n url.search = '';\n $478a66e2828d03bc$var$filterTypes.forEach((filterType)=>{\n url.searchParams.append(filterType, $478a66e2828d03bc$var$filter[filterType].join(','));\n });\n window.history.pushState({}, '', url);\n};\nconst $478a66e2828d03bc$var$showFieldList = (element, text)=>{\n document.querySelector('.field.active').classList.remove('active');\n element.classList.add('active');\n document.querySelector('.field-filter').classList.remove('active');\n document.querySelector('.current-field span').textContent = text;\n};\nconst $478a66e2828d03bc$var$changeFilterText = (filterType)=>{\n document.querySelector(`.filter.${filterType} .currentValue .value`).textContent = $478a66e2828d03bc$var$filter[filterType].map((value)=>document.querySelector(`[data-${filterType}=${value}] .name`).textContent).join(', ');\n};\nconst $478a66e2828d03bc$var$selectAll = (filterType)=>{\n $478a66e2828d03bc$var$filter[filterType] = [\n 'all'\n ];\n $478a66e2828d03bc$var$allFilterOptionsList.filter((item)=>item.classList.contains(filterType)).forEach((item)=>item.classList.remove('active'));\n document.querySelector(`[data-${filterType}=all]`).classList.add('active');\n $478a66e2828d03bc$var$changeFilterText(filterType);\n $478a66e2828d03bc$var$filterCases();\n};\nconst $478a66e2828d03bc$var$getFilterType = (dataset)=>{\n if (dataset.format) return 'format';\n if (dataset.product) return 'product';\n return 'sphere';\n};\nconst $478a66e2828d03bc$var$changeFilterValues = (filterType, currentTarget)=>{\n const { dataset: dataset } = currentTarget;\n return currentTarget.classList.contains('active') ? $478a66e2828d03bc$var$filter[filterType].filter((filterItem)=>filterItem !== dataset[filterType]) : [\n ...$478a66e2828d03bc$var$filter[filterType].filter((value)=>value !== 'all'),\n dataset[filterType]\n ];\n};\nconst $478a66e2828d03bc$var$setFilter = ({ currentTarget: currentTarget })=>{\n const { dataset: dataset } = currentTarget;\n const filterType = $478a66e2828d03bc$var$getFilterType(dataset);\n const filterValues = $478a66e2828d03bc$var$changeFilterValues(filterType, currentTarget);\n if (filterValues.length === 0 || dataset[filterType] === 'all') {\n $478a66e2828d03bc$var$selectAll(filterType);\n window.ym?.($478a66e2828d03bc$var$YM_ID, 'reachGoal', 'filters_cases_click', {\n [$478a66e2828d03bc$var$sectionName]: {\n article_filters: $478a66e2828d03bc$var$filter\n }\n });\n return;\n }\n $478a66e2828d03bc$var$filter[filterType] = filterValues;\n currentTarget.classList.toggle('active');\n currentTarget.parentElement.querySelector(`[data-${filterType}=all]`).classList.remove('active');\n $478a66e2828d03bc$var$changeFilterText(filterType);\n $478a66e2828d03bc$var$filterCases();\n window.ym?.($478a66e2828d03bc$var$YM_ID, 'reachGoal', 'filters_cases_click', {\n [$478a66e2828d03bc$var$sectionName]: {\n article_filters: $478a66e2828d03bc$var$filter\n }\n });\n};\nconst $478a66e2828d03bc$var$resetFilter = (type)=>()=>{\n $478a66e2828d03bc$var$filterTypes.forEach((filterType)=>{\n $478a66e2828d03bc$var$filter[filterType] = [\n 'all'\n ];\n $478a66e2828d03bc$var$selectAll(filterType);\n });\n if (type) window.ym?.($478a66e2828d03bc$var$YM_ID, 'reachGoal', 'filters_cases_click', {\n [$478a66e2828d03bc$var$sectionName]: {\n article_filters: {\n clear_all: type\n }\n }\n });\n };\nconst $478a66e2828d03bc$var$highlightFiltersItems = (filterType)=>{\n document.querySelector(`[data-${filterType}=all]`).classList.remove('active');\n $478a66e2828d03bc$var$allFilterOptionsList.filter((item)=>item.classList.contains(filterType) && $478a66e2828d03bc$var$filter[filterType].includes(item.dataset[filterType])).forEach((item)=>item.classList.add('active'));\n};\n$478a66e2828d03bc$var$tabs.map((tab)=>{\n tab.addEventListener('click', (e)=>{\n const { tab: tab } = e.target.dataset;\n $478a66e2828d03bc$var$capture.innerHTML = $478a66e2828d03bc$var$capturesMap[tab];\n [\n ...document.querySelectorAll(`.active[data-tab]:not([data-tab=${tab}])`)\n ].map((node)=>{\n node.classList.remove('active');\n });\n [\n ...document.querySelectorAll(`[data-tab=${tab}]`)\n ].map((node)=>{\n node.classList.add('active');\n });\n });\n});\n$478a66e2828d03bc$var$filtersSelects.map((filterElement)=>{\n filterElement.addEventListener('click', ({ currentTarget: currentTarget })=>{\n currentTarget.parentElement.classList.toggle('active');\n $478a66e2828d03bc$var$openedFilter = currentTarget.parentElement;\n });\n});\ndocument.addEventListener('click', ({ target: target })=>{\n if ($478a66e2828d03bc$var$openedFilter && !$478a66e2828d03bc$var$openedFilter.contains(target)) {\n $478a66e2828d03bc$var$openedFilter.classList.remove('active');\n $478a66e2828d03bc$var$openedFilter = null;\n }\n}, {\n capture: true\n});\n$478a66e2828d03bc$var$emptyBlock.querySelector('.reset').addEventListener('click', $478a66e2828d03bc$var$resetFilter('page'));\n$478a66e2828d03bc$var$resetButton.addEventListener('click', $478a66e2828d03bc$var$resetFilter('filters'));\n$478a66e2828d03bc$var$allFilterOptionsList.forEach((optionElement)=>{\n optionElement.addEventListener('click', $478a66e2828d03bc$var$setFilter);\n});\n$478a66e2828d03bc$var$filterTypes.forEach((filterType)=>{\n $478a66e2828d03bc$var$highlightFiltersItems(filterType);\n $478a66e2828d03bc$var$changeFilterText(filterType);\n $478a66e2828d03bc$var$filterCases();\n});\n$478a66e2828d03bc$var$tags.forEach((tag)=>tag.addEventListener('click', ({ currentTarget: currentTarget })=>{\n const { dataset: dataset } = currentTarget;\n const filterType = $478a66e2828d03bc$var$getFilterType(dataset);\n $478a66e2828d03bc$var$resetFilter()();\n $478a66e2828d03bc$var$filter[filterType] = [\n dataset[filterType]\n ];\n $478a66e2828d03bc$var$highlightFiltersItems(filterType);\n $478a66e2828d03bc$var$changeFilterText(filterType);\n $478a66e2828d03bc$var$filterCases();\n document.querySelector('.filtersWrapper').scrollIntoView({\n block: 'end',\n behavior: 'smooth'\n });\n }));\n\n\n//# sourceMappingURL=cases.43e19f13.js.map\n","const capturesMap = {\n 'cases': 'Кейсы наших клиентов — как фидбек улучшает продукты',\n 'clients': 'Нам доверяют 90+ ведущих компаний в России и мире',\n}\nconst capture = document.querySelector(`h1.capture`);\nconst cases = [...document.querySelector('.content .cases').children];\nconst filtersSelects = [...document.querySelectorAll('.filtersWrapper .filter .select .currentValue')];\nconst emptyBlock = document.querySelector('.empty');\nconst tabs = [...document.querySelectorAll('.casesClients [data-tab]')];\nconst hash = location.hash.slice(1);\nconst activeTab = (!hash || hash === 'form-demo') ? 'cases' : hash;\nconst queryParams = new URLSearchParams(location.search);\nconst activePageNodes = [...document.querySelectorAll(`[data-tab=\"${activeTab}\"]`)];\nconst allFilterOptionsList = [...document.querySelectorAll('.selectList li')];\nconst resetButton = document.querySelector('.resetButton');\nconst tags = [...document.querySelectorAll('.tags .tag')];\nconst YM_ID = 49633516;\nconst sectionName = window.location.href.includes('https://uxfeedback.ru') ? 'cases' : 'test_cases';\nlet openedFilter = null;\nconst filterTypes = ['format', 'product', 'sphere'];\nconst filter = {\n format: queryParams.get('format')?.split(',') || ['all'],\n product: queryParams.get('product')?.split(',') || ['all'],\n sphere: queryParams.get('sphere')?.split(',') || ['all'],\n};\n\nif (activePageNodes.length > 0) {\n capture.innerHTML = capturesMap[activeTab];\n\n [...document.querySelectorAll(`.active[data-tab]`)].map((node) => {\n node.classList.remove('active');\n })\n activePageNodes.map((node) => {\n node.classList.add('active');\n });\n}\n\nconst filterCases = () => {\n const hiddenCases = cases.filter((item) => !Object.values(filter).every((filterValues) => filterValues.some((value) => item.dataset.types.includes(value))));\n\n cases.forEach((item) => item.classList.remove('hide'));\n hiddenCases.forEach((item) => item.classList.add('hide'));\n\n if ([...new Set(Object.values(filter).reduce((acc, filterValues) => [...acc, ...filterValues], []))].length > 1) {\n resetButton.classList.add('active');\n } else {\n resetButton.classList.remove('active');\n }\n\n if (hiddenCases.length === cases.length) {\n emptyBlock.classList.add('show');\n } else {\n emptyBlock.classList.remove('show');\n }\n\n const url = new URL(window.location.href);\n\n url.search = '';\n filterTypes.forEach((filterType) => {\n url.searchParams.append(filterType, filter[filterType].join(','));\n });\n window.history.pushState({}, '', url);\n};\n\nconst showFieldList = (element, text) => {\n document.querySelector('.field.active').classList.remove('active');\n element.classList.add('active');\n document.querySelector('.field-filter').classList.remove('active');\n document.querySelector('.current-field span').textContent = text;\n}\n\nconst changeFilterText = (filterType) => {\n document.querySelector(`.filter.${filterType} .currentValue .value`).textContent = filter[filterType]\n .map((value) => document.querySelector(`[data-${filterType}=${value}] .name`).textContent)\n .join(', ');\n}\n\nconst selectAll = (filterType) => {\n filter[filterType] = ['all'];\n allFilterOptionsList.filter((item) => item.classList.contains(filterType)).forEach((item) => item.classList.remove('active'));\n document.querySelector(`[data-${filterType}=all]`).classList.add('active');\n changeFilterText(filterType);\n filterCases();\n}\n\nconst getFilterType = (dataset) => {\n if (dataset.format) {\n return 'format';\n }\n\n if (dataset.product) {\n return 'product';\n }\n\n return 'sphere';\n};\n\nconst changeFilterValues = (filterType, currentTarget) => {\n const { dataset } = currentTarget;\n\n return currentTarget.classList.contains('active')\n ? filter[filterType].filter((filterItem) => filterItem !== dataset[filterType])\n : [...filter[filterType].filter((value) => value !== 'all'), dataset[filterType]];\n}\n\nconst setFilter = ({ currentTarget }) => {\n const { dataset } = currentTarget;\n const filterType = getFilterType(dataset);\n const filterValues = changeFilterValues(filterType, currentTarget);\n\n if (filterValues.length === 0 || dataset[filterType] === 'all') {\n selectAll(filterType);\n window.ym?.(YM_ID, 'reachGoal', 'filters_cases_click', { [sectionName]: { article_filters: filter } });\n\n return;\n }\n\n filter[filterType] = filterValues;\n currentTarget.classList.toggle('active');\n currentTarget.parentElement.querySelector(`[data-${filterType}=all]`).classList.remove('active');\n changeFilterText(filterType);\n filterCases();\n window.ym?.(YM_ID, 'reachGoal', 'filters_cases_click', { [sectionName]: { article_filters: filter } });\n};\n\nconst resetFilter = (type) => () => { \n filterTypes.forEach((filterType) => {\n filter[filterType] = ['all'];\n selectAll(filterType);\n })\n\n if (type) {\n window.ym?.(YM_ID, 'reachGoal', 'filters_cases_click', { [sectionName]: { article_filters: { clear_all: type } } });\n }\n}\n\nconst highlightFiltersItems = (filterType) => {\n document.querySelector(`[data-${filterType}=all]`).classList.remove('active');\n allFilterOptionsList\n .filter((item) => item.classList.contains(filterType) && filter[filterType].includes(item.dataset[filterType]))\n .forEach((item) => item.classList.add('active'));\n}\n\ntabs.map((tab) => {\n tab.addEventListener('click', (e) => {\n const { tab } = e.target.dataset;\n\n capture.innerHTML = capturesMap[tab];\n\n [...document.querySelectorAll(`.active[data-tab]:not([data-tab=${tab}])`)].map((node) => {\n\n node.classList.remove('active');\n });\n [...document.querySelectorAll(`[data-tab=${tab}]`)].map((node) => {\n node.classList.add('active');\n });\n })\n})\n\nfiltersSelects.map((filterElement) => {\n filterElement.addEventListener('click', ({ currentTarget }) => {\n currentTarget.parentElement.classList.toggle('active');\n openedFilter = currentTarget.parentElement;\n });\n});\n\ndocument.addEventListener('click', ({ target }) => {\n if (openedFilter && !openedFilter.contains(target)) {\n openedFilter.classList.remove('active');\n openedFilter = null;\n }\n}, { capture: true });\n\nemptyBlock\n .querySelector('.reset')\n .addEventListener('click', resetFilter('page'));\n\nresetButton.addEventListener('click', resetFilter('filters'));\n\nallFilterOptionsList.forEach((optionElement) => {\n optionElement.addEventListener('click', setFilter)\n});\n\nfilterTypes.forEach((filterType) => {\n highlightFiltersItems(filterType)\n changeFilterText(filterType);\n filterCases();\n});\n\ntags.forEach((tag) => tag.addEventListener('click', ({ currentTarget }) => {\n const { dataset } = currentTarget;\n const filterType = getFilterType(dataset);\n\n resetFilter()();\n filter[filterType] = [dataset[filterType]];\n highlightFiltersItems(filterType)\n changeFilterText(filterType);\n filterCases();\n document.querySelector('.filtersWrapper').scrollIntoView({ block: 'end', behavior: 'smooth' });\n}))\n"],"names":["$478a66e2828d03bc$var$capturesMap","$478a66e2828d03bc$var$capture","document","querySelector","$478a66e2828d03bc$var$cases","children","$478a66e2828d03bc$var$filtersSelects","querySelectorAll","$478a66e2828d03bc$var$emptyBlock","$478a66e2828d03bc$var$tabs","$478a66e2828d03bc$var$hash","location","hash","slice","$478a66e2828d03bc$var$activeTab","$478a66e2828d03bc$var$queryParams","URLSearchParams","search","$478a66e2828d03bc$var$activePageNodes","$478a66e2828d03bc$var$allFilterOptionsList","$478a66e2828d03bc$var$resetButton","$478a66e2828d03bc$var$tags","$478a66e2828d03bc$var$sectionName","window","href","includes","$478a66e2828d03bc$var$openedFilter","$478a66e2828d03bc$var$filterTypes","$478a66e2828d03bc$var$filter","format","get","split","product","sphere","length","innerHTML","map","node","classList","remove","add","$478a66e2828d03bc$var$filterCases","hiddenCases","filter","item","Object","values","every","filterValues","some","value","dataset","types","forEach","Set","reduce","acc","url","URL","filterType","searchParams","append","join","history","pushState","$478a66e2828d03bc$var$changeFilterText","textContent","$478a66e2828d03bc$var$selectAll","contains","$478a66e2828d03bc$var$getFilterType","$478a66e2828d03bc$var$changeFilterValues","currentTarget","filterItem","$478a66e2828d03bc$var$setFilter","ym","article_filters","toggle","parentElement","$478a66e2828d03bc$var$resetFilter","type","clear_all","$478a66e2828d03bc$var$highlightFiltersItems","tab","addEventListener","e","target","filterElement","capture","optionElement","tag","scrollIntoView","block","behavior"],"version":3,"file":"cases.43e19f13.js.map"}