{ "version": 3, "sources": ["../javascripts/components/filters/default-filter-block.tsx", "../javascripts/components/filters/active-filters.tsx", "../javascripts/components/filters/save-subscription-button.tsx", "../javascripts/helpers/query.ts", "../javascripts/components/filters/filter-foldout.tsx", "../javascripts/components/filters/filter-foldout-checkbox.tsx", "../javascripts/components/filters/filter-foldout-item.tsx", "../javascripts/components/filters/filter-wx-panel.tsx", "../javascripts/components/filters/selected-filter-modal.tsx", "../javascripts/components/filters/select-filter.tsx", "../javascripts/components/filters/advanced-filter-help.tsx", "../javascripts/components/filters/select-filter-item.tsx", "../javascripts/components/filters/select-filter-item-advanced.tsx", "../javascripts/components/filters/select-filter-location.tsx", "../javascripts/components/filters/query-foldout.tsx", "../javascripts/components/filters/select-filter-location-map.tsx", "../javascripts/components/filters/select-filter-range.tsx", "../javascripts/components/filters/select-filter-range-histogram.tsx", "../javascripts/helpers/list.ts", "../javascripts/components/filters/filter-bar.tsx", "../javascripts/components/filters/filter-bar-item.tsx", "../javascripts/components/filters/filter-bar-slider.tsx", "../javascripts/components/search/pagination-v2.tsx", "../javascripts/hooks/useQueryFilterFromUrl.ts"], "sourcesContent": ["import { bindActionCreators } from '@reduxjs/toolkit';\nimport React from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\n\nimport { openFilter, openFoldout } from '../../actions/filters';\nimport { search } from '../../actions/search';\n\nimport ActiveFilters from './active-filters';\nimport FilterFoldout from './filter-foldout';\n\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport type { Facet } from '../../@types/ElasticSearchResponse';\nimport { getListQueryConcatQueryfilter } from '../../helpers/list';\nimport type QueryFilter from '../../helpers/query-filter';\nimport { getQueryFilter } from '../../utils/reselectors';\nimport FilterBar from './filter-bar';\n\nconst BASE_SEARCH_PATH = '/sok';\n\ninterface DefaultFilterBlockProps {\n target: string;\n silent?: boolean;\n umbrellaFacet?: string;\n useContainer?: boolean;\n children?: React.ReactNode;\n navigate?: (queryFilter: QueryFilter) => void;\n}\n\nconst DefaultFilterBlock = ({\n target,\n silent,\n umbrellaFacet,\n useContainer,\n children,\n navigate,\n}: DefaultFilterBlockProps) => {\n const dispatch = useDispatch();\n const _navigate = useNavigate();\n\n const { pathname } = useLocation();\n\n const queryFilter = useSelector(getQueryFilter);\n\n const actions = bindActionCreators({ search, openFoldout, openFilter }, dispatch);\n\n const localNavigate = (nextQueryFilter: QueryFilter) => {\n if (!silent) {\n if (target && pathname !== BASE_SEARCH_PATH) {\n _navigate(`${target}${getListQueryConcatQueryfilter(nextQueryFilter.toQueryURL())}`);\n } else if (nextQueryFilter.toQueryString() !== queryFilter.toQueryString()) {\n _navigate(\n `${location.pathname}${getListQueryConcatQueryfilter(nextQueryFilter.toQueryURL())}`,\n { replace: true },\n );\n }\n }\n\n if (!queryFilter.isSame(queryFilter) && silent) {\n _navigate(\n `${target || BASE_SEARCH_PATH}${getListQueryConcatQueryfilter(queryFilter.toQueryURL())}`,\n );\n }\n };\n\n const onRequestSearch = (nextQueryFilter: QueryFilter) => {\n const _nextQueryFilter = nextQueryFilter.removePagination();\n\n if (navigate) {\n navigate(_nextQueryFilter);\n } else {\n localNavigate(_nextQueryFilter);\n }\n\n actions.search(_nextQueryFilter);\n };\n\n const onRequestFilter = (facet: Facet) => {\n if (navigate) {\n navigate(queryFilter);\n } else {\n localNavigate(queryFilter);\n }\n\n actions.openFilter(facet, !process.env.SSR ? window.scrollY : 0, false);\n };\n\n const onRequestFoldout = () => {\n if (navigate) {\n navigate(queryFilter);\n } else {\n localNavigate(queryFilter);\n }\n\n actions.openFoldout(!process.env.SSR ? window.scrollY : 0);\n };\n\n if (useContainer) {\n return (\n <>\n