"use strict"; (() => { var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]); if (__getOwnPropSymbols) for (var prop of __getOwnPropSymbols(b)) { if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]); } return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; // tae/utils.js var utils_exports = {}; __export(utils_exports, { addParamsLocale: () => addParamsLocale, checkCssAndRender: () => checkCssAndRender, checkExistFilterOptionParam: () => checkExistFilterOptionParam, convertValueRequestStockStatus: () => convertValueRequestStockStatus, detectDeviceByWidth: () => detectDeviceByWidth, formatPercentSaleLabel: () => formatPercentSaleLabel, generateUuid: () => generateUuid, getApi: () => getApi, getCurrentPage: () => getCurrentPage, getLocalStorage: () => getLocalStorage, getParamsHistory: () => getParamsHistory, getQueryParamByKey: () => getQueryParamByKey, getSortBy: () => getSortBy, inViewPortHandler: () => inViewPortHandler, initBlocks: () => initBlocks, isBadSearchTerm: () => isBadSearchTerm, isBadUrl: () => isBadUrl, isCartPage: () => isCartPage, isCollectionPage: () => isCollectionPage, isHomePage: () => isHomePage, isMobileWidth: () => isMobileWidth, isProductPage: () => isProductPage, isSearchPage: () => isSearchPage, isTabletPortraitMaxWidth: () => isTabletPortraitMaxWidth, lazyLoadImages: () => lazyLoadImages, mergeDeep: () => mergeDeep, removeLocalStorage: () => removeLocalStorage, roundToNearest50: () => roundToNearest50, saveRequestId: () => saveRequestId, setLocalStorage: () => setLocalStorage, updateValuesOptions: () => updateValuesOptions }); function generateUuid() { return "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/[x]/g, function(c) { var r = Math.random() * 16 | 0; return r.toString(16); }); } function mergeDeep(...objects) { const isObject = (obj) => obj && typeof obj === "object"; return objects.reduce((prev, obj) => { Object.keys(obj).forEach((key) => { const pVal = prev[key]; const oVal = obj[key]; if (Array.isArray(pVal) && Array.isArray(oVal)) { prev[key] = pVal.concat(...oVal); } else if (isObject(pVal) && isObject(oVal)) { prev[key] = mergeDeep(pVal, oVal); } else { prev[key] = oVal; } }); return prev; }, {}); } function formatPercentSaleLabel(to, from = 0) { let label = ""; if (!from) { label = `under ${to}%`; } else if (!to) { label = `above ${from}%`; } else { label = `${from}% - ${to}%`; } return label; } function updateValuesOptions(options) { if (!Array.isArray(options)) return options; return options.map((option) => { var _a; if (option.filterType === "percent_sale") { option.values = (_a = option.values) == null ? void 0 : _a.map((item) => { item.key = item.key.replace("*-", ":").replace("-*", ":").replace("-", ":"); item.label = formatPercentSaleLabel(item.to, item.from); return item; }); } return option; }); } function getQueryParamByKey(key) { const urlParams = new URLSearchParams(window.location.search); return urlParams.get(key); } function convertValueRequestStockStatus(v) { if (typeof v === "string") { if (v === "out-of-stock") return false; return true; } if (Array.isArray(v)) { return v.map((_v) => { if (_v === "out-of-stock") { return false; } return true; }); } } function isMobileWidth() { return window.innerWidth < 576; } function isTabletPortraitMaxWidth() { return window.innerWidth < 991; } function detectDeviceByWidth() { let result = ""; if (isMobileWidth()) { result += "mobile|"; } else { result = result.replace("mobile|", ""); } if (isTabletPortraitMaxWidth()) { result += "tablet_portrait_max"; } else { result = result.replace("tablet_portrait_max", ""); } return result; } function getParamsHistory() { const url = new URL(window.location); var isXSS = isBadUrl(url); if (isXSS) { console.log("bad url!!!!", isXSS); window.location.href = window.location.pathname; } else { const FILTER_HISTORY_PREFIX = "pf_"; const { searchParams } = url; const sort = searchParams.get("sort"); const page = searchParams.get("page"); const paramMap = {}; for (let key of searchParams.keys()) { if (key.startsWith(FILTER_HISTORY_PREFIX) && !paramMap[key]) { if (key === "pf_tag") { paramMap.tag = searchParams.getAll(key); delete paramMap.pf_tag; } else { paramMap[key] = searchParams.getAll(key); } } } return { paramMap, sort, page }; } } function getSortBy() { const { generalSettings: { collection_id = 0, page: tempPage, default_sort_by: defaultSortBy }, additionalElementSettings: { default_sort_order: defaultSortOrder = {}, customSortingList } } = window.boostWidgetIntegration.app["production"]; const page = tempPage || "collection"; const defaultSortingList = [ "relevance", "best-selling", "manual", "title-ascending", "title-descending", "price-ascending", "price-descending", "created-ascending", "created-descending" ]; const sortQueryKey = getQueryParamByKey("sort"); let sortingList = customSortingList ? customSortingList.split("|") : defaultSortingList; if (sortQueryKey && sortingList.includes(sortQueryKey)) return sortQueryKey; const searchPage = page === "search"; const collectionPage = page === "collection"; if (searchPage) sortingList.splice(sortingList.indexOf("manual"), 1); const { all, search } = defaultSortOrder; if (collectionPage) { if (collection_id in defaultSortOrder) { return defaultSortOrder[collection_id]; } else if (all) { return all; } else if (defaultSortBy) { return defaultSortBy; } } else if (searchPage) { return search || "relevance"; } } async function getApi(url, params, widgetDomId) { var _a, _b; const key = params.toString(); const hasFilterParams = key.includes("pf_"); const block = window.boostWidgetIntegration.blocks || {}; const newId = generateUuid(); window.boostWidgetIntegration.blocks[widgetDomId].latestFilterSearchRequest = newId; const { filterSettings: { sortingAvailableFirst, availableAfterFiltering, productAndVariantAvailable }, generalSettings: { collection_tags } } = window.boostWidgetIntegration.app["production"]; if ((collection_tags == null ? void 0 : collection_tags.length) > 0) { params.set("tag", collection_tags[0]); } params.set("t", Date.now()); params.set("sid", generateUuid()); const customParams = window.boostSdCustomParams; if (customParams && Object.keys(customParams).length > 0) { for (const key2 in customParams) { params.set(key2, customParams[key2]); } } if (sortingAvailableFirst) { params.set("sort_first", "available"); } if (!availableAfterFiltering && !productAndVariantAvailable) { params.set("product_available", false); params.set("variant_available", false); } else if (!availableAfterFiltering && productAndVariantAvailable) { params.set("product_available", true); params.set("variant_available", true); } else { params.set("product_available", hasFilterParams); params.set("variant_available", hasFilterParams); } const response = await fetch(`${url}?${params}`, { method: "GET" }); const HTTP_STATUS_NEED_FALLBACK = [404, 413, 403, 500]; if (HTTP_STATUS_NEED_FALLBACK.includes(response.status)) { enableProductFilterFallback(); } const resJson = await response.json(); const type = isSearchPage() ? "search" : "filter"; saveRequestId(type, (_a = resJson == null ? void 0 : resJson.meta) == null ? void 0 : _a.rid); const PRE_ACTION = "boostSdPreAction"; setLocalStorage(PRE_ACTION, type); let html = ""; if (resJson.html) { html = await resJson.html; block[widgetDomId].filterTree = resJson.filter; if (resJson.bundles) { block[widgetDomId].dynamicBundles = resJson.bundles; } resJson.filter.options = updateValuesOptions(resJson.filter.options); const timestamp = (/* @__PURE__ */ new Date()).getTime(); window.boostWidgetIntegration.blocks[widgetDomId].cache[key] = __spreadProps(__spreadValues({}, resJson), { timestamp }); const { filterLayout, filterTreeHorizontalStyle, filterTreeMobileStyle, filterTreeVerticalStyle } = ((_b = resJson.setting) == null ? void 0 : _b.filterSettings) || {}; if (filterLayout && filterTreeHorizontalStyle && filterTreeMobileStyle && filterTreeVerticalStyle) { console.log("Ensure Layout settings"); window.boostWidgetIntegration.blocks[widgetDomId].filterSettings = __spreadValues(__spreadValues({}, window.boostWidgetIntegration.blocks[widgetDomId].filterSettings), { filterLayout, filterTreeHorizontalStyle, filterTreeMobileStyle, filterTreeVerticalStyle }); } } else { html = await response.text(); } if (html && widgetDomId) { const widget = document.getElementById(widgetDomId); const app = window.boostWidgetIntegration.app["production"]; checkCssAndRender(app, widget, html); window.boostWidgetIntegration.blocks[widgetDomId].isLoadingHtml = false; } } function initBlocks(blocks, feature, app, templateSettings, sort, widgetId, defaultParams) { for (const block of blocks) { window.boostWidgetIntegration.blocks[block.id] = window.boostWidgetIntegration.blocks[block.id] || {}; const context = window.boostWidgetIntegration.blocks[block.id]; context.widgetInfo = {}; context.widgetInfo = templateSettings; context.templateSettings = templateSettings; context.app = app; context.id = block.id; context.document = block; context.cache = context.cache || {}; if (defaultParams) context.defaultParams = defaultParams; context.blockType = feature || "filter"; context.defaultSort = sort; context.widgetId = widgetId; if (feature === "recommendation") context.widgetId = block.id.replace("boost-sd-widget-", ""); } } var addParamsLocale = (params) => { var _a, _b, _c, _d, _e, _f, _g; if (parseFloat(`${(_b = (_a = window.Shopify) == null ? void 0 : _a.currency) == null ? void 0 : _b.rate}`) === 1) return params; return __spreadProps(__spreadValues({}, params), { currency_rate: (_d = (_c = window.Shopify) == null ? void 0 : _c.currency) == null ? void 0 : _d.rate, currency: (_f = (_e = window.Shopify) == null ? void 0 : _e.currency) == null ? void 0 : _f.active, country: (_g = window.Shopify) == null ? void 0 : _g.country, return_all_currency_fields: false }); }; var getLocalStorage = (key) => { try { const value = localStorage.getItem(key); if (value) return JSON.parse(value); return null; } catch (error) { return null; } }; var setLocalStorage = (key, value) => { try { localStorage.setItem(key, JSON.stringify(value)); } catch (error) { console.log("Error setLocalStorage", error); } }; var removeLocalStorage = (key) => { try { localStorage.removeItem(key); } catch (error) { console.log("Error setLocalStorage", error); } }; var PRE_REQUEST_IDS = "boostSdPreRequestIds"; function saveRequestId(type = "filter", request_id) { if (!request_id) return; const requestIds = getLocalStorage(PRE_REQUEST_IDS) || {}; requestIds[type] = request_id; setLocalStorage(PRE_REQUEST_IDS, requestIds); } function roundToNearest50(num) { const remainder = num % 50; if (remainder > 25) { return num + (50 - remainder); } else { return num - remainder; } } function checkCssAndRender(app, dom, html) { if (!dom) return; if (app.themeCssLoaded && app.settingsCSSLoaded) { dom.innerHTML = html; window.boostWidgetIntegration.status = "ready"; lazyLoadImages(dom); return; } let tempElement; const interval = setInterval(() => { if (app.themeCssLoaded && app.settingsCSSLoaded) { console.log("css loaded"); if (tempElement) { document.body.removeChild(tempElement); } dom.innerHTML = html; window.boostWidgetIntegration.status = "ready"; lazyLoadImages(dom); clearInterval(interval); } else { if (tempElement) return; tempElement = document.createElement("div"); tempElement.style.display = "none"; tempElement.innerHTML = html; document.body.appendChild(tempElement); const hasProductList = !!tempElement.querySelector(".boost-sd__product-list"); if (hasProductList && isMobileWidth()) { const productImages = Array.from( tempElement.querySelectorAll(".boost-sd__product-image img") ).slice(0, 6); productImages.forEach((elm) => { if (elm.src) { const img = new Image(); img.src = elm.src; } }); } } }, 50); } function lazyLoadImages(dom) { if (!dom) return; const lazyImages = dom.querySelectorAll("img[loading='lazy']"); lazyImages.forEach(function(img) { inViewPortHandler([img.parentElement], (element) => { const img2 = element.querySelector("img[loading='lazy']"); if (img2) { img2.removeAttribute("loading"); } }); }); } function inViewPortHandler(elements, callback) { var observer = new IntersectionObserver(function intersectionObserverCallback(entries, observer2) { entries.forEach(function(entry) { if (entry.isIntersecting) { callback(entry.target); observer2.unobserve(entry.target); } }); }); elements.forEach(function(element) { observer.observe(element); }); } var isBadUrl = (url) => { try { if (!url) { url = getWindowLocation().search; } var urlParams = decodeURIComponent(url).split("&"); var isXSSUrl = false; if (urlParams.length > 0) { for (var i = 0; i < urlParams.length; i++) { var param = urlParams[i]; isXSSUrl = isBadSearchTerm(param); if (isXSSUrl) break; } } return isXSSUrl; } catch (e) { return true; } }; var getWindowLocation = () => { var href = window.location.href; var escapedHref = href.replace(/%3C/g, "<").replace(/%3E/g, ">"); var rebuildHrefArr = []; for (var i = 0; i < escapedHref.length; i++) { rebuildHrefArr.push(escapedHref.charAt(i)); } var rebuildHref = rebuildHrefArr.join("").split("<").join("%3C").split(">").join("%3E"); var rebuildSearch = ""; var hrefWithoutHash = rebuildHref.replace(/#.*$/, ""); if (hrefWithoutHash.split("?").length > 1) { rebuildSearch = hrefWithoutHash.split("?")[1]; if (rebuildSearch.length > 0) { rebuildSearch = "?" + rebuildSearch; } } return { pathname: window.location.pathname, href: rebuildHref, search: rebuildSearch }; }; var isBadSearchTerm = (term) => { if (typeof term == "string") { term = term.toLowerCase(); var domEvents = [ "img src", "script", "alert", "onabort", "popstate", "afterprint", "beforeprint", "beforeunload", "blur", "canplay", "canplaythrough", "change", "click", "contextmenu", "copy", "cut", "dblclick", "drag", "dragend", "dragenter", "dragleave", "dragover", "dragstart", "drop", "durationchange", "ended", "error", "focus", "focusin", "focusout", "fullscreenchange", "fullscreenerror", "hashchange", "input", "invalid", "keydown", "keypress", "keyup", "load", "loadeddata", "loadedmetadata", "loadstart", "mousedown", "mouseenter", "mouseleave", "mousemove", "mouseover", "mouseout", "mouseout", "mouseup", "offline", "online", "pagehide", "pageshow", "paste", "pause", "play", "playing", "progress", "ratechange", "resize", "reset", "scroll", "search", "seeked", "seeking", "select", "show", "stalled", "submit", "suspend", "timeupdate", "toggle", "touchcancel", "touchend", "touchmove", "touchstart", "unload", "volumechange", "waiting", "wheel" ]; var potentialEventRegex = new RegExp(domEvents.join("=|on")); var countOpenTag = (term.match(//g) || []).length; var isAlert = (term.match(/alert\(/g) || []).length; var isConsoleLog = (term.match(/console\.log\(/g) || []).length; var isExecCommand = (term.match(/execCommand/g) || []).length; var isCookie = (term.match(/document\.cookie/g) || []).length; var isJavascript = (term.match(/j.*a.*v.*a.*s.*c.*r.*i.*p.*t/g) || []).length; var isPotentialEvent = potentialEventRegex.test(term); if (countOpenTag > 0 && countCloseTag > 0 || countOpenTag > 1 || countCloseTag > 1 || isAlert || isConsoleLog || isExecCommand || isCookie || isJavascript || isPotentialEvent) { return true; } } return false; }; var isCollectionPage = () => { var _a, _b, _c, _d; return ((_d = (_c = (_b = (_a = window.boostWidgetIntegration) == null ? void 0 : _a.app) == null ? void 0 : _b["production"]) == null ? void 0 : _c.generalSettings) == null ? void 0 : _d.page) === "collection"; }; var isSearchPage = () => { var _a, _b, _c, _d; return ((_d = (_c = (_b = (_a = window.boostWidgetIntegration) == null ? void 0 : _a.app) == null ? void 0 : _b["production"]) == null ? void 0 : _c.generalSettings) == null ? void 0 : _d.page) === "search"; }; var isCartPage = () => { var _a, _b, _c, _d; return ((_d = (_c = (_b = (_a = window.boostWidgetIntegration) == null ? void 0 : _a.app) == null ? void 0 : _b["production"]) == null ? void 0 : _c.generalSettings) == null ? void 0 : _d.page) === "cart"; }; var isProductPage = () => { var _a, _b, _c, _d; return ((_d = (_c = (_b = (_a = window.boostWidgetIntegration) == null ? void 0 : _a.app) == null ? void 0 : _b["production"]) == null ? void 0 : _c.generalSettings) == null ? void 0 : _d.page) === "product"; }; var isHomePage = () => { var _a, _b, _c, _d; return ((_d = (_c = (_b = (_a = window.boostWidgetIntegration) == null ? void 0 : _a.app) == null ? void 0 : _b["production"]) == null ? void 0 : _c.generalSettings) == null ? void 0 : _d.page) === "index"; }; var getCurrentPage = () => { let currentPage = ""; switch (true) { case isCollectionPage(): currentPage = "collection_page"; break; case isSearchPage(): currentPage = "search_page"; break; case isProductPage(): currentPage = "product_page"; break; case isCartPage(): currentPage = "cart_page"; break; case isHomePage(): currentPage = "home_page"; break; default: break; } return currentPage; }; var checkExistFilterOptionParam = () => { const queryParams = new URLSearchParams(window.location.search); for (const [key, value] of queryParams.entries()) { if (key.indexOf("pf_") > -1) { return true; } } return false; }; var enableProductFilterFallback = () => { const cdn = "https://boost-cdn-prod.bc-solutions.net"; const script = document.createElement("script"); script.src = `${cdn}/fallback-theme/1.0.12/boost-sd-fallback-theme.js`; script.defer = true; script.onload = () => { const enableEvent = new CustomEvent("boost-sd-enable-product-filter-fallback"); window.dispatchEvent(enableEvent); console.log("dispatch event"); }; document.body.appendChild(script); }; // tae/settings.js function initSettings() { window.boostWidgetIntegration = window.boostWidgetIntegration || {}; window.boostWidgetIntegration.app = window.boostWidgetIntegration.app || {}; window.boostWidgetIntegration.blocks = window.boostWidgetIntegration.blocks || {}; window.boostWidgetIntegration.app["production"] = window.boostWidgetIntegration.app["production"] || {}; const combinedAppSettings = mergeDeep( __spreadValues(__spreadProps(__spreadValues({ filterUrl: "https://services.mybcapps.com/bc-sf-filter/filter", searchUrl: "https://services.mybcapps.com/bc-sf-filter/search", productUrl: "https://services.mybcapps.com/bc-sf-filter/products", cdn: "https://cdn.boostcommerce.io", taeSettings: { instantSearch: null }, shop: { name: "George Richards", url: "https://www.georgerichardsbigandtall.ca", domain: "georgerichards-storefront.myshopify.com", currency: "CAD", money_format: "\u0026#36;{{amount}}", money_format_with_currency: "\u0026#36;{{amount}} CAD" } }, { } ), { filterSettings: Object.assign(__spreadValues({ swatch_extension: "png" }, { swatch_settings: {"aqua":{"name":"aqua","type":"one_color","colorCodes":["#00FFFF"],"imageUrl":""},"beige":{"name":"beige","type":"one_color","colorCodes":["#F5F5DC"],"imageUrl":""},"berry":{"name":"berry","type":"one_color","colorCodes":["#B13684"],"imageUrl":""},"black":{"name":"black","type":"one_color","colorCodes":["#000000"],"imageUrl":""},"blue":{"name":"blue","type":"one_color","colorCodes":["#0000FF"],"imageUrl":""},"bronze":{"name":"bronze","type":"one_color","colorCodes":["#BF9659"],"imageUrl":""},"brown":{"name":"brown","type":"one_color","colorCodes":["#6C5656"],"imageUrl":""},"burgundy":{"name":"burgundy","type":"one_color","colorCodes":["#803939"],"imageUrl":""},"camel":{"name":"camel","type":"one_color","colorCodes":["#F2E5BF"],"imageUrl":""},"charcoal":{"name":"charcoal","type":"one_color","colorCodes":["#4B4B4B"],"imageUrl":""},"cobalt":{"name":"cobalt","type":"one_color","colorCodes":["#3D59AB"],"imageUrl":""},"coral":{"name":"coral","type":"one_color","colorCodes":["#FF7F50"],"imageUrl":""},"cream":{"name":"cream","type":"one_color","colorCodes":["#FBFBEB"],"imageUrl":""},"dark blue":{"name":"dark blue","type":"one_color","colorCodes":["#1A2CB0"],"imageUrl":""},"dark brown":{"name":"dark brown","type":"one_color","colorCodes":["#6A5050"],"imageUrl":""},"dark navy":{"name":"dark navy","type":"one_color","colorCodes":["#244277"],"imageUrl":""},"dark taupe":{"name":"dark taupe","type":"one_color","colorCodes":["#6A6363"],"imageUrl":""},"denim":{"name":"denim","type":"one_color","colorCodes":["#90B4C4"],"imageUrl":""},"green":{"name":"green","type":"one_color","colorCodes":["#008000"],"imageUrl":""},"grey":{"name":"grey","type":"one_color","colorCodes":["#CFCFCF"],"imageUrl":""},"honey":{"name":"honey","type":"one_color","colorCodes":["#F7DFA8"],"imageUrl":""},"indigo":{"name":"indigo","type":"one_color","colorCodes":["#4B0082"],"imageUrl":""},"ivory":{"name":"ivory","type":"one_color","colorCodes":["#FFFFF0"],"imageUrl":""},"khaki":{"name":"khaki","type":"one_color","colorCodes":["#F0E68C"],"imageUrl":""},"lavender":{"name":"lavender","type":"one_color","colorCodes":["#E6E6FA"],"imageUrl":""},"light brown":{"name":"light brown","type":"one_color","colorCodes":["#BA9C92"],"imageUrl":""},"light grey":{"name":"light grey","type":"one_color","colorCodes":["#E1E1E1"],"imageUrl":""},"lilac":{"name":"lilac","type":"one_color","colorCodes":["#D3AEEA"],"imageUrl":""},"mauve":{"name":"mauve","type":"one_color","colorCodes":["#E9D0E0"],"imageUrl":""},"multi":{"name":"multi","type":"two_colors","colorCodes":["#9E279F","#000000"],"imageUrl":""},"navy":{"name":"navy","type":"one_color","colorCodes":["#000080"],"imageUrl":""},"neutral":{"name":"neutral","type":"one_color","colorCodes":["#FFFFFF"],"imageUrl":""},"olive":{"name":"olive","type":"one_color","colorCodes":["#808000"],"imageUrl":""},"orange":{"name":"orange","type":"one_color","colorCodes":["#FF8000"],"imageUrl":""},"pink":{"name":"pink","type":"one_color","colorCodes":["#FFC0CB"],"imageUrl":""},"purple":{"name":"purple","type":"one_color","colorCodes":["#800080"],"imageUrl":""},"red":{"name":"red","type":"one_color","colorCodes":["#FF0000"],"imageUrl":""},"royal blue":{"name":"royal blue","type":"one_color","colorCodes":["#2845A1"],"imageUrl":""},"rust":{"name":"rust","type":"one_color","colorCodes":["#A56619"],"imageUrl":""},"sand":{"name":"sand","type":"one_color","colorCodes":["#E3CEB4"],"imageUrl":""},"silver":{"name":"silver","type":"one_color","colorCodes":["#C0C0C0"],"imageUrl":""},"steel blue":{"name":"steel blue","type":"one_color","colorCodes":["#617893"],"imageUrl":""},"tan":{"name":"tan","type":"one_color","colorCodes":["#D2B48C"],"imageUrl":""},"taupe":{"name":"taupe","type":"one_color","colorCodes":["#BEAD8F"],"imageUrl":""},"teal":{"name":"teal","type":"one_color","colorCodes":["#008080"],"imageUrl":""},"tobacco":{"name":"tobacco","type":"one_color","colorCodes":["#7C5429"],"imageUrl":""},"turquoise":{"name":"turquoise","type":"one_color","colorCodes":["#40E0D0"],"imageUrl":""},"white":{"name":"white","type":"one_color","colorCodes":["#FFFFFF"],"imageUrl":""},"wine":{"name":"wine","type":"one_color","colorCodes":["#86123D"],"imageUrl":""},"yellow":{"name":"yellow","type":"one_color","colorCodes":["#FFFF00"],"imageUrl":""}}, }), {"showFilterOptionCount":false,"showRefineBy":false,"showOutOfStockOption":false,"showSingleOption":true,"keepToggleState":true,"changeMobileButtonLabel":false,"sortingAvailableFirst":true,"showLoading":false,"activeScrollToTop":false,"showVariantImageBasedOnSelectedFilter":"pf_opt_color","productAndVariantAvailable":false,"availableAfterFiltering":true,"isShortenUrlParam":false,"filterTreeMobileStyle":"style2","filterTreeVerticalStyle":"style-default","filterTreeHorizontalStyle":"style1","stickyFilterOnDesktop":false,"stickyFilterOnMobile":false,"style":{"filterTitleTextColor":"","filterTitleFontSize":"","filterTitleFontWeight":"","filterTitleFontTransform":"","filterTitleFontFamily":"","filterOptionTextColor":"","filterOptionFontSize":"","filterOptionFontFamily":"","filterMobileButtonTextColor":"","filterMobileButtonFontSize":"","filterMobileButtonFontWeight":"","filterMobileButtonFontTransform":"","filterMobileButtonFontFamily":"","filterMobileButtonBackgroundColor":""}}), searchSettings: {"searchPanelBlocks":{"searchTermSuggestions":{"label":"Popular searches","type":"based_on_data","active":false,"backup":[],"searchTermList":["shoes","shorts","vest","suit","belt","projek raw","underwear","suits","golf shirt","callaway"]},"mostPopularProducts":{"label":"Trending products","type":"based_on_data","active":false,"backup":[],"productList":["bw-5114-662-9849-suit-separate-vest","bw-5233-964-8466-ultimate-crew-neck-w-pkt","bw-5563-1044-6162-full-zip-hoodie","bw-5323-23-4025-pindot-five-pocket-knit-pant","bw-5463-964-1101-2-pack-crew-neck-t-shirts","bw-5114-662-9850-suit-separate-vest","bw-5581-300-7138-golf-short","bw-5463-964-1300-2-pack-boxer-briefs","bw-5121-626-7109-heather-knit-sport-jacket","bw-5323-23-4026-crosshatch-five-pocket-knit-pant"]},"products":{"label":"Products","pageSize":25,"active":true,"displayImage":true},"collections":{"label":"Collections","pageSize":25,"active":false,"displayImage":true,"displayDescription":false,"excludedValues":[]},"pages":{"label":"Blogs & Pages","pageSize":25,"active":false,"displayImage":false,"displayExcerpt":false},"searchTips":{"label":"Search tips","searchTips":"Please double-check your spelling.{{ breakline }}Use more generic search terms.{{ breakline }}Enter fewer keywords.{{ breakline }}Try searching by product type, brand, model number or product feature.","active":false},"searchEmptyResultMessages":{"label":"We are sorry! We couldn't find results for \"{{ terms }}\".{{ breakline }}But don't give up – check the spelling or try less specific search terms.","active":true}},"suggestionNoResult":{"search_terms":{"label":"Popular searches","status":true,"data":["shoes","shorts","vest","suit","belt","projek raw","underwear","suits","golf shirt","callaway"],"type":"based_on_data","backup":[]},"products":{"label":"Trending products","status":true,"data":["bw-5114-662-9849-suit-separate-vest","bw-5233-964-8466-ultimate-crew-neck-w-pkt","bw-5563-1044-6162-full-zip-hoodie","bw-5323-23-4025-pindot-five-pocket-knit-pant","bw-5463-964-1101-2-pack-crew-neck-t-shirts","bw-5114-662-9850-suit-separate-vest","bw-5581-300-7138-golf-short","bw-5463-964-1300-2-pack-boxer-briefs","bw-5121-626-7109-heather-knit-sport-jacket","bw-5323-23-4026-crosshatch-five-pocket-knit-pant"],"type":"based_on_data","backup":[]}},"enableInstantSearch":true,"productAvailable":true,"showSuggestionProductImage":true,"showSuggestionProductPrice":true,"showSuggestionProductSalePrice":true,"showSuggestionProductSku":false,"showSuggestionProductVendor":true,"suggestionBlocks":[{"type":"suggestions","label":"Popular suggestions","status":"disabled","number":5},{"type":"products","label":"Products","status":"active","number":6},{"type":"collections","label":"Collections","status":"active","number":5,"excludedValues":[]},{"type":"pages","label":"Blog & Pages","status":"disabled","number":3}],"searchBoxOnclick":{"recentSearch":{"label":"Recent searches","status":true,"number":"3"},"searchTermSuggestion":{"label":"Popular searches","status":true,"data":["graphic tees","sweaters","hoodies","casual pants","outerwear"],"backup":["socks","christmas","sweater","robe","polo","vest","hoodie","britches","jeans","sweaters"],"type":"manually"},"productSuggestion":{"label":"Trending products","status":true,"data":["4814816018512","4874423730256","6829677838416","6685442113616","4814829617232","4814815985744","6908547235920","4814829682768","6870204383312","6685442277456"],"backup":[],"type":"based_on_data"}},"suggestionStyle":"style2","suggestionStyle1ProductItemType":"list","suggestionStyle1ProductPosition":"none","suggestionStyle1ProductPerRow":"1","suggestionStyle2ProductItemType":"list","suggestionStyle2ProductPosition":"right","suggestionStyle2ProductPerRow":"2","suggestionStyle3ProductItemType":"list","suggestionStyle3ProductPosition":"right","suggestionStyle3ProductPerRow":"3"} , additionalElementSettings: Object.assign( { default_sort_order: {"search":"","all":"relevance"}, }, {"customSortingList":"relevance|price-ascending|created-descending|price-descending|extra-sort1-descending","enableCollectionSearch":false}), b2b: Object.assign({ enabled: false }, { } ), generalSettings: Object.assign(__spreadProps(__spreadValues({ preview_mode: false, preview_path: "", page: "index", custom_js_asset_url: "", custom_css_asset_url: "", collection_id: 0, collection_handle: "", collection_product_count: 0 }, { }), { collection_tags: null, current_tags: null, default_sort_by: "", swatch_extension: "png", no_image_url: "https://cdn.shopify.com/extensions/33ed89d2-5726-4665-9277-f45b11fa532e/boost-ai-search-discovery-95/assets/boost-pfs-no-image.jpg", search_term: "", template: "index", currencies: ["CAD"], current_currency:"CAD", published_locales: __spreadValues({}, {"en":true} ), current_locale: "en" }), {"addCollectionToProductUrl":false,"enableTrackingOrderRevenue":true}) }), { translation: {"productFilter":"Product filter","refine":"Filters","refineMobile":"Filters","refineMobileCollapse":"Hide Filter","clear":"Clear","clearAll":"Clear All","viewMore":"View More","viewLess":"View Less","apply":"Apply","applyAll":"Apply All","close":"Close","back":"Back","showLimit":"Show","collectionAll":"All","under":"Under","above":"Above","ratingStar":"Star","ratingStars":"Stars","ratingUp":"& Up","showResult":"Show result","searchOptions":"Search Options","loadPreviousPage":"Load Previous Page","loadMore":"Load more {{ amountProduct }} Products","loadMoreTotal":"{{ from }} - {{ to }} of {{ total }} Products","search":{"generalTitle":"General Title (when no search term)","resultHeader":"Search results for \"{{ terms }}\"","resultNumber":"Showing {{ count }} results for \"{{ terms }}\"","seeAllProducts":"See all products","resultEmpty":"We are sorry! We couldn't find results for \"{{ terms }}\".{{ breakline }}But don't give up – check the spelling or try less specific search terms.","resultEmptyWithSuggestion":"Sorry, nothing found for \"{{ terms }}\". Check out these items instead?","searchTotalResult":"Showing {{ count }} result","searchTotalResults":"Showing {{ count }} results","searchPanelProduct":"Products","searchPanelCollection":"Collections","searchPanelPage":"Blogs & Pages","searchTipsTitle":"Search tips","searchTipsContent":"Please double-check your spelling.{{ breakline }}Use more generic search terms.{{ breakline }}Enter fewer keywords.{{ breakline }}Try searching by product type, brand, model number or product feature.","noSearchResultSearchTermLabel":"Popular searches","noSearchResultProductsLabel":"Trending products","searchBoxOnclickRecentSearchLabel":"Recent searches","searchBoxOnclickSearchTermLabel":"Popular searches","searchBoxOnclickProductsLabel":"Trending products"},"suggestion":{"viewAll":"View all {{ count }} products","didYouMean":"Did you mean: {{ terms }}","searchBoxPlaceholder":"Search","suggestQuery":"Show {{ count }} results for {{ terms }}","instantSearchSuggestionsLabel":"Popular suggestions","instantSearchCollectionsLabel":"Collections","instantSearchProductsLabel":"Products","instantSearchPagesLabel":"Blog & Pages","searchBoxOnclickRecentSearchLabel":"Recent searches","searchBoxOnclickSearchTermLabel":"Popular searches","searchBoxOnclickProductsLabel":"Trending products","noSearchResultSearchTermLabel":"Popular searches","noSearchResultProductsLabel":"Trending products"},"error":{"noFilterResult":"Sorry, no products matched your selection","noSearchResult":"Sorry, no products matched the keyword","noProducts":"No products found in this collection","noSuggestionResult":"Sorry, nothing found for \"{{ terms }}\".","noSuggestionProducts":"Sorry, nothing found for \"{{ terms }}\"."},"recommendation":{"homepage-842004":"Just dropped","homepage-058552":"Best Sellers","collectionpage-581388":"Just dropped","collectionpage-645542":"Most Popular Products","productpage-172016":"Recently viewed","productpage-760402":"Frequently Bought Together","cartpage-446345":"Still interested in this?","cartpage-215162":"Similar Products"},"productItem":{},"quickView":{},"cart":{},"recentlyViewed":{"recentProductHeading":"Recently Viewed Products"},"mostPopular":{"popularProductsHeading":"Popular Products"},"perpage":{},"productCount":{},"pagination":{},"sortingList":{"relevance":"Relevance","price-ascending":"Price ascending","created-descending":"Created descending","price-descending":"Price descending","extra-sort1-descending":"Published decending"},"inCollectionSearch":"Search for products in this collection","collectionHeader":{},"breadcrumb":{},"sliderProduct":{}}, primary_language: {"productFilter":"Product filter","refine":"Filters","refineMobile":"Filters","refineMobileCollapse":"Hide Filter","clear":"Clear","clearAll":"Clear All","viewMore":"View More","viewLess":"View Less","apply":"Apply","applyAll":"Apply All","close":"Close","back":"Back","showLimit":"Show","collectionAll":"All","under":"Under","above":"Above","ratingStar":"Star","ratingStars":"Stars","ratingUp":"& Up","showResult":"Show result","searchOptions":"Search Options","loadPreviousPage":"Load Previous Page","loadMore":"Load more {{ amountProduct }} Products","loadMoreTotal":"{{ from }} - {{ to }} of {{ total }} Products","search":{"generalTitle":"General Title (when no search term)","resultHeader":"Search results for \"{{ terms }}\"","resultNumber":"Showing {{ count }} results for \"{{ terms }}\"","seeAllProducts":"See all products","resultEmpty":"We are sorry! We couldn't find results for \"{{ terms }}\".{{ breakline }}But don't give up – check the spelling or try less specific search terms.","resultEmptyWithSuggestion":"Sorry, nothing found for \"{{ terms }}\". Check out these items instead?","searchTotalResult":"Showing {{ count }} result","searchTotalResults":"Showing {{ count }} results","searchPanelProduct":"Products","searchPanelCollection":"Collections","searchPanelPage":"Blogs & Pages","searchTipsTitle":"Search tips","searchTipsContent":"Please double-check your spelling.{{ breakline }}Use more generic search terms.{{ breakline }}Enter fewer keywords.{{ breakline }}Try searching by product type, brand, model number or product feature.","noSearchResultSearchTermLabel":"Popular searches","noSearchResultProductsLabel":"Trending products","searchBoxOnclickRecentSearchLabel":"Recent searches","searchBoxOnclickSearchTermLabel":"Popular searches","searchBoxOnclickProductsLabel":"Trending products"},"suggestion":{"viewAll":"View all {{ count }} products","didYouMean":"Did you mean: {{ terms }}","searchBoxPlaceholder":"Search","suggestQuery":"Show {{ count }} results for {{ terms }}","instantSearchSuggestionsLabel":"Popular suggestions","instantSearchCollectionsLabel":"Collections","instantSearchProductsLabel":"Products","instantSearchPagesLabel":"Blog & Pages","searchBoxOnclickRecentSearchLabel":"Recent searches","searchBoxOnclickSearchTermLabel":"Popular searches","searchBoxOnclickProductsLabel":"Trending products","noSearchResultSearchTermLabel":"Popular searches","noSearchResultProductsLabel":"Trending products"},"error":{"noFilterResult":"Sorry, no products matched your selection","noSearchResult":"Sorry, no products matched the keyword","noProducts":"No products found in this collection","noSuggestionResult":"Sorry, nothing found for \"{{ terms }}\".","noSuggestionProducts":"Sorry, nothing found for \"{{ terms }}\"."},"recommendation":{"homepage-842004":"Just dropped","homepage-058552":"Best Sellers","collectionpage-581388":"Just dropped","collectionpage-645542":"Most Popular Products","productpage-172016":"Recently viewed","productpage-760402":"Frequently Bought Together","cartpage-446345":"Still interested in this?","cartpage-215162":"Similar Products"},"productItem":{},"quickView":{},"cart":{},"recentlyViewed":{"recentProductHeading":"Recently Viewed Products"},"mostPopular":{"popularProductsHeading":"Popular Products"},"perpage":{},"productCount":{},"pagination":{},"sortingList":{"relevance":"Relevance","price-ascending":"Price ascending","created-descending":"Created descending","price-descending":"Price descending","extra-sort1-descending":"Published decending"},"inCollectionSearch":"Search for products in this collection","collectionHeader":{},"breadcrumb":{},"sliderProduct":{}}, } ), window.boostWidgetIntegration.app["production"] || {} ); window.boostWidgetIntegration.env = "production"; window.boostWidgetIntegration.app["production"] = combinedAppSettings; window.boostWidgetIntegration.app["production"].customization = window.boostWidgetIntegration.app["production"].customization || {}; window.boostWidgetIntegration.regisCustomization = function(fc, scope) { if (typeof fc === "function" && fc.name && !scope) { const functionName = fc.name; window.boostWidgetIntegration.app["production"].customization[functionName] = fc; } else if (typeof fc === "function" && fc.name && scope) { window.boostWidgetIntegration.app["production"].customization[scope] = window.boostWidgetIntegration.app["production"].customization[scope] || {}; const functionName = fc.name; window.boostWidgetIntegration.app["production"].customization[scope][functionName] = fc; } else { console.error("Invalid function or function does not have a name."); } }; } // tae/recommendation.js function initRecommendation() { const app = window.boostWidgetIntegration.app["production"]; const recommendationWidgetDoms = document.querySelectorAll('[id^="boost-sd-widget-"]'); const recommendationWidgets = {}; ; recommendationWidgets['home-page'] = {"homepage-842004":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"newest-arrivals","limit":12},"widgetName":"Just dropped","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}},"homepage-058552":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"bestsellers","limit":12},"widgetName":"Best Sellers","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}}} recommendationWidgets['cart-page'] = {"cartpage-446345":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"recently-viewed","limit":12},"widgetName":"Still interested in this?","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}},"cartpage-215162":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"related-items","limit":12,"modelType":"Alternative","secondaryAlgorithm":"bestsellers"},"widgetName":"Similar Products","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}}} recommendationWidgets['product-page'] = {"productpage-172016":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"recently-viewed","limit":12},"widgetName":"Recently viewed","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}},"productpage-760402":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"frequently-bought-together","limit":2,"modelType":"FBT","secondaryAlgorithm":"bestsellers"},"widgetName":"Frequently Bought Together","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"productpage-760402","bundleStyle":"style1","layoutDisplay":"bundle","numberOfRecommendProduct":2,"templateType":"customization","themePreview":"","titleAlignment":"left","titleFont":"Poppins","titleFontSize":14,"titleFontStyle":"100","titleTextColor":"#3D4246","titleTextTransform":"capitalize"}}} recommendationWidgets['collection-page'] = {"collectionpage-581388":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"newest-arrivals","limit":12},"widgetName":"Just dropped","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}},"collectionpage-645542":{"params":{"shop":"georgerichards-storefront.myshopify.com","recommendationType":"trending-products","limit":12,"calculatedBasedOn":"purchase-events","rangeOfTime":"7-day"},"widgetName":"Most Popular Products","widgetStatus":"inactive","widgetDesignSettings":{"tenantId":"georgerichards-storefront.myshopify.com","widgetId":"defaultSettings","layoutDisplay":"carousel","templateType":"customization","themePreview":"","numberOfRecommendProduct":12,"numberOfProductPerRow":4,"titleAlignment":"left","titleTextColor":"#3D4246","titleFont":"Poppins","titleTextTransform":"capitalize","titleFontSize":14,"titleFontStyle":"100"}}} recommendationWidgets['defaultSettings'] = null ; app.recommendationWidgets = recommendationWidgets; for (const recDom of recommendationWidgetDoms) { recDom.innerHTML = ``; } initBlocks( [...recommendationWidgetDoms], "recommendation", app, app.templateSettings, {}, "", "" ); } // tae/instant-search.js function initInstantSearch() { const app = window.boostWidgetIntegration.app["production"]; const instantSearchDom = document.createElement("div"); instantSearchDom.id = "bc-instant-search"; document.body.appendChild(instantSearchDom); initBlocks( [instantSearchDom], "instantSearch", app, app.templateSettings, {}, instantSearchDom.id, "" ); } // tae/predictive-bundle.js function initPredictiveBundle() { const app = window.boostWidgetIntegration.app["production"]; const predictiveBundleDom = document.querySelector(".boost-sd-widget-predictive-bundle"); if (!predictiveBundleDom) return; predictiveBundleDom.id = "bc-predictive-bundle"; initBlocks([predictiveBundleDom], "predictiveBundle", app, app.templateSettings, {}, "", ""); } // tae/collection-filter.js function initCollectionFilter() { var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z; console.log("block filter init ", /* @__PURE__ */ new Date(), "-", (/* @__PURE__ */ new Date()).getMilliseconds(), "ms"); const { convertValueRequestStockStatus: convertValueRequestStockStatus2, isMobileWidth: isMobileWidth2, detectDeviceByWidth: detectDeviceByWidth2, getParamsHistory: getParamsHistory2, getSortBy: getSortBy2, getApi: getApi2, getLocalStorage: getLocalStorage2, generateUuid: generateUuid2, initBlocks: initBlocks2, addParamsLocale: addParamsLocale2, roundToNearest50: roundToNearest502, getCurrentPage: getCurrentPage2, isCollectionPage: isCollectionPage2, isSearchPage: isSearchPage2 } = utils_exports; const app = window.boostWidgetIntegration.app["production"]; if (typeof ((_b = (_a = app == null ? void 0 : app.customization) == null ? void 0 : _a.filter) == null ? void 0 : _b.beforeRender) === "function") { app.customization.filter.beforeRender(); } const { generalSettings: { page = "collection" } } = app || {}; const widgetName = page === "collection" ? "collectionFilters" : "searchPage"; const width = window.innerWidth; const isMobile = isMobileWidth2(); const productPerRow = isMobile ? ((_e = (_d = (_c = app.templateSettings) == null ? void 0 : _c.themeSettings) == null ? void 0 : _d.productList) == null ? void 0 : _e.productsPerRowOnMobile) || 2 : ((_h = (_g = (_f = app.templateSettings) == null ? void 0 : _f.themeSettings) == null ? void 0 : _g.productList) == null ? void 0 : _h.productsPerRowOnDesktop) || 3; let showFilterTree = 0; if (((_j = (_i = app.templateSettings) == null ? void 0 : _i.filterSettings) == null ? void 0 : _j.filterLayout) === "vertical" && ((_l = (_k = app.templateSettings) == null ? void 0 : _k.filterSettings) == null ? void 0 : _l.filterTreeVerticalStyle) === "style-default") { showFilterTree = 1; } const productImageMaxWidth = isMobile ? width / productPerRow : width / (productPerRow + showFilterTree); const filterDom = document.querySelector( ".boost-sd__filter-product-list:not(.boost-sd__filter-product-list--ready)" ); (_m = filterDom == null ? void 0 : filterDom.classList) == null ? void 0 : _m.add("boost-sd__filter-product-list--ready"); const widgetId = app.templateMetadata[widgetName] || "default"; const filterDomId = `${widgetId}-${generateUuid2()}`; const sort = getSortBy2(); let shop = "georgerichards-storefront.myshopify.com"; const paramsHistory = getParamsHistory2(); const productPerPage = (_p = (_o = (_n = app.templateSettings) == null ? void 0 : _n.themeSettings) == null ? void 0 : _o.productList) == null ? void 0 : _p.productsPerPage; const selectedValueOfLimitList = getLocalStorage2("boostSDLimit") || productPerPage; const limitSetting = getLocalStorage2("boostSDLimitSetting"); const limit = limitSetting === productPerPage ? parseInt(selectedValueOfLimitList) : productPerPage || 16; let defaultParams = { _: "pf", shop, page: paramsHistory.page || 1, limit, sort: paramsHistory.sort || sort, locale: ((_q = app == null ? void 0 : app.generalSettings) == null ? void 0 : _q.current_locale) || "en", event_type: "init", pg: getCurrentPage2(), build_filter_tree: true, collection_scope: "0" , money_format: "\u0026#36;{{amount}}", money_format_with_currency: "\u0026#36;{{amount}} CAD", widgetId, // TODO: Update later when having breakpoint viewAs: `grid--${isMobileWidth2() ? ((_t = (_s = (_r = app.templateSettings) == null ? void 0 : _r.themeSettings) == null ? void 0 : _s.productList) == null ? void 0 : _t.productsPerRowOnMobile) || 2 : ((_w = (_v = (_u = app.templateSettings) == null ? void 0 : _u.themeSettings) == null ? void 0 : _v.productList) == null ? void 0 : _w.productsPerRowOnDesktop) || 3}`, device: detectDeviceByWidth2(), first_load: false, productImageWidth: roundToNearest502(productImageMaxWidth), productPerRow, widget_updated_at: (_x = app.templateMetadata) == null ? void 0 : _x.updatedAt, templateId: "" }; defaultParams = addParamsLocale2(defaultParams); if (filterDom) { filterDom.id = filterDomId; window.boostWidgetIntegration.blocks[filterDomId] = {}; const params = new URLSearchParams(defaultParams); params["first_load"] = true; params["search_no_result"] = Object.keys(paramsHistory.paramMap).length === 0; Object.keys(paramsHistory.paramMap).forEach((key) => { paramsHistory.paramMap[key].forEach( (v) => params.append( `${key}[]`, key.startsWith(`${defaultParams._}_st_`) ? convertValueRequestStockStatus2(v) : v ) ); }); const urlParams = new URLSearchParams(window.location.search); const searchQuery = urlParams.get("q"); const url = isSearchPage2() || searchQuery ? app.searchUrl : app.filterUrl; if (searchQuery) { params.set("q", searchQuery); if (isCollectionPage2()) { params.set("incollection_search", true); params.set("event_type", "incollection_search"); } buildSearchQueryParamsWithSuggestion(params); } if ((_y = app.b2b) == null ? void 0 : _y.enabled) { params.set( "company_location_id", `${app.b2b.current_company_id}_${app.b2b.current_location_id}` ); const shopifyCurrencySettings = (_z = window.Shopify) == null ? void 0 : _z.currency; params.set("currency", shopifyCurrencySettings.active); params.set("currency_rate", shopifyCurrencySettings.rate); } getApi2(url, params, filterDomId); if (filterDom && app.jsLibLoadStatus === "pending") { const observer = new MutationObserver(function(mutationsList, observer2) { mutationsList.forEach(function(mutation) { if (mutation.type === "childList" && mutation.addedNodes.length > 0) { mutation.addedNodes.forEach(function(addedNode) { var _a2; const imgElement = (_a2 = addedNode == null ? void 0 : addedNode.querySelector) == null ? void 0 : _a2.call( addedNode, ".boost-sd__filter-product-list .boost-sd__product-image img" ); if (app.jsLibLoadStatus === "pending") { const loadIntegrationScript = () => { var _a3; if (document.getElementById("bc-widget-integration")) { console.warn("Integration script is already loaded"); return; } const widgetLibScript = document.createElement("script"); widgetLibScript.setAttribute("src", app.libUrl); widgetLibScript.defer = true; widgetLibScript.id = "bc-widget-integration"; (_a3 = document.head) == null ? void 0 : _a3.appendChild(widgetLibScript); app.jsLibLoadStatus = "loading"; widgetLibScript.onload = function() { app.jsLibLoadStatus = "loaded"; }; }; if (imgElement) { imgElement.addEventListener("load", function() { loadIntegrationScript(); }); } else { loadIntegrationScript(); } observer2.disconnect(); } }); } }); }); observer.observe(filterDom, { childList: true, subtree: true }); } initBlocks2([filterDom], "filter", app, app.templateSettings, sort, widgetId, defaultParams); } } var initRobotMeta = () => { const { checkExistFilterOptionParam: checkExistFilterOptionParam2, getQueryParamByKey: getQueryParamByKey2, isSearchPage: isSearchPage2 } = utils_exports; const { generalSettings: { enableRobot = true } } = window.boostWidgetIntegration.app["production"]; if (!enableRobot) return; const robot = document.querySelector('meta[content="noindex,nofollow,nosnippet"]'); if (!robot && (checkExistFilterOptionParam2() || getQueryParamByKey2("q") && !isSearchPage2())) { const meta = document.createElement("meta"); meta.name = "robots"; meta.content = "noindex,nofollow,nosnippet"; document.head.append(meta); } }; var buildSearchQueryParamsWithSuggestion = (params) => { const SUGGESTION_DATA = "boostSDSuggestionData"; const CLICK_SUGGESTION_TERM = "boostSDClickSuggestionTerm"; const term = getLocalStorage(CLICK_SUGGESTION_TERM); if (!term) return; const suggestionData = getLocalStorage(SUGGESTION_DATA); if (!suggestionData) return; params.set("query", suggestionData.query); params.set("parent_request_id", suggestionData.id); params.set("suggestion", term); params.set("item_rank", suggestionData.suggestions.findIndex((item) => item === term) + 1); removeLocalStorage(CLICK_SUGGESTION_TERM); removeLocalStorage(SUGGESTION_DATA); }; // tae/cart.js function initCart() { const app = window.boostWidgetIntegration.app["production"]; document.body.id = "bc-cart"; initBlocks([document.body], "cart", app, app.templateSettings, {}, "bc-cart", ""); } // tae/app.js (function() { var _a, _b, _c, _d, _e, _f; initSettings(); initRobotMeta(); window.boostSDTaeUtils = { lazyLoadImages, inViewPortHandler, initCollectionFilter }; const app = window.boostWidgetIntegration.app["production"]; window.boostWidgetIntegration.status = "initializing"; app.fallback = { themeCssUrl: "https://cdn.boostcommerce.io/widget-integration/theme/default/1.0.1/main.css", settingsCssUrl: "https://boost-cdn-staging.bc-solutions.net/widget-integration/theme/default/staging/default-settings.css" }; boostWidgetIntegration.generalSettings = app.generalSettings; const templateId = "" || ""; boostWidgetIntegration.generalSettings.templateId = templateId; const templateMetadata = "" || {}; const devMode = window.boostWidgetIntegration.mode === "development"; const env = "production"; const cssLink = document.createElement("link"); cssLink.rel = "stylesheet"; cssLink.type = "text/css"; cssLink.media = "all"; if (templateMetadata == null ? void 0 : templateMetadata.themeCssUrl) { cssLink.href = templateMetadata.themeCssUrl; if (env === "staging") { cssLink.href += `?v=${Date.now()}`; } } else if ((_a = app == null ? void 0 : app.fallback) == null ? void 0 : _a.themeCssUrl) { cssLink.href = (_b = app == null ? void 0 : app.fallback) == null ? void 0 : _b.themeCssUrl; } const settingsCSSLink = document.createElement("link"); settingsCSSLink.rel = "stylesheet"; settingsCSSLink.type = "text/css"; settingsCSSLink.media = "all"; if ((templateMetadata == null ? void 0 : templateMetadata.settingsCssUrl) && !devMode) { settingsCSSLink.href = templateMetadata.settingsCssUrl; } else if ((_c = app == null ? void 0 : app.fallback) == null ? void 0 : _c.settingsCssUrl) { settingsCSSLink.href = (_d = app == null ? void 0 : app.fallback) == null ? void 0 : _d.settingsCssUrl; } if (devMode) { app.themeCssLoaded = true; app.settingsCSSLoaded = true; } else if (cssLink.href && settingsCSSLink.href) { document.head.appendChild(cssLink); cssLink.onload = function() { app.themeCssLoaded = true; }; document.head.appendChild(settingsCSSLink); settingsCSSLink.onload = function() { app.settingsCSSLoaded = true; }; } if (!devMode) { app.cdn = app.cdn || "https://cdn.boostcommerce.io"; let themeLibVersion = env === "staging" ? "staging" : templateMetadata.themeLibVersion || "1.5.0"; let libUrl = app.libUrl || `${app.cdn}/widget-integration/${themeLibVersion}/bc-widget-integration.js`; if (env === "staging") { libUrl += `?v=${Date.now()}`; } app.libUrl = libUrl; const link = document.createElement("link"); link.rel = "preload"; link.as = "script"; link.href = libUrl; (_e = document.head) == null ? void 0 : _e.appendChild(link); if (isMobileWidth()) { app.jsLibLoadStatus = "pending"; } else { const widgetLibScript = document.createElement("script"); widgetLibScript.setAttribute("src", libUrl); widgetLibScript.defer = true; (_f = document.head) == null ? void 0 : _f.appendChild(widgetLibScript); app.jsLibLoadStatus = "loading"; widgetLibScript.onload = function() { app.jsLibLoadStatus = "loaded"; }; } } app.filterUrl = "https://services.mybcapps.com/bc-sf-filter/filter"; app.searchUrl = "https://services.mybcapps.com/bc-sf-filter/search"; app.productUrl = "https://services.mybcapps.com/bc-sf-filter/products"; app.recommendUrl = "https://services.mybcapps.com/discovery/recommend"; app.templateUrl = "https://services.mybcapps.com/bc-sf-filter/ssr-template"; app.bundleUrl = "https://services.mybcapps.com/bc-sf-filter/bundles"; app.templateMetadata = templateMetadata; const product = "" || {}; window.boostSDData = { product }; let templateSettings = "" || {}; app.templateSettings = templateSettings; app.template = {}; ; })(); document.addEventListener("DOMContentLoaded", function() { var _a, _b; const taeSettings = window.boostWidgetIntegration.taeSettings; const app = window.boostWidgetIntegration.app["production"]; const hasFilterBlock = document.querySelector(".boost-sd__filter-product-list"); if (app.jsLibLoadStatus === "pending" && !hasFilterBlock) { const widgetLibScript = document.createElement("script"); widgetLibScript.setAttribute("src", app.libUrl); widgetLibScript.defer = true; (_a = document.head) == null ? void 0 : _a.appendChild(widgetLibScript); app.jsLibLoadStatus = "loading"; widgetLibScript.onload = function() { app.jsLibLoadStatus = "loaded"; }; } if (((_b = taeSettings == null ? void 0 : taeSettings.instantSearch) == null ? void 0 : _b.enabled) && boostWidgetIntegration.generalSettings.templateId) { initInstantSearch(); } initRecommendation(); initCart(); initPredictiveBundle(); const checkCssLoaded = function() { var _a2; if (app.themeCssLoaded && app.settingsCSSLoaded) { window.boostWidgetIntegration.status = "ready"; const app2 = window.boostWidgetIntegration.app["production"]; const templateMetadata = app2.templateMetadata; if (templateMetadata == null ? void 0 : templateMetadata.customizeCssUrl) { const customizeCss = document.createElement("link"); customizeCss.rel = "stylesheet"; customizeCss.type = "text/css"; customizeCss.href = templateMetadata == null ? void 0 : templateMetadata.customizeCssUrl; document.head.appendChild(customizeCss); } if (templateMetadata == null ? void 0 : templateMetadata.customizeJsUrl) { const customizeJs = document.createElement("script"); customizeJs.defer = true; customizeJs.type = "module"; customizeJs.setAttribute("src", templateMetadata.customizeJsUrl); (_a2 = document.body) == null ? void 0 : _a2.appendChild(customizeJs); } } else { setTimeout(() => { checkCssLoaded(); }, 50); } }; checkCssLoaded(); }); })();