@streamlayer/react 1.20.6 → 1.21.0
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 +1 -1
- package/lib/cjs/advertisement.js +29 -29
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +4 -4
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters2.js +7 -7
- 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/provider.js +15 -39
- package/lib/cjs/useStreamLayerApp2.js +14 -15
- package/lib/classic/app/pause-ad.d.ts +1 -1
- package/lib/classic/cjs/advertisement.js +29 -29
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +10 -34
- package/lib/classic/cjs/useStreamLayerApp2.js +14 -15
- package/lib/classic/es/advertisement.js +2193 -2265
- package/lib/classic/es/bet-pack.js +14 -12
- package/lib/classic/es/index.js +16 -11
- package/lib/classic/es/insight.js +35 -30
- package/lib/classic/es/notification.js +108 -103
- package/lib/classic/es/pause-ad.js +196 -148
- package/lib/classic/es/points.js +28 -23
- package/lib/classic/es/provider.js +4290 -10434
- package/lib/classic/es/useStreamLayerApp.js +1 -1
- package/lib/classic/es/useStreamLayerApp2.js +3249 -5821
- package/lib/classic/index.d.ts +1 -1
- package/lib/classic/masters.d.ts +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +35 -60
- package/lib/dist/es/gamification-feature2.js +112 -105
- package/lib/dist/es/index.js +12 -7
- package/lib/dist/es/masters.js +9837 -18573
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +2193 -2265
- package/lib/es/index.js +16 -11
- package/lib/es/index2.js +12 -10
- package/lib/es/insight.js +35 -30
- package/lib/es/masters2.js +28 -25
- package/lib/es/notification.js +135 -130
- package/lib/es/pause-ad.js +196 -148
- package/lib/es/points.js +28 -23
- package/lib/es/provider.js +4317 -10469
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/es/useStreamLayerApp2.js +3249 -5821
- package/lib/index.d.ts +1 -1
- package/lib/masters.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +15 -15
package/lib/es/pause-ad.js
CHANGED
|
@@ -1,72 +1,101 @@
|
|
|
1
1
|
import { jsx as a, jsxs as I } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { j as K, k as F, e as k, s as p, l as M, n as _, f as j, u as q, d as G, h as N } from "./provider.js";
|
|
3
|
+
import "nanostores";
|
|
4
|
+
import { useRef as D, useCallback as L, useState as R, useEffect as T, Component as $ } from "react";
|
|
5
|
+
import "@nanostores/react";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
9
|
+
import { c as z } from "./vast-client.min-B0NUra1B.js";
|
|
10
|
+
const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
|
|
11
|
+
const n = new Image();
|
|
12
|
+
n.onload = () => s(e), n.onerror = () => t(), n.src = e;
|
|
13
|
+
}), V = () => {
|
|
14
|
+
const e = D(0);
|
|
15
|
+
return [L(async (s) => {
|
|
16
|
+
var t, n, r, d, c, i, h, l, f, g, y;
|
|
17
|
+
if ((t = b.get()[s]) != null && t.imageSrc)
|
|
13
18
|
return { success: !0 };
|
|
14
19
|
const v = Date.now();
|
|
15
|
-
|
|
20
|
+
e.current = v, b.setKey(s, { id: "", url: s });
|
|
16
21
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
k.emit("exposedPauseAd", {
|
|
23
|
+
action: "load",
|
|
24
|
+
payload: {}
|
|
25
|
+
});
|
|
26
|
+
const u = await W.get(s);
|
|
27
|
+
if (E.debug(u, "parsedVAST"), e.current === v && b.get()[s].url) {
|
|
28
|
+
const o = u.ads.find((m) => m.creatives.length > 0);
|
|
29
|
+
if (o) {
|
|
30
|
+
E.debug(o, "validAd");
|
|
31
|
+
const m = o.creatives.find((A) => A.type === "nonlinear");
|
|
32
|
+
if (m) {
|
|
33
|
+
E.debug(m, "nonlinear");
|
|
34
|
+
const A = (r = (n = m.variations) == null ? void 0 : n[0]) == null ? void 0 : r.staticResource, C = (c = (d = m.variations) == null ? void 0 : d[0]) == null ? void 0 : c.nonlinearClickThroughURLTemplate;
|
|
35
|
+
if (A)
|
|
36
|
+
return await U(A), b.setKey(s, {
|
|
37
|
+
id: o.id || "",
|
|
38
|
+
url: s,
|
|
39
|
+
imageSrc: A,
|
|
40
|
+
adUrl: C
|
|
41
|
+
}), k.emit("exposedPauseAd", {
|
|
42
|
+
action: "loaded",
|
|
43
|
+
payload: {
|
|
44
|
+
id: o.id || ""
|
|
45
|
+
}
|
|
46
|
+
}), { success: !0 };
|
|
28
47
|
}
|
|
29
|
-
const
|
|
30
|
-
E.debug(
|
|
31
|
-
const
|
|
32
|
-
if (
|
|
33
|
-
return await U(
|
|
48
|
+
const P = o.creatives.find((A) => A.type === "companion");
|
|
49
|
+
E.debug(P, "companion");
|
|
50
|
+
const w = (f = (l = (h = (i = P == null ? void 0 : P.variations) == null ? void 0 : i[0]) == null ? void 0 : h.staticResources) == null ? void 0 : l[0]) == null ? void 0 : f.url, S = (y = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : y.companionClickThroughURLTemplate;
|
|
51
|
+
if (w)
|
|
52
|
+
return await U(w), b.setKey(s, {
|
|
53
|
+
id: o.id || "",
|
|
54
|
+
url: s,
|
|
55
|
+
imageSrc: w,
|
|
56
|
+
adUrl: S
|
|
57
|
+
}), k.emit("exposedPauseAd", {
|
|
58
|
+
action: "loaded",
|
|
59
|
+
payload: {
|
|
60
|
+
id: o.id || ""
|
|
61
|
+
}
|
|
62
|
+
}), { success: !0 };
|
|
34
63
|
}
|
|
35
64
|
}
|
|
36
|
-
} catch (
|
|
37
|
-
console.error("Error parsing VAST",
|
|
65
|
+
} catch (u) {
|
|
66
|
+
console.error("Error parsing VAST", u);
|
|
38
67
|
}
|
|
39
68
|
return { success: !1 };
|
|
40
|
-
}, []),
|
|
41
|
-
},
|
|
69
|
+
}, []), b];
|
|
70
|
+
}, X = /* @__PURE__ */ p("div")({
|
|
42
71
|
name: "PauseAdOverlay",
|
|
43
72
|
class: "pw9gih8",
|
|
44
73
|
propsAsIs: !1
|
|
45
|
-
}),
|
|
74
|
+
}), H = /* @__PURE__ */ p("div")({
|
|
46
75
|
name: "PauseAdContent",
|
|
47
76
|
class: "p8lpomy",
|
|
48
77
|
propsAsIs: !1
|
|
49
|
-
}),
|
|
78
|
+
}), J = /* @__PURE__ */ p("div")({
|
|
50
79
|
name: "PauseAdGradientRight",
|
|
51
80
|
class: "pv7u167",
|
|
52
81
|
propsAsIs: !1
|
|
53
|
-
}),
|
|
82
|
+
}), Q = /* @__PURE__ */ p("div")({
|
|
54
83
|
name: "PauseAdGradientBottom",
|
|
55
84
|
class: "p1kh2yb0",
|
|
56
85
|
propsAsIs: !1
|
|
57
|
-
}),
|
|
86
|
+
}), Y = /* @__PURE__ */ p("div")({
|
|
58
87
|
name: "PauseAdTopLeft",
|
|
59
88
|
class: "pl8f94x",
|
|
60
89
|
propsAsIs: !1
|
|
61
|
-
}),
|
|
90
|
+
}), Z = /* @__PURE__ */ p("h2")({
|
|
62
91
|
name: "PauseAdTitle",
|
|
63
92
|
class: "p1m6zmrt",
|
|
64
93
|
propsAsIs: !1
|
|
65
|
-
}),
|
|
94
|
+
}), ee = /* @__PURE__ */ p("p")({
|
|
66
95
|
name: "PauseAdCaption",
|
|
67
96
|
class: "pm3vwfa",
|
|
68
97
|
propsAsIs: !1
|
|
69
|
-
}),
|
|
98
|
+
}), se = /* @__PURE__ */ p("div")({
|
|
70
99
|
name: "PauseAdBottomLeft",
|
|
71
100
|
class: "p1tibuhw",
|
|
72
101
|
propsAsIs: !1
|
|
@@ -74,176 +103,195 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
|
|
|
74
103
|
name: "PauseAdPlayButton",
|
|
75
104
|
class: "ptqqrqd",
|
|
76
105
|
propsAsIs: !1
|
|
77
|
-
}),
|
|
106
|
+
}), te = /* @__PURE__ */ p("div")({
|
|
78
107
|
name: "PauseAdSidebar",
|
|
79
108
|
class: "p14estxv",
|
|
80
109
|
propsAsIs: !1
|
|
81
|
-
}),
|
|
110
|
+
}), oe = /* @__PURE__ */ p("span")({
|
|
82
111
|
name: "PauseAdTitleDescription",
|
|
83
112
|
class: "p1dpvfl1",
|
|
84
113
|
propsAsIs: !1
|
|
85
|
-
}),
|
|
114
|
+
}), B = /* @__PURE__ */ p("img")({
|
|
86
115
|
name: "ExternalAdContainer",
|
|
87
116
|
class: "ezfmabr",
|
|
88
117
|
propsAsIs: !1
|
|
89
|
-
}),
|
|
90
|
-
var
|
|
91
|
-
const [,
|
|
92
|
-
return (
|
|
93
|
-
|
|
94
|
-
|
|
118
|
+
}), ae = ({ vastUrl: e, isDesktop: s }) => {
|
|
119
|
+
var t;
|
|
120
|
+
const [, n] = V(), r = j(n, { keys: [e] });
|
|
121
|
+
return T(() => {
|
|
122
|
+
r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
|
|
123
|
+
action: "rendered",
|
|
124
|
+
payload: {
|
|
125
|
+
id: r[e].id
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ a(B, { src: r[e].imageSrc }) : /* @__PURE__ */ a(
|
|
129
|
+
"a",
|
|
130
|
+
{
|
|
131
|
+
onClick: () => {
|
|
132
|
+
k.emit("exposedPauseAd", {
|
|
133
|
+
action: "navigated",
|
|
134
|
+
payload: {
|
|
135
|
+
id: r[e].id
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
href: r[e].adUrl,
|
|
140
|
+
target: "_blank",
|
|
141
|
+
rel: "noopener noreferrer",
|
|
142
|
+
children: /* @__PURE__ */ a(B, { src: r[e].imageSrc })
|
|
143
|
+
}
|
|
144
|
+
) : null;
|
|
145
|
+
}, ne = ({ isClosing: e, title: s, caption: t, onPlay: n, onClose: r, vastUrl: d, options: c, isDesktop: i }) => {
|
|
146
|
+
const h = (c == null ? void 0 : c.showPauseButton) ?? !0, { ref: l, focusSelf: f } = M.useFocusable({
|
|
95
147
|
focusKey: "sl-pause-ad-play",
|
|
96
|
-
onEnterRelease:
|
|
148
|
+
onEnterRelease: n,
|
|
97
149
|
isFocusBoundary: !0,
|
|
98
150
|
forceFocus: !0
|
|
99
151
|
});
|
|
100
|
-
return
|
|
101
|
-
|
|
102
|
-
}, [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
152
|
+
return T(() => {
|
|
153
|
+
l.current && f();
|
|
154
|
+
}, [l, f]), T(() => {
|
|
155
|
+
if (!r)
|
|
156
|
+
return () => {
|
|
157
|
+
};
|
|
158
|
+
const g = (y) => {
|
|
159
|
+
const v = y.keyCode;
|
|
160
|
+
if (v === 461 || v === 10009 || v === 27 || v === 8) {
|
|
161
|
+
y.preventDefault(), y.stopPropagation(), y.stopImmediatePropagation(), r();
|
|
107
162
|
return;
|
|
108
163
|
}
|
|
109
164
|
};
|
|
110
|
-
return window.addEventListener("keydown",
|
|
111
|
-
}, [
|
|
165
|
+
return window.addEventListener("keydown", g, { capture: !0 }), () => window.removeEventListener("keydown", g, { capture: !0 });
|
|
166
|
+
}, [r]), /* @__PURE__ */ a(X, { className: _("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ I(H, { children: [
|
|
167
|
+
/* @__PURE__ */ a(J, {}),
|
|
112
168
|
/* @__PURE__ */ a(Q, {}),
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
115
|
-
/* @__PURE__ */ a(
|
|
116
|
-
/* @__PURE__ */ a(Z, { children: t })
|
|
169
|
+
/* @__PURE__ */ I(Y, { children: [
|
|
170
|
+
/* @__PURE__ */ a(Z, { children: s }),
|
|
171
|
+
/* @__PURE__ */ a(ee, { children: t })
|
|
117
172
|
] }),
|
|
118
|
-
|
|
173
|
+
h && /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(
|
|
119
174
|
re,
|
|
120
175
|
{
|
|
121
|
-
ref:
|
|
122
|
-
onClick:
|
|
123
|
-
onMouseEnter: () =>
|
|
176
|
+
ref: l,
|
|
177
|
+
onClick: n,
|
|
178
|
+
onMouseEnter: () => l.current.focus(),
|
|
124
179
|
"aria-label": "Resume playback"
|
|
125
180
|
}
|
|
126
181
|
) }),
|
|
127
|
-
/* @__PURE__ */ I(
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */ a(
|
|
182
|
+
/* @__PURE__ */ I(te, { children: [
|
|
183
|
+
d && /* @__PURE__ */ a(ae, { isDesktop: i, vastUrl: d }),
|
|
184
|
+
/* @__PURE__ */ a(oe, { children: "ADVERTISEMENT" })
|
|
130
185
|
] })
|
|
131
186
|
] }) });
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
if (r && d) {
|
|
147
|
-
L.emit("exposedPauseAd", {
|
|
187
|
+
}, ie = ({ showPauseAd: e, vastUrls: s, title: t, caption: n, sdk: r, onClose: d, onRender: c, options: i, isDesktop: h }) => {
|
|
188
|
+
const l = (i == null ? void 0 : i.pauseAdDelay) ?? 5e3, [f, g] = R(!1), [y, v] = R(!1), u = D(), o = s == null ? void 0 : s[0].url, m = D(o);
|
|
189
|
+
m.current = o;
|
|
190
|
+
const [P, w] = V(), S = L(() => {
|
|
191
|
+
d && (k.emit("exposedPauseAd", {
|
|
192
|
+
action: "closed",
|
|
193
|
+
payload: {}
|
|
194
|
+
}), d());
|
|
195
|
+
}, [d]), A = L(() => {
|
|
196
|
+
r.controlVideoPlayer({ play: !0 });
|
|
197
|
+
}, [r]);
|
|
198
|
+
return T(() => {
|
|
199
|
+
if (e && o) {
|
|
200
|
+
k.emit("exposedPauseAd", {
|
|
148
201
|
action: "enabled",
|
|
149
202
|
payload: {}
|
|
150
|
-
}),
|
|
151
|
-
|
|
203
|
+
}), P(o).then((x) => {
|
|
204
|
+
m.current === o && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
|
|
152
205
|
}).catch(() => {
|
|
153
|
-
|
|
206
|
+
m.current === o && (clearTimeout(u.current), S == null || S());
|
|
154
207
|
});
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
payload: {}
|
|
160
|
-
})) : v.current = setTimeout(() => {
|
|
161
|
-
T();
|
|
208
|
+
const C = () => {
|
|
209
|
+
const x = w.get()[m.current];
|
|
210
|
+
x != null && x.imageSrc ? (clearTimeout(u.current), v(!1), g(!0)) : u.current = setTimeout(() => {
|
|
211
|
+
C();
|
|
162
212
|
}, 200);
|
|
163
213
|
};
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
},
|
|
214
|
+
u.current = setTimeout(() => {
|
|
215
|
+
C();
|
|
216
|
+
}, l);
|
|
167
217
|
} else
|
|
168
|
-
|
|
218
|
+
k.emit("exposedPauseAd", {
|
|
169
219
|
action: "disabled",
|
|
170
220
|
payload: {}
|
|
171
|
-
}),
|
|
172
|
-
|
|
221
|
+
}), v(!0), u.current = setTimeout(() => {
|
|
222
|
+
g(!1);
|
|
173
223
|
}, 400);
|
|
174
224
|
return () => {
|
|
175
|
-
|
|
225
|
+
u.current && clearTimeout(u.current);
|
|
176
226
|
};
|
|
177
|
-
}, [
|
|
178
|
-
|
|
179
|
-
}, [
|
|
180
|
-
|
|
181
|
-
}, [
|
|
182
|
-
|
|
227
|
+
}, [w, P, S, l, e, o]), T(() => {
|
|
228
|
+
c == null || c({ rendered: f });
|
|
229
|
+
}, [f, c]), T(() => () => {
|
|
230
|
+
c == null || c({ rendered: !1 });
|
|
231
|
+
}, [c]), f ? /* @__PURE__ */ a(
|
|
232
|
+
ne,
|
|
183
233
|
{
|
|
184
|
-
onClose:
|
|
185
|
-
isClosing:
|
|
234
|
+
onClose: S,
|
|
235
|
+
isClosing: y,
|
|
186
236
|
title: t,
|
|
187
|
-
caption:
|
|
188
|
-
onPlay:
|
|
189
|
-
vastUrl:
|
|
190
|
-
options:
|
|
237
|
+
caption: n,
|
|
238
|
+
onPlay: A,
|
|
239
|
+
vastUrl: o,
|
|
240
|
+
options: i,
|
|
241
|
+
isDesktop: h
|
|
191
242
|
}
|
|
192
243
|
) : null;
|
|
193
244
|
}, le = ({
|
|
194
|
-
showPauseAd:
|
|
195
|
-
pauseAdVastUrl:
|
|
245
|
+
showPauseAd: e,
|
|
246
|
+
pauseAdVastUrl: s,
|
|
196
247
|
videoPlayerController: t,
|
|
197
|
-
onRenderPauseAd:
|
|
198
|
-
onClosePauseAd:
|
|
199
|
-
children:
|
|
200
|
-
options:
|
|
248
|
+
onRenderPauseAd: n,
|
|
249
|
+
onClosePauseAd: r,
|
|
250
|
+
children: d,
|
|
251
|
+
options: c
|
|
201
252
|
}) => {
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
n == null || n.controlVideoPlayer({ play: !0 });
|
|
206
|
-
}, [n]);
|
|
207
|
-
return b(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
|
|
208
|
-
i.current && n.removeVideoPlayerController(i.current);
|
|
253
|
+
const i = q(), h = G(), l = D();
|
|
254
|
+
return T(() => i ? (t && (l.current = t, i.addVideoPlayerController(l.current)), () => {
|
|
255
|
+
l.current && i.removeVideoPlayerController(l.current);
|
|
209
256
|
}) : () => {
|
|
210
|
-
}, [
|
|
211
|
-
|
|
257
|
+
}, [i, t]), i ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
|
|
258
|
+
N,
|
|
212
259
|
{
|
|
213
|
-
style: { position: "relative" },
|
|
214
|
-
customTheme:
|
|
215
|
-
themeMode:
|
|
260
|
+
style: d ? { position: "relative" } : {},
|
|
261
|
+
customTheme: h.theme,
|
|
262
|
+
themeMode: h.themeMode,
|
|
216
263
|
children: [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
264
|
+
d,
|
|
265
|
+
s && /* @__PURE__ */ a(
|
|
266
|
+
ie,
|
|
220
267
|
{
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
options:
|
|
268
|
+
sdk: i,
|
|
269
|
+
showPauseAd: e,
|
|
270
|
+
vastUrls: s,
|
|
271
|
+
onClose: r,
|
|
272
|
+
onRender: n,
|
|
273
|
+
options: c,
|
|
274
|
+
isDesktop: !0
|
|
227
275
|
}
|
|
228
276
|
)
|
|
229
277
|
]
|
|
230
278
|
}
|
|
231
|
-
) }) :
|
|
279
|
+
) }) : d;
|
|
232
280
|
};
|
|
233
|
-
class
|
|
234
|
-
constructor(
|
|
235
|
-
super(
|
|
281
|
+
class Ae extends $ {
|
|
282
|
+
constructor(s) {
|
|
283
|
+
super(s), this.state = { hasError: !1 };
|
|
236
284
|
}
|
|
237
285
|
static getDerivedStateFromError() {
|
|
238
286
|
return { hasError: !0 };
|
|
239
287
|
}
|
|
240
|
-
componentDidCatch(
|
|
241
|
-
console.error(
|
|
288
|
+
componentDidCatch(s, t) {
|
|
289
|
+
console.error(s, t.componentStack);
|
|
242
290
|
}
|
|
243
291
|
render() {
|
|
244
292
|
return this.state.hasError ? this.props.children : /* @__PURE__ */ a(le, { ...this.props });
|
|
245
293
|
}
|
|
246
294
|
}
|
|
247
295
|
export {
|
|
248
|
-
|
|
296
|
+
Ae as StreamLayerPauseAd
|
|
249
297
|
};
|
package/lib/es/points.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useEffect as d } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
3
|
+
import "@nanostores/react";
|
|
4
|
+
import "nanostores";
|
|
5
|
+
import { s as a, B as y, m as h, i as S, f, F as c, e as r, u as v, d as g, h as k } from "./provider.js";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
9
|
+
import { S as A } from "./useStreamLayerApp2.js";
|
|
10
|
+
const I = /* @__PURE__ */ a("div")({
|
|
6
11
|
name: "PointsContainer",
|
|
7
12
|
class: "psiob9b",
|
|
8
13
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
14
|
+
}), P = /* @__PURE__ */ a("div")({
|
|
10
15
|
name: "PointsIcon",
|
|
11
16
|
class: "p1gqe4lh",
|
|
12
17
|
propsAsIs: !1
|
|
13
|
-
}),
|
|
18
|
+
}), b = () => y, T = /* @__PURE__ */ a(b())({
|
|
14
19
|
name: "PointsSvg",
|
|
15
20
|
class: "p15syg2y",
|
|
16
21
|
propsAsIs: !0
|
|
@@ -26,31 +31,31 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
26
31
|
name: "PointsValue",
|
|
27
32
|
class: "prj9b3v",
|
|
28
33
|
propsAsIs: !1
|
|
29
|
-
}), B = ({ points: s, onClick: e }) => /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */ t(
|
|
31
|
-
/* @__PURE__ */
|
|
34
|
+
}), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: h, onClick: e, children: [
|
|
35
|
+
/* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(T, { name: "icon-trophy-solid" }) }),
|
|
36
|
+
/* @__PURE__ */ m(F, { children: [
|
|
32
37
|
/* @__PURE__ */ t(L, { children: "Total points" }),
|
|
33
38
|
/* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(S, { value: s }) })
|
|
34
39
|
] })
|
|
35
40
|
] }), C = ({ gamification: s }) => {
|
|
36
|
-
const e = s.userSummary.$store, [
|
|
41
|
+
const e = s.userSummary.$store, [o, l] = u(0);
|
|
37
42
|
return d(() => {
|
|
38
|
-
const
|
|
39
|
-
var
|
|
40
|
-
(
|
|
43
|
+
const n = e.subscribe((i) => {
|
|
44
|
+
var p;
|
|
45
|
+
(p = i == null ? void 0 : i.summary) != null && p.points && l(i.summary.points);
|
|
41
46
|
});
|
|
42
47
|
return () => {
|
|
43
|
-
|
|
48
|
+
n();
|
|
44
49
|
};
|
|
45
|
-
}, [e]), /* @__PURE__ */ t(B, { points:
|
|
46
|
-
const
|
|
47
|
-
|
|
50
|
+
}, [e]), /* @__PURE__ */ t(B, { points: o, onClick: () => {
|
|
51
|
+
const n = s.status.get();
|
|
52
|
+
n === c.Suspended ? (s.openFeature(), r.emit("app", {
|
|
48
53
|
action: "open",
|
|
49
54
|
payload: {}
|
|
50
55
|
}), r.emit("interactions", {
|
|
51
56
|
action: "tap",
|
|
52
57
|
payload: {}
|
|
53
|
-
})) :
|
|
58
|
+
})) : n === c.Ready && (s.closeFeature(!1), r.emit("app", {
|
|
54
59
|
action: "close",
|
|
55
60
|
payload: {}
|
|
56
61
|
}), r.emit("interactions", {
|
|
@@ -61,12 +66,12 @@ const A = /* @__PURE__ */ a("div")({
|
|
|
61
66
|
}, j = ({ sdk: s }) => {
|
|
62
67
|
if (!f(s.featuresList.getStore()))
|
|
63
68
|
return null;
|
|
64
|
-
const e = s.getFeature(
|
|
69
|
+
const e = s.getFeature(A.GAMES);
|
|
65
70
|
return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
|
|
66
|
-
},
|
|
67
|
-
const e = v(),
|
|
68
|
-
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(
|
|
71
|
+
}, V = ({ theme: s }) => {
|
|
72
|
+
const e = v(), o = g();
|
|
73
|
+
return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
|
|
69
74
|
};
|
|
70
75
|
export {
|
|
71
|
-
|
|
76
|
+
V as StreamLayerSDKPoints
|
|
72
77
|
};
|