@streamlayer/react 1.23.0 → 1.23.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.
- package/lib/app/pause-ad.d.ts +2 -4
- package/lib/app/polymarket.d.ts +7 -0
- package/lib/cjs/Question.js +1 -1
- package/lib/cjs/advertisement.js +28 -223
- package/lib/cjs/analytics.js +1 -1
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/feature.js +1 -0
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/hooks-WfHlJH12.js +1 -0
- package/lib/cjs/index-eShKGO10.js +1 -5
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index10.js +1 -4
- package/lib/cjs/index11.js +3 -1
- package/lib/cjs/index12.js +1 -1
- package/lib/cjs/index13.js +3 -1
- package/lib/cjs/index14.js +1 -1
- package/lib/cjs/index15.js +1 -5
- package/lib/cjs/index16.js +3 -0
- package/lib/cjs/index2.js +1 -1
- package/lib/cjs/index3.js +1 -1
- package/lib/cjs/index4.js +3 -5
- package/lib/cjs/index5.js +1 -1
- package/lib/cjs/index6.js +1 -1
- package/lib/cjs/index7.js +1 -1
- package/lib/cjs/index8.js +1 -1
- package/lib/cjs/index9.js +1 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +1 -13
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/polymarket.js +9 -0
- package/lib/cjs/sl-types.js +1 -15
- package/lib/cjs/storage.js +1 -1
- package/lib/cjs/style.css +1 -0
- package/lib/cjs/theme.js +1 -17
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +3 -17
- package/lib/cjs/utils.js +1 -47
- package/lib/classic/app/pause-ad.d.ts +2 -4
- package/lib/classic/app/polymarket.d.ts +7 -0
- package/lib/classic/cjs/Question.js +1 -1
- package/lib/classic/cjs/advertisement.js +28 -223
- package/lib/classic/cjs/analytics.js +1 -1
- package/lib/classic/cjs/auth.js +1 -1
- package/lib/classic/cjs/bet-pack.js +3 -5
- package/lib/classic/cjs/feature.js +1 -0
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/hooks-WfHlJH12.js +1 -0
- package/lib/classic/cjs/index-eShKGO10.js +1 -5
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index10.js +1 -1
- package/lib/classic/cjs/index11.js +1 -1
- package/lib/classic/cjs/index12.js +1 -4
- package/lib/classic/cjs/index13.js +3 -0
- package/lib/classic/cjs/index2.js +3 -5
- package/lib/classic/cjs/index3.js +1 -1
- package/lib/classic/cjs/index4.js +1 -1
- package/lib/classic/cjs/index5.js +1 -1
- package/lib/classic/cjs/index6.js +1 -1
- package/lib/classic/cjs/index7.js +1 -1
- package/lib/classic/cjs/index8.js +1 -1
- package/lib/classic/cjs/index9.js +3 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/notification2.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/polymarket.js +9 -0
- package/lib/classic/cjs/sl-types.js +1 -15
- package/lib/classic/cjs/style.css +1 -0
- package/lib/classic/cjs/useStreamLayerApp.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +3 -17
- package/lib/classic/cjs/utils.js +1 -47
- package/lib/classic/es/Question.js +277 -264
- package/lib/classic/es/advertisement.js +34990 -18881
- package/lib/classic/es/analytics.js +58 -56
- package/lib/classic/es/auth.js +14 -8
- package/lib/classic/es/bet-pack.js +2448 -2418
- package/lib/classic/es/feature.js +108 -0
- package/lib/classic/es/gamification-feature.js +2 -2
- package/lib/classic/es/hooks-WfHlJH12.js +98 -0
- package/lib/classic/es/index-eShKGO10.js +948 -948
- package/lib/classic/es/index.js +13 -13
- package/lib/classic/es/index10.js +83 -2295
- package/lib/classic/es/index11.js +3095 -179
- package/lib/classic/es/index12.js +174 -821
- package/lib/classic/es/index13.js +850 -0
- package/lib/classic/es/index2.js +2099 -1763
- package/lib/classic/es/index3.js +11 -11
- package/lib/classic/es/index4.js +127 -127
- package/lib/classic/es/index5.js +3 -5
- package/lib/classic/es/index6.js +10 -11
- package/lib/classic/es/index7.js +6 -62
- package/lib/classic/es/index8.js +9 -316
- package/lib/classic/es/index9.js +316 -82
- package/lib/classic/es/insight.js +58 -53
- package/lib/classic/es/notification.js +5 -5
- package/lib/classic/es/notification2.js +765 -722
- package/lib/classic/es/pause-ad.js +190 -167
- package/lib/classic/es/points.js +55 -47
- package/lib/classic/es/polymarket.js +6848 -0
- package/lib/classic/es/sl-types.js +193 -125
- package/lib/classic/es/useStreamLayerApp.js +2 -2
- package/lib/classic/es/useStreamLayerApp2.js +9727 -7592
- package/lib/classic/es/utils.js +28 -28
- package/lib/classic/index.d.ts +1 -0
- package/lib/classic/style.css +1 -0
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/index-eShKGO10.js +1 -5
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +3 -77
- package/lib/dist/es/gamification-feature.js +2 -2
- package/lib/dist/es/index-eShKGO10.js +948 -948
- package/lib/dist/es/index.js +7 -8
- package/lib/dist/es/masters.js +18212 -14741
- package/lib/dist/index.d.ts +29 -8
- package/lib/dist/style.css +1 -1
- package/lib/es/Question.js +108 -106
- package/lib/es/advertisement.js +34990 -18881
- package/lib/es/analytics.js +58 -56
- package/lib/es/auth.js +14 -8
- package/lib/es/bet-pack.js +29 -17
- package/lib/es/feature.js +108 -0
- package/lib/es/gamification-feature.js +2 -2
- package/lib/es/gamification-feature2.js +2 -2
- package/lib/es/hooks-WfHlJH12.js +98 -0
- package/lib/es/index-eShKGO10.js +948 -948
- package/lib/es/index.js +14 -13
- package/lib/es/index10.js +258 -816
- package/lib/es/index11.js +837 -170
- package/lib/es/index12.js +181 -312
- package/lib/es/index13.js +316 -82
- package/lib/es/index14.js +83 -2350
- package/lib/es/index15.js +3069 -1224
- package/lib/es/index16.js +1453 -0
- package/lib/es/index2.js +1118 -984
- package/lib/es/index3.js +3 -62
- package/lib/es/index4.js +2424 -2407
- package/lib/es/index5.js +11 -11
- package/lib/es/index6.js +127 -127
- package/lib/es/index7.js +10 -7
- package/lib/es/index8.js +5 -9
- package/lib/es/index9.js +10 -265
- package/lib/es/insight.js +58 -53
- package/lib/es/masters.js +6 -5
- package/lib/es/masters2.js +696 -558
- package/lib/es/notification.js +697 -655
- package/lib/es/pause-ad.js +190 -167
- package/lib/es/points.js +56 -48
- package/lib/es/polymarket.js +6848 -0
- package/lib/es/sl-types.js +200 -132
- package/lib/es/storage.js +75 -74
- package/lib/es/theme.js +177 -31
- package/lib/es/useStreamLayerApp.js +2 -2
- package/lib/es/useStreamLayerApp2.js +9727 -7592
- package/lib/es/utils.js +28 -28
- package/lib/index.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +33 -20
- package/lib/cjs/hooks-B0Qttldg.js +0 -1
- package/lib/classic/cjs/hooks-B0Qttldg.js +0 -1
- package/lib/classic/es/hooks-B0Qttldg.js +0 -98
- package/lib/es/hooks-B0Qttldg.js +0 -98
|
@@ -1,257 +1,280 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { h
|
|
3
|
-
import { s as
|
|
4
|
-
import { d as
|
|
5
|
-
import { useState
|
|
6
|
-
import { e as
|
|
7
|
-
import { B
|
|
8
|
-
const
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { h } from "./index7.js";
|
|
3
|
+
import { s as styled_default, u as useStore, c as cx_default } from "./sl-types.js";
|
|
4
|
+
import { d as distExports } from "./index11.js";
|
|
5
|
+
import { useState, useRef, useCallback, useEffect, Component } from "react";
|
|
6
|
+
import { e as eventBus } from "./index5.js";
|
|
7
|
+
import { B, z } from "./hooks-WfHlJH12.js";
|
|
8
|
+
const e = /* @__PURE__ */ styled_default("div")({
|
|
9
9
|
name: "PauseAdOverlay",
|
|
10
10
|
class: "pw9gih8",
|
|
11
|
-
propsAsIs:
|
|
12
|
-
}),
|
|
11
|
+
propsAsIs: false
|
|
12
|
+
}), t = /* @__PURE__ */ styled_default("div")({
|
|
13
13
|
name: "PauseAdContent",
|
|
14
14
|
class: "p8lpomy",
|
|
15
|
-
propsAsIs:
|
|
16
|
-
}),
|
|
15
|
+
propsAsIs: false
|
|
16
|
+
}), p = /* @__PURE__ */ styled_default("div")({
|
|
17
17
|
name: "PauseAdTopLeft",
|
|
18
18
|
class: "pv7u167",
|
|
19
|
-
propsAsIs:
|
|
20
|
-
}),
|
|
19
|
+
propsAsIs: false
|
|
20
|
+
}), o = /* @__PURE__ */ styled_default("h2")({
|
|
21
21
|
name: "PauseAdTitle",
|
|
22
22
|
class: "p1kh2yb0",
|
|
23
|
-
propsAsIs:
|
|
24
|
-
}),
|
|
23
|
+
propsAsIs: false
|
|
24
|
+
}), n = /* @__PURE__ */ styled_default("p")({
|
|
25
25
|
name: "PauseAdCaption",
|
|
26
26
|
class: "pl8f94x",
|
|
27
|
-
propsAsIs:
|
|
28
|
-
}),
|
|
27
|
+
propsAsIs: false
|
|
28
|
+
}), d = /* @__PURE__ */ styled_default("div")({
|
|
29
29
|
name: "PauseAdBottomLeft",
|
|
30
30
|
class: "p1m6zmrt",
|
|
31
|
-
propsAsIs:
|
|
32
|
-
}),
|
|
31
|
+
propsAsIs: false
|
|
32
|
+
}), l = /* @__PURE__ */ styled_default("button")({
|
|
33
33
|
name: "PauseAdPlayButton",
|
|
34
34
|
class: "pm3vwfa",
|
|
35
|
-
propsAsIs:
|
|
36
|
-
}),
|
|
35
|
+
propsAsIs: false
|
|
36
|
+
}), A = /* @__PURE__ */ styled_default("div")({
|
|
37
37
|
name: "PauseAdSidebarGradient",
|
|
38
38
|
class: "p1tibuhw",
|
|
39
|
-
propsAsIs:
|
|
40
|
-
}),
|
|
39
|
+
propsAsIs: false
|
|
40
|
+
}), r = /* @__PURE__ */ styled_default("div")({
|
|
41
41
|
name: "PauseAdSidebar",
|
|
42
42
|
class: "ptqqrqd",
|
|
43
|
-
propsAsIs:
|
|
44
|
-
}),
|
|
43
|
+
propsAsIs: false
|
|
44
|
+
}), i = /* @__PURE__ */ styled_default("span")({
|
|
45
45
|
name: "PauseAdTitleDescription",
|
|
46
46
|
class: "p14estxv",
|
|
47
|
-
propsAsIs:
|
|
48
|
-
}),
|
|
47
|
+
propsAsIs: false
|
|
48
|
+
}), u = /* @__PURE__ */ styled_default("img")({
|
|
49
49
|
name: "ExternalAdContainer",
|
|
50
50
|
class: "e1dpvfl1",
|
|
51
|
-
propsAsIs:
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
propsAsIs: false
|
|
52
|
+
});
|
|
53
|
+
const W = ({
|
|
54
|
+
vastUrl: l2,
|
|
55
|
+
isDesktop: o2,
|
|
56
|
+
content: r2
|
|
57
|
+
}) => (useEffect(() => {
|
|
58
|
+
r2.imageSrc && r2.id && eventBus.emit("exposedPauseAd", {
|
|
58
59
|
action: "rendered",
|
|
59
60
|
payload: {
|
|
60
|
-
id:
|
|
61
|
-
parentId:
|
|
61
|
+
id: r2.id,
|
|
62
|
+
parentId: r2.parentId
|
|
62
63
|
}
|
|
63
64
|
});
|
|
64
|
-
}, [
|
|
65
|
+
}, [r2, l2]), r2 != null && r2.imageSrc ? !r2.adUrl || !o2 ? /* @__PURE__ */ jsx(u, { src: r2.imageSrc }) : /* @__PURE__ */ jsx(
|
|
65
66
|
"a",
|
|
66
67
|
{
|
|
67
68
|
onClick: () => {
|
|
68
|
-
|
|
69
|
+
eventBus.emit("exposedPauseAd", {
|
|
69
70
|
action: "navigated",
|
|
70
71
|
payload: {
|
|
71
|
-
id:
|
|
72
|
-
parentId:
|
|
72
|
+
id: r2.id,
|
|
73
|
+
parentId: r2.parentId
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
},
|
|
76
|
-
href:
|
|
77
|
+
href: r2.adUrl,
|
|
77
78
|
target: "_blank",
|
|
78
79
|
rel: "noopener noreferrer",
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ jsx(u, { src: r2.imageSrc })
|
|
80
81
|
}
|
|
81
|
-
) : null),
|
|
82
|
-
const
|
|
82
|
+
) : null), X = ({ isClosing: l$1, content: o$1, externalPauseAdStore: r$1, title: k, caption: y, onPlay: f, onClose: a, vastUrl: c, options: A$1, isDesktop: m }) => {
|
|
83
|
+
const v = (A$1 == null ? void 0 : A$1.showPauseButton) ?? true, { ref: s, focusSelf: I } = distExports.useFocusable({
|
|
83
84
|
focusKey: "sl-pause-ad-play",
|
|
84
|
-
onEnterRelease:
|
|
85
|
-
isFocusBoundary:
|
|
86
|
-
forceFocus:
|
|
85
|
+
onEnterRelease: f,
|
|
86
|
+
isFocusBoundary: true,
|
|
87
|
+
forceFocus: true
|
|
87
88
|
});
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
}, [
|
|
91
|
-
|
|
92
|
-
}, [
|
|
89
|
+
return useEffect(() => () => {
|
|
90
|
+
r$1.revalidate();
|
|
91
|
+
}, [r$1]), useEffect(() => {
|
|
92
|
+
s.current && I();
|
|
93
|
+
}, [s, I]), useEffect(() => {
|
|
93
94
|
if (!a)
|
|
94
95
|
return () => {
|
|
95
96
|
};
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
|
|
97
|
+
const E = (d2) => {
|
|
98
|
+
const t2 = d2.keyCode;
|
|
99
|
+
if (t2 === 461 || t2 === 10009 || t2 === 27 || t2 === 8) {
|
|
100
|
+
d2.preventDefault(), d2.stopPropagation(), d2.stopImmediatePropagation(), a();
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
|
-
return window.addEventListener("keydown",
|
|
104
|
-
}, [a]), /* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
104
|
+
return window.addEventListener("keydown", E, { capture: true }), () => window.removeEventListener("keydown", E, { capture: true });
|
|
105
|
+
}, [a]), /* @__PURE__ */ jsx(e, { className: cx_default("SL_PauseAd", l$1 && "pause-ad-closing"), children: /* @__PURE__ */ jsxs(t, { children: [
|
|
106
|
+
/* @__PURE__ */ jsxs(p, { children: [
|
|
107
|
+
/* @__PURE__ */ jsx(o, { children: k }),
|
|
108
|
+
/* @__PURE__ */ jsx(n, { children: y })
|
|
108
109
|
] }),
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
v && /* @__PURE__ */ jsx(d, { children: /* @__PURE__ */ jsx(
|
|
111
|
+
l,
|
|
111
112
|
{
|
|
112
|
-
ref:
|
|
113
|
-
onClick:
|
|
114
|
-
onMouseEnter: () =>
|
|
113
|
+
ref: s,
|
|
114
|
+
onClick: f,
|
|
115
|
+
onMouseEnter: () => s.current.focus(),
|
|
115
116
|
"aria-label": "Resume playback"
|
|
116
117
|
}
|
|
117
118
|
) }),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ jsx(A, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ jsxs(r, { children: [
|
|
120
|
+
c && /* @__PURE__ */ jsx(W, { content: o$1, isDesktop: m, vastUrl: c }),
|
|
121
|
+
/* @__PURE__ */ jsx(i, { children: "ADVERTISEMENT" })
|
|
121
122
|
] }) })
|
|
122
123
|
] }) });
|
|
123
|
-
}, se = ({ showPauseAd:
|
|
124
|
-
const
|
|
125
|
-
P.current =
|
|
126
|
-
const [
|
|
127
|
-
refetchInterval:
|
|
128
|
-
$enabled:
|
|
129
|
-
prefetch:
|
|
130
|
-
}),
|
|
131
|
-
if (
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
124
|
+
}, se = ({ showPauseAd: l2, vastUrls: o2, title: r2, caption: k, sdk: y, onClose: f, onRender: a, options: c, isDesktop: A2 }) => {
|
|
125
|
+
const m = (c == null ? void 0 : c.pauseAdDelay) ?? 0, v = (c == null ? void 0 : c.pauseAdRefetchInterval) ?? 1e3 * 60 * 50, [s, I] = useState(false), [E, d2] = useState(false), t2 = useRef(), p2 = o2 == null ? void 0 : o2[0].url, P = useRef(p2), S = useRef(""), T = useRef("");
|
|
126
|
+
P.current = p2;
|
|
127
|
+
const [i2, D] = y.advertisement.getExternalPauseAd(p2, {
|
|
128
|
+
refetchInterval: v,
|
|
129
|
+
$enabled: m === 0 || !!l2,
|
|
130
|
+
prefetch: m === 0 && v > 0
|
|
131
|
+
}), x = useStore(i2), g = useCallback(() => {
|
|
132
|
+
if (f) {
|
|
133
|
+
T.current = P.current;
|
|
134
|
+
const e2 = i2.get().data;
|
|
135
|
+
eventBus.emit("exposedPauseAd", {
|
|
135
136
|
action: "closed",
|
|
136
|
-
payload: (
|
|
137
|
-
id:
|
|
138
|
-
parentId:
|
|
137
|
+
payload: (e2 == null ? void 0 : e2.url) === T.current ? {
|
|
138
|
+
id: e2 == null ? void 0 : e2.id,
|
|
139
|
+
parentId: e2 == null ? void 0 : e2.parentId
|
|
139
140
|
} : {}
|
|
140
|
-
}),
|
|
141
|
+
}), f();
|
|
141
142
|
}
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
return
|
|
146
|
-
|
|
147
|
-
}, [
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
143
|
+
}, [f, i2]), j = useCallback(() => {
|
|
144
|
+
y.controlVideoPlayer({ play: true });
|
|
145
|
+
}, [y]);
|
|
146
|
+
return useEffect(() => {
|
|
147
|
+
D === P.current && x.error && (console.log("error", x.error), clearTimeout(t2.current), g == null || g());
|
|
148
|
+
}, [x, g, D]), useEffect(() => {
|
|
149
|
+
if (l2 && p2) {
|
|
150
|
+
S.current = P.current, T.current = "";
|
|
151
|
+
const e2 = i2.get().data;
|
|
152
|
+
eventBus.emit("exposedPauseAd", {
|
|
152
153
|
action: "enabled",
|
|
153
|
-
payload: (
|
|
154
|
-
id:
|
|
155
|
-
parentId:
|
|
154
|
+
payload: (e2 == null ? void 0 : e2.url) === S.current ? {
|
|
155
|
+
id: e2 == null ? void 0 : e2.id,
|
|
156
|
+
parentId: e2 == null ? void 0 : e2.parentId
|
|
156
157
|
} : {}
|
|
157
158
|
});
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
(
|
|
161
|
-
console.log("checkAndAllowRender timeout"),
|
|
159
|
+
const L = () => {
|
|
160
|
+
const C = i2.get(), h2 = C.data;
|
|
161
|
+
(h2 == null ? void 0 : h2.url) === P.current && (!C.loading && (h2 != null && h2.imageSrc) ? (clearTimeout(t2.current), d2(false), I(true)) : C.loading && (t2.current = setTimeout(() => {
|
|
162
|
+
console.log("checkAndAllowRender timeout"), L();
|
|
162
163
|
}, 200)));
|
|
163
164
|
};
|
|
164
|
-
clearTimeout(
|
|
165
|
-
|
|
166
|
-
},
|
|
165
|
+
clearTimeout(t2.current), t2.current = setTimeout(() => {
|
|
166
|
+
L();
|
|
167
|
+
}, m);
|
|
167
168
|
} else {
|
|
168
|
-
if (
|
|
169
|
-
const
|
|
170
|
-
|
|
169
|
+
if (T.current !== P.current) {
|
|
170
|
+
const e2 = i2.get().data;
|
|
171
|
+
T.current = "", S.current !== "" && (eventBus.emit("exposedPauseAd", {
|
|
171
172
|
action: "disabled",
|
|
172
|
-
payload:
|
|
173
|
-
id:
|
|
174
|
-
parentId:
|
|
173
|
+
payload: S.current === (e2 == null ? void 0 : e2.url) ? {
|
|
174
|
+
id: e2 == null ? void 0 : e2.id,
|
|
175
|
+
parentId: e2 == null ? void 0 : e2.parentId
|
|
175
176
|
} : {}
|
|
176
|
-
}),
|
|
177
|
+
}), S.current = "");
|
|
177
178
|
}
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
d2(true), t2.current = setTimeout(() => {
|
|
180
|
+
I(false);
|
|
180
181
|
}, 400);
|
|
181
182
|
}
|
|
182
183
|
return () => {
|
|
183
|
-
|
|
184
|
+
t2.current && clearTimeout(t2.current);
|
|
184
185
|
};
|
|
185
|
-
}, [
|
|
186
|
-
a == null || a({ rendered:
|
|
187
|
-
}, [
|
|
188
|
-
a == null || a({ rendered:
|
|
189
|
-
}, [a]), !
|
|
190
|
-
|
|
186
|
+
}, [i2, g, m, l2, p2]), useEffect(() => {
|
|
187
|
+
a == null || a({ rendered: s });
|
|
188
|
+
}, [s, a]), useEffect(() => () => {
|
|
189
|
+
a == null || a({ rendered: false });
|
|
190
|
+
}, [a]), !s || !x.data ? null : /* @__PURE__ */ jsx(
|
|
191
|
+
X,
|
|
191
192
|
{
|
|
192
|
-
onClose:
|
|
193
|
-
isClosing:
|
|
194
|
-
title:
|
|
195
|
-
caption:
|
|
196
|
-
onPlay:
|
|
197
|
-
vastUrl:
|
|
198
|
-
options:
|
|
199
|
-
isDesktop:
|
|
200
|
-
externalPauseAdStore:
|
|
201
|
-
content:
|
|
193
|
+
onClose: g,
|
|
194
|
+
isClosing: E,
|
|
195
|
+
title: r2,
|
|
196
|
+
caption: k,
|
|
197
|
+
onPlay: j,
|
|
198
|
+
vastUrl: p2,
|
|
199
|
+
options: c,
|
|
200
|
+
isDesktop: A2,
|
|
201
|
+
externalPauseAdStore: i2,
|
|
202
|
+
content: x.data
|
|
202
203
|
}
|
|
203
204
|
);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
205
|
+
};
|
|
206
|
+
const PureStreamLayerPauseAd = ({
|
|
207
|
+
showPauseAd,
|
|
208
|
+
pauseAdVastUrl,
|
|
209
|
+
videoPlayerController,
|
|
210
|
+
onRenderPauseAd,
|
|
211
|
+
onClosePauseAd,
|
|
212
|
+
children,
|
|
213
|
+
options
|
|
212
214
|
}) => {
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
const sdk = B();
|
|
216
|
+
const baseTheme = z();
|
|
217
|
+
const ref = useRef();
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
if (sdk) {
|
|
220
|
+
if (videoPlayerController) {
|
|
221
|
+
ref.current = videoPlayerController;
|
|
222
|
+
sdk.addVideoPlayerController(ref.current);
|
|
223
|
+
}
|
|
224
|
+
return () => {
|
|
225
|
+
if (ref.current) {
|
|
226
|
+
sdk.removeVideoPlayerController(ref.current);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return () => {
|
|
231
|
+
};
|
|
232
|
+
}, [sdk, videoPlayerController]);
|
|
233
|
+
if (!sdk) {
|
|
234
|
+
return children;
|
|
235
|
+
}
|
|
236
|
+
return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(
|
|
237
|
+
h,
|
|
219
238
|
{
|
|
220
|
-
style:
|
|
221
|
-
customTheme:
|
|
222
|
-
themeMode:
|
|
239
|
+
style: children ? { position: "relative" } : {},
|
|
240
|
+
customTheme: baseTheme.theme,
|
|
241
|
+
themeMode: baseTheme.themeMode,
|
|
223
242
|
children: [
|
|
224
|
-
|
|
225
|
-
|
|
243
|
+
children,
|
|
244
|
+
pauseAdVastUrl && /* @__PURE__ */ jsx(
|
|
226
245
|
se,
|
|
227
246
|
{
|
|
228
|
-
sdk
|
|
229
|
-
showPauseAd
|
|
230
|
-
vastUrls:
|
|
231
|
-
onClose:
|
|
232
|
-
onRender:
|
|
233
|
-
options
|
|
234
|
-
isDesktop:
|
|
247
|
+
sdk,
|
|
248
|
+
showPauseAd,
|
|
249
|
+
vastUrls: pauseAdVastUrl,
|
|
250
|
+
onClose: onClosePauseAd,
|
|
251
|
+
onRender: onRenderPauseAd,
|
|
252
|
+
options,
|
|
253
|
+
isDesktop: true
|
|
235
254
|
}
|
|
236
255
|
)
|
|
237
256
|
]
|
|
238
257
|
}
|
|
239
|
-
) })
|
|
258
|
+
) });
|
|
240
259
|
};
|
|
241
|
-
class
|
|
242
|
-
constructor(
|
|
243
|
-
super(
|
|
260
|
+
class StreamLayerPauseAd extends Component {
|
|
261
|
+
constructor(props) {
|
|
262
|
+
super(props);
|
|
263
|
+
this.state = { hasError: false };
|
|
244
264
|
}
|
|
245
265
|
static getDerivedStateFromError() {
|
|
246
|
-
return { hasError:
|
|
266
|
+
return { hasError: true };
|
|
247
267
|
}
|
|
248
|
-
componentDidCatch(
|
|
249
|
-
console.error(
|
|
268
|
+
componentDidCatch(error, info) {
|
|
269
|
+
console.error(error, info.componentStack);
|
|
250
270
|
}
|
|
251
271
|
render() {
|
|
252
|
-
|
|
272
|
+
if (this.state.hasError) {
|
|
273
|
+
return this.props.children;
|
|
274
|
+
}
|
|
275
|
+
return /* @__PURE__ */ jsx(PureStreamLayerPauseAd, { ...this.props });
|
|
253
276
|
}
|
|
254
277
|
}
|
|
255
278
|
export {
|
|
256
|
-
|
|
279
|
+
StreamLayerPauseAd
|
|
257
280
|
};
|
package/lib/classic/es/points.js
CHANGED
|
@@ -1,77 +1,85 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { m
|
|
3
|
-
import { useState
|
|
4
|
-
import { s as
|
|
5
|
-
import {
|
|
6
|
-
import { d
|
|
7
|
-
import { B as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { m, h } from "./index7.js";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { s as styled_default, u as useStore } from "./sl-types.js";
|
|
5
|
+
import { e as eventBus } from "./index5.js";
|
|
6
|
+
import { d } from "./index3.js";
|
|
7
|
+
import { B as B1 } from "./index4.js";
|
|
8
|
+
import { F as FeatureStatus } from "./feature.js";
|
|
9
|
+
import { S as SdkOverlayType } from "./useStreamLayerApp2.js";
|
|
10
|
+
import { B, z } from "./hooks-WfHlJH12.js";
|
|
11
|
+
const e = /* @__PURE__ */ styled_default("div")({
|
|
11
12
|
name: "PointsContainer",
|
|
12
13
|
class: "psiob9b",
|
|
13
|
-
propsAsIs:
|
|
14
|
-
}),
|
|
14
|
+
propsAsIs: false
|
|
15
|
+
}), p = /* @__PURE__ */ styled_default("div")({
|
|
15
16
|
name: "PointsIcon",
|
|
16
17
|
class: "p1gqe4lh",
|
|
17
|
-
propsAsIs:
|
|
18
|
-
}),
|
|
18
|
+
propsAsIs: false
|
|
19
|
+
}), n = () => B1, a = /* @__PURE__ */ styled_default(n())({
|
|
19
20
|
name: "PointsSvg",
|
|
20
21
|
class: "p15syg2y",
|
|
21
|
-
propsAsIs:
|
|
22
|
-
}),
|
|
22
|
+
propsAsIs: true
|
|
23
|
+
}), l = /* @__PURE__ */ styled_default("div")({
|
|
23
24
|
name: "PointsBody",
|
|
24
25
|
class: "p12n4f2h",
|
|
25
|
-
propsAsIs:
|
|
26
|
-
}),
|
|
26
|
+
propsAsIs: false
|
|
27
|
+
}), c = /* @__PURE__ */ styled_default("div")({
|
|
27
28
|
name: "PointsTitle",
|
|
28
29
|
class: "poqmx89",
|
|
29
|
-
propsAsIs:
|
|
30
|
-
}),
|
|
30
|
+
propsAsIs: false
|
|
31
|
+
}), r = /* @__PURE__ */ styled_default("div")({
|
|
31
32
|
name: "PointsValue",
|
|
32
33
|
class: "prj9b3v",
|
|
33
|
-
propsAsIs:
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */ p
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
34
|
+
propsAsIs: false
|
|
35
|
+
});
|
|
36
|
+
const u = ({ points: n2, onClick: t }) => /* @__PURE__ */ jsxs(e, { className: m, onClick: t, children: [
|
|
37
|
+
/* @__PURE__ */ jsx(p, { children: /* @__PURE__ */ jsx(a, { name: "icon-trophy-solid" }) }),
|
|
38
|
+
/* @__PURE__ */ jsxs(l, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(c, { children: "Total points" }),
|
|
40
|
+
/* @__PURE__ */ jsx(r, { children: /* @__PURE__ */ jsx(d, { value: n2 }) })
|
|
39
41
|
] })
|
|
40
|
-
] })
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
] });
|
|
43
|
+
const S = ({ gamification: e2 }) => {
|
|
44
|
+
const n2 = e2.userSummary.$store, [t, m2] = useState(0);
|
|
45
|
+
return useEffect(() => {
|
|
46
|
+
const r2 = n2.subscribe((o) => {
|
|
47
|
+
var i;
|
|
48
|
+
(i = o == null ? void 0 : o.summary) != null && i.points && m2(o.summary.points);
|
|
46
49
|
});
|
|
47
50
|
return () => {
|
|
48
|
-
|
|
51
|
+
r2();
|
|
49
52
|
};
|
|
50
|
-
}, [
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
+
}, [n2]), /* @__PURE__ */ jsx(u, { points: t, onClick: () => {
|
|
54
|
+
const r2 = e2.status.get();
|
|
55
|
+
r2 === FeatureStatus.Suspended ? (e2.openFeature(), eventBus.emit("app", {
|
|
53
56
|
action: "open",
|
|
54
57
|
payload: {}
|
|
55
|
-
}),
|
|
58
|
+
}), eventBus.emit("interactions", {
|
|
56
59
|
action: "tap",
|
|
57
60
|
payload: {}
|
|
58
|
-
})) :
|
|
61
|
+
})) : r2 === FeatureStatus.Ready && (e2.closeFeature(false), eventBus.emit("app", {
|
|
59
62
|
action: "close",
|
|
60
63
|
payload: {}
|
|
61
|
-
}),
|
|
64
|
+
}), eventBus.emit("interactions", {
|
|
62
65
|
action: "tap",
|
|
63
66
|
payload: {}
|
|
64
67
|
}));
|
|
65
68
|
} });
|
|
66
|
-
},
|
|
67
|
-
if (!
|
|
69
|
+
}, k = ({ sdk: e2 }) => {
|
|
70
|
+
if (!useStore(e2.featuresList.getStore()))
|
|
68
71
|
return null;
|
|
69
|
-
const t =
|
|
70
|
-
return t ? /* @__PURE__ */
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const t = e2.getFeature(SdkOverlayType.GAMES);
|
|
73
|
+
return t ? /* @__PURE__ */ jsx(S, { gamification: t }) : null;
|
|
74
|
+
};
|
|
75
|
+
const StreamLayerSDKPoints = ({ theme }) => {
|
|
76
|
+
const sdk = B();
|
|
77
|
+
const baseTheme = z();
|
|
78
|
+
if (!sdk) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h, { customTheme: theme ?? baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(k, { sdk }) }) });
|
|
74
82
|
};
|
|
75
83
|
export {
|
|
76
|
-
|
|
84
|
+
StreamLayerSDKPoints
|
|
77
85
|
};
|