@streamlayer/react 1.24.6 → 1.24.7

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 (160) hide show
  1. package/lib/cjs/advertisement.js +19607 -203
  2. package/lib/cjs/auth.js +4459 -1
  3. package/lib/cjs/bet-pack.js +15691 -1
  4. package/lib/cjs/index.js +19411 -1
  5. package/lib/cjs/insight.js +13509 -1
  6. package/lib/cjs/masters.js +20696 -1
  7. package/lib/cjs/notification.js +13087 -1
  8. package/lib/cjs/package.json +1 -0
  9. package/lib/cjs/pause-ad.js +8390 -1
  10. package/lib/cjs/points.js +7189 -1
  11. package/lib/cjs/polyfills.js +69 -0
  12. package/lib/cjs/polymarket.js +16394 -14
  13. package/lib/cjs/style.css +1 -0
  14. package/lib/cjs/useStreamLayerApp.js +4711 -1
  15. package/lib/dist/cjs/index.js +20696 -1
  16. package/lib/dist/es/index.js +20669 -10
  17. package/lib/dist/es/polyfills.js +92 -0
  18. package/lib/es/advertisement.js +2821 -2746
  19. package/lib/es/analytics.js +1 -1
  20. package/lib/es/feature.js +60 -56
  21. package/lib/es/index.js +1 -1
  22. package/lib/es/index10.js +181 -7
  23. package/lib/es/index11.js +371 -181
  24. package/lib/es/index12.js +3 -3
  25. package/lib/es/index13.js +4 -4
  26. package/lib/es/index14.js +2 -2
  27. package/lib/es/index15.js +384 -414
  28. package/lib/es/index16.js +45 -46
  29. package/lib/es/index2.js +11 -13
  30. package/lib/es/index3.js +34 -4
  31. package/lib/es/index4.js +3 -3
  32. package/lib/es/index5.js +3 -19
  33. package/lib/es/index6.js +7 -4
  34. package/lib/es/index7.js +284 -5
  35. package/lib/es/index8.js +236 -281
  36. package/lib/es/index9.js +8 -179
  37. package/lib/es/insight.js +1 -1
  38. package/lib/es/masters2.js +9 -10
  39. package/lib/es/notification.js +5 -5
  40. package/lib/es/pause-ad.js +1 -1
  41. package/lib/es/points.js +3 -3
  42. package/lib/es/polymarket.js +2 -2
  43. package/lib/es/storage.js +3 -3
  44. package/lib/es/style.css +1 -0
  45. package/lib/es/useStreamLayerApp2.js +5654 -4604
  46. package/lib/source.css +1 -120
  47. package/package.json +99 -83
  48. package/lib/cjs/Question.js +0 -1
  49. package/lib/cjs/analytics.js +0 -1
  50. package/lib/cjs/feature.js +0 -1
  51. package/lib/cjs/gamification-feature.js +0 -1
  52. package/lib/cjs/gamification-feature2.js +0 -1
  53. package/lib/cjs/hooks-n9ax4LRT.js +0 -1
  54. package/lib/cjs/index-CfSdnrfA.js +0 -5
  55. package/lib/cjs/index10.js +0 -1
  56. package/lib/cjs/index11.js +0 -1
  57. package/lib/cjs/index12.js +0 -1
  58. package/lib/cjs/index13.js +0 -4
  59. package/lib/cjs/index14.js +0 -1
  60. package/lib/cjs/index15.js +0 -1
  61. package/lib/cjs/index16.js +0 -5
  62. package/lib/cjs/index2.js +0 -1
  63. package/lib/cjs/index3.js +0 -1
  64. package/lib/cjs/index4.js +0 -5
  65. package/lib/cjs/index5.js +0 -1
  66. package/lib/cjs/index6.js +0 -1
  67. package/lib/cjs/index7.js +0 -1
  68. package/lib/cjs/index8.js +0 -1
  69. package/lib/cjs/index9.js +0 -7
  70. package/lib/cjs/masters2.js +0 -8
  71. package/lib/cjs/storage.js +0 -1
  72. package/lib/cjs/theme.js +0 -1
  73. package/lib/cjs/useStreamLayerApp2.js +0 -17
  74. package/lib/cjs/utils.js +0 -47
  75. package/lib/classic/app/advertisement.d.ts +0 -19
  76. package/lib/classic/app/app.d.ts +0 -23
  77. package/lib/classic/app/auth.d.ts +0 -4
  78. package/lib/classic/app/bet-pack.d.ts +0 -10
  79. package/lib/classic/app/insight.d.ts +0 -13
  80. package/lib/classic/app/masters.d.ts +0 -19
  81. package/lib/classic/app/notification.d.ts +0 -5
  82. package/lib/classic/app/pause-ad.d.ts +0 -27
  83. package/lib/classic/app/points.d.ts +0 -3
  84. package/lib/classic/app/polymarket.d.ts +0 -7
  85. package/lib/classic/app/useStreamLayerApp.d.ts +0 -1
  86. package/lib/classic/cjs/Question.js +0 -1
  87. package/lib/classic/cjs/advertisement.js +0 -203
  88. package/lib/classic/cjs/analytics.js +0 -1
  89. package/lib/classic/cjs/auth.js +0 -1
  90. package/lib/classic/cjs/bet-pack.js +0 -5
  91. package/lib/classic/cjs/feature.js +0 -1
  92. package/lib/classic/cjs/gamification-feature.js +0 -1
  93. package/lib/classic/cjs/hooks-n9ax4LRT.js +0 -1
  94. package/lib/classic/cjs/index-CfSdnrfA.js +0 -5
  95. package/lib/classic/cjs/index.js +0 -1
  96. package/lib/classic/cjs/index10.js +0 -1
  97. package/lib/classic/cjs/index11.js +0 -1
  98. package/lib/classic/cjs/index12.js +0 -1
  99. package/lib/classic/cjs/index13.js +0 -4
  100. package/lib/classic/cjs/index2.js +0 -5
  101. package/lib/classic/cjs/index3.js +0 -1
  102. package/lib/classic/cjs/index4.js +0 -1
  103. package/lib/classic/cjs/index5.js +0 -1
  104. package/lib/classic/cjs/index6.js +0 -1
  105. package/lib/classic/cjs/index7.js +0 -7
  106. package/lib/classic/cjs/index8.js +0 -1
  107. package/lib/classic/cjs/index9.js +0 -1
  108. package/lib/classic/cjs/insight.js +0 -1
  109. package/lib/classic/cjs/notification.js +0 -1
  110. package/lib/classic/cjs/notification2.js +0 -1
  111. package/lib/classic/cjs/pause-ad.js +0 -1
  112. package/lib/classic/cjs/points.js +0 -1
  113. package/lib/classic/cjs/polymarket.js +0 -14
  114. package/lib/classic/cjs/useStreamLayerApp.js +0 -1
  115. package/lib/classic/cjs/useStreamLayerApp2.js +0 -17
  116. package/lib/classic/cjs/utils.js +0 -47
  117. package/lib/classic/es/Question.js +0 -503
  118. package/lib/classic/es/advertisement.js +0 -38792
  119. package/lib/classic/es/analytics.js +0 -84
  120. package/lib/classic/es/auth.js +0 -11
  121. package/lib/classic/es/bet-pack.js +0 -3418
  122. package/lib/classic/es/feature.js +0 -210
  123. package/lib/classic/es/gamification-feature.js +0 -4
  124. package/lib/classic/es/hooks-n9ax4LRT.js +0 -97
  125. package/lib/classic/es/index.js +0 -15
  126. package/lib/classic/es/index10.js +0 -321
  127. package/lib/classic/es/index11.js +0 -2592
  128. package/lib/classic/es/index12.js +0 -185
  129. package/lib/classic/es/index13.js +0 -820
  130. package/lib/classic/es/index2.js +0 -2605
  131. package/lib/classic/es/index3.js +0 -19
  132. package/lib/classic/es/index4.js +0 -6
  133. package/lib/classic/es/index5.js +0 -4
  134. package/lib/classic/es/index6.js +0 -285
  135. package/lib/classic/es/index7.js +0 -181
  136. package/lib/classic/es/index8.js +0 -7
  137. package/lib/classic/es/index9.js +0 -11
  138. package/lib/classic/es/insight.js +0 -79
  139. package/lib/classic/es/notification.js +0 -9
  140. package/lib/classic/es/notification2.js +0 -1126
  141. package/lib/classic/es/pause-ad.js +0 -232
  142. package/lib/classic/es/points.js +0 -76
  143. package/lib/classic/es/polymarket.js +0 -6617
  144. package/lib/classic/es/useStreamLayerApp.js +0 -4
  145. package/lib/classic/es/useStreamLayerApp2.js +0 -11627
  146. package/lib/classic/es/utils.js +0 -76
  147. package/lib/classic/index.d.ts +0 -6
  148. package/lib/classic/masters.d.ts +0 -8
  149. package/lib/classic/source.css +0 -110
  150. package/lib/dist/cjs/gamification-feature.js +0 -1
  151. package/lib/dist/cjs/index-CfSdnrfA.js +0 -5
  152. package/lib/dist/cjs/masters.js +0 -69
  153. package/lib/dist/es/gamification-feature.js +0 -4
  154. package/lib/dist/es/index-CfSdnrfA.js +0 -3775
  155. package/lib/dist/es/masters.js +0 -22387
  156. package/lib/dist/index.d.ts +0 -1357
  157. package/lib/dist/source.css +0 -64
  158. package/lib/es/index-CfSdnrfA.js +0 -3775
  159. package/lib/style.css +0 -1
  160. /package/lib/{classic/es/index-CfSdnrfA.js → es/index-D8wyDNJD.js} +0 -0
@@ -1,820 +0,0 @@
1
- import { jsx as e, jsxs as o, Fragment as B } from "react/jsx-runtime";
2
- import { useState as $, useRef as ee, useEffect as _, useCallback as N, useLayoutEffect as ze, useMemo as K } from "react";
3
- import { s, c as pe } from "./feature.js";
4
- import { i as le } from "./index9.js";
5
- import { B as E } from "./index6.js";
6
- import { Q as t, c as se, a as G, b as Ye } from "./useStreamLayerApp2.js";
7
- import { b as Me, L as Ue } from "./index7.js";
8
- import { p as Ce } from "./index3.js";
9
- const On = /* @__PURE__ */ s("div")({
10
- name: "SDKContainer",
11
- class: "sopqfe6",
12
- propsAsIs: !1
13
- }), Ke = /* @__PURE__ */ s("div")({
14
- name: "SDKScrollContainer",
15
- class: "s102vcph",
16
- propsAsIs: !1
17
- }), $e = /* @__PURE__ */ s("div")({
18
- name: "SDKContentContainer",
19
- class: "s1meqjjv",
20
- propsAsIs: !1
21
- }), _e = () => $e, Ee = /* @__PURE__ */ s(_e())({
22
- name: "SDKWhiteContainer",
23
- class: "s1burm22",
24
- propsAsIs: !0
25
- }), He = () => Ee, Sn = /* @__PURE__ */ s(He())({
26
- name: "SDKSummaryContainer",
27
- class: "sm5r3j5",
28
- propsAsIs: !0
29
- }), Vn = /* @__PURE__ */ s("div")({
30
- name: "TabsContainer",
31
- class: "tysxwr6",
32
- propsAsIs: !1
33
- }), Ze = () => $e, Ln = /* @__PURE__ */ s(Ze())({
34
- name: "LeaderboardContainer",
35
- class: "l9er3b1",
36
- propsAsIs: !0
37
- }), Ge = () => Ee, jn = /* @__PURE__ */ s(Ge())({
38
- name: "TabsNavContainer",
39
- class: "t19dtrb3",
40
- propsAsIs: !0
41
- }), Qn = /* @__PURE__ */ s("div")({
42
- name: "UserSummaryContainer",
43
- class: "u1552n3j",
44
- propsAsIs: !1
45
- });
46
- let Je = class {
47
- observers = /* @__PURE__ */ new Set();
48
- subscribe(a) {
49
- this.observers.add(a);
50
- }
51
- unsubscribe(a) {
52
- this.observers.delete(a);
53
- }
54
- notify(a) {
55
- this.observers.forEach((c) => c(a));
56
- }
57
- };
58
- const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
59
- const [n, a] = $(Xe), c = ee(null);
60
- _(() => {
61
- const p = (h) => {
62
- a(h);
63
- };
64
- return J.subscribe(p), () => {
65
- J.unsubscribe(p);
66
- };
67
- }, []);
68
- const l = N((p) => {
69
- const h = { hiding: !0, finished: !1 };
70
- c.current && clearTimeout(c.current), p?.delay ? c.current = setTimeout(() => {
71
- J.notify(h);
72
- }, p?.delay) : J.notify(h);
73
- }, []), r = N(() => {
74
- n.hiding && (c.current = null, J.notify({ hiding: !1, finished: !0 }));
75
- }, [n.hiding]);
76
- return {
77
- ...n,
78
- runAnimation: l,
79
- onAnimationEnd: r
80
- };
81
- }, ss = /* @__PURE__ */ s("div")({
82
- name: "Container",
83
- class: "c1pgyo67",
84
- propsAsIs: !1
85
- }), ns = "sx17qu6", ts = "h1692c5m", be = ({
86
- children: n,
87
- style: a,
88
- className: c,
89
- enabled: l = !0,
90
- hiding: r,
91
- onAnimationEnd: p
92
- }) => /* @__PURE__ */ e(ss, {
93
- style: a,
94
- className: pe(c, l && ns, l && r && ts),
95
- onAnimationEnd: p,
96
- children: n
97
- }), rs = () => be, as = /* @__PURE__ */ s(rs())({
98
- name: "GrowingContainer",
99
- class: "gck55ev",
100
- propsAsIs: !0
101
- }), we = ({
102
- children: n,
103
- style: a,
104
- enabled: c,
105
- animate: l,
106
- ...r
107
- }) => {
108
- const p = ee(null);
109
- return /* @__PURE__ */ e(as, {
110
- ...r,
111
- enabled: c && l,
112
- style: {
113
- ...a,
114
- ...(() => {
115
- const h = p?.current, v = (h && window.getComputedStyle(h))?.getPropertyValue("height");
116
- return c ? {
117
- height: l ? v : 0
118
- } : {};
119
- })()
120
- },
121
- children: /* @__PURE__ */ e("div", {
122
- ref: p,
123
- children: n
124
- })
125
- });
126
- }, is = /* @__PURE__ */ s("div")({
127
- name: "Container",
128
- class: "c1gcvmcj",
129
- propsAsIs: !1
130
- }), os = /* @__PURE__ */ s("div")({
131
- name: "Title",
132
- class: "tnr592a",
133
- propsAsIs: !1
134
- }), cs = /* @__PURE__ */ s("div")({
135
- name: "Description",
136
- class: "d1e8jqpv",
137
- propsAsIs: !1
138
- }), ls = () => E, ds = /* @__PURE__ */ s(ls())({
139
- name: "Icon",
140
- class: "i1vs651k",
141
- propsAsIs: !0
142
- }), ps = ({ icon: n, title: a, description: c }) => /* @__PURE__ */ o(is, { children: [
143
- /* @__PURE__ */ e(ds, { name: n }),
144
- /* @__PURE__ */ e(os, { children: a }),
145
- /* @__PURE__ */ e(cs, { children: c })
146
- ] }), us = () => we, ms = /* @__PURE__ */ s(us())({
147
- name: "ShowInContainer",
148
- class: "s16sbdnm",
149
- propsAsIs: !0
150
- }), Q = /* @__PURE__ */ s("div")({
151
- name: "FeedbackContainer",
152
- class: "fbhorgl",
153
- propsAsIs: !1
154
- }), Ae = "s1g20ja7", hs = /* @__PURE__ */ s("div")({
155
- name: "Container",
156
- class: "c455ozj",
157
- propsAsIs: !1
158
- }), Is = () => E, ve = /* @__PURE__ */ s(Is())({
159
- name: "IconPrediction",
160
- class: "i1913njx",
161
- propsAsIs: !0
162
- }), X = /* @__PURE__ */ s("div")({
163
- name: "FeedbackIconWrap",
164
- class: "fzfk69z",
165
- propsAsIs: !1
166
- }), te = /* @__PURE__ */ s("div")({
167
- name: "FeedbackHeader",
168
- class: "fx87qaj",
169
- propsAsIs: !1
170
- }), fs = /* @__PURE__ */ s("span")({
171
- name: "FeedbackTitle",
172
- class: "fvek9ew",
173
- propsAsIs: !1
174
- }), W = /* @__PURE__ */ s("span")({
175
- name: "FeedbackDescription",
176
- class: "f1kbtp09",
177
- propsAsIs: !1
178
- }), As = /* @__PURE__ */ s("div")({
179
- name: "FeedbackTitleWrap",
180
- class: "f4i8rro",
181
- propsAsIs: !1
182
- }), vs = /* @__PURE__ */ s("div")({
183
- name: "FeedbackResultDescriptionWrap",
184
- class: "fqyssr",
185
- propsAsIs: !1
186
- }), ys = () => W, Ts = /* @__PURE__ */ s(ys())({
187
- name: "FeedbackDynamicDescription",
188
- class: "fyv794i",
189
- propsAsIs: !0
190
- }), Cs = () => W, $s = /* @__PURE__ */ s(Cs())({
191
- name: "FeedbackResultDescription",
192
- class: "f1jkj9vx",
193
- propsAsIs: !0
194
- }), de = /* @__PURE__ */ s("div")({
195
- name: "FeedbackText",
196
- class: "f1pxh3a6",
197
- propsAsIs: !1
198
- }), Es = /* @__PURE__ */ s("span")({
199
- name: "DynamicWrap",
200
- class: "d1afvufn",
201
- propsAsIs: !1
202
- }), bs = /* @__PURE__ */ s("div")({
203
- name: "EarlyFeedbackDescription",
204
- class: "eq8u24d",
205
- propsAsIs: !1
206
- }), ye = ({
207
- feedbackMessages: n,
208
- questionVotedCorrectly: a,
209
- questionVoted: c,
210
- questionType: l,
211
- hasCorrectAnswer: r,
212
- showExpiredNotification: p,
213
- showClosedNotificationTrivia: h,
214
- votedInCurrentRender: v,
215
- votedAfterQuestionClosed: i,
216
- voteErrorMessage: m,
217
- enteredAnActiveQuestion: b,
218
- marketClosed: g,
219
- percentsAnimated: y,
220
- votedAnswer: O,
221
- isEarlyPrediction: I,
222
- correctAnswer: T,
223
- onAnimationEnd: q
224
- }) => {
225
- const P = c && (l === t.TRIVIA || l === t.PREDICTION), k = l === t.PREDICTION && !r, S = g && l === t.PREDICTION && !c || l === t.PREDICTION && i && v && b, C = P && k, V = P && r, f = l === t.PREDICTION && c && v && r, F = c && l === t.POLL && v, w = a ? "correct" : "incorrect", L = a ? n?.correctFeedback : n?.incorrectFeedback;
226
- return p || h || C || V || S || F || f || m ? /* @__PURE__ */ e(
227
- ms,
228
- {
229
- enabled: v,
230
- animate: !m && p ? !0 : y,
231
- onAnimationEnd: q,
232
- children: /* @__PURE__ */ o(hs, { "data-prediction": k, children: [
233
- m && !S && /* @__PURE__ */ o(Q, { children: [
234
- !I && /* @__PURE__ */ e(ve, { name: "questionExpired" }),
235
- /* @__PURE__ */ e(W, { children: m })
236
- ] }),
237
- !m && p && /* @__PURE__ */ o(Q, { children: [
238
- !I && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
239
- /* @__PURE__ */ o("div", { children: [
240
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: "Question Expired" }) }),
241
- /* @__PURE__ */ e(de, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
242
- ] })
243
- ] }),
244
- !m && h && /* @__PURE__ */ o(Q, { className: pe(Ae), children: [
245
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
246
- /* @__PURE__ */ o("div", { children: [
247
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: "Question Closed" }) }),
248
- /* @__PURE__ */ e(de, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
249
- ] })
250
- ] }),
251
- S && /* @__PURE__ */ o(Q, { children: [
252
- !I && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
253
- /* @__PURE__ */ o("div", { children: [
254
- /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: I ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
255
- /* @__PURE__ */ e(de, { children: I ? /* @__PURE__ */ e(bs, { children: r ? `Correct: ${T?.text}` : "Event affecting the outcome has occurred." }) : "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
256
- ] })
257
- ] }),
258
- !m && C && /* @__PURE__ */ o(Q, { children: [
259
- !I && /* @__PURE__ */ e(ve, { name: "icon-prediction" }),
260
- /* @__PURE__ */ o(Ts, { children: [
261
- "Your pick has been recorded. ",
262
- /* @__PURE__ */ e(Es, { children: "We’ll notify you of the result." })
263
- ] })
264
- ] }),
265
- !m && F && /* @__PURE__ */ o(Q, { children: [
266
- !I && /* @__PURE__ */ e(X, { "data-feedback-type": "correct", children: /* @__PURE__ */ e(E, { name: "correct" }) }),
267
- /* @__PURE__ */ e(W, { children: "Thanks for answering. Please stay tuned for the next question." })
268
- ] }),
269
- !m && (V || f) && /* @__PURE__ */ o(Q, { className: pe(h && Ae), children: [
270
- !I && /* @__PURE__ */ e(X, { "data-feedback-type": w, children: /* @__PURE__ */ e(E, { name: w }) }),
271
- /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o(te, { children: [
272
- I ? /* @__PURE__ */ e(As, { children: w === "incorrect" ? /* @__PURE__ */ o(B, { children: [
273
- /* @__PURE__ */ e("div", { children: "So close!" }),
274
- /* @__PURE__ */ e("div", { children: "Better luck next time" })
275
- ] }) : /* @__PURE__ */ o(B, { children: [
276
- /* @__PURE__ */ e("div", { children: "That’s correct!" }),
277
- /* @__PURE__ */ e("div", { children: "You chose wisely." })
278
- ] }) }) : /* @__PURE__ */ e(fs, { "data-feedback-type": w, children: L?.title }),
279
- I ? /* @__PURE__ */ o(vs, { children: [
280
- /* @__PURE__ */ o("div", { children: [
281
- "Your pick: ",
282
- O?.text
283
- ] }),
284
- /* @__PURE__ */ e("div", { children: w === "incorrect" ? `Correct: ${T?.text}` : "" })
285
- ] }) : /* @__PURE__ */ e($s, { children: L?.description })
286
- ] }) })
287
- ] })
288
- ] })
289
- }
290
- ) : null;
291
- }, ws = /* @__PURE__ */ s("div")({
292
- name: "Container",
293
- class: "c1hygj0s",
294
- propsAsIs: !1
295
- }), gs = /* @__PURE__ */ s("div")({
296
- name: "Title",
297
- class: "t1r84tez",
298
- propsAsIs: !1
299
- }), Ps = /* @__PURE__ */ s("div")({
300
- name: "Description",
301
- class: "d1aj1a7k",
302
- propsAsIs: !1
303
- }), Rs = /* @__PURE__ */ s("div")({
304
- name: "AdditionalDescription",
305
- class: "ax09ezs",
306
- propsAsIs: !1
307
- }), Ds = () => E, qs = /* @__PURE__ */ s(Ds())({
308
- name: "Icon",
309
- class: "inkrac",
310
- propsAsIs: !0
311
- }), ks = ({ icon: n, title: a, description: c, additionalDescription: l }) => /* @__PURE__ */ o(ws, { children: [
312
- n && /* @__PURE__ */ e(qs, { name: n }),
313
- /* @__PURE__ */ e(gs, { children: a }),
314
- /* @__PURE__ */ e(Ps, { children: c }),
315
- l && /* @__PURE__ */ e(Rs, { children: l })
316
- ] }), ge = /* @__PURE__ */ s("div")({
317
- name: "Container",
318
- class: "c14ielyq",
319
- propsAsIs: !1
320
- }), xs = () => Ke, Ns = /* @__PURE__ */ s(xs())({
321
- name: "QuestionScrollContainer",
322
- class: "q1tlqx57",
323
- propsAsIs: !0
324
- }), Os = /* @__PURE__ */ s("div")({
325
- name: "TopShadow",
326
- class: "t1hq58md",
327
- propsAsIs: !1
328
- }), Ss = /* @__PURE__ */ s("div")({
329
- name: "BottomShadow",
330
- class: "b1c8nxcx",
331
- propsAsIs: !1
332
- }), Vs = /* @__PURE__ */ s("div")({
333
- name: "SponsorLogo",
334
- class: "siozuc3",
335
- propsAsIs: !1
336
- }), Pe = /* @__PURE__ */ s("div")({
337
- name: "Content",
338
- class: "cpnc44r",
339
- propsAsIs: !1
340
- }), Ls = /* @__PURE__ */ s("div")({
341
- name: "Title",
342
- class: "tq7p3w0",
343
- propsAsIs: !1
344
- }), js = /* @__PURE__ */ s("div")({
345
- name: "OptionsWrap",
346
- class: "o1jlfj9g",
347
- propsAsIs: !1
348
- }), Re = /* @__PURE__ */ s("div")({
349
- name: "Options",
350
- class: "o84pmnd",
351
- propsAsIs: !1
352
- }), Qs = () => be, Te = /* @__PURE__ */ s(Qs())({
353
- name: "AlertContainer",
354
- class: "a1dybjw9",
355
- propsAsIs: !0
356
- }), Ws = /* @__PURE__ */ s("div")({
357
- name: "EarlyPrediction",
358
- class: "e1l05ict",
359
- propsAsIs: !1
360
- }), Bs = () => E, Fs = /* @__PURE__ */ s(Bs())({
361
- name: "EarlyPredictionIcon",
362
- class: "ez9juex",
363
- propsAsIs: !0
364
- }), zs = () => E, Ys = /* @__PURE__ */ s(zs())({
365
- name: "SponsorIcon",
366
- class: "s8p4aob",
367
- propsAsIs: !0
368
- }), Ms = /* @__PURE__ */ s("button")({
369
- name: "ButtonContainer",
370
- class: "b1b6dl8t",
371
- propsAsIs: !1
372
- }), Us = /* @__PURE__ */ s("div")({
373
- name: "ButtonPctWrap",
374
- class: "b4iik8i",
375
- propsAsIs: !1
376
- }), Ks = /* @__PURE__ */ s("div")({
377
- name: "ButtonPct",
378
- class: "b1gq1lnf",
379
- propsAsIs: !1
380
- }), _s = /* @__PURE__ */ s("span")({
381
- name: "ButtonBody",
382
- class: "b1j65z51",
383
- propsAsIs: !1
384
- }), Hs = /* @__PURE__ */ s("div")({
385
- name: "IconContainer",
386
- class: "i19tpfua",
387
- propsAsIs: !1
388
- }), Zs = /* @__PURE__ */ s("div")({
389
- name: "IconWrap",
390
- class: "i1tubmma",
391
- propsAsIs: !1
392
- }), De = /* @__PURE__ */ s("img")({
393
- name: "Icon",
394
- class: "i1grrgwj",
395
- propsAsIs: !1
396
- }), Gs = () => De, Js = /* @__PURE__ */ s(Gs())({
397
- name: "IconDefault",
398
- class: "ibemyq8",
399
- propsAsIs: !0
400
- }), Xs = () => De, en = /* @__PURE__ */ s(Xs())({
401
- name: "IconCircle",
402
- class: "i1dceht",
403
- propsAsIs: !0
404
- }), sn = /* @__PURE__ */ s("span")({
405
- name: "Title",
406
- class: "t116q4vq",
407
- propsAsIs: !1
408
- }), nn = /* @__PURE__ */ s("span")({
409
- name: "Indicators",
410
- class: "i17ajcu2",
411
- propsAsIs: !1
412
- }), tn = /* @__PURE__ */ s("div")({
413
- name: "PtsWrap",
414
- class: "pu9kmlb",
415
- propsAsIs: !1
416
- }), rn = /* @__PURE__ */ s("span")({
417
- name: "Pts",
418
- class: "p1j2j0s0",
419
- propsAsIs: !1
420
- }), an = /* @__PURE__ */ s("span")({
421
- name: "Percentage",
422
- class: "p1mzj1sj",
423
- propsAsIs: !1
424
- }), on = () => E, cn = /* @__PURE__ */ s(on())({
425
- name: "CheckIcon",
426
- class: "cichgz8",
427
- propsAsIs: !0
428
- }), ln = {
429
- [G.CENTERED]: (n) => /* @__PURE__ */ e(Js, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
430
- [G.TRANSPARENT]: (n) => /* @__PURE__ */ e(Hs, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(Zs, { style: { backgroundImage: `url(${n})` } }) }),
431
- [G.ROUNDED]: (n) => /* @__PURE__ */ e(en, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
432
- [G.NONE]: () => null,
433
- [G.UNSET]: () => null
434
- }, dn = ({ questionType: n, hasCorrectAnswer: a, correct: c, youVoted: l, questionVoted: r }) => {
435
- if (n === t.POLL && l)
436
- return "voted";
437
- if (n === t.PREDICTION) {
438
- if (!a && r)
439
- return l ? "voted" : "unset";
440
- if (a && r)
441
- return l ? c ? "correct" : "incorrect" : "unset";
442
- if (l)
443
- return "correct";
444
- }
445
- return n === t.TRIVIA && r && l ? c ? "correct" : "incorrect" : "unset";
446
- }, pn = ({
447
- questionType: n,
448
- questionVoted: a,
449
- correct: c,
450
- hasCorrectAnswer: l,
451
- questionStatus: r
452
- }) => n === t.TRIVIA ? a && c : n === t.PREDICTION ? a && c && l || r === se.RESOLVED && c : !1, un = Me(Ms), mn = (n) => {
453
- const {
454
- // option props
455
- id: a,
456
- icon: c,
457
- text: l,
458
- percentageDecimal: r,
459
- points: p,
460
- // extra props
461
- onVote: h,
462
- markThatVoted: v,
463
- firstOption: i,
464
- onPercentsAnimated: m,
465
- youSelected: b,
466
- youVoted: g,
467
- questionVoted: y,
468
- imageMode: O,
469
- answerTimeExpired: I,
470
- questionStatus: T,
471
- isLoading: q,
472
- questionType: P,
473
- correct: k,
474
- hasCorrectAnswer: S,
475
- marketClosed: C,
476
- isEarlyPrediction: V,
477
- isAd: f,
478
- webos: F
479
- } = n, [w, L] = $(0), z = dn(n), H = pn({ questionType: P, questionVoted: y, correct: k, hasCorrectAnswer: S, questionStatus: T }), x = C && P === t.PREDICTION, ne = y || x, Y = P === t.PREDICTION && !y && !C && !f, Z = y && !b && z !== "incorrect" && !g;
480
- return ze(() => {
481
- L(0), requestAnimationFrame(() => {
482
- L(r);
483
- });
484
- }, [r]), /* @__PURE__ */ o(
485
- un,
486
- {
487
- value: a,
488
- webos: F,
489
- autoFocus: i,
490
- "data-selected": b,
491
- "data-answer-state": z,
492
- disabled: y || q || I || x,
493
- "data-is-not-checked": Z,
494
- "data-a": "intr",
495
- onClick: (re) => {
496
- v(
497
- P === t.PREDICTION ? C : T === se.RESOLVED
498
- ), h(re);
499
- },
500
- "data-is-ad": f,
501
- children: [
502
- /* @__PURE__ */ e(Us, { children: /* @__PURE__ */ e(
503
- Ks,
504
- {
505
- "data-answer-state": z,
506
- "data-is-not-checked": Z,
507
- style: { width: `${ne ? w : 0}%` },
508
- onTransitionEnd: () => {
509
- x || m?.();
510
- },
511
- "data-is-ad": f
512
- }
513
- ) }),
514
- /* @__PURE__ */ o(_s, { "data-a": "intr", children: [
515
- c && O && ln[O]?.(c),
516
- /* @__PURE__ */ e(sn, { "data-a": "intr", children: l }),
517
- Y && /* @__PURE__ */ o(tn, { children: [
518
- p,
519
- /* @__PURE__ */ e(rn, { children: "pts" })
520
- ] }),
521
- ne && /* @__PURE__ */ o(nn, { children: [
522
- H && /* @__PURE__ */ e(cn, { name: V ? "selectedBetPack" : "selected" }),
523
- /* @__PURE__ */ e(an, { children: /* @__PURE__ */ e(Ce, { value: r, suffix: "%" }) })
524
- ] })
525
- ] })
526
- ]
527
- }
528
- );
529
- }, hn = () => we, In = /* @__PURE__ */ s(hn())({
530
- name: "ShowInContainer",
531
- class: "sie6cqo",
532
- propsAsIs: !0
533
- }), fn = /* @__PURE__ */ s("div")({
534
- name: "WinBarContainer",
535
- class: "wgizw4u",
536
- propsAsIs: !1
537
- }), An = /* @__PURE__ */ s("div")({
538
- name: "Content",
539
- class: "c1l3ucjp",
540
- propsAsIs: !1
541
- }), vn = /* @__PURE__ */ s("div")({
542
- name: "Title",
543
- class: "tx7j799",
544
- propsAsIs: !1
545
- }), yn = () => E, Tn = /* @__PURE__ */ s(yn())({
546
- name: "WinIcon",
547
- class: "w4lwuj0",
548
- propsAsIs: !0
549
- }), Cn = /* @__PURE__ */ s("div")({
550
- name: "Points",
551
- class: "po9i64o",
552
- propsAsIs: !1
553
- }), $n = /* @__PURE__ */ s("span")({
554
- name: "PointsCount",
555
- class: "pe5g05h",
556
- propsAsIs: !1
557
- }), En = /* @__PURE__ */ s("span")({
558
- name: "PointsUnits",
559
- class: "p1hdtpmb",
560
- propsAsIs: !1
561
- }), bn = ({
562
- title: n,
563
- points: a,
564
- isPlayingTimer: c,
565
- isTimer: l,
566
- animatePoints: r,
567
- questionType: p,
568
- timerDuration: h,
569
- votedInCurrentRender: v,
570
- percentsAnimated: i,
571
- onTimerExpired: m
572
- }) => /* @__PURE__ */ e(
573
- In,
574
- {
575
- enabled: p === t.PREDICTION && v,
576
- animate: i,
577
- children: /* @__PURE__ */ o(
578
- fn,
579
- {
580
- style: {
581
- justifyContent: p === t.PREDICTION ? "center" : "space-between"
582
- },
583
- children: [
584
- /* @__PURE__ */ o(An, { children: [
585
- n && /* @__PURE__ */ e(vn, { children: n }),
586
- a !== void 0 && p !== t.POLL && /* @__PURE__ */ o(B, { children: [
587
- /* @__PURE__ */ e(Tn, { name: "icon-trophy" }),
588
- /* @__PURE__ */ o(Cn, { children: [
589
- /* @__PURE__ */ e($n, { children: r ? /* @__PURE__ */ e(Ce, { value: a, delay: 0.3 }) : a }),
590
- /* @__PURE__ */ e(En, { children: "PTS" })
591
- ] })
592
- ] })
593
- ] }),
594
- l && p !== t.PREDICTION && /* @__PURE__ */ e(Ue, { isPlaying: c, onTimerExpired: m, duration: h })
595
- ]
596
- }
597
- )
598
- }
599
- ), wn = (n, a) => n === "already_voted" ? a === t.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally." : "Something went wrong, please try again", Bn = () => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ o(Pe, { children: [
600
- /* @__PURE__ */ e(le, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
601
- /* @__PURE__ */ e(le, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
602
- /* @__PURE__ */ e(Re, { children: Array.from({ length: 5 }).map((n, a) => /* @__PURE__ */ e(le, { loading: !0, style: { height: "44px" } }, a)) })
603
- ] }) }), Fn = ({
604
- openedQuestion: n,
605
- isLoading: a,
606
- vote: c,
607
- close: l,
608
- isEarlyPrediction: r,
609
- mastersApp: p,
610
- webos: h
611
- }) => {
612
- const v = n.subject, i = n.type, m = n.status, b = n.options?.options, g = n.marketClosed, y = n.id, O = ee(), I = ee(), T = p ? !1 : n?.adUnit === Ye.STANDART, [q, P] = $(!1), [k, S] = $(!1), [C, V] = $(!0), [f, F] = $(!1), [w, L] = $(!1), [z, H] = $(""), [x, ne] = $(""), [Y, Z] = $(!1), [re, qe] = $(!1), [ue, ke] = $(!1), { runAnimation: M, hiding: me } = es();
613
- _(() => {
614
- me && l(y);
615
- }, [l, me]), _(() => {
616
- i === t.PREDICTION ? g && V(!1) : m === se.RESOLVED && V(!1);
617
- }, []);
618
- const xe = N((u) => {
619
- S(u), P(!0);
620
- }, []), Ne = N(() => {
621
- r && P(!1);
622
- }, [r]), ae = ee(!1), he = N(() => {
623
- I.current && clearTimeout(I.current), I.current = setTimeout(() => {
624
- ke(!0), M({ delay: 5500 });
625
- }, 4e3);
626
- }, [M]), Ie = N(
627
- async (u) => {
628
- if (!ae.current && (ae.current = !0, y)) {
629
- const D = u.currentTarget.value;
630
- H(D);
631
- try {
632
- await c(y, D), T && he();
633
- } catch (U) {
634
- ne(wn(U.message, i)), H(""), console.error("Error while voting", U), ae.current = !1;
635
- }
636
- }
637
- },
638
- [i, y, H, c, T, he]
639
- ), Oe = N(() => {
640
- F(!0), M({ delay: 3500 });
641
- }, [M]), Se = N(() => {
642
- L(!0), M({ delay: 3500 });
643
- }, [M]), d = n?.answers.find((u) => u.youVoted === !0), A = K(
644
- () => !!n?.answers.find((u) => u.correct === !0),
645
- [n]
646
- ), R = K(
647
- () => n?.answers.find((u) => u.correct === !0),
648
- [n]
649
- );
650
- _(() => {
651
- d && q && !re && (O.current = setTimeout(Se, 1e4), qe(!0));
652
- }, [d]), _(() => () => {
653
- clearTimeout(O.current), clearTimeout(I.current);
654
- }, []);
655
- const ie = K(() => n ? n.answers.map((u) => ({
656
- ...u,
657
- questionVoted: !!d,
658
- youSelected: z === u.id,
659
- isLoading: a,
660
- hasCorrectAnswer: A,
661
- questionType: n.type,
662
- answerTimeExpired: f,
663
- questionStatus: m,
664
- imageMode: n.appearance?.images,
665
- onVote: Ie
666
- })) : [], [
667
- A,
668
- f,
669
- a,
670
- n,
671
- d,
672
- m,
673
- Ie,
674
- z
675
- ]);
676
- _(() => {
677
- const u = ie.some(({ percentageDecimal: U }) => U !== 0), D = d && i === t.PREDICTION;
678
- x && (r || !u || g && D) && Z(!0);
679
- }, [ie, x, r, g, i, d]);
680
- const fe = b && (b.case === "trivia" || b.case === "prediction") ? b.value : void 0, j = m === se.RESOLVED && i === t.TRIVIA && !d && !C, oe = i === t.TRIVIA && k, ce = K(() => T ? !1 : i === t.PREDICTION ? r ? !1 : !!(d && !A || d && A && R?.youVoted) : !0, [i, d, A, R, r, T]), Ve = K(() => {
681
- if (i === t.PREDICTION && d && (!A || A && R?.youVoted))
682
- return d.points;
683
- if (!(j || f))
684
- return d ? d.correct ? d.pointsEarned : 0 : R?.points;
685
- }, [f, d, R, j, i, A]), Le = K(() => i === t.PREDICTION && d ? A ? A && R?.youVoted ? "You won" : "" : "To win" : j || f ? "Time expired" : i === t.POLL ? "Time remaining" : d ? "You won" : "To win", [f, i, d, j, A, R]), je = !ce || ce && i === t.PREDICTION && q && !Y, Qe = (i === t.TRIVIA || i === t.PREDICTION) && d && A && R?.youVoted, We = d || j || oe || i === t.TRIVIA && m === se.RESOLVED && C, Be = !r && (f || w) || ue, Fe = () => {
686
- const u = () => i === t.TRIVIA ? d?.correct ? `That's correct!
687
- You chose wisely.` : `So close!
688
- Better luck next time.` : i === t.POLL ? `Thanks for answering.
689
- Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to see if your prediction was correct." : "", D = () => i === t.TRIVIA ? `Your Pick: ${R?.text}` : i === t.POLL || i === t.PREDICTION ? `Your Pick: ${d?.text}` : "", U = () => i === t.TRIVIA && b?.case === "trivia" ? b?.value.explanation : i === t.PREDICTION ? v : "";
690
- return ue ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
691
- ks,
692
- {
693
- title: u(),
694
- description: D(),
695
- ...d?.correct || i === t.POLL || i === t.PREDICTION ? { icon: "icon-correct" } : {},
696
- ...i === t.TRIVIA || i === t.PREDICTION ? { additionalDescription: U() } : {}
697
- }
698
- ) }) : !r && (f || w) ? /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ e(
699
- ps,
700
- {
701
- icon: "icon-check-circle",
702
- title: "More to come...",
703
- description: w ? /* @__PURE__ */ o(B, { children: [
704
- "Stay tuned for more questions ",
705
- /* @__PURE__ */ e("br", {}),
706
- " and insights."
707
- ] }) : /* @__PURE__ */ o(B, { children: [
708
- "Watch for additional enhanced stream ",
709
- /* @__PURE__ */ e("br", {}),
710
- " interactive experience."
711
- ] })
712
- }
713
- ) }) : null;
714
- };
715
- return /* @__PURE__ */ o(Ns, { children: [
716
- r && /* @__PURE__ */ e(Os, {}),
717
- /* @__PURE__ */ e(ge, { style: r ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ o(Pe, { children: [
718
- !r && !T && /* @__PURE__ */ e(
719
- ye,
720
- {
721
- feedbackMessages: fe,
722
- questionVoted: !!d,
723
- questionVotedCorrectly: d?.correct,
724
- questionType: i,
725
- hasCorrectAnswer: A,
726
- showExpiredNotification: j,
727
- showClosedNotificationTrivia: oe,
728
- votedInCurrentRender: q,
729
- votedAfterQuestionClosed: k,
730
- enteredAnActiveQuestion: C,
731
- marketClosed: g,
732
- percentsAnimated: Y,
733
- voteErrorMessage: x,
734
- votedAnswer: d
735
- }
736
- ),
737
- ce && /* @__PURE__ */ e(
738
- bn,
739
- {
740
- title: Le,
741
- points: Ve,
742
- onTimerExpired: Oe,
743
- questionType: n.type,
744
- isTimer: !a,
745
- isPlayingTimer: !d,
746
- animatePoints: Qe,
747
- timerDuration: We ? 0 : Number(n?.appearance?.autoHideInterval || "30"),
748
- votedInCurrentRender: q,
749
- percentsAnimated: Y
750
- }
751
- ),
752
- Be ? Fe() : /* @__PURE__ */ o(B, { children: [
753
- r && /* @__PURE__ */ o(Ws, { children: [
754
- /* @__PURE__ */ e(Fs, { name: "iconEarlyPrediction" }),
755
- "EARLY PREDICTION"
756
- ] }),
757
- /* @__PURE__ */ e(Ls, { style: je ? { marginTop: 0 } : {}, children: v }),
758
- r && /* @__PURE__ */ e(
759
- ye,
760
- {
761
- feedbackMessages: fe,
762
- questionVoted: !!d,
763
- questionVotedCorrectly: d?.correct,
764
- questionType: i,
765
- hasCorrectAnswer: A,
766
- showExpiredNotification: j,
767
- showClosedNotificationTrivia: oe,
768
- votedInCurrentRender: q,
769
- votedAfterQuestionClosed: k,
770
- enteredAnActiveQuestion: C,
771
- marketClosed: g,
772
- percentsAnimated: Y,
773
- voteErrorMessage: x,
774
- isEarlyPrediction: r,
775
- correctAnswer: R,
776
- votedAnswer: d,
777
- onAnimationEnd: Ne
778
- }
779
- ),
780
- /* @__PURE__ */ o(js, { children: [
781
- /* @__PURE__ */ e(Re, { children: ie.sort((u, D) => u.id > D.id ? 1 : -1).map((u, D) => /* @__PURE__ */ e(
782
- mn,
783
- {
784
- ...u,
785
- firstOption: D === 0,
786
- markThatVoted: xe,
787
- onPercentsAnimated: () => Z(!0),
788
- votedAfterQuestionClosed: k,
789
- enteredAnActiveQuestion: C,
790
- marketClosed: g,
791
- isEarlyPrediction: r,
792
- isAd: T,
793
- webos: h
794
- },
795
- u.id
796
- )) }),
797
- r && /* @__PURE__ */ o(B, { children: [
798
- /* @__PURE__ */ e(Ss, {}),
799
- /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Ys, { name: "mastersLogoWhite" }) })
800
- ] })
801
- ] })
802
- ] })
803
- ] }) })
804
- ] });
805
- };
806
- export {
807
- Ln as C,
808
- Fn as Q,
809
- jn as S,
810
- Bn as Z,
811
- Ee as a,
812
- Ke as c,
813
- Qn as d,
814
- be as f,
815
- Vn as l,
816
- Sn as m,
817
- $e as n,
818
- On as p,
819
- es as y
820
- };