@getlupa/client 1.15.10 → 1.15.12

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.
@@ -73,9 +73,9 @@ var __async = (__this, __arguments, generator) => {
73
73
  const isFunction$1 = (val) => typeof val === "function";
74
74
  const isString = (val) => typeof val === "string";
75
75
  const isSymbol = (val) => typeof val === "symbol";
76
- const isObject$2 = (val) => val !== null && typeof val === "object";
76
+ const isObject$3 = (val) => val !== null && typeof val === "object";
77
77
  const isPromise$1 = (val) => {
78
- return isObject$2(val) && isFunction$1(val.then) && isFunction$1(val.catch);
78
+ return isObject$3(val) && isFunction$1(val.then) && isFunction$1(val.catch);
79
79
  };
80
80
  const objectToString$1 = Object.prototype.toString;
81
81
  const toTypeString = (value) => objectToString$1.call(value);
@@ -149,7 +149,7 @@ var __async = (__this, __arguments, generator) => {
149
149
  return res;
150
150
  } else if (isString(value)) {
151
151
  return value;
152
- } else if (isObject$2(value)) {
152
+ } else if (isObject$3(value)) {
153
153
  return value;
154
154
  }
155
155
  }
@@ -177,7 +177,7 @@ var __async = (__this, __arguments, generator) => {
177
177
  res += normalized + " ";
178
178
  }
179
179
  }
180
- } else if (isObject$2(value)) {
180
+ } else if (isObject$3(value)) {
181
181
  for (const name in value) {
182
182
  if (value[name]) {
183
183
  res += name + " ";
@@ -230,8 +230,8 @@ var __async = (__this, __arguments, generator) => {
230
230
  if (aValidType || bValidType) {
231
231
  return aValidType && bValidType ? looseCompareArrays(a, b) : false;
232
232
  }
233
- aValidType = isObject$2(a);
234
- bValidType = isObject$2(b);
233
+ aValidType = isObject$3(a);
234
+ bValidType = isObject$3(b);
235
235
  if (aValidType || bValidType) {
236
236
  if (!aValidType || !bValidType) {
237
237
  return false;
@@ -255,7 +255,7 @@ var __async = (__this, __arguments, generator) => {
255
255
  return arr.findIndex((item) => looseEqual(item, val));
256
256
  }
257
257
  const toDisplayString = (val) => {
258
- return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$2(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
258
+ return isString(val) ? val : val == null ? "" : isArray$1(val) || isObject$3(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
259
259
  };
260
260
  const replacer = (_key, val) => {
261
261
  if (val && val.__v_isRef) {
@@ -271,7 +271,7 @@ var __async = (__this, __arguments, generator) => {
271
271
  return {
272
272
  [`Set(${val.size})`]: [...val.values()]
273
273
  };
274
- } else if (isObject$2(val) && !isArray$1(val) && !isPlainObject$4(val)) {
274
+ } else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$4(val)) {
275
275
  return String(val);
276
276
  }
277
277
  return val;
@@ -664,7 +664,7 @@ var __async = (__this, __arguments, generator) => {
664
664
  if (isRef(res)) {
665
665
  return targetIsArray && isIntegerKey(key) ? res : res.value;
666
666
  }
667
- if (isObject$2(res)) {
667
+ if (isObject$3(res)) {
668
668
  return isReadonly2 ? readonly(res) : reactive(res);
669
669
  }
670
670
  return res;
@@ -1058,7 +1058,7 @@ var __async = (__this, __arguments, generator) => {
1058
1058
  );
1059
1059
  }
1060
1060
  function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
1061
- if (!isObject$2(target)) {
1061
+ if (!isObject$3(target)) {
1062
1062
  return target;
1063
1063
  }
1064
1064
  if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
@@ -1102,8 +1102,8 @@ var __async = (__this, __arguments, generator) => {
1102
1102
  def(value, "__v_skip", true);
1103
1103
  return value;
1104
1104
  }
1105
- const toReactive = (value) => isObject$2(value) ? reactive(value) : value;
1106
- const toReadonly = (value) => isObject$2(value) ? readonly(value) : value;
1105
+ const toReactive = (value) => isObject$3(value) ? reactive(value) : value;
1106
+ const toReadonly = (value) => isObject$3(value) ? readonly(value) : value;
1107
1107
  function trackRefValue(ref2) {
1108
1108
  if (shouldTrack && activeEffect) {
1109
1109
  ref2 = toRaw(ref2);
@@ -1213,7 +1213,7 @@ var __async = (__this, __arguments, generator) => {
1213
1213
  return source;
1214
1214
  } else if (isFunction$1(source)) {
1215
1215
  return new GetterRefImpl(source);
1216
- } else if (isObject$2(source) && arguments.length > 1) {
1216
+ } else if (isObject$3(source) && arguments.length > 1) {
1217
1217
  return propertyToRef(source, key, defaultValue);
1218
1218
  } else {
1219
1219
  return ref(source);
@@ -1533,7 +1533,7 @@ var __async = (__this, __arguments, generator) => {
1533
1533
  }
1534
1534
  }
1535
1535
  if (!raw && !hasExtends) {
1536
- if (isObject$2(comp)) {
1536
+ if (isObject$3(comp)) {
1537
1537
  cache.set(comp, null);
1538
1538
  }
1539
1539
  return null;
@@ -1543,7 +1543,7 @@ var __async = (__this, __arguments, generator) => {
1543
1543
  } else {
1544
1544
  extend(normalized, raw);
1545
1545
  }
1546
- if (isObject$2(comp)) {
1546
+ if (isObject$3(comp)) {
1547
1547
  cache.set(comp, normalized);
1548
1548
  }
1549
1549
  return normalized;
@@ -1951,7 +1951,7 @@ var __async = (__this, __arguments, generator) => {
1951
1951
  };
1952
1952
  }
1953
1953
  function traverse(value, seen) {
1954
- if (!isObject$2(value) || value["__v_skip"]) {
1954
+ if (!isObject$3(value) || value["__v_skip"]) {
1955
1955
  return value;
1956
1956
  }
1957
1957
  seen = seen || /* @__PURE__ */ new Set();
@@ -2486,7 +2486,7 @@ var __async = (__this, __arguments, generator) => {
2486
2486
  for (let i = 0; i < source; i++) {
2487
2487
  ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
2488
2488
  }
2489
- } else if (isObject$2(source)) {
2489
+ } else if (isObject$3(source)) {
2490
2490
  if (source[Symbol.iterator]) {
2491
2491
  ret = Array.from(
2492
2492
  source,
@@ -2763,7 +2763,7 @@ var __async = (__this, __arguments, generator) => {
2763
2763
  }
2764
2764
  if (dataOptions) {
2765
2765
  const data = dataOptions.call(publicThis, publicThis);
2766
- if (!isObject$2(data))
2766
+ if (!isObject$3(data))
2767
2767
  ;
2768
2768
  else {
2769
2769
  instance.data = reactive(data);
@@ -2851,7 +2851,7 @@ var __async = (__this, __arguments, generator) => {
2851
2851
  for (const key in injectOptions) {
2852
2852
  const opt = injectOptions[key];
2853
2853
  let injected;
2854
- if (isObject$2(opt)) {
2854
+ if (isObject$3(opt)) {
2855
2855
  if ("default" in opt) {
2856
2856
  injected = inject(
2857
2857
  opt.from || key,
@@ -2893,7 +2893,7 @@ var __async = (__this, __arguments, generator) => {
2893
2893
  }
2894
2894
  } else if (isFunction$1(raw)) {
2895
2895
  watch(getter, raw.bind(publicThis));
2896
- } else if (isObject$2(raw)) {
2896
+ } else if (isObject$3(raw)) {
2897
2897
  if (isArray$1(raw)) {
2898
2898
  raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
2899
2899
  } else {
@@ -2930,7 +2930,7 @@ var __async = (__this, __arguments, generator) => {
2930
2930
  }
2931
2931
  mergeOptions(resolved, base, optionMergeStrategies);
2932
2932
  }
2933
- if (isObject$2(base)) {
2933
+ if (isObject$3(base)) {
2934
2934
  cache.set(base, resolved);
2935
2935
  }
2936
2936
  return resolved;
@@ -3071,7 +3071,7 @@ var __async = (__this, __arguments, generator) => {
3071
3071
  if (!isFunction$1(rootComponent)) {
3072
3072
  rootComponent = extend({}, rootComponent);
3073
3073
  }
3074
- if (rootProps != null && !isObject$2(rootProps)) {
3074
+ if (rootProps != null && !isObject$3(rootProps)) {
3075
3075
  rootProps = null;
3076
3076
  }
3077
3077
  const context = createAppContext();
@@ -3415,7 +3415,7 @@ var __async = (__this, __arguments, generator) => {
3415
3415
  }
3416
3416
  }
3417
3417
  if (!raw && !hasExtends) {
3418
- if (isObject$2(comp)) {
3418
+ if (isObject$3(comp)) {
3419
3419
  cache.set(comp, EMPTY_ARR);
3420
3420
  }
3421
3421
  return EMPTY_ARR;
@@ -3452,7 +3452,7 @@ var __async = (__this, __arguments, generator) => {
3452
3452
  }
3453
3453
  }
3454
3454
  const res = [normalized, needCastKeys];
3455
- if (isObject$2(comp)) {
3455
+ if (isObject$3(comp)) {
3456
3456
  cache.set(comp, res);
3457
3457
  }
3458
3458
  return res;
@@ -5116,14 +5116,14 @@ var __async = (__this, __arguments, generator) => {
5116
5116
  if (klass && !isString(klass)) {
5117
5117
  props.class = normalizeClass(klass);
5118
5118
  }
5119
- if (isObject$2(style)) {
5119
+ if (isObject$3(style)) {
5120
5120
  if (isProxy(style) && !isArray$1(style)) {
5121
5121
  style = extend({}, style);
5122
5122
  }
5123
5123
  props.style = normalizeStyle(style);
5124
5124
  }
5125
5125
  }
5126
- const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$2(type) ? 4 : isFunction$1(type) ? 2 : 0;
5126
+ const shapeFlag = isString(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$3(type) ? 4 : isFunction$1(type) ? 2 : 0;
5127
5127
  return createBaseVNode(
5128
5128
  type,
5129
5129
  props,
@@ -5460,7 +5460,7 @@ var __async = (__this, __arguments, generator) => {
5460
5460
  } else {
5461
5461
  instance.render = setupResult;
5462
5462
  }
5463
- } else if (isObject$2(setupResult)) {
5463
+ } else if (isObject$3(setupResult)) {
5464
5464
  instance.setupState = proxyRefs(setupResult);
5465
5465
  } else
5466
5466
  ;
@@ -5552,7 +5552,7 @@ var __async = (__this, __arguments, generator) => {
5552
5552
  function h$1(type, propsOrChildren, children) {
5553
5553
  const l = arguments.length;
5554
5554
  if (l === 2) {
5555
- if (isObject$2(propsOrChildren) && !isArray$1(propsOrChildren)) {
5555
+ if (isObject$3(propsOrChildren) && !isArray$1(propsOrChildren)) {
5556
5556
  if (isVNode(propsOrChildren)) {
5557
5557
  return createVNode(type, null, [propsOrChildren]);
5558
5558
  }
@@ -6058,7 +6058,7 @@ var __async = (__this, __arguments, generator) => {
6058
6058
  function normalizeDuration(duration) {
6059
6059
  if (duration == null) {
6060
6060
  return null;
6061
- } else if (isObject$2(duration)) {
6061
+ } else if (isObject$3(duration)) {
6062
6062
  return [NumberOf(duration.enter), NumberOf(duration.leave)];
6063
6063
  } else {
6064
6064
  const n = NumberOf(duration);
@@ -12904,18 +12904,18 @@ var __async = (__this, __arguments, generator) => {
12904
12904
  * Copyright (c) 2014-2017, Jon Schlinkert.
12905
12905
  * Released under the MIT License.
12906
12906
  */
12907
- function isObject(o) {
12907
+ function isObject$2(o) {
12908
12908
  return Object.prototype.toString.call(o) === "[object Object]";
12909
12909
  }
12910
12910
  function isPlainObject$1(o) {
12911
12911
  var ctor, prot;
12912
- if (isObject(o) === false)
12912
+ if (isObject$2(o) === false)
12913
12913
  return false;
12914
12914
  ctor = o.constructor;
12915
12915
  if (ctor === void 0)
12916
12916
  return true;
12917
12917
  prot = ctor.prototype;
12918
- if (isObject(prot) === false)
12918
+ if (isObject$2(prot) === false)
12919
12919
  return false;
12920
12920
  if (prot.hasOwnProperty("isPrototypeOf") === false) {
12921
12921
  return false;
@@ -17701,12 +17701,12 @@ and ensure you are accounting for this risk.
17701
17701
  enforceHtmlBoundary: false,
17702
17702
  parseStyleAttributes: true
17703
17703
  };
17704
- sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge) {
17705
- merge = merge === void 0 ? true : merge;
17704
+ sanitizeHtml.simpleTransform = function(newTagName, newAttribs, merge2) {
17705
+ merge2 = merge2 === void 0 ? true : merge2;
17706
17706
  newAttribs = newAttribs || {};
17707
17707
  return function(tagName, attribs) {
17708
17708
  let attrib;
17709
- if (merge) {
17709
+ if (merge2) {
17710
17710
  for (attrib in newAttribs) {
17711
17711
  attribs[attrib] = newAttribs[attrib];
17712
17712
  }
@@ -19704,6 +19704,74 @@ and ensure you are accounting for this risk.
19704
19704
  };
19705
19705
  }
19706
19706
  });
19707
+ const extractValue = (options) => {
19708
+ switch (options.extractFrom) {
19709
+ case "url":
19710
+ return extractFromUrl(options);
19711
+ case "localStorage":
19712
+ case "sessionStorage":
19713
+ return extractFromStorage(options);
19714
+ case "htmlElementText":
19715
+ return extractFromHtmlElementText(options);
19716
+ case "cookie":
19717
+ return extractFromCookie(options);
19718
+ default:
19719
+ return options.default;
19720
+ }
19721
+ };
19722
+ const extractFromCookie = (options) => {
19723
+ var _a, _b;
19724
+ try {
19725
+ const cookieValue = (_b = (_a = document.cookie) == null ? void 0 : _a.split("; ")) == null ? void 0 : _b.find((row) => row == null ? void 0 : row.startsWith(`${options.cookieName}=`));
19726
+ return cookieValue ? cookieValue.split("=")[1] : options.default;
19727
+ } catch (e2) {
19728
+ return options.default;
19729
+ }
19730
+ };
19731
+ const extractFromUrl = (options) => {
19732
+ const regex = new RegExp(options.regex);
19733
+ const match = window.location.href.match(regex);
19734
+ return match ? match[1] : options.default;
19735
+ };
19736
+ const extractFromStorage = (options) => {
19737
+ const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
19738
+ let rawValue2 = "";
19739
+ try {
19740
+ rawValue2 = storage.getItem(options.key);
19741
+ } catch (e2) {
19742
+ return options.default;
19743
+ }
19744
+ if (rawValue2) {
19745
+ try {
19746
+ const parsedValue = JSON.parse(rawValue2);
19747
+ return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
19748
+ } catch (e2) {
19749
+ return rawValue2;
19750
+ }
19751
+ }
19752
+ return options.default;
19753
+ };
19754
+ const extractFromHtmlElementText = (options) => {
19755
+ var _a;
19756
+ const element = document.querySelector(options.querySelector);
19757
+ return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
19758
+ };
19759
+ const getValueFromPath = (obj, path) => {
19760
+ return path.split(".").reduce((value, key) => value && value[key] || null, obj);
19761
+ };
19762
+ const processExtractionObject = (value = {}) => {
19763
+ var _a;
19764
+ const parsedObject = {};
19765
+ for (const key in value) {
19766
+ if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
19767
+ const extractedValue = extractValue(value[key]);
19768
+ parsedObject[key] = Array.isArray(extractedValue) ? extractedValue : [extractedValue];
19769
+ } else {
19770
+ parsedObject[key] = value[key];
19771
+ }
19772
+ }
19773
+ return parsedObject;
19774
+ };
19707
19775
  const _sfc_main$11 = /* @__PURE__ */ defineComponent({
19708
19776
  __name: "SearchBoxProductsWrapper",
19709
19777
  props: {
@@ -19727,6 +19795,9 @@ and ensure you are accounting for this risk.
19727
19795
  const showGoToResultsButton = computed(() => {
19728
19796
  return props.panel.showGoToResults;
19729
19797
  });
19798
+ const extractedInitialFilters = computed(() => {
19799
+ return __spreadValues2({}, processExtractionObject(props.searchBoxOptions.initialFilters));
19800
+ });
19730
19801
  const inputValueProp = computed(() => props.inputValue);
19731
19802
  onMounted(() => {
19732
19803
  getItemsDebounced();
@@ -19744,7 +19815,11 @@ and ensure you are accounting for this risk.
19744
19815
  const getItems = () => {
19745
19816
  searchBoxStore.queryDocuments({
19746
19817
  queryKey: props.panel.queryKey,
19747
- publicQuery: { searchText: props.inputValue, limit: props.panel.limit },
19818
+ publicQuery: {
19819
+ searchText: props.inputValue,
19820
+ limit: props.panel.limit,
19821
+ filters: extractedInitialFilters.value
19822
+ },
19748
19823
  options: props.options
19749
19824
  }).then(({ result: result2 }) => {
19750
19825
  if (!(result2 == null ? void 0 : result2.items.length)) {
@@ -20173,6 +20248,9 @@ and ensure you are accounting for this risk.
20173
20248
  const focused = ref(false);
20174
20249
  const searchBoxInput = ref(null);
20175
20250
  const { highlightedDocument } = storeToRefs(searchBoxStore);
20251
+ computed(() => {
20252
+ return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
20253
+ });
20176
20254
  const searchValue = computed(() => {
20177
20255
  return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
20178
20256
  });
@@ -20198,7 +20276,8 @@ and ensure you are accounting for this risk.
20198
20276
  "hideMoreResultsButtonOnNoResults",
20199
20277
  "showNoResultsPanel",
20200
20278
  "expandOnSinglePanel",
20201
- "showMoreResultsButton"
20279
+ "showMoreResultsButton",
20280
+ "initialFilters"
20202
20281
  ])
20203
20282
  );
20204
20283
  const searchTriggers = computed(() => {
@@ -25433,9 +25512,12 @@ and ensure you are accounting for this risk.
25433
25512
  const dynamicDataStore = useDynamicDataStore();
25434
25513
  const screenStore = useScreenStore();
25435
25514
  const redirectionStore = useRedirectionStore();
25515
+ const extractedInitialFilters = computed(() => {
25516
+ return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
25517
+ });
25436
25518
  const initialFilters = computed(() => {
25437
- var _a;
25438
- return (_a = props.initialFilters) != null ? _a : {};
25519
+ var _a, _b;
25520
+ return (_b = (_a = props.initialFilters) != null ? _a : extractedInitialFilters.value) != null ? _b : {};
25439
25521
  });
25440
25522
  const { currentQueryText, hasResults, currentFilterCount } = storeToRefs(searchResultStore);
25441
25523
  const { searchString, sortParams } = storeToRefs(paramStore);
@@ -25741,62 +25823,6 @@ and ensure you are accounting for this risk.
25741
25823
  };
25742
25824
  }
25743
25825
  });
25744
- const extractValue = (options) => {
25745
- switch (options.extractFrom) {
25746
- case "url":
25747
- return extractFromUrl(options);
25748
- case "localStorage":
25749
- case "sessionStorage":
25750
- return extractFromStorage(options);
25751
- case "htmlElementText":
25752
- return extractFromHtmlElementText(options);
25753
- default:
25754
- return options.default;
25755
- }
25756
- };
25757
- const extractFromUrl = (options) => {
25758
- const regex = new RegExp(options.regex);
25759
- const match = window.location.href.match(regex);
25760
- return match ? match[1] : options.default;
25761
- };
25762
- const extractFromStorage = (options) => {
25763
- const storage = options.extractFrom === "localStorage" ? localStorage : sessionStorage;
25764
- let rawValue2 = "";
25765
- try {
25766
- rawValue2 = storage.getItem(options.key);
25767
- } catch (e2) {
25768
- return options.default;
25769
- }
25770
- if (rawValue2) {
25771
- try {
25772
- const parsedValue = JSON.parse(rawValue2);
25773
- return options.path ? getValueFromPath(parsedValue, options.path) : parsedValue;
25774
- } catch (e2) {
25775
- return rawValue2;
25776
- }
25777
- }
25778
- return options.default;
25779
- };
25780
- const extractFromHtmlElementText = (options) => {
25781
- var _a;
25782
- const element = document.querySelector(options.querySelector);
25783
- return element ? ((_a = element.textContent) == null ? void 0 : _a.trim()) || options.default : options.default;
25784
- };
25785
- const getValueFromPath = (obj, path) => {
25786
- return path.split(".").reduce((value, key) => value && value[key] || null, obj);
25787
- };
25788
- const processExtractionObject = (value = {}) => {
25789
- var _a;
25790
- const parsedObject = {};
25791
- for (const key in value) {
25792
- if (isObject$1(value[key]) && ((_a = value[key]) == null ? void 0 : _a.extractFrom)) {
25793
- parsedObject[key] = extractValue(value[key]);
25794
- } else {
25795
- parsedObject[key] = value[key];
25796
- }
25797
- }
25798
- return parsedObject;
25799
- };
25800
25826
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
25801
25827
  __name: "ProductList",
25802
25828
  props: {
@@ -25816,7 +25842,7 @@ and ensure you are accounting for this risk.
25816
25842
  var _a;
25817
25843
  (_a = searchResults2.value) == null ? void 0 : _a.handleMounted();
25818
25844
  };
25819
- computed(() => {
25845
+ const initialFilters = computed(() => {
25820
25846
  return __spreadValues2({}, processExtractionObject(props.options.initialFilters));
25821
25847
  });
25822
25848
  __expose({ fetch: fetch2 });
@@ -25824,7 +25850,7 @@ and ensure you are accounting for this risk.
25824
25850
  return openBlock(), createElementBlock("div", null, [
25825
25851
  createVNode(_sfc_main$e, {
25826
25852
  options: componentOptions.value,
25827
- "initial-filters": _ctx.options.initialFilters,
25853
+ "initial-filters": initialFilters.value,
25828
25854
  "is-product-list": true,
25829
25855
  ref_key: "searchResults",
25830
25856
  ref: searchResults2
@@ -30212,7 +30238,7 @@ and ensure you are accounting for this risk.
30212
30238
  });
30213
30239
  return result3;
30214
30240
  }
30215
- var merge = createAssigner(function(object, source, srcIndex) {
30241
+ var merge2 = createAssigner(function(object, source, srcIndex) {
30216
30242
  baseMerge(object, source, srcIndex);
30217
30243
  });
30218
30244
  var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
@@ -30902,7 +30928,7 @@ and ensure you are accounting for this risk.
30902
30928
  lodash2.matches = matches;
30903
30929
  lodash2.matchesProperty = matchesProperty;
30904
30930
  lodash2.memoize = memoize;
30905
- lodash2.merge = merge;
30931
+ lodash2.merge = merge2;
30906
30932
  lodash2.mergeWith = mergeWith;
30907
30933
  lodash2.method = method;
30908
30934
  lodash2.methodOf = methodOf;
@@ -37738,7 +37764,7 @@ and ensure you are accounting for this risk.
37738
37764
  });
37739
37765
  return result3;
37740
37766
  }
37741
- var merge = createAssigner(function(object, source, srcIndex) {
37767
+ var merge2 = createAssigner(function(object, source, srcIndex) {
37742
37768
  baseMerge(object, source, srcIndex);
37743
37769
  });
37744
37770
  var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
@@ -38428,7 +38454,7 @@ and ensure you are accounting for this risk.
38428
38454
  lodash2.matches = matches;
38429
38455
  lodash2.matchesProperty = matchesProperty;
38430
38456
  lodash2.memoize = memoize;
38431
- lodash2.merge = merge;
38457
+ lodash2.merge = merge2;
38432
38458
  lodash2.mergeWith = mergeWith;
38433
38459
  lodash2.method = method;
38434
38460
  lodash2.methodOf = methodOf;
@@ -39585,6 +39611,14 @@ and ensure you are accounting for this risk.
39585
39611
  }, interval);
39586
39612
  });
39587
39613
  });
39614
+ const isObject = (item) => typeof item === "object" && !Array.isArray(item);
39615
+ const merge = (target, source) => {
39616
+ const isDeep = (prop) => isObject(source[prop]) && Object.prototype.hasOwnProperty.call(target, prop) && isObject(target[prop]);
39617
+ const replaced = Object.getOwnPropertyNames(source).map((prop) => ({
39618
+ [prop]: isDeep(prop) ? merge(target[prop], source[prop]) : source[prop]
39619
+ })).reduce((a, b) => __spreadValues(__spreadValues({}, a), b), {});
39620
+ return __spreadValues(__spreadValues({}, target), replaced);
39621
+ };
39588
39622
  const saveToLocalStorage = (key, value) => {
39589
39623
  try {
39590
39624
  localStorage.setItem(key, JSON.stringify(value));
@@ -39636,7 +39670,7 @@ and ensure you are accounting for this risk.
39636
39670
  const PREVIEW_PARAMETER = "lupaSearchPreview";
39637
39671
  const MAX_ELEMENT_MOUNT_RETRIES = 25;
39638
39672
  let styleElement = null;
39639
- const loadAndSaveConfigurationFromServer = (configurationKey, options) => __async(this, null, function* () {
39673
+ const loadAndSaveConfigurationFromServer = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }) {
39640
39674
  const configuration = yield fetchPluginConfiguration(
39641
39675
  options,
39642
39676
  configurationKey
@@ -39661,7 +39695,7 @@ and ensure you are accounting for this risk.
39661
39695
  }
39662
39696
  return isPreviewMode;
39663
39697
  };
39664
- const loadConfigurations = (configurationKey, isPreviewMode, options) => __async(this, null, function* () {
39698
+ const loadConfigurations = (configurationKey, isPreviewMode, options, optionOverrides) => __async(this, null, function* () {
39665
39699
  if (isPreviewMode) {
39666
39700
  return loadAndSaveConfigurationFromServer(configurationKey, options);
39667
39701
  }
@@ -39679,7 +39713,7 @@ and ensure you are accounting for this risk.
39679
39713
  const isPreviewMode2 = checkIsPreviewMode();
39680
39714
  const configuration = isPreviewMode2 ? (_a = newestConfiguration.previewConfiguration) != null ? _a : newestConfiguration.configuration : newestConfiguration.configuration;
39681
39715
  if (configuration) {
39682
- yield mount(configuration, options, false, true);
39716
+ yield mount(configuration, options, optionOverrides, false, true);
39683
39717
  } else {
39684
39718
  removeFromLocalStorage(configurationKey);
39685
39719
  window.location.reload();
@@ -39710,7 +39744,8 @@ and ensure you are accounting for this risk.
39710
39744
  }
39711
39745
  document.head.appendChild(styleElement);
39712
39746
  });
39713
- const mountSearchBox = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39747
+ const mountSearchBox = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
39748
+ var _a;
39714
39749
  if (!configuration.searchBox) {
39715
39750
  return;
39716
39751
  }
@@ -39727,9 +39762,11 @@ and ensure you are accounting for this risk.
39727
39762
  );
39728
39763
  return;
39729
39764
  }
39730
- searchBox(__spreadProps(__spreadValues({}, resolvedConfiguration), { options }), { fetch: fetch2, allowedMountUrls });
39765
+ const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchBox) != null ? _a : {});
39766
+ searchBox(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
39731
39767
  });
39732
- const mountSearchResults = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39768
+ const mountSearchResults = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
39769
+ var _a;
39733
39770
  if (!configuration.searchResults) {
39734
39771
  return;
39735
39772
  }
@@ -39746,9 +39783,11 @@ and ensure you are accounting for this risk.
39746
39783
  );
39747
39784
  return;
39748
39785
  }
39749
- searchResults(__spreadProps(__spreadValues({}, resolvedConfiguration), { options }), { fetch: fetch2, allowedMountUrls });
39786
+ const mergedOptions = merge(resolvedConfiguration, (_a = optionOverrides == null ? void 0 : optionOverrides.searchResults) != null ? _a : {});
39787
+ searchResults(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
39750
39788
  });
39751
- const mountProductList = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39789
+ const mountProductList = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
39790
+ var _a;
39752
39791
  if (!configuration.productList) {
39753
39792
  return;
39754
39793
  }
@@ -39768,12 +39807,14 @@ and ensure you are accounting for this risk.
39768
39807
  );
39769
39808
  return;
39770
39809
  }
39771
- productList(
39772
- __spreadProps(__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { options }),
39773
- { fetch: fetch2, allowedMountUrls }
39810
+ const mergedOptions = merge(
39811
+ __spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
39812
+ (_a = optionOverrides == null ? void 0 : optionOverrides.productList) != null ? _a : {}
39774
39813
  );
39814
+ productList(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
39775
39815
  });
39776
- const mountRecommendations = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39816
+ const mountRecommendations = (configuration, options, optionOverrides, fetch2 = true, remount = false) => __async(this, null, function* () {
39817
+ var _a;
39777
39818
  if (!configuration.recommendations) {
39778
39819
  return;
39779
39820
  }
@@ -39795,10 +39836,11 @@ and ensure you are accounting for this risk.
39795
39836
  );
39796
39837
  return;
39797
39838
  }
39798
- recommendations(
39799
- __spreadProps(__spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration), { options }),
39800
- { fetch: fetch2, allowedMountUrls }
39839
+ const mergedOptions = merge(
39840
+ __spreadValues(__spreadValues({}, resolvedSearchResultsConfiguration), resolvedConfiguration),
39841
+ (_a = optionOverrides == null ? void 0 : optionOverrides.recommendations) != null ? _a : {}
39801
39842
  );
39843
+ recommendations(__spreadProps(__spreadValues({}, mergedOptions), { options }), { fetch: fetch2, allowedMountUrls });
39802
39844
  });
39803
39845
  const mountChat = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39804
39846
  if (!configuration.genAiChat) {
@@ -39825,24 +39867,24 @@ and ensure you are accounting for this risk.
39825
39867
  { fetch: fetch2, allowedMountUrls }
39826
39868
  );
39827
39869
  });
39828
- const mount = (configuration, options, fetch2 = true, remount = false) => __async(this, null, function* () {
39870
+ const mount = (_0, ..._1) => __async(this, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
39829
39871
  yield applyStyles(configuration);
39830
39872
  const mountPromises = [
39831
- mountSearchBox(configuration, options, fetch2, remount),
39832
- mountSearchResults(configuration, options, fetch2, remount),
39833
- mountProductList(configuration, options, fetch2, remount),
39834
- mountRecommendations(configuration, options, fetch2, remount),
39873
+ mountSearchBox(configuration, options, optionOverrides, fetch2, remount),
39874
+ mountSearchResults(configuration, options, optionOverrides, fetch2, remount),
39875
+ mountProductList(configuration, options, optionOverrides, fetch2, remount),
39876
+ mountRecommendations(configuration, options, optionOverrides, fetch2, remount),
39835
39877
  mountChat(configuration, options, fetch2, remount)
39836
39878
  ];
39837
39879
  yield Promise.all(mountPromises);
39838
39880
  });
39839
- const init$1 = (configurationKey, options) => __async(this, null, function* () {
39881
+ const init$1 = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
39840
39882
  var _a;
39841
39883
  const isPreviewMode = checkIsPreviewMode();
39842
- const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options);
39884
+ const plugin = yield loadConfigurations(configurationKey, isPreviewMode, options, optionOverrides);
39843
39885
  const configuration = isPreviewMode ? (_a = plugin.previewConfiguration) != null ? _a : plugin.configuration : plugin.configuration;
39844
39886
  if (configuration) {
39845
- yield mount(configuration, options);
39887
+ yield mount(configuration, options, optionOverrides);
39846
39888
  }
39847
39889
  });
39848
39890
  const PluginConfigurationManager = {
@@ -39851,8 +39893,8 @@ and ensure you are accounting for this risk.
39851
39893
  const tracking = (options) => {
39852
39894
  setupTracking(options);
39853
39895
  };
39854
- const init = (configurationKey, options) => {
39855
- return PluginConfigurationManager.init(configurationKey, options);
39896
+ const init = (configurationKey, options, optionOverrides) => {
39897
+ return PluginConfigurationManager.init(configurationKey, options, optionOverrides);
39856
39898
  };
39857
39899
  const lupaSearch = {
39858
39900
  init,