@getlupa/client 1.15.14 → 1.15.16

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.
@@ -7351,6 +7351,7 @@ var __async = (__this, __arguments, generator) => {
7351
7351
  );
7352
7352
  const trackingOptions = ref({});
7353
7353
  const searchResultInitialFilters = ref({});
7354
+ const productRecommendationOptions = ref({});
7354
7355
  const screenStore = useScreenStore();
7355
7356
  const envOptions = computed(
7356
7357
  () => {
@@ -7411,6 +7412,11 @@ var __async = (__this, __arguments, generator) => {
7411
7412
  const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
7412
7413
  searchResultInitialFilters.value = initialFilters2;
7413
7414
  };
7415
+ const setProductRecommendationOptions = ({
7416
+ options
7417
+ }) => {
7418
+ productRecommendationOptions.value = options;
7419
+ };
7414
7420
  const getQueryParamName = (param) => {
7415
7421
  var _a;
7416
7422
  const nameMap = searchBoxOptions.value.queryParameterNames;
@@ -7427,10 +7433,12 @@ var __async = (__this, __arguments, generator) => {
7427
7433
  searchResultsRoutingBehavior,
7428
7434
  defaultSearchResultPageSize,
7429
7435
  currentResolutionPageSizes,
7436
+ productRecommendationOptions,
7430
7437
  setSearchBoxOptions,
7431
7438
  setTrackingOptions,
7432
7439
  setSearchResultOptions,
7433
7440
  setInitialFilters,
7441
+ setProductRecommendationOptions,
7434
7442
  getQueryParamName
7435
7443
  };
7436
7444
  });
@@ -7518,7 +7526,7 @@ var __async = (__this, __arguments, generator) => {
7518
7526
  return void 0;
7519
7527
  }
7520
7528
  };
7521
- const initTracking = (options) => {
7529
+ const initTracking$1 = (options) => {
7522
7530
  initBaseTracking(Boolean(options.trackBase));
7523
7531
  if (options.trackSession) {
7524
7532
  initSessionTracking();
@@ -7560,7 +7568,9 @@ var __async = (__this, __arguments, generator) => {
7560
7568
  name: data.type,
7561
7569
  userId: getUserKey(),
7562
7570
  sessionId: getSessionKey(),
7563
- filters: data.filters
7571
+ filters: data.filters,
7572
+ metadata: data.metadata,
7573
+ sourceItemId: data.sourceItemId
7564
7574
  };
7565
7575
  LupaSearchSdk.track(queryKey, eventData, options);
7566
7576
  };
@@ -24273,7 +24283,8 @@ and ensure you are accounting for this risk.
24273
24283
  options: {},
24274
24284
  isAdditionalPanel: { type: Boolean },
24275
24285
  clickTrackingSettings: {},
24276
- lupaClickTrackingType: {}
24286
+ lupaClickTrackingType: {},
24287
+ sourceItemId: {}
24277
24288
  },
24278
24289
  setup(__props) {
24279
24290
  const props = __props;
@@ -24286,7 +24297,7 @@ and ensure you are accounting for this risk.
24286
24297
  const paramsStore = useParamsStore();
24287
24298
  const trackingStore = useTrackingStore();
24288
24299
  const { layout } = storeToRefs(searchResultStore);
24289
- const { searchResultsRoutingBehavior, searchResultOptions, trackingOptions } = storeToRefs(optionsStore);
24300
+ const { searchResultsRoutingBehavior, searchResultOptions, productRecommendationOptions } = storeToRefs(optionsStore);
24290
24301
  const { query } = storeToRefs(paramsStore);
24291
24302
  const isInStock = ref(true);
24292
24303
  const listLayoutClass = computed(() => {
@@ -24383,7 +24394,8 @@ and ensure you are accounting for this risk.
24383
24394
  itemId: id.value
24384
24395
  },
24385
24396
  options: { allowEmptySearchQuery: true },
24386
- filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
24397
+ filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0,
24398
+ sourceItemId: props.lupaClickTrackingType === "recommendedItemClick" ? props.sourceItemId : void 0
24387
24399
  }
24388
24400
  };
24389
24401
  if (isDelayedClickTracking()) {
@@ -32192,6 +32204,9 @@ and ensure you are accounting for this risk.
32192
32204
  optionsStore.setSearchResultOptions({
32193
32205
  options: props.options
32194
32206
  });
32207
+ optionsStore.setProductRecommendationOptions({
32208
+ options: props.options
32209
+ });
32195
32210
  if (props.options.lazyLoad) {
32196
32211
  initIntersectionObserver();
32197
32212
  } else {
@@ -32296,8 +32311,10 @@ and ensure you are accounting for this risk.
32296
32311
  createVNode(_sfc_main$p, {
32297
32312
  product,
32298
32313
  options: _ctx.options,
32299
- "click-tracking-settings": clickTrackingSettings.value
32300
- }, null, 8, ["product", "options", "click-tracking-settings"])
32314
+ "click-tracking-settings": clickTrackingSettings.value,
32315
+ "lupa-click-tracking-type": `recommendedItemClick`,
32316
+ "source-item-id": itemId.value
32317
+ }, null, 8, ["product", "options", "click-tracking-settings", "source-item-id"])
32301
32318
  ]),
32302
32319
  _: 2
32303
32320
  }, 1024);
@@ -32311,8 +32328,9 @@ and ensure you are accounting for this risk.
32311
32328
  key: getProductKeyAction(index, product),
32312
32329
  product,
32313
32330
  options: _ctx.options,
32314
- "lupa-click-tracking-type": `recommendedItemClick`
32315
- }, null, 8, ["style", "product", "options"]);
32331
+ "lupa-click-tracking-type": `recommendedItemClick`,
32332
+ "source-item-id": itemId.value
32333
+ }, null, 8, ["style", "product", "options", "source-item-id"]);
32316
32334
  }), 128))
32317
32335
  ]))
32318
32336
  ])) : createCommentVNode("", true)
@@ -33050,7 +33068,7 @@ and ensure you are accounting for this risk.
33050
33068
  const setupTracking = (options) => {
33051
33069
  const pinia = initPinia();
33052
33070
  const store = useOptionsStore(pinia);
33053
- initTracking(options);
33071
+ initTracking$1(options);
33054
33072
  store.setTrackingOptions({ options });
33055
33073
  };
33056
33074
  const displayDiscountedPriceSection = (doc2, options) => {
@@ -39925,6 +39943,16 @@ and ensure you are accounting for this risk.
39925
39943
  { fetch: fetch2, allowedMountUrls }
39926
39944
  );
39927
39945
  });
39946
+ const initTracking = (configuration) => __async(this, null, function* () {
39947
+ let trackingOptions = { trackBase: false };
39948
+ if (configuration.tracking) {
39949
+ const resolvedConfiguration = JSON.parse(configuration.tracking);
39950
+ if (resolvedConfiguration.trackBase) {
39951
+ trackingOptions = resolvedConfiguration;
39952
+ }
39953
+ }
39954
+ setupTracking(trackingOptions);
39955
+ });
39928
39956
  const mount = (_0, ..._1) => __async(this, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
39929
39957
  yield applyStyles(configuration);
39930
39958
  const mountPromises = [
@@ -39935,6 +39963,7 @@ and ensure you are accounting for this risk.
39935
39963
  mountChat(configuration, options, fetch2, remount)
39936
39964
  ];
39937
39965
  yield Promise.all(mountPromises);
39966
+ initTracking(configuration);
39938
39967
  });
39939
39968
  const init$1 = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
39940
39969
  var _a;
@@ -7351,6 +7351,7 @@ const useOptionsStore = defineStore("options", () => {
7351
7351
  );
7352
7352
  const trackingOptions = ref({});
7353
7353
  const searchResultInitialFilters = ref({});
7354
+ const productRecommendationOptions = ref({});
7354
7355
  const screenStore = useScreenStore();
7355
7356
  const envOptions = computed(
7356
7357
  () => {
@@ -7411,6 +7412,11 @@ const useOptionsStore = defineStore("options", () => {
7411
7412
  const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
7412
7413
  searchResultInitialFilters.value = initialFilters2;
7413
7414
  };
7415
+ const setProductRecommendationOptions = ({
7416
+ options
7417
+ }) => {
7418
+ productRecommendationOptions.value = options;
7419
+ };
7414
7420
  const getQueryParamName = (param) => {
7415
7421
  var _a;
7416
7422
  const nameMap = searchBoxOptions.value.queryParameterNames;
@@ -7427,10 +7433,12 @@ const useOptionsStore = defineStore("options", () => {
7427
7433
  searchResultsRoutingBehavior,
7428
7434
  defaultSearchResultPageSize,
7429
7435
  currentResolutionPageSizes,
7436
+ productRecommendationOptions,
7430
7437
  setSearchBoxOptions,
7431
7438
  setTrackingOptions,
7432
7439
  setSearchResultOptions,
7433
7440
  setInitialFilters,
7441
+ setProductRecommendationOptions,
7434
7442
  getQueryParamName
7435
7443
  };
7436
7444
  });
@@ -7518,7 +7526,7 @@ const getUserKey = () => {
7518
7526
  return void 0;
7519
7527
  }
7520
7528
  };
7521
- const initTracking = (options) => {
7529
+ const initTracking$1 = (options) => {
7522
7530
  initBaseTracking(Boolean(options.trackBase));
7523
7531
  if (options.trackSession) {
7524
7532
  initSessionTracking();
@@ -7560,7 +7568,9 @@ const trackLupaEvent = (queryKey, data = {}, options) => {
7560
7568
  name: data.type,
7561
7569
  userId: getUserKey(),
7562
7570
  sessionId: getSessionKey(),
7563
- filters: data.filters
7571
+ filters: data.filters,
7572
+ metadata: data.metadata,
7573
+ sourceItemId: data.sourceItemId
7564
7574
  };
7565
7575
  LupaSearchSdk.track(queryKey, eventData, options);
7566
7576
  };
@@ -24273,7 +24283,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24273
24283
  options: {},
24274
24284
  isAdditionalPanel: { type: Boolean },
24275
24285
  clickTrackingSettings: {},
24276
- lupaClickTrackingType: {}
24286
+ lupaClickTrackingType: {},
24287
+ sourceItemId: {}
24277
24288
  },
24278
24289
  setup(__props) {
24279
24290
  const props = __props;
@@ -24286,7 +24297,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24286
24297
  const paramsStore = useParamsStore();
24287
24298
  const trackingStore = useTrackingStore();
24288
24299
  const { layout } = storeToRefs(searchResultStore);
24289
- const { searchResultsRoutingBehavior, searchResultOptions, trackingOptions } = storeToRefs(optionsStore);
24300
+ const { searchResultsRoutingBehavior, searchResultOptions, productRecommendationOptions } = storeToRefs(optionsStore);
24290
24301
  const { query } = storeToRefs(paramsStore);
24291
24302
  const isInStock = ref(true);
24292
24303
  const listLayoutClass = computed(() => {
@@ -24383,7 +24394,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24383
24394
  itemId: id.value
24384
24395
  },
24385
24396
  options: { allowEmptySearchQuery: true },
24386
- filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
24397
+ filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0,
24398
+ sourceItemId: props.lupaClickTrackingType === "recommendedItemClick" ? props.sourceItemId : void 0
24387
24399
  }
24388
24400
  };
24389
24401
  if (isDelayedClickTracking()) {
@@ -32192,6 +32204,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32192
32204
  optionsStore.setSearchResultOptions({
32193
32205
  options: props.options
32194
32206
  });
32207
+ optionsStore.setProductRecommendationOptions({
32208
+ options: props.options
32209
+ });
32195
32210
  if (props.options.lazyLoad) {
32196
32211
  initIntersectionObserver();
32197
32212
  } else {
@@ -32296,8 +32311,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32296
32311
  createVNode(_sfc_main$p, {
32297
32312
  product,
32298
32313
  options: _ctx.options,
32299
- "click-tracking-settings": clickTrackingSettings.value
32300
- }, null, 8, ["product", "options", "click-tracking-settings"])
32314
+ "click-tracking-settings": clickTrackingSettings.value,
32315
+ "lupa-click-tracking-type": `recommendedItemClick`,
32316
+ "source-item-id": itemId.value
32317
+ }, null, 8, ["product", "options", "click-tracking-settings", "source-item-id"])
32301
32318
  ]),
32302
32319
  _: 2
32303
32320
  }, 1024);
@@ -32311,8 +32328,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32311
32328
  key: getProductKeyAction(index, product),
32312
32329
  product,
32313
32330
  options: _ctx.options,
32314
- "lupa-click-tracking-type": `recommendedItemClick`
32315
- }, null, 8, ["style", "product", "options"]);
32331
+ "lupa-click-tracking-type": `recommendedItemClick`,
32332
+ "source-item-id": itemId.value
32333
+ }, null, 8, ["style", "product", "options", "source-item-id"]);
32316
32334
  }), 128))
32317
32335
  ]))
32318
32336
  ])) : createCommentVNode("", true)
@@ -33050,7 +33068,7 @@ const initPinia = () => {
33050
33068
  const setupTracking = (options) => {
33051
33069
  const pinia = initPinia();
33052
33070
  const store = useOptionsStore(pinia);
33053
- initTracking(options);
33071
+ initTracking$1(options);
33054
33072
  store.setTrackingOptions({ options });
33055
33073
  };
33056
33074
  const displayDiscountedPriceSection = (doc2, options) => {
@@ -39925,6 +39943,16 @@ const mountChat = (configuration, options, fetch2 = true, remount = false) => __
39925
39943
  { fetch: fetch2, allowedMountUrls }
39926
39944
  );
39927
39945
  });
39946
+ const initTracking = (configuration) => __async(exports, null, function* () {
39947
+ let trackingOptions = { trackBase: false };
39948
+ if (configuration.tracking) {
39949
+ const resolvedConfiguration = JSON.parse(configuration.tracking);
39950
+ if (resolvedConfiguration.trackBase) {
39951
+ trackingOptions = resolvedConfiguration;
39952
+ }
39953
+ }
39954
+ setupTracking(trackingOptions);
39955
+ });
39928
39956
  const mount = (_0, ..._1) => __async(exports, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
39929
39957
  yield applyStyles(configuration);
39930
39958
  const mountPromises = [
@@ -39935,6 +39963,7 @@ const mount = (_0, ..._1) => __async(exports, [_0, ..._1], function* (configurat
39935
39963
  mountChat(configuration, options, fetch2, remount)
39936
39964
  ];
39937
39965
  yield Promise.all(mountPromises);
39966
+ initTracking(configuration);
39938
39967
  });
39939
39968
  const init$1 = (_0, ..._1) => __async(exports, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
39940
39969
  var _a;
@@ -7349,6 +7349,7 @@ const useOptionsStore = defineStore("options", () => {
7349
7349
  );
7350
7350
  const trackingOptions = ref({});
7351
7351
  const searchResultInitialFilters = ref({});
7352
+ const productRecommendationOptions = ref({});
7352
7353
  const screenStore = useScreenStore();
7353
7354
  const envOptions = computed(
7354
7355
  () => {
@@ -7409,6 +7410,11 @@ const useOptionsStore = defineStore("options", () => {
7409
7410
  const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
7410
7411
  searchResultInitialFilters.value = initialFilters2;
7411
7412
  };
7413
+ const setProductRecommendationOptions = ({
7414
+ options
7415
+ }) => {
7416
+ productRecommendationOptions.value = options;
7417
+ };
7412
7418
  const getQueryParamName = (param) => {
7413
7419
  var _a;
7414
7420
  const nameMap = searchBoxOptions.value.queryParameterNames;
@@ -7425,10 +7431,12 @@ const useOptionsStore = defineStore("options", () => {
7425
7431
  searchResultsRoutingBehavior,
7426
7432
  defaultSearchResultPageSize,
7427
7433
  currentResolutionPageSizes,
7434
+ productRecommendationOptions,
7428
7435
  setSearchBoxOptions,
7429
7436
  setTrackingOptions,
7430
7437
  setSearchResultOptions,
7431
7438
  setInitialFilters,
7439
+ setProductRecommendationOptions,
7432
7440
  getQueryParamName
7433
7441
  };
7434
7442
  });
@@ -7516,7 +7524,7 @@ const getUserKey = () => {
7516
7524
  return void 0;
7517
7525
  }
7518
7526
  };
7519
- const initTracking = (options) => {
7527
+ const initTracking$1 = (options) => {
7520
7528
  initBaseTracking(Boolean(options.trackBase));
7521
7529
  if (options.trackSession) {
7522
7530
  initSessionTracking();
@@ -7558,7 +7566,9 @@ const trackLupaEvent = (queryKey, data = {}, options) => {
7558
7566
  name: data.type,
7559
7567
  userId: getUserKey(),
7560
7568
  sessionId: getSessionKey(),
7561
- filters: data.filters
7569
+ filters: data.filters,
7570
+ metadata: data.metadata,
7571
+ sourceItemId: data.sourceItemId
7562
7572
  };
7563
7573
  LupaSearchSdk.track(queryKey, eventData, options);
7564
7574
  };
@@ -24271,7 +24281,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24271
24281
  options: {},
24272
24282
  isAdditionalPanel: { type: Boolean },
24273
24283
  clickTrackingSettings: {},
24274
- lupaClickTrackingType: {}
24284
+ lupaClickTrackingType: {},
24285
+ sourceItemId: {}
24275
24286
  },
24276
24287
  setup(__props) {
24277
24288
  const props = __props;
@@ -24284,7 +24295,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24284
24295
  const paramsStore = useParamsStore();
24285
24296
  const trackingStore = useTrackingStore();
24286
24297
  const { layout } = storeToRefs(searchResultStore);
24287
- const { searchResultsRoutingBehavior, searchResultOptions, trackingOptions } = storeToRefs(optionsStore);
24298
+ const { searchResultsRoutingBehavior, searchResultOptions, productRecommendationOptions } = storeToRefs(optionsStore);
24288
24299
  const { query } = storeToRefs(paramsStore);
24289
24300
  const isInStock = ref(true);
24290
24301
  const listLayoutClass = computed(() => {
@@ -24381,7 +24392,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
24381
24392
  itemId: id.value
24382
24393
  },
24383
24394
  options: { allowEmptySearchQuery: true },
24384
- filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
24395
+ filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0,
24396
+ sourceItemId: props.lupaClickTrackingType === "recommendedItemClick" ? props.sourceItemId : void 0
24385
24397
  }
24386
24398
  };
24387
24399
  if (isDelayedClickTracking()) {
@@ -32190,6 +32202,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32190
32202
  optionsStore.setSearchResultOptions({
32191
32203
  options: props.options
32192
32204
  });
32205
+ optionsStore.setProductRecommendationOptions({
32206
+ options: props.options
32207
+ });
32193
32208
  if (props.options.lazyLoad) {
32194
32209
  initIntersectionObserver();
32195
32210
  } else {
@@ -32294,8 +32309,10 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32294
32309
  createVNode(_sfc_main$p, {
32295
32310
  product,
32296
32311
  options: _ctx.options,
32297
- "click-tracking-settings": clickTrackingSettings.value
32298
- }, null, 8, ["product", "options", "click-tracking-settings"])
32312
+ "click-tracking-settings": clickTrackingSettings.value,
32313
+ "lupa-click-tracking-type": `recommendedItemClick`,
32314
+ "source-item-id": itemId.value
32315
+ }, null, 8, ["product", "options", "click-tracking-settings", "source-item-id"])
32299
32316
  ]),
32300
32317
  _: 2
32301
32318
  }, 1024);
@@ -32309,8 +32326,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
32309
32326
  key: getProductKeyAction(index, product),
32310
32327
  product,
32311
32328
  options: _ctx.options,
32312
- "lupa-click-tracking-type": `recommendedItemClick`
32313
- }, null, 8, ["style", "product", "options"]);
32329
+ "lupa-click-tracking-type": `recommendedItemClick`,
32330
+ "source-item-id": itemId.value
32331
+ }, null, 8, ["style", "product", "options", "source-item-id"]);
32314
32332
  }), 128))
32315
32333
  ]))
32316
32334
  ])) : createCommentVNode("", true)
@@ -33048,7 +33066,7 @@ const initPinia = () => {
33048
33066
  const setupTracking = (options) => {
33049
33067
  const pinia = initPinia();
33050
33068
  const store = useOptionsStore(pinia);
33051
- initTracking(options);
33069
+ initTracking$1(options);
33052
33070
  store.setTrackingOptions({ options });
33053
33071
  };
33054
33072
  const displayDiscountedPriceSection = (doc2, options) => {
@@ -39923,6 +39941,16 @@ const mountChat = (configuration, options, fetch2 = true, remount = false) => __
39923
39941
  { fetch: fetch2, allowedMountUrls }
39924
39942
  );
39925
39943
  });
39944
+ const initTracking = (configuration) => __async(void 0, null, function* () {
39945
+ let trackingOptions = { trackBase: false };
39946
+ if (configuration.tracking) {
39947
+ const resolvedConfiguration = JSON.parse(configuration.tracking);
39948
+ if (resolvedConfiguration.trackBase) {
39949
+ trackingOptions = resolvedConfiguration;
39950
+ }
39951
+ }
39952
+ setupTracking(trackingOptions);
39953
+ });
39926
39954
  const mount = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
39927
39955
  yield applyStyles(configuration);
39928
39956
  const mountPromises = [
@@ -39933,6 +39961,7 @@ const mount = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (configurati
39933
39961
  mountChat(configuration, options, fetch2, remount)
39934
39962
  ];
39935
39963
  yield Promise.all(mountPromises);
39964
+ initTracking(configuration);
39936
39965
  });
39937
39966
  const init$1 = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
39938
39967
  var _a;
@@ -7353,6 +7353,7 @@ var __async = (__this, __arguments, generator) => {
7353
7353
  );
7354
7354
  const trackingOptions = ref({});
7355
7355
  const searchResultInitialFilters = ref({});
7356
+ const productRecommendationOptions = ref({});
7356
7357
  const screenStore = useScreenStore();
7357
7358
  const envOptions = computed(
7358
7359
  () => {
@@ -7413,6 +7414,11 @@ var __async = (__this, __arguments, generator) => {
7413
7414
  const setInitialFilters = ({ initialFilters: initialFilters2 }) => {
7414
7415
  searchResultInitialFilters.value = initialFilters2;
7415
7416
  };
7417
+ const setProductRecommendationOptions = ({
7418
+ options
7419
+ }) => {
7420
+ productRecommendationOptions.value = options;
7421
+ };
7416
7422
  const getQueryParamName = (param) => {
7417
7423
  var _a;
7418
7424
  const nameMap = searchBoxOptions.value.queryParameterNames;
@@ -7429,10 +7435,12 @@ var __async = (__this, __arguments, generator) => {
7429
7435
  searchResultsRoutingBehavior,
7430
7436
  defaultSearchResultPageSize,
7431
7437
  currentResolutionPageSizes,
7438
+ productRecommendationOptions,
7432
7439
  setSearchBoxOptions,
7433
7440
  setTrackingOptions,
7434
7441
  setSearchResultOptions,
7435
7442
  setInitialFilters,
7443
+ setProductRecommendationOptions,
7436
7444
  getQueryParamName
7437
7445
  };
7438
7446
  });
@@ -7520,7 +7528,7 @@ var __async = (__this, __arguments, generator) => {
7520
7528
  return void 0;
7521
7529
  }
7522
7530
  };
7523
- const initTracking = (options) => {
7531
+ const initTracking$1 = (options) => {
7524
7532
  initBaseTracking(Boolean(options.trackBase));
7525
7533
  if (options.trackSession) {
7526
7534
  initSessionTracking();
@@ -7562,7 +7570,9 @@ var __async = (__this, __arguments, generator) => {
7562
7570
  name: data.type,
7563
7571
  userId: getUserKey(),
7564
7572
  sessionId: getSessionKey(),
7565
- filters: data.filters
7573
+ filters: data.filters,
7574
+ metadata: data.metadata,
7575
+ sourceItemId: data.sourceItemId
7566
7576
  };
7567
7577
  LupaSearchSdk.track(queryKey, eventData, options);
7568
7578
  };
@@ -24275,7 +24285,8 @@ and ensure you are accounting for this risk.
24275
24285
  options: {},
24276
24286
  isAdditionalPanel: { type: Boolean },
24277
24287
  clickTrackingSettings: {},
24278
- lupaClickTrackingType: {}
24288
+ lupaClickTrackingType: {},
24289
+ sourceItemId: {}
24279
24290
  },
24280
24291
  setup(__props) {
24281
24292
  const props = __props;
@@ -24288,7 +24299,7 @@ and ensure you are accounting for this risk.
24288
24299
  const paramsStore = useParamsStore();
24289
24300
  const trackingStore = useTrackingStore();
24290
24301
  const { layout } = storeToRefs(searchResultStore);
24291
- const { searchResultsRoutingBehavior, searchResultOptions, trackingOptions } = storeToRefs(optionsStore);
24302
+ const { searchResultsRoutingBehavior, searchResultOptions, productRecommendationOptions } = storeToRefs(optionsStore);
24292
24303
  const { query } = storeToRefs(paramsStore);
24293
24304
  const isInStock = ref(true);
24294
24305
  const listLayoutClass = computed(() => {
@@ -24385,7 +24396,8 @@ and ensure you are accounting for this risk.
24385
24396
  itemId: id.value
24386
24397
  },
24387
24398
  options: { allowEmptySearchQuery: true },
24388
- filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0
24399
+ filters: searchResultStore.hasAnyFilter ? searchResultStore.filters : void 0,
24400
+ sourceItemId: props.lupaClickTrackingType === "recommendedItemClick" ? props.sourceItemId : void 0
24389
24401
  }
24390
24402
  };
24391
24403
  if (isDelayedClickTracking()) {
@@ -32194,6 +32206,9 @@ and ensure you are accounting for this risk.
32194
32206
  optionsStore.setSearchResultOptions({
32195
32207
  options: props.options
32196
32208
  });
32209
+ optionsStore.setProductRecommendationOptions({
32210
+ options: props.options
32211
+ });
32197
32212
  if (props.options.lazyLoad) {
32198
32213
  initIntersectionObserver();
32199
32214
  } else {
@@ -32298,8 +32313,10 @@ and ensure you are accounting for this risk.
32298
32313
  createVNode(_sfc_main$p, {
32299
32314
  product,
32300
32315
  options: _ctx.options,
32301
- "click-tracking-settings": clickTrackingSettings.value
32302
- }, null, 8, ["product", "options", "click-tracking-settings"])
32316
+ "click-tracking-settings": clickTrackingSettings.value,
32317
+ "lupa-click-tracking-type": `recommendedItemClick`,
32318
+ "source-item-id": itemId.value
32319
+ }, null, 8, ["product", "options", "click-tracking-settings", "source-item-id"])
32303
32320
  ]),
32304
32321
  _: 2
32305
32322
  }, 1024);
@@ -32313,8 +32330,9 @@ and ensure you are accounting for this risk.
32313
32330
  key: getProductKeyAction(index, product),
32314
32331
  product,
32315
32332
  options: _ctx.options,
32316
- "lupa-click-tracking-type": `recommendedItemClick`
32317
- }, null, 8, ["style", "product", "options"]);
32333
+ "lupa-click-tracking-type": `recommendedItemClick`,
32334
+ "source-item-id": itemId.value
32335
+ }, null, 8, ["style", "product", "options", "source-item-id"]);
32318
32336
  }), 128))
32319
32337
  ]))
32320
32338
  ])) : createCommentVNode("", true)
@@ -33052,7 +33070,7 @@ and ensure you are accounting for this risk.
33052
33070
  const setupTracking = (options) => {
33053
33071
  const pinia = initPinia();
33054
33072
  const store = useOptionsStore(pinia);
33055
- initTracking(options);
33073
+ initTracking$1(options);
33056
33074
  store.setTrackingOptions({ options });
33057
33075
  };
33058
33076
  const displayDiscountedPriceSection = (doc2, options) => {
@@ -39927,6 +39945,16 @@ and ensure you are accounting for this risk.
39927
39945
  { fetch: fetch2, allowedMountUrls }
39928
39946
  );
39929
39947
  });
39948
+ const initTracking = (configuration) => __async(this, null, function* () {
39949
+ let trackingOptions = { trackBase: false };
39950
+ if (configuration.tracking) {
39951
+ const resolvedConfiguration = JSON.parse(configuration.tracking);
39952
+ if (resolvedConfiguration.trackBase) {
39953
+ trackingOptions = resolvedConfiguration;
39954
+ }
39955
+ }
39956
+ setupTracking(trackingOptions);
39957
+ });
39930
39958
  const mount = (_0, ..._1) => __async(this, [_0, ..._1], function* (configuration, options = { environment: "production" }, optionOverrides = {}, fetch2 = true, remount = false) {
39931
39959
  yield applyStyles(configuration);
39932
39960
  const mountPromises = [
@@ -39937,6 +39965,7 @@ and ensure you are accounting for this risk.
39937
39965
  mountChat(configuration, options, fetch2, remount)
39938
39966
  ];
39939
39967
  yield Promise.all(mountPromises);
39968
+ initTracking(configuration);
39940
39969
  });
39941
39970
  const init$1 = (_0, ..._1) => __async(this, [_0, ..._1], function* (configurationKey, options = { environment: "production" }, optionOverrides = {}) {
39942
39971
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.15.14",
3
+ "version": "1.15.16",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.15.14",
23
+ "@getlupa/vue": "0.15.16",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",