@internetarchive/collection-browser 4.1.2-alpha4 → 4.1.2-alpha5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -613,8 +613,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
|
613
613
|
// Determine the set of sortable fields that should be shown in the sort bar
|
|
614
614
|
let sortFieldAvailability = defaultSortAvailability;
|
|
615
615
|
// We adjust the available sort options for a couple of special cases...
|
|
616
|
-
if (this.withinCollection?.startsWith('fav-')
|
|
617
|
-
|| this.profileElement === 'favorites') {
|
|
616
|
+
if (this.withinCollection?.startsWith('fav-') || this.profileElement === 'favorites') {
|
|
618
617
|
// When viewing a fav- collection or the favorites profile tab,
|
|
619
618
|
// we include the Date Favorited option as the default
|
|
620
619
|
sortFieldAvailability = favoritesSortAvailability;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection-browser.js","sourceRoot":"","sources":["../../src/collection-browser.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EAIV,OAAO,GACR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAOpC,OAAO,EAIL,UAAU,GAGX,MAAM,iCAAiC,CAAC;AAKzC,OAAO,oCAAoC,CAAC;AAK5C,OAAO,EAEL,SAAS,EAET,wBAAwB,EAIxB,uBAAuB,EACvB,YAAY,EACZ,0BAA0B,EAE1B,wBAAwB,EACxB,mBAAmB,EAEnB,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,GAEnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,uBAAuB,GAGxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE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AD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CAq6F7B","sourcesContent":["import {\n html,\n css,\n LitElement,\n PropertyValues,\n TemplateResult,\n HTMLTemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { msg } from '@lit/localize';\n\nimport type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';\nimport type {\n InfiniteScroller,\n InfiniteScrollerCellProviderInterface,\n} from '@internetarchive/infinite-scroller';\nimport {\n CollectionExtraInfo,\n PageElementName,\n SearchServiceInterface,\n SearchType,\n SortDirection,\n SortParam,\n} from '@internetarchive/search-service';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport '@internetarchive/infinite-scroller';\nimport type { ModalManagerInterface } from '@internetarchive/modal-manager';\nimport type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';\nimport type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';\nimport type { IAComboBox } from '@internetarchive/elements/ia-combo-box/ia-combo-box';\nimport {\n SelectedFacets,\n SortField,\n CollectionBrowserContext,\n getDefaultSelectedFacets,\n TileModel,\n CollectionDisplayMode,\n FacetEventDetails,\n sortOptionFromAPIString,\n SORT_OPTIONS,\n defaultProfileElementSorts,\n FacetLoadStrategy,\n defaultFacetDisplayOrder,\n tvFacetDisplayOrder,\n TileBlurOverrideState,\n defaultSortAvailability,\n favoritesSortAvailability,\n tvSortAvailability,\n FacetBucket,\n} from './models';\nimport {\n RestorationStateHandlerInterface,\n RestorationStateHandler,\n RestorationState,\n RestorationStatePersistOptions,\n} from './restoration-state-handler';\nimport { CollectionBrowserDataSource } from './data-source/collection-browser-data-source';\nimport type {\n CollectionBrowserQueryState,\n CollectionBrowserSearchInterface,\n} from './data-source/collection-browser-query-state';\nimport { FACETLESS_PAGE_ELEMENTS } from './data-source/models';\nimport type { CollectionFacets } from './collection-facets';\nimport type { CollectionBrowserDataSourceInterface } from './data-source/collection-browser-data-source-interface';\nimport {\n analyticsActions,\n analyticsCategories,\n} from './utils/analytics-events';\nimport { updateSelectedFacetBucket } from './utils/facet-utils';\nimport chevronIcon from './assets/img/icons/chevron';\nimport { srOnlyStyle } from './styles/sr-only';\nimport { sha1 } from './utils/sha1';\nimport type { PlaceholderType } from './empty-placeholder';\nimport type { ManageBar } from './manage/manage-bar';\nimport type { SmartFacetBar } from './collection-facets/smart-facets/smart-facet-bar';\n\nimport '@internetarchive/elements/ia-combo-box/ia-combo-box';\nimport './empty-placeholder';\nimport './tiles/tile-dispatcher';\nimport './tiles/collection-browser-loading-tile';\nimport './sort-filter-bar/sort-filter-bar';\nimport './manage/manage-bar';\nimport './collection-facets';\nimport './circular-activity-indicator';\nimport './collection-facets/smart-facets/smart-facet-bar';\n\n@customElement('collection-browser')\nexport class CollectionBrowser\n extends LitElement\n implements\n InfiniteScrollerCellProviderInterface,\n SharedResizeObserverResizeHandlerInterface,\n CollectionBrowserSearchInterface\n{\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: String }) baseImageUrl: string = 'https://archive.org';\n\n @property({ type: Object }) searchService?: SearchServiceInterface;\n\n /**\n * Which backend should be targeted by searches (e.g., metadata or FTS)\n */\n @property({ type: Number }) searchType: SearchType = SearchType.DEFAULT;\n\n /**\n * The identifier of the collection that searches should be performed within\n */\n @property({ type: String }) withinCollection?: string;\n\n /**\n * The identifier (e.g., @person) of the user whose profile is being searched within\n */\n @property({ type: String }) withinProfile?: string;\n\n /**\n * Which section of the profile page searches are for (e.g., uploads, reviews, ...)\n */\n @property({ type: String }) profileElement?: PageElementName;\n\n /**\n * The base query to use for all searches, updated to match the current user query.\n */\n @property({ type: String }) baseQuery?: string;\n\n /**\n * The base list of identifiers to fetch, if using the client_document_fetch feature\n * of the search service.\n *\n * This approach allows many more identifiers to be retrieved than a query like\n * `identifier:(foo OR bar OR ...)` would, but still may be more limited in what\n * content is returned by the backend\n */\n @property({ type: Array }) identifiers?: string[];\n\n /**\n * Which mode to display result tiles in (grid, extended list, or compact list)\n */\n @property({ type: String }) displayMode?: CollectionDisplayMode;\n\n @property({ type: String }) selectedSort: SortField = SortField.default;\n\n @property({ type: String }) selectedTitleFilter: string | null = null;\n\n @property({ type: String }) selectedCreatorFilter: string | null = null;\n\n @property({ type: String }) sortDirection: SortDirection | null = null;\n\n @property({ type: String }) defaultSortField: Exclude<\n SortField,\n SortField.default\n > = SortField.relevance;\n\n @property({ type: String }) defaultSortDirection: SortDirection | null = null;\n\n @property({ type: Number }) pageSize = 50;\n\n @property({ type: Number }) currentPage?: number;\n\n @property({ type: String }) minSelectedDate?: string;\n\n @property({ type: String }) maxSelectedDate?: string;\n\n @property({ type: Object }) selectedFacets?: SelectedFacets;\n\n /**\n * Set of filters to be applied internally to searches, but not included in URL params or\n * visibly selected facets. Use when this instance of collection browser is being shown\n * in a filtered context, such as a single-mediatype tab, but the corresponding filters\n * should not be exposed/changeable within that context.\n */\n @property({ type: Object }) internalFilters?: SelectedFacets;\n\n /**\n * Whether to show smart facets (bubbles) along the top of the component\n */\n @property({ type: Boolean }) showSmartFacetBar = false;\n\n /**\n * Sets the label that is shown in front of the smart facets, if present.\n */\n @property({ type: String }) smartFacetBarLabel?: string;\n\n /**\n * Whether to show the date picker (above the facets)\n */\n @property({ type: Boolean }) showHistogramDatePicker = false;\n\n /**\n * Whether placeholder views should be suppressed. If true, searches that produce an\n * error or empty result set will simply show a blank results view instead of a placeholder.\n */\n @property({ type: Boolean }) suppressPlaceholders = false;\n\n /**\n * Whether the result count text should be suppressed.\n * If true, no \"X Results\" message will be shown.\n */\n @property({ type: Boolean }) suppressResultCount = false;\n\n /**\n * Whether the scrolling result view should be suppressed entirely.\n * If true, no infinite scroller (and thus no result tiles) will be rendered.\n */\n @property({ type: Boolean }) suppressResultTiles = false;\n\n /**\n * Whether to suppress persistence of the query to the URL.\n * If true, the `query` param will not be added to the URL or updated on query changes.\n */\n @property({ type: Boolean }) suppressURLQuery = false;\n\n /**\n * Whether to suppress persistence of the `sin` search type param to the URL.\n * If true, the `sin` param will not be added to the URL or updated on query changes.\n */\n @property({ type: Boolean }) suppressURLSinParam = false;\n\n /**\n * Whether to suppress display of the sort bar.\n * If true, the entire sort bar (incl. display modes) will be omitted from rendering.\n */\n @property({ type: Boolean }) suppressSortBar = false;\n\n /**\n * Whether to suppress showing the display mode options in the sort bar.\n * If true, those options will be omitted (though the rest of the sort bar may still render).\n */\n @property({ type: Boolean }) suppressDisplayModes = false;\n\n /**\n * Whether to suppress the display of the `mediatype` facet group, e.g., because this instance\n * of collection browser is being shown in a filtered single-mediatype context.\n */\n @property({ type: Boolean }) suppressMediatypeFacets = false;\n\n /**\n * What strategy to use for when/whether to load facet data for a search.\n *\n * Defaults to `eager`, always loading facets immediately alongside search results.\n *\n * To eliminate facets that are never seen, this can be reduced to `lazy-mobile`, which\n * will delay loading facets in the mobile view until the \"Filters\" accordion is opened.\n * Facets are still loaded eagerly when viewing the desktop layout.\n *\n * To further reduce facet requests for patrons who do not need to use them, this can be\n * again reduced to `opt-in`, which will also require desktop users to explicitly request\n * that they be loaded (in addition to the lazy mobile behavior described above).\n *\n * To entirely suppress facets from being loaded, this may be set to `off`.\n */\n @property({ type: String }) facetLoadStrategy: FacetLoadStrategy = 'eager';\n\n @property({ type: Boolean, reflect: true }) facetPaneVisible = false;\n\n @property({ type: Boolean }) clearResultsOnEmptyQuery = false;\n\n @property({ type: String }) collectionPagePath: string = '/details/';\n\n /** describes where this component is being used */\n @property({ type: String, reflect: true }) searchContext: string =\n analyticsCategories.default;\n\n @property({ type: String }) pageContext: CollectionBrowserContext = 'search';\n\n @property({ type: Object })\n restorationStateHandler: RestorationStateHandlerInterface =\n new RestorationStateHandler({\n context: this.pageContext,\n });\n\n @property({ type: Number }) mobileBreakpoint = 600;\n\n @property({ type: Boolean }) loggedIn = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object }) modalManager?: ModalManagerInterface = undefined;\n\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n /**\n * Whether we are representing a TV collection, needing slightly different tile handling.\n */\n @property({ type: Boolean }) isTVCollection = false;\n\n /**\n * If item management UI active\n */\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: String }) manageViewLabel = 'Select items to remove';\n\n /** Whether to replace the default sort options with a slot for customization (default: false) */\n @property({ type: Boolean }) enableSortOptionsSlot = false;\n\n /** Whether to expose a slot for a smart results carousel above the full results */\n @property({ type: Boolean, reflect: true }) showSmartResults = false;\n\n /**\n * The maximum number of pages we will load when a privileged user clicks\n * the \"Manage\" button on the search page. Limited to 15 pages.\n */\n @property({ type: Number }) maxPagesToManage = 15;\n\n /**\n * The results per page so we can paginate.\n *\n * This allows us to start in the middle of the search results and\n * fetch data before or after the current page. If we don't have a key\n * for the previous/next page, we'll fetch the next/previous page to populate it\n */\n @property({ type: Object }) dataSource: CollectionBrowserDataSourceInterface =\n new CollectionBrowserDataSource(this, this.pageSize);\n\n /**\n * The page that the consumer wants to load.\n */\n initialPageNumber = 1;\n\n /**\n * This the the number of pages that we want to show.\n *\n * The data isn't necessarily loaded for all of the pages, but this lets us\n * know how many cells we should render.\n */\n @state() private pagesToRender = this.initialPageNumber;\n\n /**\n * Whether the initial page fetch for a new query is currently in progress.\n */\n @state() private searchResultsLoading = false;\n\n @state() private facetsLoading = false;\n\n @state() private totalResults?: number;\n\n @state() private mobileView = false;\n\n /**\n * Any temporarily overridden `on`/`off` state for the user's tile blurring preference if they\n * have chosen to override it, or `no-override` if they have not.\n */\n @state() private tileBlurOverrideState: TileBlurOverrideState = 'no-override';\n\n @state() private collapsibleFacetsVisible = false;\n\n @state() private contentWidth?: number;\n\n @state() private placeholderType: PlaceholderType = null;\n\n @state() private selectedTVNetwork?: string = undefined;\n\n @state() private selectedTVShow?: string = undefined;\n\n @state() private tvMapsPopulated: boolean = false;\n\n @state() private tvMapsLoading: boolean = false;\n\n @state() private tvMapsErrored: boolean = false;\n\n @query('#content-container') private contentContainer!: HTMLDivElement;\n\n @query('#left-column') private leftColumn?: HTMLDivElement;\n\n @query('collection-facets') private collectionFacets?: CollectionFacets;\n\n @query('manage-bar') private manageBar?: ManageBar;\n\n @query('smart-facet-bar') private smartFacetBar?: SmartFacetBar;\n\n @query('#tv-networks') private tvNetworksDropdown?: IAComboBox;\n\n @query('#tv-shows') private tvShowsDropdown?: IAComboBox;\n\n @property({ type: Object, attribute: false })\n analyticsHandler?: AnalyticsManagerInterface;\n\n /** Whether layout size analytics have been sent already. */\n private layoutSizeAnalyticsSent = false;\n\n /**\n * When we're animated scrolling to the page, we don't want to fetch\n * all of the pages as it scrolls so this lets us know if we're scrolling\n */\n private isScrollingToCell = false;\n\n /**\n * When page width resizes from desktop to mobile, set true to\n * disable expand/collapse transition when loading.\n */\n private isResizeToMobile = false;\n\n /**\n * Flag indicating that a new data source is currently being installed.\n * During the install, any URL persistence operation should replace the current entry\n * instead of creating a new one.\n */\n private dataSourceInstallInProgress = false;\n\n private leftColIntersectionObserver?: IntersectionObserver;\n\n private facetsIntersectionObserver?: IntersectionObserver;\n\n private placeholderCellTemplate = html`<collection-browser-loading-tile></collection-browser-loading-tile>`;\n\n constructor() {\n super();\n this.addController(this.dataSource);\n }\n\n private tileModelAtCellIndex(index: number): TileModel | undefined {\n const model = this.dataSource.getTileModelAt(index);\n /**\n * If we encounter a model we don't have yet and we're not in the middle of an\n * automated scroll, fetch the page and just return undefined.\n * The datasource will be updated once the page is loaded and the cell will be rendered.\n *\n * We disable it during the automated scroll since we don't want to fetch pages for intervening cells the\n * user may never see.\n */\n if (!model && !this.isScrollingToCell && this.dataSource.queryInitialized) {\n const pageNumber = Math.floor(index / this.pageSize) + 1;\n this.dataSource.fetchPage(pageNumber);\n }\n return model;\n }\n\n // this is the total number of tiles we expect if\n // the data returned is a full page worth\n // this is useful for putting in placeholders for the expected number of tiles\n private get estimatedTileCount(): number {\n return this.pagesToRender * this.pageSize;\n }\n\n @query('infinite-scroller')\n private infiniteScroller?: InfiniteScroller;\n\n private sessionIdGenPromise?: Promise<string>;\n\n /**\n * Returns a promise resolving to a unique string that persists for the current browser session.\n * Used in generating unique IDs for search requests, so that multiple requests coming from the\n * same browser session can be identified.\n */\n async getSessionId(): Promise<string> {\n try {\n const storedSessionId = sessionStorage?.getItem('cb-session');\n if (storedSessionId) {\n return storedSessionId;\n }\n\n // If we enter this method a second time while a first session ID is already being generated,\n // ensure we produce the same ID from both calls instead of generating another one.\n if (this.sessionIdGenPromise) {\n return this.sessionIdGenPromise;\n }\n\n this.sessionIdGenPromise = sha1(Math.random().toString());\n const newSessionId = await this.sessionIdGenPromise;\n\n sessionStorage?.setItem('cb-session', newSessionId);\n return newSessionId;\n } catch {\n // Either we can't generate the hash or we're restricted from accessing sessionStorage\n return '';\n }\n }\n\n /**\n * Go to the given page of results\n *\n * @param pageNumber\n */\n goToPage(pageNumber: number) {\n this.initialPageNumber = pageNumber;\n this.pagesToRender = pageNumber;\n return this.scrollToPage(pageNumber);\n }\n\n /**\n * Sets the state for whether the initial set of search results is loading in.\n */\n setSearchResultsLoading(loading: boolean): void {\n this.searchResultsLoading = loading;\n }\n\n /**\n * Sets the state for whether facet data is loading in\n */\n setFacetsLoading(loading: boolean): void {\n this.facetsLoading = loading;\n }\n\n /**\n * Sets the total number of results to be displayed for the current search\n */\n setTotalResultCount(totalResults: number): void {\n this.totalResults = totalResults;\n }\n\n /**\n * Clears all selected/negated facets, date ranges, and letter filters.\n *\n * By default, the current sort field/direction are not cleared,\n * but this can be overridden by setting the `sort` option to `true`.\n *\n * Similarly, it is possible to finely control what is cleared by\n * setting any of the `facets`, `dateRange`, or `letterFilters` flags\n * in the options object.\n */\n clearFilters({\n facets = true,\n dateRange = true,\n letterFilters = true,\n sort = false,\n } = {}): void {\n // Don't bother clearing facets if none are checked, so that we don't\n // trigger unnecessary update cycles.\n if (facets && this.hasCheckedFacets) {\n this.selectedFacets = getDefaultSelectedFacets();\n }\n\n if (dateRange) {\n this.minSelectedDate = undefined;\n this.maxSelectedDate = undefined;\n }\n\n if (letterFilters) {\n this.selectedTitleFilter = null;\n this.selectedCreatorFilter = null;\n }\n\n if (sort) {\n this.sortDirection = null;\n this.selectedSort = SortField.default;\n }\n\n this.clearTVDropdowns();\n\n if (this.smartFacetBar) {\n this.smartFacetBar.deselectAll();\n }\n }\n\n /**\n * Resets any selected TV network/show dropdowns to their default state\n */\n private clearTVDropdowns(): void {\n this.selectedTVNetwork = undefined;\n this.selectedTVShow = undefined;\n\n if (this.tvNetworksDropdown) {\n this.tvNetworksDropdown.clearSelectedOption();\n }\n\n if (this.tvShowsDropdown) {\n this.tvShowsDropdown.clearSelectedOption();\n }\n }\n\n /**\n * Returns true if the current value of `this.selectedFacets` contains\n * any facet buckets than have been selected or negated, or false otherwise.\n */\n private get hasCheckedFacets(): boolean {\n if (!this.selectedFacets) return false;\n\n for (const facetGroup of Object.values(this.selectedFacets)) {\n for (const bucket of Object.values(facetGroup)) {\n if (bucket.state !== 'none') return true;\n }\n }\n\n return false;\n }\n\n /**\n * Returns true if there are any currently selected/negated facet buckets,\n * any selected date range, or any selected letter filters. False otherwise.\n *\n * Ignores sorting options.\n */\n private get hasActiveFilters(): boolean {\n return !!(\n this.hasCheckedFacets ||\n this.minSelectedDate ||\n this.maxSelectedDate ||\n this.selectedTitleFilter ||\n this.selectedCreatorFilter\n );\n }\n\n willUpdate(changed: PropertyValues): void {\n this.setPlaceholderType();\n\n if (changed.has('searchType') && this.searchType === SearchType.TV) {\n this.applyDefaultTVSearchSort();\n }\n }\n\n render() {\n return html`\n ${this.showSmartFacetBar && this.placeholderType === null\n ? html`<smart-facet-bar\n .query=${this.baseQuery}\n .aggregations=${this.dataSource.aggregations}\n .selectedFacets=${this.selectedFacets}\n .collectionTitles=${this.dataSource.collectionTitles}\n .filterToggleShown=${!this.mobileView}\n .filterToggleActive=${this.facetPaneVisible}\n .label=${this.smartFacetBarLabel}\n @facetsChanged=${this.facetsChanged}\n @filtersToggled=${() => {\n this.facetPaneVisible = !this.facetPaneVisible;\n this.emitFacetPaneVisibilityChanged();\n }}\n ></smart-facet-bar>`\n : nothing}\n\n <div\n id=\"content-container\"\n class=${this.mobileView ? 'mobile' : 'desktop'}\n >\n ${this.placeholderType\n ? this.emptyPlaceholderTemplate\n : this.collectionBrowserTemplate}\n </div>\n `;\n }\n\n /**\n * Determines what type of placeholder content should be shown instead of result tiles, if applicable.\n * The placeholders indicate states where we have no results to show, which could be the result of:\n * - No query is set (on the search page)\n * - No results were returned for the most recent search\n * - The collection being searched within has no viewable items\n * - An error occurred on the most recent search attempt\n */\n private setPlaceholderType() {\n const isInitialized = this.dataSource.queryInitialized;\n const hasQuery = !!this.baseQuery?.trim();\n const hasIdentifiers = !!this.identifiers?.length;\n const isCollection = !!this.withinCollection;\n const isProfile = !!this.withinProfile;\n const isSearchResults = !isCollection && !isProfile;\n const noResults =\n !this.searchResultsLoading &&\n (this.dataSource.size === 0 || !this.searchService);\n\n this.placeholderType = null;\n if (this.suppressPlaceholders) return;\n\n if (!isInitialized) {\n this.placeholderType = 'empty-query';\n } else if (isSearchResults && !hasQuery && !hasIdentifiers) {\n this.placeholderType = 'empty-query';\n } else if (noResults) {\n // Within a collection, no query + no results means the collection simply has no viewable items.\n // Otherwise, we must have a user query that produced 0 results.\n this.placeholderType =\n !hasQuery && isCollection ? 'empty-collection' : 'no-results';\n }\n\n if (this.dataSource.queryErrorMessage) {\n this.placeholderType =\n !hasQuery && isCollection ? 'collection-error' : 'query-error';\n }\n }\n\n /**\n * Template for the placeholder content to show when no results are available.\n */\n private get emptyPlaceholderTemplate() {\n return html`\n <empty-placeholder\n .placeholderType=${this.placeholderType}\n ?isMobileView=${this.mobileView}\n ?isCollection=${!!this.withinCollection}\n .detailMessage=${this.dataSource.queryErrorMessage ?? ''}\n .baseNavigationUrl=${this.baseNavigationUrl}\n ></empty-placeholder>\n `;\n }\n\n /**\n * Top-level template for rendering the left (facets) and right (results) columns.\n */\n private get collectionBrowserTemplate() {\n return html`\n <div id=\"left-column-scroll-sentinel\"></div>\n ${this.leftColumnTemplate} ${this.rightColumnTemplate}\n `;\n }\n\n /**\n * Template for either the mobile or desktop version of the left column, depending\n * on current component state.\n */\n private get leftColumnTemplate(): TemplateResult {\n if (this.mobileView) {\n return this.mobileLeftColumnTemplate;\n }\n return this.desktopLeftColumnTemplate;\n }\n\n /**\n * Template for the mobile version of the \"left column\" (which in this case, appears\n * *above* the search results rather than beside them), for rendering the\n * accordion-style facets.\n */\n private get mobileLeftColumnTemplate(): TemplateResult {\n return html`\n <div\n id=\"left-column\"\n class=\"column${this.isResizeToMobile ? ' preload' : ''}\"\n >\n ${this.facetTopViewSlot} ${this.resultsCountTemplate}\n <div id=\"facets-header-container\">${this.mobileFacetsTemplate}</div>\n </div>\n `;\n }\n\n /**\n * Template for the desktop version of the left column, displaying the facets sidebar.\n */\n private get desktopLeftColumnTemplate(): TemplateResult {\n return html`\n <div id=\"left-column\" class=\"column\" ?hidden=${!this.facetPaneVisible}>\n ${this.facetTopViewSlot}\n <div id=\"facets-header-container\">\n <h2 id=\"facets-header\" class=\"sr-only\">${msg('Filters')}</h2>\n ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}\n </div>\n <div id=\"facets-container\" aria-labelledby=\"facets-header\">\n ${this.facetsTemplate}\n <div id=\"facets-scroll-sentinel\"></div>\n </div>\n <div id=\"facets-bottom-fade\"></div>\n </div>\n `;\n }\n\n /**\n * Slot which is placed at top of the facets area for user-profile page\n * - mainly used to render userlists\n */\n private get facetTopViewSlot(): TemplateResult {\n return html`<div id=\"facet-top-view\">\n <slot name=\"facet-top-slot\"></slot>\n </div>`;\n }\n\n /**\n * Template for the \"X Results\" count at the top of the search results.\n * Changes to the \"Searching...\" label if the search results are still loading.\n */\n private get resultsCountTemplate(): TemplateResult | typeof nothing {\n if (this.suppressResultCount) return nothing;\n\n const shouldShowSearching =\n this.searchResultsLoading || this.totalResults === undefined;\n const classes = classMap({ filtered: this.hasActiveFilters });\n const resultsCount = this.totalResults?.toLocaleString();\n const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';\n\n // Added data-testid for Playwright testing\n return html`\n <div id=\"results-total\" class=${classes} data-testid=\"results-total\">\n <span id=\"big-results-count\">\n ${shouldShowSearching ? html`Searching…` : resultsCount}\n </span>\n <span id=\"big-results-label\">\n ${shouldShowSearching ? nothing : resultsLabel}\n </span>\n </div>\n `;\n }\n\n /**\n * Template for the right column of the collection browser, where the result\n * tiles and sort/filter bar are shown.\n */\n private get rightColumnTemplate(): TemplateResult {\n const rightColumnClasses = classMap({\n column: true,\n 'full-width': !this.facetPaneVisible,\n 'smart-results-spacing': !!this.showSmartResults,\n });\n\n return html`\n <div id=\"right-column\" class=${rightColumnClasses}>\n ${this.showSmartResults\n ? html`<slot name=\"smart-results\"></slot>`\n : nothing}\n <section id=\"results\">\n <h2 class=\"results-section-heading\">\n <slot name=\"results-heading\"></slot>\n </h2>\n <div id=\"cb-top-view\">\n <slot name=\"cb-top-slot\"></slot>\n </div>\n ${this.isManageView\n ? this.manageBarTemplate\n : this.sortFilterBarTemplate}\n <slot name=\"cb-results\"></slot>\n ${this.displayMode === `list-compact` && this.totalResults\n ? this.listHeaderTemplate\n : nothing}\n ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}\n </section>\n </div>\n `;\n }\n\n /**\n * Template for the infinite scroller widget that contains the result tiles.\n */\n private get infiniteScrollerTemplate() {\n return html`<infinite-scroller\n class=${this.infiniteScrollerClasses}\n itemCount=${this.placeholderType ? 0 : nothing}\n ariaLandmarkLabel=\"Search results\"\n .cellProvider=${this}\n .placeholderCellTemplate=${this.placeholderCellTemplate}\n @scrollThresholdReached=${this.scrollThresholdReached}\n @visibleCellsChanged=${this.visibleCellsChanged}\n >${this.displayMode === 'grid'\n ? html`<slot name=\"result-last-tile\" slot=\"result-last-tile\"></slot>`\n : nothing}\n </infinite-scroller>`;\n }\n\n /**\n * Produces a `classMap` indicating which classes the infinite scroller should have\n * given the current display mode & placeholder case.\n */\n private get infiniteScrollerClasses() {\n return classMap({\n [this.displayMode ?? '']: !!this.displayMode,\n hidden: !!this.placeholderType,\n });\n }\n\n /**\n * Template for the sort & filtering bar that appears atop the search results.\n */\n private get sortFilterBarTemplate(): TemplateResult | typeof nothing {\n if (this.suppressSortBar) return nothing;\n\n // Determine the set of sortable fields that should be shown in the sort bar\n let sortFieldAvailability = defaultSortAvailability;\n\n // We adjust the available sort options for a couple of special cases...\n if (this.withinCollection?.startsWith('fav-')\n || (this.profileElement as string) === 'favorites'\n ) {\n // When viewing a fav- collection or the favorites profile tab,\n // we include the Date Favorited option as the default\n sortFieldAvailability = favoritesSortAvailability;\n console.log('favoritesSortAvailability', true);\n } else if (!this.withinCollection && this.searchType === SearchType.TV) {\n // When viewing TV search results, we exclude several of the usual date sort options.\n sortFieldAvailability = tvSortAvailability;\n }\n\n // We only show relevance sort if a search query is currently defined\n sortFieldAvailability.relevance = this.isRelevanceSortAvailable;\n\n return html`\n <sort-filter-bar\n .defaultSortField=${this.defaultSortField}\n .defaultSortDirection=${this.defaultSortDirection}\n .selectedSort=${this.selectedSort}\n .sortDirection=${this.sortDirection}\n .sortFieldAvailability=${sortFieldAvailability}\n .displayMode=${this.displayMode}\n .selectedTitleFilter=${this.selectedTitleFilter}\n .selectedCreatorFilter=${this.selectedCreatorFilter}\n .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}\n .enableSortOptionsSlot=${this.enableSortOptionsSlot}\n .suppressDisplayModes=${this.suppressDisplayModes}\n @sortChanged=${this.userChangedSort}\n @displayModeChanged=${this.displayModeChanged}\n @titleLetterChanged=${this.titleLetterSelected}\n @creatorLetterChanged=${this.creatorLetterSelected}\n >\n ${this.tileBlurCheckboxTemplate}\n <slot name=\"sort-options-left\" slot=\"sort-options-left\"></slot>\n <slot name=\"sort-options\" slot=\"sort-options\"></slot>\n <slot name=\"sort-options-right\" slot=\"sort-options-right\"></slot>\n </sort-filter-bar>\n `;\n }\n\n /**\n * Template for the Blurring toggle for admins to enable/disable blurring of\n * sensitive content in result tiles.\n */\n private get tileBlurCheckboxTemplate(): TemplateResult | typeof nothing {\n // Only show the checkbox for @archive.org users\n if (!this.dataSource.sessionContext?.is_archive_user) return nothing;\n\n return html`\n <label\n id=\"tile-blur-label\"\n for=\"tile-blur-check\"\n slot=\"sort-options-right\"\n >\n ${msg('Blurring')}\n <input\n id=\"tile-blur-check\"\n type=\"checkbox\"\n ?checked=${!this.shouldSuppressTileBlurring}\n @change=${this.tileBlurCheckboxChanged}\n />\n </label>\n `;\n }\n\n /**\n * Message to show in the manage view modal, depending on context.\n */\n private get manageViewModalMsg(): string {\n const pluralize = this.dataSource.checkedTileModels.length > 1;\n\n switch (this.profileElement) {\n case 'uploads':\n return pluralize\n ? msg(\n 'Note: It may take a few minutes for these items to stop appearing in your uploads list.',\n )\n : msg(\n 'Note: It may take a few minutes for this item to stop appearing in your uploads list.',\n );\n case 'web_archives':\n return pluralize\n ? msg(\n 'Note: It may take a few minutes for these items to stop appearing in your web archives list.',\n )\n : msg(\n 'Note: It may take a few minutes for this item to stop appearing in your web archives list.',\n );\n default:\n return '';\n }\n }\n\n /**\n * Template for the manage bar UI that appears atop the search results when we are\n * showing the management view. This generally replaces the sort bar when present.\n */\n private get manageBarTemplate(): TemplateResult {\n return html`\n <manage-bar\n .label=${this.manageViewLabel}\n .modalManager=${this.modalManager}\n .selectedItems=${this.dataSource.checkedTileModels}\n .manageViewModalMsg=${this.manageViewModalMsg}\n showSelectAll\n showUnselectAll\n ?showItemManageButton=${this.pageContext === 'search'}\n ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}\n @removeItems=${this.handleRemoveItems}\n @manageItems=${this.handleManageItems}\n @selectAll=${() => this.dataSource.checkAllTiles()}\n @unselectAll=${() => this.dataSource.uncheckAllTiles()}\n @cancel=${() => {\n this.isManageView = false;\n this.dataSource.uncheckAllTiles();\n if (this.searchResultsLoading) this.dataSource.resetPages();\n }}\n ></manage-bar>\n `;\n }\n\n /**\n * Handler for when the user requests to remove all checked items via the manage bar.\n * Emits an `itemRemovalRequested` event with all checked tile models.\n */\n private handleRemoveItems(): void {\n this.dispatchEvent(\n new CustomEvent<{ items: string[] }>('itemRemovalRequested', {\n detail: {\n items: this.dataSource.checkedTileModels.map(model => {\n // For favorited searches, we attach a search: prefix to differentiate it from an item\n const searchPrefix = model?.mediatype === 'search' ? 'search:' : '';\n const identifier = model?.identifier ?? '';\n return `${searchPrefix}${identifier}`;\n }),\n },\n }),\n );\n }\n\n /**\n * Handler when user request to bulk edit from /search/ page\n */\n private handleManageItems(): void {\n this.dispatchEvent(\n new CustomEvent<{ items: string[] }>('itemManagerRequested', {\n detail: {\n items: this.dataSource.checkedTileModels.map(model =>\n model?.identifier ? model.identifier : '',\n ),\n },\n }),\n );\n }\n\n refreshSmartFacets(): void {\n this.smartFacetBar?.refresh();\n }\n\n /**\n * Handler to show processing modal while removing item\n */\n showRemoveItemsProcessingModal(): void {\n this.manageBar?.showRemoveItemsProcessingModal();\n }\n\n /**\n * Handler to show error modal when item removal failed\n */\n showRemoveItemsErrorModal(): void {\n this.manageBar?.showRemoveItemsErrorModal();\n }\n\n /**\n * Removes all tile models that are currently checked & adjusts the paging\n * of the data source to account for any new gaps in the data.\n */\n removeCheckedTiles(): void {\n this.dataSource.removeCheckedTiles();\n }\n\n /**\n * Handler for when the tile blurring checkbox state is toggled\n */\n private tileBlurCheckboxChanged(e: Event): void {\n const { checked } = e.target as HTMLInputElement;\n this.tileBlurOverrideState = checked ? 'on' : 'off';\n this.infiniteScroller?.refreshAllVisibleCells();\n }\n\n /**\n * Whether result tiles should have the default blurring of sensitive content suppressed.\n * First considers any override specified by the user, falling back to the setting in\n * user preferences if not overridden.\n */\n private get shouldSuppressTileBlurring(): boolean {\n if (this.tileBlurOverrideState !== 'no-override') {\n // User wants to override their preference.\n // Return true if they want blurring turned off, or false otherwise.\n return this.tileBlurOverrideState === 'off';\n }\n\n // Not overriding, so use the preference from session context\n const { sessionContext } = this.dataSource;\n const userPrefs = sessionContext?.pps_relevant_user_preferences;\n const blurringPref = userPrefs?.display__blur_moderated_content;\n\n // Only suppress blurring if the preference is disabled.\n // If enabled or missing, tile blurring remains on.\n return blurringPref === 'off';\n }\n\n /**\n * Handler for when the user changes the selected sort option or direction.\n */\n private userChangedSort(\n e: CustomEvent<{\n selectedSort: SortField;\n sortDirection: SortDirection | null;\n }>,\n ) {\n const { selectedSort, sortDirection } = e.detail;\n this.selectedSort = selectedSort;\n this.sortDirection = sortDirection;\n\n if ((this.currentPage ?? 1) > 1) {\n this.goToPage(1);\n }\n this.currentPage = 1;\n }\n\n /**\n * Fires an analytics event for sorting changes.\n * @param prevSortDirection Which sort direction was previously set.\n */\n private sendSortByAnalytics(prevSortDirection: SortDirection | null): void {\n const directionCleared = prevSortDirection && !this.sortDirection;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.sortBy,\n label: `${this.selectedSort}${\n this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''\n }`,\n });\n }\n\n /**\n * Handler for when the selected sort option is updated, whether by the user\n * themselves or programmatically.\n */\n private selectedSortChanged(): void {\n // Lazy-load the alphabet counts for title/creator sort bar as needed\n this.dataSource.updatePrefixFiltersForCurrentSort();\n }\n\n /**\n * An object representing the current sort field & direction.\n */\n get sortParam(): SortParam | null {\n const sortOption = SORT_OPTIONS[this.selectedSort];\n if (!sortOption?.handledBySearchService) {\n return null;\n }\n\n // If the sort option specified in the URL is unrecognized, we just use it as-is\n const urlSortParam = new URL(window.location.href).searchParams.get('sort');\n const sortField =\n sortOption.searchServiceKey ?? urlSortParam?.replace(/^-/, '');\n\n // If the sort direction is still null at this point, then we assume ascending\n // (i.e., it was unrecognized and had no directional flag)\n if (!this.sortDirection) this.sortDirection = 'asc';\n\n if (!sortField) return null;\n return { field: sortField, direction: this.sortDirection };\n }\n\n /**\n * An object representing the default sort field & direction, if none are explicitly set.\n */\n get defaultSortParam(): SortParam | null {\n const direction = this.defaultSortDirection ?? 'asc';\n const field = SORT_OPTIONS[this.defaultSortField].searchServiceKey;\n if (!field) return null;\n\n return { field, direction };\n }\n\n /**\n * Handler for when the display mode option is changed (grid/list/compact-list views).\n */\n private displayModeChanged(\n e: CustomEvent<{ displayMode?: CollectionDisplayMode }>,\n ): void {\n this.displayMode = e.detail.displayMode;\n\n if (this.displayMode) {\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.displayMode,\n label: this.displayMode,\n });\n }\n }\n\n /**\n * Returns a query clause identifying the currently selected title filter,\n * e.g., `firstTitle:X`.\n */\n private get titleQuery(): string | undefined {\n return this.selectedTitleFilter\n ? `firstTitle:${this.selectedTitleFilter}`\n : undefined;\n }\n\n /**\n * Returns a query clause identifying the currently selected creator filter,\n * e.g., `firstCreator:X`.\n */\n private get creatorQuery(): string | undefined {\n return this.selectedCreatorFilter\n ? `firstCreator:${this.selectedCreatorFilter}`\n : undefined;\n }\n\n /**\n * Send Analytics when sorting by title's first letter\n * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'\n */\n private sendFilterByTitleAnalytics(prevSelectedLetter: string | null): void {\n if (!prevSelectedLetter && !this.selectedTitleFilter) {\n return;\n }\n const cleared = prevSelectedLetter && !this.selectedTitleFilter;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.filterByTitle,\n label: cleared\n ? `clear-${prevSelectedLetter}`\n : `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,\n });\n }\n\n /**\n * Send Analytics when filtering by creator's first letter\n * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'\n */\n private sendFilterByCreatorAnalytics(\n prevSelectedLetter: string | null,\n ): void {\n if (!prevSelectedLetter && !this.selectedCreatorFilter) {\n return;\n }\n const cleared = prevSelectedLetter && !this.selectedCreatorFilter;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.filterByCreator,\n label: cleared\n ? `clear-${prevSelectedLetter}`\n : `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,\n });\n }\n\n /**\n * Handler for changes to which letter is selected in the title alphabet bar.\n */\n private titleLetterSelected(\n e: CustomEvent<{ selectedLetter: string | null }>,\n ): void {\n this.selectedCreatorFilter = null;\n this.selectedTitleFilter = e.detail.selectedLetter;\n }\n\n /**\n * Handler for changes to which letter is selected in the creator alphabet bar.\n */\n private creatorLetterSelected(\n e: CustomEvent<{ selectedLetter: string | null }>,\n ): void {\n this.selectedTitleFilter = null;\n this.selectedCreatorFilter = e.detail.selectedLetter;\n }\n\n /**\n * The full template for how the facets should be structured in mobile view,\n * including the collapsible container (with header) and the facets themselves.\n */\n private get mobileFacetsTemplate(): TemplateResult | typeof nothing {\n if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement!)) return nothing;\n\n const toggleFacetsVisible = (e: Event) => {\n const target = e.target as HTMLDetailsElement;\n this.isResizeToMobile = false;\n this.collapsibleFacetsVisible = target.open;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.mobileFacetsToggled,\n label: target.open ? 'open' : 'closed',\n });\n };\n\n return html`\n <details id=\"mobile-filter-collapse\" @toggle=${toggleFacetsVisible}>\n <summary>\n <span class=\"collapser-icon\">${chevronIcon}</span>\n <h2>${msg('Filters')}</h2>\n ${this.clearFiltersBtnTemplate(true)}\n </summary>\n ${this.facetsTemplate}\n </details>\n `;\n }\n\n /**\n * Handler for when either of the TV dropdown filters are toggled, loading their\n * contents if necessary.\n */\n private async tvDropdownToggled(e: CustomEvent<boolean>): Promise<void> {\n if (!e.detail) return; // Only run when toggled open\n if (this.tvMapsPopulated) return;\n\n this.tvMapsLoading = true;\n this.tvMapsErrored = false;\n try {\n await this.dataSource.populateTVChannelMaps();\n this.tvMapsPopulated = true;\n } catch (err) {\n this.tvMapsErrored = true;\n }\n\n this.tvMapsLoading = false;\n }\n\n private async networksDropdownChanged(): Promise<void> {\n const previousNetwork = this.selectedTVNetwork;\n const newNetwork = this.tvNetworksDropdown!.selectedOption?.text;\n this.selectedTVNetwork = newNetwork ?? undefined;\n\n const entries = this.dataSource.tvChannelMaps.channelToNetwork!.entries();\n for (const [channel, network] of entries) {\n if (network === previousNetwork) {\n // Remove any previously-applied network filter\n const removedBucket: FacetBucket = {\n key: channel.toLowerCase(),\n count: 0,\n state: 'none',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'creator',\n removedBucket,\n true,\n );\n } else if (network === this.selectedTVNetwork) {\n const newBucket: FacetBucket = {\n key: channel.toLowerCase(),\n count: 0,\n state: 'selected',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'creator',\n newBucket,\n );\n }\n }\n }\n\n private async showsDropdownChanged(): Promise<void> {\n const previousShow = this.selectedTVShow;\n const newShow = this.tvShowsDropdown!.selectedOption?.text;\n this.selectedTVShow = newShow ?? undefined;\n\n // Remove any previously-applied shows filter\n if (previousShow !== undefined) {\n const removedBucket: FacetBucket = {\n key: previousShow,\n count: 0,\n state: 'none',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'program',\n removedBucket,\n true,\n );\n }\n\n if (this.selectedTVShow) {\n const newBucket: FacetBucket = {\n key: this.selectedTVShow,\n count: 0,\n state: 'selected',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'program',\n newBucket,\n );\n }\n }\n\n private get tvDropdownFiltersTemplate(): TemplateResult | typeof nothing {\n if (this.searchType !== SearchType.TV) return nothing;\n\n const { channelToNetwork, programToChannels } =\n this.dataSource.tvChannelMaps;\n const networks = channelToNetwork\n ? [...new Set(channelToNetwork.values())]\n : [];\n\n let showEntries = programToChannels ? [...programToChannels.entries()] : [];\n\n if (channelToNetwork && this.selectedTVNetwork) {\n showEntries = showEntries.filter(([, channels]) =>\n Object.keys(channels).some(\n c => channelToNetwork.get(c) === this.selectedTVNetwork,\n ),\n );\n }\n\n const filterByNetworkLabel = msg('Filter by Network');\n const filterByShowLabel = msg('Filter by Show');\n const shows = showEntries.map(([show]) => show);\n const loadingIndicator = html`\n <span slot=\"empty-options\">\n <img src=\"https://archive.org/images/loading.gif\" />\n </span>\n `;\n const errorMessage = html`\n <span slot=\"empty-options\">\n ${msg('Unable to fetch options, try again later')}\n </span>\n `;\n\n return html`\n <div id=\"tv-filters\" slot=\"facets-top\">\n <ia-combo-box\n id=\"tv-networks\"\n class=\"tv-filter-dropdown\"\n placeholder=${filterByNetworkLabel}\n clearable\n wrap-arrow-keys\n sort\n .options=${networks.map((n, i) => ({ id: `network-${i}`, text: n }))}\n @toggle=${this.tvDropdownToggled}\n @change=${this.networksDropdownChanged}\n >\n <span slot=\"label\" class=\"sr-only\">${filterByNetworkLabel}</span>\n ${this.tvMapsLoading ? loadingIndicator : nothing}\n ${this.tvMapsErrored ? errorMessage : nothing}\n </ia-combo-box>\n <ia-combo-box\n id=\"tv-shows\"\n class=\"tv-filter-dropdown\"\n placeholder=${filterByShowLabel}\n max-autocomplete-entries=\"500\"\n clearable\n wrap-arrow-keys\n sort\n .options=${shows.map((s, i) => ({ id: `show-${i}`, text: s }))}\n @toggle=${this.tvDropdownToggled}\n @change=${this.showsDropdownChanged}\n >\n <span slot=\"label\" class=\"sr-only\">${filterByShowLabel}</span>\n ${this.tvMapsLoading ? loadingIndicator : nothing}\n ${this.tvMapsErrored ? errorMessage : nothing}\n </ia-combo-box>\n </div>\n `;\n }\n\n /**\n * The template for the facets component alone, without any surrounding wrappers.\n */\n private get facetsTemplate() {\n if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement!)) return nothing;\n if (this.facetLoadStrategy === 'off') {\n return html`\n <p class=\"facets-message\">\n ${msg('Facets are temporarily unavailable.')}\n </p>\n `;\n }\n\n // We switch to TV facet ordering & date picker if we are in a TV collection or showing TV search results\n const shouldUseTvInterface =\n this.isTVCollection ||\n (!this.withinCollection && this.searchType === SearchType.TV);\n const facetDisplayOrder = shouldUseTvInterface\n ? tvFacetDisplayOrder\n : defaultFacetDisplayOrder;\n\n const facets = html`\n <collection-facets\n .collectionPagePath=${this.collectionPagePath}\n .parentCollections=${this.dataSource.parentCollections}\n .pageSpecifierParams=${this.dataSource.pageSpecifierParams}\n .searchService=${this.searchService}\n .featureFeedbackService=${this.featureFeedbackService}\n .recaptchaManager=${this.recaptchaManager}\n .resizeObserver=${this.resizeObserver}\n .searchType=${this.searchType}\n .aggregations=${this.dataSource.aggregations}\n .histogramAggregation=${this.dataSource.histogramAggregation}\n .minSelectedDate=${this.minSelectedDate}\n .maxSelectedDate=${this.maxSelectedDate}\n .selectedFacets=${this.selectedFacets}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .collectionTitles=${this.dataSource.collectionTitles}\n .tvChannelAliases=${this.dataSource.tvChannelAliases}\n .showHistogramDatePicker=${this.showHistogramDatePicker}\n .allowExpandingDatePicker=${!this.mobileView}\n .allowDatePickerMonths=${shouldUseTvInterface}\n .contentWidth=${this.contentWidth}\n .query=${this.baseQuery}\n .identifiers=${this.identifiers}\n .filterMap=${this.dataSource.filterMap}\n .isManageView=${this.isManageView}\n .modalManager=${this.modalManager}\n .analyticsHandler=${this.analyticsHandler}\n .facetDisplayOrder=${facetDisplayOrder}\n .isTvSearch=${shouldUseTvInterface}\n ?collapsableFacets=${this.mobileView}\n ?facetsLoading=${this.facetsLoading}\n ?histogramAggregationLoading=${this.facetsLoading}\n ?suppressMediatypeFacets=${this.suppressMediatypeFacets}\n @facetClick=${this.facetClickHandler}\n @facetsChanged=${this.facetsChanged}\n @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}\n >\n ${this.tvDropdownFiltersTemplate}\n </collection-facets>\n `;\n\n // If we are using one of the opt-in facet load strategies, we may need to wrap the\n // desktop view facets in a <details> widget so that patrons can opt into loading them.\n // In the `opt-in-or-login` case, we only do this if they are not logged in.\n const showDesktopOptInWidget =\n this.facetLoadStrategy === 'opt-in' ||\n (this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);\n\n if (showDesktopOptInWidget && !this.mobileView) {\n return html`\n <details\n class=\"desktop-facets-dropdown\"\n @toggle=${(e: Event) => {\n const target = e.target as HTMLDetailsElement;\n this.collapsibleFacetsVisible = target.open;\n }}\n >\n <summary>\n <span class=\"collapser-icon\">${chevronIcon}</span>\n <h2>${msg('Filters')}</h2>\n </summary>\n ${facets}\n </details>\n `;\n }\n // Otherwise, just render the facets component bare\n return facets;\n }\n\n /**\n * The HTML template for the \"Clear all filters\" button, or `nothing` if no\n * filters are currently active.\n *\n * @param mobile Whether to style/shorten the button for mobile view\n */\n private clearFiltersBtnTemplate(\n mobile: boolean,\n ): TemplateResult | typeof nothing {\n if (!this.hasActiveFilters) return nothing;\n\n const buttonClasses = classMap({\n 'clear-filters-btn': true,\n mobile,\n });\n\n const buttonText = mobile ? 'Clear all' : 'Clear all filters';\n\n return html`\n <div class=\"clear-filters-btn-row\">\n ${mobile\n ? html`<span class=\"clear-filters-btn-separator\"> </span>`\n : nothing}\n <button class=${buttonClasses} @click=${this.clearFilters}>\n ${buttonText}\n </button>\n </div>\n `;\n }\n\n /**\n * Template for the table header content that appears atop the compact list view.\n */\n private get listHeaderTemplate() {\n return html`\n <div id=\"list-header\">\n <tile-dispatcher\n .tileDisplayMode=${'list-header'}\n .resizeObserver=${this.resizeObserver}\n .sortParam=${this.sortParam}\n .defaultSortParam=${this.defaultSortParam}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.shouldSuppressTileBlurring}\n >\n </tile-dispatcher>\n </div>\n `;\n }\n\n /**\n * Handler for when the date picker's date range is changed.\n */\n private histogramDateRangeUpdated(\n e: CustomEvent<{\n minDate: string;\n maxDate: string;\n }>,\n ) {\n const { minDate, maxDate } = e.detail;\n [this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.histogramChanged,\n label: this.dateRangeQueryClause,\n });\n }\n\n /**\n * The Lucene query corresponding to the current date range.\n */\n private get dateRangeQueryClause() {\n if (!this.minSelectedDate || !this.maxSelectedDate) {\n return undefined;\n }\n\n return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;\n }\n\n /**\n * Emits an event indicating a change in whether the manage mode is shown.\n */\n private emitManageModeChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent<boolean>('manageModeChanged', {\n detail: this.isManageView,\n }),\n );\n }\n\n /**\n * Installs a new data source component and associated query state parameters into\n * this component, causing it to efficiently update its views to represent the\n * newly-provided data. In this way, one can reuse a single instance of\n * <collection-browser> to handle multiple different sets of search results on\n * a single page, each set of results being loaded & updated by its own data\n * source.\n *\n * @param dataSource The data source component containing (or prepared to fetch)\n * the tile data to be displayed.\n * @param queryState The new query-related state that this component should\n * represent, such as the search query, sort option, and any filters applied.\n */\n async installDataSourceAndQueryState(\n dataSource: CollectionBrowserDataSourceInterface,\n queryState: CollectionBrowserQueryState,\n ): Promise<void> {\n if (this.dataSource) this.removeController(this.dataSource);\n this.dataSource = dataSource;\n this.addController(this.dataSource);\n\n this.baseQuery = queryState.baseQuery;\n this.profileElement = queryState.profileElement;\n this.searchType = queryState.searchType;\n this.selectedFacets =\n queryState.selectedFacets ?? getDefaultSelectedFacets();\n this.internalFilters = queryState.internalFilters;\n this.minSelectedDate = queryState.minSelectedDate;\n this.maxSelectedDate = queryState.maxSelectedDate;\n this.selectedSort = queryState.selectedSort ?? SortField.default;\n this.sortDirection = queryState.sortDirection;\n this.selectedTitleFilter = queryState.selectedTitleFilter;\n this.selectedCreatorFilter = queryState.selectedCreatorFilter;\n\n this.pagesToRender = this.initialPageNumber;\n\n // We set this flag during the update to prevent the URL state persistence\n // from creating an unwanted extra history entry.\n this.dataSourceInstallInProgress = true;\n this.requestUpdate();\n await this.updateComplete;\n this.dataSourceInstallInProgress = false;\n\n if (!this.searchResultsLoading) {\n this.setTotalResultCount(this.dataSource.totalResults);\n this.setTileCount(this.dataSource.size);\n }\n\n this.refreshVisibleResults();\n }\n\n firstUpdated(): void {\n this.restoreState();\n this.setInitialSize();\n }\n\n /**\n * Determines the initial size of the content container and whether or not\n * the mobile layout should be used.\n */\n setInitialSize(): void {\n this.contentWidth = this.contentContainer.getBoundingClientRect().width;\n this.mobileView =\n this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;\n this.sendLayoutSizeAnalytics();\n }\n\n /**\n * Fires an analytics event indicating which type of layout was rendered:\n * mobile or desktop.\n */\n private sendLayoutSizeAnalytics(): void {\n if (this.analyticsHandler) {\n this.layoutSizeAnalyticsSent = true;\n this.analyticsHandler.sendEvent({\n category: this.searchContext,\n action: this.mobileView\n ? analyticsActions.loadMobileView\n : analyticsActions.loadDesktopView,\n });\n }\n }\n\n updated(changed: PropertyValues) {\n if (changed.has('placeholderType') && this.placeholderType === null) {\n if (!this.leftColIntersectionObserver) {\n this.setupLeftColumnScrollListeners();\n }\n if (!this.facetsIntersectionObserver) {\n this.setupFacetsScrollListeners();\n }\n this.updateLeftColumnHeight();\n }\n\n if (changed.has('analyticsHandler') && !this.layoutSizeAnalyticsSent) {\n this.sendLayoutSizeAnalytics();\n }\n\n if (\n changed.has('displayMode') ||\n changed.has('baseNavigationUrl') ||\n changed.has('baseImageUrl') ||\n changed.has('loggedIn')\n ) {\n this.infiniteScroller?.reload();\n }\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('searchType') ||\n changed.has('withinCollection')\n ) {\n // Unless this query/search type update is from the initial page load or the\n // result of hitting the back button,\n // we need to clear any existing filters since they may no longer be valid for\n // the new set of search results.\n if (!this.historyPopOccurred && this.initialQueryChangeHappened) {\n // Ordinarily, we leave the sort param unchanged between searches.\n // However, if we are changing the target collection itself, we want the sort cleared too,\n // since different collections may have different sorting options available.\n const shouldClearSort =\n changed.has('withinCollection') &&\n !changed.has('selectedSort') &&\n !changed.has('sortDirection');\n\n // Otherwise, only clear filters that haven't been simultaneously applied in this update\n this.clearFilters({\n sort: shouldClearSort,\n facets: !changed.has('selectedFacets'),\n dateRange: !(\n changed.has('minSelectedDate') || changed.has('maxSelectedDate')\n ),\n letterFilters: !(\n changed.has('selectedTitleFilter') ||\n changed.has('selectedCreatorFilter')\n ),\n });\n }\n }\n\n if (changed.has('profileElement')) {\n this.applyDefaultProfileSort();\n }\n\n if (changed.has('withinCollection') && this.withinCollection) {\n // Set a sensible default collection sort while we load results, which we will later\n // adjust based on any sort-by metadata once the response arrives.\n if (!this.baseQuery) {\n this.defaultSortField = this.withinCollection.startsWith('fav-')\n ? SortField.datefavorited\n : SortField.weeklyview;\n this.defaultSortDirection = 'desc';\n }\n }\n\n if (changed.has('baseQuery')) {\n this.emitBaseQueryChanged();\n }\n if (changed.has('searchType')) {\n this.emitSearchTypeChanged();\n }\n\n if (changed.has('currentPage') || changed.has('displayMode')) {\n this.persistState();\n }\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('minSelectedDate') ||\n changed.has('maxSelectedDate') ||\n changed.has('selectedFacets') ||\n changed.has('searchService') ||\n changed.has('withinCollection') ||\n changed.has('withinProfile') ||\n changed.has('profileElement')\n ) {\n this.dataSource.refreshLetterCounts();\n }\n\n if (changed.has('selectedSort') || changed.has('sortDirection')) {\n const prevSortDirection = changed.get('sortDirection') as SortDirection;\n this.sendSortByAnalytics(prevSortDirection);\n this.selectedSortChanged();\n }\n\n if (changed.has('selectedTitleFilter')) {\n this.sendFilterByTitleAnalytics(\n changed.get('selectedTitleFilter') as string,\n );\n }\n if (changed.has('selectedCreatorFilter')) {\n this.sendFilterByCreatorAnalytics(\n changed.get('selectedCreatorFilter') as string,\n );\n }\n\n this.updateFacetReadiness();\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('searchType') ||\n changed.has('selectedTitleFilter') ||\n changed.has('selectedCreatorFilter') ||\n changed.has('minSelectedDate') ||\n changed.has('maxSelectedDate') ||\n changed.has('selectedSort') ||\n changed.has('sortDirection') ||\n changed.has('selectedFacets') ||\n changed.has('searchService') ||\n changed.has('withinCollection') ||\n changed.has('withinProfile') ||\n changed.has('profileElement')\n ) {\n this.handleQueryChange();\n }\n\n if (changed.has('searchResultsLoading')) {\n this.emitSearchResultsLoadingChanged();\n }\n\n if (\n changed.has('facetsLoading') &&\n this.facetsLoading &&\n this.collectionFacets\n ) {\n this.collectionFacets.moreLinksVisible =\n this.searchType !== SearchType.FULLTEXT;\n }\n\n if (changed.has('pagesToRender')) {\n if (!this.dataSource.endOfDataReached && this.infiniteScroller) {\n this.infiniteScroller.itemCount = this.estimatedTileCount;\n }\n }\n\n if (changed.has('isManageView')) {\n if (this.isManageView) {\n this.displayMode = 'grid';\n this.fetchManageableSearchResults();\n } else if (this.pageContext === 'search') this.infiniteScroller?.reload();\n\n this.infiniteScroller?.refreshAllVisibleCells();\n\n // Only emit change event if changing b/w true & false, not on initial value set.\n if (changed.get('isManageView') !== undefined) {\n this.emitManageModeChangedEvent();\n }\n }\n\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n if (oldObserver) this.disconnectResizeObserver(oldObserver);\n this.setupResizeObserver();\n }\n\n this.ensureAvailableTilesDisplayed();\n }\n\n connectedCallback(): void {\n super.connectedCallback?.();\n this.setupStateRestorationObserver();\n this.setupResizeObserver();\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver) {\n this.disconnectResizeObserver(this.resizeObserver);\n }\n if (this.boundNavigationHandler) {\n window.removeEventListener('popstate', this.boundNavigationHandler);\n }\n\n this.leftColIntersectionObserver?.disconnect();\n this.facetsIntersectionObserver?.disconnect();\n window.removeEventListener('resize', this.updateLeftColumnHeight);\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n const previousView = this.mobileView;\n if (entry.target === this.contentContainer) {\n this.contentWidth = entry.contentRect.width;\n this.mobileView =\n this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;\n // If changing from desktop to mobile disable transition\n if (this.mobileView && !previousView) {\n this.isResizeToMobile = true;\n }\n }\n\n // Ensure the facet sidebar remains sized correctly\n this.updateLeftColumnHeight();\n }\n\n /**\n * Ensures that if we have new results from the data source that are not yet\n * displayed in the infinite scroller, that they are immediately reflected\n * in the tile count.\n */\n private ensureAvailableTilesDisplayed(): void {\n if (\n this.infiniteScroller &&\n this.infiniteScroller.itemCount < this.dataSource.size\n ) {\n this.setTileCount(\n this.dataSource.endOfDataReached\n ? this.dataSource.size\n : this.estimatedTileCount,\n );\n }\n }\n\n /**\n * Updates the data source with the current state of facet readiness for loading,\n * so that they will begin to load in at the appropriate time according to the\n * current facet loading strategy.\n */\n private updateFacetReadiness(): void {\n // There are two ways to opt into facet production:\n // (1) have the facets dropdown open, or\n // (2) if using the `opt-in-or-login` strategy, be logged into an account\n const optedIn =\n this.collapsibleFacetsVisible ||\n (this.facetLoadStrategy === 'opt-in-or-login' && this.loggedIn);\n\n // In desktop view, we are always ready to load facets *unless* we are using one of the\n // `opt-in` strategies and have not opted in (whether by login or UI interaction).\n const usingOptInStrategy = ['opt-in', 'opt-in-or-login'].includes(\n this.facetLoadStrategy,\n );\n const desktopFacetsReady =\n !this.mobileView && (!usingOptInStrategy || optedIn);\n\n // In the mobile view, facets are considered ready provided we have opted in (whether by\n // login or UI interaction).\n const mobileFacetsReady = this.mobileView && optedIn;\n\n this.dataSource.handleFacetReadinessChange(\n desktopFacetsReady || mobileFacetsReady,\n );\n }\n\n /**\n * Sets up listeners for events that may require updating the left column height.\n */\n private setupLeftColumnScrollListeners(): void {\n // We observe intersections between the left column's scroll sentinel and\n // the viewport, so that we can ensure the left column is always sized to\n // match the _available_ viewport height. This should generally be more\n // performant than listening to scroll events on the page or column.\n const leftColumnSentinel = this.shadowRoot?.querySelector(\n '#left-column-scroll-sentinel',\n );\n if (leftColumnSentinel) {\n this.leftColIntersectionObserver = new IntersectionObserver(\n this.updateLeftColumnHeight,\n {\n threshold: [...Array(201).keys()].map(n => n / 200), // Threshold every 0.5%\n },\n );\n this.leftColIntersectionObserver.observe(leftColumnSentinel);\n }\n\n // We also listen for window resize events, as they are not always captured\n // by the resize observer and can affect the desired height of the left column.\n window.addEventListener('resize', this.updateLeftColumnHeight);\n }\n\n /**\n * Sets up listeners to control whether the facet sidebar shows its bottom fade-out.\n * Note this uses a separate IntersectionObserver from the left column, because we\n * don't need granular intersection thresholds for this.\n */\n private setupFacetsScrollListeners(): void {\n const facetsSentinel = this.shadowRoot?.querySelector(\n '#facets-scroll-sentinel',\n );\n if (facetsSentinel) {\n this.facetsIntersectionObserver = new IntersectionObserver(\n this.updateFacetFadeOut,\n );\n this.facetsIntersectionObserver.observe(facetsSentinel);\n }\n }\n\n /**\n * Updates the height of the left column according to its position on the page.\n * Arrow function ensures proper `this` binding.\n */\n private updateLeftColumnHeight = (): void => {\n if (this.mobileView) {\n this.leftColumn?.style?.removeProperty('height');\n } else {\n const clientTop = this.leftColumn?.getBoundingClientRect().top;\n const columnHeight = window.innerHeight - (clientTop ?? 0);\n const cssHeightValue =\n clientTop === 0\n ? null\n : // Subtract off the column's top padding so that it doesn't overflow\n `calc(${columnHeight}px - var(--leftColumnPaddingTop, 2rem))`;\n\n this.leftColumn?.style?.setProperty('height', cssHeightValue);\n }\n };\n\n /**\n * Toggles whether the fade-out is visible at the bottom of the facets.\n * It should only be visible if the facets are not scrolled to the bottom.\n * Arrow function ensures proper `this` binding.\n */\n private updateFacetFadeOut = (entries: IntersectionObserverEntry[]): void => {\n const fadeElmt = this.shadowRoot?.getElementById('facets-bottom-fade');\n fadeElmt?.classList.toggle('hidden', entries?.[0]?.isIntersecting);\n };\n\n /**\n * Emits a `baseQueryChanged` event indicating an update to the search query.\n */\n private emitBaseQueryChanged() {\n this.dispatchEvent(\n new CustomEvent<{ baseQuery?: string }>('baseQueryChanged', {\n detail: {\n baseQuery: this.baseQuery,\n },\n }),\n );\n }\n\n /**\n * Emits a `searchTypeChanged` event indicating an update to the search type\n * (e.g., metadata vs. full-text).\n */\n private emitSearchTypeChanged() {\n this.dispatchEvent(\n new CustomEvent<SearchType>('searchTypeChanged', {\n detail: this.searchType,\n }),\n );\n }\n\n /**\n * Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has\n * been toggled open or closed.\n */\n private emitFacetPaneVisibilityChanged(): void {\n this.dispatchEvent(\n new CustomEvent<boolean>('facetPaneVisibilityChanged', {\n detail: this.facetPaneVisible,\n }),\n );\n }\n\n /**\n * Emits a `searchError` event indicating that the most recent search has encountered\n * an error from the backend.\n */\n emitSearchError(): void {\n this.dispatchEvent(\n new CustomEvent<string>('searchError', {\n detail: this.dataSource.queryErrorMessage,\n }),\n );\n }\n\n /**\n * Emits a `queryStateChanged` event indicating that one or more of this component's\n * properties have changed in a way that could affect the set of search results.\n */\n emitQueryStateChanged() {\n this.dispatchEvent(\n new CustomEvent<CollectionBrowserQueryState>('queryStateChanged', {\n detail: {\n baseQuery: this.baseQuery,\n withinCollection: this.withinCollection,\n withinProfile: this.withinProfile,\n profileElement: this.profileElement,\n searchType: this.searchType,\n selectedFacets: this.selectedFacets,\n internalFilters: this.internalFilters,\n minSelectedDate: this.minSelectedDate,\n maxSelectedDate: this.maxSelectedDate,\n selectedSort: this.selectedSort,\n sortDirection: this.sortDirection,\n selectedTitleFilter: this.selectedTitleFilter,\n selectedCreatorFilter: this.selectedCreatorFilter,\n },\n }),\n );\n }\n\n /**\n * Emits an `emptyResults` event indicating that we have received an empty result set\n * for the most recent query.\n */\n emitEmptyResults() {\n this.dispatchEvent(new Event('emptyResults'));\n }\n\n private disconnectResizeObserver(\n resizeObserver: SharedResizeObserverInterface,\n ) {\n resizeObserver.removeObserver({\n target: this.contentContainer,\n handler: this,\n });\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver || !this.contentContainer) return;\n this.resizeObserver.addObserver({\n target: this.contentContainer,\n handler: this,\n });\n }\n\n /**\n * When the visible cells change from the infinite scroller, we want to emit\n * which page is currently visible so the consumer can update its UI or the URL\n *\n * @param e\n * @returns\n */\n private visibleCellsChanged(\n e: CustomEvent<{ visibleCellIndices: number[] }>,\n ) {\n if (this.isScrollingToCell) return;\n const { visibleCellIndices } = e.detail;\n if (visibleCellIndices.length === 0) return;\n\n // For page determination, do not count more than a single page of visible cells,\n // since otherwise patrons using very tall screens will be treated as one page\n // further than they actually are.\n const lastIndexWithinCurrentPage =\n Math.min(this.pageSize, visibleCellIndices.length) - 1;\n const lastVisibleCellIndex = visibleCellIndices[lastIndexWithinCurrentPage];\n const lastVisibleCellPage =\n Math.floor(lastVisibleCellIndex / this.pageSize) + 1;\n if (this.currentPage !== lastVisibleCellPage) {\n this.currentPage = lastVisibleCellPage;\n }\n const event = new CustomEvent('visiblePageChanged', {\n detail: {\n pageNumber: lastVisibleCellPage,\n },\n });\n this.dispatchEvent(event);\n }\n\n // we only want to scroll on the very first query change\n // so this keeps track of whether we've already set the initial query\n private initialQueryChangeHappened = false;\n\n private historyPopOccurred = false;\n\n // this lets us store the query key so we know if it's actually changed or not\n private previousQueryKey?: string;\n\n /**\n * A Promise which, after each query change, resolves once the fetches for the initial\n * search have completed. Waits for *both* the hits and aggregations fetches to finish.\n *\n * Ensure you await this component's `updateComplete` promise before awaiting this\n * one, to ensure you do not await an obsolete promise from the previous update.\n */\n get initialSearchComplete(): Promise<boolean> {\n return this.dataSource.initialSearchComplete;\n }\n\n /**\n * Handler for whenever the component's properties change in a way that may require\n * fetching new results.\n */\n private async handleQueryChange() {\n // only reset if the query has actually changed\n if (\n !this.searchService ||\n this.dataSource.pageFetchQueryKey === this.previousQueryKey\n ) {\n return;\n }\n\n // If the new state prevents us from updating the search results, don't reset\n if (this.baseQuery && !this.dataSource.canPerformSearch) {\n return;\n }\n\n this.previousQueryKey = this.dataSource.pageFetchQueryKey;\n\n this.totalResults = undefined;\n this.pagesToRender =\n this.initialPageNumber === 1\n ? 2 // First two pages are batched into one request when starting from page 1\n : this.initialPageNumber;\n\n // Reset the infinite scroller's item count, so that it\n // shows tile placeholders until the new query's results load in\n if (this.infiniteScroller) {\n this.infiniteScroller.itemCount = this.estimatedTileCount;\n this.infiniteScroller.reload();\n }\n\n if (this.withinCollection && this.baseQuery?.trim()) {\n this.defaultSortField = SortField.relevance;\n this.defaultSortDirection = null;\n }\n\n if (!this.initialQueryChangeHappened && this.initialPageNumber > 1) {\n this.scrollToPage(this.initialPageNumber);\n }\n this.initialQueryChangeHappened = true;\n\n // if the query changed as part of a window.history pop event, we don't want to\n // persist the state because it overwrites the forward history\n if (!this.historyPopOccurred) {\n this.persistState();\n }\n this.historyPopOccurred = false;\n }\n\n private setupStateRestorationObserver() {\n if (!this.boundNavigationHandler) {\n this.boundNavigationHandler = this.historyNavigationHandler.bind(this);\n }\n // when the user navigates back, we want to update the UI to match the URL\n window.addEventListener('popstate', this.boundNavigationHandler);\n }\n\n private boundNavigationHandler?: () => void;\n\n private historyNavigationHandler() {\n this.historyPopOccurred = true;\n this.restoreState();\n }\n\n private restoreState() {\n const restorationState = this.restorationStateHandler.getRestorationState();\n this.displayMode = restorationState.displayMode;\n if (!this.suppressURLSinParam && restorationState.searchType != null)\n this.searchType = restorationState.searchType;\n this.selectedSort = restorationState.selectedSort ?? SortField.default;\n this.sortDirection = restorationState.sortDirection ?? null;\n this.selectedTitleFilter = restorationState.selectedTitleFilter ?? null;\n this.selectedCreatorFilter = restorationState.selectedCreatorFilter ?? null;\n this.selectedFacets = restorationState.selectedFacets;\n if (!this.suppressURLQuery) this.baseQuery = restorationState.baseQuery;\n this.currentPage = restorationState.currentPage ?? 1;\n this.minSelectedDate = restorationState.minSelectedDate;\n this.maxSelectedDate = restorationState.maxSelectedDate;\n if (this.currentPage > 1) {\n this.goToPage(this.currentPage);\n }\n }\n\n private persistState() {\n const isDefaultSort = this.selectedSort === this.defaultSortField;\n const restorationState: RestorationState = {\n displayMode: this.displayMode,\n searchType: this.suppressURLSinParam ? undefined : this.searchType,\n selectedSort: isDefaultSort ? SortField.default : this.selectedSort,\n sortDirection: this.sortDirection ?? undefined,\n selectedFacets: this.selectedFacets ?? getDefaultSelectedFacets(),\n baseQuery: this.suppressURLQuery ? undefined : this.baseQuery,\n currentPage: this.currentPage,\n titleQuery: this.titleQuery,\n creatorQuery: this.creatorQuery,\n minSelectedDate: this.minSelectedDate,\n maxSelectedDate: this.maxSelectedDate,\n selectedTitleFilter: this.selectedTitleFilter ?? undefined,\n selectedCreatorFilter: this.selectedCreatorFilter ?? undefined,\n };\n const persistOptions: RestorationStatePersistOptions = {\n forceReplace: this.dataSourceInstallInProgress,\n persistMetadataSearchType: this.isTVCollection,\n };\n this.restorationStateHandler.persistState(restorationState, persistOptions);\n }\n\n /**\n * Emits a `searchResultsLoadingChanged` event indicating that our loading state has\n * changed (either we have started loading new results, or we have finished loading them).\n */\n private emitSearchResultsLoadingChanged(): void {\n this.dispatchEvent(\n new CustomEvent<{ loading: boolean }>('searchResultsLoadingChanged', {\n detail: {\n loading: this.searchResultsLoading,\n },\n }),\n );\n }\n\n /**\n * Handler for when the set of selected facets changes.\n */\n facetsChanged(e: CustomEvent<SelectedFacets>) {\n this.selectedFacets = e.detail;\n }\n\n /**\n * Handler for when any facet is selected/unselected/hidden/unhidden.\n * Fires analytics indicating the type of facet event that took place.\n */\n facetClickHandler({\n detail: { facetType, bucket, negative },\n }: CustomEvent<FacetEventDetails>): void {\n let action: analyticsActions;\n if (negative) {\n action =\n bucket.state !== 'none'\n ? analyticsActions.facetNegativeSelected\n : analyticsActions.facetNegativeDeselected;\n } else {\n action =\n bucket.state !== 'none'\n ? analyticsActions.facetSelected\n : analyticsActions.facetDeselected;\n }\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action,\n label: facetType,\n });\n }\n\n private scrollToPage(pageNumber: number): Promise<void> {\n return new Promise(resolve => {\n const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);\n // without this setTimeout, Safari just pauses until the `fetchPage` is complete\n // then scrolls to the cell\n setTimeout(() => {\n this.isScrollingToCell = true;\n this.infiniteScroller?.scrollToCell(cellIndexToScrollTo, true);\n // This timeout is to give the scroll animation time to finish\n // then updating the infinite scroller once we're done scrolling\n // There's no scroll animation completion callback so we're\n // giving it 0.5s to finish.\n setTimeout(() => {\n this.isScrollingToCell = false;\n this.infiniteScroller?.refreshAllVisibleCells();\n resolve();\n }, 500);\n }, 0);\n });\n }\n\n /**\n * Whether sorting by relevance makes sense for the current state.\n * Currently equivalent to having a non-empty query.\n */\n private get isRelevanceSortAvailable(): boolean {\n return !!this.baseQuery?.trim();\n }\n\n /**\n * Sets the total number of tiles displayed in the infinite scroller.\n */\n setTileCount(count: number): void {\n if (this.infiniteScroller) {\n this.infiniteScroller.itemCount = count;\n }\n }\n\n /**\n * Applies the default sort options for the TV search results page\n */\n applyDefaultTVSearchSort(): void {\n this.defaultSortField = SortField.datearchived;\n this.defaultSortDirection = 'desc';\n }\n\n /**\n * Applies any default sort option for the current collection, by checking\n * for one in the collection's metadata. If none is found, defaults to sorting\n * descending by:\n * - Date Favorited for fav-* collections\n * - Weekly views for all other collections\n */\n applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void {\n if (this.baseQuery) {\n // If there's a query set, then we default to relevance sorting regardless of\n // the collection metadata-specified sort.\n this.defaultSortField = SortField.relevance;\n this.defaultSortDirection = null;\n return;\n }\n\n // Favorite collections sort on Date Favorited by default.\n // Other collections fall back to sorting on weekly views.\n const baseDefaultSort: string =\n collectionInfo?.public_metadata?.identifier?.startsWith('fav-')\n ? '-favoritedate'\n : '-week';\n\n // The collection metadata may override the default sorting with something else\n const metadataSort: string | undefined =\n collectionInfo?.public_metadata?.['sort-by'];\n\n // Prefer the metadata-specified sort if one exists\n const defaultSortToApply = metadataSort ?? baseDefaultSort;\n\n // Account for both -field and field:dir formats\n let [field, dir] = defaultSortToApply.split(':');\n if (field.startsWith('-')) {\n field = field.slice(1);\n dir = 'desc';\n } else if (!['asc', 'desc'].includes(dir)) {\n dir = 'asc';\n }\n\n const sortOption = sortOptionFromAPIString(field);\n const sortField = sortOption.field;\n if (sortField && sortField !== SortField.default) {\n this.defaultSortField = sortField;\n this.defaultSortDirection = dir as SortDirection;\n }\n }\n\n /**\n * Applies the default sort option for the current profile element\n */\n applyDefaultProfileSort(): void {\n if (this.profileElement) {\n const defaultSortField = defaultProfileElementSorts[this.profileElement];\n this.defaultSortField = defaultSortField ?? SortField.weeklyview;\n } else {\n this.defaultSortField = SortField.weeklyview;\n }\n\n this.defaultSortDirection = 'desc';\n }\n\n /**\n * This is useful for determining whether we need to reload the scroller.\n *\n * When the fetch completes, we need to reload the scroller if the cells for that\n * page are visible, but if the page is not currenlty visible, we don't need to reload\n */\n get currentVisiblePageNumbers(): number[] {\n const visibleCells = this.infiniteScroller?.getVisibleCellIndices() ?? [];\n const visiblePages = new Set<number>();\n visibleCells.forEach(cellIndex => {\n const visiblePage = Math.floor(cellIndex / this.pageSize) + 1;\n visiblePages.add(visiblePage);\n });\n return Array.from(visiblePages);\n }\n\n /**\n * Whether we are currently displaying results for a radio collection\n */\n private get isRadioCollection(): boolean {\n const { withinCollection } = this;\n const topCollections = ['radio'];\n const isTopCollection = topCollections.includes(withinCollection as string);\n const isSubCollection = topCollections.some(topCollxn =>\n this.dataSource.parentCollections?.includes(topCollxn),\n );\n return isTopCollection || isSubCollection;\n }\n\n /**\n * Refreshes all visible result cells in the infinite scroller.\n */\n refreshVisibleResults(): void {\n this.infiniteScroller?.refreshAllVisibleCells();\n }\n\n /**\n * Callback when a result is selected\n */\n resultSelected(event: CustomEvent<TileModel>): void {\n if (this.isManageView) {\n // Checked/unchecked state change -- rerender to ensure it propagates\n // this.mapDataSource(model => ({ ...model }));\n const cellIndex = this.dataSource.indexOf(event.detail);\n if (cellIndex >= 0) this.infiniteScroller?.refreshCell(cellIndex);\n\n this.requestUpdate();\n }\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.resultSelected,\n label: event.detail.mediatype,\n });\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.resultSelected,\n label: `page-${this.currentPage}`,\n });\n }\n\n cellForIndex(index: number): HTMLTemplateResult | undefined {\n const model = this.tileModelAtCellIndex(index);\n if (!model) return undefined;\n\n // Tiles show dates in UTC by default.\n // But for certain types of time-based media, we want them to use local time instead.\n // Those local-time cases are:\n // - TV or Radio search results\n // - TV or Radio collection results\n const isTVSearch = this.searchType === SearchType.TV;\n const isRadioSearch = this.searchType === SearchType.RADIO;\n const { isTVCollection, isRadioCollection } = this;\n const shouldUseLocalTime =\n isTVSearch || isRadioSearch || isTVCollection || isRadioCollection;\n\n return html`\n <tile-dispatcher\n .collectionPagePath=${this.collectionPagePath}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .baseImageUrl=${this.baseImageUrl}\n .model=${model}\n .tileDisplayMode=${this.displayMode}\n .resizeObserver=${this.resizeObserver}\n .collectionTitles=${this.dataSource.collectionTitles}\n .sortParam=${this.sortParam}\n .defaultSortParam=${this.defaultSortParam}\n .creatorFilter=${this.selectedCreatorFilter}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.shouldSuppressTileBlurring}\n .isManageView=${this.isManageView}\n ?showTvClips=${isTVSearch || isTVCollection}\n ?enableHoverPane=${true}\n ?useLocalTime=${shouldUseLocalTime}\n @resultSelected=${(e: CustomEvent) => this.resultSelected(e)}\n >\n </tile-dispatcher>\n `;\n }\n\n /**\n * When the user scrolls near to the bottom of the page, fetch the next page\n * increase the number of pages to render and start fetching data for the new page\n */\n private scrollThresholdReached() {\n if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {\n this.pagesToRender += 1;\n this.dataSource.fetchPage(this.pagesToRender);\n }\n }\n\n /**\n * Fetches search results for privileged users when in manage view.\n *\n * This method:\n * 1. Checks if we're in search context and either haven't loaded results yet, or have already finished loading with > 100 total results\n * 2. Resets the datasource pagination state\n * 3. Fetches first page with limit based on maxPagesToManage threshold\n * 4. Reloads the infinite scroller to display new results\n */\n private fetchManageableSearchResults(): void {\n const hasNotLoadedInitialResults = !this.dataSource.totalResults;\n const hasLoadedWithMoreResultsAvailable =\n !this.searchResultsLoading && this.dataSource.totalResults > 100;\n\n if (\n this.pageContext === 'search' &&\n (hasNotLoadedInitialResults || hasLoadedWithMoreResultsAvailable)\n ) {\n this.dataSource.resetPages();\n this.dataSource.fetchPage(1, this.maxPagesToManage);\n this.infiniteScroller?.reload();\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n css`\n :host {\n display: block;\n --leftColumnWidth: 18rem;\n --leftColumnPaddingTop: 2rem;\n --leftColumnPaddingRight: 2.5rem;\n }\n\n #facet-top-view {\n display: flex;\n }\n\n /**\n * When page width resizes from desktop to mobile, use this class to\n * disable expand/collapse transition when loading.\n */\n .preload * {\n transition: none !important;\n -webkit-transition: none !important;\n -moz-transition: none !important;\n -ms-transition: none !important;\n -o-transition: none !important;\n }\n\n #content-container {\n display: flex;\n }\n\n empty-placeholder {\n margin-top: var(--placeholderMarginTop, 0);\n }\n\n .collapser-icon {\n display: inline-block;\n }\n\n .collapser-icon svg {\n display: inline-block;\n width: 12px;\n height: 12px;\n transition: transform 0.2s ease-out;\n }\n\n #mobile-filter-collapse {\n width: 100%;\n }\n\n #mobile-filter-collapse > summary {\n cursor: pointer;\n list-style: none;\n }\n\n #mobile-filter-collapse[open] > summary {\n margin-bottom: 10px;\n }\n\n #mobile-filter-collapse h2 {\n display: inline-block;\n margin: 0;\n font-size: 2rem;\n }\n\n #mobile-filter-collapse[open] svg {\n transform: rotate(90deg);\n }\n\n #content-container.mobile {\n display: block;\n }\n\n #right-column {\n flex: 1;\n position: relative;\n min-height: 90vh;\n border-right: 1px solid rgb(232, 232, 232);\n margin-top: var(--rightColumnMarginTop, 0);\n padding-top: var(--rightColumnPaddingTop, 2rem);\n background: #fff;\n }\n\n #left-column:not([hidden]) + #right-column {\n border-left: 1px solid rgb(232, 232, 232);\n }\n\n #right-column.smart-results-spacing {\n padding-top: 0.5rem;\n border-right: none;\n background: transparent;\n min-width: 0;\n }\n\n #results {\n background: #fff;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n\n #right-column.smart-results-spacing #results {\n border-radius: 10px 10px 0px 0px;\n padding-top: 0.5rem;\n margin-top: 1rem;\n }\n\n .mobile #right-column {\n border-left: none;\n }\n\n .mobile #results {\n padding: 5px 5px 0;\n }\n\n #left-column {\n width: var(--leftColumnWidth, 18rem);\n /* Prevents Safari from shrinking col at first draw */\n min-width: var(--leftColumnWidth, 18rem);\n padding-top: var(--leftColumnPaddingTop, 2rem);\n /* Reduced padding by 0.2rem to add the invisible border in the rule below */\n padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);\n border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */\n z-index: 1;\n }\n\n .desktop #left-column {\n top: 0;\n position: sticky;\n height: calc(100vh - 2rem);\n max-height: calc(100vh - 2rem);\n overflow-x: hidden;\n overflow-y: scroll;\n\n /*\n * Firefox doesn't support any of the -webkit-scrollbar stuff below, but\n * does at least give us a tiny bit of control over width & color.\n */\n scrollbar-width: thin;\n scrollbar-color: transparent transparent;\n }\n .desktop #left-column:hover {\n scrollbar-color: auto;\n }\n .desktop #left-column::-webkit-scrollbar {\n appearance: none;\n width: 6px;\n }\n .desktop #left-column::-webkit-scrollbar-button {\n height: 3px;\n background: transparent;\n }\n .desktop #left-column::-webkit-scrollbar-corner {\n background: transparent;\n }\n .desktop #left-column::-webkit-scrollbar-thumb {\n border-radius: 4px;\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.15);\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.2);\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb:active {\n background: rgba(0, 0, 0, 0.3);\n }\n\n #facets-bottom-fade {\n background: linear-gradient(\n to bottom,\n #fbfbfd00 0%,\n #fbfbfdc0 50%,\n #fbfbfd 80%,\n #fbfbfd 100%\n );\n position: fixed;\n bottom: 0;\n height: 50px;\n /* Wide enough to cover the content, but leave the scrollbar uncovered */\n width: calc(\n var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px\n );\n z-index: 2;\n pointer-events: none;\n transition: height 0.1s ease;\n }\n #facets-bottom-fade.hidden {\n height: 0;\n }\n\n .facets-message {\n font-size: 1.4rem;\n }\n\n .desktop-facets-dropdown > summary {\n cursor: pointer;\n list-style: none;\n }\n\n .desktop-facets-dropdown h2 {\n display: inline-block;\n margin: 0;\n font-size: 1.6rem;\n }\n\n .desktop-facets-dropdown[open] > summary {\n margin-bottom: 10px;\n }\n\n .desktop-facets-dropdown[open] svg {\n transform: rotate(90deg);\n }\n\n .desktop #left-column-scroll-sentinel {\n width: 1px;\n height: 100vh;\n background: transparent;\n }\n\n .desktop #facets-scroll-sentinel {\n width: 1px;\n height: 1px;\n background: transparent;\n }\n\n #facets-header-container {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n clear: both;\n }\n\n .desktop #facets-header-container {\n flex-wrap: wrap;\n }\n\n .mobile #left-column {\n width: 100%;\n min-width: 0;\n padding: 5px 0;\n border: 0;\n }\n\n .clear-filters-btn-row {\n display: inline-block;\n }\n\n .desktop .clear-filters-btn-row {\n width: 100%;\n }\n\n .clear-filters-btn {\n display: inline-block;\n appearance: none;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: var(--ia-theme-link-color);\n font-size: 1.4rem;\n font-family: inherit;\n cursor: pointer;\n }\n\n .clear-filters-btn:hover {\n text-decoration: underline;\n }\n\n .clear-filters-btn-separator {\n display: inline-block;\n margin-left: 5px;\n border-left: 1px solid #2c2c2c;\n font-size: 1.4rem;\n line-height: 1.3rem;\n }\n\n #tv-filters {\n margin-bottom: 15px;\n }\n\n #tv-shows {\n --comboBoxListWidth: 300px;\n }\n\n .tv-filter-dropdown {\n display: block;\n font-size: 14px;\n margin-left: 1px;\n margin-bottom: 5px;\n }\n\n .tv-filter-dropdown::part(combo-box) {\n outline-offset: 1px;\n }\n\n .tv-filter-dropdown::part(option) {\n line-height: 1.1;\n padding: 7px;\n }\n\n .tv-filter-dropdown::part(clear-button) {\n flex: 0 0 26px;\n --combo-box-clear-icon-size: 14px;\n }\n\n .tv-filter-dropdown::part(icon) {\n width: 1.4rem;\n height: 1.4rem;\n }\n\n #facets-container {\n position: relative;\n max-height: 0;\n transition: max-height 0.2s ease-in-out;\n z-index: 1;\n margin-top: var(--facetsContainerMarginTop, 3rem);\n padding-bottom: 2rem;\n }\n\n .desktop #facets-container {\n width: 18rem;\n }\n\n .mobile #facets-container {\n overflow: hidden;\n padding-bottom: 0;\n padding-left: 10px;\n padding-right: 10px;\n }\n\n #facets-container.expanded {\n max-height: 2000px;\n }\n\n .results-section-heading {\n margin: 0.5rem 0.3rem;\n font-size: 2rem;\n line-height: 25px;\n }\n\n #results-total {\n display: flex;\n align-items: baseline;\n }\n\n #results-total:not(.filtered) {\n padding-bottom: 2rem;\n }\n\n .mobile #results-total {\n position: absolute;\n right: 10px;\n }\n\n #big-results-count {\n font-size: 2.4rem;\n font-weight: 500;\n margin-right: 5px;\n }\n\n .mobile #big-results-count {\n font-size: 2rem;\n }\n\n #big-results-label {\n font-size: 1.4rem;\n font-weight: 200;\n }\n\n #list-header {\n max-height: 4.2rem;\n }\n\n .loading-cover {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n z-index: 1;\n padding-top: 50px;\n }\n\n #tile-blur-label {\n display: flex;\n align-items: center;\n column-gap: 5px;\n }\n\n #tile-blur-check {\n margin: 0 5px 0 0;\n width: 15px;\n }\n\n circular-activity-indicator {\n width: 30px;\n height: 30px;\n }\n\n sort-filter-bar {\n display: block;\n margin-bottom: 4rem;\n }\n\n infinite-scroller {\n display: block;\n --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);\n --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);\n }\n\n infinite-scroller.list-compact {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 100%\n );\n --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */\n --infiniteScrollerCellMaxHeight: 56px;\n --infiniteScrollerRowGap: 10px;\n }\n\n infinite-scroller.list-detail {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 100%\n );\n --infiniteScrollerCellMinHeight: var(\n --collectionBrowserCellMinHeight,\n 5rem\n );\n /*\n 30px in spec, compensating for a -4px margin\n to align title with top of item image\n src/tiles/list/tile-list.ts\n */\n --infiniteScrollerRowGap: 34px;\n }\n\n .mobile infinite-scroller.list-detail {\n --infiniteScrollerRowGap: 24px;\n }\n\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 17rem\n );\n --infiniteScrollerCellMaxWidth: var(\n --collectionBrowserCellMaxWidth,\n 1fr\n );\n }\n\n /* Allow tiles to shrink a bit further at smaller viewport widths */\n @media screen and (max-width: 880px) {\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 15rem\n );\n }\n }\n /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */\n @media screen and (max-width: 360px) {\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 12rem\n );\n }\n }\n\n infinite-scroller.hidden {\n display: none;\n }\n `,\n ];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"collection-browser.js","sourceRoot":"","sources":["../../src/collection-browser.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,GAAG,EACH,UAAU,EAIV,OAAO,GACR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,O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C,mBAAmB,CAAC;2DAA6C;AAE3C;IAA5B,KAAK,CAAC,YAAY,CAAC;oDAA+B;AAEjB;IAAjC,KAAK,CAAC,iBAAiB,CAAC;wDAAuC;AAEjC;IAA9B,KAAK,CAAC,cAAc,CAAC;6DAAyC;AAEnC;IAA3B,KAAK,CAAC,WAAW,CAAC;0DAAsC;AAGzD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2DACA;AA4DrC;IADP,KAAK,CAAC,mBAAmB,CAAC;2DACiB;AAhWjC,iBAAiB;IAD7B,aAAa,CAAC,oBAAoB,CAAC;GACvB,iBAAiB,CAm6F7B","sourcesContent":["import {\n html,\n css,\n LitElement,\n PropertyValues,\n TemplateResult,\n HTMLTemplateResult,\n nothing,\n} from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { msg } from '@lit/localize';\n\nimport type { AnalyticsManagerInterface } from '@internetarchive/analytics-manager';\nimport type {\n InfiniteScroller,\n InfiniteScrollerCellProviderInterface,\n} from '@internetarchive/infinite-scroller';\nimport {\n CollectionExtraInfo,\n PageElementName,\n SearchServiceInterface,\n SearchType,\n SortDirection,\n SortParam,\n} from '@internetarchive/search-service';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport '@internetarchive/infinite-scroller';\nimport type { ModalManagerInterface } from '@internetarchive/modal-manager';\nimport type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';\nimport type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';\nimport type { IAComboBox } from '@internetarchive/elements/ia-combo-box/ia-combo-box';\nimport {\n SelectedFacets,\n SortField,\n CollectionBrowserContext,\n getDefaultSelectedFacets,\n TileModel,\n CollectionDisplayMode,\n FacetEventDetails,\n sortOptionFromAPIString,\n SORT_OPTIONS,\n defaultProfileElementSorts,\n FacetLoadStrategy,\n defaultFacetDisplayOrder,\n tvFacetDisplayOrder,\n TileBlurOverrideState,\n defaultSortAvailability,\n favoritesSortAvailability,\n tvSortAvailability,\n FacetBucket,\n} from './models';\nimport {\n RestorationStateHandlerInterface,\n RestorationStateHandler,\n RestorationState,\n RestorationStatePersistOptions,\n} from './restoration-state-handler';\nimport { CollectionBrowserDataSource } from './data-source/collection-browser-data-source';\nimport type {\n CollectionBrowserQueryState,\n CollectionBrowserSearchInterface,\n} from './data-source/collection-browser-query-state';\nimport { FACETLESS_PAGE_ELEMENTS } from './data-source/models';\nimport type { CollectionFacets } from './collection-facets';\nimport type { CollectionBrowserDataSourceInterface } from './data-source/collection-browser-data-source-interface';\nimport {\n analyticsActions,\n analyticsCategories,\n} from './utils/analytics-events';\nimport { updateSelectedFacetBucket } from './utils/facet-utils';\nimport chevronIcon from './assets/img/icons/chevron';\nimport { srOnlyStyle } from './styles/sr-only';\nimport { sha1 } from './utils/sha1';\nimport type { PlaceholderType } from './empty-placeholder';\nimport type { ManageBar } from './manage/manage-bar';\nimport type { SmartFacetBar } from './collection-facets/smart-facets/smart-facet-bar';\n\nimport '@internetarchive/elements/ia-combo-box/ia-combo-box';\nimport './empty-placeholder';\nimport './tiles/tile-dispatcher';\nimport './tiles/collection-browser-loading-tile';\nimport './sort-filter-bar/sort-filter-bar';\nimport './manage/manage-bar';\nimport './collection-facets';\nimport './circular-activity-indicator';\nimport './collection-facets/smart-facets/smart-facet-bar';\n\n@customElement('collection-browser')\nexport class CollectionBrowser\n extends LitElement\n implements\n InfiniteScrollerCellProviderInterface,\n SharedResizeObserverResizeHandlerInterface,\n CollectionBrowserSearchInterface\n{\n @property({ type: String }) baseNavigationUrl?: string;\n\n @property({ type: String }) baseImageUrl: string = 'https://archive.org';\n\n @property({ type: Object }) searchService?: SearchServiceInterface;\n\n /**\n * Which backend should be targeted by searches (e.g., metadata or FTS)\n */\n @property({ type: Number }) searchType: SearchType = SearchType.DEFAULT;\n\n /**\n * The identifier of the collection that searches should be performed within\n */\n @property({ type: String }) withinCollection?: string;\n\n /**\n * The identifier (e.g., @person) of the user whose profile is being searched within\n */\n @property({ type: String }) withinProfile?: string;\n\n /**\n * Which section of the profile page searches are for (e.g., uploads, reviews, ...)\n */\n @property({ type: String }) profileElement?: PageElementName;\n\n /**\n * The base query to use for all searches, updated to match the current user query.\n */\n @property({ type: String }) baseQuery?: string;\n\n /**\n * The base list of identifiers to fetch, if using the client_document_fetch feature\n * of the search service.\n *\n * This approach allows many more identifiers to be retrieved than a query like\n * `identifier:(foo OR bar OR ...)` would, but still may be more limited in what\n * content is returned by the backend\n */\n @property({ type: Array }) identifiers?: string[];\n\n /**\n * Which mode to display result tiles in (grid, extended list, or compact list)\n */\n @property({ type: String }) displayMode?: CollectionDisplayMode;\n\n @property({ type: String }) selectedSort: SortField = SortField.default;\n\n @property({ type: String }) selectedTitleFilter: string | null = null;\n\n @property({ type: String }) selectedCreatorFilter: string | null = null;\n\n @property({ type: String }) sortDirection: SortDirection | null = null;\n\n @property({ type: String }) defaultSortField: Exclude<\n SortField,\n SortField.default\n > = SortField.relevance;\n\n @property({ type: String }) defaultSortDirection: SortDirection | null = null;\n\n @property({ type: Number }) pageSize = 50;\n\n @property({ type: Number }) currentPage?: number;\n\n @property({ type: String }) minSelectedDate?: string;\n\n @property({ type: String }) maxSelectedDate?: string;\n\n @property({ type: Object }) selectedFacets?: SelectedFacets;\n\n /**\n * Set of filters to be applied internally to searches, but not included in URL params or\n * visibly selected facets. Use when this instance of collection browser is being shown\n * in a filtered context, such as a single-mediatype tab, but the corresponding filters\n * should not be exposed/changeable within that context.\n */\n @property({ type: Object }) internalFilters?: SelectedFacets;\n\n /**\n * Whether to show smart facets (bubbles) along the top of the component\n */\n @property({ type: Boolean }) showSmartFacetBar = false;\n\n /**\n * Sets the label that is shown in front of the smart facets, if present.\n */\n @property({ type: String }) smartFacetBarLabel?: string;\n\n /**\n * Whether to show the date picker (above the facets)\n */\n @property({ type: Boolean }) showHistogramDatePicker = false;\n\n /**\n * Whether placeholder views should be suppressed. If true, searches that produce an\n * error or empty result set will simply show a blank results view instead of a placeholder.\n */\n @property({ type: Boolean }) suppressPlaceholders = false;\n\n /**\n * Whether the result count text should be suppressed.\n * If true, no \"X Results\" message will be shown.\n */\n @property({ type: Boolean }) suppressResultCount = false;\n\n /**\n * Whether the scrolling result view should be suppressed entirely.\n * If true, no infinite scroller (and thus no result tiles) will be rendered.\n */\n @property({ type: Boolean }) suppressResultTiles = false;\n\n /**\n * Whether to suppress persistence of the query to the URL.\n * If true, the `query` param will not be added to the URL or updated on query changes.\n */\n @property({ type: Boolean }) suppressURLQuery = false;\n\n /**\n * Whether to suppress persistence of the `sin` search type param to the URL.\n * If true, the `sin` param will not be added to the URL or updated on query changes.\n */\n @property({ type: Boolean }) suppressURLSinParam = false;\n\n /**\n * Whether to suppress display of the sort bar.\n * If true, the entire sort bar (incl. display modes) will be omitted from rendering.\n */\n @property({ type: Boolean }) suppressSortBar = false;\n\n /**\n * Whether to suppress showing the display mode options in the sort bar.\n * If true, those options will be omitted (though the rest of the sort bar may still render).\n */\n @property({ type: Boolean }) suppressDisplayModes = false;\n\n /**\n * Whether to suppress the display of the `mediatype` facet group, e.g., because this instance\n * of collection browser is being shown in a filtered single-mediatype context.\n */\n @property({ type: Boolean }) suppressMediatypeFacets = false;\n\n /**\n * What strategy to use for when/whether to load facet data for a search.\n *\n * Defaults to `eager`, always loading facets immediately alongside search results.\n *\n * To eliminate facets that are never seen, this can be reduced to `lazy-mobile`, which\n * will delay loading facets in the mobile view until the \"Filters\" accordion is opened.\n * Facets are still loaded eagerly when viewing the desktop layout.\n *\n * To further reduce facet requests for patrons who do not need to use them, this can be\n * again reduced to `opt-in`, which will also require desktop users to explicitly request\n * that they be loaded (in addition to the lazy mobile behavior described above).\n *\n * To entirely suppress facets from being loaded, this may be set to `off`.\n */\n @property({ type: String }) facetLoadStrategy: FacetLoadStrategy = 'eager';\n\n @property({ type: Boolean, reflect: true }) facetPaneVisible = false;\n\n @property({ type: Boolean }) clearResultsOnEmptyQuery = false;\n\n @property({ type: String }) collectionPagePath: string = '/details/';\n\n /** describes where this component is being used */\n @property({ type: String, reflect: true }) searchContext: string =\n analyticsCategories.default;\n\n @property({ type: String }) pageContext: CollectionBrowserContext = 'search';\n\n @property({ type: Object })\n restorationStateHandler: RestorationStateHandlerInterface =\n new RestorationStateHandler({\n context: this.pageContext,\n });\n\n @property({ type: Number }) mobileBreakpoint = 600;\n\n @property({ type: Boolean }) loggedIn = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object }) modalManager?: ModalManagerInterface = undefined;\n\n @property({ type: Object })\n featureFeedbackService?: FeatureFeedbackServiceInterface;\n\n @property({ type: Object }) recaptchaManager?: RecaptchaManagerInterface;\n\n /**\n * Whether we are representing a TV collection, needing slightly different tile handling.\n */\n @property({ type: Boolean }) isTVCollection = false;\n\n /**\n * If item management UI active\n */\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: String }) manageViewLabel = 'Select items to remove';\n\n /** Whether to replace the default sort options with a slot for customization (default: false) */\n @property({ type: Boolean }) enableSortOptionsSlot = false;\n\n /** Whether to expose a slot for a smart results carousel above the full results */\n @property({ type: Boolean, reflect: true }) showSmartResults = false;\n\n /**\n * The maximum number of pages we will load when a privileged user clicks\n * the \"Manage\" button on the search page. Limited to 15 pages.\n */\n @property({ type: Number }) maxPagesToManage = 15;\n\n /**\n * The results per page so we can paginate.\n *\n * This allows us to start in the middle of the search results and\n * fetch data before or after the current page. If we don't have a key\n * for the previous/next page, we'll fetch the next/previous page to populate it\n */\n @property({ type: Object }) dataSource: CollectionBrowserDataSourceInterface =\n new CollectionBrowserDataSource(this, this.pageSize);\n\n /**\n * The page that the consumer wants to load.\n */\n initialPageNumber = 1;\n\n /**\n * This the the number of pages that we want to show.\n *\n * The data isn't necessarily loaded for all of the pages, but this lets us\n * know how many cells we should render.\n */\n @state() private pagesToRender = this.initialPageNumber;\n\n /**\n * Whether the initial page fetch for a new query is currently in progress.\n */\n @state() private searchResultsLoading = false;\n\n @state() private facetsLoading = false;\n\n @state() private totalResults?: number;\n\n @state() private mobileView = false;\n\n /**\n * Any temporarily overridden `on`/`off` state for the user's tile blurring preference if they\n * have chosen to override it, or `no-override` if they have not.\n */\n @state() private tileBlurOverrideState: TileBlurOverrideState = 'no-override';\n\n @state() private collapsibleFacetsVisible = false;\n\n @state() private contentWidth?: number;\n\n @state() private placeholderType: PlaceholderType = null;\n\n @state() private selectedTVNetwork?: string = undefined;\n\n @state() private selectedTVShow?: string = undefined;\n\n @state() private tvMapsPopulated: boolean = false;\n\n @state() private tvMapsLoading: boolean = false;\n\n @state() private tvMapsErrored: boolean = false;\n\n @query('#content-container') private contentContainer!: HTMLDivElement;\n\n @query('#left-column') private leftColumn?: HTMLDivElement;\n\n @query('collection-facets') private collectionFacets?: CollectionFacets;\n\n @query('manage-bar') private manageBar?: ManageBar;\n\n @query('smart-facet-bar') private smartFacetBar?: SmartFacetBar;\n\n @query('#tv-networks') private tvNetworksDropdown?: IAComboBox;\n\n @query('#tv-shows') private tvShowsDropdown?: IAComboBox;\n\n @property({ type: Object, attribute: false })\n analyticsHandler?: AnalyticsManagerInterface;\n\n /** Whether layout size analytics have been sent already. */\n private layoutSizeAnalyticsSent = false;\n\n /**\n * When we're animated scrolling to the page, we don't want to fetch\n * all of the pages as it scrolls so this lets us know if we're scrolling\n */\n private isScrollingToCell = false;\n\n /**\n * When page width resizes from desktop to mobile, set true to\n * disable expand/collapse transition when loading.\n */\n private isResizeToMobile = false;\n\n /**\n * Flag indicating that a new data source is currently being installed.\n * During the install, any URL persistence operation should replace the current entry\n * instead of creating a new one.\n */\n private dataSourceInstallInProgress = false;\n\n private leftColIntersectionObserver?: IntersectionObserver;\n\n private facetsIntersectionObserver?: IntersectionObserver;\n\n private placeholderCellTemplate = html`<collection-browser-loading-tile></collection-browser-loading-tile>`;\n\n constructor() {\n super();\n this.addController(this.dataSource);\n }\n\n private tileModelAtCellIndex(index: number): TileModel | undefined {\n const model = this.dataSource.getTileModelAt(index);\n /**\n * If we encounter a model we don't have yet and we're not in the middle of an\n * automated scroll, fetch the page and just return undefined.\n * The datasource will be updated once the page is loaded and the cell will be rendered.\n *\n * We disable it during the automated scroll since we don't want to fetch pages for intervening cells the\n * user may never see.\n */\n if (!model && !this.isScrollingToCell && this.dataSource.queryInitialized) {\n const pageNumber = Math.floor(index / this.pageSize) + 1;\n this.dataSource.fetchPage(pageNumber);\n }\n return model;\n }\n\n // this is the total number of tiles we expect if\n // the data returned is a full page worth\n // this is useful for putting in placeholders for the expected number of tiles\n private get estimatedTileCount(): number {\n return this.pagesToRender * this.pageSize;\n }\n\n @query('infinite-scroller')\n private infiniteScroller?: InfiniteScroller;\n\n private sessionIdGenPromise?: Promise<string>;\n\n /**\n * Returns a promise resolving to a unique string that persists for the current browser session.\n * Used in generating unique IDs for search requests, so that multiple requests coming from the\n * same browser session can be identified.\n */\n async getSessionId(): Promise<string> {\n try {\n const storedSessionId = sessionStorage?.getItem('cb-session');\n if (storedSessionId) {\n return storedSessionId;\n }\n\n // If we enter this method a second time while a first session ID is already being generated,\n // ensure we produce the same ID from both calls instead of generating another one.\n if (this.sessionIdGenPromise) {\n return this.sessionIdGenPromise;\n }\n\n this.sessionIdGenPromise = sha1(Math.random().toString());\n const newSessionId = await this.sessionIdGenPromise;\n\n sessionStorage?.setItem('cb-session', newSessionId);\n return newSessionId;\n } catch {\n // Either we can't generate the hash or we're restricted from accessing sessionStorage\n return '';\n }\n }\n\n /**\n * Go to the given page of results\n *\n * @param pageNumber\n */\n goToPage(pageNumber: number) {\n this.initialPageNumber = pageNumber;\n this.pagesToRender = pageNumber;\n return this.scrollToPage(pageNumber);\n }\n\n /**\n * Sets the state for whether the initial set of search results is loading in.\n */\n setSearchResultsLoading(loading: boolean): void {\n this.searchResultsLoading = loading;\n }\n\n /**\n * Sets the state for whether facet data is loading in\n */\n setFacetsLoading(loading: boolean): void {\n this.facetsLoading = loading;\n }\n\n /**\n * Sets the total number of results to be displayed for the current search\n */\n setTotalResultCount(totalResults: number): void {\n this.totalResults = totalResults;\n }\n\n /**\n * Clears all selected/negated facets, date ranges, and letter filters.\n *\n * By default, the current sort field/direction are not cleared,\n * but this can be overridden by setting the `sort` option to `true`.\n *\n * Similarly, it is possible to finely control what is cleared by\n * setting any of the `facets`, `dateRange`, or `letterFilters` flags\n * in the options object.\n */\n clearFilters({\n facets = true,\n dateRange = true,\n letterFilters = true,\n sort = false,\n } = {}): void {\n // Don't bother clearing facets if none are checked, so that we don't\n // trigger unnecessary update cycles.\n if (facets && this.hasCheckedFacets) {\n this.selectedFacets = getDefaultSelectedFacets();\n }\n\n if (dateRange) {\n this.minSelectedDate = undefined;\n this.maxSelectedDate = undefined;\n }\n\n if (letterFilters) {\n this.selectedTitleFilter = null;\n this.selectedCreatorFilter = null;\n }\n\n if (sort) {\n this.sortDirection = null;\n this.selectedSort = SortField.default;\n }\n\n this.clearTVDropdowns();\n\n if (this.smartFacetBar) {\n this.smartFacetBar.deselectAll();\n }\n }\n\n /**\n * Resets any selected TV network/show dropdowns to their default state\n */\n private clearTVDropdowns(): void {\n this.selectedTVNetwork = undefined;\n this.selectedTVShow = undefined;\n\n if (this.tvNetworksDropdown) {\n this.tvNetworksDropdown.clearSelectedOption();\n }\n\n if (this.tvShowsDropdown) {\n this.tvShowsDropdown.clearSelectedOption();\n }\n }\n\n /**\n * Returns true if the current value of `this.selectedFacets` contains\n * any facet buckets than have been selected or negated, or false otherwise.\n */\n private get hasCheckedFacets(): boolean {\n if (!this.selectedFacets) return false;\n\n for (const facetGroup of Object.values(this.selectedFacets)) {\n for (const bucket of Object.values(facetGroup)) {\n if (bucket.state !== 'none') return true;\n }\n }\n\n return false;\n }\n\n /**\n * Returns true if there are any currently selected/negated facet buckets,\n * any selected date range, or any selected letter filters. False otherwise.\n *\n * Ignores sorting options.\n */\n private get hasActiveFilters(): boolean {\n return !!(\n this.hasCheckedFacets ||\n this.minSelectedDate ||\n this.maxSelectedDate ||\n this.selectedTitleFilter ||\n this.selectedCreatorFilter\n );\n }\n\n willUpdate(changed: PropertyValues): void {\n this.setPlaceholderType();\n\n if (changed.has('searchType') && this.searchType === SearchType.TV) {\n this.applyDefaultTVSearchSort();\n }\n }\n\n render() {\n return html`\n ${this.showSmartFacetBar && this.placeholderType === null\n ? html`<smart-facet-bar\n .query=${this.baseQuery}\n .aggregations=${this.dataSource.aggregations}\n .selectedFacets=${this.selectedFacets}\n .collectionTitles=${this.dataSource.collectionTitles}\n .filterToggleShown=${!this.mobileView}\n .filterToggleActive=${this.facetPaneVisible}\n .label=${this.smartFacetBarLabel}\n @facetsChanged=${this.facetsChanged}\n @filtersToggled=${() => {\n this.facetPaneVisible = !this.facetPaneVisible;\n this.emitFacetPaneVisibilityChanged();\n }}\n ></smart-facet-bar>`\n : nothing}\n\n <div\n id=\"content-container\"\n class=${this.mobileView ? 'mobile' : 'desktop'}\n >\n ${this.placeholderType\n ? this.emptyPlaceholderTemplate\n : this.collectionBrowserTemplate}\n </div>\n `;\n }\n\n /**\n * Determines what type of placeholder content should be shown instead of result tiles, if applicable.\n * The placeholders indicate states where we have no results to show, which could be the result of:\n * - No query is set (on the search page)\n * - No results were returned for the most recent search\n * - The collection being searched within has no viewable items\n * - An error occurred on the most recent search attempt\n */\n private setPlaceholderType() {\n const isInitialized = this.dataSource.queryInitialized;\n const hasQuery = !!this.baseQuery?.trim();\n const hasIdentifiers = !!this.identifiers?.length;\n const isCollection = !!this.withinCollection;\n const isProfile = !!this.withinProfile;\n const isSearchResults = !isCollection && !isProfile;\n const noResults =\n !this.searchResultsLoading &&\n (this.dataSource.size === 0 || !this.searchService);\n\n this.placeholderType = null;\n if (this.suppressPlaceholders) return;\n\n if (!isInitialized) {\n this.placeholderType = 'empty-query';\n } else if (isSearchResults && !hasQuery && !hasIdentifiers) {\n this.placeholderType = 'empty-query';\n } else if (noResults) {\n // Within a collection, no query + no results means the collection simply has no viewable items.\n // Otherwise, we must have a user query that produced 0 results.\n this.placeholderType =\n !hasQuery && isCollection ? 'empty-collection' : 'no-results';\n }\n\n if (this.dataSource.queryErrorMessage) {\n this.placeholderType =\n !hasQuery && isCollection ? 'collection-error' : 'query-error';\n }\n }\n\n /**\n * Template for the placeholder content to show when no results are available.\n */\n private get emptyPlaceholderTemplate() {\n return html`\n <empty-placeholder\n .placeholderType=${this.placeholderType}\n ?isMobileView=${this.mobileView}\n ?isCollection=${!!this.withinCollection}\n .detailMessage=${this.dataSource.queryErrorMessage ?? ''}\n .baseNavigationUrl=${this.baseNavigationUrl}\n ></empty-placeholder>\n `;\n }\n\n /**\n * Top-level template for rendering the left (facets) and right (results) columns.\n */\n private get collectionBrowserTemplate() {\n return html`\n <div id=\"left-column-scroll-sentinel\"></div>\n ${this.leftColumnTemplate} ${this.rightColumnTemplate}\n `;\n }\n\n /**\n * Template for either the mobile or desktop version of the left column, depending\n * on current component state.\n */\n private get leftColumnTemplate(): TemplateResult {\n if (this.mobileView) {\n return this.mobileLeftColumnTemplate;\n }\n return this.desktopLeftColumnTemplate;\n }\n\n /**\n * Template for the mobile version of the \"left column\" (which in this case, appears\n * *above* the search results rather than beside them), for rendering the\n * accordion-style facets.\n */\n private get mobileLeftColumnTemplate(): TemplateResult {\n return html`\n <div\n id=\"left-column\"\n class=\"column${this.isResizeToMobile ? ' preload' : ''}\"\n >\n ${this.facetTopViewSlot} ${this.resultsCountTemplate}\n <div id=\"facets-header-container\">${this.mobileFacetsTemplate}</div>\n </div>\n `;\n }\n\n /**\n * Template for the desktop version of the left column, displaying the facets sidebar.\n */\n private get desktopLeftColumnTemplate(): TemplateResult {\n return html`\n <div id=\"left-column\" class=\"column\" ?hidden=${!this.facetPaneVisible}>\n ${this.facetTopViewSlot}\n <div id=\"facets-header-container\">\n <h2 id=\"facets-header\" class=\"sr-only\">${msg('Filters')}</h2>\n ${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}\n </div>\n <div id=\"facets-container\" aria-labelledby=\"facets-header\">\n ${this.facetsTemplate}\n <div id=\"facets-scroll-sentinel\"></div>\n </div>\n <div id=\"facets-bottom-fade\"></div>\n </div>\n `;\n }\n\n /**\n * Slot which is placed at top of the facets area for user-profile page\n * - mainly used to render userlists\n */\n private get facetTopViewSlot(): TemplateResult {\n return html`<div id=\"facet-top-view\">\n <slot name=\"facet-top-slot\"></slot>\n </div>`;\n }\n\n /**\n * Template for the \"X Results\" count at the top of the search results.\n * Changes to the \"Searching...\" label if the search results are still loading.\n */\n private get resultsCountTemplate(): TemplateResult | typeof nothing {\n if (this.suppressResultCount) return nothing;\n\n const shouldShowSearching =\n this.searchResultsLoading || this.totalResults === undefined;\n const classes = classMap({ filtered: this.hasActiveFilters });\n const resultsCount = this.totalResults?.toLocaleString();\n const resultsLabel = this.totalResults === 1 ? 'Result' : 'Results';\n\n // Added data-testid for Playwright testing\n return html`\n <div id=\"results-total\" class=${classes} data-testid=\"results-total\">\n <span id=\"big-results-count\">\n ${shouldShowSearching ? html`Searching…` : resultsCount}\n </span>\n <span id=\"big-results-label\">\n ${shouldShowSearching ? nothing : resultsLabel}\n </span>\n </div>\n `;\n }\n\n /**\n * Template for the right column of the collection browser, where the result\n * tiles and sort/filter bar are shown.\n */\n private get rightColumnTemplate(): TemplateResult {\n const rightColumnClasses = classMap({\n column: true,\n 'full-width': !this.facetPaneVisible,\n 'smart-results-spacing': !!this.showSmartResults,\n });\n\n return html`\n <div id=\"right-column\" class=${rightColumnClasses}>\n ${this.showSmartResults\n ? html`<slot name=\"smart-results\"></slot>`\n : nothing}\n <section id=\"results\">\n <h2 class=\"results-section-heading\">\n <slot name=\"results-heading\"></slot>\n </h2>\n <div id=\"cb-top-view\">\n <slot name=\"cb-top-slot\"></slot>\n </div>\n ${this.isManageView\n ? this.manageBarTemplate\n : this.sortFilterBarTemplate}\n <slot name=\"cb-results\"></slot>\n ${this.displayMode === `list-compact` && this.totalResults\n ? this.listHeaderTemplate\n : nothing}\n ${this.suppressResultTiles ? nothing : this.infiniteScrollerTemplate}\n </section>\n </div>\n `;\n }\n\n /**\n * Template for the infinite scroller widget that contains the result tiles.\n */\n private get infiniteScrollerTemplate() {\n return html`<infinite-scroller\n class=${this.infiniteScrollerClasses}\n itemCount=${this.placeholderType ? 0 : nothing}\n ariaLandmarkLabel=\"Search results\"\n .cellProvider=${this}\n .placeholderCellTemplate=${this.placeholderCellTemplate}\n @scrollThresholdReached=${this.scrollThresholdReached}\n @visibleCellsChanged=${this.visibleCellsChanged}\n >${this.displayMode === 'grid'\n ? html`<slot name=\"result-last-tile\" slot=\"result-last-tile\"></slot>`\n : nothing}\n </infinite-scroller>`;\n }\n\n /**\n * Produces a `classMap` indicating which classes the infinite scroller should have\n * given the current display mode & placeholder case.\n */\n private get infiniteScrollerClasses() {\n return classMap({\n [this.displayMode ?? '']: !!this.displayMode,\n hidden: !!this.placeholderType,\n });\n }\n\n /**\n * Template for the sort & filtering bar that appears atop the search results.\n */\n private get sortFilterBarTemplate(): TemplateResult | typeof nothing {\n if (this.suppressSortBar) return nothing;\n\n // Determine the set of sortable fields that should be shown in the sort bar\n let sortFieldAvailability = defaultSortAvailability;\n\n // We adjust the available sort options for a couple of special cases...\n if (this.withinCollection?.startsWith('fav-') || this.profileElement === 'favorites') {\n // When viewing a fav- collection or the favorites profile tab,\n // we include the Date Favorited option as the default\n sortFieldAvailability = favoritesSortAvailability;\n console.log('favoritesSortAvailability', true);\n } else if (!this.withinCollection && this.searchType === SearchType.TV) {\n // When viewing TV search results, we exclude several of the usual date sort options.\n sortFieldAvailability = tvSortAvailability;\n }\n\n // We only show relevance sort if a search query is currently defined\n sortFieldAvailability.relevance = this.isRelevanceSortAvailable;\n\n return html`\n <sort-filter-bar\n .defaultSortField=${this.defaultSortField}\n .defaultSortDirection=${this.defaultSortDirection}\n .selectedSort=${this.selectedSort}\n .sortDirection=${this.sortDirection}\n .sortFieldAvailability=${sortFieldAvailability}\n .displayMode=${this.displayMode}\n .selectedTitleFilter=${this.selectedTitleFilter}\n .selectedCreatorFilter=${this.selectedCreatorFilter}\n .prefixFilterCountMap=${this.dataSource.prefixFilterCountMap}\n .enableSortOptionsSlot=${this.enableSortOptionsSlot}\n .suppressDisplayModes=${this.suppressDisplayModes}\n @sortChanged=${this.userChangedSort}\n @displayModeChanged=${this.displayModeChanged}\n @titleLetterChanged=${this.titleLetterSelected}\n @creatorLetterChanged=${this.creatorLetterSelected}\n >\n ${this.tileBlurCheckboxTemplate}\n <slot name=\"sort-options-left\" slot=\"sort-options-left\"></slot>\n <slot name=\"sort-options\" slot=\"sort-options\"></slot>\n <slot name=\"sort-options-right\" slot=\"sort-options-right\"></slot>\n </sort-filter-bar>\n `;\n }\n\n /**\n * Template for the Blurring toggle for admins to enable/disable blurring of\n * sensitive content in result tiles.\n */\n private get tileBlurCheckboxTemplate(): TemplateResult | typeof nothing {\n // Only show the checkbox for @archive.org users\n if (!this.dataSource.sessionContext?.is_archive_user) return nothing;\n\n return html`\n <label\n id=\"tile-blur-label\"\n for=\"tile-blur-check\"\n slot=\"sort-options-right\"\n >\n ${msg('Blurring')}\n <input\n id=\"tile-blur-check\"\n type=\"checkbox\"\n ?checked=${!this.shouldSuppressTileBlurring}\n @change=${this.tileBlurCheckboxChanged}\n />\n </label>\n `;\n }\n\n /**\n * Message to show in the manage view modal, depending on context.\n */\n private get manageViewModalMsg(): string {\n const pluralize = this.dataSource.checkedTileModels.length > 1;\n\n switch (this.profileElement) {\n case 'uploads':\n return pluralize\n ? msg(\n 'Note: It may take a few minutes for these items to stop appearing in your uploads list.',\n )\n : msg(\n 'Note: It may take a few minutes for this item to stop appearing in your uploads list.',\n );\n case 'web_archives':\n return pluralize\n ? msg(\n 'Note: It may take a few minutes for these items to stop appearing in your web archives list.',\n )\n : msg(\n 'Note: It may take a few minutes for this item to stop appearing in your web archives list.',\n );\n default:\n return '';\n }\n }\n\n /**\n * Template for the manage bar UI that appears atop the search results when we are\n * showing the management view. This generally replaces the sort bar when present.\n */\n private get manageBarTemplate(): TemplateResult {\n return html`\n <manage-bar\n .label=${this.manageViewLabel}\n .modalManager=${this.modalManager}\n .selectedItems=${this.dataSource.checkedTileModels}\n .manageViewModalMsg=${this.manageViewModalMsg}\n showSelectAll\n showUnselectAll\n ?showItemManageButton=${this.pageContext === 'search'}\n ?removeAllowed=${this.dataSource.checkedTileModels.length !== 0}\n @removeItems=${this.handleRemoveItems}\n @manageItems=${this.handleManageItems}\n @selectAll=${() => this.dataSource.checkAllTiles()}\n @unselectAll=${() => this.dataSource.uncheckAllTiles()}\n @cancel=${() => {\n this.isManageView = false;\n this.dataSource.uncheckAllTiles();\n if (this.searchResultsLoading) this.dataSource.resetPages();\n }}\n ></manage-bar>\n `;\n }\n\n /**\n * Handler for when the user requests to remove all checked items via the manage bar.\n * Emits an `itemRemovalRequested` event with all checked tile models.\n */\n private handleRemoveItems(): void {\n this.dispatchEvent(\n new CustomEvent<{ items: string[] }>('itemRemovalRequested', {\n detail: {\n items: this.dataSource.checkedTileModels.map(model => {\n // For favorited searches, we attach a search: prefix to differentiate it from an item\n const searchPrefix = model?.mediatype === 'search' ? 'search:' : '';\n const identifier = model?.identifier ?? '';\n return `${searchPrefix}${identifier}`;\n }),\n },\n }),\n );\n }\n\n /**\n * Handler when user request to bulk edit from /search/ page\n */\n private handleManageItems(): void {\n this.dispatchEvent(\n new CustomEvent<{ items: string[] }>('itemManagerRequested', {\n detail: {\n items: this.dataSource.checkedTileModels.map(model =>\n model?.identifier ? model.identifier : '',\n ),\n },\n }),\n );\n }\n\n refreshSmartFacets(): void {\n this.smartFacetBar?.refresh();\n }\n\n /**\n * Handler to show processing modal while removing item\n */\n showRemoveItemsProcessingModal(): void {\n this.manageBar?.showRemoveItemsProcessingModal();\n }\n\n /**\n * Handler to show error modal when item removal failed\n */\n showRemoveItemsErrorModal(): void {\n this.manageBar?.showRemoveItemsErrorModal();\n }\n\n /**\n * Removes all tile models that are currently checked & adjusts the paging\n * of the data source to account for any new gaps in the data.\n */\n removeCheckedTiles(): void {\n this.dataSource.removeCheckedTiles();\n }\n\n /**\n * Handler for when the tile blurring checkbox state is toggled\n */\n private tileBlurCheckboxChanged(e: Event): void {\n const { checked } = e.target as HTMLInputElement;\n this.tileBlurOverrideState = checked ? 'on' : 'off';\n this.infiniteScroller?.refreshAllVisibleCells();\n }\n\n /**\n * Whether result tiles should have the default blurring of sensitive content suppressed.\n * First considers any override specified by the user, falling back to the setting in\n * user preferences if not overridden.\n */\n private get shouldSuppressTileBlurring(): boolean {\n if (this.tileBlurOverrideState !== 'no-override') {\n // User wants to override their preference.\n // Return true if they want blurring turned off, or false otherwise.\n return this.tileBlurOverrideState === 'off';\n }\n\n // Not overriding, so use the preference from session context\n const { sessionContext } = this.dataSource;\n const userPrefs = sessionContext?.pps_relevant_user_preferences;\n const blurringPref = userPrefs?.display__blur_moderated_content;\n\n // Only suppress blurring if the preference is disabled.\n // If enabled or missing, tile blurring remains on.\n return blurringPref === 'off';\n }\n\n /**\n * Handler for when the user changes the selected sort option or direction.\n */\n private userChangedSort(\n e: CustomEvent<{\n selectedSort: SortField;\n sortDirection: SortDirection | null;\n }>,\n ) {\n const { selectedSort, sortDirection } = e.detail;\n this.selectedSort = selectedSort;\n this.sortDirection = sortDirection;\n\n if ((this.currentPage ?? 1) > 1) {\n this.goToPage(1);\n }\n this.currentPage = 1;\n }\n\n /**\n * Fires an analytics event for sorting changes.\n * @param prevSortDirection Which sort direction was previously set.\n */\n private sendSortByAnalytics(prevSortDirection: SortDirection | null): void {\n const directionCleared = prevSortDirection && !this.sortDirection;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.sortBy,\n label: `${this.selectedSort}${\n this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''\n }`,\n });\n }\n\n /**\n * Handler for when the selected sort option is updated, whether by the user\n * themselves or programmatically.\n */\n private selectedSortChanged(): void {\n // Lazy-load the alphabet counts for title/creator sort bar as needed\n this.dataSource.updatePrefixFiltersForCurrentSort();\n }\n\n /**\n * An object representing the current sort field & direction.\n */\n get sortParam(): SortParam | null {\n const sortOption = SORT_OPTIONS[this.selectedSort];\n if (!sortOption?.handledBySearchService) {\n return null;\n }\n\n // If the sort option specified in the URL is unrecognized, we just use it as-is\n const urlSortParam = new URL(window.location.href).searchParams.get('sort');\n const sortField =\n sortOption.searchServiceKey ?? urlSortParam?.replace(/^-/, '');\n\n // If the sort direction is still null at this point, then we assume ascending\n // (i.e., it was unrecognized and had no directional flag)\n if (!this.sortDirection) this.sortDirection = 'asc';\n\n if (!sortField) return null;\n return { field: sortField, direction: this.sortDirection };\n }\n\n /**\n * An object representing the default sort field & direction, if none are explicitly set.\n */\n get defaultSortParam(): SortParam | null {\n const direction = this.defaultSortDirection ?? 'asc';\n const field = SORT_OPTIONS[this.defaultSortField].searchServiceKey;\n if (!field) return null;\n\n return { field, direction };\n }\n\n /**\n * Handler for when the display mode option is changed (grid/list/compact-list views).\n */\n private displayModeChanged(\n e: CustomEvent<{ displayMode?: CollectionDisplayMode }>,\n ): void {\n this.displayMode = e.detail.displayMode;\n\n if (this.displayMode) {\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.displayMode,\n label: this.displayMode,\n });\n }\n }\n\n /**\n * Returns a query clause identifying the currently selected title filter,\n * e.g., `firstTitle:X`.\n */\n private get titleQuery(): string | undefined {\n return this.selectedTitleFilter\n ? `firstTitle:${this.selectedTitleFilter}`\n : undefined;\n }\n\n /**\n * Returns a query clause identifying the currently selected creator filter,\n * e.g., `firstCreator:X`.\n */\n private get creatorQuery(): string | undefined {\n return this.selectedCreatorFilter\n ? `firstCreator:${this.selectedCreatorFilter}`\n : undefined;\n }\n\n /**\n * Send Analytics when sorting by title's first letter\n * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'\n */\n private sendFilterByTitleAnalytics(prevSelectedLetter: string | null): void {\n if (!prevSelectedLetter && !this.selectedTitleFilter) {\n return;\n }\n const cleared = prevSelectedLetter && !this.selectedTitleFilter;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.filterByTitle,\n label: cleared\n ? `clear-${prevSelectedLetter}`\n : `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,\n });\n }\n\n /**\n * Send Analytics when filtering by creator's first letter\n * labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'\n */\n private sendFilterByCreatorAnalytics(\n prevSelectedLetter: string | null,\n ): void {\n if (!prevSelectedLetter && !this.selectedCreatorFilter) {\n return;\n }\n const cleared = prevSelectedLetter && !this.selectedCreatorFilter;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.filterByCreator,\n label: cleared\n ? `clear-${prevSelectedLetter}`\n : `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,\n });\n }\n\n /**\n * Handler for changes to which letter is selected in the title alphabet bar.\n */\n private titleLetterSelected(\n e: CustomEvent<{ selectedLetter: string | null }>,\n ): void {\n this.selectedCreatorFilter = null;\n this.selectedTitleFilter = e.detail.selectedLetter;\n }\n\n /**\n * Handler for changes to which letter is selected in the creator alphabet bar.\n */\n private creatorLetterSelected(\n e: CustomEvent<{ selectedLetter: string | null }>,\n ): void {\n this.selectedTitleFilter = null;\n this.selectedCreatorFilter = e.detail.selectedLetter;\n }\n\n /**\n * The full template for how the facets should be structured in mobile view,\n * including the collapsible container (with header) and the facets themselves.\n */\n private get mobileFacetsTemplate(): TemplateResult | typeof nothing {\n if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement!)) return nothing;\n\n const toggleFacetsVisible = (e: Event) => {\n const target = e.target as HTMLDetailsElement;\n this.isResizeToMobile = false;\n this.collapsibleFacetsVisible = target.open;\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.mobileFacetsToggled,\n label: target.open ? 'open' : 'closed',\n });\n };\n\n return html`\n <details id=\"mobile-filter-collapse\" @toggle=${toggleFacetsVisible}>\n <summary>\n <span class=\"collapser-icon\">${chevronIcon}</span>\n <h2>${msg('Filters')}</h2>\n ${this.clearFiltersBtnTemplate(true)}\n </summary>\n ${this.facetsTemplate}\n </details>\n `;\n }\n\n /**\n * Handler for when either of the TV dropdown filters are toggled, loading their\n * contents if necessary.\n */\n private async tvDropdownToggled(e: CustomEvent<boolean>): Promise<void> {\n if (!e.detail) return; // Only run when toggled open\n if (this.tvMapsPopulated) return;\n\n this.tvMapsLoading = true;\n this.tvMapsErrored = false;\n try {\n await this.dataSource.populateTVChannelMaps();\n this.tvMapsPopulated = true;\n } catch (err) {\n this.tvMapsErrored = true;\n }\n\n this.tvMapsLoading = false;\n }\n\n private async networksDropdownChanged(): Promise<void> {\n const previousNetwork = this.selectedTVNetwork;\n const newNetwork = this.tvNetworksDropdown!.selectedOption?.text;\n this.selectedTVNetwork = newNetwork ?? undefined;\n\n const entries = this.dataSource.tvChannelMaps.channelToNetwork!.entries();\n for (const [channel, network] of entries) {\n if (network === previousNetwork) {\n // Remove any previously-applied network filter\n const removedBucket: FacetBucket = {\n key: channel.toLowerCase(),\n count: 0,\n state: 'none',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'creator',\n removedBucket,\n true,\n );\n } else if (network === this.selectedTVNetwork) {\n const newBucket: FacetBucket = {\n key: channel.toLowerCase(),\n count: 0,\n state: 'selected',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'creator',\n newBucket,\n );\n }\n }\n }\n\n private async showsDropdownChanged(): Promise<void> {\n const previousShow = this.selectedTVShow;\n const newShow = this.tvShowsDropdown!.selectedOption?.text;\n this.selectedTVShow = newShow ?? undefined;\n\n // Remove any previously-applied shows filter\n if (previousShow !== undefined) {\n const removedBucket: FacetBucket = {\n key: previousShow,\n count: 0,\n state: 'none',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'program',\n removedBucket,\n true,\n );\n }\n\n if (this.selectedTVShow) {\n const newBucket: FacetBucket = {\n key: this.selectedTVShow,\n count: 0,\n state: 'selected',\n };\n this.selectedFacets = updateSelectedFacetBucket(\n this.selectedFacets,\n 'program',\n newBucket,\n );\n }\n }\n\n private get tvDropdownFiltersTemplate(): TemplateResult | typeof nothing {\n if (this.searchType !== SearchType.TV) return nothing;\n\n const { channelToNetwork, programToChannels } =\n this.dataSource.tvChannelMaps;\n const networks = channelToNetwork\n ? [...new Set(channelToNetwork.values())]\n : [];\n\n let showEntries = programToChannels ? [...programToChannels.entries()] : [];\n\n if (channelToNetwork && this.selectedTVNetwork) {\n showEntries = showEntries.filter(([, channels]) =>\n Object.keys(channels).some(\n c => channelToNetwork.get(c) === this.selectedTVNetwork,\n ),\n );\n }\n\n const filterByNetworkLabel = msg('Filter by Network');\n const filterByShowLabel = msg('Filter by Show');\n const shows = showEntries.map(([show]) => show);\n const loadingIndicator = html`\n <span slot=\"empty-options\">\n <img src=\"https://archive.org/images/loading.gif\" />\n </span>\n `;\n const errorMessage = html`\n <span slot=\"empty-options\">\n ${msg('Unable to fetch options, try again later')}\n </span>\n `;\n\n return html`\n <div id=\"tv-filters\" slot=\"facets-top\">\n <ia-combo-box\n id=\"tv-networks\"\n class=\"tv-filter-dropdown\"\n placeholder=${filterByNetworkLabel}\n clearable\n wrap-arrow-keys\n sort\n .options=${networks.map((n, i) => ({ id: `network-${i}`, text: n }))}\n @toggle=${this.tvDropdownToggled}\n @change=${this.networksDropdownChanged}\n >\n <span slot=\"label\" class=\"sr-only\">${filterByNetworkLabel}</span>\n ${this.tvMapsLoading ? loadingIndicator : nothing}\n ${this.tvMapsErrored ? errorMessage : nothing}\n </ia-combo-box>\n <ia-combo-box\n id=\"tv-shows\"\n class=\"tv-filter-dropdown\"\n placeholder=${filterByShowLabel}\n max-autocomplete-entries=\"500\"\n clearable\n wrap-arrow-keys\n sort\n .options=${shows.map((s, i) => ({ id: `show-${i}`, text: s }))}\n @toggle=${this.tvDropdownToggled}\n @change=${this.showsDropdownChanged}\n >\n <span slot=\"label\" class=\"sr-only\">${filterByShowLabel}</span>\n ${this.tvMapsLoading ? loadingIndicator : nothing}\n ${this.tvMapsErrored ? errorMessage : nothing}\n </ia-combo-box>\n </div>\n `;\n }\n\n /**\n * The template for the facets component alone, without any surrounding wrappers.\n */\n private get facetsTemplate() {\n if (FACETLESS_PAGE_ELEMENTS.includes(this.profileElement!)) return nothing;\n if (this.facetLoadStrategy === 'off') {\n return html`\n <p class=\"facets-message\">\n ${msg('Facets are temporarily unavailable.')}\n </p>\n `;\n }\n\n // We switch to TV facet ordering & date picker if we are in a TV collection or showing TV search results\n const shouldUseTvInterface =\n this.isTVCollection ||\n (!this.withinCollection && this.searchType === SearchType.TV);\n const facetDisplayOrder = shouldUseTvInterface\n ? tvFacetDisplayOrder\n : defaultFacetDisplayOrder;\n\n const facets = html`\n <collection-facets\n .collectionPagePath=${this.collectionPagePath}\n .parentCollections=${this.dataSource.parentCollections}\n .pageSpecifierParams=${this.dataSource.pageSpecifierParams}\n .searchService=${this.searchService}\n .featureFeedbackService=${this.featureFeedbackService}\n .recaptchaManager=${this.recaptchaManager}\n .resizeObserver=${this.resizeObserver}\n .searchType=${this.searchType}\n .aggregations=${this.dataSource.aggregations}\n .histogramAggregation=${this.dataSource.histogramAggregation}\n .minSelectedDate=${this.minSelectedDate}\n .maxSelectedDate=${this.maxSelectedDate}\n .selectedFacets=${this.selectedFacets}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .collectionTitles=${this.dataSource.collectionTitles}\n .tvChannelAliases=${this.dataSource.tvChannelAliases}\n .showHistogramDatePicker=${this.showHistogramDatePicker}\n .allowExpandingDatePicker=${!this.mobileView}\n .allowDatePickerMonths=${shouldUseTvInterface}\n .contentWidth=${this.contentWidth}\n .query=${this.baseQuery}\n .identifiers=${this.identifiers}\n .filterMap=${this.dataSource.filterMap}\n .isManageView=${this.isManageView}\n .modalManager=${this.modalManager}\n .analyticsHandler=${this.analyticsHandler}\n .facetDisplayOrder=${facetDisplayOrder}\n .isTvSearch=${shouldUseTvInterface}\n ?collapsableFacets=${this.mobileView}\n ?facetsLoading=${this.facetsLoading}\n ?histogramAggregationLoading=${this.facetsLoading}\n ?suppressMediatypeFacets=${this.suppressMediatypeFacets}\n @facetClick=${this.facetClickHandler}\n @facetsChanged=${this.facetsChanged}\n @histogramDateRangeUpdated=${this.histogramDateRangeUpdated}\n >\n ${this.tvDropdownFiltersTemplate}\n </collection-facets>\n `;\n\n // If we are using one of the opt-in facet load strategies, we may need to wrap the\n // desktop view facets in a <details> widget so that patrons can opt into loading them.\n // In the `opt-in-or-login` case, we only do this if they are not logged in.\n const showDesktopOptInWidget =\n this.facetLoadStrategy === 'opt-in' ||\n (this.facetLoadStrategy === 'opt-in-or-login' && !this.loggedIn);\n\n if (showDesktopOptInWidget && !this.mobileView) {\n return html`\n <details\n class=\"desktop-facets-dropdown\"\n @toggle=${(e: Event) => {\n const target = e.target as HTMLDetailsElement;\n this.collapsibleFacetsVisible = target.open;\n }}\n >\n <summary>\n <span class=\"collapser-icon\">${chevronIcon}</span>\n <h2>${msg('Filters')}</h2>\n </summary>\n ${facets}\n </details>\n `;\n }\n // Otherwise, just render the facets component bare\n return facets;\n }\n\n /**\n * The HTML template for the \"Clear all filters\" button, or `nothing` if no\n * filters are currently active.\n *\n * @param mobile Whether to style/shorten the button for mobile view\n */\n private clearFiltersBtnTemplate(\n mobile: boolean,\n ): TemplateResult | typeof nothing {\n if (!this.hasActiveFilters) return nothing;\n\n const buttonClasses = classMap({\n 'clear-filters-btn': true,\n mobile,\n });\n\n const buttonText = mobile ? 'Clear all' : 'Clear all filters';\n\n return html`\n <div class=\"clear-filters-btn-row\">\n ${mobile\n ? html`<span class=\"clear-filters-btn-separator\"> </span>`\n : nothing}\n <button class=${buttonClasses} @click=${this.clearFilters}>\n ${buttonText}\n </button>\n </div>\n `;\n }\n\n /**\n * Template for the table header content that appears atop the compact list view.\n */\n private get listHeaderTemplate() {\n return html`\n <div id=\"list-header\">\n <tile-dispatcher\n .tileDisplayMode=${'list-header'}\n .resizeObserver=${this.resizeObserver}\n .sortParam=${this.sortParam}\n .defaultSortParam=${this.defaultSortParam}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.shouldSuppressTileBlurring}\n >\n </tile-dispatcher>\n </div>\n `;\n }\n\n /**\n * Handler for when the date picker's date range is changed.\n */\n private histogramDateRangeUpdated(\n e: CustomEvent<{\n minDate: string;\n maxDate: string;\n }>,\n ) {\n const { minDate, maxDate } = e.detail;\n [this.minSelectedDate, this.maxSelectedDate] = [minDate, maxDate];\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.histogramChanged,\n label: this.dateRangeQueryClause,\n });\n }\n\n /**\n * The Lucene query corresponding to the current date range.\n */\n private get dateRangeQueryClause() {\n if (!this.minSelectedDate || !this.maxSelectedDate) {\n return undefined;\n }\n\n return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;\n }\n\n /**\n * Emits an event indicating a change in whether the manage mode is shown.\n */\n private emitManageModeChangedEvent(): void {\n this.dispatchEvent(\n new CustomEvent<boolean>('manageModeChanged', {\n detail: this.isManageView,\n }),\n );\n }\n\n /**\n * Installs a new data source component and associated query state parameters into\n * this component, causing it to efficiently update its views to represent the\n * newly-provided data. In this way, one can reuse a single instance of\n * <collection-browser> to handle multiple different sets of search results on\n * a single page, each set of results being loaded & updated by its own data\n * source.\n *\n * @param dataSource The data source component containing (or prepared to fetch)\n * the tile data to be displayed.\n * @param queryState The new query-related state that this component should\n * represent, such as the search query, sort option, and any filters applied.\n */\n async installDataSourceAndQueryState(\n dataSource: CollectionBrowserDataSourceInterface,\n queryState: CollectionBrowserQueryState,\n ): Promise<void> {\n if (this.dataSource) this.removeController(this.dataSource);\n this.dataSource = dataSource;\n this.addController(this.dataSource);\n\n this.baseQuery = queryState.baseQuery;\n this.profileElement = queryState.profileElement;\n this.searchType = queryState.searchType;\n this.selectedFacets =\n queryState.selectedFacets ?? getDefaultSelectedFacets();\n this.internalFilters = queryState.internalFilters;\n this.minSelectedDate = queryState.minSelectedDate;\n this.maxSelectedDate = queryState.maxSelectedDate;\n this.selectedSort = queryState.selectedSort ?? SortField.default;\n this.sortDirection = queryState.sortDirection;\n this.selectedTitleFilter = queryState.selectedTitleFilter;\n this.selectedCreatorFilter = queryState.selectedCreatorFilter;\n\n this.pagesToRender = this.initialPageNumber;\n\n // We set this flag during the update to prevent the URL state persistence\n // from creating an unwanted extra history entry.\n this.dataSourceInstallInProgress = true;\n this.requestUpdate();\n await this.updateComplete;\n this.dataSourceInstallInProgress = false;\n\n if (!this.searchResultsLoading) {\n this.setTotalResultCount(this.dataSource.totalResults);\n this.setTileCount(this.dataSource.size);\n }\n\n this.refreshVisibleResults();\n }\n\n firstUpdated(): void {\n this.restoreState();\n this.setInitialSize();\n }\n\n /**\n * Determines the initial size of the content container and whether or not\n * the mobile layout should be used.\n */\n setInitialSize(): void {\n this.contentWidth = this.contentContainer.getBoundingClientRect().width;\n this.mobileView =\n this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;\n this.sendLayoutSizeAnalytics();\n }\n\n /**\n * Fires an analytics event indicating which type of layout was rendered:\n * mobile or desktop.\n */\n private sendLayoutSizeAnalytics(): void {\n if (this.analyticsHandler) {\n this.layoutSizeAnalyticsSent = true;\n this.analyticsHandler.sendEvent({\n category: this.searchContext,\n action: this.mobileView\n ? analyticsActions.loadMobileView\n : analyticsActions.loadDesktopView,\n });\n }\n }\n\n updated(changed: PropertyValues) {\n if (changed.has('placeholderType') && this.placeholderType === null) {\n if (!this.leftColIntersectionObserver) {\n this.setupLeftColumnScrollListeners();\n }\n if (!this.facetsIntersectionObserver) {\n this.setupFacetsScrollListeners();\n }\n this.updateLeftColumnHeight();\n }\n\n if (changed.has('analyticsHandler') && !this.layoutSizeAnalyticsSent) {\n this.sendLayoutSizeAnalytics();\n }\n\n if (\n changed.has('displayMode') ||\n changed.has('baseNavigationUrl') ||\n changed.has('baseImageUrl') ||\n changed.has('loggedIn')\n ) {\n this.infiniteScroller?.reload();\n }\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('searchType') ||\n changed.has('withinCollection')\n ) {\n // Unless this query/search type update is from the initial page load or the\n // result of hitting the back button,\n // we need to clear any existing filters since they may no longer be valid for\n // the new set of search results.\n if (!this.historyPopOccurred && this.initialQueryChangeHappened) {\n // Ordinarily, we leave the sort param unchanged between searches.\n // However, if we are changing the target collection itself, we want the sort cleared too,\n // since different collections may have different sorting options available.\n const shouldClearSort =\n changed.has('withinCollection') &&\n !changed.has('selectedSort') &&\n !changed.has('sortDirection');\n\n // Otherwise, only clear filters that haven't been simultaneously applied in this update\n this.clearFilters({\n sort: shouldClearSort,\n facets: !changed.has('selectedFacets'),\n dateRange: !(\n changed.has('minSelectedDate') || changed.has('maxSelectedDate')\n ),\n letterFilters: !(\n changed.has('selectedTitleFilter') ||\n changed.has('selectedCreatorFilter')\n ),\n });\n }\n }\n\n if (changed.has('profileElement')) {\n this.applyDefaultProfileSort();\n }\n\n if (changed.has('withinCollection') && this.withinCollection) {\n // Set a sensible default collection sort while we load results, which we will later\n // adjust based on any sort-by metadata once the response arrives.\n if (!this.baseQuery) {\n this.defaultSortField = this.withinCollection.startsWith('fav-')\n ? SortField.datefavorited\n : SortField.weeklyview;\n this.defaultSortDirection = 'desc';\n }\n }\n\n if (changed.has('baseQuery')) {\n this.emitBaseQueryChanged();\n }\n if (changed.has('searchType')) {\n this.emitSearchTypeChanged();\n }\n\n if (changed.has('currentPage') || changed.has('displayMode')) {\n this.persistState();\n }\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('minSelectedDate') ||\n changed.has('maxSelectedDate') ||\n changed.has('selectedFacets') ||\n changed.has('searchService') ||\n changed.has('withinCollection') ||\n changed.has('withinProfile') ||\n changed.has('profileElement')\n ) {\n this.dataSource.refreshLetterCounts();\n }\n\n if (changed.has('selectedSort') || changed.has('sortDirection')) {\n const prevSortDirection = changed.get('sortDirection') as SortDirection;\n this.sendSortByAnalytics(prevSortDirection);\n this.selectedSortChanged();\n }\n\n if (changed.has('selectedTitleFilter')) {\n this.sendFilterByTitleAnalytics(\n changed.get('selectedTitleFilter') as string,\n );\n }\n if (changed.has('selectedCreatorFilter')) {\n this.sendFilterByCreatorAnalytics(\n changed.get('selectedCreatorFilter') as string,\n );\n }\n\n this.updateFacetReadiness();\n\n if (\n changed.has('baseQuery') ||\n changed.has('identifiers') ||\n changed.has('searchType') ||\n changed.has('selectedTitleFilter') ||\n changed.has('selectedCreatorFilter') ||\n changed.has('minSelectedDate') ||\n changed.has('maxSelectedDate') ||\n changed.has('selectedSort') ||\n changed.has('sortDirection') ||\n changed.has('selectedFacets') ||\n changed.has('searchService') ||\n changed.has('withinCollection') ||\n changed.has('withinProfile') ||\n changed.has('profileElement')\n ) {\n this.handleQueryChange();\n }\n\n if (changed.has('searchResultsLoading')) {\n this.emitSearchResultsLoadingChanged();\n }\n\n if (\n changed.has('facetsLoading') &&\n this.facetsLoading &&\n this.collectionFacets\n ) {\n this.collectionFacets.moreLinksVisible =\n this.searchType !== SearchType.FULLTEXT;\n }\n\n if (changed.has('pagesToRender')) {\n if (!this.dataSource.endOfDataReached && this.infiniteScroller) {\n this.infiniteScroller.itemCount = this.estimatedTileCount;\n }\n }\n\n if (changed.has('isManageView')) {\n if (this.isManageView) {\n this.displayMode = 'grid';\n this.fetchManageableSearchResults();\n } else if (this.pageContext === 'search') this.infiniteScroller?.reload();\n\n this.infiniteScroller?.refreshAllVisibleCells();\n\n // Only emit change event if changing b/w true & false, not on initial value set.\n if (changed.get('isManageView') !== undefined) {\n this.emitManageModeChangedEvent();\n }\n }\n\n if (changed.has('resizeObserver')) {\n const oldObserver = changed.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n if (oldObserver) this.disconnectResizeObserver(oldObserver);\n this.setupResizeObserver();\n }\n\n this.ensureAvailableTilesDisplayed();\n }\n\n connectedCallback(): void {\n super.connectedCallback?.();\n this.setupStateRestorationObserver();\n this.setupResizeObserver();\n }\n\n disconnectedCallback(): void {\n if (this.resizeObserver) {\n this.disconnectResizeObserver(this.resizeObserver);\n }\n if (this.boundNavigationHandler) {\n window.removeEventListener('popstate', this.boundNavigationHandler);\n }\n\n this.leftColIntersectionObserver?.disconnect();\n this.facetsIntersectionObserver?.disconnect();\n window.removeEventListener('resize', this.updateLeftColumnHeight);\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n const previousView = this.mobileView;\n if (entry.target === this.contentContainer) {\n this.contentWidth = entry.contentRect.width;\n this.mobileView =\n this.contentWidth > 0 && this.contentWidth < this.mobileBreakpoint;\n // If changing from desktop to mobile disable transition\n if (this.mobileView && !previousView) {\n this.isResizeToMobile = true;\n }\n }\n\n // Ensure the facet sidebar remains sized correctly\n this.updateLeftColumnHeight();\n }\n\n /**\n * Ensures that if we have new results from the data source that are not yet\n * displayed in the infinite scroller, that they are immediately reflected\n * in the tile count.\n */\n private ensureAvailableTilesDisplayed(): void {\n if (\n this.infiniteScroller &&\n this.infiniteScroller.itemCount < this.dataSource.size\n ) {\n this.setTileCount(\n this.dataSource.endOfDataReached\n ? this.dataSource.size\n : this.estimatedTileCount,\n );\n }\n }\n\n /**\n * Updates the data source with the current state of facet readiness for loading,\n * so that they will begin to load in at the appropriate time according to the\n * current facet loading strategy.\n */\n private updateFacetReadiness(): void {\n // There are two ways to opt into facet production:\n // (1) have the facets dropdown open, or\n // (2) if using the `opt-in-or-login` strategy, be logged into an account\n const optedIn =\n this.collapsibleFacetsVisible ||\n (this.facetLoadStrategy === 'opt-in-or-login' && this.loggedIn);\n\n // In desktop view, we are always ready to load facets *unless* we are using one of the\n // `opt-in` strategies and have not opted in (whether by login or UI interaction).\n const usingOptInStrategy = ['opt-in', 'opt-in-or-login'].includes(\n this.facetLoadStrategy,\n );\n const desktopFacetsReady =\n !this.mobileView && (!usingOptInStrategy || optedIn);\n\n // In the mobile view, facets are considered ready provided we have opted in (whether by\n // login or UI interaction).\n const mobileFacetsReady = this.mobileView && optedIn;\n\n this.dataSource.handleFacetReadinessChange(\n desktopFacetsReady || mobileFacetsReady,\n );\n }\n\n /**\n * Sets up listeners for events that may require updating the left column height.\n */\n private setupLeftColumnScrollListeners(): void {\n // We observe intersections between the left column's scroll sentinel and\n // the viewport, so that we can ensure the left column is always sized to\n // match the _available_ viewport height. This should generally be more\n // performant than listening to scroll events on the page or column.\n const leftColumnSentinel = this.shadowRoot?.querySelector(\n '#left-column-scroll-sentinel',\n );\n if (leftColumnSentinel) {\n this.leftColIntersectionObserver = new IntersectionObserver(\n this.updateLeftColumnHeight,\n {\n threshold: [...Array(201).keys()].map(n => n / 200), // Threshold every 0.5%\n },\n );\n this.leftColIntersectionObserver.observe(leftColumnSentinel);\n }\n\n // We also listen for window resize events, as they are not always captured\n // by the resize observer and can affect the desired height of the left column.\n window.addEventListener('resize', this.updateLeftColumnHeight);\n }\n\n /**\n * Sets up listeners to control whether the facet sidebar shows its bottom fade-out.\n * Note this uses a separate IntersectionObserver from the left column, because we\n * don't need granular intersection thresholds for this.\n */\n private setupFacetsScrollListeners(): void {\n const facetsSentinel = this.shadowRoot?.querySelector(\n '#facets-scroll-sentinel',\n );\n if (facetsSentinel) {\n this.facetsIntersectionObserver = new IntersectionObserver(\n this.updateFacetFadeOut,\n );\n this.facetsIntersectionObserver.observe(facetsSentinel);\n }\n }\n\n /**\n * Updates the height of the left column according to its position on the page.\n * Arrow function ensures proper `this` binding.\n */\n private updateLeftColumnHeight = (): void => {\n if (this.mobileView) {\n this.leftColumn?.style?.removeProperty('height');\n } else {\n const clientTop = this.leftColumn?.getBoundingClientRect().top;\n const columnHeight = window.innerHeight - (clientTop ?? 0);\n const cssHeightValue =\n clientTop === 0\n ? null\n : // Subtract off the column's top padding so that it doesn't overflow\n `calc(${columnHeight}px - var(--leftColumnPaddingTop, 2rem))`;\n\n this.leftColumn?.style?.setProperty('height', cssHeightValue);\n }\n };\n\n /**\n * Toggles whether the fade-out is visible at the bottom of the facets.\n * It should only be visible if the facets are not scrolled to the bottom.\n * Arrow function ensures proper `this` binding.\n */\n private updateFacetFadeOut = (entries: IntersectionObserverEntry[]): void => {\n const fadeElmt = this.shadowRoot?.getElementById('facets-bottom-fade');\n fadeElmt?.classList.toggle('hidden', entries?.[0]?.isIntersecting);\n };\n\n /**\n * Emits a `baseQueryChanged` event indicating an update to the search query.\n */\n private emitBaseQueryChanged() {\n this.dispatchEvent(\n new CustomEvent<{ baseQuery?: string }>('baseQueryChanged', {\n detail: {\n baseQuery: this.baseQuery,\n },\n }),\n );\n }\n\n /**\n * Emits a `searchTypeChanged` event indicating an update to the search type\n * (e.g., metadata vs. full-text).\n */\n private emitSearchTypeChanged() {\n this.dispatchEvent(\n new CustomEvent<SearchType>('searchTypeChanged', {\n detail: this.searchType,\n }),\n );\n }\n\n /**\n * Emits a `facetPaneVisibilityChanged` event indicating that the facet pane has\n * been toggled open or closed.\n */\n private emitFacetPaneVisibilityChanged(): void {\n this.dispatchEvent(\n new CustomEvent<boolean>('facetPaneVisibilityChanged', {\n detail: this.facetPaneVisible,\n }),\n );\n }\n\n /**\n * Emits a `searchError` event indicating that the most recent search has encountered\n * an error from the backend.\n */\n emitSearchError(): void {\n this.dispatchEvent(\n new CustomEvent<string>('searchError', {\n detail: this.dataSource.queryErrorMessage,\n }),\n );\n }\n\n /**\n * Emits a `queryStateChanged` event indicating that one or more of this component's\n * properties have changed in a way that could affect the set of search results.\n */\n emitQueryStateChanged() {\n this.dispatchEvent(\n new CustomEvent<CollectionBrowserQueryState>('queryStateChanged', {\n detail: {\n baseQuery: this.baseQuery,\n withinCollection: this.withinCollection,\n withinProfile: this.withinProfile,\n profileElement: this.profileElement,\n searchType: this.searchType,\n selectedFacets: this.selectedFacets,\n internalFilters: this.internalFilters,\n minSelectedDate: this.minSelectedDate,\n maxSelectedDate: this.maxSelectedDate,\n selectedSort: this.selectedSort,\n sortDirection: this.sortDirection,\n selectedTitleFilter: this.selectedTitleFilter,\n selectedCreatorFilter: this.selectedCreatorFilter,\n },\n }),\n );\n }\n\n /**\n * Emits an `emptyResults` event indicating that we have received an empty result set\n * for the most recent query.\n */\n emitEmptyResults() {\n this.dispatchEvent(new Event('emptyResults'));\n }\n\n private disconnectResizeObserver(\n resizeObserver: SharedResizeObserverInterface,\n ) {\n resizeObserver.removeObserver({\n target: this.contentContainer,\n handler: this,\n });\n }\n\n private setupResizeObserver() {\n if (!this.resizeObserver || !this.contentContainer) return;\n this.resizeObserver.addObserver({\n target: this.contentContainer,\n handler: this,\n });\n }\n\n /**\n * When the visible cells change from the infinite scroller, we want to emit\n * which page is currently visible so the consumer can update its UI or the URL\n *\n * @param e\n * @returns\n */\n private visibleCellsChanged(\n e: CustomEvent<{ visibleCellIndices: number[] }>,\n ) {\n if (this.isScrollingToCell) return;\n const { visibleCellIndices } = e.detail;\n if (visibleCellIndices.length === 0) return;\n\n // For page determination, do not count more than a single page of visible cells,\n // since otherwise patrons using very tall screens will be treated as one page\n // further than they actually are.\n const lastIndexWithinCurrentPage =\n Math.min(this.pageSize, visibleCellIndices.length) - 1;\n const lastVisibleCellIndex = visibleCellIndices[lastIndexWithinCurrentPage];\n const lastVisibleCellPage =\n Math.floor(lastVisibleCellIndex / this.pageSize) + 1;\n if (this.currentPage !== lastVisibleCellPage) {\n this.currentPage = lastVisibleCellPage;\n }\n const event = new CustomEvent('visiblePageChanged', {\n detail: {\n pageNumber: lastVisibleCellPage,\n },\n });\n this.dispatchEvent(event);\n }\n\n // we only want to scroll on the very first query change\n // so this keeps track of whether we've already set the initial query\n private initialQueryChangeHappened = false;\n\n private historyPopOccurred = false;\n\n // this lets us store the query key so we know if it's actually changed or not\n private previousQueryKey?: string;\n\n /**\n * A Promise which, after each query change, resolves once the fetches for the initial\n * search have completed. Waits for *both* the hits and aggregations fetches to finish.\n *\n * Ensure you await this component's `updateComplete` promise before awaiting this\n * one, to ensure you do not await an obsolete promise from the previous update.\n */\n get initialSearchComplete(): Promise<boolean> {\n return this.dataSource.initialSearchComplete;\n }\n\n /**\n * Handler for whenever the component's properties change in a way that may require\n * fetching new results.\n */\n private async handleQueryChange() {\n // only reset if the query has actually changed\n if (\n !this.searchService ||\n this.dataSource.pageFetchQueryKey === this.previousQueryKey\n ) {\n return;\n }\n\n // If the new state prevents us from updating the search results, don't reset\n if (this.baseQuery && !this.dataSource.canPerformSearch) {\n return;\n }\n\n this.previousQueryKey = this.dataSource.pageFetchQueryKey;\n\n this.totalResults = undefined;\n this.pagesToRender =\n this.initialPageNumber === 1\n ? 2 // First two pages are batched into one request when starting from page 1\n : this.initialPageNumber;\n\n // Reset the infinite scroller's item count, so that it\n // shows tile placeholders until the new query's results load in\n if (this.infiniteScroller) {\n this.infiniteScroller.itemCount = this.estimatedTileCount;\n this.infiniteScroller.reload();\n }\n\n if (this.withinCollection && this.baseQuery?.trim()) {\n this.defaultSortField = SortField.relevance;\n this.defaultSortDirection = null;\n }\n\n if (!this.initialQueryChangeHappened && this.initialPageNumber > 1) {\n this.scrollToPage(this.initialPageNumber);\n }\n this.initialQueryChangeHappened = true;\n\n // if the query changed as part of a window.history pop event, we don't want to\n // persist the state because it overwrites the forward history\n if (!this.historyPopOccurred) {\n this.persistState();\n }\n this.historyPopOccurred = false;\n }\n\n private setupStateRestorationObserver() {\n if (!this.boundNavigationHandler) {\n this.boundNavigationHandler = this.historyNavigationHandler.bind(this);\n }\n // when the user navigates back, we want to update the UI to match the URL\n window.addEventListener('popstate', this.boundNavigationHandler);\n }\n\n private boundNavigationHandler?: () => void;\n\n private historyNavigationHandler() {\n this.historyPopOccurred = true;\n this.restoreState();\n }\n\n private restoreState() {\n const restorationState = this.restorationStateHandler.getRestorationState();\n this.displayMode = restorationState.displayMode;\n if (!this.suppressURLSinParam && restorationState.searchType != null)\n this.searchType = restorationState.searchType;\n this.selectedSort = restorationState.selectedSort ?? SortField.default;\n this.sortDirection = restorationState.sortDirection ?? null;\n this.selectedTitleFilter = restorationState.selectedTitleFilter ?? null;\n this.selectedCreatorFilter = restorationState.selectedCreatorFilter ?? null;\n this.selectedFacets = restorationState.selectedFacets;\n if (!this.suppressURLQuery) this.baseQuery = restorationState.baseQuery;\n this.currentPage = restorationState.currentPage ?? 1;\n this.minSelectedDate = restorationState.minSelectedDate;\n this.maxSelectedDate = restorationState.maxSelectedDate;\n if (this.currentPage > 1) {\n this.goToPage(this.currentPage);\n }\n }\n\n private persistState() {\n const isDefaultSort = this.selectedSort === this.defaultSortField;\n const restorationState: RestorationState = {\n displayMode: this.displayMode,\n searchType: this.suppressURLSinParam ? undefined : this.searchType,\n selectedSort: isDefaultSort ? SortField.default : this.selectedSort,\n sortDirection: this.sortDirection ?? undefined,\n selectedFacets: this.selectedFacets ?? getDefaultSelectedFacets(),\n baseQuery: this.suppressURLQuery ? undefined : this.baseQuery,\n currentPage: this.currentPage,\n titleQuery: this.titleQuery,\n creatorQuery: this.creatorQuery,\n minSelectedDate: this.minSelectedDate,\n maxSelectedDate: this.maxSelectedDate,\n selectedTitleFilter: this.selectedTitleFilter ?? undefined,\n selectedCreatorFilter: this.selectedCreatorFilter ?? undefined,\n };\n const persistOptions: RestorationStatePersistOptions = {\n forceReplace: this.dataSourceInstallInProgress,\n persistMetadataSearchType: this.isTVCollection,\n };\n this.restorationStateHandler.persistState(restorationState, persistOptions);\n }\n\n /**\n * Emits a `searchResultsLoadingChanged` event indicating that our loading state has\n * changed (either we have started loading new results, or we have finished loading them).\n */\n private emitSearchResultsLoadingChanged(): void {\n this.dispatchEvent(\n new CustomEvent<{ loading: boolean }>('searchResultsLoadingChanged', {\n detail: {\n loading: this.searchResultsLoading,\n },\n }),\n );\n }\n\n /**\n * Handler for when the set of selected facets changes.\n */\n facetsChanged(e: CustomEvent<SelectedFacets>) {\n this.selectedFacets = e.detail;\n }\n\n /**\n * Handler for when any facet is selected/unselected/hidden/unhidden.\n * Fires analytics indicating the type of facet event that took place.\n */\n facetClickHandler({\n detail: { facetType, bucket, negative },\n }: CustomEvent<FacetEventDetails>): void {\n let action: analyticsActions;\n if (negative) {\n action =\n bucket.state !== 'none'\n ? analyticsActions.facetNegativeSelected\n : analyticsActions.facetNegativeDeselected;\n } else {\n action =\n bucket.state !== 'none'\n ? analyticsActions.facetSelected\n : analyticsActions.facetDeselected;\n }\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action,\n label: facetType,\n });\n }\n\n private scrollToPage(pageNumber: number): Promise<void> {\n return new Promise(resolve => {\n const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);\n // without this setTimeout, Safari just pauses until the `fetchPage` is complete\n // then scrolls to the cell\n setTimeout(() => {\n this.isScrollingToCell = true;\n this.infiniteScroller?.scrollToCell(cellIndexToScrollTo, true);\n // This timeout is to give the scroll animation time to finish\n // then updating the infinite scroller once we're done scrolling\n // There's no scroll animation completion callback so we're\n // giving it 0.5s to finish.\n setTimeout(() => {\n this.isScrollingToCell = false;\n this.infiniteScroller?.refreshAllVisibleCells();\n resolve();\n }, 500);\n }, 0);\n });\n }\n\n /**\n * Whether sorting by relevance makes sense for the current state.\n * Currently equivalent to having a non-empty query.\n */\n private get isRelevanceSortAvailable(): boolean {\n return !!this.baseQuery?.trim();\n }\n\n /**\n * Sets the total number of tiles displayed in the infinite scroller.\n */\n setTileCount(count: number): void {\n if (this.infiniteScroller) {\n this.infiniteScroller.itemCount = count;\n }\n }\n\n /**\n * Applies the default sort options for the TV search results page\n */\n applyDefaultTVSearchSort(): void {\n this.defaultSortField = SortField.datearchived;\n this.defaultSortDirection = 'desc';\n }\n\n /**\n * Applies any default sort option for the current collection, by checking\n * for one in the collection's metadata. If none is found, defaults to sorting\n * descending by:\n * - Date Favorited for fav-* collections\n * - Weekly views for all other collections\n */\n applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void {\n if (this.baseQuery) {\n // If there's a query set, then we default to relevance sorting regardless of\n // the collection metadata-specified sort.\n this.defaultSortField = SortField.relevance;\n this.defaultSortDirection = null;\n return;\n }\n\n // Favorite collections sort on Date Favorited by default.\n // Other collections fall back to sorting on weekly views.\n const baseDefaultSort: string =\n collectionInfo?.public_metadata?.identifier?.startsWith('fav-')\n ? '-favoritedate'\n : '-week';\n\n // The collection metadata may override the default sorting with something else\n const metadataSort: string | undefined =\n collectionInfo?.public_metadata?.['sort-by'];\n\n // Prefer the metadata-specified sort if one exists\n const defaultSortToApply = metadataSort ?? baseDefaultSort;\n\n // Account for both -field and field:dir formats\n let [field, dir] = defaultSortToApply.split(':');\n if (field.startsWith('-')) {\n field = field.slice(1);\n dir = 'desc';\n } else if (!['asc', 'desc'].includes(dir)) {\n dir = 'asc';\n }\n\n const sortOption = sortOptionFromAPIString(field);\n const sortField = sortOption.field;\n if (sortField && sortField !== SortField.default) {\n this.defaultSortField = sortField;\n this.defaultSortDirection = dir as SortDirection;\n }\n }\n\n /**\n * Applies the default sort option for the current profile element\n */\n applyDefaultProfileSort(): void {\n if (this.profileElement) {\n const defaultSortField = defaultProfileElementSorts[this.profileElement];\n this.defaultSortField = defaultSortField ?? SortField.weeklyview;\n } else {\n this.defaultSortField = SortField.weeklyview;\n }\n\n this.defaultSortDirection = 'desc';\n }\n\n /**\n * This is useful for determining whether we need to reload the scroller.\n *\n * When the fetch completes, we need to reload the scroller if the cells for that\n * page are visible, but if the page is not currenlty visible, we don't need to reload\n */\n get currentVisiblePageNumbers(): number[] {\n const visibleCells = this.infiniteScroller?.getVisibleCellIndices() ?? [];\n const visiblePages = new Set<number>();\n visibleCells.forEach(cellIndex => {\n const visiblePage = Math.floor(cellIndex / this.pageSize) + 1;\n visiblePages.add(visiblePage);\n });\n return Array.from(visiblePages);\n }\n\n /**\n * Whether we are currently displaying results for a radio collection\n */\n private get isRadioCollection(): boolean {\n const { withinCollection } = this;\n const topCollections = ['radio'];\n const isTopCollection = topCollections.includes(withinCollection as string);\n const isSubCollection = topCollections.some(topCollxn =>\n this.dataSource.parentCollections?.includes(topCollxn),\n );\n return isTopCollection || isSubCollection;\n }\n\n /**\n * Refreshes all visible result cells in the infinite scroller.\n */\n refreshVisibleResults(): void {\n this.infiniteScroller?.refreshAllVisibleCells();\n }\n\n /**\n * Callback when a result is selected\n */\n resultSelected(event: CustomEvent<TileModel>): void {\n if (this.isManageView) {\n // Checked/unchecked state change -- rerender to ensure it propagates\n // this.mapDataSource(model => ({ ...model }));\n const cellIndex = this.dataSource.indexOf(event.detail);\n if (cellIndex >= 0) this.infiniteScroller?.refreshCell(cellIndex);\n\n this.requestUpdate();\n }\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.resultSelected,\n label: event.detail.mediatype,\n });\n\n this.analyticsHandler?.sendEvent({\n category: this.searchContext,\n action: analyticsActions.resultSelected,\n label: `page-${this.currentPage}`,\n });\n }\n\n cellForIndex(index: number): HTMLTemplateResult | undefined {\n const model = this.tileModelAtCellIndex(index);\n if (!model) return undefined;\n\n // Tiles show dates in UTC by default.\n // But for certain types of time-based media, we want them to use local time instead.\n // Those local-time cases are:\n // - TV or Radio search results\n // - TV or Radio collection results\n const isTVSearch = this.searchType === SearchType.TV;\n const isRadioSearch = this.searchType === SearchType.RADIO;\n const { isTVCollection, isRadioCollection } = this;\n const shouldUseLocalTime =\n isTVSearch || isRadioSearch || isTVCollection || isRadioCollection;\n\n return html`\n <tile-dispatcher\n .collectionPagePath=${this.collectionPagePath}\n .baseNavigationUrl=${this.baseNavigationUrl}\n .baseImageUrl=${this.baseImageUrl}\n .model=${model}\n .tileDisplayMode=${this.displayMode}\n .resizeObserver=${this.resizeObserver}\n .collectionTitles=${this.dataSource.collectionTitles}\n .sortParam=${this.sortParam}\n .defaultSortParam=${this.defaultSortParam}\n .creatorFilter=${this.selectedCreatorFilter}\n .mobileBreakpoint=${this.mobileBreakpoint}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.shouldSuppressTileBlurring}\n .isManageView=${this.isManageView}\n ?showTvClips=${isTVSearch || isTVCollection}\n ?enableHoverPane=${true}\n ?useLocalTime=${shouldUseLocalTime}\n @resultSelected=${(e: CustomEvent) => this.resultSelected(e)}\n >\n </tile-dispatcher>\n `;\n }\n\n /**\n * When the user scrolls near to the bottom of the page, fetch the next page\n * increase the number of pages to render and start fetching data for the new page\n */\n private scrollThresholdReached() {\n if (!this.dataSource.endOfDataReached && this.dataSource.queryInitialized) {\n this.pagesToRender += 1;\n this.dataSource.fetchPage(this.pagesToRender);\n }\n }\n\n /**\n * Fetches search results for privileged users when in manage view.\n *\n * This method:\n * 1. Checks if we're in search context and either haven't loaded results yet, or have already finished loading with > 100 total results\n * 2. Resets the datasource pagination state\n * 3. Fetches first page with limit based on maxPagesToManage threshold\n * 4. Reloads the infinite scroller to display new results\n */\n private fetchManageableSearchResults(): void {\n const hasNotLoadedInitialResults = !this.dataSource.totalResults;\n const hasLoadedWithMoreResultsAvailable =\n !this.searchResultsLoading && this.dataSource.totalResults > 100;\n\n if (\n this.pageContext === 'search' &&\n (hasNotLoadedInitialResults || hasLoadedWithMoreResultsAvailable)\n ) {\n this.dataSource.resetPages();\n this.dataSource.fetchPage(1, this.maxPagesToManage);\n this.infiniteScroller?.reload();\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n css`\n :host {\n display: block;\n --leftColumnWidth: 18rem;\n --leftColumnPaddingTop: 2rem;\n --leftColumnPaddingRight: 2.5rem;\n }\n\n #facet-top-view {\n display: flex;\n }\n\n /**\n * When page width resizes from desktop to mobile, use this class to\n * disable expand/collapse transition when loading.\n */\n .preload * {\n transition: none !important;\n -webkit-transition: none !important;\n -moz-transition: none !important;\n -ms-transition: none !important;\n -o-transition: none !important;\n }\n\n #content-container {\n display: flex;\n }\n\n empty-placeholder {\n margin-top: var(--placeholderMarginTop, 0);\n }\n\n .collapser-icon {\n display: inline-block;\n }\n\n .collapser-icon svg {\n display: inline-block;\n width: 12px;\n height: 12px;\n transition: transform 0.2s ease-out;\n }\n\n #mobile-filter-collapse {\n width: 100%;\n }\n\n #mobile-filter-collapse > summary {\n cursor: pointer;\n list-style: none;\n }\n\n #mobile-filter-collapse[open] > summary {\n margin-bottom: 10px;\n }\n\n #mobile-filter-collapse h2 {\n display: inline-block;\n margin: 0;\n font-size: 2rem;\n }\n\n #mobile-filter-collapse[open] svg {\n transform: rotate(90deg);\n }\n\n #content-container.mobile {\n display: block;\n }\n\n #right-column {\n flex: 1;\n position: relative;\n min-height: 90vh;\n border-right: 1px solid rgb(232, 232, 232);\n margin-top: var(--rightColumnMarginTop, 0);\n padding-top: var(--rightColumnPaddingTop, 2rem);\n background: #fff;\n }\n\n #left-column:not([hidden]) + #right-column {\n border-left: 1px solid rgb(232, 232, 232);\n }\n\n #right-column.smart-results-spacing {\n padding-top: 0.5rem;\n border-right: none;\n background: transparent;\n min-width: 0;\n }\n\n #results {\n background: #fff;\n padding-left: 1rem;\n padding-right: 1rem;\n }\n\n #right-column.smart-results-spacing #results {\n border-radius: 10px 10px 0px 0px;\n padding-top: 0.5rem;\n margin-top: 1rem;\n }\n\n .mobile #right-column {\n border-left: none;\n }\n\n .mobile #results {\n padding: 5px 5px 0;\n }\n\n #left-column {\n width: var(--leftColumnWidth, 18rem);\n /* Prevents Safari from shrinking col at first draw */\n min-width: var(--leftColumnWidth, 18rem);\n padding-top: var(--leftColumnPaddingTop, 2rem);\n /* Reduced padding by 0.2rem to add the invisible border in the rule below */\n padding-right: calc(var(--leftColumnPaddingRight, 2.5rem) - 0.2rem);\n border-right: 0.2rem solid transparent; /* Pads to the right of the scrollbar a bit */\n z-index: 1;\n }\n\n .desktop #left-column {\n top: 0;\n position: sticky;\n height: calc(100vh - 2rem);\n max-height: calc(100vh - 2rem);\n overflow-x: hidden;\n overflow-y: scroll;\n\n /*\n * Firefox doesn't support any of the -webkit-scrollbar stuff below, but\n * does at least give us a tiny bit of control over width & color.\n */\n scrollbar-width: thin;\n scrollbar-color: transparent transparent;\n }\n .desktop #left-column:hover {\n scrollbar-color: auto;\n }\n .desktop #left-column::-webkit-scrollbar {\n appearance: none;\n width: 6px;\n }\n .desktop #left-column::-webkit-scrollbar-button {\n height: 3px;\n background: transparent;\n }\n .desktop #left-column::-webkit-scrollbar-corner {\n background: transparent;\n }\n .desktop #left-column::-webkit-scrollbar-thumb {\n border-radius: 4px;\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.15);\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.2);\n }\n .desktop #left-column:hover::-webkit-scrollbar-thumb:active {\n background: rgba(0, 0, 0, 0.3);\n }\n\n #facets-bottom-fade {\n background: linear-gradient(\n to bottom,\n #fbfbfd00 0%,\n #fbfbfdc0 50%,\n #fbfbfd 80%,\n #fbfbfd 100%\n );\n position: fixed;\n bottom: 0;\n height: 50px;\n /* Wide enough to cover the content, but leave the scrollbar uncovered */\n width: calc(\n var(--leftColumnWidth) + var(--leftColumnPaddingRight) - 10px\n );\n z-index: 2;\n pointer-events: none;\n transition: height 0.1s ease;\n }\n #facets-bottom-fade.hidden {\n height: 0;\n }\n\n .facets-message {\n font-size: 1.4rem;\n }\n\n .desktop-facets-dropdown > summary {\n cursor: pointer;\n list-style: none;\n }\n\n .desktop-facets-dropdown h2 {\n display: inline-block;\n margin: 0;\n font-size: 1.6rem;\n }\n\n .desktop-facets-dropdown[open] > summary {\n margin-bottom: 10px;\n }\n\n .desktop-facets-dropdown[open] svg {\n transform: rotate(90deg);\n }\n\n .desktop #left-column-scroll-sentinel {\n width: 1px;\n height: 100vh;\n background: transparent;\n }\n\n .desktop #facets-scroll-sentinel {\n width: 1px;\n height: 1px;\n background: transparent;\n }\n\n #facets-header-container {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n clear: both;\n }\n\n .desktop #facets-header-container {\n flex-wrap: wrap;\n }\n\n .mobile #left-column {\n width: 100%;\n min-width: 0;\n padding: 5px 0;\n border: 0;\n }\n\n .clear-filters-btn-row {\n display: inline-block;\n }\n\n .desktop .clear-filters-btn-row {\n width: 100%;\n }\n\n .clear-filters-btn {\n display: inline-block;\n appearance: none;\n margin: 0;\n padding: 0;\n border: 0;\n background: none;\n color: var(--ia-theme-link-color);\n font-size: 1.4rem;\n font-family: inherit;\n cursor: pointer;\n }\n\n .clear-filters-btn:hover {\n text-decoration: underline;\n }\n\n .clear-filters-btn-separator {\n display: inline-block;\n margin-left: 5px;\n border-left: 1px solid #2c2c2c;\n font-size: 1.4rem;\n line-height: 1.3rem;\n }\n\n #tv-filters {\n margin-bottom: 15px;\n }\n\n #tv-shows {\n --comboBoxListWidth: 300px;\n }\n\n .tv-filter-dropdown {\n display: block;\n font-size: 14px;\n margin-left: 1px;\n margin-bottom: 5px;\n }\n\n .tv-filter-dropdown::part(combo-box) {\n outline-offset: 1px;\n }\n\n .tv-filter-dropdown::part(option) {\n line-height: 1.1;\n padding: 7px;\n }\n\n .tv-filter-dropdown::part(clear-button) {\n flex: 0 0 26px;\n --combo-box-clear-icon-size: 14px;\n }\n\n .tv-filter-dropdown::part(icon) {\n width: 1.4rem;\n height: 1.4rem;\n }\n\n #facets-container {\n position: relative;\n max-height: 0;\n transition: max-height 0.2s ease-in-out;\n z-index: 1;\n margin-top: var(--facetsContainerMarginTop, 3rem);\n padding-bottom: 2rem;\n }\n\n .desktop #facets-container {\n width: 18rem;\n }\n\n .mobile #facets-container {\n overflow: hidden;\n padding-bottom: 0;\n padding-left: 10px;\n padding-right: 10px;\n }\n\n #facets-container.expanded {\n max-height: 2000px;\n }\n\n .results-section-heading {\n margin: 0.5rem 0.3rem;\n font-size: 2rem;\n line-height: 25px;\n }\n\n #results-total {\n display: flex;\n align-items: baseline;\n }\n\n #results-total:not(.filtered) {\n padding-bottom: 2rem;\n }\n\n .mobile #results-total {\n position: absolute;\n right: 10px;\n }\n\n #big-results-count {\n font-size: 2.4rem;\n font-weight: 500;\n margin-right: 5px;\n }\n\n .mobile #big-results-count {\n font-size: 2rem;\n }\n\n #big-results-label {\n font-size: 1.4rem;\n font-weight: 200;\n }\n\n #list-header {\n max-height: 4.2rem;\n }\n\n .loading-cover {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n z-index: 1;\n padding-top: 50px;\n }\n\n #tile-blur-label {\n display: flex;\n align-items: center;\n column-gap: 5px;\n }\n\n #tile-blur-check {\n margin: 0 5px 0 0;\n width: 15px;\n }\n\n circular-activity-indicator {\n width: 30px;\n height: 30px;\n }\n\n sort-filter-bar {\n display: block;\n margin-bottom: 4rem;\n }\n\n infinite-scroller {\n display: block;\n --infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);\n --infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);\n }\n\n infinite-scroller.list-compact {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 100%\n );\n --infiniteScrollerCellMinHeight: 45px; /* override infinite scroller component */\n --infiniteScrollerCellMaxHeight: 56px;\n --infiniteScrollerRowGap: 10px;\n }\n\n infinite-scroller.list-detail {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 100%\n );\n --infiniteScrollerCellMinHeight: var(\n --collectionBrowserCellMinHeight,\n 5rem\n );\n /*\n 30px in spec, compensating for a -4px margin\n to align title with top of item image\n src/tiles/list/tile-list.ts\n */\n --infiniteScrollerRowGap: 34px;\n }\n\n .mobile infinite-scroller.list-detail {\n --infiniteScrollerRowGap: 24px;\n }\n\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 17rem\n );\n --infiniteScrollerCellMaxWidth: var(\n --collectionBrowserCellMaxWidth,\n 1fr\n );\n }\n\n /* Allow tiles to shrink a bit further at smaller viewport widths */\n @media screen and (max-width: 880px) {\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 15rem\n );\n }\n }\n /* At very small widths, maintain a 2-tile layout as far as it can reasonably go */\n @media screen and (max-width: 360px) {\n infinite-scroller.grid {\n --infiniteScrollerCellMinWidth: var(\n --collectionBrowserCellMinWidth,\n 12rem\n );\n }\n }\n\n infinite-scroller.hidden {\n display: none;\n }\n `,\n ];\n }\n}\n"]}
|
package/dist/src/models.js
CHANGED
|
@@ -334,7 +334,7 @@ export const defaultSortAvailability = {
|
|
|
334
334
|
[SortField.weeklyview]: true,
|
|
335
335
|
[SortField.alltimeview]: true,
|
|
336
336
|
[SortField.title]: true,
|
|
337
|
-
[SortField.datefavorited]:
|
|
337
|
+
[SortField.datefavorited]: false,
|
|
338
338
|
[SortField.date]: true,
|
|
339
339
|
[SortField.datearchived]: true,
|
|
340
340
|
[SortField.datereviewed]: true,
|
package/dist/src/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EACL,mBAAmB,GAKpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAe/D,MAAM,CAAC,MAAM,iBAAiB,GAAoC;IAChE,gBAAgB,EAAE,GAAG,CAAC,0BAA0B,CAAC;IACjD,iBAAiB,EAAE,GAAG,CAAC,8BAA8B,CAAC;CACvD,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAA4C;IACzE,gBAAgB,EAAE,iBAAiB;IACnC,iBAAiB,EAAE,cAAc;CAClC,CAAC;AAeF;;GAEG;AACH,MAAM,OAAO,SAAS;IA2FpB,YACE,MAAoB,EACpB,mBAAqC,SAAS;QAE9C,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEpC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,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4B;IAC5D,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,gBAAgB,EAAE,IAAI;IACtB,wBAAwB,EAAE,IAAI;IAC9B,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;CACd,CAAC","sourcesContent":["import type { TemplateResult } from 'lit';\nimport { msg } from '@lit/localize';\nimport type { MediaType } from '@internetarchive/field-parsers';\nimport {\n AggregationSortType,\n HitType,\n SearchReview,\n SearchResult,\n SortDirection,\n} from '@internetarchive/search-service';\nimport { collapseRepeatedQuotes } from './utils/collapse-repeated-quotes';\nimport { resolveMediatype } from './utils/resolve-mediatype';\n\nimport { loginRequiredIcon } from './assets/img/icons/login-required';\nimport { restrictedIcon } from './assets/img/icons/restricted';\n\n/**\n * Flags that can affect the visibility of content on a tile\n */\ninterface TileFlags {\n loginRequired: boolean;\n contentWarning: boolean;\n}\n\n/**\n * Different types of tile overlays, corresponding to the above flags.\n */\nexport type TileOverlayType = 'login-required' | 'content-warning';\n\nexport const TILE_OVERLAY_TEXT: Record<TileOverlayType, string> = {\n 'login-required': msg('Log in to view this item'),\n 'content-warning': msg('Content may be inappropriate'),\n};\n\nexport const TILE_OVERLAY_ICONS: Record<TileOverlayType, TemplateResult> = {\n 'login-required': loginRequiredIcon,\n 'content-warning': restrictedIcon,\n};\n\n/**\n * What type of request produced a given set of hits:\n * - `search_query`: Hits produced by an explicit user query and/or applied filters on any page\n * - `collection_members`: Hits produced for a collection page without any query or filters\n * - `profile_tab`: Hits produced for a tab of the profile page without any query or filters\n * - `unknown`: Hits produced via any other means\n */\nexport type HitRequestSource =\n | 'search_query'\n | 'collection_members'\n | 'profile_tab'\n | 'unknown';\n\n/**\n * Class for converting & storing raw search results in the correct format for UI tiles.\n */\nexport class TileModel {\n /** For TV hits. List of identifiers for any commercials contained. */\n adIds?: string[];\n\n averageRating?: number;\n\n /** For Web Archive hits on profile pages. List of capture dates for the current URL. */\n captureDates?: Date[];\n\n /** Whether this tile is currently checked for item management functions */\n checked: boolean;\n\n collectionIdentifier?: string;\n\n collectionName?: string;\n\n collectionFilesCount: number;\n\n collections: string[];\n\n collectionSize: number;\n\n commentCount: number;\n\n creator?: string;\n\n creators: string[];\n\n /** A string representation of the publication date, used strictly for passing preformatted dates to the parent */\n dateStr?: string;\n\n /** Date added to public search (software-defined) [from MD field: addeddate] */\n dateAdded?: Date;\n\n /** Date archived (software-defined) item created on archive.org [from MD field: publicdate] */\n dateArchived?: Date;\n\n /** Date work published in the world (user-defined) [from MD field: date] */\n datePublished?: Date;\n\n /** Date reviewed (user-created) most recent review [from MD field: reviewdate] */\n dateReviewed?: Date;\n\n description?: string;\n\n /** For TV hits. List of URLs for any fact-checks of the contained clips. */\n factChecks?: string[];\n\n favCount: number;\n\n hitRequestSource: HitRequestSource;\n\n hitType?: HitType;\n\n href?: string;\n\n identifier?: string;\n\n /** Whether this model represents a TV clip */\n isClip?: boolean;\n\n issue?: string;\n\n itemCount: number;\n\n mediatype: MediaType;\n\n review?: SearchReview;\n\n source?: string;\n\n snippets?: string[];\n\n subjects: string[];\n\n thumbnailUrl?: string;\n\n title: string;\n\n tvClipCount?: number;\n\n viewCount?: number;\n\n volume?: string;\n\n weeklyViewCount?: number;\n\n loginRequired: boolean;\n\n contentWarning: boolean;\n\n constructor(\n result: SearchResult,\n hitRequestSource: HitRequestSource = 'unknown',\n ) {\n const flags = this.getFlags(result);\n\n this.adIds = result.ad_id?.values;\n this.averageRating = result.avg_rating?.value;\n this.captureDates = result.capture_dates?.values;\n this.checked = false;\n this.collections = result.collection?.values ?? [];\n this.collectionFilesCount = result.collection_files_count?.value ?? 0;\n this.collectionSize = result.collection_size?.value ?? 0;\n this.commentCount = result.num_reviews?.value ?? 0;\n this.creator = result.creator?.value;\n this.creators = result.creator?.values ?? [];\n this.dateAdded = result.addeddate?.value;\n this.dateArchived = result.publicdate?.value;\n this.datePublished = result.date?.value;\n this.dateReviewed = result.reviewdate?.value;\n this.description = result.description?.values.join('\\n');\n this.factChecks = result.factcheck?.values;\n this.favCount = result.num_favorites?.value ?? 0;\n this.hitRequestSource = hitRequestSource;\n this.hitType = result.rawMetadata?.hit_type;\n this.href = collapseRepeatedQuotes(\n result.review?.__href__ ?? result.__href__?.value,\n );\n this.identifier = TileModel.cleanIdentifier(result.identifier);\n this.isClip = result.is_clip?.value;\n this.issue = result.issue?.value;\n this.itemCount = result.item_count?.value ?? 0;\n this.mediatype = resolveMediatype(result);\n this.review = result.review;\n this.snippets = result.highlight?.values ?? [];\n this.source = result.source?.value;\n this.subjects = result.subject?.values ?? [];\n this.thumbnailUrl = result.__img__?.value;\n this.title = result.title?.value ?? '';\n this.tvClipCount = result.num_clips?.value ?? 0;\n this.volume = result.volume?.value;\n this.viewCount = result.downloads?.value;\n this.weeklyViewCount = result.week?.value;\n this.loginRequired = flags.loginRequired;\n this.contentWarning = flags.contentWarning;\n }\n\n /**\n * Copies the contents of this TileModel onto a new instance\n */\n clone(): TileModel {\n const cloned = new TileModel({});\n cloned.adIds = this.adIds;\n cloned.averageRating = this.averageRating;\n cloned.captureDates = this.captureDates;\n cloned.checked = this.checked;\n cloned.collections = this.collections;\n cloned.collectionFilesCount = this.collectionFilesCount;\n cloned.collectionSize = this.collectionSize;\n cloned.commentCount = this.commentCount;\n cloned.creator = this.creator;\n cloned.creators = this.creators;\n cloned.dateStr = this.dateStr;\n cloned.dateAdded = this.dateAdded;\n cloned.dateArchived = this.dateArchived;\n cloned.datePublished = this.datePublished;\n cloned.dateReviewed = this.dateReviewed;\n cloned.description = this.description;\n cloned.factChecks = this.factChecks;\n cloned.favCount = this.favCount;\n cloned.hitRequestSource = this.hitRequestSource;\n cloned.hitType = this.hitType;\n cloned.href = this.href;\n cloned.identifier = this.identifier;\n cloned.isClip = this.isClip;\n cloned.issue = this.issue;\n cloned.itemCount = this.itemCount;\n cloned.mediatype = this.mediatype;\n cloned.snippets = this.snippets;\n cloned.source = this.source;\n cloned.subjects = this.subjects;\n cloned.thumbnailUrl = this.thumbnailUrl;\n cloned.title = this.title;\n cloned.tvClipCount = this.tvClipCount;\n cloned.volume = this.volume;\n cloned.viewCount = this.viewCount;\n cloned.weeklyViewCount = this.weeklyViewCount;\n cloned.loginRequired = this.loginRequired;\n cloned.contentWarning = this.contentWarning;\n return cloned;\n }\n\n /**\n * Whether this model represents the result of a TV search query.\n */\n get isTvSearchResult(): boolean {\n return (\n this.hitType === 'tv_clip' && this.hitRequestSource === 'search_query'\n );\n }\n\n /**\n * Determines the appropriate tile flags for the given search result\n * (login required and/or content warning)\n */\n private getFlags(result: SearchResult): TileFlags {\n const flags: TileFlags = {\n loginRequired: false,\n contentWarning: false,\n };\n\n // Check if item and item in \"modifying\" collection, setting above flags\n if (\n result.collection?.values.length &&\n result.mediatype?.value !== 'collection'\n ) {\n for (const collection of result.collection?.values ?? []) {\n if (collection === 'loggedin') {\n flags.loginRequired = true;\n if (flags.contentWarning) break;\n }\n if (collection === 'no-preview') {\n flags.contentWarning = true;\n if (flags.loginRequired) break;\n }\n }\n }\n\n return flags;\n }\n\n private static cleanIdentifier(\n identifier: string | undefined,\n ): string | undefined {\n // Some identifiers (e.g., from Whisper) represent documents rather than items, and\n // are suffixed with values that need to be stripped. Those values are separated\n // from the item identifier itself with '|'.\n const barIndex = identifier?.indexOf('|') ?? -1;\n const cleaned = barIndex > 0 ? identifier?.slice(0, barIndex) : identifier;\n return cleaned;\n }\n}\n\nexport type RequestKind = 'full' | 'hits' | 'aggregations';\n\nexport type CollectionDisplayMode = 'grid' | 'list-compact' | 'list-detail';\n\nexport type TileDisplayMode =\n | 'grid'\n | 'list-compact'\n | 'list-detail'\n | 'list-header';\n\n/**\n * This is mainly used to set the cookies for the collection display mode.\n *\n * It allows the user to set different modes for different contexts (collection page, search page, profile page etc).\n */\nexport type CollectionBrowserContext = 'collection' | 'search' | 'profile';\n\n/**\n * The sort fields shown in the sort filter bar\n */\nexport enum SortField {\n 'default' = 'default',\n 'unrecognized' = 'unrecognized',\n 'relevance' = 'relevance',\n 'alltimeview' = 'alltimeview',\n 'weeklyview' = 'weeklyview',\n 'title' = 'title',\n 'date' = 'date',\n 'datearchived' = 'datearchived',\n 'datereviewed' = 'datereviewed',\n 'dateadded' = 'dateadded',\n 'datefavorited' = 'datefavorited',\n 'creator' = 'creator',\n}\n\n/**\n * Views-related sort fields\n */\nexport const ALL_VIEWS_SORT_FIELDS = [\n SortField.weeklyview,\n SortField.alltimeview,\n] as const;\nexport type ViewsSortField = (typeof ALL_VIEWS_SORT_FIELDS)[number];\n\n/**\n * Date-related sort fields\n */\nexport const ALL_DATE_SORT_FIELDS = [\n SortField.datefavorited,\n SortField.date,\n SortField.datearchived,\n SortField.datereviewed,\n SortField.dateadded,\n] as const;\nexport type DateSortField = (typeof ALL_DATE_SORT_FIELDS)[number];\n\nexport interface SortOption {\n /**\n * The SortField enum member corresponding to this option.\n */\n field: SortField;\n\n /**\n * The default sort direction to apply when this sort option is first selected.\n */\n defaultSortDirection: SortDirection | null;\n\n /**\n * Whether this sort option allows its sort direction to be changed from the default.\n */\n canSetDirection: boolean;\n\n /**\n * Whether this sort option may appear in the sort bar.\n */\n shownInSortBar: boolean;\n\n /**\n * Whether this sort option should be saved to the URL.\n * If false, then no `sort` param will be added to the URL when this sort option\n * is selected.\n */\n shownInURL: boolean;\n\n /**\n * Whether this sort option is passed to the search service.\n * If false, then no sort param will be passed to the search service at all when\n * this sort option is selected.\n */\n handledBySearchService: boolean;\n\n /**\n * The string identifying this sort field to the search service & backend API.\n */\n searchServiceKey?: string;\n\n /**\n * The human-readable name to use for this option in the sort bar (if applicable).\n */\n displayName: string;\n\n /**\n * A list of URL param keys that should be mapped to this sort option.\n * E.g., both `title` and `titleSorter` in the URL map to the `SortField.title` option.\n */\n urlNames: (string | null | undefined)[];\n}\n\nexport const SORT_OPTIONS: Record<SortField, SortOption> = {\n // Default sort is the case where the user has not specified a sort option via the sort bar or URL.\n // In these cases, we defer to whatever sort the backend chooses.\n // For the search page, the default is always relevance sort.\n // For collection pages _without a query_, the default is usually weekly views, but this can be\n // overridden by the collection's `sort-by` metadata entry. If a query _is_ specified, then the\n // default is again relevance sort.\n // For fav-* collections only, the default is instead sorting by date favorited.\n [SortField.default]: {\n field: SortField.default,\n defaultSortDirection: null,\n canSetDirection: false,\n shownInSortBar: false,\n shownInURL: false,\n handledBySearchService: false, // We rely on the PPS default sort handling in these cases\n displayName: '',\n urlNames: ['', null, undefined], // Empty or nullish sort params result in default sorting\n },\n // Unrecognized sort is the case where the user has specified a sort in the URL, but it is not\n // one of the options listed in this map. We still want these unrecognized sorts to be applied\n // when searching, but they are not displayed in the sort bar and we do not actively manage\n // their URL param beyond flipping the direction as needed.\n [SortField.unrecognized]: {\n field: SortField.unrecognized,\n defaultSortDirection: null,\n canSetDirection: true,\n shownInSortBar: false,\n shownInURL: false,\n handledBySearchService: true, // The unrecognized sort param is passed along as-is\n displayName: '',\n urlNames: [],\n },\n // Relevance sort is unique in that it does not produce a URL param when it is set.\n // It is only available when there is a user-specified query that relevancy can be scored against.\n // Therefore, it does not appear as a sort bar option when browsing a collection with no query set.\n [SortField.relevance]: {\n field: SortField.relevance,\n defaultSortDirection: null,\n canSetDirection: false,\n shownInSortBar: true,\n shownInURL: false,\n handledBySearchService: false,\n displayName: 'Relevance',\n urlNames: ['_score'],\n },\n [SortField.alltimeview]: {\n field: SortField.alltimeview,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'downloads',\n displayName: 'All-time views',\n urlNames: ['downloads'],\n },\n [SortField.weeklyview]: {\n field: SortField.weeklyview,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'week',\n displayName: 'Weekly views',\n urlNames: ['week'],\n },\n [SortField.title]: {\n field: SortField.title,\n defaultSortDirection: 'asc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'titleSorter',\n displayName: 'Title',\n urlNames: ['title', 'titleSorter'],\n },\n [SortField.date]: {\n field: SortField.date,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'date',\n displayName: 'Date published',\n urlNames: ['date'],\n },\n [SortField.datearchived]: {\n field: SortField.datearchived,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'publicdate',\n displayName: 'Date archived',\n urlNames: ['publicdate'],\n },\n [SortField.datereviewed]: {\n field: SortField.datereviewed,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'reviewdate',\n displayName: 'Date reviewed',\n urlNames: ['reviewdate'],\n },\n [SortField.dateadded]: {\n field: SortField.dateadded,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'addeddate',\n displayName: 'Date added',\n urlNames: ['addeddate'],\n },\n [SortField.datefavorited]: {\n field: SortField.datefavorited,\n defaultSortDirection: 'desc',\n canSetDirection: false,\n shownInSortBar: true, // But only when viewing fav-* collections\n shownInURL: false,\n handledBySearchService: false,\n searchServiceKey: 'favoritedate',\n displayName: 'Date favorited',\n urlNames: ['favoritedate'],\n },\n [SortField.creator]: {\n field: SortField.creator,\n defaultSortDirection: 'asc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'creatorSorter',\n displayName: 'Creator',\n urlNames: ['creator', 'creatorSorter'],\n },\n};\n\n/**\n * Returns the SortOption corresponding to the given API sort name, or\n * the \"unrecognized\" SortOption if none matches.\n */\nexport function sortOptionFromAPIString(sortName?: string | null): SortOption {\n return (\n Object.values(SORT_OPTIONS).find(opt =>\n opt.urlNames.some(name => sortName === name),\n ) ?? SORT_OPTIONS[SortField.unrecognized]\n );\n}\n\nexport const defaultSortAvailability: Record<SortField, boolean> = {\n [SortField.relevance]: true,\n [SortField.weeklyview]: true,\n [SortField.alltimeview]: true,\n [SortField.title]: true,\n [SortField.datefavorited]: true,\n [SortField.date]: true,\n [SortField.datearchived]: true,\n [SortField.datereviewed]: true,\n [SortField.dateadded]: true,\n [SortField.creator]: true,\n [SortField.default]: false,\n [SortField.unrecognized]: false,\n};\n\nexport const favoritesSortAvailability: Record<SortField, boolean> = {\n ...defaultSortAvailability,\n [SortField.datefavorited]: true,\n};\n\nexport const tvSortAvailability: Record<SortField, boolean> = {\n ...defaultSortAvailability,\n [SortField.date]: false,\n [SortField.datereviewed]: false,\n [SortField.dateadded]: false,\n};\n\nexport const defaultProfileElementSorts: Record<\n string,\n Exclude<SortField, SortField.default>\n> = {\n uploads: SortField.datearchived,\n reviews: SortField.datereviewed,\n collections: SortField.datearchived,\n web_archives: SortField.datearchived,\n favorites: SortField.datefavorited,\n};\n\n/** A union of the fields that permit prefix filtering (e.g., alphabetical filtering) */\nexport type PrefixFilterType = 'title' | 'creator';\n\n/** A map from prefixes (e.g., initial letters) to the number of items matching that prefix */\nexport type PrefixFilterCounts = Record<string, number>;\n\n/**\n * A map from prefix filter types to the corresponding aggregation keys\n * that are needed to fetch the filter counts from the backend.\n */\nexport const prefixFilterAggregationKeys: Record<PrefixFilterType, string> = {\n title: 'firstTitle',\n creator: 'firstCreator',\n};\n\n/**\n * Different facet loading strategies that can be used with collection browser.\n * - `eager`: Facet data is always loaded as soon as a search is performed\n * - `lazy-mobile`: In the desktop layout, functions exactly as `eager`.\n * In the mobile layout, facet data will only be loaded once the \"Filters\" accordion is opened.\n * - `opt-in-or-login`: Same as `opt-in` for guest users not logged into an account, but same as `eager` for\n * any logged in user.\n * - `opt-in`: In the desktop layout, facet data will only be loaded after the user presses a \"Load Facets\" button.\n * In the mobile layout, functions exactly as `lazy-mobile`.\n * - `off`: Facet data will never be loaded, and a message will be displayed in place of facets\n * indicating that they are unavailable.\n */\nexport type FacetLoadStrategy =\n | 'eager'\n | 'lazy-mobile'\n | 'opt-in-or-login'\n | 'opt-in'\n | 'off';\n\n/**\n * Union of the facet types that are available in the sidebar.\n */\nexport type FacetOption =\n | 'subject'\n | 'lending'\n | 'mediatype'\n | 'language'\n | 'creator'\n | 'collection'\n | 'year'\n // TV-specific facet options:\n | 'clip_type'\n | 'program'\n | 'person'\n | 'sponsor';\n\nexport type SelectedFacetState = 'selected' | 'hidden';\n\nexport type FacetState = SelectedFacetState | 'none';\n\nexport interface FacetBucket {\n key: string;\n count: number;\n state: FacetState;\n // for some facets, we augment the key with a display value\n displayText?: string;\n // for TV channel facets, we add a parenthesized secondary name\n extraNote?: string;\n}\n\nexport interface FacetGroup {\n title: string;\n key: FacetOption;\n buckets: FacetBucket[];\n}\n\n/**\n * Information about a user interaction event on a facet.\n */\nexport type FacetEventDetails = {\n /**\n * The type of facet that was interacted with (e.g., 'mediatype', 'language', ...).\n */\n facetType: FacetOption;\n /**\n * The bucket corresponding to the facet that was interacted with, including the\n * updated state of the facet after the interaction.\n */\n bucket: FacetBucket;\n /**\n * Whether the interaction occurred on a negative facet.\n */\n negative: boolean;\n};\n\nexport type FacetValue = string;\n\nexport type SelectedFacets = Partial<\n Record<FacetOption, Record<FacetValue, FacetBucket>>\n>;\n\nexport const getDefaultSelectedFacets = (): Required<SelectedFacets> => ({\n subject: {},\n lending: {},\n mediatype: {},\n language: {},\n creator: {},\n collection: {},\n year: {},\n clip_type: {},\n program: {},\n person: {},\n sponsor: {},\n});\n\n/**\n * For TV search results, what types of TV clips to restrict the results to.\n */\nexport type TvClipFilterType = 'commercial' | 'fact check' | 'quote';\n\n/**\n * Map from allowed TV filtering parameters in the URL to their corresponding filter type\n */\nexport const tvClipURLParamsToFilters: Record<string, TvClipFilterType> = {\n only_commercials: 'commercial',\n only_factchecks: 'fact check',\n only_quotes: 'quote',\n};\n\n/**\n * Facet display order when presenting results for all search types *except* TV (see below).\n */\nexport const defaultFacetDisplayOrder: FacetOption[] = [\n 'mediatype',\n // 'lending', Commenting this out removes the lending facet from the sidebar for now\n 'year',\n 'subject',\n 'collection',\n 'creator',\n 'language',\n];\n\n/**\n * Specialized facet ordering when displaying TV search results\n */\nexport const tvFacetDisplayOrder: FacetOption[] = [\n 'program',\n 'creator',\n 'year',\n 'subject',\n 'person',\n 'language',\n 'clip_type',\n];\n\n/**\n * Human-readable titles for each facet group.\n */\nexport const facetTitles: Record<FacetOption, string> = {\n subject: 'Subject',\n lending: 'Availability',\n mediatype: 'Media Type',\n language: 'Language',\n creator: 'Creator',\n collection: 'Collection',\n year: 'Year',\n clip_type: 'Clip Type',\n program: 'Program',\n person: 'Person',\n sponsor: 'Sponsor',\n};\n\n/**\n * The default sort type to use for each facet type\n */\nexport const defaultFacetSort: Record<FacetOption, AggregationSortType> = {\n subject: AggregationSortType.COUNT,\n lending: AggregationSortType.COUNT,\n mediatype: AggregationSortType.COUNT,\n language: AggregationSortType.COUNT,\n creator: AggregationSortType.COUNT,\n collection: AggregationSortType.COUNT,\n year: AggregationSortType.NUMERIC, // Year facets are ordered by their numeric value by default\n clip_type: AggregationSortType.COUNT,\n program: AggregationSortType.COUNT,\n person: AggregationSortType.COUNT,\n sponsor: AggregationSortType.COUNT,\n};\n\n/**\n * The default sort type to use for each facet type in TV search More... dialogs only\n */\nexport const tvMoreFacetSort: Record<FacetOption, AggregationSortType> = {\n ...defaultFacetSort,\n creator: AggregationSortType.ALPHABETICAL,\n program: AggregationSortType.ALPHABETICAL,\n};\n\n/**\n * The sort type corresponding to facet bucket values, for each facet type\n * (i.e., the opposite of \"sort by count\" for that type).\n */\nexport const valueFacetSort: Record<FacetOption, AggregationSortType> = {\n subject: AggregationSortType.ALPHABETICAL,\n lending: AggregationSortType.ALPHABETICAL,\n mediatype: AggregationSortType.ALPHABETICAL,\n language: AggregationSortType.ALPHABETICAL,\n creator: AggregationSortType.ALPHABETICAL,\n collection: AggregationSortType.ALPHABETICAL,\n year: AggregationSortType.NUMERIC, // Year facets' values should be compared numerically, not lexicographically (year 2001 > year 3)\n clip_type: AggregationSortType.ALPHABETICAL,\n program: AggregationSortType.ALPHABETICAL,\n person: AggregationSortType.ALPHABETICAL,\n sponsor: AggregationSortType.ALPHABETICAL,\n};\n\nexport type LendingFacetKey =\n | 'is_lendable'\n | 'is_borrowable'\n | 'available_to_borrow'\n | 'is_browsable'\n | 'available_to_browse'\n | 'is_readable'\n | 'available_to_waitlist';\n\n/**\n * Maps valid lending keys to whether they should be visible in the facet sidebar\n */\nexport const lendingFacetKeysVisibility: Record<LendingFacetKey, boolean> = {\n is_lendable: true,\n is_borrowable: false,\n available_to_borrow: true,\n is_browsable: false,\n available_to_browse: false,\n is_readable: true,\n available_to_waitlist: false,\n};\n\n/**\n * Maps valid, visible lending keys to their facet sidebar display text\n */\nexport const lendingFacetDisplayNames: Partial<\n Record<LendingFacetKey, string>\n> = {\n is_lendable: 'Lending Library',\n available_to_borrow: 'Borrow 14 Days',\n is_readable: 'Always Available',\n};\n\n/**\n * A record of which admin-only collections should be suppressed from being displayed\n * as facets or in an item's list of collections.\n */\nexport const suppressedCollections: Record<string, boolean> = {\n deemphasize: true,\n community: true,\n stream_only: true,\n samples_only: true,\n test_collection: true,\n printdisabled: true,\n 'openlibrary-ol': true,\n nationalemergencylibrary: true,\n china: true,\n americana: true,\n toronto: true,\n};\n\n/**\n * A record of manageable item\n */\nexport interface ManageableItem {\n identifier: string;\n title?: string;\n dateStr?: string;\n date?: string;\n}\n\n/**\n * Possible states for whether & how the user has overridden their user preference\n * for blurring behavior on tiles with sensitive content.\n * - `no-override`: The user has not overridden their user preference, so simply\n * respect the preference as given.\n * - `on`: The user has overridden their preference and wants tile blurring enabled.\n * - `off`: The user has overridden their preference and wants tile blurring disabled.\n */\nexport type TileBlurOverride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B,CAAC,YAAY;IACzC,OAAO,EAAE,mBAAmB,CAAC,YAAY;IACzC,SAAS,EAAE,mBAAmB,CAAC,YAAY;IAC3C,QAAQ,EAAE,mBAAmB,CAAC,YAAY;IAC1C,OAAO,EAAE,mBAAmB,CAAC,YAAY;IACzC,UAAU,EAAE,mBAAmB,CAAC,YAAY;IAC5C,IAAI,EAAE,mBAAmB,CAAC,OAAO,EAAE,iGAAiG;IACpI,SAAS,EAAE,mBAAmB,CAAC,YAAY;IAC3C,OAAO,EAAE,mBAAmB,CAAC,YAAY;IACzC,MAAM,EAAE,mBAAmB,CAAC,YAAY;IACxC,OAAO,EAAE,mBAAmB,CAAC,YAAY;CAC1C,CAAC;AAWF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAqC;IAC1E,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,IAAI;IACzB,YAAY,EAAE,KAAK;IACnB,mBAAmB,EAAE,KAAK;IAC1B,WAAW,EAAE,IAAI;IACjB,qBAAqB,EAAE,KAAK;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAEjC;IACF,WAAW,EAAE,iBAAiB;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,WAAW,EAAE,kBAAkB;CAChC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA4B;IAC5D,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,gBAAgB,EAAE,IAAI;IACtB,wBAAwB,EAAE,IAAI;IAC9B,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,IAAI;IACf,OAAO,EAAE,IAAI;CACd,CAAC","sourcesContent":["import type { TemplateResult } from 'lit';\nimport { msg } from '@lit/localize';\nimport type { MediaType } from '@internetarchive/field-parsers';\nimport {\n AggregationSortType,\n HitType,\n SearchReview,\n SearchResult,\n SortDirection,\n} from '@internetarchive/search-service';\nimport { collapseRepeatedQuotes } from './utils/collapse-repeated-quotes';\nimport { resolveMediatype } from './utils/resolve-mediatype';\n\nimport { loginRequiredIcon } from './assets/img/icons/login-required';\nimport { restrictedIcon } from './assets/img/icons/restricted';\n\n/**\n * Flags that can affect the visibility of content on a tile\n */\ninterface TileFlags {\n loginRequired: boolean;\n contentWarning: boolean;\n}\n\n/**\n * Different types of tile overlays, corresponding to the above flags.\n */\nexport type TileOverlayType = 'login-required' | 'content-warning';\n\nexport const TILE_OVERLAY_TEXT: Record<TileOverlayType, string> = {\n 'login-required': msg('Log in to view this item'),\n 'content-warning': msg('Content may be inappropriate'),\n};\n\nexport const TILE_OVERLAY_ICONS: Record<TileOverlayType, TemplateResult> = {\n 'login-required': loginRequiredIcon,\n 'content-warning': restrictedIcon,\n};\n\n/**\n * What type of request produced a given set of hits:\n * - `search_query`: Hits produced by an explicit user query and/or applied filters on any page\n * - `collection_members`: Hits produced for a collection page without any query or filters\n * - `profile_tab`: Hits produced for a tab of the profile page without any query or filters\n * - `unknown`: Hits produced via any other means\n */\nexport type HitRequestSource =\n | 'search_query'\n | 'collection_members'\n | 'profile_tab'\n | 'unknown';\n\n/**\n * Class for converting & storing raw search results in the correct format for UI tiles.\n */\nexport class TileModel {\n /** For TV hits. List of identifiers for any commercials contained. */\n adIds?: string[];\n\n averageRating?: number;\n\n /** For Web Archive hits on profile pages. List of capture dates for the current URL. */\n captureDates?: Date[];\n\n /** Whether this tile is currently checked for item management functions */\n checked: boolean;\n\n collectionIdentifier?: string;\n\n collectionName?: string;\n\n collectionFilesCount: number;\n\n collections: string[];\n\n collectionSize: number;\n\n commentCount: number;\n\n creator?: string;\n\n creators: string[];\n\n /** A string representation of the publication date, used strictly for passing preformatted dates to the parent */\n dateStr?: string;\n\n /** Date added to public search (software-defined) [from MD field: addeddate] */\n dateAdded?: Date;\n\n /** Date archived (software-defined) item created on archive.org [from MD field: publicdate] */\n dateArchived?: Date;\n\n /** Date work published in the world (user-defined) [from MD field: date] */\n datePublished?: Date;\n\n /** Date reviewed (user-created) most recent review [from MD field: reviewdate] */\n dateReviewed?: Date;\n\n description?: string;\n\n /** For TV hits. List of URLs for any fact-checks of the contained clips. */\n factChecks?: string[];\n\n favCount: number;\n\n hitRequestSource: HitRequestSource;\n\n hitType?: HitType;\n\n href?: string;\n\n identifier?: string;\n\n /** Whether this model represents a TV clip */\n isClip?: boolean;\n\n issue?: string;\n\n itemCount: number;\n\n mediatype: MediaType;\n\n review?: SearchReview;\n\n source?: string;\n\n snippets?: string[];\n\n subjects: string[];\n\n thumbnailUrl?: string;\n\n title: string;\n\n tvClipCount?: number;\n\n viewCount?: number;\n\n volume?: string;\n\n weeklyViewCount?: number;\n\n loginRequired: boolean;\n\n contentWarning: boolean;\n\n constructor(\n result: SearchResult,\n hitRequestSource: HitRequestSource = 'unknown',\n ) {\n const flags = this.getFlags(result);\n\n this.adIds = result.ad_id?.values;\n this.averageRating = result.avg_rating?.value;\n this.captureDates = result.capture_dates?.values;\n this.checked = false;\n this.collections = result.collection?.values ?? [];\n this.collectionFilesCount = result.collection_files_count?.value ?? 0;\n this.collectionSize = result.collection_size?.value ?? 0;\n this.commentCount = result.num_reviews?.value ?? 0;\n this.creator = result.creator?.value;\n this.creators = result.creator?.values ?? [];\n this.dateAdded = result.addeddate?.value;\n this.dateArchived = result.publicdate?.value;\n this.datePublished = result.date?.value;\n this.dateReviewed = result.reviewdate?.value;\n this.description = result.description?.values.join('\\n');\n this.factChecks = result.factcheck?.values;\n this.favCount = result.num_favorites?.value ?? 0;\n this.hitRequestSource = hitRequestSource;\n this.hitType = result.rawMetadata?.hit_type;\n this.href = collapseRepeatedQuotes(\n result.review?.__href__ ?? result.__href__?.value,\n );\n this.identifier = TileModel.cleanIdentifier(result.identifier);\n this.isClip = result.is_clip?.value;\n this.issue = result.issue?.value;\n this.itemCount = result.item_count?.value ?? 0;\n this.mediatype = resolveMediatype(result);\n this.review = result.review;\n this.snippets = result.highlight?.values ?? [];\n this.source = result.source?.value;\n this.subjects = result.subject?.values ?? [];\n this.thumbnailUrl = result.__img__?.value;\n this.title = result.title?.value ?? '';\n this.tvClipCount = result.num_clips?.value ?? 0;\n this.volume = result.volume?.value;\n this.viewCount = result.downloads?.value;\n this.weeklyViewCount = result.week?.value;\n this.loginRequired = flags.loginRequired;\n this.contentWarning = flags.contentWarning;\n }\n\n /**\n * Copies the contents of this TileModel onto a new instance\n */\n clone(): TileModel {\n const cloned = new TileModel({});\n cloned.adIds = this.adIds;\n cloned.averageRating = this.averageRating;\n cloned.captureDates = this.captureDates;\n cloned.checked = this.checked;\n cloned.collections = this.collections;\n cloned.collectionFilesCount = this.collectionFilesCount;\n cloned.collectionSize = this.collectionSize;\n cloned.commentCount = this.commentCount;\n cloned.creator = this.creator;\n cloned.creators = this.creators;\n cloned.dateStr = this.dateStr;\n cloned.dateAdded = this.dateAdded;\n cloned.dateArchived = this.dateArchived;\n cloned.datePublished = this.datePublished;\n cloned.dateReviewed = this.dateReviewed;\n cloned.description = this.description;\n cloned.factChecks = this.factChecks;\n cloned.favCount = this.favCount;\n cloned.hitRequestSource = this.hitRequestSource;\n cloned.hitType = this.hitType;\n cloned.href = this.href;\n cloned.identifier = this.identifier;\n cloned.isClip = this.isClip;\n cloned.issue = this.issue;\n cloned.itemCount = this.itemCount;\n cloned.mediatype = this.mediatype;\n cloned.snippets = this.snippets;\n cloned.source = this.source;\n cloned.subjects = this.subjects;\n cloned.thumbnailUrl = this.thumbnailUrl;\n cloned.title = this.title;\n cloned.tvClipCount = this.tvClipCount;\n cloned.volume = this.volume;\n cloned.viewCount = this.viewCount;\n cloned.weeklyViewCount = this.weeklyViewCount;\n cloned.loginRequired = this.loginRequired;\n cloned.contentWarning = this.contentWarning;\n return cloned;\n }\n\n /**\n * Whether this model represents the result of a TV search query.\n */\n get isTvSearchResult(): boolean {\n return (\n this.hitType === 'tv_clip' && this.hitRequestSource === 'search_query'\n );\n }\n\n /**\n * Determines the appropriate tile flags for the given search result\n * (login required and/or content warning)\n */\n private getFlags(result: SearchResult): TileFlags {\n const flags: TileFlags = {\n loginRequired: false,\n contentWarning: false,\n };\n\n // Check if item and item in \"modifying\" collection, setting above flags\n if (\n result.collection?.values.length &&\n result.mediatype?.value !== 'collection'\n ) {\n for (const collection of result.collection?.values ?? []) {\n if (collection === 'loggedin') {\n flags.loginRequired = true;\n if (flags.contentWarning) break;\n }\n if (collection === 'no-preview') {\n flags.contentWarning = true;\n if (flags.loginRequired) break;\n }\n }\n }\n\n return flags;\n }\n\n private static cleanIdentifier(\n identifier: string | undefined,\n ): string | undefined {\n // Some identifiers (e.g., from Whisper) represent documents rather than items, and\n // are suffixed with values that need to be stripped. Those values are separated\n // from the item identifier itself with '|'.\n const barIndex = identifier?.indexOf('|') ?? -1;\n const cleaned = barIndex > 0 ? identifier?.slice(0, barIndex) : identifier;\n return cleaned;\n }\n}\n\nexport type RequestKind = 'full' | 'hits' | 'aggregations';\n\nexport type CollectionDisplayMode = 'grid' | 'list-compact' | 'list-detail';\n\nexport type TileDisplayMode =\n | 'grid'\n | 'list-compact'\n | 'list-detail'\n | 'list-header';\n\n/**\n * This is mainly used to set the cookies for the collection display mode.\n *\n * It allows the user to set different modes for different contexts (collection page, search page, profile page etc).\n */\nexport type CollectionBrowserContext = 'collection' | 'search' | 'profile';\n\n/**\n * The sort fields shown in the sort filter bar\n */\nexport enum SortField {\n 'default' = 'default',\n 'unrecognized' = 'unrecognized',\n 'relevance' = 'relevance',\n 'alltimeview' = 'alltimeview',\n 'weeklyview' = 'weeklyview',\n 'title' = 'title',\n 'date' = 'date',\n 'datearchived' = 'datearchived',\n 'datereviewed' = 'datereviewed',\n 'dateadded' = 'dateadded',\n 'datefavorited' = 'datefavorited',\n 'creator' = 'creator',\n}\n\n/**\n * Views-related sort fields\n */\nexport const ALL_VIEWS_SORT_FIELDS = [\n SortField.weeklyview,\n SortField.alltimeview,\n] as const;\nexport type ViewsSortField = (typeof ALL_VIEWS_SORT_FIELDS)[number];\n\n/**\n * Date-related sort fields\n */\nexport const ALL_DATE_SORT_FIELDS = [\n SortField.datefavorited,\n SortField.date,\n SortField.datearchived,\n SortField.datereviewed,\n SortField.dateadded,\n] as const;\nexport type DateSortField = (typeof ALL_DATE_SORT_FIELDS)[number];\n\nexport interface SortOption {\n /**\n * The SortField enum member corresponding to this option.\n */\n field: SortField;\n\n /**\n * The default sort direction to apply when this sort option is first selected.\n */\n defaultSortDirection: SortDirection | null;\n\n /**\n * Whether this sort option allows its sort direction to be changed from the default.\n */\n canSetDirection: boolean;\n\n /**\n * Whether this sort option may appear in the sort bar.\n */\n shownInSortBar: boolean;\n\n /**\n * Whether this sort option should be saved to the URL.\n * If false, then no `sort` param will be added to the URL when this sort option\n * is selected.\n */\n shownInURL: boolean;\n\n /**\n * Whether this sort option is passed to the search service.\n * If false, then no sort param will be passed to the search service at all when\n * this sort option is selected.\n */\n handledBySearchService: boolean;\n\n /**\n * The string identifying this sort field to the search service & backend API.\n */\n searchServiceKey?: string;\n\n /**\n * The human-readable name to use for this option in the sort bar (if applicable).\n */\n displayName: string;\n\n /**\n * A list of URL param keys that should be mapped to this sort option.\n * E.g., both `title` and `titleSorter` in the URL map to the `SortField.title` option.\n */\n urlNames: (string | null | undefined)[];\n}\n\nexport const SORT_OPTIONS: Record<SortField, SortOption> = {\n // Default sort is the case where the user has not specified a sort option via the sort bar or URL.\n // In these cases, we defer to whatever sort the backend chooses.\n // For the search page, the default is always relevance sort.\n // For collection pages _without a query_, the default is usually weekly views, but this can be\n // overridden by the collection's `sort-by` metadata entry. If a query _is_ specified, then the\n // default is again relevance sort.\n // For fav-* collections only, the default is instead sorting by date favorited.\n [SortField.default]: {\n field: SortField.default,\n defaultSortDirection: null,\n canSetDirection: false,\n shownInSortBar: false,\n shownInURL: false,\n handledBySearchService: false, // We rely on the PPS default sort handling in these cases\n displayName: '',\n urlNames: ['', null, undefined], // Empty or nullish sort params result in default sorting\n },\n // Unrecognized sort is the case where the user has specified a sort in the URL, but it is not\n // one of the options listed in this map. We still want these unrecognized sorts to be applied\n // when searching, but they are not displayed in the sort bar and we do not actively manage\n // their URL param beyond flipping the direction as needed.\n [SortField.unrecognized]: {\n field: SortField.unrecognized,\n defaultSortDirection: null,\n canSetDirection: true,\n shownInSortBar: false,\n shownInURL: false,\n handledBySearchService: true, // The unrecognized sort param is passed along as-is\n displayName: '',\n urlNames: [],\n },\n // Relevance sort is unique in that it does not produce a URL param when it is set.\n // It is only available when there is a user-specified query that relevancy can be scored against.\n // Therefore, it does not appear as a sort bar option when browsing a collection with no query set.\n [SortField.relevance]: {\n field: SortField.relevance,\n defaultSortDirection: null,\n canSetDirection: false,\n shownInSortBar: true,\n shownInURL: false,\n handledBySearchService: false,\n displayName: 'Relevance',\n urlNames: ['_score'],\n },\n [SortField.alltimeview]: {\n field: SortField.alltimeview,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'downloads',\n displayName: 'All-time views',\n urlNames: ['downloads'],\n },\n [SortField.weeklyview]: {\n field: SortField.weeklyview,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'week',\n displayName: 'Weekly views',\n urlNames: ['week'],\n },\n [SortField.title]: {\n field: SortField.title,\n defaultSortDirection: 'asc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'titleSorter',\n displayName: 'Title',\n urlNames: ['title', 'titleSorter'],\n },\n [SortField.date]: {\n field: SortField.date,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'date',\n displayName: 'Date published',\n urlNames: ['date'],\n },\n [SortField.datearchived]: {\n field: SortField.datearchived,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'publicdate',\n displayName: 'Date archived',\n urlNames: ['publicdate'],\n },\n [SortField.datereviewed]: {\n field: SortField.datereviewed,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'reviewdate',\n displayName: 'Date reviewed',\n urlNames: ['reviewdate'],\n },\n [SortField.dateadded]: {\n field: SortField.dateadded,\n defaultSortDirection: 'desc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'addeddate',\n displayName: 'Date added',\n urlNames: ['addeddate'],\n },\n [SortField.datefavorited]: {\n field: SortField.datefavorited,\n defaultSortDirection: 'desc',\n canSetDirection: false,\n shownInSortBar: true, // But only when viewing fav-* collections\n shownInURL: false,\n handledBySearchService: false,\n searchServiceKey: 'favoritedate',\n displayName: 'Date favorited',\n urlNames: ['favoritedate'],\n },\n [SortField.creator]: {\n field: SortField.creator,\n defaultSortDirection: 'asc',\n canSetDirection: true,\n shownInSortBar: true,\n shownInURL: true,\n handledBySearchService: true,\n searchServiceKey: 'creatorSorter',\n displayName: 'Creator',\n urlNames: ['creator', 'creatorSorter'],\n },\n};\n\n/**\n * Returns the SortOption corresponding to the given API sort name, or\n * the \"unrecognized\" SortOption if none matches.\n */\nexport function sortOptionFromAPIString(sortName?: string | null): SortOption {\n return (\n Object.values(SORT_OPTIONS).find(opt =>\n opt.urlNames.some(name => sortName === name),\n ) ?? SORT_OPTIONS[SortField.unrecognized]\n );\n}\n\nexport const defaultSortAvailability: Record<SortField, boolean> = {\n [SortField.relevance]: true,\n [SortField.weeklyview]: true,\n [SortField.alltimeview]: true,\n [SortField.title]: true,\n [SortField.datefavorited]: false,\n [SortField.date]: true,\n [SortField.datearchived]: true,\n [SortField.datereviewed]: true,\n [SortField.dateadded]: true,\n [SortField.creator]: true,\n [SortField.default]: false,\n [SortField.unrecognized]: false,\n};\n\nexport const favoritesSortAvailability: Record<SortField, boolean> = {\n ...defaultSortAvailability,\n [SortField.datefavorited]: true,\n};\n\nexport const tvSortAvailability: Record<SortField, boolean> = {\n ...defaultSortAvailability,\n [SortField.date]: false,\n [SortField.datereviewed]: false,\n [SortField.dateadded]: false,\n};\n\nexport const defaultProfileElementSorts: Record<\n string,\n Exclude<SortField, SortField.default>\n> = {\n uploads: SortField.datearchived,\n reviews: SortField.datereviewed,\n collections: SortField.datearchived,\n web_archives: SortField.datearchived,\n favorites: SortField.datefavorited,\n};\n\n/** A union of the fields that permit prefix filtering (e.g., alphabetical filtering) */\nexport type PrefixFilterType = 'title' | 'creator';\n\n/** A map from prefixes (e.g., initial letters) to the number of items matching that prefix */\nexport type PrefixFilterCounts = Record<string, number>;\n\n/**\n * A map from prefix filter types to the corresponding aggregation keys\n * that are needed to fetch the filter counts from the backend.\n */\nexport const prefixFilterAggregationKeys: Record<PrefixFilterType, string> = {\n title: 'firstTitle',\n creator: 'firstCreator',\n};\n\n/**\n * Different facet loading strategies that can be used with collection browser.\n * - `eager`: Facet data is always loaded as soon as a search is performed\n * - `lazy-mobile`: In the desktop layout, functions exactly as `eager`.\n * In the mobile layout, facet data will only be loaded once the \"Filters\" accordion is opened.\n * - `opt-in-or-login`: Same as `opt-in` for guest users not logged into an account, but same as `eager` for\n * any logged in user.\n * - `opt-in`: In the desktop layout, facet data will only be loaded after the user presses a \"Load Facets\" button.\n * In the mobile layout, functions exactly as `lazy-mobile`.\n * - `off`: Facet data will never be loaded, and a message will be displayed in place of facets\n * indicating that they are unavailable.\n */\nexport type FacetLoadStrategy =\n | 'eager'\n | 'lazy-mobile'\n | 'opt-in-or-login'\n | 'opt-in'\n | 'off';\n\n/**\n * Union of the facet types that are available in the sidebar.\n */\nexport type FacetOption =\n | 'subject'\n | 'lending'\n | 'mediatype'\n | 'language'\n | 'creator'\n | 'collection'\n | 'year'\n // TV-specific facet options:\n | 'clip_type'\n | 'program'\n | 'person'\n | 'sponsor';\n\nexport type SelectedFacetState = 'selected' | 'hidden';\n\nexport type FacetState = SelectedFacetState | 'none';\n\nexport interface FacetBucket {\n key: string;\n count: number;\n state: FacetState;\n // for some facets, we augment the key with a display value\n displayText?: string;\n // for TV channel facets, we add a parenthesized secondary name\n extraNote?: string;\n}\n\nexport interface FacetGroup {\n title: string;\n key: FacetOption;\n buckets: FacetBucket[];\n}\n\n/**\n * Information about a user interaction event on a facet.\n */\nexport type FacetEventDetails = {\n /**\n * The type of facet that was interacted with (e.g., 'mediatype', 'language', ...).\n */\n facetType: FacetOption;\n /**\n * The bucket corresponding to the facet that was interacted with, including the\n * updated state of the facet after the interaction.\n */\n bucket: FacetBucket;\n /**\n * Whether the interaction occurred on a negative facet.\n */\n negative: boolean;\n};\n\nexport type FacetValue = string;\n\nexport type SelectedFacets = Partial<\n Record<FacetOption, Record<FacetValue, FacetBucket>>\n>;\n\nexport const getDefaultSelectedFacets = (): Required<SelectedFacets> => ({\n subject: {},\n lending: {},\n mediatype: {},\n language: {},\n creator: {},\n collection: {},\n year: {},\n clip_type: {},\n program: {},\n person: {},\n sponsor: {},\n});\n\n/**\n * For TV search results, what types of TV clips to restrict the results to.\n */\nexport type TvClipFilterType = 'commercial' | 'fact check' | 'quote';\n\n/**\n * Map from allowed TV filtering parameters in the URL to their corresponding filter type\n */\nexport const tvClipURLParamsToFilters: Record<string, TvClipFilterType> = {\n only_commercials: 'commercial',\n only_factchecks: 'fact check',\n only_quotes: 'quote',\n};\n\n/**\n * Facet display order when presenting results for all search types *except* TV (see below).\n */\nexport const defaultFacetDisplayOrder: FacetOption[] = [\n 'mediatype',\n // 'lending', Commenting this out removes the lending facet from the sidebar for now\n 'year',\n 'subject',\n 'collection',\n 'creator',\n 'language',\n];\n\n/**\n * Specialized facet ordering when displaying TV search results\n */\nexport const tvFacetDisplayOrder: FacetOption[] = [\n 'program',\n 'creator',\n 'year',\n 'subject',\n 'person',\n 'language',\n 'clip_type',\n];\n\n/**\n * Human-readable titles for each facet group.\n */\nexport const facetTitles: Record<FacetOption, string> = {\n subject: 'Subject',\n lending: 'Availability',\n mediatype: 'Media Type',\n language: 'Language',\n creator: 'Creator',\n collection: 'Collection',\n year: 'Year',\n clip_type: 'Clip Type',\n program: 'Program',\n person: 'Person',\n sponsor: 'Sponsor',\n};\n\n/**\n * The default sort type to use for each facet type\n */\nexport const defaultFacetSort: Record<FacetOption, AggregationSortType> = {\n subject: AggregationSortType.COUNT,\n lending: AggregationSortType.COUNT,\n mediatype: AggregationSortType.COUNT,\n language: AggregationSortType.COUNT,\n creator: AggregationSortType.COUNT,\n collection: AggregationSortType.COUNT,\n year: AggregationSortType.NUMERIC, // Year facets are ordered by their numeric value by default\n clip_type: AggregationSortType.COUNT,\n program: AggregationSortType.COUNT,\n person: AggregationSortType.COUNT,\n sponsor: AggregationSortType.COUNT,\n};\n\n/**\n * The default sort type to use for each facet type in TV search More... dialogs only\n */\nexport const tvMoreFacetSort: Record<FacetOption, AggregationSortType> = {\n ...defaultFacetSort,\n creator: AggregationSortType.ALPHABETICAL,\n program: AggregationSortType.ALPHABETICAL,\n};\n\n/**\n * The sort type corresponding to facet bucket values, for each facet type\n * (i.e., the opposite of \"sort by count\" for that type).\n */\nexport const valueFacetSort: Record<FacetOption, AggregationSortType> = {\n subject: AggregationSortType.ALPHABETICAL,\n lending: AggregationSortType.ALPHABETICAL,\n mediatype: AggregationSortType.ALPHABETICAL,\n language: AggregationSortType.ALPHABETICAL,\n creator: AggregationSortType.ALPHABETICAL,\n collection: AggregationSortType.ALPHABETICAL,\n year: AggregationSortType.NUMERIC, // Year facets' values should be compared numerically, not lexicographically (year 2001 > year 3)\n clip_type: AggregationSortType.ALPHABETICAL,\n program: AggregationSortType.ALPHABETICAL,\n person: AggregationSortType.ALPHABETICAL,\n sponsor: AggregationSortType.ALPHABETICAL,\n};\n\nexport type LendingFacetKey =\n | 'is_lendable'\n | 'is_borrowable'\n | 'available_to_borrow'\n | 'is_browsable'\n | 'available_to_browse'\n | 'is_readable'\n | 'available_to_waitlist';\n\n/**\n * Maps valid lending keys to whether they should be visible in the facet sidebar\n */\nexport const lendingFacetKeysVisibility: Record<LendingFacetKey, boolean> = {\n is_lendable: true,\n is_borrowable: false,\n available_to_borrow: true,\n is_browsable: false,\n available_to_browse: false,\n is_readable: true,\n available_to_waitlist: false,\n};\n\n/**\n * Maps valid, visible lending keys to their facet sidebar display text\n */\nexport const lendingFacetDisplayNames: Partial<\n Record<LendingFacetKey, string>\n> = {\n is_lendable: 'Lending Library',\n available_to_borrow: 'Borrow 14 Days',\n is_readable: 'Always Available',\n};\n\n/**\n * A record of which admin-only collections should be suppressed from being displayed\n * as facets or in an item's list of collections.\n */\nexport const suppressedCollections: Record<string, boolean> = {\n deemphasize: true,\n community: true,\n stream_only: true,\n samples_only: true,\n test_collection: true,\n printdisabled: true,\n 'openlibrary-ol': true,\n nationalemergencylibrary: true,\n china: true,\n americana: true,\n toronto: true,\n};\n\n/**\n * A record of manageable item\n */\nexport interface ManageableItem {\n identifier: string;\n title?: string;\n dateStr?: string;\n date?: string;\n}\n\n/**\n * Possible states for whether & how the user has overridden their user preference\n * for blurring behavior on tiles with sensitive content.\n * - `no-override`: The user has not overridden their user preference, so simply\n * respect the preference as given.\n * - `on`: The user has overridden their preference and wants tile blurring enabled.\n * - `off`: The user has overridden their preference and wants tile blurring disabled.\n */\nexport type TileBlurOverrideState = 'no-override' | 'on' | 'off';\n"]}
|
package/package.json
CHANGED
|
@@ -860,9 +860,7 @@ export class CollectionBrowser
|
|
|
860
860
|
let sortFieldAvailability = defaultSortAvailability;
|
|
861
861
|
|
|
862
862
|
// We adjust the available sort options for a couple of special cases...
|
|
863
|
-
if (this.withinCollection?.startsWith('fav-')
|
|
864
|
-
|| (this.profileElement as string) === 'favorites'
|
|
865
|
-
) {
|
|
863
|
+
if (this.withinCollection?.startsWith('fav-') || this.profileElement === 'favorites') {
|
|
866
864
|
// When viewing a fav- collection or the favorites profile tab,
|
|
867
865
|
// we include the Date Favorited option as the default
|
|
868
866
|
sortFieldAvailability = favoritesSortAvailability;
|
package/src/models.ts
CHANGED
|
@@ -558,7 +558,7 @@ export const defaultSortAvailability: Record<SortField, boolean> = {
|
|
|
558
558
|
[SortField.weeklyview]: true,
|
|
559
559
|
[SortField.alltimeview]: true,
|
|
560
560
|
[SortField.title]: true,
|
|
561
|
-
[SortField.datefavorited]:
|
|
561
|
+
[SortField.datefavorited]: false,
|
|
562
562
|
[SortField.date]: true,
|
|
563
563
|
[SortField.datearchived]: true,
|
|
564
564
|
[SortField.datereviewed]: true,
|