@streamlayer/react-ui 1.18.1 → 1.19.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.
Files changed (69) hide show
  1. package/lib/app/app/Notifications/index.js +1 -1
  2. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +12 -8
  3. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +42 -14
  4. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.d.ts +12 -0
  5. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +40 -20
  6. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +8 -4
  7. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +4 -0
  8. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +27 -0
  9. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +21 -19
  10. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
  11. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +22 -17
  12. package/lib/app/masters/BetPack/BetPackContent/index.js +88 -62
  13. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +1 -0
  14. package/lib/app/masters/BetPack/BetPackContent/styles.js +8 -7
  15. package/lib/app/masters/BetPack/index.js +59 -53
  16. package/lib/app/masters/Features/Gamification/Question.js +3 -3
  17. package/lib/app/masters/Features/Gamification/Tabs.d.ts +0 -7
  18. package/lib/app/masters/Features/Gamification/Tabs.js +9 -42
  19. package/lib/app/masters/Features/Gamification/UserSummary.js +15 -14
  20. package/lib/app/masters/Features/Gamification/index.d.ts +1 -6
  21. package/lib/app/masters/Features/Gamification/index.js +37 -76
  22. package/lib/app/masters/Features/index.d.ts +1 -6
  23. package/lib/app/masters/Features/index.js +15 -25
  24. package/lib/app/masters/Header/index.d.ts +3 -0
  25. package/lib/app/masters/Header/index.js +38 -0
  26. package/lib/app/masters/Notifications/index.js +1 -1
  27. package/lib/app/masters/masters.d.ts +1 -0
  28. package/lib/app/masters/masters.js +75 -92
  29. package/lib/app/masters/story/index.d.ts +1 -0
  30. package/lib/app/masters/story/index.js +21 -22
  31. package/lib/app/masters/styles.d.ts +0 -10
  32. package/lib/app/masters/styles.js +13 -23
  33. package/lib/app/masters/useSdkResponsive.js +1 -1
  34. package/lib/app/masters/useSdkScroll.js +1 -1
  35. package/lib/app/useClipboardCopy.js +1 -1
  36. package/lib/app/useSdkResponsive.js +1 -1
  37. package/lib/app/useSdkScroll.js +1 -1
  38. package/lib/assets/style.css +1 -1
  39. package/lib/index-BEm7B1u1.js +72 -0
  40. package/lib/index-DALxy-8N.js +5437 -0
  41. package/lib/ui/gamification/user-statistics/index.d.ts +1 -0
  42. package/lib/ui/gamification/user-statistics/index.js +47 -39
  43. package/lib/ui/gamification/user-statistics/styles.d.ts +2 -0
  44. package/lib/ui/gamification/user-statistics/styles.js +34 -24
  45. package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
  46. package/lib/ui/gamification/vote/feedback/index.js +60 -47
  47. package/lib/ui/gamification/vote/feedback/styles.d.ts +12 -0
  48. package/lib/ui/gamification/vote/feedback/styles.js +47 -27
  49. package/lib/ui/gamification/vote/index.js +145 -136
  50. package/lib/ui/gamification/vote/styles.d.ts +3 -1
  51. package/lib/ui/gamification/vote/styles.js +42 -32
  52. package/lib/ui/gamification/vote/vote-option/index.d.ts +1 -0
  53. package/lib/ui/gamification/vote/vote-option/index.js +59 -60
  54. package/lib/ui/gamification/vote/vote-option/styles.d.ts +1 -0
  55. package/lib/ui/gamification/vote/vote-option/styles.js +16 -11
  56. package/lib/ui/icons/index.d.ts +3 -0
  57. package/lib/ui/icons/index.js +69 -51
  58. package/lib/ui/loader/index.js +4 -3
  59. package/lib/ui/modal/index.js +1 -1
  60. package/lib/ui/theme/masters-theme.js +152 -32
  61. package/lib/ui/theme/theme.js +66 -20
  62. package/package.json +16 -15
  63. package/lib/app/masters/Features/Gamification/Friends.d.ts +0 -3
  64. package/lib/app/masters/Features/Gamification/Friends.js +0 -19
  65. package/lib/app/masters/Features/Gamification/Leaderboard.d.ts +0 -8
  66. package/lib/app/masters/Features/Gamification/Leaderboard.js +0 -56
  67. package/lib/index-B1QdimmR.js +0 -19047
  68. package/lib/index-CZvwzN5o.js +0 -75
  69. package/lib/index-xuotMAFm.js +0 -118
@@ -1,191 +1,200 @@
1
- import { jsx as n, jsxs as h, Fragment as N } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as m, Fragment as O } from "react/jsx-runtime";
2
2
  import { useHideTransition as gt } from "../../../hooks/showIn.js";
3
- import { useRef as U, useState as c, useEffect as y, useCallback as O, useMemo as g } from "react";
3
+ import { useRef as U, useState as l, useEffect as p, useCallback as S, useMemo as g } from "react";
4
4
  import { QuestionType as a, QuestionStatus as b } from "@streamlayer/sdk-web-types";
5
5
  import { Skeleton as L } from "../../skeleton/index.js";
6
6
  import { Alert as It } from "./alert/index.js";
7
7
  import { Feedback as X } from "./feedback/index.js";
8
- import { Container as Z, Content as $, Options as Q, QuestionScrollContainer as Ct, AlertContainer as Vt, EarlyPrediction as yt, EarlyPredictionIcon as vt, Title as pt, OptionsWrap as Et, SponsorLogo as At, SponsorIcon as wt } from "./styles.js";
9
- import { VotingOption as Rt } from "./vote-option/index.js";
10
- import { WinBar as Ot } from "./win-bar/index.js";
11
- const xt = (e, m) => {
8
+ import { Container as Z, Content as $, Options as Q, QuestionScrollContainer as Ct, TopShadow as Vt, AlertContainer as pt, EarlyPrediction as vt, EarlyPredictionIcon as yt, Title as wt, OptionsWrap as At, BottomShadow as Et, SponsorLogo as Rt, SponsorIcon as Ot } from "./styles.js";
9
+ import { VotingOption as St } from "./vote-option/index.js";
10
+ import { WinBar as xt } from "./win-bar/index.js";
11
+ const qt = (e, u) => {
12
12
  switch (e) {
13
13
  case "already_voted":
14
- return m === a.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.";
14
+ return u === a.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.";
15
15
  default:
16
16
  return "Something went wrong, please try again";
17
17
  }
18
- }, Yt = () => /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ h($, { children: [
19
- /* @__PURE__ */ n(L, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
20
- /* @__PURE__ */ n(L, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
21
- /* @__PURE__ */ n(Q, { children: Array.from({ length: 5 }).map((e, m) => /* @__PURE__ */ n(L, { loading: !0, style: { height: "44px" } }, m)) })
22
- ] }) }), Bt = ({ openedQuestion: e, isLoading: m, vote: M, close: W, isEarlyPrediction: l }) => {
18
+ }, jt = () => /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ m($, { children: [
19
+ /* @__PURE__ */ r(L, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
20
+ /* @__PURE__ */ r(L, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
21
+ /* @__PURE__ */ r(Q, { children: Array.from({ length: 5 }).map((e, u) => /* @__PURE__ */ r(L, { loading: !0, style: { height: "44px" } }, u)) })
22
+ ] }) }), Ht = ({ openedQuestion: e, isLoading: u, vote: M, close: W, isEarlyPrediction: c }) => {
23
23
  var J, K;
24
- const tt = e.subject, r = e.type, I = e.status, v = (J = e.options) == null ? void 0 : J.options, T = e.marketClosed, x = e.id, Y = U(), [C, et] = c(!1), [p, rt] = c(!1), [V, B] = c(!0), [f, nt] = c(!1), [j, it] = c(!1), [H, S] = c(""), [E, ot] = c(""), [A, F] = c(!1), [st, at] = c(!1), { runAnimation: w, finished: _ } = gt();
25
- y(() => {
24
+ const tt = e.subject, n = e.type, I = e.status, v = (J = e.options) == null ? void 0 : J.options, T = e.marketClosed, x = e.id, B = U(), [C, et] = l(!1), [y, rt] = l(!1), [V, Y] = l(!0), [f, nt] = l(!1), [j, ot] = l(!1), [H, q] = l(""), [w, st] = l(""), [A, F] = l(!1), [it, at] = l(!1), { runAnimation: E, finished: _ } = gt();
25
+ p(() => {
26
26
  _ && W();
27
- }, [W, _]), y(() => {
28
- r === a.PREDICTION ? T && B(!1) : I === b.RESOLVED && B(!1);
27
+ }, [W, _]), p(() => {
28
+ n === a.PREDICTION ? T && Y(!1) : I === b.RESOLVED && Y(!1);
29
29
  }, []);
30
- const ct = O((o) => {
31
- rt(o), et(!0);
32
- }, []), q = U(!1), z = O(
33
- async (o) => {
34
- if (!q.current && (q.current = !0, x)) {
35
- const d = o.currentTarget.value;
36
- S(d);
30
+ const ct = S((s) => {
31
+ rt(s), et(!0);
32
+ }, []), D = U(!1), z = S(
33
+ async (s) => {
34
+ if (!D.current && (D.current = !0, x)) {
35
+ const h = s.currentTarget.value;
36
+ q(h);
37
37
  try {
38
- await M(x, d);
38
+ await M(x, h);
39
39
  } catch (R) {
40
- ot(xt(R.message, r)), S(""), console.error("Error while voting", R), q.current = !1;
40
+ st(qt(R.message, n)), q(""), console.error("Error while voting", R), D.current = !1;
41
41
  }
42
42
  }
43
43
  },
44
- [r, x, S, M]
45
- ), lt = O(() => {
46
- nt(!0), w({ delay: 3500 });
47
- }, [w]), mt = O(() => {
48
- it(!0), w({ delay: 3500 });
49
- }, [w]), t = e == null ? void 0 : e.answers.find((o) => o.youVoted === !0), s = g(
50
- () => !!(e != null && e.answers.find((o) => o.correct === !0)),
44
+ [n, x, q, M]
45
+ ), lt = S(() => {
46
+ nt(!0), E({ delay: 3500 });
47
+ }, [E]), mt = S(() => {
48
+ ot(!0), E({ delay: 3500 });
49
+ }, [E]), t = e == null ? void 0 : e.answers.find((s) => s.youVoted === !0), i = g(
50
+ () => !!(e != null && e.answers.find((s) => s.correct === !0)),
51
51
  [e]
52
- ), i = g(
53
- () => e == null ? void 0 : e.answers.find((o) => o.correct === !0),
52
+ ), o = g(
53
+ () => e == null ? void 0 : e.answers.find((s) => s.correct === !0),
54
54
  [e]
55
55
  );
56
- y(() => {
57
- t && C && !st && (Y.current = setTimeout(mt, 1e4), at(!0));
58
- }, [t]), y(() => () => {
59
- clearTimeout(Y.current);
56
+ p(() => {
57
+ t && C && !it && (B.current = setTimeout(mt, 1e4), at(!0));
58
+ }, [t]), p(() => () => {
59
+ clearTimeout(B.current);
60
60
  }, []);
61
- const D = g(() => e ? e.answers.map((o) => {
62
- var d;
61
+ const k = g(() => e ? e.answers.map((s) => {
62
+ var h;
63
63
  return {
64
- ...o,
64
+ ...s,
65
65
  questionVoted: !!t,
66
- youSelected: H === o.id,
67
- isLoading: m,
68
- hasCorrectAnswer: s,
66
+ youSelected: H === s.id,
67
+ isLoading: u,
68
+ hasCorrectAnswer: i,
69
69
  questionType: e.type,
70
70
  answerTimeExpired: f,
71
71
  questionStatus: I,
72
- imageMode: (d = e.appearance) == null ? void 0 : d.images,
72
+ imageMode: (h = e.appearance) == null ? void 0 : h.images,
73
73
  onVote: z
74
74
  };
75
75
  }) : [], [
76
- s,
76
+ i,
77
77
  f,
78
- m,
78
+ u,
79
79
  e,
80
80
  t,
81
81
  I,
82
82
  z,
83
83
  H
84
84
  ]);
85
- y(() => {
86
- const o = D.some(({ percentageDecimal: R }) => R !== 0), d = t && r === a.PREDICTION;
87
- E && (!o || T && d) && F(!0);
88
- }, [D, E, T, r, t]);
89
- const G = v && (v.case === "trivia" || v.case === "prediction") ? v.value : void 0, u = I === b.RESOLVED && r === a.TRIVIA && !t && !V, P = r === a.TRIVIA && p, k = g(() => r === a.PREDICTION ? l ? !1 : !!(t && !s || t && s && (i != null && i.youVoted)) : !0, [r, t, s, i, l]), ft = g(() => {
90
- if (r === a.PREDICTION && t && (!s || s && (i != null && i.youVoted)))
85
+ p(() => {
86
+ const s = k.some(({ percentageDecimal: R }) => R !== 0), h = t && n === a.PREDICTION;
87
+ w && (!s || T && h) && F(!0);
88
+ }, [k, w, T, n, t]);
89
+ const G = v && (v.case === "trivia" || v.case === "prediction") ? v.value : void 0, d = I === b.RESOLVED && n === a.TRIVIA && !t && !V, N = n === a.TRIVIA && y, P = g(() => n === a.PREDICTION ? c ? !1 : !!(t && !i || t && i && (o != null && o.youVoted)) : !0, [n, t, i, o, c]), ut = g(() => {
90
+ if (n === a.PREDICTION && t && (!i || i && (o != null && o.youVoted)))
91
91
  return t.points;
92
- if (!(u || f))
93
- return t ? t.correct ? t.pointsEarned : 0 : i == null ? void 0 : i.points;
94
- }, [f, t, i, u, r, s]), ut = g(() => r === a.PREDICTION && t ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : u || f ? "Time expired" : r === a.POLL ? "Time remaining" : t ? "You won" : "To win", [f, r, t, u, s, i]), dt = !k || k && r === a.PREDICTION && C && !A, ht = (r === a.TRIVIA || r === a.PREDICTION) && t && s && (i == null ? void 0 : i.youVoted), Tt = t || u || P || r === a.TRIVIA && I === b.RESOLVED && V;
95
- return /* @__PURE__ */ n(Ct, { children: /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ h($, { children: [
96
- !l && /* @__PURE__ */ n(
97
- X,
98
- {
99
- feedbackMessages: G,
100
- questionVoted: !!t,
101
- questionVotedCorrectly: t == null ? void 0 : t.correct,
102
- questionType: r,
103
- hasCorrectAnswer: s,
104
- showExpiredNotification: u,
105
- showClosedNotificationTrivia: P,
106
- votedInCurrentRender: C,
107
- votedAfterQuestionClosed: p,
108
- enteredAnActiveQuestion: V,
109
- marketClosed: T,
110
- percentsAnimated: A,
111
- voteErrorMessage: E
112
- }
113
- ),
114
- k && /* @__PURE__ */ n(
115
- Ot,
116
- {
117
- title: ut,
118
- points: ft,
119
- onTimerExpired: lt,
120
- questionType: e.type,
121
- isTimer: !m,
122
- isPlayingTimer: !t,
123
- animatePoints: ht,
124
- timerDuration: Tt ? 0 : Number(((K = e == null ? void 0 : e.appearance) == null ? void 0 : K.autoHideInterval) || "30"),
125
- votedInCurrentRender: C,
126
- percentsAnimated: A
127
- }
128
- ),
129
- !l && (f || j) ? /* @__PURE__ */ n(Vt, { children: /* @__PURE__ */ n(
130
- It,
131
- {
132
- icon: "icon-check-circle",
133
- title: "More to come...",
134
- description: j ? /* @__PURE__ */ h(N, { children: [
135
- "Stay tuned for more questions ",
136
- /* @__PURE__ */ n("br", {}),
137
- " and insights."
138
- ] }) : /* @__PURE__ */ h(N, { children: [
139
- "Watch for additional enhanced stream ",
140
- /* @__PURE__ */ n("br", {}),
141
- " interactive experience."
142
- ] })
143
- }
144
- ) }) : /* @__PURE__ */ h(N, { children: [
145
- l && /* @__PURE__ */ h(yt, { children: [
146
- /* @__PURE__ */ n(vt, { name: "iconEarlyPrediction" }),
147
- "EARLY PREDICTION"
148
- ] }),
149
- /* @__PURE__ */ n(pt, { style: dt ? { marginTop: 0 } : {}, id: "voteTitle", children: tt }),
150
- l && /* @__PURE__ */ n(
92
+ if (!(d || f))
93
+ return t ? t.correct ? t.pointsEarned : 0 : o == null ? void 0 : o.points;
94
+ }, [f, t, o, d, n, i]), ft = g(() => n === a.PREDICTION && t ? i ? i && (o != null && o.youVoted) ? "You won" : "" : "To win" : d || f ? "Time expired" : n === a.POLL ? "Time remaining" : t ? "You won" : "To win", [f, n, t, d, i, o]), dt = !P || P && n === a.PREDICTION && C && !A, ht = (n === a.TRIVIA || n === a.PREDICTION) && t && i && (o == null ? void 0 : o.youVoted), Tt = t || d || N || n === a.TRIVIA && I === b.RESOLVED && V;
95
+ return /* @__PURE__ */ m(Ct, { children: [
96
+ c && /* @__PURE__ */ r(Vt, {}),
97
+ /* @__PURE__ */ r(Z, { style: c ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ m($, { id: "questionContent", children: [
98
+ !c && /* @__PURE__ */ r(
151
99
  X,
152
100
  {
153
101
  feedbackMessages: G,
154
102
  questionVoted: !!t,
155
103
  questionVotedCorrectly: t == null ? void 0 : t.correct,
156
- questionType: r,
157
- hasCorrectAnswer: s,
158
- showExpiredNotification: u,
159
- showClosedNotificationTrivia: P,
104
+ questionType: n,
105
+ hasCorrectAnswer: i,
106
+ showExpiredNotification: d,
107
+ showClosedNotificationTrivia: N,
160
108
  votedInCurrentRender: C,
161
- votedAfterQuestionClosed: p,
109
+ votedAfterQuestionClosed: y,
162
110
  enteredAnActiveQuestion: V,
163
111
  marketClosed: T,
164
112
  percentsAnimated: A,
165
- voteErrorMessage: E,
166
- isEarlyPrediction: l,
167
- correctAnswer: i
113
+ voteErrorMessage: w,
114
+ votedAnswer: t
168
115
  }
169
116
  ),
170
- /* @__PURE__ */ h(Et, { children: [
171
- /* @__PURE__ */ n(Q, { id: "voteOptions", children: D.map((o) => /* @__PURE__ */ n(
172
- Rt,
117
+ P && /* @__PURE__ */ r(
118
+ xt,
119
+ {
120
+ title: ft,
121
+ points: ut,
122
+ onTimerExpired: lt,
123
+ questionType: e.type,
124
+ isTimer: !u,
125
+ isPlayingTimer: !t,
126
+ animatePoints: ht,
127
+ timerDuration: Tt ? 0 : Number(((K = e == null ? void 0 : e.appearance) == null ? void 0 : K.autoHideInterval) || "30"),
128
+ votedInCurrentRender: C,
129
+ percentsAnimated: A
130
+ }
131
+ ),
132
+ !c && (f || j) ? /* @__PURE__ */ r(pt, { children: /* @__PURE__ */ r(
133
+ It,
134
+ {
135
+ icon: "icon-check-circle",
136
+ title: "More to come...",
137
+ description: j ? /* @__PURE__ */ m(O, { children: [
138
+ "Stay tuned for more questions ",
139
+ /* @__PURE__ */ r("br", {}),
140
+ " and insights."
141
+ ] }) : /* @__PURE__ */ m(O, { children: [
142
+ "Watch for additional enhanced stream ",
143
+ /* @__PURE__ */ r("br", {}),
144
+ " interactive experience."
145
+ ] })
146
+ }
147
+ ) }) : /* @__PURE__ */ m(O, { children: [
148
+ c && /* @__PURE__ */ m(vt, { children: [
149
+ /* @__PURE__ */ r(yt, { name: "iconEarlyPrediction" }),
150
+ "EARLY PREDICTION"
151
+ ] }),
152
+ /* @__PURE__ */ r(wt, { style: dt ? { marginTop: 0 } : {}, children: tt }),
153
+ c && /* @__PURE__ */ r(
154
+ X,
173
155
  {
174
- ...o,
175
- markThatVoted: ct,
176
- onPercentsAnimated: () => F(!0),
177
- votedAfterQuestionClosed: p,
156
+ feedbackMessages: G,
157
+ questionVoted: !!t,
158
+ questionVotedCorrectly: t == null ? void 0 : t.correct,
159
+ questionType: n,
160
+ hasCorrectAnswer: i,
161
+ showExpiredNotification: d,
162
+ showClosedNotificationTrivia: N,
163
+ votedInCurrentRender: C,
164
+ votedAfterQuestionClosed: y,
178
165
  enteredAnActiveQuestion: V,
179
- marketClosed: T
180
- },
181
- o.id
182
- )) }),
183
- l && /* @__PURE__ */ n(At, { children: /* @__PURE__ */ n(wt, { name: "mastersLogoWhite" }) })
166
+ marketClosed: T,
167
+ percentsAnimated: A,
168
+ voteErrorMessage: w,
169
+ isEarlyPrediction: c,
170
+ correctAnswer: o,
171
+ votedAnswer: t
172
+ }
173
+ ),
174
+ /* @__PURE__ */ m(At, { children: [
175
+ /* @__PURE__ */ r(Q, { children: k.map((s) => /* @__PURE__ */ r(
176
+ St,
177
+ {
178
+ ...s,
179
+ markThatVoted: ct,
180
+ onPercentsAnimated: () => F(!0),
181
+ votedAfterQuestionClosed: y,
182
+ enteredAnActiveQuestion: V,
183
+ marketClosed: T,
184
+ isEarlyPrediction: c
185
+ },
186
+ s.id
187
+ )) }),
188
+ c && /* @__PURE__ */ m(O, { children: [
189
+ /* @__PURE__ */ r(Et, {}),
190
+ /* @__PURE__ */ r(Rt, { children: /* @__PURE__ */ r(Ot, { name: "mastersLogoWhite" }) })
191
+ ] })
192
+ ] })
184
193
  ] })
185
- ] })
186
- ] }) }) });
194
+ ] }) })
195
+ ] });
187
196
  };
188
197
  export {
189
- Bt as Vote,
190
- Yt as VoteSkeleton
198
+ Ht as Vote,
199
+ jt as VoteSkeleton
191
200
  };
@@ -1,5 +1,8 @@
1
1
  export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
2
  export declare const QuestionScrollContainer: any;
3
+ export declare const TopShadow: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
+ export declare const BottomShadow: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const SponsorLogo: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
6
  export declare const Content: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
7
  export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
8
  export declare const OptionsWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -8,4 +11,3 @@ export declare const AlertContainer: any;
8
11
  export declare const EarlyPrediction: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
12
  export declare const EarlyPredictionIcon: any;
10
13
  export declare const SponsorIcon: any;
11
- export declare const SponsorLogo: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -2,61 +2,71 @@ import { styled as s } from "@linaria/react";
2
2
  import { SDKScrollContainer as n } from "../../../app/app/styles.js";
3
3
  import { SvgIcon as o } from "../../icons/index.js";
4
4
  import { ShowIn as t } from "../../show-in/index.js";
5
- const I = /* @__PURE__ */ s("div")({
5
+ const d = /* @__PURE__ */ s("div")({
6
6
  name: "Container",
7
7
  class: "c14ielyq",
8
8
  propsAsIs: !1
9
- }), r = () => n, d = /* @__PURE__ */ s(r())({
9
+ }), e = () => n, I = /* @__PURE__ */ s(e())({
10
10
  name: "QuestionScrollContainer",
11
11
  class: "q1tlqx57",
12
12
  propsAsIs: !0
13
13
  }), A = /* @__PURE__ */ s("div")({
14
- name: "Content",
15
- class: "c1hq58md",
14
+ name: "TopShadow",
15
+ class: "t1hq58md",
16
16
  propsAsIs: !1
17
17
  }), f = /* @__PURE__ */ s("div")({
18
- name: "Title",
19
- class: "t1c8nxcx",
18
+ name: "BottomShadow",
19
+ class: "b1c8nxcx",
20
20
  propsAsIs: !1
21
21
  }), S = /* @__PURE__ */ s("div")({
22
- name: "OptionsWrap",
23
- class: "oiozuc3",
22
+ name: "SponsorLogo",
23
+ class: "siozuc3",
24
+ propsAsIs: !1
25
+ }), v = /* @__PURE__ */ s("div")({
26
+ name: "Content",
27
+ class: "cpnc44r",
28
+ propsAsIs: !1
29
+ }), x = /* @__PURE__ */ s("div")({
30
+ name: "Title",
31
+ class: "tq7p3w0",
24
32
  propsAsIs: !1
25
33
  }), C = /* @__PURE__ */ s("div")({
34
+ name: "OptionsWrap",
35
+ class: "o1jlfj9g",
36
+ propsAsIs: !1
37
+ }), u = /* @__PURE__ */ s("div")({
26
38
  name: "Options",
27
- class: "opnc44r",
39
+ class: "o84pmnd",
28
40
  propsAsIs: !1
29
- }), e = () => t, v = /* @__PURE__ */ s(e())({
41
+ }), a = () => t, w = /* @__PURE__ */ s(a())({
30
42
  name: "AlertContainer",
31
- class: "aq7p3w0",
43
+ class: "a1dybjw9",
32
44
  propsAsIs: !0
33
- }), x = /* @__PURE__ */ s("div")({
45
+ }), y = /* @__PURE__ */ s("div")({
34
46
  name: "EarlyPrediction",
35
- class: "e1jlfj9g",
47
+ class: "e1l05ict",
36
48
  propsAsIs: !1
37
- }), c = () => o, u = /* @__PURE__ */ s(c())({
49
+ }), r = () => o, h = /* @__PURE__ */ s(r())({
38
50
  name: "EarlyPredictionIcon",
39
- class: "e84pmnd",
51
+ class: "ez9juex",
40
52
  propsAsIs: !0
41
- }), p = () => o, y = /* @__PURE__ */ s(p())({
53
+ }), p = () => o, q = /* @__PURE__ */ s(p())({
42
54
  name: "SponsorIcon",
43
- class: "s1dybjw9",
55
+ class: "s8p4aob",
44
56
  propsAsIs: !0
45
- }), q = /* @__PURE__ */ s("div")({
46
- name: "SponsorLogo",
47
- class: "s1l05ict",
48
- propsAsIs: !1
49
57
  });
50
58
  export {
51
- v as AlertContainer,
52
- I as Container,
53
- A as Content,
54
- x as EarlyPrediction,
55
- u as EarlyPredictionIcon,
56
- C as Options,
57
- S as OptionsWrap,
58
- d as QuestionScrollContainer,
59
- y as SponsorIcon,
60
- q as SponsorLogo,
61
- f as Title
59
+ w as AlertContainer,
60
+ f as BottomShadow,
61
+ d as Container,
62
+ v as Content,
63
+ y as EarlyPrediction,
64
+ h as EarlyPredictionIcon,
65
+ u as Options,
66
+ C as OptionsWrap,
67
+ I as QuestionScrollContainer,
68
+ q as SponsorIcon,
69
+ S as SponsorLogo,
70
+ x as Title,
71
+ A as TopShadow
62
72
  };
@@ -14,5 +14,6 @@ export type VotingOptionProps = ExtendedQuestionAnswer & {
14
14
  onVote: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
15
15
  markThatVoted: (votedAfterQuestionClosed: boolean) => void;
16
16
  onPercentsAnimated?: () => void;
17
+ isEarlyPrediction?: boolean;
17
18
  };
18
19
  export declare const VotingOption: React.FC<VotingOptionProps>;
@@ -1,100 +1,99 @@
1
- import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
- import { useState as V, useLayoutEffect as W } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as N } from "@streamlayer/sdk-web-types";
1
+ import { jsx as e, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as U, useLayoutEffect as V } from "react";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as D } from "@streamlayer/sdk-web-types";
4
4
  import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
- import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as z, ButtonContainer as G, ButtonPctWrap as H, ButtonPct as J, ButtonBody as K, Title as X, Pts as Y, Indicators as Z, CheckIcon as _, Percentage as q } from "./styles.js";
6
- const h = {
7
- [a.CENTERED]: (t) => /* @__PURE__ */ e(y, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(M, { style: { backgroundImage: `url(${t})` } }) }),
9
- [a.ROUNDED]: (t) => /* @__PURE__ */ e(z, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
5
+ import { IconDefault as F, IconContainer as M, IconWrap as z, IconCircle as G, ButtonContainer as H, ButtonPctWrap as J, ButtonPct as K, ButtonBody as X, Title as Y, PtsWrap as Z, Pts as _, Indicators as q, CheckIcon as tt, Percentage as et } from "./styles.js";
6
+ const E = {
7
+ [a.CENTERED]: (t) => /* @__PURE__ */ e(F, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
8
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ e(M, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(z, { style: { backgroundImage: `url(${t})` } }) }),
9
+ [a.ROUNDED]: (t) => /* @__PURE__ */ e(G, { "data-testid": "vote-icon", alt: "option-icon", src: t }),
10
10
  [a.NONE]: () => null,
11
11
  [a.UNSET]: () => null
12
- }, tt = ({ questionType: t, hasCorrectAnswer: s, correct: n, youVoted: r, questionVoted: i }) => {
12
+ }, nt = ({ questionType: t, hasCorrectAnswer: c, correct: n, youVoted: r, questionVoted: i }) => {
13
13
  if (t === o.POLL && r)
14
14
  return "voted";
15
15
  if (t === o.PREDICTION) {
16
- if (!s && i)
16
+ if (!c && i)
17
17
  return r ? "voted" : "unset";
18
- if (s && i)
18
+ if (c && i)
19
19
  return r ? n ? "correct" : "incorrect" : "unset";
20
20
  if (r)
21
21
  return "correct";
22
22
  }
23
23
  return t === o.TRIVIA && i && r ? n ? "correct" : "incorrect" : "unset";
24
- }, et = ({
24
+ }, rt = ({
25
25
  questionType: t,
26
- questionVoted: s,
26
+ questionVoted: c,
27
27
  correct: n,
28
28
  hasCorrectAnswer: r,
29
29
  questionStatus: i
30
- }) => t === o.TRIVIA ? s && n : t === o.PREDICTION ? s && n && r || i === N.RESOLVED && n : !1, ct = (t) => {
31
- var T;
30
+ }) => t === o.TRIVIA ? c && n : t === o.PREDICTION ? c && n && r || i === D.RESOLVED && n : !1, dt = (t) => {
31
+ var S;
32
32
  const {
33
33
  // option props
34
- id: s,
34
+ id: c,
35
35
  icon: n,
36
36
  text: r,
37
37
  percentageDecimal: i,
38
- points: S,
38
+ points: O,
39
39
  // extra props
40
- onVote: p,
41
- markThatVoted: D,
40
+ onVote: g,
41
+ markThatVoted: v,
42
42
  onPercentsAnimated: f,
43
- youSelected: E,
44
- youVoted: O,
45
- questionVoted: c,
46
- imageMode: C,
47
- answerTimeExpired: g,
48
- questionStatus: v,
43
+ youSelected: h,
44
+ youVoted: w,
45
+ questionVoted: s,
46
+ imageMode: P,
47
+ answerTimeExpired: A,
48
+ questionStatus: C,
49
49
  isLoading: k,
50
50
  questionType: d,
51
51
  correct: x,
52
- hasCorrectAnswer: L,
53
- votedAfterQuestionClosed: B,
54
- enteredAnActiveQuestion: P,
55
- marketClosed: I
56
- } = t, [Q, R] = V(0), m = tt(t), b = et({ questionType: d, questionVoted: c, correct: x, hasCorrectAnswer: L, questionStatus: v }), u = I && d === o.PREDICTION, w = c || u, j = d === o.PREDICTION && !c && !I, A = c && !E && m !== "incorrect" && !O;
57
- return W(() => {
58
- R(0), requestAnimationFrame(() => {
59
- R(i);
52
+ hasCorrectAnswer: B,
53
+ votedAfterQuestionClosed: L,
54
+ enteredAnActiveQuestion: R,
55
+ marketClosed: I,
56
+ isEarlyPrediction: Q
57
+ } = t, [W, T] = U(0), m = nt(t), b = rt({ questionType: d, questionVoted: s, correct: x, hasCorrectAnswer: B, questionStatus: C }), l = I && d === o.PREDICTION, p = s || l, j = d === o.PREDICTION && !s && !I, N = s && !h && m !== "incorrect" && !w;
58
+ return V(() => {
59
+ T(0), requestAnimationFrame(() => {
60
+ T(i);
60
61
  });
61
- }, [i]), /* @__PURE__ */ l(
62
- G,
62
+ }, [i]), /* @__PURE__ */ u(
63
+ H,
63
64
  {
64
- id: "voteAnswerContainer",
65
- value: s,
66
- "data-selected": E,
65
+ value: c,
66
+ "data-selected": h,
67
67
  "data-answer-state": m,
68
- disabled: c || k || g || u && !P || u && P && B,
69
- "data-is-not-checked": A,
70
- onClick: (U) => {
71
- D(
72
- d === o.PREDICTION ? I : v === N.RESOLVED
73
- ), p(U);
68
+ disabled: s || k || A || l && !R || l && R && L,
69
+ "data-is-not-checked": N,
70
+ onClick: (y) => {
71
+ v(
72
+ d === o.PREDICTION ? I : C === D.RESOLVED
73
+ ), g(y);
74
74
  },
75
75
  children: [
76
- /* @__PURE__ */ e(H, { children: /* @__PURE__ */ e(
77
- J,
76
+ /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(
77
+ K,
78
78
  {
79
- id: "voteAnswerRct",
80
79
  "data-answer-state": m,
81
- "data-is-not-checked": A,
82
- style: { width: `${w ? Q : 0}%` },
80
+ "data-is-not-checked": N,
81
+ style: { width: `${p ? W : 0}%` },
83
82
  onTransitionEnd: () => {
84
- u || f == null || f();
83
+ l || f == null || f();
85
84
  }
86
85
  }
87
86
  ) }),
88
- /* @__PURE__ */ l(K, { id: "voteAnswer", children: [
89
- n && C && ((T = h[C]) == null ? void 0 : T.call(h, n)),
90
- /* @__PURE__ */ e(X, { children: r }),
91
- j && /* @__PURE__ */ l("div", { children: [
92
- S,
93
- /* @__PURE__ */ e(Y, { children: "pts" })
87
+ /* @__PURE__ */ u(X, { children: [
88
+ n && P && ((S = E[P]) == null ? void 0 : S.call(E, n)),
89
+ /* @__PURE__ */ e(Y, { children: r }),
90
+ j && /* @__PURE__ */ u(Z, { children: [
91
+ O,
92
+ /* @__PURE__ */ e(_, { children: "pts" })
94
93
  ] }),
95
- w && /* @__PURE__ */ l(Z, { id: "voteAnswerIndicators", children: [
96
- b && /* @__PURE__ */ e(_, { name: "selected" }),
97
- /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
94
+ p && /* @__PURE__ */ u(q, { children: [
95
+ b && /* @__PURE__ */ e(tt, { name: Q ? "selectedBetPack" : "selected" }),
96
+ /* @__PURE__ */ e(et, { children: /* @__PURE__ */ e($, { value: i, suffix: "%" }) })
98
97
  ] })
99
98
  ] })
100
99
  ]
@@ -102,5 +101,5 @@ const h = {
102
101
  );
103
102
  };
104
103
  export {
105
- ct as VotingOption
104
+ dt as VotingOption
106
105
  };
@@ -17,6 +17,7 @@ export declare const IconCircle: {
17
17
  }>;
18
18
  export declare const Title: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
19
19
  export declare const Indicators: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
20
+ export declare const PtsWrap: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
20
21
  export declare const Pts: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
21
22
  export declare const Percentage: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLSpanElement> & import('react').HTMLAttributes<HTMLSpanElement> & Record<never, unknown>>;
22
23
  export declare const CheckIcon: any;