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.
@@ -13,6 +13,7 @@ export type postConfigType = {
13
13
  };
14
14
  export interface ISxpPageRenderProps {
15
15
  globalConfig?: {
16
+ enableCookieSetting?: boolean;
16
17
  nineProductEnable?: boolean;
17
18
  isShowLogo?: boolean;
18
19
  isShowCTA?: boolean;
@@ -320,7 +320,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
320
320
  React.createElement(Nudge, { nudge: nudge }),
321
321
  ((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' },
322
322
  React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
323
- React.createElement("div", null,
323
+ React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
324
324
  React.createElement(ExpandableText, { 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 }),
325
325
  React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
326
326
  React.createElement(Hashtag, { 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) }))),
@@ -562,66 +562,69 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
562
562
  isReload,
563
563
  renderToggleButton
564
564
  ]);
565
- 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' } },
566
- 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` })) },
567
- waterFallData && (React.createElement(Navbar, { icon: left, 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: () => {
568
- const isEq = isEqual(rtcList, cacheRtcList);
569
- if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
570
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
571
- }
572
- setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
573
- } })),
574
- renderLogo,
575
- React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
576
- top: minusHeight
577
- } }),
578
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
579
- ((((_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) &&
580
- !waterFallData && (React.createElement(NavBack, { 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: () => {
581
- var _a, _b;
582
- const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
583
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
584
- eventInfo: {
585
- eventSubject: 'backMultiPostClick',
586
- eventDescription: 'backMultiPostClick',
587
- 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) || ''
565
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
566
+ (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
567
+ 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` })) },
568
+ waterFallData && (React.createElement(Navbar, { icon: left, 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: () => {
569
+ const isEq = isEqual(rtcList, cacheRtcList);
570
+ if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
571
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
588
572
  }
589
- });
590
- location === null || location === void 0 ? void 0 : location.reload();
591
- } })),
592
- 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,
593
- React.createElement(Swiper, { style: {
594
- marginTop: tagHeight
595
- }, ref: swiperRef, onSlideChange: () => {
596
- swiperRef.current.swiper.allowTouchMove = false;
597
- setTimeout(() => {
598
- swiperRef.current.swiper.allowTouchMove = true;
599
- }, 500);
600
- }, onActiveIndexChange: (swiper) => {
601
- setActiveIndex(swiper.activeIndex);
602
- if (openHashtag)
603
- return;
604
- handleScrollEvent(swiper);
605
- if (waterFallData || isEditor || isDiyH5)
606
- return;
607
- if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
608
- if (!isLoadMore) {
609
- setIsLoadMore(true);
610
- loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
611
- var _a;
612
- setIsLoadMore(false);
613
- if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
614
- setPageNum(pageNum + 1);
615
- }
616
- });
573
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
574
+ } })),
575
+ renderLogo,
576
+ React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
577
+ top: minusHeight
578
+ } }),
579
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (React.createElement(NavBack, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
580
+ ((((_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) &&
581
+ !waterFallData && (React.createElement(NavBack, { 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: () => {
582
+ var _a, _b;
583
+ const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
584
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
585
+ eventInfo: {
586
+ eventSubject: 'backMultiPostClick',
587
+ eventDescription: 'backMultiPostClick',
588
+ 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) || ''
589
+ }
590
+ });
591
+ location === null || location === void 0 ? void 0 : location.reload();
592
+ } })),
593
+ 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,
594
+ React.createElement(Swiper, { style: {
595
+ marginTop: tagHeight
596
+ }, ref: swiperRef, onSlideChange: () => {
597
+ swiperRef.current.swiper.allowTouchMove = false;
598
+ setTimeout(() => {
599
+ swiperRef.current.swiper.allowTouchMove = true;
600
+ }, 500);
601
+ }, onActiveIndexChange: (swiper) => {
602
+ setActiveIndex(swiper.activeIndex);
603
+ if (openHashtag)
604
+ return;
605
+ handleScrollEvent(swiper);
606
+ if (waterFallData || isEditor || isDiyH5)
607
+ return;
608
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
609
+ if (!isLoadMore) {
610
+ setIsLoadMore(true);
611
+ loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
612
+ var _a;
613
+ setIsLoadMore(false);
614
+ if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
615
+ setPageNum(pageNum + 1);
616
+ }
617
+ });
618
+ }
617
619
  }
618
- }
619
- }, direction: 'vertical', height: height },
620
- renderView,
621
- renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
622
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
623
- React.createElement(WaterFall, 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)),
624
- React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
625
- openMultiPosts && (React.createElement(MultiPosts, 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 } })))))));
620
+ }, direction: 'vertical', height: height },
621
+ renderView,
622
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
623
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
624
+ React.createElement(WaterFall, 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)),
625
+ React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
626
+ openMultiPosts && (React.createElement(MultiPosts, 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 } }))))),
627
+ (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 } },
628
+ 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")))));
626
629
  };
627
630
  export default memo(SxpPageRender);
@@ -7,7 +7,7 @@ import { storeAndLoadFeUserId, AGREE_POLICY } from '../utils/localStore';
7
7
  import { useIconLink } from '../components/SxpPageRender/useIconLink';
8
8
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../utils/event';
9
9
  import Consent from '../components/Consent';
10
- import { getCookie, splitUrlParams } from '../utils/tool';
10
+ import { deleteCookie, getCookie, setCookie, splitUrlParams } from '../utils/tool';
11
11
  export const SxpDataSourceContext = createContext({
12
12
  rtcList: [],
13
13
  tagList: []
@@ -50,6 +50,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
50
50
  const [chatlabsId, setChatlabsId] = useState();
51
51
  const finalPageData = useMemo(() => pageData !== null && pageData !== void 0 ? pageData : data, [pageData, data]);
52
52
  const pixelPvStatusRef = useRef(false);
53
+ const fbcRef = useRef('');
53
54
  const isShowConsent = useMemo(() => {
54
55
  var _a, _b, _c, _d;
55
56
  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) &&
@@ -105,6 +106,53 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
105
106
  var _a;
106
107
  return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
107
108
  }, [bffDataSource]);
109
+ useEffect(() => {
110
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
111
+ return;
112
+ fbcRef.current = getCookie('_fbc');
113
+ window.OptanonWrapper = function () {
114
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
115
+ if (!activeGroups)
116
+ return;
117
+ if (!(activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4'))) {
118
+ deleteCookie('_fbc');
119
+ }
120
+ else if (fbcRef.current) {
121
+ setCookie('_fbc', fbcRef.current, 90);
122
+ }
123
+ };
124
+ }, [globalConfig]);
125
+ const isActiveTargetingCookie = useMemo(() => {
126
+ var _a;
127
+ function isTargetingRejected(cookieValue) {
128
+ const groupsMatch = cookieValue.match(/groups=([^&]+)/);
129
+ if (!groupsMatch || !groupsMatch[1]) {
130
+ return false;
131
+ }
132
+ const groupsString = groupsMatch[1];
133
+ const groupsPairs = groupsString.split(',');
134
+ for (const pair of groupsPairs) {
135
+ const [category, status] = pair.split(':');
136
+ if (category === '4') {
137
+ return status === '0';
138
+ }
139
+ }
140
+ return false;
141
+ }
142
+ function getCookie(name) {
143
+ var _a;
144
+ const value = `; ${document.cookie}`;
145
+ const parts = value.split(`; ${name}=`);
146
+ if (parts.length === 2)
147
+ return (_a = parts.pop()) === null || _a === void 0 ? void 0 : _a.split(';').shift();
148
+ return '';
149
+ }
150
+ const OptanonConsent = decodeURIComponent((_a = getCookie('OptanonConsent')) !== null && _a !== void 0 ? _a : '');
151
+ 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')))) {
152
+ return true;
153
+ }
154
+ return false;
155
+ }, [globalConfig]);
108
156
  const bffFetch = useCallback((path, options, isBota = true) => {
109
157
  var _a;
110
158
  if (!bffDataSource)
@@ -132,6 +180,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
132
180
  }, [bffDataSource, fakeUserId]);
133
181
  const bffCollectEvent = useCallback((params) => {
134
182
  var _a;
183
+ if (isActiveTargetingCookie)
184
+ return Promise.resolve();
135
185
  const body = {
136
186
  eventName: params === null || params === void 0 ? void 0 : params.eventName,
137
187
  eventSource: params === null || params === void 0 ? void 0 : params.eventSource
@@ -141,34 +191,35 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
141
191
  body,
142
192
  type: 'beacon'
143
193
  }, false);
144
- }, [bffFetch, bffDataSource]);
194
+ }, [bffFetch, bffDataSource, isActiveTargetingCookie]);
145
195
  useEffect(() => {
146
- if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
147
- const OriginalImage = window.Image;
148
- window.Image = function () {
149
- const img = new OriginalImage();
150
- const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
151
- Object.defineProperty(img, 'src', {
152
- set(value) {
153
- originalSrcDescriptor.set.call(this, value);
154
- if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
155
- const url = new URL(value);
156
- const params = Object.fromEntries(url.searchParams.entries());
157
- bffCollectEvent({
158
- eventName: params === null || params === void 0 ? void 0 : params.ev,
159
- eventSource: 'Meta Pixel'
160
- });
161
- }
162
- ;
163
- },
164
- get() {
165
- return originalSrcDescriptor.get.call(this);
196
+ const OriginalImage = window.Image;
197
+ window.Image = function () {
198
+ const img = new OriginalImage();
199
+ const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
200
+ Object.defineProperty(img, 'src', {
201
+ set(value) {
202
+ if (isActiveTargetingCookie && (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/') || value.includes('https://www.facebook.com/tr'))) {
203
+ return;
166
204
  }
167
- });
168
- return img;
169
- };
170
- }
171
- }, [bffCollectEvent]);
205
+ originalSrcDescriptor.set.call(this, value);
206
+ if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
207
+ const url = new URL(value);
208
+ const params = Object.fromEntries(url.searchParams.entries());
209
+ bffCollectEvent({
210
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
211
+ eventSource: 'Meta Pixel'
212
+ });
213
+ }
214
+ ;
215
+ },
216
+ get() {
217
+ return originalSrcDescriptor.get.call(this);
218
+ }
219
+ });
220
+ return img;
221
+ };
222
+ }, [bffCollectEvent, isActiveTargetingCookie]);
172
223
  useEffect(() => {
173
224
  const navigatorWithBeacon = navigator;
174
225
  if (!navigatorWithBeacon.sendBeacon) {
@@ -178,6 +229,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
178
229
  const originalSendBeacon = navigatorWithBeacon.sendBeacon.bind(navigatorWithBeacon);
179
230
  navigatorWithBeacon.sendBeacon = function (url, data) {
180
231
  const urlString = url instanceof URL ? url.href : url.toString();
232
+ if (isActiveTargetingCookie && (urlString.includes('https://tr.snapchat.com/p') || urlString.includes('https://analytics.tiktok.com/api/v2/pixel'))) {
233
+ return true;
234
+ }
181
235
  const success = originalSendBeacon(url, data);
182
236
  function parseBeaconData(data) {
183
237
  return __awaiter(this, void 0, void 0, function* () {
@@ -223,7 +277,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
223
277
  return () => {
224
278
  navigatorWithBeacon.sendBeacon = originalSendBeacon;
225
279
  };
226
- }, [bffCollectEvent]);
280
+ }, [bffCollectEvent, isActiveTargetingCookie]);
227
281
  useEffect(() => {
228
282
  const _originalFetch = window.fetch;
229
283
  window.fetch = function (input, init) {
@@ -243,6 +297,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
243
297
  return _originalFetch.apply(this, arguments_1);
244
298
  }
245
299
  try {
300
+ if (isActiveTargetingCookie && (url.includes('https://www.google-analytics.com/g/collect') || url.includes('https://arms-retcode.aliyuncs.com/r.png'))) {
301
+ return Promise.resolve(new Response(''));
302
+ }
246
303
  const response = _originalFetch.apply(this, arguments_1);
247
304
  if (url.includes('https://www.google-analytics.com/g/collect')) {
248
305
  const urlObj = new URL(url);
@@ -284,7 +341,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
284
341
  }
285
342
  });
286
343
  };
287
- }, [bffCollectEvent]);
344
+ }, [bffCollectEvent, isActiveTargetingCookie]);
288
345
  useEffect(() => {
289
346
  const originalOpen = XMLHttpRequest.prototype.open;
290
347
  const originalSend = XMLHttpRequest.prototype.send;
@@ -294,6 +351,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
294
351
  };
295
352
  XMLHttpRequest.prototype.send = function (body) {
296
353
  var _a;
354
+ 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'))) {
355
+ return;
356
+ }
297
357
  if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
298
358
  if (body && typeof body === 'string') {
299
359
  try {
@@ -319,7 +379,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
319
379
  XMLHttpRequest.prototype.open = originalOpen;
320
380
  XMLHttpRequest.prototype.send = originalSend;
321
381
  };
322
- }, [bffCollectEvent]);
382
+ }, [bffCollectEvent, isActiveTargetingCookie]);
323
383
  useEffect(() => {
324
384
  if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
325
385
  window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
@@ -446,7 +506,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
446
506
  }, [data]);
447
507
  const bffEventReport = useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
448
508
  var _a, _b;
449
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
509
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
450
510
  return;
451
511
  }
452
512
  if (!userInfo) {
@@ -483,7 +543,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
483
543
  layoutVariantId,
484
544
  globalConfig,
485
545
  playbookType,
486
- bffDataSource
546
+ bffDataSource,
547
+ isActiveTargetingCookie
487
548
  ]);
488
549
  const getEventParamsByJson = useCallback((json, product) => {
489
550
  var _a, _b, _c;
@@ -548,7 +609,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
548
609
  }, [fakeUserId]);
549
610
  const bffFbReport = useCallback(({ eventName, product }) => {
550
611
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
551
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
612
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || isActiveTargetingCookie) {
552
613
  return;
553
614
  }
554
615
  let isPushState = false;
@@ -614,7 +675,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
614
675
  type: 'beacon'
615
676
  });
616
677
  }
617
- }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson]);
678
+ }, [bffFetch, enableReportEvent, enabledMetaConversionApi, globalConfig, bffDataSource, getEventParamsByJson, isActiveTargetingCookie]);
618
679
  const bffMutateLike = useCallback((body) => __awaiter(void 0, void 0, void 0, function* () {
619
680
  const res = yield (bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch('v1/recommend/like', { method: 'POST', body }));
620
681
  return res === null || res === void 0 ? void 0 : res.success;
@@ -13,4 +13,6 @@ declare function getDevice(): string | null;
13
13
  declare function getCookie(val: string): string;
14
14
  declare function getScreenReader(): boolean;
15
15
  declare function splitUrlParams(urlParams: string): string[] | undefined;
16
- export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams };
16
+ declare function deleteCookie(name: string, path?: string, domain?: string): void;
17
+ declare function setCookie(name: string, value: string, days?: number, path?: string, domain?: string, secure?: boolean, sameSite?: string): void;
18
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams, deleteCookie, setCookie };
@@ -191,4 +191,32 @@ function splitUrlParams(urlParams) {
191
191
  });
192
192
  return splitList !== null && splitList !== void 0 ? splitList : [];
193
193
  }
194
- export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams };
194
+ function deleteCookie(name, path = '/', domain = '') {
195
+ const expiration = 'expires=Thu, 01 Jan 1970 00:00:00 GMT';
196
+ const pathPart = path ? `; path=${path}` : '';
197
+ const domainPart = domain ? `; domain=${domain}` : '';
198
+ document.cookie = `${name}=; ${expiration}${pathPart}${domainPart}`;
199
+ console.log(`已尝试删除Cookie: ${name}`);
200
+ }
201
+ function setCookie(name, value, days = 0, path = '/', domain = '', secure = false, sameSite = 'Lax') {
202
+ let cookieString = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
203
+ if (days) {
204
+ const date = new Date();
205
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
206
+ cookieString += `; expires=${date.toUTCString()}`;
207
+ }
208
+ if (path) {
209
+ cookieString += `; path=${path}`;
210
+ }
211
+ if (domain) {
212
+ cookieString += `; domain=${domain}`;
213
+ }
214
+ if (secure) {
215
+ cookieString += '; secure';
216
+ }
217
+ if (sameSite) {
218
+ cookieString += `; samesite=${sameSite}`;
219
+ }
220
+ document.cookie = cookieString;
221
+ }
222
+ export { uuid, getIndexByblockType, getBrowserInfo, getDevice, getSystem, getCookie, getScreenReader, splitUrlParams, deleteCookie, setCookie };
@@ -13,6 +13,7 @@ export type postConfigType = {
13
13
  };
14
14
  export interface ISxpPageRenderProps {
15
15
  globalConfig?: {
16
+ enableCookieSetting?: boolean;
16
17
  nineProductEnable?: boolean;
17
18
  isShowLogo?: boolean;
18
19
  isShowCTA?: boolean;
@@ -323,7 +323,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
323
323
  react_1.default.createElement(Nudge_1.default, { nudge: nudge }),
324
324
  ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) && !isNineProduct ? (react_1.default.createElement("div", { className: 'clc-sxp-bottom-card' },
325
325
  react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
326
- react_1.default.createElement("div", null,
326
+ react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
327
327
  react_1.default.createElement(ExpandableText_1.default, { 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 }),
328
328
  react_1.default.createElement(RenderCard_1.default, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
329
329
  react_1.default.createElement(Hashtag_1.default, { 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) }))),
@@ -565,66 +565,69 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
565
565
  isReload,
566
566
  renderToggleButton
567
567
  ]);
568
- return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
569
- react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.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` })) },
570
- waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, 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: () => {
571
- const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
572
- if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
573
- setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
574
- }
575
- setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
576
- } })),
577
- renderLogo,
578
- react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
579
- top: minusHeight
580
- } }),
581
- ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (react_1.default.createElement(NavBack_1.default, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
582
- ((((_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) &&
583
- !waterFallData && (react_1.default.createElement(NavBack_1.default, { 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: () => {
584
- var _a, _b;
585
- const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
586
- bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
587
- eventInfo: {
588
- eventSubject: 'backMultiPostClick',
589
- eventDescription: 'backMultiPostClick',
590
- 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) || ''
568
+ return (react_1.default.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
569
+ (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (react_1.default.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
570
+ react_1.default.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (react_1.default.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` })) },
571
+ waterFallData && (react_1.default.createElement(Navbar_1.default, { icon: left_png_1.default, 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: () => {
572
+ const isEq = (0, lodash_1.isEqual)(rtcList, cacheRtcList);
573
+ if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
574
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
591
575
  }
592
- });
593
- location === null || location === void 0 ? void 0 : location.reload();
594
- } })),
595
- isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { 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,
596
- react_1.default.createElement(react_2.Swiper, { style: {
597
- marginTop: tagHeight
598
- }, ref: swiperRef, onSlideChange: () => {
599
- swiperRef.current.swiper.allowTouchMove = false;
600
- setTimeout(() => {
601
- swiperRef.current.swiper.allowTouchMove = true;
602
- }, 500);
603
- }, onActiveIndexChange: (swiper) => {
604
- setActiveIndex(swiper.activeIndex);
605
- if (openHashtag)
606
- return;
607
- handleScrollEvent(swiper);
608
- if (waterFallData || isEditor || isDiyH5)
609
- return;
610
- if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
611
- if (!isLoadMore) {
612
- setIsLoadMore(true);
613
- loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
614
- var _a;
615
- setIsLoadMore(false);
616
- if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
617
- setPageNum(pageNum + 1);
618
- }
619
- });
576
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
577
+ } })),
578
+ renderLogo,
579
+ react_1.default.createElement(Tagbar_1.default, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
580
+ top: minusHeight
581
+ } }),
582
+ ((_f = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton) === null || _f === void 0 ? void 0 : _f.enable) && !channel && !openMultiPosts && !waterFallData && (react_1.default.createElement(NavBack_1.default, { data: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.backButton, minusHeight: minusHeight, tagHeight: tagHeight, onClick: () => history === null || history === void 0 ? void 0 : history.back() })),
583
+ ((((_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) &&
584
+ !waterFallData && (react_1.default.createElement(NavBack_1.default, { 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: () => {
585
+ var _a, _b;
586
+ const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
587
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
588
+ eventInfo: {
589
+ eventSubject: 'backMultiPostClick',
590
+ eventDescription: 'backMultiPostClick',
591
+ 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) || ''
592
+ }
593
+ });
594
+ location === null || location === void 0 ? void 0 : location.reload();
595
+ } })),
596
+ isShowFingerTip ? (react_1.default.createElement(FingerSwipeTip_1.default, { 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,
597
+ react_1.default.createElement(react_2.Swiper, { style: {
598
+ marginTop: tagHeight
599
+ }, ref: swiperRef, onSlideChange: () => {
600
+ swiperRef.current.swiper.allowTouchMove = false;
601
+ setTimeout(() => {
602
+ swiperRef.current.swiper.allowTouchMove = true;
603
+ }, 500);
604
+ }, onActiveIndexChange: (swiper) => {
605
+ setActiveIndex(swiper.activeIndex);
606
+ if (openHashtag)
607
+ return;
608
+ handleScrollEvent(swiper);
609
+ if (waterFallData || isEditor || isDiyH5)
610
+ return;
611
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
612
+ if (!isLoadMore) {
613
+ setIsLoadMore(true);
614
+ loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
615
+ var _a;
616
+ setIsLoadMore(false);
617
+ if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
618
+ setPageNum(pageNum + 1);
619
+ }
620
+ });
621
+ }
620
622
  }
621
- }
622
- }, direction: 'vertical', height: height },
623
- renderView,
624
- renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
625
- renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
626
- react_1.default.createElement(WaterFall_1.default, 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)),
627
- react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
628
- openMultiPosts && (react_1.default.createElement(MultiPosts_1.default, 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 } })))))));
623
+ }, direction: 'vertical', height: height },
624
+ renderView,
625
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
626
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
627
+ react_1.default.createElement(WaterFall_1.default, 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)),
628
+ react_1.default.createElement(ConsentPopup_1.default, { resolver: resolver, globalConfig: globalConfig }),
629
+ openMultiPosts && (react_1.default.createElement(MultiPosts_1.default, 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 } }))))),
630
+ (window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting) && (react_1.default.createElement("div", { style: { position: 'fixed', bottom: 0, left: 0, right: 0, width: '100%', zIndex: 10, backgroundColor: '#000', fontSize: 0 } },
631
+ react_1.default.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")))));
629
632
  };
630
633
  exports.default = (0, react_1.memo)(SxpPageRender);