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

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 (74) hide show
  1. package/dist/index.cjs +364 -252
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +7 -15
  4. package/dist/index.js +364 -252
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +6 -6
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +6 -6
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +364 -252
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +6 -6
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/DiyPortalPreview/index.js +3 -5
  15. package/es/core/components/DiyStoryPreview/index.js +18 -7
  16. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  17. package/es/core/components/SxpPageRender/RenderCard.js +2 -14
  18. package/es/core/components/SxpPageRender/index.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/index.js +98 -64
  20. package/es/core/context/SxpDataSourceProvider.d.ts +2 -0
  21. package/es/core/context/SxpDataSourceProvider.js +71 -27
  22. package/es/core/utils/tool.d.ts +3 -1
  23. package/es/core/utils/tool.js +29 -1
  24. package/es/materials/sxp/consentPopup/Display/index.js +1 -1
  25. package/es/materials/sxp/cta/AniLinkPopup/material.js +3 -2
  26. package/es/materials/sxp/popup/CommodityDetail/material.js +2 -1
  27. package/es/materials/sxp/popup/CommodityList/index.js +5 -4
  28. package/es/materials/sxp/popup/CommodityList/material.js +1 -1
  29. package/es/materials/sxp/popup/CommodityList/settingRender.js +1 -1
  30. package/es/materials/sxp/template/Appoint/material.js +2 -1
  31. package/es/materials/sxp/template/Commodity/material.js +3 -2
  32. package/es/materials/sxp/template/CommodityDiro/material.js +3 -2
  33. package/es/materials/sxp/template/CommodityDiroNew/material.js +4 -2
  34. package/es/materials/sxp/template/Link/material.js +4 -2
  35. package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
  36. package/es/materials/sxp/template/MultiCommodity/material.js +2 -1
  37. package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  38. package/es/materials/sxp/template/MultiCommodityDiro/material.js +3 -2
  39. package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
  40. package/es/materials/sxp/template/MultiCommodityDiroNew/material.js +4 -2
  41. package/es/materials/sxp/template/NineCommodity/material.js +3 -2
  42. package/es/materials/sxp/template/components/CommodityGroup.js +1 -1
  43. package/es/materials/sxp/template/components/settingRender.js +1 -1
  44. package/lib/core/components/DiyPortalPreview/index.js +3 -5
  45. package/lib/core/components/DiyStoryPreview/index.js +18 -7
  46. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  47. package/lib/core/components/SxpPageRender/RenderCard.js +2 -14
  48. package/lib/core/components/SxpPageRender/index.d.ts +1 -0
  49. package/lib/core/components/SxpPageRender/index.js +98 -64
  50. package/lib/core/context/SxpDataSourceProvider.d.ts +2 -0
  51. package/lib/core/context/SxpDataSourceProvider.js +71 -27
  52. package/lib/core/utils/tool.d.ts +3 -1
  53. package/lib/core/utils/tool.js +31 -1
  54. package/lib/materials/sxp/consentPopup/Display/index.js +1 -1
  55. package/lib/materials/sxp/cta/AniLinkPopup/material.js +2 -1
  56. package/lib/materials/sxp/popup/CommodityDetail/material.js +2 -1
  57. package/lib/materials/sxp/popup/CommodityList/index.js +5 -4
  58. package/lib/materials/sxp/popup/CommodityList/material.js +1 -1
  59. package/lib/materials/sxp/popup/CommodityList/settingRender.js +1 -1
  60. package/lib/materials/sxp/template/Appoint/material.js +2 -1
  61. package/lib/materials/sxp/template/Commodity/material.js +3 -2
  62. package/lib/materials/sxp/template/CommodityDiro/material.js +3 -2
  63. package/lib/materials/sxp/template/CommodityDiroNew/material.js +4 -2
  64. package/lib/materials/sxp/template/Link/material.js +4 -2
  65. package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
  66. package/lib/materials/sxp/template/MultiCommodity/material.js +2 -1
  67. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
  68. package/lib/materials/sxp/template/MultiCommodityDiro/material.js +3 -2
  69. package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +2 -2
  70. package/lib/materials/sxp/template/MultiCommodityDiroNew/material.js +4 -2
  71. package/lib/materials/sxp/template/NineCommodity/material.js +3 -2
  72. package/lib/materials/sxp/template/components/CommodityGroup.js +1 -1
  73. package/lib/materials/sxp/template/components/settingRender.js +1 -1
  74. package/package.json +1 -1
@@ -59,7 +59,7 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
59
59
  const CTA = (rec, index) => {
60
60
  if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)) {
61
61
  return (React.createElement("div", { className: 'clc-sxp-bottom-card' },
62
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: true })));
62
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER })));
63
63
  }
64
64
  return null;
65
65
  };
@@ -72,10 +72,8 @@ const DiyPortalPreview = ({ data = [], globalConfig, tipText, nudge, tempMap, de
72
72
  React.createElement(Nudge, { nudge: nudge }),
73
73
  CTA(rec, index),
74
74
  React.createElement("div", null,
75
- 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: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) }),
76
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: true })),
77
- React.createElement(Hashtag, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })),
78
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: true })));
75
+ 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: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', 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' }) })),
76
+ React.createElement(Hashtag, { index: index, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle }))));
79
77
  }
80
78
  return null;
81
79
  };
@@ -81,10 +81,21 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
81
81
  return null;
82
82
  }, [globalConfig]);
83
83
  const renderBottom = (rec, index) => {
84
- var _a, _b, _c, _d;
84
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
85
85
  if (rec === null || rec === void 0 ? void 0 : rec.video) {
86
+ let cta = null;
87
+ if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
88
+ cta = '多商品CTA';
89
+ }
90
+ else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
91
+ cta = '商品CTA';
92
+ }
93
+ else {
94
+ cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
95
+ }
96
+ const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
86
97
  return (React.createElement(React.Fragment, null,
87
- ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && (React.createElement("div", { style: {
98
+ ((_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.title) && (React.createElement("div", { style: {
88
99
  background: 'repeating-linear-gradient(0deg, rgba(26, 26, 25, 0.7), hsla(0, 0%, 100%, 0))',
89
100
  height: '130px',
90
101
  position: 'absolute',
@@ -95,7 +106,7 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
95
106
  pointerEvents
96
107
  } })),
97
108
  React.createElement("div", { style: {
98
- marginBottom: `${(_b = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _b !== void 0 ? _b : 40}px`,
109
+ marginBottom: `${(_g = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _g !== void 0 ? _g : 40}px`,
99
110
  zIndex: 999,
100
111
  position: 'absolute',
101
112
  bottom: 0,
@@ -104,11 +115,11 @@ const DiyStoryPreview = forwardRef(({ data = [], globalConfig, tipText, nudge, t
104
115
  paddingTop: '20px'
105
116
  } },
106
117
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) ? (React.createElement("div", { style: {} },
107
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex }))) : null,
118
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, isActive: index === activeIndex, value: value }))) : null,
108
119
  React.createElement("div", null,
109
- React.createElement(ExpandableText, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_d = (_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : '', 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', padding: '0 20px', fontSize: '12px' }) }),
110
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex }))),
111
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
120
+ React.createElement(ExpandableText, { isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_j = (_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : '', 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', padding: '0 20px', fontSize: '12px' }) }),
121
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }))),
122
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: RESOLVER, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
112
123
  }
113
124
  return null;
114
125
  };
@@ -8,6 +8,7 @@ interface IRenderCardProps {
8
8
  resolver: any;
9
9
  includesCtaType?: string[];
10
10
  isActive?: boolean;
11
+ value?: any;
11
12
  isNineProduct?: boolean;
12
13
  }
13
14
  declare const _default: React.NamedExoticComponent<IRenderCardProps>;
@@ -3,22 +3,10 @@ import './index.less';
3
3
  import { cloneDeep } from 'lodash';
4
4
  import withBindDataSource from '../../../core/hoc/withBindDataSource';
5
5
  import { useEditor } from '../../../core/hooks';
6
- const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, isNineProduct }) => {
7
- var _a, _b, _c, _d, _e;
6
+ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive, value, isNineProduct }) => {
8
7
  const { schema } = useEditor();
9
8
  if (!(rec === null || rec === void 0 ? void 0 : rec.video))
10
9
  return null;
11
- let cta = null;
12
- if ((_b = (_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) {
13
- cta = '多商品CTA';
14
- }
15
- else if ((_c = rec === null || rec === void 0 ? void 0 : rec.video) === null || _c === void 0 ? void 0 : _c.bindProduct) {
16
- cta = '商品CTA';
17
- }
18
- else {
19
- cta = (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId;
20
- }
21
- const value = tempMap === null || tempMap === void 0 ? void 0 : tempMap[cta];
22
10
  const renderComp = useMemo(() => {
23
11
  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;
24
12
  if (includesCtaType && !(includesCtaType === null || includesCtaType === void 0 ? void 0 : includesCtaType.includes((_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type)))
@@ -43,7 +31,7 @@ const RenderCard = ({ rec, index, tempMap, resolver, includesCtaType, isActive,
43
31
  const sbf = style.backdropFilter;
44
32
  style.backdropFilter = `blur(${sbf !== null && sbf !== void 0 ? sbf : 0}px)`;
45
33
  }
46
- return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginInlineStart: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
34
+ return (React.createElement(Component, Object.assign({ style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), style), { zIndex: 50, marginLeft: '20px', boxSizing: 'border-box', transform: 'translate3d(0px, 0px, 0px)' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_z = value === null || value === void 0 ? void 0 : value.item) === null || _z === void 0 ? void 0 : _z.textStyle), bindDatas: (_1 = (_0 = value === null || value === void 0 ? void 0 : value.item) === null || _0 === void 0 ? void 0 : _0.bindDatas) !== null && _1 !== void 0 ? _1 : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_2 = value === null || value === void 0 ? void 0 : value.item) === null || _2 === void 0 ? void 0 : _2.props, { event: ((_3 = value === null || value === void 0 ? void 0 : value.item) === null || _3 === void 0 ? void 0 : _3.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, key: value === null || value === void 0 ? void 0 : value.id, recData: rec, isExternalLink: isExternalLink, index: index, isActive: isActive })));
47
35
  }
48
36
  else {
49
37
  return null;
@@ -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;
@@ -26,6 +26,7 @@ import ConsentPopup from './ConsentPopup';
26
26
  import MultiPosts from '../../../materials/sxp/MultiPosts';
27
27
  import { useEditorDataProvider } from '../../../core/context/EditorDataProvider';
28
28
  import NavBack from './NavBack';
29
+ import { deleteCookie, getCookie, setCookie } from '../../../core/utils/tool';
29
30
  const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.innerHeight, containerWidth = window.innerWidth, tempMap, resolver, data = [], ctaType, tipText, nudge, _schema, hashTagStyle, hashTagRightMargin, tagList = [], defaultData }) => {
30
31
  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;
31
32
  const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
@@ -42,6 +43,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
42
43
  const skipLinkRef = useRef(false);
43
44
  const [pageNum, setPageNum] = useState(2);
44
45
  const videoWidgetRef = useRef(null);
46
+ const fbcRef = useRef('');
45
47
  const { loadVideos, bffEventReport, loading, setPopupDetailData, ctaEvent, swiperRef, waterFallData, setOpenHashtag, appDomain, openHashtag, loadingImage, isFromHashtag, popupDetailData, bffFbReport, curTime, h5EnterLink, isShowConsent, selectTag, isPreview, isEditor, cacheRtcList, setRtcList, cacheActiveIndex, rtcList, isNoMoreData, channel, refreshFeSession, isDiyH5 } = useSxpDataSource();
46
48
  const { backMainFeed, productView, jumpToWeb } = useEventReport();
47
49
  const isShowFingerTip = useMemo(() => {
@@ -314,17 +316,17 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
314
316
  index === ((rtcList === null || rtcList === void 0 ? void 0 : rtcList[0]) === 'organic menu' ? 2 : 1) &&
315
317
  ((_f = ['MultiCommodity', 'MultiCommodityDiro', 'MultiCommodityDiroNew']) === null || _f === void 0 ? void 0 : _f.includes((_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.type));
316
318
  return (React.createElement(React.Fragment, null,
317
- isNineProduct && (React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, isNineProduct: isNineProduct })),
319
+ isNineProduct && (React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value, isNineProduct: isNineProduct })),
318
320
  ((_h = rec === null || rec === void 0 ? void 0 : rec.video) === null || _h === void 0 ? void 0 : _h.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
319
321
  React.createElement("div", { className: 'clc-sxp-bottom', style: { marginBottom: `${(_j = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.bottomInfoDist) !== null && _j !== void 0 ? _j : 40}px` } },
320
322
  React.createElement(Nudge, { nudge: nudge }),
321
323
  ((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
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex }))) : null,
323
- React.createElement("div", null,
324
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, isActive: index === activeIndex, value: value }))) : null,
325
+ React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
324
326
  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
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex }),
327
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLink'], isActive: index === activeIndex, value: value }),
326
328
  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) }))),
327
- React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex })));
329
+ React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver, includesCtaType: ['AniLinkPopup'], isActive: index === activeIndex, value: value })));
328
330
  }
329
331
  return null;
330
332
  }, [
@@ -479,6 +481,35 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
479
481
  viewTime.current = new Date();
480
482
  }
481
483
  }, [openHashtag, data, activeIndex]);
484
+ useEffect(() => {
485
+ if (!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enableCookieSetting))
486
+ return;
487
+ window.OptanonWrapper = function () {
488
+ var _a, _b;
489
+ const activeGroups = window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups;
490
+ if (!activeGroups)
491
+ return;
492
+ if (activeGroups === null || activeGroups === void 0 ? void 0 : activeGroups.includes('4')) {
493
+ if (fbcRef.current) {
494
+ setCookie('_fbc', fbcRef.current, 90);
495
+ }
496
+ }
497
+ else {
498
+ fbcRef.current = getCookie('_fbc');
499
+ deleteCookie('_fbc');
500
+ const item = data[activeIndex];
501
+ const 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) || '';
502
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
503
+ eventInfo: {
504
+ eventSubject: 'refuseCookie',
505
+ eventDescription: 'refuseCookie',
506
+ traceInfo
507
+ },
508
+ isActiveTargetingCookie: false
509
+ });
510
+ }
511
+ };
512
+ }, [globalConfig, bffEventReport, data, activeIndex]);
482
513
  const handleViewImageStartEvent = (activeIndex, imgInfo, enableCapi) => {
483
514
  var _a, _b, _c, _d, _e, _f, _g, _h;
484
515
  const item = data[activeIndex];
@@ -562,66 +593,69 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
562
593
  isReload,
563
594
  renderToggleButton
564
595
  ]);
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) || ''
596
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' },
597
+ (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
598
+ 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` })) },
599
+ 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: () => {
600
+ const isEq = isEqual(rtcList, cacheRtcList);
601
+ if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {
602
+ setRtcList === null || setRtcList === void 0 ? void 0 : setRtcList(cacheRtcList);
588
603
  }
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
- });
604
+ setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
605
+ } })),
606
+ renderLogo,
607
+ React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
608
+ top: minusHeight
609
+ } }),
610
+ ((_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() })),
611
+ ((((_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) &&
612
+ !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: () => {
613
+ var _a, _b;
614
+ const item = visList === null || visList === void 0 ? void 0 : visList[activeIndex];
615
+ bffEventReport === null || bffEventReport === void 0 ? void 0 : bffEventReport({
616
+ eventInfo: {
617
+ eventSubject: 'backMultiPostClick',
618
+ eventDescription: 'backMultiPostClick',
619
+ 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) || ''
620
+ }
621
+ });
622
+ location === null || location === void 0 ? void 0 : location.reload();
623
+ } })),
624
+ 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,
625
+ React.createElement(Swiper, { style: {
626
+ marginTop: tagHeight
627
+ }, ref: swiperRef, onSlideChange: () => {
628
+ swiperRef.current.swiper.allowTouchMove = false;
629
+ setTimeout(() => {
630
+ swiperRef.current.swiper.allowTouchMove = true;
631
+ }, 500);
632
+ }, onActiveIndexChange: (swiper) => {
633
+ setActiveIndex(swiper.activeIndex);
634
+ if (openHashtag)
635
+ return;
636
+ handleScrollEvent(swiper);
637
+ if (waterFallData || isEditor || isDiyH5)
638
+ return;
639
+ if ((swiper === null || swiper === void 0 ? void 0 : swiper.activeIndex) + 1 >= (data === null || data === void 0 ? void 0 : data.length)) {
640
+ if (!isLoadMore) {
641
+ setIsLoadMore(true);
642
+ loadVideos === null || loadVideos === void 0 ? void 0 : loadVideos(pageNum).then((res) => {
643
+ var _a;
644
+ setIsLoadMore(false);
645
+ if (res && ((_a = res === null || res === void 0 ? void 0 : res.recList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
646
+ setPageNum(pageNum + 1);
647
+ }
648
+ });
649
+ }
617
650
  }
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 } })))))));
651
+ }, direction: 'vertical', height: height },
652
+ renderView,
653
+ renderLikeButton(visList[activeIndex], activeIndex, !!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.likeIconFixed)),
654
+ renderToggleButton(!!(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.muteIconFixed))),
655
+ 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)),
656
+ React.createElement(ConsentPopup, { resolver: resolver, globalConfig: globalConfig }),
657
+ 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 } }))))),
658
+ (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 } },
659
+ 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
660
  };
627
661
  export default memo(SxpPageRender);
@@ -43,6 +43,8 @@ export interface ISxpDataSourceContext {
43
43
  bffEventReport?: (body: {
44
44
  userInfo?: object;
45
45
  eventInfo: object;
46
+ reportLayId?: boolean;
47
+ isActiveTargetingCookie?: boolean;
46
48
  }) => Promise<any> | undefined | boolean;
47
49
  isPreview?: boolean;
48
50
  loading?: boolean;
@@ -105,6 +105,38 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
105
105
  var _a;
106
106
  return ((_a = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _a === void 0 ? void 0 : _a['x-app-id']) + storeAndLoadFeUserId();
107
107
  }, [bffDataSource]);
108
+ const getTargetingCookie = () => {
109
+ var _a;
110
+ function isTargetingRejected(cookieValue) {
111
+ const groupsMatch = cookieValue.match(/groups=([^&]+)/);
112
+ if (!groupsMatch || !groupsMatch[1]) {
113
+ return false;
114
+ }
115
+ const groupsString = groupsMatch[1];
116
+ const groupsPairs = groupsString.split(',');
117
+ for (const pair of groupsPairs) {
118
+ const [category, status] = pair.split(':');
119
+ if (category === '4') {
120
+ return status === '0';
121
+ }
122
+ }
123
+ return false;
124
+ }
125
+ function getCookie(name) {
126
+ var _a;
127
+ const value = `; ${document.cookie}`;
128
+ const parts = value.split(`; ${name}=`);
129
+ if (parts.length === 2)
130
+ return (_a = parts.pop()) === null || _a === void 0 ? void 0 : _a.split(';').shift();
131
+ return '';
132
+ }
133
+ const OptanonConsent = decodeURIComponent((_a = getCookie('OptanonConsent')) !== null && _a !== void 0 ? _a : '');
134
+ console.log('OptanonConsent:', window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups);
135
+ if (((window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups) && !(window === null || window === void 0 ? void 0 : window.OnetrustActiveGroups.includes('4')))) {
136
+ return true;
137
+ }
138
+ return false;
139
+ };
108
140
  const bffFetch = useCallback((path, options, isBota = true) => {
109
141
  var _a;
110
142
  if (!bffDataSource)
@@ -132,6 +164,8 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
132
164
  }, [bffDataSource, fakeUserId]);
133
165
  const bffCollectEvent = useCallback((params) => {
134
166
  var _a;
167
+ if (getTargetingCookie())
168
+ return Promise.resolve();
135
169
  const body = {
136
170
  eventName: params === null || params === void 0 ? void 0 : params.eventName,
137
171
  eventSource: params === null || params === void 0 ? void 0 : params.eventSource
@@ -143,31 +177,32 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
143
177
  }, false);
144
178
  }, [bffFetch, bffDataSource]);
145
179
  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);
180
+ const OriginalImage = window.Image;
181
+ window.Image = function () {
182
+ const img = new OriginalImage();
183
+ const originalSrcDescriptor = Object.getOwnPropertyDescriptor(HTMLImageElement.prototype, 'src');
184
+ Object.defineProperty(img, 'src', {
185
+ set(value) {
186
+ if (getTargetingCookie() && (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/') || value.includes('https://www.facebook.com/tr'))) {
187
+ return;
166
188
  }
167
- });
168
- return img;
169
- };
170
- }
189
+ originalSrcDescriptor.set.call(this, value);
190
+ if (value.includes('https://www.facebook.com/privacy_sandbox/pixel/register/trigger/')) {
191
+ const url = new URL(value);
192
+ const params = Object.fromEntries(url.searchParams.entries());
193
+ bffCollectEvent({
194
+ eventName: params === null || params === void 0 ? void 0 : params.ev,
195
+ eventSource: 'Meta Pixel'
196
+ });
197
+ }
198
+ ;
199
+ },
200
+ get() {
201
+ return originalSrcDescriptor.get.call(this);
202
+ }
203
+ });
204
+ return img;
205
+ };
171
206
  }, [bffCollectEvent]);
172
207
  useEffect(() => {
173
208
  const navigatorWithBeacon = navigator;
@@ -178,6 +213,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
178
213
  const originalSendBeacon = navigatorWithBeacon.sendBeacon.bind(navigatorWithBeacon);
179
214
  navigatorWithBeacon.sendBeacon = function (url, data) {
180
215
  const urlString = url instanceof URL ? url.href : url.toString();
216
+ if (getTargetingCookie() && (urlString.includes('https://tr.snapchat.com/p') || urlString.includes('https://analytics.tiktok.com/api/v2/pixel'))) {
217
+ return true;
218
+ }
181
219
  const success = originalSendBeacon(url, data);
182
220
  function parseBeaconData(data) {
183
221
  return __awaiter(this, void 0, void 0, function* () {
@@ -243,6 +281,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
243
281
  return _originalFetch.apply(this, arguments_1);
244
282
  }
245
283
  try {
284
+ if (getTargetingCookie() && (url.includes('https://www.google-analytics.com/g/collect') || url.includes('https://arms-retcode.aliyuncs.com/r.png'))) {
285
+ return Promise.resolve(new Response(''));
286
+ }
246
287
  const response = _originalFetch.apply(this, arguments_1);
247
288
  if (url.includes('https://www.google-analytics.com/g/collect')) {
248
289
  const urlObj = new URL(url);
@@ -294,6 +335,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
294
335
  };
295
336
  XMLHttpRequest.prototype.send = function (body) {
296
337
  var _a;
338
+ if (getTargetingCookie() && 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'))) {
339
+ return;
340
+ }
297
341
  if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
298
342
  if (body && typeof body === 'string') {
299
343
  try {
@@ -444,9 +488,9 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
444
488
  }
445
489
  return expire;
446
490
  }, [data]);
447
- const bffEventReport = useCallback(({ userInfo, eventInfo, reportLayId = true }) => {
491
+ const bffEventReport = useCallback(({ userInfo, eventInfo, reportLayId = true, isActiveTargetingCookie = true }) => {
448
492
  var _a, _b;
449
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
493
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || (isActiveTargetingCookie && getTargetingCookie())) {
450
494
  return;
451
495
  }
452
496
  if (!userInfo) {
@@ -548,7 +592,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
548
592
  }, [fakeUserId]);
549
593
  const bffFbReport = useCallback(({ eventName, product }) => {
550
594
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
551
- if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview)) {
595
+ if (!enableReportEvent || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) || getTargetingCookie()) {
552
596
  return;
553
597
  }
554
598
  let isPushState = false;
@@ -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 };
@@ -26,7 +26,7 @@ const Display = (_a) => {
26
26
  React.createElement("span", { style: content === null || content === void 0 ? void 0 : content.style, dangerouslySetInnerHTML: {
27
27
  __html: setFontForText((_b = content === null || content === void 0 ? void 0 : content.text) === null || _b === void 0 ? void 0 : _b.replace(/\n/g, '</br>'), content === null || content === void 0 ? void 0 : content.style)
28
28
  } }),
29
- React.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), { marginInlineStart: '5px' }), dangerouslySetInnerHTML: {
29
+ React.createElement("span", { style: Object.assign(Object.assign({}, interaction === null || interaction === void 0 ? void 0 : interaction.style), { marginLeft: '5px' }), dangerouslySetInnerHTML: {
30
30
  __html: setFontForText((_c = interaction === null || interaction === void 0 ? void 0 : interaction.text) === null || _c === void 0 ? void 0 : _c.replace(/\n/g, '</br>'), interaction === null || interaction === void 0 ? void 0 : interaction.style)
31
31
  }, onClick: handleClick })),
32
32
  isShowClose && (React.createElement("button", { "aria-label": 'close', className: 'consentPopupDisplay-close', onClick: handleClickClose },
@@ -1,14 +1,14 @@
1
1
  import settingRender from './settingRender';
2
- import interactionRender from './interactionRender';
3
2
  import AniLinkPopupComponent from '.';
4
3
  import { createMaterial } from '../../../../core/create';
4
+ import interactionRender from './interactionRender';
5
5
  const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
6
6
  displayName: '竖版弹窗CTA',
7
7
  icon: '',
8
8
  category: 'cta',
9
9
  type: 'AniLinkPopup',
10
10
  related: {
11
- settingRender,
11
+ settingRender: settingRender,
12
12
  bindableProps: [],
13
13
  interactionRender
14
14
  },
@@ -24,6 +24,7 @@ const AniLinkPopup = createMaterial(AniLinkPopupComponent, {
24
24
  title: {
25
25
  fontSize: 14,
26
26
  color: '#000',
27
+ textAlign: 'left',
27
28
  lineHeight: 2.6
28
29
  },
29
30
  ctaTitle: {