@streamlayer/react-ui 0.96.2 → 0.97.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 (83) hide show
  1. package/lib/assets/style.css +1 -1
  2. package/lib/hooks/analytics.js +50 -0
  3. package/lib/index-z0QjLiEL.js +75 -0
  4. package/lib/ui/app/Features/FeatureProvider.d.ts +1 -0
  5. package/lib/ui/app/Features/FeatureProvider.js +34 -6
  6. package/lib/ui/app/Features/Gamification/Friends.d.ts +0 -2
  7. package/lib/ui/app/Features/Gamification/Friends.js +20 -23
  8. package/lib/ui/app/Features/Gamification/Leaderboard.js +31 -25
  9. package/lib/ui/app/Features/Gamification/Question.js +4 -2
  10. package/lib/ui/app/Features/Gamification/QuestionsList.js +11 -8
  11. package/lib/ui/app/Features/Gamification/Tabs.js +30 -25
  12. package/lib/ui/app/Features/Gamification/UserSummary.js +14 -12
  13. package/lib/ui/app/Features/Gamification/gamification-feature.js +6 -2
  14. package/lib/ui/app/Features/Gamification/index.d.ts +10 -0
  15. package/lib/ui/app/Features/Gamification/index.js +73 -68
  16. package/lib/ui/app/Features/index.d.ts +8 -0
  17. package/lib/ui/app/Features/index.js +112 -16
  18. package/lib/ui/app/Navigation/MastersNavigation/index.js +5 -4
  19. package/lib/ui/app/Navigation/index.js +7 -6
  20. package/lib/ui/app/Notifications/Onboarding/index.d.ts +2 -0
  21. package/lib/ui/app/Notifications/Onboarding/index.js +76 -78
  22. package/lib/ui/app/Notifications/index.js +98 -91
  23. package/lib/ui/app/Points/index.js +20 -17
  24. package/lib/ui/app/masters.js +167 -86
  25. package/lib/ui/app/useMastersApp.js +12 -11
  26. package/lib/ui/app/useSdkFeature.js +13 -16
  27. package/lib/ui/app/useSdkResponsive.js +1 -1
  28. package/lib/ui/app/useSdkScroll.d.ts +1 -1
  29. package/lib/ui/app/useSdkScroll.js +28 -25
  30. package/lib/ui/gamification/invite-link/index.js +26 -12
  31. package/lib/ui/gamification/onboarding/index.d.ts +0 -2
  32. package/lib/ui/gamification/onboarding/index.js +46 -46
  33. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.d.ts +2 -2
  34. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/index.js +21 -20
  35. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.d.ts +1 -0
  36. package/lib/ui/gamification/onboarding/slides/onboarding-instructions/styles.js +20 -15
  37. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.d.ts +0 -3
  38. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/index.js +34 -29
  39. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.d.ts +0 -3
  40. package/lib/ui/gamification/onboarding/slides/onboarding-invite-card/styles.js +17 -32
  41. package/lib/ui/gamification/points/index.d.ts +1 -0
  42. package/lib/ui/gamification/points/index.js +9 -9
  43. package/lib/ui/gamification/question/index.d.ts +1 -0
  44. package/lib/ui/gamification/question/index.js +31 -24
  45. package/lib/ui/gamification/question/insight/index.js +11 -15
  46. package/lib/ui/gamification/question/list/index.d.ts +3 -1
  47. package/lib/ui/gamification/question/list/index.js +50 -34
  48. package/lib/ui/gamification/question/notification/index.js +23 -25
  49. package/lib/ui/gamification/question/notification/insight/index.js +10 -9
  50. package/lib/ui/gamification/question/notification/tweet/index.js +3 -2
  51. package/lib/ui/gamification/question/styles.d.ts +2 -0
  52. package/lib/ui/gamification/question/styles.js +39 -28
  53. package/lib/ui/gamification/question/twitter/index.js +14 -18
  54. package/lib/ui/gamification/user-statistics/index.d.ts +3 -2
  55. package/lib/ui/gamification/user-statistics/index.js +48 -45
  56. package/lib/ui/gamification/vote/feedback/index.d.ts +3 -2
  57. package/lib/ui/gamification/vote/feedback/index.js +74 -58
  58. package/lib/ui/gamification/vote/feedback/styles.d.ts +2 -0
  59. package/lib/ui/gamification/vote/feedback/styles.js +33 -21
  60. package/lib/ui/gamification/vote/index.js +94 -83
  61. package/lib/ui/gamification/vote/insight-details/index.js +7 -6
  62. package/lib/ui/gamification/vote/twitter-details/index.js +3 -2
  63. package/lib/ui/gamification/vote/vote-option/index.d.ts +2 -1
  64. package/lib/ui/gamification/vote/vote-option/index.js +47 -39
  65. package/lib/ui/icons/index.d.ts +1 -2
  66. package/lib/ui/icons/index.js +122 -49
  67. package/lib/ui/modal/index.js +27 -21
  68. package/lib/ui/navigation/button/Channels.js +6 -5
  69. package/lib/ui/navigation/button/FeaturedGroups.js +4 -3
  70. package/lib/ui/navigation/button/LeaderBoard.js +6 -5
  71. package/lib/ui/navigation/button/index.js +20 -7
  72. package/lib/ui/navigation/button/styles.d.ts +3 -0
  73. package/lib/ui/navigation/button/styles.js +9 -6
  74. package/lib/ui/questions/insight/index.js +16 -16
  75. package/lib/ui/questions/twitter/index.js +3 -2
  76. package/lib/ui/show-in/index.d.ts +2 -0
  77. package/lib/ui/show-in/index.js +24 -14
  78. package/lib/ui/timer/index.js +32 -28
  79. package/lib/ui/video-player/index.js +41 -39
  80. package/lib/ui/video-player/styles.d.ts +1 -0
  81. package/lib/ui/video-player/styles.js +10 -9
  82. package/package.json +22 -21
  83. package/lib/index-keh7OLCY.js +0 -67
@@ -1,15 +1,17 @@
1
- import { jsx as n, jsxs as k, Fragment as J } from "react/jsx-runtime";
2
- import { useState as I, useEffect as K, useCallback as R, useMemo as f } from "react";
3
- import { QuestionType as o, QuestionStatus as E } from "@streamlayer/sdk-web-types";
4
- import { ExpiredAlert as U } from "./expired-alert/index.js";
5
- import { Feedback as X } from "./feedback/index.js";
6
- import { QuestionScrollContainer as Z, Container as _, Content as $, Title as Q, Options as tt } from "./styles.js";
7
- import { VotingOption as rt } from "./vote-option/index.js";
8
- import { WinBar as it } from "./win-bar/index.js";
1
+ import { jsx as n, jsxs as B, Fragment as tt } from "react/jsx-runtime";
2
+ import { useState as m, useEffect as g, useCallback as O, useRef as rt, useMemo as l } from "react";
3
+ import { QuestionType as a, QuestionStatus as x } from "@streamlayer/sdk-web-types";
4
+ import { ExpiredAlert as et } from "./expired-alert/index.js";
5
+ import { Feedback as it } from "./feedback/index.js";
6
+ import { QuestionScrollContainer as ot, Container as st, Content as at, Title as nt, Options as ct } from "./styles.js";
7
+ import { VotingOption as mt } from "./vote-option/index.js";
8
+ import { WinBar as lt } from "./win-bar/index.js";
9
9
  import "../../icons/index.js";
10
10
  import "@linaria/react";
11
11
  import "./expired-alert/styles.js";
12
12
  import "./feedback/styles.js";
13
+ import "../../show-in/index.js";
14
+ import "@linaria/core";
13
15
  import "../../app/styles.js";
14
16
  import "../../animated-counter/index.js";
15
17
  import "react-countup";
@@ -18,123 +20,132 @@ import "../../timer/index.js";
18
20
  import "react-countdown-circle-timer";
19
21
  import "../../theme/constants.js";
20
22
  import "./win-bar/styles.js";
21
- const vt = ({ openedQuestion: t, isLoading: C, vote: p, close: v }) => {
22
- var P, g;
23
- const A = t.subject, a = t.type, m = t.status, V = (P = t.options) == null ? void 0 : P.options, d = t.marketClosed, [O, b] = I(!1), [y, L] = I(!1), [T, w] = I(!0), [c, M] = I(!1), [x, D] = I(""), h = t == null ? void 0 : t.id;
24
- K(() => {
25
- a === o.PREDICTION ? d && w(!1) : m === E.RESOLVED && w(!1);
23
+ const Nt = ({ openedQuestion: t, isLoading: E, vote: P, close: p }) => {
24
+ var M, b;
25
+ const L = t.subject, o = t.type, u = t.status, I = (M = t.options) == null ? void 0 : M.options, h = t.marketClosed, y = t.id, [V, W] = m(!1), [C, Y] = m(!1), [T, q] = m(!0), [c, F] = m(!1), [A, v] = m(""), [w, H] = m(""), [_, D] = m(!1);
26
+ g(() => {
27
+ w && D(!0);
28
+ }, [w]), g(() => {
29
+ o === a.PREDICTION ? h && q(!1) : u === x.RESOLVED && q(!1);
26
30
  }, []);
27
- const j = R((e) => {
28
- L(e), b(!0);
29
- }, []), q = R(
30
- async (e) => {
31
- if (h) {
32
- const u = e.currentTarget.value;
33
- D(u), await p(h, u);
31
+ const z = O((i) => {
32
+ Y(i), W(!0);
33
+ }, []), R = rt(!1), S = O(
34
+ async (i) => {
35
+ if (!R.current && (R.current = !0, y)) {
36
+ const d = i.currentTarget.value;
37
+ v(d);
38
+ try {
39
+ await P(y, d);
40
+ } catch (j) {
41
+ const Q = j.message === "already_voted" ? "You’ve already answered this question on other device. So the points for this answer won't tally." : "Something went wrong, please try again";
42
+ H(Q), v(""), console.error("Error while voting", j), R.current = !1;
43
+ }
34
44
  }
35
45
  },
36
- [h, D, p]
37
- ), B = R(() => {
38
- M(!0), setTimeout(v, 3e3);
39
- }, [v]), r = f(
40
- () => t == null ? void 0 : t.answers.find((e) => e.youVoted === !0),
46
+ [y, v, P]
47
+ ), G = O(() => {
48
+ F(!0), setTimeout(p, 3e3);
49
+ }, [p]), r = l(
50
+ () => t == null ? void 0 : t.answers.find((i) => i.youVoted === !0),
41
51
  [t]
42
- ), s = f(
43
- () => !!(t != null && t.answers.find((e) => e.correct === !0)),
52
+ ), s = l(
53
+ () => !!(t != null && t.answers.find((i) => i.correct === !0)),
44
54
  [t]
45
- ), i = f(
46
- () => t == null ? void 0 : t.answers.find((e) => e.correct === !0),
55
+ ), e = l(
56
+ () => t == null ? void 0 : t.answers.find((i) => i.correct === !0),
47
57
  [t]
48
- ), W = f(() => t ? t.answers.map((e) => {
49
- var u;
58
+ );
59
+ g(() => {
60
+ let i;
61
+ return o === a.PREDICTION && r && V && (i = setTimeout(p, 1e4)), () => {
62
+ clearTimeout(i);
63
+ };
64
+ }, [r]);
65
+ const J = l(() => t ? t.answers.map((i) => {
66
+ var d;
50
67
  return {
51
- ...e,
68
+ ...i,
52
69
  questionVoted: !!r,
53
- youSelected: x === e.id,
54
- isLoading: C,
70
+ youSelected: A === i.id,
71
+ isLoading: E,
55
72
  hasCorrectAnswer: s,
56
73
  questionType: t.type,
57
74
  answerTimeExpired: c,
58
- questionStatus: m,
59
- imageMode: (u = t.appearance) == null ? void 0 : u.images,
60
- onVote: q
75
+ questionStatus: u,
76
+ imageMode: (d = t.appearance) == null ? void 0 : d.images,
77
+ onVote: S
61
78
  };
62
79
  }) : [], [
63
80
  s,
64
81
  c,
65
- C,
82
+ E,
66
83
  t,
67
84
  r,
68
- m,
69
- q,
70
- x
71
- ]), F = V && (V.case === "trivia" || V.case === "prediction") ? V.value : void 0, l = m === E.RESOLVED && a === o.TRIVIA && !r && !T, S = a === o.TRIVIA && y && O && T, N = f(() => a === o.PREDICTION ? !!(r && !s || r && s && (i != null && i.youVoted)) : !0, [a, r, s, i]), Y = f(() => {
72
- if (a === o.PREDICTION && r && (!s || s && (i != null && i.youVoted)))
85
+ u,
86
+ S,
87
+ A
88
+ ]), K = I && (I.case === "trivia" || I.case === "prediction") ? I.value : void 0, f = u === x.RESOLVED && o === a.TRIVIA && !r && !T, N = o === a.TRIVIA && C && V && T, k = l(() => o === a.PREDICTION ? !!(r && !s || r && s && (e != null && e.youVoted)) : !0, [o, r, s, e]), U = l(() => {
89
+ if (o === a.PREDICTION && r && (!s || s && (e != null && e.youVoted)))
73
90
  return r.points;
74
- if (!(l || c))
75
- return m === E.RESOLVED ? 0 : r ? r.correct ? r.points : 0 : i == null ? void 0 : i.points;
76
- }, [
77
- c,
78
- r,
79
- i,
80
- m,
81
- l,
82
- a,
83
- s
84
- ]), H = f(() => a === o.PREDICTION && r ? s ? s && (i != null && i.youVoted) ? "You won" : "" : "To win" : l || c ? "Time expired" : a === o.POLL ? "Time remaining" : r ? "You won" : "To win", [c, a, r, l, s, i]), z = (a === o.TRIVIA || a === o.PREDICTION) && r && s && (i == null ? void 0 : i.youVoted), G = r || l || S || a === o.TRIVIA && m === E.RESOLVED && T;
85
- return /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(_, { children: /* @__PURE__ */ k($, { children: [
91
+ if (!(f || c))
92
+ return r ? r.correct ? r.pointsEarned : 0 : e == null ? void 0 : e.points;
93
+ }, [c, r, e, f, o, s]), X = l(() => o === a.PREDICTION && r ? s ? s && (e != null && e.youVoted) ? "You won" : "" : "To win" : f || c ? "Time expired" : o === a.POLL ? "Time remaining" : r ? "You won" : "To win", [c, o, r, f, s, e]), Z = (o === a.TRIVIA || o === a.PREDICTION) && r && s && (e == null ? void 0 : e.youVoted), $ = r || f || N || o === a.TRIVIA && u === x.RESOLVED && T;
94
+ return /* @__PURE__ */ n(ot, { children: /* @__PURE__ */ n(st, { children: /* @__PURE__ */ B(at, { children: [
86
95
  /* @__PURE__ */ n(
87
- X,
96
+ it,
88
97
  {
89
- feedbackMessages: F,
98
+ feedbackMessages: K,
90
99
  questionVoted: !!r,
91
100
  questionVotedCorrectly: r == null ? void 0 : r.correct,
92
- questionType: a,
101
+ questionType: o,
93
102
  hasCorrectAnswer: s,
94
- questionStatus: m,
95
- showExpiredNotification: l,
96
- showClosedNotificationTrivia: S,
97
- votedInCurrentRender: O,
98
- votedAfterQuestionClosed: y,
103
+ showExpiredNotification: f,
104
+ showClosedNotificationTrivia: N,
105
+ votedInCurrentRender: V,
106
+ votedAfterQuestionClosed: C,
99
107
  enteredAnActiveQuestion: T,
100
- marketClosed: d
108
+ marketClosed: h,
109
+ percentsAnimated: _,
110
+ voteErrorMessage: w
101
111
  }
102
112
  ),
103
- N && /* @__PURE__ */ n(
104
- it,
113
+ k && /* @__PURE__ */ n(
114
+ lt,
105
115
  {
106
- title: H,
107
- points: Y,
108
- onTimerExpired: B,
116
+ title: X,
117
+ points: U,
118
+ onTimerExpired: G,
109
119
  questionType: t.type,
110
- isTimer: !C,
120
+ isTimer: !E,
111
121
  isPlayingTimer: !r,
112
- animatePoints: z,
113
- timerDuration: G ? 0 : Number(((g = t == null ? void 0 : t.appearance) == null ? void 0 : g.autoHideInterval) || "30")
122
+ animatePoints: Z,
123
+ timerDuration: $ ? 0 : Number(((b = t == null ? void 0 : t.appearance) == null ? void 0 : b.autoHideInterval) || "30")
114
124
  }
115
125
  ),
116
126
  c ? /* @__PURE__ */ n(
117
- U,
127
+ et,
118
128
  {
119
129
  title: "More to come...",
120
130
  description: "Watch for additional enhanced stream interactive experience."
121
131
  }
122
- ) : /* @__PURE__ */ k(J, { children: [
123
- /* @__PURE__ */ n(Q, { style: N ? {} : { marginTop: 0 }, children: A }),
124
- /* @__PURE__ */ n(tt, { children: W.map((e) => /* @__PURE__ */ n(
125
- rt,
132
+ ) : /* @__PURE__ */ B(tt, { children: [
133
+ /* @__PURE__ */ n(nt, { style: k ? {} : { marginTop: 0 }, children: L }),
134
+ /* @__PURE__ */ n(ct, { children: J.map((i) => /* @__PURE__ */ n(
135
+ mt,
126
136
  {
127
- ...e,
128
- markThatVoted: j,
129
- votedAfterQuestionClosed: y,
137
+ ...i,
138
+ markThatVoted: z,
139
+ onPercentsAnimated: () => D(!0),
140
+ votedAfterQuestionClosed: C,
130
141
  enteredAnActiveQuestion: T,
131
- marketClosed: d
142
+ marketClosed: h
132
143
  },
133
- e.id
144
+ i.id
134
145
  )) })
135
146
  ] })
136
147
  ] }) }) });
137
148
  };
138
149
  export {
139
- vt as Vote
150
+ Nt as Vote
140
151
  };
@@ -1,20 +1,21 @@
1
1
  import { jsxs as o, jsx as m } from "react/jsx-runtime";
2
- import { SvgIcon as l } from "../../../icons/index.js";
2
+ import { SvgIcon as p } from "../../../icons/index.js";
3
3
  import { InsightContent as b } from "../../../questions/insight/index.js";
4
4
  import { Container as k, WebLinkBtn as c } from "./styles.js";
5
5
  import "@linaria/react";
6
6
  import "react";
7
7
  import "@streamlayer/sdk-web-types";
8
8
  import "../../../video-player/index.js";
9
+ import "@linaria/core";
9
10
  import "../../../video-player/styles.js";
10
11
  import "../../../questions/insight/styles.js";
11
- const C = ({ instantView: r, ...p }) => /* @__PURE__ */ o(k, { children: [
12
- /* @__PURE__ */ m(b, { instantView: r, ...p, isDetail: !0 }),
13
- (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", children: [
12
+ const D = ({ instantView: r, ...l }) => /* @__PURE__ */ o(k, { children: [
13
+ /* @__PURE__ */ m(b, { instantView: r, ...l, isDetail: !0 }),
14
+ (r == null ? void 0 : r.webLink) && /* @__PURE__ */ o(c, { href: r == null ? void 0 : r.webLink.url, target: "_blank", "data-analytics": "web-link", children: [
14
15
  r == null ? void 0 : r.webLink.label,
15
- /* @__PURE__ */ m(l, { name: "icon-external-link" })
16
+ /* @__PURE__ */ m(p, { name: "icon-external-link" })
16
17
  ] })
17
18
  ] });
18
19
  export {
19
- C as InsightDetails
20
+ D as InsightDetails
20
21
  };
@@ -2,6 +2,7 @@ import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
2
  import { TwitterContent as o } from "../../../questions/twitter/index.js";
3
3
  import { Container as m, Quote as e } from "./styles.js";
4
4
  import "../../../video-player/index.js";
5
+ import "@linaria/core";
5
6
  import "react";
6
7
  import "../../../icons/index.js";
7
8
  import "@linaria/react";
@@ -10,10 +11,10 @@ import "../../../questions/twitter/account/index.js";
10
11
  import "../../../../utils/common.js";
11
12
  import "../../../questions/twitter/account/styles.js";
12
13
  import "../../../questions/twitter/styles.js";
13
- const w = (t) => /* @__PURE__ */ r(m, { children: [
14
+ const C = (t) => /* @__PURE__ */ r(m, { children: [
14
15
  t.title && /* @__PURE__ */ i(e, { children: t.title }),
15
16
  /* @__PURE__ */ i(o, { ...t, isDetail: !0 })
16
17
  ] });
17
18
  export {
18
- w as TwitterDetails
19
+ C as TwitterDetails
19
20
  };
@@ -12,7 +12,8 @@ export type VotingOptionProps = ExtendedQuestionAnswer & {
12
12
  votedAfterQuestionClosed: boolean;
13
13
  enteredAnActiveQuestion: boolean;
14
14
  marketClosed: boolean;
15
- onVote: (e: React.MouseEvent<HTMLButtonElement>) => void;
15
+ onVote: (e: React.MouseEvent<HTMLButtonElement>) => Promise<void>;
16
16
  markThatVoted: (votedAfterQuestionClosed: boolean) => void;
17
+ onPercentsAnimated?: () => void;
17
18
  };
18
19
  export declare const VotingOption: React.FC<VotingOptionProps>;
@@ -1,18 +1,18 @@
1
1
  import { jsx as n, jsxs as u } from "react/jsx-runtime";
2
- import { useState as b, useLayoutEffect as j } from "react";
3
- import { QuestionImages as a, QuestionType as o, QuestionStatus as S } from "@streamlayer/sdk-web-types";
4
- import { AnimatedCounter as U } from "../../../animated-counter/index.js";
5
- import { IconDefault as $, IconContainer as y, IconWrap as F, IconCircle as M, ButtonContainer as W, ButtonPct as z, ButtonBody as G, Title as H, Pts as J, Indicators as K, CheckIcon as X, Percentage as Y } from "./styles.js";
2
+ import { useState as j, useLayoutEffect as U } from "react";
3
+ import { QuestionImages as a, QuestionType as o, QuestionStatus as A } from "@streamlayer/sdk-web-types";
4
+ import { AnimatedCounter as $ } from "../../../animated-counter/index.js";
5
+ import { IconDefault as y, IconContainer as F, IconWrap as M, IconCircle as W, ButtonContainer as z, ButtonPct as G, ButtonBody as H, Title as J, Pts as K, Indicators as X, CheckIcon as Y, Percentage as Z } from "./styles.js";
6
6
  import "react-countup";
7
7
  import "@linaria/react";
8
8
  import "../../../icons/index.js";
9
9
  const I = {
10
- [a.CENTERED]: (t) => /* @__PURE__ */ n($, { alt: "option-icon", src: t }),
11
- [a.TRANSPARENT]: (t) => /* @__PURE__ */ n(y, { children: /* @__PURE__ */ n(F, { style: { backgroundImage: `url(${t})` } }) }),
12
- [a.ROUNDED]: (t) => /* @__PURE__ */ n(M, { alt: "option-icon", src: t }),
10
+ [a.CENTERED]: (t) => /* @__PURE__ */ n(y, { alt: "option-icon", src: t }),
11
+ [a.TRANSPARENT]: (t) => /* @__PURE__ */ n(F, { children: /* @__PURE__ */ n(M, { style: { backgroundImage: `url(${t})` } }) }),
12
+ [a.ROUNDED]: (t) => /* @__PURE__ */ n(W, { alt: "option-icon", src: t }),
13
13
  [a.NONE]: () => null,
14
14
  [a.UNSET]: () => null
15
- }, Z = ({ questionType: t, hasCorrectAnswer: c, correct: r, youVoted: i, questionVoted: e }) => {
15
+ }, _ = ({ questionType: t, hasCorrectAnswer: c, correct: r, youVoted: i, questionVoted: e }) => {
16
16
  if (t === o.POLL && i)
17
17
  return "correct";
18
18
  if (t === o.PREDICTION) {
@@ -22,66 +22,74 @@ const I = {
22
22
  return "correct";
23
23
  }
24
24
  return t === o.TRIVIA && e && i ? r ? "correct" : "incorrect" : "unset";
25
- }, _ = ({
25
+ }, q = ({
26
26
  questionType: t,
27
27
  questionVoted: c,
28
28
  correct: r,
29
29
  hasCorrectAnswer: i,
30
30
  questionStatus: e
31
- }) => t === o.TRIVIA ? c && r : t === o.PREDICTION ? c && r && i || e === S.RESOLVED && r : !1, st = (t) => {
32
- var N;
31
+ }) => t === o.TRIVIA ? c && r : t === o.PREDICTION ? c && r && i || e === A.RESOLVED && r : !1, at = (t) => {
32
+ var T;
33
33
  const {
34
34
  // option props
35
35
  id: c,
36
36
  icon: r,
37
37
  text: i,
38
38
  percentageDecimal: e,
39
- points: T,
39
+ points: N,
40
40
  // extra props
41
- onVote: A,
41
+ onVote: S,
42
42
  markThatVoted: D,
43
- youSelected: h,
43
+ onPercentsAnimated: w,
44
+ youSelected: E,
44
45
  questionVoted: s,
45
- imageMode: E,
46
- answerTimeExpired: w,
46
+ imageMode: h,
47
+ answerTimeExpired: O,
47
48
  questionStatus: C,
48
- isLoading: O,
49
+ isLoading: g,
49
50
  questionType: d,
50
- correct: g,
51
- hasCorrectAnswer: k,
51
+ correct: k,
52
+ hasCorrectAnswer: v,
52
53
  votedAfterQuestionClosed: x,
53
54
  enteredAnActiveQuestion: P,
54
55
  marketClosed: l
55
- } = t, [L, p] = b(e), m = Z(t), v = _({ questionType: d, questionVoted: s, correct: g, hasCorrectAnswer: k, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, Q = d === o.PREDICTION && !s && !l, B = s && !h && m !== "incorrect";
56
- return j(() => {
56
+ } = t, [L, p] = j(e), m = _(t), Q = q({ questionType: d, questionVoted: s, correct: k, hasCorrectAnswer: v, questionStatus: C }), f = l && d === o.PREDICTION, R = s || f, B = d === o.PREDICTION && !s && !l, V = s && !E && m !== "incorrect";
57
+ return U(() => {
57
58
  e > 0 && (p(0), requestAnimationFrame(() => {
58
59
  p(e);
59
60
  }));
60
61
  }, [e]), /* @__PURE__ */ u(
61
- W,
62
+ z,
62
63
  {
63
64
  value: c,
64
- "data-selected": h,
65
+ "data-selected": E,
65
66
  "data-answer-state": m,
66
- disabled: s || O || w || f && !P || f && P && x,
67
- "data-is-not-checked": B,
68
- onClick: (V) => {
67
+ disabled: s || g || O || f && !P || f && P && x,
68
+ "data-is-not-checked": V,
69
+ onClick: (b) => {
69
70
  D(
70
- d === o.PREDICTION ? l : C === S.RESOLVED
71
- ), A(V);
71
+ d === o.PREDICTION ? l : C === A.RESOLVED
72
+ ), S(b);
72
73
  },
73
74
  children: [
74
- /* @__PURE__ */ n(z, { "data-answer-state": m, style: { width: `${R ? L : 0}%` } }),
75
- /* @__PURE__ */ u(G, { children: [
76
- r && E && ((N = I[E]) == null ? void 0 : N.call(I, r)),
77
- /* @__PURE__ */ n(H, { children: i }),
78
- Q && /* @__PURE__ */ u("div", { children: [
79
- T,
80
- /* @__PURE__ */ n(J, { children: "pts" })
75
+ /* @__PURE__ */ n(
76
+ G,
77
+ {
78
+ "data-answer-state": m,
79
+ style: { width: `${R ? L : 0}%` },
80
+ onTransitionEnd: w
81
+ }
82
+ ),
83
+ /* @__PURE__ */ u(H, { children: [
84
+ r && h && ((T = I[h]) == null ? void 0 : T.call(I, r)),
85
+ /* @__PURE__ */ n(J, { children: i }),
86
+ B && /* @__PURE__ */ u("div", { children: [
87
+ N,
88
+ /* @__PURE__ */ n(K, { children: "pts" })
81
89
  ] }),
82
- R && /* @__PURE__ */ u(K, { children: [
83
- v && /* @__PURE__ */ n(X, { name: "selected" }),
84
- /* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(U, { value: e, suffix: "%" }) })
90
+ R && /* @__PURE__ */ u(X, { children: [
91
+ Q && /* @__PURE__ */ n(Y, { name: "selected" }),
92
+ /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n($, { value: e, suffix: "%" }) })
85
93
  ] })
86
94
  ] })
87
95
  ]
@@ -89,5 +97,5 @@ const I = {
89
97
  );
90
98
  };
91
99
  export {
92
- st as VotingOption
100
+ at as VotingOption
93
101
  };
@@ -11,6 +11,7 @@ export declare const icons: {
11
11
  'icon-insight': any;
12
12
  'icon-poll': any;
13
13
  'icon-play': any;
14
+ 'icon-pause': any;
14
15
  'icon-masters-logo': any;
15
16
  'icon-logout': any;
16
17
  'icon-link': any;
@@ -36,8 +37,6 @@ export declare const icons: {
36
37
  'icon-btn-feature-groups': any;
37
38
  'icon-btn-leaderboard': any;
38
39
  'icon-arrow': any;
39
- 'icon-facebook': any;
40
- 'icon-twitter': any;
41
40
  'icon-twitter-verified': any;
42
41
  correct: any;
43
42
  incorrect: any;