/**
* Init css selectors by merging various settings
*/
const init = () => {
var mergedSelectors = Selector;
if (typeof boostPFSConfig != 'undefined' && boostPFSConfig.hasOwnProperty('selector') && boostPFSConfig.selector !== null) {
mergedSelectors = Utils.mergeObject(mergedSelectors, boostPFSConfig.selector);
}
if (typeof boostPFSFilterConfig != 'undefined' && boostPFSFilterConfig.hasOwnProperty('selector') && boostPFSFilterConfig.selector !== null) {
mergedSelectors = Utils.mergeObject(mergedSelectors, boostPFSFilterConfig.selector);
}
if (typeof boostPFSInstantSearchConfig != 'undefined' && boostPFSInstantSearchConfig.hasOwnProperty('selector') && boostPFSInstantSearchConfig.selector !== null) {
mergedSelectors = Utils.mergeObject(mergedSelectors, boostPFSInstantSearchConfig.selector);
}
Selector = mergedSelectors;
};
/**
* List of all css selectors in the app
*/
var Selector = {
// Filter
filterTree: '.boost-pfs-filter-tree',
filterTreeVertical: '.boost-pfs-filter-tree-v',
filterTreeHorizontal: '.boost-pfs-filter-tree-h',
filterTreeMobileButton: '.boost-pfs-filter-tree-mobile-button',
// Refine by
filterRefineByVertical: '.boost-pfs-filter-refine-by-wrapper-v',
filterRefineByHorizontal: '.boost-pfs-filter-refine-by-wrapper-h',
// Products
products: '.boost-pfs-filter-products',
// Collection
collections: '.boost-pfs-search-result-collections',
// Page
pages: '.boost-pfs-search-result-pages',
// Search
searchBoxMobile: '#boost-pfs-search-box-mobile',
searchTopPanels: '.boost-pfs-search-result-panel-controls',
searchCollectionPagination: '.boost-pfs-search-result-collection-pagination',
searchPagePagination: '.boost-pfs-search-result-page-pagination',
searchPanelsProductShow: '.boost-pfs-search-panel-product-show',
searchPanelsCollectionShow: '.boost-pfs-search-panel-collection-show',
searchPanelsPageShow: '.boost-pfs-search-panel-page-show',
searchTotalResult: '.boost-pfs-search-total-result',
// Toolbar & Pagination
topShowLimit: '.boost-pfs-filter-top-show-limit',
topSorting: '.boost-pfs-filter-top-sorting',
topDisplayType: '.boost-pfs-filter-top-display-type',
pagination: '.boost-pfs-filter-bottom-pagination,.boost-pfs-filter-top-pagination',
bottomPagination: '.boost-pfs-filter-bottom-pagination',
loadMore: '.boost-pfs-filter-load-more',
loadMoreButtonContainer: '.boost-pfs-filter-load-more-button-container',
btnLoadPreviousPageWrapperSelector: '.boost-pfs-filter-btn-load-previous-page-wrapper',
btnLoadPreviousPageSelector: '.boost-pfs-filter-btn-load-previous-page',
loadMoreLoading: '.boost-pfs-filter-load-more-loading',
topNotification: '.boost-pfs-filter-top-notification',
breadcrumb: '.boost-pfs-filter-breadcrumb',
// Others
scrollToTop: '.boost-pfs-filter-scroll-to-top',
// OTP
otpProductItem: '',
otpButtons: '',
otpTopCartLink: 'header a[href="/cart"]',
otpTopCartCount: '#CartCount',
otpTopCartSubtotal: '',
mostPopular: '.boost-pfs-most-popular',
recentlyViewed: '.boost-pfs-recently-viewed',
// Tracking:
trackingProduct: '.boost-pfs-filter-products > *',
trackingQuickView: '.boost-pfs-quickview-btn',
trackingAddToCart: 'form[action="/cart/add"] *[type="submit"]',
trackingBuyNow: '.shopify-payment-button, #dynamic-checkout-cart',
init: init
};
export default Selector;