pb-sxp-ui 1.18.2 → 1.19.0-alpha.1

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.
package/dist/index.cjs CHANGED
@@ -298,6 +298,42 @@ function splitUrlParams(urlParams) {
298
298
  });
299
299
  return splitList !== null && splitList !== void 0 ? splitList : [];
300
300
  }
301
+ function deleteCookie(name, path = '/', domain = '') {
302
+ // 设置过期时间为过去的时间
303
+ const expiration = 'expires=Thu, 01 Jan 1970 00:00:00 GMT';
304
+ const pathPart = path ? `; path=${path}` : '';
305
+ const domainPart = domain ? `; domain=${domain}` : '';
306
+ // 设置Cookie值为空,过期时间设为过去
307
+ document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
308
+ console.log(`已尝试删除Cookie: ${name}`);
309
+ }
310
+ function setCookie(name, value, days = 0, path = '/', domain = '', secure = false, sameSite = 'Lax') {
311
+ let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
312
+ // 设置过期时间
313
+ if (days) {
314
+ const date = new Date();
315
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
316
+ cookieString += `; expires=${date.toUTCString()}`;
317
+ }
318
+ // 设置路径
319
+ if (path) {
320
+ cookieString += `; path=${path}`;
321
+ }
322
+ // 设置域名
323
+ if (domain) {
324
+ cookieString += `; domain=${domain}`;
325
+ }
326
+ // 设置Secure标志
327
+ if (secure) {
328
+ cookieString += '; secure';
329
+ }
330
+ // 设置SameSite属性
331
+ if (sameSite) {
332
+ cookieString += `; samesite=${sameSite}`;
333
+ }
334
+ // 设置Cookie
335
+ document.cookie = cookieString;
336
+ }
301
337
 
302
338
  function unzip(b64Data) {
303
339
  const strData = atob(b64Data);
@@ -675,6 +711,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
675
711
  const [chatlabsId, setChatlabsId] = React.useState();
676
712
  const finalPageData = React.useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
677
713
  const pixelPvStatusRef = React.useRef(false);
714
+ const fbcRef = React.useRef('');
678
715
  const isShowConsent = React.useMemo(() => {
679
716
  var _a, _b, _c, _d;
680
717
  return (((((_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.consent) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.privacy_necessity) && !isAgreePolicy && !isEditor) || isOpenConsent) &&
@@ -735,6 +772,38 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
735
772
  var _a;
736
773
  return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
737
774
  }, [bffDataSource]);
775
+ React.useEffect(() => {
776
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
777
+ return;
778
+ fbcRef.current = getCookie('_fbc');
779
+ window.OptanonWrapper = function () {
780
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
781
+ if (!activeGroups)
782
+ return;
783
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
784
+ deleteCookie('_fbc');
785
+ }
786
+ else if (fbcRef.current) {
787
+ setCookie('_fbc', fbcRef.current, 90);
788
+ }
789
+ };
790
+ }, [globalConfig]);
791
+ const isActiveTargetingCookie = React.useMemo(() => {
792
+ var _a;
793
+ function getCookie(name) {
794
+ var _a;
795
+ const value = `; ${document.cookie}`;
796
+ const parts = value.split(`; ${name}=`);
797
+ if (parts.length === 2)
798
+ return (_a = parts.pop()) === null || _a === void 0 ? void 0 : _a.split(';').shift();
799
+ return '';
800
+ }
801
+ decodeURIComponent((_a = getCookie('OptanonConsent')) !== null && _a !== void 0 ? _a : '');
802
+ if (((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && !(window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups.includes('4')))) {
803
+ return true;
804
+ }
805
+ return false;
806
+ }, [globalConfig]);
738
807
  // bff API 请求方法
739
808
  const bffFetch = React.useCallback((path, options, isBota = true) => {
740
809
  var _a;
@@ -761,6 +830,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
761
830
  }, [bffDataSource, fakeUserId]);
762
831
  const bffCollectEvent = React.useCallback((params) => {
763
832
  var _a;
833
+ if (isActiveTargetingCookie)
834
+ return Promise.resolve();
764
835
  const body = {
765
836
  eventName: params === null || params === void 0 ? void 0 : params.eventName,
766
837
  eventSource: params === null || params === void 0 ? void 0 : params.eventSource
@@ -771,39 +842,42 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
771
842
  body,
772
843
  type: 'beacon'
773
844
  }, false);
774
- }, [bffFetch, bffDataSource]);
845
+ }, [bffFetch, bffDataSource, isActiveTargetingCookie]);
775
846
  React.useEffect(() => {
776
- if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
777
- const OriginalImage = window.Image;
778
- window.Image = function () {
779
- const img = new OriginalImage();
780
- // 劫持 src 的 setter
781
- const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
782
- Object.defineProperty(img, 'src', {
783
- set(value) {
784
- // 继续正常设置 src
785
- originalSrcDescriptor.set.call(this, value);
786
- // img.onload = function () {
787
- // 检查是否是目标 URL
788
- if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
789
- // 解析 URL 参数
790
- const url = new URL(value);
791
- const params = Object.fromEntries(url.searchParams.entries());
792
- bffCollectEvent({
793
- eventName: params === null || params === void 0 ? void 0 : params.ev,
794
- eventSource: 'Meta Pixel'
795
- });
796
- // }
797
- }
798
- },
799
- get() {
800
- return originalSrcDescriptor.get.call(this);
847
+ // if (typeof (window as any)?.fbq === 'function') {
848
+ const OriginalImage = window.Image;
849
+ window.Image = function () {
850
+ const img = new OriginalImage();
851
+ // 劫持 src 的 setter
852
+ const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
853
+ Object.defineProperty(img, 'src', {
854
+ set(value) {
855
+ if (isActiveTargetingCookie && (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/') || value.includes('https://www.facebook.com/tr'))) {
856
+ return;
801
857
  }
802
- });
803
- return img;
804
- };
805
- }
806
- }, [bffCollectEvent]);
858
+ // 继续正常设置 src
859
+ originalSrcDescriptor.set.call(this, value);
860
+ // img.onload = function () {
861
+ // 检查是否是目标 URL
862
+ if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
863
+ // 解析 URL 参数
864
+ const url = new URL(value);
865
+ const params = Object.fromEntries(url.searchParams.entries());
866
+ bffCollectEvent({
867
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
868
+ eventSource: 'Meta Pixel'
869
+ });
870
+ // }
871
+ }
872
+ },
873
+ get() {
874
+ return originalSrcDescriptor.get.call(this);
875
+ }
876
+ });
877
+ return img;
878
+ };
879
+ // }
880
+ }, [bffCollectEvent, isActiveTargetingCookie]);
807
881
  React.useEffect(() => {
808
882
  // 类型安全声明
809
883
  const navigatorWithBeacon = navigator;
@@ -816,6 +890,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
816
890
  // 覆盖方法
817
891
  navigatorWithBeacon.sendBeacon = function (url, data) {
818
892
  const urlString = url instanceof URL ? url.href : url.toString();
893
+ if (isActiveTargetingCookie && (urlString.includes('https://tr.snapchat.com/p') || urlString.includes('https://analytics.tiktok.com/api/v2/pixel'))) {
894
+ return true;
895
+ }
819
896
  const success = originalSendBeacon(url, data);
820
897
  function parseBeaconData(data) {
821
898
  return __awaiter(this, void 0, void 0, function* () {
@@ -865,7 +942,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
865
942
  return () => {
866
943
  navigatorWithBeacon.sendBeacon = originalSendBeacon;
867
944
  };
868
- }, [bffCollectEvent]);
945
+ }, [bffCollectEvent, isActiveTargetingCookie]);
869
946
  React.useEffect(() => {
870
947
  const _originalFetch = window.fetch;
871
948
  // 覆盖 fetch 方法
@@ -887,6 +964,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
887
964
  return _originalFetch.apply(this, arguments_1);
888
965
  }
889
966
  try {
967
+ if (isActiveTargetingCookie && (url.includes('https://www.google-analytics.com/g/collect') || url.includes('https://arms-retcode.aliyuncs.com/r.png'))) {
968
+ return Promise.resolve(new Response(''));
969
+ }
890
970
  // 1. 先执行原始请求
891
971
  const response = _originalFetch.apply(this, arguments_1);
892
972
  // 检查是否是 GA4 收集端点
@@ -930,7 +1010,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
930
1010
  }
931
1011
  });
932
1012
  };
933
- }, [bffCollectEvent]);
1013
+ }, [bffCollectEvent, isActiveTargetingCookie]);
934
1014
  React.useEffect(() => {
935
1015
  const originalOpen = XMLHttpRequest.prototype.open;
936
1016
  const originalSend = XMLHttpRequest.prototype.send;
@@ -940,6 +1020,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
940
1020
  };
941
1021
  XMLHttpRequest.prototype.send = function (body) {
942
1022
  var _a;
1023
+ if (isActiveTargetingCookie && this._url && typeof this._url === 'string' && (this._url.includes('https://rumcollector.uptime.com') || this._url.includes('https://arms-retcode.aliyuncs.com/r.png') || this._url.includes('https://i.giesswein.com/nb-collector'))) {
1024
+ return;
1025
+ }
943
1026
  if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
944
1027
  if (body && typeof body === 'string') {
945
1028
  try {
@@ -965,7 +1048,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
965
1048
  XMLHttpRequest.prototype.open = originalOpen;
966
1049
  XMLHttpRequest.prototype.send = originalSend;
967
1050
  };
968
- }, [bffCollectEvent]);
1051
+ }, [bffCollectEvent, isActiveTargetingCookie]);
969
1052
  React.useEffect(() => {
970
1053
  if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
971
1054
  window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
@@ -1095,7 +1178,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1095
1178
  const bffEventReport = React.useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
1096
1179
  var _a, _b;
1097
1180
  // 关闭 BFF 事件上报
1098
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
1181
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
1099
1182
  return;
1100
1183
  }
1101
1184
  // 用户信息都是公共的
@@ -1136,7 +1219,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1136
1219
  layoutVariantId,
1137
1220
  globalConfig,
1138
1221
  playbookType,
1139
- bffDataSource
1222
+ bffDataSource,
1223
+ isActiveTargetingCookie
1140
1224
  ]);
1141
1225
  const getEventParamsByJson = React.useCallback((json, product) => {
1142
1226
  var _a, _b, _c;
@@ -1201,7 +1285,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1201
1285
  }, [fakeUserId]);
1202
1286
  const bffFbReport = React.useCallback(({ eventName, product }) => {
1203
1287
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1204
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
1288
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
1205
1289
  return;
1206
1290
  }
1207
1291
  let isPushState = false;
@@ -1267,7 +1351,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
1267
1351
  type: 'beacon'
1268
1352
  });
1269
1353
  }
1270
- }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
1354
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson, isActiveTargetingCookie]);
1271
1355
  const bffMutateLike = React.useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
1272
1356
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
1273
1357
  return res === null || res === void 0 ? void 0 : res.success;
@@ -19239,7 +19323,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19239
19323
  React.createElement(Nudge, { nudge: nudge }),
19240
19324
  ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
19241
19325
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
19242
- React.createElement("div", null,
19326
+ React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
19243
19327
  React.createElement(ExpandableText$1, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_l = (_k = rec === null || rec === void 0 ? void 0 : rec.video) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
19244
19328
  React.createElement(RenderCard$1, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
19245
19329
  React.createElement(Hashtag$1, { index: activeIndex, tags: (_o = (_m = rec === null || rec === void 0 ? void 0 : rec.video) === null || _m === void 0 ? void 0 : _m.hashTags) !== null && _o !== void 0 ? _o : [], itemId: (_p = rec === null || rec === void 0 ? void 0 : rec.video) === null || _p === void 0 ? void 0 : _p.itemId, itemType: ((_q = rec === null || rec === void 0 ? void 0 : rec.video) === null || _q === void 0 ? void 0 : _q.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle, hashTagRightMargin: containerWidth - (hashTagRightMargin !== null && hashTagRightMargin !== void 0 ? hashTagRightMargin : 0) }))),
@@ -19485,68 +19569,71 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
19485
19569
  isReload,
19486
19570
  renderToggleButton
19487
19571
  ]);
19488
- return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19489
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
19490
- waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
19491
- const isEq = lodash.isEqual(rtcList, cacheRtcList);
19492
- if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
19493
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
19494
- }
19495
- setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
19496
- } })),
19497
- renderLogo,
19498
- React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
19499
- top: minusHeight
19500
- } }),
19501
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
19502
- ((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) &&
19503
- !waterFallData && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
19504
- var _a, _b;
19505
- const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
19506
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19507
- eventInfo: {
19508
- eventSubject: 'backMultiPostClick',
19509
- eventDescription: 'backMultiPostClick',
19510
- traceInfo: ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || ''
19572
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
19573
+ (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
19574
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
19575
+ waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
19576
+ const isEq = lodash.isEqual(rtcList, cacheRtcList);
19577
+ if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
19578
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
19511
19579
  }
19512
- });
19513
- location === null || location === void 0 ? void 0 : location.reload();
19514
- } })),
19515
- isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
19516
- React.createElement(Swiper, { style: {
19517
- marginTop: tagHeight
19518
- }, ref: swiperRef, onSlideChange: () => {
19519
- swiperRef.current.swiper.allowTouchMove = false;
19520
- setTimeout(() => {
19521
- swiperRef.current.swiper.allowTouchMove = true;
19522
- }, 500);
19523
- }, onActiveIndexChange: (swiper) => {
19524
- setActiveIndex(swiper.activeIndex);
19525
- if (openHashtag)
19526
- return;
19527
- // 处理上滑下滑事件
19528
- handleScrollEvent(swiper);
19529
- if (waterFallData || isEditor || isDiyH5)
19530
- return;
19531
- if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
19532
- if (!isLoadMore) {
19533
- setIsLoadMore(true);
19534
- loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
19535
- var _a;
19536
- setIsLoadMore(false);
19537
- if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
19538
- setPageNum(pageNum + 1);
19539
- }
19540
- });
19580
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
19581
+ } })),
19582
+ renderLogo,
19583
+ React.createElement(Tagbar$1, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
19584
+ top: minusHeight
19585
+ } }),
19586
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack$1, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
19587
+ ((((_l = (_k = (_j = (_h = (_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _g === void 0 ? void 0 : _g[0]) === null || _h === void 0 ? void 0 : _h.item) === null || _j === void 0 ? void 0 : _j.props) === null || _k === void 0 ? void 0 : _k.backButton) === null || _l === void 0 ? void 0 : _l.enable) && channel) || openMultiPosts) &&
19588
+ !waterFallData && (React.createElement(NavBack$1, { data: (_q = (_p = (_o = (_m = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _m === void 0 ? void 0 : _m[0]) === null || _o === void 0 ? void 0 : _o.item) === null || _p === void 0 ? void 0 : _p.props) === null || _q === void 0 ? void 0 : _q.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => {
19589
+ var _a, _b;
19590
+ const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
19591
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
19592
+ eventInfo: {
19593
+ eventSubject: 'backMultiPostClick',
19594
+ eventDescription: 'backMultiPostClick',
19595
+ traceInfo: ((_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.traceInfo) || ((_b = item === null || item === void 0 ? void 0 : item.product) === null || _b === void 0 ? void 0 : _b.traceInfo) || ''
19596
+ }
19597
+ });
19598
+ location === null || location === void 0 ? void 0 : location.reload();
19599
+ } })),
19600
+ isShowFingerTip ? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 - ((_r = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _r !== void 0 ? _r : 0)}%` }, duration: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swiperTipAniDur })) : null,
19601
+ React.createElement(Swiper, { style: {
19602
+ marginTop: tagHeight
19603
+ }, ref: swiperRef, onSlideChange: () => {
19604
+ swiperRef.current.swiper.allowTouchMove = false;
19605
+ setTimeout(() => {
19606
+ swiperRef.current.swiper.allowTouchMove = true;
19607
+ }, 500);
19608
+ }, onActiveIndexChange: (swiper) => {
19609
+ setActiveIndex(swiper.activeIndex);
19610
+ if (openHashtag)
19611
+ return;
19612
+ // 处理上滑下滑事件
19613
+ handleScrollEvent(swiper);
19614
+ if (waterFallData || isEditor || isDiyH5)
19615
+ return;
19616
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
19617
+ if (!isLoadMore) {
19618
+ setIsLoadMore(true);
19619
+ loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
19620
+ var _a;
19621
+ setIsLoadMore(false);
19622
+ if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
19623
+ setPageNum(pageNum + 1);
19624
+ }
19625
+ });
19626
+ }
19541
19627
  }
19542
- }
19543
- }, direction: 'vertical', height: height },
19544
- renderView,
19545
- renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19546
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19547
- React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19548
- React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19549
- openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } })))))));
19628
+ }, direction: 'vertical', height: height },
19629
+ renderView,
19630
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
19631
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
19632
+ React.createElement(WaterFall$1, Object.assign({}, (_u = (_t = (_s = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _s === void 0 ? void 0 : _s[0]) === null || _t === void 0 ? void 0 : _t.item) === null || _u === void 0 ? void 0 : _u.props)),
19633
+ React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
19634
+ openMultiPosts && (React.createElement(MultiPosts$2, Object.assign({}, (_x = (_w = (_v = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.item) === null || _x === void 0 ? void 0 : _x.props, (_0 = (_z = (_y = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.multiPosts) === null || _y === void 0 ? void 0 : _y[0]) === null || _z === void 0 ? void 0 : _z.item) === null || _0 === void 0 ? void 0 : _0.event, { style: { position: 'fixed', top: 0, left: 0, right: 0 } }))))),
19635
+ (window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (React.createElement("div", { style: { position: 'fixed', bottom: 0, left: 0, right: 0, width: '100%', zIndex: 10, backgroundColor: '#000', fontSize: 0 } },
19636
+ React.createElement("button", { id: 'ot-sdk-btn', className: 'ot-sdk-show-settings', style: { textDecoration: 'underline', width: 'fit-content', border: 'none', lineHeight: '24px', fontSize: '10px', color: '#fff', padding: '0 20px' } }, "Cookie settings")))));
19550
19637
  };
19551
19638
  var SxpPageRender$1 = React.memo(SxpPageRender);
19552
19639