pb-sxp-ui 1.20.2 → 1.20.4

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 (45) hide show
  1. package/dist/index.cjs +379 -123
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +379 -123
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.cjs +7 -7
  6. package/dist/index.min.cjs.map +1 -1
  7. package/dist/index.min.js +7 -7
  8. package/dist/index.min.js.map +1 -1
  9. package/dist/pb-ui.js +379 -123
  10. package/dist/pb-ui.js.map +1 -1
  11. package/dist/pb-ui.min.js +7 -7
  12. package/dist/pb-ui.min.js.map +1 -1
  13. package/es/core/components/SxpPageRender/LikeButton/index.js +12 -4
  14. package/es/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  15. package/es/core/components/SxpPageRender/WaterFall/List.js +12 -22
  16. package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +6 -4
  17. package/es/core/components/SxpPageRender/WaterFall/index.js +6 -2
  18. package/es/core/components/SxpPageRender/index.js +62 -16
  19. package/es/core/context/SxpDataSourceProvider.d.ts +8 -3
  20. package/es/core/context/SxpDataSourceProvider.js +63 -43
  21. package/es/core/utils/tool.d.ts +2 -1
  22. package/es/core/utils/tool.js +15 -1
  23. package/es/materials/sxp/cta/AniLink/index.js +18 -7
  24. package/es/materials/sxp/cta/AniLinkPopup/index.js +21 -10
  25. package/es/materials/sxp/popup/CommodityDetail/index.js +59 -2
  26. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +60 -3
  27. package/es/materials/sxp/popup/CommodityList/index.js +21 -5
  28. package/es/materials/sxp/template/components/EventProvider.js +22 -10
  29. package/lib/core/components/SxpPageRender/LikeButton/index.js +12 -4
  30. package/lib/core/components/SxpPageRender/VideoWidget/index.js +6 -2
  31. package/lib/core/components/SxpPageRender/WaterFall/List.js +11 -21
  32. package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +6 -4
  33. package/lib/core/components/SxpPageRender/WaterFall/index.js +6 -2
  34. package/lib/core/components/SxpPageRender/index.js +62 -16
  35. package/lib/core/context/SxpDataSourceProvider.d.ts +8 -3
  36. package/lib/core/context/SxpDataSourceProvider.js +61 -41
  37. package/lib/core/utils/tool.d.ts +2 -1
  38. package/lib/core/utils/tool.js +16 -1
  39. package/lib/materials/sxp/cta/AniLink/index.js +18 -7
  40. package/lib/materials/sxp/cta/AniLinkPopup/index.js +21 -10
  41. package/lib/materials/sxp/popup/CommodityDetail/index.js +59 -2
  42. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +60 -3
  43. package/lib/materials/sxp/popup/CommodityList/index.js +21 -5
  44. package/lib/materials/sxp/template/components/EventProvider.js +22 -10
  45. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -307,6 +307,20 @@ function deleteCookie(name, path = '/', domain = '') {
307
307
  document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
308
308
  console.log(`已尝试删除Cookie: ${name}`);
309
309
  }
310
+ function getUrlParamByKey(key) {
311
+ var _a, _b;
312
+ const queryString = location.search.slice(1);
313
+ const params = {};
314
+ (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
315
+ const key = val.split('=')[0];
316
+ const value = val.split('=')[1];
317
+ params[key] = value;
318
+ });
319
+ for (const key in params) {
320
+ params[key] = params[key].replace(/%2B/g, '+');
321
+ }
322
+ return (_b = params[key]) !== null && _b !== void 0 ? _b : '';
323
+ }
310
324
 
311
325
  function unzip(b64Data) {
312
326
  const strData = atob(b64Data);
@@ -990,7 +1004,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
990
1004
  }
991
1005
  });
992
1006
  };
993
- }, [bffCollectEvent]);
1007
+ }, []);
994
1008
  React.useEffect(() => {
995
1009
  const originalOpen = XMLHttpRequest.prototype.open;
996
1010
  const originalSend = XMLHttpRequest.prototype.send;
@@ -1201,19 +1215,51 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1201
1215
  playbookType,
1202
1216
  bffDataSource
1203
1217
  ]);
1204
- const getEventParamsByJson = React.useCallback((json, product) => {
1205
- var _a, _b, _c;
1218
+ const getEventParamsByJson = React.useCallback((_a) => {
1219
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1220
+ var { json, product = [], rec, contentType = 'post', position, eventName } = _a, props = __rest(_a, ["json", "product", "rec", "contentType", "position", "eventName"]);
1206
1221
  const jsonParams = lodash.cloneDeep(json);
1207
1222
  const urlParams = new URLSearchParams(window.location.search);
1208
1223
  const fbclid = urlParams === null || urlParams === void 0 ? void 0 : urlParams.get('fbclid');
1209
1224
  const fix_par = {
1210
- event_source_url: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href,
1225
+ event_source_url: (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href,
1211
1226
  external_id: fakeUserId,
1212
- client_user_agent: (_c = (_b = window === null || window === void 0 ? void 0 : window.navigator) === null || _b === void 0 ? void 0 : _b.userAgent) !== null && _c !== void 0 ? _c : '',
1227
+ client_user_agent: (_d = (_c = window === null || window === void 0 ? void 0 : window.navigator) === null || _c === void 0 ? void 0 : _c.userAgent) !== null && _d !== void 0 ? _d : '',
1213
1228
  fbc: fbclid ? `fb.2.${new Date().getTime()}.${fbclid}` : '',
1214
1229
  fbp: getCookie('_fbp') ? `${getCookie('_fbp')}` : '',
1215
1230
  time: Math.floor(Date.now() / 1000)
1216
1231
  };
1232
+ let customData = Object.assign({
1233
+ // funnel_type
1234
+ content_ids: [(_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.itemId, ...((_f = product === null || product === void 0 ? void 0 : product.map((item) => item === null || item === void 0 ? void 0 : item.itemId)) !== null && _f !== void 0 ? _f : [])], content_type: contentType, content_name: (_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.title, total_posts: rtcList === null || rtcList === void 0 ? void 0 : rtcList.length, position,
1235
+ // content_category
1236
+ currency: (_h = product === null || product === void 0 ? void 0 : product[0]) === null || _h === void 0 ? void 0 : _h.currency, contents: (_j = product === null || product === void 0 ? void 0 : product.map((item) => ({
1237
+ item_id: item === null || item === void 0 ? void 0 : item.itemId,
1238
+ item_price: item === null || item === void 0 ? void 0 : item.price
1239
+ }))) !== null && _j !== void 0 ? _j : [], image_urls: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.imgUrls) !== null && _l !== void 0 ? _l : [], video_urls: (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.url,
1240
+ // prompt
1241
+ headline: getUrlParamByKey('headline'), scene: getUrlParamByKey('scene'), campaign_id: getUrlParamByKey('campaign_id'), ad_id: getUrlParamByKey('ad_id'), utm_source: getUrlParamByKey('utm_source'), utm_medium: getUrlParamByKey('utm_medium'), utm_campaign: getUrlParamByKey('utm_campaign'), utm_content: getUrlParamByKey('utm_content') }, props);
1242
+ if (!((_o = rec === null || rec === void 0 ? void 0 : rec.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length) && (rec === null || rec === void 0 ? void 0 : rec.product) && Array.isArray(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) && ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost) === null || _r === void 0 ? void 0 : _r.length) > 0) {
1243
+ const product = rec === null || rec === void 0 ? void 0 : rec.product;
1244
+ const productCustomData = {
1245
+ content_ids: [product === null || product === void 0 ? void 0 : product.itemId],
1246
+ content_type: 'product',
1247
+ content_name: '',
1248
+ contents: [{
1249
+ item_id: product === null || product === void 0 ? void 0 : product.itemId,
1250
+ item_price: product === null || product === void 0 ? void 0 : product.price
1251
+ }],
1252
+ image_urls: (_s = product.homePage) !== null && _s !== void 0 ? _s : []
1253
+ };
1254
+ customData = Object.assign(Object.assign({}, customData), productCustomData);
1255
+ }
1256
+ if (eventName === 'ContentSwipe' || eventName === 'Engagement' || eventName === 'ExitFeed') {
1257
+ const deleteKeys = ['content_ids', 'content_category', 'currency', 'contents', 'image_urls', 'video_urls', 'prompt'];
1258
+ deleteKeys.forEach(key => {
1259
+ if (customData === null || customData === void 0 ? void 0 : customData[key])
1260
+ delete customData[key];
1261
+ });
1262
+ }
1217
1263
  const regex = /\{\{(.*?)\}\}/g;
1218
1264
  const getEventParams = (obj) => {
1219
1265
  if (!obj)
@@ -1226,6 +1272,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1226
1272
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
1227
1273
  const value = obj === null || obj === void 0 ? void 0 : obj[key];
1228
1274
  if (typeof value === 'object') {
1275
+ if (key === 'custom_data') {
1276
+ obj[key] = customData !== null && customData !== void 0 ? customData : {};
1277
+ }
1229
1278
  getEventParams(value);
1230
1279
  }
1231
1280
  else if (typeof value === 'string') {
@@ -1235,7 +1284,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1235
1284
  var _a;
1236
1285
  const prop = match.substring(2, match.length - 2);
1237
1286
  try {
1238
- let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product);
1287
+ let replaceValue = new Function('fix_par', 'product', `return ${prop}`)(fix_par, product === null || product === void 0 ? void 0 : product[0]);
1239
1288
  if (replaceValue) {
1240
1289
  if ((prop === null || prop === void 0 ? void 0 : prop.indexOf('currency')) !== -1 &&
1241
1290
  (replaceValue === null || replaceValue === void 0 ? void 0 : replaceValue.indexOf('-')) !== -1 &&
@@ -1260,15 +1309,17 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1260
1309
  }
1261
1310
  };
1262
1311
  getEventParams(jsonParams);
1312
+ console.log('capi event params:', jsonParams);
1263
1313
  return jsonParams;
1264
- }, [fakeUserId]);
1265
- const bffFbReport = React.useCallback(({ eventName, product }) => {
1266
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1314
+ }, [fakeUserId, globalConfig, rtcList]);
1315
+ const bffFbReport = React.useCallback((_a) => {
1316
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1317
+ var { eventName } = _a, props = __rest(_a, ["eventName"]);
1267
1318
  if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
1268
1319
  return;
1269
1320
  }
1270
1321
  let isPushState = false;
1271
- const pixelEventParamsJson = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _a === void 0 ? void 0 : _a[eventName];
1322
+ const pixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.pixel) === null || _b === void 0 ? void 0 : _b[eventName];
1272
1323
  if ((pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
1273
1324
  function updateQueryStringParameter(uri, key, value) {
1274
1325
  const re = new RegExp('([?&])' + key + '=.*?(&|$)', 'i');
@@ -1292,39 +1343,39 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1292
1343
  }
1293
1344
  }
1294
1345
  else {
1295
- window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(pixelEventParamsJson, product));
1346
+ window === null || window === void 0 ? void 0 : window.fbq('track', pixelEventParamsJson === null || pixelEventParamsJson === void 0 ? void 0 : pixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: pixelEventParamsJson, eventName }, props)));
1296
1347
  }
1297
1348
  }
1298
1349
  if (!isPushState) {
1299
1350
  if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.gtag) === 'function') {
1300
1351
  window === null || window === void 0 ? void 0 : window.gtag('event', 'page_view');
1301
1352
  }
1302
- const tiktokPixelEventParamsJson = (_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _b === void 0 ? void 0 : _b[eventName];
1353
+ const tiktokPixelEventParamsJson = (_c = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.tiktokPixel) === null || _c === void 0 ? void 0 : _c[eventName];
1303
1354
  if ((tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name) &&
1304
1355
  typeof (window === null || window === void 0 ? void 0 : window.ttq) === 'object' &&
1305
- typeof ((_c = window === null || window === void 0 ? void 0 : window.ttq) === null || _c === void 0 ? void 0 : _c.track) === 'function') {
1306
- (_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(tiktokPixelEventParamsJson, product));
1356
+ typeof ((_d = window === null || window === void 0 ? void 0 : window.ttq) === null || _d === void 0 ? void 0 : _d.track) === 'function') {
1357
+ (_e = window === null || window === void 0 ? void 0 : window.ttq) === null || _e === void 0 ? void 0 : _e.track(tiktokPixelEventParamsJson === null || tiktokPixelEventParamsJson === void 0 ? void 0 : tiktokPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: tiktokPixelEventParamsJson, eventName }, props)));
1307
1358
  }
1308
1359
  }
1309
- const snapchatPixelEventParamsJson = (_e = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _e === void 0 ? void 0 : _e[eventName];
1360
+ const snapchatPixelEventParamsJson = (_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.snapchatPixel) === null || _f === void 0 ? void 0 : _f[eventName];
1310
1361
  if ((snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name) && typeof (window === null || window === void 0 ? void 0 : window.snaptr) === 'function') {
1311
- window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(snapchatPixelEventParamsJson, product));
1362
+ window === null || window === void 0 ? void 0 : window.snaptr('track', snapchatPixelEventParamsJson === null || snapchatPixelEventParamsJson === void 0 ? void 0 : snapchatPixelEventParamsJson.event_name, getEventParamsByJson(Object.assign({ json: snapchatPixelEventParamsJson, eventName }, props)));
1312
1363
  }
1313
- if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_f = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _f === void 0 ? void 0 : _f.trackPageView) === 'function') {
1314
- (_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView();
1364
+ if (eventName === 'PageView' && typeof (window === null || window === void 0 ? void 0 : window.Northbeam) === 'object' && typeof ((_g = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _g === void 0 ? void 0 : _g.trackPageView) === 'function') {
1365
+ (_h = window === null || window === void 0 ? void 0 : window.Northbeam) === null || _h === void 0 ? void 0 : _h.trackPageView();
1315
1366
  }
1316
- const converApiEventParamsJson = (_h = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _h === void 0 ? void 0 : _h[eventName];
1367
+ const converApiEventParamsJson = (_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.converApi) === null || _j === void 0 ? void 0 : _j[eventName];
1317
1368
  if (enabledMetaConversionApi && converApiEventParamsJson) {
1318
- const body = getEventParamsByJson(converApiEventParamsJson, product);
1369
+ const body = getEventParamsByJson(Object.assign({ json: converApiEventParamsJson, eventName }, props));
1319
1370
  const params = {};
1320
1371
  const queryString = location.search.slice(1);
1321
- (_j = splitUrlParams(queryString)) === null || _j === void 0 ? void 0 : _j.forEach((val) => {
1372
+ (_k = splitUrlParams(queryString)) === null || _k === void 0 ? void 0 : _k.forEach((val) => {
1322
1373
  const key = val.split('=')[0];
1323
1374
  const value = val.split('=')[1];
1324
1375
  params[key] = value;
1325
1376
  });
1326
1377
  const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
1327
- bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_k = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _k === void 0 ? void 0 : _k['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1378
+ bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_l = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _l === void 0 ? void 0 : _l['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
1328
1379
  method: 'POST',
1329
1380
  body,
1330
1381
  type: 'beacon'
@@ -1362,7 +1413,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1362
1413
  console.log('e', e);
1363
1414
  }
1364
1415
  }), [bffFetch, utmVal]);
1365
- const ctaEvent = React.useCallback((eventInfo, rec, product, position) => {
1416
+ const ctaEvent = React.useCallback((eventInfo, rec, product, position, ctaActionType, targetUrl, contentType) => {
1366
1417
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
1367
1418
  const cta = product === null || product === void 0 ? void 0 : product.bindCta;
1368
1419
  const isProd = ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) || (((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.bindProducts) && ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProducts) === null || _d === void 0 ? void 0 : _d.length) > 0);
@@ -1385,32 +1436,21 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1385
1436
  });
1386
1437
  }, [bffEventReport, isFromHashtag]);
1387
1438
  const h5EnterLink = React.useCallback(() => {
1388
- var _a, _b, _c;
1389
- const queryString = location.search.slice(1);
1390
- const params = {};
1391
- (_a = splitUrlParams(queryString.replace(/\+/g, '%2B'))) === null || _a === void 0 ? void 0 : _a.map((val) => {
1392
- const key = val.split('=')[0];
1393
- const value = val.split('=')[1];
1394
- params[key] = value;
1395
- });
1396
- for (const key in params) {
1397
- params[key] = params[key].replace(/%2B/g, '+');
1398
- }
1399
- const getVal = (key) => { var _a; return (_a = params[key]) !== null && _a !== void 0 ? _a : ''; };
1439
+ var _a, _b;
1400
1440
  const time = new Date();
1401
1441
  curTime.current = time;
1402
1442
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
1403
1443
  eventInfo: {
1404
1444
  eventSubject: 'h5LinkEnterFeed',
1405
1445
  eventDescription: 'User enter h5 link',
1406
- utmSource: getVal('utm_source'),
1407
- utmMedium: getVal('utm_medium'),
1408
- utmCampaign: getVal('utm_campaign'),
1409
- utmId: getVal('utm_id'),
1410
- utmContent: getVal('utm_content'),
1446
+ utmSource: getUrlParamByKey('utm_source'),
1447
+ utmMedium: getUrlParamByKey('utm_medium'),
1448
+ utmCampaign: getUrlParamByKey('utm_campaign'),
1449
+ utmId: getUrlParamByKey('utm_id'),
1450
+ utmContent: getUrlParamByKey('utm_content'),
1411
1451
  enterTime: Math.floor(time / 1000) + '',
1412
1452
  requestId: null,
1413
- enterUrl: (_c = (_b = window === null || window === void 0 ? void 0 : window.location) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : ''
1453
+ enterUrl: (_b = (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : ''
1414
1454
  },
1415
1455
  reportLayId: false
1416
1456
  });
@@ -10830,22 +10870,78 @@ const CommodityDetail$1 = (_a) => {
10830
10870
  eventSubject: 'clickCta',
10831
10871
  eventDescription: 'User clicked the CTA'
10832
10872
  }, data, product, position);
10873
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10874
+ eventName: 'ClickCTA',
10875
+ product: product ? [product] : undefined,
10876
+ contentType: 'product',
10877
+ data,
10878
+ position,
10879
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
10880
+ cta_action_type: 'open_external_link',
10881
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
10882
+ target_url: product.link
10883
+ });
10833
10884
  }
10834
10885
  window.location.href = window.getJointUtmLink(product.link);
10835
10886
  }
10836
10887
  };
10837
10888
  React.useEffect(() => {
10889
+ var _a;
10838
10890
  if (!isActive)
10839
10891
  return;
10892
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
10840
10893
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10841
10894
  eventName: 'ProductView',
10842
- product
10895
+ product: product ? [product] : undefined,
10896
+ contentType: 'product',
10897
+ rec: recData,
10898
+ position
10843
10899
  });
10844
10900
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10845
10901
  eventName: 'PageView',
10846
- product
10902
+ product: product ? [product] : undefined,
10903
+ contentType: 'product',
10904
+ rec: recData,
10905
+ position
10847
10906
  });
10848
10907
  }, [isActive, bffFbReport]);
10908
+ React.useEffect(() => {
10909
+ if (!isActive || isPost)
10910
+ return;
10911
+ const onShow = () => {
10912
+ curTimeRef.current = new Date();
10913
+ };
10914
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
10915
+ const onHide = () => {
10916
+ var _a;
10917
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10918
+ eventName: 'ExitFeed',
10919
+ product: product ? [product] : undefined,
10920
+ contentType: 'product',
10921
+ rec: recData,
10922
+ position,
10923
+ view_time: new Date() - curTimeRef.current,
10924
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
10925
+ });
10926
+ };
10927
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
10928
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
10929
+ return () => {
10930
+ var _a;
10931
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
10932
+ eventName: 'Engagement',
10933
+ product: product ? [product] : undefined,
10934
+ rec: recData,
10935
+ position,
10936
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
10937
+ engagement_type: 'close_popup',
10938
+ contentType: 'product',
10939
+ view_time: new Date() - curTimeRef.current
10940
+ });
10941
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
10942
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
10943
+ };
10944
+ }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
10849
10945
  React.useEffect(() => {
10850
10946
  const initTime = () => {
10851
10947
  curTimeRef.current = new Date();
@@ -11737,22 +11833,78 @@ const CommodityDetailDiroNew$1 = (_a) => {
11737
11833
  eventSubject: 'clickCta',
11738
11834
  eventDescription: 'User clicked the CTA'
11739
11835
  }, data, product, position);
11836
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11837
+ eventName: 'ClickCTA',
11838
+ product: product ? [product] : undefined,
11839
+ contentType: 'product',
11840
+ data,
11841
+ position,
11842
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
11843
+ cta_action_type: 'open_external_link',
11844
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
11845
+ target_url: product.link
11846
+ });
11740
11847
  }
11741
11848
  window.location.href = window.getJointUtmLink(product.link);
11742
11849
  }
11743
11850
  };
11744
11851
  React.useEffect(() => {
11852
+ var _a;
11745
11853
  if (!isActive)
11746
11854
  return;
11855
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '', imgUrls: !isPost ? product === null || product === void 0 ? void 0 : product.homePage : (_a = data === null || data === void 0 ? void 0 : data.video) === null || _a === void 0 ? void 0 : _a.imgUrls }) : null });
11747
11856
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11748
11857
  eventName: 'ProductView',
11749
- product
11858
+ product: product ? [product] : undefined,
11859
+ contentType: 'product',
11860
+ rec: recData,
11861
+ position
11750
11862
  });
11751
11863
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11752
11864
  eventName: 'PageView',
11753
- product
11865
+ product: product ? [product] : undefined,
11866
+ contentType: 'product',
11867
+ rec: recData,
11868
+ position
11754
11869
  });
11755
- }, [isActive, bffFbReport]);
11870
+ }, [isActive, bffFbReport, isPost]);
11871
+ React.useEffect(() => {
11872
+ if (!isActive || isPost)
11873
+ return;
11874
+ const onShow = () => {
11875
+ curTimeRef.current = new Date();
11876
+ };
11877
+ const recData = Object.assign(Object.assign({}, data), { video: (data === null || data === void 0 ? void 0 : data.video) ? Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.video), { title: '' }) : null });
11878
+ const onHide = () => {
11879
+ var _a;
11880
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11881
+ eventName: 'ExitFeed',
11882
+ product: product ? [product] : undefined,
11883
+ contentType: 'product',
11884
+ rec: recData,
11885
+ position,
11886
+ view_time: new Date() - curTimeRef.current,
11887
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : ''
11888
+ });
11889
+ };
11890
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
11891
+ SXP_EVENT_BUS.on(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
11892
+ return () => {
11893
+ var _a;
11894
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
11895
+ eventName: 'Engagement',
11896
+ product: product ? [product] : undefined,
11897
+ rec: recData,
11898
+ position,
11899
+ content_id: (_a = product === null || product === void 0 ? void 0 : product.itemId) !== null && _a !== void 0 ? _a : '',
11900
+ engagement_type: 'close_popup',
11901
+ contentType: 'product',
11902
+ view_time: new Date() - curTimeRef.current
11903
+ });
11904
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_SHOW, () => onShow());
11905
+ SXP_EVENT_BUS.off(SXP_EVENT_TYPE.PAGE_DID_HIDE, () => onHide());
11906
+ };
11907
+ }, [isActive, isPost, bffFbReport, data, product, position, curTimeRef]);
11756
11908
  React.useEffect(() => {
11757
11909
  const initTime = () => {
11758
11910
  if (!isActive)
@@ -12417,16 +12569,28 @@ const CommodityList$1 = (_a) => {
12417
12569
  });
12418
12570
  }, [(_d = commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) === null || _d === void 0 ? void 0 : _d.enableFormattedPrice, globalConfig]);
12419
12571
  const handleClick = lodash.throttle((item, multiCheckIndex, e) => {
12572
+ var _a;
12420
12573
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12421
12574
  eventSubject: 'clickCta',
12422
12575
  eventDescription: 'User clicked the CTA'
12423
12576
  }, recData, item, index);
12577
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12578
+ eventName: 'ClickCTA',
12579
+ product: item ? [item] : undefined,
12580
+ contentType: 'product',
12581
+ recData,
12582
+ index,
12583
+ cta_text: (_a = item === null || item === void 0 ? void 0 : item.bindCta) === null || _a === void 0 ? void 0 : _a.enTitle,
12584
+ cta_action_type: isExternalLink && !!(item === null || item === void 0 ? void 0 : item.link) ? 'open_external_link' : 'open_internal_popup',
12585
+ target_content_id: item === null || item === void 0 ? void 0 : item.itemId,
12586
+ target_url: item.link
12587
+ });
12424
12588
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
12425
12589
  if (isExternalLink) {
12426
- if (item === null || item === void 0 ? void 0 : item.link) {
12427
- jumpToWeb(e, recData, item, item.bindCta, index);
12428
- window.location.href = window.getJointUtmLink(item.link);
12429
- }
12590
+ if (!(item === null || item === void 0 ? void 0 : item.link))
12591
+ return;
12592
+ jumpToWeb(e, recData, item, item.bindCta, index);
12593
+ window.location.href = window.getJointUtmLink(item.link);
12430
12594
  }
12431
12595
  else {
12432
12596
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -12434,7 +12598,11 @@ const CommodityList$1 = (_a) => {
12434
12598
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
12435
12599
  React.useEffect(() => {
12436
12600
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
12437
- eventName: 'PageView'
12601
+ eventName: 'PageView',
12602
+ product: (product !== null && product !== void 0 ? product : []),
12603
+ contentType: 'product',
12604
+ rec: recData,
12605
+ position: index
12438
12606
  });
12439
12607
  }, []);
12440
12608
  return (React.createElement("ul", { role: 'list', className: css.css(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px', boxSizing: 'border-box' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
@@ -12946,28 +13114,40 @@ const EventProvider = (_a) => {
12946
13114
  var { rec, children, className, onClick, style, isExternalLink = false, index, jumpLink, multItem, multiCheckIndex } = _a; __rest(_a, ["rec", "children", "className", "onClick", "style", "isExternalLink", "index", "jumpLink", "multItem", "multiCheckIndex"]);
12947
13115
  const ref = React.useRef(null);
12948
13116
  const { popup } = useEditor();
12949
- const { setPopupDetailData, ctaEvent } = useSxpDataSource();
13117
+ const { setPopupDetailData, ctaEvent, bffFbReport } = useSxpDataSource();
12950
13118
  const { jumpToWeb } = useEventReport();
12951
13119
  const [element, setElement] = React.useState(null);
12952
13120
  const handleClick = lodash.throttle((e) => {
12953
- var _a, _b, _c, _d, _e, _f;
13121
+ var _a, _b, _c, _d, _e, _f, _g, _h;
12954
13122
  e.preventDefault();
12955
- const item = multItem ? multItem : (_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video;
13123
+ const item = multItem || ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProduct) !== null && _b !== void 0 ? _b : rec === null || rec === void 0 ? void 0 : rec.video);
13124
+ const link = jumpLink || ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link) || '';
12956
13125
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
12957
13126
  eventSubject: 'clickCta',
12958
13127
  eventDescription: 'User clicked the CTA'
12959
13128
  }, rec, item, index);
13129
+ const product = multItem || ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindProduct);
13130
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
13131
+ eventName: 'ClickCTA',
13132
+ product: product ? [product] : undefined,
13133
+ contentType: 'post',
13134
+ rec,
13135
+ index,
13136
+ cta_text: (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle,
13137
+ cta_action_type: isExternalLink && (!!link) ? 'open_external_link' : 'open_internal_popup',
13138
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
13139
+ target_url: link
13140
+ });
12960
13141
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(multItem && multiCheckIndex !== undefined && multiCheckIndex >= 0
12961
13142
  ? Object.assign(Object.assign({}, rec), { video: Object.assign(Object.assign({}, rec === null || rec === void 0 ? void 0 : rec.video), { bindProduct: multItem }), index, multiCheckIndex }) : Object.assign(Object.assign({}, rec), { index }));
12962
13143
  setElement(ref === null || ref === void 0 ? void 0 : ref.current);
12963
13144
  if (isExternalLink) {
12964
- const link = ((_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) === null || _d === void 0 ? void 0 : _d.link) || (multItem === null || multItem === void 0 ? void 0 : multItem.link);
12965
- if (jumpLink || link) {
12966
- const cta = ((_e = rec === null || rec === void 0 ? void 0 : rec.video) === null || _e === void 0 ? void 0 : _e.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
12967
- const product = ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.bindProduct) || multItem;
12968
- jumpToWeb(e, rec, product, cta, index);
12969
- window.location.href = window.getJointUtmLink(jumpLink || link || '');
12970
- }
13145
+ if (!link)
13146
+ return;
13147
+ const cta = ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.bindCta) || (multItem === null || multItem === void 0 ? void 0 : multItem.bindCta);
13148
+ const product = ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.bindProduct) || multItem;
13149
+ jumpToWeb(e, rec, product, cta, index);
13150
+ window.location.href = window.getJointUtmLink(link);
12971
13151
  }
12972
13152
  else {
12973
13153
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -15452,7 +15632,7 @@ var previewData = {
15452
15632
 
15453
15633
  const WaterfallFlowItem$1 = (props) => {
15454
15634
  var _a;
15455
- const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
15635
+ const { listItem, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
15456
15636
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
15457
15637
  const [showVideo, setShowVideo] = React.useState(false);
15458
15638
  React.useState(false);
@@ -15465,6 +15645,7 @@ const WaterfallFlowItem$1 = (props) => {
15465
15645
  React.useRef(null);
15466
15646
  React.useRef(null);
15467
15647
  const [firstFrameSrc, setFirstFrameSrc] = React.useState('');
15648
+ const rec = listItem;
15468
15649
  const src = React.useMemo(() => {
15469
15650
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
15470
15651
  if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) {
@@ -15557,7 +15738,7 @@ const WaterfallFlowItem$1 = (props) => {
15557
15738
  function WaterfallList$1(_a) {
15558
15739
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
15559
15740
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15560
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
15741
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15561
15742
  const { jumpToWeb } = useEventReport();
15562
15743
  /** 滚动的父元素 */
15563
15744
  const scrollParent = React.useRef(null);
@@ -15684,7 +15865,8 @@ function WaterfallList$1(_a) {
15684
15865
  }).then((res) => {
15685
15866
  var _a, _b;
15686
15867
  setData(res);
15687
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
15868
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
15869
+ setList(list);
15688
15870
  setIsLoadingData(false);
15689
15871
  }));
15690
15872
  if (isOpenHashTag) {
@@ -15773,7 +15955,7 @@ function WaterfallList$1(_a) {
15773
15955
  React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
15774
15956
  list.map((item, ind) => {
15775
15957
  var _a;
15776
- return (React.createElement(WaterfallFlowItem$1, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
15958
+ return (React.createElement(WaterfallFlowItem$1, Object.assign({ key: ind, index: ind, listItem: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
15777
15959
  }),
15778
15960
  React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
15779
15961
  position: 'absolute',
@@ -15795,7 +15977,8 @@ var img$6 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeA
15795
15977
 
15796
15978
  const WaterfallFlowItem = (props) => {
15797
15979
  var _a;
15798
- const { rec, index, list, reportTagsView, textStyles, space, openFixedSize, fixedSizeRatio } = props;
15980
+ const { listItem, index, list, reportTagsView, textStyles, space, openFixedSize, fixedSizeRatio } = props;
15981
+ const rec = listItem;
15799
15982
  const { swiperRef, setRtcList, setOpenHashtag, sxpParameter, globalConfig } = useSxpDataSource();
15800
15983
  const [showVideo, setShowVideo] = React.useState(false);
15801
15984
  const imgDom = React.useRef(null);
@@ -15920,41 +16103,30 @@ const WaterfallFlowItem = (props) => {
15920
16103
  function WaterfallList(_a) {
15921
16104
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15922
16105
  var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
15923
- const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex } = useSxpDataSource();
16106
+ const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag, cacheActiveIndex, bffFbReport } = useSxpDataSource();
15924
16107
  const { jumpToWeb } = useEventReport();
15925
16108
  const [list, setList] = React.useState();
15926
16109
  const [data, setData] = React.useState();
15927
16110
  const [isLoadingData, setIsLoadingData] = React.useState(false);
15928
16111
  const containerRef = React.useRef(null);
15929
16112
  const [isLoadMore, setIsLoadMore] = React.useState(false);
15930
- React.useCallback(() => {
15931
- if (isLoadMore)
15932
- return;
15933
- setIsLoadMore(true);
15934
- waterFallData &&
15935
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15936
- hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag
15937
- }).then((res) => {
15938
- var _a;
15939
- setList(list === null || list === void 0 ? void 0 : list.concat((_a = res === null || res === void 0 ? void 0 : res.recList) !== null && _a !== void 0 ? _a : []));
15940
- setIsLoadMore(false);
15941
- }));
15942
- }, [waterFallData, getRecommendVideos, list, isLoadMore]);
15943
16113
  React.useEffect(() => {
15944
16114
  var _a, _b;
15945
16115
  setIsLoadingData(true);
15946
- waterFallData &&
15947
- (getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
16116
+ if (waterFallData) {
16117
+ getRecommendVideos === null || getRecommendVideos === void 0 ? void 0 : getRecommendVideos({
15948
16118
  hashTag: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag,
15949
16119
  defaultSize: hashTagSize,
15950
16120
  maxSize: hashTagSize
15951
16121
  }).then((res) => {
15952
16122
  var _a, _b;
15953
16123
  setData(res);
15954
- setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
16124
+ const list = (_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : [];
16125
+ setList(list);
15955
16126
  setIsLoadingData(false);
15956
- }));
15957
- if (isOpenHashTag) {
16127
+ });
16128
+ }
16129
+ else if (isOpenHashTag) {
15958
16130
  const res = previewData;
15959
16131
  setData(res);
15960
16132
  setList((_b = (_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.filter((item) => (item === null || item === void 0 ? void 0 : item.video) !== null || (item === null || item === void 0 ? void 0 : item.product) !== null)) !== null && _b !== void 0 ? _b : []);
@@ -16002,7 +16174,7 @@ function WaterfallList(_a) {
16002
16174
  __html: setFontForText(((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.linkTitle) || 'Shop the collection', (_k = props === null || props === void 0 ? void 0 : props.textStyles) === null || _k === void 0 ? void 0 : _k.hashTagLink)
16003
16175
  } }),
16004
16176
  React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
16005
- return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
16177
+ return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, listItem: item, list: list, reportTagsView: reportTagsView }, props)));
16006
16178
  })),
16007
16179
  React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
16008
16180
  React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
@@ -16091,13 +16263,17 @@ const WaterFall = (props) => {
16091
16263
  });
16092
16264
  }, [recData, bffEventReport, viewTime, isFromHashtag, cacheActiveIndex]);
16093
16265
  React.useEffect(() => {
16266
+ var _a, _b;
16094
16267
  if (openHashtag) {
16095
16268
  setViewTime(new Date());
16096
16269
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16097
- eventName: 'PageView'
16270
+ eventName: 'PageView',
16271
+ product: (_b = (_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
16272
+ rec: waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.rec,
16273
+ position: cacheActiveIndex
16098
16274
  });
16099
16275
  }
16100
- }, [openHashtag, bffFbReport]);
16276
+ }, [openHashtag, bffFbReport, waterFallData, cacheActiveIndex]);
16101
16277
  React.useEffect(() => {
16102
16278
  const initTime = () => {
16103
16279
  setViewTime(new Date());
@@ -16408,7 +16584,7 @@ var styles$1 = {"animated-button":"index-module_animated-button__lqTbg","gradien
16408
16584
  const AniLink$1 = (_a) => {
16409
16585
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
16410
16586
  var { style, recData, ctaTempStyles, index, event, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "onClick", "isExternalLink", "isActive"]);
16411
- const { ctaEvent, setPopupDetailData } = useSxpDataSource();
16587
+ const { ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
16412
16588
  const { jumpToWeb } = useEventReport();
16413
16589
  const [visible, setVisible] = React.useState(false);
16414
16590
  const ref = React.useRef(null);
@@ -16418,17 +16594,28 @@ const AniLink$1 = (_a) => {
16418
16594
  const handleTo = (e) => {
16419
16595
  var _a, _b, _c, _d;
16420
16596
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
16597
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16421
16598
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16422
16599
  eventSubject: 'clickCta',
16423
16600
  eventDescription: 'User clicked the CTA'
16424
16601
  }, recData, item, index);
16602
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
16603
+ eventName: 'ClickCTA',
16604
+ product: product ? [product] : undefined,
16605
+ contentType: 'post',
16606
+ recData,
16607
+ index,
16608
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
16609
+ cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
16610
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
16611
+ target_url: link
16612
+ });
16425
16613
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16426
16614
  if (isExternalLink) {
16427
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16428
- if (link) {
16429
- jumpToWeb(e, recData, product, cta, index);
16430
- window.location.href = window.getJointUtmLink(link);
16431
- }
16615
+ if (!link)
16616
+ return;
16617
+ jumpToWeb(e, recData, product, cta, index);
16618
+ window.location.href = window.getJointUtmLink(link);
16432
16619
  }
16433
16620
  else {
16434
16621
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16911,7 +17098,7 @@ const AniLinkPopup$1 = (_a) => {
16911
17098
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
16912
17099
  var { style, recData, ctaTempStyles, index, event, bottom_image, translateY, isTel, onClick, isExternalLink = false, isActive } = _a, props = __rest(_a, ["style", "recData", "ctaTempStyles", "index", "event", "bottom_image", "translateY", "isTel", "onClick", "isExternalLink", "isActive"]);
16913
17100
  style === null || style === void 0 ? true : delete style.transform;
16914
- const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData } = useSxpDataSource();
17101
+ const { sxpParameter, globalConfig, ctaEvent, setPopupDetailData, bffFbReport } = useSxpDataSource();
16915
17102
  const { jumpToWeb } = useEventReport();
16916
17103
  const [visible, setVisible] = React.useState(true);
16917
17104
  const cta = ((_d = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.bindCta) || ((_f = (_e = recData === null || recData === void 0 ? void 0 : recData.video) === null || _e === void 0 ? void 0 : _e.bindProduct) === null || _f === void 0 ? void 0 : _f.bindCta) || ((_g = recData === null || recData === void 0 ? void 0 : recData.video) === null || _g === void 0 ? void 0 : _g.bindCta);
@@ -16919,17 +17106,28 @@ const AniLinkPopup$1 = (_a) => {
16919
17106
  const handleTo = (e) => {
16920
17107
  var _a, _b, _c, _d;
16921
17108
  const item = ((_b = (_a = recData === null || recData === void 0 ? void 0 : recData.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = recData === null || recData === void 0 ? void 0 : recData.video) === null || _c === void 0 ? void 0 : _c.bindProduct) || (recData === null || recData === void 0 ? void 0 : recData.video);
17109
+ const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16922
17110
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16923
17111
  eventSubject: 'clickCta',
16924
17112
  eventDescription: 'User clicked the CTA'
16925
17113
  }, recData, item, index);
17114
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
17115
+ eventName: 'ClickCTA',
17116
+ product: product ? [product] : undefined,
17117
+ contentType: 'post',
17118
+ recData,
17119
+ index,
17120
+ cta_text: cta === null || cta === void 0 ? void 0 : cta.enTitle,
17121
+ cta_action_type: (isExternalLink && !!link) ? 'open_external_link' : 'open_internal_popup',
17122
+ target_content_id: product === null || product === void 0 ? void 0 : product.itemId,
17123
+ target_url: link
17124
+ });
16926
17125
  setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { index }));
16927
17126
  if (isExternalLink) {
16928
- const link = (product === null || product === void 0 ? void 0 : product.link) || ((_d = item === null || item === void 0 ? void 0 : item.bindCta) === null || _d === void 0 ? void 0 : _d.link);
16929
- if (link) {
16930
- jumpToWeb(e, recData, product, cta, index);
16931
- window.location.href = window.getJointUtmLink(link);
16932
- }
17127
+ if (!link)
17128
+ return;
17129
+ jumpToWeb(e, recData, product, cta, index);
17130
+ window.location.href = window.getJointUtmLink(link);
16933
17131
  }
16934
17132
  else {
16935
17133
  onClick === null || onClick === void 0 ? void 0 : onClick();
@@ -16963,8 +17161,8 @@ const AniLinkPopup$1 = (_a) => {
16963
17161
  height: '40px',
16964
17162
  lineHeight: '40px',
16965
17163
  paddingLeft: '6px'
16966
- } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles['aniLinkPopup']} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
16967
- React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style['padding']) !== null && _s !== void 0 ? _s : 0 } },
17164
+ } }, "Cta Title")) : (React.createElement("div", Object.assign({}, props, { className: `${css.css(Object.assign(Object.assign({}, style), { '--transY': `translateY(calc(100% + ${(_r = style === null || style === void 0 ? void 0 : style.margin) !== null && _r !== void 0 ? _r : 0}px))` }))} ${styles.aniLinkPopup} ${aniNamStyle} ${css.css(aniTimStyle)}`, onClick: handleTo }),
17165
+ React.createElement("div", { onClick: onClose, className: styles['modal-icon-wrapper'], style: { padding: (_s = style === null || style === void 0 ? void 0 : style.padding) !== null && _s !== void 0 ? _s : 0 } },
16968
17166
  React.createElement("img", { src: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.popupCloseIcon) || closeIcon, alt: 'close', className: styles['modal-icon-wrapper-img'] })),
16969
17167
  React.createElement(Img$1, { src: src, rec: recData, item: (_x = (_v = (_u = (_t = recData === null || recData === void 0 ? void 0 : recData.video) === null || _t === void 0 ? void 0 : _t.bindProducts) === null || _u === void 0 ? void 0 : _u[0]) !== null && _v !== void 0 ? _v : (_w = recData === null || recData === void 0 ? void 0 : recData.video) === null || _w === void 0 ? void 0 : _w.bindProduct) !== null && _x !== void 0 ? _x : recData === null || recData === void 0 ? void 0 : recData.video, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img, isActive: isActive }),
16970
17168
  (!recData || (product === null || product === void 0 ? void 0 : product.title)) && (React.createElement("div", { className: styles['one-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title, dangerouslySetInnerHTML: {
@@ -18155,12 +18353,12 @@ const defaultLikeIconPath$2 = '/pb_static/f07900fe3f0f4ae188ea1611d4801a44.png';
18155
18353
  const LikeButton = (_a) => {
18156
18354
  var _b;
18157
18355
  var { active, activeIcon, unActicveIcon, recData, position } = _a, props = __rest(_a, ["active", "activeIcon", "unActicveIcon", "recData", "position"]);
18158
- const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList } = useSxpDataSource();
18356
+ const { mutateLike, mutateUnlike, bffEventReport, setCacheRtcList, cacheRtcList, bffFbReport } = useSxpDataSource();
18159
18357
  const [state, setState] = React.useState((_b = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList[position]) === null || _b === void 0 ? void 0 : _b.isCollected);
18160
18358
  const likeIcon = useIconLink(defaultLikeIconPath$2);
18161
18359
  const unlikeIcon = useIconLink(defaultUnLikeIconPath$2);
18162
18360
  const handleClick = lodash.debounce(() => __awaiter(void 0, void 0, void 0, function* () {
18163
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
18361
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
18164
18362
  if (state) {
18165
18363
  // 先设置状态
18166
18364
  setState(false);
@@ -18206,16 +18404,24 @@ const LikeButton = (_a) => {
18206
18404
  traceInfo: (_y = recData === null || recData === void 0 ? void 0 : recData.video) === null || _y === void 0 ? void 0 : _y.traceInfo
18207
18405
  }
18208
18406
  });
18407
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18408
+ eventName: 'Engagement',
18409
+ product: (_z = recData === null || recData === void 0 ? void 0 : recData.video) === null || _z === void 0 ? void 0 : _z.bindProducts,
18410
+ rec: recData,
18411
+ position,
18412
+ content_id: (_1 = (_0 = recData === null || recData === void 0 ? void 0 : recData.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '',
18413
+ engagement_type: 'like'
18414
+ });
18209
18415
  if (!result) {
18210
18416
  setState(false);
18211
18417
  }
18212
18418
  else {
18213
- const nRtcList = (_z = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18419
+ const nRtcList = (_2 = cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.map((item, index) => {
18214
18420
  if (index === position) {
18215
18421
  item.isCollected = true;
18216
18422
  }
18217
18423
  return item;
18218
- })) !== null && _z !== void 0 ? _z : [];
18424
+ })) !== null && _2 !== void 0 ? _2 : [];
18219
18425
  setCacheRtcList === null || setCacheRtcList === void 0 ? void 0 : setCacheRtcList(nRtcList);
18220
18426
  }
18221
18427
  }
@@ -18527,11 +18733,15 @@ const VideoWidget$4 = React.forwardRef(({ rec, index, height, data, muted, activ
18527
18733
  if (isActive) {
18528
18734
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18529
18735
  eventName: 'ViewContent',
18530
- product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProduct
18736
+ product: (_b = (_a = data === null || data === void 0 ? void 0 : data[index]) === null || _a === void 0 ? void 0 : _a.video) === null || _b === void 0 ? void 0 : _b.bindProducts,
18737
+ rec: data === null || data === void 0 ? void 0 : data[index],
18738
+ position: index
18531
18739
  });
18532
18740
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
18533
18741
  eventName: 'PageView',
18534
- product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProduct
18742
+ product: (_d = (_c = data === null || data === void 0 ? void 0 : data[index]) === null || _c === void 0 ? void 0 : _c.video) === null || _d === void 0 ? void 0 : _d.bindProducts,
18743
+ rec: data === null || data === void 0 ? void 0 : data[index],
18744
+ position: index
18535
18745
  });
18536
18746
  (_e = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _e === void 0 ? void 0 : _e.play();
18537
18747
  }
@@ -19183,7 +19393,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19183
19393
  (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(index);
19184
19394
  }, [data, ctaType, swiperRef]);
19185
19395
  const handleSessionCompleted = React.useCallback((fk) => {
19186
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
19396
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
19187
19397
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19188
19398
  let fromKName = '';
19189
19399
  if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
@@ -19218,7 +19428,18 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19218
19428
  traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : ''
19219
19429
  }
19220
19430
  });
19221
- }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime]);
19431
+ const isPostType = ((_w = item === null || item === void 0 ? void 0 : item.video) === null || _w === void 0 ? void 0 : _w.url) || ((_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.imgUrls) === null || _y === void 0 ? void 0 : _y.length);
19432
+ if (!popupDetailData) {
19433
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19434
+ eventName: 'ExitFeed',
19435
+ product: isPostType ? (_z = item === null || item === void 0 ? void 0 : item.video) === null || _z === void 0 ? void 0 : _z.bindProducts : (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [],
19436
+ rec: item,
19437
+ position: activeIndex,
19438
+ content_id: isPostType ? (_1 = (_0 = item === null || item === void 0 ? void 0 : item.video) === null || _0 === void 0 ? void 0 : _0.itemId) !== null && _1 !== void 0 ? _1 : '' : (_3 = (_2 = item === null || item === void 0 ? void 0 : item.product) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19439
+ view_time: new Date() - viewTime.current
19440
+ });
19441
+ }
19442
+ }, [data, bffEventReport, activeIndex, popupDetailData, tempMap, isFromHashtag, curTime, bffFbReport]);
19222
19443
  React.useEffect(() => {
19223
19444
  const item = data === null || data === void 0 ? void 0 : data[activeIndex];
19224
19445
  const visibleChange = () => {
@@ -19521,50 +19742,81 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19521
19742
  }
19522
19743
  };
19523
19744
  const handleScrollEvent = (swiper) => {
19524
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
19745
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
19525
19746
  const item = data[swiper.previousIndex];
19747
+ const activeItem = data[swiper.activeIndex];
19526
19748
  if (!item)
19527
19749
  return;
19528
19750
  let contentFormat = null;
19529
- if ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.url) {
19751
+ let previousContentType = 'post';
19752
+ let previousContentId = (_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.itemId) !== null && _b !== void 0 ? _b : '';
19753
+ let previousProduct = (_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProducts;
19754
+ let previousContentsName = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : '';
19755
+ let previousDirection = '';
19756
+ let contentId = (_g = (_f = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '';
19757
+ if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
19530
19758
  contentFormat = 'video';
19531
19759
  }
19532
- else if ((_c = (_b = item === null || item === void 0 ? void 0 : item.video) === null || _b === void 0 ? void 0 : _b.imgUrls) === null || _c === void 0 ? void 0 : _c.length) {
19760
+ else if ((_k = (_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.imgUrls) === null || _k === void 0 ? void 0 : _k.length) {
19533
19761
  contentFormat = 'image';
19534
19762
  }
19763
+ else {
19764
+ previousContentType = 'product';
19765
+ previousContentId = (_m = (_l = item === null || item === void 0 ? void 0 : item.product) === null || _l === void 0 ? void 0 : _l.itemId) !== null && _m !== void 0 ? _m : '';
19766
+ previousProduct = (item === null || item === void 0 ? void 0 : item.product) ? [item === null || item === void 0 ? void 0 : item.product] : [];
19767
+ previousContentsName = '';
19768
+ }
19769
+ if (!((_o = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _o === void 0 ? void 0 : _o.url) && !((_q = (_p = activeItem === null || activeItem === void 0 ? void 0 : activeItem.video) === null || _p === void 0 ? void 0 : _p.imgUrls) === null || _q === void 0 ? void 0 : _q.length)) {
19770
+ contentId = (_s = (_r = activeItem === null || activeItem === void 0 ? void 0 : activeItem.product) === null || _r === void 0 ? void 0 : _r.itemId) !== null && _s !== void 0 ? _s : '';
19771
+ }
19535
19772
  if (swiper.previousIndex - swiper.activeIndex < 0) {
19536
19773
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19537
19774
  eventInfo: {
19538
19775
  eventSubject: 'scrollDown',
19539
19776
  eventDescription: 'User scroll down',
19540
- contentId: (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.itemId) !== null && _e !== void 0 ? _e : '',
19541
- productId: (_g = (_f = item === null || item === void 0 ? void 0 : item.product) === null || _f === void 0 ? void 0 : _f.itemId) !== null && _g !== void 0 ? _g : '',
19777
+ contentId: (_u = (_t = item === null || item === void 0 ? void 0 : item.video) === null || _t === void 0 ? void 0 : _t.itemId) !== null && _u !== void 0 ? _u : '',
19778
+ productId: (_w = (_v = item === null || item === void 0 ? void 0 : item.product) === null || _v === void 0 ? void 0 : _v.itemId) !== null && _w !== void 0 ? _w : '',
19542
19779
  requestId: null,
19543
- traceInfo: (_l = (_j = (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.traceInfo) !== null && _j !== void 0 ? _j : (_k = item === null || item === void 0 ? void 0 : item.product) === null || _k === void 0 ? void 0 : _k.traceInfo) !== null && _l !== void 0 ? _l : '',
19780
+ traceInfo: (_0 = (_y = (_x = item === null || item === void 0 ? void 0 : item.video) === null || _x === void 0 ? void 0 : _x.traceInfo) !== null && _y !== void 0 ? _y : (_z = item === null || item === void 0 ? void 0 : item.product) === null || _z === void 0 ? void 0 : _z.traceInfo) !== null && _0 !== void 0 ? _0 : '',
19544
19781
  contentFormat,
19545
- position: ((_m = swiper.previousIndex) !== null && _m !== void 0 ? _m : 0) + ''
19782
+ position: ((_1 = swiper.previousIndex) !== null && _1 !== void 0 ? _1 : 0) + ''
19546
19783
  }
19547
19784
  });
19548
19785
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19549
19786
  handleViewImageStartEnd(item);
19550
19787
  handleSlideSkip(item, swiper.previousIndex);
19788
+ previousDirection = 'up';
19551
19789
  }
19552
19790
  else {
19553
19791
  bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19554
19792
  eventInfo: {
19555
19793
  eventSubject: 'scrollUp',
19556
19794
  eventDescription: 'User scroll up',
19557
- contentId: (_p = (_o = item === null || item === void 0 ? void 0 : item.video) === null || _o === void 0 ? void 0 : _o.itemId) !== null && _p !== void 0 ? _p : '',
19558
- productId: (_r = (_q = item.product) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : '',
19795
+ contentId: (_3 = (_2 = item === null || item === void 0 ? void 0 : item.video) === null || _2 === void 0 ? void 0 : _2.itemId) !== null && _3 !== void 0 ? _3 : '',
19796
+ productId: (_5 = (_4 = item.product) === null || _4 === void 0 ? void 0 : _4.itemId) !== null && _5 !== void 0 ? _5 : '',
19559
19797
  requestId: null,
19560
- traceInfo: (_v = (_t = (_s = item === null || item === void 0 ? void 0 : item.video) === null || _s === void 0 ? void 0 : _s.traceInfo) !== null && _t !== void 0 ? _t : (_u = item === null || item === void 0 ? void 0 : item.product) === null || _u === void 0 ? void 0 : _u.traceInfo) !== null && _v !== void 0 ? _v : '',
19798
+ traceInfo: (_9 = (_7 = (_6 = item === null || item === void 0 ? void 0 : item.video) === null || _6 === void 0 ? void 0 : _6.traceInfo) !== null && _7 !== void 0 ? _7 : (_8 = item === null || item === void 0 ? void 0 : item.product) === null || _8 === void 0 ? void 0 : _8.traceInfo) !== null && _9 !== void 0 ? _9 : '',
19561
19799
  contentFormat,
19562
- position: ((_w = swiper.previousIndex) !== null && _w !== void 0 ? _w : 0) + ''
19800
+ position: ((_10 = swiper.previousIndex) !== null && _10 !== void 0 ? _10 : 0) + ''
19563
19801
  }
19564
19802
  });
19565
19803
  // 如果上一个商品是图片集,需上报 浏览图片集结结束 事件
19566
19804
  handleViewImageStartEnd(item);
19805
+ previousDirection = 'down';
19567
19806
  }
19807
+ bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19808
+ eventName: 'ContentSwipe',
19809
+ product: previousProduct,
19810
+ rec: activeItem,
19811
+ position: swiper.activeIndex,
19812
+ previous_content_id: previousContentId,
19813
+ previous_content_type: previousContentType,
19814
+ previous_contents_name: previousContentsName,
19815
+ previosu_position: swiper.previousIndex,
19816
+ swipe_direction: previousDirection,
19817
+ view_time: new Date() - viewTime.current,
19818
+ content_id: contentId
19819
+ });
19568
19820
  // 商品浏览事件
19569
19821
  handleReportProductView(item);
19570
19822
  viewTime.current = new Date();
@@ -19668,11 +19920,15 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight, containerWidt
19668
19920
  if (enableCapi) {
19669
19921
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19670
19922
  eventName: 'ViewContent',
19671
- product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProduct
19923
+ product: (_g = item === null || item === void 0 ? void 0 : item.video) === null || _g === void 0 ? void 0 : _g.bindProducts,
19924
+ rec: item,
19925
+ position: activeIndex
19672
19926
  });
19673
19927
  bffFbReport === null || bffFbReport === void 0 ? void 0 : bffFbReport({
19674
19928
  eventName: 'PageView',
19675
- product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProduct
19929
+ product: (_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.bindProducts,
19930
+ rec: item,
19931
+ position: activeIndex
19676
19932
  });
19677
19933
  }
19678
19934
  }