@streamlayer/react 1.13.1 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/provider.d.ts +1 -0
- package/lib/app/useStreamLayerApp.d.ts +2 -1
- package/lib/cjs/advertisement.js +223 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/index2.js +5 -5
- package/lib/cjs/masters2.js +3 -8
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +16 -28
- package/lib/cjs/useStreamLayerApp2.js +11 -11
- package/lib/classic/app/provider.d.ts +1 -0
- package/lib/classic/app/useStreamLayerApp.d.ts +2 -1
- package/lib/classic/cjs/advertisement.js +223 -1
- package/lib/classic/cjs/bet-pack.js +1 -1
- package/lib/classic/cjs/gamification-feature2.js +1 -1
- package/lib/classic/cjs/index2.js +5 -5
- package/lib/classic/cjs/masters2.js +3 -8
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +16 -28
- package/lib/classic/cjs/useStreamLayerApp2.js +11 -11
- package/lib/classic/es/advertisement.js +40824 -557
- package/lib/classic/es/bet-pack.js +1 -1
- package/lib/classic/es/gamification-feature2.js +1 -1
- package/lib/classic/es/index.js +4 -4
- package/lib/classic/es/index2.js +1125 -1088
- package/lib/classic/es/masters2.js +385 -439
- package/lib/classic/es/notification.js +205 -191
- package/lib/classic/es/points.js +39 -32
- package/lib/classic/es/provider.js +3852 -3908
- package/lib/classic/es/useStreamLayerApp.js +1 -1
- package/lib/classic/es/useStreamLayerApp2.js +3422 -3355
- package/lib/classic/style.css +1 -1
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/masters.js +29 -46
- package/lib/dist/es/gamification-feature.js +1 -1
- package/lib/dist/es/gamification-feature2.js +46 -46
- package/lib/dist/es/masters.js +8856 -8843
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +40824 -557
- package/lib/es/bet-pack.js +1 -1
- package/lib/es/gamification-feature2.js +1 -1
- package/lib/es/index.js +4 -4
- package/lib/es/index2.js +1125 -1088
- package/lib/es/masters2.js +385 -439
- package/lib/es/notification.js +205 -191
- package/lib/es/points.js +39 -32
- package/lib/es/provider.js +3955 -4011
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/es/useStreamLayerApp2.js +3422 -3355
- package/lib/style.css +1 -1
- package/package.json +16 -16
|
@@ -1,468 +1,482 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { k as
|
|
3
|
-
import { jsxs as c, jsx as
|
|
4
|
-
import { useState as
|
|
5
|
-
const
|
|
1
|
+
import { c as u, s, X as L, Z as O, _ as R, C as B, $ as P, O as Q, e as U, a as V, f as F, N as C, u as W, b as _, Q as G, h as K } from "./provider.js";
|
|
2
|
+
import { k as m, Q as A, l as Y, S as X } from "./useStreamLayerApp2.js";
|
|
3
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
4
|
+
import { useState as y, useCallback as Z, useMemo as E, useEffect as x } from "react";
|
|
5
|
+
const $ = /* @__PURE__ */ s("div")({
|
|
6
6
|
name: "Media",
|
|
7
7
|
class: "m1bcvojl",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}), H = () =>
|
|
9
|
+
}), H = () => $, J = /* @__PURE__ */ s(H())({
|
|
10
10
|
name: "MediaImgBottom",
|
|
11
11
|
class: "m58gin0",
|
|
12
12
|
propsAsIs: !0
|
|
13
|
-
}),
|
|
13
|
+
}), ee = () => $, N = /* @__PURE__ */ s(ee())({
|
|
14
14
|
name: "MediaImgSolid",
|
|
15
15
|
class: "m1atm8do",
|
|
16
16
|
propsAsIs: !0
|
|
17
|
-
}),
|
|
17
|
+
}), se = () => $, ne = /* @__PURE__ */ s(se())({
|
|
18
18
|
name: "MediaImgRounded",
|
|
19
19
|
class: "myx3xoi",
|
|
20
20
|
propsAsIs: !0
|
|
21
|
-
}),
|
|
21
|
+
}), te = () => $, oe = /* @__PURE__ */ s(te())({
|
|
22
22
|
name: "MediaImgCentered",
|
|
23
23
|
class: "m1bwv0gx",
|
|
24
24
|
propsAsIs: !0
|
|
25
|
-
}),
|
|
25
|
+
}), ie = () => $, ae = /* @__PURE__ */ s(ie())({
|
|
26
26
|
name: "MediaImgInsight",
|
|
27
27
|
class: "mntjanp",
|
|
28
28
|
propsAsIs: !0
|
|
29
|
-
}),
|
|
29
|
+
}), ce = /* @__PURE__ */ s("div")({
|
|
30
30
|
name: "VideoIcon",
|
|
31
31
|
class: "v1kofb47",
|
|
32
32
|
propsAsIs: !1
|
|
33
|
-
}),
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
},
|
|
33
|
+
}), re = {
|
|
34
|
+
[m.UNSET]: N,
|
|
35
|
+
[m.NONE]: N,
|
|
36
|
+
[m.ROUNDED]: ne,
|
|
37
|
+
[m.CENTERED]: oe,
|
|
38
|
+
[m.TRANSPARENT]: J
|
|
39
|
+
}, b = ({
|
|
40
40
|
src: t,
|
|
41
|
-
imageMode: o =
|
|
41
|
+
imageMode: o = m.UNSET,
|
|
42
42
|
withVideo: i,
|
|
43
43
|
fromInsight: a
|
|
44
44
|
}) => {
|
|
45
|
-
if (o ===
|
|
45
|
+
if (o === m.NONE)
|
|
46
46
|
return null;
|
|
47
|
-
const n = a ?
|
|
47
|
+
const n = a ? ae : re[o];
|
|
48
48
|
return /* @__PURE__ */ c(n, {
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ e("img", {
|
|
50
50
|
src: t,
|
|
51
51
|
alt: ""
|
|
52
|
-
}), i && /* @__PURE__ */
|
|
53
|
-
children: /* @__PURE__ */
|
|
52
|
+
}), i && /* @__PURE__ */ e(ce, {
|
|
53
|
+
children: /* @__PURE__ */ e(u, {
|
|
54
54
|
name: "icon-play"
|
|
55
55
|
})
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
|
-
},
|
|
58
|
+
}, le = /* @__PURE__ */ s("div")({
|
|
59
59
|
name: "NotificationContent",
|
|
60
60
|
class: "nuraq9m",
|
|
61
61
|
propsAsIs: !1
|
|
62
|
-
}),
|
|
62
|
+
}), de = /* @__PURE__ */ s("div")({
|
|
63
63
|
name: "NotificationContainer",
|
|
64
64
|
class: "ns1nzpg",
|
|
65
65
|
propsAsIs: !1
|
|
66
|
-
}), M = /* @__PURE__ */
|
|
66
|
+
}), M = /* @__PURE__ */ s("div")({
|
|
67
67
|
name: "Body",
|
|
68
68
|
class: "b1j59nzs",
|
|
69
69
|
propsAsIs: !1
|
|
70
|
-
}),
|
|
70
|
+
}), pe = /* @__PURE__ */ s("div")({
|
|
71
71
|
name: "Title",
|
|
72
72
|
class: "t9vmnpp",
|
|
73
73
|
propsAsIs: !1
|
|
74
|
-
}),
|
|
74
|
+
}), me = /* @__PURE__ */ s("button")({
|
|
75
75
|
name: "Button",
|
|
76
76
|
class: "b14ivj5k",
|
|
77
77
|
propsAsIs: !1
|
|
78
|
-
}),
|
|
78
|
+
}), ue = () => u, Ie = /* @__PURE__ */ s(ue())({
|
|
79
79
|
name: "StyledChevronRight",
|
|
80
80
|
class: "s1atci8n",
|
|
81
81
|
propsAsIs: !0
|
|
82
|
-
}),
|
|
82
|
+
}), ve = /* @__PURE__ */ s("div")({
|
|
83
83
|
name: "QuoteWrap",
|
|
84
84
|
class: "q4w8jgs",
|
|
85
85
|
propsAsIs: !1
|
|
86
|
-
}),
|
|
86
|
+
}), he = /* @__PURE__ */ s("blockquote")({
|
|
87
87
|
name: "Quote",
|
|
88
88
|
class: "qaa0kez",
|
|
89
89
|
propsAsIs: !1
|
|
90
|
-
}),
|
|
90
|
+
}), Ae = /* @__PURE__ */ s("div")({
|
|
91
91
|
name: "Body",
|
|
92
92
|
class: "b1wvd52w",
|
|
93
93
|
propsAsIs: !1
|
|
94
|
-
}),
|
|
94
|
+
}), $e = /* @__PURE__ */ s("div")({
|
|
95
95
|
name: "Container",
|
|
96
96
|
class: "ccvukea",
|
|
97
97
|
propsAsIs: !1
|
|
98
|
-
}),
|
|
99
|
-
var
|
|
100
|
-
return /* @__PURE__ */ c(
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
98
|
+
}), ye = ({ image: t, tweet: o, account: i, accountVerified: a, body: n, title: d }) => {
|
|
99
|
+
var l;
|
|
100
|
+
return /* @__PURE__ */ c($e, { children: [
|
|
101
|
+
d && /* @__PURE__ */ e(ve, { children: /* @__PURE__ */ e(he, { children: d }) }),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
103
|
L,
|
|
104
104
|
{
|
|
105
105
|
image: t,
|
|
106
|
-
name: (
|
|
106
|
+
name: (l = o == null ? void 0 : o.meta) == null ? void 0 : l.accountName,
|
|
107
107
|
userName: i,
|
|
108
108
|
verified: a,
|
|
109
109
|
createdTweet: o == null ? void 0 : o.date
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ e(Ae, { children: O(n) })
|
|
113
113
|
] });
|
|
114
|
-
},
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
114
|
+
}, fe = ({ title: t, questionType: o, questionTypeData: i }) => /* @__PURE__ */ c(M, { children: [
|
|
115
|
+
/* @__PURE__ */ e(
|
|
116
|
+
R,
|
|
117
117
|
{
|
|
118
118
|
questionTypeData: i,
|
|
119
119
|
questionType: o,
|
|
120
120
|
questionStatus: Y.UNSET
|
|
121
121
|
}
|
|
122
122
|
),
|
|
123
|
-
t && /* @__PURE__ */
|
|
124
|
-
] }),
|
|
125
|
-
} }) }) : null,
|
|
126
|
-
var
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
123
|
+
t && /* @__PURE__ */ e(pe, { children: t })
|
|
124
|
+
] }), ge = ({ tweet: t }) => t ? /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(ye, { ...t, controlVideo: () => {
|
|
125
|
+
} }) }) : null, Te = ({ action: t, questionType: o, inApp: i, insight: a, tweet: n }) => {
|
|
126
|
+
var d;
|
|
127
|
+
const l = B[o], r = P[o];
|
|
128
|
+
if (!l || !i || !i.notification)
|
|
129
129
|
return null;
|
|
130
|
-
const { title:
|
|
131
|
-
let
|
|
132
|
-
o ===
|
|
133
|
-
const
|
|
134
|
-
return /* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
o ===
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
130
|
+
const { title: p, image: I, imageMode: v } = i.notification;
|
|
131
|
+
let h = I;
|
|
132
|
+
o === A.TWEET && n != null && n.tweetMedia && (h = n.tweetMedia.image), v === m.NONE && (h = "");
|
|
133
|
+
const f = i.useMediaFromContent && (a == null ? void 0 : a.image), T = o === A.TWEET && ((d = n == null ? void 0 : n.tweetMedia) == null ? void 0 : d.video) || o === A.FACTOID && (a == null ? void 0 : a.video);
|
|
134
|
+
return /* @__PURE__ */ e(de, { className: "SL_InApp", onClick: t, children: /* @__PURE__ */ c(le, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
135
|
+
h && !f && /* @__PURE__ */ e(b, { src: h, imageMode: v, withVideo: !!T }),
|
|
136
|
+
f && /* @__PURE__ */ e(b, { src: f, fromInsight: !0, withVideo: !!T }),
|
|
137
|
+
o === A.TWEET ? /* @__PURE__ */ e(ge, { tweet: n }) : /* @__PURE__ */ e(fe, { questionTypeData: l, questionType: o, title: p }),
|
|
138
|
+
/* @__PURE__ */ e(me, { name: "inapp-button", children: r || "Open" }),
|
|
139
|
+
/* @__PURE__ */ e(Ie, { name: "chevronRight" })
|
|
140
140
|
] }) });
|
|
141
|
-
},
|
|
141
|
+
}, Ce = /* @__PURE__ */ s("div")({
|
|
142
142
|
name: "NotificationContainer",
|
|
143
143
|
class: "n11jcrxe",
|
|
144
144
|
propsAsIs: !1
|
|
145
|
-
}),
|
|
145
|
+
}), k = /* @__PURE__ */ s("img")({
|
|
146
146
|
name: "Icon",
|
|
147
147
|
class: "i1vmpt6u",
|
|
148
148
|
propsAsIs: !1
|
|
149
|
-
}),
|
|
149
|
+
}), Ne = /* @__PURE__ */ s("div")({
|
|
150
150
|
name: "IconContainer",
|
|
151
151
|
class: "i180665s",
|
|
152
152
|
propsAsIs: !1
|
|
153
|
-
}),
|
|
153
|
+
}), be = () => u, ke = /* @__PURE__ */ s(be())({
|
|
154
154
|
name: "TitleIcon",
|
|
155
155
|
class: "t16zzzei",
|
|
156
156
|
propsAsIs: !0
|
|
157
|
-
}),
|
|
157
|
+
}), we = () => Q, Se = /* @__PURE__ */ s(we())({
|
|
158
158
|
name: "Close",
|
|
159
159
|
class: "c1sur0q2",
|
|
160
160
|
propsAsIs: !0
|
|
161
|
-
}),
|
|
161
|
+
}), qe = /* @__PURE__ */ s("div")({
|
|
162
162
|
name: "Body",
|
|
163
163
|
class: "bai9j52",
|
|
164
164
|
propsAsIs: !1
|
|
165
|
-
}),
|
|
165
|
+
}), Ee = /* @__PURE__ */ s("div")({
|
|
166
166
|
name: "Title",
|
|
167
167
|
class: "t1bnt25p",
|
|
168
168
|
propsAsIs: !1
|
|
169
|
-
}),
|
|
169
|
+
}), xe = /* @__PURE__ */ s("div")({
|
|
170
170
|
name: "Description",
|
|
171
171
|
class: "dmixjec",
|
|
172
172
|
propsAsIs: !1
|
|
173
|
-
}),
|
|
173
|
+
}), Me = /* @__PURE__ */ s("button")({
|
|
174
174
|
name: "Button",
|
|
175
175
|
class: "b1ubkw1q",
|
|
176
176
|
propsAsIs: !1
|
|
177
|
-
}),
|
|
177
|
+
}), je = ({
|
|
178
178
|
open: t,
|
|
179
179
|
close: o,
|
|
180
180
|
...i
|
|
181
181
|
}) => {
|
|
182
182
|
var a, n;
|
|
183
183
|
return /* @__PURE__ */ c(
|
|
184
|
-
|
|
184
|
+
Ce,
|
|
185
185
|
{
|
|
186
186
|
onClick: () => {
|
|
187
187
|
t == null || t(), i && (i.instantOpen = !0);
|
|
188
188
|
},
|
|
189
189
|
children: [
|
|
190
|
-
/* @__PURE__ */ c(
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
190
|
+
/* @__PURE__ */ c(Ne, { children: [
|
|
191
|
+
/* @__PURE__ */ e(k, { className: "on-light", src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png" }),
|
|
192
|
+
/* @__PURE__ */ e(
|
|
193
|
+
k,
|
|
194
194
|
{
|
|
195
195
|
className: "on-dark",
|
|
196
196
|
src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"
|
|
197
197
|
}
|
|
198
198
|
)
|
|
199
199
|
] }),
|
|
200
|
-
/* @__PURE__ */ c(
|
|
201
|
-
/* @__PURE__ */ c(
|
|
202
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ c(qe, { children: [
|
|
201
|
+
/* @__PURE__ */ c(Ee, { children: [
|
|
202
|
+
/* @__PURE__ */ e(ke, { name: "icon-trophy-solid" }),
|
|
203
203
|
(a = i == null ? void 0 : i.titleCard) == null ? void 0 : a.title
|
|
204
204
|
] }),
|
|
205
|
-
/* @__PURE__ */ c(
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ c(xe, { children: [
|
|
206
|
+
/* @__PURE__ */ e("span", { children: (n = i == null ? void 0 : i.titleCard) == null ? void 0 : n.subtitle }),
|
|
207
|
+
/* @__PURE__ */ e(Me, { name: "inapp-button", children: "Play Now" })
|
|
208
208
|
] })
|
|
209
209
|
] }),
|
|
210
|
-
/* @__PURE__ */
|
|
211
|
-
|
|
210
|
+
/* @__PURE__ */ e(
|
|
211
|
+
Se,
|
|
212
212
|
{
|
|
213
|
-
close: (
|
|
214
|
-
|
|
213
|
+
close: (d) => {
|
|
214
|
+
d == null || d.stopPropagation(), o == null || o();
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
)
|
|
218
218
|
]
|
|
219
219
|
}
|
|
220
220
|
);
|
|
221
|
-
},
|
|
221
|
+
}, ze = /* @__PURE__ */ s("div")({
|
|
222
222
|
name: "Container",
|
|
223
223
|
class: "cef8huz",
|
|
224
224
|
propsAsIs: !1
|
|
225
|
-
}),
|
|
225
|
+
}), De = () => u, Le = /* @__PURE__ */ s(De())({
|
|
226
226
|
name: "CheckIcon",
|
|
227
227
|
class: "c1mo15kk",
|
|
228
228
|
propsAsIs: !0
|
|
229
|
-
}),
|
|
229
|
+
}), Oe = () => u, Re = /* @__PURE__ */ s(Oe())({
|
|
230
230
|
name: "PredictionIcon",
|
|
231
231
|
class: "p16zkqnm",
|
|
232
232
|
propsAsIs: !0
|
|
233
|
-
}),
|
|
233
|
+
}), Be = /* @__PURE__ */ s("div")({
|
|
234
234
|
name: "PredictionIconContainer",
|
|
235
235
|
class: "pjszi7a",
|
|
236
236
|
propsAsIs: !1
|
|
237
|
-
}),
|
|
237
|
+
}), Pe = /* @__PURE__ */ s("div")({
|
|
238
238
|
name: "BodyContainer",
|
|
239
239
|
class: "bftbmo3",
|
|
240
240
|
propsAsIs: !1
|
|
241
|
-
}),
|
|
241
|
+
}), Qe = /* @__PURE__ */ s("div")({
|
|
242
242
|
name: "Body",
|
|
243
243
|
class: "barrbyu",
|
|
244
244
|
propsAsIs: !1
|
|
245
|
-
}),
|
|
245
|
+
}), Ue = /* @__PURE__ */ s("div")({
|
|
246
246
|
name: "Subtitle",
|
|
247
247
|
class: "sz7237i",
|
|
248
248
|
propsAsIs: !1
|
|
249
|
-
}),
|
|
249
|
+
}), Ve = ({
|
|
250
250
|
step: t,
|
|
251
251
|
children: o,
|
|
252
252
|
answer: i,
|
|
253
253
|
state: a = "pending"
|
|
254
|
-
}) =>
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}), /* @__PURE__ */
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
254
|
+
}) => {
|
|
255
|
+
const [n, d] = y(0), [l] = y(() => new ResizeObserver((p) => {
|
|
256
|
+
var I, v;
|
|
257
|
+
d((v = (I = p == null ? void 0 : p[0]) == null ? void 0 : I.contentRect) == null ? void 0 : v.width);
|
|
258
|
+
})), r = Z((p) => {
|
|
259
|
+
p || l.disconnect(), l.observe(p);
|
|
260
|
+
}, [l]);
|
|
261
|
+
return E(() => () => {
|
|
262
|
+
l.disconnect();
|
|
263
|
+
}, [l]), /* @__PURE__ */ c(ze, {
|
|
264
|
+
children: [/* @__PURE__ */ e(Be, {
|
|
265
|
+
children: /* @__PURE__ */ e(Re, {
|
|
266
|
+
name: "icon-prediction"
|
|
267
|
+
})
|
|
268
|
+
}), /* @__PURE__ */ e(Pe, {
|
|
269
|
+
style: {
|
|
270
|
+
minWidth: `${n}px`
|
|
271
|
+
},
|
|
272
|
+
children: /* @__PURE__ */ e(Qe, {
|
|
273
|
+
children: o
|
|
274
|
+
}, t)
|
|
275
|
+
}), /* @__PURE__ */ e(Ue, {
|
|
276
|
+
ref: r,
|
|
277
|
+
className: a,
|
|
278
|
+
children: /* @__PURE__ */ c("div", {
|
|
279
|
+
children: [/* @__PURE__ */ e(Le, {
|
|
280
|
+
name: "icon-check"
|
|
281
|
+
}), "Your Pick: ", i]
|
|
282
|
+
})
|
|
283
|
+
})]
|
|
284
|
+
});
|
|
285
|
+
}, Fe = /* @__PURE__ */ s("div")({
|
|
272
286
|
name: "Container",
|
|
273
287
|
class: "ckyzolp",
|
|
274
288
|
propsAsIs: !1
|
|
275
|
-
}),
|
|
289
|
+
}), g = /* @__PURE__ */ s("div")({
|
|
276
290
|
name: "Line",
|
|
277
291
|
class: "l16t1zr7",
|
|
278
292
|
propsAsIs: !1
|
|
279
|
-
}),
|
|
293
|
+
}), We = () => g, _e = /* @__PURE__ */ s(We())({
|
|
280
294
|
name: "Line1",
|
|
281
295
|
class: "le78kvg",
|
|
282
296
|
propsAsIs: !0
|
|
283
|
-
}),
|
|
297
|
+
}), Ge = () => g, Ke = /* @__PURE__ */ s(Ge())({
|
|
284
298
|
name: "Line2",
|
|
285
299
|
class: "l1o7966d",
|
|
286
300
|
propsAsIs: !0
|
|
287
|
-
}),
|
|
301
|
+
}), Ye = () => g, Xe = /* @__PURE__ */ s(Ye())({
|
|
288
302
|
name: "Line3",
|
|
289
303
|
class: "lu9lyxq",
|
|
290
304
|
propsAsIs: !0
|
|
291
|
-
}),
|
|
292
|
-
children: [/* @__PURE__ */
|
|
293
|
-
children: /* @__PURE__ */
|
|
294
|
-
}), /* @__PURE__ */
|
|
295
|
-
children: /* @__PURE__ */
|
|
296
|
-
}), /* @__PURE__ */
|
|
297
|
-
children: /* @__PURE__ */
|
|
305
|
+
}), Ze = () => /* @__PURE__ */ c(Fe, {
|
|
306
|
+
children: [/* @__PURE__ */ e(_e, {
|
|
307
|
+
children: /* @__PURE__ */ e("div", {})
|
|
308
|
+
}), /* @__PURE__ */ e(Ke, {
|
|
309
|
+
children: /* @__PURE__ */ e("div", {})
|
|
310
|
+
}), /* @__PURE__ */ e(Xe, {
|
|
311
|
+
children: /* @__PURE__ */ e("div", {})
|
|
298
312
|
})]
|
|
299
|
-
}),
|
|
313
|
+
}), He = /* @__PURE__ */ s("div")({
|
|
300
314
|
name: "Container",
|
|
301
315
|
class: "c10jy6zf",
|
|
302
316
|
propsAsIs: !1
|
|
303
|
-
}),
|
|
317
|
+
}), Je = () => u, es = /* @__PURE__ */ s(Je())({
|
|
304
318
|
name: "CheckIcon",
|
|
305
319
|
class: "c1c7scay",
|
|
306
320
|
propsAsIs: !0
|
|
307
|
-
}),
|
|
308
|
-
children: [/* @__PURE__ */
|
|
321
|
+
}), ss = () => /* @__PURE__ */ c(He, {
|
|
322
|
+
children: [/* @__PURE__ */ e(es, {
|
|
309
323
|
name: "icon-check"
|
|
310
324
|
}), " Prediction results are in!"]
|
|
311
|
-
}),
|
|
325
|
+
}), ns = /* @__PURE__ */ s("div")({
|
|
312
326
|
name: "Container",
|
|
313
327
|
class: "cf6k2yy",
|
|
314
328
|
propsAsIs: !1
|
|
315
|
-
}),
|
|
329
|
+
}), ts = /* @__PURE__ */ s("div")({
|
|
316
330
|
name: "Caption",
|
|
317
331
|
class: "c1c8xjus",
|
|
318
332
|
propsAsIs: !1
|
|
319
|
-
}),
|
|
333
|
+
}), os = /* @__PURE__ */ s("div")({
|
|
320
334
|
name: "Title",
|
|
321
335
|
class: "t1d1uekn",
|
|
322
336
|
propsAsIs: !1
|
|
323
|
-
}),
|
|
337
|
+
}), is = ({
|
|
324
338
|
title: t
|
|
325
|
-
}) => /* @__PURE__ */ c(
|
|
326
|
-
children: [/* @__PURE__ */
|
|
339
|
+
}) => /* @__PURE__ */ c(ns, {
|
|
340
|
+
children: [/* @__PURE__ */ e(ts, {
|
|
327
341
|
children: "Results for"
|
|
328
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ e(os, {
|
|
329
343
|
children: t
|
|
330
344
|
})]
|
|
331
|
-
}),
|
|
345
|
+
}), j = /* @__PURE__ */ s("div")({
|
|
332
346
|
name: "Container",
|
|
333
347
|
class: "c181a1as",
|
|
334
348
|
propsAsIs: !1
|
|
335
|
-
}),
|
|
349
|
+
}), z = /* @__PURE__ */ s("div")({
|
|
336
350
|
name: "Title",
|
|
337
351
|
class: "t1cduox6",
|
|
338
352
|
propsAsIs: !1
|
|
339
|
-
}),
|
|
353
|
+
}), as = () => u, D = /* @__PURE__ */ s(as())({
|
|
340
354
|
name: "CorrectIcon",
|
|
341
355
|
class: "c1onrv6j",
|
|
342
356
|
propsAsIs: !0
|
|
343
|
-
}),
|
|
357
|
+
}), cs = () => D, rs = /* @__PURE__ */ s(cs())({
|
|
344
358
|
name: "InCorrectIcon",
|
|
345
359
|
class: "i17n9o7e",
|
|
346
360
|
propsAsIs: !0
|
|
347
|
-
}),
|
|
348
|
-
children: [/* @__PURE__ */ c(
|
|
349
|
-
children: ["Congratulations!", /* @__PURE__ */
|
|
350
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), ls = () => /* @__PURE__ */ c(j, {
|
|
362
|
+
children: [/* @__PURE__ */ c(z, {
|
|
363
|
+
children: ["Congratulations!", /* @__PURE__ */ e("br", {}), "You answered correctly."]
|
|
364
|
+
}), /* @__PURE__ */ e(D, {
|
|
351
365
|
name: "icon-check"
|
|
352
366
|
})]
|
|
353
|
-
}),
|
|
367
|
+
}), ds = ({
|
|
354
368
|
title: t
|
|
355
|
-
}) => /* @__PURE__ */ c(
|
|
356
|
-
children: [/* @__PURE__ */ c(
|
|
357
|
-
children: ["Better luck next time!", /* @__PURE__ */
|
|
358
|
-
}), /* @__PURE__ */
|
|
369
|
+
}) => /* @__PURE__ */ c(j, {
|
|
370
|
+
children: [/* @__PURE__ */ c(z, {
|
|
371
|
+
children: ["Better luck next time!", /* @__PURE__ */ e("br", {}), "Correct: ", t]
|
|
372
|
+
}), /* @__PURE__ */ e(rs, {
|
|
359
373
|
name: "icon-cross"
|
|
360
374
|
})]
|
|
361
|
-
}),
|
|
375
|
+
}), ps = /* @__PURE__ */ s("div")({
|
|
362
376
|
name: "Container",
|
|
363
377
|
class: "cnxgcs2",
|
|
364
378
|
propsAsIs: !1
|
|
365
|
-
}),
|
|
379
|
+
}), ms = /* @__PURE__ */ s("div")({
|
|
366
380
|
name: "Title",
|
|
367
381
|
class: "t903f8n",
|
|
368
382
|
propsAsIs: !1
|
|
369
|
-
}),
|
|
383
|
+
}), us = () => u, Is = /* @__PURE__ */ s(us())({
|
|
370
384
|
name: "CheckIcon",
|
|
371
385
|
class: "ceyu3qj",
|
|
372
386
|
propsAsIs: !0
|
|
373
|
-
}),
|
|
387
|
+
}), vs = ({
|
|
374
388
|
points: t
|
|
375
|
-
}) => /* @__PURE__ */ c(
|
|
376
|
-
children: [/* @__PURE__ */ c(
|
|
377
|
-
children: ["You won ", /* @__PURE__ */
|
|
389
|
+
}) => /* @__PURE__ */ c(ps, {
|
|
390
|
+
children: [/* @__PURE__ */ c(ms, {
|
|
391
|
+
children: ["You won ", /* @__PURE__ */ e(U, {
|
|
378
392
|
delay: 0.5,
|
|
379
393
|
prefix: "+",
|
|
380
394
|
suffix: " points",
|
|
381
395
|
value: t
|
|
382
396
|
})]
|
|
383
|
-
}), /* @__PURE__ */
|
|
397
|
+
}), /* @__PURE__ */ e(Is, {
|
|
384
398
|
name: "icon-trophy-solid"
|
|
385
399
|
})]
|
|
386
|
-
}),
|
|
400
|
+
}), w = /* @__PURE__ */ s("div")({
|
|
387
401
|
name: "Container",
|
|
388
402
|
class: "cq3agu2",
|
|
389
403
|
propsAsIs: !1
|
|
390
|
-
}),
|
|
404
|
+
}), S = /* @__PURE__ */ s("div")({
|
|
391
405
|
name: "Body",
|
|
392
406
|
class: "b16qj0do",
|
|
393
407
|
propsAsIs: !1
|
|
394
|
-
}),
|
|
408
|
+
}), q = {
|
|
395
409
|
1: 3e3,
|
|
396
410
|
2: 4e3,
|
|
397
411
|
3: 4e3,
|
|
398
412
|
4: 4e3
|
|
399
|
-
},
|
|
400
|
-
if (
|
|
413
|
+
}, hs = ({ close: t, action: o, setStep: i, votedAnswer: a, correct: n, correctAnswerTitle: d, questionTitle: l, step: r }) => {
|
|
414
|
+
if (x(() => {
|
|
401
415
|
if (i) {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
},
|
|
416
|
+
const I = setTimeout(() => {
|
|
417
|
+
q[r + 1] && (n || r < 3) ? i(r + 1) : t == null || t();
|
|
418
|
+
}, q[r]);
|
|
405
419
|
return () => {
|
|
406
|
-
|
|
420
|
+
I && clearTimeout(I);
|
|
407
421
|
};
|
|
408
422
|
}
|
|
409
423
|
return () => {
|
|
410
424
|
};
|
|
411
425
|
}, [i, r, t, n]), r === 1)
|
|
412
|
-
return /* @__PURE__ */
|
|
413
|
-
let
|
|
414
|
-
return (r === 3 || r === 4) && (
|
|
415
|
-
r !== 1 && /* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */ c(
|
|
417
|
-
r === 2 && /* @__PURE__ */
|
|
418
|
-
r === 3 && n && /* @__PURE__ */
|
|
419
|
-
r === 3 && !n && /* @__PURE__ */
|
|
420
|
-
r === 4 && /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(ss, {}) }) });
|
|
427
|
+
let p = "pending";
|
|
428
|
+
return (r === 3 || r === 4) && (p = n ? "correct" : "incorrect"), /* @__PURE__ */ e(w, { onClick: () => o == null ? void 0 : o(), children: /* @__PURE__ */ c(S, { children: [
|
|
429
|
+
r !== 1 && /* @__PURE__ */ e(Ze, {}, r),
|
|
430
|
+
/* @__PURE__ */ c(Ve, { state: p, step: r, answer: (a == null ? void 0 : a.title) || "unknown", children: [
|
|
431
|
+
r === 2 && /* @__PURE__ */ e(is, { title: l || "unknown" }),
|
|
432
|
+
r === 3 && n && /* @__PURE__ */ e(ls, {}),
|
|
433
|
+
r === 3 && !n && /* @__PURE__ */ e(ds, { title: d || "unknown" }),
|
|
434
|
+
r === 4 && /* @__PURE__ */ e(vs, { points: (a == null ? void 0 : a.points) || 0 })
|
|
421
435
|
] })
|
|
422
436
|
] }) });
|
|
423
|
-
},
|
|
424
|
-
const [
|
|
425
|
-
return /* @__PURE__ */
|
|
426
|
-
|
|
437
|
+
}, As = ({ close: t, action: o, votedAnswer: i, correct: a, correctAnswerTitle: n, questionTitle: d }) => {
|
|
438
|
+
const [l, r] = y(1);
|
|
439
|
+
return /* @__PURE__ */ e(
|
|
440
|
+
hs,
|
|
427
441
|
{
|
|
428
442
|
close: t,
|
|
429
443
|
action: o,
|
|
430
444
|
votedAnswer: i,
|
|
431
445
|
correct: a,
|
|
432
446
|
correctAnswerTitle: n,
|
|
433
|
-
questionTitle:
|
|
447
|
+
questionTitle: d,
|
|
434
448
|
setStep: r,
|
|
435
|
-
step:
|
|
449
|
+
step: l,
|
|
436
450
|
title: ""
|
|
437
451
|
}
|
|
438
452
|
);
|
|
439
|
-
},
|
|
453
|
+
}, $s = /* @__PURE__ */ s("div")({
|
|
440
454
|
name: "NotificationContainer",
|
|
441
455
|
class: "n1i4h28u",
|
|
442
456
|
propsAsIs: !1
|
|
443
|
-
}),
|
|
444
|
-
const [o] =
|
|
445
|
-
return
|
|
446
|
-
n &&
|
|
457
|
+
}), ys = (t) => /* @__PURE__ */ e($s, { children: /* @__PURE__ */ e(As, { ...t }) }), fs = ({ sdk: t }) => {
|
|
458
|
+
const [o] = y(t.getNotificationsStore()), i = V(o), a = t.getFeature(X.GAMES), n = E(() => t.getActiveNotification(), [t, i]);
|
|
459
|
+
return x(() => {
|
|
460
|
+
n && F.emit("notification", {
|
|
447
461
|
action: "rendered",
|
|
448
462
|
payload: {
|
|
449
463
|
questionId: n.data.questionId,
|
|
450
464
|
questionType: n.data.questionType
|
|
451
465
|
}
|
|
452
466
|
});
|
|
453
|
-
}, [n]), n && n.type ===
|
|
454
|
-
|
|
467
|
+
}, [n]), n && n.type === C.QUESTION_RESOLVED ? n.data.question && n.data.questionType === A.PREDICTION ? /* @__PURE__ */ e(
|
|
468
|
+
ys,
|
|
455
469
|
{
|
|
456
470
|
action: n.action,
|
|
457
471
|
close: n.close,
|
|
458
472
|
...n.data.question
|
|
459
473
|
}
|
|
460
|
-
) : null : n && n.type ===
|
|
461
|
-
},
|
|
462
|
-
const o =
|
|
463
|
-
return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */
|
|
474
|
+
) : null : n && n.type === C.ONBOARDING ? n.data.onboarding ? /* @__PURE__ */ e(je, { open: a == null ? void 0 : a.openFeature, close: n.close, ...n.data.onboarding }) : null : n && /* @__PURE__ */ e(Te, { ...n.data, action: n.action });
|
|
475
|
+
}, bs = ({ theme: t }) => {
|
|
476
|
+
const o = W(), i = _(), a = G();
|
|
477
|
+
return o && (a.appNotification || a.onboardingNotification) ? a.app && !a.onboardingNotification ? null : /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(K, { customTheme: t ?? i.theme, themeMode: i.themeMode, children: /* @__PURE__ */ e(fs, { sdk: o }) }) }) : null;
|
|
464
478
|
};
|
|
465
479
|
export {
|
|
466
|
-
|
|
467
|
-
|
|
480
|
+
bs as StreamLayerSDKNotification,
|
|
481
|
+
fs as StreamLayerSDKNotificationUI
|
|
468
482
|
};
|