@getlupa/client 1.8.5 → 1.8.7

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.
@@ -6399,6 +6399,37 @@ const inputsAreEqual = (input, possibleValues) => {
6399
6399
  const normalizedInput = getNormalizedString(input);
6400
6400
  return possibleValues.some((v) => getNormalizedString(v) === normalizedInput);
6401
6401
  };
6402
+ const levenshteinDistance = (s = "", t = "") => {
6403
+ if (!(s == null ? void 0 : s.length)) {
6404
+ return t.length;
6405
+ }
6406
+ if (!(t == null ? void 0 : t.length)) {
6407
+ return s.length;
6408
+ }
6409
+ const arr = [];
6410
+ for (let i = 0; i <= t.length; i++) {
6411
+ arr[i] = [i];
6412
+ for (let j = 1; j <= s.length; j++) {
6413
+ arr[i][j] = i === 0 ? j : Math.min(
6414
+ arr[i - 1][j] + 1,
6415
+ arr[i][j - 1] + 1,
6416
+ arr[i - 1][j - 1] + (s[j - 1] === t[i - 1] ? 0 : 1)
6417
+ );
6418
+ }
6419
+ }
6420
+ return arr[t.length][s.length];
6421
+ };
6422
+ const findClosestStringValue = (input, possibleValues, key) => {
6423
+ var _a;
6424
+ const directMatch = possibleValues.find((v) => v[key] === input);
6425
+ if (directMatch) {
6426
+ return directMatch;
6427
+ }
6428
+ const distances = possibleValues.map((v) => levenshteinDistance(`${v[key]}`, input));
6429
+ const minDistance = Math.min(...distances);
6430
+ const closestValue = (_a = possibleValues.filter((_, i) => distances[i] === minDistance)) == null ? void 0 : _a[0];
6431
+ return closestValue;
6432
+ };
6402
6433
  const initAnalyticsTracking = (analyticsOptions) => {
6403
6434
  try {
6404
6435
  if (analyticsOptions == null ? void 0 : analyticsOptions.enabled) {
@@ -7808,7 +7839,7 @@ const useSearchBoxStore = defineStore("searchBox", () => {
7808
7839
  });
7809
7840
  const _hoisted_1$1c = { id: "lupa-search-box-input-container" };
7810
7841
  const _hoisted_2$P = { class: "lupa-input-clear" };
7811
- const _hoisted_3$B = { id: "lupa-search-box-input" };
7842
+ const _hoisted_3$A = { id: "lupa-search-box-input" };
7812
7843
  const _hoisted_4$s = ["value"];
7813
7844
  const _hoisted_5$g = ["aria-label", "placeholder"];
7814
7845
  const _hoisted_6$9 = {
@@ -7903,7 +7934,7 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
7903
7934
  onClick: clear2
7904
7935
  }, null, 2)
7905
7936
  ]),
7906
- createBaseVNode("div", _hoisted_3$B, [
7937
+ createBaseVNode("div", _hoisted_3$A, [
7907
7938
  createBaseVNode("input", {
7908
7939
  class: "lupa-hint",
7909
7940
  "aria-hidden": "true",
@@ -8084,7 +8115,7 @@ const _hoisted_2$N = {
8084
8115
  "data-cy": "lupa-suggestion-value",
8085
8116
  class: "lupa-suggestion-value"
8086
8117
  };
8087
- const _hoisted_3$A = {
8118
+ const _hoisted_3$z = {
8088
8119
  key: 2,
8089
8120
  class: "lupa-suggestion-facet",
8090
8121
  "data-cy": "lupa-suggestion-facet"
@@ -8134,7 +8165,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
8134
8165
  "data-cy": "lupa-suggestion-value",
8135
8166
  innerHTML: _ctx.suggestion.displayHighlight
8136
8167
  }, null, 8, _hoisted_1$18)) : (openBlock(), createElementBlock("div", _hoisted_2$N, toDisplayString(_ctx.suggestion.display), 1)),
8137
- _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$A, [
8168
+ _ctx.suggestion.facet ? (openBlock(), createElementBlock("div", _hoisted_3$z, [
8138
8169
  createBaseVNode("span", _hoisted_4$r, toDisplayString(facetLabel.value), 1),
8139
8170
  createBaseVNode("span", _hoisted_5$f, toDisplayString(_ctx.suggestion.facet.title), 1)
8140
8171
  ])) : createCommentVNode("", true)
@@ -8548,7 +8579,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
8548
8579
  });
8549
8580
  const _hoisted_1$11 = ["innerHTML"];
8550
8581
  const _hoisted_2$K = { key: 0 };
8551
- const _hoisted_3$z = { key: 1 };
8582
+ const _hoisted_3$y = { key: 1 };
8552
8583
  const _hoisted_4$q = { class: "lupa-search-box-custom-label" };
8553
8584
  const _hoisted_5$e = { class: "lupa-search-box-custom-text" };
8554
8585
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
@@ -8581,7 +8612,7 @@ const _sfc_main$16 = /* @__PURE__ */ defineComponent({
8581
8612
  key: 1,
8582
8613
  class: [className.value, "lupa-search-box-product-custom"]
8583
8614
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
8584
- !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$K, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$z, [
8615
+ !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$K, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$y, [
8585
8616
  createBaseVNode("div", _hoisted_4$q, toDisplayString(label.value), 1),
8586
8617
  createBaseVNode("div", _hoisted_5$e, toDisplayString(text.value), 1)
8587
8618
  ]))
@@ -8806,7 +8837,7 @@ const useSearchResultStore = defineStore("searchResult", () => {
8806
8837
  });
8807
8838
  const _hoisted_1$$ = { class: "lupa-search-box-add-to-cart-wrapper" };
8808
8839
  const _hoisted_2$J = { class: "lupa-search-box-product-addtocart" };
8809
- const _hoisted_3$y = ["onClick", "disabled"];
8840
+ const _hoisted_3$x = ["onClick", "disabled"];
8810
8841
  const _sfc_main$14 = /* @__PURE__ */ defineComponent({
8811
8842
  __name: "SearchBoxProductAddToCart",
8812
8843
  props: {
@@ -8842,7 +8873,7 @@ const _sfc_main$14 = /* @__PURE__ */ defineComponent({
8842
8873
  "data-cy": "lupa-add-to-cart",
8843
8874
  type: "button",
8844
8875
  disabled: !inStockValue.value || loading.value
8845
- }, toDisplayString(label.value), 11, _hoisted_3$y)
8876
+ }, toDisplayString(label.value), 11, _hoisted_3$x)
8846
8877
  ])
8847
8878
  ]);
8848
8879
  };
@@ -8921,7 +8952,7 @@ const _sfc_main$13 = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValu
8921
8952
  }));
8922
8953
  const _hoisted_1$_ = ["href"];
8923
8954
  const _hoisted_2$I = { class: "lupa-search-box-product-image-section" };
8924
- const _hoisted_3$x = { class: "lupa-search-box-product-details-section" };
8955
+ const _hoisted_3$w = { class: "lupa-search-box-product-details-section" };
8925
8956
  const _hoisted_4$p = {
8926
8957
  key: 0,
8927
8958
  class: "lupa-search-box-product-add-to-cart-section"
@@ -8994,7 +9025,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
8994
9025
  }, null, 8, ["item", "element", "labels", "link"]);
8995
9026
  }), 128))
8996
9027
  ]),
8997
- createBaseVNode("div", _hoisted_3$x, [
9028
+ createBaseVNode("div", _hoisted_3$w, [
8998
9029
  (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
8999
9030
  return openBlock(), createBlock(_sfc_main$13, {
9000
9031
  class: "lupa-search-box-product-element",
@@ -9238,7 +9269,7 @@ const _hoisted_1$Y = {
9238
9269
  id: "lupa-search-box-panel"
9239
9270
  };
9240
9271
  const _hoisted_2$H = ["data-cy"];
9241
- const _hoisted_3$w = {
9272
+ const _hoisted_3$v = {
9242
9273
  key: 0,
9243
9274
  class: "lupa-panel-title"
9244
9275
  };
@@ -9390,7 +9421,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent(__spreadProps2(__spreadValue
9390
9421
  ]),
9391
9422
  "data-cy": "lupa-panel-" + panel.type + "-index"
9392
9423
  }, [
9393
- ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$w, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9424
+ ((_a2 = panel.labels) == null ? void 0 : _a2.topResultsTitle) && showTopResultsPanelTitle(panel.queryKey) ? (openBlock(), createElementBlock("div", _hoisted_3$v, toDisplayString((_b = panel.labels) == null ? void 0 : _b.topResultsTitle), 1)) : createCommentVNode("", true),
9394
9425
  panel.queryKey ? (openBlock(), createBlock(resolveDynamicComponent(getComponent(panel.type)), {
9395
9426
  key: 1,
9396
9427
  panel,
@@ -9797,7 +9828,7 @@ const _hoisted_2$F = {
9797
9828
  key: 0,
9798
9829
  "data-cy": "suggested-search-text-label"
9799
9830
  };
9800
- const _hoisted_3$v = {
9831
+ const _hoisted_3$u = {
9801
9832
  key: 1,
9802
9833
  "data-cy": "did-you-mean-label"
9803
9834
  };
@@ -9844,7 +9875,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
9844
9875
  ]);
9845
9876
  }), 128))
9846
9877
  ])) : createCommentVNode("", true),
9847
- didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$v, [
9878
+ didYouMeanValue.value ? (openBlock(), createElementBlock("div", _hoisted_3$u, [
9848
9879
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.labels.didYouMean.split(" "), (label, index) => {
9849
9880
  return openBlock(), createElementBlock("span", { key: index }, [
9850
9881
  label.includes("{1}") ? (openBlock(), createElementBlock("span", {
@@ -9898,7 +9929,7 @@ const _hoisted_1$U = {
9898
9929
  "data-cy": "lupa-result-page-title"
9899
9930
  };
9900
9931
  const _hoisted_2$D = { key: 0 };
9901
- const _hoisted_3$u = {
9932
+ const _hoisted_3$t = {
9902
9933
  key: 1,
9903
9934
  class: "lupa-results-total-count"
9904
9935
  };
@@ -9941,7 +9972,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
9941
9972
  showSearchTitle.value ? (openBlock(), createElementBlock("h1", _hoisted_1$U, [
9942
9973
  createTextVNode(toDisplayString(_ctx.options.labels.searchResults), 1),
9943
9974
  queryText.value ? (openBlock(), createElementBlock("span", _hoisted_2$D, "'" + toDisplayString(queryText.value) + "'", 1)) : createCommentVNode("", true),
9944
- showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$u, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
9975
+ showProductCount.value ? (openBlock(), createElementBlock("span", _hoisted_3$t, "(" + toDisplayString(unref(totalItems)) + ")", 1)) : createCommentVNode("", true)
9945
9976
  ])) : createCommentVNode("", true),
9946
9977
  _ctx.showSummary ? (openBlock(), createBlock(_sfc_main$Y, {
9947
9978
  key: 1,
@@ -9961,7 +9992,7 @@ const _hoisted_2$C = {
9961
9992
  class: "lupa-current-filter-label",
9962
9993
  "data-cy": "lupa-current-filter-label"
9963
9994
  };
9964
- const _hoisted_3$t = {
9995
+ const _hoisted_3$s = {
9965
9996
  class: "lupa-current-filter-value",
9966
9997
  "data-cy": "lupa-current-filter-value"
9967
9998
  };
@@ -9983,7 +10014,7 @@ const _sfc_main$W = /* @__PURE__ */ defineComponent({
9983
10014
  onClick: handleClick
9984
10015
  }, "⨉"),
9985
10016
  createBaseVNode("div", _hoisted_2$C, toDisplayString(_ctx.filter.label) + ": ", 1),
9986
- createBaseVNode("div", _hoisted_3$t, toDisplayString(_ctx.filter.value), 1)
10017
+ createBaseVNode("div", _hoisted_3$s, toDisplayString(_ctx.filter.value), 1)
9987
10018
  ]);
9988
10019
  };
9989
10020
  }
@@ -9993,7 +10024,7 @@ const _hoisted_2$B = {
9993
10024
  key: 0,
9994
10025
  class: "lupa-filter-count"
9995
10026
  };
9996
- const _hoisted_3$s = {
10027
+ const _hoisted_3$r = {
9997
10028
  key: 0,
9998
10029
  class: "filter-values"
9999
10030
  };
@@ -10062,7 +10093,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
10062
10093
  class: normalizeClass(["lupa-filter-title-caret", isOpen.value && "open"])
10063
10094
  }, null, 2)) : createCommentVNode("", true)
10064
10095
  ]),
10065
- !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$s, [
10096
+ !_ctx.expandable || isOpen.value ? (openBlock(), createElementBlock("div", _hoisted_3$r, [
10066
10097
  createBaseVNode("div", _hoisted_4$l, [
10067
10098
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(displayFilters), (filter) => {
10068
10099
  return openBlock(), createBlock(_sfc_main$W, {
@@ -10130,7 +10161,7 @@ const _hoisted_1$Q = {
10130
10161
  "data-cy": "lupa-category-filter"
10131
10162
  };
10132
10163
  const _hoisted_2$A = { class: "lupa-category-back" };
10133
- const _hoisted_3$r = ["href"];
10164
+ const _hoisted_3$q = ["href"];
10134
10165
  const _hoisted_4$k = ["href"];
10135
10166
  const _hoisted_5$d = { class: "lupa-child-category-list" };
10136
10167
  const _sfc_main$T = /* @__PURE__ */ defineComponent({
@@ -10226,7 +10257,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
10226
10257
  "data-cy": "lupa-category-back",
10227
10258
  href: backUrlLink.value,
10228
10259
  onClick: handleNavigationBack
10229
- }, toDisplayString(backTitle.value), 9, _hoisted_3$r)) : createCommentVNode("", true)
10260
+ }, toDisplayString(backTitle.value), 9, _hoisted_3$q)) : createCommentVNode("", true)
10230
10261
  ]),
10231
10262
  createBaseVNode("div", {
10232
10263
  class: normalizeClass(["lupa-current-category", { "lupa-current-category-active": isActive }])
@@ -10256,7 +10287,7 @@ const _hoisted_1$P = {
10256
10287
  "data-cy": "lupa-search-result-facet-term-values"
10257
10288
  };
10258
10289
  const _hoisted_2$z = ["placeholder"];
10259
- const _hoisted_3$q = { class: "lupa-terms-list" };
10290
+ const _hoisted_3$p = { class: "lupa-terms-list" };
10260
10291
  const _hoisted_4$j = ["onClick"];
10261
10292
  const _hoisted_5$c = { class: "lupa-term-checkbox-wrapper" };
10262
10293
  const _hoisted_6$8 = { class: "lupa-term-checkbox-label" };
@@ -10346,7 +10377,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
10346
10377
  }, null, 8, _hoisted_2$z)), [
10347
10378
  [vModelText, termFilter.value]
10348
10379
  ]) : createCommentVNode("", true),
10349
- createBaseVNode("div", _hoisted_3$q, [
10380
+ createBaseVNode("div", _hoisted_3$p, [
10350
10381
  (openBlock(true), createElementBlock(Fragment, null, renderList(displayValues.value, (item) => {
10351
10382
  return openBlock(), createElementBlock("div", {
10352
10383
  class: normalizeClass(["lupa-facet-term", { checked: isChecked(item) }]),
@@ -11359,7 +11390,7 @@ const _hoisted_2$y = {
11359
11390
  key: 0,
11360
11391
  class: "lupa-stats-facet-summary"
11361
11392
  };
11362
- const _hoisted_3$p = {
11393
+ const _hoisted_3$o = {
11363
11394
  key: 1,
11364
11395
  class: "lupa-stats-facet-summary-input"
11365
11396
  };
@@ -11545,7 +11576,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11545
11576
  };
11546
11577
  return (_ctx, _cache) => {
11547
11578
  return openBlock(), createElementBlock("div", _hoisted_1$O, [
11548
- !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$y, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$p, [
11579
+ !isInputVisible.value ? (openBlock(), createElementBlock("div", _hoisted_2$y, toDisplayString(statsSummary.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$o, [
11549
11580
  createBaseVNode("div", null, [
11550
11581
  rangeLabelFrom.value ? (openBlock(), createElementBlock("div", _hoisted_4$i, toDisplayString(rangeLabelFrom.value), 1)) : createCommentVNode("", true),
11551
11582
  createBaseVNode("div", _hoisted_5$b, [
@@ -11613,7 +11644,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
11613
11644
  });
11614
11645
  const _hoisted_1$N = { class: "lupa-term-checkbox-wrapper" };
11615
11646
  const _hoisted_2$x = { class: "lupa-term-checkbox-label" };
11616
- const _hoisted_3$o = { class: "lupa-term-label" };
11647
+ const _hoisted_3$n = { class: "lupa-term-label" };
11617
11648
  const _hoisted_4$h = {
11618
11649
  key: 0,
11619
11650
  class: "lupa-term-count"
@@ -11674,7 +11705,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
11674
11705
  }, null, 2)
11675
11706
  ]),
11676
11707
  createBaseVNode("div", _hoisted_2$x, [
11677
- createBaseVNode("span", _hoisted_3$o, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
11708
+ createBaseVNode("span", _hoisted_3$n, toDisplayString(_ctx.item.title) + toDisplayString(" "), 1),
11678
11709
  _ctx.options.showDocumentCount ? (openBlock(), createElementBlock("span", _hoisted_4$h, "(" + toDisplayString(_ctx.item.count) + ")", 1)) : createCommentVNode("", true)
11679
11710
  ])
11680
11711
  ]),
@@ -11699,7 +11730,7 @@ const _hoisted_1$M = {
11699
11730
  "data-cy": "lupa-search-result-facet-term-values"
11700
11731
  };
11701
11732
  const _hoisted_2$w = { key: 0 };
11702
- const _hoisted_3$n = ["placeholder"];
11733
+ const _hoisted_3$m = ["placeholder"];
11703
11734
  const _sfc_main$P = /* @__PURE__ */ defineComponent({
11704
11735
  __name: "HierarchyFacet",
11705
11736
  props: {
@@ -11757,7 +11788,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
11757
11788
  "data-cy": "lupa-term-filter",
11758
11789
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => termFilter.value = $event),
11759
11790
  placeholder: _ctx.options.labels.facetFilter
11760
- }, null, 8, _hoisted_3$n), [
11791
+ }, null, 8, _hoisted_3$m), [
11761
11792
  [vModelText, termFilter.value]
11762
11793
  ])
11763
11794
  ])) : createCommentVNode("", true),
@@ -12125,7 +12156,7 @@ const _hoisted_1$H = {
12125
12156
  class: "lupa-mobile-filter-sidebar"
12126
12157
  };
12127
12158
  const _hoisted_2$t = ["onClick"];
12128
- const _hoisted_3$m = { class: "lupa-mobile-sidebar-content" };
12159
+ const _hoisted_3$l = { class: "lupa-mobile-sidebar-content" };
12129
12160
  const _hoisted_4$g = { class: "lupa-sidebar-top" };
12130
12161
  const _hoisted_5$9 = { class: "lupa-sidebar-title" };
12131
12162
  const _hoisted_6$6 = {
@@ -12164,7 +12195,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
12164
12195
  class: "lupa-sidebar-close",
12165
12196
  onClick: withModifiers(handleMobileToggle, ["stop"])
12166
12197
  }, null, 8, _hoisted_2$t),
12167
- createBaseVNode("div", _hoisted_3$m, [
12198
+ createBaseVNode("div", _hoisted_3$l, [
12168
12199
  createBaseVNode("div", _hoisted_4$g, [
12169
12200
  createBaseVNode("div", _hoisted_5$9, [
12170
12201
  createTextVNode(toDisplayString(sidebarTitle.value) + " ", 1),
@@ -12188,7 +12219,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
12188
12219
  });
12189
12220
  const _hoisted_1$G = { id: "lupa-search-results-breadcrumbs" };
12190
12221
  const _hoisted_2$s = ["href", "onClick"];
12191
- const _hoisted_3$l = {
12222
+ const _hoisted_3$k = {
12192
12223
  key: 1,
12193
12224
  class: "lupa-search-results-breadcrumb-text"
12194
12225
  };
@@ -12232,7 +12263,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
12232
12263
  var _a;
12233
12264
  return handleNavigation(e, (_a = breadcrumb == null ? void 0 : breadcrumb.link) != null ? _a : "");
12234
12265
  }
12235
- }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (openBlock(), createElementBlock("span", _hoisted_3$l, toDisplayString(getLabel(breadcrumb.label)), 1)),
12266
+ }, toDisplayString(getLabel(breadcrumb.label)), 9, _hoisted_2$s)) : (openBlock(), createElementBlock("span", _hoisted_3$k, toDisplayString(getLabel(breadcrumb.label)), 1)),
12236
12267
  index < breadcrumbsValue.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_4$f, " / ")) : createCommentVNode("", true)
12237
12268
  ]);
12238
12269
  }), 128))
@@ -12333,7 +12364,7 @@ const _hoisted_2$r = {
12333
12364
  key: 0,
12334
12365
  class: "lupa-page-number-separator"
12335
12366
  };
12336
- const _hoisted_3$k = ["onClick"];
12367
+ const _hoisted_3$j = ["onClick"];
12337
12368
  const _hoisted_4$e = {
12338
12369
  key: 0,
12339
12370
  class: "lupa-page-number-separator"
@@ -12437,7 +12468,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
12437
12468
  page === _ctx.options.selectedPage ? "lupa-page-number-selected" : ""
12438
12469
  ]),
12439
12470
  "data-cy": "lupa-page-number"
12440
- }, toDisplayString(page), 11, _hoisted_3$k);
12471
+ }, toDisplayString(page), 11, _hoisted_3$j);
12441
12472
  }), 128)),
12442
12473
  showLastPage.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
12443
12474
  showLastPageSeparator.value ? (openBlock(), createElementBlock("div", _hoisted_4$e, "...")) : createCommentVNode("", true),
@@ -12464,7 +12495,7 @@ const _hoisted_1$B = {
12464
12495
  "data-cy": "lupa-search-results-page-size"
12465
12496
  };
12466
12497
  const _hoisted_2$q = { id: "lupa-select" };
12467
- const _hoisted_3$j = { class: "lupa-select-label" };
12498
+ const _hoisted_3$i = { class: "lupa-select-label" };
12468
12499
  const _hoisted_4$d = ["aria-label"];
12469
12500
  const _sfc_main$E = /* @__PURE__ */ defineComponent({
12470
12501
  __name: "SearchResultsPageSize",
@@ -12485,7 +12516,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
12485
12516
  return (_ctx, _cache) => {
12486
12517
  return openBlock(), createElementBlock("div", _hoisted_1$B, [
12487
12518
  createBaseVNode("div", _hoisted_2$q, [
12488
- createBaseVNode("label", _hoisted_3$j, toDisplayString(_ctx.label), 1),
12519
+ createBaseVNode("label", _hoisted_3$i, toDisplayString(_ctx.label), 1),
12489
12520
  createBaseVNode("select", {
12490
12521
  class: "lupa-select-dropdown",
12491
12522
  "aria-label": _ctx.label,
@@ -12508,7 +12539,7 @@ const _hoisted_1$A = {
12508
12539
  class: "lupa-search-results-sort"
12509
12540
  };
12510
12541
  const _hoisted_2$p = { id: "lupa-select" };
12511
- const _hoisted_3$i = { class: "lupa-select-label" };
12542
+ const _hoisted_3$h = { class: "lupa-select-label" };
12512
12543
  const _hoisted_4$c = ["aria-label"];
12513
12544
  const _hoisted_5$8 = ["value"];
12514
12545
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
@@ -12561,7 +12592,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
12561
12592
  return (_ctx, _cache) => {
12562
12593
  return openBlock(), createElementBlock("div", _hoisted_1$A, [
12563
12594
  createBaseVNode("div", _hoisted_2$p, [
12564
- createBaseVNode("label", _hoisted_3$i, toDisplayString(_ctx.options.label), 1),
12595
+ createBaseVNode("label", _hoisted_3$h, toDisplayString(_ctx.options.label), 1),
12565
12596
  withDirectives(createBaseVNode("select", {
12566
12597
  class: "lupa-select-dropdown",
12567
12598
  "aria-label": _ctx.options.label,
@@ -12586,7 +12617,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
12586
12617
  });
12587
12618
  const _hoisted_1$z = { class: "lupa-toolbar-left" };
12588
12619
  const _hoisted_2$o = { key: 1 };
12589
- const _hoisted_3$h = { key: 3 };
12620
+ const _hoisted_3$g = { key: 3 };
12590
12621
  const _hoisted_4$b = { key: 5 };
12591
12622
  const _hoisted_5$7 = { class: "lupa-toolbar-right" };
12592
12623
  const _hoisted_6$5 = { key: 1 };
@@ -12697,7 +12728,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12697
12728
  label: searchSummaryLabel.value,
12698
12729
  clearable: unref(hasAnyFilter) && showFilterClear.value,
12699
12730
  onClear: handleClearAll
12700
- }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$h)),
12731
+ }, null, 8, ["label", "clearable"])) : (openBlock(), createElementBlock("div", _hoisted_3$g)),
12701
12732
  displayPageSelect.value ? (openBlock(), createBlock(_sfc_main$F, {
12702
12733
  key: 4,
12703
12734
  options: paginationOptions.value.pageSelect,
@@ -12727,7 +12758,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12727
12758
  });
12728
12759
  const _hoisted_1$y = { class: "lupa-badge-title" };
12729
12760
  const _hoisted_2$n = ["src"];
12730
- const _hoisted_3$g = { key: 1 };
12761
+ const _hoisted_3$f = { key: 1 };
12731
12762
  const _hoisted_4$a = {
12732
12763
  key: 0,
12733
12764
  class: "lupa-badge-full-text"
@@ -12770,7 +12801,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
12770
12801
  key: 0,
12771
12802
  src: image.value
12772
12803
  }, null, 8, _hoisted_2$n)) : createCommentVNode("", true),
12773
- hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$g, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
12804
+ hasTitleText.value && showTitle.value ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(_ctx.badge.titleText), 1)) : createCommentVNode("", true)
12774
12805
  ]),
12775
12806
  hasAdditionalText.value ? (openBlock(), createElementBlock("span", _hoisted_4$a, toDisplayString(_ctx.badge.additionalText), 1)) : createCommentVNode("", true)
12776
12807
  ], 6);
@@ -12997,7 +13028,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
12997
13028
  });
12998
13029
  const _hoisted_1$s = ["innerHTML"];
12999
13030
  const _hoisted_2$l = ["title"];
13000
- const _hoisted_3$f = {
13031
+ const _hoisted_3$e = {
13001
13032
  key: 0,
13002
13033
  class: "lupa-search-results-product-title-text"
13003
13034
  };
@@ -13041,7 +13072,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
13041
13072
  style: normalizeStyle(`-webkit-line-clamp: ${maxLines.value}`),
13042
13073
  title: title.value
13043
13074
  }, [
13044
- !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_3$f, toDisplayString(title.value), 1)) : createCommentVNode("", true),
13075
+ !_ctx.options.link ? (openBlock(), createElementBlock("span", _hoisted_3$e, toDisplayString(title.value), 1)) : createCommentVNode("", true),
13045
13076
  _ctx.options.link ? (openBlock(), createElementBlock("a", {
13046
13077
  key: 1,
13047
13078
  href: _ctx.link,
@@ -13087,7 +13118,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
13087
13118
  });
13088
13119
  const _hoisted_1$q = { id: "lupa-search-results-rating" };
13089
13120
  const _hoisted_2$k = { class: "lupa-ratings" };
13090
- const _hoisted_3$e = { class: "lupa-ratings-base" };
13121
+ const _hoisted_3$d = { class: "lupa-ratings-base" };
13091
13122
  const _hoisted_4$8 = ["innerHTML"];
13092
13123
  const _hoisted_5$6 = { class: "lupa-rating-wrapper" };
13093
13124
  const _hoisted_6$4 = ["innerHTML"];
@@ -13126,7 +13157,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
13126
13157
  return (_ctx, _cache) => {
13127
13158
  return openBlock(), createElementBlock("div", _hoisted_1$q, [
13128
13159
  createBaseVNode("div", _hoisted_2$k, [
13129
- createBaseVNode("div", _hoisted_3$e, [
13160
+ createBaseVNode("div", _hoisted_3$d, [
13130
13161
  (openBlock(true), createElementBlock(Fragment, null, renderList(baseStars.value, (star, index) => {
13131
13162
  return openBlock(), createElementBlock("div", {
13132
13163
  key: index,
@@ -13214,7 +13245,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
13214
13245
  });
13215
13246
  const _hoisted_1$n = { class: "lupa-search-results-add-to-cart-wrapper" };
13216
13247
  const _hoisted_2$j = { class: "lupa-search-results-product-addtocart" };
13217
- const _hoisted_3$d = ["onClick", "disabled"];
13248
+ const _hoisted_3$c = ["onClick", "disabled"];
13218
13249
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
13219
13250
  __name: "SearchResultsProductAddToCart",
13220
13251
  props: {
@@ -13249,7 +13280,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
13249
13280
  class: normalizeClass(loading.value ? "lupa-add-to-cart-loading" : "lupa-add-to-cart"),
13250
13281
  "data-cy": "lupa-add-to-cart",
13251
13282
  disabled: !inStockValue.value || loading.value
13252
- }, toDisplayString(label.value), 11, _hoisted_3$d)
13283
+ }, toDisplayString(label.value), 11, _hoisted_3$c)
13253
13284
  ])
13254
13285
  ]);
13255
13286
  };
@@ -13257,7 +13288,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
13257
13288
  });
13258
13289
  const _hoisted_1$m = ["innerHTML"];
13259
13290
  const _hoisted_2$i = { key: 0 };
13260
- const _hoisted_3$c = { key: 1 };
13291
+ const _hoisted_3$b = { key: 1 };
13261
13292
  const _hoisted_4$7 = { class: "lupa-search-box-custom-label" };
13262
13293
  const _hoisted_5$5 = { class: "lupa-search-box-custom-text" };
13263
13294
  const _sfc_main$o = /* @__PURE__ */ defineComponent({
@@ -13302,7 +13333,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
13302
13333
  key: 1,
13303
13334
  class: className.value
13304
13335
  }, toHandlers(_ctx.options.action ? { click: handleClick } : {}, true)), [
13305
- !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$i, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$c, [
13336
+ !label.value ? (openBlock(), createElementBlock("div", _hoisted_2$i, toDisplayString(text.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_3$b, [
13306
13337
  createBaseVNode("div", _hoisted_4$7, toDisplayString(label.value), 1),
13307
13338
  createBaseVNode("div", _hoisted_5$5, toDisplayString(text.value), 1)
13308
13339
  ]))
@@ -13341,7 +13372,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
13341
13372
  });
13342
13373
  const _hoisted_1$k = { id: "lupa-search-results-rating" };
13343
13374
  const _hoisted_2$h = ["innerHTML"];
13344
- const _hoisted_3$b = { class: "lupa-ratings" };
13375
+ const _hoisted_3$a = { class: "lupa-ratings" };
13345
13376
  const _hoisted_4$6 = ["href"];
13346
13377
  const _sfc_main$m = /* @__PURE__ */ defineComponent({
13347
13378
  __name: "SearchResultsProductSingleStarRating",
@@ -13376,7 +13407,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
13376
13407
  innerHTML: star.value,
13377
13408
  class: "lupa-rating lupa-rating-highlighted"
13378
13409
  }, null, 8, _hoisted_2$h),
13379
- createBaseVNode("div", _hoisted_3$b, toDisplayString(rating.value), 1),
13410
+ createBaseVNode("div", _hoisted_3$a, toDisplayString(rating.value), 1),
13380
13411
  createBaseVNode("a", {
13381
13412
  href: ratingLink.value,
13382
13413
  class: "lupa-total-ratings"
@@ -13474,7 +13505,7 @@ const _hoisted_2$g = {
13474
13505
  key: 0,
13475
13506
  class: "lupa-out-of-stock"
13476
13507
  };
13477
- const _hoisted_3$a = { class: "lupa-search-result-product-details-section" };
13508
+ const _hoisted_3$9 = { class: "lupa-search-result-product-details-section" };
13478
13509
  const _sfc_main$k = /* @__PURE__ */ defineComponent({
13479
13510
  __name: "SearchResultsProductCard",
13480
13511
  props: {
@@ -13650,7 +13681,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
13650
13681
  }, null, 8, ["options"]),
13651
13682
  ((_a = labels.value) == null ? void 0 : _a.outOfStock) && !isInStock.value ? (openBlock(), createElementBlock("div", _hoisted_2$g, toDisplayString(labels.value.outOfStock), 1)) : createCommentVNode("", true)
13652
13683
  ], 8, _hoisted_1$j),
13653
- createBaseVNode("div", _hoisted_3$a, [
13684
+ createBaseVNode("div", _hoisted_3$9, [
13654
13685
  (openBlock(true), createElementBlock(Fragment, null, renderList(detailElements.value, (element) => {
13655
13686
  return openBlock(), createBlock(_sfc_main$l, {
13656
13687
  class: "lupa-search-results-product-element",
@@ -13693,7 +13724,7 @@ const _hoisted_1$i = {
13693
13724
  "data-cy": "lupa-search-results-similar-queries"
13694
13725
  };
13695
13726
  const _hoisted_2$f = { class: "lupa-similar-queries-label" };
13696
- const _hoisted_3$9 = {
13727
+ const _hoisted_3$8 = {
13697
13728
  class: "lupa-similar-query-label",
13698
13729
  "data-cy": "lupa-similar-query-label"
13699
13730
  };
@@ -13738,7 +13769,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
13738
13769
  createBaseVNode("div", _hoisted_2$f, toDisplayString(_ctx.labels.similarQueries), 1),
13739
13770
  (openBlock(true), createElementBlock(Fragment, null, renderList(similarQueries.value, (similarQuery, index) => {
13740
13771
  return openBlock(), createElementBlock("div", { key: index }, [
13741
- createBaseVNode("div", _hoisted_3$9, [
13772
+ createBaseVNode("div", _hoisted_3$8, [
13742
13773
  createBaseVNode("span", null, toDisplayString(similarQueryLabel.value), 1),
13743
13774
  createBaseVNode("span", {
13744
13775
  id: "lupa-similar-query-text-component",
@@ -13927,7 +13958,7 @@ const _hoisted_1$e = {
13927
13958
  "data-cy": "lupa-search-results-similar-results"
13928
13959
  };
13929
13960
  const _hoisted_2$c = { class: "lupa-similar-results-label" };
13930
- const _hoisted_3$8 = {
13961
+ const _hoisted_3$7 = {
13931
13962
  class: "lupa-products",
13932
13963
  "data-cy": "lupa-products"
13933
13964
  };
@@ -13949,7 +13980,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
13949
13980
  return (_ctx, _cache) => {
13950
13981
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
13951
13982
  createBaseVNode("div", _hoisted_2$c, toDisplayString(_ctx.labels.similarResultsLabel), 1),
13952
- createBaseVNode("div", _hoisted_3$8, [
13983
+ createBaseVNode("div", _hoisted_3$7, [
13953
13984
  (openBlock(true), createElementBlock(Fragment, null, renderList(similarResults.value.items, (product, index) => {
13954
13985
  return openBlock(), createBlock(_sfc_main$k, {
13955
13986
  style: normalizeStyle(_ctx.columnSize),
@@ -13968,7 +13999,7 @@ const _hoisted_2$b = {
13968
13999
  class: "lupa-products",
13969
14000
  "data-cy": "lupa-products"
13970
14001
  };
13971
- const _hoisted_3$7 = {
14002
+ const _hoisted_3$6 = {
13972
14003
  key: 0,
13973
14004
  class: "lupa-empty-results",
13974
14005
  "data-cy": "lupa-no-results-in-page"
@@ -14131,7 +14162,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
14131
14162
  }, null, 8, ["style", "product", "options"]);
14132
14163
  }), 128))
14133
14164
  ]),
14134
- unref(isPageEmpty) && _ctx.options.labels.noItemsInPage ? (openBlock(), createElementBlock("div", _hoisted_3$7, [
14165
+ unref(isPageEmpty) && _ctx.options.labels.noItemsInPage ? (openBlock(), createElementBlock("div", _hoisted_3$6, [
14135
14166
  createTextVNode(toDisplayString(_ctx.options.labels.noItemsInPage) + " ", 1),
14136
14167
  _ctx.options.labels.backToFirstPage ? (openBlock(), createElementBlock("span", {
14137
14168
  key: 0,
@@ -14177,7 +14208,7 @@ const _hoisted_2$a = {
14177
14208
  key: 0,
14178
14209
  class: "lupa-category-back"
14179
14210
  };
14180
- const _hoisted_3$6 = ["href"];
14211
+ const _hoisted_3$5 = ["href"];
14181
14212
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
14182
14213
  __name: "CategoryTopFilters",
14183
14214
  props: {
@@ -14216,7 +14247,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
14216
14247
  "data-cy": "lupa-category-back",
14217
14248
  href: backUrlLink.value,
14218
14249
  onClick: handleNavigationBack
14219
- }, toDisplayString(backTitle.value), 9, _hoisted_3$6)
14250
+ }, toDisplayString(backTitle.value), 9, _hoisted_3$5)
14220
14251
  ])) : createCommentVNode("", true),
14221
14252
  createVNode(_sfc_main$C, {
14222
14253
  class: "lupa-toolbar-mobile",
@@ -14237,7 +14268,7 @@ const _hoisted_2$9 = {
14237
14268
  id: "lupa-search-results",
14238
14269
  class: "top-layout-wrapper"
14239
14270
  };
14240
- const _hoisted_3$5 = { class: "search-content" };
14271
+ const _hoisted_3$4 = { class: "search-content" };
14241
14272
  const _hoisted_4$3 = { id: "lupa-search-results" };
14242
14273
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
14243
14274
  __name: "SearchResults",
@@ -14476,7 +14507,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
14476
14507
  ref_key: "searchResultsFilters",
14477
14508
  ref: searchResultsFilters
14478
14509
  }, null, 8, ["options"])) : createCommentVNode("", true),
14479
- createBaseVNode("div", _hoisted_3$5, [
14510
+ createBaseVNode("div", _hoisted_3$4, [
14480
14511
  createVNode(_sfc_main$Z, { labels: didYouMeanLabels.value }, null, 8, ["labels"]),
14481
14512
  createVNode(_sfc_main$X, {
14482
14513
  options: _ctx.options,
@@ -20967,12 +20998,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
20967
20998
  });
20968
20999
  const _hoisted_1$7 = { class: "lupa-chat-spinner" };
20969
21000
  const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20970
- const _hoisted_3$4 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
21001
+ const _hoisted_3$3 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20971
21002
  const _hoisted_4$2 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20972
21003
  const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("div", null, null, -1);
20973
21004
  const _hoisted_6$1 = [
20974
21005
  _hoisted_2$5,
20975
- _hoisted_3$4,
21006
+ _hoisted_3$3,
20976
21007
  _hoisted_4$2,
20977
21008
  _hoisted_5$2
20978
21009
  ];
@@ -20996,7 +21027,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
20996
21027
  });
20997
21028
  const _hoisted_1$6 = { class: "lupa-chat-input-container" };
20998
21029
  const _hoisted_2$4 = { id: "lupa-search-box-input" };
20999
- const _hoisted_3$3 = {
21030
+ const _hoisted_3$2 = {
21000
21031
  key: 0,
21001
21032
  class: "lupa-chat-form-submit"
21002
21033
  };
@@ -21032,7 +21063,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
21032
21063
  [vModelText, inputValue.value]
21033
21064
  ])
21034
21065
  ]),
21035
- !_ctx.disabled ? (openBlock(), createElementBlock("button", _hoisted_3$3, "Ask LupaChat")) : (openBlock(), createBlock(_sfc_main$7, {
21066
+ !_ctx.disabled ? (openBlock(), createElementBlock("button", _hoisted_3$2, "Ask LupaChat")) : (openBlock(), createBlock(_sfc_main$7, {
21036
21067
  key: 1,
21037
21068
  small: true
21038
21069
  }))
@@ -21199,7 +21230,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
21199
21230
  });
21200
21231
  const _hoisted_1$4 = { class: "lupa-chat-content-entry-phrase" };
21201
21232
  const _hoisted_2$3 = { class: "lupa-chat-phrase-title" };
21202
- const _hoisted_3$2 = {
21233
+ const _hoisted_3$1 = {
21203
21234
  key: 0,
21204
21235
  class: "alert"
21205
21236
  };
@@ -21300,7 +21331,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
21300
21331
  createBaseVNode("div", _hoisted_2$3, [
21301
21332
  createBaseVNode("h3", null, toDisplayString(displayPhrase.value), 1),
21302
21333
  createBaseVNode("sub", null, toDisplayString(usedAlternativePhrases.value.join(", ")), 1),
21303
- usedPartialResults.value ? (openBlock(), createElementBlock("sub", _hoisted_3$2, "Including partial matches - which might not be what you are looking for")) : createCommentVNode("", true)
21334
+ usedPartialResults.value ? (openBlock(), createElementBlock("sub", _hoisted_3$1, "Including partial matches - which might not be what you are looking for")) : createCommentVNode("", true)
21304
21335
  ]),
21305
21336
  createBaseVNode("div", null, [
21306
21337
  createVNode(_sfc_main$5, {
@@ -21319,7 +21350,7 @@ const _sfc_main$4$1 = /* @__PURE__ */ defineComponent({
21319
21350
  });
21320
21351
  const _hoisted_1$3 = { class: "lupa-chat-best-matches lupa-chat-content-entry" };
21321
21352
  const _hoisted_2$2 = /* @__PURE__ */ createBaseVNode("h3", null, "Best matches", -1);
21322
- const _hoisted_3$1 = { key: 0 };
21353
+ const MAX_SOURCES_FOR_BEST_ITEM_MATCHING = 250;
21323
21354
  const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21324
21355
  __name: "ChatContentEntry",
21325
21356
  props: {
@@ -21349,20 +21380,18 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21349
21380
  return (_a = props.options.displayOptions.titleKey) != null ? _a : "title";
21350
21381
  });
21351
21382
  const loadFinalRecommendations = () => __async(this, null, function* () {
21352
- var _a;
21383
+ var _a, _b;
21353
21384
  try {
21354
- const productResultStrings = loadedResults.value.map(
21355
- (result) => {
21356
- var _a2, _b;
21357
- return (_b = (_a2 = result[titleKey.value]) == null ? void 0 : _a2.toString()) != null ? _b : "";
21358
- }
21359
- );
21385
+ const productResultStrings = (_a = loadedResults.value.map((result) => {
21386
+ var _a2, _b2;
21387
+ return (_b2 = (_a2 = result[titleKey.value]) == null ? void 0 : _a2.toString()) != null ? _b2 : "";
21388
+ })) == null ? void 0 : _a.slice(0, MAX_SOURCES_FOR_BEST_ITEM_MATCHING);
21360
21389
  const { products } = yield ChatService.suggestBestProductMatches(
21361
21390
  props.options.sdkOptions,
21362
21391
  {
21363
21392
  initialQuery: props.entry.userInput,
21364
21393
  productStrings: productResultStrings,
21365
- messageHistory: (_a = props.history) != null ? _a : [],
21394
+ messageHistory: (_b = props.history) != null ? _b : [],
21366
21395
  queryKey: props.options.displayOptions.queryKey
21367
21396
  },
21368
21397
  props.options.chatSettings
@@ -21375,13 +21404,9 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21375
21404
  });
21376
21405
  const bestMatchProducts = computed(() => {
21377
21406
  return bestMatches.value.map((productName) => {
21378
- return loadedResults.value.find((r) => r[titleKey.value] === productName);
21407
+ return findClosestStringValue(productName, loadedResults.value, titleKey.value);
21379
21408
  }).filter(Boolean);
21380
21409
  });
21381
- const explanation = computed(() => {
21382
- var _a, _b;
21383
- return ((_a = bestMatches.value) == null ? void 0 : _a.length) > 0 && !bestMatchProducts.value.length ? (_b = bestMatches == null ? void 0 : bestMatches.value) == null ? void 0 : _b[0] : "";
21384
- });
21385
21410
  return (_ctx, _cache) => {
21386
21411
  return openBlock(), createElementBlock("div", null, [
21387
21412
  createBaseVNode("ul", null, [
@@ -21401,13 +21426,12 @@ const _sfc_main$3$1 = /* @__PURE__ */ defineComponent({
21401
21426
  ]),
21402
21427
  createBaseVNode("section", _hoisted_1$3, [
21403
21428
  _hoisted_2$2,
21404
- explanation.value ? (openBlock(), createElementBlock("p", _hoisted_3$1, toDisplayString(explanation.value), 1)) : createCommentVNode("", true),
21405
21429
  loading.value ? (openBlock(), createBlock(_sfc_main$7, {
21406
- key: 1,
21430
+ key: 0,
21407
21431
  message: "Selecting the best matches for you. This might take a few seconds."
21408
21432
  })) : createCommentVNode("", true),
21409
21433
  bestMatches.value.length ? (openBlock(), createBlock(_sfc_main$5, {
21410
- key: 2,
21434
+ key: 1,
21411
21435
  "search-results": bestMatchProducts.value,
21412
21436
  options: _ctx.options.displayOptions
21413
21437
  }, null, 8, ["search-results", "options"])) : createCommentVNode("", true)