vviinn-widgets 2.63.0 → 2.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cjs/{index-906a587a.js → index-95fbaca6.js} +1 -1
  2. package/dist/cjs/{package-00199f27.js → package-4f9945bc.js} +1 -1
  3. package/dist/cjs/search-filters_18.cjs.entry.js +36 -20
  4. package/dist/cjs/{search.store-ce0289aa.js → search.store-f3a52bff.js} +1 -3
  5. package/dist/cjs/vviinn-carousel_6.cjs.entry.js +8 -8
  6. package/dist/cjs/vviinn-preloader.cjs.entry.js +1 -1
  7. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  8. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  9. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +4 -4
  10. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +4 -0
  11. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +10 -0
  12. package/dist/collection/components/vviinn-filters/vviinn-extended-filters.js +3 -3
  13. package/dist/collection/components/vviinn-filters/vviinn-filters.js +2 -2
  14. package/dist/collection/components/vviinn-modal/vviinn-modal.js +1 -1
  15. package/dist/collection/components/vviinn-results/vviinn-results.js +34 -20
  16. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -1
  17. package/dist/collection/store/search.store.js +1 -3
  18. package/dist/esm/{index-f183e646.js → index-d6a3778d.js} +1 -1
  19. package/dist/esm/{package-ab3fee7e.js → package-cb459229.js} +1 -1
  20. package/dist/esm/search-filters_18.entry.js +36 -20
  21. package/dist/esm/{search.store-5dda7985.js → search.store-1687b6ed.js} +1 -3
  22. package/dist/esm/vviinn-carousel_6.entry.js +8 -8
  23. package/dist/esm/vviinn-preloader.entry.js +1 -1
  24. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  25. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  26. package/dist/esm/vviinn-vps-widget.entry.js +4 -4
  27. package/dist/types/components/vviinn-filters/vviinn-extended-filters.d.ts +1 -1
  28. package/dist/types/components/vviinn-filters/vviinn-filters.d.ts +1 -1
  29. package/dist/types/components/vviinn-results/vviinn-results.d.ts +7 -4
  30. package/dist/types/components.d.ts +3 -3
  31. package/dist/types/recommendation/events.d.ts +4 -0
  32. package/dist/vviinn-widgets/{p-2261d4fc.entry.js → p-00df9e92.entry.js} +1 -1
  33. package/{www/build/p-d22e2933.entry.js → dist/vviinn-widgets/p-46d06b62.entry.js} +1 -1
  34. package/dist/vviinn-widgets/{p-dbd312bf.entry.js → p-4d342a14.entry.js} +1 -1
  35. package/dist/vviinn-widgets/{p-e5d8ae2b.entry.js → p-562a62ab.entry.js} +1 -1
  36. package/dist/vviinn-widgets/p-7e67be4a.entry.js +11 -0
  37. package/dist/vviinn-widgets/p-99386bf8.js +1 -0
  38. package/dist/vviinn-widgets/{p-32f5cf0b.js → p-acb7fad6.js} +1 -1
  39. package/dist/vviinn-widgets/{p-b5fcd710.entry.js → p-f8f179ea.entry.js} +1 -1
  40. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  41. package/package.json +1 -1
  42. package/www/build/{p-2261d4fc.entry.js → p-00df9e92.entry.js} +1 -1
  43. package/{dist/vviinn-widgets/p-d22e2933.entry.js → www/build/p-46d06b62.entry.js} +1 -1
  44. package/www/build/{p-dbd312bf.entry.js → p-4d342a14.entry.js} +1 -1
  45. package/www/build/{p-e5d8ae2b.entry.js → p-562a62ab.entry.js} +1 -1
  46. package/www/build/p-7e67be4a.entry.js +11 -0
  47. package/www/build/p-99386bf8.js +1 -0
  48. package/www/build/{p-32f5cf0b.js → p-acb7fad6.js} +1 -1
  49. package/www/build/{p-b5fcd710.entry.js → p-f8f179ea.entry.js} +1 -1
  50. package/www/build/vviinn-widgets.esm.js +1 -1
  51. package/dist/vviinn-widgets/p-12f21b13.js +0 -1
  52. package/dist/vviinn-widgets/p-6b53f2a1.entry.js +0 -11
  53. package/www/build/p-12f21b13.js +0 -1
  54. package/www/build/p-6b53f2a1.entry.js +0 -11
  55. /package/dist/vviinn-widgets/{p-bba30ade.js → p-1928f236.js} +0 -0
  56. /package/www/build/{p-bba30ade.js → p-1928f236.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const search_store = require('./search.store-ce0289aa.js');
3
+ const search_store = require('./search.store-f3a52bff.js');
4
4
 
5
5
  const consoleLogger = {
6
6
  type: 'logger',
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.63.0";
3
+ const version = "2.64.0";
4
4
 
5
5
  exports.version = version;
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const search_store = require('./search.store-ce0289aa.js');
7
- const index$1 = require('./index-906a587a.js');
6
+ const search_store = require('./search.store-f3a52bff.js');
7
+ const index$1 = require('./index-95fbaca6.js');
8
8
  const customizedSlots = require('./customized-slots-dacb282b.js');
9
9
  const PlusIcon = require('./PlusIcon-835a5dcc.js');
10
- const _package = require('./package-00199f27.js');
10
+ const _package = require('./package-4f9945bc.js');
11
11
 
12
12
  const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
13
13
  index.h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
@@ -3885,7 +3885,7 @@ const VviinnModal = class {
3885
3885
  }
3886
3886
  resetTopScroll() {
3887
3887
  const element = this.el.shadowRoot.querySelector(".body");
3888
- element.scroll({ top: 0 });
3888
+ element === null || element === void 0 ? void 0 : element.scroll({ top: 0 });
3889
3889
  }
3890
3890
  close() {
3891
3891
  this.active = false;
@@ -3990,6 +3990,17 @@ const VviinnResults = class {
3990
3990
  this.vviinnProductClick = index.createEvent(this, "vviinnProductClick", 7);
3991
3991
  this.vviinnResultLoad = index.createEvent(this, "vviinnResultLoad", 7);
3992
3992
  this.vviinnResultView = index.createEvent(this, "vviinnResultView", 7);
3993
+ this.searchIdReceivedHandler = ({ detail }) => {
3994
+ const { searchId } = detail;
3995
+ this.getResultsBySearchId(searchId);
3996
+ };
3997
+ this.getResultsBySearchId = async (newSearchId) => {
3998
+ if (!newSearchId)
3999
+ return;
4000
+ search_store.state.apiPath = this.apiPath; //FIXME: #36877
4001
+ const results = await search_store.processSearchIdQuery(newSearchId, this.token);
4002
+ this.recommendations = search_store.getOrElse(() => [])(results);
4003
+ };
3993
4004
  this.setTrackingDeactivated = (result) => {
3994
4005
  if (result.status === "rejected") {
3995
4006
  this.trackingDeactivated = true;
@@ -4021,21 +4032,19 @@ const VviinnResults = class {
4021
4032
  this.resetState = undefined;
4022
4033
  this.recommendations = [];
4023
4034
  }
4024
- async connectedCallback() {
4035
+ connectedCallback() {
4025
4036
  this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
4026
- if (search_store.searchState.results) {
4027
- this.recommendations = search_store.searchState.results;
4028
- }
4029
4037
  if (!this.uiSessionId) {
4030
4038
  this.uiSessionId = index$1.v4();
4031
4039
  }
4032
- if (this.searchId) {
4033
- const result = await search_store.processSearchIdQuery(this.searchId, this.token);
4034
- this.recommendations = search_store.getOrElse(() => [])(result);
4035
- }
4040
+ document.addEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
4041
+ this.getResultsBySearchId(this.searchId);
4042
+ }
4043
+ disconnectedCallback() {
4044
+ document.removeEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
4036
4045
  }
4037
- processSearchId(newId) {
4038
- this.searchId && search_store.processSearchIdQuery(newId, this.token);
4046
+ processSearchId(newSearchIdProp) {
4047
+ this.getResultsBySearchId(newSearchIdProp);
4039
4048
  }
4040
4049
  trackProductLoad({ detail }) {
4041
4050
  const productLoadEvent = this.getProductTrackEvent(detail, "load");
@@ -4122,15 +4131,15 @@ const VviinnResults = class {
4122
4131
  const productEvent = index$1.createProductVpsEventByType(eventType)(eventBody);
4123
4132
  return productEvent;
4124
4133
  }
4125
- renderResults() {
4126
- if (this.recommendations.length === 0)
4134
+ renderResults(results) {
4135
+ if (results.length === 0)
4127
4136
  return null;
4128
4137
  if (!search_store.searchState.resultLoaded) {
4129
4138
  this.vviinnResultLoad.emit(this.getBasicEventData());
4130
4139
  this.trackResultEvent("load");
4131
4140
  search_store.searchState.resultLoaded = true;
4132
4141
  }
4133
- return this.recommendations.map((p, i) => {
4142
+ return results.map((p, i) => {
4134
4143
  var _a;
4135
4144
  return (index.h("vviinn-product-card", { key: p.productId, index: i, productTitle: p.title, productId: p.productId, productType: p.productType, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, responsive: true, imageWidth: this.imageResolutionWidth, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", campaignTypeId: "VPS", widgetElementId: this.widgetElementId, buttonElementId: this.buttonElementId, widgetVersion: _package.version, currency: this.currencySign, locale: this.locale }));
4136
4145
  });
@@ -4140,14 +4149,18 @@ const VviinnResults = class {
4140
4149
  "widget-results": this.showingInWidget,
4141
4150
  }, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card" }, index.h("div", { class: {
4142
4151
  "nothing-found": true,
4143
- hidden: this.recommendations.length > 0 || !this.showingInWidget,
4152
+ hidden: this.recommendations.length > 0 ||
4153
+ search_store.searchState.results.length > 0 ||
4154
+ !this.showingInWidget,
4144
4155
  } }, index.h("vviinn-empty-results", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), index.h("div", { class: {
4145
4156
  "nothing-found": true,
4146
4157
  hidden: !this.showAspectRatioError || !this.showingInWidget,
4147
4158
  } }, index.h("vviinn-wrong-aspect-ratio", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), index.h("div", { class: {
4148
- hidden: this.recommendations.length === 0 || this.showAspectRatioError,
4159
+ hidden: this.showAspectRatioError ||
4160
+ (this.recommendations.length === 0 &&
4161
+ search_store.searchState.results.length === 0),
4149
4162
  products: true,
4150
- } }, this.renderResults())));
4163
+ } }, this.renderResults(this.showingInWidget ? search_store.searchState.results : this.recommendations))));
4151
4164
  }
4152
4165
  get el() { return index.getElement(this); }
4153
4166
  static get watchers() { return {
@@ -4156,6 +4169,8 @@ const VviinnResults = class {
4156
4169
  };
4157
4170
  VviinnResults.style = vviinnResultsCss;
4158
4171
 
4172
+ const vviinnServerErrorCss = ":host{display:flex;justify-content:center}";
4173
+
4159
4174
  const VviinnServerError = class {
4160
4175
  constructor(hostRef) {
4161
4176
  index.registerInstance(this, hostRef);
@@ -4165,6 +4180,7 @@ const VviinnServerError = class {
4165
4180
  return (index.h(index.Host, null, index.h("vviinn-error", null, index.h(WarningIcon, null), index.h("h4", { slot: "title" }, index$1.instance.t("serverErrorBlock.title")), index.h("button", { slot: "action", onClick: this.handler }, index$1.instance.t("serverErrorBlock.button")))));
4166
4181
  }
4167
4182
  };
4183
+ VviinnServerError.style = vviinnServerErrorCss;
4168
4184
 
4169
4185
  const vviinnSlideCss = ":host{display:grid;justify-items:center}";
4170
4186
 
@@ -17342,9 +17342,7 @@ const uploadText = (query, dynamicFilters) => {
17342
17342
  }));
17343
17343
  };
17344
17344
  const processSelectedText = async (query, dynamicFilters) => await uploadText(query, dynamicFilters)();
17345
- const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), fromEither, chainW(linkRequest(createLinkfromSearchId(searchId))), map((response) => {
17346
- return response.value;
17347
- }))();
17345
+ const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), fromEither, chainW(linkRequest(createLinkfromSearchId(searchId))), map((response) => response.value))();
17348
17346
  onChange("activeIonLink", async (newLink) => {
17349
17347
  const link = newLink ? newLink : state.resetCategoryLink;
17350
17348
  if (!link)
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const search_store = require('./search.store-ce0289aa.js');
6
+ const search_store = require('./search.store-f3a52bff.js');
7
7
  const customizedSlots = require('./customized-slots-dacb282b.js');
8
- const index$1 = require('./index-906a587a.js');
8
+ const index$1 = require('./index-95fbaca6.js');
9
9
  const resources = require('./resources-c5fbe419.js');
10
10
  const PlusIcon = require('./PlusIcon-835a5dcc.js');
11
- const _package = require('./package-00199f27.js');
11
+ const _package = require('./package-4f9945bc.js');
12
12
 
13
13
  const BasketIcon = () => (index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
14
14
  index.h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
@@ -516,12 +516,12 @@ const VviinnExtendedFilters = class {
516
516
  });
517
517
  customizedSlots.slotChangeListener(this, this.el);
518
518
  }
519
- emitTequestFiltersMore(requestFilters) {
519
+ emitRequestFiltersMore(requestFilters) {
520
520
  this.vviinnFiltersChanged.emit({ filters: requestFilters, el: this.el });
521
521
  }
522
522
  handleSubFilterSelection(filterValue, seletedFilter) {
523
523
  this.requestFilters = subFilterSelection(this.requestFilters, seletedFilter, filterValue);
524
- this.emitTequestFiltersMore([...this.requestFilters]);
524
+ this.emitRequestFiltersMore([...this.requestFilters]);
525
525
  }
526
526
  showActiveOnModalSubButton(requestFilters, filterValue) {
527
527
  let className = "";
@@ -560,7 +560,7 @@ const VviinnExtendedFilters = class {
560
560
  document.addEventListener("vviinnFiltersChanged", this.handleFiltersChanged);
561
561
  }
562
562
  resetModal() {
563
- this.emitTequestFiltersMore([]);
563
+ this.emitRequestFiltersMore([]);
564
564
  this.requestFilters = [];
565
565
  this.showMore = false;
566
566
  }
@@ -618,12 +618,12 @@ const VviinnFilters = class {
618
618
  handleMainFilterSelection(filter) {
619
619
  this.selectedFilter = filter;
620
620
  }
621
- emitTequestFiltersMore(requestFilters) {
621
+ emitRequestFiltersMore(requestFilters) {
622
622
  this.vviinnFiltersChanged.emit({ filters: requestFilters, el: this.el });
623
623
  }
624
624
  handleSubFilterSelection(filterValue, seletedFilter) {
625
625
  this.requestFilters = subFilterSelection(this.requestFilters, seletedFilter, filterValue);
626
- this.emitTequestFiltersMore([...this.requestFilters]);
626
+ this.emitRequestFiltersMore([...this.requestFilters]);
627
627
  }
628
628
  showActiveOnMainButton({ column }) {
629
629
  if (!this.selectedFilter)
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const search_store = require('./search.store-ce0289aa.js');
6
+ const search_store = require('./search.store-f3a52bff.js');
7
7
 
8
8
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const _package = require('./package-00199f27.js');
6
+ const _package = require('./package-4f9945bc.js');
7
7
  const VisualSearchIcon = require('./VisualSearchIcon-f435f5b0.js');
8
8
 
9
9
  const vviinnVprButtonCss = ":host{display:block}";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const _package = require('./package-00199f27.js');
6
+ const _package = require('./package-4f9945bc.js');
7
7
  const customizedSlots = require('./customized-slots-dacb282b.js');
8
8
  const constants = require('./constants-7684cbfc.js');
9
9
 
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-4474431a.js');
6
- const search_store = require('./search.store-ce0289aa.js');
7
- const index$1 = require('./index-906a587a.js');
8
- const _package = require('./package-00199f27.js');
6
+ const search_store = require('./search.store-f3a52bff.js');
7
+ const index$1 = require('./index-95fbaca6.js');
8
+ const _package = require('./package-4f9945bc.js');
9
9
  const customizedSlots = require('./customized-slots-dacb282b.js');
10
10
  const resources = require('./resources-c5fbe419.js');
11
11
  const constants = require('./constants-7684cbfc.js');
@@ -379,7 +379,7 @@ const VviinnVpsWidget = class {
379
379
  }
380
380
  resetScroll(elementId, behavior = "auto") {
381
381
  const element = this.el.shadowRoot.getElementById(elementId);
382
- element.scroll({ top: 0, left: 0, behavior });
382
+ element === null || element === void 0 ? void 0 : element.scroll({ top: 0, left: 0, behavior });
383
383
  }
384
384
  handleModalClose() {
385
385
  this.active = false;
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: flex;
3
+ justify-content: center;
4
+ }
@@ -10,6 +10,16 @@ export class VviinnServerError {
10
10
  }
11
11
  static get is() { return "vviinn-server-error"; }
12
12
  static get encapsulation() { return "shadow"; }
13
+ static get originalStyleUrls() {
14
+ return {
15
+ "$": ["vviinn-server-error.css"]
16
+ };
17
+ }
18
+ static get styleUrls() {
19
+ return {
20
+ "$": ["vviinn-server-error.css"]
21
+ };
22
+ }
13
23
  static get properties() {
14
24
  return {
15
25
  "handler": {
@@ -43,12 +43,12 @@ export class VviinnExtendedFilters {
43
43
  });
44
44
  slotChangeListener(this, this.el);
45
45
  }
46
- emitTequestFiltersMore(requestFilters) {
46
+ emitRequestFiltersMore(requestFilters) {
47
47
  this.vviinnFiltersChanged.emit({ filters: requestFilters, el: this.el });
48
48
  }
49
49
  handleSubFilterSelection(filterValue, seletedFilter) {
50
50
  this.requestFilters = subFilterSelection(this.requestFilters, seletedFilter, filterValue);
51
- this.emitTequestFiltersMore([...this.requestFilters]);
51
+ this.emitRequestFiltersMore([...this.requestFilters]);
52
52
  }
53
53
  showActiveOnModalSubButton(requestFilters, filterValue) {
54
54
  let className = "";
@@ -87,7 +87,7 @@ export class VviinnExtendedFilters {
87
87
  document.addEventListener("vviinnFiltersChanged", this.handleFiltersChanged);
88
88
  }
89
89
  resetModal() {
90
- this.emitTequestFiltersMore([]);
90
+ this.emitRequestFiltersMore([]);
91
91
  this.requestFilters = [];
92
92
  this.showMore = false;
93
93
  }
@@ -25,12 +25,12 @@ export class VviinnFilters {
25
25
  handleMainFilterSelection(filter) {
26
26
  this.selectedFilter = filter;
27
27
  }
28
- emitTequestFiltersMore(requestFilters) {
28
+ emitRequestFiltersMore(requestFilters) {
29
29
  this.vviinnFiltersChanged.emit({ filters: requestFilters, el: this.el });
30
30
  }
31
31
  handleSubFilterSelection(filterValue, seletedFilter) {
32
32
  this.requestFilters = subFilterSelection(this.requestFilters, seletedFilter, filterValue);
33
- this.emitTequestFiltersMore([...this.requestFilters]);
33
+ this.emitRequestFiltersMore([...this.requestFilters]);
34
34
  }
35
35
  showActiveOnMainButton({ column }) {
36
36
  if (!this.selectedFilter)
@@ -23,7 +23,7 @@ export class VviinnModal {
23
23
  }
24
24
  resetTopScroll() {
25
25
  const element = this.el.shadowRoot.querySelector(".body");
26
- element.scroll({ top: 0 });
26
+ element === null || element === void 0 ? void 0 : element.scroll({ top: 0 });
27
27
  }
28
28
  close() {
29
29
  this.active = false;
@@ -11,13 +11,14 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  import { Host, h, } from "@stencil/core";
14
- import { version } from "../../../package.json";
15
14
  import * as E from "fp-ts/Either";
16
15
  import { v4 as uuidv4 } from "uuid";
16
+ import { version } from "../../../package.json";
17
17
  import { processSearchIdQuery, searchState } from "../../store/search.store";
18
+ import { state } from "../../store/store";
19
+ import { createTrackingApi } from "../../openApi";
18
20
  import { campaignTypeNames } from "../../campaign/Campaign";
19
21
  import { createProductVpsEventByType, createResultVpsEventByType, } from "../../tracking";
20
- import { createTrackingApi } from "../../openApi";
21
22
  /**
22
23
  * @part product-card - Product Card itself.
23
24
  * @part brand - Brand inside Product Card.
@@ -37,6 +38,17 @@ import { createTrackingApi } from "../../openApi";
37
38
  */
38
39
  export class VviinnResults {
39
40
  constructor() {
41
+ this.searchIdReceivedHandler = ({ detail }) => {
42
+ const { searchId } = detail;
43
+ this.getResultsBySearchId(searchId);
44
+ };
45
+ this.getResultsBySearchId = async (newSearchId) => {
46
+ if (!newSearchId)
47
+ return;
48
+ state.apiPath = this.apiPath; //FIXME: #36877
49
+ const results = await processSearchIdQuery(newSearchId, this.token);
50
+ this.recommendations = E.getOrElse(() => [])(results);
51
+ };
40
52
  this.setTrackingDeactivated = (result) => {
41
53
  if (result.status === "rejected") {
42
54
  this.trackingDeactivated = true;
@@ -68,21 +80,19 @@ export class VviinnResults {
68
80
  this.resetState = undefined;
69
81
  this.recommendations = [];
70
82
  }
71
- async connectedCallback() {
83
+ connectedCallback() {
72
84
  this.trackingApi = createTrackingApi(this.apiPath, this.token);
73
- if (searchState.results) {
74
- this.recommendations = searchState.results;
75
- }
76
85
  if (!this.uiSessionId) {
77
86
  this.uiSessionId = uuidv4();
78
87
  }
79
- if (this.searchId) {
80
- const result = await processSearchIdQuery(this.searchId, this.token);
81
- this.recommendations = E.getOrElse(() => [])(result);
82
- }
88
+ document.addEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
89
+ this.getResultsBySearchId(this.searchId);
90
+ }
91
+ disconnectedCallback() {
92
+ document.removeEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
83
93
  }
84
- processSearchId(newId) {
85
- this.searchId && processSearchIdQuery(newId, this.token);
94
+ processSearchId(newSearchIdProp) {
95
+ this.getResultsBySearchId(newSearchIdProp);
86
96
  }
87
97
  trackProductLoad({ detail }) {
88
98
  const productLoadEvent = this.getProductTrackEvent(detail, "load");
@@ -169,15 +179,15 @@ export class VviinnResults {
169
179
  const productEvent = createProductVpsEventByType(eventType)(eventBody);
170
180
  return productEvent;
171
181
  }
172
- renderResults() {
173
- if (this.recommendations.length === 0)
182
+ renderResults(results) {
183
+ if (results.length === 0)
174
184
  return null;
175
185
  if (!searchState.resultLoaded) {
176
186
  this.vviinnResultLoad.emit(this.getBasicEventData());
177
187
  this.trackResultEvent("load");
178
188
  searchState.resultLoaded = true;
179
189
  }
180
- return this.recommendations.map((p, i) => {
190
+ return results.map((p, i) => {
181
191
  var _a;
182
192
  return (h("vviinn-product-card", { key: p.productId, index: i, productTitle: p.title, productId: p.productId, productType: p.productType, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, responsive: true, imageWidth: this.imageResolutionWidth, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", campaignTypeId: "VPS", widgetElementId: this.widgetElementId, buttonElementId: this.buttonElementId, widgetVersion: version, currency: this.currencySign, locale: this.locale }));
183
193
  });
@@ -187,14 +197,18 @@ export class VviinnResults {
187
197
  "widget-results": this.showingInWidget,
188
198
  }, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card" }, h("div", { class: {
189
199
  "nothing-found": true,
190
- hidden: this.recommendations.length > 0 || !this.showingInWidget,
200
+ hidden: this.recommendations.length > 0 ||
201
+ searchState.results.length > 0 ||
202
+ !this.showingInWidget,
191
203
  } }, h("vviinn-empty-results", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
192
204
  "nothing-found": true,
193
205
  hidden: !this.showAspectRatioError || !this.showingInWidget,
194
206
  } }, h("vviinn-wrong-aspect-ratio", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
195
- hidden: this.recommendations.length === 0 || this.showAspectRatioError,
207
+ hidden: this.showAspectRatioError ||
208
+ (this.recommendations.length === 0 &&
209
+ searchState.results.length === 0),
196
210
  products: true,
197
- } }, this.renderResults())));
211
+ } }, this.renderResults(this.showingInWidget ? searchState.results : this.recommendations))));
198
212
  }
199
213
  static get is() { return "vviinn-results"; }
200
214
  static get encapsulation() { return "shadow"; }
@@ -236,10 +250,10 @@ export class VviinnResults {
236
250
  "references": {}
237
251
  },
238
252
  "required": false,
239
- "optional": false,
253
+ "optional": true,
240
254
  "docs": {
241
255
  "tags": [],
242
- "text": "Search ID for results request (required)"
256
+ "text": "Search ID for results request"
243
257
  },
244
258
  "attribute": "search-id",
245
259
  "reflect": false
@@ -384,7 +384,7 @@ export class VviinnVpsWidget {
384
384
  }
385
385
  resetScroll(elementId, behavior = "auto") {
386
386
  const element = this.el.shadowRoot.getElementById(elementId);
387
- element.scroll({ top: 0, left: 0, behavior });
387
+ element === null || element === void 0 ? void 0 : element.scroll({ top: 0, left: 0, behavior });
388
388
  }
389
389
  handleModalClose() {
390
390
  this.active = false;
@@ -135,9 +135,7 @@ const uploadText = (query, dynamicFilters) => {
135
135
  }));
136
136
  };
137
137
  export const processSelectedText = async (query, dynamicFilters) => await uploadText(query, dynamicFilters)();
138
- export const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), TE.fromEither, TE.chainW(linkRequest(createLinkfromSearchId(searchId))), TE.map((response) => {
139
- return response.value;
140
- }))();
138
+ export const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), TE.fromEither, TE.chainW(linkRequest(createLinkfromSearchId(searchId))), TE.map((response) => response.value))();
141
139
  onChange("activeIonLink", async (newLink) => {
142
140
  const link = newLink ? newLink : state.resetCategoryLink;
143
141
  if (!link)
@@ -1,4 +1,4 @@
1
- import { e as commonjsGlobal, i as createCommonjsModule } from './search.store-5dda7985.js';
1
+ import { e as commonjsGlobal, i as createCommonjsModule } from './search.store-1687b6ed.js';
2
2
 
3
3
  const consoleLogger = {
4
4
  type: 'logger',
@@ -1,3 +1,3 @@
1
- const version = "2.63.0";
1
+ const version = "2.64.0";
2
2
 
3
3
  export { version as v };
@@ -1,9 +1,9 @@
1
1
  import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-abf408d8.js';
2
- import { s as searchState, _ as _function, O as Option, l as fromAlt, n as foldValueObject, o as scaleWithSized, q as center, r as makeRectangularSearchRequest, u as detectedObjectEq, v as toFile, w as processSelectedFile, E as Either, x as match, i as createCommonjsModule, e as commonjsGlobal, y as sequenceToOption, z as fromImage, B as dimensionsFromImage, C as scaleByLargestSide, D as processSearchIdQuery, F as getOrElse, N as NonEmptyArray } from './search.store-5dda7985.js';
3
- import { i as instance, c as createTrackingApi, v as v4, n as createResultVpsEventByType, o as createProductVpsEventByType } from './index-f183e646.js';
2
+ import { s as searchState, _ as _function, O as Option, l as fromAlt, n as foldValueObject, o as scaleWithSized, q as center, r as makeRectangularSearchRequest, u as detectedObjectEq, v as toFile, w as processSelectedFile, E as Either, x as match, i as createCommonjsModule, e as commonjsGlobal, y as sequenceToOption, z as fromImage, B as dimensionsFromImage, C as scaleByLargestSide, d as state, D as processSearchIdQuery, F as getOrElse, N as NonEmptyArray } from './search.store-1687b6ed.js';
3
+ import { i as instance, c as createTrackingApi, v as v4, n as createResultVpsEventByType, o as createProductVpsEventByType } from './index-d6a3778d.js';
4
4
  import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-299054d1.js';
5
5
  import { P as PlusIcon } from './PlusIcon-8f8206c3.js';
6
- import { v as version } from './package-ab3fee7e.js';
6
+ import { v as version } from './package-cb459229.js';
7
7
 
8
8
  const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
9
9
  h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
@@ -3881,7 +3881,7 @@ const VviinnModal = class {
3881
3881
  }
3882
3882
  resetTopScroll() {
3883
3883
  const element = this.el.shadowRoot.querySelector(".body");
3884
- element.scroll({ top: 0 });
3884
+ element === null || element === void 0 ? void 0 : element.scroll({ top: 0 });
3885
3885
  }
3886
3886
  close() {
3887
3887
  this.active = false;
@@ -3986,6 +3986,17 @@ const VviinnResults = class {
3986
3986
  this.vviinnProductClick = createEvent(this, "vviinnProductClick", 7);
3987
3987
  this.vviinnResultLoad = createEvent(this, "vviinnResultLoad", 7);
3988
3988
  this.vviinnResultView = createEvent(this, "vviinnResultView", 7);
3989
+ this.searchIdReceivedHandler = ({ detail }) => {
3990
+ const { searchId } = detail;
3991
+ this.getResultsBySearchId(searchId);
3992
+ };
3993
+ this.getResultsBySearchId = async (newSearchId) => {
3994
+ if (!newSearchId)
3995
+ return;
3996
+ state.apiPath = this.apiPath; //FIXME: #36877
3997
+ const results = await processSearchIdQuery(newSearchId, this.token);
3998
+ this.recommendations = getOrElse(() => [])(results);
3999
+ };
3989
4000
  this.setTrackingDeactivated = (result) => {
3990
4001
  if (result.status === "rejected") {
3991
4002
  this.trackingDeactivated = true;
@@ -4017,21 +4028,19 @@ const VviinnResults = class {
4017
4028
  this.resetState = undefined;
4018
4029
  this.recommendations = [];
4019
4030
  }
4020
- async connectedCallback() {
4031
+ connectedCallback() {
4021
4032
  this.trackingApi = createTrackingApi(this.apiPath, this.token);
4022
- if (searchState.results) {
4023
- this.recommendations = searchState.results;
4024
- }
4025
4033
  if (!this.uiSessionId) {
4026
4034
  this.uiSessionId = v4();
4027
4035
  }
4028
- if (this.searchId) {
4029
- const result = await processSearchIdQuery(this.searchId, this.token);
4030
- this.recommendations = getOrElse(() => [])(result);
4031
- }
4036
+ document.addEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
4037
+ this.getResultsBySearchId(this.searchId);
4038
+ }
4039
+ disconnectedCallback() {
4040
+ document.removeEventListener("vviinnSearchIdReceived", this.searchIdReceivedHandler);
4032
4041
  }
4033
- processSearchId(newId) {
4034
- this.searchId && processSearchIdQuery(newId, this.token);
4042
+ processSearchId(newSearchIdProp) {
4043
+ this.getResultsBySearchId(newSearchIdProp);
4035
4044
  }
4036
4045
  trackProductLoad({ detail }) {
4037
4046
  const productLoadEvent = this.getProductTrackEvent(detail, "load");
@@ -4118,15 +4127,15 @@ const VviinnResults = class {
4118
4127
  const productEvent = createProductVpsEventByType(eventType)(eventBody);
4119
4128
  return productEvent;
4120
4129
  }
4121
- renderResults() {
4122
- if (this.recommendations.length === 0)
4130
+ renderResults(results) {
4131
+ if (results.length === 0)
4123
4132
  return null;
4124
4133
  if (!searchState.resultLoaded) {
4125
4134
  this.vviinnResultLoad.emit(this.getBasicEventData());
4126
4135
  this.trackResultEvent("load");
4127
4136
  searchState.resultLoaded = true;
4128
4137
  }
4129
- return this.recommendations.map((p, i) => {
4138
+ return results.map((p, i) => {
4130
4139
  var _a;
4131
4140
  return (h("vviinn-product-card", { key: p.productId, index: i, productTitle: p.title, productId: p.productId, productType: p.productType, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, responsive: true, imageWidth: this.imageResolutionWidth, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", campaignTypeId: "VPS", widgetElementId: this.widgetElementId, buttonElementId: this.buttonElementId, widgetVersion: version, currency: this.currencySign, locale: this.locale }));
4132
4141
  });
@@ -4136,14 +4145,18 @@ const VviinnResults = class {
4136
4145
  "widget-results": this.showingInWidget,
4137
4146
  }, exportparts: "brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card" }, h("div", { class: {
4138
4147
  "nothing-found": true,
4139
- hidden: this.recommendations.length > 0 || !this.showingInWidget,
4148
+ hidden: this.recommendations.length > 0 ||
4149
+ searchState.results.length > 0 ||
4150
+ !this.showingInWidget,
4140
4151
  } }, h("vviinn-empty-results", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
4141
4152
  "nothing-found": true,
4142
4153
  hidden: !this.showAspectRatioError || !this.showingInWidget,
4143
4154
  } }, h("vviinn-wrong-aspect-ratio", { handler: () => this === null || this === void 0 ? void 0 : this.resetState() })), h("div", { class: {
4144
- hidden: this.recommendations.length === 0 || this.showAspectRatioError,
4155
+ hidden: this.showAspectRatioError ||
4156
+ (this.recommendations.length === 0 &&
4157
+ searchState.results.length === 0),
4145
4158
  products: true,
4146
- } }, this.renderResults())));
4159
+ } }, this.renderResults(this.showingInWidget ? searchState.results : this.recommendations))));
4147
4160
  }
4148
4161
  get el() { return getElement(this); }
4149
4162
  static get watchers() { return {
@@ -4152,6 +4165,8 @@ const VviinnResults = class {
4152
4165
  };
4153
4166
  VviinnResults.style = vviinnResultsCss;
4154
4167
 
4168
+ const vviinnServerErrorCss = ":host{display:flex;justify-content:center}";
4169
+
4155
4170
  const VviinnServerError = class {
4156
4171
  constructor(hostRef) {
4157
4172
  registerInstance(this, hostRef);
@@ -4161,6 +4176,7 @@ const VviinnServerError = class {
4161
4176
  return (h(Host, null, h("vviinn-error", null, h(WarningIcon, null), h("h4", { slot: "title" }, instance.t("serverErrorBlock.title")), h("button", { slot: "action", onClick: this.handler }, instance.t("serverErrorBlock.button")))));
4162
4177
  }
4163
4178
  };
4179
+ VviinnServerError.style = vviinnServerErrorCss;
4164
4180
 
4165
4181
  const vviinnSlideCss = ":host{display:grid;justify-items:center}";
4166
4182
 
@@ -17340,9 +17340,7 @@ const uploadText = (query, dynamicFilters) => {
17340
17340
  }));
17341
17341
  };
17342
17342
  const processSelectedText = async (query, dynamicFilters) => await uploadText(query, dynamicFilters)();
17343
- const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), fromEither, chainW(linkRequest(createLinkfromSearchId(searchId))), map((response) => {
17344
- return response.value;
17345
- }))();
17343
+ const processSearchIdQuery = async (searchId, token) => await pipe(makeAuthorizedRequest(token), fromEither, chainW(linkRequest(createLinkfromSearchId(searchId))), map((response) => response.value))();
17346
17344
  onChange("activeIonLink", async (newLink) => {
17347
17345
  const link = newLink ? newLink : state.resetCategoryLink;
17348
17346
  if (!link)