@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,23 +1,43 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
- var __spreadValues = (a, b) => {
2
+ var __defProp2 = Object.defineProperty;
3
+ var __defProps2 = Object.defineProperties;
4
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues2 = (a, b) => {
10
10
  for (var prop in b || (b = {}))
11
- if (__hasOwnProp.call(b, prop))
12
- __defNormalProp(a, prop, b[prop]);
13
- if (__getOwnPropSymbols)
14
- for (var prop of __getOwnPropSymbols(b)) {
15
- if (__propIsEnum.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
11
+ if (__hasOwnProp2.call(b, prop))
12
+ __defNormalProp2(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols2)
14
+ for (var prop of __getOwnPropSymbols2(b)) {
15
+ if (__propIsEnum2.call(b, prop))
16
+ __defNormalProp2(a, prop, b[prop]);
17
17
  }
18
18
  return a;
19
19
  };
20
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
21
+ var __async2 = (__this, __arguments, generator) => {
22
+ return new Promise((resolve2, reject) => {
23
+ var fulfilled = (value) => {
24
+ try {
25
+ step(generator.next(value));
26
+ } catch (e2) {
27
+ reject(e2);
28
+ }
29
+ };
30
+ var rejected = (value) => {
31
+ try {
32
+ step(generator.throw(value));
33
+ } catch (e2) {
34
+ reject(e2);
35
+ }
36
+ };
37
+ var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
38
+ step((generator = generator.apply(__this, __arguments)).next());
39
+ });
40
+ };
21
41
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
22
42
  function makeMap(str, expectsLowerCase) {
23
43
  const map = /* @__PURE__ */ Object.create(null);
@@ -6303,7 +6323,7 @@ function ensureRenderer() {
6303
6323
  }
6304
6324
  const createApp = (...args) => {
6305
6325
  const app2 = ensureRenderer().createApp(...args);
6306
- const { mount } = app2;
6326
+ const { mount: mount2 } = app2;
6307
6327
  app2.mount = (containerOrSelector) => {
6308
6328
  const container = normalizeContainer(containerOrSelector);
6309
6329
  if (!container)
@@ -6313,7 +6333,7 @@ const createApp = (...args) => {
6313
6333
  component.template = container.innerHTML;
6314
6334
  }
6315
6335
  container.innerHTML = "";
6316
- const proxy = mount(container, false, container instanceof SVGElement);
6336
+ const proxy = mount2(container, false, container instanceof SVGElement);
6317
6337
  if (container instanceof Element) {
6318
6338
  container.removeAttribute("v-cloak");
6319
6339
  container.setAttribute("data-v-app", "");
@@ -6329,25 +6349,25 @@ function normalizeContainer(container) {
6329
6349
  }
6330
6350
  return container;
6331
6351
  }
6332
- var __defProp2 = Object.defineProperty;
6333
- var __defProps2 = Object.defineProperties;
6334
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
6335
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
6336
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
6337
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
6338
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6339
- var __spreadValues2 = (a, b) => {
6352
+ var __defProp = Object.defineProperty;
6353
+ var __defProps = Object.defineProperties;
6354
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6355
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6356
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6357
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6358
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6359
+ var __spreadValues = (a, b) => {
6340
6360
  for (var prop in b || (b = {}))
6341
- if (__hasOwnProp2.call(b, prop))
6342
- __defNormalProp2(a, prop, b[prop]);
6343
- if (__getOwnPropSymbols2)
6344
- for (var prop of __getOwnPropSymbols2(b)) {
6345
- if (__propIsEnum2.call(b, prop))
6346
- __defNormalProp2(a, prop, b[prop]);
6361
+ if (__hasOwnProp.call(b, prop))
6362
+ __defNormalProp(a, prop, b[prop]);
6363
+ if (__getOwnPropSymbols)
6364
+ for (var prop of __getOwnPropSymbols(b)) {
6365
+ if (__propIsEnum.call(b, prop))
6366
+ __defNormalProp(a, prop, b[prop]);
6347
6367
  }
6348
6368
  return a;
6349
6369
  };
6350
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
6370
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6351
6371
  var __async = (__this, __arguments, generator) => {
6352
6372
  return new Promise((resolve2, reject) => {
6353
6373
  var fulfilled = (value) => {
@@ -6813,14 +6833,14 @@ var __awaiter = globalThis && globalThis.__awaiter || function(thisArg, _argumen
6813
6833
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6814
6834
  });
6815
6835
  };
6816
- const defaultConfig$1 = {
6836
+ const defaultConfig = {
6817
6837
  method: "POST",
6818
6838
  headers: { "Content-Type": "application/json" }
6819
6839
  };
6820
6840
  const customRequestConfig = ({ customHeaders }) => {
6821
6841
  return {
6822
- method: defaultConfig$1.method,
6823
- headers: Object.assign(Object.assign({}, defaultConfig$1.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6842
+ method: defaultConfig.method,
6843
+ headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6824
6844
  };
6825
6845
  };
6826
6846
  const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, function* () {
@@ -6844,7 +6864,7 @@ const suggestCustom = (query, options) => __awaiter(void 0, void 0, void 0, func
6844
6864
  return { success: false, errors };
6845
6865
  });
6846
6866
  const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6847
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6867
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6848
6868
  if (res.status < 400) {
6849
6869
  const data = yield res.json();
6850
6870
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6854,7 +6874,7 @@ const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0
6854
6874
  });
6855
6875
  const queryByIds = (queryKey, ids, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6856
6876
  const idParam = ids.map((id) => `ids=${id}`).join("&");
6857
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6877
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6858
6878
  if (res.status < 400) {
6859
6879
  const data = yield res.json();
6860
6880
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6867,7 +6887,7 @@ const recommendForSingleId = (queryKey, recommendForId, filters, environment, cu
6867
6887
  if (filters) {
6868
6888
  url += `&${e({ filters })}`;
6869
6889
  }
6870
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6890
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6871
6891
  if (res.status < 400) {
6872
6892
  const data = yield res.json();
6873
6893
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6881,7 +6901,7 @@ const recommendForMultipleIds = (queryKey, recommendForIds, filters, environment
6881
6901
  if (filters) {
6882
6902
  url += `&${e({ filters })}`;
6883
6903
  }
6884
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6904
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6885
6905
  if (res.status < 400) {
6886
6906
  const data = yield res.json();
6887
6907
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6893,7 +6913,7 @@ const recommend = (queryKey, recommendForId, filters, environment, customBaseUrl
6893
6913
  return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl);
6894
6914
  });
6895
6915
  const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6896
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6916
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6897
6917
  if (res.status < 400) {
6898
6918
  const items = yield res.json();
6899
6919
  return { items, success: true };
@@ -6903,7 +6923,7 @@ const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void
6903
6923
  });
6904
6924
  const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6905
6925
  try {
6906
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6926
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6907
6927
  if (res.status < 400) {
6908
6928
  return { success: false };
6909
6929
  }
@@ -6913,7 +6933,7 @@ const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void
6913
6933
  }
6914
6934
  });
6915
6935
  const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6916
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6936
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6917
6937
  if (res.status < 400) {
6918
6938
  return res.json();
6919
6939
  }
@@ -7245,13 +7265,13 @@ const sendGa4AnalyticsEvent = (data, options) => {
7245
7265
  }
7246
7266
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
7247
7267
  const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
7248
- const params = __spreadValues2({
7268
+ const params = __spreadValues({
7249
7269
  search_text: data.searchQuery,
7250
7270
  item_title: title,
7251
7271
  item_id: data.itemId,
7252
7272
  ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
7253
7273
  }, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
7254
- window.dataLayer.push(__spreadValues2({
7274
+ window.dataLayer.push(__spreadValues({
7255
7275
  event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
7256
7276
  }, params));
7257
7277
  };
@@ -7429,15 +7449,21 @@ const DEFAULT_OPTIONS_RESULTS$1 = {
7429
7449
  breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
7430
7450
  };
7431
7451
  const useScreenStore = defineStore("screen", () => {
7432
- const screenWidth = ref(1e3);
7452
+ const measuredScreenWidth = ref(1e3);
7433
7453
  const optionsStore = useOptionsStore();
7454
+ const screenWidth = computed(() => {
7455
+ var _a, _b;
7456
+ const { searchResultOptions } = storeToRefs(optionsStore);
7457
+ return (_b = (_a = searchResultOptions.value.grid) == null ? void 0 : _a.forcedScreenWidth) != null ? _b : measuredScreenWidth.value;
7458
+ });
7434
7459
  const configuredGridSizes = computed(() => {
7435
7460
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
7461
+ const { searchResultOptions } = storeToRefs(optionsStore);
7436
7462
  return {
7437
- 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,
7438
- 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,
7439
- 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,
7440
- 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
7463
+ 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,
7464
+ 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,
7465
+ 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,
7466
+ 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
7441
7467
  };
7442
7468
  });
7443
7469
  const currentScreenWidth = computed(() => {
@@ -7459,7 +7485,7 @@ const useScreenStore = defineStore("screen", () => {
7459
7485
  return (_a = ["xs", "sm"]) == null ? void 0 : _a.includes(currentScreenWidth.value);
7460
7486
  });
7461
7487
  const setScreenWidth = ({ width }) => {
7462
- screenWidth.value = width;
7488
+ measuredScreenWidth.value = width;
7463
7489
  };
7464
7490
  return { screenWidth, currentScreenWidth, isMobileWidth, setScreenWidth };
7465
7491
  });
@@ -7739,7 +7765,7 @@ const unfoldFilters = (filters, price = {}) => {
7739
7765
  const getLabeledFilters = (filters, facets) => {
7740
7766
  return filters.map((f2) => {
7741
7767
  var _a, _b;
7742
- return __spreadProps2(__spreadValues2({}, f2), {
7768
+ return __spreadProps(__spreadValues({}, f2), {
7743
7769
  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)
7744
7770
  });
7745
7771
  });
@@ -7767,7 +7793,7 @@ const recursiveFilterItem = (item, query = "") => {
7767
7793
  }
7768
7794
  const children = recursiveFilter(item.children, query).filter(Boolean);
7769
7795
  const include = children.length > 0 || filterable;
7770
- return include ? __spreadProps2(__spreadValues2({}, item), {
7796
+ return include ? __spreadProps(__spreadValues({}, item), {
7771
7797
  children
7772
7798
  }) : void 0;
7773
7799
  };
@@ -7849,7 +7875,7 @@ const parseFacetKeys = (facetKeys, searchParams) => {
7849
7875
  params.filters = {};
7850
7876
  for (const key of facetKeys) {
7851
7877
  const parsedKey = key.slice(key.indexOf(FACET_KEY_SEPARATOR) + 1);
7852
- params.filters = __spreadProps2(__spreadValues2({}, params.filters), {
7878
+ params.filters = __spreadProps(__spreadValues({}, params.filters), {
7853
7879
  [parsedKey]: parseFacetKey(key, searchParams)
7854
7880
  });
7855
7881
  }
@@ -7862,7 +7888,7 @@ const parseParams = (getQueryParamName, searchParams) => {
7862
7888
  const paramKeys = Array.from(searchParams.keys());
7863
7889
  const facetKeys = paramKeys.filter((k) => isFacetKey(k));
7864
7890
  const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
7865
- const r = __spreadValues2(__spreadValues2({
7891
+ const r = __spreadValues(__spreadValues({
7866
7892
  [QUERY_PARAMS_PARSED.QUERY]: ""
7867
7893
  }, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
7868
7894
  return r;
@@ -7912,7 +7938,7 @@ const encodeParam = (param) => {
7912
7938
  const encoded = encodeURIComponent(param);
7913
7939
  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, " ");
7914
7940
  };
7915
- const getQueryParam = (name) => {
7941
+ const getQueryParam$1 = (name) => {
7916
7942
  try {
7917
7943
  const urlParams = new URLSearchParams(window.location.search);
7918
7944
  return urlParams.get(name);
@@ -8052,7 +8078,7 @@ const CACHE_KEY = "lupasearch-client-redirections";
8052
8078
  const useRedirectionStore = defineStore("redirections", () => {
8053
8079
  const redirections = ref({ rules: [] });
8054
8080
  const redirectionOptions = ref({ enabled: false, queryKey: "" });
8055
- const saveToLocalStorage = () => {
8081
+ const saveToLocalStorage2 = () => {
8056
8082
  try {
8057
8083
  localStorage.setItem(
8058
8084
  CACHE_KEY,
@@ -8061,7 +8087,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8061
8087
  } catch (e2) {
8062
8088
  }
8063
8089
  };
8064
- const tryLoadFromLocalStorage = (config) => {
8090
+ const tryLoadFromLocalStorage2 = (config) => {
8065
8091
  var _a;
8066
8092
  if (!config.cacheSeconds)
8067
8093
  return false;
@@ -8084,7 +8110,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8084
8110
  if (!(config == null ? void 0 : config.enabled)) {
8085
8111
  return;
8086
8112
  }
8087
- const loaded = tryLoadFromLocalStorage(config);
8113
+ const loaded = tryLoadFromLocalStorage2(config);
8088
8114
  if (loaded || ((_c = (_b = redirections.value) == null ? void 0 : _b.rules) == null ? void 0 : _c.length) > 0) {
8089
8115
  return;
8090
8116
  }
@@ -8094,7 +8120,7 @@ const useRedirectionStore = defineStore("redirections", () => {
8094
8120
  return;
8095
8121
  }
8096
8122
  redirections.value = result;
8097
- saveToLocalStorage();
8123
+ saveToLocalStorage2();
8098
8124
  } catch (e2) {
8099
8125
  }
8100
8126
  });
@@ -8220,12 +8246,12 @@ const useParamsStore = defineStore("params", () => {
8220
8246
  return;
8221
8247
  }
8222
8248
  const forceFullReload = (_a = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a.some(
8223
- (p2) => getQueryParam(p2)
8249
+ (p2) => getQueryParam$1(p2)
8224
8250
  );
8225
8251
  if ((!searchResultsLink.value || linksMatch(searchResultsLink.value, window.location.pathname)) && !forceFullReload) {
8226
8252
  const singleFacetParam = facet ? getFacetParam(facet.key, [facet.title]) : void 0;
8227
8253
  const facetParam = singleFacetParam ? [
8228
- __spreadProps2(__spreadValues2({}, singleFacetParam), {
8254
+ __spreadProps(__spreadValues({}, singleFacetParam), {
8229
8255
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
8230
8256
  })
8231
8257
  ] : [];
@@ -8314,7 +8340,7 @@ const flattenFacet = (key, facets, suggestion, inputValue) => {
8314
8340
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
8315
8341
  display: suggestion.suggestion,
8316
8342
  suggestion,
8317
- facet: __spreadValues2({
8343
+ facet: __spreadValues({
8318
8344
  key
8319
8345
  }, f2)
8320
8346
  }));
@@ -8421,14 +8447,14 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8421
8447
  const context = getLupaTrackingContext();
8422
8448
  const result = yield LupaSearchSdk.suggestions(
8423
8449
  queryKey,
8424
- __spreadValues2(__spreadValues2({}, publicQuery), context),
8450
+ __spreadValues(__spreadValues({}, publicQuery), context),
8425
8451
  options2
8426
8452
  );
8427
8453
  if (!result.success) {
8428
8454
  return { suggestions: void 0 };
8429
8455
  }
8430
8456
  highlightChange({ action: "clear" });
8431
- suggestionResults.value = __spreadProps2(__spreadValues2({}, suggestionResults.value), {
8457
+ suggestionResults.value = __spreadProps(__spreadValues({}, suggestionResults.value), {
8432
8458
  [queryKey]: flattenSuggestions(result.items, (_a = publicQuery.searchText) != null ? _a : "")
8433
8459
  });
8434
8460
  inputValue.value = publicQuery.searchText;
@@ -8465,12 +8491,12 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8465
8491
  }) {
8466
8492
  try {
8467
8493
  const context = getLupaTrackingContext();
8468
- const result = yield LupaSearchSdk.query(queryKey, __spreadValues2(__spreadValues2({}, publicQuery), context), options2);
8494
+ const result = yield LupaSearchSdk.query(queryKey, __spreadValues(__spreadValues({}, publicQuery), context), options2);
8469
8495
  if (!result.success) {
8470
8496
  return { queryKey, result: { items: [] } };
8471
8497
  }
8472
8498
  highlightChange({ action: "clear" });
8473
- docResults.value = __spreadProps2(__spreadValues2({}, docResults.value), { [queryKey]: result });
8499
+ docResults.value = __spreadProps(__spreadValues({}, docResults.value), { [queryKey]: result });
8474
8500
  emitSearchResultsCallback();
8475
8501
  return { queryKey, result };
8476
8502
  } catch (err) {
@@ -8517,7 +8543,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
8517
8543
  resetHighlightIndex
8518
8544
  };
8519
8545
  });
8520
- const _hoisted_1$1f = { id: "lupa-search-box-input-container" };
8546
+ const _hoisted_1$1d = { id: "lupa-search-box-input-container" };
8521
8547
  const _hoisted_2$R = { class: "lupa-input-clear" };
8522
8548
  const _hoisted_3$B = { id: "lupa-search-box-input" };
8523
8549
  const _hoisted_4$t = ["value"];
@@ -8572,7 +8598,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8572
8598
  );
8573
8599
  const inputAttributes = computed(() => {
8574
8600
  var _a;
8575
- return __spreadValues2({}, (_a = props.options.inputAttributes) != null ? _a : {});
8601
+ return __spreadValues({}, (_a = props.options.inputAttributes) != null ? _a : {});
8576
8602
  });
8577
8603
  const ariaLabel = computed(() => {
8578
8604
  var _a;
@@ -8614,7 +8640,7 @@ const _sfc_main$1n = /* @__PURE__ */ defineComponent({
8614
8640
  };
8615
8641
  __expose({ focus });
8616
8642
  return (_ctx, _cache) => {
8617
- return openBlock(), createElementBlock("div", _hoisted_1$1f, [
8643
+ return openBlock(), createElementBlock("div", _hoisted_1$1d, [
8618
8644
  createBaseVNode("div", _hoisted_2$R, [
8619
8645
  createBaseVNode("div", {
8620
8646
  class: normalizeClass(["lupa-input-clear-content", { "lupa-input-clear-filled": inputValue.value }]),
@@ -8692,7 +8718,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
8692
8718
  };
8693
8719
  }
8694
8720
  });
8695
- const _hoisted_1$1e = { class: "lupa-search-box-history-item" };
8721
+ const _hoisted_1$1c = { class: "lupa-search-box-history-item" };
8696
8722
  const _hoisted_2$Q = { class: "lupa-search-box-history-item-content" };
8697
8723
  const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8698
8724
  __name: "SearchBoxHistoryItem",
@@ -8710,7 +8736,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8710
8736
  emit2("click", { query: props.item });
8711
8737
  };
8712
8738
  return (_ctx, _cache) => {
8713
- return openBlock(), createElementBlock("div", _hoisted_1$1e, [
8739
+ return openBlock(), createElementBlock("div", _hoisted_1$1c, [
8714
8740
  createBaseVNode("div", _hoisted_2$Q, [
8715
8741
  createBaseVNode("div", {
8716
8742
  class: normalizeClass(["lupa-search-box-history-item-text", { "lupa-search-box-history-item-highlighted": _ctx.highlighted }]),
@@ -8725,7 +8751,7 @@ const _sfc_main$1l = /* @__PURE__ */ defineComponent({
8725
8751
  };
8726
8752
  }
8727
8753
  });
8728
- const _hoisted_1$1d = {
8754
+ const _hoisted_1$1b = {
8729
8755
  key: 0,
8730
8756
  class: "lupa-search-box-history-panel"
8731
8757
  };
@@ -8770,7 +8796,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
8770
8796
  }
8771
8797
  };
8772
8798
  return (_ctx, _cache) => {
8773
- return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1d, [
8799
+ return hasHistory.value ? (openBlock(), createElementBlock("div", _hoisted_1$1b, [
8774
8800
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(history), (item, index) => {
8775
8801
  return openBlock(), createBlock(_sfc_main$1l, {
8776
8802
  key: item,
@@ -8788,7 +8814,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
8788
8814
  };
8789
8815
  }
8790
8816
  });
8791
- const _hoisted_1$1c = { class: "lupa-search-box-no-results" };
8817
+ const _hoisted_1$1a = { class: "lupa-search-box-no-results" };
8792
8818
  const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8793
8819
  __name: "SearchBoxNoResults",
8794
8820
  props: {
@@ -8796,11 +8822,11 @@ const _sfc_main$1j = /* @__PURE__ */ defineComponent({
8796
8822
  },
8797
8823
  setup(__props) {
8798
8824
  return (_ctx, _cache) => {
8799
- return openBlock(), createElementBlock("p", _hoisted_1$1c, toDisplayString(_ctx.labels.noResults), 1);
8825
+ return openBlock(), createElementBlock("p", _hoisted_1$1a, toDisplayString(_ctx.labels.noResults), 1);
8800
8826
  };
8801
8827
  }
8802
8828
  });
8803
- const _hoisted_1$1b = ["innerHTML"];
8829
+ const _hoisted_1$19 = ["innerHTML"];
8804
8830
  const _hoisted_2$P = {
8805
8831
  key: 1,
8806
8832
  "data-cy": "lupa-suggestion-value",
@@ -8855,7 +8881,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
8855
8881
  class: "lupa-suggestion-value",
8856
8882
  "data-cy": "lupa-suggestion-value",
8857
8883
  innerHTML: _ctx.suggestion.displayHighlight
8858
- }, null, 8, _hoisted_1$1b)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8884
+ }, null, 8, _hoisted_1$19)) : (openBlock(), createElementBlock("div", _hoisted_2$P, toDisplayString(_ctx.suggestion.display), 1)),
8859
8885
  _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8860
8886
  createBaseVNode("span", _hoisted_4$s, toDisplayString(facetLabel.value), 1),
8861
8887
  createBaseVNode("span", _hoisted_5$i, toDisplayString(_ctx.suggestion.facet.title), 1)
@@ -8864,7 +8890,7 @@ const _sfc_main$1i = /* @__PURE__ */ defineComponent({
8864
8890
  };
8865
8891
  }
8866
8892
  });
8867
- const _hoisted_1$1a = {
8893
+ const _hoisted_1$18 = {
8868
8894
  id: "lupa-search-box-suggestions",
8869
8895
  "data-cy": "lupa-search-box-suggestions"
8870
8896
  };
@@ -8928,7 +8954,7 @@ const _sfc_main$1h = /* @__PURE__ */ defineComponent({
8928
8954
  });
8929
8955
  });
8930
8956
  return (_ctx, _cache) => {
8931
- return openBlock(), createElementBlock("div", _hoisted_1$1a, [
8957
+ return openBlock(), createElementBlock("div", _hoisted_1$18, [
8932
8958
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (item, index) => {
8933
8959
  return openBlock(), createBlock(_sfc_main$1i, {
8934
8960
  key: getSuggestionKey(item),
@@ -9060,7 +9086,7 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
9060
9086
  if (!requestedIds.length) {
9061
9087
  return;
9062
9088
  }
9063
- loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2]: true }), {});
9089
+ loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
9064
9090
  loading.value = true;
9065
9091
  try {
9066
9092
  const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
@@ -9070,10 +9096,10 @@ const useDynamicDataStore = defineStore("dynamicData", () => {
9070
9096
  const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
9071
9097
  const seed = {};
9072
9098
  const dynamicDataIdMapValue = dynamicDataResult.reduce(
9073
- (a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
9099
+ (a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
9074
9100
  seed
9075
9101
  );
9076
- dynamicDataIdMap.value = __spreadValues2(__spreadValues2({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9102
+ dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9077
9103
  } finally {
9078
9104
  loading.value = false;
9079
9105
  loadingIds.value = {};
@@ -9103,7 +9129,7 @@ const replaceImageWithPlaceholder = (e2, placeholder) => {
9103
9129
  targetImage.src = placeholder;
9104
9130
  }
9105
9131
  };
9106
- const _hoisted_1$19 = ["src"];
9132
+ const _hoisted_1$17 = ["src"];
9107
9133
  const _sfc_main$1f = /* @__PURE__ */ defineComponent({
9108
9134
  __name: "ProductImage",
9109
9135
  props: {
@@ -9222,7 +9248,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
9222
9248
  }, { alt: imageAlt.value ? imageAlt.value : void 0 }, {
9223
9249
  onError: replaceWithPlaceholder,
9224
9250
  key: finalUrl.value
9225
- }), null, 16, _hoisted_1$19))
9251
+ }), null, 16, _hoisted_1$17))
9226
9252
  ]),
9227
9253
  _: 1
9228
9254
  })
@@ -9247,7 +9273,7 @@ const _sfc_main$1e = /* @__PURE__ */ defineComponent({
9247
9273
  };
9248
9274
  }
9249
9275
  });
9250
- const _hoisted_1$18 = ["innerHTML"];
9276
+ const _hoisted_1$16 = ["innerHTML"];
9251
9277
  const _hoisted_2$O = {
9252
9278
  key: 1,
9253
9279
  class: "lupa-search-box-product-title"
@@ -9272,13 +9298,13 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
9272
9298
  key: 0,
9273
9299
  class: "lupa-search-box-product-title",
9274
9300
  innerHTML: title.value
9275
- }, null, 8, _hoisted_1$18)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9301
+ }, null, 8, _hoisted_1$16)) : (openBlock(), createElementBlock("div", _hoisted_2$O, [
9276
9302
  createBaseVNode("strong", null, toDisplayString(title.value), 1)
9277
9303
  ]));
9278
9304
  };
9279
9305
  }
9280
9306
  });
9281
- const _hoisted_1$17 = ["innerHTML"];
9307
+ const _hoisted_1$15 = ["innerHTML"];
9282
9308
  const _hoisted_2$N = {
9283
9309
  key: 1,
9284
9310
  class: "lupa-search-box-product-description"
@@ -9303,11 +9329,11 @@ const _sfc_main$1c = /* @__PURE__ */ defineComponent({
9303
9329
  key: 0,
9304
9330
  class: "lupa-search-box-product-description",
9305
9331
  innerHTML: description.value
9306
- }, null, 8, _hoisted_1$17)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9332
+ }, null, 8, _hoisted_1$15)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(description.value), 1));
9307
9333
  };
9308
9334
  }
9309
9335
  });
9310
- const _hoisted_1$16 = { class: "lupa-search-box-product-price" };
9336
+ const _hoisted_1$14 = { class: "lupa-search-box-product-price" };
9311
9337
  const _sfc_main$1b = /* @__PURE__ */ defineComponent({
9312
9338
  __name: "SearchBoxProductPrice",
9313
9339
  props: {
@@ -9326,13 +9352,12 @@ const _sfc_main$1b = /* @__PURE__ */ defineComponent({
9326
9352
  );
9327
9353
  });
9328
9354
  return (_ctx, _cache) => {
9329
- return openBlock(), createElementBlock("div", _hoisted_1$16, [
9355
+ return openBlock(), createElementBlock("div", _hoisted_1$14, [
9330
9356
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
9331
9357
  ]);
9332
9358
  };
9333
9359
  }
9334
9360
  });
9335
- const _hoisted_1$15 = { class: "lupa-search-box-product-regular-price" };
9336
9361
  const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9337
9362
  __name: "SearchBoxProductRegularPrice",
9338
9363
  props: {
@@ -9342,6 +9367,9 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9342
9367
  },
9343
9368
  setup(__props) {
9344
9369
  const props = __props;
9370
+ const className = computed(() => {
9371
+ return props.options.className;
9372
+ });
9345
9373
  const price = computed(() => {
9346
9374
  var _a, _b;
9347
9375
  return formatPrice(
@@ -9351,11 +9379,13 @@ const _sfc_main$1a = /* @__PURE__ */ defineComponent({
9351
9379
  );
9352
9380
  });
9353
9381
  return (_ctx, _cache) => {
9354
- return openBlock(), createElementBlock("div", _hoisted_1$15, toDisplayString(price.value), 1);
9382
+ return openBlock(), createElementBlock("div", {
9383
+ class: normalizeClass([className.value, "lupa-search-box-product-regular-price"])
9384
+ }, toDisplayString(price.value), 3);
9355
9385
  };
9356
9386
  }
9357
9387
  });
9358
- const _hoisted_1$14 = ["innerHTML"];
9388
+ const _hoisted_1$13 = ["innerHTML"];
9359
9389
  const _hoisted_2$M = { key: 0 };
9360
9390
  const _hoisted_3$z = { key: 1 };
9361
9391
  const _hoisted_4$r = { class: "lupa-search-box-custom-label" };
@@ -9386,7 +9416,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
9386
9416
  key: 0,
9387
9417
  class: [className.value, "lupa-search-box-product-custom"],
9388
9418
  innerHTML: text.value
9389
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$14)) : (openBlock(), createElementBlock("div", mergeProps({
9419
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13)) : (openBlock(), createElementBlock("div", mergeProps({
9390
9420
  key: 1,
9391
9421
  class: [className.value, "lupa-search-box-product-custom"]
9392
9422
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
@@ -9398,7 +9428,7 @@ const _sfc_main$19 = /* @__PURE__ */ defineComponent({
9398
9428
  };
9399
9429
  }
9400
9430
  });
9401
- const _hoisted_1$13 = ["innerHTML"];
9431
+ const _hoisted_1$12 = ["innerHTML"];
9402
9432
  const _sfc_main$18 = /* @__PURE__ */ defineComponent({
9403
9433
  __name: "SearchBoxProductCustomHtml",
9404
9434
  props: {
@@ -9419,7 +9449,7 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
9419
9449
  return openBlock(), createElementBlock("div", mergeProps({
9420
9450
  class: className.value,
9421
9451
  innerHTML: text.value
9422
- }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$13);
9452
+ }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), null, 16, _hoisted_1$12);
9423
9453
  };
9424
9454
  }
9425
9455
  });
@@ -9539,17 +9569,17 @@ const useSearchResultStore = defineStore("searchResult", () => {
9539
9569
  return hasResults.value && ((_a = searchResult.value.offset) != null ? _a : 0) >= totalItems.value;
9540
9570
  }
9541
9571
  );
9542
- const setSidebarState = ({ visible }) => {
9543
- if (visible) {
9572
+ const setSidebarState = ({ visible: visible2 }) => {
9573
+ if (visible2) {
9544
9574
  disableBodyScroll();
9545
9575
  } else {
9546
9576
  enableBodyScroll();
9547
9577
  }
9548
- isMobileSidebarVisible.value = visible;
9578
+ isMobileSidebarVisible.value = visible2;
9549
9579
  };
9550
9580
  const queryFacet = (_0) => __async(void 0, [_0], function* ({ queryKey, facetKey }) {
9551
9581
  var _a, _b, _c, _d;
9552
- const query = { searchText: "", filters: __spreadValues2({}, filters.value) };
9582
+ const query = { searchText: "", filters: __spreadValues({}, filters.value) };
9553
9583
  const options = (_a = optionsStore.envOptions) != null ? _a : { environment: "production" };
9554
9584
  const result = yield LupaSearchSdk.query(queryKey, query, options);
9555
9585
  if (!result.success) {
@@ -9557,8 +9587,8 @@ const useSearchResultStore = defineStore("searchResult", () => {
9557
9587
  }
9558
9588
  const facet = (_b = result.facets) == null ? void 0 : _b.find((f2) => f2.key === facetKey);
9559
9589
  const facetItems = (_c = facet == null ? void 0 : facet.items) != null ? _c : [];
9560
- const updatedResult = __spreadProps2(__spreadValues2({}, searchResult.value), {
9561
- facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps2(__spreadValues2({}, f2), { items: facetItems }) : f2)
9590
+ const updatedResult = __spreadProps(__spreadValues({}, searchResult.value), {
9591
+ facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps(__spreadValues({}, f2), { items: facetItems }) : f2)
9562
9592
  });
9563
9593
  searchResult.value = updatedResult;
9564
9594
  });
@@ -9647,7 +9677,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
9647
9677
  filterVisibleFilterValues
9648
9678
  };
9649
9679
  });
9650
- const _hoisted_1$12 = { class: "lupa-search-box-add-to-cart-wrapper" };
9680
+ const _hoisted_1$11 = { class: "lupa-search-box-add-to-cart-wrapper" };
9651
9681
  const _hoisted_2$L = { class: "lupa-search-box-product-addtocart" };
9652
9682
  const _hoisted_3$y = ["onClick", "disabled"];
9653
9683
  const _sfc_main$17 = /* @__PURE__ */ defineComponent({
@@ -9677,7 +9707,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
9677
9707
  loading.value = false;
9678
9708
  });
9679
9709
  return (_ctx, _cache) => {
9680
- return openBlock(), createElementBlock("div", _hoisted_1$12, [
9710
+ return openBlock(), createElementBlock("div", _hoisted_1$11, [
9681
9711
  createBaseVNode("div", _hoisted_2$L, [
9682
9712
  createBaseVNode("button", {
9683
9713
  onClick: withModifiers(handleClick, ["stop", "prevent"]),
@@ -9691,7 +9721,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
9691
9721
  };
9692
9722
  }
9693
9723
  });
9694
- const _hoisted_1$11 = {
9724
+ const _hoisted_1$10 = {
9695
9725
  key: 1,
9696
9726
  class: "lupa-search-box-element-badge-wrapper"
9697
9727
  };
@@ -9707,7 +9737,7 @@ const __default__$4 = {
9707
9737
  SearchBoxProductAddToCart: _sfc_main$17
9708
9738
  }
9709
9739
  };
9710
- const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$4), {
9740
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
9711
9741
  __name: "SearchBoxProductElement",
9712
9742
  props: {
9713
9743
  item: {},
@@ -9749,7 +9779,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9749
9779
  return props.item;
9750
9780
  }
9751
9781
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
9752
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
9782
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
9753
9783
  });
9754
9784
  const isLoadingDynamicData = (id) => {
9755
9785
  return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
@@ -9765,7 +9795,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9765
9795
  class: normalizeClass({ "lupa-loading-dynamic-data": isLoadingDynamicData((_a = _ctx.item) == null ? void 0 : _a.id) }),
9766
9796
  inStock: _ctx.isInStock
9767
9797
  }, null, 8, ["item", "options", "labels", "class", "inStock"])) : createCommentVNode("", true)
9768
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$11, [
9798
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_1$10, [
9769
9799
  displayElement.value ? (openBlock(), createBlock(resolveDynamicComponent(elementComponent.value), {
9770
9800
  key: 0,
9771
9801
  item: enhancedItem.value,
@@ -9779,7 +9809,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9779
9809
  };
9780
9810
  }
9781
9811
  }));
9782
- const _hoisted_1$10 = { class: "lupa-badge-title" };
9812
+ const _hoisted_1$$ = { class: "lupa-badge-title" };
9783
9813
  const _hoisted_2$K = ["src"];
9784
9814
  const _hoisted_3$x = { key: 1 };
9785
9815
  const _hoisted_4$q = {
@@ -9819,7 +9849,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
9819
9849
  class: normalizeClass(["lupa-dynamic-badge", customClassName.value]),
9820
9850
  style: normalizeStyle({ background: _ctx.badge.backgroundColor, color: _ctx.badge.color })
9821
9851
  }, [
9822
- createBaseVNode("span", _hoisted_1$10, [
9852
+ createBaseVNode("span", _hoisted_1$$, [
9823
9853
  image.value ? (openBlock(), createElementBlock("img", {
9824
9854
  key: 0,
9825
9855
  src: image.value
@@ -9831,7 +9861,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
9831
9861
  };
9832
9862
  }
9833
9863
  });
9834
- const _hoisted_1$$ = { class: "lupa-generated-badges" };
9864
+ const _hoisted_1$_ = { class: "lupa-generated-badges" };
9835
9865
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9836
9866
  __name: "SearchResultGeneratedBadges",
9837
9867
  props: {
@@ -9858,7 +9888,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9858
9888
  })).filter((b) => Boolean(b.id));
9859
9889
  });
9860
9890
  return (_ctx, _cache) => {
9861
- return openBlock(), createElementBlock("div", _hoisted_1$$, [
9891
+ return openBlock(), createElementBlock("div", _hoisted_1$_, [
9862
9892
  (openBlock(true), createElementBlock(Fragment, null, renderList(badges.value, (badge) => {
9863
9893
  return openBlock(), createBlock(_sfc_main$15, {
9864
9894
  key: badge.id,
@@ -9870,7 +9900,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
9870
9900
  };
9871
9901
  }
9872
9902
  });
9873
- const _hoisted_1$_ = ["innerHTML"];
9903
+ const _hoisted_1$Z = ["innerHTML"];
9874
9904
  const _sfc_main$13 = /* @__PURE__ */ defineComponent({
9875
9905
  __name: "CustomBadge",
9876
9906
  props: {
@@ -9890,11 +9920,11 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent({
9890
9920
  return openBlock(), createElementBlock("div", {
9891
9921
  class: normalizeClass(className.value),
9892
9922
  innerHTML: text.value
9893
- }, null, 10, _hoisted_1$_);
9923
+ }, null, 10, _hoisted_1$Z);
9894
9924
  };
9895
9925
  }
9896
9926
  });
9897
- const _hoisted_1$Z = { class: "lupa-text-badges" };
9927
+ const _hoisted_1$Y = { class: "lupa-text-badges" };
9898
9928
  const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9899
9929
  __name: "TextBadge",
9900
9930
  props: {
@@ -9910,7 +9940,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9910
9940
  return badges.value.slice(0, props.badge.maxItems);
9911
9941
  });
9912
9942
  return (_ctx, _cache) => {
9913
- return openBlock(), createElementBlock("div", _hoisted_1$Z, [
9943
+ return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9914
9944
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9915
9945
  return openBlock(), createElementBlock("div", {
9916
9946
  class: "lupa-badge lupa-text-badge",
@@ -9921,7 +9951,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9921
9951
  };
9922
9952
  }
9923
9953
  });
9924
- const _hoisted_1$Y = { class: "lupa-image-badges" };
9954
+ const _hoisted_1$X = { class: "lupa-image-badges" };
9925
9955
  const _hoisted_2$J = ["src"];
9926
9956
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9927
9957
  __name: "ImageBadge",
@@ -9943,7 +9973,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9943
9973
  return `${props.badge.rootImageUrl}${src}`;
9944
9974
  };
9945
9975
  return (_ctx, _cache) => {
9946
- return openBlock(), createElementBlock("div", _hoisted_1$Y, [
9976
+ return openBlock(), createElementBlock("div", _hoisted_1$X, [
9947
9977
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayBadges.value, (item) => {
9948
9978
  return openBlock(), createElementBlock("div", {
9949
9979
  class: "lupa-badge lupa-image-badge",
@@ -9958,7 +9988,7 @@ const _sfc_main$11 = /* @__PURE__ */ defineComponent({
9958
9988
  };
9959
9989
  }
9960
9990
  });
9961
- const _hoisted_1$X = { id: "lupa-search-results-badges" };
9991
+ const _hoisted_1$W = { id: "lupa-search-results-badges" };
9962
9992
  const __default__$3 = {
9963
9993
  components: {
9964
9994
  CustomBadge: _sfc_main$13,
@@ -9966,7 +9996,7 @@ const __default__$3 = {
9966
9996
  ImageBadge: _sfc_main$11
9967
9997
  }
9968
9998
  };
9969
- const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$3), {
9999
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
9970
10000
  __name: "SearchResultsBadgeWrapper",
9971
10001
  props: {
9972
10002
  position: {},
@@ -9989,7 +10019,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
9989
10019
  return props.options.product;
9990
10020
  }
9991
10021
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.options.product) == null ? void 0 : _b.id]) != null ? _d : {};
9992
- return __spreadValues2(__spreadValues2({}, props.options.product), enhancementData);
10022
+ return __spreadValues(__spreadValues({}, props.options.product), enhancementData);
9993
10023
  });
9994
10024
  const badges = computed(() => {
9995
10025
  if (!props.options.elements) {
@@ -10000,7 +10030,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
10000
10030
  return !e2.display || e2.display((_a = props.options.product) != null ? _a : {});
10001
10031
  }).map((x) => {
10002
10032
  var _a;
10003
- return __spreadProps2(__spreadValues2({}, x), {
10033
+ return __spreadProps(__spreadValues({}, x), {
10004
10034
  value: ((_a = enhancedProduct.value) == null ? void 0 : _a[x.key]) || "badge",
10005
10035
  product: enhancedProduct.value
10006
10036
  });
@@ -10022,7 +10052,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
10022
10052
  }
10023
10053
  };
10024
10054
  return (_ctx, _cache) => {
10025
- return openBlock(), createElementBlock("div", _hoisted_1$X, [
10055
+ return openBlock(), createElementBlock("div", _hoisted_1$W, [
10026
10056
  createBaseVNode("div", {
10027
10057
  id: "lupa-badges",
10028
10058
  class: normalizeClass(anchorPosition.value)
@@ -10042,7 +10072,7 @@ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
10042
10072
  };
10043
10073
  }
10044
10074
  }));
10045
- const _hoisted_1$W = ["href"];
10075
+ const _hoisted_1$V = ["href"];
10046
10076
  const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
10047
10077
  const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
10048
10078
  const _hoisted_4$p = {
@@ -10067,7 +10097,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
10067
10097
  return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
10068
10098
  });
10069
10099
  const badgeOptions = computed(() => {
10070
- return __spreadProps2(__spreadValues2({}, props.panelOptions.badges), { product: props.item });
10100
+ return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
10071
10101
  });
10072
10102
  const imageElements = computed(() => {
10073
10103
  var _a, _b;
@@ -10154,7 +10184,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
10154
10184
  isInStock: isInStock.value
10155
10185
  }, null, 8, ["item", "element", "labels", "link", "isInStock"])
10156
10186
  ])) : createCommentVNode("", true)
10157
- ], 16, _hoisted_1$W);
10187
+ ], 16, _hoisted_1$V);
10158
10188
  };
10159
10189
  }
10160
10190
  });
@@ -10206,8 +10236,8 @@ const useTrackingStore = defineStore("tracking", () => {
10206
10236
  const mappedItems = ((_e = trackingOptions.analytics) == null ? void 0 : _e.itemMap) ? items.map(trackingOptions.analytics.itemMap) : items;
10207
10237
  track(
10208
10238
  queryKey,
10209
- __spreadProps2(__spreadValues2({}, data), {
10210
- analytics: data.analytics ? __spreadProps2(__spreadValues2({}, data.analytics), { items: mappedItems }) : void 0,
10239
+ __spreadProps(__spreadValues({}, data), {
10240
+ analytics: data.analytics ? __spreadProps(__spreadValues({}, data.analytics), { items: mappedItems }) : void 0,
10211
10241
  filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
10212
10242
  }),
10213
10243
  options
@@ -10215,7 +10245,7 @@ const useTrackingStore = defineStore("tracking", () => {
10215
10245
  };
10216
10246
  return { trackSearch, trackResults, trackEvent };
10217
10247
  });
10218
- const _hoisted_1$V = { id: "lupa-search-box-products" };
10248
+ const _hoisted_1$U = { id: "lupa-search-box-products" };
10219
10249
  const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10220
10250
  __name: "SearchBoxProducts",
10221
10251
  props: {
@@ -10277,7 +10307,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10277
10307
  handleRoutingEvent(link, event, boxRoutingBehavior.value === "event");
10278
10308
  };
10279
10309
  return (_ctx, _cache) => {
10280
- return openBlock(), createElementBlock("div", _hoisted_1$V, [
10310
+ return openBlock(), createElementBlock("div", _hoisted_1$U, [
10281
10311
  _ctx.$slots.productCard ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(_ctx.items, (item, index) => {
10282
10312
  return renderSlot(_ctx.$slots, "productCard", {
10283
10313
  key: index,
@@ -10304,7 +10334,7 @@ const _sfc_main$_ = /* @__PURE__ */ defineComponent({
10304
10334
  };
10305
10335
  }
10306
10336
  });
10307
- const _hoisted_1$U = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10337
+ const _hoisted_1$T = { class: "lupa-search-box-documents-go-to-results-wrapper" };
10308
10338
  const _hoisted_2$H = { key: 0 };
10309
10339
  const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10310
10340
  __name: "SearchBoxProductsGoToResultsButton",
@@ -10336,7 +10366,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10336
10366
  emit2("goToResults");
10337
10367
  };
10338
10368
  return (_ctx, _cache) => {
10339
- return openBlock(), createElementBlock("div", _hoisted_1$U, [
10369
+ return openBlock(), createElementBlock("div", _hoisted_1$T, [
10340
10370
  createBaseVNode("button", {
10341
10371
  class: "lupa-search-box-documents-go-to-results-button",
10342
10372
  onClick: goToResults
@@ -10501,7 +10531,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10501
10531
  });
10502
10532
  const getItemsDebounced = debounce$1(getItems, props.debounce);
10503
10533
  const documentPanelOptions = computed(() => {
10504
- return __spreadProps2(__spreadValues2({}, props.panel), {
10534
+ return __spreadProps(__spreadValues({}, props.panel), {
10505
10535
  type: SearchBoxPanelType.DOCUMENT
10506
10536
  });
10507
10537
  });
@@ -10525,7 +10555,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
10525
10555
  };
10526
10556
  }
10527
10557
  });
10528
- const _hoisted_1$T = {
10558
+ const _hoisted_1$S = {
10529
10559
  key: 0,
10530
10560
  id: "lupa-search-box-panel"
10531
10561
  };
@@ -10549,7 +10579,7 @@ const __default__$2 = {
10549
10579
  SearchBoxRelatedSourceWrapper: _sfc_main$X
10550
10580
  }
10551
10581
  };
10552
- const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$2), {
10582
+ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
10553
10583
  __name: "SearchBoxMainPanel",
10554
10584
  props: {
10555
10585
  options: {},
@@ -10695,7 +10725,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
10695
10725
  ref_key: "panelContainer",
10696
10726
  ref: panelContainer
10697
10727
  }, [
10698
- displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$T, [
10728
+ displayResults.value ? (openBlock(), createElementBlock("div", _hoisted_1$S, [
10699
10729
  labels.value.closePanel ? (openBlock(), createElementBlock("a", {
10700
10730
  key: 0,
10701
10731
  class: "lupa-search-box-close-panel",
@@ -10778,7 +10808,7 @@ const unbindSearchTriggers = (triggers = [], event) => {
10778
10808
  const elements = getElements(triggers);
10779
10809
  elements.forEach((e2) => e2 == null ? void 0 : e2.removeEventListener(BIND_EVENT, event));
10780
10810
  };
10781
- const _hoisted_1$S = { id: "lupa-search-box" };
10811
+ const _hoisted_1$R = { id: "lupa-search-box" };
10782
10812
  const _hoisted_2$F = { class: "lupa-search-box-wrapper" };
10783
10813
  const _sfc_main$V = /* @__PURE__ */ defineComponent({
10784
10814
  __name: "SearchBox",
@@ -10861,7 +10891,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10861
10891
  const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
10862
10892
  const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
10863
10893
  const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
10864
- if (!isOutsideElement) {
10894
+ if (!isOutsideElement || props.options.keepOpen) {
10865
10895
  return;
10866
10896
  }
10867
10897
  opened.value = false;
@@ -10880,7 +10910,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10880
10910
  case "Tab":
10881
10911
  if ((_b = (_a2 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a2.item) == null ? void 0 : _b.suggestion) {
10882
10912
  e2.preventDefault();
10883
- selectSuggestion(__spreadProps2(__spreadValues2({}, suggestedValue.value), { override: true }));
10913
+ selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
10884
10914
  }
10885
10915
  break;
10886
10916
  case "Enter":
@@ -10895,6 +10925,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10895
10925
  opened.value = true;
10896
10926
  inputValue.value = (_a2 = value == null ? void 0 : value.replace(/\s+$/, "")) != null ? _a2 : "";
10897
10927
  suggestedValue.value = defaultSuggestedValue;
10928
+ searchBoxStore.resetHighlightIndex();
10898
10929
  trackSearchQuery(value);
10899
10930
  if (props.isSearchContainer) {
10900
10931
  goToResultsDebounced({
@@ -10929,7 +10960,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10929
10960
  };
10930
10961
  const selectSuggestion = (inputSuggestion, shouldSearch = false) => {
10931
10962
  if (inputSuggestion.item.suggestion) {
10932
- suggestedValue.value = __spreadProps2(__spreadValues2({}, inputSuggestion), {
10963
+ suggestedValue.value = __spreadProps(__spreadValues({}, inputSuggestion), {
10933
10964
  override: true
10934
10965
  });
10935
10966
  if (inputSuggestion.override) {
@@ -11027,11 +11058,11 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
11027
11058
  opened.value = false;
11028
11059
  };
11029
11060
  const slotProps = (props2) => {
11030
- return __spreadValues2({}, props2);
11061
+ return __spreadValues({}, props2);
11031
11062
  };
11032
11063
  return (_ctx, _cache) => {
11033
11064
  var _a2;
11034
- return openBlock(), createElementBlock("div", _hoisted_1$S, [
11065
+ return openBlock(), createElementBlock("div", _hoisted_1$R, [
11035
11066
  createBaseVNode("div", _hoisted_2$F, [
11036
11067
  createVNode(_sfc_main$1n, {
11037
11068
  options: inputOptions.value,
@@ -11115,8 +11146,8 @@ const getOffset = (page, limit = 10) => {
11115
11146
  return (page - 1) * limit;
11116
11147
  };
11117
11148
  const getPublicQuery = (publicQuery, initialFilters, isProductList) => {
11118
- return __spreadProps2(__spreadValues2({}, publicQuery), {
11119
- filters: __spreadValues2(__spreadValues2({}, initialFilters), publicQuery.filters),
11149
+ return __spreadProps(__spreadValues({}, publicQuery), {
11150
+ filters: __spreadValues(__spreadValues({}, initialFilters), publicQuery.filters),
11120
11151
  searchText: isProductList ? "" : publicQuery.searchText
11121
11152
  });
11122
11153
  };
@@ -11133,7 +11164,7 @@ const getSearchParams = (url, params, baseUrl) => {
11133
11164
  }
11134
11165
  return searchParams;
11135
11166
  };
11136
- const _hoisted_1$R = {
11167
+ const _hoisted_1$Q = {
11137
11168
  key: 0,
11138
11169
  id: "lupa-search-results-did-you-mean"
11139
11170
  };
@@ -11178,7 +11209,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
11178
11209
  paramStore.goToResults({ searchText, facet });
11179
11210
  };
11180
11211
  return (_ctx, _cache) => {
11181
- return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
11212
+ return unref(searchResult).suggestedSearchText || didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11182
11213
  unref(searchResult).suggestedSearchText ? (openBlock(), createElementBlock("div", _hoisted_2$E, [
11183
11214
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.noResultsSuggestion.split(" "), (label, index) => {
11184
11215
  return openBlock(), createElementBlock("span", { key: index }, [
@@ -11204,7 +11235,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
11204
11235
  };
11205
11236
  }
11206
11237
  });
11207
- const _hoisted_1$Q = {
11238
+ const _hoisted_1$P = {
11208
11239
  key: 0,
11209
11240
  class: "lupa-search-results-summary"
11210
11241
  };
@@ -11224,7 +11255,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
11224
11255
  return addParamsToLabel(props.label, range, `<span>${totalItems.value}</span>`);
11225
11256
  });
11226
11257
  return (_ctx, _cache) => {
11227
- return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
11258
+ return unref(totalItems) > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$P, [
11228
11259
  createBaseVNode("div", { innerHTML: summaryLabel.value }, null, 8, _hoisted_2$D),
11229
11260
  _ctx.clearable ? (openBlock(), createElementBlock("span", {
11230
11261
  key: 0,
@@ -11236,7 +11267,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
11236
11267
  };
11237
11268
  }
11238
11269
  });
11239
- const _hoisted_1$P = {
11270
+ const _hoisted_1$O = {
11240
11271
  key: 0,
11241
11272
  class: "lupa-result-page-title",
11242
11273
  "data-cy": "lupa-result-page-title"
@@ -11287,7 +11318,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
11287
11318
  });
11288
11319
  return (_ctx, _cache) => {
11289
11320
  return openBlock(), createElementBlock("div", null, [
11290
- showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$P, [
11321
+ showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$O, [
11291
11322
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
11292
11323
  queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$C, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
11293
11324
  showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
@@ -11309,7 +11340,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
11309
11340
  };
11310
11341
  }
11311
11342
  });
11312
- const _hoisted_1$O = { class: "lupa-search-result-filter-value" };
11343
+ const _hoisted_1$N = { class: "lupa-search-result-filter-value" };
11313
11344
  const _hoisted_2$B = {
11314
11345
  class: "lupa-current-filter-label",
11315
11346
  "data-cy": "lupa-current-filter-label"
@@ -11330,7 +11361,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11330
11361
  emit2("remove", { filter: props.filter });
11331
11362
  };
11332
11363
  return (_ctx, _cache) => {
11333
- return openBlock(), createElementBlock("div", _hoisted_1$O, [
11364
+ return openBlock(), createElementBlock("div", _hoisted_1$N, [
11334
11365
  createBaseVNode("div", {
11335
11366
  class: "lupa-current-filter-action",
11336
11367
  onClick: handleClick
@@ -11341,7 +11372,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11341
11372
  };
11342
11373
  }
11343
11374
  });
11344
- const _hoisted_1$N = { class: "lupa-filter-title-text" };
11375
+ const _hoisted_1$M = { class: "lupa-filter-title-text" };
11345
11376
  const _hoisted_2$A = {
11346
11377
  key: 0,
11347
11378
  class: "lupa-filter-count"
@@ -11424,7 +11455,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11424
11455
  class: "lupa-current-filter-title",
11425
11456
  onClick: _cache[0] || (_cache[0] = ($event) => isOpen.value = !isOpen.value)
11426
11457
  }, [
11427
- createBaseVNode("div", _hoisted_1$N, [
11458
+ createBaseVNode("div", _hoisted_1$M, [
11428
11459
  createTextVNode(toDisplayString((_c = (_b = (_a = _ctx.options) == null ? void 0 : _a.labels) == null ? void 0 : _b.title) != null ? _c : "") + " ", 1),
11429
11460
  _ctx.expandable ? (openBlock(), createElementBlock("span", _hoisted_2$A, " (" + toDisplayString(unref(currentFilterCount)) + ") ", 1)) : createCommentVNode("", true)
11430
11461
  ]),
@@ -11453,7 +11484,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11453
11484
  };
11454
11485
  }
11455
11486
  });
11456
- const _hoisted_1$M = ["href"];
11487
+ const _hoisted_1$L = ["href"];
11457
11488
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
11458
11489
  __name: "CategoryFilterItem",
11459
11490
  props: {
@@ -11491,12 +11522,12 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
11491
11522
  "data-cy": "lupa-child-category-item",
11492
11523
  href: urlLink.value,
11493
11524
  onClick: handleNavigation
11494
- }, toDisplayString(title.value), 9, _hoisted_1$M)
11525
+ }, toDisplayString(title.value), 9, _hoisted_1$L)
11495
11526
  ], 2);
11496
11527
  };
11497
11528
  }
11498
11529
  });
11499
- const _hoisted_1$L = {
11530
+ const _hoisted_1$K = {
11500
11531
  class: "lupa-category-filter",
11501
11532
  "data-cy": "lupa-category-filter"
11502
11533
  };
@@ -11590,7 +11621,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
11590
11621
  };
11591
11622
  __expose({ fetch: fetch2 });
11592
11623
  return (_ctx, _cache) => {
11593
- return openBlock(), createElementBlock("div", _hoisted_1$L, [
11624
+ return openBlock(), createElementBlock("div", _hoisted_1$K, [
11594
11625
  createBaseVNode("div", _hoisted_2$z, [
11595
11626
  hasBackButton.value ? (openBlock(), createElementBlock("a", {
11596
11627
  key: 0,
@@ -11622,7 +11653,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
11622
11653
  };
11623
11654
  }
11624
11655
  });
11625
- const _hoisted_1$K = {
11656
+ const _hoisted_1$J = {
11626
11657
  class: "lupa-search-result-facet-term-values",
11627
11658
  "data-cy": "lupa-search-result-facet-term-values"
11628
11659
  };
@@ -11667,7 +11698,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
11667
11698
  return searchResultStore.filterVisibleFilterValues(facet.value.key, (_b = (_a = facet.value) == null ? void 0 : _a.items) != null ? _b : []);
11668
11699
  });
11669
11700
  const displayValues = computed(() => {
11670
- return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps2(__spreadValues2({}, v), { title: getDisplayValue(v.title) }));
11701
+ return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps(__spreadValues({}, v), { title: getDisplayValue(v.title) }));
11671
11702
  });
11672
11703
  const filteredValues = computed(() => {
11673
11704
  var _a, _b;
@@ -11709,7 +11740,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
11709
11740
  return selectedItems == null ? void 0 : selectedItems.includes((_b = item.title) == null ? void 0 : _b.toString());
11710
11741
  };
11711
11742
  return (_ctx, _cache) => {
11712
- return openBlock(), createElementBlock("div", _hoisted_1$K, [
11743
+ return openBlock(), createElementBlock("div", _hoisted_1$J, [
11713
11744
  isFilterable.value ? withDirectives((openBlock(), createElementBlock("input", {
11714
11745
  key: 0,
11715
11746
  class: "lupa-term-filter",
@@ -12608,7 +12639,7 @@ function h(e2, t) {
12608
12639
  return e3 === r[t2];
12609
12640
  });
12610
12641
  }
12611
- var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps2(__spreadValues2({}, { value: { validator: function(e2) {
12642
+ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps(__spreadValues({}, { value: { validator: function(e2) {
12612
12643
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
12613
12644
  }, required: false }, modelValue: { validator: function(e2) {
12614
12645
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
@@ -12621,15 +12652,15 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
12621
12652
  throw new Error("Slider v-model must not be an empty array");
12622
12653
  return { value: l2, initialValue: c3 };
12623
12654
  }(a), c2 = function(t, i, n) {
12624
- 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));
12655
+ 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));
12625
12656
  return { classList: computed(() => {
12626
- const e2 = __spreadValues2({}, u2.value);
12657
+ const e2 = __spreadValues({}, u2.value);
12627
12658
  return Object.keys(e2).forEach((t2) => {
12628
12659
  e2[t2] = Array.isArray(e2[t2]) ? e2[t2].filter((e3) => null !== e3).join(" ") : e2[t2];
12629
12660
  }), "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;
12630
12661
  }) };
12631
12662
  }(a), p2 = function(t, i, n) {
12632
- 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);
12663
+ 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);
12633
12664
  return { tooltipFormat: u2, tooltipsFormat: c3, tooltipsMerge: (e2, t2, r) => {
12634
12665
  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();
12635
12666
  a3.forEach(function(e3, t3) {
@@ -12722,12 +12753,12 @@ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide"
12722
12753
  R(V.value);
12723
12754
  } };
12724
12755
  }(a, s, { value: l.value, initialValue: l.initialValue, tooltipFormat: p2.tooltipFormat, tooltipsFormat: p2.tooltipsFormat, tooltipsMerge: p2.tooltipsMerge, classList: c2.classList });
12725
- return __spreadValues2(__spreadValues2(__spreadValues2({}, c2), p2), m2);
12756
+ return __spreadValues(__spreadValues(__spreadValues({}, c2), p2), m2);
12726
12757
  } };
12727
12758
  m.render = function(e2, t, r, i, n, o) {
12728
12759
  return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
12729
12760
  }, m.__file = "src/Slider.vue";
12730
- const _hoisted_1$J = { class: "lupa-search-result-facet-stats-values" };
12761
+ const _hoisted_1$I = { class: "lupa-search-result-facet-stats-values" };
12731
12762
  const _hoisted_2$x = {
12732
12763
  key: 0,
12733
12764
  class: "lupa-stats-facet-summary"
@@ -12928,7 +12959,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
12928
12959
  innerSliderRange.value = value;
12929
12960
  };
12930
12961
  return (_ctx, _cache) => {
12931
- return openBlock(), createElementBlock("div", _hoisted_1$J, [
12962
+ return openBlock(), createElementBlock("div", _hoisted_1$I, [
12932
12963
  !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$x, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
12933
12964
  createBaseVNode("div", null, [
12934
12965
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
@@ -12995,7 +13026,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
12995
13026
  };
12996
13027
  }
12997
13028
  });
12998
- const _hoisted_1$I = { class: "lupa-term-checkbox-wrapper" };
13029
+ const _hoisted_1$H = { class: "lupa-term-checkbox-wrapper" };
12999
13030
  const _hoisted_2$w = { class: "lupa-term-checkbox-label" };
13000
13031
  const _hoisted_3$n = { class: "lupa-term-label" };
13001
13032
  const _hoisted_4$h = {
@@ -13052,7 +13083,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
13052
13083
  "data-cy": "lupa-facet-term",
13053
13084
  onClick: _cache[0] || (_cache[0] = ($event) => handleFacetClick(_ctx.item))
13054
13085
  }, [
13055
- createBaseVNode("div", _hoisted_1$I, [
13086
+ createBaseVNode("div", _hoisted_1$H, [
13056
13087
  createBaseVNode("span", {
13057
13088
  class: normalizeClass(["lupa-term-checkbox", { checked: isChecked.value }])
13058
13089
  }, null, 2)
@@ -13078,7 +13109,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
13078
13109
  };
13079
13110
  }
13080
13111
  });
13081
- const _hoisted_1$H = {
13112
+ const _hoisted_1$G = {
13082
13113
  class: "lupa-search-result-facet-term-values lupa-search-result-facet-hierarchy-values",
13083
13114
  "data-cy": "lupa-search-result-facet-term-values"
13084
13115
  };
@@ -13134,7 +13165,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
13134
13165
  showAll.value = true;
13135
13166
  };
13136
13167
  return (_ctx, _cache) => {
13137
- return openBlock(), createElementBlock("div", _hoisted_1$H, [
13168
+ return openBlock(), createElementBlock("div", _hoisted_1$G, [
13138
13169
  isFilterable.value ? (openBlock(), createElementBlock("div", _hoisted_2$v, [
13139
13170
  withDirectives(createBaseVNode("input", {
13140
13171
  class: "lupa-term-filter",
@@ -13166,7 +13197,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
13166
13197
  };
13167
13198
  }
13168
13199
  });
13169
- const _hoisted_1$G = { class: "lupa-facet-label-text" };
13200
+ const _hoisted_1$F = { class: "lupa-facet-label-text" };
13170
13201
  const _hoisted_2$u = {
13171
13202
  key: 0,
13172
13203
  class: "lupa-facet-content",
@@ -13179,7 +13210,7 @@ const __default__$1 = {
13179
13210
  HierarchyFacet: _sfc_main$K
13180
13211
  }
13181
13212
  };
13182
- const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
13213
+ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
13183
13214
  __name: "FacetDisplay",
13184
13215
  props: {
13185
13216
  options: {},
@@ -13291,7 +13322,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
13291
13322
  "data-cy": "lupa-search-result-facet-label",
13292
13323
  onClick: toggleFacet
13293
13324
  }, [
13294
- createBaseVNode("div", _hoisted_1$G, toDisplayString(facet.value.label), 1),
13325
+ createBaseVNode("div", _hoisted_1$F, toDisplayString(facet.value.label), 1),
13295
13326
  createBaseVNode("div", {
13296
13327
  class: normalizeClass(["lupa-facet-label-caret", isOpen.value && "open"])
13297
13328
  }, null, 2)
@@ -13314,7 +13345,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
13314
13345
  };
13315
13346
  }
13316
13347
  }));
13317
- const _hoisted_1$F = { class: "lupa-search-result-facet-section" };
13348
+ const _hoisted_1$E = { class: "lupa-search-result-facet-section" };
13318
13349
  const _hoisted_2$t = {
13319
13350
  key: 0,
13320
13351
  class: "lupa-facets-title"
@@ -13353,7 +13384,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
13353
13384
  };
13354
13385
  return (_ctx, _cache) => {
13355
13386
  var _a;
13356
- return openBlock(), createElementBlock("div", _hoisted_1$F, [
13387
+ return openBlock(), createElementBlock("div", _hoisted_1$E, [
13357
13388
  _ctx.options.labels.title ? (openBlock(), createElementBlock("div", _hoisted_2$t, toDisplayString(_ctx.options.labels.title), 1)) : createCommentVNode("", true),
13358
13389
  createBaseVNode("div", {
13359
13390
  class: normalizeClass(["lupa-search-result-facet-list", "lupa-" + ((_a = _ctx.facetStyle) != null ? _a : "")])
@@ -13375,7 +13406,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
13375
13406
  };
13376
13407
  }
13377
13408
  });
13378
- const _hoisted_1$E = ["onClick"];
13409
+ const _hoisted_1$D = ["onClick"];
13379
13410
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
13380
13411
  __name: "FacetsButton",
13381
13412
  props: {
@@ -13396,11 +13427,11 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
13396
13427
  key: 0,
13397
13428
  class: "lupa-facets-button-filter",
13398
13429
  onClick: withModifiers(handleClick, ["stop"])
13399
- }, toDisplayString(label.value), 9, _hoisted_1$E)) : createCommentVNode("", true);
13430
+ }, toDisplayString(label.value), 9, _hoisted_1$D)) : createCommentVNode("", true);
13400
13431
  };
13401
13432
  }
13402
13433
  });
13403
- const _hoisted_1$D = { class: "lupa-search-result-facets" };
13434
+ const _hoisted_1$C = { class: "lupa-search-result-facets" };
13404
13435
  const _hoisted_2$s = { class: "lupa-facets-filter-button-wrapper" };
13405
13436
  const _sfc_main$G = /* @__PURE__ */ defineComponent({
13406
13437
  __name: "Facets",
@@ -13485,7 +13516,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
13485
13516
  emit2("filter");
13486
13517
  };
13487
13518
  return (_ctx, _cache) => {
13488
- return openBlock(), createElementBlock("div", _hoisted_1$D, [
13519
+ return openBlock(), createElementBlock("div", _hoisted_1$C, [
13489
13520
  regularFacets.value ? (openBlock(), createBlock(_sfc_main$I, {
13490
13521
  key: 0,
13491
13522
  options: _ctx.options,
@@ -13507,7 +13538,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
13507
13538
  };
13508
13539
  }
13509
13540
  });
13510
- const _hoisted_1$C = {
13541
+ const _hoisted_1$B = {
13511
13542
  id: "lupa-search-result-filters",
13512
13543
  class: "lupa-search-result-filters"
13513
13544
  };
@@ -13544,7 +13575,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13544
13575
  __expose({ fetch: fetch2 });
13545
13576
  return (_ctx, _cache) => {
13546
13577
  var _a;
13547
- return openBlock(), createElementBlock("div", _hoisted_1$C, [
13578
+ return openBlock(), createElementBlock("div", _hoisted_1$B, [
13548
13579
  showCurrentFilters.value ? (openBlock(), createBlock(_sfc_main$Q, {
13549
13580
  key: 0,
13550
13581
  options: _ctx.options.currentFilters,
@@ -13565,7 +13596,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
13565
13596
  };
13566
13597
  }
13567
13598
  });
13568
- const _hoisted_1$B = {
13599
+ const _hoisted_1$A = {
13569
13600
  key: 0,
13570
13601
  class: "lupa-mobile-filter-sidebar"
13571
13602
  };
@@ -13609,7 +13640,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13609
13640
  handleMobileToggle();
13610
13641
  };
13611
13642
  return (_ctx, _cache) => {
13612
- return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$B, [
13643
+ return isMobileSidebarVisible.value ? (openBlock(), createElementBlock("div", _hoisted_1$A, [
13613
13644
  createBaseVNode("div", {
13614
13645
  class: "lupa-sidebar-close",
13615
13646
  onClick: withModifiers(handleMobileToggle, ["stop"])
@@ -13637,7 +13668,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
13637
13668
  };
13638
13669
  }
13639
13670
  });
13640
- const _hoisted_1$A = { id: "lupa-search-results-breadcrumbs" };
13671
+ const _hoisted_1$z = { id: "lupa-search-results-breadcrumbs" };
13641
13672
  const _hoisted_2$q = ["href", "onClick"];
13642
13673
  const _hoisted_3$k = {
13643
13674
  key: 1,
@@ -13669,7 +13700,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13669
13700
  handleRoutingEvent(link, event, hasEventRouting.value);
13670
13701
  };
13671
13702
  return (_ctx, _cache) => {
13672
- return openBlock(), createElementBlock("div", _hoisted_1$A, [
13703
+ return openBlock(), createElementBlock("div", _hoisted_1$z, [
13673
13704
  (openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbsValue.value, (breadcrumb, index) => {
13674
13705
  return openBlock(), createElementBlock("span", {
13675
13706
  class: "lupa-search-results-breadcrumb",
@@ -13691,9 +13722,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
13691
13722
  };
13692
13723
  }
13693
13724
  });
13694
- const _hoisted_1$z = {
13725
+ const _hoisted_1$y = {
13695
13726
  id: "lupa-search-result-filters",
13696
- class: "lupa-search-result-filters"
13727
+ class: "lupa-search-result-filters lupa-search-result-top-filters"
13697
13728
  };
13698
13729
  const _sfc_main$C = /* @__PURE__ */ defineComponent({
13699
13730
  __name: "FiltersTopDropdown",
@@ -13707,7 +13738,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13707
13738
  };
13708
13739
  return (_ctx, _cache) => {
13709
13740
  var _a;
13710
- return openBlock(), createElementBlock("div", _hoisted_1$z, [
13741
+ return openBlock(), createElementBlock("div", _hoisted_1$y, [
13711
13742
  _ctx.options.facets ? (openBlock(), createBlock(_sfc_main$G, {
13712
13743
  key: 0,
13713
13744
  options: _ctx.options.facets,
@@ -13719,7 +13750,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
13719
13750
  };
13720
13751
  }
13721
13752
  });
13722
- const _hoisted_1$y = { id: "lupa-search-results-layout-selection" };
13753
+ const _hoisted_1$x = { id: "lupa-search-results-layout-selection" };
13723
13754
  const _sfc_main$B = /* @__PURE__ */ defineComponent({
13724
13755
  __name: "SearchResultsLayoutSelection",
13725
13756
  setup(__props) {
@@ -13731,7 +13762,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13731
13762
  searchResultStore.setLayout(layout2);
13732
13763
  };
13733
13764
  return (_ctx, _cache) => {
13734
- return openBlock(), createElementBlock("div", _hoisted_1$y, [
13765
+ return openBlock(), createElementBlock("div", _hoisted_1$x, [
13735
13766
  createBaseVNode("div", {
13736
13767
  class: normalizeClass([
13737
13768
  "lupa-layout-selection-grid",
@@ -13753,7 +13784,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
13753
13784
  };
13754
13785
  }
13755
13786
  });
13756
- const _hoisted_1$x = {
13787
+ const _hoisted_1$w = {
13757
13788
  key: 0,
13758
13789
  class: "lupa-mobile-toggle-filter-count"
13759
13790
  };
@@ -13775,12 +13806,12 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
13775
13806
  onClick: handleMobileToggle
13776
13807
  }, [
13777
13808
  createTextVNode(toDisplayString(_ctx.label) + " ", 1),
13778
- _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$x, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13809
+ _ctx.showFilterCount && unref(currentFilterCount) > 0 ? (openBlock(), createElementBlock("span", _hoisted_1$w, toDisplayString(unref(currentFilterCount)), 1)) : createCommentVNode("", true)
13779
13810
  ], 2);
13780
13811
  };
13781
13812
  }
13782
13813
  });
13783
- const _hoisted_1$w = {
13814
+ const _hoisted_1$v = {
13784
13815
  key: 0,
13785
13816
  id: "lupa-search-results-page-select",
13786
13817
  "data-cy": "lupa-search-results-page-select"
@@ -13871,7 +13902,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
13871
13902
  }
13872
13903
  };
13873
13904
  return (_ctx, _cache) => {
13874
- return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$w, [
13905
+ return showPagination.value ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
13875
13906
  showBack.value ? (openBlock(), createElementBlock("div", {
13876
13907
  key: 0,
13877
13908
  class: normalizeClass(firstPageLabel.value === "<" ? "lupa-page-arrow" : "lupa-show-less"),
@@ -13915,7 +13946,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
13915
13946
  };
13916
13947
  }
13917
13948
  });
13918
- const _hoisted_1$v = {
13949
+ const _hoisted_1$u = {
13919
13950
  id: "lupa-search-results-page-size",
13920
13951
  "data-cy": "lupa-search-results-page-size"
13921
13952
  };
@@ -13942,6 +13973,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13942
13973
  var _a, _b;
13943
13974
  return (_b = (_a = props.labels) == null ? void 0 : _a.pageSize) != null ? _b : "";
13944
13975
  });
13976
+ const sizes = computed(() => props.options.sizes);
13945
13977
  const handleSelect = (e2) => {
13946
13978
  const value = e2.target.value;
13947
13979
  paramsStore.appendParams({
@@ -13950,7 +13982,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13950
13982
  });
13951
13983
  };
13952
13984
  return (_ctx, _cache) => {
13953
- return openBlock(), createElementBlock("div", _hoisted_1$v, [
13985
+ return openBlock(), createElementBlock("div", _hoisted_1$u, [
13954
13986
  createBaseVNode("div", _hoisted_2$o, [
13955
13987
  createBaseVNode("label", _hoisted_3$i, toDisplayString(label.value), 1),
13956
13988
  createBaseVNode("select", {
@@ -13961,7 +13993,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13961
13993
  ref_key: "select",
13962
13994
  ref: select
13963
13995
  }, [
13964
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options.sizes, (option) => {
13996
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sizes.value, (option) => {
13965
13997
  return openBlock(), createElementBlock("option", {
13966
13998
  key: option,
13967
13999
  value: option
@@ -13973,7 +14005,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
13973
14005
  };
13974
14006
  }
13975
14007
  });
13976
- const _hoisted_1$u = {
14008
+ const _hoisted_1$t = {
13977
14009
  id: "lupa-search-results-sort",
13978
14010
  class: "lupa-search-results-sort"
13979
14011
  };
@@ -14030,7 +14062,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
14030
14062
  previousKey.value = selectedKey.value;
14031
14063
  };
14032
14064
  return (_ctx, _cache) => {
14033
- return openBlock(), createElementBlock("div", _hoisted_1$u, [
14065
+ return openBlock(), createElementBlock("div", _hoisted_1$t, [
14034
14066
  createBaseVNode("div", _hoisted_2$n, [
14035
14067
  createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.options.label), 1),
14036
14068
  withDirectives(createBaseVNode("select", {
@@ -14055,7 +14087,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
14055
14087
  };
14056
14088
  }
14057
14089
  });
14058
- const _hoisted_1$t = { class: "lupa-toolbar-left" };
14090
+ const _hoisted_1$s = { class: "lupa-toolbar-left" };
14059
14091
  const _hoisted_2$m = {
14060
14092
  key: 0,
14061
14093
  class: "lupa-toolbar-right-title"
@@ -14177,7 +14209,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
14177
14209
  id: "lupa-search-results-toolbar",
14178
14210
  class: normalizeClass({ "lupa-filter-no-results": !hasResults.value })
14179
14211
  }, [
14180
- createBaseVNode("div", _hoisted_1$t, [
14212
+ createBaseVNode("div", _hoisted_1$s, [
14181
14213
  toolbarLeftLabel.value ? (openBlock(), createElementBlock("div", _hoisted_2$m, toDisplayString(toolbarLeftLabel.value), 1)) : createCommentVNode("", true),
14182
14214
  showLayoutSelection.value ? (openBlock(), createBlock(_sfc_main$B, { key: 1 })) : (openBlock(), createElementBlock("div", _hoisted_3$g)),
14183
14215
  showItemSummary.value ? (openBlock(), createBlock(_sfc_main$T, {
@@ -14231,7 +14263,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
14231
14263
  };
14232
14264
  }
14233
14265
  });
14234
- const _hoisted_1$s = ["innerHTML"];
14266
+ const _hoisted_1$r = ["innerHTML"];
14235
14267
  const _hoisted_2$l = ["title"];
14236
14268
  const _hoisted_3$f = {
14237
14269
  key: 0,
@@ -14271,7 +14303,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14271
14303
  class: "lupa-search-results-product-title",
14272
14304
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14273
14305
  innerHTML: title.value
14274
- }, null, 12, _hoisted_1$s)) : (openBlock(), createElementBlock("div", {
14306
+ }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14275
14307
  key: 1,
14276
14308
  class: "lupa-search-results-product-title",
14277
14309
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
@@ -14288,7 +14320,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
14288
14320
  };
14289
14321
  }
14290
14322
  });
14291
- const _hoisted_1$r = ["innerHTML"];
14323
+ const _hoisted_1$q = ["innerHTML"];
14292
14324
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
14293
14325
  __name: "SearchResultsProductDescription",
14294
14326
  props: {
@@ -14313,7 +14345,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
14313
14345
  class: "lupa-search-results-product-description",
14314
14346
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
14315
14347
  innerHTML: description.value
14316
- }, null, 12, _hoisted_1$r)) : (openBlock(), createElementBlock("div", {
14348
+ }, null, 12, _hoisted_1$q)) : (openBlock(), createElementBlock("div", {
14317
14349
  key: 1,
14318
14350
  class: "lupa-search-results-product-description",
14319
14351
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`)
@@ -14321,7 +14353,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
14321
14353
  };
14322
14354
  }
14323
14355
  });
14324
- const _hoisted_1$q = { id: "lupa-search-results-rating" };
14356
+ const _hoisted_1$p = { id: "lupa-search-results-rating" };
14325
14357
  const _hoisted_2$k = { class: "lupa-ratings" };
14326
14358
  const _hoisted_3$e = { class: "lupa-ratings-base" };
14327
14359
  const _hoisted_4$9 = ["innerHTML"];
@@ -14360,7 +14392,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
14360
14392
  return generateLink(props.options.links.ratingDetails, props.item);
14361
14393
  });
14362
14394
  return (_ctx, _cache) => {
14363
- return openBlock(), createElementBlock("div", _hoisted_1$q, [
14395
+ return openBlock(), createElementBlock("div", _hoisted_1$p, [
14364
14396
  createBaseVNode("div", _hoisted_2$k, [
14365
14397
  createBaseVNode("div", _hoisted_3$e, [
14366
14398
  (openBlock(true), createElementBlock(Fragment, null, renderList(baseStars.value, (star, index) => {
@@ -14394,7 +14426,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
14394
14426
  };
14395
14427
  }
14396
14428
  });
14397
- const _hoisted_1$p = {
14429
+ const _hoisted_1$o = {
14398
14430
  class: "lupa-search-results-product-regular-price",
14399
14431
  "data-cy": "lupa-search-results-product-regular-price"
14400
14432
  };
@@ -14416,14 +14448,10 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
14416
14448
  );
14417
14449
  });
14418
14450
  return (_ctx, _cache) => {
14419
- return openBlock(), createElementBlock("div", _hoisted_1$p, toDisplayString(price.value), 1);
14451
+ return openBlock(), createElementBlock("div", _hoisted_1$o, toDisplayString(price.value), 1);
14420
14452
  };
14421
14453
  }
14422
14454
  });
14423
- const _hoisted_1$o = {
14424
- class: "lupa-search-results-product-price",
14425
- "data-cy": "lupa-search-results-product-price"
14426
- };
14427
14455
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
14428
14456
  __name: "SearchResultsProductPrice",
14429
14457
  props: {
@@ -14433,6 +14461,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
14433
14461
  },
14434
14462
  setup(__props) {
14435
14463
  const props = __props;
14464
+ const className = computed(() => {
14465
+ return props.options.className;
14466
+ });
14436
14467
  const price = computed(() => {
14437
14468
  var _a, _b;
14438
14469
  return formatPrice(
@@ -14442,9 +14473,12 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
14442
14473
  );
14443
14474
  });
14444
14475
  return (_ctx, _cache) => {
14445
- return openBlock(), createElementBlock("div", _hoisted_1$o, [
14476
+ return openBlock(), createElementBlock("div", {
14477
+ class: normalizeClass([className.value, "lupa-search-results-product-price"]),
14478
+ "data-cy": "lupa-search-results-product-price"
14479
+ }, [
14446
14480
  createBaseVNode("strong", null, toDisplayString(price.value), 1)
14447
- ]);
14481
+ ], 2);
14448
14482
  };
14449
14483
  }
14450
14484
  });
@@ -14639,7 +14673,7 @@ const __default__ = {
14639
14673
  SearchResultsProductSingleStarRating: _sfc_main$m
14640
14674
  }
14641
14675
  };
14642
- const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__), {
14676
+ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
14643
14677
  __name: "SearchResultsProductCardElement",
14644
14678
  props: {
14645
14679
  item: {},
@@ -14684,7 +14718,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
14684
14718
  return props.item;
14685
14719
  }
14686
14720
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
14687
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
14721
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
14688
14722
  });
14689
14723
  const displayElement = computed(() => {
14690
14724
  return props.element.display ? props.element.display(enhancedItem.value) : true;
@@ -14743,7 +14777,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
14743
14777
  return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
14744
14778
  });
14745
14779
  const badgesOptions = computed(() => {
14746
- return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
14780
+ return __spreadProps(__spreadValues({}, props.options.badges), { product: props.product });
14747
14781
  });
14748
14782
  const imageElements = computed(() => {
14749
14783
  var _a, _b;
@@ -15066,7 +15100,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
15066
15100
  };
15067
15101
  const handleQueryChange = () => {
15068
15102
  const context = getLupaTrackingContext();
15069
- const queryBody = __spreadProps2(__spreadValues2({}, context), {
15103
+ const queryBody = __spreadProps(__spreadValues({}, context), {
15070
15104
  limit: props.panel.totalCountLimit,
15071
15105
  searchText: query.value
15072
15106
  });
@@ -15547,7 +15581,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15547
15581
  window.addEventListener("resize", handleResize);
15548
15582
  yield redirectionStore.initiate(props.options.redirections, props.options.options);
15549
15583
  if (props.initialData) {
15550
- searchResultStore.add(__spreadValues2({}, props.initialData));
15584
+ searchResultStore.add(__spreadValues({}, props.initialData));
15551
15585
  }
15552
15586
  handleMounted();
15553
15587
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
@@ -15600,7 +15634,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15600
15634
  });
15601
15635
  const context = getLupaTrackingContext();
15602
15636
  const limit = publicQuery.limit || defaultSearchResultPageSize.value;
15603
- const query2 = __spreadProps2(__spreadValues2(__spreadValues2({}, publicQuery), context), { limit });
15637
+ const query2 = __spreadProps(__spreadValues(__spreadValues({}, publicQuery), context), { limit });
15604
15638
  const redirectionApplied = redirectionStore.redirectOnKeywordIfConfigured(
15605
15639
  publicQuery.searchText,
15606
15640
  optionStore.searchResultsRoutingBehavior
@@ -15615,7 +15649,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15615
15649
  var _a, _b;
15616
15650
  if (res.success) {
15617
15651
  handleResults({ queryKey: props.options.queryKey, results: res });
15618
- searchResultStore.add(__spreadValues2({}, res));
15652
+ searchResultStore.add(__spreadValues({}, res));
15619
15653
  } else if ((_b = (_a = props.options) == null ? void 0 : _a.options) == null ? void 0 : _b.onError) {
15620
15654
  props.options.options.onError(res);
15621
15655
  }
@@ -15684,7 +15718,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15684
15718
  if (typeof window !== "undefined") {
15685
15719
  optionStore.setSearchResultOptions({ options: props.options });
15686
15720
  if (props.initialData) {
15687
- searchResultStore.add(__spreadValues2({}, props.initialData));
15721
+ searchResultStore.add(__spreadValues({}, props.initialData));
15688
15722
  }
15689
15723
  handleMounted();
15690
15724
  return;
@@ -15695,7 +15729,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15695
15729
  (_b = props.options.ssr) == null ? void 0 : _b.baseUrl
15696
15730
  );
15697
15731
  optionStore.setSearchResultOptions({ options: props.options });
15698
- searchResultStore.add(__spreadValues2({}, initialData));
15732
+ searchResultStore.add(__spreadValues({}, initialData));
15699
15733
  paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
15700
15734
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
15701
15735
  handleResults({ queryKey: props.options.queryKey, results: initialData });
@@ -15833,8 +15867,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
15833
15867
  const props = __props;
15834
15868
  const searchResults2 = ref(null);
15835
15869
  const componentOptions = computed(() => {
15836
- return __spreadProps2(__spreadValues2({}, props.options), {
15837
- filters: __spreadProps2(__spreadValues2({}, props.options.filters), {
15870
+ return __spreadProps(__spreadValues({}, props.options), {
15871
+ filters: __spreadProps(__spreadValues({}, props.options.filters), {
15838
15872
  categories: props.options.categories
15839
15873
  })
15840
15874
  });
@@ -22361,11 +22395,11 @@ const Env = {
22361
22395
  production: "https://api.lupasearch.com/v1/",
22362
22396
  staging: "https://api.staging.lupasearch.com/v1/"
22363
22397
  };
22364
- const defaultConfig = {
22398
+ const DEFAULT_REQUEST_CONFIG = {
22365
22399
  method: "POST",
22366
22400
  headers: { "Content-Type": "application/json" }
22367
22401
  };
22368
- const headers = defaultConfig.headers;
22402
+ const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
22369
22403
  const getApiUrl = (environment, customBaseUrl) => {
22370
22404
  if (customBaseUrl) {
22371
22405
  return customBaseUrl;
@@ -22377,13 +22411,13 @@ const suggestSearchChatPhrases = (options, request, chatSettings) => __async(voi
22377
22411
  const { environment, customBaseUrl } = options;
22378
22412
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22379
22413
  try {
22380
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22414
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22381
22415
  body: JSON.stringify(request),
22382
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22416
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22383
22417
  }));
22384
22418
  if (res.status < 400) {
22385
22419
  const data = yield res.json();
22386
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22420
+ return __spreadProps(__spreadValues({}, data), { success: true });
22387
22421
  }
22388
22422
  const errors = yield res.json();
22389
22423
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22400,14 +22434,14 @@ const suggestPhraseAlternatives = (options, request, chatSettings) => __async(vo
22400
22434
  try {
22401
22435
  const res = yield fetch(
22402
22436
  `${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives${model}`,
22403
- __spreadProps2(__spreadValues2({}, defaultConfig), {
22437
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22404
22438
  body: JSON.stringify(request),
22405
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22439
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22406
22440
  })
22407
22441
  );
22408
22442
  if (res.status < 400) {
22409
22443
  const data = yield res.json();
22410
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22444
+ return __spreadProps(__spreadValues({}, data), { success: true });
22411
22445
  }
22412
22446
  const errors = yield res.json();
22413
22447
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22422,13 +22456,13 @@ const suggestBestProductMatches = (options, request, chatSettings) => __async(vo
22422
22456
  const { environment, customBaseUrl } = options;
22423
22457
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22424
22458
  try {
22425
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22459
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22426
22460
  body: JSON.stringify(request),
22427
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22461
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22428
22462
  }));
22429
22463
  if (res.status < 400) {
22430
22464
  const data = yield res.json();
22431
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22465
+ return __spreadProps(__spreadValues({}, data), { success: true });
22432
22466
  }
22433
22467
  const errors = yield res.json();
22434
22468
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22462,9 +22496,9 @@ const prepareChatHistory = (chatLog) => {
22462
22496
  const getTextResponseChunkStream = (options, request, onChunkReceived, chatSettings) => {
22463
22497
  var _a;
22464
22498
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22465
- fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22499
+ fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22466
22500
  body: JSON.stringify(request),
22467
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22501
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22468
22502
  })).then((response) => {
22469
22503
  const reader = response.body.getReader();
22470
22504
  return reader.read().then(function processStream({ done, value }) {
@@ -22856,7 +22890,7 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
22856
22890
  }
22857
22891
  const validPhrases = phrases.filter((p2) => (p2 == null ? void 0 : p2.trim().length) > 0);
22858
22892
  chatContent.value = chatContent.value.map(
22859
- (c2) => c2.key === key ? __spreadProps2(__spreadValues2({}, c2), {
22893
+ (c2) => c2.key === key ? __spreadProps(__spreadValues({}, c2), {
22860
22894
  allPhrases: [...validPhrases],
22861
22895
  suggestedPhrases: phrases
22862
22896
  }) : c2
@@ -22893,6 +22927,29 @@ const _sfc_main$1o = /* @__PURE__ */ defineComponent({
22893
22927
  };
22894
22928
  }
22895
22929
  });
22930
+ const fetchPluginConfiguration = (options, configurationKey) => __async(void 0, null, function* () {
22931
+ var _a, _b, _c;
22932
+ const { environment, customBaseUrl } = options;
22933
+ try {
22934
+ const res = yield fetch(
22935
+ `${getApiUrl(environment, customBaseUrl)}plugin/configurations/${configurationKey}`,
22936
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22937
+ method: "GET",
22938
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22939
+ })
22940
+ );
22941
+ if (res.status < 400) {
22942
+ const data = yield res.json();
22943
+ return __spreadValues({}, data);
22944
+ }
22945
+ const errors = yield res.json();
22946
+ (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
22947
+ return null;
22948
+ } catch (e2) {
22949
+ (_c = options == null ? void 0 : options.onError) == null ? void 0 : _c.call(options, e2);
22950
+ return null;
22951
+ }
22952
+ });
22896
22953
  let piniaInstance = null;
22897
22954
  const initPinia = () => {
22898
22955
  if (piniaInstance) {
@@ -22908,105 +22965,450 @@ const setupTracking = (options) => {
22908
22965
  initTracking(options);
22909
22966
  store.setTrackingOptions({ options });
22910
22967
  };
22911
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
22912
- var lodash = { exports: {} };
22913
- /**
22914
- * @license
22915
- * Lodash <https://lodash.com/>
22916
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
22917
- * Released under MIT license <https://lodash.com/license>
22918
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
22919
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
22920
- */
22921
- lodash.exports;
22922
- (function(module2, exports2) {
22923
- (function() {
22924
- var undefined$1;
22925
- var VERSION = "4.17.21";
22926
- var LARGE_ARRAY_SIZE = 200;
22927
- 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`";
22928
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
22929
- var MAX_MEMOIZE_SIZE = 500;
22930
- var PLACEHOLDER = "__lodash_placeholder__";
22931
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
22932
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
22933
- 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;
22934
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
22935
- var HOT_COUNT = 800, HOT_SPAN = 16;
22936
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
22937
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
22938
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
22939
- var wrapFlags = [
22940
- ["ary", WRAP_ARY_FLAG],
22941
- ["bind", WRAP_BIND_FLAG],
22942
- ["bindKey", WRAP_BIND_KEY_FLAG],
22943
- ["curry", WRAP_CURRY_FLAG],
22944
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
22945
- ["flip", WRAP_FLIP_FLAG],
22946
- ["partial", WRAP_PARTIAL_FLAG],
22947
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
22948
- ["rearg", WRAP_REARG_FLAG]
22949
- ];
22950
- 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]";
22951
- 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]";
22952
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
22953
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
22954
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
22955
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
22956
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
22957
- var reTrimStart = /^\s+/;
22958
- var reWhitespace = /\s/;
22959
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
22960
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
22961
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
22962
- var reEscapeChar = /\\(\\)?/g;
22963
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
22964
- var reFlags = /\w*$/;
22965
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
22966
- var reIsBinary = /^0b[01]+$/i;
22967
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
22968
- var reIsOctal = /^0o[0-7]+$/i;
22969
- var reIsUint = /^(?:0|[1-9]\d*)$/;
22970
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
22971
- var reNoMatch = /($^)/;
22972
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
22973
- 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;
22974
- 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";
22975
- 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("|") + ")";
22976
- var reApos = RegExp(rsApos, "g");
22977
- var reComboMark = RegExp(rsCombo, "g");
22978
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
22979
- var reUnicodeWord = RegExp([
22980
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
22981
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
22982
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
22983
- rsUpper + "+" + rsOptContrUpper,
22984
- rsOrdUpper,
22985
- rsOrdLower,
22986
- rsDigits,
22987
- rsEmoji
22988
- ].join("|"), "g");
22989
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
22990
- 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 ]/;
22991
- var contextProps = [
22992
- "Array",
22993
- "Buffer",
22994
- "DataView",
22995
- "Date",
22996
- "Error",
22997
- "Float32Array",
22998
- "Float64Array",
22999
- "Function",
23000
- "Int8Array",
23001
- "Int16Array",
23002
- "Int32Array",
23003
- "Map",
23004
- "Math",
23005
- "Object",
23006
- "Promise",
23007
- "RegExp",
23008
- "Set",
23009
- "String",
22968
+ const displayDiscountedPriceSection = (doc2, options) => {
22969
+ var _a, _b;
22970
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22971
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22972
+ return discountPrice && regularPrice && discountPrice < regularPrice;
22973
+ };
22974
+ const displayRegularPriceSection = (doc2, options) => {
22975
+ var _a, _b;
22976
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22977
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22978
+ const anyPrice = discountPrice || regularPrice;
22979
+ return anyPrice && !displayDiscountedPriceSection(doc2, options);
22980
+ };
22981
+ const escapeHtml = (source) => {
22982
+ if (!source) {
22983
+ return source;
22984
+ }
22985
+ return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
22986
+ };
22987
+ const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
22988
+ if (!value) {
22989
+ return 0;
22990
+ }
22991
+ try {
22992
+ return +parseFloat(`${value}`).toFixed(maxDecimal);
22993
+ } catch (e2) {
22994
+ return `${value}`;
22995
+ }
22996
+ };
22997
+ const capitalize = (value) => {
22998
+ if (!value) {
22999
+ return "";
23000
+ }
23001
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1);
23002
+ };
23003
+ const getAlphanumeric = (value) => {
23004
+ if (!value) {
23005
+ return "";
23006
+ }
23007
+ return value.replace(/[\W_]/g, " ");
23008
+ };
23009
+ const getAdditionalElements = (fields) => {
23010
+ return fields.map((key) => ({
23011
+ type: "custom",
23012
+ key,
23013
+ label: capitalize(getAlphanumeric(key)),
23014
+ className: "lupa-custom",
23015
+ display: (doc2) => Boolean(doc2[key])
23016
+ }));
23017
+ };
23018
+ const addFieldIfKeyExists = (field, key, config) => {
23019
+ if (key) {
23020
+ return config;
23021
+ }
23022
+ return { key: field, type: "customHtml", display: () => false };
23023
+ };
23024
+ const getSearchBoxComponent = ({
23025
+ searchBoxOptions,
23026
+ labels,
23027
+ panelOptions,
23028
+ redirections,
23029
+ placeholderImage
23030
+ }) => {
23031
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
23032
+ const panels = [
23033
+ ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
23034
+ {
23035
+ type: SearchBoxPanelType.SUGGESTION,
23036
+ queryKey: searchBoxOptions.suggestionQueryKey,
23037
+ highlight: true,
23038
+ limit: 8,
23039
+ labels: {
23040
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
23041
+ }
23042
+ }
23043
+ ] : [],
23044
+ ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
23045
+ {
23046
+ type: SearchBoxPanelType.DOCUMENT,
23047
+ queryKey: searchBoxOptions.documentQueryKey,
23048
+ limit: 5,
23049
+ elements: [
23050
+ {
23051
+ type: "image",
23052
+ placeholder: placeholderImage,
23053
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
23054
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
23055
+ },
23056
+ {
23057
+ type: "title",
23058
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
23059
+ maxLines: 2
23060
+ },
23061
+ {
23062
+ type: "regularPrice",
23063
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
23064
+ display: (doc2) => {
23065
+ var _a2, _b2, _c2, _d2;
23066
+ 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]);
23067
+ }
23068
+ },
23069
+ {
23070
+ type: "price",
23071
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
23072
+ }
23073
+ ]
23074
+ }
23075
+ ] : []
23076
+ ];
23077
+ return {
23078
+ inputSelector: searchBoxOptions.inputSelector,
23079
+ options: {
23080
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
23081
+ customUrl: searchBoxOptions.customUrl,
23082
+ customBaseUrl: searchBoxOptions.customBaseUrl,
23083
+ customPayload: searchBoxOptions.customPayload,
23084
+ customHeaders: searchBoxOptions.customHeaders
23085
+ },
23086
+ showTotalCount: true,
23087
+ expandOnSinglePanel: true,
23088
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
23089
+ debounce: 250,
23090
+ labels: labels == null ? void 0 : labels.searchBox,
23091
+ links: {
23092
+ searchResults: ""
23093
+ },
23094
+ panels,
23095
+ redirections,
23096
+ history: {
23097
+ labels: {
23098
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
23099
+ }
23100
+ }
23101
+ };
23102
+ };
23103
+ const getSearchResultsComponent = ({
23104
+ searchResultOptions,
23105
+ labels,
23106
+ redirections,
23107
+ placeholderImage,
23108
+ configuratorOverrides,
23109
+ callbacks,
23110
+ additionalFields
23111
+ }) => {
23112
+ 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;
23113
+ const filters = searchResultOptions.showFacets ? {
23114
+ currentFilters: {
23115
+ visibility: {
23116
+ mobileSidebar: true,
23117
+ mobileToolbar: true
23118
+ },
23119
+ labels: {
23120
+ title: "",
23121
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
23122
+ }
23123
+ },
23124
+ facets: {
23125
+ labels: {
23126
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
23127
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
23128
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
23129
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
23130
+ },
23131
+ filterable: {
23132
+ minValues: 5
23133
+ },
23134
+ hierarchy: {
23135
+ maxInitialLevel: 2,
23136
+ topLevelValueCountLimit: 5,
23137
+ filterable: true
23138
+ },
23139
+ stats: {
23140
+ slider: true,
23141
+ inputs: true,
23142
+ labels: {
23143
+ from: "",
23144
+ to: ""
23145
+ }
23146
+ },
23147
+ facetValueCountLimit: 8,
23148
+ showDocumentCount: true,
23149
+ style: {
23150
+ type: "sidebar"
23151
+ }
23152
+ }
23153
+ } : {};
23154
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
23155
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
23156
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
23157
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
23158
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
23159
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
23160
+ };
23161
+ const badges = {
23162
+ badges: {
23163
+ anchor: "tr",
23164
+ elements: [
23165
+ ...searchResultOptions.showRelevance ? [
23166
+ {
23167
+ key: "",
23168
+ type: "customHtml",
23169
+ className: "relevance",
23170
+ html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
23171
+ display: (doc2) => Boolean(doc2._relevance !== void 0)
23172
+ }
23173
+ ] : [],
23174
+ ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
23175
+ {
23176
+ key: "",
23177
+ type: "customHtml",
23178
+ className: "boosted-marker",
23179
+ html: () => {
23180
+ var _a2;
23181
+ return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
23182
+ },
23183
+ display: (doc2) => doc2._boosted === true
23184
+ }
23185
+ ] : []
23186
+ ]
23187
+ }
23188
+ };
23189
+ return __spreadValues2(__spreadProps2(__spreadValues2({
23190
+ options: {
23191
+ environment: (_m = searchResultOptions.environment) != null ? _m : "production",
23192
+ customUrl: searchResultOptions.customUrl,
23193
+ customBaseUrl: searchResultOptions.customBaseUrl,
23194
+ customPayload: searchResultOptions.customPayload,
23195
+ customHeaders: searchResultOptions.customHeaders,
23196
+ onError: searchResultOptions.errorHandler
23197
+ },
23198
+ queryKey: searchResultOptions.queryKey,
23199
+ containerSelector: searchResultOptions.containerSelector,
23200
+ searchTitlePosition: "search-results-top",
23201
+ titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
23202
+ labels: labels == null ? void 0 : labels.searchResults,
23203
+ grid: {
23204
+ columns
23205
+ },
23206
+ pagination: {
23207
+ sizeSelection: {
23208
+ position: {
23209
+ top: true,
23210
+ bottom: false
23211
+ },
23212
+ sizes: [12, 24, 36, 48]
23213
+ },
23214
+ pageSelection: {
23215
+ position: {
23216
+ top: false,
23217
+ bottom: true
23218
+ },
23219
+ displayMobile: 3,
23220
+ display: 5
23221
+ }
23222
+ },
23223
+ filters,
23224
+ toolbar: {
23225
+ layoutSelector: false,
23226
+ itemSummary: true,
23227
+ clearFilters: false
23228
+ },
23229
+ isInStock: () => {
23230
+ return true;
23231
+ }
23232
+ }, badges), {
23233
+ links: {
23234
+ details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
23235
+ },
23236
+ callbacks,
23237
+ routingBehavior: callbacks ? "event" : "direct-link",
23238
+ idKey: "id",
23239
+ elements: [
23240
+ {
23241
+ type: "image",
23242
+ placeholder: placeholderImage,
23243
+ key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
23244
+ baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
23245
+ display: () => {
23246
+ var _a2;
23247
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
23248
+ }
23249
+ },
23250
+ addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
23251
+ type: "custom",
23252
+ className: "lupa-custom-emphasis",
23253
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
23254
+ display: () => true
23255
+ }),
23256
+ {
23257
+ type: "title",
23258
+ key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
23259
+ maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
23260
+ display: (doc2) => {
23261
+ var _a2, _b2;
23262
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
23263
+ }
23264
+ },
23265
+ ...getAdditionalElements(additionalFields),
23266
+ addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
23267
+ key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
23268
+ type: "customHtml",
23269
+ className: "lupa-price lupa-price-discounted",
23270
+ display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
23271
+ html: (doc2) => {
23272
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23273
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23274
+ const discountPrice = (_d2 = parseFloat(
23275
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
23276
+ )) == null ? void 0 : _d2.toFixed(2);
23277
+ const regularPrice = (_g2 = parseFloat(
23278
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
23279
+ )) == null ? void 0 : _g2.toFixed(2);
23280
+ const discount = `<span class="lupa-discount">${escapeHtml(
23281
+ discountPrice
23282
+ )} ${currency}</span>`;
23283
+ const regular = `<span class="lupa-regular">${escapeHtml(
23284
+ regularPrice
23285
+ )} ${currency}</span>`;
23286
+ return discount + regular;
23287
+ }
23288
+ }),
23289
+ addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
23290
+ key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
23291
+ type: "customHtml",
23292
+ className: "lupa-price lupa-price-single",
23293
+ display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
23294
+ html: (doc2) => {
23295
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23296
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23297
+ const price = (_g2 = parseFloat(
23298
+ (_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 : ""]
23299
+ )) == null ? void 0 : _g2.toFixed(2);
23300
+ return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
23301
+ }
23302
+ })
23303
+ ],
23304
+ breadcrumbs: [],
23305
+ sort: [],
23306
+ redirections
23307
+ }), configuratorOverrides);
23308
+ };
23309
+ const SearchContainerConfigurationService = {
23310
+ getSearchBoxComponent,
23311
+ getSearchResultsComponent
23312
+ };
23313
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
23314
+ var lodash = { exports: {} };
23315
+ /**
23316
+ * @license
23317
+ * Lodash <https://lodash.com/>
23318
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
23319
+ * Released under MIT license <https://lodash.com/license>
23320
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23321
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
23322
+ */
23323
+ lodash.exports;
23324
+ (function(module2, exports2) {
23325
+ (function() {
23326
+ var undefined$1;
23327
+ var VERSION = "4.17.21";
23328
+ var LARGE_ARRAY_SIZE = 200;
23329
+ 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`";
23330
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
23331
+ var MAX_MEMOIZE_SIZE = 500;
23332
+ var PLACEHOLDER = "__lodash_placeholder__";
23333
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
23334
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
23335
+ 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;
23336
+ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
23337
+ var HOT_COUNT = 800, HOT_SPAN = 16;
23338
+ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
23339
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
23340
+ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
23341
+ var wrapFlags = [
23342
+ ["ary", WRAP_ARY_FLAG],
23343
+ ["bind", WRAP_BIND_FLAG],
23344
+ ["bindKey", WRAP_BIND_KEY_FLAG],
23345
+ ["curry", WRAP_CURRY_FLAG],
23346
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG],
23347
+ ["flip", WRAP_FLIP_FLAG],
23348
+ ["partial", WRAP_PARTIAL_FLAG],
23349
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
23350
+ ["rearg", WRAP_REARG_FLAG]
23351
+ ];
23352
+ 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]";
23353
+ 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]";
23354
+ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
23355
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
23356
+ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
23357
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
23358
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
23359
+ var reTrimStart = /^\s+/;
23360
+ var reWhitespace = /\s/;
23361
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
23362
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
23363
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
23364
+ var reEscapeChar = /\\(\\)?/g;
23365
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
23366
+ var reFlags = /\w*$/;
23367
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
23368
+ var reIsBinary = /^0b[01]+$/i;
23369
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23370
+ var reIsOctal = /^0o[0-7]+$/i;
23371
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
23372
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
23373
+ var reNoMatch = /($^)/;
23374
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
23375
+ 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;
23376
+ 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";
23377
+ 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("|") + ")";
23378
+ var reApos = RegExp(rsApos, "g");
23379
+ var reComboMark = RegExp(rsCombo, "g");
23380
+ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
23381
+ var reUnicodeWord = RegExp([
23382
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
23383
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
23384
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
23385
+ rsUpper + "+" + rsOptContrUpper,
23386
+ rsOrdUpper,
23387
+ rsOrdLower,
23388
+ rsDigits,
23389
+ rsEmoji
23390
+ ].join("|"), "g");
23391
+ var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
23392
+ 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 ]/;
23393
+ var contextProps = [
23394
+ "Array",
23395
+ "Buffer",
23396
+ "DataView",
23397
+ "Date",
23398
+ "Error",
23399
+ "Float32Array",
23400
+ "Float64Array",
23401
+ "Function",
23402
+ "Int8Array",
23403
+ "Int16Array",
23404
+ "Int32Array",
23405
+ "Map",
23406
+ "Math",
23407
+ "Object",
23408
+ "Promise",
23409
+ "RegExp",
23410
+ "Set",
23411
+ "String",
23010
23412
  "Symbol",
23011
23413
  "TypeError",
23012
23414
  "Uint8Array",
@@ -28386,546 +28788,150 @@ lodash.exports;
28386
28788
  (freeModule.exports = _)._ = _;
28387
28789
  freeExports._ = _;
28388
28790
  } else {
28389
- root._ = _;
28390
- }
28391
- }).call(commonjsGlobal);
28392
- })(lodash, lodash.exports);
28393
- var lodashExports = lodash.exports;
28394
- const DEFAULT_SEARCH_BOX_OPTIONS = {
28395
- inputSelector: "#searchBox",
28396
- options: {
28397
- environment: "production"
28398
- },
28399
- showTotalCount: false,
28400
- minInputLength: 1,
28401
- inputAttributes: {
28402
- name: "q"
28403
- },
28404
- debounce: 0,
28405
- labels: {
28406
- placeholder: "Search for products...",
28407
- noResults: "There are no results found.",
28408
- moreResults: "Show more results",
28409
- currency: "€",
28410
- defaultFacetLabel: "Category:"
28411
- },
28412
- links: {
28413
- searchResults: "/search"
28414
- },
28415
- panels: [
28416
- {
28417
- type: "suggestion",
28418
- queryKey: "",
28419
- highlight: true,
28420
- limit: 5
28421
- },
28422
- {
28423
- type: "document",
28424
- queryKey: "",
28425
- limit: 5,
28426
- searchBySuggestion: false,
28427
- links: {
28428
- details: "{url}"
28429
- },
28430
- titleKey: "name",
28431
- elements: []
28432
- }
28433
- ],
28434
- history: {
28435
- labels: {
28436
- clear: "Clear History"
28437
- }
28438
- }
28439
- };
28440
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28441
- __name: "SearchBoxEntry",
28442
- props: {
28443
- searchBoxOptions: {}
28444
- },
28445
- setup(__props, { expose: __expose }) {
28446
- const props = __props;
28447
- const searchBox2 = ref(null);
28448
- const fullSearchBoxOptions = computed(() => {
28449
- const options = lodashExports.cloneDeep(props.searchBoxOptions);
28450
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28451
- });
28452
- const fetch2 = () => {
28453
- var _a;
28454
- (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28455
- };
28456
- __expose({ fetch: fetch2 });
28457
- return (_ctx, _cache) => {
28458
- return openBlock(), createBlock(unref(_sfc_main$V), {
28459
- options: fullSearchBoxOptions.value,
28460
- ref_key: "searchBox",
28461
- ref: searchBox2
28462
- }, null, 8, ["options"]);
28463
- };
28464
- }
28465
- });
28466
- const DEFAULT_OPTIONS_RESULTS = {
28791
+ root._ = _;
28792
+ }
28793
+ }).call(commonjsGlobal);
28794
+ })(lodash, lodash.exports);
28795
+ var lodashExports = lodash.exports;
28796
+ const DEFAULT_SEARCH_BOX_OPTIONS = {
28797
+ inputSelector: "#searchBox",
28467
28798
  options: {
28468
28799
  environment: "production"
28469
28800
  },
28470
- queryKey: "",
28471
- containerSelector: "#searchResultsContainer",
28472
- searchTitlePosition: "page-top",
28801
+ showTotalCount: false,
28802
+ minInputLength: 1,
28803
+ inputAttributes: {
28804
+ name: "q"
28805
+ },
28806
+ debounce: 0,
28473
28807
  labels: {
28474
- pageSize: "Page size:",
28475
- sortBy: "Sort by:",
28476
- itemCount: "Items {1} of {2}",
28477
- filteredItemCount: "",
28808
+ placeholder: "Search for products...",
28809
+ noResults: "There are no results found.",
28810
+ moreResults: "Show more results",
28478
28811
  currency: "€",
28479
- showMore: "Show more",
28480
- searchResults: "Search Query: ",
28481
- emptyResults: "There are no results for the query:",
28482
- mobileFilterButton: "Filter",
28483
- htmlTitleTemplate: "Search Query: '{1}'",
28484
- noResultsSuggestion: "No results found for this query: {1}",
28485
- didYouMean: "Did you mean to search: {1}",
28486
- similarQuery: "Search results for phrase {1}",
28487
- similarQueries: "Similar queries:"
28488
- },
28489
- grid: {
28490
- columns: {
28491
- xl: 4,
28492
- l: 3,
28493
- md: 2,
28494
- sm: 2,
28495
- xs: 1
28496
- }
28812
+ defaultFacetLabel: "Category:"
28497
28813
  },
28498
- pagination: {
28499
- sizeSelection: {
28500
- position: {
28501
- top: false,
28502
- bottom: true
28503
- },
28504
- sizes: [12, 24, 36]
28505
- },
28506
- pageSelection: {
28507
- position: {
28508
- top: false,
28509
- bottom: true
28510
- },
28511
- display: 5,
28512
- displayMobile: 3
28513
- }
28814
+ links: {
28815
+ searchResults: "/search"
28514
28816
  },
28515
- sort: [],
28516
- filters: {
28517
- currentFilters: {
28518
- visibility: {
28519
- mobileSidebar: true,
28520
- mobileToolbar: true
28521
- },
28522
- labels: {
28523
- title: "Current filters:",
28524
- clearAll: "Clear all"
28525
- }
28817
+ panels: [
28818
+ {
28819
+ type: "suggestion",
28820
+ queryKey: "",
28821
+ highlight: true,
28822
+ limit: 5
28526
28823
  },
28527
- facets: {
28528
- labels: {
28529
- title: "Filters:",
28530
- showAll: "Show more",
28531
- facetFilter: "Filter...",
28532
- facetClear: "Clear"
28533
- },
28534
- filterable: {
28535
- minValues: 5
28536
- },
28537
- hierarchy: {
28538
- maxInitialLevel: 2,
28539
- topLevelValueCountLimit: 5,
28540
- filterable: true
28824
+ {
28825
+ type: "document",
28826
+ queryKey: "",
28827
+ limit: 5,
28828
+ searchBySuggestion: false,
28829
+ links: {
28830
+ details: "{url}"
28541
28831
  },
28542
- facetValueCountLimit: 20,
28543
- showDocumentCount: true,
28544
- style: {
28545
- type: "sidebar"
28546
- }
28547
- }
28548
- },
28549
- toolbar: {
28550
- layoutSelector: true,
28551
- itemSummary: true,
28552
- clearFilters: false
28553
- },
28554
- isInStock: () => {
28555
- return true;
28556
- },
28557
- badges: {
28558
- anchor: "tr",
28559
- elements: []
28560
- },
28561
- links: {
28562
- details: "/{id}"
28563
- },
28564
- elements: [],
28565
- breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28566
- };
28567
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28568
- __name: "SearchResultsEntry",
28569
- props: {
28570
- searchResultsOptions: {}
28571
- },
28572
- setup(__props, { expose: __expose }) {
28573
- const props = __props;
28574
- const searchResults2 = ref(null);
28575
- const fullSearchResultsOptions = computed(() => {
28576
- const options = lodashExports.cloneDeep(props.searchResultsOptions);
28577
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28578
- });
28579
- const fetch2 = () => {
28580
- var _a;
28581
- (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28582
- };
28583
- __expose({ fetch: fetch2 });
28584
- return (_ctx, _cache) => {
28585
- return openBlock(), createBlock(unref(_sfc_main$c), {
28586
- options: fullSearchResultsOptions.value,
28587
- ref_key: "searchResults",
28588
- ref: searchResults2
28589
- }, null, 8, ["options"]);
28590
- };
28591
- }
28592
- });
28593
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28594
- __name: "ProductListEntry",
28595
- props: {
28596
- productListOptions: {}
28597
- },
28598
- setup(__props, { expose: __expose }) {
28599
- const props = __props;
28600
- const productList2 = ref(null);
28601
- const fullProductListOptions = computed(() => {
28602
- return lodashExports.cloneDeep(props.productListOptions);
28603
- });
28604
- const fetch2 = () => {
28605
- var _a;
28606
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28607
- };
28608
- __expose({ fetch: fetch2 });
28609
- return (_ctx, _cache) => {
28610
- return openBlock(), createBlock(unref(_sfc_main$a), {
28611
- options: fullProductListOptions.value,
28612
- ref_key: "productList",
28613
- ref: productList2
28614
- }, null, 8, ["options"]);
28615
- };
28616
- }
28617
- });
28618
- const QUERY_PARAMS = {
28619
- QUERY: "q",
28620
- PAGE: "p",
28621
- LIMIT: "l",
28622
- SORT: "s"
28623
- };
28624
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28625
- __name: "SearchContainerEntry",
28626
- props: {
28627
- searchContainerOptions: {}
28628
- },
28629
- setup(__props, { expose: __expose }) {
28630
- const props = __props;
28631
- const isOpen = ref(false);
28632
- const triggerElement = ref(null);
28633
- const productList2 = ref(null);
28634
- const containerOptions = computed(() => {
28635
- return lodashExports.cloneDeep(props.searchContainerOptions);
28636
- });
28637
- const focus = () => {
28638
- const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
28639
- el == null ? void 0 : el.focus();
28640
- };
28641
- const close = () => {
28642
- isOpen.value = false;
28643
- };
28644
- const openSearchContainer = () => {
28645
- isOpen.value = true;
28646
- };
28647
- const checkCloseOnEscape = (e2) => {
28648
- var _a;
28649
- if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
28650
- return;
28651
- }
28652
- isOpen.value = false;
28653
- };
28654
- const checkExistingQuery = () => {
28655
- const url = new URL(window.location.href);
28656
- const param = url.searchParams.get(QUERY_PARAMS.QUERY);
28657
- if (!param) {
28658
- return;
28659
- }
28660
- isOpen.value = true;
28661
- };
28662
- const mountOpenListeners = () => {
28663
- var _a, _b;
28664
- triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
28665
- (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
28666
- window.addEventListener("keydown", checkCloseOnEscape);
28667
- };
28668
- onMounted(() => {
28669
- var _a, _b;
28670
- mountOpenListeners();
28671
- checkExistingQuery();
28672
- isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
28673
- });
28674
- onBeforeUnmount(() => {
28675
- var _a;
28676
- (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
28677
- window.removeEventListener("keydown", checkCloseOnEscape);
28678
- });
28679
- const fetch2 = () => {
28680
- var _a;
28681
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28682
- };
28683
- const reloadOptions = () => {
28684
- var _a;
28685
- (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
28686
- };
28687
- __expose({ fetch: fetch2, reloadOptions });
28688
- return (_ctx, _cache) => {
28689
- return openBlock(), createElementBlock("div", null, [
28690
- containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
28691
- key: 0,
28692
- options: containerOptions.value,
28693
- ref_key: "productList",
28694
- ref: productList2,
28695
- "onHook:mounted": focus,
28696
- onClose: close
28697
- }, null, 8, ["options"])) : createCommentVNode("", true)
28698
- ]);
28699
- };
28832
+ titleKey: "name",
28833
+ elements: []
28834
+ }
28835
+ ],
28836
+ history: {
28837
+ labels: {
28838
+ clear: "Clear History"
28839
+ }
28700
28840
  }
28701
- });
28702
- const _sfc_main = /* @__PURE__ */ defineComponent({
28703
- __name: "RecommendationsEntry",
28841
+ };
28842
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28843
+ __name: "SearchBoxEntry",
28704
28844
  props: {
28705
- recommendationOptions: {}
28845
+ searchBoxOptions: {}
28706
28846
  },
28707
28847
  setup(__props, { expose: __expose }) {
28708
- const productRecommendations = ref(null);
28848
+ const props = __props;
28849
+ const searchBox2 = ref(null);
28850
+ const fullSearchBoxOptions = computed(() => {
28851
+ const options = lodashExports.cloneDeep(props.searchBoxOptions);
28852
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28853
+ });
28709
28854
  const fetch2 = () => {
28710
- productRecommendations == null ? void 0 : productRecommendations.fetch();
28855
+ var _a;
28856
+ (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28711
28857
  };
28712
28858
  __expose({ fetch: fetch2 });
28713
28859
  return (_ctx, _cache) => {
28714
- return openBlock(), createBlock(unref(_sfc_main$8), {
28715
- options: _ctx.recommendationOptions,
28716
- ref_key: "productRecommendations",
28717
- ref: productRecommendations
28860
+ return openBlock(), createBlock(unref(_sfc_main$V), {
28861
+ options: fullSearchBoxOptions.value,
28862
+ ref_key: "searchBox",
28863
+ ref: searchBox2
28718
28864
  }, null, 8, ["options"]);
28719
28865
  };
28720
28866
  }
28721
28867
  });
28722
- const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
28723
- const createShadowDom = (shadowId, managerId) => {
28724
- let host = document.getElementById(shadowId);
28725
- if (host) {
28726
- host.remove();
28727
- }
28728
- host = document.createElement("div");
28729
- const manager = document.createElement("div");
28730
- host.setAttribute("id", shadowId);
28731
- manager == null ? void 0 : manager.setAttribute("id", managerId);
28732
- return { host, manager };
28733
- };
28734
- const attatchShadowDom = ({
28735
- host,
28736
- manager,
28737
- styleUrl,
28738
- options
28739
- }) => {
28740
- var _a;
28741
- if (host.shadowRoot) {
28742
- return;
28743
- }
28744
- const link = document.createElement("link");
28745
- link.type = "text/css";
28746
- link.rel = "stylesheet";
28747
- link.href = styleUrl;
28748
- const fontLink = document.createElement("link");
28749
- fontLink.type = "text/css";
28750
- fontLink.rel = "stylesheet";
28751
- fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
28752
- document.head.appendChild(fontLink);
28753
- const materialIconLink = document.createElement("link");
28754
- materialIconLink.type = "text/css";
28755
- materialIconLink.rel = "stylesheet";
28756
- materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
28757
- document.head.appendChild(materialIconLink);
28758
- const shadow = host.attachShadow({ mode: "open" });
28759
- shadow.appendChild(manager);
28760
- shadow.appendChild(link);
28761
- if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
28762
- const style = document.createElement("style");
28763
- style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
28764
- shadow.appendChild(style);
28765
- }
28766
- };
28767
- const displayDiscountedPriceSection = (doc2, options) => {
28768
- var _a, _b;
28769
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28770
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28771
- return discountPrice && regularPrice && discountPrice < regularPrice;
28772
- };
28773
- const displayRegularPriceSection = (doc2, options) => {
28774
- var _a, _b;
28775
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28776
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28777
- const anyPrice = discountPrice || regularPrice;
28778
- return anyPrice && !displayDiscountedPriceSection(doc2, options);
28779
- };
28780
- const escapeHtml = (source) => {
28781
- if (!source) {
28782
- return source;
28783
- }
28784
- return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
28785
- };
28786
- const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
28787
- if (!value) {
28788
- return 0;
28789
- }
28790
- try {
28791
- return +parseFloat(`${value}`).toFixed(maxDecimal);
28792
- } catch (e2) {
28793
- return `${value}`;
28794
- }
28795
- };
28796
- const capitalize = (value) => {
28797
- if (!value) {
28798
- return "";
28799
- }
28800
- return value.charAt(0).toLocaleUpperCase() + value.slice(1);
28801
- };
28802
- const getAlphanumeric = (value) => {
28803
- if (!value) {
28804
- return "";
28805
- }
28806
- return value.replace(/[\W_]/g, " ");
28807
- };
28808
- const getAdditionalElements = (fields) => {
28809
- return fields.map((key) => ({
28810
- type: "custom",
28811
- key,
28812
- label: capitalize(getAlphanumeric(key)),
28813
- className: "lupa-custom",
28814
- display: (doc2) => Boolean(doc2[key])
28815
- }));
28816
- };
28817
- const addFieldIfKeyExists = (field, key, config) => {
28818
- if (key) {
28819
- return config;
28820
- }
28821
- return { key: field, type: "customHtml", display: () => false };
28822
- };
28823
- const getSearchBoxComponent = ({
28824
- searchBoxOptions,
28825
- labels,
28826
- panelOptions,
28827
- redirections,
28828
- placeholderImage
28829
- }) => {
28830
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
28831
- const panels = [
28832
- ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
28833
- {
28834
- type: SearchBoxPanelType.SUGGESTION,
28835
- queryKey: searchBoxOptions.suggestionQueryKey,
28836
- highlight: true,
28837
- limit: 8,
28838
- labels: {
28839
- topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
28840
- }
28841
- }
28842
- ] : [],
28843
- ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
28844
- {
28845
- type: SearchBoxPanelType.DOCUMENT,
28846
- queryKey: searchBoxOptions.documentQueryKey,
28847
- limit: 5,
28848
- elements: [
28849
- {
28850
- type: "image",
28851
- placeholder: placeholderImage,
28852
- key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
28853
- baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
28854
- },
28855
- {
28856
- type: "title",
28857
- key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
28858
- maxLines: 2
28859
- },
28860
- {
28861
- type: "regularPrice",
28862
- key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
28863
- display: (doc2) => {
28864
- var _a2, _b2, _c2, _d2;
28865
- 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]);
28866
- }
28867
- },
28868
- {
28869
- type: "price",
28870
- key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
28871
- }
28872
- ]
28873
- }
28874
- ] : []
28875
- ];
28876
- return {
28877
- inputSelector: searchBoxOptions.inputSelector,
28878
- options: {
28879
- environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
28880
- customUrl: searchBoxOptions.customUrl,
28881
- customBaseUrl: searchBoxOptions.customBaseUrl,
28882
- customPayload: searchBoxOptions.customPayload,
28883
- customHeaders: searchBoxOptions.customHeaders
28884
- },
28885
- showTotalCount: true,
28886
- expandOnSinglePanel: true,
28887
- minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
28888
- debounce: 250,
28889
- labels: labels == null ? void 0 : labels.searchBox,
28890
- links: {
28891
- searchResults: ""
28868
+ const DEFAULT_OPTIONS_RESULTS = {
28869
+ options: {
28870
+ environment: "production"
28871
+ },
28872
+ queryKey: "",
28873
+ containerSelector: "#searchResultsContainer",
28874
+ searchTitlePosition: "page-top",
28875
+ labels: {
28876
+ pageSize: "Page size:",
28877
+ sortBy: "Sort by:",
28878
+ itemCount: "Items {1} of {2}",
28879
+ filteredItemCount: "",
28880
+ currency: "€",
28881
+ showMore: "Show more",
28882
+ searchResults: "Search Query: ",
28883
+ emptyResults: "There are no results for the query:",
28884
+ mobileFilterButton: "Filter",
28885
+ htmlTitleTemplate: "Search Query: '{1}'",
28886
+ noResultsSuggestion: "No results found for this query: {1}",
28887
+ didYouMean: "Did you mean to search: {1}",
28888
+ similarQuery: "Search results for phrase {1}",
28889
+ similarQueries: "Similar queries:"
28890
+ },
28891
+ grid: {
28892
+ columns: {
28893
+ xl: 4,
28894
+ l: 3,
28895
+ md: 2,
28896
+ sm: 2,
28897
+ xs: 1
28898
+ }
28899
+ },
28900
+ pagination: {
28901
+ sizeSelection: {
28902
+ position: {
28903
+ top: false,
28904
+ bottom: true
28905
+ },
28906
+ sizes: [12, 24, 36]
28892
28907
  },
28893
- panels,
28894
- redirections,
28895
- history: {
28896
- labels: {
28897
- clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
28898
- }
28908
+ pageSelection: {
28909
+ position: {
28910
+ top: false,
28911
+ bottom: true
28912
+ },
28913
+ display: 5,
28914
+ displayMobile: 3
28899
28915
  }
28900
- };
28901
- };
28902
- const getSearchResultsComponent = ({
28903
- searchResultOptions,
28904
- labels,
28905
- redirections,
28906
- placeholderImage,
28907
- configuratorOverrides,
28908
- callbacks,
28909
- additionalFields
28910
- }) => {
28911
- 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;
28912
- const filters = searchResultOptions.showFacets ? {
28916
+ },
28917
+ sort: [],
28918
+ filters: {
28913
28919
  currentFilters: {
28914
28920
  visibility: {
28915
28921
  mobileSidebar: true,
28916
28922
  mobileToolbar: true
28917
28923
  },
28918
28924
  labels: {
28919
- title: "",
28920
- clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
28925
+ title: "Current filters:",
28926
+ clearAll: "Clear all"
28921
28927
  }
28922
28928
  },
28923
28929
  facets: {
28924
28930
  labels: {
28925
- title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
28926
- showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
28927
- facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
28928
- facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
28931
+ title: "Filters:",
28932
+ showAll: "Show more",
28933
+ facetFilter: "Filter...",
28934
+ facetClear: "Clear"
28929
28935
  },
28930
28936
  filterable: {
28931
28937
  minValues: 5
@@ -28935,179 +28941,230 @@ const getSearchResultsComponent = ({
28935
28941
  topLevelValueCountLimit: 5,
28936
28942
  filterable: true
28937
28943
  },
28938
- stats: {
28939
- slider: true,
28940
- inputs: true,
28941
- labels: {
28942
- from: "",
28943
- to: ""
28944
- }
28945
- },
28946
- facetValueCountLimit: 8,
28944
+ facetValueCountLimit: 20,
28947
28945
  showDocumentCount: true,
28948
28946
  style: {
28949
28947
  type: "sidebar"
28950
28948
  }
28951
28949
  }
28952
- } : {};
28953
- const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
28954
- xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
28955
- l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
28956
- md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
28957
- sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
28958
- xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
28959
- };
28960
- const badges = {
28961
- badges: {
28962
- anchor: "tr",
28963
- elements: [
28964
- ...searchResultOptions.showRelevance ? [
28965
- {
28966
- key: "",
28967
- type: "customHtml",
28968
- className: "relevance",
28969
- html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
28970
- display: (doc2) => Boolean(doc2._relevance !== void 0)
28971
- }
28972
- ] : [],
28973
- ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
28974
- {
28975
- key: "",
28976
- type: "customHtml",
28977
- className: "boosted-marker",
28978
- html: () => {
28979
- var _a2;
28980
- return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
28981
- },
28982
- display: (doc2) => doc2._boosted === true
28983
- }
28984
- ] : []
28985
- ]
28986
- }
28987
- };
28988
- return __spreadValues(__spreadProps(__spreadValues({
28989
- options: {
28990
- environment: (_m = searchResultOptions.environment) != null ? _m : "production",
28991
- customUrl: searchResultOptions.customUrl,
28992
- customBaseUrl: searchResultOptions.customBaseUrl,
28993
- customPayload: searchResultOptions.customPayload,
28994
- customHeaders: searchResultOptions.customHeaders,
28995
- onError: searchResultOptions.errorHandler
28996
- },
28997
- queryKey: searchResultOptions.queryKey,
28998
- containerSelector: searchResultOptions.containerSelector,
28999
- searchTitlePosition: "search-results-top",
29000
- titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
29001
- labels: labels == null ? void 0 : labels.searchResults,
29002
- grid: {
29003
- columns
29004
- },
29005
- pagination: {
29006
- sizeSelection: {
29007
- position: {
29008
- top: true,
29009
- bottom: false
29010
- },
29011
- sizes: [12, 24, 36, 48]
29012
- },
29013
- pageSelection: {
29014
- position: {
29015
- top: false,
29016
- bottom: true
29017
- },
29018
- displayMobile: 3,
29019
- display: 5
29020
- }
29021
- },
29022
- filters,
29023
- toolbar: {
29024
- layoutSelector: false,
29025
- itemSummary: true,
29026
- clearFilters: false
29027
- },
29028
- isInStock: () => {
29029
- return true;
29030
- }
29031
- }, badges), {
29032
- links: {
29033
- details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
29034
- },
29035
- callbacks,
29036
- routingBehavior: callbacks ? "event" : "direct-link",
29037
- idKey: "id",
29038
- elements: [
29039
- {
29040
- type: "image",
29041
- placeholder: placeholderImage,
29042
- key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
29043
- baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
29044
- display: () => {
29045
- var _a2;
29046
- return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
29047
- }
29048
- },
29049
- addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
29050
- type: "custom",
29051
- className: "lupa-custom-emphasis",
29052
- key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
29053
- display: () => true
29054
- }),
29055
- {
29056
- type: "title",
29057
- key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
29058
- maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
29059
- display: (doc2) => {
29060
- var _a2, _b2;
29061
- return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
29062
- }
29063
- },
29064
- ...getAdditionalElements(additionalFields),
29065
- addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
29066
- key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
29067
- type: "customHtml",
29068
- className: "lupa-price lupa-price-discounted",
29069
- display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
29070
- html: (doc2) => {
29071
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29072
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29073
- const discountPrice = (_d2 = parseFloat(
29074
- doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
29075
- )) == null ? void 0 : _d2.toFixed(2);
29076
- const regularPrice = (_g2 = parseFloat(
29077
- doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
29078
- )) == null ? void 0 : _g2.toFixed(2);
29079
- const discount = `<span class="lupa-discount">${escapeHtml(
29080
- discountPrice
29081
- )} ${currency}</span>`;
29082
- const regular = `<span class="lupa-regular">${escapeHtml(
29083
- regularPrice
29084
- )} ${currency}</span>`;
29085
- return discount + regular;
29086
- }
29087
- }),
29088
- addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
29089
- key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
29090
- type: "customHtml",
29091
- className: "lupa-price lupa-price-single",
29092
- display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
29093
- html: (doc2) => {
29094
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29095
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29096
- const price = (_g2 = parseFloat(
29097
- (_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 : ""]
29098
- )) == null ? void 0 : _g2.toFixed(2);
29099
- return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
29100
- }
29101
- })
29102
- ],
29103
- breadcrumbs: [],
29104
- sort: [],
29105
- redirections
29106
- }), configuratorOverrides);
28950
+ },
28951
+ toolbar: {
28952
+ layoutSelector: true,
28953
+ itemSummary: true,
28954
+ clearFilters: false
28955
+ },
28956
+ isInStock: () => {
28957
+ return true;
28958
+ },
28959
+ badges: {
28960
+ anchor: "tr",
28961
+ elements: []
28962
+ },
28963
+ links: {
28964
+ details: "/{id}"
28965
+ },
28966
+ elements: [],
28967
+ breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28968
+ };
28969
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28970
+ __name: "SearchResultsEntry",
28971
+ props: {
28972
+ searchResultsOptions: {}
28973
+ },
28974
+ setup(__props, { expose: __expose }) {
28975
+ const props = __props;
28976
+ const searchResults2 = ref(null);
28977
+ const fullSearchResultsOptions = computed(() => {
28978
+ const options = lodashExports.cloneDeep(props.searchResultsOptions);
28979
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28980
+ });
28981
+ const fetch2 = () => {
28982
+ var _a;
28983
+ (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28984
+ };
28985
+ __expose({ fetch: fetch2 });
28986
+ return (_ctx, _cache) => {
28987
+ return openBlock(), createBlock(unref(_sfc_main$c), {
28988
+ options: fullSearchResultsOptions.value,
28989
+ ref_key: "searchResults",
28990
+ ref: searchResults2
28991
+ }, null, 8, ["options"]);
28992
+ };
28993
+ }
28994
+ });
28995
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28996
+ __name: "ProductListEntry",
28997
+ props: {
28998
+ productListOptions: {}
28999
+ },
29000
+ setup(__props, { expose: __expose }) {
29001
+ const props = __props;
29002
+ const productList2 = ref(null);
29003
+ const fullProductListOptions = computed(() => {
29004
+ return lodashExports.cloneDeep(props.productListOptions);
29005
+ });
29006
+ const fetch2 = () => {
29007
+ var _a;
29008
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29009
+ };
29010
+ __expose({ fetch: fetch2 });
29011
+ return (_ctx, _cache) => {
29012
+ return openBlock(), createBlock(unref(_sfc_main$a), {
29013
+ options: fullProductListOptions.value,
29014
+ ref_key: "productList",
29015
+ ref: productList2
29016
+ }, null, 8, ["options"]);
29017
+ };
29018
+ }
29019
+ });
29020
+ const QUERY_PARAMS = {
29021
+ QUERY: "q",
29022
+ PAGE: "p",
29023
+ LIMIT: "l",
29024
+ SORT: "s"
29107
29025
  };
29108
- const SearchContainerConfigurationService = {
29109
- getSearchBoxComponent,
29110
- getSearchResultsComponent
29026
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
29027
+ __name: "SearchContainerEntry",
29028
+ props: {
29029
+ searchContainerOptions: {}
29030
+ },
29031
+ setup(__props, { expose: __expose }) {
29032
+ const props = __props;
29033
+ const isOpen = ref(false);
29034
+ const triggerElement = ref(null);
29035
+ const productList2 = ref(null);
29036
+ const containerOptions = computed(() => {
29037
+ return lodashExports.cloneDeep(props.searchContainerOptions);
29038
+ });
29039
+ const focus = () => {
29040
+ const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
29041
+ el == null ? void 0 : el.focus();
29042
+ };
29043
+ const close = () => {
29044
+ isOpen.value = false;
29045
+ };
29046
+ const openSearchContainer = () => {
29047
+ isOpen.value = true;
29048
+ };
29049
+ const checkCloseOnEscape = (e2) => {
29050
+ var _a;
29051
+ if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
29052
+ return;
29053
+ }
29054
+ isOpen.value = false;
29055
+ };
29056
+ const checkExistingQuery = () => {
29057
+ const url = new URL(window.location.href);
29058
+ const param = url.searchParams.get(QUERY_PARAMS.QUERY);
29059
+ if (!param) {
29060
+ return;
29061
+ }
29062
+ isOpen.value = true;
29063
+ };
29064
+ const mountOpenListeners = () => {
29065
+ var _a, _b;
29066
+ triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
29067
+ (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
29068
+ window.addEventListener("keydown", checkCloseOnEscape);
29069
+ };
29070
+ onMounted(() => {
29071
+ var _a, _b;
29072
+ mountOpenListeners();
29073
+ checkExistingQuery();
29074
+ isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
29075
+ });
29076
+ onBeforeUnmount(() => {
29077
+ var _a;
29078
+ (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
29079
+ window.removeEventListener("keydown", checkCloseOnEscape);
29080
+ });
29081
+ const fetch2 = () => {
29082
+ var _a;
29083
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29084
+ };
29085
+ const reloadOptions = () => {
29086
+ var _a;
29087
+ (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
29088
+ };
29089
+ __expose({ fetch: fetch2, reloadOptions });
29090
+ return (_ctx, _cache) => {
29091
+ return openBlock(), createElementBlock("div", null, [
29092
+ containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
29093
+ key: 0,
29094
+ options: containerOptions.value,
29095
+ ref_key: "productList",
29096
+ ref: productList2,
29097
+ "onHook:mounted": focus,
29098
+ onClose: close
29099
+ }, null, 8, ["options"])) : createCommentVNode("", true)
29100
+ ]);
29101
+ };
29102
+ }
29103
+ });
29104
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29105
+ __name: "RecommendationsEntry",
29106
+ props: {
29107
+ recommendationOptions: {}
29108
+ },
29109
+ setup(__props, { expose: __expose }) {
29110
+ const productRecommendations = ref(null);
29111
+ const fetch2 = () => {
29112
+ productRecommendations == null ? void 0 : productRecommendations.fetch();
29113
+ };
29114
+ __expose({ fetch: fetch2 });
29115
+ return (_ctx, _cache) => {
29116
+ return openBlock(), createBlock(unref(_sfc_main$8), {
29117
+ options: _ctx.recommendationOptions,
29118
+ ref_key: "productRecommendations",
29119
+ ref: productRecommendations
29120
+ }, null, 8, ["options"]);
29121
+ };
29122
+ }
29123
+ });
29124
+ const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
29125
+ const createShadowDom = (shadowId, managerId) => {
29126
+ let host = document.getElementById(shadowId);
29127
+ if (host) {
29128
+ host.remove();
29129
+ }
29130
+ host = document.createElement("div");
29131
+ const manager = document.createElement("div");
29132
+ host.setAttribute("id", shadowId);
29133
+ manager == null ? void 0 : manager.setAttribute("id", managerId);
29134
+ return { host, manager };
29135
+ };
29136
+ const attatchShadowDom = ({
29137
+ host,
29138
+ manager,
29139
+ styleUrl,
29140
+ options
29141
+ }) => {
29142
+ var _a;
29143
+ if (host.shadowRoot) {
29144
+ return;
29145
+ }
29146
+ const link = document.createElement("link");
29147
+ link.type = "text/css";
29148
+ link.rel = "stylesheet";
29149
+ link.href = styleUrl;
29150
+ const fontLink = document.createElement("link");
29151
+ fontLink.type = "text/css";
29152
+ fontLink.rel = "stylesheet";
29153
+ fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
29154
+ document.head.appendChild(fontLink);
29155
+ const materialIconLink = document.createElement("link");
29156
+ materialIconLink.type = "text/css";
29157
+ materialIconLink.rel = "stylesheet";
29158
+ materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
29159
+ document.head.appendChild(materialIconLink);
29160
+ const shadow = host.attachShadow({ mode: "open" });
29161
+ shadow.appendChild(manager);
29162
+ shadow.appendChild(link);
29163
+ if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
29164
+ const style = document.createElement("style");
29165
+ style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
29166
+ shadow.appendChild(style);
29167
+ }
29111
29168
  };
29112
29169
  const getMountElement = (element, mountingBehavior = "replace", mountToParent) => {
29113
29170
  const parent = element == null ? void 0 : element.parentElement;
@@ -29138,7 +29195,7 @@ const createVue = (selector, mountingBehavior = "replace", rootComponent, option
29138
29195
  return;
29139
29196
  }
29140
29197
  let mountedComponent = null;
29141
- const props = reactive(__spreadValues({}, options));
29198
+ const props = reactive(__spreadValues2({}, options));
29142
29199
  const app2 = createApp({
29143
29200
  render: () => mountedComponent = h$1(rootComponent, props)
29144
29201
  });
@@ -29157,9 +29214,6 @@ const app = {
29157
29214
  recommendations: {},
29158
29215
  chat: {}
29159
29216
  };
29160
- const tracking = (options) => {
29161
- setupTracking(options);
29162
- };
29163
29217
  const applySearchBox = (options, mountOptions) => {
29164
29218
  const existingInstance = app.box[options.inputSelector];
29165
29219
  if (existingInstance) {
@@ -29188,7 +29242,7 @@ const searchBox = (options, mountOptions) => {
29188
29242
  var _a;
29189
29243
  const inputs = (_a = options.inputSelector) == null ? void 0 : _a.split(",");
29190
29244
  for (const input of inputs) {
29191
- applySearchBox(__spreadProps(__spreadValues({}, options), { inputSelector: input.trim() }), mountOptions);
29245
+ applySearchBox(__spreadProps2(__spreadValues2({}, options), { inputSelector: input.trim() }), mountOptions);
29192
29246
  }
29193
29247
  };
29194
29248
  const searchResults = (options, mountOptions) => {
@@ -29424,7 +29478,238 @@ const clearChat = (selector) => {
29424
29478
  } catch (e2) {
29425
29479
  }
29426
29480
  };
29481
+ const saveToLocalStorage = (key, value) => {
29482
+ try {
29483
+ localStorage.setItem(key, JSON.stringify(value));
29484
+ } catch (e2) {
29485
+ }
29486
+ };
29487
+ const tryLoadFromLocalStorage = (key) => {
29488
+ try {
29489
+ const item = localStorage.getItem(key);
29490
+ return item ? JSON.parse(item) : null;
29491
+ } catch (e2) {
29492
+ return null;
29493
+ }
29494
+ };
29495
+ const saveToSessionStorage = (key, value) => {
29496
+ try {
29497
+ sessionStorage.setItem(key, JSON.stringify(value));
29498
+ } catch (e2) {
29499
+ }
29500
+ };
29501
+ const tryLoadFromSessionStorage = (key) => {
29502
+ try {
29503
+ const item = sessionStorage.getItem(key);
29504
+ return item ? JSON.parse(item) : null;
29505
+ } catch (e2) {
29506
+ return null;
29507
+ }
29508
+ };
29509
+ const getQueryParam = (name) => {
29510
+ try {
29511
+ const urlParams = new URLSearchParams(window.location.search);
29512
+ return urlParams.get(name);
29513
+ } catch (e2) {
29514
+ return null;
29515
+ }
29516
+ };
29517
+ const PREVIEW_PARAMETER = "lupaSearchPreview";
29518
+ let styleElement = null;
29519
+ const waitForElementToBeVisible = (element, retries = 0, maxRetries = 10, interval = 10) => __async2(exports, null, function* () {
29520
+ if (retries > maxRetries) {
29521
+ return false;
29522
+ }
29523
+ if (typeof element === "string") {
29524
+ element = document.querySelector(element);
29525
+ }
29526
+ if (element) {
29527
+ return true;
29528
+ } else {
29529
+ setTimeout(() => {
29530
+ waitForElementToBeVisible(element, retries + 1, maxRetries, interval + 10);
29531
+ }, interval);
29532
+ }
29533
+ });
29534
+ const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async2(exports, null, function* () {
29535
+ const configuration2 = yield fetchPluginConfiguration(
29536
+ options,
29537
+ configurationKey
29538
+ );
29539
+ if (!configuration2) {
29540
+ console.error(`Failed to fetch LupaSearch plugin configuration for key ${configurationKey}`);
29541
+ return null;
29542
+ }
29543
+ saveToLocalStorage(configurationKey, configuration2);
29544
+ return configuration2;
29545
+ });
29546
+ const checkIsPreviewMode = () => {
29547
+ const isPreviewModeSaved = tryLoadFromSessionStorage(PREVIEW_PARAMETER);
29548
+ if (isPreviewModeSaved) {
29549
+ return isPreviewModeSaved;
29550
+ }
29551
+ const isPreviewMode = getQueryParam(PREVIEW_PARAMETER) === "true";
29552
+ if (isPreviewMode) {
29553
+ saveToSessionStorage(PREVIEW_PARAMETER, isPreviewMode);
29554
+ } else {
29555
+ saveToSessionStorage(PREVIEW_PARAMETER, false);
29556
+ }
29557
+ return isPreviewMode;
29558
+ };
29559
+ const loadConfigurations = (configurationKey, isPreviewMode, options) => __async2(exports, null, function* () {
29560
+ if (isPreviewMode) {
29561
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29562
+ }
29563
+ const existingConfiguration = tryLoadFromLocalStorage(configurationKey);
29564
+ if (existingConfiguration) {
29565
+ setTimeout(() => __async2(exports, null, function* () {
29566
+ var _a;
29567
+ const newestConfiguration = yield loadAndSaveConfigurationFromServer(
29568
+ configurationKey,
29569
+ options
29570
+ );
29571
+ if (existingConfiguration.updatedAt === newestConfiguration.updatedAt) {
29572
+ return;
29573
+ }
29574
+ const isPreviewMode2 = checkIsPreviewMode();
29575
+ const configuration2 = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
29576
+ yield mount(configuration2, false);
29577
+ }), 5e3);
29578
+ return existingConfiguration;
29579
+ }
29580
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29581
+ });
29582
+ const applyStyles = (configuration2) => __async2(exports, null, function* () {
29583
+ var _a;
29584
+ const visible2 = yield waitForElementToBeVisible(document.head);
29585
+ if (!visible2) {
29586
+ console.error("Failed to apply custom LupaSearch styles, head element not found");
29587
+ return;
29588
+ }
29589
+ const baseStyleLink = configuration2.baseStyleLink;
29590
+ if (styleElement) {
29591
+ styleElement.remove();
29592
+ }
29593
+ styleElement = document.createElement("style");
29594
+ if (baseStyleLink) {
29595
+ styleElement.innerHTML = `
29596
+ @import url('${baseStyleLink}');
29597
+ @import url('https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css')
29598
+ ${(_a = configuration2.customStyles) != null ? _a : ""}
29599
+ `;
29600
+ }
29601
+ document.head.appendChild(styleElement);
29602
+ });
29603
+ const mountSearchBox = (configuration, fetch = true) => __async2(exports, null, function* () {
29604
+ if (!configuration.searchBox) {
29605
+ return;
29606
+ }
29607
+ const resolvedConfiguration = eval(`(${configuration.searchBox})`);
29608
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.inputSelector);
29609
+ if (!visible) {
29610
+ console.error(
29611
+ `Failed to mount LupaSearch search box, input element ${resolvedConfiguration.inputSelector} not found`
29612
+ );
29613
+ return;
29614
+ }
29615
+ searchBox(resolvedConfiguration, { fetch });
29616
+ });
29617
+ const mountSearchResults = (configuration, fetch = true) => __async2(exports, null, function* () {
29618
+ if (!configuration.searchResults) {
29619
+ return;
29620
+ }
29621
+ const resolvedConfiguration = eval(`(${configuration.searchResults})`);
29622
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29623
+ if (!visible) {
29624
+ console.error(
29625
+ `Failed to mount LupaSearch search results, element ${resolvedConfiguration.containerSelector} not found`
29626
+ );
29627
+ return;
29628
+ }
29629
+ searchResults(resolvedConfiguration, { fetch });
29630
+ });
29631
+ const mountProductList = (configuration, fetch = true) => __async2(exports, null, function* () {
29632
+ if (!configuration.productList) {
29633
+ return;
29634
+ }
29635
+ const resolvedSearchResultsConfiguration = eval(
29636
+ `(${configuration.searchResults})`
29637
+ );
29638
+ const resolvedConfiguration = eval(`(${configuration.productList})`);
29639
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29640
+ if (!visible) {
29641
+ console.error(
29642
+ `Failed to mount LupaSearch product list, element ${resolvedConfiguration.containerSelector} not found`
29643
+ );
29644
+ return;
29645
+ }
29646
+ productList(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29647
+ });
29648
+ const mountRecommendations = (configuration, fetch = true) => __async2(exports, null, function* () {
29649
+ if (!configuration.recommendations) {
29650
+ return;
29651
+ }
29652
+ const resolvedSearchResultsConfiguration = eval(
29653
+ `(${configuration.searchResults})`
29654
+ );
29655
+ const resolvedConfiguration = eval(
29656
+ `(${configuration.recommendations})`
29657
+ );
29658
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29659
+ if (!visible) {
29660
+ console.error(
29661
+ `Failed to mount LupaSearch recommendations, element ${resolvedConfiguration.containerSelector} not found`
29662
+ );
29663
+ return;
29664
+ }
29665
+ recommendations(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29666
+ });
29667
+ const mountChat = (configuration, fetch = true) => __async2(exports, null, function* () {
29668
+ if (!configuration.genAiChat) {
29669
+ return;
29670
+ }
29671
+ const resolvedSearchResultsConfiguration = eval(
29672
+ `(${configuration.searchResults})`
29673
+ );
29674
+ const resolvedConfiguration = eval(`(${configuration.genAiChat})`);
29675
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29676
+ if (!visible) {
29677
+ console.error(
29678
+ `Failed to mount LupaSearch chat, element ${resolvedConfiguration.containerSelector} not found`
29679
+ );
29680
+ return;
29681
+ }
29682
+ chat(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29683
+ });
29684
+ const mount = (configuration2, fetch2 = true) => __async2(exports, null, function* () {
29685
+ yield applyStyles(configuration2);
29686
+ const mountPromises = [
29687
+ mountSearchBox(configuration2, fetch2),
29688
+ mountSearchResults(configuration2, fetch2),
29689
+ mountProductList(configuration2, fetch2),
29690
+ mountRecommendations(configuration2, fetch2),
29691
+ mountChat(configuration2, fetch2)
29692
+ ];
29693
+ yield Promise.all(mountPromises);
29694
+ });
29695
+ const init$1 = (configurationKey, options) => __async2(exports, null, function* () {
29696
+ var _a;
29697
+ const isPreviewMode = checkIsPreviewMode();
29698
+ const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
29699
+ const configuration2 = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
29700
+ yield mount(configuration2);
29701
+ });
29702
+ const PluginConfigurationManager = {
29703
+ init: init$1
29704
+ };
29705
+ const tracking = (options) => {
29706
+ setupTracking(options);
29707
+ };
29708
+ const init = (configurationKey, options) => {
29709
+ return PluginConfigurationManager.init(configurationKey, options);
29710
+ };
29427
29711
  const lupaSearch = {
29712
+ init,
29428
29713
  searchBox,
29429
29714
  searchResults,
29430
29715
  tracking,