@getlupa/client 1.12.10 → 1.13.0

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,25 +1,45 @@
1
1
  (function(global2, factory) {
2
2
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.LupaSearch = {}));
3
- })(this, function(exports2) {
4
- "use strict";var __defProp = Object.defineProperty;
5
- var __defProps = Object.defineProperties;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
- var __spreadValues = (a, b) => {
3
+ })(this, function(exports) {
4
+ "use strict";var __defProp2 = Object.defineProperty;
5
+ var __defProps2 = Object.defineProperties;
6
+ var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
8
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues2 = (a, b) => {
12
12
  for (var prop in b || (b = {}))
13
- if (__hasOwnProp.call(b, prop))
14
- __defNormalProp(a, prop, b[prop]);
15
- if (__getOwnPropSymbols)
16
- for (var prop of __getOwnPropSymbols(b)) {
17
- if (__propIsEnum.call(b, prop))
18
- __defNormalProp(a, prop, b[prop]);
13
+ if (__hasOwnProp2.call(b, prop))
14
+ __defNormalProp2(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols2)
16
+ for (var prop of __getOwnPropSymbols2(b)) {
17
+ if (__propIsEnum2.call(b, prop))
18
+ __defNormalProp2(a, prop, b[prop]);
19
19
  }
20
20
  return a;
21
21
  };
22
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22
+ var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
23
+ var __async2 = (__this, __arguments, generator) => {
24
+ return new Promise((resolve2, reject) => {
25
+ var fulfilled = (value) => {
26
+ try {
27
+ step(generator.next(value));
28
+ } catch (e2) {
29
+ reject(e2);
30
+ }
31
+ };
32
+ var rejected = (value) => {
33
+ try {
34
+ step(generator.throw(value));
35
+ } catch (e2) {
36
+ reject(e2);
37
+ }
38
+ };
39
+ var step = (x) => x.done ? resolve2(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
40
+ step((generator = generator.apply(__this, __arguments)).next());
41
+ });
42
+ };
23
43
 
24
44
  function makeMap(str, expectsLowerCase) {
25
45
  const map = /* @__PURE__ */ Object.create(null);
@@ -6305,7 +6325,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6305
6325
  }
6306
6326
  const createApp = (...args) => {
6307
6327
  const app2 = ensureRenderer().createApp(...args);
6308
- const { mount } = app2;
6328
+ const { mount: mount2 } = app2;
6309
6329
  app2.mount = (containerOrSelector) => {
6310
6330
  const container = normalizeContainer(containerOrSelector);
6311
6331
  if (!container)
@@ -6315,7 +6335,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6315
6335
  component.template = container.innerHTML;
6316
6336
  }
6317
6337
  container.innerHTML = "";
6318
- const proxy = mount(container, false, container instanceof SVGElement);
6338
+ const proxy = mount2(container, false, container instanceof SVGElement);
6319
6339
  if (container instanceof Element) {
6320
6340
  container.removeAttribute("v-cloak");
6321
6341
  container.setAttribute("data-v-app", "");
@@ -6331,25 +6351,25 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6331
6351
  }
6332
6352
  return container;
6333
6353
  }
6334
- var __defProp2 = Object.defineProperty;
6335
- var __defProps2 = Object.defineProperties;
6336
- var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
6337
- var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
6338
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
6339
- var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
6340
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6341
- var __spreadValues2 = (a, b) => {
6354
+ var __defProp = Object.defineProperty;
6355
+ var __defProps = Object.defineProperties;
6356
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6357
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6358
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6359
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
6360
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6361
+ var __spreadValues = (a, b) => {
6342
6362
  for (var prop in b || (b = {}))
6343
- if (__hasOwnProp2.call(b, prop))
6344
- __defNormalProp2(a, prop, b[prop]);
6345
- if (__getOwnPropSymbols2)
6346
- for (var prop of __getOwnPropSymbols2(b)) {
6347
- if (__propIsEnum2.call(b, prop))
6348
- __defNormalProp2(a, prop, b[prop]);
6363
+ if (__hasOwnProp.call(b, prop))
6364
+ __defNormalProp(a, prop, b[prop]);
6365
+ if (__getOwnPropSymbols)
6366
+ for (var prop of __getOwnPropSymbols(b)) {
6367
+ if (__propIsEnum.call(b, prop))
6368
+ __defNormalProp(a, prop, b[prop]);
6349
6369
  }
6350
6370
  return a;
6351
6371
  };
6352
- var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
6372
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6353
6373
  var __async = (__this, __arguments, generator) => {
6354
6374
  return new Promise((resolve2, reject) => {
6355
6375
  var fulfilled = (value) => {
@@ -6815,14 +6835,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6815
6835
  step((generator = generator.apply(thisArg, _arguments || [])).next());
6816
6836
  });
6817
6837
  };
6818
- const defaultConfig$1 = {
6838
+ const defaultConfig = {
6819
6839
  method: "POST",
6820
6840
  headers: { "Content-Type": "application/json" }
6821
6841
  };
6822
6842
  const customRequestConfig = ({ customHeaders }) => {
6823
6843
  return {
6824
- method: defaultConfig$1.method,
6825
- headers: Object.assign(Object.assign({}, defaultConfig$1.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6844
+ method: defaultConfig.method,
6845
+ headers: Object.assign(Object.assign({}, defaultConfig.headers), customHeaders !== null && customHeaders !== void 0 ? customHeaders : {})
6826
6846
  };
6827
6847
  };
6828
6848
  const searchCustom = (query, options) => __awaiter(void 0, void 0, void 0, function* () {
@@ -6846,7 +6866,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6846
6866
  return { success: false, errors };
6847
6867
  });
6848
6868
  const search = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6849
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6869
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6850
6870
  if (res.status < 400) {
6851
6871
  const data = yield res.json();
6852
6872
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6856,7 +6876,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6856
6876
  });
6857
6877
  const queryByIds = (queryKey, ids, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6858
6878
  const idParam = ids.map((id) => `ids=${id}`).join("&");
6859
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6879
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}/ids?${idParam}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6860
6880
  if (res.status < 400) {
6861
6881
  const data = yield res.json();
6862
6882
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6869,7 +6889,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6869
6889
  if (filters) {
6870
6890
  url += `&${e({ filters })}`;
6871
6891
  }
6872
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6892
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6873
6893
  if (res.status < 400) {
6874
6894
  const data = yield res.json();
6875
6895
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6883,7 +6903,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6883
6903
  if (filters) {
6884
6904
  url += `&${e({ filters })}`;
6885
6905
  }
6886
- const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6906
+ const res = yield fetch(url, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6887
6907
  if (res.status < 400) {
6888
6908
  const data = yield res.json();
6889
6909
  return Object.assign(Object.assign({}, data), { success: true });
@@ -6895,7 +6915,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6895
6915
  return Array.isArray(recommendForId) ? yield recommendForMultipleIds(queryKey, recommendForId, filters, environment, customBaseUrl) : yield recommendForSingleId(queryKey, recommendForId, filters, environment, customBaseUrl);
6896
6916
  });
6897
6917
  const suggest = (queryKey, query, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6898
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(query) }));
6918
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}query/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(query) }));
6899
6919
  if (res.status < 400) {
6900
6920
  const items = yield res.json();
6901
6921
  return { items, success: true };
@@ -6905,7 +6925,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6905
6925
  });
6906
6926
  const track$1 = (queryKey, event, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6907
6927
  try {
6908
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig$1), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6928
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}events`, Object.assign(Object.assign({}, defaultConfig), { body: JSON.stringify(Object.assign({ queryKey }, event)) }));
6909
6929
  if (res.status < 400) {
6910
6930
  return { success: false };
6911
6931
  }
@@ -6915,7 +6935,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
6915
6935
  }
6916
6936
  });
6917
6937
  const loadRedirectionRules = (queryKey, environment, customBaseUrl) => __awaiter(void 0, void 0, void 0, function* () {
6918
- const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig$1), { method: "GET" }));
6938
+ const res = yield fetch(`${getApiUrl$1(environment, customBaseUrl)}redirections/${queryKey}`, Object.assign(Object.assign({}, defaultConfig), { method: "GET" }));
6919
6939
  if (res.status < 400) {
6920
6940
  return res.json();
6921
6941
  }
@@ -7247,13 +7267,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7247
7267
  }
7248
7268
  const sendItemTitle = data.searchQuery !== ((_a = data.analytics) == null ? void 0 : _a.label);
7249
7269
  const title = sendItemTitle ? (_b = data.analytics) == null ? void 0 : _b.label : void 0;
7250
- const params = __spreadValues2({
7270
+ const params = __spreadValues({
7251
7271
  search_text: data.searchQuery,
7252
7272
  item_title: title,
7253
7273
  item_id: data.itemId,
7254
7274
  ecommerce: parseEcommerceData(data, (_c = data.analytics) == null ? void 0 : _c.listLabel)
7255
7275
  }, (_e = (_d = data.analytics) == null ? void 0 : _d.additionalParams) != null ? _e : {});
7256
- window.dataLayer.push(__spreadValues2({
7276
+ window.dataLayer.push(__spreadValues({
7257
7277
  event: (_g = (_f = data.analytics) == null ? void 0 : _f.type) != null ? _g : options.parentEventName
7258
7278
  }, params));
7259
7279
  };
@@ -7431,15 +7451,21 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7431
7451
  breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
7432
7452
  };
7433
7453
  const useScreenStore = defineStore("screen", () => {
7434
- const screenWidth = ref(1e3);
7454
+ const measuredScreenWidth = ref(1e3);
7435
7455
  const optionsStore = useOptionsStore();
7456
+ const screenWidth = computed(() => {
7457
+ var _a, _b;
7458
+ const { searchResultOptions } = storeToRefs(optionsStore);
7459
+ return (_b = (_a = searchResultOptions.value.grid) == null ? void 0 : _a.forcedScreenWidth) != null ? _b : measuredScreenWidth.value;
7460
+ });
7436
7461
  const configuredGridSizes = computed(() => {
7437
7462
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
7463
+ const { searchResultOptions } = storeToRefs(optionsStore);
7438
7464
  return {
7439
- 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,
7440
- 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,
7441
- 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,
7442
- 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
7465
+ 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,
7466
+ 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,
7467
+ 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,
7468
+ 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
7443
7469
  };
7444
7470
  });
7445
7471
  const currentScreenWidth = computed(() => {
@@ -7461,7 +7487,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7461
7487
  return (_a = ["xs", "sm"]) == null ? void 0 : _a.includes(currentScreenWidth.value);
7462
7488
  });
7463
7489
  const setScreenWidth = ({ width }) => {
7464
- screenWidth.value = width;
7490
+ measuredScreenWidth.value = width;
7465
7491
  };
7466
7492
  return { screenWidth, currentScreenWidth, isMobileWidth, setScreenWidth };
7467
7493
  });
@@ -7741,7 +7767,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7741
7767
  const getLabeledFilters = (filters, facets) => {
7742
7768
  return filters.map((f2) => {
7743
7769
  var _a, _b;
7744
- return __spreadProps2(__spreadValues2({}, f2), {
7770
+ return __spreadProps(__spreadValues({}, f2), {
7745
7771
  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)
7746
7772
  });
7747
7773
  });
@@ -7769,7 +7795,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7769
7795
  }
7770
7796
  const children = recursiveFilter(item.children, query).filter(Boolean);
7771
7797
  const include = children.length > 0 || filterable;
7772
- return include ? __spreadProps2(__spreadValues2({}, item), {
7798
+ return include ? __spreadProps(__spreadValues({}, item), {
7773
7799
  children
7774
7800
  }) : void 0;
7775
7801
  };
@@ -7851,7 +7877,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7851
7877
  params.filters = {};
7852
7878
  for (const key of facetKeys) {
7853
7879
  const parsedKey = key.slice(key.indexOf(FACET_KEY_SEPARATOR) + 1);
7854
- params.filters = __spreadProps2(__spreadValues2({}, params.filters), {
7880
+ params.filters = __spreadProps(__spreadValues({}, params.filters), {
7855
7881
  [parsedKey]: parseFacetKey(key, searchParams)
7856
7882
  });
7857
7883
  }
@@ -7864,7 +7890,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7864
7890
  const paramKeys = Array.from(searchParams.keys());
7865
7891
  const facetKeys = paramKeys.filter((k) => isFacetKey(k));
7866
7892
  const regularKeys = paramKeys.filter((k) => !isFacetKey(k));
7867
- const r = __spreadValues2(__spreadValues2({
7893
+ const r = __spreadValues(__spreadValues({
7868
7894
  [QUERY_PARAMS_PARSED.QUERY]: ""
7869
7895
  }, parseRegularKeys(regularKeys, searchParams, getQueryParamName)), parseFacetKeys(facetKeys, searchParams));
7870
7896
  return r;
@@ -7914,7 +7940,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
7914
7940
  const encoded = encodeURIComponent(param);
7915
7941
  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, " ");
7916
7942
  };
7917
- const getQueryParam = (name) => {
7943
+ const getQueryParam$1 = (name) => {
7918
7944
  try {
7919
7945
  const urlParams = new URLSearchParams(window.location.search);
7920
7946
  return urlParams.get(name);
@@ -8054,7 +8080,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8054
8080
  const useRedirectionStore = defineStore("redirections", () => {
8055
8081
  const redirections = ref({ rules: [] });
8056
8082
  const redirectionOptions = ref({ enabled: false, queryKey: "" });
8057
- const saveToLocalStorage = () => {
8083
+ const saveToLocalStorage2 = () => {
8058
8084
  try {
8059
8085
  localStorage.setItem(
8060
8086
  CACHE_KEY,
@@ -8063,7 +8089,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8063
8089
  } catch (e2) {
8064
8090
  }
8065
8091
  };
8066
- const tryLoadFromLocalStorage = (config) => {
8092
+ const tryLoadFromLocalStorage2 = (config) => {
8067
8093
  var _a;
8068
8094
  if (!config.cacheSeconds)
8069
8095
  return false;
@@ -8086,7 +8112,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8086
8112
  if (!(config == null ? void 0 : config.enabled)) {
8087
8113
  return;
8088
8114
  }
8089
- const loaded = tryLoadFromLocalStorage(config);
8115
+ const loaded = tryLoadFromLocalStorage2(config);
8090
8116
  if (loaded || ((_c = (_b = redirections.value) == null ? void 0 : _b.rules) == null ? void 0 : _c.length) > 0) {
8091
8117
  return;
8092
8118
  }
@@ -8096,7 +8122,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8096
8122
  return;
8097
8123
  }
8098
8124
  redirections.value = result;
8099
- saveToLocalStorage();
8125
+ saveToLocalStorage2();
8100
8126
  } catch (e2) {
8101
8127
  }
8102
8128
  });
@@ -8222,12 +8248,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8222
8248
  return;
8223
8249
  }
8224
8250
  const forceFullReload = (_a = optionsStore.searchBoxOptions.forceFullReloadOnParams) == null ? void 0 : _a.some(
8225
- (p2) => getQueryParam(p2)
8251
+ (p2) => getQueryParam$1(p2)
8226
8252
  );
8227
8253
  if ((!searchResultsLink.value || linksMatch(searchResultsLink.value, window.location.pathname)) && !forceFullReload) {
8228
8254
  const singleFacetParam = facet ? getFacetParam(facet.key, [facet.title]) : void 0;
8229
8255
  const facetParam = singleFacetParam ? [
8230
- __spreadProps2(__spreadValues2({}, singleFacetParam), {
8256
+ __spreadProps(__spreadValues({}, singleFacetParam), {
8231
8257
  value: Array.isArray(singleFacetParam.value) ? singleFacetParam.value[0] : singleFacetParam.value
8232
8258
  })
8233
8259
  ] : [];
@@ -8316,7 +8342,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8316
8342
  displayHighlight: getHint(suggestion.suggestion, inputValue != null ? inputValue : ""),
8317
8343
  display: suggestion.suggestion,
8318
8344
  suggestion,
8319
- facet: __spreadValues2({
8345
+ facet: __spreadValues({
8320
8346
  key
8321
8347
  }, f2)
8322
8348
  }));
@@ -8423,14 +8449,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8423
8449
  const context = getLupaTrackingContext();
8424
8450
  const result = yield LupaSearchSdk.suggestions(
8425
8451
  queryKey,
8426
- __spreadValues2(__spreadValues2({}, publicQuery), context),
8452
+ __spreadValues(__spreadValues({}, publicQuery), context),
8427
8453
  options2
8428
8454
  );
8429
8455
  if (!result.success) {
8430
8456
  return { suggestions: void 0 };
8431
8457
  }
8432
8458
  highlightChange({ action: "clear" });
8433
- suggestionResults.value = __spreadProps2(__spreadValues2({}, suggestionResults.value), {
8459
+ suggestionResults.value = __spreadProps(__spreadValues({}, suggestionResults.value), {
8434
8460
  [queryKey]: flattenSuggestions(result.items, (_a = publicQuery.searchText) != null ? _a : "")
8435
8461
  });
8436
8462
  inputValue.value = publicQuery.searchText;
@@ -8467,12 +8493,12 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8467
8493
  }) {
8468
8494
  try {
8469
8495
  const context = getLupaTrackingContext();
8470
- const result = yield LupaSearchSdk.query(queryKey, __spreadValues2(__spreadValues2({}, publicQuery), context), options2);
8496
+ const result = yield LupaSearchSdk.query(queryKey, __spreadValues(__spreadValues({}, publicQuery), context), options2);
8471
8497
  if (!result.success) {
8472
8498
  return { queryKey, result: { items: [] } };
8473
8499
  }
8474
8500
  highlightChange({ action: "clear" });
8475
- docResults.value = __spreadProps2(__spreadValues2({}, docResults.value), { [queryKey]: result });
8501
+ docResults.value = __spreadProps(__spreadValues({}, docResults.value), { [queryKey]: result });
8476
8502
  emitSearchResultsCallback();
8477
8503
  return { queryKey, result };
8478
8504
  } catch (err) {
@@ -8574,7 +8600,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
8574
8600
  );
8575
8601
  const inputAttributes = computed(() => {
8576
8602
  var _a;
8577
- return __spreadValues2({}, (_a = props.options.inputAttributes) != null ? _a : {});
8603
+ return __spreadValues({}, (_a = props.options.inputAttributes) != null ? _a : {});
8578
8604
  });
8579
8605
  const ariaLabel = computed(() => {
8580
8606
  var _a;
@@ -9062,7 +9088,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9062
9088
  if (!requestedIds.length) {
9063
9089
  return;
9064
9090
  }
9065
- loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps2(__spreadValues2({}, a), { [c2]: true }), {});
9091
+ loadingIds.value = requestedIds.reduce((a, c2) => __spreadProps(__spreadValues({}, a), { [c2]: true }), {});
9066
9092
  loading.value = true;
9067
9093
  try {
9068
9094
  const dynamicData = dynamicSearchResultData.value || dynamicSearchBoxData.value;
@@ -9072,10 +9098,10 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9072
9098
  const dynamicDataResult = (_h = yield dynamicData == null ? void 0 : dynamicData.handler(requestedIds)) != null ? _h : [];
9073
9099
  const seed = {};
9074
9100
  const dynamicDataIdMapValue = dynamicDataResult.reduce(
9075
- (a, c2) => __spreadProps2(__spreadValues2({}, a), { [`${c2.id}`]: c2 }),
9101
+ (a, c2) => __spreadProps(__spreadValues({}, a), { [`${c2.id}`]: c2 }),
9076
9102
  seed
9077
9103
  );
9078
- dynamicDataIdMap.value = __spreadValues2(__spreadValues2({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9104
+ dynamicDataIdMap.value = __spreadValues(__spreadValues({}, dynamicDataIdMap.value), dynamicDataIdMapValue);
9079
9105
  } finally {
9080
9106
  loading.value = false;
9081
9107
  loadingIds.value = {};
@@ -9541,17 +9567,17 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9541
9567
  return hasResults.value && ((_a = searchResult.value.offset) != null ? _a : 0) >= totalItems.value;
9542
9568
  }
9543
9569
  );
9544
- const setSidebarState = ({ visible }) => {
9545
- if (visible) {
9570
+ const setSidebarState = ({ visible: visible2 }) => {
9571
+ if (visible2) {
9546
9572
  disableBodyScroll();
9547
9573
  } else {
9548
9574
  enableBodyScroll();
9549
9575
  }
9550
- isMobileSidebarVisible.value = visible;
9576
+ isMobileSidebarVisible.value = visible2;
9551
9577
  };
9552
9578
  const queryFacet = (_0) => __async(void 0, [_0], function* ({ queryKey, facetKey }) {
9553
9579
  var _a, _b, _c, _d;
9554
- const query = { searchText: "", filters: __spreadValues2({}, filters.value) };
9580
+ const query = { searchText: "", filters: __spreadValues({}, filters.value) };
9555
9581
  const options = (_a = optionsStore.envOptions) != null ? _a : { environment: "production" };
9556
9582
  const result = yield LupaSearchSdk.query(queryKey, query, options);
9557
9583
  if (!result.success) {
@@ -9559,8 +9585,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9559
9585
  }
9560
9586
  const facet = (_b = result.facets) == null ? void 0 : _b.find((f2) => f2.key === facetKey);
9561
9587
  const facetItems = (_c = facet == null ? void 0 : facet.items) != null ? _c : [];
9562
- const updatedResult = __spreadProps2(__spreadValues2({}, searchResult.value), {
9563
- facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps2(__spreadValues2({}, f2), { items: facetItems }) : f2)
9588
+ const updatedResult = __spreadProps(__spreadValues({}, searchResult.value), {
9589
+ facets: (_d = facets.value) == null ? void 0 : _d.map((f2) => f2.key === facetKey ? __spreadProps(__spreadValues({}, f2), { items: facetItems }) : f2)
9564
9590
  });
9565
9591
  searchResult.value = updatedResult;
9566
9592
  });
@@ -9709,7 +9735,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9709
9735
  SearchBoxProductAddToCart: _sfc_main$17
9710
9736
  }
9711
9737
  };
9712
- const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$4), {
9738
+ const _sfc_main$16 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$4), {
9713
9739
  __name: "SearchBoxProductElement",
9714
9740
  props: {
9715
9741
  item: {},
@@ -9751,7 +9777,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9751
9777
  return props.item;
9752
9778
  }
9753
9779
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
9754
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
9780
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
9755
9781
  });
9756
9782
  const isLoadingDynamicData = (id) => {
9757
9783
  return Boolean(props.element.dynamic && id && loading.value && (loadingIds == null ? void 0 : loadingIds.value[id]));
@@ -9968,7 +9994,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9968
9994
  ImageBadge: _sfc_main$11
9969
9995
  }
9970
9996
  };
9971
- const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$3), {
9997
+ const _sfc_main$10 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$3), {
9972
9998
  __name: "SearchResultsBadgeWrapper",
9973
9999
  props: {
9974
10000
  position: {},
@@ -9991,7 +10017,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
9991
10017
  return props.options.product;
9992
10018
  }
9993
10019
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.options.product) == null ? void 0 : _b.id]) != null ? _d : {};
9994
- return __spreadValues2(__spreadValues2({}, props.options.product), enhancementData);
10020
+ return __spreadValues(__spreadValues({}, props.options.product), enhancementData);
9995
10021
  });
9996
10022
  const badges = computed(() => {
9997
10023
  if (!props.options.elements) {
@@ -10002,7 +10028,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10002
10028
  return !e2.display || e2.display((_a = props.options.product) != null ? _a : {});
10003
10029
  }).map((x) => {
10004
10030
  var _a;
10005
- return __spreadProps2(__spreadValues2({}, x), {
10031
+ return __spreadProps(__spreadValues({}, x), {
10006
10032
  value: ((_a = enhancedProduct.value) == null ? void 0 : _a[x.key]) || "badge",
10007
10033
  product: enhancedProduct.value
10008
10034
  });
@@ -10069,7 +10095,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10069
10095
  return generateLink((_b = (_a = props.panelOptions.links) == null ? void 0 : _a.details) != null ? _b : "", props.item);
10070
10096
  });
10071
10097
  const badgeOptions = computed(() => {
10072
- return __spreadProps2(__spreadValues2({}, props.panelOptions.badges), { product: props.item });
10098
+ return __spreadProps(__spreadValues({}, props.panelOptions.badges), { product: props.item });
10073
10099
  });
10074
10100
  const imageElements = computed(() => {
10075
10101
  var _a, _b;
@@ -10208,8 +10234,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10208
10234
  const mappedItems = ((_e = trackingOptions.analytics) == null ? void 0 : _e.itemMap) ? items.map(trackingOptions.analytics.itemMap) : items;
10209
10235
  track(
10210
10236
  queryKey,
10211
- __spreadProps2(__spreadValues2({}, data), {
10212
- analytics: data.analytics ? __spreadProps2(__spreadValues2({}, data.analytics), { items: mappedItems }) : void 0,
10237
+ __spreadProps(__spreadValues({}, data), {
10238
+ analytics: data.analytics ? __spreadProps(__spreadValues({}, data.analytics), { items: mappedItems }) : void 0,
10213
10239
  filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
10214
10240
  }),
10215
10241
  options
@@ -10503,7 +10529,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10503
10529
  });
10504
10530
  const getItemsDebounced = debounce$1(getItems, props.debounce);
10505
10531
  const documentPanelOptions = computed(() => {
10506
- return __spreadProps2(__spreadValues2({}, props.panel), {
10532
+ return __spreadProps(__spreadValues({}, props.panel), {
10507
10533
  type: SearchBoxPanelType.DOCUMENT
10508
10534
  });
10509
10535
  });
@@ -10551,7 +10577,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10551
10577
  SearchBoxRelatedSourceWrapper: _sfc_main$X
10552
10578
  }
10553
10579
  };
10554
- const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$2), {
10580
+ const _sfc_main$W = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
10555
10581
  __name: "SearchBoxMainPanel",
10556
10582
  props: {
10557
10583
  options: {},
@@ -10863,7 +10889,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10863
10889
  const elementClass = (_b = (_a2 = e2.target) == null ? void 0 : _a2.className) != null ? _b : "";
10864
10890
  const hasLupaClass = typeof elementClass.includes == "function" && elementClass.includes("lupa-search-box");
10865
10891
  const isOutsideElement = el && !el.contains(e2.target) && !hasLupaClass;
10866
- if (!isOutsideElement) {
10892
+ if (!isOutsideElement || props.options.keepOpen) {
10867
10893
  return;
10868
10894
  }
10869
10895
  opened.value = false;
@@ -10882,7 +10908,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10882
10908
  case "Tab":
10883
10909
  if ((_b = (_a2 = suggestedValue == null ? void 0 : suggestedValue.value) == null ? void 0 : _a2.item) == null ? void 0 : _b.suggestion) {
10884
10910
  e2.preventDefault();
10885
- selectSuggestion(__spreadProps2(__spreadValues2({}, suggestedValue.value), { override: true }));
10911
+ selectSuggestion(__spreadProps(__spreadValues({}, suggestedValue.value), { override: true }));
10886
10912
  }
10887
10913
  break;
10888
10914
  case "Enter":
@@ -10931,7 +10957,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
10931
10957
  };
10932
10958
  const selectSuggestion = (inputSuggestion, shouldSearch = false) => {
10933
10959
  if (inputSuggestion.item.suggestion) {
10934
- suggestedValue.value = __spreadProps2(__spreadValues2({}, inputSuggestion), {
10960
+ suggestedValue.value = __spreadProps(__spreadValues({}, inputSuggestion), {
10935
10961
  override: true
10936
10962
  });
10937
10963
  if (inputSuggestion.override) {
@@ -11029,7 +11055,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11029
11055
  opened.value = false;
11030
11056
  };
11031
11057
  const slotProps = (props2) => {
11032
- return __spreadValues2({}, props2);
11058
+ return __spreadValues({}, props2);
11033
11059
  };
11034
11060
  return (_ctx, _cache) => {
11035
11061
  var _a2;
@@ -11117,8 +11143,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11117
11143
  return (page - 1) * limit;
11118
11144
  };
11119
11145
  const getPublicQuery = (publicQuery, initialFilters, isProductList) => {
11120
- return __spreadProps2(__spreadValues2({}, publicQuery), {
11121
- filters: __spreadValues2(__spreadValues2({}, initialFilters), publicQuery.filters),
11146
+ return __spreadProps(__spreadValues({}, publicQuery), {
11147
+ filters: __spreadValues(__spreadValues({}, initialFilters), publicQuery.filters),
11122
11148
  searchText: isProductList ? "" : publicQuery.searchText
11123
11149
  });
11124
11150
  };
@@ -11669,7 +11695,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11669
11695
  return searchResultStore.filterVisibleFilterValues(facet.value.key, (_b = (_a = facet.value) == null ? void 0 : _a.items) != null ? _b : []);
11670
11696
  });
11671
11697
  const displayValues = computed(() => {
11672
- return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps2(__spreadValues2({}, v), { title: getDisplayValue(v.title) }));
11698
+ return filteredValues.value.slice(0, itemLimit.value).map((v) => __spreadProps(__spreadValues({}, v), { title: getDisplayValue(v.title) }));
11673
11699
  });
11674
11700
  const filteredValues = computed(() => {
11675
11701
  var _a, _b;
@@ -12610,7 +12636,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12610
12636
  return e3 === r[t2];
12611
12637
  });
12612
12638
  }
12613
- var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps2(__spreadValues2({}, { value: { validator: function(e2) {
12639
+ var m = { name: "Slider", emits: ["input", "update:modelValue", "start", "slide", "drag", "update", "change", "set", "end"], props: __spreadProps(__spreadValues({}, { value: { validator: function(e2) {
12614
12640
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
12615
12641
  }, required: false }, modelValue: { validator: function(e2) {
12616
12642
  return (e3) => "number" == typeof e3 || e3 instanceof Array || null == e3 || false === e3;
@@ -12623,15 +12649,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12623
12649
  throw new Error("Slider v-model must not be an empty array");
12624
12650
  return { value: l2, initialValue: c3 };
12625
12651
  }(a), c2 = function(t, i, n) {
12626
- 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));
12652
+ 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));
12627
12653
  return { classList: computed(() => {
12628
- const e2 = __spreadValues2({}, u2.value);
12654
+ const e2 = __spreadValues({}, u2.value);
12629
12655
  return Object.keys(e2).forEach((t2) => {
12630
12656
  e2[t2] = Array.isArray(e2[t2]) ? e2[t2].filter((e3) => null !== e3).join(" ") : e2[t2];
12631
12657
  }), "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;
12632
12658
  }) };
12633
12659
  }(a), p2 = function(t, i, n) {
12634
- 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);
12660
+ 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);
12635
12661
  return { tooltipFormat: u2, tooltipsFormat: c3, tooltipsMerge: (e2, t2, r) => {
12636
12662
  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();
12637
12663
  a3.forEach(function(e3, t3) {
@@ -12724,7 +12750,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
12724
12750
  R(V.value);
12725
12751
  } };
12726
12752
  }(a, s, { value: l.value, initialValue: l.initialValue, tooltipFormat: p2.tooltipFormat, tooltipsFormat: p2.tooltipsFormat, tooltipsMerge: p2.tooltipsMerge, classList: c2.classList });
12727
- return __spreadValues2(__spreadValues2(__spreadValues2({}, c2), p2), m2);
12753
+ return __spreadValues(__spreadValues(__spreadValues({}, c2), p2), m2);
12728
12754
  } };
12729
12755
  m.render = function(e2, t, r, i, n, o) {
12730
12756
  return openBlock(), createElementBlock("div", mergeProps(e2.sliderProps, { ref: "slider" }), null, 16);
@@ -13181,7 +13207,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13181
13207
  HierarchyFacet: _sfc_main$K
13182
13208
  }
13183
13209
  };
13184
- const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__$1), {
13210
+ const _sfc_main$J = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
13185
13211
  __name: "FacetDisplay",
13186
13212
  props: {
13187
13213
  options: {},
@@ -13944,6 +13970,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13944
13970
  var _a, _b;
13945
13971
  return (_b = (_a = props.labels) == null ? void 0 : _a.pageSize) != null ? _b : "";
13946
13972
  });
13973
+ const sizes = computed(() => props.options.sizes);
13947
13974
  const handleSelect = (e2) => {
13948
13975
  const value = e2.target.value;
13949
13976
  paramsStore.appendParams({
@@ -13963,7 +13990,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
13963
13990
  ref_key: "select",
13964
13991
  ref: select
13965
13992
  }, [
13966
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options.sizes, (option) => {
13993
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sizes.value, (option) => {
13967
13994
  return openBlock(), createElementBlock("option", {
13968
13995
  key: option,
13969
13996
  value: option
@@ -14641,7 +14668,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14641
14668
  SearchResultsProductSingleStarRating: _sfc_main$m
14642
14669
  }
14643
14670
  };
14644
- const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValues2({}, __default__), {
14671
+ const _sfc_main$l = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
14645
14672
  __name: "SearchResultsProductCardElement",
14646
14673
  props: {
14647
14674
  item: {},
@@ -14686,7 +14713,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14686
14713
  return props.item;
14687
14714
  }
14688
14715
  const enhancementData = (_d = (_c = dynamicDataIdMap.value) == null ? void 0 : _c[(_b = props.item) == null ? void 0 : _b.id]) != null ? _d : {};
14689
- return __spreadValues2(__spreadValues2({}, props.item), enhancementData);
14716
+ return __spreadValues(__spreadValues({}, props.item), enhancementData);
14690
14717
  });
14691
14718
  const displayElement = computed(() => {
14692
14719
  return props.element.display ? props.element.display(enhancedItem.value) : true;
@@ -14745,7 +14772,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
14745
14772
  return layout.value === ResultsLayoutEnum.LIST && !props.isAdditionalPanel ? "lupa-search-result-product-contents-list" : "";
14746
14773
  });
14747
14774
  const badgesOptions = computed(() => {
14748
- return __spreadProps2(__spreadValues2({}, props.options.badges), { product: props.product });
14775
+ return __spreadProps(__spreadValues({}, props.options.badges), { product: props.product });
14749
14776
  });
14750
14777
  const imageElements = computed(() => {
14751
14778
  var _a, _b;
@@ -15068,7 +15095,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15068
15095
  };
15069
15096
  const handleQueryChange = () => {
15070
15097
  const context = getLupaTrackingContext();
15071
- const queryBody = __spreadProps2(__spreadValues2({}, context), {
15098
+ const queryBody = __spreadProps(__spreadValues({}, context), {
15072
15099
  limit: props.panel.totalCountLimit,
15073
15100
  searchText: query.value
15074
15101
  });
@@ -15549,7 +15576,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15549
15576
  window.addEventListener("resize", handleResize);
15550
15577
  yield redirectionStore.initiate(props.options.redirections, props.options.options);
15551
15578
  if (props.initialData) {
15552
- searchResultStore.add(__spreadValues2({}, props.initialData));
15579
+ searchResultStore.add(__spreadValues({}, props.initialData));
15553
15580
  }
15554
15581
  handleMounted();
15555
15582
  (_b = (_a = props.options.callbacks) == null ? void 0 : _a.onMounted) == null ? void 0 : _b.call(_a);
@@ -15602,7 +15629,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15602
15629
  });
15603
15630
  const context = getLupaTrackingContext();
15604
15631
  const limit = publicQuery.limit || defaultSearchResultPageSize.value;
15605
- const query2 = __spreadProps2(__spreadValues2(__spreadValues2({}, publicQuery), context), { limit });
15632
+ const query2 = __spreadProps(__spreadValues(__spreadValues({}, publicQuery), context), { limit });
15606
15633
  const redirectionApplied = redirectionStore.redirectOnKeywordIfConfigured(
15607
15634
  publicQuery.searchText,
15608
15635
  optionStore.searchResultsRoutingBehavior
@@ -15617,7 +15644,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15617
15644
  var _a, _b;
15618
15645
  if (res.success) {
15619
15646
  handleResults({ queryKey: props.options.queryKey, results: res });
15620
- searchResultStore.add(__spreadValues2({}, res));
15647
+ searchResultStore.add(__spreadValues({}, res));
15621
15648
  } else if ((_b = (_a = props.options) == null ? void 0 : _a.options) == null ? void 0 : _b.onError) {
15622
15649
  props.options.options.onError(res);
15623
15650
  }
@@ -15686,7 +15713,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15686
15713
  if (typeof window !== "undefined") {
15687
15714
  optionStore.setSearchResultOptions({ options: props.options });
15688
15715
  if (props.initialData) {
15689
- searchResultStore.add(__spreadValues2({}, props.initialData));
15716
+ searchResultStore.add(__spreadValues({}, props.initialData));
15690
15717
  }
15691
15718
  handleMounted();
15692
15719
  return;
@@ -15697,7 +15724,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15697
15724
  (_b = props.options.ssr) == null ? void 0 : _b.baseUrl
15698
15725
  );
15699
15726
  optionStore.setSearchResultOptions({ options: props.options });
15700
- searchResultStore.add(__spreadValues2({}, initialData));
15727
+ searchResultStore.add(__spreadValues({}, initialData));
15701
15728
  paramStore.add(parseParams(optionStore.getQueryParamName, searchParams), props.options.ssr);
15702
15729
  paramStore.setDefaultLimit(defaultSearchResultPageSize.value);
15703
15730
  handleResults({ queryKey: props.options.queryKey, results: initialData });
@@ -15835,8 +15862,8 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15835
15862
  const props = __props;
15836
15863
  const searchResults2 = ref(null);
15837
15864
  const componentOptions = computed(() => {
15838
- return __spreadProps2(__spreadValues2({}, props.options), {
15839
- filters: __spreadProps2(__spreadValues2({}, props.options.filters), {
15865
+ return __spreadProps(__spreadValues({}, props.options), {
15866
+ filters: __spreadProps(__spreadValues({}, props.options.filters), {
15840
15867
  categories: props.options.categories
15841
15868
  })
15842
15869
  });
@@ -15875,7 +15902,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
15875
15902
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15876
15903
  */
15877
15904
  lodash$1.exports;
15878
- (function(module2, exports3) {
15905
+ (function(module2, exports2) {
15879
15906
  (function() {
15880
15907
  var undefined$1;
15881
15908
  var VERSION = "4.17.21";
@@ -16203,7 +16230,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
16203
16230
  var freeGlobal = typeof commonjsGlobal$1 == "object" && commonjsGlobal$1 && commonjsGlobal$1.Object === Object && commonjsGlobal$1;
16204
16231
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
16205
16232
  var root = freeGlobal || freeSelf || Function("return this")();
16206
- var freeExports = exports3 && !exports3.nodeType && exports3;
16233
+ var freeExports = exports2 && !exports2.nodeType && exports2;
16207
16234
  var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
16208
16235
  var moduleExports = freeModule && freeModule.exports === freeExports;
16209
16236
  var freeProcess = moduleExports && freeGlobal.process;
@@ -22363,11 +22390,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22363
22390
  production: "https://api.lupasearch.com/v1/",
22364
22391
  staging: "https://api.staging.lupasearch.com/v1/"
22365
22392
  };
22366
- const defaultConfig = {
22393
+ const DEFAULT_REQUEST_CONFIG = {
22367
22394
  method: "POST",
22368
22395
  headers: { "Content-Type": "application/json" }
22369
22396
  };
22370
- const headers = defaultConfig.headers;
22397
+ const DEFAULT_HEADERS = DEFAULT_REQUEST_CONFIG.headers;
22371
22398
  const getApiUrl = (environment, customBaseUrl) => {
22372
22399
  if (customBaseUrl) {
22373
22400
  return customBaseUrl;
@@ -22379,13 +22406,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22379
22406
  const { environment, customBaseUrl } = options;
22380
22407
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22381
22408
  try {
22382
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22409
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22383
22410
  body: JSON.stringify(request),
22384
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22411
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22385
22412
  }));
22386
22413
  if (res.status < 400) {
22387
22414
  const data = yield res.json();
22388
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22415
+ return __spreadProps(__spreadValues({}, data), { success: true });
22389
22416
  }
22390
22417
  const errors = yield res.json();
22391
22418
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22402,14 +22429,14 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22402
22429
  try {
22403
22430
  const res = yield fetch(
22404
22431
  `${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives${model}`,
22405
- __spreadProps2(__spreadValues2({}, defaultConfig), {
22432
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22406
22433
  body: JSON.stringify(request),
22407
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22434
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22408
22435
  })
22409
22436
  );
22410
22437
  if (res.status < 400) {
22411
22438
  const data = yield res.json();
22412
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22439
+ return __spreadProps(__spreadValues({}, data), { success: true });
22413
22440
  }
22414
22441
  const errors = yield res.json();
22415
22442
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22424,13 +22451,13 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22424
22451
  const { environment, customBaseUrl } = options;
22425
22452
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22426
22453
  try {
22427
- const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22454
+ const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22428
22455
  body: JSON.stringify(request),
22429
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22456
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22430
22457
  }));
22431
22458
  if (res.status < 400) {
22432
22459
  const data = yield res.json();
22433
- return __spreadProps2(__spreadValues2({}, data), { success: true });
22460
+ return __spreadProps(__spreadValues({}, data), { success: true });
22434
22461
  }
22435
22462
  const errors = yield res.json();
22436
22463
  (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
@@ -22464,9 +22491,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22464
22491
  const getTextResponseChunkStream = (options, request, onChunkReceived, chatSettings) => {
22465
22492
  var _a;
22466
22493
  const model = (chatSettings == null ? void 0 : chatSettings.model) ? `?model=${chatSettings.model}` : ``;
22467
- fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps2(__spreadValues2({}, defaultConfig), {
22494
+ fetch(`${getApiUrl(options.environment, options.customBaseUrl)}chat/text${model}`, __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22468
22495
  body: JSON.stringify(request),
22469
- headers: __spreadValues2(__spreadValues2({}, headers), (_a = options.customHeaders) != null ? _a : {})
22496
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22470
22497
  })).then((response) => {
22471
22498
  const reader = response.body.getReader();
22472
22499
  return reader.read().then(function processStream({ done, value }) {
@@ -22858,7 +22885,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22858
22885
  }
22859
22886
  const validPhrases = phrases.filter((p2) => (p2 == null ? void 0 : p2.trim().length) > 0);
22860
22887
  chatContent.value = chatContent.value.map(
22861
- (c2) => c2.key === key ? __spreadProps2(__spreadValues2({}, c2), {
22888
+ (c2) => c2.key === key ? __spreadProps(__spreadValues({}, c2), {
22862
22889
  allPhrases: [...validPhrases],
22863
22890
  suggestedPhrases: phrases
22864
22891
  }) : c2
@@ -22895,6 +22922,29 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22895
22922
  };
22896
22923
  }
22897
22924
  });
22925
+ const fetchPluginConfiguration = (options, configurationKey) => __async(void 0, null, function* () {
22926
+ var _a, _b, _c;
22927
+ const { environment, customBaseUrl } = options;
22928
+ try {
22929
+ const res = yield fetch(
22930
+ `${getApiUrl(environment, customBaseUrl)}plugin/configurations/${configurationKey}`,
22931
+ __spreadProps(__spreadValues({}, DEFAULT_REQUEST_CONFIG), {
22932
+ method: "GET",
22933
+ headers: __spreadValues(__spreadValues({}, DEFAULT_HEADERS), (_a = options.customHeaders) != null ? _a : {})
22934
+ })
22935
+ );
22936
+ if (res.status < 400) {
22937
+ const data = yield res.json();
22938
+ return __spreadValues({}, data);
22939
+ }
22940
+ const errors = yield res.json();
22941
+ (_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, errors);
22942
+ return null;
22943
+ } catch (e2) {
22944
+ (_c = options == null ? void 0 : options.onError) == null ? void 0 : _c.call(options, e2);
22945
+ return null;
22946
+ }
22947
+ });
22898
22948
  let piniaInstance = null;
22899
22949
  const initPinia = () => {
22900
22950
  if (piniaInstance) {
@@ -22910,225 +22960,570 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
22910
22960
  initTracking(options);
22911
22961
  store.setTrackingOptions({ options });
22912
22962
  };
22913
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
22914
- var lodash = { exports: {} };
22915
- /**
22916
- * @license
22917
- * Lodash <https://lodash.com/>
22918
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
22919
- * Released under MIT license <https://lodash.com/license>
22920
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
22921
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
22922
- */
22923
- lodash.exports;
22924
- (function(module2, exports3) {
22925
- (function() {
22926
- var undefined$1;
22927
- var VERSION = "4.17.21";
22928
- var LARGE_ARRAY_SIZE = 200;
22929
- 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`";
22930
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
22931
- var MAX_MEMOIZE_SIZE = 500;
22932
- var PLACEHOLDER = "__lodash_placeholder__";
22933
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
22934
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
22935
- 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;
22936
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
22937
- var HOT_COUNT = 800, HOT_SPAN = 16;
22938
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
22939
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
22940
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
22941
- var wrapFlags = [
22942
- ["ary", WRAP_ARY_FLAG],
22943
- ["bind", WRAP_BIND_FLAG],
22944
- ["bindKey", WRAP_BIND_KEY_FLAG],
22945
- ["curry", WRAP_CURRY_FLAG],
22946
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
22947
- ["flip", WRAP_FLIP_FLAG],
22948
- ["partial", WRAP_PARTIAL_FLAG],
22949
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
22950
- ["rearg", WRAP_REARG_FLAG]
22951
- ];
22952
- 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]";
22953
- 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]";
22954
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
22955
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
22956
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
22957
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
22958
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
22959
- var reTrimStart = /^\s+/;
22960
- var reWhitespace = /\s/;
22961
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
22962
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
22963
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
22964
- var reEscapeChar = /\\(\\)?/g;
22965
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
22966
- var reFlags = /\w*$/;
22967
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
22968
- var reIsBinary = /^0b[01]+$/i;
22969
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
22970
- var reIsOctal = /^0o[0-7]+$/i;
22971
- var reIsUint = /^(?:0|[1-9]\d*)$/;
22972
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
22973
- var reNoMatch = /($^)/;
22974
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
22975
- 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;
22976
- 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";
22977
- 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("|") + ")";
22978
- var reApos = RegExp(rsApos, "g");
22979
- var reComboMark = RegExp(rsCombo, "g");
22980
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
22981
- var reUnicodeWord = RegExp([
22982
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
22983
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
22984
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
22985
- rsUpper + "+" + rsOptContrUpper,
22986
- rsOrdUpper,
22987
- rsOrdLower,
22988
- rsDigits,
22989
- rsEmoji
22990
- ].join("|"), "g");
22991
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
22992
- 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 ]/;
22993
- var contextProps = [
22994
- "Array",
22995
- "Buffer",
22996
- "DataView",
22997
- "Date",
22998
- "Error",
22999
- "Float32Array",
23000
- "Float64Array",
23001
- "Function",
23002
- "Int8Array",
23003
- "Int16Array",
23004
- "Int32Array",
23005
- "Map",
23006
- "Math",
23007
- "Object",
23008
- "Promise",
23009
- "RegExp",
23010
- "Set",
23011
- "String",
23012
- "Symbol",
23013
- "TypeError",
23014
- "Uint8Array",
23015
- "Uint8ClampedArray",
23016
- "Uint16Array",
23017
- "Uint32Array",
23018
- "WeakMap",
23019
- "_",
23020
- "clearTimeout",
23021
- "isFinite",
23022
- "parseInt",
23023
- "setTimeout"
23024
- ];
23025
- var templateCounter = -1;
23026
- var typedArrayTags = {};
23027
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
23028
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
23029
- var cloneableTags = {};
23030
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
23031
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
23032
- var deburredLetters = {
23033
- // Latin-1 Supplement block.
23034
- "À": "A",
23035
- "Á": "A",
23036
- "Â": "A",
23037
- "Ã": "A",
23038
- "Ä": "A",
23039
- "Å": "A",
23040
- "à": "a",
23041
- "á": "a",
23042
- "â": "a",
23043
- "ã": "a",
23044
- "ä": "a",
23045
- "å": "a",
23046
- "Ç": "C",
23047
- "ç": "c",
23048
- "Ð": "D",
23049
- "ð": "d",
23050
- "È": "E",
23051
- "É": "E",
23052
- "Ê": "E",
23053
- "Ë": "E",
23054
- "è": "e",
23055
- "é": "e",
23056
- "ê": "e",
23057
- "ë": "e",
23058
- "Ì": "I",
23059
- "Í": "I",
23060
- "Î": "I",
23061
- "Ï": "I",
23062
- "ì": "i",
23063
- "í": "i",
23064
- "î": "i",
23065
- "ï": "i",
23066
- "Ñ": "N",
23067
- "ñ": "n",
23068
- "Ò": "O",
23069
- "Ó": "O",
23070
- "Ô": "O",
23071
- "Õ": "O",
23072
- "Ö": "O",
23073
- "Ø": "O",
23074
- "ò": "o",
23075
- "ó": "o",
23076
- "ô": "o",
23077
- "õ": "o",
23078
- "ö": "o",
23079
- "ø": "o",
23080
- "Ù": "U",
23081
- "Ú": "U",
23082
- "Û": "U",
23083
- "Ü": "U",
23084
- "ù": "u",
23085
- "ú": "u",
23086
- "û": "u",
23087
- "ü": "u",
23088
- "Ý": "Y",
23089
- "ý": "y",
23090
- "ÿ": "y",
23091
- "Æ": "Ae",
23092
- "æ": "ae",
23093
- "Þ": "Th",
23094
- "þ": "th",
23095
- "ß": "ss",
23096
- // Latin Extended-A block.
23097
- "Ā": "A",
23098
- "Ă": "A",
23099
- "Ą": "A",
23100
- "ā": "a",
23101
- "ă": "a",
23102
- "ą": "a",
23103
- "Ć": "C",
23104
- "Ĉ": "C",
23105
- "Ċ": "C",
23106
- "Č": "C",
23107
- "ć": "c",
23108
- "ĉ": "c",
23109
- "ċ": "c",
23110
- "č": "c",
23111
- "Ď": "D",
23112
- "Đ": "D",
23113
- "ď": "d",
23114
- "đ": "d",
23115
- "Ē": "E",
23116
- "Ĕ": "E",
23117
- "Ė": "E",
23118
- "Ę": "E",
23119
- "Ě": "E",
23120
- "ē": "e",
23121
- "ĕ": "e",
23122
- "ė": "e",
23123
- "ę": "e",
23124
- "ě": "e",
23125
- "Ĝ": "G",
23126
- "Ğ": "G",
23127
- "Ġ": "G",
23128
- "Ģ": "G",
23129
- "ĝ": "g",
23130
- "ğ": "g",
23131
- "ġ": "g",
22963
+ const displayDiscountedPriceSection = (doc2, options) => {
22964
+ var _a, _b;
22965
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22966
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22967
+ return discountPrice && regularPrice && discountPrice < regularPrice;
22968
+ };
22969
+ const displayRegularPriceSection = (doc2, options) => {
22970
+ var _a, _b;
22971
+ const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
22972
+ const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
22973
+ const anyPrice = discountPrice || regularPrice;
22974
+ return anyPrice && !displayDiscountedPriceSection(doc2, options);
22975
+ };
22976
+ const escapeHtml = (source) => {
22977
+ if (!source) {
22978
+ return source;
22979
+ }
22980
+ return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
22981
+ };
22982
+ const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
22983
+ if (!value) {
22984
+ return 0;
22985
+ }
22986
+ try {
22987
+ return +parseFloat(`${value}`).toFixed(maxDecimal);
22988
+ } catch (e2) {
22989
+ return `${value}`;
22990
+ }
22991
+ };
22992
+ const capitalize = (value) => {
22993
+ if (!value) {
22994
+ return "";
22995
+ }
22996
+ return value.charAt(0).toLocaleUpperCase() + value.slice(1);
22997
+ };
22998
+ const getAlphanumeric = (value) => {
22999
+ if (!value) {
23000
+ return "";
23001
+ }
23002
+ return value.replace(/[\W_]/g, " ");
23003
+ };
23004
+ const getAdditionalElements = (fields) => {
23005
+ return fields.map((key) => ({
23006
+ type: "custom",
23007
+ key,
23008
+ label: capitalize(getAlphanumeric(key)),
23009
+ className: "lupa-custom",
23010
+ display: (doc2) => Boolean(doc2[key])
23011
+ }));
23012
+ };
23013
+ const addFieldIfKeyExists = (field, key, config) => {
23014
+ if (key) {
23015
+ return config;
23016
+ }
23017
+ return { key: field, type: "customHtml", display: () => false };
23018
+ };
23019
+ const getSearchBoxComponent = ({
23020
+ searchBoxOptions,
23021
+ labels,
23022
+ panelOptions,
23023
+ redirections,
23024
+ placeholderImage
23025
+ }) => {
23026
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
23027
+ const panels = [
23028
+ ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
23029
+ {
23030
+ type: SearchBoxPanelType.SUGGESTION,
23031
+ queryKey: searchBoxOptions.suggestionQueryKey,
23032
+ highlight: true,
23033
+ limit: 8,
23034
+ labels: {
23035
+ topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
23036
+ }
23037
+ }
23038
+ ] : [],
23039
+ ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
23040
+ {
23041
+ type: SearchBoxPanelType.DOCUMENT,
23042
+ queryKey: searchBoxOptions.documentQueryKey,
23043
+ limit: 5,
23044
+ elements: [
23045
+ {
23046
+ type: "image",
23047
+ placeholder: placeholderImage,
23048
+ key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
23049
+ baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
23050
+ },
23051
+ {
23052
+ type: "title",
23053
+ key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
23054
+ maxLines: 2
23055
+ },
23056
+ {
23057
+ type: "regularPrice",
23058
+ key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
23059
+ display: (doc2) => {
23060
+ var _a2, _b2, _c2, _d2;
23061
+ 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]);
23062
+ }
23063
+ },
23064
+ {
23065
+ type: "price",
23066
+ key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
23067
+ }
23068
+ ]
23069
+ }
23070
+ ] : []
23071
+ ];
23072
+ return {
23073
+ inputSelector: searchBoxOptions.inputSelector,
23074
+ options: {
23075
+ environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
23076
+ customUrl: searchBoxOptions.customUrl,
23077
+ customBaseUrl: searchBoxOptions.customBaseUrl,
23078
+ customPayload: searchBoxOptions.customPayload,
23079
+ customHeaders: searchBoxOptions.customHeaders
23080
+ },
23081
+ showTotalCount: true,
23082
+ expandOnSinglePanel: true,
23083
+ minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
23084
+ debounce: 250,
23085
+ labels: labels == null ? void 0 : labels.searchBox,
23086
+ links: {
23087
+ searchResults: ""
23088
+ },
23089
+ panels,
23090
+ redirections,
23091
+ history: {
23092
+ labels: {
23093
+ clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
23094
+ }
23095
+ }
23096
+ };
23097
+ };
23098
+ const getSearchResultsComponent = ({
23099
+ searchResultOptions,
23100
+ labels,
23101
+ redirections,
23102
+ placeholderImage,
23103
+ configuratorOverrides,
23104
+ callbacks,
23105
+ additionalFields
23106
+ }) => {
23107
+ 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;
23108
+ const filters = searchResultOptions.showFacets ? {
23109
+ currentFilters: {
23110
+ visibility: {
23111
+ mobileSidebar: true,
23112
+ mobileToolbar: true
23113
+ },
23114
+ labels: {
23115
+ title: "",
23116
+ clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
23117
+ }
23118
+ },
23119
+ facets: {
23120
+ labels: {
23121
+ title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
23122
+ showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
23123
+ facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
23124
+ facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
23125
+ },
23126
+ filterable: {
23127
+ minValues: 5
23128
+ },
23129
+ hierarchy: {
23130
+ maxInitialLevel: 2,
23131
+ topLevelValueCountLimit: 5,
23132
+ filterable: true
23133
+ },
23134
+ stats: {
23135
+ slider: true,
23136
+ inputs: true,
23137
+ labels: {
23138
+ from: "",
23139
+ to: ""
23140
+ }
23141
+ },
23142
+ facetValueCountLimit: 8,
23143
+ showDocumentCount: true,
23144
+ style: {
23145
+ type: "sidebar"
23146
+ }
23147
+ }
23148
+ } : {};
23149
+ const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
23150
+ xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
23151
+ l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
23152
+ md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
23153
+ sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
23154
+ xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
23155
+ };
23156
+ const badges = {
23157
+ badges: {
23158
+ anchor: "tr",
23159
+ elements: [
23160
+ ...searchResultOptions.showRelevance ? [
23161
+ {
23162
+ key: "",
23163
+ type: "customHtml",
23164
+ className: "relevance",
23165
+ html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
23166
+ display: (doc2) => Boolean(doc2._relevance !== void 0)
23167
+ }
23168
+ ] : [],
23169
+ ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
23170
+ {
23171
+ key: "",
23172
+ type: "customHtml",
23173
+ className: "boosted-marker",
23174
+ html: () => {
23175
+ var _a2;
23176
+ return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
23177
+ },
23178
+ display: (doc2) => doc2._boosted === true
23179
+ }
23180
+ ] : []
23181
+ ]
23182
+ }
23183
+ };
23184
+ return __spreadValues2(__spreadProps2(__spreadValues2({
23185
+ options: {
23186
+ environment: (_m = searchResultOptions.environment) != null ? _m : "production",
23187
+ customUrl: searchResultOptions.customUrl,
23188
+ customBaseUrl: searchResultOptions.customBaseUrl,
23189
+ customPayload: searchResultOptions.customPayload,
23190
+ customHeaders: searchResultOptions.customHeaders,
23191
+ onError: searchResultOptions.errorHandler
23192
+ },
23193
+ queryKey: searchResultOptions.queryKey,
23194
+ containerSelector: searchResultOptions.containerSelector,
23195
+ searchTitlePosition: "search-results-top",
23196
+ titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
23197
+ labels: labels == null ? void 0 : labels.searchResults,
23198
+ grid: {
23199
+ columns
23200
+ },
23201
+ pagination: {
23202
+ sizeSelection: {
23203
+ position: {
23204
+ top: true,
23205
+ bottom: false
23206
+ },
23207
+ sizes: [12, 24, 36, 48]
23208
+ },
23209
+ pageSelection: {
23210
+ position: {
23211
+ top: false,
23212
+ bottom: true
23213
+ },
23214
+ displayMobile: 3,
23215
+ display: 5
23216
+ }
23217
+ },
23218
+ filters,
23219
+ toolbar: {
23220
+ layoutSelector: false,
23221
+ itemSummary: true,
23222
+ clearFilters: false
23223
+ },
23224
+ isInStock: () => {
23225
+ return true;
23226
+ }
23227
+ }, badges), {
23228
+ links: {
23229
+ details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
23230
+ },
23231
+ callbacks,
23232
+ routingBehavior: callbacks ? "event" : "direct-link",
23233
+ idKey: "id",
23234
+ elements: [
23235
+ {
23236
+ type: "image",
23237
+ placeholder: placeholderImage,
23238
+ key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
23239
+ baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
23240
+ display: () => {
23241
+ var _a2;
23242
+ return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
23243
+ }
23244
+ },
23245
+ addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
23246
+ type: "custom",
23247
+ className: "lupa-custom-emphasis",
23248
+ key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
23249
+ display: () => true
23250
+ }),
23251
+ {
23252
+ type: "title",
23253
+ key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
23254
+ maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
23255
+ display: (doc2) => {
23256
+ var _a2, _b2;
23257
+ return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
23258
+ }
23259
+ },
23260
+ ...getAdditionalElements(additionalFields),
23261
+ addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
23262
+ key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
23263
+ type: "customHtml",
23264
+ className: "lupa-price lupa-price-discounted",
23265
+ display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
23266
+ html: (doc2) => {
23267
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23268
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23269
+ const discountPrice = (_d2 = parseFloat(
23270
+ doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
23271
+ )) == null ? void 0 : _d2.toFixed(2);
23272
+ const regularPrice = (_g2 = parseFloat(
23273
+ doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
23274
+ )) == null ? void 0 : _g2.toFixed(2);
23275
+ const discount = `<span class="lupa-discount">${escapeHtml(
23276
+ discountPrice
23277
+ )} ${currency}</span>`;
23278
+ const regular = `<span class="lupa-regular">${escapeHtml(
23279
+ regularPrice
23280
+ )} ${currency}</span>`;
23281
+ return discount + regular;
23282
+ }
23283
+ }),
23284
+ addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
23285
+ key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
23286
+ type: "customHtml",
23287
+ className: "lupa-price lupa-price-single",
23288
+ display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
23289
+ html: (doc2) => {
23290
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
23291
+ const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
23292
+ const price = (_g2 = parseFloat(
23293
+ (_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 : ""]
23294
+ )) == null ? void 0 : _g2.toFixed(2);
23295
+ return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
23296
+ }
23297
+ })
23298
+ ],
23299
+ breadcrumbs: [],
23300
+ sort: [],
23301
+ redirections
23302
+ }), configuratorOverrides);
23303
+ };
23304
+ const SearchContainerConfigurationService = {
23305
+ getSearchBoxComponent,
23306
+ getSearchResultsComponent
23307
+ };
23308
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
23309
+ var lodash = { exports: {} };
23310
+ /**
23311
+ * @license
23312
+ * Lodash <https://lodash.com/>
23313
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
23314
+ * Released under MIT license <https://lodash.com/license>
23315
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23316
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
23317
+ */
23318
+ lodash.exports;
23319
+ (function(module2, exports2) {
23320
+ (function() {
23321
+ var undefined$1;
23322
+ var VERSION = "4.17.21";
23323
+ var LARGE_ARRAY_SIZE = 200;
23324
+ 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`";
23325
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
23326
+ var MAX_MEMOIZE_SIZE = 500;
23327
+ var PLACEHOLDER = "__lodash_placeholder__";
23328
+ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
23329
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
23330
+ 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;
23331
+ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
23332
+ var HOT_COUNT = 800, HOT_SPAN = 16;
23333
+ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
23334
+ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
23335
+ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
23336
+ var wrapFlags = [
23337
+ ["ary", WRAP_ARY_FLAG],
23338
+ ["bind", WRAP_BIND_FLAG],
23339
+ ["bindKey", WRAP_BIND_KEY_FLAG],
23340
+ ["curry", WRAP_CURRY_FLAG],
23341
+ ["curryRight", WRAP_CURRY_RIGHT_FLAG],
23342
+ ["flip", WRAP_FLIP_FLAG],
23343
+ ["partial", WRAP_PARTIAL_FLAG],
23344
+ ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
23345
+ ["rearg", WRAP_REARG_FLAG]
23346
+ ];
23347
+ 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]";
23348
+ 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]";
23349
+ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
23350
+ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
23351
+ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
23352
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
23353
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
23354
+ var reTrimStart = /^\s+/;
23355
+ var reWhitespace = /\s/;
23356
+ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
23357
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
23358
+ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
23359
+ var reEscapeChar = /\\(\\)?/g;
23360
+ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
23361
+ var reFlags = /\w*$/;
23362
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
23363
+ var reIsBinary = /^0b[01]+$/i;
23364
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23365
+ var reIsOctal = /^0o[0-7]+$/i;
23366
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
23367
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
23368
+ var reNoMatch = /($^)/;
23369
+ var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
23370
+ 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;
23371
+ 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";
23372
+ 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("|") + ")";
23373
+ var reApos = RegExp(rsApos, "g");
23374
+ var reComboMark = RegExp(rsCombo, "g");
23375
+ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
23376
+ var reUnicodeWord = RegExp([
23377
+ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
23378
+ rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
23379
+ rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
23380
+ rsUpper + "+" + rsOptContrUpper,
23381
+ rsOrdUpper,
23382
+ rsOrdLower,
23383
+ rsDigits,
23384
+ rsEmoji
23385
+ ].join("|"), "g");
23386
+ var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
23387
+ 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 ]/;
23388
+ var contextProps = [
23389
+ "Array",
23390
+ "Buffer",
23391
+ "DataView",
23392
+ "Date",
23393
+ "Error",
23394
+ "Float32Array",
23395
+ "Float64Array",
23396
+ "Function",
23397
+ "Int8Array",
23398
+ "Int16Array",
23399
+ "Int32Array",
23400
+ "Map",
23401
+ "Math",
23402
+ "Object",
23403
+ "Promise",
23404
+ "RegExp",
23405
+ "Set",
23406
+ "String",
23407
+ "Symbol",
23408
+ "TypeError",
23409
+ "Uint8Array",
23410
+ "Uint8ClampedArray",
23411
+ "Uint16Array",
23412
+ "Uint32Array",
23413
+ "WeakMap",
23414
+ "_",
23415
+ "clearTimeout",
23416
+ "isFinite",
23417
+ "parseInt",
23418
+ "setTimeout"
23419
+ ];
23420
+ var templateCounter = -1;
23421
+ var typedArrayTags = {};
23422
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
23423
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
23424
+ var cloneableTags = {};
23425
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
23426
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
23427
+ var deburredLetters = {
23428
+ // Latin-1 Supplement block.
23429
+ "À": "A",
23430
+ "Á": "A",
23431
+ "Â": "A",
23432
+ "Ã": "A",
23433
+ "Ä": "A",
23434
+ "Å": "A",
23435
+ "à": "a",
23436
+ "á": "a",
23437
+ "â": "a",
23438
+ "ã": "a",
23439
+ "ä": "a",
23440
+ "å": "a",
23441
+ "Ç": "C",
23442
+ "ç": "c",
23443
+ "Ð": "D",
23444
+ "ð": "d",
23445
+ "È": "E",
23446
+ "É": "E",
23447
+ "Ê": "E",
23448
+ "Ë": "E",
23449
+ "è": "e",
23450
+ "é": "e",
23451
+ "ê": "e",
23452
+ "ë": "e",
23453
+ "Ì": "I",
23454
+ "Í": "I",
23455
+ "Î": "I",
23456
+ "Ï": "I",
23457
+ "ì": "i",
23458
+ "í": "i",
23459
+ "î": "i",
23460
+ "ï": "i",
23461
+ "Ñ": "N",
23462
+ "ñ": "n",
23463
+ "Ò": "O",
23464
+ "Ó": "O",
23465
+ "Ô": "O",
23466
+ "Õ": "O",
23467
+ "Ö": "O",
23468
+ "Ø": "O",
23469
+ "ò": "o",
23470
+ "ó": "o",
23471
+ "ô": "o",
23472
+ "õ": "o",
23473
+ "ö": "o",
23474
+ "ø": "o",
23475
+ "Ù": "U",
23476
+ "Ú": "U",
23477
+ "Û": "U",
23478
+ "Ü": "U",
23479
+ "ù": "u",
23480
+ "ú": "u",
23481
+ "û": "u",
23482
+ "ü": "u",
23483
+ "Ý": "Y",
23484
+ "ý": "y",
23485
+ "ÿ": "y",
23486
+ "Æ": "Ae",
23487
+ "æ": "ae",
23488
+ "Þ": "Th",
23489
+ "þ": "th",
23490
+ "ß": "ss",
23491
+ // Latin Extended-A block.
23492
+ "Ā": "A",
23493
+ "Ă": "A",
23494
+ "Ą": "A",
23495
+ "ā": "a",
23496
+ "ă": "a",
23497
+ "ą": "a",
23498
+ "Ć": "C",
23499
+ "Ĉ": "C",
23500
+ "Ċ": "C",
23501
+ "Č": "C",
23502
+ "ć": "c",
23503
+ "ĉ": "c",
23504
+ "ċ": "c",
23505
+ "č": "c",
23506
+ "Ď": "D",
23507
+ "Đ": "D",
23508
+ "ď": "d",
23509
+ "đ": "d",
23510
+ "Ē": "E",
23511
+ "Ĕ": "E",
23512
+ "Ė": "E",
23513
+ "Ę": "E",
23514
+ "Ě": "E",
23515
+ "ē": "e",
23516
+ "ĕ": "e",
23517
+ "ė": "e",
23518
+ "ę": "e",
23519
+ "ě": "e",
23520
+ "Ĝ": "G",
23521
+ "Ğ": "G",
23522
+ "Ġ": "G",
23523
+ "Ģ": "G",
23524
+ "ĝ": "g",
23525
+ "ğ": "g",
23526
+ "ġ": "g",
23132
23527
  "ģ": "g",
23133
23528
  "Ĥ": "H",
23134
23529
  "Ħ": "H",
@@ -23249,7 +23644,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
23249
23644
  var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
23250
23645
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
23251
23646
  var root = freeGlobal || freeSelf || Function("return this")();
23252
- var freeExports = exports3 && !exports3.nodeType && exports3;
23647
+ var freeExports = exports2 && !exports2.nodeType && exports2;
23253
23648
  var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
23254
23649
  var moduleExports = freeModule && freeModule.exports === freeExports;
23255
23650
  var freeProcess = moduleExports && freeGlobal.process;
@@ -28388,546 +28783,150 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28388
28783
  (freeModule.exports = _)._ = _;
28389
28784
  freeExports._ = _;
28390
28785
  } else {
28391
- root._ = _;
28392
- }
28393
- }).call(commonjsGlobal);
28394
- })(lodash, lodash.exports);
28395
- var lodashExports = lodash.exports;
28396
- const DEFAULT_SEARCH_BOX_OPTIONS = {
28397
- inputSelector: "#searchBox",
28398
- options: {
28399
- environment: "production"
28400
- },
28401
- showTotalCount: false,
28402
- minInputLength: 1,
28403
- inputAttributes: {
28404
- name: "q"
28405
- },
28406
- debounce: 0,
28407
- labels: {
28408
- placeholder: "Search for products...",
28409
- noResults: "There are no results found.",
28410
- moreResults: "Show more results",
28411
- currency: "€",
28412
- defaultFacetLabel: "Category:"
28413
- },
28414
- links: {
28415
- searchResults: "/search"
28416
- },
28417
- panels: [
28418
- {
28419
- type: "suggestion",
28420
- queryKey: "",
28421
- highlight: true,
28422
- limit: 5
28423
- },
28424
- {
28425
- type: "document",
28426
- queryKey: "",
28427
- limit: 5,
28428
- searchBySuggestion: false,
28429
- links: {
28430
- details: "{url}"
28431
- },
28432
- titleKey: "name",
28433
- elements: []
28434
- }
28435
- ],
28436
- history: {
28437
- labels: {
28438
- clear: "Clear History"
28439
- }
28440
- }
28441
- };
28442
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28443
- __name: "SearchBoxEntry",
28444
- props: {
28445
- searchBoxOptions: {}
28446
- },
28447
- setup(__props, { expose: __expose }) {
28448
- const props = __props;
28449
- const searchBox2 = ref(null);
28450
- const fullSearchBoxOptions = computed(() => {
28451
- const options = lodashExports.cloneDeep(props.searchBoxOptions);
28452
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28453
- });
28454
- const fetch2 = () => {
28455
- var _a;
28456
- (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28457
- };
28458
- __expose({ fetch: fetch2 });
28459
- return (_ctx, _cache) => {
28460
- return openBlock(), createBlock(unref(_sfc_main$V), {
28461
- options: fullSearchBoxOptions.value,
28462
- ref_key: "searchBox",
28463
- ref: searchBox2
28464
- }, null, 8, ["options"]);
28465
- };
28466
- }
28467
- });
28468
- const DEFAULT_OPTIONS_RESULTS = {
28786
+ root._ = _;
28787
+ }
28788
+ }).call(commonjsGlobal);
28789
+ })(lodash, lodash.exports);
28790
+ var lodashExports = lodash.exports;
28791
+ const DEFAULT_SEARCH_BOX_OPTIONS = {
28792
+ inputSelector: "#searchBox",
28469
28793
  options: {
28470
28794
  environment: "production"
28471
28795
  },
28472
- queryKey: "",
28473
- containerSelector: "#searchResultsContainer",
28474
- searchTitlePosition: "page-top",
28796
+ showTotalCount: false,
28797
+ minInputLength: 1,
28798
+ inputAttributes: {
28799
+ name: "q"
28800
+ },
28801
+ debounce: 0,
28475
28802
  labels: {
28476
- pageSize: "Page size:",
28477
- sortBy: "Sort by:",
28478
- itemCount: "Items {1} of {2}",
28479
- filteredItemCount: "",
28803
+ placeholder: "Search for products...",
28804
+ noResults: "There are no results found.",
28805
+ moreResults: "Show more results",
28480
28806
  currency: "€",
28481
- showMore: "Show more",
28482
- searchResults: "Search Query: ",
28483
- emptyResults: "There are no results for the query:",
28484
- mobileFilterButton: "Filter",
28485
- htmlTitleTemplate: "Search Query: '{1}'",
28486
- noResultsSuggestion: "No results found for this query: {1}",
28487
- didYouMean: "Did you mean to search: {1}",
28488
- similarQuery: "Search results for phrase {1}",
28489
- similarQueries: "Similar queries:"
28490
- },
28491
- grid: {
28492
- columns: {
28493
- xl: 4,
28494
- l: 3,
28495
- md: 2,
28496
- sm: 2,
28497
- xs: 1
28498
- }
28807
+ defaultFacetLabel: "Category:"
28499
28808
  },
28500
- pagination: {
28501
- sizeSelection: {
28502
- position: {
28503
- top: false,
28504
- bottom: true
28505
- },
28506
- sizes: [12, 24, 36]
28507
- },
28508
- pageSelection: {
28509
- position: {
28510
- top: false,
28511
- bottom: true
28512
- },
28513
- display: 5,
28514
- displayMobile: 3
28515
- }
28809
+ links: {
28810
+ searchResults: "/search"
28516
28811
  },
28517
- sort: [],
28518
- filters: {
28519
- currentFilters: {
28520
- visibility: {
28521
- mobileSidebar: true,
28522
- mobileToolbar: true
28523
- },
28524
- labels: {
28525
- title: "Current filters:",
28526
- clearAll: "Clear all"
28527
- }
28812
+ panels: [
28813
+ {
28814
+ type: "suggestion",
28815
+ queryKey: "",
28816
+ highlight: true,
28817
+ limit: 5
28528
28818
  },
28529
- facets: {
28530
- labels: {
28531
- title: "Filters:",
28532
- showAll: "Show more",
28533
- facetFilter: "Filter...",
28534
- facetClear: "Clear"
28535
- },
28536
- filterable: {
28537
- minValues: 5
28538
- },
28539
- hierarchy: {
28540
- maxInitialLevel: 2,
28541
- topLevelValueCountLimit: 5,
28542
- filterable: true
28819
+ {
28820
+ type: "document",
28821
+ queryKey: "",
28822
+ limit: 5,
28823
+ searchBySuggestion: false,
28824
+ links: {
28825
+ details: "{url}"
28543
28826
  },
28544
- facetValueCountLimit: 20,
28545
- showDocumentCount: true,
28546
- style: {
28547
- type: "sidebar"
28548
- }
28549
- }
28550
- },
28551
- toolbar: {
28552
- layoutSelector: true,
28553
- itemSummary: true,
28554
- clearFilters: false
28555
- },
28556
- isInStock: () => {
28557
- return true;
28558
- },
28559
- badges: {
28560
- anchor: "tr",
28561
- elements: []
28562
- },
28563
- links: {
28564
- details: "/{id}"
28565
- },
28566
- elements: [],
28567
- breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28568
- };
28569
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28570
- __name: "SearchResultsEntry",
28571
- props: {
28572
- searchResultsOptions: {}
28573
- },
28574
- setup(__props, { expose: __expose }) {
28575
- const props = __props;
28576
- const searchResults2 = ref(null);
28577
- const fullSearchResultsOptions = computed(() => {
28578
- const options = lodashExports.cloneDeep(props.searchResultsOptions);
28579
- return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28580
- });
28581
- const fetch2 = () => {
28582
- var _a;
28583
- (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28584
- };
28585
- __expose({ fetch: fetch2 });
28586
- return (_ctx, _cache) => {
28587
- return openBlock(), createBlock(unref(_sfc_main$c), {
28588
- options: fullSearchResultsOptions.value,
28589
- ref_key: "searchResults",
28590
- ref: searchResults2
28591
- }, null, 8, ["options"]);
28592
- };
28593
- }
28594
- });
28595
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28596
- __name: "ProductListEntry",
28597
- props: {
28598
- productListOptions: {}
28599
- },
28600
- setup(__props, { expose: __expose }) {
28601
- const props = __props;
28602
- const productList2 = ref(null);
28603
- const fullProductListOptions = computed(() => {
28604
- return lodashExports.cloneDeep(props.productListOptions);
28605
- });
28606
- const fetch2 = () => {
28607
- var _a;
28608
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28609
- };
28610
- __expose({ fetch: fetch2 });
28611
- return (_ctx, _cache) => {
28612
- return openBlock(), createBlock(unref(_sfc_main$a), {
28613
- options: fullProductListOptions.value,
28614
- ref_key: "productList",
28615
- ref: productList2
28616
- }, null, 8, ["options"]);
28617
- };
28618
- }
28619
- });
28620
- const QUERY_PARAMS = {
28621
- QUERY: "q",
28622
- PAGE: "p",
28623
- LIMIT: "l",
28624
- SORT: "s"
28625
- };
28626
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
28627
- __name: "SearchContainerEntry",
28628
- props: {
28629
- searchContainerOptions: {}
28630
- },
28631
- setup(__props, { expose: __expose }) {
28632
- const props = __props;
28633
- const isOpen = ref(false);
28634
- const triggerElement = ref(null);
28635
- const productList2 = ref(null);
28636
- const containerOptions = computed(() => {
28637
- return lodashExports.cloneDeep(props.searchContainerOptions);
28638
- });
28639
- const focus = () => {
28640
- const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
28641
- el == null ? void 0 : el.focus();
28642
- };
28643
- const close = () => {
28644
- isOpen.value = false;
28645
- };
28646
- const openSearchContainer = () => {
28647
- isOpen.value = true;
28648
- };
28649
- const checkCloseOnEscape = (e2) => {
28650
- var _a;
28651
- if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
28652
- return;
28653
- }
28654
- isOpen.value = false;
28655
- };
28656
- const checkExistingQuery = () => {
28657
- const url = new URL(window.location.href);
28658
- const param = url.searchParams.get(QUERY_PARAMS.QUERY);
28659
- if (!param) {
28660
- return;
28661
- }
28662
- isOpen.value = true;
28663
- };
28664
- const mountOpenListeners = () => {
28665
- var _a, _b;
28666
- triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
28667
- (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
28668
- window.addEventListener("keydown", checkCloseOnEscape);
28669
- };
28670
- onMounted(() => {
28671
- var _a, _b;
28672
- mountOpenListeners();
28673
- checkExistingQuery();
28674
- isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
28675
- });
28676
- onBeforeUnmount(() => {
28677
- var _a;
28678
- (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
28679
- window.removeEventListener("keydown", checkCloseOnEscape);
28680
- });
28681
- const fetch2 = () => {
28682
- var _a;
28683
- (_a = productList2.value) == null ? void 0 : _a.fetch();
28684
- };
28685
- const reloadOptions = () => {
28686
- var _a;
28687
- (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
28688
- };
28689
- __expose({ fetch: fetch2, reloadOptions });
28690
- return (_ctx, _cache) => {
28691
- return openBlock(), createElementBlock("div", null, [
28692
- containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
28693
- key: 0,
28694
- options: containerOptions.value,
28695
- ref_key: "productList",
28696
- ref: productList2,
28697
- "onHook:mounted": focus,
28698
- onClose: close
28699
- }, null, 8, ["options"])) : createCommentVNode("", true)
28700
- ]);
28701
- };
28827
+ titleKey: "name",
28828
+ elements: []
28829
+ }
28830
+ ],
28831
+ history: {
28832
+ labels: {
28833
+ clear: "Clear History"
28834
+ }
28702
28835
  }
28703
- });
28704
- const _sfc_main = /* @__PURE__ */ defineComponent({
28705
- __name: "RecommendationsEntry",
28836
+ };
28837
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
28838
+ __name: "SearchBoxEntry",
28706
28839
  props: {
28707
- recommendationOptions: {}
28840
+ searchBoxOptions: {}
28708
28841
  },
28709
28842
  setup(__props, { expose: __expose }) {
28710
- const productRecommendations = ref(null);
28843
+ const props = __props;
28844
+ const searchBox2 = ref(null);
28845
+ const fullSearchBoxOptions = computed(() => {
28846
+ const options = lodashExports.cloneDeep(props.searchBoxOptions);
28847
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_SEARCH_BOX_OPTIONS), options);
28848
+ });
28711
28849
  const fetch2 = () => {
28712
- productRecommendations == null ? void 0 : productRecommendations.fetch();
28850
+ var _a;
28851
+ (_a = searchBox2.value) == null ? void 0 : _a.handleCurrentValueSearch();
28713
28852
  };
28714
28853
  __expose({ fetch: fetch2 });
28715
28854
  return (_ctx, _cache) => {
28716
- return openBlock(), createBlock(unref(_sfc_main$8), {
28717
- options: _ctx.recommendationOptions,
28718
- ref_key: "productRecommendations",
28719
- ref: productRecommendations
28855
+ return openBlock(), createBlock(unref(_sfc_main$V), {
28856
+ options: fullSearchBoxOptions.value,
28857
+ ref_key: "searchBox",
28858
+ ref: searchBox2
28720
28859
  }, null, 8, ["options"]);
28721
28860
  };
28722
28861
  }
28723
28862
  });
28724
- const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
28725
- const createShadowDom = (shadowId, managerId) => {
28726
- let host = document.getElementById(shadowId);
28727
- if (host) {
28728
- host.remove();
28729
- }
28730
- host = document.createElement("div");
28731
- const manager = document.createElement("div");
28732
- host.setAttribute("id", shadowId);
28733
- manager == null ? void 0 : manager.setAttribute("id", managerId);
28734
- return { host, manager };
28735
- };
28736
- const attatchShadowDom = ({
28737
- host,
28738
- manager,
28739
- styleUrl,
28740
- options
28741
- }) => {
28742
- var _a;
28743
- if (host.shadowRoot) {
28744
- return;
28745
- }
28746
- const link = document.createElement("link");
28747
- link.type = "text/css";
28748
- link.rel = "stylesheet";
28749
- link.href = styleUrl;
28750
- const fontLink = document.createElement("link");
28751
- fontLink.type = "text/css";
28752
- fontLink.rel = "stylesheet";
28753
- fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
28754
- document.head.appendChild(fontLink);
28755
- const materialIconLink = document.createElement("link");
28756
- materialIconLink.type = "text/css";
28757
- materialIconLink.rel = "stylesheet";
28758
- materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
28759
- document.head.appendChild(materialIconLink);
28760
- const shadow = host.attachShadow({ mode: "open" });
28761
- shadow.appendChild(manager);
28762
- shadow.appendChild(link);
28763
- if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
28764
- const style = document.createElement("style");
28765
- style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
28766
- shadow.appendChild(style);
28767
- }
28768
- };
28769
- const displayDiscountedPriceSection = (doc2, options) => {
28770
- var _a, _b;
28771
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28772
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28773
- return discountPrice && regularPrice && discountPrice < regularPrice;
28774
- };
28775
- const displayRegularPriceSection = (doc2, options) => {
28776
- var _a, _b;
28777
- const discountPrice = doc2[(_a = options.fields.discountPriceKey) != null ? _a : ""];
28778
- const regularPrice = doc2[(_b = options.fields.regularPriceKey) != null ? _b : ""];
28779
- const anyPrice = discountPrice || regularPrice;
28780
- return anyPrice && !displayDiscountedPriceSection(doc2, options);
28781
- };
28782
- const escapeHtml = (source) => {
28783
- if (!source) {
28784
- return source;
28785
- }
28786
- return `${source}`.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
28787
- };
28788
- const toMaxDecimalPlaces = (value, maxDecimal = 2) => {
28789
- if (!value) {
28790
- return 0;
28791
- }
28792
- try {
28793
- return +parseFloat(`${value}`).toFixed(maxDecimal);
28794
- } catch (e2) {
28795
- return `${value}`;
28796
- }
28797
- };
28798
- const capitalize = (value) => {
28799
- if (!value) {
28800
- return "";
28801
- }
28802
- return value.charAt(0).toLocaleUpperCase() + value.slice(1);
28803
- };
28804
- const getAlphanumeric = (value) => {
28805
- if (!value) {
28806
- return "";
28807
- }
28808
- return value.replace(/[\W_]/g, " ");
28809
- };
28810
- const getAdditionalElements = (fields) => {
28811
- return fields.map((key) => ({
28812
- type: "custom",
28813
- key,
28814
- label: capitalize(getAlphanumeric(key)),
28815
- className: "lupa-custom",
28816
- display: (doc2) => Boolean(doc2[key])
28817
- }));
28818
- };
28819
- const addFieldIfKeyExists = (field, key, config) => {
28820
- if (key) {
28821
- return config;
28822
- }
28823
- return { key: field, type: "customHtml", display: () => false };
28824
- };
28825
- const getSearchBoxComponent = ({
28826
- searchBoxOptions,
28827
- labels,
28828
- panelOptions,
28829
- redirections,
28830
- placeholderImage
28831
- }) => {
28832
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
28833
- const panels = [
28834
- ...(panelOptions == null ? void 0 : panelOptions.suggestionPanel) ? [
28835
- {
28836
- type: SearchBoxPanelType.SUGGESTION,
28837
- queryKey: searchBoxOptions.suggestionQueryKey,
28838
- highlight: true,
28839
- limit: 8,
28840
- labels: {
28841
- topResultsTitle: (_a = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _a.topSuggestionsTitle
28842
- }
28843
- }
28844
- ] : [],
28845
- ...(panelOptions == null ? void 0 : panelOptions.docPanel) ? [
28846
- {
28847
- type: SearchBoxPanelType.DOCUMENT,
28848
- queryKey: searchBoxOptions.documentQueryKey,
28849
- limit: 5,
28850
- elements: [
28851
- {
28852
- type: "image",
28853
- placeholder: placeholderImage,
28854
- key: (_b = searchBoxOptions.fields) == null ? void 0 : _b.imageKey,
28855
- baseUrl: (_c = searchBoxOptions.fields) == null ? void 0 : _c.baseImageUrl
28856
- },
28857
- {
28858
- type: "title",
28859
- key: (_d = searchBoxOptions.fields) == null ? void 0 : _d.titleKey,
28860
- maxLines: 2
28861
- },
28862
- {
28863
- type: "regularPrice",
28864
- key: (_e = searchBoxOptions.fields) == null ? void 0 : _e.regularPriceKey,
28865
- display: (doc2) => {
28866
- var _a2, _b2, _c2, _d2;
28867
- 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]);
28868
- }
28869
- },
28870
- {
28871
- type: "price",
28872
- key: (_f = searchBoxOptions.fields) == null ? void 0 : _f.discountPriceKey
28873
- }
28874
- ]
28875
- }
28876
- ] : []
28877
- ];
28878
- return {
28879
- inputSelector: searchBoxOptions.inputSelector,
28880
- options: {
28881
- environment: (_g = searchBoxOptions.environment) != null ? _g : "production",
28882
- customUrl: searchBoxOptions.customUrl,
28883
- customBaseUrl: searchBoxOptions.customBaseUrl,
28884
- customPayload: searchBoxOptions.customPayload,
28885
- customHeaders: searchBoxOptions.customHeaders
28886
- },
28887
- showTotalCount: true,
28888
- expandOnSinglePanel: true,
28889
- minInputLength: (_i = (_h = searchBoxOptions.fields) == null ? void 0 : _h.minInputLength) != null ? _i : 0,
28890
- debounce: 250,
28891
- labels: labels == null ? void 0 : labels.searchBox,
28892
- links: {
28893
- searchResults: ""
28863
+ const DEFAULT_OPTIONS_RESULTS = {
28864
+ options: {
28865
+ environment: "production"
28866
+ },
28867
+ queryKey: "",
28868
+ containerSelector: "#searchResultsContainer",
28869
+ searchTitlePosition: "page-top",
28870
+ labels: {
28871
+ pageSize: "Page size:",
28872
+ sortBy: "Sort by:",
28873
+ itemCount: "Items {1} of {2}",
28874
+ filteredItemCount: "",
28875
+ currency: "€",
28876
+ showMore: "Show more",
28877
+ searchResults: "Search Query: ",
28878
+ emptyResults: "There are no results for the query:",
28879
+ mobileFilterButton: "Filter",
28880
+ htmlTitleTemplate: "Search Query: '{1}'",
28881
+ noResultsSuggestion: "No results found for this query: {1}",
28882
+ didYouMean: "Did you mean to search: {1}",
28883
+ similarQuery: "Search results for phrase {1}",
28884
+ similarQueries: "Similar queries:"
28885
+ },
28886
+ grid: {
28887
+ columns: {
28888
+ xl: 4,
28889
+ l: 3,
28890
+ md: 2,
28891
+ sm: 2,
28892
+ xs: 1
28893
+ }
28894
+ },
28895
+ pagination: {
28896
+ sizeSelection: {
28897
+ position: {
28898
+ top: false,
28899
+ bottom: true
28900
+ },
28901
+ sizes: [12, 24, 36]
28894
28902
  },
28895
- panels,
28896
- redirections,
28897
- history: {
28898
- labels: {
28899
- clear: (_j = labels == null ? void 0 : labels.searchBox) == null ? void 0 : _j.clearHistory
28900
- }
28903
+ pageSelection: {
28904
+ position: {
28905
+ top: false,
28906
+ bottom: true
28907
+ },
28908
+ display: 5,
28909
+ displayMobile: 3
28901
28910
  }
28902
- };
28903
- };
28904
- const getSearchResultsComponent = ({
28905
- searchResultOptions,
28906
- labels,
28907
- redirections,
28908
- placeholderImage,
28909
- configuratorOverrides,
28910
- callbacks,
28911
- additionalFields
28912
- }) => {
28913
- 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;
28914
- const filters = searchResultOptions.showFacets ? {
28911
+ },
28912
+ sort: [],
28913
+ filters: {
28915
28914
  currentFilters: {
28916
28915
  visibility: {
28917
28916
  mobileSidebar: true,
28918
28917
  mobileToolbar: true
28919
28918
  },
28920
28919
  labels: {
28921
- title: "",
28922
- clearAll: (_a = labels == null ? void 0 : labels.facets) == null ? void 0 : _a.clearAll
28920
+ title: "Current filters:",
28921
+ clearAll: "Clear all"
28923
28922
  }
28924
28923
  },
28925
28924
  facets: {
28926
28925
  labels: {
28927
- title: (_b = labels == null ? void 0 : labels.facets) == null ? void 0 : _b.facetTitle,
28928
- showAll: (_c = labels == null ? void 0 : labels.facets) == null ? void 0 : _c.showAll,
28929
- facetFilter: (_d = labels == null ? void 0 : labels.facets) == null ? void 0 : _d.facetFilter,
28930
- facetClear: (_e = labels == null ? void 0 : labels.facets) == null ? void 0 : _e.facetClear
28926
+ title: "Filters:",
28927
+ showAll: "Show more",
28928
+ facetFilter: "Filter...",
28929
+ facetClear: "Clear"
28931
28930
  },
28932
28931
  filterable: {
28933
28932
  minValues: 5
@@ -28937,179 +28936,230 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28937
28936
  topLevelValueCountLimit: 5,
28938
28937
  filterable: true
28939
28938
  },
28940
- stats: {
28941
- slider: true,
28942
- inputs: true,
28943
- labels: {
28944
- from: "",
28945
- to: ""
28946
- }
28947
- },
28948
- facetValueCountLimit: 8,
28939
+ facetValueCountLimit: 20,
28949
28940
  showDocumentCount: true,
28950
28941
  style: {
28951
28942
  type: "sidebar"
28952
28943
  }
28953
28944
  }
28954
- } : {};
28955
- const columns = (_k = searchResultOptions.gridConfiguration) != null ? _k : {
28956
- xl: (_f = searchResultOptions.maxColumns) != null ? _f : 4,
28957
- l: (_g = searchResultOptions.maxColumns) != null ? _g : 3,
28958
- md: (_h = searchResultOptions.maxColumns) != null ? _h : 3,
28959
- sm: (_i = searchResultOptions.maxColumns) != null ? _i : 2,
28960
- xs: (_j = searchResultOptions.maxColumns) != null ? _j : 1
28961
- };
28962
- const badges = {
28963
- badges: {
28964
- anchor: "tr",
28965
- elements: [
28966
- ...searchResultOptions.showRelevance ? [
28967
- {
28968
- key: "",
28969
- type: "customHtml",
28970
- className: "relevance",
28971
- html: (doc2) => `${toMaxDecimalPlaces(escapeHtml(doc2._relevance), 3)}`,
28972
- display: (doc2) => Boolean(doc2._relevance !== void 0)
28973
- }
28974
- ] : [],
28975
- ...((_l = searchResultOptions.boostedMarker) == null ? void 0 : _l.enabled) ? [
28976
- {
28977
- key: "",
28978
- type: "customHtml",
28979
- className: "boosted-marker",
28980
- html: () => {
28981
- var _a2;
28982
- return `${escapeHtml((_a2 = searchResultOptions.boostedMarker) == null ? void 0 : _a2.label)}`;
28983
- },
28984
- display: (doc2) => doc2._boosted === true
28985
- }
28986
- ] : []
28987
- ]
28988
- }
28989
- };
28990
- return __spreadValues(__spreadProps(__spreadValues({
28991
- options: {
28992
- environment: (_m = searchResultOptions.environment) != null ? _m : "production",
28993
- customUrl: searchResultOptions.customUrl,
28994
- customBaseUrl: searchResultOptions.customBaseUrl,
28995
- customPayload: searchResultOptions.customPayload,
28996
- customHeaders: searchResultOptions.customHeaders,
28997
- onError: searchResultOptions.errorHandler
28998
- },
28999
- queryKey: searchResultOptions.queryKey,
29000
- containerSelector: searchResultOptions.containerSelector,
29001
- searchTitlePosition: "search-results-top",
29002
- titleKey: (_n = searchResultOptions.fields) == null ? void 0 : _n.titleKey,
29003
- labels: labels == null ? void 0 : labels.searchResults,
29004
- grid: {
29005
- columns
29006
- },
29007
- pagination: {
29008
- sizeSelection: {
29009
- position: {
29010
- top: true,
29011
- bottom: false
29012
- },
29013
- sizes: [12, 24, 36, 48]
29014
- },
29015
- pageSelection: {
29016
- position: {
29017
- top: false,
29018
- bottom: true
29019
- },
29020
- displayMobile: 3,
29021
- display: 5
29022
- }
29023
- },
29024
- filters,
29025
- toolbar: {
29026
- layoutSelector: false,
29027
- itemSummary: true,
29028
- clearFilters: false
29029
- },
29030
- isInStock: () => {
29031
- return true;
29032
- }
29033
- }, badges), {
29034
- links: {
29035
- details: ((_o = searchResultOptions.fields) == null ? void 0 : _o.productUrl) ? `{${(_p = searchResultOptions.fields) == null ? void 0 : _p.productUrl}}` : void 0
29036
- },
29037
- callbacks,
29038
- routingBehavior: callbacks ? "event" : "direct-link",
29039
- idKey: "id",
29040
- elements: [
29041
- {
29042
- type: "image",
29043
- placeholder: placeholderImage,
29044
- key: (_q = searchResultOptions.fields) == null ? void 0 : _q.imageKey,
29045
- baseUrl: (_r = searchResultOptions.fields) == null ? void 0 : _r.baseImageUrl,
29046
- display: () => {
29047
- var _a2;
29048
- return (_a2 = searchResultOptions.fields) == null ? void 0 : _a2.imageKey;
29049
- }
29050
- },
29051
- addFieldIfKeyExists("_emphasis", (_s = searchResultOptions.fields) == null ? void 0 : _s.emphasizedField, {
29052
- type: "custom",
29053
- className: "lupa-custom-emphasis",
29054
- key: (_t = searchResultOptions.fields) == null ? void 0 : _t.emphasizedField,
29055
- display: () => true
29056
- }),
29057
- {
29058
- type: "title",
29059
- key: (_u = searchResultOptions.fields) == null ? void 0 : _u.titleKey,
29060
- maxLines: (_v = searchResultOptions.maxLines) != null ? _v : 2,
29061
- display: (doc2) => {
29062
- var _a2, _b2;
29063
- return ((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.titleKey) && Boolean(doc2[(_b2 = searchResultOptions.fields) == null ? void 0 : _b2.titleKey]);
29064
- }
29065
- },
29066
- ...getAdditionalElements(additionalFields),
29067
- addFieldIfKeyExists("_discountPrice", (_w = searchResultOptions.fields) == null ? void 0 : _w.discountPriceKey, {
29068
- key: (_x = searchResultOptions.fields) == null ? void 0 : _x.discountPriceKey,
29069
- type: "customHtml",
29070
- className: "lupa-price lupa-price-discounted",
29071
- display: (doc2) => displayDiscountedPriceSection(doc2, searchResultOptions),
29072
- html: (doc2) => {
29073
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29074
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29075
- const discountPrice = (_d2 = parseFloat(
29076
- doc2[(_c2 = (_b2 = searchResultOptions.fields) == null ? void 0 : _b2.discountPriceKey) != null ? _c2 : ""]
29077
- )) == null ? void 0 : _d2.toFixed(2);
29078
- const regularPrice = (_g2 = parseFloat(
29079
- doc2[(_f2 = (_e2 = searchResultOptions.fields) == null ? void 0 : _e2.regularPriceKey) != null ? _f2 : ""]
29080
- )) == null ? void 0 : _g2.toFixed(2);
29081
- const discount = `<span class="lupa-discount">${escapeHtml(
29082
- discountPrice
29083
- )} ${currency}</span>`;
29084
- const regular = `<span class="lupa-regular">${escapeHtml(
29085
- regularPrice
29086
- )} ${currency}</span>`;
29087
- return discount + regular;
29088
- }
29089
- }),
29090
- addFieldIfKeyExists("_regularPrice", (_y = searchResultOptions.fields) == null ? void 0 : _y.regularPriceKey, {
29091
- key: (_z = searchResultOptions.fields) == null ? void 0 : _z.regularPriceKey,
29092
- type: "customHtml",
29093
- className: "lupa-price lupa-price-single",
29094
- display: (doc2) => displayRegularPriceSection(doc2, searchResultOptions),
29095
- html: (doc2) => {
29096
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
29097
- const currency = escapeHtml(((_a2 = searchResultOptions.fields) == null ? void 0 : _a2.currency) || "€");
29098
- const price = (_g2 = parseFloat(
29099
- (_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 : ""]
29100
- )) == null ? void 0 : _g2.toFixed(2);
29101
- return `<span class="lupa-final">${escapeHtml(price)} ${currency}</span>`;
29102
- }
29103
- })
29104
- ],
29105
- breadcrumbs: [],
29106
- sort: [],
29107
- redirections
29108
- }), configuratorOverrides);
28945
+ },
28946
+ toolbar: {
28947
+ layoutSelector: true,
28948
+ itemSummary: true,
28949
+ clearFilters: false
28950
+ },
28951
+ isInStock: () => {
28952
+ return true;
28953
+ },
28954
+ badges: {
28955
+ anchor: "tr",
28956
+ elements: []
28957
+ },
28958
+ links: {
28959
+ details: "/{id}"
28960
+ },
28961
+ elements: [],
28962
+ breadcrumbs: [{ label: "Main Page", link: "/" }, { label: "Search: {1}" }]
28963
+ };
28964
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
28965
+ __name: "SearchResultsEntry",
28966
+ props: {
28967
+ searchResultsOptions: {}
28968
+ },
28969
+ setup(__props, { expose: __expose }) {
28970
+ const props = __props;
28971
+ const searchResults2 = ref(null);
28972
+ const fullSearchResultsOptions = computed(() => {
28973
+ const options = lodashExports.cloneDeep(props.searchResultsOptions);
28974
+ return lodashExports.merge(lodashExports.cloneDeep(DEFAULT_OPTIONS_RESULTS), options);
28975
+ });
28976
+ const fetch2 = () => {
28977
+ var _a;
28978
+ (_a = searchResults2.value) == null ? void 0 : _a.handleUrlChange();
28979
+ };
28980
+ __expose({ fetch: fetch2 });
28981
+ return (_ctx, _cache) => {
28982
+ return openBlock(), createBlock(unref(_sfc_main$c), {
28983
+ options: fullSearchResultsOptions.value,
28984
+ ref_key: "searchResults",
28985
+ ref: searchResults2
28986
+ }, null, 8, ["options"]);
28987
+ };
28988
+ }
28989
+ });
28990
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
28991
+ __name: "ProductListEntry",
28992
+ props: {
28993
+ productListOptions: {}
28994
+ },
28995
+ setup(__props, { expose: __expose }) {
28996
+ const props = __props;
28997
+ const productList2 = ref(null);
28998
+ const fullProductListOptions = computed(() => {
28999
+ return lodashExports.cloneDeep(props.productListOptions);
29000
+ });
29001
+ const fetch2 = () => {
29002
+ var _a;
29003
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29004
+ };
29005
+ __expose({ fetch: fetch2 });
29006
+ return (_ctx, _cache) => {
29007
+ return openBlock(), createBlock(unref(_sfc_main$a), {
29008
+ options: fullProductListOptions.value,
29009
+ ref_key: "productList",
29010
+ ref: productList2
29011
+ }, null, 8, ["options"]);
29012
+ };
29013
+ }
29014
+ });
29015
+ const QUERY_PARAMS = {
29016
+ QUERY: "q",
29017
+ PAGE: "p",
29018
+ LIMIT: "l",
29019
+ SORT: "s"
29109
29020
  };
29110
- const SearchContainerConfigurationService = {
29111
- getSearchBoxComponent,
29112
- getSearchResultsComponent
29021
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
29022
+ __name: "SearchContainerEntry",
29023
+ props: {
29024
+ searchContainerOptions: {}
29025
+ },
29026
+ setup(__props, { expose: __expose }) {
29027
+ const props = __props;
29028
+ const isOpen = ref(false);
29029
+ const triggerElement = ref(null);
29030
+ const productList2 = ref(null);
29031
+ const containerOptions = computed(() => {
29032
+ return lodashExports.cloneDeep(props.searchContainerOptions);
29033
+ });
29034
+ const focus = () => {
29035
+ const el = document.querySelector("#lupa-search-box-input .lupa-search-box-input-field");
29036
+ el == null ? void 0 : el.focus();
29037
+ };
29038
+ const close = () => {
29039
+ isOpen.value = false;
29040
+ };
29041
+ const openSearchContainer = () => {
29042
+ isOpen.value = true;
29043
+ };
29044
+ const checkCloseOnEscape = (e2) => {
29045
+ var _a;
29046
+ if (!["Escape", "Esc"].includes((_a = e2.key) != null ? _a : "")) {
29047
+ return;
29048
+ }
29049
+ isOpen.value = false;
29050
+ };
29051
+ const checkExistingQuery = () => {
29052
+ const url = new URL(window.location.href);
29053
+ const param = url.searchParams.get(QUERY_PARAMS.QUERY);
29054
+ if (!param) {
29055
+ return;
29056
+ }
29057
+ isOpen.value = true;
29058
+ };
29059
+ const mountOpenListeners = () => {
29060
+ var _a, _b;
29061
+ triggerElement.value = document.querySelector((_a = props.searchContainerOptions) == null ? void 0 : _a.trigger);
29062
+ (_b = triggerElement.value) == null ? void 0 : _b.addEventListener("focus", openSearchContainer);
29063
+ window.addEventListener("keydown", checkCloseOnEscape);
29064
+ };
29065
+ onMounted(() => {
29066
+ var _a, _b;
29067
+ mountOpenListeners();
29068
+ checkExistingQuery();
29069
+ isOpen.value = Boolean((_b = (_a = containerOptions.value) == null ? void 0 : _a.options) == null ? void 0 : _b.isOpenInitially);
29070
+ });
29071
+ onBeforeUnmount(() => {
29072
+ var _a;
29073
+ (_a = triggerElement.value) == null ? void 0 : _a.removeEventListener("focus", openSearchContainer);
29074
+ window.removeEventListener("keydown", checkCloseOnEscape);
29075
+ });
29076
+ const fetch2 = () => {
29077
+ var _a;
29078
+ (_a = productList2.value) == null ? void 0 : _a.fetch();
29079
+ };
29080
+ const reloadOptions = () => {
29081
+ var _a;
29082
+ (_a = productList2.value) == null ? void 0 : _a.reloadOptions();
29083
+ };
29084
+ __expose({ fetch: fetch2, reloadOptions });
29085
+ return (_ctx, _cache) => {
29086
+ return openBlock(), createElementBlock("div", null, [
29087
+ containerOptions.value && isOpen.value ? (openBlock(), createBlock(unref(_sfc_main$9), {
29088
+ key: 0,
29089
+ options: containerOptions.value,
29090
+ ref_key: "productList",
29091
+ ref: productList2,
29092
+ "onHook:mounted": focus,
29093
+ onClose: close
29094
+ }, null, 8, ["options"])) : createCommentVNode("", true)
29095
+ ]);
29096
+ };
29097
+ }
29098
+ });
29099
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29100
+ __name: "RecommendationsEntry",
29101
+ props: {
29102
+ recommendationOptions: {}
29103
+ },
29104
+ setup(__props, { expose: __expose }) {
29105
+ const productRecommendations = ref(null);
29106
+ const fetch2 = () => {
29107
+ productRecommendations == null ? void 0 : productRecommendations.fetch();
29108
+ };
29109
+ __expose({ fetch: fetch2 });
29110
+ return (_ctx, _cache) => {
29111
+ return openBlock(), createBlock(unref(_sfc_main$8), {
29112
+ options: _ctx.recommendationOptions,
29113
+ ref_key: "productRecommendations",
29114
+ ref: productRecommendations
29115
+ }, null, 8, ["options"]);
29116
+ };
29117
+ }
29118
+ });
29119
+ const DEFAULT_CONTAINER_STYLE = "/containerStyle.css";
29120
+ const createShadowDom = (shadowId, managerId) => {
29121
+ let host = document.getElementById(shadowId);
29122
+ if (host) {
29123
+ host.remove();
29124
+ }
29125
+ host = document.createElement("div");
29126
+ const manager = document.createElement("div");
29127
+ host.setAttribute("id", shadowId);
29128
+ manager == null ? void 0 : manager.setAttribute("id", managerId);
29129
+ return { host, manager };
29130
+ };
29131
+ const attatchShadowDom = ({
29132
+ host,
29133
+ manager,
29134
+ styleUrl,
29135
+ options
29136
+ }) => {
29137
+ var _a;
29138
+ if (host.shadowRoot) {
29139
+ return;
29140
+ }
29141
+ const link = document.createElement("link");
29142
+ link.type = "text/css";
29143
+ link.rel = "stylesheet";
29144
+ link.href = styleUrl;
29145
+ const fontLink = document.createElement("link");
29146
+ fontLink.type = "text/css";
29147
+ fontLink.rel = "stylesheet";
29148
+ fontLink.href = "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap";
29149
+ document.head.appendChild(fontLink);
29150
+ const materialIconLink = document.createElement("link");
29151
+ materialIconLink.type = "text/css";
29152
+ materialIconLink.rel = "stylesheet";
29153
+ materialIconLink.href = "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,1,-50..200";
29154
+ document.head.appendChild(materialIconLink);
29155
+ const shadow = host.attachShadow({ mode: "open" });
29156
+ shadow.appendChild(manager);
29157
+ shadow.appendChild(link);
29158
+ if ((_a = options == null ? void 0 : options.layout) == null ? void 0 : _a.marginLeft) {
29159
+ const style = document.createElement("style");
29160
+ style.innerHTML = `.lupa-search-container-overlay { width: calc(100% - ${options.layout.marginLeft}px); margin-left: ${options.layout.marginLeft}px; }`;
29161
+ shadow.appendChild(style);
29162
+ }
29113
29163
  };
29114
29164
  const getMountElement = (element, mountingBehavior = "replace", mountToParent) => {
29115
29165
  const parent = element == null ? void 0 : element.parentElement;
@@ -29140,7 +29190,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29140
29190
  return;
29141
29191
  }
29142
29192
  let mountedComponent = null;
29143
- const props = reactive(__spreadValues({}, options));
29193
+ const props = reactive(__spreadValues2({}, options));
29144
29194
  const app2 = createApp({
29145
29195
  render: () => mountedComponent = h$1(rootComponent, props)
29146
29196
  });
@@ -29159,9 +29209,6 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29159
29209
  recommendations: {},
29160
29210
  chat: {}
29161
29211
  };
29162
- const tracking = (options) => {
29163
- setupTracking(options);
29164
- };
29165
29212
  const applySearchBox = (options, mountOptions) => {
29166
29213
  const existingInstance = app.box[options.inputSelector];
29167
29214
  if (existingInstance) {
@@ -29190,7 +29237,7 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29190
29237
  var _a;
29191
29238
  const inputs = (_a = options.inputSelector) == null ? void 0 : _a.split(",");
29192
29239
  for (const input of inputs) {
29193
- applySearchBox(__spreadProps(__spreadValues({}, options), { inputSelector: input.trim() }), mountOptions);
29240
+ applySearchBox(__spreadProps2(__spreadValues2({}, options), { inputSelector: input.trim() }), mountOptions);
29194
29241
  }
29195
29242
  };
29196
29243
  const searchResults = (options, mountOptions) => {
@@ -29426,7 +29473,237 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29426
29473
  } catch (e2) {
29427
29474
  }
29428
29475
  };
29476
+ const saveToLocalStorage = (key, value) => {
29477
+ try {
29478
+ localStorage.setItem(key, JSON.stringify(value));
29479
+ } catch (e2) {
29480
+ }
29481
+ };
29482
+ const tryLoadFromLocalStorage = (key) => {
29483
+ try {
29484
+ const item = localStorage.getItem(key);
29485
+ return item ? JSON.parse(item) : null;
29486
+ } catch (e2) {
29487
+ return null;
29488
+ }
29489
+ };
29490
+ const saveToSessionStorage = (key, value) => {
29491
+ try {
29492
+ sessionStorage.setItem(key, JSON.stringify(value));
29493
+ } catch (e2) {
29494
+ }
29495
+ };
29496
+ const tryLoadFromSessionStorage = (key) => {
29497
+ try {
29498
+ const item = sessionStorage.getItem(key);
29499
+ return item ? JSON.parse(item) : null;
29500
+ } catch (e2) {
29501
+ return null;
29502
+ }
29503
+ };
29504
+ const getQueryParam = (name) => {
29505
+ try {
29506
+ const urlParams = new URLSearchParams(window.location.search);
29507
+ return urlParams.get(name);
29508
+ } catch (e2) {
29509
+ return null;
29510
+ }
29511
+ };
29512
+ const PREVIEW_PARAMETER = "lupaSearchPreview";
29513
+ let styleElement = null;
29514
+ const waitForElementToBeVisible = (element, retries = 0, maxRetries = 10, interval = 10) => __async2(this, null, function* () {
29515
+ if (retries > maxRetries) {
29516
+ return false;
29517
+ }
29518
+ if (typeof element === "string") {
29519
+ element = document.querySelector(element);
29520
+ }
29521
+ if (element) {
29522
+ return true;
29523
+ } else {
29524
+ setTimeout(() => {
29525
+ waitForElementToBeVisible(element, retries + 1, maxRetries, interval + 10);
29526
+ }, interval);
29527
+ }
29528
+ });
29529
+ const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async2(this, null, function* () {
29530
+ const configuration2 = yield fetchPluginConfiguration(
29531
+ options,
29532
+ configurationKey
29533
+ );
29534
+ if (!configuration2) {
29535
+ console.error(`Failed to fetch LupaSearch plugin configuration for key ${configurationKey}`);
29536
+ return null;
29537
+ }
29538
+ saveToLocalStorage(configurationKey, configuration2);
29539
+ return configuration2;
29540
+ });
29541
+ const checkIsPreviewMode = () => {
29542
+ const isPreviewModeSaved = tryLoadFromSessionStorage(PREVIEW_PARAMETER);
29543
+ if (isPreviewModeSaved) {
29544
+ return isPreviewModeSaved;
29545
+ }
29546
+ const isPreviewMode = getQueryParam(PREVIEW_PARAMETER) === "true";
29547
+ if (isPreviewMode) {
29548
+ saveToSessionStorage(PREVIEW_PARAMETER, isPreviewMode);
29549
+ } else {
29550
+ saveToSessionStorage(PREVIEW_PARAMETER, false);
29551
+ }
29552
+ return isPreviewMode;
29553
+ };
29554
+ const loadConfigurations = (configurationKey, isPreviewMode, options) => __async2(this, null, function* () {
29555
+ if (isPreviewMode) {
29556
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29557
+ }
29558
+ const existingConfiguration = tryLoadFromLocalStorage(configurationKey);
29559
+ if (existingConfiguration) {
29560
+ setTimeout(() => __async2(this, null, function* () {
29561
+ var _a;
29562
+ const newestConfiguration = yield loadAndSaveConfigurationFromServer(
29563
+ configurationKey,
29564
+ options
29565
+ );
29566
+ if (existingConfiguration.updatedAt === newestConfiguration.updatedAt) {
29567
+ return;
29568
+ }
29569
+ const isPreviewMode2 = checkIsPreviewMode();
29570
+ const configuration2 = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
29571
+ yield mount(configuration2, false);
29572
+ }), 5e3);
29573
+ return existingConfiguration;
29574
+ }
29575
+ return loadAndSaveConfigurationFromServer(configurationKey, options);
29576
+ });
29577
+ const applyStyles = (configuration2) => __async2(this, null, function* () {
29578
+ var _a;
29579
+ const visible2 = yield waitForElementToBeVisible(document.head);
29580
+ if (!visible2) {
29581
+ console.error("Failed to apply custom LupaSearch styles, head element not found");
29582
+ return;
29583
+ }
29584
+ const baseStyleLink = configuration2.baseStyleLink;
29585
+ if (styleElement) {
29586
+ styleElement.remove();
29587
+ }
29588
+ styleElement = document.createElement("style");
29589
+ if (baseStyleLink) {
29590
+ styleElement.innerHTML = `
29591
+ @import url('${baseStyleLink}');
29592
+ @import url('https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css')
29593
+ ${(_a = configuration2.customStyles) != null ? _a : ""}`;
29594
+ }
29595
+ document.head.appendChild(styleElement);
29596
+ });
29597
+ const mountSearchBox = (configuration, fetch = true) => __async2(this, null, function* () {
29598
+ if (!configuration.searchBox) {
29599
+ return;
29600
+ }
29601
+ const resolvedConfiguration = eval(`(${configuration.searchBox})`);
29602
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.inputSelector);
29603
+ if (!visible) {
29604
+ console.error(
29605
+ `Failed to mount LupaSearch search box, input element ${resolvedConfiguration.inputSelector} not found`
29606
+ );
29607
+ return;
29608
+ }
29609
+ searchBox(resolvedConfiguration, { fetch });
29610
+ });
29611
+ const mountSearchResults = (configuration, fetch = true) => __async2(this, null, function* () {
29612
+ if (!configuration.searchResults) {
29613
+ return;
29614
+ }
29615
+ const resolvedConfiguration = eval(`(${configuration.searchResults})`);
29616
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29617
+ if (!visible) {
29618
+ console.error(
29619
+ `Failed to mount LupaSearch search results, element ${resolvedConfiguration.containerSelector} not found`
29620
+ );
29621
+ return;
29622
+ }
29623
+ searchResults(resolvedConfiguration, { fetch });
29624
+ });
29625
+ const mountProductList = (configuration, fetch = true) => __async2(this, null, function* () {
29626
+ if (!configuration.productList) {
29627
+ return;
29628
+ }
29629
+ const resolvedSearchResultsConfiguration = eval(
29630
+ `(${configuration.searchResults})`
29631
+ );
29632
+ const resolvedConfiguration = eval(`(${configuration.productList})`);
29633
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29634
+ if (!visible) {
29635
+ console.error(
29636
+ `Failed to mount LupaSearch product list, element ${resolvedConfiguration.containerSelector} not found`
29637
+ );
29638
+ return;
29639
+ }
29640
+ productList(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29641
+ });
29642
+ const mountRecommendations = (configuration, fetch = true) => __async2(this, null, function* () {
29643
+ if (!configuration.recommendations) {
29644
+ return;
29645
+ }
29646
+ const resolvedSearchResultsConfiguration = eval(
29647
+ `(${configuration.searchResults})`
29648
+ );
29649
+ const resolvedConfiguration = eval(
29650
+ `(${configuration.recommendations})`
29651
+ );
29652
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29653
+ if (!visible) {
29654
+ console.error(
29655
+ `Failed to mount LupaSearch recommendations, element ${resolvedConfiguration.containerSelector} not found`
29656
+ );
29657
+ return;
29658
+ }
29659
+ recommendations(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29660
+ });
29661
+ const mountChat = (configuration, fetch = true) => __async2(this, null, function* () {
29662
+ if (!configuration.genAiChat) {
29663
+ return;
29664
+ }
29665
+ const resolvedSearchResultsConfiguration = eval(
29666
+ `(${configuration.searchResults})`
29667
+ );
29668
+ const resolvedConfiguration = eval(`(${configuration.genAiChat})`);
29669
+ const visible = yield waitForElementToBeVisible(resolvedConfiguration.containerSelector);
29670
+ if (!visible) {
29671
+ console.error(
29672
+ `Failed to mount LupaSearch chat, element ${resolvedConfiguration.containerSelector} not found`
29673
+ );
29674
+ return;
29675
+ }
29676
+ chat(__spreadValues2(__spreadValues2({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { fetch });
29677
+ });
29678
+ const mount = (configuration2, fetch2 = true) => __async2(this, null, function* () {
29679
+ yield applyStyles(configuration2);
29680
+ const mountPromises = [
29681
+ mountSearchBox(configuration2, fetch2),
29682
+ mountSearchResults(configuration2, fetch2),
29683
+ mountProductList(configuration2, fetch2),
29684
+ mountRecommendations(configuration2, fetch2),
29685
+ mountChat(configuration2, fetch2)
29686
+ ];
29687
+ yield Promise.all(mountPromises);
29688
+ });
29689
+ const init$1 = (configurationKey, options) => __async2(this, null, function* () {
29690
+ var _a;
29691
+ const isPreviewMode = checkIsPreviewMode();
29692
+ const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
29693
+ const configuration2 = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
29694
+ yield mount(configuration2);
29695
+ });
29696
+ const PluginConfigurationManager = {
29697
+ init: init$1
29698
+ };
29699
+ const tracking = (options) => {
29700
+ setupTracking(options);
29701
+ };
29702
+ const init = (configurationKey, options) => {
29703
+ return PluginConfigurationManager.init(configurationKey, options);
29704
+ };
29429
29705
  const lupaSearch = {
29706
+ init,
29430
29707
  searchBox,
29431
29708
  searchResults,
29432
29709
  tracking,
@@ -29448,9 +29725,9 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
29448
29725
  window.getLupa = lupaSearch;
29449
29726
  window.lupaSearch = lupaSearch;
29450
29727
  }
29451
- exports2.BadgeType = BadgeType;
29452
- exports2.DocumentElementType = DocumentElementType;
29453
- exports2.SearchBoxPanelType = SearchBoxPanelType;
29454
- exports2.default = lupaSearch;
29455
- Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
29728
+ exports.BadgeType = BadgeType;
29729
+ exports.DocumentElementType = DocumentElementType;
29730
+ exports.SearchBoxPanelType = SearchBoxPanelType;
29731
+ exports.default = lupaSearch;
29732
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
29456
29733
  });