@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
@@ -0,0 +1,1443 @@
1
+ import { jsxs as u, jsx as s, Fragment as E } from "react/jsx-runtime";
2
+ import { s as o, i as j } from "./index3.js";
3
+ import { useStore as w } from "@nanostores/react";
4
+ import { o as Ne, r as te, w as $e, A as Re, O as Qe, c as Ue, a as K, n as _e, d as qe } from "./masters2.js";
5
+ import { useState as R, useCallback as V, useMemo as P, createElement as B, PureComponent as Ae } 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 Te, r as Ye, a as Pe, n as We } from "./common.js";
8
+ import { CountdownCircleTimer as Ve } from "react-countdown-circle-timer";
9
+ import { E as L } from "./index2.js";
10
+ import "@streamlayer/sdk-web-interfaces";
11
+ import "@streamlayer/sdk-web-notifications";
12
+ import "@lottiefiles/react-lottie-player";
13
+ import "./useStreamLayerApp.js";
14
+ import "@streamlayer/sdk-web";
15
+ const Fe = /* @__PURE__ */ o("div")({
16
+ name: "Container",
17
+ class: "c1vwopgc",
18
+ propsAsIs: !1
19
+ }), Be = /* @__PURE__ */ o("div")({
20
+ name: "QuestionTypeWrap",
21
+ class: "qyktpt0",
22
+ propsAsIs: !1
23
+ }), He = () => j, Ze = /* @__PURE__ */ o(He())({
24
+ name: "QuestionTypeIcon",
25
+ class: "q951jdx",
26
+ propsAsIs: !0
27
+ }), Ge = /* @__PURE__ */ o("span")({
28
+ name: "QuestionTypeTitle",
29
+ class: "qss5f0e",
30
+ propsAsIs: !1
31
+ }), Je = /* @__PURE__ */ o("button")({
32
+ name: "CloseButton",
33
+ class: "c1ao1jtv",
34
+ propsAsIs: !1
35
+ }), Ke = () => j, Xe = /* @__PURE__ */ o(Ke())({
36
+ name: "CloseIcon",
37
+ class: "cvsl7l3",
38
+ propsAsIs: !0
39
+ }), De = ({ type: e, close: t, label: n }) => {
40
+ const i = e ? Ne[e] : { label: n, iconName: void 0 };
41
+ return /* @__PURE__ */ u(Fe, { children: [
42
+ /* @__PURE__ */ u(Be, { children: [
43
+ (i == null ? void 0 : i.iconName) && /* @__PURE__ */ s(Ze, { name: i.iconName }),
44
+ (i == null ? void 0 : i.label) && /* @__PURE__ */ s(Ge, { children: i.label })
45
+ ] }),
46
+ /* @__PURE__ */ s(Je, { onClick: t, children: /* @__PURE__ */ s(Xe, { name: "icon-cross" }) })
47
+ ] });
48
+ }, et = /* @__PURE__ */ o("div")({
49
+ name: "Container",
50
+ class: "c1zy8a",
51
+ propsAsIs: !1
52
+ }), tt = /* @__PURE__ */ o("div")({
53
+ name: "Title",
54
+ class: "t1vih9p5",
55
+ propsAsIs: !1
56
+ }), nt = /* @__PURE__ */ o("div")({
57
+ name: "Indicator",
58
+ class: "i1fbnvpb",
59
+ propsAsIs: !1
60
+ }), oe = ({ indicator: e, title: t }) => /* @__PURE__ */ u(et, { children: [
61
+ /* @__PURE__ */ s(tt, { children: t }),
62
+ /* @__PURE__ */ s(nt, { children: e })
63
+ ] }), st = /* @__PURE__ */ o("div")({
64
+ name: "Container",
65
+ class: "ctmhwyc",
66
+ propsAsIs: !1
67
+ }), it = /* @__PURE__ */ o("div")({
68
+ name: "Indicator",
69
+ class: "i1jri200",
70
+ propsAsIs: !1
71
+ }), rt = /* @__PURE__ */ o("div")({
72
+ name: "Title",
73
+ class: "t8s05oq",
74
+ propsAsIs: !1
75
+ }), Y = ({ indicator: e, title: t }) => /* @__PURE__ */ u(st, { children: [
76
+ /* @__PURE__ */ s(it, { children: e }),
77
+ /* @__PURE__ */ s(rt, { children: t })
78
+ ] }), ot = /* @__PURE__ */ o("div")({
79
+ name: "Container",
80
+ class: "c1yrpn9o",
81
+ propsAsIs: !1
82
+ }), at = /* @__PURE__ */ o("div")({
83
+ name: "TopInfo",
84
+ class: "t17fwahh",
85
+ propsAsIs: !1
86
+ }), lt = /* @__PURE__ */ o("div")({
87
+ name: "BottomInfo",
88
+ class: "by6w7e9",
89
+ propsAsIs: !1
90
+ }), ct = /* @__PURE__ */ o("div")({
91
+ name: "User",
92
+ class: "u1g7arbm",
93
+ propsAsIs: !1
94
+ }), dt = /* @__PURE__ */ o("img")({
95
+ name: "Avatar",
96
+ class: "a1ldeata",
97
+ propsAsIs: !1
98
+ }), ut = /* @__PURE__ */ o("div")({
99
+ name: "UserInfo",
100
+ class: "u10d4koz",
101
+ propsAsIs: !1
102
+ }), pt = /* @__PURE__ */ o("div")({
103
+ name: "UserName",
104
+ class: "u1q6roj0",
105
+ propsAsIs: !1
106
+ }), mt = /* @__PURE__ */ o("div")({
107
+ name: "UserRating",
108
+ class: "ui0m425",
109
+ propsAsIs: !1
110
+ }), It = /* @__PURE__ */ o("img")({
111
+ name: "TrophyIcon",
112
+ class: "t1el3mrn",
113
+ propsAsIs: !1
114
+ }), ht = /* @__PURE__ */ o("div")({
115
+ name: "Rts",
116
+ class: "r2vgnxv",
117
+ propsAsIs: !1
118
+ }), ft = /* @__PURE__ */ o("div")({
119
+ name: "RtsIndicator",
120
+ class: "roqn06j",
121
+ propsAsIs: !1
122
+ }), gt = /* @__PURE__ */ o("div")({
123
+ name: "RtsLabel",
124
+ class: "r15adx7c",
125
+ propsAsIs: !1
126
+ }), Mt = /* @__PURE__ */ o("div")({
127
+ name: "Divider",
128
+ class: "dv59lta",
129
+ propsAsIs: !1
130
+ }), vt = /* @__PURE__ */ o("div")({
131
+ name: "Ranks",
132
+ class: "r55lotb",
133
+ propsAsIs: !1
134
+ }), Nt = /* @__PURE__ */ o("div")({
135
+ name: "Statistics",
136
+ class: "s1knfgqt",
137
+ propsAsIs: !1
138
+ }), At = /* @__PURE__ */ o("div")({
139
+ name: "AvatarPlaceholder",
140
+ class: "a1mqo824",
141
+ propsAsIs: !1
142
+ }), yt = /* @__PURE__ */ o("button")({
143
+ name: "UserAccountBtn",
144
+ class: "uxareh6",
145
+ propsAsIs: !1
146
+ }), Tt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", Se = ({
147
+ avatar: e,
148
+ name: t,
149
+ points: n,
150
+ friendsRank: i,
151
+ rank: r,
152
+ streak: I,
153
+ correct: m,
154
+ incorrect: p,
155
+ inTop: d,
156
+ successRate: f
157
+ }) => /* @__PURE__ */ u(ot, { children: [
158
+ /* @__PURE__ */ s(at, { children: /* @__PURE__ */ u(ct, { children: [
159
+ /* @__PURE__ */ u(yt, { children: [
160
+ e && /* @__PURE__ */ s(dt, { alt: "avatar", src: e }),
161
+ !e && /* @__PURE__ */ s(At, { children: ye(t || "") })
162
+ ] }),
163
+ /* @__PURE__ */ u(ut, { children: [
164
+ /* @__PURE__ */ s(pt, { children: t }),
165
+ /* @__PURE__ */ u(mt, { children: [
166
+ /* @__PURE__ */ u(ht, { children: [
167
+ /* @__PURE__ */ s(It, { alt: "rank-icon", src: Tt }),
168
+ /* @__PURE__ */ u(ft, { children: [
169
+ Te(n),
170
+ /* @__PURE__ */ s(gt, { children: "PTS" })
171
+ ] })
172
+ ] }),
173
+ /* @__PURE__ */ s(Mt, {}),
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__ */ s(oe, { indicator: i || 0, title: "Friends rank" }),
185
+ /* @__PURE__ */ s(oe, { indicator: r || 0, title: "Global rank" })
186
+ ] }),
187
+ /* @__PURE__ */ u(Nt, { children: [
188
+ /* @__PURE__ */ s(Y, { indicator: I || 0, title: "Win streak" }),
189
+ /* @__PURE__ */ s(Y, { indicator: m || 0, title: "Correct" }),
190
+ /* @__PURE__ */ s(Y, { indicator: p || 0, title: "Incorrect" }),
191
+ /* @__PURE__ */ s(Y, { indicator: `${f || 0}%`, title: "Succ. rate" })
192
+ ] })
193
+ ] })
194
+ ] }), Dt = /* @__PURE__ */ o("div")({
195
+ name: "Container",
196
+ class: "c38csyt",
197
+ propsAsIs: !1
198
+ }), St = /* @__PURE__ */ o("div")({
199
+ name: "Title",
200
+ class: "ty221rx",
201
+ propsAsIs: !1
202
+ }), zt = /* @__PURE__ */ o("div")({
203
+ name: "Description",
204
+ class: "dlaj9xp",
205
+ propsAsIs: !1
206
+ }), xt = ({ title: e, description: t }) => /* @__PURE__ */ u(Dt, { children: [
207
+ /* @__PURE__ */ s(j, { name: "icon-check-circle" }),
208
+ /* @__PURE__ */ s(St, { children: e }),
209
+ /* @__PURE__ */ s(zt, { children: t })
210
+ ] }), jt = /* @__PURE__ */ o("div")({
211
+ name: "Container",
212
+ class: "c16sbdnm",
213
+ propsAsIs: !1
214
+ }), Ot = () => j, kt = /* @__PURE__ */ o(Ot())({
215
+ name: "IconPrediction",
216
+ class: "ibhorgl",
217
+ propsAsIs: !0
218
+ }), ae = /* @__PURE__ */ o("div")({
219
+ name: "FeedbackIconWrap",
220
+ class: "f1g20ja7",
221
+ propsAsIs: !1
222
+ }), le = /* @__PURE__ */ o("div")({
223
+ name: "FeedbackHeader",
224
+ class: "f455ozj",
225
+ propsAsIs: !1
226
+ }), wt = /* @__PURE__ */ o("span")({
227
+ name: "FeedbackTitle",
228
+ class: "f1913njx",
229
+ propsAsIs: !1
230
+ }), H = /* @__PURE__ */ o("span")({
231
+ name: "FeedbackDescription",
232
+ class: "fzfk69z",
233
+ propsAsIs: !1
234
+ }), Ct = /* @__PURE__ */ o("div")({
235
+ name: "FeedbackText",
236
+ class: "fx87qaj",
237
+ propsAsIs: !1
238
+ }), bt = ({
239
+ feedbackMessages: e,
240
+ questionVotedCorrectly: t,
241
+ questionVoted: n,
242
+ questionType: i,
243
+ hasCorrectAnswer: r,
244
+ questionStatus: I
245
+ }) => {
246
+ const m = n && (i === x.TRIVIA || i === x.PREDICTION);
247
+ if (!m && I !== Q.RESOLVED)
248
+ return null;
249
+ const p = i === x.PREDICTION && !r, d = t ? "correct" : "incorrect", f = t ? e.correctFeedback : e.incorrectFeedback;
250
+ return /* @__PURE__ */ u(jt, { "data-isPrediction": p, children: [
251
+ I === Q.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */ u(E, { children: [
252
+ /* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(j, { name: "questionExpired" }) }),
253
+ /* @__PURE__ */ u("div", { children: [
254
+ /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(H, { children: "Question Expired" }) }),
255
+ /* @__PURE__ */ s(Ct, { 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(E, { children: [
259
+ /* @__PURE__ */ s(kt, { name: "icon-prediction" }),
260
+ /* @__PURE__ */ s(H, { children: "Stay tuned to see if your prediction was correct." })
261
+ ] }),
262
+ m && r && /* @__PURE__ */ u(E, { children: [
263
+ /* @__PURE__ */ s(ae, { "data-feedbackType": d, children: /* @__PURE__ */ s(j, { name: d }) }),
264
+ /* @__PURE__ */ s("div", { children: /* @__PURE__ */ u(le, { children: [
265
+ /* @__PURE__ */ s(wt, { "data-feedbackType": d, children: f == null ? void 0 : f.title }),
266
+ /* @__PURE__ */ s(H, { children: f == null ? void 0 : f.description })
267
+ ] }) })
268
+ ] })
269
+ ] });
270
+ }, Et = /* @__PURE__ */ o("div")({
271
+ name: "Container",
272
+ class: "c14ielyq",
273
+ propsAsIs: !1
274
+ }), Lt = /* @__PURE__ */ o("div")({
275
+ name: "Content",
276
+ class: "c1tlqx57",
277
+ propsAsIs: !1
278
+ }), $t = /* @__PURE__ */ o("div")({
279
+ name: "Title",
280
+ class: "t1hq58md",
281
+ propsAsIs: !1
282
+ }), Rt = /* @__PURE__ */ o("div")({
283
+ name: "Options",
284
+ class: "o1c8nxcx",
285
+ propsAsIs: !1
286
+ }), Qt = /* @__PURE__ */ o("button")({
287
+ name: "ButtonContainer",
288
+ class: "b1b6dl8t",
289
+ propsAsIs: !1
290
+ }), Ut = /* @__PURE__ */ o("div")({
291
+ name: "ButtonPct",
292
+ class: "b4iik8i",
293
+ propsAsIs: !1
294
+ }), _t = /* @__PURE__ */ o("span")({
295
+ name: "ButtonBody",
296
+ class: "b1gq1lnf",
297
+ propsAsIs: !1
298
+ }), qt = /* @__PURE__ */ o("div")({
299
+ name: "IconContainer",
300
+ class: "i1j65z51",
301
+ propsAsIs: !1
302
+ }), Yt = /* @__PURE__ */ o("div")({
303
+ name: "IconWrap",
304
+ class: "i19tpfua",
305
+ propsAsIs: !1
306
+ }), ze = /* @__PURE__ */ o("img")({
307
+ name: "Icon",
308
+ class: "i1tubmma",
309
+ propsAsIs: !1
310
+ }), Pt = () => ze, Wt = /* @__PURE__ */ o(Pt())({
311
+ name: "IconDefault",
312
+ class: "i1grrgwj",
313
+ propsAsIs: !0
314
+ }), Vt = () => ze, Ft = /* @__PURE__ */ o(Vt())({
315
+ name: "IconCircle",
316
+ class: "ibemyq8",
317
+ propsAsIs: !0
318
+ }), Bt = /* @__PURE__ */ o("span")({
319
+ name: "Title",
320
+ class: "t1dceht",
321
+ propsAsIs: !1
322
+ }), Ht = /* @__PURE__ */ o("span")({
323
+ name: "Indicators",
324
+ class: "i116q4vq",
325
+ propsAsIs: !1
326
+ }), Zt = /* @__PURE__ */ o("span")({
327
+ name: "Percentage",
328
+ class: "p17ajcu2",
329
+ propsAsIs: !1
330
+ }), Gt = () => j, Jt = /* @__PURE__ */ o(Gt())({
331
+ name: "CheckIcon",
332
+ class: "cu9kmlb",
333
+ propsAsIs: !0
334
+ }), ce = {
335
+ [b.CENTERED]: (e) => /* @__PURE__ */ s(Wt, { alt: "option-icon", src: e }),
336
+ [b.TRANSPARENT]: (e) => /* @__PURE__ */ s(qt, { children: /* @__PURE__ */ s(Yt, { style: { backgroundImage: `url(${e})` } }) }),
337
+ [b.ROUNDED]: (e) => /* @__PURE__ */ s(Ft, { alt: "option-icon", src: e }),
338
+ [b.NONE]: () => null,
339
+ [b.UNSET]: () => null
340
+ }, Kt = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: i, questionVoted: r }) => {
341
+ if (e === x.POLL && i)
342
+ return "correct";
343
+ if (e === x.PREDICTION) {
344
+ if (t && r)
345
+ return i ? n ? "correct" : "incorrect" : n ? "correct" : "unset";
346
+ if (i)
347
+ return "correct";
348
+ }
349
+ return e === x.TRIVIA && r ? i ? n ? "correct" : "incorrect" : n ? "correct" : "unset" : "unset";
350
+ }, Xt = ({
351
+ questionType: e,
352
+ questionVoted: t,
353
+ correct: n,
354
+ hasCorrectAnswer: i,
355
+ questionStatus: r
356
+ }) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && i || r === Q.RESOLVED && n : !1, en = (e) => {
357
+ var t;
358
+ const {
359
+ // option props
360
+ id: n,
361
+ icon: i,
362
+ text: r,
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: A,
371
+ questionStatus: D,
372
+ isLoading: N,
373
+ questionType: y,
374
+ correct: T,
375
+ hasCorrectAnswer: a
376
+ } = e, l = Kt(e), c = Xt({ questionType: y, questionVoted: d, correct: T, hasCorrectAnswer: a, questionStatus: D }), h = d || D === Q.RESOLVED && y === x.PREDICTION;
377
+ return /* @__PURE__ */ u(
378
+ Qt,
379
+ {
380
+ value: n,
381
+ "data-selected": p,
382
+ "data-answerState": l,
383
+ disabled: d || N || A,
384
+ onClick: m,
385
+ children: [
386
+ h && /* @__PURE__ */ s(Ut, { "data-answerState": l, style: { width: `${I}%` } }),
387
+ /* @__PURE__ */ u(_t, { children: [
388
+ i && ((t = ce[f]) == null ? void 0 : t.call(ce, i)),
389
+ /* @__PURE__ */ s(Bt, { children: r }),
390
+ h && /* @__PURE__ */ u(Ht, { children: [
391
+ c && /* @__PURE__ */ s(Jt, { name: "selected" }),
392
+ /* @__PURE__ */ u(Zt, { children: [
393
+ I,
394
+ "%"
395
+ ] })
396
+ ] })
397
+ ] })
398
+ ]
399
+ }
400
+ );
401
+ }, tn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], nn = [10, 10, 0], sn = /* @__PURE__ */ o("div")({
402
+ name: "RemainingTime",
403
+ class: "r165427",
404
+ propsAsIs: !1
405
+ }), rn = L.SECONDARY_GREEN6, de = L.SECONDARY_RED3, on = L.NEUTRALS_GRAY3, an = ({
406
+ isPlaying: e = !0,
407
+ duration: t = 30,
408
+ onTimerExpired: n
409
+ }) => {
410
+ const [i, r] = R(t > 10 ? rn : de), I = ({
411
+ remainingTime: d
412
+ }) => /* @__PURE__ */ s(sn, {
413
+ children: d
414
+ }), m = V(() => {
415
+ n == null || n(), r(on);
416
+ }, [n, r]), p = V((d) => {
417
+ d === 10 && r(de);
418
+ }, [r]);
419
+ return /* @__PURE__ */ s(Ve, {
420
+ isPlaying: e,
421
+ duration: t,
422
+ colors: tn,
423
+ colorsTime: nn,
424
+ size: 32,
425
+ strokeWidth: 2,
426
+ trailStrokeWidth: 2,
427
+ trailColor: i,
428
+ onComplete: m,
429
+ onUpdate: p,
430
+ children: I
431
+ });
432
+ }, ln = /* @__PURE__ */ o("div")({
433
+ name: "WinBarContainer",
434
+ class: "wie6cqo",
435
+ propsAsIs: !1
436
+ }), cn = /* @__PURE__ */ o("div")({
437
+ name: "Content",
438
+ class: "cgizw4u",
439
+ propsAsIs: !1
440
+ }), dn = /* @__PURE__ */ o("div")({
441
+ name: "Title",
442
+ class: "t1l3ucjp",
443
+ propsAsIs: !1
444
+ }), un = () => j, pn = /* @__PURE__ */ o(un())({
445
+ name: "WinIcon",
446
+ class: "wx7j799",
447
+ propsAsIs: !0
448
+ }), mn = /* @__PURE__ */ o("div")({
449
+ name: "Points",
450
+ class: "p4lwuj0",
451
+ propsAsIs: !1
452
+ }), In = /* @__PURE__ */ o("span")({
453
+ name: "PointsCount",
454
+ class: "po9i64o",
455
+ propsAsIs: !1
456
+ }), hn = /* @__PURE__ */ o("span")({
457
+ name: "PointsUnits",
458
+ class: "pe5g05h",
459
+ propsAsIs: !1
460
+ }), fn = ({ title: e, points: t, isPlayingTimer: n, isTimer: i, onTimerExpired: r }) => /* @__PURE__ */ u(ln, { children: [
461
+ /* @__PURE__ */ u(cn, { children: [
462
+ e && /* @__PURE__ */ s(dn, { children: e }),
463
+ t !== void 0 && /* @__PURE__ */ u(E, { children: [
464
+ /* @__PURE__ */ s(pn, { name: "icon-trophy" }),
465
+ /* @__PURE__ */ u(mn, { children: [
466
+ /* @__PURE__ */ s(In, { children: t }),
467
+ /* @__PURE__ */ s(hn, { children: "PTS" })
468
+ ] })
469
+ ] })
470
+ ] }),
471
+ i && /* @__PURE__ */ s(an, { isPlaying: n, onTimerExpired: r })
472
+ ] }), gn = ({ openedQuestion: e, vote: t, close: n }) => {
473
+ var i;
474
+ const r = e.subject, I = e.type, m = (i = e.options) == null ? void 0 : i.options, [p, d] = R(!1), [f, A] = R(!1), [D, N] = R(""), y = e == null ? void 0 : e.id, T = V(
475
+ async (v) => {
476
+ if (y) {
477
+ const g = v.currentTarget.value;
478
+ N(g), A(!0), await t(y, g), A(!1);
479
+ }
480
+ },
481
+ [y, N, t]
482
+ ), a = V(() => {
483
+ d(!0), setTimeout(n, 3e3);
484
+ }, [n]), l = P(
485
+ () => e == null ? void 0 : e.answers.find((v) => v.youVoted === !0),
486
+ [e]
487
+ ), c = P(
488
+ () => !!(e != null && e.answers.find((v) => v.correct === !0)),
489
+ [e]
490
+ ), h = P(() => 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: T
501
+ })) : [], [c, p, f, e, l, T, D]), M = m && (m.case === "trivia" || m.case === "prediction") ? m.value : void 0;
502
+ return /* @__PURE__ */ s(te, { "data-question-header": "true", children: /* @__PURE__ */ s(Et, { children: /* @__PURE__ */ u(Lt, { children: [
503
+ M && /* @__PURE__ */ s(
504
+ bt,
505
+ {
506
+ feedbackMessages: M,
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__ */ s(
515
+ fn,
516
+ {
517
+ title: p ? "Time expired" : "To win",
518
+ points: p ? void 0 : 100,
519
+ onTimerExpired: a,
520
+ isTimer: !0
521
+ }
522
+ ),
523
+ p ? /* @__PURE__ */ s(
524
+ xt,
525
+ {
526
+ title: "More to come...",
527
+ description: "Watch for additional enhanced stream interactive experience."
528
+ }
529
+ ) : /* @__PURE__ */ u(E, { children: [
530
+ /* @__PURE__ */ s($t, { children: r }),
531
+ /* @__PURE__ */ s(Rt, { children: h.map((v) => /* @__PURE__ */ s(en, { ...v }, v.id)) })
532
+ ] })
533
+ ] }) }) });
534
+ }, Mn = /* @__PURE__ */ o("div")({
535
+ name: "Container",
536
+ class: "cgn5uen",
537
+ propsAsIs: !1
538
+ }), vn = /* @__PURE__ */ o("div")({
539
+ name: "Content",
540
+ class: "c1px8nt6",
541
+ propsAsIs: !1
542
+ }), Nn = /* @__PURE__ */ o("h3")({
543
+ name: "Title",
544
+ class: "t5et2jt",
545
+ propsAsIs: !1
546
+ }), An = /* @__PURE__ */ o("div")({
547
+ name: "Description",
548
+ class: "d1i2kpk2",
549
+ propsAsIs: !1
550
+ }), yn = /* @__PURE__ */ o("div")({
551
+ name: "DateWrap",
552
+ class: "dd3lh3p",
553
+ propsAsIs: !1
554
+ }), xe = ({ created: e, title: t, instantView: n }) => {
555
+ const i = P(() => {
556
+ if (e) {
557
+ const r = new Date(e);
558
+ if (Ye(r))
559
+ return {
560
+ date: Pe(r),
561
+ time: We(r)
562
+ };
563
+ }
564
+ return null;
565
+ }, [e]);
566
+ return /* @__PURE__ */ u(Mn, { children: [
567
+ i && /* @__PURE__ */ u(yn, { children: [
568
+ i.date,
569
+ " · ",
570
+ i.time
571
+ ] }),
572
+ (n == null ? void 0 : n.video) && /* @__PURE__ */ s($e, { source: n.video.url, poster: n.video.thumbnailUrl }),
573
+ /* @__PURE__ */ u(vn, { children: [
574
+ /* @__PURE__ */ s(Nn, { children: (n == null ? void 0 : n.heading) || t }),
575
+ /* @__PURE__ */ s(An, { children: n == null ? void 0 : n.body })
576
+ ] })
577
+ ] });
578
+ }, Tn = /* @__PURE__ */ o("div")({
579
+ name: "Container",
580
+ class: "c1euiow",
581
+ propsAsIs: !1
582
+ }), Dn = /* @__PURE__ */ o("a")({
583
+ name: "WebLinkBtn",
584
+ class: "w19zie3h",
585
+ propsAsIs: !1
586
+ }), Sn = ({ instantView: e, ...t }) => /* @__PURE__ */ u(Tn, { children: [
587
+ /* @__PURE__ */ s(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__ */ s(j, { name: "icon-external-link" })
591
+ ] })
592
+ ] }), zn = /* @__PURE__ */ o("div")({
593
+ name: "QuestionContainer",
594
+ class: "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__ */ s(Sn, {
601
+ created: e.attributes.created,
602
+ ...e.attributes.attributes.value
603
+ }) : null;
604
+ }, jn = ({
605
+ extendedQuestion: e,
606
+ vote: t,
607
+ close: n
608
+ }) => {
609
+ const {
610
+ loading: i,
611
+ data: r
612
+ } = e;
613
+ return !i && r ? /* @__PURE__ */ s(gn, {
614
+ vote: t,
615
+ close: n,
616
+ openedQuestion: r
617
+ }) : null;
618
+ }, On = ({
619
+ gamification: e
620
+ }) => {
621
+ var t;
622
+ const n = w(e.openedQuestion.$store), i = w(e.openedQuestion.$extendedStore);
623
+ if (!n)
624
+ return null;
625
+ const r = n.type;
626
+ return /* @__PURE__ */ u(zn, {
627
+ children: [/* @__PURE__ */ s(De, {
628
+ close: e.closeQuestion,
629
+ type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
630
+ }), r === "question" && /* @__PURE__ */ s(jn, {
631
+ vote: e.submitAnswer,
632
+ close: e.closeQuestion,
633
+ extendedQuestion: i
634
+ }), r !== "question" && /* @__PURE__ */ s(xn, {
635
+ openedQuestion: n
636
+ })]
637
+ });
638
+ }, kn = /* @__PURE__ */ o("div")({
639
+ name: "Container",
640
+ class: "c115qtkr",
641
+ propsAsIs: !1
642
+ }), wn = /* @__PURE__ */ o("div")({
643
+ name: "STabs",
644
+ class: "sxnslc8",
645
+ propsAsIs: !1
646
+ }), Cn = /* @__PURE__ */ o("button")({
647
+ name: "Button",
648
+ class: "b1umzux0",
649
+ propsAsIs: !1
650
+ }), bn = /* @__PURE__ */ o("span")({
651
+ name: "Title",
652
+ class: "tspsaas",
653
+ propsAsIs: !1
654
+ });
655
+ var W = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(W || {});
656
+ const ue = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ s(Cn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ s(bn, { children: e }) }), En = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ s(kn, { children: /* @__PURE__ */ u(wn, { "data-position": e === "home" ? "left" : "right", children: [
657
+ /* @__PURE__ */ s(ue, { title: "Home", active: e === "home", onClick: () => t(
658
+ "home"
659
+ /* HOME */
660
+ ) }),
661
+ /* @__PURE__ */ s(
662
+ ue,
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 i in n)
678
+ Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
679
+ }
680
+ return e;
681
+ }, X.apply(this, arguments);
682
+ }
683
+ function pe(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(i, r) {
690
+ return i.__proto__ = r, i;
691
+ }, ee(e, t);
692
+ }
693
+ function Ln(e, t) {
694
+ e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ee(e, t);
695
+ }
696
+ var me = Number.isNaN || function(t) {
697
+ return typeof t == "number" && t !== t;
698
+ };
699
+ function $n(e, t) {
700
+ return !!(e === t || me(e) && me(t));
701
+ }
702
+ function Rn(e, t) {
703
+ if (e.length !== t.length)
704
+ return !1;
705
+ for (var n = 0; n < e.length; n++)
706
+ if (!$n(e[n], t[n]))
707
+ return !1;
708
+ return !0;
709
+ }
710
+ function Z(e, t) {
711
+ t === void 0 && (t = Rn);
712
+ var n, i = [], r, 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, i) || (r = e.apply(this, p), I = !0, n = this, i = p), r;
717
+ }
718
+ return m;
719
+ }
720
+ var Qn = typeof performance == "object" && typeof performance.now == "function", Ie = Qn ? function() {
721
+ return performance.now();
722
+ } : function() {
723
+ return Date.now();
724
+ };
725
+ function he(e) {
726
+ cancelAnimationFrame(e.id);
727
+ }
728
+ function Un(e, t) {
729
+ var n = Ie();
730
+ function i() {
731
+ Ie() - n >= t ? e.call(null) : r.id = requestAnimationFrame(i);
732
+ }
733
+ var r = {
734
+ id: requestAnimationFrame(i)
735
+ };
736
+ return r;
737
+ }
738
+ var G = -1;
739
+ function fe(e) {
740
+ if (e === void 0 && (e = !1), G === -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), G = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
743
+ }
744
+ return G;
745
+ }
746
+ var C = null;
747
+ function ge(e) {
748
+ if (e === void 0 && (e = !1), C === 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 i = document.createElement("div"), r = i.style;
752
+ return r.width = "100px", r.height = "100px", t.appendChild(i), document.body.appendChild(t), t.scrollLeft > 0 ? C = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? C = "negative" : C = "positive-ascending"), document.body.removeChild(t), C;
753
+ }
754
+ return C;
755
+ }
756
+ var _n = 150, qn = function(t, n) {
757
+ return t;
758
+ };
759
+ function Yn(e) {
760
+ var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, I = e.getOffsetForIndexAndAlignment, m = e.getStartIndexForOffset, p = e.getStopIndexForStartIndex, d = e.initInstanceProps, f = e.shouldResetStyleCacheOnItemSizeChange, A = e.validateProps;
761
+ return t = /* @__PURE__ */ function(D) {
762
+ Ln(N, D);
763
+ function N(T) {
764
+ var a;
765
+ return a = D.call(this, T) || this, a._instanceProps = d(a.props, pe(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
766
+ instance: pe(a),
767
+ isScrolling: !1,
768
+ scrollDirection: "forward",
769
+ scrollOffset: typeof a.props.initialScrollOffset == "number" ? a.props.initialScrollOffset : 0,
770
+ scrollUpdateWasRequested: !1
771
+ }, a._callOnItemsRendered = void 0, a._callOnItemsRendered = Z(function(l, c, h, M) {
772
+ return a.props.onItemsRendered({
773
+ overscanStartIndex: l,
774
+ overscanStopIndex: c,
775
+ visibleStartIndex: h,
776
+ visibleStopIndex: M
777
+ });
778
+ }), a._callOnScroll = void 0, a._callOnScroll = Z(function(l, c, h) {
779
+ return a.props.onScroll({
780
+ scrollDirection: l,
781
+ scrollOffset: c,
782
+ scrollUpdateWasRequested: h
783
+ });
784
+ }), a._getItemStyle = void 0, a._getItemStyle = function(l) {
785
+ var c = a.props, h = c.direction, M = c.itemSize, v = c.layout, g = a._getItemStyleCache(f && M, f && v, f && h), S;
786
+ if (g.hasOwnProperty(l))
787
+ S = g[l];
788
+ else {
789
+ var z = n(a.props, l, a._instanceProps), O = r(a.props, l, a._instanceProps), k = h === "horizontal" || v === "horizontal", U = h === "rtl", _ = k ? z : 0;
790
+ g[l] = S = {
791
+ position: "absolute",
792
+ left: U ? void 0 : _,
793
+ right: U ? _ : void 0,
794
+ top: k ? 0 : z,
795
+ height: k ? "100%" : O,
796
+ width: k ? O : "100%"
797
+ };
798
+ }
799
+ return S;
800
+ }, a._getItemStyleCache = void 0, a._getItemStyleCache = Z(function(l, c, h) {
801
+ return {};
802
+ }), a._onScrollHorizontal = function(l) {
803
+ var c = l.currentTarget, h = c.clientWidth, M = c.scrollLeft, v = c.scrollWidth;
804
+ a.setState(function(g) {
805
+ if (g.scrollOffset === M)
806
+ return null;
807
+ var S = a.props.direction, z = M;
808
+ if (S === "rtl")
809
+ switch (ge()) {
810
+ case "negative":
811
+ z = -M;
812
+ break;
813
+ case "positive-descending":
814
+ z = v - h - M;
815
+ break;
816
+ }
817
+ return z = Math.max(0, Math.min(z, v - h)), {
818
+ isScrolling: !0,
819
+ scrollDirection: g.scrollOffset < M ? "forward" : "backward",
820
+ scrollOffset: z,
821
+ scrollUpdateWasRequested: !1
822
+ };
823
+ }, a._resetIsScrollingDebounced);
824
+ }, a._onScrollVertical = function(l) {
825
+ var c = l.currentTarget, h = c.clientHeight, M = c.scrollHeight, v = c.scrollTop;
826
+ a.setState(function(g) {
827
+ if (g.scrollOffset === v)
828
+ return null;
829
+ var S = Math.max(0, Math.min(v, M - h));
830
+ return {
831
+ isScrolling: !0,
832
+ scrollDirection: g.scrollOffset < S ? "forward" : "backward",
833
+ scrollOffset: S,
834
+ scrollUpdateWasRequested: !1
835
+ };
836
+ }, a._resetIsScrollingDebounced);
837
+ }, a._outerRefSetter = function(l) {
838
+ var c = a.props.outerRef;
839
+ a._outerRef = l, typeof c == "function" ? c(l) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = l);
840
+ }, a._resetIsScrollingDebounced = function() {
841
+ a._resetIsScrollingTimeoutId !== null && he(a._resetIsScrollingTimeoutId), a._resetIsScrollingTimeoutId = Un(a._resetIsScrolling, _n);
842
+ }, a._resetIsScrolling = function() {
843
+ a._resetIsScrollingTimeoutId = null, a.setState({
844
+ isScrolling: !1
845
+ }, function() {
846
+ a._getItemStyleCache(-1, null);
847
+ });
848
+ }, a;
849
+ }
850
+ N.getDerivedStateFromProps = function(a, l) {
851
+ return Pn(a, l), A(a), null;
852
+ };
853
+ var y = N.prototype;
854
+ return y.scrollTo = function(a) {
855
+ a = Math.max(0, a), this.setState(function(l) {
856
+ return l.scrollOffset === a ? null : {
857
+ scrollDirection: l.scrollOffset < a ? "forward" : "backward",
858
+ scrollOffset: a,
859
+ scrollUpdateWasRequested: !0
860
+ };
861
+ }, this._resetIsScrollingDebounced);
862
+ }, y.scrollToItem = function(a, l) {
863
+ l === void 0 && (l = "auto");
864
+ var c = this.props, h = c.itemCount, M = c.layout, v = this.state.scrollOffset;
865
+ a = Math.max(0, Math.min(a, h - 1));
866
+ var g = 0;
867
+ if (this._outerRef) {
868
+ var S = this._outerRef;
869
+ M === "vertical" ? g = S.scrollWidth > S.clientWidth ? fe() : 0 : g = S.scrollHeight > S.clientHeight ? fe() : 0;
870
+ }
871
+ this.scrollTo(I(this.props, a, l, v, this._instanceProps, g));
872
+ }, y.componentDidMount = function() {
873
+ var a = this.props, l = a.direction, c = a.initialScrollOffset, h = a.layout;
874
+ if (typeof c == "number" && this._outerRef != null) {
875
+ var M = this._outerRef;
876
+ l === "horizontal" || h === "horizontal" ? M.scrollLeft = c : M.scrollTop = c;
877
+ }
878
+ this._callPropsCallbacks();
879
+ }, y.componentDidUpdate = function() {
880
+ var a = this.props, l = a.direction, c = a.layout, h = this.state, M = h.scrollOffset, v = h.scrollUpdateWasRequested;
881
+ if (v && this._outerRef != null) {
882
+ var g = this._outerRef;
883
+ if (l === "horizontal" || c === "horizontal")
884
+ if (l === "rtl")
885
+ switch (ge()) {
886
+ case "negative":
887
+ g.scrollLeft = -M;
888
+ break;
889
+ case "positive-ascending":
890
+ g.scrollLeft = M;
891
+ break;
892
+ default:
893
+ var S = g.clientWidth, z = g.scrollWidth;
894
+ g.scrollLeft = z - S - M;
895
+ break;
896
+ }
897
+ else
898
+ g.scrollLeft = M;
899
+ else
900
+ g.scrollTop = M;
901
+ }
902
+ this._callPropsCallbacks();
903
+ }, y.componentWillUnmount = function() {
904
+ this._resetIsScrollingTimeoutId !== null && he(this._resetIsScrollingTimeoutId);
905
+ }, y.render = function() {
906
+ var a = this.props, l = a.children, c = a.className, h = a.direction, M = a.height, v = a.innerRef, g = a.innerElementType, S = a.innerTagName, z = a.itemCount, O = a.itemData, k = a.itemKey, U = k === void 0 ? qn : k, _ = a.layout, je = a.outerElementType, Oe = a.outerTagName, ke = a.style, we = a.useIsScrolling, Ce = a.width, ne = this.state.isScrolling, F = h === "horizontal" || _ === "horizontal", be = F ? this._onScrollHorizontal : this._onScrollVertical, se = this._getRangeToRender(), Ee = se[0], Le = se[1], ie = [];
907
+ if (z > 0)
908
+ for (var $ = Ee; $ <= Le; $++)
909
+ ie.push(B(l, {
910
+ data: O,
911
+ key: U($, O),
912
+ index: $,
913
+ isScrolling: we ? ne : void 0,
914
+ style: this._getItemStyle($)
915
+ }));
916
+ var re = i(this.props, this._instanceProps);
917
+ return B(je || Oe || "div", {
918
+ className: c,
919
+ onScroll: be,
920
+ ref: this._outerRefSetter,
921
+ style: X({
922
+ position: "relative",
923
+ height: M,
924
+ width: Ce,
925
+ overflow: "auto",
926
+ WebkitOverflowScrolling: "touch",
927
+ willChange: "transform",
928
+ direction: h
929
+ }, ke)
930
+ }, B(g || S || "div", {
931
+ children: ie,
932
+ ref: v,
933
+ style: {
934
+ height: F ? "100%" : re,
935
+ pointerEvents: ne ? "none" : void 0,
936
+ width: F ? re : "100%"
937
+ }
938
+ }));
939
+ }, y._callPropsCallbacks = function() {
940
+ if (typeof this.props.onItemsRendered == "function") {
941
+ var a = this.props.itemCount;
942
+ if (a > 0) {
943
+ var l = this._getRangeToRender(), c = l[0], h = l[1], M = l[2], v = l[3];
944
+ this._callOnItemsRendered(c, h, M, v);
945
+ }
946
+ }
947
+ if (typeof this.props.onScroll == "function") {
948
+ var g = this.state, S = g.scrollDirection, z = g.scrollOffset, O = g.scrollUpdateWasRequested;
949
+ this._callOnScroll(S, z, O);
950
+ }
951
+ }, y._getRangeToRender = function() {
952
+ var a = this.props, l = a.itemCount, c = a.overscanCount, h = this.state, M = h.isScrolling, v = h.scrollDirection, g = h.scrollOffset;
953
+ if (l === 0)
954
+ return [0, 0, 0, 0];
955
+ var S = m(this.props, g, this._instanceProps), z = p(this.props, S, g, this._instanceProps), O = !M || v === "backward" ? Math.max(1, c) : 1, k = !M || v === "forward" ? Math.max(1, c) : 1;
956
+ return [Math.max(0, S - O), Math.max(0, Math.min(l - 1, z + k)), S, z];
957
+ }, N;
958
+ }(Ae), t.defaultProps = {
959
+ direction: "ltr",
960
+ itemData: void 0,
961
+ layout: "vertical",
962
+ overscanCount: 2,
963
+ useIsScrolling: !1
964
+ }, t;
965
+ }
966
+ var Pn = function(t, n) {
967
+ t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
968
+ }, Wn = /* @__PURE__ */ Yn({
969
+ getItemOffset: function(t, n) {
970
+ var i = t.itemSize;
971
+ return n * i;
972
+ },
973
+ getItemSize: function(t, n) {
974
+ var i = t.itemSize;
975
+ return i;
976
+ },
977
+ getEstimatedTotalSize: function(t) {
978
+ var n = t.itemCount, i = t.itemSize;
979
+ return i * n;
980
+ },
981
+ getOffsetForIndexAndAlignment: function(t, n, i, r, I, m) {
982
+ var p = t.direction, d = t.height, f = t.itemCount, A = t.itemSize, D = t.layout, N = t.width, y = p === "horizontal" || D === "horizontal", T = y ? N : d, a = Math.max(0, f * A - T), l = Math.min(a, n * A), c = Math.max(0, n * A - T + A + m);
983
+ switch (i === "smart" && (r >= c - T && r <= l + T ? i = "auto" : i = "center"), i) {
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(T / 2) ? 0 : h > a + Math.floor(T / 2) ? a : h;
991
+ }
992
+ case "auto":
993
+ default:
994
+ return r >= c && r <= l ? r : r < c ? c : l;
995
+ }
996
+ },
997
+ getStartIndexForOffset: function(t, n) {
998
+ var i = t.itemCount, r = t.itemSize;
999
+ return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
1000
+ },
1001
+ getStopIndexForStartIndex: function(t, n, i) {
1002
+ var r = t.direction, I = t.height, m = t.itemCount, p = t.itemSize, d = t.layout, f = t.width, A = r === "horizontal" || d === "horizontal", D = n * p, N = A ? f : I, y = Math.ceil((N + i - 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 Vn(e) {
1017
+ var t = e.lastRenderedStartIndex, n = e.lastRenderedStopIndex, i = e.startIndex, r = e.stopIndex;
1018
+ return !(i > n || r < t);
1019
+ }
1020
+ function Fn(e) {
1021
+ for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, I = e.stopIndex, m = [], p = null, d = null, f = r; f <= I; f++) {
1022
+ var A = t(f);
1023
+ A ? 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 + i - 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 < i && 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 Bn = 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 i = 0; i < n.length; i++) {
1046
+ var r = n[i];
1047
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r);
1048
+ }
1049
+ }
1050
+ return function(t, n, i) {
1051
+ return n && e(t.prototype, n), i && e(t, i), t;
1052
+ };
1053
+ }(), Zn = 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
+ }, Gn = function(e) {
1069
+ Zn(t, e);
1070
+ function t() {
1071
+ var n, i, r, I;
1072
+ Bn(this, t);
1073
+ for (var m = arguments.length, p = Array(m), d = 0; d < m; d++)
1074
+ p[d] = arguments[d];
1075
+ return I = (i = (r = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(p))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(f) {
1076
+ var A = f.visibleStartIndex, D = f.visibleStopIndex;
1077
+ r._lastRenderedStartIndex = A, r._lastRenderedStopIndex = D, r._ensureRowsLoaded(A, D);
1078
+ }, r._setRef = function(f) {
1079
+ r._listRef = f;
1080
+ }, i), Me(r, I);
1081
+ }
1082
+ return Hn(t, [{
1083
+ key: "resetloadMoreItemsCache",
1084
+ value: function() {
1085
+ var i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1086
+ this._memoizedUnloadedRanges = [], i && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
1087
+ }
1088
+ }, {
1089
+ key: "componentDidMount",
1090
+ value: function() {
1091
+ }
1092
+ }, {
1093
+ key: "render",
1094
+ value: function() {
1095
+ var i = this.props.children;
1096
+ return i({
1097
+ onItemsRendered: this._onItemsRendered,
1098
+ ref: this._setRef
1099
+ });
1100
+ }
1101
+ }, {
1102
+ key: "_ensureRowsLoaded",
1103
+ value: function(i, r) {
1104
+ var I = this.props, m = I.isItemLoaded, p = I.itemCount, d = I.minimumBatchSize, f = d === void 0 ? 10 : d, A = I.threshold, D = A === void 0 ? 15 : A, N = Fn({
1105
+ isItemLoaded: m,
1106
+ itemCount: p,
1107
+ minimumBatchSize: f,
1108
+ startIndex: Math.max(0, i - D),
1109
+ stopIndex: Math.min(p - 1, r + D)
1110
+ });
1111
+ (this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(y, T) {
1112
+ return N[T] !== y;
1113
+ })) && (this._memoizedUnloadedRanges = N, this._loadUnloadedRanges(N));
1114
+ }
1115
+ }, {
1116
+ key: "_loadUnloadedRanges",
1117
+ value: function(i) {
1118
+ for (var r = this, I = this.props.loadMoreItems || this.props.loadMoreRows, m = function(f) {
1119
+ var A = i[f], D = i[f + 1], N = I(A, D);
1120
+ N != null && N.then(function() {
1121
+ if (Vn({
1122
+ lastRenderedStartIndex: r._lastRenderedStartIndex,
1123
+ lastRenderedStopIndex: r._lastRenderedStopIndex,
1124
+ startIndex: A,
1125
+ stopIndex: D
1126
+ })) {
1127
+ if (r._listRef == null)
1128
+ return;
1129
+ typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(A, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
1130
+ }
1131
+ });
1132
+ }, p = 0; p < i.length; p += 2)
1133
+ m(p);
1134
+ }
1135
+ }]), t;
1136
+ }(Ae);
1137
+ const Jn = /* @__PURE__ */ o("div")({
1138
+ name: "Container",
1139
+ class: "culdu4a",
1140
+ propsAsIs: !1
1141
+ }), Kn = /* @__PURE__ */ o("div")({
1142
+ name: "Position",
1143
+ class: "pwf8e69",
1144
+ propsAsIs: !1
1145
+ }), Xn = /* @__PURE__ */ o("img")({
1146
+ name: "Avatar",
1147
+ class: "atf4yh4",
1148
+ propsAsIs: !1
1149
+ }), es = /* @__PURE__ */ o("div")({
1150
+ name: "AvatarPlaceholder",
1151
+ class: "a1dg29ja",
1152
+ propsAsIs: !1
1153
+ }), ts = /* @__PURE__ */ o("div")({
1154
+ name: "Content",
1155
+ class: "c10a68rc",
1156
+ propsAsIs: !1
1157
+ }), ns = /* @__PURE__ */ o("div")({
1158
+ name: "NameContainer",
1159
+ class: "nc4kck5",
1160
+ propsAsIs: !1
1161
+ }), ss = /* @__PURE__ */ o("span")({
1162
+ name: "Name",
1163
+ class: "njsrqgr",
1164
+ propsAsIs: !1
1165
+ }), is = () => j, rs = /* @__PURE__ */ o(is())({
1166
+ name: "CurrentUserBadge",
1167
+ class: "c17uc4zr",
1168
+ propsAsIs: !0
1169
+ }), os = ({
1170
+ rank: e,
1171
+ avatar: t,
1172
+ name: n,
1173
+ points: i,
1174
+ isCurrentUser: r,
1175
+ openItemDetail: I,
1176
+ style: m
1177
+ }) => /* @__PURE__ */ u(Jn, { onClick: I, style: m, children: [
1178
+ /* @__PURE__ */ s(Kn, { children: e || 0 }),
1179
+ /* @__PURE__ */ u(ts, { children: [
1180
+ t ? /* @__PURE__ */ s(Xn, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(es, { children: ye(n || "") }),
1181
+ /* @__PURE__ */ u(ns, { children: [
1182
+ /* @__PURE__ */ s(ss, { children: n || "" }),
1183
+ r && /* @__PURE__ */ s(rs, { name: "icon-star" })
1184
+ ] })
1185
+ ] }),
1186
+ /* @__PURE__ */ s("div", { children: Te(i) })
1187
+ ] }), as = /* @__PURE__ */ o("div")({
1188
+ name: "ScrollContainer",
1189
+ class: "s13d8sg6",
1190
+ propsAsIs: !1
1191
+ }), ls = ({
1192
+ items: e,
1193
+ currentUserId: t,
1194
+ openItemDetail: n,
1195
+ fetchMore: i
1196
+ }) => /* @__PURE__ */ s(Re, { children: ({ width: r, height: I }) => /* @__PURE__ */ s(
1197
+ Gn,
1198
+ {
1199
+ isItemLoaded: (m) => m < e.length,
1200
+ itemCount: e.length + 1,
1201
+ loadMoreItems: i,
1202
+ children: ({ onItemsRendered: m, ref: p }) => /* @__PURE__ */ s(as, { children: /* @__PURE__ */ s(
1203
+ Wn,
1204
+ {
1205
+ itemSize: 56,
1206
+ onItemsRendered: m,
1207
+ ref: p,
1208
+ itemCount: e.length,
1209
+ width: r,
1210
+ height: I,
1211
+ children: ({ index: d, style: f }) => /* @__PURE__ */ s(
1212
+ os,
1213
+ {
1214
+ style: { ...f, maxHeight: 48 },
1215
+ ...e[d],
1216
+ openItemDetail: () => n(e[d].userId),
1217
+ isCurrentUser: !!t && t === e[d].userId
1218
+ },
1219
+ e[d].userId
1220
+ )
1221
+ }
1222
+ ) })
1223
+ }
1224
+ ) }), cs = ({ deepLink: e }) => {
1225
+ const { data: t } = w(e.$store);
1226
+ return /* @__PURE__ */ s(
1227
+ Qe,
1228
+ {
1229
+ inviteLink: t == null ? void 0 : t.url,
1230
+ socialLinks: [
1231
+ {
1232
+ icon: "icon-facebook",
1233
+ link: "https://www.facebook.com/TheMasters",
1234
+ label: "Facebook"
1235
+ },
1236
+ {
1237
+ icon: "icon-twitter",
1238
+ link: "https://twitter.com/@TheMasters",
1239
+ label: "X"
1240
+ }
1241
+ ],
1242
+ inviteCardTitle: "It’s more fun with friends",
1243
+ inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
1244
+ }
1245
+ );
1246
+ }, ds = ({ gamification: e }) => {
1247
+ const { data: t } = w(e.leaderboardList.$store);
1248
+ return t != null && t.length ? /* @__PURE__ */ s(
1249
+ ls,
1250
+ {
1251
+ fetchMore: e.leaderboardList.fetchMore,
1252
+ items: t,
1253
+ openItemDetail: e.openUser,
1254
+ currentUserId: e.currentUserId.get()
1255
+ }
1256
+ ) : /* @__PURE__ */ s(cs, { deepLink: e.deepLink });
1257
+ }, us = /* @__PURE__ */ o("div")({
1258
+ name: "QuestionItem",
1259
+ class: "q1w97g3p",
1260
+ propsAsIs: !1
1261
+ }), ps = /* @__PURE__ */ o("div")({
1262
+ name: "QuestionCaption",
1263
+ class: "q2sl39u",
1264
+ propsAsIs: !1
1265
+ }), ms = /* @__PURE__ */ o("div")({
1266
+ name: "QuestionBody",
1267
+ class: "qd5h0uc",
1268
+ propsAsIs: !1
1269
+ }), Is = /* @__PURE__ */ o("div")({
1270
+ name: "QuestionAction",
1271
+ class: "q105uluy",
1272
+ propsAsIs: !1
1273
+ }), hs = () => j, J = /* @__PURE__ */ o(hs())({
1274
+ name: "QuestionActionIcon",
1275
+ class: "q1fa0b9h",
1276
+ propsAsIs: !0
1277
+ }), fs = () => j, gs = /* @__PURE__ */ o(fs())({
1278
+ name: "QuestionTypeIcon",
1279
+ class: "qxlt78s",
1280
+ propsAsIs: !0
1281
+ }), Ms = /* @__PURE__ */ o("div")({
1282
+ name: "QuestionTypeLabel",
1283
+ class: "qmg0vkx",
1284
+ propsAsIs: !1
1285
+ }), vs = /* @__PURE__ */ o("div")({
1286
+ name: "QuestionContent",
1287
+ class: "q1uz5j1g",
1288
+ propsAsIs: !1
1289
+ }), Ns = {
1290
+ [q.LOST]: /* @__PURE__ */ s(J, { name: "icon-cross" }),
1291
+ [q.WON]: /* @__PURE__ */ s(J, { name: "icon-check" }),
1292
+ [q.UNSET]: void 0,
1293
+ [q.DNP]: /* @__PURE__ */ s(J, { name: "icon-arrow" })
1294
+ }, As = ({
1295
+ questionId: e,
1296
+ questionType: t,
1297
+ questionStatus: n,
1298
+ subject: i,
1299
+ openForVoting: r,
1300
+ openQuestion: I,
1301
+ status: m
1302
+ }) => {
1303
+ const p = Ne[t], d = Ns[m];
1304
+ return p ? /* @__PURE__ */ u(us, { onClick: () => I == null ? void 0 : I(e), children: [
1305
+ /* @__PURE__ */ u(vs, { children: [
1306
+ /* @__PURE__ */ u(ps, { children: [
1307
+ /* @__PURE__ */ s(gs, { name: p.iconName }),
1308
+ /* @__PURE__ */ u(Ms, { children: [
1309
+ p.label,
1310
+ t === x.TRIVIA && n === Q.RESOLVED && " • Expired"
1311
+ ] })
1312
+ ] }),
1313
+ /* @__PURE__ */ s(ms, { children: i || "" })
1314
+ ] }),
1315
+ /* @__PURE__ */ s(Is, { children: d || (r ? /* @__PURE__ */ s(Ue, { children: "Play" }) : null) })
1316
+ ] }) : null;
1317
+ }, ys = /* @__PURE__ */ o("div")({
1318
+ name: "Container",
1319
+ class: "cll3md7",
1320
+ propsAsIs: !1
1321
+ }), Ts = /* @__PURE__ */ o("button")({
1322
+ name: "ActionBtn",
1323
+ class: "a10g1iik",
1324
+ propsAsIs: !1
1325
+ }), Ds = ({
1326
+ openInsight: e,
1327
+ questionId: t,
1328
+ ...n
1329
+ }) => /* @__PURE__ */ u(ys, { children: [
1330
+ /* @__PURE__ */ s(xe, { questionId: t, ...n }),
1331
+ e && /* @__PURE__ */ s(Ts, { onClick: () => e(t), children: "View Insight" })
1332
+ ] }), Ss = /* @__PURE__ */ o("div")({
1333
+ name: "QuestionsContainer",
1334
+ class: "qvghv3l",
1335
+ propsAsIs: !1
1336
+ }), zs = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(Ss, { children: e == null ? void 0 : e.map((n) => {
1337
+ var i, r;
1338
+ if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
1339
+ const I = n.attributes.attributes.value;
1340
+ return /* @__PURE__ */ s(As, { openQuestion: t, ...I }, I.questionId);
1341
+ }
1342
+ if (n.type === "insight" && ((r = n.attributes) == null ? void 0 : r.attributes.case) === "insight") {
1343
+ const I = n.attributes.attributes.value;
1344
+ return /* @__PURE__ */ s(Ds, { openInsight: t, ...I }, I.questionId);
1345
+ }
1346
+ return null;
1347
+ }) }), xs = ({ store: e, openQuestion: t }) => {
1348
+ const n = w(e);
1349
+ return n != null && n.data ? /* @__PURE__ */ s(zs, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ s("div", { children: "wait questions..." });
1350
+ }, js = ({ userSummary: e }) => {
1351
+ var t, n;
1352
+ const i = w(e.getStore());
1353
+ return (t = i.data) != null && t.summary ? /* @__PURE__ */ s(Se, { ...i.data.summary, successRate: (n = i.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ s("div", { children: "wait user..." });
1354
+ }, Os = ({
1355
+ gamification: e
1356
+ }) => {
1357
+ const [t, n] = R(W.HOME);
1358
+ return /* @__PURE__ */ u("div", {
1359
+ style: {
1360
+ height: "100%",
1361
+ display: "flex",
1362
+ flexDirection: "column",
1363
+ overflow: "hidden"
1364
+ },
1365
+ children: [/* @__PURE__ */ s(K, {
1366
+ style: {
1367
+ paddingBottom: "4px"
1368
+ },
1369
+ children: /* @__PURE__ */ s(En, {
1370
+ activePage: t,
1371
+ toggleActivePage: n
1372
+ })
1373
+ }), t === W.HOME && /* @__PURE__ */ u(te, {
1374
+ children: [/* @__PURE__ */ s(K, {
1375
+ style: {
1376
+ paddingTop: "12px"
1377
+ },
1378
+ children: /* @__PURE__ */ s(js, {
1379
+ userSummary: e.userSummary
1380
+ })
1381
+ }), /* @__PURE__ */ s(_e, {
1382
+ children: /* @__PURE__ */ s(xs, {
1383
+ openQuestion: e.openQuestion,
1384
+ store: e.feedList.getStore()
1385
+ })
1386
+ })]
1387
+ }), t === W.LEADERBOARD && /* @__PURE__ */ s("div", {
1388
+ className: "c1bp9dj2",
1389
+ children: /* @__PURE__ */ s(ds, {
1390
+ gamification: e
1391
+ })
1392
+ })]
1393
+ });
1394
+ }, ks = () => qe, ve = /* @__PURE__ */ o(ks())({
1395
+ name: "OpenedContainer",
1396
+ class: "oar61gl",
1397
+ propsAsIs: !0
1398
+ }), ws = /* @__PURE__ */ o("div")({
1399
+ name: "UserContainer",
1400
+ class: "u14zaal4",
1401
+ propsAsIs: !1
1402
+ }), Cs = ({
1403
+ correct: e,
1404
+ incorrect: t
1405
+ }) => {
1406
+ const n = e + t;
1407
+ return n === 0 ? 0 : Math.round(e / n * 100);
1408
+ }, Bs = ({
1409
+ gamification: e,
1410
+ className: t
1411
+ }) => {
1412
+ const n = w(e.openedQuestion.$store), i = w(e.openedUser);
1413
+ return /* @__PURE__ */ u(E, {
1414
+ children: [n && /* @__PURE__ */ s(ve, {
1415
+ className: t,
1416
+ children: /* @__PURE__ */ s(On, {
1417
+ gamification: e
1418
+ })
1419
+ }), i && /* @__PURE__ */ s(ve, {
1420
+ className: t,
1421
+ children: /* @__PURE__ */ u(ws, {
1422
+ children: [/* @__PURE__ */ s(De, {
1423
+ label: "Friend's Rank",
1424
+ close: e.closeUser
1425
+ }), /* @__PURE__ */ s(K, {
1426
+ children: /* @__PURE__ */ s(Se, {
1427
+ ...i,
1428
+ successRate: Cs(i)
1429
+ })
1430
+ })]
1431
+ })
1432
+ }), /* @__PURE__ */ s(te, {
1433
+ className: t,
1434
+ "data-nav": "true",
1435
+ children: /* @__PURE__ */ s(Os, {
1436
+ gamification: e
1437
+ })
1438
+ })]
1439
+ });
1440
+ };
1441
+ export {
1442
+ Bs as default
1443
+ };