vviinn-widgets 2.28.0 → 2.30.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 (52) hide show
  1. package/dist/cjs/{index-ea4811ba.js → index-7ff2ab5f.js} +65 -20
  2. package/dist/cjs/{package-2c1dfbe0.js → package-ebb49556.js} +1 -1
  3. package/dist/cjs/vviinn-carousel_3.cjs.entry.js +33 -10
  4. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
  5. package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
  6. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +25 -9
  7. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +5 -5
  8. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +3 -3
  9. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +34 -11
  10. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +3 -3
  11. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +27 -11
  12. package/dist/collection/tracking/index.js +36 -20
  13. package/dist/collection/tracking/models.js +3 -1
  14. package/dist/collection/tracking/result.js +26 -0
  15. package/dist/esm/{index-95fa66d2.js → index-53105ad4.js} +63 -21
  16. package/dist/esm/{package-ed187917.js → package-5b89b632.js} +1 -1
  17. package/dist/esm/vviinn-carousel_3.entry.js +33 -10
  18. package/dist/esm/vviinn-vpr-button.entry.js +1 -1
  19. package/dist/esm/vviinn-vps-button.entry.js +1 -1
  20. package/dist/esm/vviinn-vps-widget.entry.js +25 -9
  21. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +1 -0
  22. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +1 -0
  23. package/dist/types/recommendation/events.d.ts +2 -0
  24. package/dist/types/tracking/index.d.ts +6 -3
  25. package/dist/types/tracking/models.d.ts +4 -2
  26. package/dist/types/tracking/result.d.ts +8 -0
  27. package/dist/vviinn-widgets/p-100db122.js +1 -0
  28. package/dist/vviinn-widgets/p-455cfbab.entry.js +1 -0
  29. package/dist/vviinn-widgets/p-71777006.entry.js +1 -0
  30. package/dist/vviinn-widgets/{p-02a84a90.entry.js → p-90c9a5f4.entry.js} +1 -1
  31. package/dist/vviinn-widgets/p-b3403a92.entry.js +1 -0
  32. package/dist/vviinn-widgets/{p-ffa567ee.js → p-da7273ce.js} +1 -1
  33. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  34. package/package.json +1 -1
  35. package/www/build/p-100db122.js +1 -0
  36. package/www/build/p-455cfbab.entry.js +1 -0
  37. package/www/build/p-71777006.entry.js +1 -0
  38. package/www/build/{p-8b25b766.js → p-7a3d8acd.js} +2 -2
  39. package/www/build/{p-02a84a90.entry.js → p-90c9a5f4.entry.js} +1 -1
  40. package/www/build/p-b3403a92.entry.js +1 -0
  41. package/www/build/{p-ffa567ee.js → p-da7273ce.js} +1 -1
  42. package/www/build/vviinn-widgets.esm.js +1 -1
  43. package/www/index.html +1 -1
  44. package/dist/vviinn-widgets/p-6b12aed8.entry.js +0 -1
  45. package/dist/vviinn-widgets/p-bf490f6f.entry.js +0 -1
  46. package/dist/vviinn-widgets/p-f9858364.entry.js +0 -1
  47. package/dist/vviinn-widgets/p-fc5a0363.js +0 -1
  48. package/www/assets/web_component_shadow_parts.png +0 -0
  49. package/www/build/p-6b12aed8.entry.js +0 -1
  50. package/www/build/p-bf490f6f.entry.js +0 -1
  51. package/www/build/p-f9858364.entry.js +0 -1
  52. package/www/build/p-fc5a0363.js +0 -1
@@ -3815,6 +3815,8 @@ const ADD_TO_BASKET_EVENT_TYPE = "add_to_basket_event";
3815
3815
  const FILTER_EVENT_TYPE = "filter_event";
3816
3816
  const SEARCH_EVENT_TYPE = "search_event";
3817
3817
  const WIDGET_EVENT_TYPE = "widget_event";
3818
+ const RESULT_LOAD_EVENT_TYPE = "result_load_event";
3819
+ const RESULT_VIEW_EVENT_TYPE = "result_view_event";
3818
3820
 
3819
3821
  const filterEvent = {
3820
3822
  widget: "VPS",
@@ -3884,45 +3886,83 @@ const vpsWidget = {
3884
3886
  typ: WIDGET_EVENT_TYPE,
3885
3887
  };
3886
3888
 
3887
- const createProductLoadVprEvent = createTrackingEvent(vprProductLoad);
3888
- const createProductViewVprEvent = createTrackingEvent(vprProductView);
3889
- const createProductClickVprEvent = createTrackingEvent(vprProductClick);
3890
- const createProductLoadVpcEvent = createTrackingEvent(vpcProductLoad);
3891
- const createProductViewVpcEvent = createTrackingEvent(vpcProductView);
3892
- const createProductClickVpcEvent = createTrackingEvent(vpcProductClick);
3893
- const createProductLoadVpsEvent = createTrackingEvent(vpsProductLoad);
3894
- const createProductViewVpsEvent = createTrackingEvent(vpsProductView);
3895
- const createProductClickVpsEvent = createTrackingEvent(vpsProductClick);
3896
- const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
3897
- const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
3889
+ const vprResultLoad = {
3890
+ widget: "VPR",
3891
+ typ: RESULT_LOAD_EVENT_TYPE,
3892
+ };
3893
+ const vprResultView = {
3894
+ widget: "VPR",
3895
+ typ: RESULT_VIEW_EVENT_TYPE,
3896
+ };
3897
+ const vpcResultLoad = {
3898
+ widget: "VPC",
3899
+ typ: RESULT_LOAD_EVENT_TYPE,
3900
+ };
3901
+ const vpcResultView = {
3902
+ widget: "VPC",
3903
+ typ: RESULT_VIEW_EVENT_TYPE,
3904
+ };
3905
+ const vpsResultLoad = {
3906
+ widget: "VPS",
3907
+ typ: RESULT_LOAD_EVENT_TYPE,
3908
+ };
3909
+ const vpsResultView = {
3910
+ widget: "VPS",
3911
+ typ: RESULT_VIEW_EVENT_TYPE,
3912
+ };
3913
+
3898
3914
  const createProductVprEventByType = (type) => {
3899
3915
  switch (type) {
3900
3916
  case "load":
3901
- return createProductLoadVprEvent;
3917
+ return createTrackingEvent(vprProductLoad);
3902
3918
  case "view":
3903
- return createProductViewVprEvent;
3919
+ return createTrackingEvent(vprProductView);
3904
3920
  case "click":
3905
- return createProductClickVprEvent;
3921
+ return createTrackingEvent(vprProductClick);
3906
3922
  }
3907
3923
  };
3908
3924
  const createProductVpcEventByType = (type) => {
3909
3925
  switch (type) {
3910
3926
  case "load":
3911
- return createProductLoadVpcEvent;
3927
+ return createTrackingEvent(vpcProductLoad);
3912
3928
  case "view":
3913
- return createProductViewVpcEvent;
3929
+ return createTrackingEvent(vpcProductView);
3914
3930
  case "click":
3915
- return createProductClickVpcEvent;
3931
+ return createTrackingEvent(vpcProductClick);
3916
3932
  }
3917
3933
  };
3918
3934
  const createProductVpsEventByType = (type) => {
3919
3935
  switch (type) {
3920
3936
  case "load":
3921
- return createProductLoadVpsEvent;
3937
+ return createTrackingEvent(vpsProductLoad);
3922
3938
  case "view":
3923
- return createProductViewVpsEvent;
3939
+ return createTrackingEvent(vpsProductView);
3924
3940
  case "click":
3925
- return createProductClickVpsEvent;
3941
+ return createTrackingEvent(vpsProductClick);
3942
+ }
3943
+ };
3944
+ const createResultVprEventByType = (type) => {
3945
+ switch (type) {
3946
+ case "load":
3947
+ return createTrackingEvent(vprResultLoad);
3948
+ case "view":
3949
+ return createTrackingEvent(vprResultView);
3950
+ }
3951
+ };
3952
+ const createResultVpcEventByType = (type) => {
3953
+ switch (type) {
3954
+ case "load":
3955
+ return createTrackingEvent(vpcResultLoad);
3956
+ case "view":
3957
+ return createTrackingEvent(vpcResultView);
3958
+ }
3959
+ };
3960
+ const createResultVpsEventByType = (type) => {
3961
+ switch (type) {
3962
+ case "load":
3963
+ return createTrackingEvent(vpsResultLoad);
3964
+ case "view":
3965
+ return createTrackingEvent(vpsResultView);
3926
3966
  }
3927
3967
  };
3928
3968
  const createWidgetVprEvent = createTrackingEvent(vprWidget);
@@ -3930,6 +3970,8 @@ const createWidgetVpsEvent = createTrackingEvent(vpsWidget);
3930
3970
  const createWidgetVpcEvent = createTrackingEvent(vpcWidget);
3931
3971
  const createSearchEvent = createTrackingEvent(searchEvent);
3932
3972
  const createFilterEvent = createTrackingEvent(filterEvent);
3973
+ const createAddToBasketVprEvent = createTrackingEvent(vprAddToBasket);
3974
+ const createAddToBasketVpcEvent = createTrackingEvent(vpcAddToBasket);
3933
3975
 
3934
3976
  exports.createAddToBasketVpcEvent = createAddToBasketVpcEvent;
3935
3977
  exports.createAddToBasketVprEvent = createAddToBasketVprEvent;
@@ -3937,6 +3979,9 @@ exports.createFilterEvent = createFilterEvent;
3937
3979
  exports.createProductVpcEventByType = createProductVpcEventByType;
3938
3980
  exports.createProductVprEventByType = createProductVprEventByType;
3939
3981
  exports.createProductVpsEventByType = createProductVpsEventByType;
3982
+ exports.createResultVpcEventByType = createResultVpcEventByType;
3983
+ exports.createResultVprEventByType = createResultVprEventByType;
3984
+ exports.createResultVpsEventByType = createResultVpsEventByType;
3940
3985
  exports.createSearchEvent = createSearchEvent;
3941
3986
  exports.createTrackingApi = createTrackingApi;
3942
3987
  exports.createWidgetVpcEvent = createWidgetVpcEvent;
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "2.28.0";
3
+ const version = "2.30.0";
4
4
 
5
5
  exports.version = version;
@@ -7,8 +7,8 @@ const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
  const index$1 = require('./index-fcf59d51.js');
8
8
  const i18next = require('./i18next-74ff3413.js');
9
9
  const customizedSlots = require('./customized-slots-0a8d663c.js');
10
- const _package = require('./package-2c1dfbe0.js');
11
- const index$2 = require('./index-ea4811ba.js');
10
+ const _package = require('./package-ebb49556.js');
11
+ const index$2 = require('./index-7ff2ab5f.js');
12
12
 
13
13
  const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#e0e0e0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button:disabled{display:none}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
14
14
 
@@ -492,7 +492,7 @@ const VviinnProductCard = class {
492
492
  links.forEach((link) => link.addEventListener("click", (event) => {
493
493
  event.preventDefault();
494
494
  event.stopImmediatePropagation();
495
- this.vviinnProductClick.emit(this.productData);
495
+ this.vviinnProductClick.emit(Object.assign(Object.assign({}, this.productData), { clickEvent: event }));
496
496
  imageSearch_store._function.pipe(getAnalyticsModule, imageSearch_store.Option.match(() => null, (analytics) => analytics.sendClick(this.getProduct())));
497
497
  }));
498
498
  }
@@ -1283,9 +1283,15 @@ const VviinnVprWidget = class {
1283
1283
  widgetVersion: _package.version,
1284
1284
  };
1285
1285
  }
1286
- handleOpenLink(deeplink) {
1287
- if (this.productDetailNewTab) {
1288
- window.open(deeplink);
1286
+ handleOpenLink(deeplink, event) {
1287
+ if (this.productDetailNewTab || event.ctrlKey || event.metaKey) {
1288
+ let newTab = window.open();
1289
+ if (newTab) {
1290
+ newTab.location.href = deeplink;
1291
+ }
1292
+ else {
1293
+ window.location.href = deeplink;
1294
+ }
1289
1295
  }
1290
1296
  else {
1291
1297
  window.location.href = deeplink;
@@ -1359,6 +1365,7 @@ const VviinnVprWidget = class {
1359
1365
  if (!this.resultViewed) {
1360
1366
  this.resultViewed = true;
1361
1367
  this.vviinnResultView.emit(this.getBasicEventData());
1368
+ this.trackResultEvent("view");
1362
1369
  }
1363
1370
  const productViewEvent = this.getProductTrackEvent(detail, "view");
1364
1371
  if (!productViewEvent)
@@ -1368,7 +1375,8 @@ const VviinnVprWidget = class {
1368
1375
  .then(this.setTrackingDeactivated);
1369
1376
  }
1370
1377
  async trackProductClick({ detail }) {
1371
- const product = this.recommendations.find((r) => r.productId === detail.productId);
1378
+ const { productId, clickEvent } = detail;
1379
+ const product = this.recommendations.find((r) => r.productId === productId);
1372
1380
  if (!product || !product.deeplink)
1373
1381
  return;
1374
1382
  const productClickEvent = this.getProductTrackEvent(detail, "click");
@@ -1377,11 +1385,11 @@ const VviinnVprWidget = class {
1377
1385
  .trackEvent(productClickEvent)
1378
1386
  .then(this.setTrackingDeactivated)
1379
1387
  .finally(() => {
1380
- this.handleOpenLink(product.deeplink);
1388
+ this.handleOpenLink(product.deeplink, clickEvent);
1381
1389
  });
1382
1390
  }
1383
1391
  else {
1384
- this.handleOpenLink(product.deeplink);
1392
+ this.handleOpenLink(product.deeplink, clickEvent);
1385
1393
  }
1386
1394
  }
1387
1395
  async trackAddToBasket({ detail }) {
@@ -1412,10 +1420,24 @@ const VviinnVprWidget = class {
1412
1420
  }
1413
1421
  this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
1414
1422
  }
1423
+ trackResultEvent(type) {
1424
+ if (this.trackingDeactivated)
1425
+ return;
1426
+ const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
1427
+ let resultEvent;
1428
+ const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
1429
+ if (this.campaignType === "VCS") {
1430
+ resultEvent = index$2.createResultVpcEventByType(type)(eventBody);
1431
+ }
1432
+ else if (this.campaignType === "VPR") {
1433
+ resultEvent = index$2.createResultVprEventByType(type)(eventBody);
1434
+ }
1435
+ this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
1436
+ }
1415
1437
  getProductTrackEvent(detail, eventType) {
1416
1438
  if (this.trackingDeactivated)
1417
1439
  return null;
1418
- const { productRank, productId, campaignTypeId, widgetType } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType"]);
1440
+ const { productRank, productId, campaignTypeId, widgetType, clickEvent } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType", "clickEvent"]);
1419
1441
  let productEvent;
1420
1442
  const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
1421
1443
  if (campaignTypeId === "VCS") {
@@ -1445,6 +1467,7 @@ const VviinnVprWidget = class {
1445
1467
  handleRecommendationsSuccess(data) {
1446
1468
  var _a;
1447
1469
  this.vviinnResultLoad.emit(this.getBasicEventData());
1470
+ this.trackResultEvent("load");
1448
1471
  this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
1449
1472
  imageSearch_store.imageSearchState.results = this.recommendations;
1450
1473
  this.productIds = this.recommendations.map((r) => r.productId);
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-5619b5ec.js');
6
- const _package = require('./package-2c1dfbe0.js');
6
+ const _package = require('./package-ebb49556.js');
7
7
  const index$1 = require('./index-fcf59d51.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-5619b5ec.js');
6
- const _package = require('./package-2c1dfbe0.js');
6
+ const _package = require('./package-ebb49556.js');
7
7
  const index$1 = require('./index-fcf59d51.js');
8
8
  const customizedSlots = require('./customized-slots-0a8d663c.js');
9
9
 
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-5619b5ec.js');
6
6
  const imageSearch_store = require('./imageSearch.store-dc4e98b3.js');
7
7
  const i18next = require('./i18next-74ff3413.js');
8
- const _package = require('./package-2c1dfbe0.js');
8
+ const _package = require('./package-ebb49556.js');
9
9
  const customizedSlots = require('./customized-slots-0a8d663c.js');
10
- const index$1 = require('./index-ea4811ba.js');
10
+ const index$1 = require('./index-7ff2ab5f.js');
11
11
 
12
12
  const resources = {
13
13
  "de-DE": {
@@ -151,9 +151,15 @@ const VviinnVpsWidget = class {
151
151
  isResultSlide() {
152
152
  return this.slidePosition === 1;
153
153
  }
154
- handleOpenLink(deeplink) {
155
- if (this.productDetailNewTab) {
156
- window.open(deeplink);
154
+ handleOpenLink(deeplink, event) {
155
+ if (this.productDetailNewTab || event.ctrlKey || event.metaKey) {
156
+ let newTab = window.open();
157
+ if (newTab) {
158
+ newTab.location.href = deeplink;
159
+ }
160
+ else {
161
+ window.location.href = deeplink;
162
+ }
157
163
  }
158
164
  else {
159
165
  window.location.href = deeplink;
@@ -191,6 +197,7 @@ const VviinnVpsWidget = class {
191
197
  if (!this.resultViewed) {
192
198
  this.resultViewed = true;
193
199
  this.vviinnResultView.emit(this.getBasicEventData());
200
+ this.trackResultEvent("view");
194
201
  }
195
202
  const productViewEvent = this.getProductTrackEvent(detail, "view");
196
203
  this.trackingApi
@@ -198,8 +205,9 @@ const VviinnVpsWidget = class {
198
205
  .then(this.setTrackingDeactivated);
199
206
  }
200
207
  async trackProductClick({ detail }) {
208
+ const { productId, clickEvent } = detail;
201
209
  const productClickEvent = this.getProductTrackEvent(detail, "click");
202
- const product = imageSearch_store.imageSearchState.results.find((r) => r.productId === detail.productId);
210
+ const product = imageSearch_store.imageSearchState.results.find((r) => r.productId === productId);
203
211
  if (!product || !product.deeplink)
204
212
  return;
205
213
  if (!this.trackingDeactivated) {
@@ -207,11 +215,11 @@ const VviinnVpsWidget = class {
207
215
  .trackEvent(this.trackingDeactivated ? null : productClickEvent)
208
216
  .then(this.setTrackingDeactivated)
209
217
  .finally(() => {
210
- this.handleOpenLink(product.deeplink);
218
+ this.handleOpenLink(product.deeplink, clickEvent);
211
219
  });
212
220
  }
213
221
  else {
214
- this.handleOpenLink(product.deeplink);
222
+ this.handleOpenLink(product.deeplink, clickEvent);
215
223
  }
216
224
  }
217
225
  trachSearchAreaChanges() {
@@ -276,11 +284,18 @@ const VviinnVpsWidget = class {
276
284
  getProductTrackEvent(detail, eventType) {
277
285
  if (this.trackingDeactivated)
278
286
  return null;
279
- const { productRank, productId, campaignTypeId, widgetType } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType"]);
287
+ const { productRank, productId, campaignTypeId, widgetType, clickEvent } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType", "clickEvent"]);
280
288
  const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
281
289
  const productEvent = index$1.createProductVpsEventByType(eventType)(eventBody);
282
290
  return productEvent;
283
291
  }
292
+ trackResultEvent(type) {
293
+ if (this.trackingDeactivated)
294
+ return;
295
+ const _a = this.getBasicEventData(), rest = __rest(_a, ["campaignTypeId", "widgetType"]);
296
+ let resultEvent = index$1.createResultVpsEventByType(type)(Object.assign({ session_id: this.uiSessionId }, rest));
297
+ this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
298
+ }
284
299
  trackInitialSearch(source) {
285
300
  if (this.trackingDeactivated)
286
301
  return;
@@ -302,6 +317,7 @@ const VviinnVpsWidget = class {
302
317
  return null;
303
318
  if (!this.resultLoaded) {
304
319
  this.vviinnResultLoad.emit(this.getBasicEventData());
320
+ this.trackResultEvent("load");
305
321
  this.resultLoaded = true;
306
322
  }
307
323
  return imageSearch_store.imageSearchState.results.map((p, i) => {
@@ -94,7 +94,7 @@ export class VviinnProductCard {
94
94
  links.forEach((link) => link.addEventListener("click", (event) => {
95
95
  event.preventDefault();
96
96
  event.stopImmediatePropagation();
97
- this.vviinnProductClick.emit(this.productData);
97
+ this.vviinnProductClick.emit(Object.assign(Object.assign({}, this.productData), { clickEvent: event }));
98
98
  pipe(getAnalyticsModule, O.match(() => null, (analytics) => analytics.sendClick(this.getProduct())));
99
99
  }));
100
100
  }
@@ -553,7 +553,7 @@ export class VviinnProductCard {
553
553
  },
554
554
  "complexType": {
555
555
  "original": "ProductCardEventData",
556
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
556
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
557
557
  "references": {
558
558
  "ProductCardEventData": {
559
559
  "location": "import",
@@ -573,7 +573,7 @@ export class VviinnProductCard {
573
573
  },
574
574
  "complexType": {
575
575
  "original": "ProductCardEventData",
576
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
576
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
577
577
  "references": {
578
578
  "ProductCardEventData": {
579
579
  "location": "import",
@@ -593,7 +593,7 @@ export class VviinnProductCard {
593
593
  },
594
594
  "complexType": {
595
595
  "original": "ProductCardEventData",
596
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
596
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
597
597
  "references": {
598
598
  "ProductCardEventData": {
599
599
  "location": "import",
@@ -613,7 +613,7 @@ export class VviinnProductCard {
613
613
  },
614
614
  "complexType": {
615
615
  "original": "ProductCardEventData",
616
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
616
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
617
617
  "references": {
618
618
  "ProductCardEventData": {
619
619
  "location": "import",
@@ -560,7 +560,7 @@ export class VviinnVprButton {
560
560
  },
561
561
  "complexType": {
562
562
  "original": "ProductCardEventData",
563
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
563
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
564
564
  "references": {
565
565
  "ProductCardEventData": {
566
566
  "location": "import",
@@ -580,7 +580,7 @@ export class VviinnVprButton {
580
580
  },
581
581
  "complexType": {
582
582
  "original": "ProductCardEventData",
583
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
583
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
584
584
  "references": {
585
585
  "ProductCardEventData": {
586
586
  "location": "import",
@@ -600,7 +600,7 @@ export class VviinnVprButton {
600
600
  },
601
601
  "complexType": {
602
602
  "original": "ProductCardEventData",
603
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
603
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
604
604
  "references": {
605
605
  "ProductCardEventData": {
606
606
  "location": "import",
@@ -25,7 +25,7 @@ import { getRecommendationsService } from "../../campaign/CampaignService";
25
25
  import { imageSearchState } from "../../store/imageSearch.store";
26
26
  import { SlotSkeleton } from "../customized-slots";
27
27
  import { createTrackingApi } from "../../openApi";
28
- import { createWidgetVprEvent, createWidgetVpcEvent, createProductVpcEventByType, createProductVprEventByType, createAddToBasketVpcEvent, createAddToBasketVprEvent, } from "../../tracking";
28
+ import { createWidgetVprEvent, createWidgetVpcEvent, createProductVpcEventByType, createProductVprEventByType, createAddToBasketVpcEvent, createAddToBasketVprEvent, createResultVpcEventByType, createResultVprEventByType, } from "../../tracking";
29
29
  import { checkEmpryString } from "../../utils/option/option";
30
30
  import { parseExcluded } from "../../utils/collections/collectionsUtils";
31
31
  import { resources } from "../../locale/resources-vpr";
@@ -101,9 +101,15 @@ export class VviinnVprWidget {
101
101
  widgetVersion: version,
102
102
  };
103
103
  }
104
- handleOpenLink(deeplink) {
105
- if (this.productDetailNewTab) {
106
- window.open(deeplink);
104
+ handleOpenLink(deeplink, event) {
105
+ if (this.productDetailNewTab || event.ctrlKey || event.metaKey) {
106
+ let newTab = window.open();
107
+ if (newTab) {
108
+ newTab.location.href = deeplink;
109
+ }
110
+ else {
111
+ window.location.href = deeplink;
112
+ }
107
113
  }
108
114
  else {
109
115
  window.location.href = deeplink;
@@ -177,6 +183,7 @@ export class VviinnVprWidget {
177
183
  if (!this.resultViewed) {
178
184
  this.resultViewed = true;
179
185
  this.vviinnResultView.emit(this.getBasicEventData());
186
+ this.trackResultEvent("view");
180
187
  }
181
188
  const productViewEvent = this.getProductTrackEvent(detail, "view");
182
189
  if (!productViewEvent)
@@ -186,7 +193,8 @@ export class VviinnVprWidget {
186
193
  .then(this.setTrackingDeactivated);
187
194
  }
188
195
  async trackProductClick({ detail }) {
189
- const product = this.recommendations.find((r) => r.productId === detail.productId);
196
+ const { productId, clickEvent } = detail;
197
+ const product = this.recommendations.find((r) => r.productId === productId);
190
198
  if (!product || !product.deeplink)
191
199
  return;
192
200
  const productClickEvent = this.getProductTrackEvent(detail, "click");
@@ -195,11 +203,11 @@ export class VviinnVprWidget {
195
203
  .trackEvent(productClickEvent)
196
204
  .then(this.setTrackingDeactivated)
197
205
  .finally(() => {
198
- this.handleOpenLink(product.deeplink);
206
+ this.handleOpenLink(product.deeplink, clickEvent);
199
207
  });
200
208
  }
201
209
  else {
202
- this.handleOpenLink(product.deeplink);
210
+ this.handleOpenLink(product.deeplink, clickEvent);
203
211
  }
204
212
  }
205
213
  async trackAddToBasket({ detail }) {
@@ -230,10 +238,24 @@ export class VviinnVprWidget {
230
238
  }
231
239
  this.trackingApi.trackEvent(widgetEvent).then(this.setTrackingDeactivated);
232
240
  }
241
+ trackResultEvent(type) {
242
+ if (this.trackingDeactivated)
243
+ return;
244
+ const _a = this.getBasicEventData(), { campaignTypeId, widgetType } = _a, rest = __rest(_a, ["campaignTypeId", "widgetType"]);
245
+ let resultEvent;
246
+ const eventBody = Object.assign({ session_id: this.uiSessionId }, rest);
247
+ if (this.campaignType === "VCS") {
248
+ resultEvent = createResultVpcEventByType(type)(eventBody);
249
+ }
250
+ else if (this.campaignType === "VPR") {
251
+ resultEvent = createResultVprEventByType(type)(eventBody);
252
+ }
253
+ this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
254
+ }
233
255
  getProductTrackEvent(detail, eventType) {
234
256
  if (this.trackingDeactivated)
235
257
  return null;
236
- const { productRank, productId, campaignTypeId, widgetType } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType"]);
258
+ const { productRank, productId, campaignTypeId, widgetType, clickEvent } = detail, rest = __rest(detail, ["productRank", "productId", "campaignTypeId", "widgetType", "clickEvent"]);
237
259
  let productEvent;
238
260
  const eventBody = Object.assign({ session_id: this.uiSessionId, rank: productRank, product: productId }, rest);
239
261
  if (campaignTypeId === "VCS") {
@@ -263,6 +285,7 @@ export class VviinnVprWidget {
263
285
  handleRecommendationsSuccess(data) {
264
286
  var _a;
265
287
  this.vviinnResultLoad.emit(this.getBasicEventData());
288
+ this.trackResultEvent("load");
266
289
  this.recommendations = (_a = data === null || data === void 0 ? void 0 : data.extended) !== null && _a !== void 0 ? _a : data;
267
290
  imageSearchState.results = this.recommendations;
268
291
  this.productIds = this.recommendations.map((r) => r.productId);
@@ -855,7 +878,7 @@ export class VviinnVprWidget {
855
878
  },
856
879
  "complexType": {
857
880
  "original": "ProductCardEventData",
858
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
881
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
859
882
  "references": {
860
883
  "ProductCardEventData": {
861
884
  "location": "import",
@@ -875,7 +898,7 @@ export class VviinnVprWidget {
875
898
  },
876
899
  "complexType": {
877
900
  "original": "ProductCardEventData",
878
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
901
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
879
902
  "references": {
880
903
  "ProductCardEventData": {
881
904
  "location": "import",
@@ -895,7 +918,7 @@ export class VviinnVprWidget {
895
918
  },
896
919
  "complexType": {
897
920
  "original": "ProductCardEventData",
898
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
921
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
899
922
  "references": {
900
923
  "ProductCardEventData": {
901
924
  "location": "import",
@@ -379,7 +379,7 @@ export class VviinnVpsButton {
379
379
  },
380
380
  "complexType": {
381
381
  "original": "ProductCardEventData",
382
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
382
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
383
383
  "references": {
384
384
  "ProductCardEventData": {
385
385
  "location": "import",
@@ -399,7 +399,7 @@ export class VviinnVpsButton {
399
399
  },
400
400
  "complexType": {
401
401
  "original": "ProductCardEventData",
402
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
402
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
403
403
  "references": {
404
404
  "ProductCardEventData": {
405
405
  "location": "import",
@@ -419,7 +419,7 @@ export class VviinnVpsButton {
419
419
  },
420
420
  "complexType": {
421
421
  "original": "ProductCardEventData",
422
- "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; }",
422
+ "resolved": "{ widgetType: \"VPR\" | \"VPS\"; campaignTypeId: \"VPR\" | \"VPS\" | \"VCS\"; campaignTypeName: \"Similar Products\" | \"Visual Search\" | \"Cross-Selling\"; widgetId: string; widgetVersion: string; productId: string; productRank: number; productName: string; productType: string; clickEvent?: MouseEvent; }",
423
423
  "references": {
424
424
  "ProductCardEventData": {
425
425
  "location": "import",