vviinn-widgets 2.216.1 → 2.216.2

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.
Files changed (39) hide show
  1. package/dist/cjs/{index-DvleNAFh.js → index-BM7VfZ_J.js} +1 -1
  2. package/dist/cjs/{search.store-DlrP4N8h.js → search.store-DX5IRC4l.js} +9 -4
  3. package/dist/cjs/vviinn-button_6.cjs.entry.js +1 -1
  4. package/dist/cjs/vviinn-camera_12.cjs.entry.js +29 -12
  5. package/dist/cjs/vviinn-carousel_10.cjs.entry.js +2 -2
  6. package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +1 -1
  7. package/dist/cjs/vviinn-text-search.cjs.entry.js +1 -1
  8. package/dist/collection/components/vviinn-filters/vviinn-selected-filters.js +26 -9
  9. package/dist/collection/components/vviinn-suggestions/vviinn-suggestions.css +0 -1
  10. package/dist/collection/store/search.store.js +8 -3
  11. package/dist/esm/{index-BsmArtOR.js → index-CmCUlnFh.js} +2 -2
  12. package/dist/esm/{search.store-Crmiihat.js → search.store-B0ZhYtWV.js} +9 -4
  13. package/dist/esm/vviinn-button_6.entry.js +1 -1
  14. package/dist/esm/vviinn-camera_12.entry.js +29 -12
  15. package/dist/esm/vviinn-carousel_10.entry.js +2 -2
  16. package/dist/esm/vviinn-shop-the-look.entry.js +1 -1
  17. package/dist/esm/vviinn-text-search.entry.js +1 -1
  18. package/dist/types/components/vviinn-filters/vviinn-selected-filters.d.ts +2 -0
  19. package/dist/vviinn-widgets/{p-4ab3fa9a.entry.js → p-137944e9.entry.js} +1 -1
  20. package/dist/vviinn-widgets/{p-0cec8974.entry.js → p-1e7d7fc8.entry.js} +1 -1
  21. package/dist/vviinn-widgets/p-2b96382d.entry.js +1 -0
  22. package/dist/vviinn-widgets/{p-COXJ3Urb.js → p-B--7xBdV.js} +1 -1
  23. package/dist/vviinn-widgets/{p-DYkVwvAf.js → p-DIMfQtwJ.js} +1 -1
  24. package/{www/build/p-a897bab6.entry.js → dist/vviinn-widgets/p-a3829a7f.entry.js} +1 -1
  25. package/dist/vviinn-widgets/{p-d08add0b.entry.js → p-c64a4923.entry.js} +1 -1
  26. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  27. package/package.json +1 -1
  28. package/www/build/{p-4ab3fa9a.entry.js → p-137944e9.entry.js} +1 -1
  29. package/www/build/{p-0cec8974.entry.js → p-1e7d7fc8.entry.js} +1 -1
  30. package/www/build/p-2b96382d.entry.js +1 -0
  31. package/www/build/{p-62f19d50.js → p-64d1f5a3.js} +1 -1
  32. package/www/build/{p-COXJ3Urb.js → p-B--7xBdV.js} +1 -1
  33. package/www/build/{p-DYkVwvAf.js → p-DIMfQtwJ.js} +1 -1
  34. package/{dist/vviinn-widgets/p-a897bab6.entry.js → www/build/p-a3829a7f.entry.js} +1 -1
  35. package/www/build/{p-d08add0b.entry.js → p-c64a4923.entry.js} +1 -1
  36. package/www/build/vviinn-widgets.esm.js +1 -1
  37. package/www/index.html +1 -1
  38. package/dist/vviinn-widgets/p-36453390.entry.js +0 -1
  39. package/www/build/p-36453390.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-D38ORu31.js');
4
- var search_store = require('./search.store-DlrP4N8h.js');
4
+ var search_store = require('./search.store-DX5IRC4l.js');
5
5
  var store = require('./store-jPZ4ROqV.js');
6
6
 
7
7
  const PlusIcon = () => (index.h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
@@ -8593,7 +8593,7 @@ const encodeToBase64UTF8 = (str) => {
8593
8593
  return btoa(String.fromCharCode.apply(null, utf8Array));
8594
8594
  };
8595
8595
 
8596
- const version = "2.216.1";
8596
+ const version = "2.216.2";
8597
8597
 
8598
8598
  const appStateGlobalDefaults = {
8599
8599
  excluded: null,
@@ -8682,7 +8682,7 @@ const emitSearchSuccess = (storeName, state, campaignTypeId) => {
8682
8682
  }));
8683
8683
  };
8684
8684
  const updateVisualSearchState = (store, isHiResUpdate = false) => async (response) => {
8685
- var _a;
8685
+ var _a, _b;
8686
8686
  const state = useStore(store);
8687
8687
  if (store === "shopTheLook") {
8688
8688
  state.visualSearchId = response.requestId;
@@ -8691,10 +8691,15 @@ const updateVisualSearchState = (store, isHiResUpdate = false) => async (respons
8691
8691
  const detectedObjects = response.interactions.suggestedSearchAreas.map(({ rectangle }) => rectangle);
8692
8692
  if (detectedObjects.length > 0)
8693
8693
  state.detectedObjects = detectedObjects;
8694
+ const dynamicFilters = (_a = response.interactions.dynamicFilters) !== null && _a !== void 0 ? _a : [];
8694
8695
  state.visualSearchId = response.requestId;
8695
8696
  state.results = response.data.products;
8696
- state.dynamicFilters = response.interactions.dynamicFilters;
8697
- state.stream = (_a = response === null || response === void 0 ? void 0 : response.stream) !== null && _a !== void 0 ? _a : null;
8697
+ state.dynamicFilters = dynamicFilters;
8698
+ const extractedFilters = extractSelectedFilters(dynamicFilters);
8699
+ if (state.requestFilters.length === 0 && extractedFilters.length > 0) {
8700
+ state.requestFilters = extractedFilters;
8701
+ }
8702
+ state.stream = (_b = response === null || response === void 0 ? void 0 : response.stream) !== null && _b !== void 0 ? _b : null;
8698
8703
  state.searchStatus = "success";
8699
8704
  if (!isHiResUpdate)
8700
8705
  emitSearchSuccess(store, state, "VPS");
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-D38ORu31.js');
4
4
  var store = require('./store-jPZ4ROqV.js');
5
- var search_store = require('./search.store-DlrP4N8h.js');
5
+ var search_store = require('./search.store-DX5IRC4l.js');
6
6
  var index$1 = require('./index-CBteD3gC.js');
7
7
  var SecondaryActionIcon = require('./SecondaryActionIcon-Ng84u7-b.js');
8
8
  var index$2 = require('./index-CvMi8_tX.js');
@@ -2,9 +2,9 @@
2
2
 
3
3
  var index = require('./index-D38ORu31.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
- var search_store = require('./search.store-DlrP4N8h.js');
5
+ var search_store = require('./search.store-DX5IRC4l.js');
6
6
  var index$2 = require('./index-CBteD3gC.js');
7
- var index$1 = require('./index-DvleNAFh.js');
7
+ var index$1 = require('./index-BM7VfZ_J.js');
8
8
  var store = require('./store-jPZ4ROqV.js');
9
9
  var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
10
10
  var openProductLink = require('./openProductLink-BwHUGXtr.js');
@@ -1050,7 +1050,7 @@ const VviinnSelectedFilters = class {
1050
1050
  resetImageFilter && (this.imageSrc = null);
1051
1051
  };
1052
1052
  this.handleFilterTriggered = ({ detail, }) => {
1053
- var _a, _b;
1053
+ var _a;
1054
1054
  if (this.skipStateChanges(detail.isTriggeredByVpsWidget))
1055
1055
  return;
1056
1056
  if (detail.customTrigger === "TPS") {
@@ -1058,14 +1058,7 @@ const VviinnSelectedFilters = class {
1058
1058
  this.textSearchCustomFilter = detail.kind;
1059
1059
  }
1060
1060
  if (detail.action === "select" && ((_a = detail.filter) === null || _a === void 0 ? void 0 : _a.type) === "interval") {
1061
- const intervalLabel = index$1.getIntervalLabel(detail.filter, detail.value.interval, (_b = this.currencySign) !== null && _b !== void 0 ? _b : store.defaultConfig.currencySign, true);
1062
- if (intervalLabel) {
1063
- this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [detail.filter.column]: intervalLabel });
1064
- }
1065
- else {
1066
- const _c = this.intervalCustomFilters, _d = detail.filter.column, remaining = __rest$1(_c, [typeof _d === "symbol" ? _d : _d + ""]);
1067
- this.intervalCustomFilters = remaining;
1068
- }
1061
+ this.setIntervalFilterLabel(detail.filter, detail.value.interval);
1069
1062
  }
1070
1063
  };
1071
1064
  this.handleImageUploadStarted = ({ detail }) => {
@@ -1170,6 +1163,10 @@ const VviinnSelectedFilters = class {
1170
1163
  this.selectedFilterButtons = [];
1171
1164
  const filters = ((_a = this.state) === null || _a === void 0 ? void 0 : _a.dynamicFilters) || [];
1172
1165
  filters.forEach((filter) => {
1166
+ if (filter.type === "interval") {
1167
+ this.syncPreselectedIntervalFilter(filter);
1168
+ return;
1169
+ }
1173
1170
  if (!("values" in filter))
1174
1171
  return;
1175
1172
  filter.values.forEach(({ value, label, active }) => {
@@ -1187,6 +1184,26 @@ const VviinnSelectedFilters = class {
1187
1184
  });
1188
1185
  });
1189
1186
  }
1187
+ setIntervalFilterLabel(filter, interval) {
1188
+ var _a;
1189
+ const label = index$1.getIntervalLabel(filter, interval, (_a = this.currencySign) !== null && _a !== void 0 ? _a : store.defaultConfig.currencySign, true);
1190
+ if (label) {
1191
+ this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [filter.column]: label });
1192
+ }
1193
+ else {
1194
+ const _b = this.intervalCustomFilters, _c = filter.column, remaining = __rest$1(_b, [typeof _c === "symbol" ? _c : _c + ""]);
1195
+ this.intervalCustomFilters = remaining;
1196
+ }
1197
+ }
1198
+ syncPreselectedIntervalFilter(filter) {
1199
+ var _a;
1200
+ if (this.intervalCustomFilters[filter.column])
1201
+ return;
1202
+ const matchingRequest = this.requestFilters.find((rf) => rf.column === filter.column);
1203
+ if (!((_a = matchingRequest === null || matchingRequest === void 0 ? void 0 : matchingRequest.values) === null || _a === void 0 ? void 0 : _a.length))
1204
+ return;
1205
+ this.setIntervalFilterLabel(filter, matchingRequest.values[0]);
1206
+ }
1190
1207
  render() {
1191
1208
  var _a, _b;
1192
1209
  if (this.showInWidget &&
@@ -1524,7 +1541,7 @@ const syncSuggestionFilters = (activeFilters, stream) => {
1524
1541
  return updatedAppliedFilters;
1525
1542
  };
1526
1543
 
1527
- const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0;font-weight:inherit}";
1544
+ const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0}";
1528
1545
 
1529
1546
  const VviinnSuggestions = class {
1530
1547
  constructor(hostRef) {
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-D38ORu31.js');
4
- var search_store = require('./search.store-DlrP4N8h.js');
4
+ var search_store = require('./search.store-DX5IRC4l.js');
5
5
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
6
6
  var store = require('./store-jPZ4ROqV.js');
7
- var index$1 = require('./index-DvleNAFh.js');
7
+ var index$1 = require('./index-BM7VfZ_J.js');
8
8
  var constants = require('./constants-BlwqMvns.js');
9
9
  var index$2 = require('./index-CBteD3gC.js');
10
10
  var index$3 = require('./index-CvMi8_tX.js');
@@ -4,7 +4,7 @@ var index = require('./index-D38ORu31.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
5
  var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
6
6
  var swiperElement = require('./swiper-element-DjtzojCR.js');
7
- var search_store = require('./search.store-DlrP4N8h.js');
7
+ var search_store = require('./search.store-DX5IRC4l.js');
8
8
  var SecondaryActionIcon = require('./SecondaryActionIcon-Ng84u7-b.js');
9
9
  var index$1 = require('./index-CvMi8_tX.js');
10
10
  var store = require('./store-jPZ4ROqV.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  var index = require('./index-D38ORu31.js');
4
4
  var Rectangle = require('./Rectangle-7dF6_xf3.js');
5
- var search_store = require('./search.store-DlrP4N8h.js');
5
+ var search_store = require('./search.store-DX5IRC4l.js');
6
6
  var index$2 = require('./index-CBteD3gC.js');
7
7
  var store = require('./store-jPZ4ROqV.js');
8
8
  var index$1 = require('./index-CvMi8_tX.js');
@@ -61,7 +61,7 @@ export class VviinnSelectedFilters {
61
61
  resetImageFilter && (this.imageSrc = null);
62
62
  };
63
63
  this.handleFilterTriggered = ({ detail, }) => {
64
- var _a, _b;
64
+ var _a;
65
65
  if (this.skipStateChanges(detail.isTriggeredByVpsWidget))
66
66
  return;
67
67
  if (detail.customTrigger === "TPS") {
@@ -69,14 +69,7 @@ export class VviinnSelectedFilters {
69
69
  this.textSearchCustomFilter = detail.kind;
70
70
  }
71
71
  if (detail.action === "select" && ((_a = detail.filter) === null || _a === void 0 ? void 0 : _a.type) === "interval") {
72
- const intervalLabel = getIntervalLabel(detail.filter, detail.value.interval, (_b = this.currencySign) !== null && _b !== void 0 ? _b : defaultConfig.currencySign, true);
73
- if (intervalLabel) {
74
- this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [detail.filter.column]: intervalLabel });
75
- }
76
- else {
77
- const _c = this.intervalCustomFilters, _d = detail.filter.column, removed = _c[_d], remaining = __rest(_c, [typeof _d === "symbol" ? _d : _d + ""]);
78
- this.intervalCustomFilters = remaining;
79
- }
72
+ this.setIntervalFilterLabel(detail.filter, detail.value.interval);
80
73
  }
81
74
  };
82
75
  this.handleImageUploadStarted = ({ detail }) => {
@@ -181,6 +174,10 @@ export class VviinnSelectedFilters {
181
174
  this.selectedFilterButtons = [];
182
175
  const filters = ((_a = this.state) === null || _a === void 0 ? void 0 : _a.dynamicFilters) || [];
183
176
  filters.forEach((filter) => {
177
+ if (filter.type === "interval") {
178
+ this.syncPreselectedIntervalFilter(filter);
179
+ return;
180
+ }
184
181
  if (!("values" in filter))
185
182
  return;
186
183
  filter.values.forEach(({ value, label, active }) => {
@@ -198,6 +195,26 @@ export class VviinnSelectedFilters {
198
195
  });
199
196
  });
200
197
  }
198
+ setIntervalFilterLabel(filter, interval) {
199
+ var _a;
200
+ const label = getIntervalLabel(filter, interval, (_a = this.currencySign) !== null && _a !== void 0 ? _a : defaultConfig.currencySign, true);
201
+ if (label) {
202
+ this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [filter.column]: label });
203
+ }
204
+ else {
205
+ const _b = this.intervalCustomFilters, _c = filter.column, removed = _b[_c], remaining = __rest(_b, [typeof _c === "symbol" ? _c : _c + ""]);
206
+ this.intervalCustomFilters = remaining;
207
+ }
208
+ }
209
+ syncPreselectedIntervalFilter(filter) {
210
+ var _a;
211
+ if (this.intervalCustomFilters[filter.column])
212
+ return;
213
+ const matchingRequest = this.requestFilters.find((rf) => rf.column === filter.column);
214
+ if (!((_a = matchingRequest === null || matchingRequest === void 0 ? void 0 : matchingRequest.values) === null || _a === void 0 ? void 0 : _a.length))
215
+ return;
216
+ this.setIntervalFilterLabel(filter, matchingRequest.values[0]);
217
+ }
201
218
  render() {
202
219
  var _a, _b;
203
220
  if (this.showInWidget &&
@@ -334,5 +334,4 @@
334
334
  .suggestion-info-text * {
335
335
  font-size: var(--font-size-label);
336
336
  margin: 0;
337
- font-weight: inherit;
338
337
  }
@@ -102,7 +102,7 @@ const emitSearchSuccess = (storeName, state, campaignTypeId) => {
102
102
  }));
103
103
  };
104
104
  const updateVisualSearchState = (store, isHiResUpdate = false) => async (response) => {
105
- var _a;
105
+ var _a, _b;
106
106
  const state = useStore(store);
107
107
  if (store === "shopTheLook") {
108
108
  state.visualSearchId = response.requestId;
@@ -111,10 +111,15 @@ const updateVisualSearchState = (store, isHiResUpdate = false) => async (respons
111
111
  const detectedObjects = response.interactions.suggestedSearchAreas.map(({ rectangle }) => rectangle);
112
112
  if (detectedObjects.length > 0)
113
113
  state.detectedObjects = detectedObjects;
114
+ const dynamicFilters = (_a = response.interactions.dynamicFilters) !== null && _a !== void 0 ? _a : [];
114
115
  state.visualSearchId = response.requestId;
115
116
  state.results = response.data.products;
116
- state.dynamicFilters = response.interactions.dynamicFilters;
117
- state.stream = (_a = response === null || response === void 0 ? void 0 : response.stream) !== null && _a !== void 0 ? _a : null;
117
+ state.dynamicFilters = dynamicFilters;
118
+ const extractedFilters = extractSelectedFilters(dynamicFilters);
119
+ if (state.requestFilters.length === 0 && extractedFilters.length > 0) {
120
+ state.requestFilters = extractedFilters;
121
+ }
122
+ state.stream = (_b = response === null || response === void 0 ? void 0 : response.stream) !== null && _b !== void 0 ? _b : null;
118
123
  state.searchStatus = "success";
119
124
  if (!isHiResUpdate)
120
125
  emitSearchSuccess(store, state, "VPS");
@@ -1,5 +1,5 @@
1
1
  import { h } from './index-RkvPN2Rk.js';
2
- import { j as addIfNotEmpty, p as parseStringToExcluded, o as isValueMatch, q as isIntervalMatch, r as valueToString, t as extractFilterValue } from './search.store-Crmiihat.js';
2
+ import { j as addIfNotEmpty, p as parseStringToExcluded, o as isValueMatch, q as isIntervalMatch, r as valueToString, t as extractFilterValue } from './search.store-B0ZhYtWV.js';
3
3
  import { i as instance } from './store-BJxQCbNV.js';
4
4
 
5
5
  const PlusIcon = () => (h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
@@ -368,4 +368,4 @@ const createImageSearchEvent = createTrackingEvent({
368
368
  typ: SEARCH_EVENT_TYPE,
369
369
  });
370
370
 
371
- export { CONTENT_GROUP_CSS_CLASS as C, DEFAULT_COLUMNS_NUMBER as D, FilterIconClose as F, PlusIcon as P, RESULTS_CALCULATED_COLUMNS_CSS_VAR as R, SET_MODE_IMAGE_WIDTH_CSS_VAR as S, createFilterEvent as a, createAddToBasketEvent as b, createWidgetEvent as c, createAddToWishlistEvent as d, createResultEventByType as e, createProductEventByType as f, getRemoveFilterAriaLabel as g, getCustomLabels as h, getIntervalLabel as i, triggerRemoveIntervalFilter as j, announceToScreenReader as k, isSubFilterActive as l, RenderFilterButton as m, createImageSearchEvent as n, CAROUSEL_IMAGE_WIDTH_CSS_VAR as o, CAROUSEL_CONTENT_WIDTH_CSS_VAR as p, CAROUSEL_COLUMNS_CSS_VAR as q, SCROLL_POSITION_TOLERANCE as r, syncRequestFilters as s, triggerFilter as t, triggerResetFilters as u, v4 as v, isPriceFilter as w, CUSTOM_LABELS_DELIMITER as x, getRecommendationsBody as y };
371
+ export { CONTENT_GROUP_CSS_CLASS as C, DEFAULT_COLUMNS_NUMBER as D, FilterIconClose as F, PlusIcon as P, RESULTS_CALCULATED_COLUMNS_CSS_VAR as R, SET_MODE_IMAGE_WIDTH_CSS_VAR as S, createFilterEvent as a, createAddToBasketEvent as b, createWidgetEvent as c, createAddToWishlistEvent as d, createResultEventByType as e, createProductEventByType as f, getRemoveFilterAriaLabel as g, getCustomLabels as h, triggerRemoveIntervalFilter as i, announceToScreenReader as j, isSubFilterActive as k, RenderFilterButton as l, getIntervalLabel as m, createImageSearchEvent as n, CAROUSEL_IMAGE_WIDTH_CSS_VAR as o, CAROUSEL_CONTENT_WIDTH_CSS_VAR as p, CAROUSEL_COLUMNS_CSS_VAR as q, SCROLL_POSITION_TOLERANCE as r, syncRequestFilters as s, triggerFilter as t, triggerResetFilters as u, v4 as v, isPriceFilter as w, CUSTOM_LABELS_DELIMITER as x, getRecommendationsBody as y };
@@ -8591,7 +8591,7 @@ const encodeToBase64UTF8 = (str) => {
8591
8591
  return btoa(String.fromCharCode.apply(null, utf8Array));
8592
8592
  };
8593
8593
 
8594
- const version = "2.216.1";
8594
+ const version = "2.216.2";
8595
8595
 
8596
8596
  const appStateGlobalDefaults = {
8597
8597
  excluded: null,
@@ -8680,7 +8680,7 @@ const emitSearchSuccess = (storeName, state, campaignTypeId) => {
8680
8680
  }));
8681
8681
  };
8682
8682
  const updateVisualSearchState = (store, isHiResUpdate = false) => async (response) => {
8683
- var _a;
8683
+ var _a, _b;
8684
8684
  const state = useStore(store);
8685
8685
  if (store === "shopTheLook") {
8686
8686
  state.visualSearchId = response.requestId;
@@ -8689,10 +8689,15 @@ const updateVisualSearchState = (store, isHiResUpdate = false) => async (respons
8689
8689
  const detectedObjects = response.interactions.suggestedSearchAreas.map(({ rectangle }) => rectangle);
8690
8690
  if (detectedObjects.length > 0)
8691
8691
  state.detectedObjects = detectedObjects;
8692
+ const dynamicFilters = (_a = response.interactions.dynamicFilters) !== null && _a !== void 0 ? _a : [];
8692
8693
  state.visualSearchId = response.requestId;
8693
8694
  state.results = response.data.products;
8694
- state.dynamicFilters = response.interactions.dynamicFilters;
8695
- state.stream = (_a = response === null || response === void 0 ? void 0 : response.stream) !== null && _a !== void 0 ? _a : null;
8695
+ state.dynamicFilters = dynamicFilters;
8696
+ const extractedFilters = extractSelectedFilters(dynamicFilters);
8697
+ if (state.requestFilters.length === 0 && extractedFilters.length > 0) {
8698
+ state.requestFilters = extractedFilters;
8699
+ }
8700
+ state.stream = (_b = response === null || response === void 0 ? void 0 : response.stream) !== null && _b !== void 0 ? _b : null;
8696
8701
  state.searchStatus = "success";
8697
8702
  if (!isHiResUpdate)
8698
8703
  emitSearchSuccess(store, state, "VPS");
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, H as Host, c as createEvent, g as getElement, F as Fragment } from './index-RkvPN2Rk.js';
2
2
  import { i as instance } from './store-BJxQCbNV.js';
3
- import { l as getAcceptableFileFormatsForDisplay, h as campaignTypeNames, j as addIfNotEmpty, n as searchState, u as useSearchStore, v as version } from './search.store-Crmiihat.js';
3
+ import { l as getAcceptableFileFormatsForDisplay, h as campaignTypeNames, j as addIfNotEmpty, n as searchState, u as useSearchStore, v as version } from './search.store-B0ZhYtWV.js';
4
4
  import { s as slotChangeListener, a as addEventListenersWithSignal } from './index-OsoUj2Au.js';
5
5
  import { S as SecondaryActionIcon } from './SecondaryActionIcon-FWFzrhba.js';
6
6
  import { m as modalParts, c as carouselParts, p as productCardParts, r as recommendationsParts, i as initializeLocale } from './index-BtnjaTty.js';
@@ -1,8 +1,8 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-RkvPN2Rk.js';
2
2
  import { _ as _functionExports, E as EitherExports, f as fold, b as fromImage, a as divideOnSized, e as isLeft, m as match, O as OptionExports } from './Rectangle-dmgo4KMB.js';
3
- import { w as toFile, c as makeUploadFileRequest, x as getImageSizes, v as version, h as campaignTypeNames, j as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, y as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, z as resetStore, k as makeTextSearchRequest, A as makeProductListingPageRequest, B as checkDeviceType, p as parseStringToExcluded } from './search.store-Crmiihat.js';
3
+ import { w as toFile, c as makeUploadFileRequest, x as getImageSizes, v as version, h as campaignTypeNames, j as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, y as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, z as resetStore, k as makeTextSearchRequest, A as makeProductListingPageRequest, B as checkDeviceType, p as parseStringToExcluded } from './search.store-B0ZhYtWV.js';
4
4
  import { s as slotChangeListener, a as addEventListenersWithSignal, p as productCardSlotNames, v as vprIconSlotName, f as findSlotElements, g as getSlotNames, b as setElementInteractivity, S as SlotSkeleton } from './index-OsoUj2Au.js';
5
- import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as getIntervalLabel, j as triggerRemoveIntervalFilter, k as announceToScreenReader, s as syncRequestFilters, l as isSubFilterActive, m as RenderFilterButton, n as createImageSearchEvent } from './index-BsmArtOR.js';
5
+ import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-CmCUlnFh.js';
6
6
  import { i as instance, t as trackEvent, a as isTrackingEnabled, d as defaultConfig } from './store-BJxQCbNV.js';
7
7
  import { M as MIN_SEARCH_AREA_SIZE, S as SUPPORTED_ASPECT_RATIO, a as MIN_IMAGE_SIDE_FOR_CROPPER, C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal, D as DEFAULT_IMAGE_SIZE } from './cropperUtils-CkB6bG3L.js';
8
8
  import { r as renderExternalCSS, o as openProductLink } from './openProductLink-CJ9Wo3Ye.js';
@@ -1048,7 +1048,7 @@ const VviinnSelectedFilters = class {
1048
1048
  resetImageFilter && (this.imageSrc = null);
1049
1049
  };
1050
1050
  this.handleFilterTriggered = ({ detail, }) => {
1051
- var _a, _b;
1051
+ var _a;
1052
1052
  if (this.skipStateChanges(detail.isTriggeredByVpsWidget))
1053
1053
  return;
1054
1054
  if (detail.customTrigger === "TPS") {
@@ -1056,14 +1056,7 @@ const VviinnSelectedFilters = class {
1056
1056
  this.textSearchCustomFilter = detail.kind;
1057
1057
  }
1058
1058
  if (detail.action === "select" && ((_a = detail.filter) === null || _a === void 0 ? void 0 : _a.type) === "interval") {
1059
- const intervalLabel = getIntervalLabel(detail.filter, detail.value.interval, (_b = this.currencySign) !== null && _b !== void 0 ? _b : defaultConfig.currencySign, true);
1060
- if (intervalLabel) {
1061
- this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [detail.filter.column]: intervalLabel });
1062
- }
1063
- else {
1064
- const _c = this.intervalCustomFilters, _d = detail.filter.column, remaining = __rest$1(_c, [typeof _d === "symbol" ? _d : _d + ""]);
1065
- this.intervalCustomFilters = remaining;
1066
- }
1059
+ this.setIntervalFilterLabel(detail.filter, detail.value.interval);
1067
1060
  }
1068
1061
  };
1069
1062
  this.handleImageUploadStarted = ({ detail }) => {
@@ -1168,6 +1161,10 @@ const VviinnSelectedFilters = class {
1168
1161
  this.selectedFilterButtons = [];
1169
1162
  const filters = ((_a = this.state) === null || _a === void 0 ? void 0 : _a.dynamicFilters) || [];
1170
1163
  filters.forEach((filter) => {
1164
+ if (filter.type === "interval") {
1165
+ this.syncPreselectedIntervalFilter(filter);
1166
+ return;
1167
+ }
1171
1168
  if (!("values" in filter))
1172
1169
  return;
1173
1170
  filter.values.forEach(({ value, label, active }) => {
@@ -1185,6 +1182,26 @@ const VviinnSelectedFilters = class {
1185
1182
  });
1186
1183
  });
1187
1184
  }
1185
+ setIntervalFilterLabel(filter, interval) {
1186
+ var _a;
1187
+ const label = getIntervalLabel(filter, interval, (_a = this.currencySign) !== null && _a !== void 0 ? _a : defaultConfig.currencySign, true);
1188
+ if (label) {
1189
+ this.intervalCustomFilters = Object.assign(Object.assign({}, this.intervalCustomFilters), { [filter.column]: label });
1190
+ }
1191
+ else {
1192
+ const _b = this.intervalCustomFilters, _c = filter.column, remaining = __rest$1(_b, [typeof _c === "symbol" ? _c : _c + ""]);
1193
+ this.intervalCustomFilters = remaining;
1194
+ }
1195
+ }
1196
+ syncPreselectedIntervalFilter(filter) {
1197
+ var _a;
1198
+ if (this.intervalCustomFilters[filter.column])
1199
+ return;
1200
+ const matchingRequest = this.requestFilters.find((rf) => rf.column === filter.column);
1201
+ if (!((_a = matchingRequest === null || matchingRequest === void 0 ? void 0 : matchingRequest.values) === null || _a === void 0 ? void 0 : _a.length))
1202
+ return;
1203
+ this.setIntervalFilterLabel(filter, matchingRequest.values[0]);
1204
+ }
1188
1205
  render() {
1189
1206
  var _a, _b;
1190
1207
  if (this.showInWidget &&
@@ -1522,7 +1539,7 @@ const syncSuggestionFilters = (activeFilters, stream) => {
1522
1539
  return updatedAppliedFilters;
1523
1540
  };
1524
1541
 
1525
- const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0;font-weight:inherit}";
1542
+ const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0}";
1526
1543
 
1527
1544
  const VviinnSuggestions = class {
1528
1545
  constructor(hostRef) {
@@ -1,8 +1,8 @@
1
1
  import { h, r as registerInstance, c as createEvent, f as forceUpdate, F as Fragment, H as Host, g as getElement } from './index-RkvPN2Rk.js';
2
- import { h as campaignTypeNames, j as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, C as isMobile, D as fromString, E as fold, v as version } from './search.store-Crmiihat.js';
2
+ import { h as campaignTypeNames, j as addIfNotEmpty, _ as _ArrayExports, u as useSearchStore, C as isMobile, D as fromString, E as fold, v as version } from './search.store-B0ZhYtWV.js';
3
3
  import { X as has, Y as tuple, _ as _functionExports, g as requireSemigroup, O as OptionExports, v as pipe$1, N as chainW, Z as makeRequest, L as fromEither, $ as resolveApiPath, a0 as createInitPostRequest, a1 as Apply, a2 as TaskEitherExports, E as EitherExports } from './Rectangle-dmgo4KMB.js';
4
4
  import { i as instance, d as defaultConfig, t as trackEvent, a as isTrackingEnabled } from './store-BJxQCbNV.js';
5
- import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, k as announceToScreenReader, i as getIntervalLabel, w as isPriceFilter, l as isSubFilterActive, m as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-BsmArtOR.js';
5
+ import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, q as CAROUSEL_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, r as SCROLL_POSITION_TOLERANCE, u as triggerResetFilters, t as triggerFilter, j as announceToScreenReader, m as getIntervalLabel, w as isPriceFilter, k as isSubFilterActive, l as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, x as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, y as getRecommendationsBody } from './index-CmCUlnFh.js';
6
6
  import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH, c as PRODUCT_CARD_IMAGE_RESOLUTION_WIDTH } from './constants-rqiiCPBX.js';
7
7
  import { s as slotChangeListener, a as addEventListenersWithSignal, i as isElementInSelector, S as SlotSkeleton } from './index-OsoUj2Au.js';
8
8
  import { o as energyLabelParts, i as initializeLocale, j as extendedFiltersParts, h as filtersParts, q as imageParts, e as contentCardParts, l as listCardParts, p as productCardParts, t as priceRangeParts } from './index-BtnjaTty.js';
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement
2
2
  import { a as divideOnSized, E as EitherExports } from './Rectangle-dmgo4KMB.js';
3
3
  import { C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal } from './cropperUtils-CkB6bG3L.js';
4
4
  import { g as getSwiperStyles, c as configureSwiperElement, r as register, e as extractSlideIndex, s as setupIntersectionObserver } from './swiper-element-Er2KrWw1.js';
5
- import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-Crmiihat.js';
5
+ import { i as isDesktop$1, s as shopTheLookState, m as makeVisualSearchRequest, a as makeVisualSearchByUrlRequest, b as imageFromFileTask, c as makeUploadFileRequest, g as getAcceptableFileFormats } from './search.store-B0ZhYtWV.js';
6
6
  import { S as SecondaryActionIcon } from './SecondaryActionIcon-FWFzrhba.js';
7
7
  import { i as initializeLocale, a as shopTheLookParts } from './index-BtnjaTty.js';
8
8
  import { d as defaultConfig } from './store-BJxQCbNV.js';
@@ -1,6 +1,6 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-RkvPN2Rk.js';
2
2
  import { _ as _functionExports, f as fold } from './Rectangle-dmgo4KMB.js';
3
- import { d as setTextSearchQuery, e as clearAutoSuggestCompletions, f as makeAutoSuggestRequest, v as version, h as campaignTypeNames, j as addIfNotEmpty, k as makeTextSearchRequest, u as useSearchStore } from './search.store-Crmiihat.js';
3
+ import { d as setTextSearchQuery, e as clearAutoSuggestCompletions, f as makeAutoSuggestRequest, v as version, h as campaignTypeNames, j as addIfNotEmpty, k as makeTextSearchRequest, u as useSearchStore } from './search.store-B0ZhYtWV.js';
4
4
  import { s as slotChangeListener, f as findSlotElements } from './index-OsoUj2Au.js';
5
5
  import { i as instance, d as defaultConfig } from './store-BJxQCbNV.js';
6
6
  import { i as initializeLocale, b as searchBarParts, s as searchModalFirstScreenParts } from './index-BtnjaTty.js';
@@ -61,5 +61,7 @@ export declare class VviinnSelectedFilters {
61
61
  componentDidRender(): void;
62
62
  disconnectedCallback(): void;
63
63
  componentWillRender(): void;
64
+ private setIntervalFilterLabel;
65
+ private syncPreselectedIntervalFilter;
64
66
  render(): any;
65
67
  }
@@ -1 +1 @@
1
- import{h as t,r as e,c as i,H as o,g as s}from"./p-RkvPN2Rk.js";import{_ as r,f as a}from"./p-CrEgr0jU.js";import{d as n,e as h,f as c,v as l,h as d,j as p,k as f,u as g}from"./p-DYkVwvAf.js";import{s as u,f as b}from"./p-DKHkeCw7.js";import{i as x,d as v}from"./p-BJxQCbNV.js";import{i as m,b as y,s as w}from"./p-CPTOq59a.js";import{i as C,b as k}from"./p-niHq9WT6.js";const S=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),T=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"24",height:"24","aria-hidden":"true"},t("path",{d:"M12 14C11.1667 14 10.4583 13.7083 9.87501 13.125C9.29168 12.5417 9.00001 11.8333 9.00001 11V5C9.00001 4.16667 9.29168 3.45833 9.87501 2.875C10.4583 2.29167 11.1667 2 12 2C12.8333 2 13.5417 2.29167 14.125 2.875C14.7083 3.45833 15 4.16667 15 5V11C15 11.8333 14.7083 12.5417 14.125 13.125C13.5417 13.7083 12.8333 14 12 14ZM11 20V17.925C9.46668 17.7083 8.15418 17.0583 7.06251 15.975C5.97085 14.8917 5.30835 13.575 5.07501 12.025C5.04168 11.7417 5.11668 11.5 5.30001 11.3C5.48335 11.1 5.71668 11 6.00001 11C6.28335 11 6.52085 11.0958 6.71251 11.2875C6.90418 11.4792 7.03335 11.7167 7.10001 12C7.33335 13.1667 7.91251 14.125 8.83751 14.875C9.76251 15.625 10.8167 16 12 16C13.2 16 14.2583 15.6208 15.175 14.8625C16.0917 14.1042 16.6667 13.15 16.9 12C16.9667 11.7167 17.0958 11.4792 17.2875 11.2875C17.4792 11.0958 17.7167 11 18 11C18.2833 11 18.5167 11.1 18.7 11.3C18.8833 11.5 18.9583 11.7417 18.925 12.025C18.6917 13.5417 18.0333 14.85 16.95 15.95C15.8667 17.05 14.55 17.7083 13 17.925V20C13 20.2833 12.9042 20.5208 12.7125 20.7125C12.5208 20.9042 12.2833 21 12 21C11.7167 21 11.4792 20.9042 11.2875 20.7125C11.0958 20.5208 11 20.2833 11 20Z",fill:"#161616"})),z=()=>{var t;const e=window,i=window.navigator,o=i.vendor,s=[void 0!==e.opr,i.userAgent.indexOf("Firefox")>-1,i.userAgent.indexOf("Edg")>-1].some((t=>!0===t)),r=void 0!==i.userAgentData?"Google Chrome"===(null===(t=i.userAgentData.brands[0])||void 0===t?void 0:t.brand):"Google Inc."===o;return{forbiddenBrowser:s,isChrome:r,isSafari:i.userAgent.indexOf("Safari")>-1&&!r}},j=class{constructor(t){e(this,t),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished"),this.vviinnFilterTriggered=i(this,"vviinnFilterTriggered"),this.vviinnTextSearchStarted=i(this,"vviinnTextSearchStarted"),this.widgetTextSearchFinished=i(this,"widgetTextSearchFinished"),this.vviinnSelectedFiltersReset=i(this,"vviinnSelectedFiltersReset"),this.vviinnNoResult=i(this,"vviinnNoResult"),this.vviinnRedirect=i(this,"vviinnRedirect"),this.mode="basic",this.placeholder="",this.autoSuggestShow=!1,this.showInWidget=!1,this.showOnFirstScreen=!1,this.isRecording=!1,this.showTooltip=!1,this.autoSuggestCompletions=[],this.activeSuggestionIndex=-1,this.originalQuery="",this.searchSubmitted=!1,this.slots=[],this.isShowPreloader=()=>"loading"===this.state.searchStatus&&"text"===this.state.searchType,this.isShowRecording=()=>this.isRecording,this.showRecording=()=>this.isRecording=!0,this.hideRecording=()=>this.isRecording=!1,this.setShowTooltip=t=>{this.showTooltip=t},this.tooltipText=(()=>{const{isSafari:t}=z();return t?"speechRecognition.tooltip.siri":"speechRecognition.tooltip.general"})(),this.getPlaceholderText=()=>this.isShowRecording()?x.t("speechRecognition.placeholder"):this.placeholder.length?this.placeholder:x.t("textSearchPlaceholder"),this.recognition=null,this.trackTextSearch=()=>this.vviinnFilterTriggered.emit({kind:this.state.textSearchQuery,action:"select",customTrigger:"TPS",isTriggeredByVpsWidget:this.showInWidget}),this.getBasicEventData=()=>this.showInWidget&&this.basicEventData?this.basicEventData:Object.assign({campaignTypeId:"TPS",campaignTypeName:d.TPS,widgetVersion:l},p("widgetId",this.el.id)),this.handleSpeech=async()=>{this.recognition&&(this.isRecording?(this.recognition.stop(),this.hideRecording(),this.setShowTooltip(!1)):(this.recognition.start(),n(this.storeName,null),this.triggerTooltipStart=setTimeout((()=>{this.isRecording||(this.setShowTooltip(!0),this.triggerTooltipEnd=setTimeout((()=>{this.setShowTooltip(!1)}),5e3))}),1e3)))},this.hideSuggestions=()=>{h(this.storeName)},this.selectSuggestion=t=>{if(n(this.storeName,t.suggestion),this.hideSuggestions(),t.url)return this.trackTextSearch(),void this.handleTextSearchRedirect(t.url,"auto-suggest",t.suggestion);this.handleTextSearch(!0)},this.handleTextSearch=async(t=!1)=>{var e;const i=this.state.textSearchQuery;if(!i)return;this.searchSubmitted=!0,null===(e=this.autoSuggestHandler)||void 0===e||e.cancelPending(),this.hideSuggestions(),t||(await this.checkAutoSuggest(i),this.hideSuggestions()),this.trackTextSearch();const o=this.state.redirect;if((null==o?void 0:o.url)&&o.query===i)this.handleTextSearchRedirect(o.url,"auto-suggest",i);else if(!this.resultsPageUrl||this.showInWidget||C(this.resultsPageUrl))this.vviinnTextSearchStarted.emit({query:i,isTriggeredByVpsWidget:this.showInWidget}),this.showInWidget&&this.showOnFirstScreen&&r.pipe(await f(this.storeName,i,this.token,this.apiPath),a((()=>{this.vviinnNoResult.emit(this.getBasicEventData())}),(t=>{this.widgetTextSearchFinished.emit({query:i,requestId:t.requestId}),this.vviinnSelectedFiltersReset.emit({isTriggeredByVpsWidget:this.showInWidget})})));else{const t=k(this.resultsPageUrl,i);this.handleTextSearchRedirect(t,"text-search",i)}},this.checkAutoSuggest=async t=>{r.pipe(await c(this.storeName,t,this.token,this.apiPath),a((()=>{}),(()=>{})))},this.handleKeyDown=t=>{this.autoSuggestShow?((t,e)=>{const{completions:i,activeSuggestionIndex:o,originalQuery:s,storeName:r,textSearchQuery:a,onActiveIndexChange:h,onOriginalQueryChange:c,onSelectSuggestion:l,onHideSuggestions:d,onSearch:p}=e,f=i.length>0;switch(t.key){case"ArrowDown":if(f){t.preventDefault(),-1===o&&c(a);const e=Math.min(o+1,i.length-1);h(e),n(r,i[e].suggestion)}break;case"ArrowUp":if(f&&o>-1){t.preventDefault();const e=o-1;h(e),n(r,-1===e?s:i[e].suggestion)}break;case"Escape":d();break;case"Enter":f&&o>=0?(t.preventDefault(),l(i[o])):p()}})(t,{completions:this.autoSuggestCompletions,activeSuggestionIndex:this.activeSuggestionIndex,originalQuery:this.originalQuery,storeName:this.storeName,textSearchQuery:this.state.textSearchQuery,onActiveIndexChange:t=>this.activeSuggestionIndex=t,onOriginalQueryChange:t=>this.originalQuery=t,onSelectSuggestion:this.selectSuggestion,onHideSuggestions:this.hideSuggestions,onSearch:this.handleTextSearch}):"Enter"===t.key&&this.handleTextSearch()},this.handleButtonKeyDown=(t,e)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}}connectedCallback(){const{state:t,storeName:e,onChange:i}=g(this.showInWidget);this.state=t,this.storeName=e,this.autoSuggestShow&&(this.disposeOnChange=i("autoSuggestCompletions",(t=>{this.searchSubmitted&&t.length>0||(this.autoSuggestCompletions=t,this.activeSuggestionIndex=-1)})))}disconnectedCallback(){var t,e;clearTimeout(this.triggerTooltipStart),clearTimeout(this.triggerTooltipEnd),null===(t=this.autoSuggestHandler)||void 0===t||t.cleanup(),null===(e=this.disposeOnChange)||void 0===e||e.call(this)}async componentWillLoad(){var t,e,i;await m(this.locale),u(this,this.el),this.slots=b(this.el),this.autoSuggestShow&&(this.autoSuggestHandler=((t,e,i)=>{let o;const s=()=>clearTimeout(o);return{handleInputChange:s=>{n(t,s),clearTimeout(o),s?o=setTimeout((()=>{c(t,s,e,i)}),300):h(t)},cancelPending:s,cleanup:s}})(this.storeName,this.token,this.apiPath)),this.recognition=((t,e,i,o)=>{const s=(()=>{const t=window,e=t.webkitSpeechRecognition||t.SpeechRecognition;if(!e)return;const{forbiddenBrowser:i,isChrome:o,isSafari:s}=z();return i?void 0:o||s?e:void 0})();if(!s)return;const r=new s;let a;return r.interimResults=!1,r.maxAlternatives=1,r.continuous=!1,r.lang=t,r.onstart=()=>{e(),a=setTimeout((()=>{r.stop()}),1e4)},r.onspeechend=()=>{r.stop(),i(),clearTimeout(a)},r.onend=i,r.onresult=t=>{o(t.results[0][0].transcript)},r})(null!==(t=this.locale)&&void 0!==t?t:v.locale,(()=>{this.showRecording(),this.setShowTooltip(!1),clearTimeout(this.triggerTooltipStart)}),this.hideRecording,(t=>{n(this.storeName,t),this.handleTextSearch()})),(null===(e=this.searchQuery)||void 0===e?void 0:e.length)>0&&n(this.storeName,this.searchQuery),!this.showInWidget&&(null===(i=this.searchQuery)||void 0===i?void 0:i.length)>0&&(this.vviinnTextSearchStarted.emit({query:this.searchQuery,isTriggeredByVpsWidget:this.showInWidget}),this.trackTextSearch())}handleInputChange(t){this.searchSubmitted=!1;const e=t.target.value;this.autoSuggestShow?this.autoSuggestHandler.handleInputChange(e):n(this.storeName,e)}handleTextSearchRedirect(t,e,i){const o=Object.assign(Object.assign({},this.getBasicEventData()),{url:t,source:e,query:i});this.vviinnRedirect.emit(o).defaultPrevented?this.state.redirect=null:window.location.href=t}render(){return t(o,{key:"40adcea597cc4fcad1536d339dfa2d796d707a19",exportparts:`${y}, ${w}`},t("div",{key:"de96469072c5878315a5ceaf65fb66e354cc9503",class:"text-search-container",part:"text-search-container"},t("input",Object.assign({key:"f7839a9cf55e1eb69050c8ba754d99819f1ac0de",class:"text-search-input",part:"text-search-input",type:"text",placeholder:this.getPlaceholderText(),value:this.state.textSearchQuery||"",onInput:t=>this.handleInputChange(t),onKeyDown:this.handleKeyDown,onBlur:this.autoSuggestShow?this.hideSuggestions:void 0},this.autoSuggestShow&&{role:"combobox","aria-autocomplete":"list","aria-expanded":this.autoSuggestCompletions.length>0&&this.state.textSearchQuery?"true":"false","aria-controls":"suggestions-listbox","aria-activedescendant":this.activeSuggestionIndex>=0?`suggestion-${this.activeSuggestionIndex}`:void 0})),"extended"===this.mode&&t("vviinn-vps-button",Object.assign({key:"4db54fd5971aa42ddfe8d9726e2a30db76e52ea2",token:this.token,locale:this.locale,apiPath:this.apiPath,addStyle:!1,showResultsInModal:!1,resultsPageUrl:this.resultsPageUrl},this.exampleImageSource&&{exampleImageSource:this.exampleImageSource},null!=this.cssUrl&&{cssUrl:this.cssUrl},this.visualSearchMode&&{mode:this.visualSearchMode},{parentSlots:this.slots})),"basic"===this.mode&&t("slot",{key:"1d3b73de7d856483d70cafd2a5296bde3abb2455",name:"vviinn-text-search-actions"}),("extended"===this.mode||this.showInWidget)&&this.recognition&&t("button",{key:"536ba7e00844f2e9644c202cc732c4f27eae7ac1",class:"speech-button",part:"speech-button","aria-label":x.t("a11y.speechButton"),onClick:this.handleSpeech,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleSpeech)},t(T,{key:"6545fda4f3c068fee2ea2fd0822576ec8652a2df"}),this.isShowRecording()&&t("span",{key:"5e15e2f6a91a1e6dac4d73a0f213600c5b1278b9",class:"recording-indicator"})),t("button",{key:"4358eaa9c64781749eae01e941b10568c0468caa",class:"text-search-button",part:"text-search-button",onClick:()=>this.handleTextSearch(),onKeyDown:t=>this.handleButtonKeyDown(t,this.handleTextSearch),disabled:"loading"===this.state.searchStatus,"aria-label":x.t("a11y.textSearchButton")},this.isShowPreloader()?t("vviinn-preloader",null):t("slot",{name:"vviinn-text-search-icon"},t(S,null)))),this.autoSuggestShow&&(i=this.state.textSearchQuery,s=this.activeSuggestionIndex,r=this.selectSuggestion,(e=this.autoSuggestCompletions).length&&i?t("ul",{class:"suggestions-container",part:"suggestions-container",role:"listbox",id:"suggestions-listbox"},e.map(((e,o)=>t("li",{id:`suggestion-${o}`,class:{"suggestion-item":!0,"suggestion-item--active":o===s},part:"suggestion-item",role:"option","aria-selected":o===s?"true":"false",onMouseDown:t=>{t.preventDefault(),r(e)}},((e,i)=>{const o=e.toLowerCase(),s=i.toLowerCase(),r=o.indexOf(s);if(-1===r)return e;const a=e.slice(0,r),n=e.slice(r,r+i.length),h=e.slice(r+i.length);return[a,t("span",{class:"suggestion-highlight"},n),h]})(e.suggestion,i))))):null),this.showTooltip&&t("p",{key:"643af912b5868cb018aa06742bd2b3566e235c3a",class:"text-search-tooltip",part:"text-search-tooltip"},x.t(this.tooltipText)));var e,i,s,r}get el(){return s(this)}};j.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:block;position:relative;width:100%;}.text-search-container{display:flex;align-items:center;gap:var(--spacing-50);width:100%;height:46px;border:1px solid var(--color-border-02);border-radius:8px;transition:border-color 0.2s;overflow:hidden;box-sizing:border-box}.text-search-container:focus-within{border-color:#8d8d8d}.text-search-input,.text-search-tooltip{font-size:16px;font-style:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base))}.text-search-input{height:100%;padding-left:16px;box-sizing:border-box;border:none;outline:none;overflow:hidden;text-overflow:ellipsis;flex-grow:2;width:150px}.text-search-input::-moz-placeholder{color:#a8a8a8}.text-search-input::placeholder{color:#a8a8a8}.text-search-input:focus,.text-search-input:active{border-color:#8d8d8d}vviinn-vps-button{height:100%}.text-search-button,.speech-button,vviinn-vps-button::part(vviinn-button){border:none;height:100%;display:flex;justify-content:center;align-items:center;cursor:pointer}.speech-button,vviinn-vps-button::part(vviinn-button){padding:0 8px}.upload-button-text{display:contents}.text-search-button{background-color:#f4f4f4;transition:background-color 0.2s;aspect-ratio:1 / 1;border-radius:0 7px 7px 0}.speech-button{background-color:transparent;position:relative}@keyframes recordingSpeech{0%{background-color:#ff0000;scale:1}100%{background-color:#ff8888;scale:1.5}}.recording-indicator{border-radius:50%;width:8px;height:8px;left:24px;top:24px;background-color:#ff0000;position:absolute;animation:recordingSpeech 1s infinite alternate ease-in-out}@keyframes fade-out{0%{opacity:0}20%{opacity:1}80%{opacity:1}100%{opacity:0;display:none}}.text-search-tooltip{position:absolute;right:0;top:80%;background:#f4f4f4;animation:fade-out 5s forwards;width:-moz-fit-content;width:fit-content;padding:24px;border-radius:8px;border:1px solid #8d8d8d;box-sizing:border-box}.text-search-button:not(:disabled):hover{background-color:#e0e0e0}.text-search-button:disabled{cursor:unset}vviinn-image-selector,::slotted([slot="vviinn-text-search-actions"]){margin:auto 8px}vviinn-preloader{--preloader-size:16px;display:flex;color:#525252}.suggestions-container{position:absolute;top:100%;left:0;right:0;margin:var(--spacing-50) 0 0;padding:4px;list-style:none;background:#ffffff;border:1px solid #fafafa;border-radius:8px;box-shadow:0px 4px 12px rgba(0, 0, 0, 0.08);box-sizing:border-box;z-index:10}.suggestion-item{padding:4px 8px;border-radius:4px;font-size:16px;line-height:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base));cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.suggestion-item:hover,.suggestion-item--active{background-color:#f4f4f4}.suggestion-highlight{font-weight:500}';export{j as vviinn_text_search}
1
+ import{h as t,r as e,c as i,H as o,g as s}from"./p-RkvPN2Rk.js";import{_ as r,f as a}from"./p-CrEgr0jU.js";import{d as n,e as h,f as c,v as l,h as d,j as p,k as f,u as g}from"./p-DIMfQtwJ.js";import{s as u,f as b}from"./p-DKHkeCw7.js";import{i as x,d as v}from"./p-BJxQCbNV.js";import{i as m,b as y,s as w}from"./p-CPTOq59a.js";import{i as C,b as k}from"./p-niHq9WT6.js";const S=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),T=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"24",height:"24","aria-hidden":"true"},t("path",{d:"M12 14C11.1667 14 10.4583 13.7083 9.87501 13.125C9.29168 12.5417 9.00001 11.8333 9.00001 11V5C9.00001 4.16667 9.29168 3.45833 9.87501 2.875C10.4583 2.29167 11.1667 2 12 2C12.8333 2 13.5417 2.29167 14.125 2.875C14.7083 3.45833 15 4.16667 15 5V11C15 11.8333 14.7083 12.5417 14.125 13.125C13.5417 13.7083 12.8333 14 12 14ZM11 20V17.925C9.46668 17.7083 8.15418 17.0583 7.06251 15.975C5.97085 14.8917 5.30835 13.575 5.07501 12.025C5.04168 11.7417 5.11668 11.5 5.30001 11.3C5.48335 11.1 5.71668 11 6.00001 11C6.28335 11 6.52085 11.0958 6.71251 11.2875C6.90418 11.4792 7.03335 11.7167 7.10001 12C7.33335 13.1667 7.91251 14.125 8.83751 14.875C9.76251 15.625 10.8167 16 12 16C13.2 16 14.2583 15.6208 15.175 14.8625C16.0917 14.1042 16.6667 13.15 16.9 12C16.9667 11.7167 17.0958 11.4792 17.2875 11.2875C17.4792 11.0958 17.7167 11 18 11C18.2833 11 18.5167 11.1 18.7 11.3C18.8833 11.5 18.9583 11.7417 18.925 12.025C18.6917 13.5417 18.0333 14.85 16.95 15.95C15.8667 17.05 14.55 17.7083 13 17.925V20C13 20.2833 12.9042 20.5208 12.7125 20.7125C12.5208 20.9042 12.2833 21 12 21C11.7167 21 11.4792 20.9042 11.2875 20.7125C11.0958 20.5208 11 20.2833 11 20Z",fill:"#161616"})),z=()=>{var t;const e=window,i=window.navigator,o=i.vendor,s=[void 0!==e.opr,i.userAgent.indexOf("Firefox")>-1,i.userAgent.indexOf("Edg")>-1].some((t=>!0===t)),r=void 0!==i.userAgentData?"Google Chrome"===(null===(t=i.userAgentData.brands[0])||void 0===t?void 0:t.brand):"Google Inc."===o;return{forbiddenBrowser:s,isChrome:r,isSafari:i.userAgent.indexOf("Safari")>-1&&!r}},I=class{constructor(t){e(this,t),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished"),this.vviinnFilterTriggered=i(this,"vviinnFilterTriggered"),this.vviinnTextSearchStarted=i(this,"vviinnTextSearchStarted"),this.widgetTextSearchFinished=i(this,"widgetTextSearchFinished"),this.vviinnSelectedFiltersReset=i(this,"vviinnSelectedFiltersReset"),this.vviinnNoResult=i(this,"vviinnNoResult"),this.vviinnRedirect=i(this,"vviinnRedirect"),this.mode="basic",this.placeholder="",this.autoSuggestShow=!1,this.showInWidget=!1,this.showOnFirstScreen=!1,this.isRecording=!1,this.showTooltip=!1,this.autoSuggestCompletions=[],this.activeSuggestionIndex=-1,this.originalQuery="",this.searchSubmitted=!1,this.slots=[],this.isShowPreloader=()=>"loading"===this.state.searchStatus&&"text"===this.state.searchType,this.isShowRecording=()=>this.isRecording,this.showRecording=()=>this.isRecording=!0,this.hideRecording=()=>this.isRecording=!1,this.setShowTooltip=t=>{this.showTooltip=t},this.tooltipText=(()=>{const{isSafari:t}=z();return t?"speechRecognition.tooltip.siri":"speechRecognition.tooltip.general"})(),this.getPlaceholderText=()=>this.isShowRecording()?x.t("speechRecognition.placeholder"):this.placeholder.length?this.placeholder:x.t("textSearchPlaceholder"),this.recognition=null,this.trackTextSearch=()=>this.vviinnFilterTriggered.emit({kind:this.state.textSearchQuery,action:"select",customTrigger:"TPS",isTriggeredByVpsWidget:this.showInWidget}),this.getBasicEventData=()=>this.showInWidget&&this.basicEventData?this.basicEventData:Object.assign({campaignTypeId:"TPS",campaignTypeName:d.TPS,widgetVersion:l},p("widgetId",this.el.id)),this.handleSpeech=async()=>{this.recognition&&(this.isRecording?(this.recognition.stop(),this.hideRecording(),this.setShowTooltip(!1)):(this.recognition.start(),n(this.storeName,null),this.triggerTooltipStart=setTimeout((()=>{this.isRecording||(this.setShowTooltip(!0),this.triggerTooltipEnd=setTimeout((()=>{this.setShowTooltip(!1)}),5e3))}),1e3)))},this.hideSuggestions=()=>{h(this.storeName)},this.selectSuggestion=t=>{if(n(this.storeName,t.suggestion),this.hideSuggestions(),t.url)return this.trackTextSearch(),void this.handleTextSearchRedirect(t.url,"auto-suggest",t.suggestion);this.handleTextSearch(!0)},this.handleTextSearch=async(t=!1)=>{var e;const i=this.state.textSearchQuery;if(!i)return;this.searchSubmitted=!0,null===(e=this.autoSuggestHandler)||void 0===e||e.cancelPending(),this.hideSuggestions(),t||(await this.checkAutoSuggest(i),this.hideSuggestions()),this.trackTextSearch();const o=this.state.redirect;if((null==o?void 0:o.url)&&o.query===i)this.handleTextSearchRedirect(o.url,"auto-suggest",i);else if(!this.resultsPageUrl||this.showInWidget||C(this.resultsPageUrl))this.vviinnTextSearchStarted.emit({query:i,isTriggeredByVpsWidget:this.showInWidget}),this.showInWidget&&this.showOnFirstScreen&&r.pipe(await f(this.storeName,i,this.token,this.apiPath),a((()=>{this.vviinnNoResult.emit(this.getBasicEventData())}),(t=>{this.widgetTextSearchFinished.emit({query:i,requestId:t.requestId}),this.vviinnSelectedFiltersReset.emit({isTriggeredByVpsWidget:this.showInWidget})})));else{const t=k(this.resultsPageUrl,i);this.handleTextSearchRedirect(t,"text-search",i)}},this.checkAutoSuggest=async t=>{r.pipe(await c(this.storeName,t,this.token,this.apiPath),a((()=>{}),(()=>{})))},this.handleKeyDown=t=>{this.autoSuggestShow?((t,e)=>{const{completions:i,activeSuggestionIndex:o,originalQuery:s,storeName:r,textSearchQuery:a,onActiveIndexChange:h,onOriginalQueryChange:c,onSelectSuggestion:l,onHideSuggestions:d,onSearch:p}=e,f=i.length>0;switch(t.key){case"ArrowDown":if(f){t.preventDefault(),-1===o&&c(a);const e=Math.min(o+1,i.length-1);h(e),n(r,i[e].suggestion)}break;case"ArrowUp":if(f&&o>-1){t.preventDefault();const e=o-1;h(e),n(r,-1===e?s:i[e].suggestion)}break;case"Escape":d();break;case"Enter":f&&o>=0?(t.preventDefault(),l(i[o])):p()}})(t,{completions:this.autoSuggestCompletions,activeSuggestionIndex:this.activeSuggestionIndex,originalQuery:this.originalQuery,storeName:this.storeName,textSearchQuery:this.state.textSearchQuery,onActiveIndexChange:t=>this.activeSuggestionIndex=t,onOriginalQueryChange:t=>this.originalQuery=t,onSelectSuggestion:this.selectSuggestion,onHideSuggestions:this.hideSuggestions,onSearch:this.handleTextSearch}):"Enter"===t.key&&this.handleTextSearch()},this.handleButtonKeyDown=(t,e)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}}connectedCallback(){const{state:t,storeName:e,onChange:i}=g(this.showInWidget);this.state=t,this.storeName=e,this.autoSuggestShow&&(this.disposeOnChange=i("autoSuggestCompletions",(t=>{this.searchSubmitted&&t.length>0||(this.autoSuggestCompletions=t,this.activeSuggestionIndex=-1)})))}disconnectedCallback(){var t,e;clearTimeout(this.triggerTooltipStart),clearTimeout(this.triggerTooltipEnd),null===(t=this.autoSuggestHandler)||void 0===t||t.cleanup(),null===(e=this.disposeOnChange)||void 0===e||e.call(this)}async componentWillLoad(){var t,e,i;await m(this.locale),u(this,this.el),this.slots=b(this.el),this.autoSuggestShow&&(this.autoSuggestHandler=((t,e,i)=>{let o;const s=()=>clearTimeout(o);return{handleInputChange:s=>{n(t,s),clearTimeout(o),s?o=setTimeout((()=>{c(t,s,e,i)}),300):h(t)},cancelPending:s,cleanup:s}})(this.storeName,this.token,this.apiPath)),this.recognition=((t,e,i,o)=>{const s=(()=>{const t=window,e=t.webkitSpeechRecognition||t.SpeechRecognition;if(!e)return;const{forbiddenBrowser:i,isChrome:o,isSafari:s}=z();return i?void 0:o||s?e:void 0})();if(!s)return;const r=new s;let a;return r.interimResults=!1,r.maxAlternatives=1,r.continuous=!1,r.lang=t,r.onstart=()=>{e(),a=setTimeout((()=>{r.stop()}),1e4)},r.onspeechend=()=>{r.stop(),i(),clearTimeout(a)},r.onend=i,r.onresult=t=>{o(t.results[0][0].transcript)},r})(null!==(t=this.locale)&&void 0!==t?t:v.locale,(()=>{this.showRecording(),this.setShowTooltip(!1),clearTimeout(this.triggerTooltipStart)}),this.hideRecording,(t=>{n(this.storeName,t),this.handleTextSearch()})),(null===(e=this.searchQuery)||void 0===e?void 0:e.length)>0&&n(this.storeName,this.searchQuery),!this.showInWidget&&(null===(i=this.searchQuery)||void 0===i?void 0:i.length)>0&&(this.vviinnTextSearchStarted.emit({query:this.searchQuery,isTriggeredByVpsWidget:this.showInWidget}),this.trackTextSearch())}handleInputChange(t){this.searchSubmitted=!1;const e=t.target.value;this.autoSuggestShow?this.autoSuggestHandler.handleInputChange(e):n(this.storeName,e)}handleTextSearchRedirect(t,e,i){const o=Object.assign(Object.assign({},this.getBasicEventData()),{url:t,source:e,query:i});this.vviinnRedirect.emit(o).defaultPrevented?this.state.redirect=null:window.location.href=t}render(){return t(o,{key:"40adcea597cc4fcad1536d339dfa2d796d707a19",exportparts:`${y}, ${w}`},t("div",{key:"de96469072c5878315a5ceaf65fb66e354cc9503",class:"text-search-container",part:"text-search-container"},t("input",Object.assign({key:"f7839a9cf55e1eb69050c8ba754d99819f1ac0de",class:"text-search-input",part:"text-search-input",type:"text",placeholder:this.getPlaceholderText(),value:this.state.textSearchQuery||"",onInput:t=>this.handleInputChange(t),onKeyDown:this.handleKeyDown,onBlur:this.autoSuggestShow?this.hideSuggestions:void 0},this.autoSuggestShow&&{role:"combobox","aria-autocomplete":"list","aria-expanded":this.autoSuggestCompletions.length>0&&this.state.textSearchQuery?"true":"false","aria-controls":"suggestions-listbox","aria-activedescendant":this.activeSuggestionIndex>=0?`suggestion-${this.activeSuggestionIndex}`:void 0})),"extended"===this.mode&&t("vviinn-vps-button",Object.assign({key:"4db54fd5971aa42ddfe8d9726e2a30db76e52ea2",token:this.token,locale:this.locale,apiPath:this.apiPath,addStyle:!1,showResultsInModal:!1,resultsPageUrl:this.resultsPageUrl},this.exampleImageSource&&{exampleImageSource:this.exampleImageSource},null!=this.cssUrl&&{cssUrl:this.cssUrl},this.visualSearchMode&&{mode:this.visualSearchMode},{parentSlots:this.slots})),"basic"===this.mode&&t("slot",{key:"1d3b73de7d856483d70cafd2a5296bde3abb2455",name:"vviinn-text-search-actions"}),("extended"===this.mode||this.showInWidget)&&this.recognition&&t("button",{key:"536ba7e00844f2e9644c202cc732c4f27eae7ac1",class:"speech-button",part:"speech-button","aria-label":x.t("a11y.speechButton"),onClick:this.handleSpeech,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleSpeech)},t(T,{key:"6545fda4f3c068fee2ea2fd0822576ec8652a2df"}),this.isShowRecording()&&t("span",{key:"5e15e2f6a91a1e6dac4d73a0f213600c5b1278b9",class:"recording-indicator"})),t("button",{key:"4358eaa9c64781749eae01e941b10568c0468caa",class:"text-search-button",part:"text-search-button",onClick:()=>this.handleTextSearch(),onKeyDown:t=>this.handleButtonKeyDown(t,this.handleTextSearch),disabled:"loading"===this.state.searchStatus,"aria-label":x.t("a11y.textSearchButton")},this.isShowPreloader()?t("vviinn-preloader",null):t("slot",{name:"vviinn-text-search-icon"},t(S,null)))),this.autoSuggestShow&&(i=this.state.textSearchQuery,s=this.activeSuggestionIndex,r=this.selectSuggestion,(e=this.autoSuggestCompletions).length&&i?t("ul",{class:"suggestions-container",part:"suggestions-container",role:"listbox",id:"suggestions-listbox"},e.map(((e,o)=>t("li",{id:`suggestion-${o}`,class:{"suggestion-item":!0,"suggestion-item--active":o===s},part:"suggestion-item",role:"option","aria-selected":o===s?"true":"false",onMouseDown:t=>{t.preventDefault(),r(e)}},((e,i)=>{const o=e.toLowerCase(),s=i.toLowerCase(),r=o.indexOf(s);if(-1===r)return e;const a=e.slice(0,r),n=e.slice(r,r+i.length),h=e.slice(r+i.length);return[a,t("span",{class:"suggestion-highlight"},n),h]})(e.suggestion,i))))):null),this.showTooltip&&t("p",{key:"643af912b5868cb018aa06742bd2b3566e235c3a",class:"text-search-tooltip",part:"text-search-tooltip"},x.t(this.tooltipText)));var e,i,s,r}get el(){return s(this)}};I.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:block;position:relative;width:100%;}.text-search-container{display:flex;align-items:center;gap:var(--spacing-50);width:100%;height:46px;border:1px solid var(--color-border-02);border-radius:8px;transition:border-color 0.2s;overflow:hidden;box-sizing:border-box}.text-search-container:focus-within{border-color:#8d8d8d}.text-search-input,.text-search-tooltip{font-size:16px;font-style:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base))}.text-search-input{height:100%;padding-left:16px;box-sizing:border-box;border:none;outline:none;overflow:hidden;text-overflow:ellipsis;flex-grow:2;width:150px}.text-search-input::-moz-placeholder{color:#a8a8a8}.text-search-input::placeholder{color:#a8a8a8}.text-search-input:focus,.text-search-input:active{border-color:#8d8d8d}vviinn-vps-button{height:100%}.text-search-button,.speech-button,vviinn-vps-button::part(vviinn-button){border:none;height:100%;display:flex;justify-content:center;align-items:center;cursor:pointer}.speech-button,vviinn-vps-button::part(vviinn-button){padding:0 8px}.upload-button-text{display:contents}.text-search-button{background-color:#f4f4f4;transition:background-color 0.2s;aspect-ratio:1 / 1;border-radius:0 7px 7px 0}.speech-button{background-color:transparent;position:relative}@keyframes recordingSpeech{0%{background-color:#ff0000;scale:1}100%{background-color:#ff8888;scale:1.5}}.recording-indicator{border-radius:50%;width:8px;height:8px;left:24px;top:24px;background-color:#ff0000;position:absolute;animation:recordingSpeech 1s infinite alternate ease-in-out}@keyframes fade-out{0%{opacity:0}20%{opacity:1}80%{opacity:1}100%{opacity:0;display:none}}.text-search-tooltip{position:absolute;right:0;top:80%;background:#f4f4f4;animation:fade-out 5s forwards;width:-moz-fit-content;width:fit-content;padding:24px;border-radius:8px;border:1px solid #8d8d8d;box-sizing:border-box}.text-search-button:not(:disabled):hover{background-color:#e0e0e0}.text-search-button:disabled{cursor:unset}vviinn-image-selector,::slotted([slot="vviinn-text-search-actions"]){margin:auto 8px}vviinn-preloader{--preloader-size:16px;display:flex;color:#525252}.suggestions-container{position:absolute;top:100%;left:0;right:0;margin:var(--spacing-50) 0 0;padding:4px;list-style:none;background:#ffffff;border:1px solid #fafafa;border-radius:8px;box-shadow:0px 4px 12px rgba(0, 0, 0, 0.08);box-sizing:border-box;z-index:10}.suggestion-item{padding:4px 8px;border-radius:4px;font-size:16px;line-height:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base));cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.suggestion-item:hover,.suggestion-item--active{background-color:#f4f4f4}.suggestion-highlight{font-weight:500}';export{I as vviinn_text_search}