@getlupa/client 1.12.10 → 1.13.3

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.
@@ -1,22 +1,42 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
1
+ var __defProp2 = Object.defineProperty;
2
+ var __defProps2 = Object.defineProperties;
3
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues2 = (a, b) => {
9
9
  for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
10
+ if (__hasOwnProp2.call(b, prop))
11
+ __defNormalProp2(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols2)
13
+ for (var prop of __getOwnPropSymbols2(b)) {
14
+ if (__propIsEnum2.call(b, prop))
15
+ __defNormalProp2(a, prop, b[prop]);
16
16
  }
17
17
  return a;
18
18
  };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
19
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
20
+ var __async2 = (__this, __arguments, generator) => {
21
+ return new Promise((resolve2, reject) => {
22
+ var fulfilled = (value) => {
23
+ try {
24
+ step(generator.next(value));
25
+ } catch (e2) {
26
+ reject(e2);
27
+ }
28
+ };
29
+ var rejected = (value) => {
30
+ try {
31
+ step(generator.throw(value));
32
+ } catch (e2) {
33
+ reject(e2);
34
+ }
35
+ };
36
+ var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
+ step((generator = generator.apply(__this, __arguments)).next());
38
+ });
39
+ };
20
40
  function makeMap(str, expectsLowerCase) {
21
41
  const map = /* @__PURE__ */ Object.create(null);
22
42
  const list = str.split(",");
@@ -6301,7 +6321,7 @@ function ensureRenderer() {
6301
6321
  }
6302
6322
  const createApp = (...args) => {
6303
6323
  const app2 = ensureRenderer().createApp(...args);
6304
- const { mount } = app2;
6324
+ const { mount: mount2 } = app2;
6305
6325
  app2.mount = (containerOrSelector) => {
6306
6326
  const container = normalizeContainer(containerOrSelector);
6307
6327
  if (!container)
@@ -6311,7 +6331,7 @@ const createApp = (...args) => {
6311
6331
  component.template = container.innerHTML;
6312
6332
  }
6313
6333
  container.innerHTML = "";
6314
- const proxy = mount(container, false, container instanceof SVGElement);
6334
+ const proxy = mount2(container, false, container instanceof SVGElement);
6315
6335
  if (container instanceof Element) {
6316
6336
  container.removeAttribute("v-cloak");
6317
6337
  container.setAttribute("data-v-app", "");
@@ -6327,25 +6347,25 @@ function normalizeContainer(container) {
6327
6347
  }
6328
6348
  return container;
6329
6349
  }
6330
- var __defProp2 = Object.defineProperty;
6331
- var __defProps2 = Object.defineProperties;
6332
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
6333
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
6334
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
6335
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
6336
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6337
- var __spreadValues2 = (a, b) => {
6350
+ var __defProp = Object.defineProperty;
6351
+ var __defProps = Object.defineProperties;
6352
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6353
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6354
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6355
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6356
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6357
+ var __spreadValues = (a, b) => {
6338
6358
  for (var prop in b || (b = {}))
6339
- if (__hasOwnProp2.call(b, prop))
6340
- __defNormalProp2(a, prop, b[prop]);
6341
- if (__getOwnPropSymbols2)
6342
- for (var prop of __getOwnPropSymbols2(b)) {
6343
- if (__propIsEnum2.call(b, prop))
6344
- __defNormalProp2(a, prop, b[prop]);
6359
+ if (__hasOwnProp.call(b, prop))
6360
+ __defNormalProp(a, prop, b[prop]);
6361
+ if (__getOwnPropSymbols)
6362
+ for (var prop of __getOwnPropSymbols(b)) {
6363
+ if (__propIsEnum.call(b, prop))
6364
+ __defNormalProp(a, prop, b[prop]);
6345
6365
  }
6346
6366
  return a;
6347
6367
  };
6348
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
6368
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6349
6369
  var __async = (__this, __arguments, generator) => {
6350
6370
  return new Promise((resolve2, reject) => {
6351
6371
  var fulfilled = (value) => {
@@ -6811,14 +6831,14 @@ var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _argumen
6811
6831
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6812
6832
  });
6813
6833
  };
6814
- const defaultConfig$1 = {
6834
+ const defaultConfig = {
6815
6835
  method: "POST",
6816
6836
  headers: { "Content-Type": "application/json" }
6817
6837
  };
6818
6838
  const customRequestConfig = ({ customHeaders }) => {
6819
6839
  return {
6820
- method: defaultConfig$1.method,
6821
- headers: Object.assign(Object.assign({}, defaultConfig$1.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6840
+ method: defaultConfig.method,
6841
+ headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6822
6842
  };
6823
6843
  };
6824
6844
  const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, function* () {
@@ -6842,7 +6862,7 @@ const suggestCustom = (query, options) => __awaiter(void 0, void 0, void 0, func
6842
6862
  return { success: false, errors };
6843
6863
  });
6844
6864
  const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6845
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6865
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6846
6866
  if (res.status < 400) {
6847
6867
  const data = yield res.json();
6848
6868
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6852,7 +6872,7 @@ const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0
6852
6872
  });
6853
6873
  const queryByIds = (queryKey, ids, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6854
6874
  const idParam = ids.map((id) => `ids=${id}`).join("&");
6855
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6875
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6856
6876
  if (res.status < 400) {
6857
6877
  const data = yield res.json();
6858
6878
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6865,7 +6885,7 @@ const recommendForSingleId = (queryKey, recommendForId, filters, environment, cu
6865
6885
  if (filters) {
6866
6886
  url += `&${e({ filters })}`;
6867
6887
  }
6868
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6888
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6869
6889
  if (res.status < 400) {
6870
6890
  const data = yield res.json();
6871
6891
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6879,7 +6899,7 @@ const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment
6879
6899
  if (filters) {
6880
6900
  url += `&${e({ filters })}`;
6881
6901
  }
6882
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6902
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6883
6903
  if (res.status < 400) {
6884
6904
  const data = yield res.json();
6885
6905
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6891,7 +6911,7 @@ const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl
6891
6911
  return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl);
6892
6912
  });
6893
6913
  const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6894
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6914
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6895
6915
  if (res.status < 400) {
6896
6916
  const items = yield res.json();
6897
6917
  return { items, success: true };
@@ -6901,7 +6921,7 @@ const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void
6901
6921
  });
6902
6922
  const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6903
6923
  try {
6904
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6924
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6905
6925
  if (res.status < 400) {
6906
6926
  return { success: false };
6907
6927
  }
@@ -6911,7 +6931,7 @@ const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void
6911
6931
  }
6912
6932
  });
6913
6933
  const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6914
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6934
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6915
6935
  if (res.status < 400) {
6916
6936
  return res.json();
6917
6937
  }
@@ -7243,13 +7263,13 @@ const sendGa4AnalyticsEvent = (data, options) => {
7243
7263
  }
7244
7264
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
7245
7265
  const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
7246
- const params = __spreadValues2({
7266
+ const params = __spreadValues({
7247
7267
  search_text: data.searchQuery,
7248
7268
  item_title: title,
7249
7269
  item_id: data.itemId,
7250
7270
  ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
7251
7271
  }, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
7252
- window.dataLayer.push(__spreadValues2({
7272
+ window.dataLayer.push(__spreadValues({
7253
7273
  event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
7254
7274
  }, params));
7255
7275
  };
@@ -7427,15 +7447,21 @@ const DEFAULT_OPTIONS_RESULTS$1 = {
7427
7447
  breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
7428
7448
  };
7429
7449
  const useScreenStore = defineStore("screen", () => {
7430
- const screenWidth = ref(1e3);
7450
+ const measuredScreenWidth = ref(1e3);
7431
7451
  const optionsStore = useOptionsStore();
7452
+ const screenWidth = computed(() => {
7453
+ var _a, _b;
7454
+ const { searchResultOptions } = storeToRefs(optionsStore);
7455
+ return (_b = (_a = searchResultOptions.value.grid) == null ? void 0 : _a.forcedScreenWidth) != null ? _b : measuredScreenWidth.value;
7456
+ });
7432
7457
  const configuredGridSizes = computed(() => {
7433
7458
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
7459
+ const { searchResultOptions } = storeToRefs(optionsStore);
7434
7460
  return {
7435
- smMin: (_d = (_c = (_b = (_a = optionsStore.searchResultOptions) == null ? void 0 : _a.grid) == null ? void 0 : _b.sizes) == null ? void 0 : _c.sm) != null ? _d : S_MIN_WIDTH,
7436
- mdMin: (_h = (_g = (_f = (_e = optionsStore.searchResultOptions) == null ? void 0 : _e.grid) == null ? void 0 : _f.sizes) == null ? void 0 : _g.md) != null ? _h : MD_MIN_WIDTH,
7437
- lMin: (_l = (_k = (_j = (_i = optionsStore.searchResultOptions) == null ? void 0 : _i.grid) == null ? void 0 : _j.sizes) == null ? void 0 : _k.l) != null ? _l : L_MIN_WIDTH,
7438
- xlMin: (_p = (_o = (_n = (_m = optionsStore.searchResultOptions) == null ? void 0 : _m.grid) == null ? void 0 : _n.sizes) == null ? void 0 : _o.xl) != null ? _p : XL_MIN_WIDTH
7461
+ smMin: (_d = (_c = (_b = (_a = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _a.grid) == null ? void 0 : _b.sizes) == null ? void 0 : _c.sm) != null ? _d : S_MIN_WIDTH,
7462
+ mdMin: (_h = (_g = (_f = (_e = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _e.grid) == null ? void 0 : _f.sizes) == null ? void 0 : _g.md) != null ? _h : MD_MIN_WIDTH,
7463
+ lMin: (_l = (_k = (_j = (_i = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _i.grid) == null ? void 0 : _j.sizes) == null ? void 0 : _k.l) != null ? _l : L_MIN_WIDTH,
7464
+ xlMin: (_p = (_o = (_n = (_m = searchResultOptions == null ? void 0 : searchResultOptions.value) == null ? void 0 : _m.grid) == null ? void 0 : _n.sizes) == null ? void 0 : _o.xl) != null ? _p : XL_MIN_WIDTH
7439
7465
  };
7440
7466
  });
7441
7467
  const currentScreenWidth = computed(() => {
@@ -7457,7 +7483,7 @@ const useScreenStore = defineStore("screen", () => {
7457
7483
  return (_a = ["xs", "sm"]) == null ? void 0 : _a.includes(currentScreenWidth.value);
7458
7484
  });
7459
7485
  const setScreenWidth = ({ width }) => {
7460
- screenWidth.value = width;
7486
+ measuredScreenWidth.value = width;
7461
7487
  };
7462
7488
  return { screenWidth, currentScreenWidth, isMobileWidth, setScreenWidth };
7463
7489
  });
@@ -7737,7 +7763,7 @@ const unfoldFilters = (filters, price = {}) => {
7737
7763
  const getLabeledFilters = (filters, facets) => {
7738
7764
  return filters.map((f2) => {
7739
7765
  var _a, _b;
7740
- return __spreadProps2(__spreadValues2({}, f2), {
7766
+ return __spreadProps(__spreadValues({}, f2), {
7741
7767
  label: (_b = (_a = facets == null ? void 0 : facets.find((ft) => ft.key === f2.key)) == null ? void 0 : _a.label) != null ? _b : capitalize$1(f2.key)
7742
7768
  });
7743
7769
  });
@@ -7765,7 +7791,7 @@ const recursiveFilterItem = (item, query = "") => {
7765
7791
  }
7766
7792
  const children = recursiveFilter(item.children, query).filter(Boolean);
7767
7793
  const include = children.length > 0 || filterable;
7768
- return include ? __spreadProps2(__spreadValues2({}, item), {
7794
+ return include ? __spreadProps(__spreadValues({}, item), {
7769
7795
  children
7770
7796
  }) : void 0;
7771
7797
  };
@@ -7847,7 +7873,7 @@ const parseFacetKeys = (facetKeys, searchParams) => {
7847
7873
  params.filters = {};
7848
7874
  for (const key of facetKeys) {
7849
7875
  const parsedKey = key.slice(key.indexOf(FACET_KEY_SEPARATOR) + 1);
7850
- params.filters = __spreadProps2(__spreadValues2({}, params.filters), {
7876
+ params.filters = __spreadProps(__spreadValues({}, params.filters), {
7851
7877
  [parsedKey]: parseFacetKey(key, searchParams)
7852
7878
  });
7853
7879
  }
@@ -7860,7 +7886,7 @@ const parseParams = (getQueryParamName, searchParams) => {
7860
7886
  const paramKeys = Array.from(searchParams.keys());
7861
7887
  const facetKeys = paramKeys.filter((k) => isFacetKey(k));
7862
7888
  const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
7863
- const r = __spreadValues2(__spreadValues2({
7889
+ const r = __spreadValues(__spreadValues({
7864
7890
  [QUERY_PARAMS_PARSED.QUERY]: ""
7865
7891
  }, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
7866
7892
  return r;
@@ -7910,7 +7936,7 @@ const encodeParam = (param) => {
7910
7936
  const encoded = encodeURIComponent(param);
7911
7937
  return encoded.replace(/%C4%85/g, "ą").replace(/%C4%8D/g, "č").replace(/%C4%99/g, "ę").replace(/%C4%97/g, "ė").replace(/%C4%AF/g, "į").replace(/%C5%A1/g, "š").replace(/%C5%B3/g, "ų").replace(/%C5%AB/g, "ū").replace(/%C5%BE/g, "ž").replace(/%20/g, " ");
7912
7938
  };
7913
- const getQueryParam = (name) => {
7939
+ const getQueryParam$1 = (name) => {
7914
7940
  try {
7915
7941
  const urlParams = new URLSearchParams(window.location.search);
7916
7942
  return urlParams.get(name);
@@ -8050,7 +8076,7 @@ const CACHE_KEY = "lupasearch-client-redirections";
8050
8076
  const useRedirectionStore = defineStore("redirections", () => {
8051
8077
  const redirections = ref({ rules: [] });
8052
8078
  const redirectionOptions = ref({ enabled: false, queryKey: "" });
8053
- const saveToLocalStorage = () => {
8079
+ const saveToLocalStorage2 = () => {
8054
8080
  try {
8055
8081
  localStorage.setItem(
8056
8082
  CACHE_KEY,
@@ -8059,7 +8085,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8059
8085
  } catch (e2) {
8060
8086
  }
8061
8087
  };
8062
- const tryLoadFromLocalStorage = (config) => {
8088
+ const tryLoadFromLocalStorage2 = (config) => {
8063
8089
  var _a;
8064
8090
  if (!config.cacheSeconds)
8065
8091
  return false;
@@ -8082,7 +8108,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8082
8108
  if (!(config == null ? void 0 : config.enabled)) {
8083
8109
  return;
8084
8110
  }
8085
- const loaded = tryLoadFromLocalStorage(config);
8111
+ const loaded = tryLoadFromLocalStorage2(config);
8086
8112
  if (loaded || ((_c = (_b = redirections.value) == null ? void 0 : _b.rules) == null ? void 0 : _c.length) > 0) {
8087
8113
  return;
8088
8114
  }
@@ -8092,7 +8118,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8092
8118
  return;
8093
8119
  }
8094
8120
  redirections.value = result;
8095
- saveToLocalStorage();
8121
+ saveToLocalStorage2();
8096
8122
  } catch (e2) {
8097
8123
  }
8098
8124
  });
@@ -8218,12 +8244,12 @@ const useParamsStore = defineStore("params", () => {
8218
8244
  return;
8219
8245
  }
8220
8246
  const forceFullReload = (_a = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a.some(
8221
- (p2) => getQueryParam(p2)
8247
+ (p2) => getQueryParam$1(p2)
8222
8248
  );
8223
8249
  if ((!searchResultsLink.value || linksMatch(searchResultsLink.value, window.location.pathname)) && !forceFullReload) {
8224
8250
  const singleFacetParam = facet ? getFacetParam(facet.key, [facet.title]) : void 0;
8225
8251
  const facetParam = singleFacetParam ? [
8226
- __spreadProps2(__spreadValues2({}, singleFacetParam), {
8252
+ __spreadProps(__spreadValues({}, singleFacetParam), {
8227
8253
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
8228
8254
  })
8229
8255
  ] : [];
@@ -8312,7 +8338,7 @@ const flattenFacet = (key, facets, suggestion, inputValue) => {
8312
8338
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
8313
8339
  display: suggestion.suggestion,
8314
8340
  suggestion,
8315
- facet: __spreadValues2({
8341
+ facet: __spreadValues({
8316
8342
  key
8317
8343
  }, f2)
8318
8344
  }));
@@ -8419,14 +8445,14 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8419
8445
  const context = getLupaTrackingContext();
8420
8446
  const result = yield LupaSearchSdk.suggestions(
8421
8447
  queryKey,
8422
- __spreadValues2(__spreadValues2({}, publicQuery), context),
8448
+ __spreadValues(__spreadValues({}, publicQuery), context),
8423
8449
  options2
8424
8450
  );
8425
8451
  if (!result.success) {
8426
8452
  return { suggestions: void 0 };
8427
8453
  }
8428
8454
  highlightChange({ action: "clear" });
8429
- suggestionResults.value = __spreadProps2(__spreadValues2({}, suggestionResults.value), {
8455
+ suggestionResults.value = __spreadProps(__spreadValues({}, suggestionResults.value), {
8430
8456
  [queryKey]: flattenSuggestions(result.items, (_a = publicQuery.searchText) != null ? _a : "")
8431
8457
  });
8432
8458
  inputValue.value = publicQuery.searchText;
@@ -8463,12 +8489,12 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8463
8489
  }) {
8464
8490
  try {
8465
8491
  const context = getLupaTrackingContext();
8466
- const result = yield LupaSearchSdk.query(queryKey, __spreadValues2(__spreadValues2({}, publicQuery), context), options2);
8492
+ const result = yield LupaSearchSdk.query(queryKey, __spreadValues(__spreadValues({}, publicQuery), context), options2);
8467
8493
  if (!result.success) {
8468
8494
  return { queryKey, result: { items: [] } };
8469
8495
  }
8470
8496
  highlightChange({ action: "clear" });
8471
- docResults.value = __spreadProps2(__spreadValues2({}, docResults.value), { [queryKey]: result });
8497
+ docResults.value = __spreadProps(__spreadValues({}, docResults.value), { [queryKey]: result });
8472
8498
  emitSearchResultsCallback();
8473
8499
  return { queryKey, result };
8474
8500
  } catch (err) {
@@ -8515,7 +8541,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8515
8541
  resetHighlightIndex
8516
8542
  };
8517
8543
  });
8518
- const _hoisted_1$1f = { id: "lupa-search-box-input-container" };
8544
+ const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
8519
8545
  const _hoisted_2$R = { class: "lupa-input-clear" };
8520
8546
  const _hoisted_3$B = { id: "lupa-search-box-input" };
8521
8547
  const _hoisted_4$t = ["value"];
@@ -8570,7 +8596,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8570
8596
  );
8571
8597
  const inputAttributes = computed(() => {
8572
8598
  var _a;
8573
- return __spreadValues2({}, (_a = props.options.inputAttributes) != null ? _a : {});
8599
+ return __spreadValues({}, (_a = props.options.inputAttributes) != null ? _a : {});
8574
8600
  });
8575
8601
  const ariaLabel = computed(() => {
8576
8602
  var _a;
@@ -8612,7 +8638,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8612
8638
  };
8613
8639
  __expose({ focus });
8614
8640
  return (_ctx, _cache) => {
8615
- return openBlock(), createElementBlock("div", _hoisted_1$1f, [
8641
+ return openBlock(), createElementBlock("div", _hoisted_1$1d, [
8616
8642
  createBaseVNode("div", _hoisted_2$R, [
8617
8643
  createBaseVNode("div", {
8618
8644
  class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
@@ -8690,7 +8716,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
8690
8716
  };
8691
8717
  }
8692
8718
  });
8693
- const _hoisted_1$1e = { class: "lupa-search-box-history-item" };
8719
+ const _hoisted_1$1c = { class: "lupa-search-box-history-item" };
8694
8720
  const _hoisted_2$Q = { class: "lupa-search-box-history-item-content" };
8695
8721
  const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8696
8722
  __name: "SearchBoxHistoryItem",
@@ -8708,7 +8734,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8708
8734
  emit2("click", { query: props.item });
8709
8735
  };
8710
8736
  return (_ctx, _cache) => {
8711
- return openBlock(), createElementBlock("div", _hoisted_1$1e, [
8737
+ return openBlock(), createElementBlock("div", _hoisted_1$1c, [
8712
8738
  createBaseVNode("div", _hoisted_2$Q, [
8713
8739
  createBaseVNode("div", {
8714
8740
  class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
@@ -8723,7 +8749,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8723
8749
  };
8724
8750
  }
8725
8751
  });
8726
- const _hoisted_1$1d = {
8752
+ const _hoisted_1$1b = {
8727
8753
  key: 0,
8728
8754
  class: "lupa-search-box-history-panel"
8729
8755
  };
@@ -8768,7 +8794,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
8768
8794
  }
8769
8795
  };
8770
8796
  return (_ctx, _cache) => {
8771
- return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1d, [
8797
+ return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1b, [
8772
8798
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
8773
8799
  return openBlock(), createBlock(_sfc_main$1l, {
8774
8800
  key: item,
@@ -8786,7 +8812,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
8786
8812
  };
8787
8813
  }
8788
8814
  });
8789
- const _hoisted_1$1c = { class: "lupa-search-box-no-results" };
8815
+ const _hoisted_1$1a = { class: "lupa-search-box-no-results" };
8790
8816
  const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8791
8817
  __name: "SearchBoxNoResults",
8792
8818
  props: {
@@ -8794,11 +8820,11 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8794
8820
  },
8795
8821
  setup(__props) {
8796
8822
  return (_ctx, _cache) => {
8797
- return openBlock(), createElementBlock("p", _hoisted_1$1c, toDisplayString(_ctx.labels.noResults), 1);
8823
+ return openBlock(), createElementBlock("p", _hoisted_1$1a, toDisplayString(_ctx.labels.noResults), 1);
8798
8824
  };
8799
8825
  }
8800
8826
  });
8801
- const _hoisted_1$1b = ["innerHTML"];
8827
+ const _hoisted_1$19 = ["innerHTML"];
8802
8828
  const _hoisted_2$P = {
8803
8829
  key: 1,
8804
8830
  "data-cy": "lupa-suggestion-value",
@@ -8853,7 +8879,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
8853
8879
  class: "lupa-suggestion-value",
8854
8880
  "data-cy": "lupa-suggestion-value",
8855
8881
  innerHTML: _ctx.suggestion.displayHighlight
8856
- }, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8882
+ }, null, 8, _hoisted_1$19)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8857
8883
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8858
8884
  createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
8859
8885
  createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
@@ -8862,7 +8888,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
8862
8888
  };
8863
8889
  }
8864
8890
  });
8865
- const _hoisted_1$1a = {
8891
+ const _hoisted_1$18 = {
8866
8892
  id: "lupa-search-box-suggestions",
8867
8893
  "data-cy": "lupa-search-box-suggestions"
8868
8894
  };
@@ -8926,7 +8952,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
8926
8952
  });
8927
8953
  });
8928
8954
  return (_ctx, _cache) => {
8929
- return openBlock(), createElementBlock("div", _hoisted_1$1a, [
8955
+ return openBlock(), createElementBlock("div", _hoisted_1$18, [
8930
8956
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
8931
8957
  return openBlock(), createBlock(_sfc_main$1i, {
8932
8958
  key: getSuggestionKey(item),
@@ -9058,7 +9084,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
9058
9084
  if (!requestedIds.length) {
9059
9085
  return;
9060
9086
  }
9061
- loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2]: true }), {});
9087
+ loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
9062
9088
  loading.value = true;
9063
9089
  try {
9064
9090
  const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
@@ -9068,10 +9094,10 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
9068
9094
  const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
9069
9095
  const seed = {};
9070
9096
  const dynamicDataIdMapValue = dynamicDataResult.reduce(
9071
- (a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
9097
+ (a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
9072
9098
  seed
9073
9099
  );
9074
- dynamicDataIdMap.value = __spreadValues2(__spreadValues2({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9100
+ dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9075
9101
  } finally {
9076
9102
  loading.value = false;
9077
9103
  loadingIds.value = {};
@@ -9101,7 +9127,7 @@ const replaceImageWithPlaceholder = (e2, placeholder) => {
9101
9127
  targetImage.src = placeholder;
9102
9128
  }
9103
9129
  };
9104
- const _hoisted_1$19 = ["src"];
9130
+ const _hoisted_1$17 = ["src"];
9105
9131
  const _sfc_main$1f = /* @__PURE__ */ defineComponent({
9106
9132
  __name: "ProductImage",
9107
9133
  props: {
@@ -9220,7 +9246,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
9220
9246
  }, { alt: imageAlt.value ? imageAlt.value : void 0 }, {
9221
9247
  onError: replaceWithPlaceholder,
9222
9248
  key: finalUrl.value
9223
- }), null, 16, _hoisted_1$19))
9249
+ }), null, 16, _hoisted_1$17))
9224
9250
  ]),
9225
9251
  _: 1
9226
9252
  })
@@ -9245,7 +9271,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
9245
9271
  };
9246
9272
  }
9247
9273
  });
9248
- const _hoisted_1$18 = ["innerHTML"];
9274
+ const _hoisted_1$16 = ["innerHTML"];
9249
9275
  const _hoisted_2$O = {
9250
9276
  key: 1,
9251
9277
  class: "lupa-search-box-product-title"
@@ -9270,13 +9296,13 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
9270
9296
  key: 0,
9271
9297
  class: "lupa-search-box-product-title",
9272
9298
  innerHTML: title.value
9273
- }, null, 8, _hoisted_1$18)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9299
+ }, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9274
9300
  createBaseVNode("strong", null, toDisplayString(title.value), 1)
9275
9301
  ]));
9276
9302
  };
9277
9303
  }
9278
9304
  });
9279
- const _hoisted_1$17 = ["innerHTML"];
9305
+ const _hoisted_1$15 = ["innerHTML"];
9280
9306
  const _hoisted_2$N = {
9281
9307
  key: 1,
9282
9308
  class: "lupa-search-box-product-description"
@@ -9301,11 +9327,11 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
9301
9327
  key: 0,
9302
9328
  class: "lupa-search-box-product-description",
9303
9329
  innerHTML: description.value
9304
- }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9330
+ }, null, 8, _hoisted_1$15)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9305
9331
  };
9306
9332
  }
9307
9333
  });
9308
- const _hoisted_1$16 = { class: "lupa-search-box-product-price" };
9334
+ const _hoisted_1$14 = { class: "lupa-search-box-product-price" };
9309
9335
  const _sfc_main$1b = /* @__PURE__ */ defineComponent({
9310
9336
  __name: "SearchBoxProductPrice",
9311
9337
  props: {
@@ -9324,13 +9350,12 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
9324
9350
  );
9325
9351
  });
9326
9352
  return (_ctx, _cache) => {
9327
- return openBlock(), createElementBlock("div", _hoisted_1$16, [
9353
+ return openBlock(), createElementBlock("div", _hoisted_1$14, [
9328
9354
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
9329
9355
  ]);
9330
9356
  };
9331
9357
  }
9332
9358
  });
9333
- const _hoisted_1$15 = { class: "lupa-search-box-product-regular-price" };
9334
9359
  const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9335
9360
  __name: "SearchBoxProductRegularPrice",
9336
9361
  props: {
@@ -9340,6 +9365,9 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9340
9365
  },
9341
9366
  setup(__props) {
9342
9367
  const props = __props;
9368
+ const className = computed(() => {
9369
+ return props.options.className;
9370
+ });
9343
9371
  const price = computed(() => {
9344
9372
  var _a, _b;
9345
9373
  return formatPrice(
@@ -9349,11 +9377,13 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9349
9377
  );
9350
9378
  });
9351
9379
  return (_ctx, _cache) => {
9352
- return openBlock(), createElementBlock("div", _hoisted_1$15, toDisplayString(price.value), 1);
9380
+ return openBlock(), createElementBlock("div", {
9381
+ class: normalizeClass([className.value, "lupa-search-box-product-regular-price"])
9382
+ }, toDisplayString(price.value), 3);
9353
9383
  };
9354
9384
  }
9355
9385
  });
9356
- const _hoisted_1$14 = ["innerHTML"];
9386
+ const _hoisted_1$13 = ["innerHTML"];
9357
9387
  const _hoisted_2$M = { key: 0 };
9358
9388
  const _hoisted_3$z = { key: 1 };
9359
9389
  const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
@@ -9384,7 +9414,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
9384
9414
  key: 0,
9385
9415
  class: [className.value, "lupa-search-box-product-custom"],
9386
9416
  innerHTML: text.value
9387
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$14)) : (openBlock(), createElementBlock("div", mergeProps({
9417
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13)) : (openBlock(), createElementBlock("div", mergeProps({
9388
9418
  key: 1,
9389
9419
  class: [className.value, "lupa-search-box-product-custom"]
9390
9420
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
@@ -9396,7 +9426,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
9396
9426
  };
9397
9427
  }
9398
9428
  });
9399
- const _hoisted_1$13 = ["innerHTML"];
9429
+ const _hoisted_1$12 = ["innerHTML"];
9400
9430
  const _sfc_main$18 = /* @__PURE__ */ defineComponent({
9401
9431
  __name: "SearchBoxProductCustomHtml",
9402
9432
  props: {
@@ -9417,7 +9447,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
9417
9447
  return openBlock(), createElementBlock("div", mergeProps({
9418
9448
  class: className.value,
9419
9449
  innerHTML: text.value
9420
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13);
9450
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$12);
9421
9451
  };
9422
9452
  }
9423
9453
  });
@@ -9537,17 +9567,17 @@ const useSearchResultStore = defineStore("searchResult", () => {
9537
9567
  return hasResults.value && ((_a = searchResult.value.offset) != null ? _a : 0) >= totalItems.value;
9538
9568
  }
9539
9569
  );
9540
- const setSidebarState = ({ visible }) => {
9541
- if (visible) {
9570
+ const setSidebarState = ({ visible: visible2 }) => {
9571
+ if (visible2) {
9542
9572
  disableBodyScroll();
9543
9573
  } else {
9544
9574
  enableBodyScroll();
9545
9575
  }
9546
- isMobileSidebarVisible.value = visible;
9576
+ isMobileSidebarVisible.value = visible2;
9547
9577
  };
9548
9578
  const queryFacet = (_0) => __async(void 0, [_0], function* ({ queryKey, facetKey }) {
9549
9579
  var _a, _b, _c, _d;
9550
- const query = { searchText: "", filters: __spreadValues2({}, filters.value) };
9580
+ const query = { searchText: "", filters: __spreadValues({}, filters.value) };
9551
9581
  const options = (_a = optionsStore.envOptions) != null ? _a : { environment: "production" };
9552
9582
  const result = yield LupaSearchSdk.query(queryKey, query, options);
9553
9583
  if (!result.success) {
@@ -9555,8 +9585,8 @@ const useSearchResultStore = defineStore("searchResult", () => {
9555
9585
  }
9556
9586
  const facet = (_b = result.facets) == null ? void 0 : _b.find((f2) => f2.key === facetKey);
9557
9587
  const facetItems = (_c = facet == null ? void 0 : facet.items) != null ? _c : [];
9558
- const updatedResult = __spreadProps2(__spreadValues2({}, searchResult.value), {
9559
- facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps2(__spreadValues2({}, f2), { items: facetItems }) : f2)
9588
+ const updatedResult = __spreadProps(__spreadValues({}, searchResult.value), {
9589
+ facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps(__spreadValues({}, f2), { items: facetItems }) : f2)
9560
9590
  });
9561
9591
  searchResult.value = updatedResult;
9562
9592
  });
@@ -9645,7 +9675,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
9645
9675
  filterVisibleFilterValues
9646
9676
  };
9647
9677
  });
9648
- const _hoisted_1$12 = { class: "lupa-search-box-add-to-cart-wrapper" };
9678
+ const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
9649
9679
  const _hoisted_2$L = { class: "lupa-search-box-product-addtocart" };
9650
9680
  const _hoisted_3$y = ["onClick", "disabled"];
9651
9681
  const _sfc_main$17 = /* @__PURE__ */ defineComponent({
@@ -9675,7 +9705,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
9675
9705
  loading.value = false;
9676
9706
  });
9677
9707
  return (_ctx, _cache) => {
9678
- return openBlock(), createElementBlock("div", _hoisted_1$12, [
9708
+ return openBlock(), createElementBlock("div", _hoisted_1$11, [
9679
9709
  createBaseVNode("div", _hoisted_2$L, [
9680
9710
  createBaseVNode("button", {
9681
9711
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
@@ -9689,7 +9719,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
9689
9719
  };
9690
9720
  }
9691
9721
  });
9692
- const _hoisted_1$11 = {
9722
+ const _hoisted_1$10 = {
9693
9723
  key: 1,
9694
9724
  class: "lupa-search-box-element-badge-wrapper"
9695
9725
  };
@@ -9705,7 +9735,7 @@ const __default__$4 = {
9705
9735
  SearchBoxProductAddToCart: _sfc_main$17
9706
9736
  }
9707
9737
  };
9708
- const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$4), {
9738
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
9709
9739
  __name: "SearchBoxProductElement",
9710
9740
  props: {
9711
9741
  item: {},
@@ -9747,7 +9777,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9747
9777
  return props.item;
9748
9778
  }
9749
9779
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
9750
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
9780
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
9751
9781
  });
9752
9782
  const isLoadingDynamicData = (id) => {
9753
9783
  return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
@@ -9763,7 +9793,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9763
9793
  class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
9764
9794
  inStock: _ctx.isInStock
9765
9795
  }, null, 8, ["item", "options", "labels", "class", "inStock"])) : createCommentVNode("", true)
9766
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$11, [
9796
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$10, [
9767
9797
  displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
9768
9798
  key: 0,
9769
9799
  item: enhancedItem.value,
@@ -9777,7 +9807,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9777
9807
  };
9778
9808
  }
9779
9809
  }));
9780
- const _hoisted_1$10 = { class: "lupa-badge-title" };
9810
+ const _hoisted_1$$ = { class: "lupa-badge-title" };
9781
9811
  const _hoisted_2$K = ["src"];
9782
9812
  const _hoisted_3$x = { key: 1 };
9783
9813
  const _hoisted_4$q = {
@@ -9817,7 +9847,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
9817
9847
  class: normalizeClass(["lupa-dynamic-badge", customClassName.value]),
9818
9848
  style: normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
9819
9849
  }, [
9820
- createBaseVNode("span", _hoisted_1$10, [
9850
+ createBaseVNode("span", _hoisted_1$$, [
9821
9851
  image.value ? (openBlock(), createElementBlock("img", {
9822
9852
  key: 0,
9823
9853
  src: image.value
@@ -9829,7 +9859,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
9829
9859
  };
9830
9860
  }
9831
9861
  });
9832
- const _hoisted_1$$ = { class: "lupa-generated-badges" };
9862
+ const _hoisted_1$_ = { class: "lupa-generated-badges" };
9833
9863
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9834
9864
  __name: "SearchResultGeneratedBadges",
9835
9865
  props: {
@@ -9856,7 +9886,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9856
9886
  })).filter((b) => Boolean(b.id));
9857
9887
  });
9858
9888
  return (_ctx, _cache) => {
9859
- return openBlock(), createElementBlock("div", _hoisted_1$$, [
9889
+ return openBlock(), createElementBlock("div", _hoisted_1$_, [
9860
9890
  (openBlock(true), createElementBlock(Fragment, null, renderList(badges.value, (badge) => {
9861
9891
  return openBlock(), createBlock(_sfc_main$15, {
9862
9892
  key: badge.id,
@@ -9868,7 +9898,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9868
9898
  };
9869
9899
  }
9870
9900
  });
9871
- const _hoisted_1$_ = ["innerHTML"];
9901
+ const _hoisted_1$Z = ["innerHTML"];
9872
9902
  const _sfc_main$13 = /* @__PURE__ */ defineComponent({
9873
9903
  __name: "CustomBadge",
9874
9904
  props: {
@@ -9888,11 +9918,11 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
9888
9918
  return openBlock(), createElementBlock("div", {
9889
9919
  class: normalizeClass(className.value),
9890
9920
  innerHTML: text.value
9891
- }, null, 10, _hoisted_1$_);
9921
+ }, null, 10, _hoisted_1$Z);
9892
9922
  };
9893
9923
  }
9894
9924
  });
9895
- const _hoisted_1$Z = { class: "lupa-text-badges" };
9925
+ const _hoisted_1$Y = { class: "lupa-text-badges" };
9896
9926
  const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9897
9927
  __name: "TextBadge",
9898
9928
  props: {
@@ -9908,7 +9938,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9908
9938
  return badges.value.slice(0, props.badge.maxItems);
9909
9939
  });
9910
9940
  return (_ctx, _cache) => {
9911
- return openBlock(), createElementBlock("div", _hoisted_1$Z, [
9941
+ return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9912
9942
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9913
9943
  return openBlock(), createElementBlock("div", {
9914
9944
  class: "lupa-badge lupa-text-badge",
@@ -9919,7 +9949,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9919
9949
  };
9920
9950
  }
9921
9951
  });
9922
- const _hoisted_1$Y = { class: "lupa-image-badges" };
9952
+ const _hoisted_1$X = { class: "lupa-image-badges" };
9923
9953
  const _hoisted_2$J = ["src"];
9924
9954
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9925
9955
  __name: "ImageBadge",
@@ -9941,7 +9971,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9941
9971
  return `${props.badge.rootImageUrl}${src}`;
9942
9972
  };
9943
9973
  return (_ctx, _cache) => {
9944
- return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9974
+ return openBlock(), createElementBlock("div", _hoisted_1$X, [
9945
9975
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9946
9976
  return openBlock(), createElementBlock("div", {
9947
9977
  class: "lupa-badge lupa-image-badge",
@@ -9956,7 +9986,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9956
9986
  };
9957
9987
  }
9958
9988
  });
9959
- const _hoisted_1$X = { id: "lupa-search-results-badges" };
9989
+ const _hoisted_1$W = { id: "lupa-search-results-badges" };
9960
9990
  const __default__$3 = {
9961
9991
  components: {
9962
9992
  CustomBadge: _sfc_main$13,
@@ -9964,7 +9994,7 @@ const __default__$3 = {
9964
9994
  ImageBadge: _sfc_main$11
9965
9995
  }
9966
9996
  };
9967
- const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$3), {
9997
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
9968
9998
  __name: "SearchResultsBadgeWrapper",
9969
9999
  props: {
9970
10000
  position: {},
@@ -9987,7 +10017,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9987
10017
  return props.options.product;
9988
10018
  }
9989
10019
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.options.product) == null ? void 0 : _b.id]) != null ? _d : {};
9990
- return __spreadValues2(__spreadValues2({}, props.options.product), enhancementData);
10020
+ return __spreadValues(__spreadValues({}, props.options.product), enhancementData);
9991
10021
  });
9992
10022
  const badges = computed(() => {
9993
10023
  if (!props.options.elements) {
@@ -9998,7 +10028,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9998
10028
  return !e2.display || e2.display((_a = props.options.product) != null ? _a : {});
9999
10029
  }).map((x) => {
10000
10030
  var _a;
10001
- return __spreadProps2(__spreadValues2({}, x), {
10031
+ return __spreadProps(__spreadValues({}, x), {
10002
10032
  value: ((_a = enhancedProduct.value) == null ? void 0 : _a[x.key]) || "badge",
10003
10033
  product: enhancedProduct.value
10004
10034
  });
@@ -10020,7 +10050,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
10020
10050
  }
10021
10051
  };
10022
10052
  return (_ctx, _cache) => {
10023
- return openBlock(), createElementBlock("div", _hoisted_1$X, [
10053
+ return openBlock(), createElementBlock("div", _hoisted_1$W, [
10024
10054
  createBaseVNode("div", {
10025
10055
  id: "lupa-badges",
10026
10056
  class: normalizeClass(anchorPosition.value)
@@ -10040,7 +10070,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
10040
10070
  };
10041
10071
  }
10042
10072
  }));
10043
- const _hoisted_1$W = ["href"];
10073
+ const _hoisted_1$V = ["href"];
10044
10074
  const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
10045
10075
  const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
10046
10076
  const _hoisted_4$p = {
@@ -10065,7 +10095,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
10065
10095
  return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
10066
10096
  });
10067
10097
  const badgeOptions = computed(() => {
10068
- return __spreadProps2(__spreadValues2({}, props.panelOptions.badges), { product: props.item });
10098
+ return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
10069
10099
  });
10070
10100
  const imageElements = computed(() => {
10071
10101
  var _a, _b;
@@ -10152,7 +10182,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
10152
10182
  isInStock: isInStock.value
10153
10183
  }, null, 8, ["item", "element", "labels", "link", "isInStock"])
10154
10184
  ])) : createCommentVNode("", true)
10155
- ], 16, _hoisted_1$W);
10185
+ ], 16, _hoisted_1$V);
10156
10186
  };
10157
10187
  }
10158
10188
  });
@@ -10204,8 +10234,8 @@ const useTrackingStore = defineStore("tracking", () => {
10204
10234
  const mappedItems = ((_e = trackingOptions.analytics) == null ? void 0 : _e.itemMap) ? items.map(trackingOptions.analytics.itemMap) : items;
10205
10235
  track(
10206
10236
  queryKey,
10207
- __spreadProps2(__spreadValues2({}, data), {
10208
- analytics: data.analytics ? __spreadProps2(__spreadValues2({}, data.analytics), { items: mappedItems }) : void 0,
10237
+ __spreadProps(__spreadValues({}, data), {
10238
+ analytics: data.analytics ? __spreadProps(__spreadValues({}, data.analytics), { items: mappedItems }) : void 0,
10209
10239
  filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
10210
10240
  }),
10211
10241
  options
@@ -10213,7 +10243,7 @@ const useTrackingStore = defineStore("tracking", () => {
10213
10243
  };
10214
10244
  return { trackSearch, trackResults, trackEvent };
10215
10245
  });
10216
- const _hoisted_1$V = { id: "lupa-search-box-products" };
10246
+ const _hoisted_1$U = { id: "lupa-search-box-products" };
10217
10247
  const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10218
10248
  __name: "SearchBoxProducts",
10219
10249
  props: {
@@ -10275,7 +10305,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10275
10305
  handleRoutingEvent(link, event, boxRoutingBehavior.value === "event");
10276
10306
  };
10277
10307
  return (_ctx, _cache) => {
10278
- return openBlock(), createElementBlock("div", _hoisted_1$V, [
10308
+ return openBlock(), createElementBlock("div", _hoisted_1$U, [
10279
10309
  _ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.items, (item, index) => {
10280
10310
  return renderSlot(_ctx.$slots, "productCard", {
10281
10311
  key: index,
@@ -10302,7 +10332,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10302
10332
  };
10303
10333
  }
10304
10334
  });
10305
- const _hoisted_1$U = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10335
+ const _hoisted_1$T = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10306
10336
  const _hoisted_2$H = { key: 0 };
10307
10337
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10308
10338
  __name: "SearchBoxProductsGoToResultsButton",
@@ -10334,7 +10364,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10334
10364
  emit2("goToResults");
10335
10365
  };
10336
10366
  return (_ctx, _cache) => {
10337
- return openBlock(), createElementBlock("div", _hoisted_1$U, [
10367
+ return openBlock(), createElementBlock("div", _hoisted_1$T, [
10338
10368
  createBaseVNode("button", {
10339
10369
  class: "lupa-search-box-documents-go-to-results-button",
10340
10370
  onClick: goToResults
@@ -10499,7 +10529,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10499
10529
  });
10500
10530
  const getItemsDebounced = debounce$1(getItems, props.debounce);
10501
10531
  const documentPanelOptions = computed(() => {
10502
- return __spreadProps2(__spreadValues2({}, props.panel), {
10532
+ return __spreadProps(__spreadValues({}, props.panel), {
10503
10533
  type: SearchBoxPanelType.DOCUMENT
10504
10534
  });
10505
10535
  });
@@ -10523,7 +10553,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10523
10553
  };
10524
10554
  }
10525
10555
  });
10526
- const _hoisted_1$T = {
10556
+ const _hoisted_1$S = {
10527
10557
  key: 0,
10528
10558
  id: "lupa-search-box-panel"
10529
10559
  };
@@ -10547,7 +10577,7 @@ const __default__$2 = {
10547
10577
  SearchBoxRelatedSourceWrapper: _sfc_main$X
10548
10578
  }
10549
10579
  };
10550
- const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$2), {
10580
+ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
10551
10581
  __name: "SearchBoxMainPanel",
10552
10582
  props: {
10553
10583
  options: {},
@@ -10693,7 +10723,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
10693
10723
  ref_key: "panelContainer",
10694
10724
  ref: panelContainer
10695
10725
  }, [
10696
- displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$T, [
10726
+ displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$S, [
10697
10727
  labels.value.closePanel ? (openBlock(), createElementBlock("a", {
10698
10728
  key: 0,
10699
10729
  class: "lupa-search-box-close-panel",
@@ -10776,7 +10806,7 @@ const unbindSearchTriggers = (triggers = [], event) => {
10776
10806
  const elements = getElements(triggers);
10777
10807
  elements.forEach((e2) => e2 == null ? void 0 : e2.removeEventListener(BIND_EVENT, event));
10778
10808
  };
10779
- const _hoisted_1$S = { id: "lupa-search-box" };
10809
+ const _hoisted_1$R = { id: "lupa-search-box" };
10780
10810
  const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
10781
10811
  const _sfc_main$V = /* @__PURE__ */ defineComponent({
10782
10812
  __name: "SearchBox",
@@ -10859,7 +10889,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10859
10889
  const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
10860
10890
  const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
10861
10891
  const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
10862
- if (!isOutsideElement) {
10892
+ if (!isOutsideElement || props.options.keepOpen) {
10863
10893
  return;
10864
10894
  }
10865
10895
  opened.value = false;
@@ -10878,7 +10908,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10878
10908
  case "Tab":
10879
10909
  if ((_b = (_a2 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a2.item) == null ? void 0 : _b.suggestion) {
10880
10910
  e2.preventDefault();
10881
- selectSuggestion(__spreadProps2(__spreadValues2({}, suggestedValue.value), { override: true }));
10911
+ selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
10882
10912
  }
10883
10913
  break;
10884
10914
  case "Enter":
@@ -10893,6 +10923,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10893
10923
  opened.value = true;
10894
10924
  inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
10895
10925
  suggestedValue.value = defaultSuggestedValue;
10926
+ searchBoxStore.resetHighlightIndex();
10896
10927
  trackSearchQuery(value);
10897
10928
  if (props.isSearchContainer) {
10898
10929
  goToResultsDebounced({
@@ -10927,7 +10958,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10927
10958
  };
10928
10959
  const selectSuggestion = (inputSuggestion, shouldSearch = false) => {
10929
10960
  if (inputSuggestion.item.suggestion) {
10930
- suggestedValue.value = __spreadProps2(__spreadValues2({}, inputSuggestion), {
10961
+ suggestedValue.value = __spreadProps(__spreadValues({}, inputSuggestion), {
10931
10962
  override: true
10932
10963
  });
10933
10964
  if (inputSuggestion.override) {
@@ -11025,11 +11056,11 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
11025
11056
  opened.value = false;
11026
11057
  };
11027
11058
  const slotProps = (props2) => {
11028
- return __spreadValues2({}, props2);
11059
+ return __spreadValues({}, props2);
11029
11060
  };
11030
11061
  return (_ctx, _cache) => {
11031
11062
  var _a2;
11032
- return openBlock(), createElementBlock("div", _hoisted_1$S, [
11063
+ return openBlock(), createElementBlock("div", _hoisted_1$R, [
11033
11064
  createBaseVNode("div", _hoisted_2$F, [
11034
11065
  createVNode(_sfc_main$1n, {
11035
11066
  options: inputOptions.value,
@@ -11113,8 +11144,8 @@ const getOffset = (page, limit = 10) => {
11113
11144
  return (page - 1) * limit;
11114
11145
  };
11115
11146
  const getPublicQuery = (publicQuery, initialFilters, isProductList) => {
11116
- return __spreadProps2(__spreadValues2({}, publicQuery), {
11117
- filters: __spreadValues2(__spreadValues2({}, initialFilters), publicQuery.filters),
11147
+ return __spreadProps(__spreadValues({}, publicQuery), {
11148
+ filters: __spreadValues(__spreadValues({}, initialFilters), publicQuery.filters),
11118
11149
  searchText: isProductList ? "" : publicQuery.searchText
11119
11150
  });
11120
11151
  };
@@ -11131,7 +11162,7 @@ const getSearchParams = (url, params, baseUrl) => {
11131
11162
  }
11132
11163
  return searchParams;
11133
11164
  };
11134
- const _hoisted_1$R = {
11165
+ const _hoisted_1$Q = {
11135
11166
  key: 0,
11136
11167
  id: "lupa-search-results-did-you-mean"
11137
11168
  };
@@ -11176,7 +11207,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
11176
11207
  paramStore.goToResults({ searchText, facet });
11177
11208
  };
11178
11209
  return (_ctx, _cache) => {
11179
- return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
11210
+ return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11180
11211
  unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
11181
11212
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
11182
11213
  return openBlock(), createElementBlock("span", { key: index }, [
@@ -11202,7 +11233,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
11202
11233
  };
11203
11234
  }
11204
11235
  });
11205
- const _hoisted_1$Q = {
11236
+ const _hoisted_1$P = {
11206
11237
  key: 0,
11207
11238
  class: "lupa-search-results-summary"
11208
11239
  };
@@ -11222,7 +11253,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
11222
11253
  return addParamsToLabel(props.label, range, `<span>${totalItems.value}</span>`);
11223
11254
  });
11224
11255
  return (_ctx, _cache) => {
11225
- return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11256
+ return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
11226
11257
  createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
11227
11258
  _ctx.clearable ? (openBlock(), createElementBlock("span", {
11228
11259
  key: 0,
@@ -11234,7 +11265,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
11234
11265
  };
11235
11266
  }
11236
11267
  });
11237
- const _hoisted_1$P = {
11268
+ const _hoisted_1$O = {
11238
11269
  key: 0,
11239
11270
  class: "lupa-result-page-title",
11240
11271
  "data-cy": "lupa-result-page-title"
@@ -11285,7 +11316,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
11285
11316
  });
11286
11317
  return (_ctx, _cache) => {
11287
11318
  return openBlock(), createElementBlock("div", null, [
11288
- showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
11319
+ showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$O, [
11289
11320
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
11290
11321
  queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
11291
11322
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
@@ -11307,7 +11338,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
11307
11338
  };
11308
11339
  }
11309
11340
  });
11310
- const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
11341
+ const _hoisted_1$N = { class: "lupa-search-result-filter-value" };
11311
11342
  const _hoisted_2$B = {
11312
11343
  class: "lupa-current-filter-label",
11313
11344
  "data-cy": "lupa-current-filter-label"
@@ -11328,7 +11359,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11328
11359
  emit2("remove", { filter: props.filter });
11329
11360
  };
11330
11361
  return (_ctx, _cache) => {
11331
- return openBlock(), createElementBlock("div", _hoisted_1$O, [
11362
+ return openBlock(), createElementBlock("div", _hoisted_1$N, [
11332
11363
  createBaseVNode("div", {
11333
11364
  class: "lupa-current-filter-action",
11334
11365
  onClick: handleClick
@@ -11339,7 +11370,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11339
11370
  };
11340
11371
  }
11341
11372
  });
11342
- const _hoisted_1$N = { class: "lupa-filter-title-text" };
11373
+ const _hoisted_1$M = { class: "lupa-filter-title-text" };
11343
11374
  const _hoisted_2$A = {
11344
11375
  key: 0,
11345
11376
  class: "lupa-filter-count"
@@ -11422,7 +11453,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11422
11453
  class: "lupa-current-filter-title",
11423
11454
  onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
11424
11455
  }, [
11425
- createBaseVNode("div", _hoisted_1$N, [
11456
+ createBaseVNode("div", _hoisted_1$M, [
11426
11457
  createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
11427
11458
  _ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
11428
11459
  ]),
@@ -11451,7 +11482,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11451
11482
  };
11452
11483
  }
11453
11484
  });
11454
- const _hoisted_1$M = ["href"];
11485
+ const _hoisted_1$L = ["href"];
11455
11486
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
11456
11487
  __name: "CategoryFilterItem",
11457
11488
  props: {
@@ -11489,12 +11520,12 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
11489
11520
  "data-cy": "lupa-child-category-item",
11490
11521
  href: urlLink.value,
11491
11522
  onClick: handleNavigation
11492
- }, toDisplayString(title.value), 9, _hoisted_1$M)
11523
+ }, toDisplayString(title.value), 9, _hoisted_1$L)
11493
11524
  ], 2);
11494
11525
  };
11495
11526
  }
11496
11527
  });
11497
- const _hoisted_1$L = {
11528
+ const _hoisted_1$K = {
11498
11529
  class: "lupa-category-filter",
11499
11530
  "data-cy": "lupa-category-filter"
11500
11531
  };
@@ -11588,7 +11619,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
11588
11619
  };
11589
11620
  __expose({ fetch: fetch2 });
11590
11621
  return (_ctx, _cache) => {
11591
- return openBlock(), createElementBlock("div", _hoisted_1$L, [
11622
+ return openBlock(), createElementBlock("div", _hoisted_1$K, [
11592
11623
  createBaseVNode("div", _hoisted_2$z, [
11593
11624
  hasBackButton.value ? (openBlock(), createElementBlock("a", {
11594
11625
  key: 0,
@@ -11620,7 +11651,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
11620
11651
  };
11621
11652
  }
11622
11653
  });
11623
- const _hoisted_1$K = {
11654
+ const _hoisted_1$J = {
11624
11655
  class: "lupa-search-result-facet-term-values",
11625
11656
  "data-cy": "lupa-search-result-facet-term-values"
11626
11657
  };
@@ -11665,7 +11696,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
11665
11696
  return searchResultStore.filterVisibleFilterValues(facet.value.key, (_b = (_a = facet.value) == null ? void 0 : _a.items) != null ? _b : []);
11666
11697
  });
11667
11698
  const displayValues = computed(() => {
11668
- return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps2(__spreadValues2({}, v), { title: getDisplayValue(v.title) }));
11699
+ return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps(__spreadValues({}, v), { title: getDisplayValue(v.title) }));
11669
11700
  });
11670
11701
  const filteredValues = computed(() => {
11671
11702
  var _a, _b;
@@ -11707,7 +11738,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
11707
11738
  return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
11708
11739
  };
11709
11740
  return (_ctx, _cache) => {
11710
- return openBlock(), createElementBlock("div", _hoisted_1$K, [
11741
+ return openBlock(), createElementBlock("div", _hoisted_1$J, [
11711
11742
  isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
11712
11743
  key: 0,
11713
11744
  class: "lupa-term-filter",
@@ -12606,7 +12637,7 @@ function h(e2, t) {
12606
12637
  return e3 === r[t2];
12607
12638
  });
12608
12639
  }
12609
- var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps2(__spreadValues2({}, { value: { validator: function(e2) {
12640
+ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps(__spreadValues({}, { value: { validator: function(e2) {
12610
12641
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
12611
12642
  }, required: false }, modelValue: { validator: function(e2) {
12612
12643
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
@@ -12619,15 +12650,15 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
12619
12650
  throw new Error("Slider v-model must not be an empty array");
12620
12651
  return { value: l2, initialValue: c3 };
12621
12652
  }(a), c2 = function(t, i, n) {
12622
- const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() => __spreadValues2({ target: "slider-target", focused: "slider-focused", tooltipFocus: "slider-tooltip-focus", tooltipDrag: "slider-tooltip-drag", ltr: "slider-ltr", rtl: "slider-rtl", horizontal: "slider-horizontal", vertical: "slider-vertical", textDirectionRtl: "slider-txt-dir-rtl", textDirectionLtr: "slider-txt-dir-ltr", base: "slider-base", connects: "slider-connects", connect: "slider-connect", origin: "slider-origin", handle: "slider-handle", handleLower: "slider-handle-lower", handleUpper: "slider-handle-upper", touchArea: "slider-touch-area", tooltip: "slider-tooltip", tooltipTop: "slider-tooltip-top", tooltipBottom: "slider-tooltip-bottom", tooltipLeft: "slider-tooltip-left", tooltipRight: "slider-tooltip-right", tooltipHidden: "slider-tooltip-hidden", active: "slider-active", draggable: "slider-draggable", tap: "slider-state-tap", drag: "slider-state-drag", pips: "slider-pips", pipsHorizontal: "slider-pips-horizontal", pipsVertical: "slider-pips-vertical", marker: "slider-marker", markerHorizontal: "slider-marker-horizontal", markerVertical: "slider-marker-vertical", markerNormal: "slider-marker-normal", markerLarge: "slider-marker-large", markerSub: "slider-marker-sub", value: "slider-value", valueHorizontal: "slider-value-horizontal", valueVertical: "slider-value-vertical", valueNormal: "slider-value-normal", valueLarge: "slider-value-large", valueSub: "slider-value-sub" }, o.value));
12653
+ const { classes: o, showTooltip: a2, tooltipPosition: s2, orientation: l2 } = toRefs(t), u2 = computed(() => __spreadValues({ target: "slider-target", focused: "slider-focused", tooltipFocus: "slider-tooltip-focus", tooltipDrag: "slider-tooltip-drag", ltr: "slider-ltr", rtl: "slider-rtl", horizontal: "slider-horizontal", vertical: "slider-vertical", textDirectionRtl: "slider-txt-dir-rtl", textDirectionLtr: "slider-txt-dir-ltr", base: "slider-base", connects: "slider-connects", connect: "slider-connect", origin: "slider-origin", handle: "slider-handle", handleLower: "slider-handle-lower", handleUpper: "slider-handle-upper", touchArea: "slider-touch-area", tooltip: "slider-tooltip", tooltipTop: "slider-tooltip-top", tooltipBottom: "slider-tooltip-bottom", tooltipLeft: "slider-tooltip-left", tooltipRight: "slider-tooltip-right", tooltipHidden: "slider-tooltip-hidden", active: "slider-active", draggable: "slider-draggable", tap: "slider-state-tap", drag: "slider-state-drag", pips: "slider-pips", pipsHorizontal: "slider-pips-horizontal", pipsVertical: "slider-pips-vertical", marker: "slider-marker", markerHorizontal: "slider-marker-horizontal", markerVertical: "slider-marker-vertical", markerNormal: "slider-marker-normal", markerLarge: "slider-marker-large", markerSub: "slider-marker-sub", value: "slider-value", valueHorizontal: "slider-value-horizontal", valueVertical: "slider-value-vertical", valueNormal: "slider-value-normal", valueLarge: "slider-value-large", valueSub: "slider-value-sub" }, o.value));
12623
12654
  return { classList: computed(() => {
12624
- const e2 = __spreadValues2({}, u2.value);
12655
+ const e2 = __spreadValues({}, u2.value);
12625
12656
  return Object.keys(e2).forEach((t2) => {
12626
12657
  e2[t2] = Array.isArray(e2[t2]) ? e2[t2].filter((e3) => null !== e3).join(" ") : e2[t2];
12627
12658
  }), "always" !== a2.value && (e2.target += ` ${"drag" === a2.value ? e2.tooltipDrag : e2.tooltipFocus}`), "horizontal" === l2.value && (e2.tooltip += "bottom" === s2.value ? ` ${e2.tooltipBottom}` : ` ${e2.tooltipTop}`), "vertical" === l2.value && (e2.tooltip += "right" === s2.value ? ` ${e2.tooltipRight}` : ` ${e2.tooltipLeft}`), e2;
12628
12659
  }) };
12629
12660
  }(a), p2 = function(t, i, n) {
12630
- const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(__spreadValues2({}, o.value)) : d({ decimals: a2.value >= 0 ? 0 : 2 })), c3 = computed(() => Array.isArray(s2.value) ? s2.value.map((e2) => u2.value) : u2.value);
12661
+ const { format: o, step: a2 } = toRefs(t), s2 = n.value, l2 = n.classList, u2 = computed(() => o && o.value ? "function" == typeof o.value ? { to: o.value } : d(__spreadValues({}, o.value)) : d({ decimals: a2.value >= 0 ? 0 : 2 })), c3 = computed(() => Array.isArray(s2.value) ? s2.value.map((e2) => u2.value) : u2.value);
12631
12662
  return { tooltipFormat: u2, tooltipsFormat: c3, tooltipsMerge: (e2, t2, r) => {
12632
12663
  var i2 = "rtl" === getComputedStyle(e2).direction, n2 = "rtl" === e2.noUiSlider.options.direction, o2 = "vertical" === e2.noUiSlider.options.orientation, a3 = e2.noUiSlider.getTooltips(), s3 = e2.noUiSlider.getOrigins();
12633
12664
  a3.forEach(function(e3, t3) {
@@ -12720,12 +12751,12 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
12720
12751
  R(V.value);
12721
12752
  } };
12722
12753
  }(a, s, { value: l.value, initialValue: l.initialValue, tooltipFormat: p2.tooltipFormat, tooltipsFormat: p2.tooltipsFormat, tooltipsMerge: p2.tooltipsMerge, classList: c2.classList });
12723
- return __spreadValues2(__spreadValues2(__spreadValues2({}, c2), p2), m2);
12754
+ return __spreadValues(__spreadValues(__spreadValues({}, c2), p2), m2);
12724
12755
  } };
12725
12756
  m.render = function(e2, t, r, i, n, o) {
12726
12757
  return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
12727
12758
  }, m.__file = "src/Slider.vue";
12728
- const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
12759
+ const _hoisted_1$I = { class: "lupa-search-result-facet-stats-values" };
12729
12760
  const _hoisted_2$x = {
12730
12761
  key: 0,
12731
12762
  class: "lupa-stats-facet-summary"
@@ -12926,7 +12957,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
12926
12957
  innerSliderRange.value = value;
12927
12958
  };
12928
12959
  return (_ctx, _cache) => {
12929
- return openBlock(), createElementBlock("div", _hoisted_1$J, [
12960
+ return openBlock(), createElementBlock("div", _hoisted_1$I, [
12930
12961
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
12931
12962
  createBaseVNode("div", null, [
12932
12963
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
@@ -12993,7 +13024,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
12993
13024
  };
12994
13025
  }
12995
13026
  });
12996
- const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
13027
+ const _hoisted_1$H = { class: "lupa-term-checkbox-wrapper" };
12997
13028
  const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
12998
13029
  const _hoisted_3$n = { class: "lupa-term-label" };
12999
13030
  const _hoisted_4$h = {
@@ -13050,7 +13081,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
13050
13081
  "data-cy": "lupa-facet-term",
13051
13082
  onClick: _cache[0] || (_cache[0] = ($event) => handleFacetClick(_ctx.item))
13052
13083
  }, [
13053
- createBaseVNode("div", _hoisted_1$I, [
13084
+ createBaseVNode("div", _hoisted_1$H, [
13054
13085
  createBaseVNode("span", {
13055
13086
  class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
13056
13087
  }, null, 2)
@@ -13076,7 +13107,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
13076
13107
  };
13077
13108
  }
13078
13109
  });
13079
- const _hoisted_1$H = {
13110
+ const _hoisted_1$G = {
13080
13111
  class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
13081
13112
  "data-cy": "lupa-search-result-facet-term-values"
13082
13113
  };
@@ -13132,7 +13163,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
13132
13163
  showAll.value = true;
13133
13164
  };
13134
13165
  return (_ctx, _cache) => {
13135
- return openBlock(), createElementBlock("div", _hoisted_1$H, [
13166
+ return openBlock(), createElementBlock("div", _hoisted_1$G, [
13136
13167
  isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
13137
13168
  withDirectives(createBaseVNode("input", {
13138
13169
  class: "lupa-term-filter",
@@ -13164,7 +13195,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
13164
13195
  };
13165
13196
  }
13166
13197
  });
13167
- const _hoisted_1$G = { class: "lupa-facet-label-text" };
13198
+ const _hoisted_1$F = { class: "lupa-facet-label-text" };
13168
13199
  const _hoisted_2$u = {
13169
13200
  key: 0,
13170
13201
  class: "lupa-facet-content",
@@ -13177,7 +13208,7 @@ const __default__$1 = {
13177
13208
  HierarchyFacet: _sfc_main$K
13178
13209
  }
13179
13210
  };
13180
- const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
13211
+ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
13181
13212
  __name: "FacetDisplay",
13182
13213
  props: {
13183
13214
  options: {},
@@ -13289,7 +13320,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
13289
13320
  "data-cy": "lupa-search-result-facet-label",
13290
13321
  onClick: toggleFacet
13291
13322
  }, [
13292
- createBaseVNode("div", _hoisted_1$G, toDisplayString(facet.value.label), 1),
13323
+ createBaseVNode("div", _hoisted_1$F, toDisplayString(facet.value.label), 1),
13293
13324
  createBaseVNode("div", {
13294
13325
  class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
13295
13326
  }, null, 2)
@@ -13312,7 +13343,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
13312
13343
  };
13313
13344
  }
13314
13345
  }));
13315
- const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
13346
+ const _hoisted_1$E = { class: "lupa-search-result-facet-section" };
13316
13347
  const _hoisted_2$t = {
13317
13348
  key: 0,
13318
13349
  class: "lupa-facets-title"
@@ -13351,7 +13382,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
13351
13382
  };
13352
13383
  return (_ctx, _cache) => {
13353
13384
  var _a;
13354
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
13385
+ return openBlock(), createElementBlock("div", _hoisted_1$E, [
13355
13386
  _ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
13356
13387
  createBaseVNode("div", {
13357
13388
  class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
@@ -13373,7 +13404,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
13373
13404
  };
13374
13405
  }
13375
13406
  });
13376
- const _hoisted_1$E = ["onClick"];
13407
+ const _hoisted_1$D = ["onClick"];
13377
13408
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
13378
13409
  __name: "FacetsButton",
13379
13410
  props: {
@@ -13394,11 +13425,11 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
13394
13425
  key: 0,
13395
13426
  class: "lupa-facets-button-filter",
13396
13427
  onClick: withModifiers(handleClick, ["stop"])
13397
- }, toDisplayString(label.value), 9, _hoisted_1$E)) : createCommentVNode("", true);
13428
+ }, toDisplayString(label.value), 9, _hoisted_1$D)) : createCommentVNode("", true);
13398
13429
  };
13399
13430
  }
13400
13431
  });
13401
- const _hoisted_1$D = { class: "lupa-search-result-facets" };
13432
+ const _hoisted_1$C = { class: "lupa-search-result-facets" };
13402
13433
  const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
13403
13434
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
13404
13435
  __name: "Facets",
@@ -13483,7 +13514,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
13483
13514
  emit2("filter");
13484
13515
  };
13485
13516
  return (_ctx, _cache) => {
13486
- return openBlock(), createElementBlock("div", _hoisted_1$D, [
13517
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
13487
13518
  regularFacets.value ? (openBlock(), createBlock(_sfc_main$I, {
13488
13519
  key: 0,
13489
13520
  options: _ctx.options,
@@ -13505,7 +13536,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
13505
13536
  };
13506
13537
  }
13507
13538
  });
13508
- const _hoisted_1$C = {
13539
+ const _hoisted_1$B = {
13509
13540
  id: "lupa-search-result-filters",
13510
13541
  class: "lupa-search-result-filters"
13511
13542
  };
@@ -13542,7 +13573,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13542
13573
  __expose({ fetch: fetch2 });
13543
13574
  return (_ctx, _cache) => {
13544
13575
  var _a;
13545
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
13576
+ return openBlock(), createElementBlock("div", _hoisted_1$B, [
13546
13577
  showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$Q, {
13547
13578
  key: 0,
13548
13579
  options: _ctx.options.currentFilters,
@@ -13563,7 +13594,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13563
13594
  };
13564
13595
  }
13565
13596
  });
13566
- const _hoisted_1$B = {
13597
+ const _hoisted_1$A = {
13567
13598
  key: 0,
13568
13599
  class: "lupa-mobile-filter-sidebar"
13569
13600
  };
@@ -13607,7 +13638,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13607
13638
  handleMobileToggle();
13608
13639
  };
13609
13640
  return (_ctx, _cache) => {
13610
- return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
13641
+ return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
13611
13642
  createBaseVNode("div", {
13612
13643
  class: "lupa-sidebar-close",
13613
13644
  onClick: withModifiers(handleMobileToggle, ["stop"])
@@ -13635,7 +13666,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13635
13666
  };
13636
13667
  }
13637
13668
  });
13638
- const _hoisted_1$A = { id: "lupa-search-results-breadcrumbs" };
13669
+ const _hoisted_1$z = { id: "lupa-search-results-breadcrumbs" };
13639
13670
  const _hoisted_2$q = ["href", "onClick"];
13640
13671
  const _hoisted_3$k = {
13641
13672
  key: 1,
@@ -13667,7 +13698,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13667
13698
  handleRoutingEvent(link, event, hasEventRouting.value);
13668
13699
  };
13669
13700
  return (_ctx, _cache) => {
13670
- return openBlock(), createElementBlock("div", _hoisted_1$A, [
13701
+ return openBlock(), createElementBlock("div", _hoisted_1$z, [
13671
13702
  (openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbsValue.value, (breadcrumb, index) => {
13672
13703
  return openBlock(), createElementBlock("span", {
13673
13704
  class: "lupa-search-results-breadcrumb",
@@ -13689,9 +13720,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13689
13720
  };
13690
13721
  }
13691
13722
  });
13692
- const _hoisted_1$z = {
13723
+ const _hoisted_1$y = {
13693
13724
  id: "lupa-search-result-filters",
13694
- class: "lupa-search-result-filters"
13725
+ class: "lupa-search-result-filters lupa-search-result-top-filters"
13695
13726
  };
13696
13727
  const _sfc_main$C = /* @__PURE__ */ defineComponent({
13697
13728
  __name: "FiltersTopDropdown",
@@ -13705,7 +13736,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13705
13736
  };
13706
13737
  return (_ctx, _cache) => {
13707
13738
  var _a;
13708
- return openBlock(), createElementBlock("div", _hoisted_1$z, [
13739
+ return openBlock(), createElementBlock("div", _hoisted_1$y, [
13709
13740
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$G, {
13710
13741
  key: 0,
13711
13742
  options: _ctx.options.facets,
@@ -13717,7 +13748,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13717
13748
  };
13718
13749
  }
13719
13750
  });
13720
- const _hoisted_1$y = { id: "lupa-search-results-layout-selection" };
13751
+ const _hoisted_1$x = { id: "lupa-search-results-layout-selection" };
13721
13752
  const _sfc_main$B = /* @__PURE__ */ defineComponent({
13722
13753
  __name: "SearchResultsLayoutSelection",
13723
13754
  setup(__props) {
@@ -13729,7 +13760,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13729
13760
  searchResultStore.setLayout(layout2);
13730
13761
  };
13731
13762
  return (_ctx, _cache) => {
13732
- return openBlock(), createElementBlock("div", _hoisted_1$y, [
13763
+ return openBlock(), createElementBlock("div", _hoisted_1$x, [
13733
13764
  createBaseVNode("div", {
13734
13765
  class: normalizeClass([
13735
13766
  "lupa-layout-selection-grid",
@@ -13751,7 +13782,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13751
13782
  };
13752
13783
  }
13753
13784
  });
13754
- const _hoisted_1$x = {
13785
+ const _hoisted_1$w = {
13755
13786
  key: 0,
13756
13787
  class: "lupa-mobile-toggle-filter-count"
13757
13788
  };
@@ -13773,12 +13804,12 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
13773
13804
  onClick: handleMobileToggle
13774
13805
  }, [
13775
13806
  createTextVNode(toDisplayString(_ctx.label) + " ", 1),
13776
- _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$x, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13807
+ _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$w, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13777
13808
  ], 2);
13778
13809
  };
13779
13810
  }
13780
13811
  });
13781
- const _hoisted_1$w = {
13812
+ const _hoisted_1$v = {
13782
13813
  key: 0,
13783
13814
  id: "lupa-search-results-page-select",
13784
13815
  "data-cy": "lupa-search-results-page-select"
@@ -13869,7 +13900,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
13869
13900
  }
13870
13901
  };
13871
13902
  return (_ctx, _cache) => {
13872
- return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
13903
+ return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
13873
13904
  showBack.value ? (openBlock(), createElementBlock("div", {
13874
13905
  key: 0,
13875
13906
  class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
@@ -13913,7 +13944,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
13913
13944
  };
13914
13945
  }
13915
13946
  });
13916
- const _hoisted_1$v = {
13947
+ const _hoisted_1$u = {
13917
13948
  id: "lupa-search-results-page-size",
13918
13949
  "data-cy": "lupa-search-results-page-size"
13919
13950
  };
@@ -13940,6 +13971,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13940
13971
  var _a, _b;
13941
13972
  return (_b = (_a = props.labels) == null ? void 0 : _a.pageSize) != null ? _b : "";
13942
13973
  });
13974
+ const sizes = computed(() => props.options.sizes);
13943
13975
  const handleSelect = (e2) => {
13944
13976
  const value = e2.target.value;
13945
13977
  paramsStore.appendParams({
@@ -13948,7 +13980,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13948
13980
  });
13949
13981
  };
13950
13982
  return (_ctx, _cache) => {
13951
- return openBlock(), createElementBlock("div", _hoisted_1$v, [
13983
+ return openBlock(), createElementBlock("div", _hoisted_1$u, [
13952
13984
  createBaseVNode("div", _hoisted_2$o, [
13953
13985
  createBaseVNode("label", _hoisted_3$i, toDisplayString(label.value), 1),
13954
13986
  createBaseVNode("select", {
@@ -13959,7 +13991,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13959
13991
  ref_key: "select",
13960
13992
  ref: select
13961
13993
  }, [
13962
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options.sizes, (option) => {
13994
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sizes.value, (option) => {
13963
13995
  return openBlock(), createElementBlock("option", {
13964
13996
  key: option,
13965
13997
  value: option
@@ -13971,7 +14003,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13971
14003
  };
13972
14004
  }
13973
14005
  });
13974
- const _hoisted_1$u = {
14006
+ const _hoisted_1$t = {
13975
14007
  id: "lupa-search-results-sort",
13976
14008
  class: "lupa-search-results-sort"
13977
14009
  };
@@ -14028,7 +14060,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
14028
14060
  previousKey.value = selectedKey.value;
14029
14061
  };
14030
14062
  return (_ctx, _cache) => {
14031
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
14063
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
14032
14064
  createBaseVNode("div", _hoisted_2$n, [
14033
14065
  createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.options.label), 1),
14034
14066
  withDirectives(createBaseVNode("select", {
@@ -14053,7 +14085,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
14053
14085
  };
14054
14086
  }
14055
14087
  });
14056
- const _hoisted_1$t = { class: "lupa-toolbar-left" };
14088
+ const _hoisted_1$s = { class: "lupa-toolbar-left" };
14057
14089
  const _hoisted_2$m = {
14058
14090
  key: 0,
14059
14091
  class: "lupa-toolbar-right-title"
@@ -14175,7 +14207,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
14175
14207
  id: "lupa-search-results-toolbar",
14176
14208
  class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
14177
14209
  }, [
14178
- createBaseVNode("div", _hoisted_1$t, [
14210
+ createBaseVNode("div", _hoisted_1$s, [
14179
14211
  toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
14180
14212
  showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$g)),
14181
14213
  showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
@@ -14229,7 +14261,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14229
14261
  };
14230
14262
  }
14231
14263
  });
14232
- const _hoisted_1$s = ["innerHTML"];
14264
+ const _hoisted_1$r = ["innerHTML"];
14233
14265
  const _hoisted_2$l = ["title"];
14234
14266
  const _hoisted_3$f = {
14235
14267
  key: 0,
@@ -14269,7 +14301,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14269
14301
  class: "lupa-search-results-product-title",
14270
14302
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14271
14303
  innerHTML: title.value
14272
- }, null, 12, _hoisted_1$s)) : (openBlock(), createElementBlock("div", {
14304
+ }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14273
14305
  key: 1,
14274
14306
  class: "lupa-search-results-product-title",
14275
14307
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
@@ -14286,7 +14318,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14286
14318
  };
14287
14319
  }
14288
14320
  });
14289
- const _hoisted_1$r = ["innerHTML"];
14321
+ const _hoisted_1$q = ["innerHTML"];
14290
14322
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
14291
14323
  __name: "SearchResultsProductDescription",
14292
14324
  props: {
@@ -14311,7 +14343,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
14311
14343
  class: "lupa-search-results-product-description",
14312
14344
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14313
14345
  innerHTML: description.value
14314
- }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14346
+ }, null, 12, _hoisted_1$q)) : (openBlock(), createElementBlock("div", {
14315
14347
  key: 1,
14316
14348
  class: "lupa-search-results-product-description",
14317
14349
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`)
@@ -14319,7 +14351,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
14319
14351
  };
14320
14352
  }
14321
14353
  });
14322
- const _hoisted_1$q = { id: "lupa-search-results-rating" };
14354
+ const _hoisted_1$p = { id: "lupa-search-results-rating" };
14323
14355
  const _hoisted_2$k = { class: "lupa-ratings" };
14324
14356
  const _hoisted_3$e = { class: "lupa-ratings-base" };
14325
14357
  const _hoisted_4$9 = ["innerHTML"];
@@ -14358,7 +14390,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
14358
14390
  return generateLink(props.options.links.ratingDetails, props.item);
14359
14391
  });
14360
14392
  return (_ctx, _cache) => {
14361
- return openBlock(), createElementBlock("div", _hoisted_1$q, [
14393
+ return openBlock(), createElementBlock("div", _hoisted_1$p, [
14362
14394
  createBaseVNode("div", _hoisted_2$k, [
14363
14395
  createBaseVNode("div", _hoisted_3$e, [
14364
14396
  (openBlock(true), createElementBlock(Fragment, null, renderList(baseStars.value, (star, index) => {
@@ -14392,7 +14424,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
14392
14424
  };
14393
14425
  }
14394
14426
  });
14395
- const _hoisted_1$p = {
14427
+ const _hoisted_1$o = {
14396
14428
  class: "lupa-search-results-product-regular-price",
14397
14429
  "data-cy": "lupa-search-results-product-regular-price"
14398
14430
  };
@@ -14414,14 +14446,10 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
14414
14446
  );
14415
14447
  });
14416
14448
  return (_ctx, _cache) => {
14417
- return openBlock(), createElementBlock("div", _hoisted_1$p, toDisplayString(price.value), 1);
14449
+ return openBlock(), createElementBlock("div", _hoisted_1$o, toDisplayString(price.value), 1);
14418
14450
  };
14419
14451
  }
14420
14452
  });
14421
- const _hoisted_1$o = {
14422
- class: "lupa-search-results-product-price",
14423
- "data-cy": "lupa-search-results-product-price"
14424
- };
14425
14453
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
14426
14454
  __name: "SearchResultsProductPrice",
14427
14455
  props: {
@@ -14431,6 +14459,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
14431
14459
  },
14432
14460
  setup(__props) {
14433
14461
  const props = __props;
14462
+ const className = computed(() => {
14463
+ return props.options.className;
14464
+ });
14434
14465
  const price = computed(() => {
14435
14466
  var _a, _b;
14436
14467
  return formatPrice(
@@ -14440,9 +14471,12 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
14440
14471
  );
14441
14472
  });
14442
14473
  return (_ctx, _cache) => {
14443
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
14474
+ return openBlock(), createElementBlock("div", {
14475
+ class: normalizeClass([className.value, "lupa-search-results-product-price"]),
14476
+ "data-cy": "lupa-search-results-product-price"
14477
+ }, [
14444
14478
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
14445
- ]);
14479
+ ], 2);
14446
14480
  };
14447
14481
  }
14448
14482
  });
@@ -14637,7 +14671,7 @@ const __default__ = {
14637
14671
  SearchResultsProductSingleStarRating: _sfc_main$m
14638
14672
  }
14639
14673
  };
14640
- const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__), {
14674
+ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
14641
14675
  __name: "SearchResultsProductCardElement",
14642
14676
  props: {
14643
14677
  item: {},
@@ -14682,7 +14716,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
14682
14716
  return props.item;
14683
14717
  }
14684
14718
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
14685
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
14719
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
14686
14720
  });
14687
14721
  const displayElement = computed(() => {
14688
14722
  return props.element.display ? props.element.display(enhancedItem.value) : true;
@@ -14741,7 +14775,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14741
14775
  return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
14742
14776
  });
14743
14777
  const badgesOptions = computed(() => {
14744
- return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
14778
+ return __spreadProps(__spreadValues({}, props.options.badges), { product: props.product });
14745
14779
  });
14746
14780
  const imageElements = computed(() => {
14747
14781
  var _a, _b;
@@ -15064,7 +15098,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15064
15098
  };
15065
15099
  const handleQueryChange = () => {
15066
15100
  const context = getLupaTrackingContext();
15067
- const queryBody = __spreadProps2(__spreadValues2({}, context), {
15101
+ const queryBody = __spreadProps(__spreadValues({}, context), {
15068
15102
  limit: props.panel.totalCountLimit,
15069
15103
  searchText: query.value
15070
15104
  });
@@ -15545,7 +15579,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15545
15579
  window.addEventListener("resize", handleResize);
15546
15580
  yield redirectionStore.initiate(props.options.redirections, props.options.options);
15547
15581
  if (props.initialData) {
15548
- searchResultStore.add(__spreadValues2({}, props.initialData));
15582
+ searchResultStore.add(__spreadValues({}, props.initialData));
15549
15583
  }
15550
15584
  handleMounted();
15551
15585
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
@@ -15598,7 +15632,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15598
15632
  });
15599
15633
  const context = getLupaTrackingContext();
15600
15634
  const limit = publicQuery.limit || defaultSearchResultPageSize.value;
15601
- const query2 = __spreadProps2(__spreadValues2(__spreadValues2({}, publicQuery), context), { limit });
15635
+ const query2 = __spreadProps(__spreadValues(__spreadValues({}, publicQuery), context), { limit });
15602
15636
  const redirectionApplied = redirectionStore.redirectOnKeywordIfConfigured(
15603
15637
  publicQuery.searchText,
15604
15638
  optionStore.searchResultsRoutingBehavior
@@ -15613,7 +15647,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15613
15647
  var _a, _b;
15614
15648
  if (res.success) {
15615
15649
  handleResults({ queryKey: props.options.queryKey, results: res });
15616
- searchResultStore.add(__spreadValues2({}, res));
15650
+ searchResultStore.add(__spreadValues({}, res));
15617
15651
  } else if ((_b = (_a = props.options) == null ? void 0 : _a.options) == null ? void 0 : _b.onError) {
15618
15652
  props.options.options.onError(res);
15619
15653
  }
@@ -15682,7 +15716,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15682
15716
  if (typeof window !== "undefined") {
15683
15717
  optionStore.setSearchResultOptions({ options: props.options });
15684
15718
  if (props.initialData) {
15685
- searchResultStore.add(__spreadValues2({}, props.initialData));
15719
+ searchResultStore.add(__spreadValues({}, props.initialData));
15686
15720
  }
15687
15721
  handleMounted();
15688
15722
  return;
@@ -15693,7 +15727,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15693
15727
  (_b = props.options.ssr) == null ? void 0 : _b.baseUrl
15694
15728
  );
15695
15729
  optionStore.setSearchResultOptions({ options: props.options });
15696
- searchResultStore.add(__spreadValues2({}, initialData));
15730
+ searchResultStore.add(__spreadValues({}, initialData));
15697
15731
  paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
15698
15732
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
15699
15733
  handleResults({ queryKey: props.options.queryKey, results: initialData });
@@ -15831,8 +15865,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
15831
15865
  const props = __props;
15832
15866
  const searchResults2 = ref(null);
15833
15867
  const componentOptions = computed(() => {
15834
- return __spreadProps2(__spreadValues2({}, props.options), {
15835
- filters: __spreadProps2(__spreadValues2({}, props.options.filters), {
15868
+ return __spreadProps(__spreadValues({}, props.options), {
15869
+ filters: __spreadProps(__spreadValues({}, props.options.filters), {
15836
15870
  categories: props.options.categories
15837
15871
  })
15838
15872
  });
@@ -22359,11 +22393,11 @@ const Env = {
22359
22393
  production: "https://api.lupasearch.com/v1/",
22360
22394
  staging: "https://api.staging.lupasearch.com/v1/"
22361
22395
  };
22362
- const defaultConfig = {
22396
+ const DEFAULT_REQUEST_CONFIG = {
22363
22397
  method: "POST",
22364
22398
  headers: { "Content-Type": "application/json" }
22365
22399
  };
22366
- const headers = defaultConfig.headers;
22400
+ const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
22367
22401
  const getApiUrl = (environment, customBaseUrl) => {
22368
22402
  if (customBaseUrl) {
22369
22403
  return customBaseUrl;
@@ -22375,13 +22409,13 @@ const suggestSearchChatPhrases = (options, request, chatSettings) => __async(voi
22375
22409
  const { environment, customBaseUrl } = options;
22376
22410
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22377
22411
  try {
22378
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22412
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22379
22413
  body: JSON.stringify(request),
22380
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22414
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22381
22415
  }));
22382
22416
  if (res.status < 400) {
22383
22417
  const data = yield res.json();
22384
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22418
+ return __spreadProps(__spreadValues({}, data), { success: true });
22385
22419
  }
22386
22420
  const errors = yield res.json();
22387
22421
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22398,14 +22432,14 @@ const suggestPhraseAlternatives = (options, request, chatSettings) => __async(vo
22398
22432
  try {
22399
22433
  const res = yield fetch(
22400
22434
  `${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives${model}`,
22401
- __spreadProps2(__spreadValues2({}, defaultConfig), {
22435
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22402
22436
  body: JSON.stringify(request),
22403
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22437
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22404
22438
  })
22405
22439
  );
22406
22440
  if (res.status < 400) {
22407
22441
  const data = yield res.json();
22408
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22442
+ return __spreadProps(__spreadValues({}, data), { success: true });
22409
22443
  }
22410
22444
  const errors = yield res.json();
22411
22445
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22420,13 +22454,13 @@ const suggestBestProductMatches = (options, request, chatSettings) => __async(vo
22420
22454
  const { environment, customBaseUrl } = options;
22421
22455
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22422
22456
  try {
22423
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22457
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22424
22458
  body: JSON.stringify(request),
22425
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22459
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22426
22460
  }));
22427
22461
  if (res.status < 400) {
22428
22462
  const data = yield res.json();
22429
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22463
+ return __spreadProps(__spreadValues({}, data), { success: true });
22430
22464
  }
22431
22465
  const errors = yield res.json();
22432
22466
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22460,9 +22494,9 @@ const prepareChatHistory = (chatLog) => {
22460
22494
  const getTextResponseChunkStream = (options, request, onChunkReceived, chatSettings) => {
22461
22495
  var _a;
22462
22496
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22463
- fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22497
+ fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22464
22498
  body: JSON.stringify(request),
22465
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22499
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22466
22500
  })).then((response) => {
22467
22501
  const reader = response.body.getReader();
22468
22502
  return reader.read().then(function processStream({ done, value }) {
@@ -22854,7 +22888,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
22854
22888
  }
22855
22889
  const validPhrases = phrases.filter((p2) => (p2 == null ? void 0 : p2.trim().length) > 0);
22856
22890
  chatContent.value = chatContent.value.map(
22857
- (c2) => c2.key === key ? __spreadProps2(__spreadValues2({}, c2), {
22891
+ (c2) => c2.key === key ? __spreadProps(__spreadValues({}, c2), {
22858
22892
  allPhrases: [...validPhrases],
22859
22893
  suggestedPhrases: phrases
22860
22894
  }) : c2
@@ -22891,6 +22925,29 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
22891
22925
  };
22892
22926
  }
22893
22927
  });
22928
+ const fetchPluginConfiguration = (options, configurationKey) => __async(void 0, null, function* () {
22929
+ var _a, _b, _c;
22930
+ const { environment, customBaseUrl } = options;
22931
+ try {
22932
+ const res = yield fetch(
22933
+ `${getApiUrl(environment, customBaseUrl)}plugin/configurations/${configurationKey}`,
22934
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22935
+ method: "GET",
22936
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22937
+ })
22938
+ );
22939
+ if (res.status < 400) {
22940
+ const data = yield res.json();
22941
+ return __spreadValues({}, data);
22942
+ }
22943
+ const errors = yield res.json();
22944
+ (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
22945
+ return null;
22946
+ } catch (e2) {
22947
+ (_c = options == null ? void 0 : options.onError) == null ? void 0 : _c.call(options, e2);
22948
+ return null;
22949
+ }
22950
+ });
22894
22951
  let piniaInstance = null;
22895
22952
  const initPinia = () => {
22896
22953
  if (piniaInstance) {
@@ -22906,105 +22963,450 @@ const setupTracking = (options) => {
22906
22963
  initTracking(options);
22907
22964
  store.setTrackingOptions({ options });
22908
22965
  };
22909
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
22910
- var lodash = { exports: {} };
22911
- /**
22912
- * @license
22913
- * Lodash <https://lodash.com/>
22914
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
22915
- * Released under MIT license <https://lodash.com/license>
22916
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
22917
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
22918
- */
22919
- lodash.exports;
22920
- (function(module, exports) {
22921
- (function() {
22922
- var undefined$1;
22923
- var VERSION = "4.17.21";
22924
- var LARGE_ARRAY_SIZE = 200;
22925
- var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
22926
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
22927
- var MAX_MEMOIZE_SIZE = 500;
22928
- var PLACEHOLDER = "__lodash_placeholder__";
22929
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
22930
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
22931
- var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
22932
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
22933
- var HOT_COUNT = 800, HOT_SPAN = 16;
22934
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
22935
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
22936
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
22937
- var wrapFlags = [
22938
- ["ary", WRAP_ARY_FLAG],
22939
- ["bind", WRAP_BIND_FLAG],
22940
- ["bindKey", WRAP_BIND_KEY_FLAG],
22941
- ["curry", WRAP_CURRY_FLAG],
22942
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
22943
- ["flip", WRAP_FLIP_FLAG],
22944
- ["partial", WRAP_PARTIAL_FLAG],
22945
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
22946
- ["rearg", WRAP_REARG_FLAG]
22947
- ];
22948
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
22949
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
22950
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
22951
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
22952
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
22953
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
22954
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
22955
- var reTrimStart = /^\s+/;
22956
- var reWhitespace = /\s/;
22957
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
22958
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
22959
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
22960
- var reEscapeChar = /\\(\\)?/g;
22961
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
22962
- var reFlags = /\w*$/;
22963
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
22964
- var reIsBinary = /^0b[01]+$/i;
22965
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
22966
- var reIsOctal = /^0o[0-7]+$/i;
22967
- var reIsUint = /^(?:0|[1-9]\d*)$/;
22968
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
22969
- var reNoMatch = /($^)/;
22970
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
22971
- var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
22972
- var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
22973
- var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
22974
- var reApos = RegExp(rsApos, "g");
22975
- var reComboMark = RegExp(rsCombo, "g");
22976
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
22977
- var reUnicodeWord = RegExp([
22978
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
22979
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
22980
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
22981
- rsUpper + "+" + rsOptContrUpper,
22982
- rsOrdUpper,
22983
- rsOrdLower,
22984
- rsDigits,
22985
- rsEmoji
22986
- ].join("|"), "g");
22987
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
22988
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
22989
- var contextProps = [
22990
- "Array",
22991
- "Buffer",
22992
- "DataView",
22993
- "Date",
22994
- "Error",
22995
- "Float32Array",
22996
- "Float64Array",
22997
- "Function",
22998
- "Int8Array",
22999
- "Int16Array",
23000
- "Int32Array",
23001
- "Map",
23002
- "Math",
23003
- "Object",
23004
- "Promise",
23005
- "RegExp",
23006
- "Set",
23007
- "String",
22966
+ const displayDiscountedPriceSection = (doc2, options) => {
22967
+ var _a, _b;
22968
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22969
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22970
+ return discountPrice && regularPrice && discountPrice < regularPrice;
22971
+ };
22972
+ const displayRegularPriceSection = (doc2, options) => {
22973
+ var _a, _b;
22974
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22975
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22976
+ const anyPrice = discountPrice || regularPrice;
22977
+ return anyPrice && !displayDiscountedPriceSection(doc2, options);
22978
+ };
22979
+ const escapeHtml = (source) => {
22980
+ if (!source) {
22981
+ return source;
22982
+ }
22983
+ return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
22984
+ };
22985
+ const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
22986
+ if (!value) {
22987
+ return 0;
22988
+ }
22989
+ try {
22990
+ return +parseFloat(`${value}`).toFixed(maxDecimal);
22991
+ } catch (e2) {
22992
+ return `${value}`;
22993
+ }
22994
+ };
22995
+ const capitalize = (value) => {
22996
+ if (!value) {
22997
+ return "";
22998
+ }
22999
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1);
23000
+ };
23001
+ const getAlphanumeric = (value) => {
23002
+ if (!value) {
23003
+ return "";
23004
+ }
23005
+ return value.replace(/[\W_]/g, " ");
23006
+ };
23007
+ const getAdditionalElements = (fields) => {
23008
+ return fields.map((key) => ({
23009
+ type: "custom",
23010
+ key,
23011
+ label: capitalize(getAlphanumeric(key)),
23012
+ className: "lupa-custom",
23013
+ display: (doc2) => Boolean(doc2[key])
23014
+ }));
23015
+ };
23016
+ const addFieldIfKeyExists = (field, key, config) => {
23017
+ if (key) {
23018
+ return config;
23019
+ }
23020
+ return { key: field, type: "customHtml", display: () => false };
23021
+ };
23022
+ const getSearchBoxComponent = ({
23023
+ searchBoxOptions,
23024
+ labels,
23025
+ panelOptions,
23026
+ redirections,
23027
+ placeholderImage
23028
+ }) => {
23029
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
23030
+ const panels = [
23031
+ ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
23032
+ {
23033
+ type: SearchBoxPanelType.SUGGESTION,
23034
+ queryKey: searchBoxOptions.suggestionQueryKey,
23035
+ highlight: true,
23036
+ limit: 8,
23037
+ labels: {
23038
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
23039
+ }
23040
+ }
23041
+ ] : [],
23042
+ ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
23043
+ {
23044
+ type: SearchBoxPanelType.DOCUMENT,
23045
+ queryKey: searchBoxOptions.documentQueryKey,
23046
+ limit: 5,
23047
+ elements: [
23048
+ {
23049
+ type: "image",
23050
+ placeholder: placeholderImage,
23051
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
23052
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
23053
+ },
23054
+ {
23055
+ type: "title",
23056
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
23057
+ maxLines: 2
23058
+ },
23059
+ {
23060
+ type: "regularPrice",
23061
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
23062
+ display: (doc2) => {
23063
+ var _a2, _b2, _c2, _d2;
23064
+ return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
23065
+ }
23066
+ },
23067
+ {
23068
+ type: "price",
23069
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
23070
+ }
23071
+ ]
23072
+ }
23073
+ ] : []
23074
+ ];
23075
+ return {
23076
+ inputSelector: searchBoxOptions.inputSelector,
23077
+ options: {
23078
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
23079
+ customUrl: searchBoxOptions.customUrl,
23080
+ customBaseUrl: searchBoxOptions.customBaseUrl,
23081
+ customPayload: searchBoxOptions.customPayload,
23082
+ customHeaders: searchBoxOptions.customHeaders
23083
+ },
23084
+ showTotalCount: true,
23085
+ expandOnSinglePanel: true,
23086
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
23087
+ debounce: 250,
23088
+ labels: labels == null ? void 0 : labels.searchBox,
23089
+ links: {
23090
+ searchResults: ""
23091
+ },
23092
+ panels,
23093
+ redirections,
23094
+ history: {
23095
+ labels: {
23096
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
23097
+ }
23098
+ }
23099
+ };
23100
+ };
23101
+ const getSearchResultsComponent = ({
23102
+ searchResultOptions,
23103
+ labels,
23104
+ redirections,
23105
+ placeholderImage,
23106
+ configuratorOverrides,
23107
+ callbacks,
23108
+ additionalFields
23109
+ }) => {
23110
+ 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;
23111
+ const filters = searchResultOptions.showFacets ? {
23112
+ currentFilters: {
23113
+ visibility: {
23114
+ mobileSidebar: true,
23115
+ mobileToolbar: true
23116
+ },
23117
+ labels: {
23118
+ title: "",
23119
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
23120
+ }
23121
+ },
23122
+ facets: {
23123
+ labels: {
23124
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
23125
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
23126
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
23127
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
23128
+ },
23129
+ filterable: {
23130
+ minValues: 5
23131
+ },
23132
+ hierarchy: {
23133
+ maxInitialLevel: 2,
23134
+ topLevelValueCountLimit: 5,
23135
+ filterable: true
23136
+ },
23137
+ stats: {
23138
+ slider: true,
23139
+ inputs: true,
23140
+ labels: {
23141
+ from: "",
23142
+ to: ""
23143
+ }
23144
+ },
23145
+ facetValueCountLimit: 8,
23146
+ showDocumentCount: true,
23147
+ style: {
23148
+ type: "sidebar"
23149
+ }
23150
+ }
23151
+ } : {};
23152
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
23153
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
23154
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
23155
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
23156
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
23157
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
23158
+ };
23159
+ const badges = {
23160
+ badges: {
23161
+ anchor: "tr",
23162
+ elements: [
23163
+ ...searchResultOptions.showRelevance ? [
23164
+ {
23165
+ key: "",
23166
+ type: "customHtml",
23167
+ className: "relevance",
23168
+ html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
23169
+ display: (doc2) => Boolean(doc2._relevance !== void 0)
23170
+ }
23171
+ ] : [],
23172
+ ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
23173
+ {
23174
+ key: "",
23175
+ type: "customHtml",
23176
+ className: "boosted-marker",
23177
+ html: () => {
23178
+ var _a2;
23179
+ return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
23180
+ },
23181
+ display: (doc2) => doc2._boosted === true
23182
+ }
23183
+ ] : []
23184
+ ]
23185
+ }
23186
+ };
23187
+ return __spreadValues2(__spreadProps2(__spreadValues2({
23188
+ options: {
23189
+ environment: (_m = searchResultOptions.environment) != null ? _m : "production",
23190
+ customUrl: searchResultOptions.customUrl,
23191
+ customBaseUrl: searchResultOptions.customBaseUrl,
23192
+ customPayload: searchResultOptions.customPayload,
23193
+ customHeaders: searchResultOptions.customHeaders,
23194
+ onError: searchResultOptions.errorHandler
23195
+ },
23196
+ queryKey: searchResultOptions.queryKey,
23197
+ containerSelector: searchResultOptions.containerSelector,
23198
+ searchTitlePosition: "search-results-top",
23199
+ titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
23200
+ labels: labels == null ? void 0 : labels.searchResults,
23201
+ grid: {
23202
+ columns
23203
+ },
23204
+ pagination: {
23205
+ sizeSelection: {
23206
+ position: {
23207
+ top: true,
23208
+ bottom: false
23209
+ },
23210
+ sizes: [12, 24, 36, 48]
23211
+ },
23212
+ pageSelection: {
23213
+ position: {
23214
+ top: false,
23215
+ bottom: true
23216
+ },
23217
+ displayMobile: 3,
23218
+ display: 5
23219
+ }
23220
+ },
23221
+ filters,
23222
+ toolbar: {
23223
+ layoutSelector: false,
23224
+ itemSummary: true,
23225
+ clearFilters: false
23226
+ },
23227
+ isInStock: () => {
23228
+ return true;
23229
+ }
23230
+ }, badges), {
23231
+ links: {
23232
+ details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
23233
+ },
23234
+ callbacks,
23235
+ routingBehavior: callbacks ? "event" : "direct-link",
23236
+ idKey: "id",
23237
+ elements: [
23238
+ {
23239
+ type: "image",
23240
+ placeholder: placeholderImage,
23241
+ key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
23242
+ baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
23243
+ display: () => {
23244
+ var _a2;
23245
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
23246
+ }
23247
+ },
23248
+ addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
23249
+ type: "custom",
23250
+ className: "lupa-custom-emphasis",
23251
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
23252
+ display: () => true
23253
+ }),
23254
+ {
23255
+ type: "title",
23256
+ key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
23257
+ maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
23258
+ display: (doc2) => {
23259
+ var _a2, _b2;
23260
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
23261
+ }
23262
+ },
23263
+ ...getAdditionalElements(additionalFields),
23264
+ addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
23265
+ key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
23266
+ type: "customHtml",
23267
+ className: "lupa-price lupa-price-discounted",
23268
+ display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
23269
+ html: (doc2) => {
23270
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23271
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23272
+ const discountPrice = (_d2 = parseFloat(
23273
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
23274
+ )) == null ? void 0 : _d2.toFixed(2);
23275
+ const regularPrice = (_g2 = parseFloat(
23276
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
23277
+ )) == null ? void 0 : _g2.toFixed(2);
23278
+ const discount = `<span class="lupa-discount">${escapeHtml(
23279
+ discountPrice
23280
+ )} ${currency}</span>`;
23281
+ const regular = `<span class="lupa-regular">${escapeHtml(
23282
+ regularPrice
23283
+ )} ${currency}</span>`;
23284
+ return discount + regular;
23285
+ }
23286
+ }),
23287
+ addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
23288
+ key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
23289
+ type: "customHtml",
23290
+ className: "lupa-price lupa-price-single",
23291
+ display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
23292
+ html: (doc2) => {
23293
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23294
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23295
+ const price = (_g2 = parseFloat(
23296
+ (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
23297
+ )) == null ? void 0 : _g2.toFixed(2);
23298
+ return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
23299
+ }
23300
+ })
23301
+ ],
23302
+ breadcrumbs: [],
23303
+ sort: [],
23304
+ redirections
23305
+ }), configuratorOverrides);
23306
+ };
23307
+ const SearchContainerConfigurationService = {
23308
+ getSearchBoxComponent,
23309
+ getSearchResultsComponent
23310
+ };
23311
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
23312
+ var lodash = { exports: {} };
23313
+ /**
23314
+ * @license
23315
+ * Lodash <https://lodash.com/>
23316
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
23317
+ * Released under MIT license <https://lodash.com/license>
23318
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23319
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
23320
+ */
23321
+ lodash.exports;
23322
+ (function(module, exports) {
23323
+ (function() {
23324
+ var undefined$1;
23325
+ var VERSION = "4.17.21";
23326
+ var LARGE_ARRAY_SIZE = 200;
23327
+ var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
23328
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
23329
+ var MAX_MEMOIZE_SIZE = 500;
23330
+ var PLACEHOLDER = "__lodash_placeholder__";
23331
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
23332
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
23333
+ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
23334
+ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
23335
+ var HOT_COUNT = 800, HOT_SPAN = 16;
23336
+ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
23337
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
23338
+ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
23339
+ var wrapFlags = [
23340
+ ["ary", WRAP_ARY_FLAG],
23341
+ ["bind", WRAP_BIND_FLAG],
23342
+ ["bindKey", WRAP_BIND_KEY_FLAG],
23343
+ ["curry", WRAP_CURRY_FLAG],
23344
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG],
23345
+ ["flip", WRAP_FLIP_FLAG],
23346
+ ["partial", WRAP_PARTIAL_FLAG],
23347
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
23348
+ ["rearg", WRAP_REARG_FLAG]
23349
+ ];
23350
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
23351
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
23352
+ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
23353
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
23354
+ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
23355
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
23356
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
23357
+ var reTrimStart = /^\s+/;
23358
+ var reWhitespace = /\s/;
23359
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
23360
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
23361
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
23362
+ var reEscapeChar = /\\(\\)?/g;
23363
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
23364
+ var reFlags = /\w*$/;
23365
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
23366
+ var reIsBinary = /^0b[01]+$/i;
23367
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23368
+ var reIsOctal = /^0o[0-7]+$/i;
23369
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
23370
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
23371
+ var reNoMatch = /($^)/;
23372
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
23373
+ var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
23374
+ var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
23375
+ var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
23376
+ var reApos = RegExp(rsApos, "g");
23377
+ var reComboMark = RegExp(rsCombo, "g");
23378
+ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
23379
+ var reUnicodeWord = RegExp([
23380
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
23381
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
23382
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
23383
+ rsUpper + "+" + rsOptContrUpper,
23384
+ rsOrdUpper,
23385
+ rsOrdLower,
23386
+ rsDigits,
23387
+ rsEmoji
23388
+ ].join("|"), "g");
23389
+ var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
23390
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
23391
+ var contextProps = [
23392
+ "Array",
23393
+ "Buffer",
23394
+ "DataView",
23395
+ "Date",
23396
+ "Error",
23397
+ "Float32Array",
23398
+ "Float64Array",
23399
+ "Function",
23400
+ "Int8Array",
23401
+ "Int16Array",
23402
+ "Int32Array",
23403
+ "Map",
23404
+ "Math",
23405
+ "Object",
23406
+ "Promise",
23407
+ "RegExp",
23408
+ "Set",
23409
+ "String",
23008
23410
  "Symbol",
23009
23411
  "TypeError",
23010
23412
  "Uint8Array",
@@ -28384,546 +28786,150 @@ lodash.exports;
28384
28786
  (freeModule.exports = _)._ = _;
28385
28787
  freeExports._ = _;
28386
28788
  } else {
28387
- root._ = _;
28388
- }
28389
- }).call(commonjsGlobal);
28390
- })(lodash, lodash.exports);
28391
- var lodashExports = lodash.exports;
28392
- const DEFAULT_SEARCH_BOX_OPTIONS = {
28393
- inputSelector: "#searchBox",
28394
- options: {
28395
- environment: "production"
28396
- },
28397
- showTotalCount: false,
28398
- minInputLength: 1,
28399
- inputAttributes: {
28400
- name: "q"
28401
- },
28402
- debounce: 0,
28403
- labels: {
28404
- placeholder: "Search for products...",
28405
- noResults: "There are no results found.",
28406
- moreResults: "Show more results",
28407
- currency: "€",
28408
- defaultFacetLabel: "Category:"
28409
- },
28410
- links: {
28411
- searchResults: "/search"
28412
- },
28413
- panels: [
28414
- {
28415
- type: "suggestion",
28416
- queryKey: "",
28417
- highlight: true,
28418
- limit: 5
28419
- },
28420
- {
28421
- type: "document",
28422
- queryKey: "",
28423
- limit: 5,
28424
- searchBySuggestion: false,
28425
- links: {
28426
- details: "{url}"
28427
- },
28428
- titleKey: "name",
28429
- elements: []
28430
- }
28431
- ],
28432
- history: {
28433
- labels: {
28434
- clear: "Clear History"
28435
- }
28436
- }
28437
- };
28438
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28439
- __name: "SearchBoxEntry",
28440
- props: {
28441
- searchBoxOptions: {}
28442
- },
28443
- setup(__props, { expose: __expose }) {
28444
- const props = __props;
28445
- const searchBox2 = ref(null);
28446
- const fullSearchBoxOptions = computed(() => {
28447
- const options = lodashExports.cloneDeep(props.searchBoxOptions);
28448
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28449
- });
28450
- const fetch2 = () => {
28451
- var _a;
28452
- (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28453
- };
28454
- __expose({ fetch: fetch2 });
28455
- return (_ctx, _cache) => {
28456
- return openBlock(), createBlock(unref(_sfc_main$V), {
28457
- options: fullSearchBoxOptions.value,
28458
- ref_key: "searchBox",
28459
- ref: searchBox2
28460
- }, null, 8, ["options"]);
28461
- };
28462
- }
28463
- });
28464
- const DEFAULT_OPTIONS_RESULTS = {
28789
+ root._ = _;
28790
+ }
28791
+ }).call(commonjsGlobal);
28792
+ })(lodash, lodash.exports);
28793
+ var lodashExports = lodash.exports;
28794
+ const DEFAULT_SEARCH_BOX_OPTIONS = {
28795
+ inputSelector: "#searchBox",
28465
28796
  options: {
28466
28797
  environment: "production"
28467
28798
  },
28468
- queryKey: "",
28469
- containerSelector: "#searchResultsContainer",
28470
- searchTitlePosition: "page-top",
28799
+ showTotalCount: false,
28800
+ minInputLength: 1,
28801
+ inputAttributes: {
28802
+ name: "q"
28803
+ },
28804
+ debounce: 0,
28471
28805
  labels: {
28472
- pageSize: "Page size:",
28473
- sortBy: "Sort by:",
28474
- itemCount: "Items {1} of {2}",
28475
- filteredItemCount: "",
28806
+ placeholder: "Search for products...",
28807
+ noResults: "There are no results found.",
28808
+ moreResults: "Show more results",
28476
28809
  currency: "€",
28477
- showMore: "Show more",
28478
- searchResults: "Search Query: ",
28479
- emptyResults: "There are no results for the query:",
28480
- mobileFilterButton: "Filter",
28481
- htmlTitleTemplate: "Search Query: '{1}'",
28482
- noResultsSuggestion: "No results found for this query: {1}",
28483
- didYouMean: "Did you mean to search: {1}",
28484
- similarQuery: "Search results for phrase {1}",
28485
- similarQueries: "Similar queries:"
28486
- },
28487
- grid: {
28488
- columns: {
28489
- xl: 4,
28490
- l: 3,
28491
- md: 2,
28492
- sm: 2,
28493
- xs: 1
28494
- }
28810
+ defaultFacetLabel: "Category:"
28495
28811
  },
28496
- pagination: {
28497
- sizeSelection: {
28498
- position: {
28499
- top: false,
28500
- bottom: true
28501
- },
28502
- sizes: [12, 24, 36]
28503
- },
28504
- pageSelection: {
28505
- position: {
28506
- top: false,
28507
- bottom: true
28508
- },
28509
- display: 5,
28510
- displayMobile: 3
28511
- }
28812
+ links: {
28813
+ searchResults: "/search"
28512
28814
  },
28513
- sort: [],
28514
- filters: {
28515
- currentFilters: {
28516
- visibility: {
28517
- mobileSidebar: true,
28518
- mobileToolbar: true
28519
- },
28520
- labels: {
28521
- title: "Current filters:",
28522
- clearAll: "Clear all"
28523
- }
28815
+ panels: [
28816
+ {
28817
+ type: "suggestion",
28818
+ queryKey: "",
28819
+ highlight: true,
28820
+ limit: 5
28524
28821
  },
28525
- facets: {
28526
- labels: {
28527
- title: "Filters:",
28528
- showAll: "Show more",
28529
- facetFilter: "Filter...",
28530
- facetClear: "Clear"
28531
- },
28532
- filterable: {
28533
- minValues: 5
28534
- },
28535
- hierarchy: {
28536
- maxInitialLevel: 2,
28537
- topLevelValueCountLimit: 5,
28538
- filterable: true
28822
+ {
28823
+ type: "document",
28824
+ queryKey: "",
28825
+ limit: 5,
28826
+ searchBySuggestion: false,
28827
+ links: {
28828
+ details: "{url}"
28539
28829
  },
28540
- facetValueCountLimit: 20,
28541
- showDocumentCount: true,
28542
- style: {
28543
- type: "sidebar"
28544
- }
28545
- }
28546
- },
28547
- toolbar: {
28548
- layoutSelector: true,
28549
- itemSummary: true,
28550
- clearFilters: false
28551
- },
28552
- isInStock: () => {
28553
- return true;
28554
- },
28555
- badges: {
28556
- anchor: "tr",
28557
- elements: []
28558
- },
28559
- links: {
28560
- details: "/{id}"
28561
- },
28562
- elements: [],
28563
- breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28564
- };
28565
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28566
- __name: "SearchResultsEntry",
28567
- props: {
28568
- searchResultsOptions: {}
28569
- },
28570
- setup(__props, { expose: __expose }) {
28571
- const props = __props;
28572
- const searchResults2 = ref(null);
28573
- const fullSearchResultsOptions = computed(() => {
28574
- const options = lodashExports.cloneDeep(props.searchResultsOptions);
28575
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28576
- });
28577
- const fetch2 = () => {
28578
- var _a;
28579
- (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28580
- };
28581
- __expose({ fetch: fetch2 });
28582
- return (_ctx, _cache) => {
28583
- return openBlock(), createBlock(unref(_sfc_main$c), {
28584
- options: fullSearchResultsOptions.value,
28585
- ref_key: "searchResults",
28586
- ref: searchResults2
28587
- }, null, 8, ["options"]);
28588
- };
28589
- }
28590
- });
28591
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28592
- __name: "ProductListEntry",
28593
- props: {
28594
- productListOptions: {}
28595
- },
28596
- setup(__props, { expose: __expose }) {
28597
- const props = __props;
28598
- const productList2 = ref(null);
28599
- const fullProductListOptions = computed(() => {
28600
- return lodashExports.cloneDeep(props.productListOptions);
28601
- });
28602
- const fetch2 = () => {
28603
- var _a;
28604
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28605
- };
28606
- __expose({ fetch: fetch2 });
28607
- return (_ctx, _cache) => {
28608
- return openBlock(), createBlock(unref(_sfc_main$a), {
28609
- options: fullProductListOptions.value,
28610
- ref_key: "productList",
28611
- ref: productList2
28612
- }, null, 8, ["options"]);
28613
- };
28614
- }
28615
- });
28616
- const QUERY_PARAMS = {
28617
- QUERY: "q",
28618
- PAGE: "p",
28619
- LIMIT: "l",
28620
- SORT: "s"
28621
- };
28622
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28623
- __name: "SearchContainerEntry",
28624
- props: {
28625
- searchContainerOptions: {}
28626
- },
28627
- setup(__props, { expose: __expose }) {
28628
- const props = __props;
28629
- const isOpen = ref(false);
28630
- const triggerElement = ref(null);
28631
- const productList2 = ref(null);
28632
- const containerOptions = computed(() => {
28633
- return lodashExports.cloneDeep(props.searchContainerOptions);
28634
- });
28635
- const focus = () => {
28636
- const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
28637
- el == null ? void 0 : el.focus();
28638
- };
28639
- const close = () => {
28640
- isOpen.value = false;
28641
- };
28642
- const openSearchContainer = () => {
28643
- isOpen.value = true;
28644
- };
28645
- const checkCloseOnEscape = (e2) => {
28646
- var _a;
28647
- if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
28648
- return;
28649
- }
28650
- isOpen.value = false;
28651
- };
28652
- const checkExistingQuery = () => {
28653
- const url = new URL(window.location.href);
28654
- const param = url.searchParams.get(QUERY_PARAMS.QUERY);
28655
- if (!param) {
28656
- return;
28657
- }
28658
- isOpen.value = true;
28659
- };
28660
- const mountOpenListeners = () => {
28661
- var _a, _b;
28662
- triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
28663
- (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
28664
- window.addEventListener("keydown", checkCloseOnEscape);
28665
- };
28666
- onMounted(() => {
28667
- var _a, _b;
28668
- mountOpenListeners();
28669
- checkExistingQuery();
28670
- isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
28671
- });
28672
- onBeforeUnmount(() => {
28673
- var _a;
28674
- (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
28675
- window.removeEventListener("keydown", checkCloseOnEscape);
28676
- });
28677
- const fetch2 = () => {
28678
- var _a;
28679
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28680
- };
28681
- const reloadOptions = () => {
28682
- var _a;
28683
- (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
28684
- };
28685
- __expose({ fetch: fetch2, reloadOptions });
28686
- return (_ctx, _cache) => {
28687
- return openBlock(), createElementBlock("div", null, [
28688
- containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
28689
- key: 0,
28690
- options: containerOptions.value,
28691
- ref_key: "productList",
28692
- ref: productList2,
28693
- "onHook:mounted": focus,
28694
- onClose: close
28695
- }, null, 8, ["options"])) : createCommentVNode("", true)
28696
- ]);
28697
- };
28830
+ titleKey: "name",
28831
+ elements: []
28832
+ }
28833
+ ],
28834
+ history: {
28835
+ labels: {
28836
+ clear: "Clear History"
28837
+ }
28698
28838
  }
28699
- });
28700
- const _sfc_main = /* @__PURE__ */ defineComponent({
28701
- __name: "RecommendationsEntry",
28839
+ };
28840
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28841
+ __name: "SearchBoxEntry",
28702
28842
  props: {
28703
- recommendationOptions: {}
28843
+ searchBoxOptions: {}
28704
28844
  },
28705
28845
  setup(__props, { expose: __expose }) {
28706
- const productRecommendations = ref(null);
28846
+ const props = __props;
28847
+ const searchBox2 = ref(null);
28848
+ const fullSearchBoxOptions = computed(() => {
28849
+ const options = lodashExports.cloneDeep(props.searchBoxOptions);
28850
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28851
+ });
28707
28852
  const fetch2 = () => {
28708
- productRecommendations == null ? void 0 : productRecommendations.fetch();
28853
+ var _a;
28854
+ (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28709
28855
  };
28710
28856
  __expose({ fetch: fetch2 });
28711
28857
  return (_ctx, _cache) => {
28712
- return openBlock(), createBlock(unref(_sfc_main$8), {
28713
- options: _ctx.recommendationOptions,
28714
- ref_key: "productRecommendations",
28715
- ref: productRecommendations
28858
+ return openBlock(), createBlock(unref(_sfc_main$V), {
28859
+ options: fullSearchBoxOptions.value,
28860
+ ref_key: "searchBox",
28861
+ ref: searchBox2
28716
28862
  }, null, 8, ["options"]);
28717
28863
  };
28718
28864
  }
28719
28865
  });
28720
- const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
28721
- const createShadowDom = (shadowId, managerId) => {
28722
- let host = document.getElementById(shadowId);
28723
- if (host) {
28724
- host.remove();
28725
- }
28726
- host = document.createElement("div");
28727
- const manager = document.createElement("div");
28728
- host.setAttribute("id", shadowId);
28729
- manager == null ? void 0 : manager.setAttribute("id", managerId);
28730
- return { host, manager };
28731
- };
28732
- const attatchShadowDom = ({
28733
- host,
28734
- manager,
28735
- styleUrl,
28736
- options
28737
- }) => {
28738
- var _a;
28739
- if (host.shadowRoot) {
28740
- return;
28741
- }
28742
- const link = document.createElement("link");
28743
- link.type = "text/css";
28744
- link.rel = "stylesheet";
28745
- link.href = styleUrl;
28746
- const fontLink = document.createElement("link");
28747
- fontLink.type = "text/css";
28748
- fontLink.rel = "stylesheet";
28749
- fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
28750
- document.head.appendChild(fontLink);
28751
- const materialIconLink = document.createElement("link");
28752
- materialIconLink.type = "text/css";
28753
- materialIconLink.rel = "stylesheet";
28754
- materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
28755
- document.head.appendChild(materialIconLink);
28756
- const shadow = host.attachShadow({ mode: "open" });
28757
- shadow.appendChild(manager);
28758
- shadow.appendChild(link);
28759
- if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
28760
- const style = document.createElement("style");
28761
- style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
28762
- shadow.appendChild(style);
28763
- }
28764
- };
28765
- const displayDiscountedPriceSection = (doc2, options) => {
28766
- var _a, _b;
28767
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28768
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28769
- return discountPrice && regularPrice && discountPrice < regularPrice;
28770
- };
28771
- const displayRegularPriceSection = (doc2, options) => {
28772
- var _a, _b;
28773
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28774
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28775
- const anyPrice = discountPrice || regularPrice;
28776
- return anyPrice && !displayDiscountedPriceSection(doc2, options);
28777
- };
28778
- const escapeHtml = (source) => {
28779
- if (!source) {
28780
- return source;
28781
- }
28782
- return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
28783
- };
28784
- const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
28785
- if (!value) {
28786
- return 0;
28787
- }
28788
- try {
28789
- return +parseFloat(`${value}`).toFixed(maxDecimal);
28790
- } catch (e2) {
28791
- return `${value}`;
28792
- }
28793
- };
28794
- const capitalize = (value) => {
28795
- if (!value) {
28796
- return "";
28797
- }
28798
- return value.charAt(0).toLocaleUpperCase() + value.slice(1);
28799
- };
28800
- const getAlphanumeric = (value) => {
28801
- if (!value) {
28802
- return "";
28803
- }
28804
- return value.replace(/[\W_]/g, " ");
28805
- };
28806
- const getAdditionalElements = (fields) => {
28807
- return fields.map((key) => ({
28808
- type: "custom",
28809
- key,
28810
- label: capitalize(getAlphanumeric(key)),
28811
- className: "lupa-custom",
28812
- display: (doc2) => Boolean(doc2[key])
28813
- }));
28814
- };
28815
- const addFieldIfKeyExists = (field, key, config) => {
28816
- if (key) {
28817
- return config;
28818
- }
28819
- return { key: field, type: "customHtml", display: () => false };
28820
- };
28821
- const getSearchBoxComponent = ({
28822
- searchBoxOptions,
28823
- labels,
28824
- panelOptions,
28825
- redirections,
28826
- placeholderImage
28827
- }) => {
28828
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
28829
- const panels = [
28830
- ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
28831
- {
28832
- type: SearchBoxPanelType.SUGGESTION,
28833
- queryKey: searchBoxOptions.suggestionQueryKey,
28834
- highlight: true,
28835
- limit: 8,
28836
- labels: {
28837
- topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
28838
- }
28839
- }
28840
- ] : [],
28841
- ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
28842
- {
28843
- type: SearchBoxPanelType.DOCUMENT,
28844
- queryKey: searchBoxOptions.documentQueryKey,
28845
- limit: 5,
28846
- elements: [
28847
- {
28848
- type: "image",
28849
- placeholder: placeholderImage,
28850
- key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
28851
- baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
28852
- },
28853
- {
28854
- type: "title",
28855
- key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
28856
- maxLines: 2
28857
- },
28858
- {
28859
- type: "regularPrice",
28860
- key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
28861
- display: (doc2) => {
28862
- var _a2, _b2, _c2, _d2;
28863
- return ((_a2 = searchBoxOptions.fields) == null ? void 0 : _a2.regularPriceKey) && ((_b2 = searchBoxOptions.fields) == null ? void 0 : _b2.discountPriceKey) && parseFloat(doc2[(_c2 = searchBoxOptions.fields) == null ? void 0 : _c2.regularPriceKey]) > parseFloat(doc2[(_d2 = searchBoxOptions.fields) == null ? void 0 : _d2.discountPriceKey]);
28864
- }
28865
- },
28866
- {
28867
- type: "price",
28868
- key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
28869
- }
28870
- ]
28871
- }
28872
- ] : []
28873
- ];
28874
- return {
28875
- inputSelector: searchBoxOptions.inputSelector,
28876
- options: {
28877
- environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
28878
- customUrl: searchBoxOptions.customUrl,
28879
- customBaseUrl: searchBoxOptions.customBaseUrl,
28880
- customPayload: searchBoxOptions.customPayload,
28881
- customHeaders: searchBoxOptions.customHeaders
28882
- },
28883
- showTotalCount: true,
28884
- expandOnSinglePanel: true,
28885
- minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
28886
- debounce: 250,
28887
- labels: labels == null ? void 0 : labels.searchBox,
28888
- links: {
28889
- searchResults: ""
28866
+ const DEFAULT_OPTIONS_RESULTS = {
28867
+ options: {
28868
+ environment: "production"
28869
+ },
28870
+ queryKey: "",
28871
+ containerSelector: "#searchResultsContainer",
28872
+ searchTitlePosition: "page-top",
28873
+ labels: {
28874
+ pageSize: "Page size:",
28875
+ sortBy: "Sort by:",
28876
+ itemCount: "Items {1} of {2}",
28877
+ filteredItemCount: "",
28878
+ currency: "€",
28879
+ showMore: "Show more",
28880
+ searchResults: "Search Query: ",
28881
+ emptyResults: "There are no results for the query:",
28882
+ mobileFilterButton: "Filter",
28883
+ htmlTitleTemplate: "Search Query: '{1}'",
28884
+ noResultsSuggestion: "No results found for this query: {1}",
28885
+ didYouMean: "Did you mean to search: {1}",
28886
+ similarQuery: "Search results for phrase {1}",
28887
+ similarQueries: "Similar queries:"
28888
+ },
28889
+ grid: {
28890
+ columns: {
28891
+ xl: 4,
28892
+ l: 3,
28893
+ md: 2,
28894
+ sm: 2,
28895
+ xs: 1
28896
+ }
28897
+ },
28898
+ pagination: {
28899
+ sizeSelection: {
28900
+ position: {
28901
+ top: false,
28902
+ bottom: true
28903
+ },
28904
+ sizes: [12, 24, 36]
28890
28905
  },
28891
- panels,
28892
- redirections,
28893
- history: {
28894
- labels: {
28895
- clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
28896
- }
28906
+ pageSelection: {
28907
+ position: {
28908
+ top: false,
28909
+ bottom: true
28910
+ },
28911
+ display: 5,
28912
+ displayMobile: 3
28897
28913
  }
28898
- };
28899
- };
28900
- const getSearchResultsComponent = ({
28901
- searchResultOptions,
28902
- labels,
28903
- redirections,
28904
- placeholderImage,
28905
- configuratorOverrides,
28906
- callbacks,
28907
- additionalFields
28908
- }) => {
28909
- 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;
28910
- const filters = searchResultOptions.showFacets ? {
28914
+ },
28915
+ sort: [],
28916
+ filters: {
28911
28917
  currentFilters: {
28912
28918
  visibility: {
28913
28919
  mobileSidebar: true,
28914
28920
  mobileToolbar: true
28915
28921
  },
28916
28922
  labels: {
28917
- title: "",
28918
- clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
28923
+ title: "Current filters:",
28924
+ clearAll: "Clear all"
28919
28925
  }
28920
28926
  },
28921
28927
  facets: {
28922
28928
  labels: {
28923
- title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
28924
- showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
28925
- facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
28926
- facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
28929
+ title: "Filters:",
28930
+ showAll: "Show more",
28931
+ facetFilter: "Filter...",
28932
+ facetClear: "Clear"
28927
28933
  },
28928
28934
  filterable: {
28929
28935
  minValues: 5
@@ -28933,179 +28939,230 @@ const getSearchResultsComponent = ({
28933
28939
  topLevelValueCountLimit: 5,
28934
28940
  filterable: true
28935
28941
  },
28936
- stats: {
28937
- slider: true,
28938
- inputs: true,
28939
- labels: {
28940
- from: "",
28941
- to: ""
28942
- }
28943
- },
28944
- facetValueCountLimit: 8,
28942
+ facetValueCountLimit: 20,
28945
28943
  showDocumentCount: true,
28946
28944
  style: {
28947
28945
  type: "sidebar"
28948
28946
  }
28949
28947
  }
28950
- } : {};
28951
- const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
28952
- xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
28953
- l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
28954
- md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
28955
- sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
28956
- xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
28957
- };
28958
- const badges = {
28959
- badges: {
28960
- anchor: "tr",
28961
- elements: [
28962
- ...searchResultOptions.showRelevance ? [
28963
- {
28964
- key: "",
28965
- type: "customHtml",
28966
- className: "relevance",
28967
- html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
28968
- display: (doc2) => Boolean(doc2._relevance !== void 0)
28969
- }
28970
- ] : [],
28971
- ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
28972
- {
28973
- key: "",
28974
- type: "customHtml",
28975
- className: "boosted-marker",
28976
- html: () => {
28977
- var _a2;
28978
- return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
28979
- },
28980
- display: (doc2) => doc2._boosted === true
28981
- }
28982
- ] : []
28983
- ]
28984
- }
28985
- };
28986
- return __spreadValues(__spreadProps(__spreadValues({
28987
- options: {
28988
- environment: (_m = searchResultOptions.environment) != null ? _m : "production",
28989
- customUrl: searchResultOptions.customUrl,
28990
- customBaseUrl: searchResultOptions.customBaseUrl,
28991
- customPayload: searchResultOptions.customPayload,
28992
- customHeaders: searchResultOptions.customHeaders,
28993
- onError: searchResultOptions.errorHandler
28994
- },
28995
- queryKey: searchResultOptions.queryKey,
28996
- containerSelector: searchResultOptions.containerSelector,
28997
- searchTitlePosition: "search-results-top",
28998
- titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
28999
- labels: labels == null ? void 0 : labels.searchResults,
29000
- grid: {
29001
- columns
29002
- },
29003
- pagination: {
29004
- sizeSelection: {
29005
- position: {
29006
- top: true,
29007
- bottom: false
29008
- },
29009
- sizes: [12, 24, 36, 48]
29010
- },
29011
- pageSelection: {
29012
- position: {
29013
- top: false,
29014
- bottom: true
29015
- },
29016
- displayMobile: 3,
29017
- display: 5
29018
- }
29019
- },
29020
- filters,
29021
- toolbar: {
29022
- layoutSelector: false,
29023
- itemSummary: true,
29024
- clearFilters: false
29025
- },
29026
- isInStock: () => {
29027
- return true;
29028
- }
29029
- }, badges), {
29030
- links: {
29031
- details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
29032
- },
29033
- callbacks,
29034
- routingBehavior: callbacks ? "event" : "direct-link",
29035
- idKey: "id",
29036
- elements: [
29037
- {
29038
- type: "image",
29039
- placeholder: placeholderImage,
29040
- key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
29041
- baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
29042
- display: () => {
29043
- var _a2;
29044
- return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
29045
- }
29046
- },
29047
- addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
29048
- type: "custom",
29049
- className: "lupa-custom-emphasis",
29050
- key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
29051
- display: () => true
29052
- }),
29053
- {
29054
- type: "title",
29055
- key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
29056
- maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
29057
- display: (doc2) => {
29058
- var _a2, _b2;
29059
- return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
29060
- }
29061
- },
29062
- ...getAdditionalElements(additionalFields),
29063
- addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
29064
- key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
29065
- type: "customHtml",
29066
- className: "lupa-price lupa-price-discounted",
29067
- display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
29068
- html: (doc2) => {
29069
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29070
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29071
- const discountPrice = (_d2 = parseFloat(
29072
- doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
29073
- )) == null ? void 0 : _d2.toFixed(2);
29074
- const regularPrice = (_g2 = parseFloat(
29075
- doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
29076
- )) == null ? void 0 : _g2.toFixed(2);
29077
- const discount = `<span class="lupa-discount">${escapeHtml(
29078
- discountPrice
29079
- )} ${currency}</span>`;
29080
- const regular = `<span class="lupa-regular">${escapeHtml(
29081
- regularPrice
29082
- )} ${currency}</span>`;
29083
- return discount + regular;
29084
- }
29085
- }),
29086
- addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
29087
- key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
29088
- type: "customHtml",
29089
- className: "lupa-price lupa-price-single",
29090
- display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
29091
- html: (doc2) => {
29092
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29093
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29094
- const price = (_g2 = parseFloat(
29095
- (_f2 = doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.regularPriceKey) != null ? _c2 : ""]) != null ? _f2 : doc2[(_e2 = (_d2 = searchResultOptions.fields) == null ? void 0 : _d2.discountPriceKey) != null ? _e2 : ""]
29096
- )) == null ? void 0 : _g2.toFixed(2);
29097
- return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
29098
- }
29099
- })
29100
- ],
29101
- breadcrumbs: [],
29102
- sort: [],
29103
- redirections
29104
- }), configuratorOverrides);
28948
+ },
28949
+ toolbar: {
28950
+ layoutSelector: true,
28951
+ itemSummary: true,
28952
+ clearFilters: false
28953
+ },
28954
+ isInStock: () => {
28955
+ return true;
28956
+ },
28957
+ badges: {
28958
+ anchor: "tr",
28959
+ elements: []
28960
+ },
28961
+ links: {
28962
+ details: "/{id}"
28963
+ },
28964
+ elements: [],
28965
+ breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28966
+ };
28967
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28968
+ __name: "SearchResultsEntry",
28969
+ props: {
28970
+ searchResultsOptions: {}
28971
+ },
28972
+ setup(__props, { expose: __expose }) {
28973
+ const props = __props;
28974
+ const searchResults2 = ref(null);
28975
+ const fullSearchResultsOptions = computed(() => {
28976
+ const options = lodashExports.cloneDeep(props.searchResultsOptions);
28977
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28978
+ });
28979
+ const fetch2 = () => {
28980
+ var _a;
28981
+ (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28982
+ };
28983
+ __expose({ fetch: fetch2 });
28984
+ return (_ctx, _cache) => {
28985
+ return openBlock(), createBlock(unref(_sfc_main$c), {
28986
+ options: fullSearchResultsOptions.value,
28987
+ ref_key: "searchResults",
28988
+ ref: searchResults2
28989
+ }, null, 8, ["options"]);
28990
+ };
28991
+ }
28992
+ });
28993
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28994
+ __name: "ProductListEntry",
28995
+ props: {
28996
+ productListOptions: {}
28997
+ },
28998
+ setup(__props, { expose: __expose }) {
28999
+ const props = __props;
29000
+ const productList2 = ref(null);
29001
+ const fullProductListOptions = computed(() => {
29002
+ return lodashExports.cloneDeep(props.productListOptions);
29003
+ });
29004
+ const fetch2 = () => {
29005
+ var _a;
29006
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29007
+ };
29008
+ __expose({ fetch: fetch2 });
29009
+ return (_ctx, _cache) => {
29010
+ return openBlock(), createBlock(unref(_sfc_main$a), {
29011
+ options: fullProductListOptions.value,
29012
+ ref_key: "productList",
29013
+ ref: productList2
29014
+ }, null, 8, ["options"]);
29015
+ };
29016
+ }
29017
+ });
29018
+ const QUERY_PARAMS = {
29019
+ QUERY: "q",
29020
+ PAGE: "p",
29021
+ LIMIT: "l",
29022
+ SORT: "s"
29105
29023
  };
29106
- const SearchContainerConfigurationService = {
29107
- getSearchBoxComponent,
29108
- getSearchResultsComponent
29024
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
29025
+ __name: "SearchContainerEntry",
29026
+ props: {
29027
+ searchContainerOptions: {}
29028
+ },
29029
+ setup(__props, { expose: __expose }) {
29030
+ const props = __props;
29031
+ const isOpen = ref(false);
29032
+ const triggerElement = ref(null);
29033
+ const productList2 = ref(null);
29034
+ const containerOptions = computed(() => {
29035
+ return lodashExports.cloneDeep(props.searchContainerOptions);
29036
+ });
29037
+ const focus = () => {
29038
+ const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
29039
+ el == null ? void 0 : el.focus();
29040
+ };
29041
+ const close = () => {
29042
+ isOpen.value = false;
29043
+ };
29044
+ const openSearchContainer = () => {
29045
+ isOpen.value = true;
29046
+ };
29047
+ const checkCloseOnEscape = (e2) => {
29048
+ var _a;
29049
+ if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
29050
+ return;
29051
+ }
29052
+ isOpen.value = false;
29053
+ };
29054
+ const checkExistingQuery = () => {
29055
+ const url = new URL(window.location.href);
29056
+ const param = url.searchParams.get(QUERY_PARAMS.QUERY);
29057
+ if (!param) {
29058
+ return;
29059
+ }
29060
+ isOpen.value = true;
29061
+ };
29062
+ const mountOpenListeners = () => {
29063
+ var _a, _b;
29064
+ triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
29065
+ (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
29066
+ window.addEventListener("keydown", checkCloseOnEscape);
29067
+ };
29068
+ onMounted(() => {
29069
+ var _a, _b;
29070
+ mountOpenListeners();
29071
+ checkExistingQuery();
29072
+ isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
29073
+ });
29074
+ onBeforeUnmount(() => {
29075
+ var _a;
29076
+ (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
29077
+ window.removeEventListener("keydown", checkCloseOnEscape);
29078
+ });
29079
+ const fetch2 = () => {
29080
+ var _a;
29081
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29082
+ };
29083
+ const reloadOptions = () => {
29084
+ var _a;
29085
+ (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
29086
+ };
29087
+ __expose({ fetch: fetch2, reloadOptions });
29088
+ return (_ctx, _cache) => {
29089
+ return openBlock(), createElementBlock("div", null, [
29090
+ containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
29091
+ key: 0,
29092
+ options: containerOptions.value,
29093
+ ref_key: "productList",
29094
+ ref: productList2,
29095
+ "onHook:mounted": focus,
29096
+ onClose: close
29097
+ }, null, 8, ["options"])) : createCommentVNode("", true)
29098
+ ]);
29099
+ };
29100
+ }
29101
+ });
29102
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29103
+ __name: "RecommendationsEntry",
29104
+ props: {
29105
+ recommendationOptions: {}
29106
+ },
29107
+ setup(__props, { expose: __expose }) {
29108
+ const productRecommendations = ref(null);
29109
+ const fetch2 = () => {
29110
+ productRecommendations == null ? void 0 : productRecommendations.fetch();
29111
+ };
29112
+ __expose({ fetch: fetch2 });
29113
+ return (_ctx, _cache) => {
29114
+ return openBlock(), createBlock(unref(_sfc_main$8), {
29115
+ options: _ctx.recommendationOptions,
29116
+ ref_key: "productRecommendations",
29117
+ ref: productRecommendations
29118
+ }, null, 8, ["options"]);
29119
+ };
29120
+ }
29121
+ });
29122
+ const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
29123
+ const createShadowDom = (shadowId, managerId) => {
29124
+ let host = document.getElementById(shadowId);
29125
+ if (host) {
29126
+ host.remove();
29127
+ }
29128
+ host = document.createElement("div");
29129
+ const manager = document.createElement("div");
29130
+ host.setAttribute("id", shadowId);
29131
+ manager == null ? void 0 : manager.setAttribute("id", managerId);
29132
+ return { host, manager };
29133
+ };
29134
+ const attatchShadowDom = ({
29135
+ host,
29136
+ manager,
29137
+ styleUrl,
29138
+ options
29139
+ }) => {
29140
+ var _a;
29141
+ if (host.shadowRoot) {
29142
+ return;
29143
+ }
29144
+ const link = document.createElement("link");
29145
+ link.type = "text/css";
29146
+ link.rel = "stylesheet";
29147
+ link.href = styleUrl;
29148
+ const fontLink = document.createElement("link");
29149
+ fontLink.type = "text/css";
29150
+ fontLink.rel = "stylesheet";
29151
+ fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
29152
+ document.head.appendChild(fontLink);
29153
+ const materialIconLink = document.createElement("link");
29154
+ materialIconLink.type = "text/css";
29155
+ materialIconLink.rel = "stylesheet";
29156
+ materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
29157
+ document.head.appendChild(materialIconLink);
29158
+ const shadow = host.attachShadow({ mode: "open" });
29159
+ shadow.appendChild(manager);
29160
+ shadow.appendChild(link);
29161
+ if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
29162
+ const style = document.createElement("style");
29163
+ style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
29164
+ shadow.appendChild(style);
29165
+ }
29109
29166
  };
29110
29167
  const getMountElement = (element, mountingBehavior = "replace", mountToParent) => {
29111
29168
  const parent = element == null ? void 0 : element.parentElement;
@@ -29136,7 +29193,7 @@ const createVue = (selector, mountingBehavior = "replace", rootComponent, option
29136
29193
  return;
29137
29194
  }
29138
29195
  let mountedComponent = null;
29139
- const props = reactive(__spreadValues({}, options));
29196
+ const props = reactive(__spreadValues2({}, options));
29140
29197
  const app2 = createApp({
29141
29198
  render: () => mountedComponent = h$1(rootComponent, props)
29142
29199
  });
@@ -29155,9 +29212,6 @@ const app = {
29155
29212
  recommendations: {},
29156
29213
  chat: {}
29157
29214
  };
29158
- const tracking = (options) => {
29159
- setupTracking(options);
29160
- };
29161
29215
  const applySearchBox = (options, mountOptions) => {
29162
29216
  const existingInstance = app.box[options.inputSelector];
29163
29217
  if (existingInstance) {
@@ -29186,7 +29240,7 @@ const searchBox = (options, mountOptions) => {
29186
29240
  var _a;
29187
29241
  const inputs = (_a = options.inputSelector) == null ? void 0 : _a.split(",");
29188
29242
  for (const input of inputs) {
29189
- applySearchBox(__spreadProps(__spreadValues({}, options), { inputSelector: input.trim() }), mountOptions);
29243
+ applySearchBox(__spreadProps2(__spreadValues2({}, options), { inputSelector: input.trim() }), mountOptions);
29190
29244
  }
29191
29245
  };
29192
29246
  const searchResults = (options, mountOptions) => {
@@ -29422,7 +29476,238 @@ const clearChat = (selector) => {
29422
29476
  } catch (e2) {
29423
29477
  }
29424
29478
  };
29479
+ const saveToLocalStorage = (key, value) => {
29480
+ try {
29481
+ localStorage.setItem(key, JSON.stringify(value));
29482
+ } catch (e2) {
29483
+ }
29484
+ };
29485
+ const tryLoadFromLocalStorage = (key) => {
29486
+ try {
29487
+ const item = localStorage.getItem(key);
29488
+ return item ? JSON.parse(item) : null;
29489
+ } catch (e2) {
29490
+ return null;
29491
+ }
29492
+ };
29493
+ const saveToSessionStorage = (key, value) => {
29494
+ try {
29495
+ sessionStorage.setItem(key, JSON.stringify(value));
29496
+ } catch (e2) {
29497
+ }
29498
+ };
29499
+ const tryLoadFromSessionStorage = (key) => {
29500
+ try {
29501
+ const item = sessionStorage.getItem(key);
29502
+ return item ? JSON.parse(item) : null;
29503
+ } catch (e2) {
29504
+ return null;
29505
+ }
29506
+ };
29507
+ const getQueryParam = (name) => {
29508
+ try {
29509
+ const urlParams = new URLSearchParams(window.location.search);
29510
+ return urlParams.get(name);
29511
+ } catch (e2) {
29512
+ return null;
29513
+ }
29514
+ };
29515
+ const PREVIEW_PARAMETER = "lupaSearchPreview";
29516
+ let styleElement = null;
29517
+ const waitForElementToBeVisible = (element, retries = 0, maxRetries = 10, interval = 10) => __async2(void 0, null, function* () {
29518
+ if (retries > maxRetries) {
29519
+ return false;
29520
+ }
29521
+ if (typeof element === "string") {
29522
+ element = document.querySelector(element);
29523
+ }
29524
+ if (element) {
29525
+ return true;
29526
+ } else {
29527
+ setTimeout(() => {
29528
+ waitForElementToBeVisible(element, retries + 1, maxRetries, interval + 10);
29529
+ }, interval);
29530
+ }
29531
+ });
29532
+ const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async2(void 0, null, function* () {
29533
+ const configuration2 = yield fetchPluginConfiguration(
29534
+ options,
29535
+ configurationKey
29536
+ );
29537
+ if (!configuration2) {
29538
+ console.error(`Failed to fetch LupaSearch plugin configuration for key ${configurationKey}`);
29539
+ return null;
29540
+ }
29541
+ saveToLocalStorage(configurationKey, configuration2);
29542
+ return configuration2;
29543
+ });
29544
+ const checkIsPreviewMode = () => {
29545
+ const isPreviewModeSaved = tryLoadFromSessionStorage(PREVIEW_PARAMETER);
29546
+ if (isPreviewModeSaved) {
29547
+ return isPreviewModeSaved;
29548
+ }
29549
+ const isPreviewMode = getQueryParam(PREVIEW_PARAMETER) === "true";
29550
+ if (isPreviewMode) {
29551
+ saveToSessionStorage(PREVIEW_PARAMETER, isPreviewMode);
29552
+ } else {
29553
+ saveToSessionStorage(PREVIEW_PARAMETER, false);
29554
+ }
29555
+ return isPreviewMode;
29556
+ };
29557
+ const loadConfigurations = (configurationKey, isPreviewMode, options) => __async2(void 0, null, function* () {
29558
+ if (isPreviewMode) {
29559
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29560
+ }
29561
+ const existingConfiguration = tryLoadFromLocalStorage(configurationKey);
29562
+ if (existingConfiguration) {
29563
+ setTimeout(() => __async2(void 0, null, function* () {
29564
+ var _a;
29565
+ const newestConfiguration = yield loadAndSaveConfigurationFromServer(
29566
+ configurationKey,
29567
+ options
29568
+ );
29569
+ if (existingConfiguration.updatedAt === newestConfiguration.updatedAt) {
29570
+ return;
29571
+ }
29572
+ const isPreviewMode2 = checkIsPreviewMode();
29573
+ const configuration2 = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
29574
+ yield mount(configuration2, false);
29575
+ }), 5e3);
29576
+ return existingConfiguration;
29577
+ }
29578
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29579
+ });
29580
+ const applyStyles = (configuration2) => __async2(void 0, null, function* () {
29581
+ var _a;
29582
+ const visible2 = yield waitForElementToBeVisible(document.head);
29583
+ if (!visible2) {
29584
+ console.error("Failed to apply custom LupaSearch styles, head element not found");
29585
+ return;
29586
+ }
29587
+ const baseStyleLink = configuration2.baseStyleLink;
29588
+ if (styleElement) {
29589
+ styleElement.remove();
29590
+ }
29591
+ styleElement = document.createElement("style");
29592
+ if (baseStyleLink) {
29593
+ styleElement.innerHTML = `
29594
+ @import url('${baseStyleLink}');
29595
+ @import url('https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css')
29596
+ ${(_a = configuration2.customStyles) != null ? _a : ""}
29597
+ `;
29598
+ }
29599
+ document.head.appendChild(styleElement);
29600
+ });
29601
+ const mountSearchBox = (configuration, fetch = true) => __async2(void 0, null, function* () {
29602
+ if (!configuration.searchBox) {
29603
+ return;
29604
+ }
29605
+ const resolvedConfiguration = eval(`(${configuration.searchBox})`);
29606
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.inputSelector);
29607
+ if (!visible) {
29608
+ console.error(
29609
+ `Failed to mount LupaSearch search box, input element ${resolvedConfiguration.inputSelector} not found`
29610
+ );
29611
+ return;
29612
+ }
29613
+ searchBox(resolvedConfiguration, { fetch });
29614
+ });
29615
+ const mountSearchResults = (configuration, fetch = true) => __async2(void 0, null, function* () {
29616
+ if (!configuration.searchResults) {
29617
+ return;
29618
+ }
29619
+ const resolvedConfiguration = eval(`(${configuration.searchResults})`);
29620
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29621
+ if (!visible) {
29622
+ console.error(
29623
+ `Failed to mount LupaSearch search results, element ${resolvedConfiguration.containerSelector} not found`
29624
+ );
29625
+ return;
29626
+ }
29627
+ searchResults(resolvedConfiguration, { fetch });
29628
+ });
29629
+ const mountProductList = (configuration, fetch = true) => __async2(void 0, null, function* () {
29630
+ if (!configuration.productList) {
29631
+ return;
29632
+ }
29633
+ const resolvedSearchResultsConfiguration = eval(
29634
+ `(${configuration.searchResults})`
29635
+ );
29636
+ const resolvedConfiguration = eval(`(${configuration.productList})`);
29637
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29638
+ if (!visible) {
29639
+ console.error(
29640
+ `Failed to mount LupaSearch product list, element ${resolvedConfiguration.containerSelector} not found`
29641
+ );
29642
+ return;
29643
+ }
29644
+ productList(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29645
+ });
29646
+ const mountRecommendations = (configuration, fetch = true) => __async2(void 0, null, function* () {
29647
+ if (!configuration.recommendations) {
29648
+ return;
29649
+ }
29650
+ const resolvedSearchResultsConfiguration = eval(
29651
+ `(${configuration.searchResults})`
29652
+ );
29653
+ const resolvedConfiguration = eval(
29654
+ `(${configuration.recommendations})`
29655
+ );
29656
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29657
+ if (!visible) {
29658
+ console.error(
29659
+ `Failed to mount LupaSearch recommendations, element ${resolvedConfiguration.containerSelector} not found`
29660
+ );
29661
+ return;
29662
+ }
29663
+ recommendations(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29664
+ });
29665
+ const mountChat = (configuration, fetch = true) => __async2(void 0, null, function* () {
29666
+ if (!configuration.genAiChat) {
29667
+ return;
29668
+ }
29669
+ const resolvedSearchResultsConfiguration = eval(
29670
+ `(${configuration.searchResults})`
29671
+ );
29672
+ const resolvedConfiguration = eval(`(${configuration.genAiChat})`);
29673
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29674
+ if (!visible) {
29675
+ console.error(
29676
+ `Failed to mount LupaSearch chat, element ${resolvedConfiguration.containerSelector} not found`
29677
+ );
29678
+ return;
29679
+ }
29680
+ chat(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29681
+ });
29682
+ const mount = (configuration2, fetch2 = true) => __async2(void 0, null, function* () {
29683
+ yield applyStyles(configuration2);
29684
+ const mountPromises = [
29685
+ mountSearchBox(configuration2, fetch2),
29686
+ mountSearchResults(configuration2, fetch2),
29687
+ mountProductList(configuration2, fetch2),
29688
+ mountRecommendations(configuration2, fetch2),
29689
+ mountChat(configuration2, fetch2)
29690
+ ];
29691
+ yield Promise.all(mountPromises);
29692
+ });
29693
+ const init$1 = (configurationKey, options) => __async2(void 0, null, function* () {
29694
+ var _a;
29695
+ const isPreviewMode = checkIsPreviewMode();
29696
+ const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
29697
+ const configuration2 = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
29698
+ yield mount(configuration2);
29699
+ });
29700
+ const PluginConfigurationManager = {
29701
+ init: init$1
29702
+ };
29703
+ const tracking = (options) => {
29704
+ setupTracking(options);
29705
+ };
29706
+ const init = (configurationKey, options) => {
29707
+ return PluginConfigurationManager.init(configurationKey, options);
29708
+ };
29425
29709
  const lupaSearch = {
29710
+ init,
29426
29711
  searchBox,
29427
29712
  searchResults,
29428
29713
  tracking,