vviinn-widgets 2.188.0 → 2.189.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 (79) hide show
  1. package/dist/cjs/{Rectangle-0jUlP_jx.js → Rectangle-DVEulpFu.js} +1 -0
  2. package/dist/cjs/{index-BUEskchg.js → index-DZMV2ChQ.js} +1 -1
  3. package/dist/cjs/{package-B2xF7VCy.js → package-CN6WlYoJ.js} +1 -1
  4. package/dist/cjs/{resources-5_Y1cO9T.js → resources-cQWt9LRT.js} +2 -2
  5. package/dist/cjs/{search.store-NSPzykno.js → search.store-CT4luzT3.js} +5 -2
  6. package/dist/cjs/vviinn-button_6.cjs.entry.js +3 -3
  7. package/dist/cjs/vviinn-camera_11.cjs.entry.js +35 -26
  8. package/dist/cjs/vviinn-carousel_10.cjs.entry.js +5 -5
  9. package/dist/cjs/vviinn-detected-object_2.cjs.entry.js +1 -1
  10. package/dist/cjs/vviinn-selected-filters.cjs.entry.js +3 -3
  11. package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +2 -2
  12. package/dist/cjs/vviinn-text-search.cjs.entry.js +3 -3
  13. package/dist/cjs/vviinn-vps-button.cjs.entry.js +2 -2
  14. package/dist/collection/Image/error.js +2 -1
  15. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +2 -2
  16. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +20 -11
  17. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.js +1 -1
  18. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +2 -2
  19. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +16 -16
  20. package/dist/collection/locale/resources.js +2 -2
  21. package/dist/esm/{Rectangle-CWwG37eK.js → Rectangle-DGBESJrE.js} +1 -1
  22. package/dist/esm/{index-CdSE2oQq.js → index-BIViS3eV.js} +1 -1
  23. package/dist/esm/{package-C1SlDb4h.js → package-B82dIeWY.js} +1 -1
  24. package/dist/esm/{resources-Bv3dEgL8.js → resources-CHDT594L.js} +2 -2
  25. package/dist/esm/{search.store-HXwFfRvm.js → search.store-DLJr8QhM.js} +4 -3
  26. package/dist/esm/vviinn-button_6.entry.js +3 -3
  27. package/dist/esm/vviinn-camera_11.entry.js +35 -26
  28. package/dist/esm/vviinn-carousel_10.entry.js +5 -5
  29. package/dist/esm/vviinn-detected-object_2.entry.js +1 -1
  30. package/dist/esm/vviinn-selected-filters.entry.js +3 -3
  31. package/dist/esm/vviinn-shop-the-look.entry.js +2 -2
  32. package/dist/esm/vviinn-text-search.entry.js +3 -3
  33. package/dist/esm/vviinn-vps-button.entry.js +2 -2
  34. package/dist/types/Image/error.d.ts +1 -0
  35. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +2 -2
  36. package/dist/types/components/vviinn-suggestions/render-helpers.d.ts +2 -4
  37. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -1
  38. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -2
  39. package/dist/types/components.d.ts +5 -5
  40. package/dist/types/interfaces/generated.d.ts +23 -6
  41. package/dist/vviinn-widgets/{p-63811fdb.entry.js → p-1152fa0e.entry.js} +1 -1
  42. package/dist/vviinn-widgets/{p-138c29a9.entry.js → p-256b88e4.entry.js} +1 -1
  43. package/dist/vviinn-widgets/{p-dd65398d.entry.js → p-2b84bf8e.entry.js} +1 -1
  44. package/dist/vviinn-widgets/{p-fd6ee191.entry.js → p-30a6e803.entry.js} +1 -1
  45. package/{www/build/p-da22f7e7.entry.js → dist/vviinn-widgets/p-41b337dd.entry.js} +1 -1
  46. package/dist/vviinn-widgets/p-80eb9975.entry.js +1 -0
  47. package/dist/vviinn-widgets/{p-75994d6d.entry.js → p-93335b84.entry.js} +1 -1
  48. package/dist/vviinn-widgets/{p-C1SlDb4h.js → p-B82dIeWY.js} +1 -1
  49. package/dist/vviinn-widgets/p-BiDe0ltU.js +1 -0
  50. package/dist/vviinn-widgets/p-CHDT594L.js +1 -0
  51. package/dist/vviinn-widgets/{p-sRFYL4zd.js → p-D3T7gXzV.js} +1 -1
  52. package/dist/vviinn-widgets/{p-Bn0oxRR6.js → p-DtaDzVqa.js} +1 -1
  53. package/dist/vviinn-widgets/p-b78ab652.entry.js +1 -0
  54. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  55. package/package.json +1 -1
  56. package/www/build/{p-63811fdb.entry.js → p-1152fa0e.entry.js} +1 -1
  57. package/www/build/{p-138c29a9.entry.js → p-256b88e4.entry.js} +1 -1
  58. package/www/build/{p-dd65398d.entry.js → p-2b84bf8e.entry.js} +1 -1
  59. package/www/build/{p-fd6ee191.entry.js → p-30a6e803.entry.js} +1 -1
  60. package/{dist/vviinn-widgets/p-da22f7e7.entry.js → www/build/p-41b337dd.entry.js} +1 -1
  61. package/www/build/p-80eb9975.entry.js +1 -0
  62. package/www/build/{p-75994d6d.entry.js → p-93335b84.entry.js} +1 -1
  63. package/www/build/{p-C1SlDb4h.js → p-B82dIeWY.js} +1 -1
  64. package/www/build/p-BiDe0ltU.js +1 -0
  65. package/www/build/p-CHDT594L.js +1 -0
  66. package/www/build/{p-sRFYL4zd.js → p-D3T7gXzV.js} +1 -1
  67. package/www/build/{p-Bn0oxRR6.js → p-DtaDzVqa.js} +1 -1
  68. package/www/build/p-b78ab652.entry.js +1 -0
  69. package/www/build/{p-89a9d325.js → p-c7ba294f.js} +1 -1
  70. package/www/build/vviinn-widgets.esm.js +1 -1
  71. package/www/index.html +1 -1
  72. package/dist/vviinn-widgets/p-499470d6.entry.js +0 -1
  73. package/dist/vviinn-widgets/p-72fe0037.entry.js +0 -1
  74. package/dist/vviinn-widgets/p-Bv3dEgL8.js +0 -1
  75. package/dist/vviinn-widgets/p-XVwOf-d0.js +0 -1
  76. package/www/build/p-499470d6.entry.js +0 -1
  77. package/www/build/p-72fe0037.entry.js +0 -1
  78. package/www/build/p-Bv3dEgL8.js +0 -1
  79. package/www/build/p-XVwOf-d0.js +0 -1
@@ -9019,6 +9019,7 @@ exports.getOrElseW = getOrElseW;
9019
9019
  exports.has = has;
9020
9020
  exports.invalidTokenError = invalidTokenError;
9021
9021
  exports.isClickedInRectBound = isClickedInRectBound;
9022
+ exports.isLeft = isLeft;
9022
9023
  exports.isSome = isSome;
9023
9024
  exports.left = left;
9024
9025
  exports.makeRequest = makeRequest;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var search_store = require('./search.store-NSPzykno.js');
4
+ var search_store = require('./search.store-CT4luzT3.js');
5
5
 
6
6
  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" },
7
7
  index.h("path", { d: "M14.6667 17.3333H8.00001C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H14.6667V8.00001C14.6667 7.62223 14.7944 7.30556 15.05 7.05001C15.3056 6.79445 15.6222 6.66667 16 6.66667C16.3778 6.66667 16.6944 6.79445 16.95 7.05001C17.2056 7.30556 17.3333 7.62223 17.3333 8.00001V14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H17.3333V24C17.3333 24.3778 17.2056 24.6944 16.95 24.95C16.6944 25.2056 16.3778 25.3333 16 25.3333C15.6222 25.3333 15.3056 25.2056 15.05 24.95C14.7944 24.6944 14.6667 24.3778 14.6667 24V17.3333Z", fill: "currentColor" })));
@@ -14,7 +14,7 @@ function fromString(s) {
14
14
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
15
15
  }
16
16
 
17
- const version = "2.188.0";
17
+ const version = "2.189.0";
18
18
 
19
19
  exports.campaignTypeNames = campaignTypeNames;
20
20
  exports.fold = fold;
@@ -49,7 +49,7 @@ const resources = {
49
49
  },
50
50
  wrongFormatBlock: {
51
51
  title: "Dateityp wird nicht unterstützt",
52
- text: "Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch.",
52
+ text: "Bitte laden Sie eine .jpg, .png, .webp oder .avif Bilddatei hoch.",
53
53
  button: "Neues Bild hochladen",
54
54
  },
55
55
  wrongAspectRatioBlock: {
@@ -172,7 +172,7 @@ const resources = {
172
172
  },
173
173
  wrongFormatBlock: {
174
174
  title: "Wrong file format",
175
- text: "Please upload a .jpg, .png or .webp image file.",
175
+ text: "Please upload a .jpg, .png, .webp or .avif image file.",
176
176
  button: "Upload another file",
177
177
  },
178
178
  wrongAspectRatioBlock: {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var store = require('./store-CrCuJC55.js');
4
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
4
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
5
5
 
6
6
  var _Array = {};
7
7
 
@@ -7702,7 +7702,8 @@ var findFirstMap$1 = function (f) {
7702
7702
  */
7703
7703
  var findFirstMap = findFirstMap$1;
7704
7704
 
7705
- const SUPPORTED_FILE_TYPES = ["jpg", "jpeg", "png", "webp"];
7705
+ const SUPPORTED_FILE_TYPES = ["jpg", "jpeg", "png", "webp", "avif"];
7706
+ const acceptableFileFormats = SUPPORTED_FILE_TYPES.map((type) => `.${type}`).join(", ");
7706
7707
  const unsupportedFileTypeError = {
7707
7708
  kind: "client",
7708
7709
  inner: "File format not supported",
@@ -8470,7 +8471,9 @@ const useSearchStore = (showInWidget) => showInWidget
8470
8471
  };
8471
8472
 
8472
8473
  exports._ArrayExports = _ArrayExports;
8474
+ exports.acceptableFileFormats = acceptableFileFormats;
8473
8475
  exports.addIfNotEmpty = addIfNotEmpty;
8476
+ exports.checkImageType = checkImageType;
8474
8477
  exports.getImageSizes = getImageSizes;
8475
8478
  exports.makeProductListingPageRequest = makeProductListingPageRequest;
8476
8479
  exports.makeTextSearchRequest = makeTextSearchRequest;
@@ -3,12 +3,12 @@
3
3
  var index = require('./index-OrE9ITel.js');
4
4
  var i18next = require('./i18next-DkN_8H9H.js');
5
5
  var customizedSlots = require('./customized-slots-D9G-pOuM.js');
6
- var _package = require('./package-B2xF7VCy.js');
6
+ var _package = require('./package-CN6WlYoJ.js');
7
7
  var SecondaryActionIcon = require('./SecondaryActionIcon-BZg-ADIW.js');
8
8
  var index$1 = require('./index-DJbShhV1.js');
9
- var search_store = require('./search.store-NSPzykno.js');
9
+ var search_store = require('./search.store-CT4luzT3.js');
10
10
  var constants = require('./constants-BlwqMvns.js');
11
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
11
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
12
12
  var index$2 = require('./index-tXcMfW9y.js');
13
13
  require('./store-CrCuJC55.js');
14
14
 
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
5
- var search_store = require('./search.store-NSPzykno.js');
4
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
5
+ var search_store = require('./search.store-CT4luzT3.js');
6
6
  var customizedSlots = require('./customized-slots-D9G-pOuM.js');
7
- var index$2 = require('./index-BUEskchg.js');
7
+ var index$2 = require('./index-DZMV2ChQ.js');
8
8
  var index$1 = require('./index-C3G9W48a.js');
9
9
  var i18next = require('./i18next-DkN_8H9H.js');
10
10
  var checkDeviceType = require('./checkDeviceType-iUhpuLlH.js');
11
11
  var store = require('./store-CrCuJC55.js');
12
12
  var index$3 = require('./index-tXcMfW9y.js');
13
- var _package = require('./package-B2xF7VCy.js');
14
- var resources = require('./resources-5_Y1cO9T.js');
13
+ var _package = require('./package-CN6WlYoJ.js');
14
+ var resources = require('./resources-cQWt9LRT.js');
15
15
  var index$4 = require('./index-DJbShhV1.js');
16
16
  var constants = require('./constants-BlwqMvns.js');
17
17
  var triggerFilter = require('./triggerFilter-DFGg92Xh.js');
@@ -396,12 +396,21 @@ const VviinnImageSelector = class {
396
396
  this.vviinnNoResult = index.createEvent(this, "vviinnNoResult");
397
397
  this.vviinnImageUploadFinished = index.createEvent(this, "vviinnImageUploadFinished");
398
398
  this.loading = false;
399
- this.accept = "image";
400
399
  }
401
400
  async handleInputChange(event) {
402
- this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
401
+ var _a;
403
402
  const input = event.target;
404
- const processingResult = await search_store.makeUploadFileRequest(this.storeName)(input.files[0]);
403
+ const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
404
+ if (!file)
405
+ return;
406
+ const validationResult = search_store.checkImageType(file);
407
+ if (Rectangle.isLeft(validationResult)) {
408
+ this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: validationResult.left.kind }));
409
+ input.value = "";
410
+ return;
411
+ }
412
+ this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
413
+ const processingResult = await search_store.makeUploadFileRequest(this.storeName)(file);
405
414
  Rectangle._functionExports.pipe(processingResult, Rectangle.match(({ kind }) => {
406
415
  this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: kind }));
407
416
  }, (response) => {
@@ -413,7 +422,7 @@ const VviinnImageSelector = class {
413
422
  isTriggeredByVpsWidget: this.storeName === "widget",
414
423
  });
415
424
  }));
416
- input.value = null;
425
+ input.value = "";
417
426
  }
418
427
  startUploadWatcher(upload) {
419
428
  if (upload) {
@@ -422,13 +431,13 @@ const VviinnImageSelector = class {
422
431
  }
423
432
  }
424
433
  render() {
425
- return (index.h(index.Host, { key: '6861edff3c5282228d0521106e9e5eae456bfe3e', exportparts: "button" }, this.loading ? (index.h("vviinn-preloader", null)) : (index.h("label", { htmlFor: "fileInput", part: "button", tabindex: "0", onKeyDown: (e) => {
434
+ return (index.h(index.Host, { key: 'ccdb1848c44143d1ec9243c39776886873729aef', exportparts: "button" }, this.loading ? (index.h("vviinn-preloader", null)) : (index.h("label", { htmlFor: "fileInput", part: "button", tabindex: "0", onKeyDown: (e) => {
426
435
  var _a;
427
436
  if (e.key === "Enter" || e.key === " ") {
428
437
  e.preventDefault();
429
438
  (_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click();
430
439
  }
431
- } }, index.h("slot", { name: "upload-button-text" }, "Upload image"))), index.h("input", { key: '4aa61d6a7c3fef77426954db6c6c499e33d90d27', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: this.accept === "image" ? "image/*" : "application/octet-stream", onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
440
+ } }, index.h("slot", { name: "upload-button-text" }, "Upload image"))), index.h("input", { key: 'bdddef690583a01729d2b7412736f3825b060386', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: search_store.acceptableFileFormats, onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
432
441
  }
433
442
  static get watchers() { return {
434
443
  "startUpload": ["startUploadWatcher"]
@@ -1389,6 +1398,7 @@ const VviinnVpsWidget = class {
1389
1398
  /** @internal */
1390
1399
  this.showInWidget = true;
1391
1400
  this.slidePosition = 0;
1401
+ this.uploadSource = null;
1392
1402
  this.stream = null;
1393
1403
  this.products = [];
1394
1404
  this.isCameraInitializing = false;
@@ -1503,20 +1513,19 @@ const VviinnVpsWidget = class {
1503
1513
  this.wrongImageFormat = false;
1504
1514
  this.resetScroll("results-block");
1505
1515
  this.stopStreamTracks();
1506
- this.initResultEvents();
1516
+ this.showInWidget && this.initResultEvents();
1507
1517
  this.stream = null;
1508
1518
  this.isCameraEnabled = false;
1509
1519
  this.isCameraButtonClicked = false;
1510
1520
  this.isCameraInitializing = false;
1511
1521
  this.setShowAspectRatioError(false);
1512
1522
  this.slidePosition = 0;
1523
+ this.uploadSource = null;
1513
1524
  this.resetScroll("start-page_block");
1514
1525
  };
1515
1526
  this.resetState = () => {
1516
1527
  this.resetInnerState();
1517
- if (this.showInWidget) {
1518
- search_store.resetStore(this.storeName, "appStateAndReceivedData");
1519
- }
1528
+ this.showInWidget && search_store.resetStore(this.storeName, "appStateAndReceivedData");
1520
1529
  };
1521
1530
  }
1522
1531
  initResultEvents() {
@@ -1572,7 +1581,7 @@ const VviinnVpsWidget = class {
1572
1581
  }
1573
1582
  else {
1574
1583
  document.body.style.overflow = this.overflow;
1575
- this.initResultEvents();
1584
+ this.showInWidget && this.initResultEvents();
1576
1585
  }
1577
1586
  }
1578
1587
  slidePositionWatcher() {
@@ -1699,31 +1708,31 @@ const VviinnVpsWidget = class {
1699
1708
  }
1700
1709
  render() {
1701
1710
  var _a, _b, _c;
1702
- return (index.h(index.Host, { key: '6befdfddd06e53f011e3f6a87bf5200bbfdafef1', exportparts: `${index$4.modalParts}, ${index$4.productCardParts}, ${index$4.searchBarParts}, ${index$4.searchWidgetFilterParts}, ${index$4.searchWidgetButtonParts}, ${index$4.productCardsGridPart}, ${index$4.suggestionsParts}` }, !this.showingInButton && customizedSlots.SlotSkeleton("search"), index.h("vviinn-overlayed-modal", { key: '38380b522ca1ac1ae86e33f6060c7dc040632728', class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState, onVviinnWidgetClose: ({ detail }) => {
1711
+ return (index.h(index.Host, { key: 'e4b3eb07adaedcc346dc23ebb4074d6b568f34a2', exportparts: `${index$4.modalParts}, ${index$4.productCardParts}, ${index$4.searchBarParts}, ${index$4.searchWidgetFilterParts}, ${index$4.searchWidgetButtonParts}, ${index$4.productCardsGridPart}, ${index$4.suggestionsParts}` }, !this.showingInButton && customizedSlots.SlotSkeleton("search"), index.h("vviinn-overlayed-modal", { key: '7b4de48bae309958fdbcd075554c0926ceea6174', class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState, onVviinnWidgetClose: ({ detail }) => {
1703
1712
  if (detail.campaignTypeId !== "VPR")
1704
1713
  this.handleModalClose();
1705
1714
  }, buttonElementId: (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.widgetElementId, widgetVersion: _package.version, hideBackButton: (this.mode === "upload" && this.showingInButton) ||
1706
- (!this.isCameraEnabled && this.isOnboardingSlide()), exportparts: index$4.modalParts }, index.h("vviinn-slider", { key: 'be3a5bbebfa1396ff2568ce23f7e5573249d3e20', position: this.slidePosition }, index.h("vviinn-slide", { key: 'b5fe1748627e08700a3a67931eb835f3e22000bc', class: {
1715
+ (!this.isCameraEnabled && this.isOnboardingSlide()), exportparts: index$4.modalParts }, index.h("vviinn-slider", { key: 'a8d336c59f73a6d68f6551363224b0b533958a51', position: this.slidePosition }, index.h("vviinn-slide", { key: '926a5a90953d80086442acc521a3d5577a444747', class: {
1707
1716
  "start-page": true,
1708
1717
  "camera-enabled": this.isCameraEnabled,
1709
- } }, index.h("vviinn-camera", { key: '2ff5659977ee56238b02611b4f7e1f1e8f2a3228', onVviinnImageUploadFinished: this.handleVviinnImageUploadFinished, onVviinnImageUploadStarted: () => {
1718
+ } }, index.h("vviinn-camera", { key: '8d4d1233f9f293f608d94d79437845545329593c', onVviinnImageUploadFinished: this.handleVviinnImageUploadFinished, onVviinnImageUploadStarted: () => {
1710
1719
  this.handleVviinnImageUpload("startCamera");
1711
- }, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), index.h("div", { key: '94e821fa25dbb4db2277d38f4ba6993941b9e2d8', class: {
1720
+ }, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), index.h("div", { key: '720b321bb57d3aad2bffd7ea1846f15dbb0ce53a', class: {
1712
1721
  error: this.haveErrors(),
1713
- }, id: "start-page_block" }, index.h("div", { key: '72c99dcc3ba6f5f7969120ea1d453f034b4ec991', class: "start-page_main-content" }, (this.wrongImageFormat ||
1714
- this.state.searchStatus === "error") && (index.h("div", { key: '655f4202af65eb118124e2401fe118ca0fc15631', class: "start-page_errors-block" }, this.getCurrentErrorType() && (index.h("vviinn-error", { key: '4c00d5fb45283e51ed94f18af266a62c80d46671', errorType: this.getCurrentErrorType(), handler: this.resetState, hasBackground: this.showInWidget, searchType: this.state.searchType })))), !this.haveErrors() && (index.h(index.Fragment, { key: 'f423acd6924394400fe6e6f4fa8e902a217dfffa' }, index.h("vviinn-teaser", { key: 'e7fb21f20050be0067d9286f6d3fa51ee6d4d2c6' }), index.h("div", { key: 'bf1f46945924a4df4e4c7f26bf6f6ee439f4ceb2', class: "buttons-group" }, this.renderButtons()), this.textSearchShow && (index.h("vviinn-text-search", { key: 'e4b5618848ede58e1d440390e64f25515d97b1b4', token: store.globalState.token, apiPath: store.globalState.apiPath, locale: store.globalState.locale, showInWidget: true, showOnFirstScreen: true, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), "save-image-mode": "never" }))))), index.h("vviinn-privacy-badge", { key: 'c38a4b2832ee506d0090ba5a2fbf65a75e4baa58', privacyBadgeText: i18next.instance.t("privacyBadgeText", {
1722
+ }, id: "start-page_block" }, index.h("div", { key: 'c32f285eb2a09128da261ab6760ffecfe2c8d29c', class: "start-page_main-content" }, (this.wrongImageFormat ||
1723
+ this.state.searchStatus === "error") && (index.h("div", { key: 'bf1e3792a180449a856e43e06f98fadb2b20f2b1', class: "start-page_errors-block" }, this.getCurrentErrorType() && (index.h("vviinn-error", { key: '475c56ce4cea82ca41630c7f33d80cc101be38c6', errorType: this.getCurrentErrorType(), handler: this.resetState, hasBackground: this.showInWidget, searchType: this.state.searchType })))), !this.haveErrors() && (index.h(index.Fragment, { key: '4df2847cfbb83dbda1cc6a79a441d66012644eec' }, index.h("vviinn-teaser", { key: 'da876e72cfd3883155f7852b4850d7d4ed8ffd06' }), index.h("div", { key: '804553414e50659d9394909e7db7e4ce999a2c16', class: "buttons-group" }, this.renderButtons()), this.textSearchShow && (index.h("vviinn-text-search", { key: '331a1f31d82487c4f50862793f88597e5e338929', token: store.globalState.token, apiPath: store.globalState.apiPath, locale: store.globalState.locale, showInWidget: true, showOnFirstScreen: true, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), "save-image-mode": "never" }))))), index.h("vviinn-privacy-badge", { key: '3da1dec800cd91585502ad7eca9f309cf6f31f48', privacyBadgeText: i18next.instance.t("privacyBadgeText", {
1715
1724
  interpolation: { escapeValue: false },
1716
- }), class: { invisible: this.haveErrors() } }))), index.h("vviinn-slide", { key: '83eb0fb3af107fc3d54639c64367a5ebfc966f56', class: {
1725
+ }), class: { invisible: this.haveErrors() } }))), index.h("vviinn-slide", { key: 'a344e5987bdc38735860430750c10e01d2c0eb8e', class: {
1717
1726
  "results-page": true,
1718
1727
  active: this.isResultSlide(),
1719
- } }, this.isResultSlide() && (index.h("div", { key: 'cdfd64427728e91f5f0faf0c61b5e10a2a4ca0a3', class: "source-wrapper" }, this.isTextSearch() ? (index.h(index.Fragment, null, index.h("vviinn-text-search", { token: this.token, showInWidget: true, apiPath: this.apiPath, locale: this.locale, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), "save-image-mode": "never" }), index.h("vviinn-suggestions", { showInWidget: true, token: this.token, apiPath: this.apiPath, locale: this.locale }))) : (index.h("vviinn-cropper", { basicEventData: this.getBasicEventData(), showAspectRatioError: this.showAspectRatioError, apiPath: this.apiPath, showInWidget: true, "save-image-mode": "never" })), ((_b = this.state.dynamicFilters) === null || _b === void 0 ? void 0 : _b.length) > 0 && (index.h("div", { key: '04a27202fe48f245394b946726b4b3cd89916dad', class: {
1728
+ } }, this.isResultSlide() && (index.h("div", { key: 'eadd2ddfcaa8277953e379742ede5f7afd22dffe', class: "source-wrapper" }, this.isTextSearch() ? (index.h(index.Fragment, null, index.h("vviinn-text-search", { token: this.token, showInWidget: true, apiPath: this.apiPath, locale: this.locale, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), "save-image-mode": "never" }), index.h("vviinn-suggestions", { showInWidget: true, token: this.token, apiPath: this.apiPath, locale: this.locale }))) : (index.h("vviinn-cropper", { basicEventData: this.getBasicEventData(), showAspectRatioError: this.showAspectRatioError, apiPath: this.apiPath, showInWidget: true, "save-image-mode": "never" })), ((_b = this.state.dynamicFilters) === null || _b === void 0 ? void 0 : _b.length) > 0 && (index.h("div", { key: 'b2cb3daae83d7ef7a50cfc8bcc04b300be5382c7', class: {
1720
1729
  "filters-wrapper": true,
1721
1730
  hidden: this.showAspectRatioError,
1722
- } }, index.h("vviinn-filters", { key: '6b84c144742bf0ef62090292f09cef66b793fcd9', class: "preview-filters", showInWidget: true, exportparts: index$4.filtersParts }), index.h("vviinn-extended-filters", { key: '9517b380405ffb2d5f01180ae0277dd09257dc15', class: "preview-extended-filters", mode: "preview", showHeader: false, exportparts: index$4.extendedFiltersParts, showInWidget: true }), index.h("vviinn-extended-filters-button", { key: '7f2e322e44edb3b8cfbd1ba94809bd1245147d64', class: {
1731
+ } }, index.h("vviinn-filters", { key: 'a028c222574d4e60ddcfd5ec289ff0c208bcfabc', class: "preview-filters", showInWidget: true, exportparts: index$4.filtersParts }), index.h("vviinn-extended-filters", { key: '88c438a41b5b44c918e5eeb9bc8590cba874b9c6', class: "preview-extended-filters", mode: "preview", showHeader: false, exportparts: index$4.extendedFiltersParts, showInWidget: true }), index.h("vviinn-extended-filters-button", { key: '0aba5bc3f6d005f0ae754494a79aaa10cf28a238', class: {
1723
1732
  "extended-filters-button": true,
1724
1733
  "has-primary-filters": this.state.dynamicFilters.filter((f) => f.isPrimary)
1725
1734
  .length > 0,
1726
- }, exportparts: "extended-filters-button", showInWidget: true }))))), this.isResultSlide() && (index.h("vviinn-results", { key: 'ffc28d5ac4cefa0fc6573140aa0923fd45e44062', token: store.globalState.token, locale: store.globalState.locale, pricePrefix: store.globalState.pricePrefix, "currency-sign": store.globalState.currencySign, apiPath: store.globalState.apiPath, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, uiSessionId: this.uiSessionId, widgetElementId: (_c = this.buttonElementId) !== null && _c !== void 0 ? _c : this.widgetElementId, showInWidget: true, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, addToBasketShow: this.addToBasketShow, favoriteShow: this.favoriteShow, showAspectRatioError: this.showAspectRatioError, resetWidgetState: this.resetState, replaceSlotsContentInWidget: this.replaceSlotsContent.bind(this), replaceSlotsContentInButton: this.replaceSlotsContentInButton, addPriceContainer: this.addPriceContainer, oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, parentSlots: [...this.parentSlots, ...this.slots], scrollableModalBody: this.modalBody })))), index.h("vviinn-extended-filters", { key: '6e4ed4c898e3f11984efc8fd51bfebf0ea3b9e8c', class: "modal-extended-filters", mode: "modal", exportparts: index$4.extendedFiltersParts, showInWidget: true }))));
1735
+ }, exportparts: "extended-filters-button", showInWidget: true }))))), this.isResultSlide() && (index.h("vviinn-results", { key: 'fc9e349d99f23df55fb546c2115ce705827b3114', token: store.globalState.token, locale: store.globalState.locale, pricePrefix: store.globalState.pricePrefix, "currency-sign": store.globalState.currencySign, apiPath: store.globalState.apiPath, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, uiSessionId: this.uiSessionId, widgetElementId: (_c = this.buttonElementId) !== null && _c !== void 0 ? _c : this.widgetElementId, showInWidget: true, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, addToBasketShow: this.addToBasketShow, favoriteShow: this.favoriteShow, showAspectRatioError: this.showAspectRatioError, resetWidgetState: this.resetState, replaceSlotsContentInWidget: this.replaceSlotsContent.bind(this), replaceSlotsContentInButton: this.replaceSlotsContentInButton, addPriceContainer: this.addPriceContainer, oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, parentSlots: [...this.parentSlots, ...this.slots], scrollableModalBody: this.modalBody })))), index.h("vviinn-extended-filters", { key: 'af6545ad7c1e002f297566a4c1590e8e043263d2', class: "modal-extended-filters", mode: "modal", exportparts: index$4.extendedFiltersParts, showInWidget: true }))));
1727
1736
  }
1728
1737
  get el() { return index.getElement(this); }
1729
1738
  static get watchers() { return {
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var search_store = require('./search.store-NSPzykno.js');
5
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
4
+ var search_store = require('./search.store-CT4luzT3.js');
5
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
6
6
  var i18next = require('./i18next-DkN_8H9H.js');
7
- var _package = require('./package-B2xF7VCy.js');
8
- var index$1 = require('./index-BUEskchg.js');
7
+ var _package = require('./package-CN6WlYoJ.js');
8
+ var index$1 = require('./index-DZMV2ChQ.js');
9
9
  var constants = require('./constants-BlwqMvns.js');
10
10
  var customizedSlots = require('./customized-slots-D9G-pOuM.js');
11
11
  var index$2 = require('./index-DJbShhV1.js');
12
12
  var RenderFilterButton = require('./RenderFilterButton-CSLqPags.js');
13
- var resources = require('./resources-5_Y1cO9T.js');
13
+ var resources = require('./resources-cQWt9LRT.js');
14
14
  var triggerFilter = require('./triggerFilter-DFGg92Xh.js');
15
15
  var store = require('./store-CrCuJC55.js');
16
16
  var index$3 = require('./index-tXcMfW9y.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
4
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
5
5
  var i18next = require('./i18next-DkN_8H9H.js');
6
6
  require('./store-CrCuJC55.js');
7
7
 
@@ -3,13 +3,13 @@
3
3
  var index = require('./index-OrE9ITel.js');
4
4
  var RenderFilterButton = require('./RenderFilterButton-CSLqPags.js');
5
5
  var triggerFilter = require('./triggerFilter-DFGg92Xh.js');
6
- var search_store = require('./search.store-NSPzykno.js');
6
+ var search_store = require('./search.store-CT4luzT3.js');
7
7
  var store = require('./store-CrCuJC55.js');
8
8
  var i18next = require('./i18next-DkN_8H9H.js');
9
- var resources = require('./resources-5_Y1cO9T.js');
9
+ var resources = require('./resources-cQWt9LRT.js');
10
10
  var index$1 = require('./index-C3G9W48a.js');
11
11
  var index$2 = require('./index-tXcMfW9y.js');
12
- require('./Rectangle-0jUlP_jx.js');
12
+ require('./Rectangle-DVEulpFu.js');
13
13
 
14
14
  const TextIcon = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" },
15
15
  index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
4
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
5
5
  var checkDeviceType = require('./checkDeviceType-iUhpuLlH.js');
6
6
  var store = require('./store-CrCuJC55.js');
7
- var search_store = require('./search.store-NSPzykno.js');
7
+ var search_store = require('./search.store-CT4luzT3.js');
8
8
  var SecondaryActionIcon = require('./SecondaryActionIcon-BZg-ADIW.js');
9
9
  var intersectionObserver = require('./intersectionObserver-Bz1vF9DA.js');
10
10
 
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-OrE9ITel.js');
4
- var search_store = require('./search.store-NSPzykno.js');
4
+ var search_store = require('./search.store-CT4luzT3.js');
5
5
  var customizedSlots = require('./customized-slots-D9G-pOuM.js');
6
6
  var i18next = require('./i18next-DkN_8H9H.js');
7
- var resources = require('./resources-5_Y1cO9T.js');
8
- var Rectangle = require('./Rectangle-0jUlP_jx.js');
7
+ var resources = require('./resources-cQWt9LRT.js');
8
+ var Rectangle = require('./Rectangle-DVEulpFu.js');
9
9
  var index$1 = require('./index-DJbShhV1.js');
10
10
  var store = require('./store-CrCuJC55.js');
11
11
 
@@ -6,7 +6,7 @@ var constants$1 = require('./constants-DHaugTOE.js');
6
6
  var index$1 = require('./index-tXcMfW9y.js');
7
7
  var constants = require('./constants-BlwqMvns.js');
8
8
  var i18next = require('./i18next-DkN_8H9H.js');
9
- var resources = require('./resources-5_Y1cO9T.js');
9
+ var resources = require('./resources-cQWt9LRT.js');
10
10
  var store = require('./store-CrCuJC55.js');
11
11
 
12
12
  const SearchModalCameraIcon = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" },
@@ -152,7 +152,7 @@ const VviinnVpsButton = class {
152
152
  }
153
153
  render() {
154
154
  const { ariaLabel, buttonIcon } = this.getButtonConfig();
155
- return (index.h(index.Host, { key: '217a7bba519ef7060fc80662ebea7d00906e09b3', role: this.buttonPressed ? undefined : "button", "aria-label": this.buttonPressed ? undefined : ariaLabel }, index.h("vviinn-button", { key: 'f9266b5a312a418fc91f92be8a2a46cf4e6fc36f', addStyle: this.addStyle, part: "vviinn-button", tabindex: this.buttonPressed ? undefined : "0", onClick: this.buttonPressed ? undefined : this.handleActivation, onKeyDown: this.buttonPressed ? undefined : this.handleKeyDown }, index.h("slot", { key: '3c0eb4a3f434f763a5b3b089655a7884bc296b3d' }, buttonIcon)), customizedSlots.SlotSkeleton("search"), index.h("vviinn-vps-widget", { key: 'c12281cb2c98e8c09e84b95719cc13fe1816b3bb', mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, pricePrefix: this.pricePrefix, campaignId: this.campaignId, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton, buttonElementId: this.el.id, active: this.buttonPressed &&
155
+ return (index.h(index.Host, { key: '77f53d931cece790d3ad282c9361255da9d7855f', role: this.buttonPressed ? undefined : "button", "aria-label": this.buttonPressed ? undefined : ariaLabel }, index.h("vviinn-button", { key: '4ae881afffce59ca29a16bcfac041b7f27e9b99f', addStyle: this.addStyle, part: "vviinn-button", tabindex: this.buttonPressed ? undefined : "0", onClick: this.buttonPressed ? undefined : this.handleActivation, onKeyDown: this.buttonPressed ? undefined : this.handleKeyDown }, index.h("slot", { key: 'd696de9a652f1536e8658647e8a34c4346560262' }, buttonIcon)), customizedSlots.SlotSkeleton("search"), index.h("vviinn-vps-widget", { key: '96d554c425f8c06a2f61c8f4415b8789589996c6', mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, pricePrefix: this.pricePrefix, campaignId: this.campaignId, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton, buttonElementId: this.el.id, active: this.buttonPressed &&
156
156
  (this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, imageResolutionWidth: this.imageResolutionWidth, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow, addToBasketShow: this.addToBasketShow, addPriceContainer: this.addPriceContainer, replaceSlotsContentInButton: this.replaceSlotsContent.bind(this), oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, favoriteShow: this.favoriteShow, showInWidget: this.showInWidget, parentSlots: this.slots })));
157
157
  }
158
158
  get el() { return index.getElement(this); }
@@ -2,7 +2,8 @@ import { fromOption } from "fp-ts/lib/Either";
2
2
  import { findFirstMap } from "fp-ts/Array";
3
3
  import { pipe } from "fp-ts/lib/function";
4
4
  import { none, some } from "fp-ts/lib/Option";
5
- const SUPPORTED_FILE_TYPES = ["jpg", "jpeg", "png", "webp"];
5
+ const SUPPORTED_FILE_TYPES = ["jpg", "jpeg", "png", "webp", "avif"];
6
+ export const acceptableFileFormats = SUPPORTED_FILE_TYPES.map((type) => `.${type}`).join(", ");
6
7
  const unsupportedFileTypeError = {
7
8
  kind: "client",
8
9
  inner: "File format not supported",
@@ -643,7 +643,7 @@ export class VviinnCarousel {
643
643
  "mutable": true,
644
644
  "complexType": {
645
645
  "original": "Recommendation[]",
646
- "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original?: string; thumbnail?: string; }; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }[]",
646
+ "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original: string; thumbnail: string; }; images?: { original: string; thumbnail: string; }[]; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }[]",
647
647
  "references": {
648
648
  "Recommendation": {
649
649
  "location": "import",
@@ -668,7 +668,7 @@ export class VviinnCarousel {
668
668
  "mutable": false,
669
669
  "complexType": {
670
670
  "original": "Recommendation",
671
- "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original?: string; thumbnail?: string; }; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }",
671
+ "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original: string; thumbnail: string; }; images?: { original: string; thumbnail: string; }[]; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }",
672
672
  "references": {
673
673
  "Recommendation": {
674
674
  "location": "import",
@@ -3,18 +3,28 @@ import * as E from "fp-ts/Either";
3
3
  import { pipe } from "fp-ts/lib/function";
4
4
  import { makeUploadFileRequest, } from "../../store/search.store";
5
5
  import { setLocalStorageItems } from "../../localStorage";
6
+ import { acceptableFileFormats, checkImageType } from "../../Image/error";
6
7
  /**
7
8
  * @part button - button look and feel
8
9
  */
9
10
  export class VviinnImageSelector {
10
11
  constructor() {
11
12
  this.loading = false;
12
- this.accept = "image";
13
13
  }
14
14
  async handleInputChange(event) {
15
- this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
15
+ var _a;
16
16
  const input = event.target;
17
- const processingResult = await makeUploadFileRequest(this.storeName)(input.files[0]);
17
+ const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
18
+ if (!file)
19
+ return;
20
+ const validationResult = checkImageType(file);
21
+ if (E.isLeft(validationResult)) {
22
+ this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: validationResult.left.kind }));
23
+ input.value = "";
24
+ return;
25
+ }
26
+ this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
27
+ const processingResult = await makeUploadFileRequest(this.storeName)(file);
18
28
  pipe(processingResult, E.match(({ kind }) => {
19
29
  this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: kind }));
20
30
  }, (response) => {
@@ -26,7 +36,7 @@ export class VviinnImageSelector {
26
36
  isTriggeredByVpsWidget: this.storeName === "widget",
27
37
  });
28
38
  }));
29
- input.value = null;
39
+ input.value = "";
30
40
  }
31
41
  startUploadWatcher(upload) {
32
42
  if (upload) {
@@ -35,13 +45,13 @@ export class VviinnImageSelector {
35
45
  }
36
46
  }
37
47
  render() {
38
- return (h(Host, { key: '6861edff3c5282228d0521106e9e5eae456bfe3e', exportparts: "button" }, this.loading ? (h("vviinn-preloader", null)) : (h("label", { htmlFor: "fileInput", part: "button", tabindex: "0", onKeyDown: (e) => {
48
+ return (h(Host, { key: 'ccdb1848c44143d1ec9243c39776886873729aef', exportparts: "button" }, this.loading ? (h("vviinn-preloader", null)) : (h("label", { htmlFor: "fileInput", part: "button", tabindex: "0", onKeyDown: (e) => {
39
49
  var _a;
40
50
  if (e.key === "Enter" || e.key === " ") {
41
51
  e.preventDefault();
42
52
  (_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click();
43
53
  }
44
- } }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: '4aa61d6a7c3fef77426954db6c6c499e33d90d27', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: this.accept === "image" ? "image/*" : "application/octet-stream", onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
54
+ } }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: 'bdddef690583a01729d2b7412736f3825b060386', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: acceptableFileFormats, onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
45
55
  }
46
56
  static get is() { return "vviinn-image-selector"; }
47
57
  static get encapsulation() { return "shadow"; }
@@ -125,8 +135,8 @@ export class VviinnImageSelector {
125
135
  "attribute": "accept",
126
136
  "mutable": false,
127
137
  "complexType": {
128
- "original": "\"image\" | \"application-octet-stream\"",
129
- "resolved": "\"application-octet-stream\" | \"image\"",
138
+ "original": "string",
139
+ "resolved": "string",
130
140
  "references": {}
131
141
  },
132
142
  "required": false,
@@ -137,8 +147,7 @@ export class VviinnImageSelector {
137
147
  },
138
148
  "getter": false,
139
149
  "setter": false,
140
- "reflect": false,
141
- "defaultValue": "\"image\""
150
+ "reflect": false
142
151
  },
143
152
  "resetVpsButton": {
144
153
  "type": "unknown",
@@ -296,7 +305,7 @@ export class VviinnImageSelector {
296
305
  "composed": true,
297
306
  "docs": {
298
307
  "tags": [],
299
- "text": "Wrong image format, that isn't .jpg, .jpeg, png"
308
+ "text": "Wrong image format, that isn't .jpg, .jpeg, .png, .webp, or .avif"
300
309
  },
301
310
  "complexType": {
302
311
  "original": "NoResultEventData",
@@ -1565,7 +1565,7 @@ export class VviinnVprWidget {
1565
1565
  },
1566
1566
  "complexType": {
1567
1567
  "original": "Recommendation",
1568
- "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original?: string; thumbnail?: string; }; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }",
1568
+ "resolved": "{ kind?: \"product\" | \"content\"; entityType?: \"product\" | \"content\" | \"list\"; groupId?: string; productId?: string; title?: string; deeplink?: string; brand?: string; productType?: string; image?: { original: string; thumbnail: string; }; images?: { original: string; thumbnail: string; }[]; price?: { actual?: number; sale?: number; }; basePrice?: { actual?: { price?: number; quantity?: number; measure?: string; }; sale?: { price?: number; quantity?: number; measure?: string; }; }; energyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; minEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; maxEnergyEfficiencyClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; energyCertifications?: { certificationClass?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; classIconUrls?: { left: string; right: string; }; classRange?: { min?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; max?: \"A+++\" | \"A++\" | \"A+\" | \"A\" | \"B\" | \"C\" | \"D\" | \"E\" | \"F\" | \"G\"; }; classLabelUrl?: string; classDataSheetUrl?: string; productType?: string; }[]; custom_label_0?: string; custom_label_1?: string; custom_label_2?: string; custom_label_3?: string; custom_label_4?: string; }",
1569
1569
  "references": {
1570
1570
  "Recommendation": {
1571
1571
  "location": "import",
@@ -186,7 +186,7 @@ export class VviinnVpsButton {
186
186
  }
187
187
  render() {
188
188
  const { ariaLabel, buttonIcon } = this.getButtonConfig();
189
- return (h(Host, { key: '217a7bba519ef7060fc80662ebea7d00906e09b3', role: this.buttonPressed ? undefined : "button", "aria-label": this.buttonPressed ? undefined : ariaLabel }, h("vviinn-button", { key: 'f9266b5a312a418fc91f92be8a2a46cf4e6fc36f', addStyle: this.addStyle, part: "vviinn-button", tabindex: this.buttonPressed ? undefined : "0", onClick: this.buttonPressed ? undefined : this.handleActivation, onKeyDown: this.buttonPressed ? undefined : this.handleKeyDown }, h("slot", { key: '3c0eb4a3f434f763a5b3b089655a7884bc296b3d' }, buttonIcon)), SlotSkeleton("search"), h("vviinn-vps-widget", { key: 'c12281cb2c98e8c09e84b95719cc13fe1816b3bb', mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, pricePrefix: this.pricePrefix, campaignId: this.campaignId, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton, buttonElementId: this.el.id, active: this.buttonPressed &&
189
+ return (h(Host, { key: '77f53d931cece790d3ad282c9361255da9d7855f', role: this.buttonPressed ? undefined : "button", "aria-label": this.buttonPressed ? undefined : ariaLabel }, h("vviinn-button", { key: '4ae881afffce59ca29a16bcfac041b7f27e9b99f', addStyle: this.addStyle, part: "vviinn-button", tabindex: this.buttonPressed ? undefined : "0", onClick: this.buttonPressed ? undefined : this.handleActivation, onKeyDown: this.buttonPressed ? undefined : this.handleKeyDown }, h("slot", { key: 'd696de9a652f1536e8658647e8a34c4346560262' }, buttonIcon)), SlotSkeleton("search"), h("vviinn-vps-widget", { key: '96d554c425f8c06a2f61c8f4415b8789589996c6', mode: this.mode, "currency-sign": this.currencySign, token: this.token, locale: this.locale, apiPath: this.apiPath, pricePrefix: this.pricePrefix, campaignId: this.campaignId, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, showingInButton: true, buttonPressed: this.buttonPressed, resetVpsButton: this.resetButton, buttonElementId: this.el.id, active: this.buttonPressed &&
190
190
  (this.mode === "modal" || this.mode === "camera"), excluded: this.excluded, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, imageResolutionWidth: this.imageResolutionWidth, exampleImageSource: this.exampleImageSource, textSearchShow: this.textSearchShow, addToBasketShow: this.addToBasketShow, addPriceContainer: this.addPriceContainer, replaceSlotsContentInButton: this.replaceSlotsContent.bind(this), oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, favoriteShow: this.favoriteShow, showInWidget: this.showInWidget, parentSlots: this.slots })));
191
191
  }
192
192
  static get is() { return "vviinn-vps-button"; }
@@ -867,7 +867,7 @@ export class VviinnVpsButton {
867
867
  "composed": true,
868
868
  "docs": {
869
869
  "tags": [],
870
- "text": "Wrong image format, that isn't .jpg, .jpeg, png, or the request failed"
870
+ "text": "Wrong image format, that isn't .jpg, .jpeg, .png, .webp, or .avif, or the request failed"
871
871
  },
872
872
  "complexType": {
873
873
  "original": "BasicEventData",