@streamlayer/react 0.29.3 → 0.29.4
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.
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/dist/cjs/masters.js +1 -1
- package/lib/dist/es/masters.js +1 -1
- package/lib/dist/{index-74fad1da.js → index-660952d7.js} +24 -24
- package/lib/dist/{index-5db9fe4d.cjs → index-72e4d21b.cjs} +1 -1
- package/lib/dist/index.d.ts +7 -0
- package/lib/dist/masters-7ea5d23e.cjs +29 -0
- package/lib/dist/{masters-7b69b363.js → masters-8c4e7068.js} +4976 -4732
- package/lib/dist/style.css +29 -3
- package/lib/es/masters.js +2 -2
- package/lib/es/points.js +3 -3
- package/lib/{index-0ee221fc.js → index-616b0bcd.js} +127 -98
- package/lib/index-b0206045.cjs +1 -0
- package/lib/{index-14d36d45.cjs → index-eb5039cd.cjs} +2 -2
- package/lib/{index-ffb81042.js → index-efde52fd.js} +2 -2
- package/lib/masters-05fe9e78.cjs +1 -0
- package/lib/masters-e142c21e.js +608 -0
- package/lib/style.css +1 -1
- package/package.json +5 -5
- package/lib/dist/masters-8b4d5688.cjs +0 -29
- package/lib/index-dc9aee43.cjs +0 -1
- package/lib/masters-6226c77f.cjs +0 -1
- package/lib/masters-62d1a034.js +0 -400
package/lib/cjs/masters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../index-89c19a6e.cjs");const e=require("../masters-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("../index-89c19a6e.cjs");const e=require("../masters-05fe9e78.cjs");require("react");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");require("@streamlayer/sdk-web-types");require("@nanostores/react");require("@streamlayer/sdk-web-interfaces");require("../index-b0206045.cjs");require("@streamlayer/sdk-web-notifications");exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;
|
package/lib/cjs/points.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@streamlayer/sdk-web-types"),i=require("../index-89c19a6e.cjs"),c=require("../common-f34b9d88.cjs"),t=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@streamlayer/sdk-web-types"),i=require("../index-89c19a6e.cjs"),c=require("../common-f34b9d88.cjs"),t=require("../index-b0206045.cjs"),u=require("react"),o=require("@nanostores/react"),d=require("../app-c9828ece.cjs");require("./useStreamLayerApp.js");require("@streamlayer/sdk-web");const m=()=>t.C1,p=t.styled_default("div")({name:"l",class:"l4qld3l",propsAsIs:!1}),y=t.styled_default("div")({name:"a",class:"ainhtok",propsAsIs:!1}),f=t.styled_default(m())({name:"x",class:"xk8yd5t",propsAsIs:!0}),x=t.styled_default("div")({name:"h",class:"h6rf9gb",propsAsIs:!1}),S=t.styled_default("div")({name:"c",class:"c18f5pxx",propsAsIs:!1}),j=t.styled_default("div")({name:"m",class:"m1jwsyj1",propsAsIs:!1}),h=({points:s})=>e.jsxs(p,{className:i.f,children:[e.jsx(y,{children:e.jsx(f,{name:"icon-trophy"})}),e.jsxs(x,{children:[e.jsx(S,{children:"Total points"}),e.jsx(j,{children:c.i(s)})]})]}),q=({userSummary:s})=>{var a,r;const n=o.useStore(s.getStore());return((r=(a=n.data)==null?void 0:a.summary)==null?void 0:r.points)===void 0?null:e.jsx("div",{className:"StreamLayerSDK",children:e.jsx(i.p,{children:e.jsx(h,{points:n.data.summary.points})})})},g=({sdk:s})=>{const{organizationSettings:n,streamSettings:a}=o.useStore(s.sdkStore),r=u.useMemo(()=>s.getFeature(l.FeatureType.GAMES),[s,n,a]);return r?e.jsx(q,{userSummary:r.userSummary}):null},v=()=>{const s=d.useStreamLayer();return s?e.jsx(g,{sdk:s}):null};exports.StreamLayerSDKPoints=v;
|
package/lib/dist/cjs/masters.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../masters-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../masters-7ea5d23e.cjs");require("react/jsx-runtime");require("react");exports.MastersStreamLayerProvider=e.MastersStreamLayerProvider;exports.MastersStreamLayerSDKReact=e.MastersStreamLayerSDKReact;exports.StreamLayerLogin=e.StreamLayerLogin;exports.StreamLayerSDKPoints=e.StreamLayerSDKPoints;
|
package/lib/dist/es/masters.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as y, jsx as a, Fragment as q } from "react/jsx-runtime";
|
|
2
|
-
import { s as o,
|
|
3
|
-
import U, { useRef as b, useState as
|
|
2
|
+
import { s as o, C as w, o as be, a as ke, i as je, Q as D, b as Y, c as L, E as C, r as Le, d as Ke, e as Xe, n as et, w as tt, u as k, f as st, P as F, g as Ce, h as ue, j as nt } from "./masters-8c4e7068.js";
|
|
3
|
+
import U, { useRef as b, useState as R, useCallback as G, useEffect as it, useLayoutEffect as rt, useMemo as H, Component as at, createElement as B, PureComponent as Re } from "react";
|
|
4
4
|
const ot = () => w, lt = () => w, ct = /* @__PURE__ */ o("div")({
|
|
5
5
|
name: "a",
|
|
6
6
|
class: "acysrl1",
|
|
@@ -127,11 +127,11 @@ const zt = /* @__PURE__ */ o("div")({
|
|
|
127
127
|
name: "u",
|
|
128
128
|
class: "u1gsbhq4",
|
|
129
129
|
propsAsIs: !1
|
|
130
|
-
}),
|
|
130
|
+
}), Ct = /* @__PURE__ */ o("div")({
|
|
131
131
|
name: "m",
|
|
132
132
|
class: "mvj8oco",
|
|
133
133
|
propsAsIs: !1
|
|
134
|
-
}),
|
|
134
|
+
}), Rt = /* @__PURE__ */ o("button")({
|
|
135
135
|
name: "v",
|
|
136
136
|
class: "viqiaf2",
|
|
137
137
|
propsAsIs: !1
|
|
@@ -148,9 +148,9 @@ const zt = /* @__PURE__ */ o("div")({
|
|
|
148
148
|
average: g
|
|
149
149
|
}) => /* @__PURE__ */ y(zt, { children: [
|
|
150
150
|
/* @__PURE__ */ a(Nt, { children: /* @__PURE__ */ y(Tt, { children: [
|
|
151
|
-
/* @__PURE__ */ y(
|
|
151
|
+
/* @__PURE__ */ y(Rt, { children: [
|
|
152
152
|
t && /* @__PURE__ */ a(At, { alt: "avatar", src: t }),
|
|
153
|
-
!t && /* @__PURE__ */ a(
|
|
153
|
+
!t && /* @__PURE__ */ a(Ct, { children: ke(e || "") })
|
|
154
154
|
] }),
|
|
155
155
|
/* @__PURE__ */ y(St, { children: [
|
|
156
156
|
/* @__PURE__ */ a(Dt, { children: e }),
|
|
@@ -379,7 +379,7 @@ const Gt = () => Qe, Zt = () => Qe, Jt = () => w, Kt = /* @__PURE__ */ o("button
|
|
|
379
379
|
);
|
|
380
380
|
};
|
|
381
381
|
var ge = typeof window > "u" ? it : rt, ps = ({ isPlaying: t, duration: e, startAt: s = 0, updateInterval: n = 0, onComplete: i, onUpdate: u }) => {
|
|
382
|
-
let [p, f] =
|
|
382
|
+
let [p, f] = R(s), m = b(0), g = b(s), N = b(s * -1e3), z = b(null), l = b(null), M = b(null), v = (c) => {
|
|
383
383
|
let d = c / 1e3;
|
|
384
384
|
if (l.current === null) {
|
|
385
385
|
l.current = d, z.current = requestAnimationFrame(v);
|
|
@@ -442,16 +442,16 @@ var ge = typeof window > "u" ? it : rt, ps = ({ isPlaying: t, duration: e, start
|
|
|
442
442
|
return U.createElement("div", { style: ms(z) }, U.createElement("svg", { viewBox: `0 0 ${z} ${z}`, width: z, height: z, xmlns: "http://www.w3.org/2000/svg" }, U.createElement("path", { d: u, fill: "none", stroke: n ?? "#d9d9d9", strokeWidth: i ?? l }), U.createElement("path", { d: u, fill: "none", stroke: f, strokeLinecap: s ?? "round", strokeWidth: l, strokeDasharray: p, strokeDashoffset: m })), typeof e == "function" && U.createElement("div", { style: fs }, e({ remainingTime: g, elapsedTime: N, color: f })));
|
|
443
443
|
};
|
|
444
444
|
Ye.displayName = "CountdownCircleTimer";
|
|
445
|
-
const vs = [
|
|
445
|
+
const vs = [C.PRIMARY_GREEN1, C.SECONDARY_RED1, C.SECONDARY_RED1], Ms = [10, 10, 0], ys = /* @__PURE__ */ o("div")({
|
|
446
446
|
name: "A",
|
|
447
447
|
class: "a1f928zy",
|
|
448
448
|
propsAsIs: !1
|
|
449
|
-
}), zs =
|
|
449
|
+
}), zs = C.SECONDARY_GREEN6, Me = C.SECONDARY_RED3, Ns = C.NEUTRALS_GRAY3, _s = ({
|
|
450
450
|
isPlaying: t = !0,
|
|
451
451
|
duration: e = 30,
|
|
452
452
|
onTimerExpired: s
|
|
453
453
|
}) => {
|
|
454
|
-
const [n, i] =
|
|
454
|
+
const [n, i] = R(e > 10 ? zs : Me), u = ({
|
|
455
455
|
remainingTime: m
|
|
456
456
|
}) => /* @__PURE__ */ a(ys, {
|
|
457
457
|
children: m
|
|
@@ -516,7 +516,7 @@ const Ts = () => w, As = /* @__PURE__ */ o("div")({
|
|
|
516
516
|
n && /* @__PURE__ */ a(_s, { isPlaying: s, onTimerExpired: i })
|
|
517
517
|
] }), ks = ({ openedQuestion: t, vote: e }) => {
|
|
518
518
|
var s;
|
|
519
|
-
const n = t.subject, i = t.type, u = (s = t.options) == null ? void 0 : s.options, [p, f] =
|
|
519
|
+
const n = t.subject, i = t.type, u = (s = t.options) == null ? void 0 : s.options, [p, f] = R(!1), [m, g] = R(!1), [N, z] = R(""), l = t == null ? void 0 : t.id, M = G(
|
|
520
520
|
async (d) => {
|
|
521
521
|
if (l) {
|
|
522
522
|
const I = d.currentTarget.value;
|
|
@@ -575,11 +575,11 @@ const js = /* @__PURE__ */ o("div")({
|
|
|
575
575
|
name: "i",
|
|
576
576
|
class: "iigl87b",
|
|
577
577
|
propsAsIs: !1
|
|
578
|
-
}),
|
|
578
|
+
}), Cs = /* @__PURE__ */ o("h3")({
|
|
579
579
|
name: "n",
|
|
580
580
|
class: "n1o2cwub",
|
|
581
581
|
propsAsIs: !1
|
|
582
|
-
}),
|
|
582
|
+
}), Rs = /* @__PURE__ */ o("div")({
|
|
583
583
|
name: "r",
|
|
584
584
|
class: "r3uxe45",
|
|
585
585
|
propsAsIs: !1
|
|
@@ -607,8 +607,8 @@ const js = /* @__PURE__ */ o("div")({
|
|
|
607
607
|
] }),
|
|
608
608
|
(s == null ? void 0 : s.video) && /* @__PURE__ */ a(tt, { source: s.video.url, poster: s.video.thumbnailUrl }),
|
|
609
609
|
/* @__PURE__ */ y(Ls, { children: [
|
|
610
|
-
/* @__PURE__ */ a(
|
|
611
|
-
/* @__PURE__ */ a(
|
|
610
|
+
/* @__PURE__ */ a(Cs, { children: (s == null ? void 0 : s.heading) || e }),
|
|
611
|
+
/* @__PURE__ */ a(Rs, { children: s == null ? void 0 : s.body })
|
|
612
612
|
] })
|
|
613
613
|
] });
|
|
614
614
|
};
|
|
@@ -1154,7 +1154,7 @@ function on(t) {
|
|
|
1154
1154
|
var A = p(this.props, _, this._instanceProps), S = f(this.props, A, _, this._instanceProps), O = !I || T === "backward" ? Math.max(1, c) : 1, E = !I || T === "forward" ? Math.max(1, c) : 1;
|
|
1155
1155
|
return [Math.max(0, A - O), Math.max(0, Math.min(h - 1, S + E)), A, S];
|
|
1156
1156
|
}, l;
|
|
1157
|
-
}(
|
|
1157
|
+
}(Re), e.defaultProps = {
|
|
1158
1158
|
direction: "ltr",
|
|
1159
1159
|
itemData: void 0,
|
|
1160
1160
|
layout: "vertical",
|
|
@@ -1332,7 +1332,7 @@ var pn = function(t, e) {
|
|
|
1332
1332
|
p(f);
|
|
1333
1333
|
}
|
|
1334
1334
|
}]), e;
|
|
1335
|
-
}(
|
|
1335
|
+
}(Re);
|
|
1336
1336
|
const gn = () => w, In = /* @__PURE__ */ o("div")({
|
|
1337
1337
|
name: "a",
|
|
1338
1338
|
class: "a1w9zony",
|
|
@@ -1435,7 +1435,7 @@ const En = () => w, bn = () => w, kn = /* @__PURE__ */ o("div")({
|
|
|
1435
1435
|
name: "p",
|
|
1436
1436
|
class: "p17rl8zy",
|
|
1437
1437
|
propsAsIs: !1
|
|
1438
|
-
}),
|
|
1438
|
+
}), Cn = /* @__PURE__ */ o("div")({
|
|
1439
1439
|
name: "l",
|
|
1440
1440
|
class: "l1vvttbn",
|
|
1441
1441
|
propsAsIs: !1
|
|
@@ -1443,7 +1443,7 @@ const En = () => w, bn = () => w, kn = /* @__PURE__ */ o("div")({
|
|
|
1443
1443
|
name: "c",
|
|
1444
1444
|
class: "c6fk2ph",
|
|
1445
1445
|
propsAsIs: !0
|
|
1446
|
-
}),
|
|
1446
|
+
}), Rn = /* @__PURE__ */ o(bn())({
|
|
1447
1447
|
name: "d",
|
|
1448
1448
|
class: "d1rdm136",
|
|
1449
1449
|
propsAsIs: !0
|
|
@@ -1473,7 +1473,7 @@ const En = () => w, bn = () => w, kn = /* @__PURE__ */ o("div")({
|
|
|
1473
1473
|
return f ? /* @__PURE__ */ y(kn, { onClick: () => u == null ? void 0 : u(t), children: [
|
|
1474
1474
|
/* @__PURE__ */ y(Un, { children: [
|
|
1475
1475
|
/* @__PURE__ */ y(jn, { children: [
|
|
1476
|
-
/* @__PURE__ */ a(
|
|
1476
|
+
/* @__PURE__ */ a(Rn, { name: f.iconName }),
|
|
1477
1477
|
/* @__PURE__ */ y($n, { children: [
|
|
1478
1478
|
f.label,
|
|
1479
1479
|
e === D.TRIVIA && s === Y.RESOLVED && " • Expired"
|
|
@@ -1481,7 +1481,7 @@ const En = () => w, bn = () => w, kn = /* @__PURE__ */ o("div")({
|
|
|
1481
1481
|
] }),
|
|
1482
1482
|
/* @__PURE__ */ a(Ln, { children: n || "" })
|
|
1483
1483
|
] }),
|
|
1484
|
-
/* @__PURE__ */ a(
|
|
1484
|
+
/* @__PURE__ */ a(Cn, { children: m || (i ? /* @__PURE__ */ a(On, { children: "Play" }) : null) })
|
|
1485
1485
|
] }) : null;
|
|
1486
1486
|
};
|
|
1487
1487
|
const Yn = /* @__PURE__ */ o("div")({
|
|
@@ -1523,9 +1523,9 @@ const Fn = /* @__PURE__ */ o("div")({
|
|
|
1523
1523
|
const s = k(t.getStore());
|
|
1524
1524
|
return (e = s.data) != null && e.summary ? /* @__PURE__ */ a(Ue, { ...s.data.summary, ...s.data.percentage }) : /* @__PURE__ */ a("div", { children: "wait user..." });
|
|
1525
1525
|
}, Gn = ({ gamification: t }) => {
|
|
1526
|
-
const [e, s] =
|
|
1526
|
+
const [e, s] = R(Q.HOME);
|
|
1527
1527
|
return /* @__PURE__ */ y("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
1528
|
-
/* @__PURE__ */ y(
|
|
1528
|
+
/* @__PURE__ */ y(Ce, { children: [
|
|
1529
1529
|
/* @__PURE__ */ a(Zs, { activePage: e, toggleActivePage: s }),
|
|
1530
1530
|
e === Q.HOME && /* @__PURE__ */ a(Bn, { userSummary: t.userSummary })
|
|
1531
1531
|
] }),
|
|
@@ -1558,7 +1558,7 @@ const Zn = () => nt, Ee = /* @__PURE__ */ o(Zn())({
|
|
|
1558
1558
|
children: [/* @__PURE__ */ a($e, {
|
|
1559
1559
|
label: "Friend's Rank",
|
|
1560
1560
|
close: t.closeUser
|
|
1561
|
-
}), /* @__PURE__ */ a(
|
|
1561
|
+
}), /* @__PURE__ */ a(Ce, {
|
|
1562
1562
|
children: /* @__PURE__ */ a(Ue, {
|
|
1563
1563
|
...n
|
|
1564
1564
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./masters-8b4d5688.cjs"),j=require("react");const Oe=()=>i.t1,ke=()=>i.t1,be=i.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Le=i.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),Re=i.styled_default(Oe())({name:"p",class:"p14kwh4y",propsAsIs:!0}),Ce=i.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),$e=i.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Qe=i.styled_default(ke())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),Ie=({type:t,close:e,label:s})=>{const r=t?i.o[t]:{label:s,iconName:void 0};return n.jsxs(be,{children:[n.jsxs(Le,{children:[(r==null?void 0:r.iconName)&&n.jsx(Re,{name:r.iconName}),(r==null?void 0:r.label)&&n.jsx(Ce,{children:r.label})]}),n.jsx($e,{onClick:e,children:n.jsx(Qe,{name:"icon-cross"})})]})};const Ue=i.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),qe=i.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Ye=i.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),J=({indicator:t,title:e})=>n.jsxs(Ue,{children:[n.jsx(qe,{children:e}),n.jsx(Ye,{children:t})]});const Pe=i.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),Fe=i.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),We=i.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),L=({indicator:t,title:e})=>n.jsxs(Pe,{children:[n.jsx(Fe,{children:t}),n.jsx(We,{children:e})]});const Ve=i.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),He=i.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),Be=i.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Ge=i.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),Ze=i.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Je=i.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Ke=i.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Xe=i.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),et=i.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),tt=i.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),st=i.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),nt=i.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),it=i.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),rt=i.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),at=i.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),ot=i.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),lt=i.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ye=({avatar:t,name:e,points:s,friendsRank:r,rank:a,streak:u,correct:p,incorrect:m,inTop:h,average:g})=>n.jsxs(Ve,{children:[n.jsx(He,{children:n.jsxs(Ge,{children:[n.jsxs(lt,{children:[t&&n.jsx(Ze,{alt:"avatar",src:t}),!t&&n.jsx(ot,{children:i.o$1(e||"")})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:e}),n.jsxs(Xe,{children:[n.jsxs(tt,{children:[n.jsx(et,{alt:"rank-icon",src:ct}),n.jsxs(st,{children:[i.i(s),n.jsx(nt,{children:"PTS"})]})]}),n.jsx(it,{}),n.jsxs("div",{children:["TOP ",h||0,"%"]})]})]})]})}),n.jsxs(Be,{children:[n.jsxs(rt,{children:[n.jsx(J,{indicator:r||0,title:"Friends rank"}),n.jsx(J,{indicator:a||0,title:"Global rank"})]}),n.jsxs(at,{children:[n.jsx(L,{indicator:u||0,title:"Win streak"}),n.jsx(L,{indicator:p||0,title:"Correct"}),n.jsx(L,{indicator:m||0,title:"Incorrect"}),n.jsx(L,{indicator:`${g||0}%`,title:"Succ. rate"})]})]})]});const dt=()=>i.t1,ut=i.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),pt=i.styled_default(dt())({name:"n",class:"nfic4xc",propsAsIs:!0}),K=i.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),X=i.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),ft=i.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),C=i.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),ht=i.styled_default("div")({name:"s",class:"smnc4zm",propsAsIs:!1}),mt=({feedbackMessages:t,questionVotedCorrectly:e,questionVoted:s,questionType:r,hasCorrectAnswer:a,questionStatus:u})=>{const p=s&&(r===i.QuestionType.TRIVIA||r===i.QuestionType.PREDICTION);if(!p&&u!==i.QuestionStatus.RESOLVED)return null;const m=r===i.QuestionType.PREDICTION&&!a,h=e?"correct":"incorrect",g=e?t.correctFeedback:t.incorrectFeedback;return n.jsxs(ut,{"data-isPrediction":m,children:[u===i.QuestionStatus.RESOLVED&&r===i.QuestionType.TRIVIA&&!s&&n.jsxs(n.Fragment,{children:[n.jsx(K,{children:n.jsx(i.t1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(X,{children:n.jsx(C,{children:"Question Expired"})}),n.jsx(ht,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&n.jsxs(n.Fragment,{children:[n.jsx(pt,{name:"icon-prediction"}),n.jsx(C,{children:"Stay tuned to see if your prediction was correct."})]}),p&&a&&n.jsxs(n.Fragment,{children:[n.jsx(K,{"data-feedbackType":h,children:n.jsx(i.t1,{name:h})}),n.jsx("div",{children:n.jsxs(X,{children:[n.jsx(ft,{"data-feedbackType":h,children:g==null?void 0:g.title}),n.jsx(C,{children:g==null?void 0:g.description})]})})]})]})};const gt=i.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),It=i.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),yt=i.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),xt=i.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const vt=()=>xe,_t=()=>xe,Mt=()=>i.t1,jt=i.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),zt=i.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),Nt=i.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),Tt=i.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),St=i.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),xe=i.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),At=i.styled_default(vt())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),Dt=i.styled_default(_t())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),wt=i.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),Et=i.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),Ot=i.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),kt=i.styled_default(Mt())({name:"v",class:"v10s9my2",propsAsIs:!0}),ee={[i.QuestionImages.CENTERED]:t=>n.jsx(At,{alt:"option-icon",src:t}),[i.QuestionImages.TRANSPARENT]:t=>n.jsx(Tt,{children:n.jsx(St,{style:{backgroundImage:`url(${t})`}})}),[i.QuestionImages.ROUNDED]:t=>n.jsx(Dt,{alt:"option-icon",src:t}),[i.QuestionImages.NONE]:()=>null,[i.QuestionImages.UNSET]:()=>null},bt=({questionType:t,hasCorrectAnswer:e,correct:s,youVoted:r,questionVoted:a})=>{if(t===i.QuestionType.POLL&&r)return"correct";if(t===i.QuestionType.PREDICTION){if(e&&a)return r?s?"correct":"incorrect":s?"correct":"unset";if(r)return"correct"}return t===i.QuestionType.TRIVIA&&a?r?s?"correct":"incorrect":s?"correct":"unset":"unset"},Lt=({questionType:t,questionVoted:e,correct:s,hasCorrectAnswer:r,questionStatus:a})=>t===i.QuestionType.TRIVIA?e&&s:t===i.QuestionType.PREDICTION?e&&s&&r||a===i.QuestionStatus.RESOLVED&&s:!1,Rt=t=>{var e;const{id:s,icon:r,text:a,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:h,imageMode:g=i.QuestionImages.ROUNDED,answerTimeExpired:_,questionStatus:v,isLoading:l,questionType:x,correct:y,hasCorrectAnswer:o}=t,f=bt(t),c=Lt({questionType:x,questionVoted:h,correct:y,hasCorrectAnswer:o,questionStatus:v}),d=h||v===i.QuestionStatus.RESOLVED&&x===i.QuestionType.PREDICTION;return n.jsxs(jt,{value:s,"data-selected":m,"data-answerState":f,disabled:h||l||_,onClick:p,children:[d&&n.jsx(zt,{"data-answerState":f,style:{width:`${u}%`}}),n.jsxs(Nt,{children:[r&&((e=ee[g])==null?void 0:e.call(ee,r)),n.jsx(wt,{children:a}),d&&n.jsxs(Et,{children:[c&&n.jsx(kt,{name:"selected"}),n.jsxs(Ot,{children:[u,"%"]})]})]})]})};var te=typeof window>"u"?j.useEffect:j.useLayoutEffect,Ct=({isPlaying:t,duration:e,startAt:s=0,updateInterval:r=0,onComplete:a,onUpdate:u})=>{let[p,m]=j.useState(s),h=j.useRef(0),g=j.useRef(s),_=j.useRef(s*-1e3),v=j.useRef(null),l=j.useRef(null),x=j.useRef(null),y=c=>{let d=c/1e3;if(l.current===null){l.current=d,v.current=requestAnimationFrame(y);return}let I=d-l.current,z=h.current+I;l.current=d,h.current=z;let M=g.current+(r===0?z:(z/r|0)*r),N=g.current+z,T=typeof e=="number"&&N>=e;m(T?e:M),T||(v.current=requestAnimationFrame(y))},o=()=>{v.current&&cancelAnimationFrame(v.current),x.current&&clearTimeout(x.current),l.current=null},f=j.useCallback(c=>{o(),h.current=0;let d=typeof c=="number"?c:s;g.current=d,m(d),t&&(v.current=requestAnimationFrame(y))},[t,s]);return te(()=>{if(u==null||u(p),e&&p>=e){_.current+=e*1e3;let{shouldRepeat:c=!1,delay:d=0,newStartAt:I}=(a==null?void 0:a(_.current/1e3))||{};c&&(x.current=setTimeout(()=>f(I),d*1e3))}},[p,e]),te(()=>(t&&(v.current=requestAnimationFrame(y)),o),[t,e,r]),{elapsedTime:p,reset:f}},$t=(t,e,s)=>{let r=t/2,a=e/2,u=r-a,p=2*u,m=s==="clockwise"?"1,0":"0,1",h=2*Math.PI*u;return{path:`m ${r},${a} a ${u},${u} 0 ${m} 0,${p} a ${u},${u} 0 ${m} 0,-${p}`,pathLength:h}},se=(t,e)=>t===0||t===e?0:typeof e=="number"?t-e:0,Qt=t=>({position:"relative",width:t,height:t}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},ve=(t,e,s,r,a)=>{if(r===0)return e;let u=(a?r-t:t)/r;return e+s*u},ne=t=>{var e,s;return(s=(e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,u,p)=>`#${a}${a}${u}${u}${p}${p}`).substring(1).match(/.{2}/g))==null?void 0:e.map(r=>parseInt(r,16)))!=null?s:[]},qt=(t,e)=>{var s;let{colors:r,colorsTime:a,isSmoothColorTransition:u=!0}=t;if(typeof r=="string")return r;let p=(s=a==null?void 0:a.findIndex((l,x)=>l>=e&&e>=a[x+1]))!=null?s:-1;if(!a||p===-1)return r[0];if(!u)return r[p];let m=a[p]-e,h=a[p]-a[p+1],g=ne(r[p]),_=ne(r[p+1]),v=!!t.isGrowing;return`rgb(${g.map((l,x)=>ve(m,l,_[x]-l,h,v)|0).join(",")})`},Yt=t=>{let{duration:e,initialRemainingTime:s,updateInterval:r,size:a=180,strokeWidth:u=12,trailStrokeWidth:p,isPlaying:m=!1,isGrowing:h=!1,rotation:g="clockwise",onComplete:_,onUpdate:v}=t,l=j.useRef(),x=Math.max(u,p??0),{path:y,pathLength:o}=$t(a,x,g),{elapsedTime:f}=Ct({isPlaying:m,duration:e,startAt:se(e,s),updateInterval:r,onUpdate:typeof v=="function"?d=>{let I=Math.ceil(e-d);I!==l.current&&(l.current=I,v(I))}:void 0,onComplete:typeof _=="function"?d=>{var I;let{shouldRepeat:z,delay:M,newInitialRemainingTime:N}=(I=_(d))!=null?I:{};if(z)return{shouldRepeat:z,delay:M,newStartAt:se(e,N)}}:void 0}),c=e-f;return{elapsedTime:f,path:y,pathLength:o,remainingTime:Math.ceil(c),rotation:g,size:a,stroke:qt(t,c),strokeDashoffset:ve(f,0,o,e,h),strokeWidth:u}},_e=t=>{let{children:e,strokeLinecap:s,trailColor:r,trailStrokeWidth:a}=t,{path:u,pathLength:p,stroke:m,strokeDashoffset:h,remainingTime:g,elapsedTime:_,size:v,strokeWidth:l}=Yt(t);return j.createElement("div",{style:Qt(v)},j.createElement("svg",{viewBox:`0 0 ${v} ${v}`,width:v,height:v,xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:u,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??l}),j.createElement("path",{d:u,fill:"none",stroke:m,strokeLinecap:s??"round",strokeWidth:l,strokeDasharray:p,strokeDashoffset:h})),typeof e=="function"&&j.createElement("div",{style:Ut},e({remainingTime:g,elapsedTime:_,color:m})))};_e.displayName="CountdownCircleTimer";const Pt=[i.E.PRIMARY_GREEN1,i.E.SECONDARY_RED1,i.E.SECONDARY_RED1],Ft=[10,10,0],Wt=i.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),Vt=i.E.SECONDARY_GREEN6,ie=i.E.SECONDARY_RED3,Ht=i.E.NEUTRALS_GRAY3,Bt=({isPlaying:t=!0,duration:e=30,onTimerExpired:s})=>{const[r,a]=j.useState(e>10?Vt:ie),u=({remainingTime:h})=>n.jsx(Wt,{children:h}),p=j.useCallback(()=>{s==null||s(),a(Ht)},[s,a]),m=j.useCallback(h=>{h===10&&a(ie)},[a]);return n.jsx(_e,{isPlaying:t,duration:e,colors:Pt,colorsTime:Ft,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:p,onUpdate:m,children:u})};const Gt=()=>i.t1,Zt=i.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Jt=i.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Kt=i.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Xt=i.styled_default(Gt())({name:"p",class:"p1edlxt3",propsAsIs:!0}),es=i.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),ts=i.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),ss=i.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),ns=({title:t,points:e,isPlayingTimer:s,isTimer:r,onTimerExpired:a})=>n.jsxs(Zt,{children:[n.jsxs(Jt,{children:[t&&n.jsx(Kt,{children:t}),e!==void 0&&n.jsxs(n.Fragment,{children:[n.jsx(Xt,{name:"icon-trophy"}),n.jsxs(es,{children:[n.jsx(ts,{children:e}),n.jsx(ss,{children:"PTS"})]})]})]}),r&&n.jsx(Bt,{isPlaying:s,onTimerExpired:a})]}),is=({openedQuestion:t,vote:e})=>{var s;const r=t.subject,a=t.type,u=(s=t.options)==null?void 0:s.options,[p,m]=j.useState(!1),[h,g]=j.useState(!1),[_,v]=j.useState(""),l=t==null?void 0:t.id,x=j.useCallback(async d=>{if(l){const I=d.currentTarget.value;v(I),g(!0),await e(l,I),g(!1)}},[l,v,e]),y=j.useMemo(()=>t==null?void 0:t.answers.find(d=>d.youVoted===!0),[t]),o=j.useMemo(()=>!!(t!=null&&t.answers.find(d=>d.correct===!0)),[t]),f=j.useMemo(()=>t?t.answers.map(d=>({...d,questionVoted:!!y,youSelected:_===d.id,isLoading:h,hasCorrectAnswer:o,questionType:t.type,answerTimeExpired:p,questionStatus:t.status,onVote:x})):[],[o,p,h,t,y,x,_]),c=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0;return n.jsx(i.r,{"data-question-header":"true",children:n.jsx(gt,{children:n.jsxs(It,{children:[c&&n.jsx(mt,{feedbackMessages:c,questionVoted:!!y,questionVotedCorrectly:y==null?void 0:y.correct,questionType:a,hasCorrectAnswer:o,questionStatus:t.status}),n.jsx(ns,{title:p?"Expired":"To win",points:p?void 0:100,onTimerExpired:()=>m(!0),isTimer:!0}),n.jsx(yt,{children:r}),n.jsx(xt,{children:f.map(d=>n.jsx(Rt,{...d},d.id))})]})})})};const rs=i.styled_default("div")({name:"e",class:"e1eio0mt",propsAsIs:!1}),as=i.styled_default("div")({name:"i",class:"iigl87b",propsAsIs:!1}),os=i.styled_default("h3")({name:"n",class:"n1o2cwub",propsAsIs:!1}),ls=i.styled_default("div")({name:"r",class:"r3uxe45",propsAsIs:!1}),cs=i.styled_default("div")({name:"l",class:"lrqius",propsAsIs:!1}),Me=({created:t,title:e,instantView:s})=>{const r=j.useMemo(()=>{if(t){const a=new Date(t);if(i.r$1(a))return{date:i.a(a),time:i.n(a)}}return null},[t]);return n.jsxs(rs,{children:[r&&n.jsxs(cs,{children:[r.date," · ",r.time]}),(s==null?void 0:s.video)&&n.jsx(i.w,{source:s.video.url,poster:s.video.thumbnailUrl}),n.jsxs(as,{children:[n.jsx(os,{children:(s==null?void 0:s.heading)||e}),n.jsx(ls,{children:s==null?void 0:s.body})]})]})};const ds=i.styled_default("div")({name:"o",class:"o18unvw4",propsAsIs:!1}),us=i.styled_default("a")({name:"n",class:"ns0uvk8",propsAsIs:!1}),ps=({instantView:t,...e})=>n.jsxs(ds,{children:[n.jsx(Me,{instantView:t,...e}),(t==null?void 0:t.webLink)&&n.jsxs(us,{href:t==null?void 0:t.webLink.url,target:"_blank",children:["Explore more of the Masters History",n.jsx(i.t1,{name:"icon-external-link"})]})]});const fs=i.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),hs=({openedQuestion:t})=>{var e;return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?n.jsx(ps,{created:t.attributes.created,...t.attributes.attributes.value}):null},ms=({extendedQuestion:t,vote:e})=>{const{loading:s,data:r}=t;return!s&&r?n.jsx(is,{vote:e,openedQuestion:r}):null},gs=({gamification:t})=>{var e;const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedQuestion.$extendedStore);if(!s)return null;const a=s.type;return n.jsxs(fs,{children:[n.jsx(Ie,{close:t.closeQuestion,type:((e=s.attributes)==null?void 0:e.type)||i.QuestionType.UNSET}),a==="question"&&n.jsx(ms,{vote:t.submitAnswer,extendedQuestion:r}),a!=="question"&&n.jsx(hs,{openedQuestion:s})]})};const Is=i.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),ys=i.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),xs=i.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),vs=i.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var O=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(O||{});const re=({title:t,active:e,onClick:s})=>n.jsx(xs,{onClick:s,"data-selected":e,children:n.jsx(vs,{children:t})}),_s=({activePage:t="home",toggleActivePage:e})=>n.jsx(Is,{children:n.jsxs(ys,{"data-position":t==="home"?"left":"right",children:[n.jsx(re,{title:"Home",active:t==="home",onClick:()=>e("home")}),n.jsx(re,{title:"Leader Board",active:t==="leaderboard",onClick:()=>e("leaderboard")})]})});let S;typeof window<"u"?S=window:typeof self<"u"?S=self:S=i.dist.global;let P=null,F=null;const ae=20,$=S.clearTimeout,oe=S.setTimeout,Q=S.cancelAnimationFrame||S.mozCancelAnimationFrame||S.webkitCancelAnimationFrame,le=S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame;Q==null||le==null?(P=$,F=function(e){return oe(e,ae)}):(P=function([e,s]){Q(e),$(s)},F=function(e){const s=le(function(){$(r),e()}),r=oe(function(){Q(s),e()},ae);return[s,r]});function Ms(t){let e,s,r,a,u,p,m;const h=typeof document<"u"&&document.attachEvent;if(!h){p=function(c){const d=c.__resizeTriggers__,I=d.firstElementChild,z=d.lastElementChild,M=I.firstElementChild;z.scrollLeft=z.scrollWidth,z.scrollTop=z.scrollHeight,M.style.width=I.offsetWidth+1+"px",M.style.height=I.offsetHeight+1+"px",I.scrollLeft=I.scrollWidth,I.scrollTop=I.scrollHeight},u=function(c){return c.offsetWidth!==c.__resizeLast__.width||c.offsetHeight!==c.__resizeLast__.height},m=function(c){if(c.target.className&&typeof c.target.className.indexOf=="function"&&c.target.className.indexOf("contract-trigger")<0&&c.target.className.indexOf("expand-trigger")<0)return;const d=this;p(this),this.__resizeRAF__&&P(this.__resizeRAF__),this.__resizeRAF__=F(function(){u(d)&&(d.__resizeLast__.width=d.offsetWidth,d.__resizeLast__.height=d.offsetHeight,d.__resizeListeners__.forEach(function(M){M.call(d,c)}))})};let l=!1,x="";r="animationstart";const y="Webkit Moz O ms".split(" ");let o="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const c=document.createElement("fakeelement");if(c.style.animationName!==void 0&&(l=!0),l===!1){for(let d=0;d<y.length;d++)if(c.style[y[d]+"AnimationName"]!==void 0){f=y[d],x="-"+f.toLowerCase()+"-",r=o[d],l=!0;break}}}s="resizeanim",e="@"+x+"keyframes "+s+" { from { opacity: 0; } to { opacity: 0; } } ",a=x+"animation: 1ms "+s+"; "}const g=function(l){if(!l.getElementById("detectElementResize")){const x=(e||"")+".resize-triggers { "+(a||"")+'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%; }',y=l.head||l.getElementsByTagName("head")[0],o=l.createElement("style");o.id="detectElementResize",o.type="text/css",t!=null&&o.setAttribute("nonce",t),o.styleSheet?o.styleSheet.cssText=x:o.appendChild(l.createTextNode(x)),y.appendChild(o)}};return{addResizeListener:function(l,x){if(h)l.attachEvent("onresize",x);else{if(!l.__resizeTriggers__){const y=l.ownerDocument,o=S.getComputedStyle(l);o&&o.position==="static"&&(l.style.position="relative"),g(y),l.__resizeLast__={},l.__resizeListeners__=[],(l.__resizeTriggers__=y.createElement("div")).className="resize-triggers";const f=y.createElement("div");f.className="expand-trigger",f.appendChild(y.createElement("div"));const c=y.createElement("div");c.className="contract-trigger",l.__resizeTriggers__.appendChild(f),l.__resizeTriggers__.appendChild(c),l.appendChild(l.__resizeTriggers__),p(l),l.addEventListener("scroll",m,!0),r&&(l.__resizeTriggers__.__animationListener__=function(I){I.animationName===s&&p(l)},l.__resizeTriggers__.addEventListener(r,l.__resizeTriggers__.__animationListener__))}l.__resizeListeners__.push(x)}},removeResizeListener:function(l,x){if(h)l.detachEvent("onresize",x);else if(l.__resizeListeners__.splice(l.__resizeListeners__.indexOf(x),1),!l.__resizeListeners__.length){l.removeEventListener("scroll",m,!0),l.__resizeTriggers__.__animationListener__&&(l.__resizeTriggers__.removeEventListener(r,l.__resizeTriggers__.__animationListener__),l.__resizeTriggers__.__animationListener__=null);try{l.__resizeTriggers__=!l.removeChild(l.__resizeTriggers__)}catch{}}}}}class js extends j.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:s,disableWidth:r,onResize:a}=this.props;if(this._parentNode){var u,p,m,h;const g=window.getComputedStyle(this._parentNode)||{},_=parseFloat((u=g.paddingLeft)!==null&&u!==void 0?u:"0"),v=parseFloat((p=g.paddingRight)!==null&&p!==void 0?p:"0"),l=parseFloat((m=g.paddingTop)!==null&&m!==void 0?m:"0"),x=parseFloat((h=g.paddingBottom)!==null&&h!==void 0?h:"0"),y=this._parentNode.getBoundingClientRect(),o=y.height-l-x,f=y.width-_-v,c=this._parentNode.offsetHeight-l-x,d=this._parentNode.offsetWidth-_-v;(!s&&(this.state.height!==c||this.state.scaledHeight!==o)||!r&&(this.state.width!==d||this.state.scaledWidth!==f))&&(this.setState({height:c,width:d,scaledHeight:o,scaledWidth:f}),typeof a=="function"&&a({height:c,scaledHeight:o,scaledWidth:f,width:d}))}},this._setRef=s=>{this._autoSizer=s}}componentDidMount(){const{nonce:e}=this.props;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(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=Ms(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){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()))}render(){const{children:e,defaultHeight:s,defaultWidth:r,disableHeight:a=!1,disableWidth:u=!1,nonce:p,onResize:m,style:h={},tagName:g="div",..._}=this.props,{height:v,scaledHeight:l,scaledWidth:x,width:y}=this.state,o={overflow:"visible"},f={};let c=!1;return a||(v===0&&(c=!0),o.height=0,f.height=v,f.scaledHeight=l),u||(y===0&&(c=!0),o.width=0,f.width=y,f.scaledWidth=x),j.createElement(g,{ref:this._setRef,style:{...o,...h},..._},!c&&e(f))}}function W(){return W=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},W.apply(this,arguments)}function ce(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V(t,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V(t,e)}function zs(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,V(t,e)}var de=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ns(t,e){return!!(t===e||de(t)&&de(e))}function Ts(t,e){if(t.length!==e.length)return!1;for(var s=0;s<t.length;s++)if(!Ns(t[s],e[s]))return!1;return!0}function U(t,e){e===void 0&&(e=Ts);var s,r=[],a,u=!1;function p(){for(var m=[],h=0;h<arguments.length;h++)m[h]=arguments[h];return u&&s===this&&e(m,r)||(a=t.apply(this,m),u=!0,s=this,r=m),a}return p}var Ss=typeof performance=="object"&&typeof performance.now=="function",ue=Ss?function(){return performance.now()}:function(){return Date.now()};function pe(t){cancelAnimationFrame(t.id)}function As(t,e){var s=ue();function r(){ue()-s>=e?t.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var q=-1;function fe(t){if(t===void 0&&(t=!1),q===-1||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",document.body.appendChild(e),q=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return q}var w=null;function he(t){if(t===void 0&&(t=!1),w===null||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",s.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?w="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(e),w}return w}var Ds=150,ws=function(e,s){return e};function Es(t){var e,s=t.getItemOffset,r=t.getEstimatedTotalSize,a=t.getItemSize,u=t.getOffsetForIndexAndAlignment,p=t.getStartIndexForOffset,m=t.getStopIndexForStartIndex,h=t.initInstanceProps,g=t.shouldResetStyleCacheOnItemSizeChange,_=t.validateProps;return e=function(v){zs(l,v);function l(y){var o;return o=v.call(this,y)||this,o._instanceProps=h(o.props,ce(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:ce(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=U(function(f,c,d,I){return o.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:c,visibleStartIndex:d,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=U(function(f,c,d){return o.props.onScroll({scrollDirection:f,scrollOffset:c,scrollUpdateWasRequested:d})}),o._getItemStyle=void 0,o._getItemStyle=function(f){var c=o.props,d=c.direction,I=c.itemSize,z=c.layout,M=o._getItemStyleCache(g&&I,g&&z,g&&d),N;if(M.hasOwnProperty(f))N=M[f];else{var T=s(o.props,f,o._instanceProps),A=a(o.props,f,o._instanceProps),D=d==="horizontal"||z==="horizontal",k=d==="rtl",b=D?T:0;M[f]=N={position:"absolute",left:k?void 0:b,right:k?b:void 0,top:D?0:T,height:D?"100%":A,width:D?A:"100%"}}return N},o._getItemStyleCache=void 0,o._getItemStyleCache=U(function(f,c,d){return{}}),o._onScrollHorizontal=function(f){var c=f.currentTarget,d=c.clientWidth,I=c.scrollLeft,z=c.scrollWidth;o.setState(function(M){if(M.scrollOffset===I)return null;var N=o.props.direction,T=I;if(N==="rtl")switch(he()){case"negative":T=-I;break;case"positive-descending":T=z-d-I;break}return T=Math.max(0,Math.min(T,z-d)),{isScrolling:!0,scrollDirection:M.scrollOffset<I?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(f){var c=f.currentTarget,d=c.clientHeight,I=c.scrollHeight,z=c.scrollTop;o.setState(function(M){if(M.scrollOffset===z)return null;var N=Math.max(0,Math.min(z,I-d));return{isScrolling:!0,scrollDirection:M.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(f){var c=o.props.outerRef;o._outerRef=f,typeof c=="function"?c(f):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=f)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&pe(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=As(o._resetIsScrolling,Ds)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}l.getDerivedStateFromProps=function(o,f){return Os(o,f),_(o),null};var x=l.prototype;return x.scrollTo=function(o){o=Math.max(0,o),this.setState(function(f){return f.scrollOffset===o?null:{scrollDirection:f.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(o,f){f===void 0&&(f="auto");var c=this.props,d=c.itemCount,I=c.layout,z=this.state.scrollOffset;o=Math.max(0,Math.min(o,d-1));var M=0;if(this._outerRef){var N=this._outerRef;I==="vertical"?M=N.scrollWidth>N.clientWidth?fe():0:M=N.scrollHeight>N.clientHeight?fe():0}this.scrollTo(u(this.props,o,f,z,this._instanceProps,M))},x.componentDidMount=function(){var o=this.props,f=o.direction,c=o.initialScrollOffset,d=o.layout;if(typeof c=="number"&&this._outerRef!=null){var I=this._outerRef;f==="horizontal"||d==="horizontal"?I.scrollLeft=c:I.scrollTop=c}this._callPropsCallbacks()},x.componentDidUpdate=function(){var o=this.props,f=o.direction,c=o.layout,d=this.state,I=d.scrollOffset,z=d.scrollUpdateWasRequested;if(z&&this._outerRef!=null){var M=this._outerRef;if(f==="horizontal"||c==="horizontal")if(f==="rtl")switch(he()){case"negative":M.scrollLeft=-I;break;case"positive-ascending":M.scrollLeft=I;break;default:var N=M.clientWidth,T=M.scrollWidth;M.scrollLeft=T-N-I;break}else M.scrollLeft=I;else M.scrollTop=I}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pe(this._resetIsScrollingTimeoutId)},x.render=function(){var o=this.props,f=o.children,c=o.className,d=o.direction,I=o.height,z=o.innerRef,M=o.innerElementType,N=o.innerTagName,T=o.itemCount,A=o.itemData,D=o.itemKey,k=D===void 0?ws:D,b=o.layout,ze=o.outerElementType,Ne=o.outerTagName,Te=o.style,Se=o.useIsScrolling,Ae=o.width,H=this.state.isScrolling,R=d==="horizontal"||b==="horizontal",De=R?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),we=B[0],Ee=B[1],G=[];if(T>0)for(var E=we;E<=Ee;E++)G.push(j.createElement(f,{data:A,key:k(E,A),index:E,isScrolling:Se?H:void 0,style:this._getItemStyle(E)}));var Z=r(this.props,this._instanceProps);return j.createElement(ze||Ne||"div",{className:c,onScroll:De,ref:this._outerRefSetter,style:W({position:"relative",height:I,width:Ae,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:d},Te)},j.createElement(M||N||"div",{children:G,ref:z,style:{height:R?"100%":Z,pointerEvents:H?"none":void 0,width:R?Z:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var f=this._getRangeToRender(),c=f[0],d=f[1],I=f[2],z=f[3];this._callOnItemsRendered(c,d,I,z)}}if(typeof this.props.onScroll=="function"){var M=this.state,N=M.scrollDirection,T=M.scrollOffset,A=M.scrollUpdateWasRequested;this._callOnScroll(N,T,A)}},x._getRangeToRender=function(){var o=this.props,f=o.itemCount,c=o.overscanCount,d=this.state,I=d.isScrolling,z=d.scrollDirection,M=d.scrollOffset;if(f===0)return[0,0,0,0];var N=p(this.props,M,this._instanceProps),T=m(this.props,N,M,this._instanceProps),A=!I||z==="backward"?Math.max(1,c):1,D=!I||z==="forward"?Math.max(1,c):1;return[Math.max(0,N-A),Math.max(0,Math.min(f-1,T+D)),N,T]},l}(j.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Os=function(e,s){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,s.instance},ks=Es({getItemOffset:function(e,s){var r=e.itemSize;return s*r},getItemSize:function(e,s){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var s=e.itemCount,r=e.itemSize;return r*s},getOffsetForIndexAndAlignment:function(e,s,r,a,u,p){var m=e.direction,h=e.height,g=e.itemCount,_=e.itemSize,v=e.layout,l=e.width,x=m==="horizontal"||v==="horizontal",y=x?l:h,o=Math.max(0,g*_-y),f=Math.min(o,s*_),c=Math.max(0,s*_-y+_+p);switch(r==="smart"&&(a>=c-y&&a<=f+y?r="auto":r="center"),r){case"start":return f;case"end":return c;case"center":{var d=Math.round(c+(f-c)/2);return d<Math.ceil(y/2)?0:d>o+Math.floor(y/2)?o:d}case"auto":default:return a>=c&&a<=f?a:a<c?c:f}},getStartIndexForOffset:function(e,s){var r=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(s/a)))},getStopIndexForStartIndex:function(e,s,r){var a=e.direction,u=e.height,p=e.itemCount,m=e.itemSize,h=e.layout,g=e.width,_=a==="horizontal"||h==="horizontal",v=s*m,l=_?g:u,x=Math.ceil((l+r-v)/m);return Math.max(0,Math.min(p-1,s+x-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function bs(t){var e=t.lastRenderedStartIndex,s=t.lastRenderedStopIndex,r=t.startIndex,a=t.stopIndex;return!(r>s||a<e)}function Ls(t){for(var e=t.isItemLoaded,s=t.itemCount,r=t.minimumBatchSize,a=t.startIndex,u=t.stopIndex,p=[],m=null,h=null,g=a;g<=u;g++){var _=e(g);_?h!==null&&(p.push(m,h),m=h=null):(h=g,m===null&&(m=g))}if(h!==null){for(var v=Math.min(Math.max(h,m+r-1),s-1),l=h+1;l<=v&&!e(l);l++)h=l;p.push(m,h)}if(p.length)for(;p[1]-p[0]+1<r&&p[0]>0;){var x=p[0]-1;if(!e(x))p[0]=x;else break}return p}var Rs=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Cs=function(){function t(e,s){for(var r=0;r<s.length;r++){var a=s[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,s,r){return s&&t(e.prototype,s),r&&t(e,r),e}}(),$s=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},me=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Qs=function(t){$s(e,t);function e(){var s,r,a,u;Rs(this,e);for(var p=arguments.length,m=Array(p),h=0;h<p;h++)m[h]=arguments[h];return u=(r=(a=me(this,(s=e.__proto__||Object.getPrototypeOf(e)).call.apply(s,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(g){var _=g.visibleStartIndex,v=g.visibleStopIndex;a._lastRenderedStartIndex=_,a._lastRenderedStopIndex=v,a._ensureRowsLoaded(_,v)},a._setRef=function(g){a._listRef=g},r),me(a,u)}return Cs(e,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var u=this.props,p=u.isItemLoaded,m=u.itemCount,h=u.minimumBatchSize,g=h===void 0?10:h,_=u.threshold,v=_===void 0?15:_,l=Ls({isItemLoaded:p,itemCount:m,minimumBatchSize:g,startIndex:Math.max(0,r-v),stopIndex:Math.min(m-1,a+v)});(this._memoizedUnloadedRanges.length!==l.length||this._memoizedUnloadedRanges.some(function(x,y){return l[y]!==x}))&&(this._memoizedUnloadedRanges=l,this._loadUnloadedRanges(l))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(g){var _=r[g],v=r[g+1],l=u(_,v);l!=null&&l.then(function(){if(bs({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:_,stopIndex:v})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(_,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)p(m)}}]),e}(j.PureComponent);const Us=()=>i.t1,qs=i.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Ys=i.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Ps=i.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),Fs=i.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Ws=i.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Vs=i.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Hs=i.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Bs=i.styled_default(Us())({name:"x",class:"x13mk3z6",propsAsIs:!0}),Gs=({rank:t,avatar:e,name:s,points:r,isCurrentUser:a,openItemDetail:u,style:p})=>n.jsxs(qs,{onClick:u,style:p,children:[n.jsx(Ys,{children:t||0}),n.jsxs(Ws,{children:[e?n.jsx(Ps,{alt:"leaderboard-item-avatar",src:e}):n.jsx(Fs,{children:i.o$1(s||"")}),n.jsxs(Vs,{children:[n.jsx(Hs,{children:s||""}),a&&n.jsx(Bs,{name:"icon-star"})]})]}),n.jsx("div",{children:i.i(r)})]}),Zs=({items:t,openItemDetail:e,fetchMore:s})=>n.jsx(js,{children:({width:r,height:a})=>n.jsx(Qs,{isItemLoaded:u=>u<t.length,itemCount:t.length+1,loadMoreItems:s,children:({onItemsRendered:u,ref:p})=>n.jsx(ks,{itemSize:56,onItemsRendered:u,ref:p,itemCount:t.length,width:r,height:a,children:({index:m,style:h})=>n.jsx(Gs,{style:{...h,maxHeight:48},...t[m],openItemDetail:()=>e(t[m].userId)},t[m].userId)})})}),Js=({leaderboardList:t,openUser:e})=>{const{data:s}=i.useStore(t.$store);return n.jsx(Zs,{fetchMore:t.fetchMore,items:s,openItemDetail:e})};const Ks=i.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),Xs=i.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),en=({disabled:t,variant:e="primary",onClick:s,children:r,...a})=>n.jsx(Ks,{onClick:s,disabled:t,"data-variant":e,...a,children:n.jsx(Xs,{children:r})});const tn=()=>i.t1,sn=()=>i.t1,nn=i.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),rn=i.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),an=i.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),on=i.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),Y=i.styled_default(tn())({name:"c",class:"c6fk2ph",propsAsIs:!0}),ln=i.styled_default(sn())({name:"d",class:"d1rdm136",propsAsIs:!0}),cn=i.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),dn=i.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),un={[i.PickHistoryStatus.LOST]:n.jsx(Y,{name:"icon-cross"}),[i.PickHistoryStatus.WON]:n.jsx(Y,{name:"icon-check"}),[i.PickHistoryStatus.UNSET]:void 0,[i.PickHistoryStatus.DNP]:n.jsx(Y,{name:"icon-arrow"})},pn=({questionId:t,questionType:e,questionStatus:s,subject:r,openForVoting:a,openQuestion:u,status:p})=>{const m=i.o[e],h=un[p];return m?n.jsxs(nn,{onClick:()=>u==null?void 0:u(t),children:[n.jsxs(dn,{children:[n.jsxs(rn,{children:[n.jsx(ln,{name:m.iconName}),n.jsxs(cn,{children:[m.label,e===i.QuestionType.TRIVIA&&s===i.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(an,{children:r||""})]}),n.jsx(on,{children:h||(a?n.jsx(en,{children:"Play"}):null)})]}):null};const fn=i.styled_default("div")({name:"n",class:"n1jcgove",propsAsIs:!1}),hn=i.styled_default("button")({name:"l",class:"l1bwp7hh",propsAsIs:!1}),mn=({openInsight:t,questionId:e,...s})=>n.jsxs(fn,{children:[n.jsx(Me,{questionId:e,...s}),t&&n.jsx(hn,{onClick:()=>t(e),children:"View Insight"})]});const gn=i.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),In=({questions:t,openQuestion:e})=>n.jsx(gn,{children:t==null?void 0:t.map(s=>{var r,a;if(s.type==="question"&&((r=s.attributes)==null?void 0:r.attributes.case)==="question"){const u=s.attributes.attributes.value;return n.jsx(pn,{openQuestion:e,...u},u.questionId)}if(s.type==="insight"&&((a=s.attributes)==null?void 0:a.attributes.case)==="insight"){const u=s.attributes.attributes.value;return n.jsx(mn,{openInsight:e,...u},u.questionId)}return null})}),yn=({store:t,openQuestion:e})=>{const s=i.useStore(t);return s!=null&&s.data?n.jsx(In,{openQuestion:e,questions:s.data}):n.jsx("div",{children:"wait questions..."})},xn=({userSummary:t})=>{var e;const s=i.useStore(t.getStore());return(e=s.data)!=null&&e.summary?n.jsx(ye,{...s.data.summary,...s.data.percentage}):n.jsx("div",{children:"wait user..."})},vn=({gamification:t})=>{const[e,s]=j.useState(O.HOME);return n.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[n.jsxs(i.e,{children:[n.jsx(_s,{activePage:e,toggleActivePage:s}),e===O.HOME&&n.jsx(xn,{userSummary:t.userSummary})]}),e===O.HOME&&n.jsx(i.n$1,{children:n.jsx(yn,{openQuestion:t.openQuestion,store:t.feedList.getStore()})}),e===O.LEADERBOARD&&n.jsx(i.n$1,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:n.jsx(Js,{openUser:t.openUser,leaderboardList:t.leaderboardList})})]})};const _n=()=>i.f,ge=i.styled_default(_n())({name:"e",class:"e1ph66cs",propsAsIs:!0}),Mn=i.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),je=({gamification:t,className:e})=>{const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedUser);return n.jsxs(n.Fragment,{children:[s&&n.jsx(ge,{className:e,children:n.jsx(gs,{gamification:t})}),r&&n.jsx(ge,{className:e,children:n.jsxs(Mn,{children:[n.jsx(Ie,{label:"Friend's Rank",close:t.closeUser}),n.jsx(i.e,{children:n.jsx(ye,{...r})})]})}),n.jsx(i.r,{className:e,"data-nav":"true",children:n.jsx(vn,{gamification:t})})]})};exports.GamificationOverlay=je;exports.default=je;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),i=require("./masters-7ea5d23e.cjs"),j=require("react");const Oe=()=>i.C1,ke=()=>i.C1,be=i.styled_default("div")({name:"a",class:"acysrl1",propsAsIs:!1}),Le=i.styled_default("div")({name:"l",class:"lo57cjm",propsAsIs:!1}),Ce=i.styled_default(Oe())({name:"p",class:"p14kwh4y",propsAsIs:!0}),Re=i.styled_default("span")({name:"s",class:"sxun7sq",propsAsIs:!1}),$e=i.styled_default("button")({name:"c",class:"c1i8ida8",propsAsIs:!1}),Qe=i.styled_default(ke())({name:"g",class:"g1m0xfmw",propsAsIs:!0}),Ie=({type:t,close:e,label:s})=>{const r=t?i.o[t]:{label:s,iconName:void 0};return n.jsxs(be,{children:[n.jsxs(Le,{children:[(r==null?void 0:r.iconName)&&n.jsx(Ce,{name:r.iconName}),(r==null?void 0:r.label)&&n.jsx(Re,{children:r.label})]}),n.jsx($e,{onClick:e,children:n.jsx(Qe,{name:"icon-cross"})})]})};const Ue=i.styled_default("div")({name:"t",class:"taj61ja",propsAsIs:!1}),qe=i.styled_default("div")({name:"r",class:"r19fxewd",propsAsIs:!1}),Ye=i.styled_default("div")({name:"i",class:"i1whkbqh",propsAsIs:!1}),J=({indicator:t,title:e})=>n.jsxs(Ue,{children:[n.jsx(qe,{children:e}),n.jsx(Ye,{children:t})]});const Pe=i.styled_default("div")({name:"i",class:"i4lbhzs",propsAsIs:!1}),Fe=i.styled_default("div")({name:"o",class:"ordquhq",propsAsIs:!1}),We=i.styled_default("div")({name:"n",class:"nwzed99",propsAsIs:!1}),L=({indicator:t,title:e})=>n.jsxs(Pe,{children:[n.jsx(Fe,{children:t}),n.jsx(We,{children:e})]});const Ve=i.styled_default("div")({name:"o",class:"o15y0waw",propsAsIs:!1}),He=i.styled_default("div")({name:"i",class:"ihjewwf",propsAsIs:!1}),Be=i.styled_default("div")({name:"n",class:"n10e9lv8",propsAsIs:!1}),Ge=i.styled_default("div")({name:"r",class:"r13bxv",propsAsIs:!1}),Ze=i.styled_default("img")({name:"a",class:"a1fi59c9",propsAsIs:!1}),Je=i.styled_default("div")({name:"s",class:"s1kkihge",propsAsIs:!1}),Ke=i.styled_default("div")({name:"c",class:"cy4f4t",propsAsIs:!1}),Xe=i.styled_default("div")({name:"p",class:"p18cnlx1",propsAsIs:!1}),et=i.styled_default("img")({name:"l",class:"lboqgs5",propsAsIs:!1}),tt=i.styled_default("div")({name:"d",class:"d1oaal4",propsAsIs:!1}),st=i.styled_default("div")({name:"x",class:"x1yzgo0u",propsAsIs:!1}),nt=i.styled_default("div")({name:"f",class:"f1l9i8s8",propsAsIs:!1}),it=i.styled_default("div")({name:"g",class:"g4cgl4u",propsAsIs:!1}),rt=i.styled_default("div")({name:"h",class:"h1qn1tmd",propsAsIs:!1}),at=i.styled_default("div")({name:"u",class:"u1gsbhq4",propsAsIs:!1}),ot=i.styled_default("div")({name:"m",class:"mvj8oco",propsAsIs:!1}),lt=i.styled_default("button")({name:"v",class:"viqiaf2",propsAsIs:!1}),ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ye=({avatar:t,name:e,points:s,friendsRank:r,rank:a,streak:u,correct:p,incorrect:m,inTop:h,average:g})=>n.jsxs(Ve,{children:[n.jsx(He,{children:n.jsxs(Ge,{children:[n.jsxs(lt,{children:[t&&n.jsx(Ze,{alt:"avatar",src:t}),!t&&n.jsx(ot,{children:i.o$1(e||"")})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:e}),n.jsxs(Xe,{children:[n.jsxs(tt,{children:[n.jsx(et,{alt:"rank-icon",src:ct}),n.jsxs(st,{children:[i.i(s),n.jsx(nt,{children:"PTS"})]})]}),n.jsx(it,{}),n.jsxs("div",{children:["TOP ",h||0,"%"]})]})]})]})}),n.jsxs(Be,{children:[n.jsxs(rt,{children:[n.jsx(J,{indicator:r||0,title:"Friends rank"}),n.jsx(J,{indicator:a||0,title:"Global rank"})]}),n.jsxs(at,{children:[n.jsx(L,{indicator:u||0,title:"Win streak"}),n.jsx(L,{indicator:p||0,title:"Correct"}),n.jsx(L,{indicator:m||0,title:"Incorrect"}),n.jsx(L,{indicator:`${g||0}%`,title:"Succ. rate"})]})]})]});const dt=()=>i.C1,ut=i.styled_default("div")({name:"c",class:"ciyeb68",propsAsIs:!1}),pt=i.styled_default(dt())({name:"n",class:"nfic4xc",propsAsIs:!0}),K=i.styled_default("div")({name:"d",class:"d1pd1p66",propsAsIs:!1}),X=i.styled_default("div")({name:"p",class:"p132yxcv",propsAsIs:!1}),ft=i.styled_default("span")({name:"l",class:"l4a8aw",propsAsIs:!1}),R=i.styled_default("span")({name:"g",class:"gzdx7pk",propsAsIs:!1}),ht=i.styled_default("div")({name:"s",class:"smnc4zm",propsAsIs:!1}),mt=({feedbackMessages:t,questionVotedCorrectly:e,questionVoted:s,questionType:r,hasCorrectAnswer:a,questionStatus:u})=>{const p=s&&(r===i.QuestionType.TRIVIA||r===i.QuestionType.PREDICTION);if(!p&&u!==i.QuestionStatus.RESOLVED)return null;const m=r===i.QuestionType.PREDICTION&&!a,h=e?"correct":"incorrect",g=e?t.correctFeedback:t.incorrectFeedback;return n.jsxs(ut,{"data-isPrediction":m,children:[u===i.QuestionStatus.RESOLVED&&r===i.QuestionType.TRIVIA&&!s&&n.jsxs(n.Fragment,{children:[n.jsx(K,{children:n.jsx(i.C1,{name:"questionExpired"})}),n.jsxs("div",{children:[n.jsx(X,{children:n.jsx(R,{children:"Question Expired"})}),n.jsx(ht,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),p&&m&&n.jsxs(n.Fragment,{children:[n.jsx(pt,{name:"icon-prediction"}),n.jsx(R,{children:"Stay tuned to see if your prediction was correct."})]}),p&&a&&n.jsxs(n.Fragment,{children:[n.jsx(K,{"data-feedbackType":h,children:n.jsx(i.C1,{name:h})}),n.jsx("div",{children:n.jsxs(X,{children:[n.jsx(ft,{"data-feedbackType":h,children:g==null?void 0:g.title}),n.jsx(R,{children:g==null?void 0:g.description})]})})]})]})};const gt=i.styled_default("div")({name:"o",class:"olc1eph",propsAsIs:!1}),It=i.styled_default("div")({name:"n",class:"n1yoh29a",propsAsIs:!1}),yt=i.styled_default("div")({name:"p",class:"pjkr5mb",propsAsIs:!1}),xt=i.styled_default("div")({name:"r",class:"r82wnnx",propsAsIs:!1});const vt=()=>xe,_t=()=>xe,Mt=()=>i.C1,jt=i.styled_default("button")({name:"c",class:"cpm4u8k",propsAsIs:!1}),zt=i.styled_default("div")({name:"l",class:"lwfomc3",propsAsIs:!1}),Nt=i.styled_default("span")({name:"d",class:"dmltvg2",propsAsIs:!1}),Tt=i.styled_default("div")({name:"s",class:"stfjpqz",propsAsIs:!1}),St=i.styled_default("div")({name:"p",class:"p198m24r",propsAsIs:!1}),xe=i.styled_default("img")({name:"r",class:"rbq5eu7",propsAsIs:!1}),At=i.styled_default(vt())({name:"g",class:"g1iv6oeb",propsAsIs:!0}),Dt=i.styled_default(_t())({name:"h",class:"h1qtxlqc",propsAsIs:!0}),wt=i.styled_default("span")({name:"u",class:"udm736q",propsAsIs:!1}),Et=i.styled_default("span")({name:"b",class:"b1da34tx",propsAsIs:!1}),Ot=i.styled_default("span")({name:"x",class:"x1dqwq83",propsAsIs:!1}),kt=i.styled_default(Mt())({name:"v",class:"v10s9my2",propsAsIs:!0}),ee={[i.QuestionImages.CENTERED]:t=>n.jsx(At,{alt:"option-icon",src:t}),[i.QuestionImages.TRANSPARENT]:t=>n.jsx(Tt,{children:n.jsx(St,{style:{backgroundImage:`url(${t})`}})}),[i.QuestionImages.ROUNDED]:t=>n.jsx(Dt,{alt:"option-icon",src:t}),[i.QuestionImages.NONE]:()=>null,[i.QuestionImages.UNSET]:()=>null},bt=({questionType:t,hasCorrectAnswer:e,correct:s,youVoted:r,questionVoted:a})=>{if(t===i.QuestionType.POLL&&r)return"correct";if(t===i.QuestionType.PREDICTION){if(e&&a)return r?s?"correct":"incorrect":s?"correct":"unset";if(r)return"correct"}return t===i.QuestionType.TRIVIA&&a?r?s?"correct":"incorrect":s?"correct":"unset":"unset"},Lt=({questionType:t,questionVoted:e,correct:s,hasCorrectAnswer:r,questionStatus:a})=>t===i.QuestionType.TRIVIA?e&&s:t===i.QuestionType.PREDICTION?e&&s&&r||a===i.QuestionStatus.RESOLVED&&s:!1,Ct=t=>{var e;const{id:s,icon:r,text:a,percentageDecimal:u,onVote:p,youSelected:m,questionVoted:h,imageMode:g=i.QuestionImages.ROUNDED,answerTimeExpired:_,questionStatus:v,isLoading:l,questionType:x,correct:y,hasCorrectAnswer:o}=t,f=bt(t),c=Lt({questionType:x,questionVoted:h,correct:y,hasCorrectAnswer:o,questionStatus:v}),d=h||v===i.QuestionStatus.RESOLVED&&x===i.QuestionType.PREDICTION;return n.jsxs(jt,{value:s,"data-selected":m,"data-answerState":f,disabled:h||l||_,onClick:p,children:[d&&n.jsx(zt,{"data-answerState":f,style:{width:`${u}%`}}),n.jsxs(Nt,{children:[r&&((e=ee[g])==null?void 0:e.call(ee,r)),n.jsx(wt,{children:a}),d&&n.jsxs(Et,{children:[c&&n.jsx(kt,{name:"selected"}),n.jsxs(Ot,{children:[u,"%"]})]})]})]})};var te=typeof window>"u"?j.useEffect:j.useLayoutEffect,Rt=({isPlaying:t,duration:e,startAt:s=0,updateInterval:r=0,onComplete:a,onUpdate:u})=>{let[p,m]=j.useState(s),h=j.useRef(0),g=j.useRef(s),_=j.useRef(s*-1e3),v=j.useRef(null),l=j.useRef(null),x=j.useRef(null),y=c=>{let d=c/1e3;if(l.current===null){l.current=d,v.current=requestAnimationFrame(y);return}let I=d-l.current,z=h.current+I;l.current=d,h.current=z;let M=g.current+(r===0?z:(z/r|0)*r),N=g.current+z,T=typeof e=="number"&&N>=e;m(T?e:M),T||(v.current=requestAnimationFrame(y))},o=()=>{v.current&&cancelAnimationFrame(v.current),x.current&&clearTimeout(x.current),l.current=null},f=j.useCallback(c=>{o(),h.current=0;let d=typeof c=="number"?c:s;g.current=d,m(d),t&&(v.current=requestAnimationFrame(y))},[t,s]);return te(()=>{if(u==null||u(p),e&&p>=e){_.current+=e*1e3;let{shouldRepeat:c=!1,delay:d=0,newStartAt:I}=(a==null?void 0:a(_.current/1e3))||{};c&&(x.current=setTimeout(()=>f(I),d*1e3))}},[p,e]),te(()=>(t&&(v.current=requestAnimationFrame(y)),o),[t,e,r]),{elapsedTime:p,reset:f}},$t=(t,e,s)=>{let r=t/2,a=e/2,u=r-a,p=2*u,m=s==="clockwise"?"1,0":"0,1",h=2*Math.PI*u;return{path:`m ${r},${a} a ${u},${u} 0 ${m} 0,${p} a ${u},${u} 0 ${m} 0,-${p}`,pathLength:h}},se=(t,e)=>t===0||t===e?0:typeof e=="number"?t-e:0,Qt=t=>({position:"relative",width:t,height:t}),Ut={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},ve=(t,e,s,r,a)=>{if(r===0)return e;let u=(a?r-t:t)/r;return e+s*u},ne=t=>{var e,s;return(s=(e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,a,u,p)=>`#${a}${a}${u}${u}${p}${p}`).substring(1).match(/.{2}/g))==null?void 0:e.map(r=>parseInt(r,16)))!=null?s:[]},qt=(t,e)=>{var s;let{colors:r,colorsTime:a,isSmoothColorTransition:u=!0}=t;if(typeof r=="string")return r;let p=(s=a==null?void 0:a.findIndex((l,x)=>l>=e&&e>=a[x+1]))!=null?s:-1;if(!a||p===-1)return r[0];if(!u)return r[p];let m=a[p]-e,h=a[p]-a[p+1],g=ne(r[p]),_=ne(r[p+1]),v=!!t.isGrowing;return`rgb(${g.map((l,x)=>ve(m,l,_[x]-l,h,v)|0).join(",")})`},Yt=t=>{let{duration:e,initialRemainingTime:s,updateInterval:r,size:a=180,strokeWidth:u=12,trailStrokeWidth:p,isPlaying:m=!1,isGrowing:h=!1,rotation:g="clockwise",onComplete:_,onUpdate:v}=t,l=j.useRef(),x=Math.max(u,p??0),{path:y,pathLength:o}=$t(a,x,g),{elapsedTime:f}=Rt({isPlaying:m,duration:e,startAt:se(e,s),updateInterval:r,onUpdate:typeof v=="function"?d=>{let I=Math.ceil(e-d);I!==l.current&&(l.current=I,v(I))}:void 0,onComplete:typeof _=="function"?d=>{var I;let{shouldRepeat:z,delay:M,newInitialRemainingTime:N}=(I=_(d))!=null?I:{};if(z)return{shouldRepeat:z,delay:M,newStartAt:se(e,N)}}:void 0}),c=e-f;return{elapsedTime:f,path:y,pathLength:o,remainingTime:Math.ceil(c),rotation:g,size:a,stroke:qt(t,c),strokeDashoffset:ve(f,0,o,e,h),strokeWidth:u}},_e=t=>{let{children:e,strokeLinecap:s,trailColor:r,trailStrokeWidth:a}=t,{path:u,pathLength:p,stroke:m,strokeDashoffset:h,remainingTime:g,elapsedTime:_,size:v,strokeWidth:l}=Yt(t);return j.createElement("div",{style:Qt(v)},j.createElement("svg",{viewBox:`0 0 ${v} ${v}`,width:v,height:v,xmlns:"http://www.w3.org/2000/svg"},j.createElement("path",{d:u,fill:"none",stroke:r??"#d9d9d9",strokeWidth:a??l}),j.createElement("path",{d:u,fill:"none",stroke:m,strokeLinecap:s??"round",strokeWidth:l,strokeDasharray:p,strokeDashoffset:h})),typeof e=="function"&&j.createElement("div",{style:Ut},e({remainingTime:g,elapsedTime:_,color:m})))};_e.displayName="CountdownCircleTimer";const Pt=[i.E.PRIMARY_GREEN1,i.E.SECONDARY_RED1,i.E.SECONDARY_RED1],Ft=[10,10,0],Wt=i.styled_default("div")({name:"A",class:"a1f928zy",propsAsIs:!1}),Vt=i.E.SECONDARY_GREEN6,ie=i.E.SECONDARY_RED3,Ht=i.E.NEUTRALS_GRAY3,Bt=({isPlaying:t=!0,duration:e=30,onTimerExpired:s})=>{const[r,a]=j.useState(e>10?Vt:ie),u=({remainingTime:h})=>n.jsx(Wt,{children:h}),p=j.useCallback(()=>{s==null||s(),a(Ht)},[s,a]),m=j.useCallback(h=>{h===10&&a(ie)},[a]);return n.jsx(_e,{isPlaying:t,duration:e,colors:Pt,colorsTime:Ft,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:p,onUpdate:m,children:u})};const Gt=()=>i.C1,Zt=i.styled_default("div")({name:"a",class:"a1r7f3z4",propsAsIs:!1}),Jt=i.styled_default("div")({name:"s",class:"sblndl",propsAsIs:!1}),Kt=i.styled_default("div")({name:"l",class:"l7ka1tv",propsAsIs:!1}),Xt=i.styled_default(Gt())({name:"p",class:"p1edlxt3",propsAsIs:!0}),es=i.styled_default("div")({name:"g",class:"ghm08u2",propsAsIs:!1}),ts=i.styled_default("span")({name:"c",class:"c12nsh46",propsAsIs:!1}),ss=i.styled_default("span")({name:"d",class:"dlr9eoc",propsAsIs:!1}),ns=({title:t,points:e,isPlayingTimer:s,isTimer:r,onTimerExpired:a})=>n.jsxs(Zt,{children:[n.jsxs(Jt,{children:[t&&n.jsx(Kt,{children:t}),e!==void 0&&n.jsxs(n.Fragment,{children:[n.jsx(Xt,{name:"icon-trophy"}),n.jsxs(es,{children:[n.jsx(ts,{children:e}),n.jsx(ss,{children:"PTS"})]})]})]}),r&&n.jsx(Bt,{isPlaying:s,onTimerExpired:a})]}),is=({openedQuestion:t,vote:e})=>{var s;const r=t.subject,a=t.type,u=(s=t.options)==null?void 0:s.options,[p,m]=j.useState(!1),[h,g]=j.useState(!1),[_,v]=j.useState(""),l=t==null?void 0:t.id,x=j.useCallback(async d=>{if(l){const I=d.currentTarget.value;v(I),g(!0),await e(l,I),g(!1)}},[l,v,e]),y=j.useMemo(()=>t==null?void 0:t.answers.find(d=>d.youVoted===!0),[t]),o=j.useMemo(()=>!!(t!=null&&t.answers.find(d=>d.correct===!0)),[t]),f=j.useMemo(()=>t?t.answers.map(d=>({...d,questionVoted:!!y,youSelected:_===d.id,isLoading:h,hasCorrectAnswer:o,questionType:t.type,answerTimeExpired:p,questionStatus:t.status,onVote:x})):[],[o,p,h,t,y,x,_]),c=u&&(u.case==="trivia"||u.case==="prediction")?u.value:void 0;return n.jsx(i.r,{"data-question-header":"true",children:n.jsx(gt,{children:n.jsxs(It,{children:[c&&n.jsx(mt,{feedbackMessages:c,questionVoted:!!y,questionVotedCorrectly:y==null?void 0:y.correct,questionType:a,hasCorrectAnswer:o,questionStatus:t.status}),n.jsx(ns,{title:p?"Expired":"To win",points:p?void 0:100,onTimerExpired:()=>m(!0),isTimer:!0}),n.jsx(yt,{children:r}),n.jsx(xt,{children:f.map(d=>n.jsx(Ct,{...d},d.id))})]})})})};const rs=i.styled_default("div")({name:"e",class:"e1eio0mt",propsAsIs:!1}),as=i.styled_default("div")({name:"i",class:"iigl87b",propsAsIs:!1}),os=i.styled_default("h3")({name:"n",class:"n1o2cwub",propsAsIs:!1}),ls=i.styled_default("div")({name:"r",class:"r3uxe45",propsAsIs:!1}),cs=i.styled_default("div")({name:"l",class:"lrqius",propsAsIs:!1}),Me=({created:t,title:e,instantView:s})=>{const r=j.useMemo(()=>{if(t){const a=new Date(t);if(i.r$1(a))return{date:i.a(a),time:i.n(a)}}return null},[t]);return n.jsxs(rs,{children:[r&&n.jsxs(cs,{children:[r.date," · ",r.time]}),(s==null?void 0:s.video)&&n.jsx(i.w,{source:s.video.url,poster:s.video.thumbnailUrl}),n.jsxs(as,{children:[n.jsx(os,{children:(s==null?void 0:s.heading)||e}),n.jsx(ls,{children:s==null?void 0:s.body})]})]})};const ds=i.styled_default("div")({name:"o",class:"o18unvw4",propsAsIs:!1}),us=i.styled_default("a")({name:"n",class:"ns0uvk8",propsAsIs:!1}),ps=({instantView:t,...e})=>n.jsxs(ds,{children:[n.jsx(Me,{instantView:t,...e}),(t==null?void 0:t.webLink)&&n.jsxs(us,{href:t==null?void 0:t.webLink.url,target:"_blank",children:["Explore more of the Masters History",n.jsx(i.C1,{name:"icon-external-link"})]})]});const fs=i.styled_default("div")({name:"d",class:"dk8r1eq",propsAsIs:!1}),hs=({openedQuestion:t})=>{var e;return((e=t==null?void 0:t.attributes)==null?void 0:e.attributes.case)==="insight"?n.jsx(ps,{created:t.attributes.created,...t.attributes.attributes.value}):null},ms=({extendedQuestion:t,vote:e})=>{const{loading:s,data:r}=t;return!s&&r?n.jsx(is,{vote:e,openedQuestion:r}):null},gs=({gamification:t})=>{var e;const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedQuestion.$extendedStore);if(!s)return null;const a=s.type;return n.jsxs(fs,{children:[n.jsx(Ie,{close:t.closeQuestion,type:((e=s.attributes)==null?void 0:e.type)||i.QuestionType.UNSET}),a==="question"&&n.jsx(ms,{vote:t.submitAnswer,extendedQuestion:r}),a!=="question"&&n.jsx(hs,{openedQuestion:s})]})};const Is=i.styled_default("div")({name:"t",class:"tcim9sm",propsAsIs:!1}),ys=i.styled_default("div")({name:"e",class:"e8wco6o",propsAsIs:!1}),xs=i.styled_default("button")({name:"n",class:"n1ardwzl",propsAsIs:!1}),vs=i.styled_default("span")({name:"i",class:"i1vk8ojx",propsAsIs:!1});var O=(t=>(t.HOME="home",t.LEADERBOARD="leaderboard",t))(O||{});const re=({title:t,active:e,onClick:s})=>n.jsx(xs,{onClick:s,"data-selected":e,children:n.jsx(vs,{children:t})}),_s=({activePage:t="home",toggleActivePage:e})=>n.jsx(Is,{children:n.jsxs(ys,{"data-position":t==="home"?"left":"right",children:[n.jsx(re,{title:"Home",active:t==="home",onClick:()=>e("home")}),n.jsx(re,{title:"Leader Board",active:t==="leaderboard",onClick:()=>e("leaderboard")})]})});let S;typeof window<"u"?S=window:typeof self<"u"?S=self:S=i.dist.global;let P=null,F=null;const ae=20,$=S.clearTimeout,oe=S.setTimeout,Q=S.cancelAnimationFrame||S.mozCancelAnimationFrame||S.webkitCancelAnimationFrame,le=S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame;Q==null||le==null?(P=$,F=function(e){return oe(e,ae)}):(P=function([e,s]){Q(e),$(s)},F=function(e){const s=le(function(){$(r),e()}),r=oe(function(){Q(s),e()},ae);return[s,r]});function Ms(t){let e,s,r,a,u,p,m;const h=typeof document<"u"&&document.attachEvent;if(!h){p=function(c){const d=c.__resizeTriggers__,I=d.firstElementChild,z=d.lastElementChild,M=I.firstElementChild;z.scrollLeft=z.scrollWidth,z.scrollTop=z.scrollHeight,M.style.width=I.offsetWidth+1+"px",M.style.height=I.offsetHeight+1+"px",I.scrollLeft=I.scrollWidth,I.scrollTop=I.scrollHeight},u=function(c){return c.offsetWidth!==c.__resizeLast__.width||c.offsetHeight!==c.__resizeLast__.height},m=function(c){if(c.target.className&&typeof c.target.className.indexOf=="function"&&c.target.className.indexOf("contract-trigger")<0&&c.target.className.indexOf("expand-trigger")<0)return;const d=this;p(this),this.__resizeRAF__&&P(this.__resizeRAF__),this.__resizeRAF__=F(function(){u(d)&&(d.__resizeLast__.width=d.offsetWidth,d.__resizeLast__.height=d.offsetHeight,d.__resizeListeners__.forEach(function(M){M.call(d,c)}))})};let l=!1,x="";r="animationstart";const y="Webkit Moz O ms".split(" ");let o="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f="";{const c=document.createElement("fakeelement");if(c.style.animationName!==void 0&&(l=!0),l===!1){for(let d=0;d<y.length;d++)if(c.style[y[d]+"AnimationName"]!==void 0){f=y[d],x="-"+f.toLowerCase()+"-",r=o[d],l=!0;break}}}s="resizeanim",e="@"+x+"keyframes "+s+" { from { opacity: 0; } to { opacity: 0; } } ",a=x+"animation: 1ms "+s+"; "}const g=function(l){if(!l.getElementById("detectElementResize")){const x=(e||"")+".resize-triggers { "+(a||"")+'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%; }',y=l.head||l.getElementsByTagName("head")[0],o=l.createElement("style");o.id="detectElementResize",o.type="text/css",t!=null&&o.setAttribute("nonce",t),o.styleSheet?o.styleSheet.cssText=x:o.appendChild(l.createTextNode(x)),y.appendChild(o)}};return{addResizeListener:function(l,x){if(h)l.attachEvent("onresize",x);else{if(!l.__resizeTriggers__){const y=l.ownerDocument,o=S.getComputedStyle(l);o&&o.position==="static"&&(l.style.position="relative"),g(y),l.__resizeLast__={},l.__resizeListeners__=[],(l.__resizeTriggers__=y.createElement("div")).className="resize-triggers";const f=y.createElement("div");f.className="expand-trigger",f.appendChild(y.createElement("div"));const c=y.createElement("div");c.className="contract-trigger",l.__resizeTriggers__.appendChild(f),l.__resizeTriggers__.appendChild(c),l.appendChild(l.__resizeTriggers__),p(l),l.addEventListener("scroll",m,!0),r&&(l.__resizeTriggers__.__animationListener__=function(I){I.animationName===s&&p(l)},l.__resizeTriggers__.addEventListener(r,l.__resizeTriggers__.__animationListener__))}l.__resizeListeners__.push(x)}},removeResizeListener:function(l,x){if(h)l.detachEvent("onresize",x);else if(l.__resizeListeners__.splice(l.__resizeListeners__.indexOf(x),1),!l.__resizeListeners__.length){l.removeEventListener("scroll",m,!0),l.__resizeTriggers__.__animationListener__&&(l.__resizeTriggers__.removeEventListener(r,l.__resizeTriggers__.__animationListener__),l.__resizeTriggers__.__animationListener__=null);try{l.__resizeTriggers__=!l.removeChild(l.__resizeTriggers__)}catch{}}}}}class js extends j.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:s,disableWidth:r,onResize:a}=this.props;if(this._parentNode){var u,p,m,h;const g=window.getComputedStyle(this._parentNode)||{},_=parseFloat((u=g.paddingLeft)!==null&&u!==void 0?u:"0"),v=parseFloat((p=g.paddingRight)!==null&&p!==void 0?p:"0"),l=parseFloat((m=g.paddingTop)!==null&&m!==void 0?m:"0"),x=parseFloat((h=g.paddingBottom)!==null&&h!==void 0?h:"0"),y=this._parentNode.getBoundingClientRect(),o=y.height-l-x,f=y.width-_-v,c=this._parentNode.offsetHeight-l-x,d=this._parentNode.offsetWidth-_-v;(!s&&(this.state.height!==c||this.state.scaledHeight!==o)||!r&&(this.state.width!==d||this.state.scaledWidth!==f))&&(this.setState({height:c,width:d,scaledHeight:o,scaledWidth:f}),typeof a=="function"&&a({height:c,scaledHeight:o,scaledWidth:f,width:d}))}},this._setRef=s=>{this._autoSizer=s}}componentDidMount(){const{nonce:e}=this.props;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(()=>{this._timeoutId=setTimeout(this._onResize,0)}),this._resizeObserver.observe(this._parentNode)):(this._detectElementResize=Ms(e),this._detectElementResize.addResizeListener(this._parentNode,this._onResize)),this._onResize()))}componentWillUnmount(){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()))}render(){const{children:e,defaultHeight:s,defaultWidth:r,disableHeight:a=!1,disableWidth:u=!1,nonce:p,onResize:m,style:h={},tagName:g="div",..._}=this.props,{height:v,scaledHeight:l,scaledWidth:x,width:y}=this.state,o={overflow:"visible"},f={};let c=!1;return a||(v===0&&(c=!0),o.height=0,f.height=v,f.scaledHeight=l),u||(y===0&&(c=!0),o.width=0,f.width=y,f.scaledWidth=x),j.createElement(g,{ref:this._setRef,style:{...o,...h},..._},!c&&e(f))}}function W(){return W=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=s[r])}return t},W.apply(this,arguments)}function ce(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function V(t,e){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},V(t,e)}function zs(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,V(t,e)}var de=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Ns(t,e){return!!(t===e||de(t)&&de(e))}function Ts(t,e){if(t.length!==e.length)return!1;for(var s=0;s<t.length;s++)if(!Ns(t[s],e[s]))return!1;return!0}function U(t,e){e===void 0&&(e=Ts);var s,r=[],a,u=!1;function p(){for(var m=[],h=0;h<arguments.length;h++)m[h]=arguments[h];return u&&s===this&&e(m,r)||(a=t.apply(this,m),u=!0,s=this,r=m),a}return p}var Ss=typeof performance=="object"&&typeof performance.now=="function",ue=Ss?function(){return performance.now()}:function(){return Date.now()};function pe(t){cancelAnimationFrame(t.id)}function As(t,e){var s=ue();function r(){ue()-s>=e?t.call(null):a.id=requestAnimationFrame(r)}var a={id:requestAnimationFrame(r)};return a}var q=-1;function fe(t){if(t===void 0&&(t=!1),q===-1||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",document.body.appendChild(e),q=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return q}var w=null;function he(t){if(t===void 0&&(t=!1),w===null||t){var e=document.createElement("div"),s=e.style;s.width="50px",s.height="50px",s.overflow="scroll",s.direction="rtl";var r=document.createElement("div"),a=r.style;return a.width="100px",a.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?w="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?w="negative":w="positive-ascending"),document.body.removeChild(e),w}return w}var Ds=150,ws=function(e,s){return e};function Es(t){var e,s=t.getItemOffset,r=t.getEstimatedTotalSize,a=t.getItemSize,u=t.getOffsetForIndexAndAlignment,p=t.getStartIndexForOffset,m=t.getStopIndexForStartIndex,h=t.initInstanceProps,g=t.shouldResetStyleCacheOnItemSizeChange,_=t.validateProps;return e=function(v){zs(l,v);function l(y){var o;return o=v.call(this,y)||this,o._instanceProps=h(o.props,ce(o)),o._outerRef=void 0,o._resetIsScrollingTimeoutId=null,o.state={instance:ce(o),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof o.props.initialScrollOffset=="number"?o.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},o._callOnItemsRendered=void 0,o._callOnItemsRendered=U(function(f,c,d,I){return o.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:c,visibleStartIndex:d,visibleStopIndex:I})}),o._callOnScroll=void 0,o._callOnScroll=U(function(f,c,d){return o.props.onScroll({scrollDirection:f,scrollOffset:c,scrollUpdateWasRequested:d})}),o._getItemStyle=void 0,o._getItemStyle=function(f){var c=o.props,d=c.direction,I=c.itemSize,z=c.layout,M=o._getItemStyleCache(g&&I,g&&z,g&&d),N;if(M.hasOwnProperty(f))N=M[f];else{var T=s(o.props,f,o._instanceProps),A=a(o.props,f,o._instanceProps),D=d==="horizontal"||z==="horizontal",k=d==="rtl",b=D?T:0;M[f]=N={position:"absolute",left:k?void 0:b,right:k?b:void 0,top:D?0:T,height:D?"100%":A,width:D?A:"100%"}}return N},o._getItemStyleCache=void 0,o._getItemStyleCache=U(function(f,c,d){return{}}),o._onScrollHorizontal=function(f){var c=f.currentTarget,d=c.clientWidth,I=c.scrollLeft,z=c.scrollWidth;o.setState(function(M){if(M.scrollOffset===I)return null;var N=o.props.direction,T=I;if(N==="rtl")switch(he()){case"negative":T=-I;break;case"positive-descending":T=z-d-I;break}return T=Math.max(0,Math.min(T,z-d)),{isScrolling:!0,scrollDirection:M.scrollOffset<I?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._onScrollVertical=function(f){var c=f.currentTarget,d=c.clientHeight,I=c.scrollHeight,z=c.scrollTop;o.setState(function(M){if(M.scrollOffset===z)return null;var N=Math.max(0,Math.min(z,I-d));return{isScrolling:!0,scrollDirection:M.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},o._resetIsScrollingDebounced)},o._outerRefSetter=function(f){var c=o.props.outerRef;o._outerRef=f,typeof c=="function"?c(f):c!=null&&typeof c=="object"&&c.hasOwnProperty("current")&&(c.current=f)},o._resetIsScrollingDebounced=function(){o._resetIsScrollingTimeoutId!==null&&pe(o._resetIsScrollingTimeoutId),o._resetIsScrollingTimeoutId=As(o._resetIsScrolling,Ds)},o._resetIsScrolling=function(){o._resetIsScrollingTimeoutId=null,o.setState({isScrolling:!1},function(){o._getItemStyleCache(-1,null)})},o}l.getDerivedStateFromProps=function(o,f){return Os(o,f),_(o),null};var x=l.prototype;return x.scrollTo=function(o){o=Math.max(0,o),this.setState(function(f){return f.scrollOffset===o?null:{scrollDirection:f.scrollOffset<o?"forward":"backward",scrollOffset:o,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},x.scrollToItem=function(o,f){f===void 0&&(f="auto");var c=this.props,d=c.itemCount,I=c.layout,z=this.state.scrollOffset;o=Math.max(0,Math.min(o,d-1));var M=0;if(this._outerRef){var N=this._outerRef;I==="vertical"?M=N.scrollWidth>N.clientWidth?fe():0:M=N.scrollHeight>N.clientHeight?fe():0}this.scrollTo(u(this.props,o,f,z,this._instanceProps,M))},x.componentDidMount=function(){var o=this.props,f=o.direction,c=o.initialScrollOffset,d=o.layout;if(typeof c=="number"&&this._outerRef!=null){var I=this._outerRef;f==="horizontal"||d==="horizontal"?I.scrollLeft=c:I.scrollTop=c}this._callPropsCallbacks()},x.componentDidUpdate=function(){var o=this.props,f=o.direction,c=o.layout,d=this.state,I=d.scrollOffset,z=d.scrollUpdateWasRequested;if(z&&this._outerRef!=null){var M=this._outerRef;if(f==="horizontal"||c==="horizontal")if(f==="rtl")switch(he()){case"negative":M.scrollLeft=-I;break;case"positive-ascending":M.scrollLeft=I;break;default:var N=M.clientWidth,T=M.scrollWidth;M.scrollLeft=T-N-I;break}else M.scrollLeft=I;else M.scrollTop=I}this._callPropsCallbacks()},x.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pe(this._resetIsScrollingTimeoutId)},x.render=function(){var o=this.props,f=o.children,c=o.className,d=o.direction,I=o.height,z=o.innerRef,M=o.innerElementType,N=o.innerTagName,T=o.itemCount,A=o.itemData,D=o.itemKey,k=D===void 0?ws:D,b=o.layout,ze=o.outerElementType,Ne=o.outerTagName,Te=o.style,Se=o.useIsScrolling,Ae=o.width,H=this.state.isScrolling,C=d==="horizontal"||b==="horizontal",De=C?this._onScrollHorizontal:this._onScrollVertical,B=this._getRangeToRender(),we=B[0],Ee=B[1],G=[];if(T>0)for(var E=we;E<=Ee;E++)G.push(j.createElement(f,{data:A,key:k(E,A),index:E,isScrolling:Se?H:void 0,style:this._getItemStyle(E)}));var Z=r(this.props,this._instanceProps);return j.createElement(ze||Ne||"div",{className:c,onScroll:De,ref:this._outerRefSetter,style:W({position:"relative",height:I,width:Ae,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:d},Te)},j.createElement(M||N||"div",{children:G,ref:z,style:{height:C?"100%":Z,pointerEvents:H?"none":void 0,width:C?Z:"100%"}}))},x._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var o=this.props.itemCount;if(o>0){var f=this._getRangeToRender(),c=f[0],d=f[1],I=f[2],z=f[3];this._callOnItemsRendered(c,d,I,z)}}if(typeof this.props.onScroll=="function"){var M=this.state,N=M.scrollDirection,T=M.scrollOffset,A=M.scrollUpdateWasRequested;this._callOnScroll(N,T,A)}},x._getRangeToRender=function(){var o=this.props,f=o.itemCount,c=o.overscanCount,d=this.state,I=d.isScrolling,z=d.scrollDirection,M=d.scrollOffset;if(f===0)return[0,0,0,0];var N=p(this.props,M,this._instanceProps),T=m(this.props,N,M,this._instanceProps),A=!I||z==="backward"?Math.max(1,c):1,D=!I||z==="forward"?Math.max(1,c):1;return[Math.max(0,N-A),Math.max(0,Math.min(f-1,T+D)),N,T]},l}(j.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Os=function(e,s){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,s.instance},ks=Es({getItemOffset:function(e,s){var r=e.itemSize;return s*r},getItemSize:function(e,s){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var s=e.itemCount,r=e.itemSize;return r*s},getOffsetForIndexAndAlignment:function(e,s,r,a,u,p){var m=e.direction,h=e.height,g=e.itemCount,_=e.itemSize,v=e.layout,l=e.width,x=m==="horizontal"||v==="horizontal",y=x?l:h,o=Math.max(0,g*_-y),f=Math.min(o,s*_),c=Math.max(0,s*_-y+_+p);switch(r==="smart"&&(a>=c-y&&a<=f+y?r="auto":r="center"),r){case"start":return f;case"end":return c;case"center":{var d=Math.round(c+(f-c)/2);return d<Math.ceil(y/2)?0:d>o+Math.floor(y/2)?o:d}case"auto":default:return a>=c&&a<=f?a:a<c?c:f}},getStartIndexForOffset:function(e,s){var r=e.itemCount,a=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(s/a)))},getStopIndexForStartIndex:function(e,s,r){var a=e.direction,u=e.height,p=e.itemCount,m=e.itemSize,h=e.layout,g=e.width,_=a==="horizontal"||h==="horizontal",v=s*m,l=_?g:u,x=Math.ceil((l+r-v)/m);return Math.max(0,Math.min(p-1,s+x-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function bs(t){var e=t.lastRenderedStartIndex,s=t.lastRenderedStopIndex,r=t.startIndex,a=t.stopIndex;return!(r>s||a<e)}function Ls(t){for(var e=t.isItemLoaded,s=t.itemCount,r=t.minimumBatchSize,a=t.startIndex,u=t.stopIndex,p=[],m=null,h=null,g=a;g<=u;g++){var _=e(g);_?h!==null&&(p.push(m,h),m=h=null):(h=g,m===null&&(m=g))}if(h!==null){for(var v=Math.min(Math.max(h,m+r-1),s-1),l=h+1;l<=v&&!e(l);l++)h=l;p.push(m,h)}if(p.length)for(;p[1]-p[0]+1<r&&p[0]>0;){var x=p[0]-1;if(!e(x))p[0]=x;else break}return p}var Cs=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Rs=function(){function t(e,s){for(var r=0;r<s.length;r++){var a=s[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,s,r){return s&&t(e.prototype,s),r&&t(e,r),e}}(),$s=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},me=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:t},Qs=function(t){$s(e,t);function e(){var s,r,a,u;Cs(this,e);for(var p=arguments.length,m=Array(p),h=0;h<p;h++)m[h]=arguments[h];return u=(r=(a=me(this,(s=e.__proto__||Object.getPrototypeOf(e)).call.apply(s,[this].concat(m))),a),a._lastRenderedStartIndex=-1,a._lastRenderedStopIndex=-1,a._memoizedUnloadedRanges=[],a._onItemsRendered=function(g){var _=g.visibleStartIndex,v=g.visibleStopIndex;a._lastRenderedStartIndex=_,a._lastRenderedStopIndex=v,a._ensureRowsLoaded(_,v)},a._setRef=function(g){a._listRef=g},r),me(a,u)}return Rs(e,[{key:"resetloadMoreItemsCache",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],r&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var r=this.props.children;return r({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(r,a){var u=this.props,p=u.isItemLoaded,m=u.itemCount,h=u.minimumBatchSize,g=h===void 0?10:h,_=u.threshold,v=_===void 0?15:_,l=Ls({isItemLoaded:p,itemCount:m,minimumBatchSize:g,startIndex:Math.max(0,r-v),stopIndex:Math.min(m-1,a+v)});(this._memoizedUnloadedRanges.length!==l.length||this._memoizedUnloadedRanges.some(function(x,y){return l[y]!==x}))&&(this._memoizedUnloadedRanges=l,this._loadUnloadedRanges(l))}},{key:"_loadUnloadedRanges",value:function(r){for(var a=this,u=this.props.loadMoreItems||this.props.loadMoreRows,p=function(g){var _=r[g],v=r[g+1],l=u(_,v);l!=null&&l.then(function(){if(bs({lastRenderedStartIndex:a._lastRenderedStartIndex,lastRenderedStopIndex:a._lastRenderedStopIndex,startIndex:_,stopIndex:v})){if(a._listRef==null)return;typeof a._listRef.resetAfterIndex=="function"?a._listRef.resetAfterIndex(_,!0):(typeof a._listRef._getItemStyleCache=="function"&&a._listRef._getItemStyleCache(-1),a._listRef.forceUpdate())}})},m=0;m<r.length;m+=2)p(m)}}]),e}(j.PureComponent);const Us=()=>i.C1,qs=i.styled_default("div")({name:"a",class:"a1w9zony",propsAsIs:!1}),Ys=i.styled_default("div")({name:"l",class:"l16qcfv8",propsAsIs:!1}),Ps=i.styled_default("img")({name:"p",class:"p1gmcc5f",propsAsIs:!1}),Fs=i.styled_default("div")({name:"s",class:"s1doddh0",propsAsIs:!1}),Ws=i.styled_default("div")({name:"c",class:"c1js9xhe",propsAsIs:!1}),Vs=i.styled_default("div")({name:"d",class:"d1tmnqsh",propsAsIs:!1}),Hs=i.styled_default("span")({name:"g",class:"gi9h87j",propsAsIs:!1}),Bs=i.styled_default(Us())({name:"x",class:"x13mk3z6",propsAsIs:!0}),Gs=({rank:t,avatar:e,name:s,points:r,isCurrentUser:a,openItemDetail:u,style:p})=>n.jsxs(qs,{onClick:u,style:p,children:[n.jsx(Ys,{children:t||0}),n.jsxs(Ws,{children:[e?n.jsx(Ps,{alt:"leaderboard-item-avatar",src:e}):n.jsx(Fs,{children:i.o$1(s||"")}),n.jsxs(Vs,{children:[n.jsx(Hs,{children:s||""}),a&&n.jsx(Bs,{name:"icon-star"})]})]}),n.jsx("div",{children:i.i(r)})]}),Zs=({items:t,openItemDetail:e,fetchMore:s})=>n.jsx(js,{children:({width:r,height:a})=>n.jsx(Qs,{isItemLoaded:u=>u<t.length,itemCount:t.length+1,loadMoreItems:s,children:({onItemsRendered:u,ref:p})=>n.jsx(ks,{itemSize:56,onItemsRendered:u,ref:p,itemCount:t.length,width:r,height:a,children:({index:m,style:h})=>n.jsx(Gs,{style:{...h,maxHeight:48},...t[m],openItemDetail:()=>e(t[m].userId)},t[m].userId)})})}),Js=({leaderboardList:t,openUser:e})=>{const{data:s}=i.useStore(t.$store);return n.jsx(Zs,{fetchMore:t.fetchMore,items:s,openItemDetail:e})};const Ks=i.styled_default("button")({name:"a",class:"akly9h2",propsAsIs:!1}),Xs=i.styled_default("span")({name:"e",class:"eptoiz9",propsAsIs:!1}),en=({disabled:t,variant:e="primary",onClick:s,children:r,...a})=>n.jsx(Ks,{onClick:s,disabled:t,"data-variant":e,...a,children:n.jsx(Xs,{children:r})});const tn=()=>i.C1,sn=()=>i.C1,nn=i.styled_default("div")({name:"s",class:"s1lblda3",propsAsIs:!1}),rn=i.styled_default("div")({name:"a",class:"ascvb2g",propsAsIs:!1}),an=i.styled_default("div")({name:"p",class:"p17rl8zy",propsAsIs:!1}),on=i.styled_default("div")({name:"l",class:"l1vvttbn",propsAsIs:!1}),Y=i.styled_default(tn())({name:"c",class:"c6fk2ph",propsAsIs:!0}),ln=i.styled_default(sn())({name:"d",class:"d1rdm136",propsAsIs:!0}),cn=i.styled_default("div")({name:"f",class:"fwqnnel",propsAsIs:!1}),dn=i.styled_default("div")({name:"u",class:"ucyxnlg",propsAsIs:!1}),un={[i.PickHistoryStatus.LOST]:n.jsx(Y,{name:"icon-cross"}),[i.PickHistoryStatus.WON]:n.jsx(Y,{name:"icon-check"}),[i.PickHistoryStatus.UNSET]:void 0,[i.PickHistoryStatus.DNP]:n.jsx(Y,{name:"icon-arrow"})},pn=({questionId:t,questionType:e,questionStatus:s,subject:r,openForVoting:a,openQuestion:u,status:p})=>{const m=i.o[e],h=un[p];return m?n.jsxs(nn,{onClick:()=>u==null?void 0:u(t),children:[n.jsxs(dn,{children:[n.jsxs(rn,{children:[n.jsx(ln,{name:m.iconName}),n.jsxs(cn,{children:[m.label,e===i.QuestionType.TRIVIA&&s===i.QuestionStatus.RESOLVED&&" • Expired"]})]}),n.jsx(an,{children:r||""})]}),n.jsx(on,{children:h||(a?n.jsx(en,{children:"Play"}):null)})]}):null};const fn=i.styled_default("div")({name:"n",class:"n1jcgove",propsAsIs:!1}),hn=i.styled_default("button")({name:"l",class:"l1bwp7hh",propsAsIs:!1}),mn=({openInsight:t,questionId:e,...s})=>n.jsxs(fn,{children:[n.jsx(Me,{questionId:e,...s}),t&&n.jsx(hn,{onClick:()=>t(e),children:"View Insight"})]});const gn=i.styled_default("div")({name:"t",class:"t19vr3p1",propsAsIs:!1}),In=({questions:t,openQuestion:e})=>n.jsx(gn,{children:t==null?void 0:t.map(s=>{var r,a;if(s.type==="question"&&((r=s.attributes)==null?void 0:r.attributes.case)==="question"){const u=s.attributes.attributes.value;return n.jsx(pn,{openQuestion:e,...u},u.questionId)}if(s.type==="insight"&&((a=s.attributes)==null?void 0:a.attributes.case)==="insight"){const u=s.attributes.attributes.value;return n.jsx(mn,{openInsight:e,...u},u.questionId)}return null})}),yn=({store:t,openQuestion:e})=>{const s=i.useStore(t);return s!=null&&s.data?n.jsx(In,{openQuestion:e,questions:s.data}):n.jsx("div",{children:"wait questions..."})},xn=({userSummary:t})=>{var e;const s=i.useStore(t.getStore());return(e=s.data)!=null&&e.summary?n.jsx(ye,{...s.data.summary,...s.data.percentage}):n.jsx("div",{children:"wait user..."})},vn=({gamification:t})=>{const[e,s]=j.useState(O.HOME);return n.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[n.jsxs(i.e,{children:[n.jsx(_s,{activePage:e,toggleActivePage:s}),e===O.HOME&&n.jsx(xn,{userSummary:t.userSummary})]}),e===O.HOME&&n.jsx(i.n$1,{children:n.jsx(yn,{openQuestion:t.openQuestion,store:t.feedList.getStore()})}),e===O.LEADERBOARD&&n.jsx(i.n$1,{style:{flex:"1 1 auto",paddingTop:0,paddingBottom:0},children:n.jsx(Js,{openUser:t.openUser,leaderboardList:t.leaderboardList})})]})};const _n=()=>i.f,ge=i.styled_default(_n())({name:"e",class:"e1ph66cs",propsAsIs:!0}),Mn=i.styled_default("div")({name:"x",class:"xorme7i",propsAsIs:!1}),je=({gamification:t,className:e})=>{const s=i.useStore(t.openedQuestion.$store),r=i.useStore(t.openedUser);return n.jsxs(n.Fragment,{children:[s&&n.jsx(ge,{className:e,children:n.jsx(gs,{gamification:t})}),r&&n.jsx(ge,{className:e,children:n.jsxs(Mn,{children:[n.jsx(Ie,{label:"Friend's Rank",close:t.closeUser}),n.jsx(i.e,{children:n.jsx(ye,{...r})})]})}),n.jsx(i.r,{className:e,"data-nav":"true",children:n.jsx(vn,{gamification:t})})]})};exports.GamificationOverlay=je;exports.default=je;
|
package/lib/dist/index.d.ts
CHANGED
|
@@ -770,6 +770,13 @@ declare module "../../sdk-web-notifications/src/notifications" {
|
|
|
770
770
|
questionType: QuestionType;
|
|
771
771
|
question?: {
|
|
772
772
|
title: string;
|
|
773
|
+
votedAnswer?: {
|
|
774
|
+
title?: string;
|
|
775
|
+
points?: number;
|
|
776
|
+
};
|
|
777
|
+
predictionResult?: boolean;
|
|
778
|
+
correct?: boolean;
|
|
779
|
+
correctAnswerTitle?: string;
|
|
773
780
|
};
|
|
774
781
|
insight?: InstantView;
|
|
775
782
|
onboarding?: GameSettings;
|