@streamlayer/react 0.28.5 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1589 @@
1
+ import { jsxs as N, jsx as a, Fragment as V } from "react/jsx-runtime";
2
+ import { s as o, e as w, o as Oe, a as be, b as ke, Q as x, c as L, d as re, E as C, r as Ee, w as je, u as E, f as Ze, P, g as Le, n as de, h as Je } from "./masters-a2f6c191.js";
3
+ import U, { useRef as k, useState as R, useCallback as H, useEffect as Ke, useLayoutEffect as Xe, useMemo as G, Component as et, createElement as F, PureComponent as Ce } from "react";
4
+ const tt = () => w, st = () => w, nt = /* @__PURE__ */ o("div")({
5
+ name: "a",
6
+ class: "acysrl1",
7
+ propsAsIs: !1
8
+ }), it = /* @__PURE__ */ o("div")({
9
+ name: "l",
10
+ class: "lo57cjm",
11
+ propsAsIs: !1
12
+ }), rt = /* @__PURE__ */ o(tt())({
13
+ name: "p",
14
+ class: "p14kwh4y",
15
+ propsAsIs: !0
16
+ }), at = /* @__PURE__ */ o("span")({
17
+ name: "s",
18
+ class: "sxun7sq",
19
+ propsAsIs: !1
20
+ }), ot = /* @__PURE__ */ o("button")({
21
+ name: "c",
22
+ class: "c1i8ida8",
23
+ propsAsIs: !1
24
+ }), lt = /* @__PURE__ */ o(st())({
25
+ name: "g",
26
+ class: "g1m0xfmw",
27
+ propsAsIs: !0
28
+ }), Re = ({ type: t, close: e, label: s }) => {
29
+ const n = t ? Oe[t] : { label: s, iconName: void 0 };
30
+ return /* @__PURE__ */ N(nt, { children: [
31
+ /* @__PURE__ */ N(it, { children: [
32
+ (n == null ? void 0 : n.iconName) && /* @__PURE__ */ a(rt, { name: n.iconName }),
33
+ (n == null ? void 0 : n.label) && /* @__PURE__ */ a(at, { children: n.label })
34
+ ] }),
35
+ /* @__PURE__ */ a(ot, { onClick: e, children: /* @__PURE__ */ a(lt, { name: "icon-cross" }) })
36
+ ] });
37
+ };
38
+ const ct = /* @__PURE__ */ o("div")({
39
+ name: "t",
40
+ class: "taj61ja",
41
+ propsAsIs: !1
42
+ }), dt = /* @__PURE__ */ o("div")({
43
+ name: "r",
44
+ class: "r19fxewd",
45
+ propsAsIs: !1
46
+ }), ut = /* @__PURE__ */ o("div")({
47
+ name: "i",
48
+ class: "i1whkbqh",
49
+ propsAsIs: !1
50
+ }), ue = ({ indicator: t, title: e }) => /* @__PURE__ */ N(ct, { children: [
51
+ /* @__PURE__ */ a(dt, { children: e }),
52
+ /* @__PURE__ */ a(ut, { children: t })
53
+ ] });
54
+ const pt = /* @__PURE__ */ o("div")({
55
+ name: "i",
56
+ class: "i4lbhzs",
57
+ propsAsIs: !1
58
+ }), ht = /* @__PURE__ */ o("div")({
59
+ name: "o",
60
+ class: "ordquhq",
61
+ propsAsIs: !1
62
+ }), mt = /* @__PURE__ */ o("div")({
63
+ name: "n",
64
+ class: "nwzed99",
65
+ propsAsIs: !1
66
+ }), W = ({ indicator: t, title: e }) => /* @__PURE__ */ N(pt, { children: [
67
+ /* @__PURE__ */ a(ht, { children: t }),
68
+ /* @__PURE__ */ a(mt, { children: e })
69
+ ] });
70
+ const ft = /* @__PURE__ */ o("div")({
71
+ name: "o",
72
+ class: "o15y0waw",
73
+ propsAsIs: !1
74
+ }), gt = /* @__PURE__ */ o("div")({
75
+ name: "i",
76
+ class: "ihjewwf",
77
+ propsAsIs: !1
78
+ }), It = /* @__PURE__ */ o("div")({
79
+ name: "n",
80
+ class: "n10e9lv8",
81
+ propsAsIs: !1
82
+ }), vt = /* @__PURE__ */ o("div")({
83
+ name: "r",
84
+ class: "r13bxv",
85
+ propsAsIs: !1
86
+ }), Mt = /* @__PURE__ */ o("img")({
87
+ name: "a",
88
+ class: "a1fi59c9",
89
+ propsAsIs: !1
90
+ }), yt = /* @__PURE__ */ o("div")({
91
+ name: "s",
92
+ class: "s1kkihge",
93
+ propsAsIs: !1
94
+ }), Nt = /* @__PURE__ */ o("div")({
95
+ name: "c",
96
+ class: "cy4f4t",
97
+ propsAsIs: !1
98
+ }), zt = /* @__PURE__ */ o("div")({
99
+ name: "p",
100
+ class: "p18cnlx1",
101
+ propsAsIs: !1
102
+ }), _t = /* @__PURE__ */ o("img")({
103
+ name: "l",
104
+ class: "lboqgs5",
105
+ propsAsIs: !1
106
+ }), Tt = /* @__PURE__ */ o("div")({
107
+ name: "d",
108
+ class: "d1oaal4",
109
+ propsAsIs: !1
110
+ }), At = /* @__PURE__ */ o("div")({
111
+ name: "x",
112
+ class: "x1yzgo0u",
113
+ propsAsIs: !1
114
+ }), St = /* @__PURE__ */ o("div")({
115
+ name: "f",
116
+ class: "f1l9i8s8",
117
+ propsAsIs: !1
118
+ }), Dt = /* @__PURE__ */ o("div")({
119
+ name: "g",
120
+ class: "g4cgl4u",
121
+ propsAsIs: !1
122
+ }), xt = /* @__PURE__ */ o("div")({
123
+ name: "h",
124
+ class: "h1qn1tmd",
125
+ propsAsIs: !1
126
+ }), wt = /* @__PURE__ */ o("div")({
127
+ name: "u",
128
+ class: "u1gsbhq4",
129
+ propsAsIs: !1
130
+ }), Ot = /* @__PURE__ */ o("div")({
131
+ name: "m",
132
+ class: "mvj8oco",
133
+ propsAsIs: !1
134
+ }), bt = /* @__PURE__ */ o("button")({
135
+ name: "v",
136
+ class: "viqiaf2",
137
+ propsAsIs: !1
138
+ }), kt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", $e = ({
139
+ avatar: t,
140
+ name: e,
141
+ points: s,
142
+ friendsRank: n,
143
+ rank: i,
144
+ streak: d,
145
+ correct: p,
146
+ incorrect: m,
147
+ inTop: f,
148
+ average: M
149
+ }) => /* @__PURE__ */ N(ft, { children: [
150
+ /* @__PURE__ */ a(gt, { children: /* @__PURE__ */ N(vt, { children: [
151
+ /* @__PURE__ */ N(bt, { children: [
152
+ t && /* @__PURE__ */ a(Mt, { alt: "avatar", src: t }),
153
+ !t && /* @__PURE__ */ a(Ot, { children: be(e || "") })
154
+ ] }),
155
+ /* @__PURE__ */ N(yt, { children: [
156
+ /* @__PURE__ */ a(Nt, { children: e }),
157
+ /* @__PURE__ */ N(zt, { children: [
158
+ /* @__PURE__ */ N(Tt, { children: [
159
+ /* @__PURE__ */ a(_t, { alt: "rank-icon", src: kt }),
160
+ /* @__PURE__ */ N(At, { children: [
161
+ ke(s),
162
+ /* @__PURE__ */ a(St, { children: "PTS" })
163
+ ] })
164
+ ] }),
165
+ /* @__PURE__ */ a(Dt, {}),
166
+ /* @__PURE__ */ N("div", { children: [
167
+ "TOP ",
168
+ f || 0,
169
+ "%"
170
+ ] })
171
+ ] })
172
+ ] })
173
+ ] }) }),
174
+ /* @__PURE__ */ N(It, { children: [
175
+ /* @__PURE__ */ N(xt, { children: [
176
+ /* @__PURE__ */ a(ue, { indicator: n || 0, title: "Friends rank" }),
177
+ /* @__PURE__ */ a(ue, { indicator: i || 0, title: "Global rank" })
178
+ ] }),
179
+ /* @__PURE__ */ N(wt, { children: [
180
+ /* @__PURE__ */ a(W, { indicator: d || 0, title: "Win streak" }),
181
+ /* @__PURE__ */ a(W, { indicator: p || 0, title: "Correct" }),
182
+ /* @__PURE__ */ a(W, { indicator: m || 0, title: "Incorrect" }),
183
+ /* @__PURE__ */ a(W, { indicator: `${M || 0}%`, title: "Succ. rate" })
184
+ ] })
185
+ ] })
186
+ ] });
187
+ const Et = () => w, jt = /* @__PURE__ */ o("div")({
188
+ name: "c",
189
+ class: "ciyeb68",
190
+ propsAsIs: !1
191
+ }), Lt = /* @__PURE__ */ o(Et())({
192
+ name: "n",
193
+ class: "nfic4xc",
194
+ propsAsIs: !0
195
+ }), Ct = /* @__PURE__ */ o("div")({
196
+ name: "d",
197
+ class: "d1pd1p66",
198
+ propsAsIs: !1
199
+ }), Rt = /* @__PURE__ */ o("div")({
200
+ name: "p",
201
+ class: "p132yxcv",
202
+ propsAsIs: !1
203
+ }), $t = /* @__PURE__ */ o("span")({
204
+ name: "l",
205
+ class: "l4a8aw",
206
+ propsAsIs: !1
207
+ }), pe = /* @__PURE__ */ o("span")({
208
+ name: "g",
209
+ class: "gzdx7pk",
210
+ propsAsIs: !1
211
+ }), Ut = ({
212
+ feedbackMessages: t,
213
+ questionVotedCorrectly: e,
214
+ questionVoted: s,
215
+ questionType: n,
216
+ hasCorrectAnswer: i
217
+ }) => {
218
+ if (!(s && (n === x.TRIVIA || n === x.PREDICTION)))
219
+ return null;
220
+ const d = n === x.PREDICTION && !i, p = e ? "correct" : "incorrect", m = e ? t.correctFeedback : t.incorrectFeedback;
221
+ return /* @__PURE__ */ N(jt, { "data-isPrediction": d, children: [
222
+ d && /* @__PURE__ */ N(V, { children: [
223
+ /* @__PURE__ */ a(Lt, { name: "icon-prediction" }),
224
+ /* @__PURE__ */ a(pe, { children: "Stay tuned to see if your prediction was correct." })
225
+ ] }),
226
+ i && /* @__PURE__ */ N(V, { children: [
227
+ /* @__PURE__ */ a(Ct, { "data-feedbackType": p, children: /* @__PURE__ */ a(w, { name: p }) }),
228
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ N(Rt, { children: [
229
+ /* @__PURE__ */ a($t, { "data-feedbackType": p, children: m == null ? void 0 : m.title }),
230
+ /* @__PURE__ */ a(pe, { children: m == null ? void 0 : m.description })
231
+ ] }) })
232
+ ] })
233
+ ] });
234
+ };
235
+ const Qt = /* @__PURE__ */ o("div")({
236
+ name: "o",
237
+ class: "olc1eph",
238
+ propsAsIs: !1
239
+ }), qt = /* @__PURE__ */ o("div")({
240
+ name: "n",
241
+ class: "n1yoh29a",
242
+ propsAsIs: !1
243
+ }), Yt = /* @__PURE__ */ o("div")({
244
+ name: "p",
245
+ class: "pjkr5mb",
246
+ propsAsIs: !1
247
+ }), Pt = /* @__PURE__ */ o("div")({
248
+ name: "r",
249
+ class: "r82wnnx",
250
+ propsAsIs: !1
251
+ });
252
+ const Wt = () => Ue, Ft = () => Ue, Vt = () => w, Ht = /* @__PURE__ */ o("button")({
253
+ name: "c",
254
+ class: "cpm4u8k",
255
+ propsAsIs: !1
256
+ }), Bt = /* @__PURE__ */ o("div")({
257
+ name: "l",
258
+ class: "lwfomc3",
259
+ propsAsIs: !1
260
+ }), Gt = /* @__PURE__ */ o("span")({
261
+ name: "d",
262
+ class: "dmltvg2",
263
+ propsAsIs: !1
264
+ }), Zt = /* @__PURE__ */ o("div")({
265
+ name: "s",
266
+ class: "stfjpqz",
267
+ propsAsIs: !1
268
+ }), Jt = /* @__PURE__ */ o("div")({
269
+ name: "p",
270
+ class: "p198m24r",
271
+ propsAsIs: !1
272
+ }), Ue = /* @__PURE__ */ o("img")({
273
+ name: "r",
274
+ class: "rbq5eu7",
275
+ propsAsIs: !1
276
+ }), Kt = /* @__PURE__ */ o(Wt())({
277
+ name: "g",
278
+ class: "g1iv6oeb",
279
+ propsAsIs: !0
280
+ }), Xt = /* @__PURE__ */ o(Ft())({
281
+ name: "h",
282
+ class: "h1qtxlqc",
283
+ propsAsIs: !0
284
+ }), es = /* @__PURE__ */ o("span")({
285
+ name: "u",
286
+ class: "udm736q",
287
+ propsAsIs: !1
288
+ }), ts = /* @__PURE__ */ o("span")({
289
+ name: "b",
290
+ class: "b1da34tx",
291
+ propsAsIs: !1
292
+ }), ss = /* @__PURE__ */ o("span")({
293
+ name: "x",
294
+ class: "x1dqwq83",
295
+ propsAsIs: !1
296
+ }), ns = /* @__PURE__ */ o(Vt())({
297
+ name: "v",
298
+ class: "v10s9my2",
299
+ propsAsIs: !0
300
+ }), he = {
301
+ [L.CENTERED]: (t) => /* @__PURE__ */ a(Kt, { alt: "option-icon", src: t }),
302
+ [L.TRANSPARENT]: (t) => /* @__PURE__ */ a(Zt, { children: /* @__PURE__ */ a(Jt, { style: { backgroundImage: `url(${t})` } }) }),
303
+ [L.ROUNDED]: (t) => /* @__PURE__ */ a(Xt, { alt: "option-icon", src: t }),
304
+ [L.NONE]: () => null,
305
+ [L.UNSET]: () => null
306
+ }, is = ({ questionType: t, hasCorrectAnswer: e, correct: s, youVoted: n, questionVoted: i }) => {
307
+ if (t === x.POLL && n)
308
+ return "correct";
309
+ if (t === x.PREDICTION) {
310
+ if (e && i)
311
+ return n ? s ? "correct" : "incorrect" : s ? "correct" : "unset";
312
+ if (n)
313
+ return "correct";
314
+ }
315
+ return t === x.TRIVIA && i ? n ? s ? "correct" : "incorrect" : s ? "correct" : "unset" : "unset";
316
+ }, rs = ({
317
+ questionType: t,
318
+ questionVoted: e,
319
+ correct: s,
320
+ hasCorrectAnswer: n,
321
+ questionStatus: i
322
+ }) => t === x.TRIVIA ? e && s : t === x.PREDICTION ? e && s && n || i === re.RESOLVED && s : !1, as = (t) => {
323
+ var e;
324
+ const {
325
+ // option props
326
+ id: s,
327
+ icon: n,
328
+ text: i,
329
+ percentageDecimal: d,
330
+ // extra props
331
+ onVote: p,
332
+ youSelected: m,
333
+ questionVoted: f,
334
+ // ToDo: Figure out why imageMode is not in the response, and delete default value
335
+ imageMode: M = L.ROUNDED,
336
+ answerTimeExpired: z,
337
+ questionStatus: y,
338
+ isLoading: l,
339
+ questionType: v,
340
+ correct: I,
341
+ hasCorrectAnswer: r
342
+ } = t, h = is(t), c = rs({ questionType: v, questionVoted: f, correct: I, hasCorrectAnswer: r, questionStatus: y }), u = f || y === re.RESOLVED && v === x.PREDICTION;
343
+ return /* @__PURE__ */ N(
344
+ Ht,
345
+ {
346
+ value: s,
347
+ "data-selected": m,
348
+ "data-answerState": h,
349
+ disabled: f || l || z,
350
+ onClick: p,
351
+ children: [
352
+ u && /* @__PURE__ */ a(Bt, { "data-answerState": h, style: { width: `${d}%` } }),
353
+ /* @__PURE__ */ N(Gt, { children: [
354
+ n && ((e = he[M]) == null ? void 0 : e.call(he, n)),
355
+ /* @__PURE__ */ a(es, { children: i }),
356
+ u && /* @__PURE__ */ N(ts, { children: [
357
+ c && /* @__PURE__ */ a(ns, { name: "selected" }),
358
+ /* @__PURE__ */ N(ss, { children: [
359
+ d,
360
+ "%"
361
+ ] })
362
+ ] })
363
+ ] })
364
+ ]
365
+ }
366
+ );
367
+ };
368
+ var me = typeof window > "u" ? Ke : Xe, os = ({ isPlaying: t, duration: e, startAt: s = 0, updateInterval: n = 0, onComplete: i, onUpdate: d }) => {
369
+ let [p, m] = R(s), f = k(0), M = k(s), z = k(s * -1e3), y = k(null), l = k(null), v = k(null), I = (c) => {
370
+ let u = c / 1e3;
371
+ if (l.current === null) {
372
+ l.current = u, y.current = requestAnimationFrame(I);
373
+ return;
374
+ }
375
+ let g = u - l.current, T = f.current + g;
376
+ l.current = u, f.current = T;
377
+ let _ = M.current + (n === 0 ? T : (T / n | 0) * n), A = M.current + T, S = typeof e == "number" && A >= e;
378
+ m(S ? e : _), S || (y.current = requestAnimationFrame(I));
379
+ }, r = () => {
380
+ y.current && cancelAnimationFrame(y.current), v.current && clearTimeout(v.current), l.current = null;
381
+ }, h = H((c) => {
382
+ r(), f.current = 0;
383
+ let u = typeof c == "number" ? c : s;
384
+ M.current = u, m(u), t && (y.current = requestAnimationFrame(I));
385
+ }, [t, s]);
386
+ return me(() => {
387
+ if (d == null || d(p), e && p >= e) {
388
+ z.current += e * 1e3;
389
+ let { shouldRepeat: c = !1, delay: u = 0, newStartAt: g } = (i == null ? void 0 : i(z.current / 1e3)) || {};
390
+ c && (v.current = setTimeout(() => h(g), u * 1e3));
391
+ }
392
+ }, [p, e]), me(() => (t && (y.current = requestAnimationFrame(I)), r), [t, e, n]), { elapsedTime: p, reset: h };
393
+ }, ls = (t, e, s) => {
394
+ let n = t / 2, i = e / 2, d = n - i, p = 2 * d, m = s === "clockwise" ? "1,0" : "0,1", f = 2 * Math.PI * d;
395
+ return { path: `m ${n},${i} a ${d},${d} 0 ${m} 0,${p} a ${d},${d} 0 ${m} 0,-${p}`, pathLength: f };
396
+ }, fe = (t, e) => t === 0 || t === e ? 0 : typeof e == "number" ? t - e : 0, cs = (t) => ({ position: "relative", width: t, height: t }), ds = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, Qe = (t, e, s, n, i) => {
397
+ if (n === 0)
398
+ return e;
399
+ let d = (i ? n - t : t) / n;
400
+ return e + s * d;
401
+ }, ge = (t) => {
402
+ var e, s;
403
+ return (s = (e = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (n, i, d, p) => `#${i}${i}${d}${d}${p}${p}`).substring(1).match(/.{2}/g)) == null ? void 0 : e.map((n) => parseInt(n, 16))) != null ? s : [];
404
+ }, us = (t, e) => {
405
+ var s;
406
+ let { colors: n, colorsTime: i, isSmoothColorTransition: d = !0 } = t;
407
+ if (typeof n == "string")
408
+ return n;
409
+ let p = (s = i == null ? void 0 : i.findIndex((l, v) => l >= e && e >= i[v + 1])) != null ? s : -1;
410
+ if (!i || p === -1)
411
+ return n[0];
412
+ if (!d)
413
+ return n[p];
414
+ let m = i[p] - e, f = i[p] - i[p + 1], M = ge(n[p]), z = ge(n[p + 1]), y = !!t.isGrowing;
415
+ return `rgb(${M.map((l, v) => Qe(m, l, z[v] - l, f, y) | 0).join(",")})`;
416
+ }, ps = (t) => {
417
+ let { duration: e, initialRemainingTime: s, updateInterval: n, size: i = 180, strokeWidth: d = 12, trailStrokeWidth: p, isPlaying: m = !1, isGrowing: f = !1, rotation: M = "clockwise", onComplete: z, onUpdate: y } = t, l = k(), v = Math.max(d, p ?? 0), { path: I, pathLength: r } = ls(i, v, M), { elapsedTime: h } = os({ isPlaying: m, duration: e, startAt: fe(e, s), updateInterval: n, onUpdate: typeof y == "function" ? (u) => {
418
+ let g = Math.ceil(e - u);
419
+ g !== l.current && (l.current = g, y(g));
420
+ } : void 0, onComplete: typeof z == "function" ? (u) => {
421
+ var g;
422
+ let { shouldRepeat: T, delay: _, newInitialRemainingTime: A } = (g = z(u)) != null ? g : {};
423
+ if (T)
424
+ return { shouldRepeat: T, delay: _, newStartAt: fe(e, A) };
425
+ } : void 0 }), c = e - h;
426
+ return { elapsedTime: h, path: I, pathLength: r, remainingTime: Math.ceil(c), rotation: M, size: i, stroke: us(t, c), strokeDashoffset: Qe(h, 0, r, e, f), strokeWidth: d };
427
+ }, qe = (t) => {
428
+ let { children: e, strokeLinecap: s, trailColor: n, trailStrokeWidth: i } = t, { path: d, pathLength: p, stroke: m, strokeDashoffset: f, remainingTime: M, elapsedTime: z, size: y, strokeWidth: l } = ps(t);
429
+ return U.createElement("div", { style: cs(y) }, U.createElement("svg", { viewBox: `0 0 ${y} ${y}`, width: y, height: y, xmlns: "http://www.w3.org/2000/svg" }, U.createElement("path", { d, fill: "none", stroke: n ?? "#d9d9d9", strokeWidth: i ?? l }), U.createElement("path", { d, fill: "none", stroke: m, strokeLinecap: s ?? "round", strokeWidth: l, strokeDasharray: p, strokeDashoffset: f })), typeof e == "function" && U.createElement("div", { style: ds }, e({ remainingTime: M, elapsedTime: z, color: m })));
430
+ };
431
+ qe.displayName = "CountdownCircleTimer";
432
+ const hs = [C.PRIMARY_GREEN1, C.SECONDARY_RED1, C.SECONDARY_RED1], ms = [10, 10, 0], fs = /* @__PURE__ */ o("div")({
433
+ name: "A",
434
+ class: "a1f928zy",
435
+ propsAsIs: !1
436
+ }), gs = C.SECONDARY_GREEN6, Ie = C.SECONDARY_RED3, Is = C.NEUTRALS_GRAY3, vs = ({
437
+ isPlaying: t = !0,
438
+ duration: e = 30,
439
+ onTimerExpired: s
440
+ }) => {
441
+ const [n, i] = R(e > 10 ? gs : Ie), d = ({
442
+ remainingTime: f
443
+ }) => /* @__PURE__ */ a(fs, {
444
+ children: f
445
+ }), p = H(() => {
446
+ s == null || s(), i(Is);
447
+ }, [s, i]), m = H((f) => {
448
+ f === 10 && i(Ie);
449
+ }, [i]);
450
+ return /* @__PURE__ */ a(qe, {
451
+ isPlaying: t,
452
+ duration: e,
453
+ colors: hs,
454
+ colorsTime: ms,
455
+ size: 32,
456
+ strokeWidth: 2,
457
+ trailStrokeWidth: 2,
458
+ trailColor: n,
459
+ onComplete: p,
460
+ onUpdate: m,
461
+ children: d
462
+ });
463
+ };
464
+ const Ms = () => w, ys = /* @__PURE__ */ o("div")({
465
+ name: "a",
466
+ class: "a1r7f3z4",
467
+ propsAsIs: !1
468
+ }), Ns = /* @__PURE__ */ o("div")({
469
+ name: "s",
470
+ class: "sblndl",
471
+ propsAsIs: !1
472
+ }), zs = /* @__PURE__ */ o("div")({
473
+ name: "l",
474
+ class: "l7ka1tv",
475
+ propsAsIs: !1
476
+ }), _s = /* @__PURE__ */ o(Ms())({
477
+ name: "p",
478
+ class: "p1edlxt3",
479
+ propsAsIs: !0
480
+ }), Ts = /* @__PURE__ */ o("div")({
481
+ name: "g",
482
+ class: "ghm08u2",
483
+ propsAsIs: !1
484
+ }), As = /* @__PURE__ */ o("span")({
485
+ name: "c",
486
+ class: "c12nsh46",
487
+ propsAsIs: !1
488
+ }), Ss = /* @__PURE__ */ o("span")({
489
+ name: "d",
490
+ class: "dlr9eoc",
491
+ propsAsIs: !1
492
+ }), Ds = ({ title: t, points: e, isPlayingTimer: s, isTimer: n, onTimerExpired: i }) => /* @__PURE__ */ N(ys, { children: [
493
+ /* @__PURE__ */ N(Ns, { children: [
494
+ t && /* @__PURE__ */ a(zs, { children: t }),
495
+ e !== void 0 && /* @__PURE__ */ N(V, { children: [
496
+ /* @__PURE__ */ a(_s, { name: "icon-trophy" }),
497
+ /* @__PURE__ */ N(Ts, { children: [
498
+ /* @__PURE__ */ a(As, { children: e }),
499
+ /* @__PURE__ */ a(Ss, { children: "PTS" })
500
+ ] })
501
+ ] })
502
+ ] }),
503
+ n && /* @__PURE__ */ a(vs, { isPlaying: s, onTimerExpired: i })
504
+ ] }), xs = ({ openedQuestion: t, vote: e }) => {
505
+ var s;
506
+ const n = t.subject, i = t.type, d = (s = t.options) == null ? void 0 : s.options, [p, m] = R(!1), [f, M] = R(!1), [z, y] = R(""), l = t == null ? void 0 : t.id, v = H(
507
+ async (u) => {
508
+ if (l) {
509
+ const g = u.currentTarget.value;
510
+ y(g), M(!0), await e(l, g), M(!1);
511
+ }
512
+ },
513
+ [l, y, e]
514
+ ), I = G(
515
+ () => t == null ? void 0 : t.answers.find((u) => u.youVoted === !0),
516
+ [t]
517
+ ), r = G(
518
+ () => !!(t != null && t.answers.find((u) => u.correct === !0)),
519
+ [t]
520
+ ), h = G(() => t ? t.answers.map((u) => ({
521
+ ...u,
522
+ questionVoted: !!I,
523
+ youSelected: z === u.id,
524
+ isLoading: f,
525
+ hasCorrectAnswer: r,
526
+ questionType: t.type,
527
+ answerTimeExpired: p,
528
+ questionStatus: t.status,
529
+ // ToDo: Figure out why imageMode is not in the response
530
+ onVote: v
531
+ })) : [], [r, p, f, t, I, v, z]), c = d && (d.case === "trivia" || d.case === "prediction") ? d.value : void 0;
532
+ return /* @__PURE__ */ a(Ee, { "data-question-header": "true", children: /* @__PURE__ */ a(Qt, { children: /* @__PURE__ */ N(qt, { children: [
533
+ c && /* @__PURE__ */ a(
534
+ Ut,
535
+ {
536
+ feedbackMessages: c,
537
+ questionVoted: !!I,
538
+ questionVotedCorrectly: I == null ? void 0 : I.correct,
539
+ questionType: i,
540
+ hasCorrectAnswer: r
541
+ }
542
+ ),
543
+ /* @__PURE__ */ a(
544
+ Ds,
545
+ {
546
+ title: p ? "Expired" : "To win",
547
+ points: p ? void 0 : 100,
548
+ onTimerExpired: () => m(!0),
549
+ isTimer: !0
550
+ }
551
+ ),
552
+ /* @__PURE__ */ a(Yt, { children: n }),
553
+ /* @__PURE__ */ a(Pt, { children: h.map((u) => /* @__PURE__ */ a(as, { ...u }, u.id)) })
554
+ ] }) }) });
555
+ };
556
+ const ws = /* @__PURE__ */ o("div")({
557
+ name: "e",
558
+ class: "e18unvw4",
559
+ propsAsIs: !1
560
+ }), Os = /* @__PURE__ */ o("div")({
561
+ name: "r",
562
+ class: "rs0uvk8",
563
+ propsAsIs: !1
564
+ }), bs = /* @__PURE__ */ o("h3")({
565
+ name: "n",
566
+ class: "n1hem4g7",
567
+ propsAsIs: !1
568
+ }), ks = /* @__PURE__ */ o("div")({
569
+ name: "i",
570
+ class: "i193lbwv",
571
+ propsAsIs: !1
572
+ }), Es = /* @__PURE__ */ o("a")({
573
+ name: "a",
574
+ class: "a1dka9qs",
575
+ propsAsIs: !1
576
+ }), js = /* @__PURE__ */ o("div")({
577
+ name: "l",
578
+ class: "l1un98tk",
579
+ propsAsIs: !1
580
+ }), Ls = ({
581
+ created: t,
582
+ title: e,
583
+ instantView: s
584
+ }) => {
585
+ const n = new Date(t), i = n.toLocaleDateString("en-US", {
586
+ weekday: "short",
587
+ month: "short",
588
+ day: "numeric"
589
+ }), d = n.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
590
+ return /* @__PURE__ */ N(ws, { children: [
591
+ /* @__PURE__ */ N(js, { children: [
592
+ i,
593
+ "・",
594
+ d
595
+ ] }),
596
+ (s == null ? void 0 : s.video) && /* @__PURE__ */ a(je, { source: s.video.url, poster: s.video.thumbnailUrl }),
597
+ /* @__PURE__ */ N(Os, { children: [
598
+ /* @__PURE__ */ a(bs, { children: (s == null ? void 0 : s.heading) || e }),
599
+ /* @__PURE__ */ a(ks, { children: s == null ? void 0 : s.body }),
600
+ (s == null ? void 0 : s.webLink) && /* @__PURE__ */ N(Es, { href: s == null ? void 0 : s.webLink.url, target: "_blank", children: [
601
+ "Explore more of the Masters History",
602
+ /* @__PURE__ */ a(w, { name: "icon-external-link" })
603
+ ] })
604
+ ] })
605
+ ] });
606
+ };
607
+ const Cs = /* @__PURE__ */ o("div")({
608
+ name: "d",
609
+ class: "dk8r1eq",
610
+ propsAsIs: !1
611
+ }), Rs = ({
612
+ openedQuestion: t
613
+ }) => {
614
+ var e;
615
+ return ((e = t == null ? void 0 : t.attributes) == null ? void 0 : e.attributes.case) === "insight" ? /* @__PURE__ */ a(Ls, {
616
+ created: t.attributes.created,
617
+ ...t.attributes.attributes.value
618
+ }) : null;
619
+ }, $s = ({
620
+ extendedQuestion: t,
621
+ vote: e
622
+ }) => {
623
+ const {
624
+ loading: s,
625
+ data: n
626
+ } = t;
627
+ return !s && n ? /* @__PURE__ */ a(xs, {
628
+ vote: e,
629
+ openedQuestion: n
630
+ }) : null;
631
+ }, Us = ({
632
+ gamification: t
633
+ }) => {
634
+ var e;
635
+ const s = E(t.openedQuestion.$store), n = E(t.openedQuestion.$extendedStore);
636
+ if (!s)
637
+ return null;
638
+ const i = s.type;
639
+ return /* @__PURE__ */ N(Cs, {
640
+ children: [/* @__PURE__ */ a(Re, {
641
+ close: t.closeQuestion,
642
+ type: ((e = s.attributes) == null ? void 0 : e.type) || x.UNSET
643
+ }), i === "question" && /* @__PURE__ */ a($s, {
644
+ vote: t.submitAnswer,
645
+ extendedQuestion: n
646
+ }), i !== "question" && /* @__PURE__ */ a(Rs, {
647
+ openedQuestion: s
648
+ })]
649
+ });
650
+ };
651
+ const Qs = /* @__PURE__ */ o("div")({
652
+ name: "t",
653
+ class: "tcim9sm",
654
+ propsAsIs: !1
655
+ }), qs = /* @__PURE__ */ o("div")({
656
+ name: "e",
657
+ class: "e8wco6o",
658
+ propsAsIs: !1
659
+ }), Ys = /* @__PURE__ */ o("button")({
660
+ name: "n",
661
+ class: "n1ardwzl",
662
+ propsAsIs: !1
663
+ }), Ps = /* @__PURE__ */ o("span")({
664
+ name: "i",
665
+ class: "i1vk8ojx",
666
+ propsAsIs: !1
667
+ });
668
+ var Q = /* @__PURE__ */ ((t) => (t.HOME = "home", t.LEADERBOARD = "leaderboard", t))(Q || {});
669
+ const ve = ({ title: t, active: e, onClick: s }) => /* @__PURE__ */ a(Ys, { onClick: s, "data-selected": e, children: /* @__PURE__ */ a(Ps, { children: t }) }), Ws = ({ activePage: t = "home", toggleActivePage: e }) => /* @__PURE__ */ a(Qs, { children: /* @__PURE__ */ N(qs, { "data-position": t === "home" ? "left" : "right", children: [
670
+ /* @__PURE__ */ a(ve, { title: "Home", active: t === "home", onClick: () => e(
671
+ "home"
672
+ /* HOME */
673
+ ) }),
674
+ /* @__PURE__ */ a(
675
+ ve,
676
+ {
677
+ title: "Leader Board",
678
+ active: t === "leaderboard",
679
+ onClick: () => e(
680
+ "leaderboard"
681
+ /* LEADERBOARD */
682
+ )
683
+ }
684
+ )
685
+ ] }) });
686
+ let D;
687
+ typeof window < "u" ? D = window : typeof self < "u" ? D = self : D = Ze.global;
688
+ let te = null, se = null;
689
+ const Me = 20, Z = D.clearTimeout, ye = D.setTimeout, J = D.cancelAnimationFrame || D.mozCancelAnimationFrame || D.webkitCancelAnimationFrame, Ne = D.requestAnimationFrame || D.mozRequestAnimationFrame || D.webkitRequestAnimationFrame;
690
+ J == null || Ne == null ? (te = Z, se = function(e) {
691
+ return ye(e, Me);
692
+ }) : (te = function([e, s]) {
693
+ J(e), Z(s);
694
+ }, se = function(e) {
695
+ const s = Ne(function() {
696
+ Z(n), e();
697
+ }), n = ye(function() {
698
+ J(s), e();
699
+ }, Me);
700
+ return [s, n];
701
+ });
702
+ function Fs(t) {
703
+ let e, s, n, i, d, p, m;
704
+ const f = typeof document < "u" && document.attachEvent;
705
+ if (!f) {
706
+ p = function(c) {
707
+ const u = c.__resizeTriggers__, g = u.firstElementChild, T = u.lastElementChild, _ = g.firstElementChild;
708
+ T.scrollLeft = T.scrollWidth, T.scrollTop = T.scrollHeight, _.style.width = g.offsetWidth + 1 + "px", _.style.height = g.offsetHeight + 1 + "px", g.scrollLeft = g.scrollWidth, g.scrollTop = g.scrollHeight;
709
+ }, d = function(c) {
710
+ return c.offsetWidth !== c.__resizeLast__.width || c.offsetHeight !== c.__resizeLast__.height;
711
+ }, m = function(c) {
712
+ if (c.target.className && typeof c.target.className.indexOf == "function" && c.target.className.indexOf("contract-trigger") < 0 && c.target.className.indexOf("expand-trigger") < 0)
713
+ return;
714
+ const u = this;
715
+ p(this), this.__resizeRAF__ && te(this.__resizeRAF__), this.__resizeRAF__ = se(function() {
716
+ d(u) && (u.__resizeLast__.width = u.offsetWidth, u.__resizeLast__.height = u.offsetHeight, u.__resizeListeners__.forEach(function(_) {
717
+ _.call(u, c);
718
+ }));
719
+ });
720
+ };
721
+ let l = !1, v = "";
722
+ n = "animationstart";
723
+ const I = "Webkit Moz O ms".split(" ");
724
+ let r = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), h = "";
725
+ {
726
+ const c = document.createElement("fakeelement");
727
+ if (c.style.animationName !== void 0 && (l = !0), l === !1) {
728
+ for (let u = 0; u < I.length; u++)
729
+ if (c.style[I[u] + "AnimationName"] !== void 0) {
730
+ h = I[u], v = "-" + h.toLowerCase() + "-", n = r[u], l = !0;
731
+ break;
732
+ }
733
+ }
734
+ }
735
+ s = "resizeanim", e = "@" + v + "keyframes " + s + " { from { opacity: 0; } to { opacity: 0; } } ", i = v + "animation: 1ms " + s + "; ";
736
+ }
737
+ const M = function(l) {
738
+ if (!l.getElementById("detectElementResize")) {
739
+ const v = (e || "") + ".resize-triggers { " + (i || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', I = l.head || l.getElementsByTagName("head")[0], r = l.createElement("style");
740
+ r.id = "detectElementResize", r.type = "text/css", t != null && r.setAttribute("nonce", t), r.styleSheet ? r.styleSheet.cssText = v : r.appendChild(l.createTextNode(v)), I.appendChild(r);
741
+ }
742
+ };
743
+ return {
744
+ addResizeListener: function(l, v) {
745
+ if (f)
746
+ l.attachEvent("onresize", v);
747
+ else {
748
+ if (!l.__resizeTriggers__) {
749
+ const I = l.ownerDocument, r = D.getComputedStyle(l);
750
+ r && r.position === "static" && (l.style.position = "relative"), M(I), l.__resizeLast__ = {}, l.__resizeListeners__ = [], (l.__resizeTriggers__ = I.createElement("div")).className = "resize-triggers";
751
+ const h = I.createElement("div");
752
+ h.className = "expand-trigger", h.appendChild(I.createElement("div"));
753
+ const c = I.createElement("div");
754
+ c.className = "contract-trigger", l.__resizeTriggers__.appendChild(h), l.__resizeTriggers__.appendChild(c), l.appendChild(l.__resizeTriggers__), p(l), l.addEventListener("scroll", m, !0), n && (l.__resizeTriggers__.__animationListener__ = function(g) {
755
+ g.animationName === s && p(l);
756
+ }, l.__resizeTriggers__.addEventListener(n, l.__resizeTriggers__.__animationListener__));
757
+ }
758
+ l.__resizeListeners__.push(v);
759
+ }
760
+ },
761
+ removeResizeListener: function(l, v) {
762
+ if (f)
763
+ l.detachEvent("onresize", v);
764
+ else if (l.__resizeListeners__.splice(l.__resizeListeners__.indexOf(v), 1), !l.__resizeListeners__.length) {
765
+ l.removeEventListener("scroll", m, !0), l.__resizeTriggers__.__animationListener__ && (l.__resizeTriggers__.removeEventListener(n, l.__resizeTriggers__.__animationListener__), l.__resizeTriggers__.__animationListener__ = null);
766
+ try {
767
+ l.__resizeTriggers__ = !l.removeChild(l.__resizeTriggers__);
768
+ } catch {
769
+ }
770
+ }
771
+ }
772
+ };
773
+ }
774
+ class Vs extends et {
775
+ constructor(...e) {
776
+ super(...e), this.state = {
777
+ height: this.props.defaultHeight || 0,
778
+ scaledHeight: this.props.defaultHeight || 0,
779
+ scaledWidth: this.props.defaultWidth || 0,
780
+ width: this.props.defaultWidth || 0
781
+ }, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
782
+ this._timeoutId = null;
783
+ const {
784
+ disableHeight: s,
785
+ disableWidth: n,
786
+ onResize: i
787
+ } = this.props;
788
+ if (this._parentNode) {
789
+ var d, p, m, f;
790
+ const M = window.getComputedStyle(this._parentNode) || {}, z = parseFloat((d = M.paddingLeft) !== null && d !== void 0 ? d : "0"), y = parseFloat((p = M.paddingRight) !== null && p !== void 0 ? p : "0"), l = parseFloat((m = M.paddingTop) !== null && m !== void 0 ? m : "0"), v = parseFloat((f = M.paddingBottom) !== null && f !== void 0 ? f : "0"), I = this._parentNode.getBoundingClientRect(), r = I.height - l - v, h = I.width - z - y, c = this._parentNode.offsetHeight - l - v, u = this._parentNode.offsetWidth - z - y;
791
+ (!s && (this.state.height !== c || this.state.scaledHeight !== r) || !n && (this.state.width !== u || this.state.scaledWidth !== h)) && (this.setState({
792
+ height: c,
793
+ width: u,
794
+ scaledHeight: r,
795
+ scaledWidth: h
796
+ }), typeof i == "function" && i({
797
+ height: c,
798
+ scaledHeight: r,
799
+ scaledWidth: h,
800
+ width: u
801
+ }));
802
+ }
803
+ }, this._setRef = (s) => {
804
+ this._autoSizer = s;
805
+ };
806
+ }
807
+ componentDidMount() {
808
+ const {
809
+ nonce: e
810
+ } = this.props;
811
+ this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement && (this._parentNode = this._autoSizer.parentNode, this._parentNode != null && (typeof ResizeObserver < "u" ? (this._resizeObserver = new ResizeObserver(() => {
812
+ this._timeoutId = setTimeout(this._onResize, 0);
813
+ }), this._resizeObserver.observe(this._parentNode)) : (this._detectElementResize = Fs(e), this._detectElementResize.addResizeListener(this._parentNode, this._onResize)), this._onResize()));
814
+ }
815
+ componentWillUnmount() {
816
+ this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && (this._resizeObserver.observe(this._parentNode), this._resizeObserver.disconnect()));
817
+ }
818
+ render() {
819
+ const {
820
+ children: e,
821
+ defaultHeight: s,
822
+ defaultWidth: n,
823
+ disableHeight: i = !1,
824
+ disableWidth: d = !1,
825
+ nonce: p,
826
+ onResize: m,
827
+ style: f = {},
828
+ tagName: M = "div",
829
+ ...z
830
+ } = this.props, {
831
+ height: y,
832
+ scaledHeight: l,
833
+ scaledWidth: v,
834
+ width: I
835
+ } = this.state, r = {
836
+ overflow: "visible"
837
+ }, h = {};
838
+ let c = !1;
839
+ return i || (y === 0 && (c = !0), r.height = 0, h.height = y, h.scaledHeight = l), d || (I === 0 && (c = !0), r.width = 0, h.width = I, h.scaledWidth = v), F(M, {
840
+ ref: this._setRef,
841
+ style: {
842
+ ...r,
843
+ ...f
844
+ },
845
+ ...z
846
+ }, !c && e(h));
847
+ }
848
+ }
849
+ function ne() {
850
+ return ne = Object.assign ? Object.assign.bind() : function(t) {
851
+ for (var e = 1; e < arguments.length; e++) {
852
+ var s = arguments[e];
853
+ for (var n in s)
854
+ Object.prototype.hasOwnProperty.call(s, n) && (t[n] = s[n]);
855
+ }
856
+ return t;
857
+ }, ne.apply(this, arguments);
858
+ }
859
+ function ze(t) {
860
+ if (t === void 0)
861
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
862
+ return t;
863
+ }
864
+ function ie(t, e) {
865
+ return ie = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
866
+ return n.__proto__ = i, n;
867
+ }, ie(t, e);
868
+ }
869
+ function Hs(t, e) {
870
+ t.prototype = Object.create(e.prototype), t.prototype.constructor = t, ie(t, e);
871
+ }
872
+ var _e = Number.isNaN || function(e) {
873
+ return typeof e == "number" && e !== e;
874
+ };
875
+ function Bs(t, e) {
876
+ return !!(t === e || _e(t) && _e(e));
877
+ }
878
+ function Gs(t, e) {
879
+ if (t.length !== e.length)
880
+ return !1;
881
+ for (var s = 0; s < t.length; s++)
882
+ if (!Bs(t[s], e[s]))
883
+ return !1;
884
+ return !0;
885
+ }
886
+ function K(t, e) {
887
+ e === void 0 && (e = Gs);
888
+ var s, n = [], i, d = !1;
889
+ function p() {
890
+ for (var m = [], f = 0; f < arguments.length; f++)
891
+ m[f] = arguments[f];
892
+ return d && s === this && e(m, n) || (i = t.apply(this, m), d = !0, s = this, n = m), i;
893
+ }
894
+ return p;
895
+ }
896
+ var Zs = typeof performance == "object" && typeof performance.now == "function", Te = Zs ? function() {
897
+ return performance.now();
898
+ } : function() {
899
+ return Date.now();
900
+ };
901
+ function Ae(t) {
902
+ cancelAnimationFrame(t.id);
903
+ }
904
+ function Js(t, e) {
905
+ var s = Te();
906
+ function n() {
907
+ Te() - s >= e ? t.call(null) : i.id = requestAnimationFrame(n);
908
+ }
909
+ var i = {
910
+ id: requestAnimationFrame(n)
911
+ };
912
+ return i;
913
+ }
914
+ var X = -1;
915
+ function Se(t) {
916
+ if (t === void 0 && (t = !1), X === -1 || t) {
917
+ var e = document.createElement("div"), s = e.style;
918
+ s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(e), X = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
919
+ }
920
+ return X;
921
+ }
922
+ var j = null;
923
+ function De(t) {
924
+ if (t === void 0 && (t = !1), j === null || t) {
925
+ var e = document.createElement("div"), s = e.style;
926
+ s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
927
+ var n = document.createElement("div"), i = n.style;
928
+ return i.width = "100px", i.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? j = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? j = "negative" : j = "positive-ascending"), document.body.removeChild(e), j;
929
+ }
930
+ return j;
931
+ }
932
+ var Ks = 150, Xs = function(e, s) {
933
+ return e;
934
+ };
935
+ function en(t) {
936
+ var e, s = t.getItemOffset, n = t.getEstimatedTotalSize, i = t.getItemSize, d = t.getOffsetForIndexAndAlignment, p = t.getStartIndexForOffset, m = t.getStopIndexForStartIndex, f = t.initInstanceProps, M = t.shouldResetStyleCacheOnItemSizeChange, z = t.validateProps;
937
+ return e = /* @__PURE__ */ function(y) {
938
+ Hs(l, y);
939
+ function l(I) {
940
+ var r;
941
+ return r = y.call(this, I) || this, r._instanceProps = f(r.props, ze(r)), r._outerRef = void 0, r._resetIsScrollingTimeoutId = null, r.state = {
942
+ instance: ze(r),
943
+ isScrolling: !1,
944
+ scrollDirection: "forward",
945
+ scrollOffset: typeof r.props.initialScrollOffset == "number" ? r.props.initialScrollOffset : 0,
946
+ scrollUpdateWasRequested: !1
947
+ }, r._callOnItemsRendered = void 0, r._callOnItemsRendered = K(function(h, c, u, g) {
948
+ return r.props.onItemsRendered({
949
+ overscanStartIndex: h,
950
+ overscanStopIndex: c,
951
+ visibleStartIndex: u,
952
+ visibleStopIndex: g
953
+ });
954
+ }), r._callOnScroll = void 0, r._callOnScroll = K(function(h, c, u) {
955
+ return r.props.onScroll({
956
+ scrollDirection: h,
957
+ scrollOffset: c,
958
+ scrollUpdateWasRequested: u
959
+ });
960
+ }), r._getItemStyle = void 0, r._getItemStyle = function(h) {
961
+ var c = r.props, u = c.direction, g = c.itemSize, T = c.layout, _ = r._getItemStyleCache(M && g, M && T, M && u), A;
962
+ if (_.hasOwnProperty(h))
963
+ A = _[h];
964
+ else {
965
+ var S = s(r.props, h, r._instanceProps), O = i(r.props, h, r._instanceProps), b = u === "horizontal" || T === "horizontal", q = u === "rtl", Y = b ? S : 0;
966
+ _[h] = A = {
967
+ position: "absolute",
968
+ left: q ? void 0 : Y,
969
+ right: q ? Y : void 0,
970
+ top: b ? 0 : S,
971
+ height: b ? "100%" : O,
972
+ width: b ? O : "100%"
973
+ };
974
+ }
975
+ return A;
976
+ }, r._getItemStyleCache = void 0, r._getItemStyleCache = K(function(h, c, u) {
977
+ return {};
978
+ }), r._onScrollHorizontal = function(h) {
979
+ var c = h.currentTarget, u = c.clientWidth, g = c.scrollLeft, T = c.scrollWidth;
980
+ r.setState(function(_) {
981
+ if (_.scrollOffset === g)
982
+ return null;
983
+ var A = r.props.direction, S = g;
984
+ if (A === "rtl")
985
+ switch (De()) {
986
+ case "negative":
987
+ S = -g;
988
+ break;
989
+ case "positive-descending":
990
+ S = T - u - g;
991
+ break;
992
+ }
993
+ return S = Math.max(0, Math.min(S, T - u)), {
994
+ isScrolling: !0,
995
+ scrollDirection: _.scrollOffset < g ? "forward" : "backward",
996
+ scrollOffset: S,
997
+ scrollUpdateWasRequested: !1
998
+ };
999
+ }, r._resetIsScrollingDebounced);
1000
+ }, r._onScrollVertical = function(h) {
1001
+ var c = h.currentTarget, u = c.clientHeight, g = c.scrollHeight, T = c.scrollTop;
1002
+ r.setState(function(_) {
1003
+ if (_.scrollOffset === T)
1004
+ return null;
1005
+ var A = Math.max(0, Math.min(T, g - u));
1006
+ return {
1007
+ isScrolling: !0,
1008
+ scrollDirection: _.scrollOffset < A ? "forward" : "backward",
1009
+ scrollOffset: A,
1010
+ scrollUpdateWasRequested: !1
1011
+ };
1012
+ }, r._resetIsScrollingDebounced);
1013
+ }, r._outerRefSetter = function(h) {
1014
+ var c = r.props.outerRef;
1015
+ r._outerRef = h, typeof c == "function" ? c(h) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = h);
1016
+ }, r._resetIsScrollingDebounced = function() {
1017
+ r._resetIsScrollingTimeoutId !== null && Ae(r._resetIsScrollingTimeoutId), r._resetIsScrollingTimeoutId = Js(r._resetIsScrolling, Ks);
1018
+ }, r._resetIsScrolling = function() {
1019
+ r._resetIsScrollingTimeoutId = null, r.setState({
1020
+ isScrolling: !1
1021
+ }, function() {
1022
+ r._getItemStyleCache(-1, null);
1023
+ });
1024
+ }, r;
1025
+ }
1026
+ l.getDerivedStateFromProps = function(r, h) {
1027
+ return tn(r, h), z(r), null;
1028
+ };
1029
+ var v = l.prototype;
1030
+ return v.scrollTo = function(r) {
1031
+ r = Math.max(0, r), this.setState(function(h) {
1032
+ return h.scrollOffset === r ? null : {
1033
+ scrollDirection: h.scrollOffset < r ? "forward" : "backward",
1034
+ scrollOffset: r,
1035
+ scrollUpdateWasRequested: !0
1036
+ };
1037
+ }, this._resetIsScrollingDebounced);
1038
+ }, v.scrollToItem = function(r, h) {
1039
+ h === void 0 && (h = "auto");
1040
+ var c = this.props, u = c.itemCount, g = c.layout, T = this.state.scrollOffset;
1041
+ r = Math.max(0, Math.min(r, u - 1));
1042
+ var _ = 0;
1043
+ if (this._outerRef) {
1044
+ var A = this._outerRef;
1045
+ g === "vertical" ? _ = A.scrollWidth > A.clientWidth ? Se() : 0 : _ = A.scrollHeight > A.clientHeight ? Se() : 0;
1046
+ }
1047
+ this.scrollTo(d(this.props, r, h, T, this._instanceProps, _));
1048
+ }, v.componentDidMount = function() {
1049
+ var r = this.props, h = r.direction, c = r.initialScrollOffset, u = r.layout;
1050
+ if (typeof c == "number" && this._outerRef != null) {
1051
+ var g = this._outerRef;
1052
+ h === "horizontal" || u === "horizontal" ? g.scrollLeft = c : g.scrollTop = c;
1053
+ }
1054
+ this._callPropsCallbacks();
1055
+ }, v.componentDidUpdate = function() {
1056
+ var r = this.props, h = r.direction, c = r.layout, u = this.state, g = u.scrollOffset, T = u.scrollUpdateWasRequested;
1057
+ if (T && this._outerRef != null) {
1058
+ var _ = this._outerRef;
1059
+ if (h === "horizontal" || c === "horizontal")
1060
+ if (h === "rtl")
1061
+ switch (De()) {
1062
+ case "negative":
1063
+ _.scrollLeft = -g;
1064
+ break;
1065
+ case "positive-ascending":
1066
+ _.scrollLeft = g;
1067
+ break;
1068
+ default:
1069
+ var A = _.clientWidth, S = _.scrollWidth;
1070
+ _.scrollLeft = S - A - g;
1071
+ break;
1072
+ }
1073
+ else
1074
+ _.scrollLeft = g;
1075
+ else
1076
+ _.scrollTop = g;
1077
+ }
1078
+ this._callPropsCallbacks();
1079
+ }, v.componentWillUnmount = function() {
1080
+ this._resetIsScrollingTimeoutId !== null && Ae(this._resetIsScrollingTimeoutId);
1081
+ }, v.render = function() {
1082
+ var r = this.props, h = r.children, c = r.className, u = r.direction, g = r.height, T = r.innerRef, _ = r.innerElementType, A = r.innerTagName, S = r.itemCount, O = r.itemData, b = r.itemKey, q = b === void 0 ? Xs : b, Y = r.layout, Ye = r.outerElementType, Pe = r.outerTagName, We = r.style, Fe = r.useIsScrolling, Ve = r.width, ae = this.state.isScrolling, B = u === "horizontal" || Y === "horizontal", He = B ? this._onScrollHorizontal : this._onScrollVertical, oe = this._getRangeToRender(), Be = oe[0], Ge = oe[1], le = [];
1083
+ if (S > 0)
1084
+ for (var $ = Be; $ <= Ge; $++)
1085
+ le.push(F(h, {
1086
+ data: O,
1087
+ key: q($, O),
1088
+ index: $,
1089
+ isScrolling: Fe ? ae : void 0,
1090
+ style: this._getItemStyle($)
1091
+ }));
1092
+ var ce = n(this.props, this._instanceProps);
1093
+ return F(Ye || Pe || "div", {
1094
+ className: c,
1095
+ onScroll: He,
1096
+ ref: this._outerRefSetter,
1097
+ style: ne({
1098
+ position: "relative",
1099
+ height: g,
1100
+ width: Ve,
1101
+ overflow: "auto",
1102
+ WebkitOverflowScrolling: "touch",
1103
+ willChange: "transform",
1104
+ direction: u
1105
+ }, We)
1106
+ }, F(_ || A || "div", {
1107
+ children: le,
1108
+ ref: T,
1109
+ style: {
1110
+ height: B ? "100%" : ce,
1111
+ pointerEvents: ae ? "none" : void 0,
1112
+ width: B ? ce : "100%"
1113
+ }
1114
+ }));
1115
+ }, v._callPropsCallbacks = function() {
1116
+ if (typeof this.props.onItemsRendered == "function") {
1117
+ var r = this.props.itemCount;
1118
+ if (r > 0) {
1119
+ var h = this._getRangeToRender(), c = h[0], u = h[1], g = h[2], T = h[3];
1120
+ this._callOnItemsRendered(c, u, g, T);
1121
+ }
1122
+ }
1123
+ if (typeof this.props.onScroll == "function") {
1124
+ var _ = this.state, A = _.scrollDirection, S = _.scrollOffset, O = _.scrollUpdateWasRequested;
1125
+ this._callOnScroll(A, S, O);
1126
+ }
1127
+ }, v._getRangeToRender = function() {
1128
+ var r = this.props, h = r.itemCount, c = r.overscanCount, u = this.state, g = u.isScrolling, T = u.scrollDirection, _ = u.scrollOffset;
1129
+ if (h === 0)
1130
+ return [0, 0, 0, 0];
1131
+ var A = p(this.props, _, this._instanceProps), S = m(this.props, A, _, this._instanceProps), O = !g || T === "backward" ? Math.max(1, c) : 1, b = !g || T === "forward" ? Math.max(1, c) : 1;
1132
+ return [Math.max(0, A - O), Math.max(0, Math.min(h - 1, S + b)), A, S];
1133
+ }, l;
1134
+ }(Ce), e.defaultProps = {
1135
+ direction: "ltr",
1136
+ itemData: void 0,
1137
+ layout: "vertical",
1138
+ overscanCount: 2,
1139
+ useIsScrolling: !1
1140
+ }, e;
1141
+ }
1142
+ var tn = function(e, s) {
1143
+ e.children, e.direction, e.height, e.layout, e.innerTagName, e.outerTagName, e.width, s.instance;
1144
+ }, sn = /* @__PURE__ */ en({
1145
+ getItemOffset: function(e, s) {
1146
+ var n = e.itemSize;
1147
+ return s * n;
1148
+ },
1149
+ getItemSize: function(e, s) {
1150
+ var n = e.itemSize;
1151
+ return n;
1152
+ },
1153
+ getEstimatedTotalSize: function(e) {
1154
+ var s = e.itemCount, n = e.itemSize;
1155
+ return n * s;
1156
+ },
1157
+ getOffsetForIndexAndAlignment: function(e, s, n, i, d, p) {
1158
+ var m = e.direction, f = e.height, M = e.itemCount, z = e.itemSize, y = e.layout, l = e.width, v = m === "horizontal" || y === "horizontal", I = v ? l : f, r = Math.max(0, M * z - I), h = Math.min(r, s * z), c = Math.max(0, s * z - I + z + p);
1159
+ switch (n === "smart" && (i >= c - I && i <= h + I ? n = "auto" : n = "center"), n) {
1160
+ case "start":
1161
+ return h;
1162
+ case "end":
1163
+ return c;
1164
+ case "center": {
1165
+ var u = Math.round(c + (h - c) / 2);
1166
+ return u < Math.ceil(I / 2) ? 0 : u > r + Math.floor(I / 2) ? r : u;
1167
+ }
1168
+ case "auto":
1169
+ default:
1170
+ return i >= c && i <= h ? i : i < c ? c : h;
1171
+ }
1172
+ },
1173
+ getStartIndexForOffset: function(e, s) {
1174
+ var n = e.itemCount, i = e.itemSize;
1175
+ return Math.max(0, Math.min(n - 1, Math.floor(s / i)));
1176
+ },
1177
+ getStopIndexForStartIndex: function(e, s, n) {
1178
+ var i = e.direction, d = e.height, p = e.itemCount, m = e.itemSize, f = e.layout, M = e.width, z = i === "horizontal" || f === "horizontal", y = s * m, l = z ? M : d, v = Math.ceil((l + n - y) / m);
1179
+ return Math.max(0, Math.min(
1180
+ p - 1,
1181
+ s + v - 1
1182
+ // -1 is because stop index is inclusive
1183
+ ));
1184
+ },
1185
+ initInstanceProps: function(e) {
1186
+ },
1187
+ shouldResetStyleCacheOnItemSizeChange: !0,
1188
+ validateProps: function(e) {
1189
+ e.itemSize;
1190
+ }
1191
+ });
1192
+ function nn(t) {
1193
+ var e = t.lastRenderedStartIndex, s = t.lastRenderedStopIndex, n = t.startIndex, i = t.stopIndex;
1194
+ return !(n > s || i < e);
1195
+ }
1196
+ function rn(t) {
1197
+ for (var e = t.isItemLoaded, s = t.itemCount, n = t.minimumBatchSize, i = t.startIndex, d = t.stopIndex, p = [], m = null, f = null, M = i; M <= d; M++) {
1198
+ var z = e(M);
1199
+ z ? f !== null && (p.push(m, f), m = f = null) : (f = M, m === null && (m = M));
1200
+ }
1201
+ if (f !== null) {
1202
+ for (var y = Math.min(Math.max(f, m + n - 1), s - 1), l = f + 1; l <= y && !e(l); l++)
1203
+ f = l;
1204
+ p.push(m, f);
1205
+ }
1206
+ if (p.length)
1207
+ for (; p[1] - p[0] + 1 < n && p[0] > 0; ) {
1208
+ var v = p[0] - 1;
1209
+ if (!e(v))
1210
+ p[0] = v;
1211
+ else
1212
+ break;
1213
+ }
1214
+ return p;
1215
+ }
1216
+ var an = function(t, e) {
1217
+ if (!(t instanceof e))
1218
+ throw new TypeError("Cannot call a class as a function");
1219
+ }, on = function() {
1220
+ function t(e, s) {
1221
+ for (var n = 0; n < s.length; n++) {
1222
+ var i = s[n];
1223
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
1224
+ }
1225
+ }
1226
+ return function(e, s, n) {
1227
+ return s && t(e.prototype, s), n && t(e, n), e;
1228
+ };
1229
+ }(), ln = function(t, e) {
1230
+ if (typeof e != "function" && e !== null)
1231
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1232
+ t.prototype = Object.create(e && e.prototype, {
1233
+ constructor: {
1234
+ value: t,
1235
+ enumerable: !1,
1236
+ writable: !0,
1237
+ configurable: !0
1238
+ }
1239
+ }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1240
+ }, xe = function(t, e) {
1241
+ if (!t)
1242
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1243
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1244
+ }, cn = function(t) {
1245
+ ln(e, t);
1246
+ function e() {
1247
+ var s, n, i, d;
1248
+ an(this, e);
1249
+ for (var p = arguments.length, m = Array(p), f = 0; f < p; f++)
1250
+ m[f] = arguments[f];
1251
+ return d = (n = (i = xe(this, (s = e.__proto__ || Object.getPrototypeOf(e)).call.apply(s, [this].concat(m))), i), i._lastRenderedStartIndex = -1, i._lastRenderedStopIndex = -1, i._memoizedUnloadedRanges = [], i._onItemsRendered = function(M) {
1252
+ var z = M.visibleStartIndex, y = M.visibleStopIndex;
1253
+ i._lastRenderedStartIndex = z, i._lastRenderedStopIndex = y, i._ensureRowsLoaded(z, y);
1254
+ }, i._setRef = function(M) {
1255
+ i._listRef = M;
1256
+ }, n), xe(i, d);
1257
+ }
1258
+ return on(e, [{
1259
+ key: "resetloadMoreItemsCache",
1260
+ value: function() {
1261
+ var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1262
+ this._memoizedUnloadedRanges = [], n && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
1263
+ }
1264
+ }, {
1265
+ key: "componentDidMount",
1266
+ value: function() {
1267
+ }
1268
+ }, {
1269
+ key: "render",
1270
+ value: function() {
1271
+ var n = this.props.children;
1272
+ return n({
1273
+ onItemsRendered: this._onItemsRendered,
1274
+ ref: this._setRef
1275
+ });
1276
+ }
1277
+ }, {
1278
+ key: "_ensureRowsLoaded",
1279
+ value: function(n, i) {
1280
+ var d = this.props, p = d.isItemLoaded, m = d.itemCount, f = d.minimumBatchSize, M = f === void 0 ? 10 : f, z = d.threshold, y = z === void 0 ? 15 : z, l = rn({
1281
+ isItemLoaded: p,
1282
+ itemCount: m,
1283
+ minimumBatchSize: M,
1284
+ startIndex: Math.max(0, n - y),
1285
+ stopIndex: Math.min(m - 1, i + y)
1286
+ });
1287
+ (this._memoizedUnloadedRanges.length !== l.length || this._memoizedUnloadedRanges.some(function(v, I) {
1288
+ return l[I] !== v;
1289
+ })) && (this._memoizedUnloadedRanges = l, this._loadUnloadedRanges(l));
1290
+ }
1291
+ }, {
1292
+ key: "_loadUnloadedRanges",
1293
+ value: function(n) {
1294
+ for (var i = this, d = this.props.loadMoreItems || this.props.loadMoreRows, p = function(M) {
1295
+ var z = n[M], y = n[M + 1], l = d(z, y);
1296
+ l != null && l.then(function() {
1297
+ if (nn({
1298
+ lastRenderedStartIndex: i._lastRenderedStartIndex,
1299
+ lastRenderedStopIndex: i._lastRenderedStopIndex,
1300
+ startIndex: z,
1301
+ stopIndex: y
1302
+ })) {
1303
+ if (i._listRef == null)
1304
+ return;
1305
+ typeof i._listRef.resetAfterIndex == "function" ? i._listRef.resetAfterIndex(z, !0) : (typeof i._listRef._getItemStyleCache == "function" && i._listRef._getItemStyleCache(-1), i._listRef.forceUpdate());
1306
+ }
1307
+ });
1308
+ }, m = 0; m < n.length; m += 2)
1309
+ p(m);
1310
+ }
1311
+ }]), e;
1312
+ }(Ce);
1313
+ const dn = () => w, un = /* @__PURE__ */ o("div")({
1314
+ name: "a",
1315
+ class: "a1w9zony",
1316
+ propsAsIs: !1
1317
+ }), pn = /* @__PURE__ */ o("div")({
1318
+ name: "l",
1319
+ class: "l16qcfv8",
1320
+ propsAsIs: !1
1321
+ }), hn = /* @__PURE__ */ o("img")({
1322
+ name: "p",
1323
+ class: "p1gmcc5f",
1324
+ propsAsIs: !1
1325
+ }), mn = /* @__PURE__ */ o("div")({
1326
+ name: "s",
1327
+ class: "s1doddh0",
1328
+ propsAsIs: !1
1329
+ }), fn = /* @__PURE__ */ o("div")({
1330
+ name: "c",
1331
+ class: "c1js9xhe",
1332
+ propsAsIs: !1
1333
+ }), gn = /* @__PURE__ */ o("div")({
1334
+ name: "d",
1335
+ class: "d1tmnqsh",
1336
+ propsAsIs: !1
1337
+ }), In = /* @__PURE__ */ o("span")({
1338
+ name: "g",
1339
+ class: "gi9h87j",
1340
+ propsAsIs: !1
1341
+ }), vn = /* @__PURE__ */ o(dn())({
1342
+ name: "x",
1343
+ class: "x13mk3z6",
1344
+ propsAsIs: !0
1345
+ }), Mn = ({
1346
+ rank: t,
1347
+ avatar: e,
1348
+ name: s,
1349
+ points: n,
1350
+ isCurrentUser: i,
1351
+ openItemDetail: d,
1352
+ style: p
1353
+ }) => /* @__PURE__ */ N(un, { onClick: d, style: p, children: [
1354
+ /* @__PURE__ */ a(pn, { children: t || 0 }),
1355
+ /* @__PURE__ */ N(fn, { children: [
1356
+ e ? /* @__PURE__ */ a(hn, { alt: "leaderboard-item-avatar", src: e }) : /* @__PURE__ */ a(mn, { children: be(s || "") }),
1357
+ /* @__PURE__ */ N(gn, { children: [
1358
+ /* @__PURE__ */ a(In, { children: s || "" }),
1359
+ i && /* @__PURE__ */ a(vn, { name: "icon-star" })
1360
+ ] })
1361
+ ] }),
1362
+ /* @__PURE__ */ a("div", { children: ke(n) })
1363
+ ] }), yn = ({ items: t, openItemDetail: e, fetchMore: s }) => /* @__PURE__ */ a(Vs, { children: ({ width: n, height: i }) => /* @__PURE__ */ a(
1364
+ cn,
1365
+ {
1366
+ isItemLoaded: (d) => d < t.length,
1367
+ itemCount: t.length + 1,
1368
+ loadMoreItems: s,
1369
+ children: ({ onItemsRendered: d, ref: p }) => /* @__PURE__ */ a(
1370
+ sn,
1371
+ {
1372
+ itemSize: 56,
1373
+ onItemsRendered: d,
1374
+ ref: p,
1375
+ itemCount: t.length,
1376
+ width: n,
1377
+ height: i,
1378
+ children: ({ index: m, style: f }) => /* @__PURE__ */ a(
1379
+ Mn,
1380
+ {
1381
+ style: { ...f, maxHeight: 48 },
1382
+ ...t[m],
1383
+ openItemDetail: () => e(t[m].userId)
1384
+ },
1385
+ t[m].userId
1386
+ )
1387
+ }
1388
+ )
1389
+ }
1390
+ ) }), Nn = ({ leaderboardList: t, openUser: e }) => {
1391
+ const { data: s } = E(t.$store);
1392
+ return /* @__PURE__ */ a(yn, { fetchMore: t.fetchMore, items: s, openItemDetail: e });
1393
+ };
1394
+ const zn = /* @__PURE__ */ o("button")({
1395
+ name: "a",
1396
+ class: "akly9h2",
1397
+ propsAsIs: !1
1398
+ }), _n = /* @__PURE__ */ o("span")({
1399
+ name: "e",
1400
+ class: "eptoiz9",
1401
+ propsAsIs: !1
1402
+ }), Tn = ({ disabled: t, variant: e = "primary", onClick: s, children: n, ...i }) => /* @__PURE__ */ a(zn, { onClick: s, disabled: t, "data-variant": e, ...i, children: /* @__PURE__ */ a(_n, { children: n }) });
1403
+ const An = () => w, Sn = () => w, Dn = /* @__PURE__ */ o("div")({
1404
+ name: "s",
1405
+ class: "s1lblda3",
1406
+ propsAsIs: !1
1407
+ }), xn = /* @__PURE__ */ o("div")({
1408
+ name: "a",
1409
+ class: "ascvb2g",
1410
+ propsAsIs: !1
1411
+ }), wn = /* @__PURE__ */ o("div")({
1412
+ name: "p",
1413
+ class: "p17rl8zy",
1414
+ propsAsIs: !1
1415
+ }), On = /* @__PURE__ */ o("div")({
1416
+ name: "l",
1417
+ class: "l1vvttbn",
1418
+ propsAsIs: !1
1419
+ }), ee = /* @__PURE__ */ o(An())({
1420
+ name: "c",
1421
+ class: "c6fk2ph",
1422
+ propsAsIs: !0
1423
+ }), bn = /* @__PURE__ */ o(Sn())({
1424
+ name: "d",
1425
+ class: "d1rdm136",
1426
+ propsAsIs: !0
1427
+ }), kn = /* @__PURE__ */ o("div")({
1428
+ name: "f",
1429
+ class: "fwqnnel",
1430
+ propsAsIs: !1
1431
+ }), En = /* @__PURE__ */ o("div")({
1432
+ name: "u",
1433
+ class: "ucyxnlg",
1434
+ propsAsIs: !1
1435
+ }), jn = {
1436
+ [P.LOST]: /* @__PURE__ */ a(ee, { name: "icon-cross" }),
1437
+ [P.WON]: /* @__PURE__ */ a(ee, { name: "icon-check" }),
1438
+ [P.UNSET]: void 0,
1439
+ [P.DNP]: /* @__PURE__ */ a(ee, { name: "icon-arrow" })
1440
+ }, Ln = ({
1441
+ questionId: t,
1442
+ questionType: e,
1443
+ questionStatus: s,
1444
+ subject: n,
1445
+ openForVoting: i,
1446
+ openQuestion: d,
1447
+ status: p
1448
+ }) => {
1449
+ const m = Oe[e], f = jn[p];
1450
+ return m ? /* @__PURE__ */ N(Dn, { onClick: () => d == null ? void 0 : d(t), children: [
1451
+ /* @__PURE__ */ N(En, { children: [
1452
+ /* @__PURE__ */ N(xn, { children: [
1453
+ /* @__PURE__ */ a(bn, { name: m.iconName }),
1454
+ /* @__PURE__ */ N(kn, { children: [
1455
+ m.label,
1456
+ e === x.TRIVIA && s === re.RESOLVED && " • Expired"
1457
+ ] })
1458
+ ] }),
1459
+ /* @__PURE__ */ a(wn, { children: n || "" })
1460
+ ] }),
1461
+ /* @__PURE__ */ a(On, { children: f || (i ? /* @__PURE__ */ a(Tn, { children: "Play" }) : null) })
1462
+ ] }) : null;
1463
+ };
1464
+ const Cn = /* @__PURE__ */ o("div")({
1465
+ name: "e",
1466
+ class: "e1jcgove",
1467
+ propsAsIs: !1
1468
+ }), Rn = /* @__PURE__ */ o("div")({
1469
+ name: "t",
1470
+ class: "t1bwp7hh",
1471
+ propsAsIs: !1
1472
+ }), $n = /* @__PURE__ */ o("div")({
1473
+ name: "i",
1474
+ class: "i1xav4cl",
1475
+ propsAsIs: !1
1476
+ }), Un = /* @__PURE__ */ o("h3")({
1477
+ name: "n",
1478
+ class: "n3qb30y",
1479
+ propsAsIs: !1
1480
+ }), Qn = /* @__PURE__ */ o("div")({
1481
+ name: "a",
1482
+ class: "ap5d9g7",
1483
+ propsAsIs: !1
1484
+ }), qn = /* @__PURE__ */ o("button")({
1485
+ name: "l",
1486
+ class: "lvdbmlu",
1487
+ propsAsIs: !1
1488
+ }), Yn = ({
1489
+ title: t,
1490
+ instantView: e,
1491
+ openInsight: s,
1492
+ questionId: n
1493
+ }) => {
1494
+ const i = /* @__PURE__ */ new Date(), d = i.toLocaleDateString("en-US", {
1495
+ weekday: "short",
1496
+ month: "short",
1497
+ day: "numeric"
1498
+ }), p = i.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
1499
+ return /* @__PURE__ */ N(Cn, { children: [
1500
+ /* @__PURE__ */ N(Rn, { children: [
1501
+ d,
1502
+ "・",
1503
+ p
1504
+ ] }),
1505
+ (e == null ? void 0 : e.video) && /* @__PURE__ */ a(je, { source: e.video.url, poster: e.video.thumbnailUrl }),
1506
+ /* @__PURE__ */ N($n, { children: [
1507
+ /* @__PURE__ */ a(Un, { children: (e == null ? void 0 : e.heading) || t }),
1508
+ /* @__PURE__ */ a(Qn, { children: e == null ? void 0 : e.body }),
1509
+ s && /* @__PURE__ */ a(qn, { onClick: () => s(n), children: "View Insight" })
1510
+ ] })
1511
+ ] });
1512
+ };
1513
+ const Pn = /* @__PURE__ */ o("div")({
1514
+ name: "t",
1515
+ class: "t19vr3p1",
1516
+ propsAsIs: !1
1517
+ }), Wn = ({ questions: t, openQuestion: e }) => /* @__PURE__ */ a(Pn, { children: t == null ? void 0 : t.map((s) => {
1518
+ var n, i;
1519
+ if (s.type === "question" && ((n = s.attributes) == null ? void 0 : n.attributes.case) === "question") {
1520
+ const d = s.attributes.attributes.value;
1521
+ return /* @__PURE__ */ a(Ln, { openQuestion: e, ...d }, d.questionId);
1522
+ }
1523
+ if (s.type === "insight" && ((i = s.attributes) == null ? void 0 : i.attributes.case) === "insight") {
1524
+ const d = s.attributes.attributes.value;
1525
+ return /* @__PURE__ */ a(Yn, { openInsight: e, ...d }, d.questionId);
1526
+ }
1527
+ return null;
1528
+ }) }), Fn = ({ store: t, openQuestion: e }) => {
1529
+ const s = E(t);
1530
+ return s != null && s.data ? /* @__PURE__ */ a(Wn, { openQuestion: e, questions: s.data }) : /* @__PURE__ */ a("div", { children: "wait questions..." });
1531
+ }, Vn = ({ userSummary: t }) => {
1532
+ var e;
1533
+ const s = E(t.getStore());
1534
+ return (e = s.data) != null && e.summary ? /* @__PURE__ */ a($e, { ...s.data.summary, ...s.data.percentage }) : /* @__PURE__ */ a("div", { children: "wait user..." });
1535
+ }, Hn = ({ gamification: t }) => {
1536
+ const [e, s] = R(Q.HOME);
1537
+ return /* @__PURE__ */ N("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
1538
+ /* @__PURE__ */ N(Le, { children: [
1539
+ /* @__PURE__ */ a(Ws, { activePage: e, toggleActivePage: s }),
1540
+ e === Q.HOME && /* @__PURE__ */ a(Vn, { userSummary: t.userSummary })
1541
+ ] }),
1542
+ e === Q.HOME && /* @__PURE__ */ a(de, { children: /* @__PURE__ */ a(Fn, { openQuestion: t.openQuestion, store: t.feedList.getStore() }) }),
1543
+ e === Q.LEADERBOARD && /* @__PURE__ */ a(de, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ a(Nn, { openUser: t.openUser, leaderboardList: t.leaderboardList }) })
1544
+ ] });
1545
+ };
1546
+ const Bn = () => Je, we = /* @__PURE__ */ o(Bn())({
1547
+ name: "m",
1548
+ class: "m1ph66cs",
1549
+ propsAsIs: !0
1550
+ }), Gn = /* @__PURE__ */ o("div")({
1551
+ name: "x",
1552
+ class: "xorme7i",
1553
+ propsAsIs: !1
1554
+ }), Xn = ({
1555
+ gamification: t,
1556
+ className: e
1557
+ }) => {
1558
+ const s = E(t.openedQuestion.$store), n = E(t.openedUser);
1559
+ return /* @__PURE__ */ N(V, {
1560
+ children: [s && /* @__PURE__ */ a(we, {
1561
+ className: e,
1562
+ children: /* @__PURE__ */ a(Us, {
1563
+ gamification: t
1564
+ })
1565
+ }), n && /* @__PURE__ */ a(we, {
1566
+ className: e,
1567
+ children: /* @__PURE__ */ N(Gn, {
1568
+ children: [/* @__PURE__ */ a(Re, {
1569
+ label: "Friend's Rank",
1570
+ close: t.closeUser
1571
+ }), /* @__PURE__ */ a(Le, {
1572
+ children: /* @__PURE__ */ a($e, {
1573
+ ...n
1574
+ })
1575
+ })]
1576
+ })
1577
+ }), /* @__PURE__ */ a(Ee, {
1578
+ className: e,
1579
+ "data-nav": "true",
1580
+ children: /* @__PURE__ */ a(Hn, {
1581
+ gamification: t
1582
+ })
1583
+ })]
1584
+ });
1585
+ };
1586
+ export {
1587
+ Xn as GamificationOverlay,
1588
+ Xn as default
1589
+ };