@streamlayer/react 0.30.0 → 0.30.2

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 (39) hide show
  1. package/lib/cjs/app.js +1 -0
  2. package/lib/cjs/auth.js +1 -1
  3. package/lib/cjs/gamification-feature.js +1 -0
  4. package/lib/cjs/index.js +1 -1
  5. package/lib/cjs/index2.js +4 -0
  6. package/lib/cjs/masters.js +1 -1
  7. package/lib/cjs/masters2.js +6 -0
  8. package/lib/cjs/points.js +1 -1
  9. package/lib/dist/cjs/gamification-feature.js +1 -0
  10. package/lib/dist/cjs/index.js +1 -0
  11. package/lib/dist/cjs/masters.js +297 -1
  12. package/lib/dist/{index-bcabe854.js → es/gamification-feature.js} +578 -545
  13. package/lib/dist/es/index.js +9 -0
  14. package/lib/dist/es/masters.js +26797 -7
  15. package/lib/dist/index.d.ts +6 -5
  16. package/lib/dist/style.css +1 -1
  17. package/lib/{app-c53bb384.js → es/app.js} +1 -1
  18. package/lib/es/auth.js +2 -2
  19. package/lib/es/gamification-feature.js +1443 -0
  20. package/lib/es/index.js +2 -2
  21. package/lib/{index-89366251.js → es/index2.js} +12 -12
  22. package/lib/es/masters.js +3 -3
  23. package/lib/es/masters2.js +2433 -0
  24. package/lib/es/points.js +45 -36
  25. package/lib/style.css +1 -1
  26. package/package.json +11 -11
  27. package/lib/app-36051bbe.cjs +0 -1
  28. package/lib/dist/index-f504e8d3.cjs +0 -1
  29. package/lib/dist/masters-3c9c6ffe.js +0 -26765
  30. package/lib/dist/masters-fe5f1486.cjs +0 -297
  31. package/lib/index-af5c5738.cjs +0 -1
  32. package/lib/index-dd93a61a.cjs +0 -4
  33. package/lib/index-e26b3493.js +0 -1410
  34. package/lib/masters-bf25c11c.js +0 -2415
  35. package/lib/masters-f135002d.cjs +0 -6
  36. /package/lib/{common-f34b9d88.cjs → cjs/common.js} +0 -0
  37. /package/lib/{index-565f26fb.cjs → cjs/index3.js} +0 -0
  38. /package/lib/{common-2d2a3ba3.js → es/common.js} +0 -0
  39. /package/lib/{index-15f61ac8.js → es/index3.js} +0 -0
@@ -1,1410 +0,0 @@
1
- import { jsxs as u, jsx as i, Fragment as w } from "react/jsx-runtime";
2
- import { s as a, i as C } from "./index-15f61ac8.js";
3
- import { useStore as _ } from "@nanostores/react";
4
- import { o as ve, r as Ne, w as Le, A as $e, O as Re, c as Qe, a as K, s as Ue, x as Pe } from "./masters-bf25c11c.js";
5
- import { useState as R, useCallback as B, useMemo as W, createElement as V, PureComponent as Te } from "react";
6
- import { QuestionType as x, QuestionStatus as Q, QuestionImages as b, PickHistoryStatus as q } from "@streamlayer/sdk-web-types";
7
- import { o as ye, i as Ae, r as qe, a as Ye, n as We } from "./common-2d2a3ba3.js";
8
- import { CountdownCircleTimer as Be } from "react-countdown-circle-timer";
9
- import { E } from "./index-89366251.js";
10
- import "@streamlayer/sdk-web-interfaces";
11
- import "@streamlayer/sdk-web-notifications";
12
- import "@lottiefiles/react-lottie-player";
13
- import "./es/useStreamLayerApp.js";
14
- import "@streamlayer/sdk-web";
15
- const Fe = /* @__PURE__ */ a("div")({
16
- name: "Container",
17
- class: "Container_c1vwopgc",
18
- propsAsIs: !1
19
- }), Ve = /* @__PURE__ */ a("div")({
20
- name: "QuestionTypeWrap",
21
- class: "QuestionTypeWrap_qyktpt0",
22
- propsAsIs: !1
23
- }), He = () => C, Ge = /* @__PURE__ */ a(He())({
24
- name: "QuestionTypeIcon",
25
- class: "QuestionTypeIcon_q951jdx",
26
- propsAsIs: !0
27
- }), Ze = /* @__PURE__ */ a("span")({
28
- name: "QuestionTypeTitle",
29
- class: "QuestionTypeTitle_qss5f0e",
30
- propsAsIs: !1
31
- }), Je = /* @__PURE__ */ a("button")({
32
- name: "CloseButton",
33
- class: "CloseButton_c1ao1jtv",
34
- propsAsIs: !1
35
- }), Ke = () => C, Xe = /* @__PURE__ */ a(Ke())({
36
- name: "CloseIcon",
37
- class: "CloseIcon_cvsl7l3",
38
- propsAsIs: !0
39
- }), De = ({ type: e, close: t, label: n }) => {
40
- const s = e ? ve[e] : { label: n, iconName: void 0 };
41
- return /* @__PURE__ */ u(Fe, { children: [
42
- /* @__PURE__ */ u(Ve, { children: [
43
- (s == null ? void 0 : s.iconName) && /* @__PURE__ */ i(Ge, { name: s.iconName }),
44
- (s == null ? void 0 : s.label) && /* @__PURE__ */ i(Ze, { children: s.label })
45
- ] }),
46
- /* @__PURE__ */ i(Je, { onClick: t, children: /* @__PURE__ */ i(Xe, { name: "icon-cross" }) })
47
- ] });
48
- }, et = /* @__PURE__ */ a("div")({
49
- name: "Container",
50
- class: "Container_c1zy8a",
51
- propsAsIs: !1
52
- }), tt = /* @__PURE__ */ a("div")({
53
- name: "Title",
54
- class: "Title_t1vih9p5",
55
- propsAsIs: !1
56
- }), nt = /* @__PURE__ */ a("div")({
57
- name: "Indicator",
58
- class: "Indicator_i1fbnvpb",
59
- propsAsIs: !1
60
- }), oe = ({ indicator: e, title: t }) => /* @__PURE__ */ u(et, { children: [
61
- /* @__PURE__ */ i(tt, { children: t }),
62
- /* @__PURE__ */ i(nt, { children: e })
63
- ] }), it = /* @__PURE__ */ a("div")({
64
- name: "Container",
65
- class: "Container_ctmhwyc",
66
- propsAsIs: !1
67
- }), st = /* @__PURE__ */ a("div")({
68
- name: "Indicator",
69
- class: "Indicator_i1jri200",
70
- propsAsIs: !1
71
- }), ot = /* @__PURE__ */ a("div")({
72
- name: "Title",
73
- class: "Title_t8s05oq",
74
- propsAsIs: !1
75
- }), Y = ({ indicator: e, title: t }) => /* @__PURE__ */ u(it, { children: [
76
- /* @__PURE__ */ i(st, { children: e }),
77
- /* @__PURE__ */ i(ot, { children: t })
78
- ] }), rt = /* @__PURE__ */ a("div")({
79
- name: "Container",
80
- class: "Container_c1yrpn9o",
81
- propsAsIs: !1
82
- }), at = /* @__PURE__ */ a("div")({
83
- name: "TopInfo",
84
- class: "TopInfo_t17fwahh",
85
- propsAsIs: !1
86
- }), lt = /* @__PURE__ */ a("div")({
87
- name: "BottomInfo",
88
- class: "BottomInfo_by6w7e9",
89
- propsAsIs: !1
90
- }), ct = /* @__PURE__ */ a("div")({
91
- name: "User",
92
- class: "User_u1g7arbm",
93
- propsAsIs: !1
94
- }), dt = /* @__PURE__ */ a("img")({
95
- name: "Avatar",
96
- class: "Avatar_a1ldeata",
97
- propsAsIs: !1
98
- }), ut = /* @__PURE__ */ a("div")({
99
- name: "UserInfo",
100
- class: "UserInfo_u10d4koz",
101
- propsAsIs: !1
102
- }), pt = /* @__PURE__ */ a("div")({
103
- name: "UserName",
104
- class: "UserName_u1q6roj0",
105
- propsAsIs: !1
106
- }), mt = /* @__PURE__ */ a("div")({
107
- name: "UserRating",
108
- class: "UserRating_ui0m425",
109
- propsAsIs: !1
110
- }), It = /* @__PURE__ */ a("img")({
111
- name: "TrophyIcon",
112
- class: "TrophyIcon_t1el3mrn",
113
- propsAsIs: !1
114
- }), ht = /* @__PURE__ */ a("div")({
115
- name: "Rts",
116
- class: "Rts_r2vgnxv",
117
- propsAsIs: !1
118
- }), ft = /* @__PURE__ */ a("div")({
119
- name: "RtsIndicator",
120
- class: "RtsIndicator_roqn06j",
121
- propsAsIs: !1
122
- }), Mt = /* @__PURE__ */ a("div")({
123
- name: "RtsLabel",
124
- class: "RtsLabel_r15adx7c",
125
- propsAsIs: !1
126
- }), gt = /* @__PURE__ */ a("div")({
127
- name: "Divider",
128
- class: "Divider_dv59lta",
129
- propsAsIs: !1
130
- }), vt = /* @__PURE__ */ a("div")({
131
- name: "Ranks",
132
- class: "Ranks_r55lotb",
133
- propsAsIs: !1
134
- }), Nt = /* @__PURE__ */ a("div")({
135
- name: "Statistics",
136
- class: "Statistics_s1knfgqt",
137
- propsAsIs: !1
138
- }), Tt = /* @__PURE__ */ a("div")({
139
- name: "AvatarPlaceholder",
140
- class: "AvatarPlaceholder_a1mqo824",
141
- propsAsIs: !1
142
- }), yt = /* @__PURE__ */ a("button")({
143
- name: "UserAccountBtn",
144
- class: "UserAccountBtn_uxareh6",
145
- propsAsIs: !1
146
- }), At = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", Se = ({
147
- avatar: e,
148
- name: t,
149
- points: n,
150
- friendsRank: s,
151
- rank: o,
152
- streak: I,
153
- correct: m,
154
- incorrect: p,
155
- inTop: d,
156
- successRate: f
157
- }) => /* @__PURE__ */ u(rt, { children: [
158
- /* @__PURE__ */ i(at, { children: /* @__PURE__ */ u(ct, { children: [
159
- /* @__PURE__ */ u(yt, { children: [
160
- e && /* @__PURE__ */ i(dt, { alt: "avatar", src: e }),
161
- !e && /* @__PURE__ */ i(Tt, { children: ye(t || "") })
162
- ] }),
163
- /* @__PURE__ */ u(ut, { children: [
164
- /* @__PURE__ */ i(pt, { children: t }),
165
- /* @__PURE__ */ u(mt, { children: [
166
- /* @__PURE__ */ u(ht, { children: [
167
- /* @__PURE__ */ i(It, { alt: "rank-icon", src: At }),
168
- /* @__PURE__ */ u(ft, { children: [
169
- Ae(n),
170
- /* @__PURE__ */ i(Mt, { children: "PTS" })
171
- ] })
172
- ] }),
173
- /* @__PURE__ */ i(gt, {}),
174
- /* @__PURE__ */ u("div", { children: [
175
- "TOP ",
176
- d || 0,
177
- "%"
178
- ] })
179
- ] })
180
- ] })
181
- ] }) }),
182
- /* @__PURE__ */ u(lt, { children: [
183
- /* @__PURE__ */ u(vt, { children: [
184
- /* @__PURE__ */ i(oe, { indicator: s || 0, title: "Friends rank" }),
185
- /* @__PURE__ */ i(oe, { indicator: o || 0, title: "Global rank" })
186
- ] }),
187
- /* @__PURE__ */ u(Nt, { children: [
188
- /* @__PURE__ */ i(Y, { indicator: I || 0, title: "Win streak" }),
189
- /* @__PURE__ */ i(Y, { indicator: m || 0, title: "Correct" }),
190
- /* @__PURE__ */ i(Y, { indicator: p || 0, title: "Incorrect" }),
191
- /* @__PURE__ */ i(Y, { indicator: `${f || 0}%`, title: "Succ. rate" })
192
- ] })
193
- ] })
194
- ] }), Dt = /* @__PURE__ */ a("div")({
195
- name: "Container",
196
- class: "Container_c38csyt",
197
- propsAsIs: !1
198
- }), St = /* @__PURE__ */ a("div")({
199
- name: "Title",
200
- class: "Title_ty221rx",
201
- propsAsIs: !1
202
- }), zt = /* @__PURE__ */ a("div")({
203
- name: "Description",
204
- class: "Description_dlaj9xp",
205
- propsAsIs: !1
206
- }), xt = ({ title: e, description: t }) => /* @__PURE__ */ u(Dt, { children: [
207
- /* @__PURE__ */ i(C, { name: "icon-check-circle" }),
208
- /* @__PURE__ */ i(St, { children: e }),
209
- /* @__PURE__ */ i(zt, { children: t })
210
- ] }), Ct = /* @__PURE__ */ a("div")({
211
- name: "Container",
212
- class: "Container_c16sbdnm",
213
- propsAsIs: !1
214
- }), Ot = () => C, jt = /* @__PURE__ */ a(Ot())({
215
- name: "IconPrediction",
216
- class: "IconPrediction_ibhorgl",
217
- propsAsIs: !0
218
- }), re = /* @__PURE__ */ a("div")({
219
- name: "FeedbackIconWrap",
220
- class: "FeedbackIconWrap_f1g20ja7",
221
- propsAsIs: !1
222
- }), ae = /* @__PURE__ */ a("div")({
223
- name: "FeedbackHeader",
224
- class: "FeedbackHeader_f455ozj",
225
- propsAsIs: !1
226
- }), _t = /* @__PURE__ */ a("span")({
227
- name: "FeedbackTitle",
228
- class: "FeedbackTitle_f1913njx",
229
- propsAsIs: !1
230
- }), H = /* @__PURE__ */ a("span")({
231
- name: "FeedbackDescription",
232
- class: "FeedbackDescription_fzfk69z",
233
- propsAsIs: !1
234
- }), kt = /* @__PURE__ */ a("div")({
235
- name: "FeedbackText",
236
- class: "FeedbackText_fx87qaj",
237
- propsAsIs: !1
238
- }), bt = ({
239
- feedbackMessages: e,
240
- questionVotedCorrectly: t,
241
- questionVoted: n,
242
- questionType: s,
243
- hasCorrectAnswer: o,
244
- questionStatus: I
245
- }) => {
246
- const m = n && (s === x.TRIVIA || s === x.PREDICTION);
247
- if (!m && I !== Q.RESOLVED)
248
- return null;
249
- const p = s === x.PREDICTION && !o, d = t ? "correct" : "incorrect", f = t ? e.correctFeedback : e.incorrectFeedback;
250
- return /* @__PURE__ */ u(Ct, { "data-isPrediction": p, children: [
251
- I === Q.RESOLVED && s === x.TRIVIA && !n && /* @__PURE__ */ u(w, { children: [
252
- /* @__PURE__ */ i(re, { children: /* @__PURE__ */ i(C, { name: "questionExpired" }) }),
253
- /* @__PURE__ */ u("div", { children: [
254
- /* @__PURE__ */ i(ae, { children: /* @__PURE__ */ i(H, { children: "Question Expired" }) }),
255
- /* @__PURE__ */ i(kt, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
256
- ] })
257
- ] }),
258
- m && p && /* @__PURE__ */ u(w, { children: [
259
- /* @__PURE__ */ i(jt, { name: "icon-prediction" }),
260
- /* @__PURE__ */ i(H, { children: "Stay tuned to see if your prediction was correct." })
261
- ] }),
262
- m && o && /* @__PURE__ */ u(w, { children: [
263
- /* @__PURE__ */ i(re, { "data-feedbackType": d, children: /* @__PURE__ */ i(C, { name: d }) }),
264
- /* @__PURE__ */ i("div", { children: /* @__PURE__ */ u(ae, { children: [
265
- /* @__PURE__ */ i(_t, { "data-feedbackType": d, children: f == null ? void 0 : f.title }),
266
- /* @__PURE__ */ i(H, { children: f == null ? void 0 : f.description })
267
- ] }) })
268
- ] })
269
- ] });
270
- }, wt = /* @__PURE__ */ a("div")({
271
- name: "Container",
272
- class: "Container_c14ielyq",
273
- propsAsIs: !1
274
- }), Et = /* @__PURE__ */ a("div")({
275
- name: "Content",
276
- class: "Content_c1tlqx57",
277
- propsAsIs: !1
278
- }), Lt = /* @__PURE__ */ a("div")({
279
- name: "Title",
280
- class: "Title_t1hq58md",
281
- propsAsIs: !1
282
- }), $t = /* @__PURE__ */ a("div")({
283
- name: "Options",
284
- class: "Options_o1c8nxcx",
285
- propsAsIs: !1
286
- }), Rt = /* @__PURE__ */ a("button")({
287
- name: "ButtonContainer",
288
- class: "ButtonContainer_b1b6dl8t",
289
- propsAsIs: !1
290
- }), Qt = /* @__PURE__ */ a("div")({
291
- name: "ButtonPct",
292
- class: "ButtonPct_b4iik8i",
293
- propsAsIs: !1
294
- }), Ut = /* @__PURE__ */ a("span")({
295
- name: "ButtonBody",
296
- class: "ButtonBody_b1gq1lnf",
297
- propsAsIs: !1
298
- }), Pt = /* @__PURE__ */ a("div")({
299
- name: "IconContainer",
300
- class: "IconContainer_i1j65z51",
301
- propsAsIs: !1
302
- }), qt = /* @__PURE__ */ a("div")({
303
- name: "IconWrap",
304
- class: "IconWrap_i19tpfua",
305
- propsAsIs: !1
306
- }), ze = /* @__PURE__ */ a("img")({
307
- name: "Icon",
308
- class: "Icon_i1tubmma",
309
- propsAsIs: !1
310
- }), Yt = () => ze, Wt = /* @__PURE__ */ a(Yt())({
311
- name: "IconDefault",
312
- class: "IconDefault_i1grrgwj",
313
- propsAsIs: !0
314
- }), Bt = () => ze, Ft = /* @__PURE__ */ a(Bt())({
315
- name: "IconCircle",
316
- class: "IconCircle_ibemyq8",
317
- propsAsIs: !0
318
- }), Vt = /* @__PURE__ */ a("span")({
319
- name: "Title",
320
- class: "Title_t1dceht",
321
- propsAsIs: !1
322
- }), Ht = /* @__PURE__ */ a("span")({
323
- name: "Indicators",
324
- class: "Indicators_i116q4vq",
325
- propsAsIs: !1
326
- }), Gt = /* @__PURE__ */ a("span")({
327
- name: "Percentage",
328
- class: "Percentage_p17ajcu2",
329
- propsAsIs: !1
330
- }), Zt = () => C, Jt = /* @__PURE__ */ a(Zt())({
331
- name: "CheckIcon",
332
- class: "CheckIcon_cu9kmlb",
333
- propsAsIs: !0
334
- }), le = {
335
- [b.CENTERED]: (e) => /* @__PURE__ */ i(Wt, { alt: "option-icon", src: e }),
336
- [b.TRANSPARENT]: (e) => /* @__PURE__ */ i(Pt, { children: /* @__PURE__ */ i(qt, { style: { backgroundImage: `url(${e})` } }) }),
337
- [b.ROUNDED]: (e) => /* @__PURE__ */ i(Ft, { alt: "option-icon", src: e }),
338
- [b.NONE]: () => null,
339
- [b.UNSET]: () => null
340
- }, Kt = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: s, questionVoted: o }) => {
341
- if (e === x.POLL && s)
342
- return "correct";
343
- if (e === x.PREDICTION) {
344
- if (t && o)
345
- return s ? n ? "correct" : "incorrect" : n ? "correct" : "unset";
346
- if (s)
347
- return "correct";
348
- }
349
- return e === x.TRIVIA && o ? s ? n ? "correct" : "incorrect" : n ? "correct" : "unset" : "unset";
350
- }, Xt = ({
351
- questionType: e,
352
- questionVoted: t,
353
- correct: n,
354
- hasCorrectAnswer: s,
355
- questionStatus: o
356
- }) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && s || o === Q.RESOLVED && n : !1, en = (e) => {
357
- var t;
358
- const {
359
- // option props
360
- id: n,
361
- icon: s,
362
- text: o,
363
- percentageDecimal: I,
364
- // extra props
365
- onVote: m,
366
- youSelected: p,
367
- questionVoted: d,
368
- // ToDo: Figure out why imageMode is not in the response, and delete default value
369
- imageMode: f = b.ROUNDED,
370
- answerTimeExpired: T,
371
- questionStatus: D,
372
- isLoading: N,
373
- questionType: y,
374
- correct: A,
375
- hasCorrectAnswer: r
376
- } = e, l = Kt(e), c = Xt({ questionType: y, questionVoted: d, correct: A, hasCorrectAnswer: r, questionStatus: D }), h = d || D === Q.RESOLVED && y === x.PREDICTION;
377
- return /* @__PURE__ */ u(
378
- Rt,
379
- {
380
- value: n,
381
- "data-selected": p,
382
- "data-answerState": l,
383
- disabled: d || N || T,
384
- onClick: m,
385
- children: [
386
- h && /* @__PURE__ */ i(Qt, { "data-answerState": l, style: { width: `${I}%` } }),
387
- /* @__PURE__ */ u(Ut, { children: [
388
- s && ((t = le[f]) == null ? void 0 : t.call(le, s)),
389
- /* @__PURE__ */ i(Vt, { children: o }),
390
- h && /* @__PURE__ */ u(Ht, { children: [
391
- c && /* @__PURE__ */ i(Jt, { name: "selected" }),
392
- /* @__PURE__ */ u(Gt, { children: [
393
- I,
394
- "%"
395
- ] })
396
- ] })
397
- ] })
398
- ]
399
- }
400
- );
401
- }, tn = [E.PRIMARY_GREEN1, E.SECONDARY_RED1, E.SECONDARY_RED1], nn = [10, 10, 0], sn = /* @__PURE__ */ a("div")({
402
- name: "RemainingTime",
403
- class: "RemainingTime_r165427",
404
- propsAsIs: !1
405
- }), on = E.SECONDARY_GREEN6, ce = E.SECONDARY_RED3, rn = E.NEUTRALS_GRAY3, an = ({
406
- isPlaying: e = !0,
407
- duration: t = 30,
408
- onTimerExpired: n
409
- }) => {
410
- const [s, o] = R(t > 10 ? on : ce), I = ({
411
- remainingTime: d
412
- }) => /* @__PURE__ */ i(sn, {
413
- children: d
414
- }), m = B(() => {
415
- n == null || n(), o(rn);
416
- }, [n, o]), p = B((d) => {
417
- d === 10 && o(ce);
418
- }, [o]);
419
- return /* @__PURE__ */ i(Be, {
420
- isPlaying: e,
421
- duration: t,
422
- colors: tn,
423
- colorsTime: nn,
424
- size: 32,
425
- strokeWidth: 2,
426
- trailStrokeWidth: 2,
427
- trailColor: s,
428
- onComplete: m,
429
- onUpdate: p,
430
- children: I
431
- });
432
- }, ln = /* @__PURE__ */ a("div")({
433
- name: "WinBarContainer",
434
- class: "WinBarContainer_wie6cqo",
435
- propsAsIs: !1
436
- }), cn = /* @__PURE__ */ a("div")({
437
- name: "Content",
438
- class: "Content_cgizw4u",
439
- propsAsIs: !1
440
- }), dn = /* @__PURE__ */ a("div")({
441
- name: "Title",
442
- class: "Title_t1l3ucjp",
443
- propsAsIs: !1
444
- }), un = () => C, pn = /* @__PURE__ */ a(un())({
445
- name: "WinIcon",
446
- class: "WinIcon_wx7j799",
447
- propsAsIs: !0
448
- }), mn = /* @__PURE__ */ a("div")({
449
- name: "Points",
450
- class: "Points_p4lwuj0",
451
- propsAsIs: !1
452
- }), In = /* @__PURE__ */ a("span")({
453
- name: "PointsCount",
454
- class: "PointsCount_po9i64o",
455
- propsAsIs: !1
456
- }), hn = /* @__PURE__ */ a("span")({
457
- name: "PointsUnits",
458
- class: "PointsUnits_pe5g05h",
459
- propsAsIs: !1
460
- }), fn = ({ title: e, points: t, isPlayingTimer: n, isTimer: s, onTimerExpired: o }) => /* @__PURE__ */ u(ln, { children: [
461
- /* @__PURE__ */ u(cn, { children: [
462
- e && /* @__PURE__ */ i(dn, { children: e }),
463
- t !== void 0 && /* @__PURE__ */ u(w, { children: [
464
- /* @__PURE__ */ i(pn, { name: "icon-trophy" }),
465
- /* @__PURE__ */ u(mn, { children: [
466
- /* @__PURE__ */ i(In, { children: t }),
467
- /* @__PURE__ */ i(hn, { children: "PTS" })
468
- ] })
469
- ] })
470
- ] }),
471
- s && /* @__PURE__ */ i(an, { isPlaying: n, onTimerExpired: o })
472
- ] }), Mn = ({ openedQuestion: e, vote: t, close: n }) => {
473
- var s;
474
- const o = e.subject, I = e.type, m = (s = e.options) == null ? void 0 : s.options, [p, d] = R(!1), [f, T] = R(!1), [D, N] = R(""), y = e == null ? void 0 : e.id, A = B(
475
- async (v) => {
476
- if (y) {
477
- const M = v.currentTarget.value;
478
- N(M), T(!0), await t(y, M), T(!1);
479
- }
480
- },
481
- [y, N, t]
482
- ), r = B(() => {
483
- d(!0), setTimeout(n, 3e3);
484
- }, [n]), l = W(
485
- () => e == null ? void 0 : e.answers.find((v) => v.youVoted === !0),
486
- [e]
487
- ), c = W(
488
- () => !!(e != null && e.answers.find((v) => v.correct === !0)),
489
- [e]
490
- ), h = W(() => e ? e.answers.map((v) => ({
491
- ...v,
492
- questionVoted: !!l,
493
- youSelected: D === v.id,
494
- isLoading: f,
495
- hasCorrectAnswer: c,
496
- questionType: e.type,
497
- answerTimeExpired: p,
498
- questionStatus: e.status,
499
- // ToDo: Figure out why imageMode is not in the response
500
- onVote: A
501
- })) : [], [c, p, f, e, l, A, D]), g = m && (m.case === "trivia" || m.case === "prediction") ? m.value : void 0;
502
- return /* @__PURE__ */ i(Ne, { "data-question-header": "true", children: /* @__PURE__ */ i(wt, { children: /* @__PURE__ */ u(Et, { children: [
503
- g && /* @__PURE__ */ i(
504
- bt,
505
- {
506
- feedbackMessages: g,
507
- questionVoted: !!l,
508
- questionVotedCorrectly: l == null ? void 0 : l.correct,
509
- questionType: I,
510
- hasCorrectAnswer: c,
511
- questionStatus: e.status
512
- }
513
- ),
514
- /* @__PURE__ */ i(
515
- fn,
516
- {
517
- title: p ? "Time expired" : "To win",
518
- points: p ? void 0 : 100,
519
- onTimerExpired: r,
520
- isTimer: !0
521
- }
522
- ),
523
- p ? /* @__PURE__ */ i(
524
- xt,
525
- {
526
- title: "More to come...",
527
- description: "Watch for additional enhanced stream interactive experience."
528
- }
529
- ) : /* @__PURE__ */ u(w, { children: [
530
- /* @__PURE__ */ i(Lt, { children: o }),
531
- /* @__PURE__ */ i($t, { children: h.map((v) => /* @__PURE__ */ i(en, { ...v }, v.id)) })
532
- ] })
533
- ] }) }) });
534
- }, gn = /* @__PURE__ */ a("div")({
535
- name: "Container",
536
- class: "Container_cgn5uen",
537
- propsAsIs: !1
538
- }), vn = /* @__PURE__ */ a("div")({
539
- name: "Content",
540
- class: "Content_c1px8nt6",
541
- propsAsIs: !1
542
- }), Nn = /* @__PURE__ */ a("h3")({
543
- name: "Title",
544
- class: "Title_t5et2jt",
545
- propsAsIs: !1
546
- }), Tn = /* @__PURE__ */ a("div")({
547
- name: "Description",
548
- class: "Description_d1i2kpk2",
549
- propsAsIs: !1
550
- }), yn = /* @__PURE__ */ a("div")({
551
- name: "DateWrap",
552
- class: "DateWrap_dd3lh3p",
553
- propsAsIs: !1
554
- }), xe = ({ created: e, title: t, instantView: n }) => {
555
- const s = W(() => {
556
- if (e) {
557
- const o = new Date(e);
558
- if (qe(o))
559
- return {
560
- date: Ye(o),
561
- time: We(o)
562
- };
563
- }
564
- return null;
565
- }, [e]);
566
- return /* @__PURE__ */ u(gn, { children: [
567
- s && /* @__PURE__ */ u(yn, { children: [
568
- s.date,
569
- " · ",
570
- s.time
571
- ] }),
572
- (n == null ? void 0 : n.video) && /* @__PURE__ */ i(Le, { source: n.video.url, poster: n.video.thumbnailUrl }),
573
- /* @__PURE__ */ u(vn, { children: [
574
- /* @__PURE__ */ i(Nn, { children: (n == null ? void 0 : n.heading) || t }),
575
- /* @__PURE__ */ i(Tn, { children: n == null ? void 0 : n.body })
576
- ] })
577
- ] });
578
- }, An = /* @__PURE__ */ a("div")({
579
- name: "Container",
580
- class: "Container_c1euiow",
581
- propsAsIs: !1
582
- }), Dn = /* @__PURE__ */ a("a")({
583
- name: "WebLinkBtn",
584
- class: "WebLinkBtn_w19zie3h",
585
- propsAsIs: !1
586
- }), Sn = ({ instantView: e, ...t }) => /* @__PURE__ */ u(An, { children: [
587
- /* @__PURE__ */ i(xe, { instantView: e, ...t }),
588
- (e == null ? void 0 : e.webLink) && /* @__PURE__ */ u(Dn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
589
- "Explore more of the Masters History",
590
- /* @__PURE__ */ i(C, { name: "icon-external-link" })
591
- ] })
592
- ] }), zn = /* @__PURE__ */ a("div")({
593
- name: "QuestionContainer",
594
- class: "QuestionContainer_qdri6g3",
595
- propsAsIs: !1
596
- }), xn = ({
597
- openedQuestion: e
598
- }) => {
599
- var t;
600
- return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ i(Sn, {
601
- created: e.attributes.created,
602
- ...e.attributes.attributes.value
603
- }) : null;
604
- }, Cn = ({
605
- extendedQuestion: e,
606
- vote: t,
607
- close: n
608
- }) => {
609
- const {
610
- loading: s,
611
- data: o
612
- } = e;
613
- return !s && o ? /* @__PURE__ */ i(Mn, {
614
- vote: t,
615
- close: n,
616
- openedQuestion: o
617
- }) : null;
618
- }, On = ({
619
- gamification: e
620
- }) => {
621
- var t;
622
- const n = _(e.openedQuestion.$store), s = _(e.openedQuestion.$extendedStore);
623
- if (!n)
624
- return null;
625
- const o = n.type;
626
- return /* @__PURE__ */ u(zn, {
627
- children: [/* @__PURE__ */ i(De, {
628
- close: e.closeQuestion,
629
- type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
630
- }), o === "question" && /* @__PURE__ */ i(Cn, {
631
- vote: e.submitAnswer,
632
- close: e.closeQuestion,
633
- extendedQuestion: s
634
- }), o !== "question" && /* @__PURE__ */ i(xn, {
635
- openedQuestion: n
636
- })]
637
- });
638
- }, jn = /* @__PURE__ */ a("div")({
639
- name: "Container",
640
- class: "Container_c115qtkr",
641
- propsAsIs: !1
642
- }), _n = /* @__PURE__ */ a("div")({
643
- name: "STabs",
644
- class: "STabs_sxnslc8",
645
- propsAsIs: !1
646
- }), kn = /* @__PURE__ */ a("button")({
647
- name: "Button",
648
- class: "Button_b1umzux0",
649
- propsAsIs: !1
650
- }), bn = /* @__PURE__ */ a("span")({
651
- name: "Title",
652
- class: "Title_tspsaas",
653
- propsAsIs: !1
654
- });
655
- var $ = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))($ || {});
656
- const de = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ i(kn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ i(bn, { children: e }) }), wn = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ i(jn, { children: /* @__PURE__ */ u(_n, { "data-position": e === "home" ? "left" : "right", children: [
657
- /* @__PURE__ */ i(de, { title: "Home", active: e === "home", onClick: () => t(
658
- "home"
659
- /* HOME */
660
- ) }),
661
- /* @__PURE__ */ i(
662
- de,
663
- {
664
- title: "Leader Board",
665
- active: e === "leaderboard",
666
- onClick: () => t(
667
- "leaderboard"
668
- /* LEADERBOARD */
669
- )
670
- }
671
- )
672
- ] }) });
673
- function X() {
674
- return X = Object.assign ? Object.assign.bind() : function(e) {
675
- for (var t = 1; t < arguments.length; t++) {
676
- var n = arguments[t];
677
- for (var s in n)
678
- Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
679
- }
680
- return e;
681
- }, X.apply(this, arguments);
682
- }
683
- function ue(e) {
684
- if (e === void 0)
685
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
686
- return e;
687
- }
688
- function ee(e, t) {
689
- return ee = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(s, o) {
690
- return s.__proto__ = o, s;
691
- }, ee(e, t);
692
- }
693
- function En(e, t) {
694
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ee(e, t);
695
- }
696
- var pe = Number.isNaN || function(t) {
697
- return typeof t == "number" && t !== t;
698
- };
699
- function Ln(e, t) {
700
- return !!(e === t || pe(e) && pe(t));
701
- }
702
- function $n(e, t) {
703
- if (e.length !== t.length)
704
- return !1;
705
- for (var n = 0; n < e.length; n++)
706
- if (!Ln(e[n], t[n]))
707
- return !1;
708
- return !0;
709
- }
710
- function G(e, t) {
711
- t === void 0 && (t = $n);
712
- var n, s = [], o, I = !1;
713
- function m() {
714
- for (var p = [], d = 0; d < arguments.length; d++)
715
- p[d] = arguments[d];
716
- return I && n === this && t(p, s) || (o = e.apply(this, p), I = !0, n = this, s = p), o;
717
- }
718
- return m;
719
- }
720
- var Rn = typeof performance == "object" && typeof performance.now == "function", me = Rn ? function() {
721
- return performance.now();
722
- } : function() {
723
- return Date.now();
724
- };
725
- function Ie(e) {
726
- cancelAnimationFrame(e.id);
727
- }
728
- function Qn(e, t) {
729
- var n = me();
730
- function s() {
731
- me() - n >= t ? e.call(null) : o.id = requestAnimationFrame(s);
732
- }
733
- var o = {
734
- id: requestAnimationFrame(s)
735
- };
736
- return o;
737
- }
738
- var Z = -1;
739
- function he(e) {
740
- if (e === void 0 && (e = !1), Z === -1 || e) {
741
- var t = document.createElement("div"), n = t.style;
742
- n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), Z = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
743
- }
744
- return Z;
745
- }
746
- var k = null;
747
- function fe(e) {
748
- if (e === void 0 && (e = !1), k === null || e) {
749
- var t = document.createElement("div"), n = t.style;
750
- n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
751
- var s = document.createElement("div"), o = s.style;
752
- return o.width = "100px", o.height = "100px", t.appendChild(s), document.body.appendChild(t), t.scrollLeft > 0 ? k = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? k = "negative" : k = "positive-ascending"), document.body.removeChild(t), k;
753
- }
754
- return k;
755
- }
756
- var Un = 150, Pn = function(t, n) {
757
- return t;
758
- };
759
- function qn(e) {
760
- var t, n = e.getItemOffset, s = e.getEstimatedTotalSize, o = e.getItemSize, I = e.getOffsetForIndexAndAlignment, m = e.getStartIndexForOffset, p = e.getStopIndexForStartIndex, d = e.initInstanceProps, f = e.shouldResetStyleCacheOnItemSizeChange, T = e.validateProps;
761
- return t = /* @__PURE__ */ function(D) {
762
- En(N, D);
763
- function N(A) {
764
- var r;
765
- return r = D.call(this, A) || this, r._instanceProps = d(r.props, ue(r)), r._outerRef = void 0, r._resetIsScrollingTimeoutId = null, r.state = {
766
- instance: ue(r),
767
- isScrolling: !1,
768
- scrollDirection: "forward",
769
- scrollOffset: typeof r.props.initialScrollOffset == "number" ? r.props.initialScrollOffset : 0,
770
- scrollUpdateWasRequested: !1
771
- }, r._callOnItemsRendered = void 0, r._callOnItemsRendered = G(function(l, c, h, g) {
772
- return r.props.onItemsRendered({
773
- overscanStartIndex: l,
774
- overscanStopIndex: c,
775
- visibleStartIndex: h,
776
- visibleStopIndex: g
777
- });
778
- }), r._callOnScroll = void 0, r._callOnScroll = G(function(l, c, h) {
779
- return r.props.onScroll({
780
- scrollDirection: l,
781
- scrollOffset: c,
782
- scrollUpdateWasRequested: h
783
- });
784
- }), r._getItemStyle = void 0, r._getItemStyle = function(l) {
785
- var c = r.props, h = c.direction, g = c.itemSize, v = c.layout, M = r._getItemStyleCache(f && g, f && v, f && h), S;
786
- if (M.hasOwnProperty(l))
787
- S = M[l];
788
- else {
789
- var z = n(r.props, l, r._instanceProps), O = o(r.props, l, r._instanceProps), j = h === "horizontal" || v === "horizontal", U = h === "rtl", P = j ? z : 0;
790
- M[l] = S = {
791
- position: "absolute",
792
- left: U ? void 0 : P,
793
- right: U ? P : void 0,
794
- top: j ? 0 : z,
795
- height: j ? "100%" : O,
796
- width: j ? O : "100%"
797
- };
798
- }
799
- return S;
800
- }, r._getItemStyleCache = void 0, r._getItemStyleCache = G(function(l, c, h) {
801
- return {};
802
- }), r._onScrollHorizontal = function(l) {
803
- var c = l.currentTarget, h = c.clientWidth, g = c.scrollLeft, v = c.scrollWidth;
804
- r.setState(function(M) {
805
- if (M.scrollOffset === g)
806
- return null;
807
- var S = r.props.direction, z = g;
808
- if (S === "rtl")
809
- switch (fe()) {
810
- case "negative":
811
- z = -g;
812
- break;
813
- case "positive-descending":
814
- z = v - h - g;
815
- break;
816
- }
817
- return z = Math.max(0, Math.min(z, v - h)), {
818
- isScrolling: !0,
819
- scrollDirection: M.scrollOffset < g ? "forward" : "backward",
820
- scrollOffset: z,
821
- scrollUpdateWasRequested: !1
822
- };
823
- }, r._resetIsScrollingDebounced);
824
- }, r._onScrollVertical = function(l) {
825
- var c = l.currentTarget, h = c.clientHeight, g = c.scrollHeight, v = c.scrollTop;
826
- r.setState(function(M) {
827
- if (M.scrollOffset === v)
828
- return null;
829
- var S = Math.max(0, Math.min(v, g - h));
830
- return {
831
- isScrolling: !0,
832
- scrollDirection: M.scrollOffset < S ? "forward" : "backward",
833
- scrollOffset: S,
834
- scrollUpdateWasRequested: !1
835
- };
836
- }, r._resetIsScrollingDebounced);
837
- }, r._outerRefSetter = function(l) {
838
- var c = r.props.outerRef;
839
- r._outerRef = l, typeof c == "function" ? c(l) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = l);
840
- }, r._resetIsScrollingDebounced = function() {
841
- r._resetIsScrollingTimeoutId !== null && Ie(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Qn(r._resetIsScrolling, Un);
842
- }, r._resetIsScrolling = function() {
843
- r._resetIsScrollingTimeoutId = null, r.setState({
844
- isScrolling: !1
845
- }, function() {
846
- r._getItemStyleCache(-1, null);
847
- });
848
- }, r;
849
- }
850
- N.getDerivedStateFromProps = function(r, l) {
851
- return Yn(r, l), T(r), null;
852
- };
853
- var y = N.prototype;
854
- return y.scrollTo = function(r) {
855
- r = Math.max(0, r), this.setState(function(l) {
856
- return l.scrollOffset === r ? null : {
857
- scrollDirection: l.scrollOffset < r ? "forward" : "backward",
858
- scrollOffset: r,
859
- scrollUpdateWasRequested: !0
860
- };
861
- }, this._resetIsScrollingDebounced);
862
- }, y.scrollToItem = function(r, l) {
863
- l === void 0 && (l = "auto");
864
- var c = this.props, h = c.itemCount, g = c.layout, v = this.state.scrollOffset;
865
- r = Math.max(0, Math.min(r, h - 1));
866
- var M = 0;
867
- if (this._outerRef) {
868
- var S = this._outerRef;
869
- g === "vertical" ? M = S.scrollWidth > S.clientWidth ? he() : 0 : M = S.scrollHeight > S.clientHeight ? he() : 0;
870
- }
871
- this.scrollTo(I(this.props, r, l, v, this._instanceProps, M));
872
- }, y.componentDidMount = function() {
873
- var r = this.props, l = r.direction, c = r.initialScrollOffset, h = r.layout;
874
- if (typeof c == "number" && this._outerRef != null) {
875
- var g = this._outerRef;
876
- l === "horizontal" || h === "horizontal" ? g.scrollLeft = c : g.scrollTop = c;
877
- }
878
- this._callPropsCallbacks();
879
- }, y.componentDidUpdate = function() {
880
- var r = this.props, l = r.direction, c = r.layout, h = this.state, g = h.scrollOffset, v = h.scrollUpdateWasRequested;
881
- if (v && this._outerRef != null) {
882
- var M = this._outerRef;
883
- if (l === "horizontal" || c === "horizontal")
884
- if (l === "rtl")
885
- switch (fe()) {
886
- case "negative":
887
- M.scrollLeft = -g;
888
- break;
889
- case "positive-ascending":
890
- M.scrollLeft = g;
891
- break;
892
- default:
893
- var S = M.clientWidth, z = M.scrollWidth;
894
- M.scrollLeft = z - S - g;
895
- break;
896
- }
897
- else
898
- M.scrollLeft = g;
899
- else
900
- M.scrollTop = g;
901
- }
902
- this._callPropsCallbacks();
903
- }, y.componentWillUnmount = function() {
904
- this._resetIsScrollingTimeoutId !== null && Ie(this._resetIsScrollingTimeoutId);
905
- }, y.render = function() {
906
- var r = this.props, l = r.children, c = r.className, h = r.direction, g = r.height, v = r.innerRef, M = r.innerElementType, S = r.innerTagName, z = r.itemCount, O = r.itemData, j = r.itemKey, U = j === void 0 ? Pn : j, P = r.layout, Ce = r.outerElementType, Oe = r.outerTagName, je = r.style, _e = r.useIsScrolling, ke = r.width, te = this.state.isScrolling, F = h === "horizontal" || P === "horizontal", be = F ? this._onScrollHorizontal : this._onScrollVertical, ne = this._getRangeToRender(), we = ne[0], Ee = ne[1], ie = [];
907
- if (z > 0)
908
- for (var L = we; L <= Ee; L++)
909
- ie.push(V(l, {
910
- data: O,
911
- key: U(L, O),
912
- index: L,
913
- isScrolling: _e ? te : void 0,
914
- style: this._getItemStyle(L)
915
- }));
916
- var se = s(this.props, this._instanceProps);
917
- return V(Ce || Oe || "div", {
918
- className: c,
919
- onScroll: be,
920
- ref: this._outerRefSetter,
921
- style: X({
922
- position: "relative",
923
- height: g,
924
- width: ke,
925
- overflow: "auto",
926
- WebkitOverflowScrolling: "touch",
927
- willChange: "transform",
928
- direction: h
929
- }, je)
930
- }, V(M || S || "div", {
931
- children: ie,
932
- ref: v,
933
- style: {
934
- height: F ? "100%" : se,
935
- pointerEvents: te ? "none" : void 0,
936
- width: F ? se : "100%"
937
- }
938
- }));
939
- }, y._callPropsCallbacks = function() {
940
- if (typeof this.props.onItemsRendered == "function") {
941
- var r = this.props.itemCount;
942
- if (r > 0) {
943
- var l = this._getRangeToRender(), c = l[0], h = l[1], g = l[2], v = l[3];
944
- this._callOnItemsRendered(c, h, g, v);
945
- }
946
- }
947
- if (typeof this.props.onScroll == "function") {
948
- var M = this.state, S = M.scrollDirection, z = M.scrollOffset, O = M.scrollUpdateWasRequested;
949
- this._callOnScroll(S, z, O);
950
- }
951
- }, y._getRangeToRender = function() {
952
- var r = this.props, l = r.itemCount, c = r.overscanCount, h = this.state, g = h.isScrolling, v = h.scrollDirection, M = h.scrollOffset;
953
- if (l === 0)
954
- return [0, 0, 0, 0];
955
- var S = m(this.props, M, this._instanceProps), z = p(this.props, S, M, this._instanceProps), O = !g || v === "backward" ? Math.max(1, c) : 1, j = !g || v === "forward" ? Math.max(1, c) : 1;
956
- return [Math.max(0, S - O), Math.max(0, Math.min(l - 1, z + j)), S, z];
957
- }, N;
958
- }(Te), t.defaultProps = {
959
- direction: "ltr",
960
- itemData: void 0,
961
- layout: "vertical",
962
- overscanCount: 2,
963
- useIsScrolling: !1
964
- }, t;
965
- }
966
- var Yn = function(t, n) {
967
- t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
968
- }, Wn = /* @__PURE__ */ qn({
969
- getItemOffset: function(t, n) {
970
- var s = t.itemSize;
971
- return n * s;
972
- },
973
- getItemSize: function(t, n) {
974
- var s = t.itemSize;
975
- return s;
976
- },
977
- getEstimatedTotalSize: function(t) {
978
- var n = t.itemCount, s = t.itemSize;
979
- return s * n;
980
- },
981
- getOffsetForIndexAndAlignment: function(t, n, s, o, I, m) {
982
- var p = t.direction, d = t.height, f = t.itemCount, T = t.itemSize, D = t.layout, N = t.width, y = p === "horizontal" || D === "horizontal", A = y ? N : d, r = Math.max(0, f * T - A), l = Math.min(r, n * T), c = Math.max(0, n * T - A + T + m);
983
- switch (s === "smart" && (o >= c - A && o <= l + A ? s = "auto" : s = "center"), s) {
984
- case "start":
985
- return l;
986
- case "end":
987
- return c;
988
- case "center": {
989
- var h = Math.round(c + (l - c) / 2);
990
- return h < Math.ceil(A / 2) ? 0 : h > r + Math.floor(A / 2) ? r : h;
991
- }
992
- case "auto":
993
- default:
994
- return o >= c && o <= l ? o : o < c ? c : l;
995
- }
996
- },
997
- getStartIndexForOffset: function(t, n) {
998
- var s = t.itemCount, o = t.itemSize;
999
- return Math.max(0, Math.min(s - 1, Math.floor(n / o)));
1000
- },
1001
- getStopIndexForStartIndex: function(t, n, s) {
1002
- var o = t.direction, I = t.height, m = t.itemCount, p = t.itemSize, d = t.layout, f = t.width, T = o === "horizontal" || d === "horizontal", D = n * p, N = T ? f : I, y = Math.ceil((N + s - D) / p);
1003
- return Math.max(0, Math.min(
1004
- m - 1,
1005
- n + y - 1
1006
- // -1 is because stop index is inclusive
1007
- ));
1008
- },
1009
- initInstanceProps: function(t) {
1010
- },
1011
- shouldResetStyleCacheOnItemSizeChange: !0,
1012
- validateProps: function(t) {
1013
- t.itemSize;
1014
- }
1015
- });
1016
- function Bn(e) {
1017
- var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, s = e.startIndex, o = e.stopIndex;
1018
- return !(s > n || o < t);
1019
- }
1020
- function Fn(e) {
1021
- for (var t = e.isItemLoaded, n = e.itemCount, s = e.minimumBatchSize, o = e.startIndex, I = e.stopIndex, m = [], p = null, d = null, f = o; f <= I; f++) {
1022
- var T = t(f);
1023
- T ? d !== null && (m.push(p, d), p = d = null) : (d = f, p === null && (p = f));
1024
- }
1025
- if (d !== null) {
1026
- for (var D = Math.min(Math.max(d, p + s - 1), n - 1), N = d + 1; N <= D && !t(N); N++)
1027
- d = N;
1028
- m.push(p, d);
1029
- }
1030
- if (m.length)
1031
- for (; m[1] - m[0] + 1 < s && m[0] > 0; ) {
1032
- var y = m[0] - 1;
1033
- if (!t(y))
1034
- m[0] = y;
1035
- else
1036
- break;
1037
- }
1038
- return m;
1039
- }
1040
- var Vn = function(e, t) {
1041
- if (!(e instanceof t))
1042
- throw new TypeError("Cannot call a class as a function");
1043
- }, Hn = function() {
1044
- function e(t, n) {
1045
- for (var s = 0; s < n.length; s++) {
1046
- var o = n[s];
1047
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
1048
- }
1049
- }
1050
- return function(t, n, s) {
1051
- return n && e(t.prototype, n), s && e(t, s), t;
1052
- };
1053
- }(), Gn = function(e, t) {
1054
- if (typeof t != "function" && t !== null)
1055
- throw new TypeError("Super expression must either be null or a function, not " + typeof t);
1056
- e.prototype = Object.create(t && t.prototype, {
1057
- constructor: {
1058
- value: e,
1059
- enumerable: !1,
1060
- writable: !0,
1061
- configurable: !0
1062
- }
1063
- }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
1064
- }, Me = function(e, t) {
1065
- if (!e)
1066
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1067
- return t && (typeof t == "object" || typeof t == "function") ? t : e;
1068
- }, Zn = function(e) {
1069
- Gn(t, e);
1070
- function t() {
1071
- var n, s, o, I;
1072
- Vn(this, t);
1073
- for (var m = arguments.length, p = Array(m), d = 0; d < m; d++)
1074
- p[d] = arguments[d];
1075
- return I = (s = (o = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(p))), o), o._lastRenderedStartIndex = -1, o._lastRenderedStopIndex = -1, o._memoizedUnloadedRanges = [], o._onItemsRendered = function(f) {
1076
- var T = f.visibleStartIndex, D = f.visibleStopIndex;
1077
- o._lastRenderedStartIndex = T, o._lastRenderedStopIndex = D, o._ensureRowsLoaded(T, D);
1078
- }, o._setRef = function(f) {
1079
- o._listRef = f;
1080
- }, s), Me(o, I);
1081
- }
1082
- return Hn(t, [{
1083
- key: "resetloadMoreItemsCache",
1084
- value: function() {
1085
- var s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1086
- this._memoizedUnloadedRanges = [], s && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
1087
- }
1088
- }, {
1089
- key: "componentDidMount",
1090
- value: function() {
1091
- }
1092
- }, {
1093
- key: "render",
1094
- value: function() {
1095
- var s = this.props.children;
1096
- return s({
1097
- onItemsRendered: this._onItemsRendered,
1098
- ref: this._setRef
1099
- });
1100
- }
1101
- }, {
1102
- key: "_ensureRowsLoaded",
1103
- value: function(s, o) {
1104
- var I = this.props, m = I.isItemLoaded, p = I.itemCount, d = I.minimumBatchSize, f = d === void 0 ? 10 : d, T = I.threshold, D = T === void 0 ? 15 : T, N = Fn({
1105
- isItemLoaded: m,
1106
- itemCount: p,
1107
- minimumBatchSize: f,
1108
- startIndex: Math.max(0, s - D),
1109
- stopIndex: Math.min(p - 1, o + D)
1110
- });
1111
- (this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(y, A) {
1112
- return N[A] !== y;
1113
- })) && (this._memoizedUnloadedRanges = N, this._loadUnloadedRanges(N));
1114
- }
1115
- }, {
1116
- key: "_loadUnloadedRanges",
1117
- value: function(s) {
1118
- for (var o = this, I = this.props.loadMoreItems || this.props.loadMoreRows, m = function(f) {
1119
- var T = s[f], D = s[f + 1], N = I(T, D);
1120
- N != null && N.then(function() {
1121
- if (Bn({
1122
- lastRenderedStartIndex: o._lastRenderedStartIndex,
1123
- lastRenderedStopIndex: o._lastRenderedStopIndex,
1124
- startIndex: T,
1125
- stopIndex: D
1126
- })) {
1127
- if (o._listRef == null)
1128
- return;
1129
- typeof o._listRef.resetAfterIndex == "function" ? o._listRef.resetAfterIndex(T, !0) : (typeof o._listRef._getItemStyleCache == "function" && o._listRef._getItemStyleCache(-1), o._listRef.forceUpdate());
1130
- }
1131
- });
1132
- }, p = 0; p < s.length; p += 2)
1133
- m(p);
1134
- }
1135
- }]), t;
1136
- }(Te);
1137
- const Jn = /* @__PURE__ */ a("div")({
1138
- name: "Container",
1139
- class: "Container_culdu4a",
1140
- propsAsIs: !1
1141
- }), Kn = /* @__PURE__ */ a("div")({
1142
- name: "Position",
1143
- class: "Position_pwf8e69",
1144
- propsAsIs: !1
1145
- }), Xn = /* @__PURE__ */ a("img")({
1146
- name: "Avatar",
1147
- class: "Avatar_atf4yh4",
1148
- propsAsIs: !1
1149
- }), ei = /* @__PURE__ */ a("div")({
1150
- name: "AvatarPlaceholder",
1151
- class: "AvatarPlaceholder_a1dg29ja",
1152
- propsAsIs: !1
1153
- }), ti = /* @__PURE__ */ a("div")({
1154
- name: "Content",
1155
- class: "Content_c10a68rc",
1156
- propsAsIs: !1
1157
- }), ni = /* @__PURE__ */ a("div")({
1158
- name: "NameContainer",
1159
- class: "NameContainer_nc4kck5",
1160
- propsAsIs: !1
1161
- }), ii = /* @__PURE__ */ a("span")({
1162
- name: "Name",
1163
- class: "Name_njsrqgr",
1164
- propsAsIs: !1
1165
- }), si = () => C, oi = /* @__PURE__ */ a(si())({
1166
- name: "CurrentUserBadge",
1167
- class: "CurrentUserBadge_c17uc4zr",
1168
- propsAsIs: !0
1169
- }), ri = ({
1170
- rank: e,
1171
- avatar: t,
1172
- name: n,
1173
- points: s,
1174
- isCurrentUser: o,
1175
- openItemDetail: I,
1176
- style: m
1177
- }) => /* @__PURE__ */ u(Jn, { onClick: I, style: m, children: [
1178
- /* @__PURE__ */ i(Kn, { children: e || 0 }),
1179
- /* @__PURE__ */ u(ti, { children: [
1180
- t ? /* @__PURE__ */ i(Xn, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ i(ei, { children: ye(n || "") }),
1181
- /* @__PURE__ */ u(ni, { children: [
1182
- /* @__PURE__ */ i(ii, { children: n || "" }),
1183
- o && /* @__PURE__ */ i(oi, { name: "icon-star" })
1184
- ] })
1185
- ] }),
1186
- /* @__PURE__ */ i("div", { children: Ae(s) })
1187
- ] }), ai = ({
1188
- items: e,
1189
- currentUserId: t,
1190
- openItemDetail: n,
1191
- fetchMore: s
1192
- }) => /* @__PURE__ */ i($e, { children: ({ width: o, height: I }) => /* @__PURE__ */ i(
1193
- Zn,
1194
- {
1195
- isItemLoaded: (m) => m < e.length,
1196
- itemCount: e.length + 1,
1197
- loadMoreItems: s,
1198
- children: ({ onItemsRendered: m, ref: p }) => /* @__PURE__ */ i(
1199
- Wn,
1200
- {
1201
- itemSize: 56,
1202
- onItemsRendered: m,
1203
- ref: p,
1204
- itemCount: e.length,
1205
- width: o,
1206
- height: I,
1207
- children: ({ index: d, style: f }) => /* @__PURE__ */ i(
1208
- ri,
1209
- {
1210
- style: { ...f, maxHeight: 48 },
1211
- ...e[d],
1212
- openItemDetail: () => n(e[d].userId),
1213
- isCurrentUser: !!t && t === e[d].userId
1214
- },
1215
- e[d].userId
1216
- )
1217
- }
1218
- )
1219
- }
1220
- ) }), li = ({ deepLink: e }) => {
1221
- const { data: t } = _(e.$store);
1222
- return /* @__PURE__ */ i(
1223
- Re,
1224
- {
1225
- inviteLink: t == null ? void 0 : t.url,
1226
- socialLinks: [
1227
- {
1228
- icon: "icon-facebook",
1229
- link: "https://www.facebook.com/TheMasters",
1230
- label: "Facebook"
1231
- },
1232
- {
1233
- icon: "icon-twitter",
1234
- link: "https://twitter.com/@TheMasters",
1235
- label: "X"
1236
- }
1237
- ],
1238
- inviteCardTitle: "It’s more fun with friends",
1239
- inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
1240
- }
1241
- );
1242
- }, ci = ({ gamification: e }) => {
1243
- const { data: t } = _(e.leaderboardList.$store);
1244
- return t != null && t.length ? /* @__PURE__ */ i(
1245
- ai,
1246
- {
1247
- fetchMore: e.leaderboardList.fetchMore,
1248
- items: t,
1249
- openItemDetail: e.openUser,
1250
- currentUserId: e.currentUserId.get()
1251
- }
1252
- ) : /* @__PURE__ */ i(li, { deepLink: e.deepLink });
1253
- }, di = /* @__PURE__ */ a("div")({
1254
- name: "QuestionItem",
1255
- class: "QuestionItem_q1w97g3p",
1256
- propsAsIs: !1
1257
- }), ui = /* @__PURE__ */ a("div")({
1258
- name: "QuestionCaption",
1259
- class: "QuestionCaption_q2sl39u",
1260
- propsAsIs: !1
1261
- }), pi = /* @__PURE__ */ a("div")({
1262
- name: "QuestionBody",
1263
- class: "QuestionBody_qd5h0uc",
1264
- propsAsIs: !1
1265
- }), mi = /* @__PURE__ */ a("div")({
1266
- name: "QuestionAction",
1267
- class: "QuestionAction_q105uluy",
1268
- propsAsIs: !1
1269
- }), Ii = () => C, J = /* @__PURE__ */ a(Ii())({
1270
- name: "QuestionActionIcon",
1271
- class: "QuestionActionIcon_q1fa0b9h",
1272
- propsAsIs: !0
1273
- }), hi = () => C, fi = /* @__PURE__ */ a(hi())({
1274
- name: "QuestionTypeIcon",
1275
- class: "QuestionTypeIcon_qxlt78s",
1276
- propsAsIs: !0
1277
- }), Mi = /* @__PURE__ */ a("div")({
1278
- name: "QuestionTypeLabel",
1279
- class: "QuestionTypeLabel_qmg0vkx",
1280
- propsAsIs: !1
1281
- }), gi = /* @__PURE__ */ a("div")({
1282
- name: "QuestionContent",
1283
- class: "QuestionContent_q1uz5j1g",
1284
- propsAsIs: !1
1285
- }), vi = {
1286
- [q.LOST]: /* @__PURE__ */ i(J, { name: "icon-cross" }),
1287
- [q.WON]: /* @__PURE__ */ i(J, { name: "icon-check" }),
1288
- [q.UNSET]: void 0,
1289
- [q.DNP]: /* @__PURE__ */ i(J, { name: "icon-arrow" })
1290
- }, Ni = ({
1291
- questionId: e,
1292
- questionType: t,
1293
- questionStatus: n,
1294
- subject: s,
1295
- openForVoting: o,
1296
- openQuestion: I,
1297
- status: m
1298
- }) => {
1299
- const p = ve[t], d = vi[m];
1300
- return p ? /* @__PURE__ */ u(di, { onClick: () => I == null ? void 0 : I(e), children: [
1301
- /* @__PURE__ */ u(gi, { children: [
1302
- /* @__PURE__ */ u(ui, { children: [
1303
- /* @__PURE__ */ i(fi, { name: p.iconName }),
1304
- /* @__PURE__ */ u(Mi, { children: [
1305
- p.label,
1306
- t === x.TRIVIA && n === Q.RESOLVED && " • Expired"
1307
- ] })
1308
- ] }),
1309
- /* @__PURE__ */ i(pi, { children: s || "" })
1310
- ] }),
1311
- /* @__PURE__ */ i(mi, { children: d || (o ? /* @__PURE__ */ i(Qe, { children: "Play" }) : null) })
1312
- ] }) : null;
1313
- }, Ti = /* @__PURE__ */ a("div")({
1314
- name: "Container",
1315
- class: "Container_cll3md7",
1316
- propsAsIs: !1
1317
- }), yi = /* @__PURE__ */ a("button")({
1318
- name: "ActionBtn",
1319
- class: "ActionBtn_a10g1iik",
1320
- propsAsIs: !1
1321
- }), Ai = ({
1322
- openInsight: e,
1323
- questionId: t,
1324
- ...n
1325
- }) => /* @__PURE__ */ u(Ti, { children: [
1326
- /* @__PURE__ */ i(xe, { questionId: t, ...n }),
1327
- e && /* @__PURE__ */ i(yi, { onClick: () => e(t), children: "View Insight" })
1328
- ] }), Di = /* @__PURE__ */ a("div")({
1329
- name: "QuestionsContainer",
1330
- class: "QuestionsContainer_qvghv3l",
1331
- propsAsIs: !1
1332
- }), Si = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ i(Di, { children: e == null ? void 0 : e.map((n) => {
1333
- var s, o;
1334
- if (n.type === "question" && ((s = n.attributes) == null ? void 0 : s.attributes.case) === "question") {
1335
- const I = n.attributes.attributes.value;
1336
- return /* @__PURE__ */ i(Ni, { openQuestion: t, ...I }, I.questionId);
1337
- }
1338
- if (n.type === "insight" && ((o = n.attributes) == null ? void 0 : o.attributes.case) === "insight") {
1339
- const I = n.attributes.attributes.value;
1340
- return /* @__PURE__ */ i(Ai, { openInsight: t, ...I }, I.questionId);
1341
- }
1342
- return null;
1343
- }) }), zi = ({ store: e, openQuestion: t }) => {
1344
- const n = _(e);
1345
- return n != null && n.data ? /* @__PURE__ */ i(Si, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ i("div", { children: "wait questions..." });
1346
- }, xi = ({ userSummary: e }) => {
1347
- var t, n;
1348
- const s = _(e.getStore());
1349
- return (t = s.data) != null && t.summary ? /* @__PURE__ */ i(Se, { ...s.data.summary, successRate: (n = s.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ i("div", { children: "wait user..." });
1350
- }, Ci = ({ gamification: e }) => {
1351
- const [t, n] = R($.HOME);
1352
- return /* @__PURE__ */ u("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
1353
- /* @__PURE__ */ u(K, { children: [
1354
- /* @__PURE__ */ i(wn, { activePage: t, toggleActivePage: n }),
1355
- t === $.HOME && /* @__PURE__ */ i(xi, { userSummary: e.userSummary })
1356
- ] }),
1357
- t === $.HOME && /* @__PURE__ */ i(Ue, { children: /* @__PURE__ */ i(zi, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) }),
1358
- t === $.LEADERBOARD && /* @__PURE__ */ i(K, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ i(ci, { gamification: e }) })
1359
- ] });
1360
- }, Oi = () => Pe, ge = /* @__PURE__ */ a(Oi())({
1361
- name: "OpenedContainer",
1362
- class: "OpenedContainer_oar61gl",
1363
- propsAsIs: !0
1364
- }), ji = /* @__PURE__ */ a("div")({
1365
- name: "UserContainer",
1366
- class: "UserContainer_u14zaal4",
1367
- propsAsIs: !1
1368
- }), _i = ({
1369
- correct: e,
1370
- incorrect: t
1371
- }) => {
1372
- const n = e + t;
1373
- return n === 0 ? 0 : Math.round(e / n * 100);
1374
- }, Fi = ({
1375
- gamification: e,
1376
- className: t
1377
- }) => {
1378
- const n = _(e.openedQuestion.$store), s = _(e.openedUser);
1379
- return /* @__PURE__ */ u(w, {
1380
- children: [n && /* @__PURE__ */ i(ge, {
1381
- className: t,
1382
- children: /* @__PURE__ */ i(On, {
1383
- gamification: e
1384
- })
1385
- }), s && /* @__PURE__ */ i(ge, {
1386
- className: t,
1387
- children: /* @__PURE__ */ u(ji, {
1388
- children: [/* @__PURE__ */ i(De, {
1389
- label: "Friend's Rank",
1390
- close: e.closeUser
1391
- }), /* @__PURE__ */ i(K, {
1392
- children: /* @__PURE__ */ i(Se, {
1393
- ...s,
1394
- successRate: _i(s)
1395
- })
1396
- })]
1397
- })
1398
- }), /* @__PURE__ */ i(Ne, {
1399
- className: t,
1400
- "data-nav": "true",
1401
- children: /* @__PURE__ */ i(Ci, {
1402
- gamification: e
1403
- })
1404
- })]
1405
- });
1406
- };
1407
- export {
1408
- Fi as GamificationOverlay,
1409
- Fi as default
1410
- };