@streamlayer/react 0.32.9 → 0.32.11
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/gamification-feature.js +1 -1
- package/lib/cjs/masters2.js +2 -2
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +17 -17
- package/lib/dist/es/gamification-feature.js +554 -543
- package/lib/dist/es/masters.js +5542 -5541
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +527 -516
- package/lib/es/masters2.js +1363 -1362
- package/lib/style.css +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),x=require("react"),ke=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Oe=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),be=()=>n.o1,we=n.styled_default(be())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),Ce=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),_e=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ee=()=>n.o1,Le=n.styled_default(Ee())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ye=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(ke,{children:[s.jsxs(Oe,{children:[(r==null?void 0:r.iconName)&&s.jsx(we,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(Ce,{children:r.label})]}),s.jsx(_e,{onClick:t,children:s.jsx(Le,{name:"icon-cross"})})]})},xe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ge=e=>e?e.toLocaleString("en-US"):"0",G=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),Z=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),J=e=>!isNaN(e.getTime()),$e=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Re=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),se=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Re,{children:t}),s.jsx(Qe,{children:e})]}),Ue=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Ve=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Fe=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ze=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),rt=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),ot="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",je=({avatar:e,name:t,points:i,friendsRank:r,rank:o,streak:d,correct:l,incorrect:p,inTop:c,successRate:h})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Fe,{children:[s.jsxs(rt,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:xe(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ge,{children:t}),s.jsxs(Ze,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:ot}),s.jsxs(Xe,{children:[ge(i),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(Ve,{children:[s.jsxs(st,{children:[s.jsx(se,{indicator:r||0,title:"Friends rank"}),s.jsx(se,{indicator:o||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx($,{indicator:d||0,title:"Win streak"}),s.jsx($,{indicator:l||0,title:"Correct"}),s.jsx($,{indicator:p||0,title:"Incorrect"}),s.jsx($,{indicator:`${h||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),lt=()=>n.o1,dt=n.styled_default(lt())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ct=()=>s.jsx(at,{children:s.jsx(dt,{name:"mastersLogo"})}),ut=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),pt=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),mt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ft=({title:e,description:t})=>s.jsxs(ut,{children:[s.jsx(n.o1,{name:"icon-check-circle"}),s.jsx(pt,{children:e}),s.jsx(mt,{children:t})]}),ht=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),It=()=>n.o1,yt=n.styled_default(It())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),L=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),R=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),xt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),C=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),W=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),gt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:d,votedInCurrentRender:l,votedAfterQuestionClosed:p,enteredAnActiveQuestion:c})=>{const h=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION)&&l&&d!==n.QuestionStatus.RESOLVED,v=r===n.QuestionType.PREDICTION&&!o,g=d===n.QuestionStatus.RESOLVED&&r===n.QuestionType.TRIVIA&&!i&&!c,y=r===n.QuestionType.TRIVIA&&p&&l&&c,T=d===n.QuestionStatus.RESOLVED&&r===n.QuestionType.PREDICTION&&!i&&!c||r===n.QuestionType.PREDICTION&&p&&l&&c,A=h&&v,a=h&&o,m=i&&r===n.QuestionType.POLL&&l;if(!g&&!y&&!A&&!a&&!T&&!m)return null;const u=t?"correct":"incorrect",f=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return s.jsxs(ht,{"data-isPrediction":v,children:[g&&s.jsxs(s.Fragment,{children:[s.jsx(L,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(R,{children:s.jsx(C,{children:"Question Expired"})}),s.jsx(W,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),y&&s.jsxs(s.Fragment,{children:[s.jsx(L,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(R,{children:s.jsx(C,{children:"Question Closed"})}),s.jsx(W,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),T&&s.jsxs(s.Fragment,{children:[s.jsx(L,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(R,{children:s.jsx(C,{children:"Question Closed"})}),s.jsx(W,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),A&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{name:"icon-prediction"}),s.jsx(C,{children:"Stay tuned to see if your prediction was correct."})]}),m&&s.jsxs(s.Fragment,{children:[s.jsx(L,{"data-feedbackType":"correct",children:s.jsx(n.o1,{name:"correct"})}),s.jsx(C,{children:"That's for answering. Please stay tuned for the next question."})]}),a&&s.jsxs(s.Fragment,{children:[s.jsx(L,{"data-feedbackType":u,children:s.jsx(n.o1,{name:u})}),s.jsx("div",{children:s.jsxs(R,{children:[s.jsx(xt,{"data-feedbackType":u,children:f==null?void 0:f.title}),s.jsx(C,{children:f==null?void 0:f.description})]})})]})]})},jt=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),At=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Nt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),St=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Dt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),zt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),ve=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),kt=()=>ve,Ot=n.styled_default(kt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),bt=()=>ve,wt=n.styled_default(bt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ct=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),_t=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Et=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Lt=()=>n.o1,$t=n.styled_default(Lt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),ne={[n.QuestionImages.CENTERED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Dt,{children:s.jsx(zt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(wt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&o)return r?i?"correct":"incorrect":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o&&r?i?"correct":"incorrect":"unset"},Qt=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,Ut=e=>{var t;const{id:i,icon:r,text:o,percentageDecimal:d,onVote:l,markThatVoted:p,youSelected:c,questionVoted:h,imageMode:v,answerTimeExpired:g,questionStatus:y,isLoading:T,questionType:A,correct:a,hasCorrectAnswer:m,votedAfterQuestionClosed:u,enteredAnActiveQuestion:f}=e,I=Rt(e),S=Qt({questionType:A,questionVoted:h,correct:a,hasCorrectAnswer:m,questionStatus:y}),j=y===n.QuestionStatus.RESOLVED&&A===n.QuestionType.PREDICTION,N=h||j;return s.jsxs(At,{value:i,"data-selected":c,"data-answerState":I,disabled:h||T||g||j&&!f||j&&f&&u,"data-isNotChecked":h&&!c&&I!=="incorrect",onClick:M=>{p(y===n.QuestionStatus.RESOLVED),l(M)},children:[s.jsx(Nt,{"data-answerState":I,style:{width:`${N?d:0}%`}}),s.jsxs(St,{children:[r&&v&&((t=ne[v])==null?void 0:t.call(ne,r)),s.jsx(Ct,{children:o}),N&&s.jsxs(_t,{children:[S&&s.jsx($t,{name:"selected"}),s.jsx(Et,{children:s.jsx(n.d,{value:d,suffix:"%"})})]})]})]})};var ie=typeof window>"u"?x.useEffect:x.useLayoutEffect,qt=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:d})=>{let[l,p]=x.useState(i),c=x.useRef(0),h=x.useRef(i),v=x.useRef(i*-1e3),g=x.useRef(null),y=x.useRef(null),T=x.useRef(null),A=u=>{let f=u/1e3;if(y.current===null){y.current=f,g.current=requestAnimationFrame(A);return}let I=f-y.current,S=c.current+I;y.current=f,c.current=S;let j=h.current+(r===0?S:(S/r|0)*r),N=h.current+S,M=typeof t=="number"&&N>=t;p(M?t:j),M||(g.current=requestAnimationFrame(A))},a=()=>{g.current&&cancelAnimationFrame(g.current),T.current&&clearTimeout(T.current),y.current=null},m=x.useCallback(u=>{a(),c.current=0;let f=typeof u=="number"?u:i;h.current=f,p(f),e&&(g.current=requestAnimationFrame(A))},[e,i]);return ie(()=>{if(d==null||d(l),t&&l>=t){v.current+=t*1e3;let{shouldRepeat:u=!1,delay:f=0,newStartAt:I}=(o==null?void 0:o(v.current/1e3))||{};u&&(T.current=setTimeout(()=>m(I),f*1e3))}},[l,t]),ie(()=>(e&&(g.current=requestAnimationFrame(A)),a),[e,t,r]),{elapsedTime:l,reset:m}},Pt=(e,t,i)=>{let r=e/2,o=t/2,d=r-o,l=2*d,p=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*d;return{path:`m ${r},${o} a ${d},${d} 0 ${p} 0,${l} a ${d},${d} 0 ${p} 0,-${l}`,pathLength:c}},re=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Yt=e=>({position:"relative",width:e,height:e}),Wt={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},Me=(e,t,i,r,o)=>{if(r===0)return t;let d=(o?r-e:e)/r;return t+i*d},oe=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,d,l)=>`#${o}${o}${d}${d}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},Vt=(e,t)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:d=!0}=e;if(typeof r=="string")return r;let l=(i=o==null?void 0:o.findIndex((y,T)=>y>=t&&t>=o[T+1]))!=null?i:-1;if(!o||l===-1)return r[0];if(!d)return r[l];let p=o[l]-t,c=o[l]-o[l+1],h=oe(r[l]),v=oe(r[l+1]),g=!!e.isGrowing;return`rgb(${h.map((y,T)=>Me(p,y,v[T]-y,c,g)|0).join(",")})`},Ft=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:d=12,trailStrokeWidth:l,isPlaying:p=!1,isGrowing:c=!1,rotation:h="clockwise",onComplete:v,onUpdate:g}=e,y=x.useRef(),T=Math.max(d,l??0),{path:A,pathLength:a}=Pt(o,T,h),{elapsedTime:m}=qt({isPlaying:p,duration:t,startAt:re(t,i),updateInterval:r,onUpdate:typeof g=="function"?f=>{let I=Math.ceil(t-f);I!==y.current&&(y.current=I,g(I))}:void 0,onComplete:typeof v=="function"?f=>{var I;let{shouldRepeat:S,delay:j,newInitialRemainingTime:N}=(I=v(f))!=null?I:{};if(S)return{shouldRepeat:S,delay:j,newStartAt:re(t,N)}}:void 0}),u=t-m;return{elapsedTime:m,path:A,pathLength:a,remainingTime:Math.ceil(u),rotation:h,size:o,stroke:Vt(e,u),strokeDashoffset:Me(m,0,a,t,c),strokeWidth:d}},Te=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:d,pathLength:l,stroke:p,strokeDashoffset:c,remainingTime:h,elapsedTime:v,size:g,strokeWidth:y}=Ft(e);return x.createElement("div",{style:Yt(g)},x.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??y}),x.createElement("path",{d,fill:"none",stroke:p,strokeLinecap:i??"round",strokeWidth:y,strokeDasharray:l,strokeDashoffset:c})),typeof t=="function"&&x.createElement("div",{style:Wt},t({remainingTime:h,elapsedTime:v,color:p})))};Te.displayName="CountdownCircleTimer";const Bt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ht=[10,10,1,0],Gt=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Zt=n.E.SECONDARY_GREEN6,ae=n.E.SECONDARY_RED3,Jt=n.E.NEUTRALS_GRAY3,Kt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,o]=x.useState(t>10?Zt:ae),d=({remainingTime:c})=>s.jsx(Gt,{children:c}),l=x.useCallback(()=>{i==null||i(),o(Jt)},[i,o]),p=x.useCallback(c=>{c===10&&o(ae)},[o]);return s.jsx(Te,{isPlaying:e,duration:t,colors:Bt,colorsTime:Ht,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:p,children:d})},Xt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),es=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),ts=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),ss=()=>n.o1,ns=n.styled_default(ss())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),is=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),rs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),os=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),as=({title:e,points:t,isPlayingTimer:i,isTimer:r,questionType:o,timerDuration:d,onTimerExpired:l})=>s.jsxs(Xt,{children:[s.jsxs(es,{children:[e&&s.jsx(ts,{children:e}),t!==void 0&&o!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(ns,{name:"icon-trophy"}),s.jsxs(is,{children:[s.jsx(rs,{children:s.jsx(n.d,{value:t})}),s.jsx(os,{children:"PTS"})]})]})]}),r&&s.jsx(Kt,{isPlaying:i,onTimerExpired:l,duration:d})]}),ls=({openedQuestion:e,isLoading:t,vote:i,close:r})=>{var o,d;const l=e.subject,p=e.type,c=(o=e.options)==null?void 0:o.options,[h,v]=x.useState(!1),[g,y]=x.useState(!1),[T,A]=x.useState(!0),[a,m]=x.useState(!1),[u,f]=x.useState(""),I=e==null?void 0:e.id;x.useEffect(()=>{e.status===n.QuestionStatus.RESOLVED&&A(!1)},[]);const S=x.useCallback(D=>{y(D),v(!0)},[]),j=x.useCallback(async D=>{if(I){const O=D.currentTarget.value;f(O),await i(I,O)}},[I,f,i]),N=x.useCallback(()=>{m(!0),setTimeout(r,3e3)},[r]),M=x.useMemo(()=>e==null?void 0:e.answers.find(D=>D.youVoted===!0),[e]),z=x.useMemo(()=>!!(e!=null&&e.answers.find(D=>D.correct===!0)),[e]),k=x.useMemo(()=>e==null?void 0:e.answers.find(D=>D.correct===!0),[e]),b=x.useMemo(()=>e?e.answers.map(D=>{var O;return{...D,questionVoted:!!M,youSelected:u===D.id,isLoading:t,hasCorrectAnswer:z,questionType:e.type,answerTimeExpired:a,questionStatus:e.status,imageMode:(O=e.appearance)==null?void 0:O.images,onVote:j}}):[],[z,a,t,e,M,j,u]),w=c&&(c.case==="trivia"||c.case==="prediction")?c.value:void 0,q=x.useMemo(()=>{if(e.status===n.QuestionStatus.RESOLVED)return 0;if(!a)return M?M.correct?M.points:0:k==null?void 0:k.points},[a,M,k,e.status]),P=x.useMemo(()=>a?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":M?"You won":"To win",[a,e.type,M]);return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(jt,{children:s.jsxs(vt,{children:[s.jsx(gt,{feedbackMessages:w,questionVoted:!!M,questionVotedCorrectly:M==null?void 0:M.correct,questionType:p,hasCorrectAnswer:z,questionStatus:e.status,votedInCurrentRender:h,votedAfterQuestionClosed:g,enteredAnActiveQuestion:T}),e.type!==n.QuestionType.PREDICTION&&s.jsx(as,{title:P,points:q,onTimerExpired:N,questionType:e.type,isTimer:!t,isPlayingTimer:!M,timerDuration:M?0:Number(((d=e==null?void 0:e.appearance)==null?void 0:d.autoHideInterval)||"30")}),a?s.jsx(ft,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:l}),s.jsx(Tt,{children:b.map(D=>s.jsx(Ut,{...D,markThatVoted:S,votedAfterQuestionClosed:g,enteredAnActiveQuestion:T},D.id))})]})]})})})},ds=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),cs=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),us=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ps=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ms=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),fs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Ae=({created:e,image:t,title:i,isPickHistory:r,instantView:o})=>{const d=x.useMemo(()=>{if(e){const p=new Date(e);if(J(p))return{date:G(p),time:Z(p)}}return null},[e]),l=(o==null?void 0:o.image)||t;return s.jsxs(ds,{children:[d&&s.jsxs(ms,{children:[d.date," · ",d.time]}),(o==null?void 0:o.video)&&s.jsx(n.w,{source:o.video.url,poster:o.video.thumbnailUrl}),l&&!(o!=null&&o.video)&&s.jsx(fs,{src:l}),s.jsxs(cs,{children:[s.jsx(us,{children:r?i:o==null?void 0:o.heading}),!r&&s.jsx(ps,{children:o==null?void 0:o.body})]})]})},hs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Is=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ys=({instantView:e,...t})=>s.jsxs(hs,{children:[s.jsx(Ae,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(Is,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.o1,{name:"icon-external-link"})]})]}),xs=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),gs=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),js=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),vs=({created:e,...t})=>{const i=x.useMemo(()=>{if(e){const r=new Date(e);if(J(r))return{date:G(r),time:Z(r)}}return null},[e]);return s.jsxs(xs,{children:[i&&s.jsxs(gs,{children:[i.date," · ",i.time]}),t.title&&s.jsx(js,{children:t.title}),s.jsx(n.u,{...t})]})},Ms=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),Ts=({openedQuestion:e})=>{var t,i;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ys,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?s.jsx(vs,{created:e.attributes.created,...e.attributes.attributes.value}):null},As=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:o}=e;return o?s.jsx(ls,{vote:t,close:i,openedQuestion:o,isLoading:!!r}):null},Ns=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return s.jsxs(Ms,{children:[s.jsx(ye,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),o==="question"&&s.jsx(As,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&s.jsx(Ts,{openedQuestion:i}),s.jsx(ct,{sponsorLogo:""})]})},Ss=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ds=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),zs=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ks=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(U||{});const le=({title:e,active:t,onClick:i})=>s.jsx(zs,{onClick:i,"data-selected":t,children:s.jsx(ks,{children:e})}),Os=({activePage:e="home",toggleActivePage:t})=>s.jsx(Ss,{children:s.jsxs(Ds,{"data-position":e==="home"?"left":"right",children:[s.jsx(le,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(le,{title:"Leader Board",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},B.apply(this,arguments)}function de(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},H(e,t)}function bs(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,H(e,t)}var ce=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function ws(e,t){return!!(e===t||ce(e)&&ce(t))}function Cs(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!ws(e[i],t[i]))return!1;return!0}function V(e,t){t===void 0&&(t=Cs);var i,r=[],o,d=!1;function l(){for(var p=[],c=0;c<arguments.length;c++)p[c]=arguments[c];return d&&i===this&&t(p,r)||(o=e.apply(this,p),d=!0,i=this,r=p),o}return l}var _s=typeof performance=="object"&&typeof performance.now=="function",ue=_s?function(){return performance.now()}:function(){return Date.now()};function pe(e){cancelAnimationFrame(e.id)}function Es(e,t){var i=ue();function r(){ue()-i>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var F=-1;function me(e){if(e===void 0&&(e=!1),F===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),F=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return F}var _=null;function fe(e){if(e===void 0&&(e=!1),_===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?_="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?_="negative":_="positive-ascending"),document.body.removeChild(t),_}return _}var Ls=150,$s=function(t,i){return t};function Rs(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,d=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,p=e.getStopIndexForStartIndex,c=e.initInstanceProps,h=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){bs(y,g);function y(A){var a;return a=g.call(this,A)||this,a._instanceProps=c(a.props,de(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:de(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=V(function(m,u,f,I){return a.props.onItemsRendered({overscanStartIndex:m,overscanStopIndex:u,visibleStartIndex:f,visibleStopIndex:I})}),a._callOnScroll=void 0,a._callOnScroll=V(function(m,u,f){return a.props.onScroll({scrollDirection:m,scrollOffset:u,scrollUpdateWasRequested:f})}),a._getItemStyle=void 0,a._getItemStyle=function(m){var u=a.props,f=u.direction,I=u.itemSize,S=u.layout,j=a._getItemStyleCache(h&&I,h&&S,h&&f),N;if(j.hasOwnProperty(m))N=j[m];else{var M=i(a.props,m,a._instanceProps),z=o(a.props,m,a._instanceProps),k=f==="horizontal"||S==="horizontal",b=f==="rtl",w=k?M:0;j[m]=N={position:"absolute",left:b?void 0:w,right:b?w:void 0,top:k?0:M,height:k?"100%":z,width:k?z:"100%"}}return N},a._getItemStyleCache=void 0,a._getItemStyleCache=V(function(m,u,f){return{}}),a._onScrollHorizontal=function(m){var u=m.currentTarget,f=u.clientWidth,I=u.scrollLeft,S=u.scrollWidth;a.setState(function(j){if(j.scrollOffset===I)return null;var N=a.props.direction,M=I;if(N==="rtl")switch(fe()){case"negative":M=-I;break;case"positive-descending":M=S-f-I;break}return M=Math.max(0,Math.min(M,S-f)),{isScrolling:!0,scrollDirection:j.scrollOffset<I?"forward":"backward",scrollOffset:M,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(m){var u=m.currentTarget,f=u.clientHeight,I=u.scrollHeight,S=u.scrollTop;a.setState(function(j){if(j.scrollOffset===S)return null;var N=Math.max(0,Math.min(S,I-f));return{isScrolling:!0,scrollDirection:j.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(m){var u=a.props.outerRef;a._outerRef=m,typeof u=="function"?u(m):u!=null&&typeof u=="object"&&u.hasOwnProperty("current")&&(u.current=m)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&pe(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=Es(a._resetIsScrolling,Ls)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}y.getDerivedStateFromProps=function(a,m){return Qs(a,m),v(a),null};var T=y.prototype;return T.scrollTo=function(a){a=Math.max(0,a),this.setState(function(m){return m.scrollOffset===a?null:{scrollDirection:m.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},T.scrollToItem=function(a,m){m===void 0&&(m="auto");var u=this.props,f=u.itemCount,I=u.layout,S=this.state.scrollOffset;a=Math.max(0,Math.min(a,f-1));var j=0;if(this._outerRef){var N=this._outerRef;I==="vertical"?j=N.scrollWidth>N.clientWidth?me():0:j=N.scrollHeight>N.clientHeight?me():0}this.scrollTo(d(this.props,a,m,S,this._instanceProps,j))},T.componentDidMount=function(){var a=this.props,m=a.direction,u=a.initialScrollOffset,f=a.layout;if(typeof u=="number"&&this._outerRef!=null){var I=this._outerRef;m==="horizontal"||f==="horizontal"?I.scrollLeft=u:I.scrollTop=u}this._callPropsCallbacks()},T.componentDidUpdate=function(){var a=this.props,m=a.direction,u=a.layout,f=this.state,I=f.scrollOffset,S=f.scrollUpdateWasRequested;if(S&&this._outerRef!=null){var j=this._outerRef;if(m==="horizontal"||u==="horizontal")if(m==="rtl")switch(fe()){case"negative":j.scrollLeft=-I;break;case"positive-ascending":j.scrollLeft=I;break;default:var N=j.clientWidth,M=j.scrollWidth;j.scrollLeft=M-N-I;break}else j.scrollLeft=I;else j.scrollTop=I}this._callPropsCallbacks()},T.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pe(this._resetIsScrollingTimeoutId)},T.render=function(){var a=this.props,m=a.children,u=a.className,f=a.direction,I=a.height,S=a.innerRef,j=a.innerElementType,N=a.innerTagName,M=a.itemCount,z=a.itemData,k=a.itemKey,b=k===void 0?$s:k,w=a.layout,q=a.outerElementType,P=a.outerTagName,D=a.style,O=a.useIsScrolling,Ne=a.width,K=this.state.isScrolling,Y=f==="horizontal"||w==="horizontal",Se=Y?this._onScrollHorizontal:this._onScrollVertical,X=this._getRangeToRender(),De=X[0],ze=X[1],ee=[];if(M>0)for(var E=De;E<=ze;E++)ee.push(x.createElement(m,{data:z,key:b(E,z),index:E,isScrolling:O?K:void 0,style:this._getItemStyle(E)}));var te=r(this.props,this._instanceProps);return x.createElement(q||P||"div",{className:u,onScroll:Se,ref:this._outerRefSetter,style:B({position:"relative",height:I,width:Ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},D)},x.createElement(j||N||"div",{children:ee,ref:S,style:{height:Y?"100%":te,pointerEvents:K?"none":void 0,width:Y?te:"100%"}}))},T._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var m=this._getRangeToRender(),u=m[0],f=m[1],I=m[2],S=m[3];this._callOnItemsRendered(u,f,I,S)}}if(typeof this.props.onScroll=="function"){var j=this.state,N=j.scrollDirection,M=j.scrollOffset,z=j.scrollUpdateWasRequested;this._callOnScroll(N,M,z)}},T._getRangeToRender=function(){var a=this.props,m=a.itemCount,u=a.overscanCount,f=this.state,I=f.isScrolling,S=f.scrollDirection,j=f.scrollOffset;if(m===0)return[0,0,0,0];var N=l(this.props,j,this._instanceProps),M=p(this.props,N,j,this._instanceProps),z=!I||S==="backward"?Math.max(1,u):1,k=!I||S==="forward"?Math.max(1,u):1;return[Math.max(0,N-z),Math.max(0,Math.min(m-1,M+k)),N,M]},y}(x.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Qs=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Us=Rs({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,o,d,l){var p=t.direction,c=t.height,h=t.itemCount,v=t.itemSize,g=t.layout,y=t.width,T=p==="horizontal"||g==="horizontal",A=T?y:c,a=Math.max(0,h*v-A),m=Math.min(a,i*v),u=Math.max(0,i*v-A+v+l);switch(r==="smart"&&(o>=u-A&&o<=m+A?r="auto":r="center"),r){case"start":return m;case"end":return u;case"center":{var f=Math.round(u+(m-u)/2);return f<Math.ceil(A/2)?0:f>a+Math.floor(A/2)?a:f}case"auto":default:return o>=u&&o<=m?o:o<u?u:m}},getStartIndexForOffset:function(t,i){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/o)))},getStopIndexForStartIndex:function(t,i,r){var o=t.direction,d=t.height,l=t.itemCount,p=t.itemSize,c=t.layout,h=t.width,v=o==="horizontal"||c==="horizontal",g=i*p,y=v?h:d,T=Math.ceil((y+r-g)/p);return Math.max(0,Math.min(l-1,i+T-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function qs(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<t)}function Ps(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,d=e.stopIndex,l=[],p=null,c=null,h=o;h<=d;h++){var v=t(h);v?c!==null&&(l.push(p,c),p=c=null):(c=h,p===null&&(p=h))}if(c!==null){for(var g=Math.min(Math.max(c,p+r-1),i-1),y=c+1;y<=g&&!t(y);y++)c=y;l.push(p,c)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var T=l[0]-1;if(!t(T))l[0]=T;else break}return l}var Ys=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ws=function(){function e(t,i){for(var r=0;r<i.length;r++){var o=i[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),Vs=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},he=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Fs=function(e){Vs(t,e);function t(){var i,r,o,d;Ys(this,t);for(var l=arguments.length,p=Array(l),c=0;c<l;c++)p[c]=arguments[c];return d=(r=(o=he(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(p))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(h){var v=h.visibleStartIndex,g=h.visibleStopIndex;o._lastRenderedStartIndex=v,o._lastRenderedStopIndex=g,o._ensureRowsLoaded(v,g)},o._setRef=function(h){o._listRef=h},r),he(o,d)}return Ws(t,[{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,o){var d=this.props,l=d.isItemLoaded,p=d.itemCount,c=d.minimumBatchSize,h=c===void 0?10:c,v=d.threshold,g=v===void 0?15:v,y=Ps({isItemLoaded:l,itemCount:p,minimumBatchSize:h,startIndex:Math.max(0,r-g),stopIndex:Math.min(p-1,o+g)});(this._memoizedUnloadedRanges.length!==y.length||this._memoizedUnloadedRanges.some(function(T,A){return y[A]!==T}))&&(this._memoizedUnloadedRanges=y,this._loadUnloadedRanges(y))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,d=this.props.loadMoreItems||this.props.loadMoreRows,l=function(h){var v=r[h],g=r[h+1],y=d(v,g);y!=null&&y.then(function(){if(qs({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(v,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},p=0;p<r.length;p+=2)l(p)}}]),t}(x.PureComponent);const Bs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Gs=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Zs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Js=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ks=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Xs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),en=()=>n.o1,tn=n.styled_default(en())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),sn=({rank:e,avatar:t,name:i,points:r,isCurrentUser:o,openItemDetail:d,style:l})=>s.jsxs(Bs,{onClick:d,style:l,children:[s.jsx(Hs,{children:e||0}),s.jsxs(Js,{children:[t?s.jsx(Gs,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Zs,{children:xe(i||"")}),s.jsxs(Ks,{children:[s.jsx(Xs,{children:i||""}),o&&s.jsx(tn,{name:"icon-star"})]})]}),s.jsx("div",{children:ge(r)})]}),nn=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),rn=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:o,height:d})=>s.jsx(Fs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:p})=>s.jsx(nn,{children:s.jsx(Us,{itemSize:56,onItemsRendered:l,ref:p,itemCount:e.length,width:o,height:d,children:({index:c,style:h})=>s.jsx(sn,{style:{...h,maxHeight:48},...e[c],openItemDetail:()=>i(e[c].userId),isCurrentUser:!!t&&t===e[c].userId},e[c].userId)})})})}),on=({deepLink:e})=>{const{data:t}=n.useStore(e.$store),i=t==null?void 0:t.url,r=e.desktopLink;return s.jsx(n.O,{inviteLink:i||r,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s more fun with friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},an=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(rn,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(on,{deepLink:e.deepLink})},ln=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),dn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),cn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),un=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),pn=()=>n.o1,Q=n.styled_default(pn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),mn=()=>n.o1,fn=n.styled_default(mn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),hn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),In=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),yn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),xn={[n.PickHistoryStatus.LOST]:s.jsx(Q,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(Q,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(Q,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(Q,{name:"icon-arrow"})},gn=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:o,openQuestion:d,status:l})=>{const p=n.o[t],c=xn[l];return p?s.jsxs(ln,{onClick:()=>d==null?void 0:d(e),children:[s.jsxs(In,{children:[s.jsxs(dn,{children:[s.jsx(fn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:p.iconName}),s.jsxs(hn,{children:[p.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(cn,{children:r||""})]}),s.jsx(un,{children:o?s.jsx(yn,{children:"Play"}):c})]}):null},jn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),vn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Mn=({openInsight:e,questionId:t,...i})=>s.jsxs(jn,{children:[s.jsx(Ae,{questionId:t,...i,isPickHistory:!0}),e&&s.jsx(vn,{onClick:()=>e(t),children:"View Insight"})]}),Tn=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),An=()=>n.c,Nn=n.styled_default(An())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Sn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Dn=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),zn=({openTweet:e,created:t,...i})=>{const r=x.useMemo(()=>{if(t){const o=new Date(t);if(J(o))return{date:G(o),time:Z(o)}}return null},[t]);return s.jsxs(Tn,{children:[r&&s.jsxs(Sn,{children:[r.date," · ",r.time]}),i.title&&s.jsx(Dn,{children:i.title}),s.jsx(n.u,{...i}),e&&s.jsx(Nn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},kn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),On=({questions:e,openQuestion:t})=>s.jsx(kn,{children:e==null?void 0:e.map(i=>{var r,o,d;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const l=i.attributes.attributes.value;return s.jsx(gn,{openQuestion:t,...l},l.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const l=i.attributes.attributes.value;return s.jsx(Mn,{openInsight:t,...l},l.questionId)}if(i.type==="tweet"&&((d=i.attributes)==null?void 0:d.attributes.case)==="tweet"){const l=i.attributes.attributes.value,p=i.attributes.id,c=i.attributes.created;return s.jsx(zn,{openTweet:t,...l,tweetId:p,created:c},p)}return null})}),bn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(On,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},wn=({userSummary:e})=>{var t;const[i,r]=x.useState(void 0);return x.useEffect(()=>{const o=e.subscribe(d=>{d!=null&&d.data&&r(d.data)});return()=>{o()}},[e]),i!=null&&i.summary?s.jsx(je,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):s.jsx("div",{children:"wait user..."})},Cn=({gamification:e})=>{const[t,i]=x.useState(U.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Os,{activePage:t,toggleActivePage:i})}),t===U.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(wn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(bn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===U.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(an,{gamification:e})})]})},_n=()=>n.f,Ie=n.styled_default(_n())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),En=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Ln=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},$n=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(Ie,{className:t,children:s.jsx(Ns,{gamification:e})}),r&&s.jsx(Ie,{className:t,children:s.jsxs(En,{children:[s.jsx(ye,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(je,{...r,successRate:Ln(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(Cn,{gamification:e})})]})};exports.default=$n;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),x=require("react"),ke=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),Oe=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),we=()=>n.o1,be=n.styled_default(we())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),Ce=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),_e=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Ee=()=>n.o1,Le=n.styled_default(Ee())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ge=({type:e,close:t,label:i})=>{const r=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(ke,{children:[s.jsxs(Oe,{children:[(r==null?void 0:r.iconName)&&s.jsx(be,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:r.iconName}),(r==null?void 0:r.label)&&s.jsx(Ce,{children:r.label})]}),s.jsx(_e,{onClick:t,children:s.jsx(Le,{name:"icon-cross"})})]})},je=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),ve=e=>e?e.toLocaleString("en-US"):"0",K=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),X=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),ee=e=>!isNaN(e.getTime()),$e=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Re=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),ie=({indicator:e,title:t})=>s.jsxs($e,{children:[s.jsx(Re,{children:t}),s.jsx(Qe,{children:e})]}),Ue=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),qe=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Pe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),U=({indicator:e,title:t})=>s.jsxs(Ue,{children:[s.jsx(qe,{children:e}),s.jsx(Pe,{children:t})]}),Ye=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),We=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),Fe=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Ve=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Be=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),He=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Ge=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),Ze=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Je=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),Ke=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Xe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),et=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),tt=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),st=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),nt=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),it=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),rt=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),ot="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",Me=({avatar:e,name:t,points:i,friendsRank:r,rank:o,streak:c,correct:l,incorrect:u,inTop:d,successRate:f})=>s.jsxs(Ye,{children:[s.jsx(We,{children:s.jsxs(Ve,{children:[s.jsxs(rt,{children:[e&&s.jsx(Be,{alt:"avatar",src:e}),!e&&s.jsx(it,{children:je(t||"")})]}),s.jsxs(He,{children:[s.jsx(Ge,{children:t}),s.jsxs(Ze,{children:[s.jsxs(Ke,{children:[s.jsx(Je,{alt:"rank-icon",src:ot}),s.jsxs(Xe,{children:[ve(i),s.jsx(et,{children:"PTS"})]})]}),s.jsx(tt,{}),s.jsxs("div",{children:["TOP ",d||0,"%"]})]})]})]})}),s.jsxs(Fe,{children:[s.jsxs(st,{children:[s.jsx(ie,{indicator:r||0,title:"Friends rank"}),s.jsx(ie,{indicator:o||0,title:"Global rank"})]}),s.jsxs(nt,{children:[s.jsx(U,{indicator:c||0,title:"Win streak"}),s.jsx(U,{indicator:l||0,title:"Correct"}),s.jsx(U,{indicator:u||0,title:"Incorrect"}),s.jsx(U,{indicator:`${f||0}%`,title:"Succ. rate"})]})]})]}),at=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),lt=()=>n.o1,ct=n.styled_default(lt())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),dt=()=>s.jsx(at,{children:s.jsx(ct,{name:"mastersLogo"})}),ut=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),pt=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),mt=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),ht=({title:e,description:t})=>s.jsxs(ut,{children:[s.jsx(n.o1,{name:"icon-check-circle"}),s.jsx(pt,{children:e}),s.jsx(mt,{children:t})]}),ft=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),It=()=>n.o1,yt=n.styled_default(It())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),$=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),q=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),xt=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),_=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),B=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),gt=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:r,hasCorrectAnswer:o,questionStatus:c,showExpiredNotification:l,showClosedNotificationTrivia:u,votedInCurrentRender:d,votedAfterQuestionClosed:f,enteredAnActiveQuestion:v})=>{const g=i&&(r===n.QuestionType.TRIVIA||r===n.QuestionType.PREDICTION)&&d&&c!==n.QuestionStatus.RESOLVED,I=r===n.QuestionType.PREDICTION&&!o,T=c===n.QuestionStatus.RESOLVED&&r===n.QuestionType.PREDICTION&&!i&&!v||r===n.QuestionType.PREDICTION&&f&&d&&v,M=g&&I,a=g&&o,p=i&&r===n.QuestionType.POLL&&d;if(!l&&!u&&!M&&!a&&!T&&!p)return null;const m=t?"correct":"incorrect",h=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return s.jsxs(ft,{"data-isPrediction":I,children:[l&&s.jsxs(s.Fragment,{children:[s.jsx($,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(q,{children:s.jsx(_,{children:"Question Expired"})}),s.jsx(B,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),u&&s.jsxs(s.Fragment,{children:[s.jsx($,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(q,{children:s.jsx(_,{children:"Question Closed"})}),s.jsx(B,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),T&&s.jsxs(s.Fragment,{children:[s.jsx($,{children:s.jsx(n.o1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(q,{children:s.jsx(_,{children:"Question Closed"})}),s.jsx(B,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),M&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{name:"icon-prediction"}),s.jsx(_,{children:"Stay tuned to see if your prediction was correct."})]}),p&&s.jsxs(s.Fragment,{children:[s.jsx($,{"data-feedbackType":"correct",children:s.jsx(n.o1,{name:"correct"})}),s.jsx(_,{children:"That's for answering. Please stay tuned for the next question."})]}),a&&s.jsxs(s.Fragment,{children:[s.jsx($,{"data-feedbackType":m,children:s.jsx(n.o1,{name:m})}),s.jsx("div",{children:s.jsxs(q,{children:[s.jsx(xt,{"data-feedbackType":m,children:h==null?void 0:h.title}),s.jsx(_,{children:h==null?void 0:h.description})]})})]})]})},jt=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),vt=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),Mt=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),Tt=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),At=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),Nt=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),St=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Dt=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),zt=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),Te=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),kt=()=>Te,Ot=n.styled_default(kt())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),wt=()=>Te,bt=n.styled_default(wt())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),Ct=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),_t=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Et=n.styled_default("span")({name:"Percentage",class:"p17ajcu2",propsAsIs:!1}),Lt=()=>n.o1,$t=n.styled_default(Lt())({name:"CheckIcon",class:"cu9kmlb",propsAsIs:!0}),re={[n.QuestionImages.CENTERED]:e=>s.jsx(Ot,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Dt,{children:s.jsx(zt,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(bt,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Rt=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:r,questionVoted:o})=>{if(e===n.QuestionType.POLL&&r)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&o)return r?i?"correct":"incorrect":"unset";if(r)return"correct"}return e===n.QuestionType.TRIVIA&&o&&r?i?"correct":"incorrect":"unset"},Qt=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:r,questionStatus:o})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&r||o===n.QuestionStatus.RESOLVED&&i:!1,Ut=e=>{var t;const{id:i,icon:r,text:o,percentageDecimal:c,onVote:l,markThatVoted:u,youSelected:d,questionVoted:f,imageMode:v,answerTimeExpired:g,questionStatus:I,isLoading:T,questionType:M,correct:a,hasCorrectAnswer:p,votedAfterQuestionClosed:m,enteredAnActiveQuestion:h}=e,y=Rt(e),A=Qt({questionType:M,questionVoted:f,correct:a,hasCorrectAnswer:p,questionStatus:I}),j=I===n.QuestionStatus.RESOLVED&&M===n.QuestionType.PREDICTION,N=f||j;return s.jsxs(At,{value:i,"data-selected":d,"data-answerState":y,disabled:f||T||g||j&&!h||j&&h&&m,"data-isNotChecked":f&&!d&&y!=="incorrect",onClick:S=>{u(I===n.QuestionStatus.RESOLVED),l(S)},children:[s.jsx(Nt,{"data-answerState":y,style:{width:`${N?c:0}%`}}),s.jsxs(St,{children:[r&&v&&((t=re[v])==null?void 0:t.call(re,r)),s.jsx(Ct,{children:o}),N&&s.jsxs(_t,{children:[A&&s.jsx($t,{name:"selected"}),s.jsx(Et,{children:s.jsx(n.d,{value:c,suffix:"%"})})]})]})]})};var oe=typeof window>"u"?x.useEffect:x.useLayoutEffect,qt=({isPlaying:e,duration:t,startAt:i=0,updateInterval:r=0,onComplete:o,onUpdate:c})=>{let[l,u]=x.useState(i),d=x.useRef(0),f=x.useRef(i),v=x.useRef(i*-1e3),g=x.useRef(null),I=x.useRef(null),T=x.useRef(null),M=m=>{let h=m/1e3;if(I.current===null){I.current=h,g.current=requestAnimationFrame(M);return}let y=h-I.current,A=d.current+y;I.current=h,d.current=A;let j=f.current+(r===0?A:(A/r|0)*r),N=f.current+A,S=typeof t=="number"&&N>=t;u(S?t:j),S||(g.current=requestAnimationFrame(M))},a=()=>{g.current&&cancelAnimationFrame(g.current),T.current&&clearTimeout(T.current),I.current=null},p=x.useCallback(m=>{a(),d.current=0;let h=typeof m=="number"?m:i;f.current=h,u(h),e&&(g.current=requestAnimationFrame(M))},[e,i]);return oe(()=>{if(c==null||c(l),t&&l>=t){v.current+=t*1e3;let{shouldRepeat:m=!1,delay:h=0,newStartAt:y}=(o==null?void 0:o(v.current/1e3))||{};m&&(T.current=setTimeout(()=>p(y),h*1e3))}},[l,t]),oe(()=>(e&&(g.current=requestAnimationFrame(M)),a),[e,t,r]),{elapsedTime:l,reset:p}},Pt=(e,t,i)=>{let r=e/2,o=t/2,c=r-o,l=2*c,u=i==="clockwise"?"1,0":"0,1",d=2*Math.PI*c;return{path:`m ${r},${o} a ${c},${c} 0 ${u} 0,${l} a ${c},${c} 0 ${u} 0,-${l}`,pathLength:d}},ae=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,Yt=e=>({position:"relative",width:e,height:e}),Wt={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},Ae=(e,t,i,r,o)=>{if(r===0)return t;let c=(o?r-e:e)/r;return t+i*c},le=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(r,o,c,l)=>`#${o}${o}${c}${c}${l}${l}`).substring(1).match(/.{2}/g))==null?void 0:t.map(r=>parseInt(r,16)))!=null?i:[]},Ft=(e,t)=>{var i;let{colors:r,colorsTime:o,isSmoothColorTransition:c=!0}=e;if(typeof r=="string")return r;let l=(i=o==null?void 0:o.findIndex((I,T)=>I>=t&&t>=o[T+1]))!=null?i:-1;if(!o||l===-1)return r[0];if(!c)return r[l];let u=o[l]-t,d=o[l]-o[l+1],f=le(r[l]),v=le(r[l+1]),g=!!e.isGrowing;return`rgb(${f.map((I,T)=>Ae(u,I,v[T]-I,d,g)|0).join(",")})`},Vt=e=>{let{duration:t,initialRemainingTime:i,updateInterval:r,size:o=180,strokeWidth:c=12,trailStrokeWidth:l,isPlaying:u=!1,isGrowing:d=!1,rotation:f="clockwise",onComplete:v,onUpdate:g}=e,I=x.useRef(),T=Math.max(c,l??0),{path:M,pathLength:a}=Pt(o,T,f),{elapsedTime:p}=qt({isPlaying:u,duration:t,startAt:ae(t,i),updateInterval:r,onUpdate:typeof g=="function"?h=>{let y=Math.ceil(t-h);y!==I.current&&(I.current=y,g(y))}:void 0,onComplete:typeof v=="function"?h=>{var y;let{shouldRepeat:A,delay:j,newInitialRemainingTime:N}=(y=v(h))!=null?y:{};if(A)return{shouldRepeat:A,delay:j,newStartAt:ae(t,N)}}:void 0}),m=t-p;return{elapsedTime:p,path:M,pathLength:a,remainingTime:Math.ceil(m),rotation:f,size:o,stroke:Ft(e,m),strokeDashoffset:Ae(p,0,a,t,d),strokeWidth:c}},Ne=e=>{let{children:t,strokeLinecap:i,trailColor:r,trailStrokeWidth:o}=e,{path:c,pathLength:l,stroke:u,strokeDashoffset:d,remainingTime:f,elapsedTime:v,size:g,strokeWidth:I}=Vt(e);return x.createElement("div",{style:Yt(g)},x.createElement("svg",{viewBox:`0 0 ${g} ${g}`,width:g,height:g,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:c,fill:"none",stroke:r??"#d9d9d9",strokeWidth:o??I}),x.createElement("path",{d:c,fill:"none",stroke:u,strokeLinecap:i??"round",strokeWidth:I,strokeDasharray:l,strokeDashoffset:d})),typeof t=="function"&&x.createElement("div",{style:Wt},t({remainingTime:f,elapsedTime:v,color:u})))};Ne.displayName="CountdownCircleTimer";const Bt=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ht=[10,10,1,0],Gt=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Zt=n.E.SECONDARY_GREEN6,ce=n.E.SECONDARY_RED3,Jt=n.E.NEUTRALS_GRAY3,Kt=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[r,o]=x.useState(t>10?Zt:ce),c=({remainingTime:d})=>s.jsx(Gt,{children:d}),l=x.useCallback(()=>{i==null||i(),o(Jt)},[i,o]),u=x.useCallback(d=>{d===10&&o(ce)},[o]);return s.jsx(Ne,{isPlaying:e,duration:t,colors:Bt,colorsTime:Ht,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:r,onComplete:l,onUpdate:u,children:c})},Xt=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),es=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),ts=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),ss=()=>n.o1,ns=n.styled_default(ss())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),is=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),rs=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),os=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),as=({title:e,points:t,isPlayingTimer:i,isTimer:r,questionType:o,timerDuration:c,onTimerExpired:l})=>s.jsxs(Xt,{children:[s.jsxs(es,{children:[e&&s.jsx(ts,{children:e}),t!==void 0&&o!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(ns,{name:"icon-trophy"}),s.jsxs(is,{children:[s.jsx(rs,{children:s.jsx(n.d,{value:t})}),s.jsx(os,{children:"PTS"})]})]})]}),r&&s.jsx(Kt,{isPlaying:i,onTimerExpired:l,duration:c})]}),ls=({openedQuestion:e,isLoading:t,vote:i,close:r})=>{var o,c;const l=e.subject,u=e.type,d=e.status,f=(o=e.options)==null?void 0:o.options,[v,g]=x.useState(!1),[I,T]=x.useState(!1),[M,a]=x.useState(!0),[p,m]=x.useState(!1),[h,y]=x.useState(""),A=e==null?void 0:e.id;x.useEffect(()=>{d===n.QuestionStatus.RESOLVED&&a(!1)},[]);const j=x.useCallback(z=>{T(z),g(!0)},[]),N=x.useCallback(async z=>{if(A){const b=z.currentTarget.value;y(b),await i(A,b)}},[A,y,i]),S=x.useCallback(()=>{m(!0),setTimeout(r,3e3)},[r]),D=x.useMemo(()=>e==null?void 0:e.answers.find(z=>z.youVoted===!0),[e]),k=x.useMemo(()=>!!(e!=null&&e.answers.find(z=>z.correct===!0)),[e]),O=x.useMemo(()=>e==null?void 0:e.answers.find(z=>z.correct===!0),[e]),C=x.useMemo(()=>e?e.answers.map(z=>{var b;return{...z,questionVoted:!!D,youSelected:h===z.id,isLoading:t,hasCorrectAnswer:k,questionType:e.type,answerTimeExpired:p,questionStatus:d,imageMode:(b=e.appearance)==null?void 0:b.images,onVote:N}}):[],[k,p,t,e,D,d,N,h]),W=f&&(f.case==="trivia"||f.case==="prediction")?f.value:void 0,w=d===n.QuestionStatus.RESOLVED&&u===n.QuestionType.TRIVIA&&!D&&!M,R=u===n.QuestionType.TRIVIA&&I&&v&&M,F=x.useMemo(()=>{if(!(w||p))return d===n.QuestionStatus.RESOLVED?0:D?D.correct?D.points:0:O==null?void 0:O.points},[p,D,O,d,w]),V=x.useMemo(()=>w||p?"Time expired":e.type===n.QuestionType.POLL?"Time remaining":D?"You won":"To win",[p,e.type,D,w]),Q=D||w||R||u===n.QuestionType.TRIVIA&&d===n.QuestionStatus.RESOLVED&&M;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(jt,{children:s.jsxs(vt,{children:[s.jsx(gt,{feedbackMessages:W,questionVoted:!!D,questionVotedCorrectly:D==null?void 0:D.correct,questionType:u,hasCorrectAnswer:k,questionStatus:d,showExpiredNotification:w,showClosedNotificationTrivia:R,votedInCurrentRender:v,votedAfterQuestionClosed:I,enteredAnActiveQuestion:M}),e.type!==n.QuestionType.PREDICTION&&s.jsx(as,{title:V,points:F,onTimerExpired:S,questionType:e.type,isTimer:!t,isPlayingTimer:!D,timerDuration:Q?0:Number(((c=e==null?void 0:e.appearance)==null?void 0:c.autoHideInterval)||"30")}),p?s.jsx(ht,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(Mt,{"data-isPrediction":e.type===n.QuestionType.PREDICTION,children:l}),s.jsx(Tt,{children:C.map(z=>s.jsx(Ut,{...z,markThatVoted:j,votedAfterQuestionClosed:I,enteredAnActiveQuestion:M},z.id))})]})]})})})},cs=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),ds=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),us=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),ps=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),ms=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),hs=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),Se=({created:e,image:t,title:i,isPickHistory:r,instantView:o})=>{const c=x.useMemo(()=>{if(e){const u=new Date(e);if(ee(u))return{date:K(u),time:X(u)}}return null},[e]),l=(o==null?void 0:o.image)||t;return s.jsxs(cs,{children:[c&&s.jsxs(ms,{children:[c.date," · ",c.time]}),(o==null?void 0:o.video)&&s.jsx(n.w,{source:o.video.url,poster:o.video.thumbnailUrl}),l&&!(o!=null&&o.video)&&s.jsx(hs,{src:l}),s.jsxs(ds,{children:[s.jsx(us,{children:r?i:o==null?void 0:o.heading}),!r&&s.jsx(ps,{children:o==null?void 0:o.body})]})]})},fs=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),Is=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ys=({instantView:e,...t})=>s.jsxs(fs,{children:[s.jsx(Se,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(Is,{href:e==null?void 0:e.webLink.url,target:"_blank",children:["Explore more of the Masters History",s.jsx(n.o1,{name:"icon-external-link"})]})]}),xs=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),gs=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),js=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),vs=({created:e,...t})=>{const i=x.useMemo(()=>{if(e){const r=new Date(e);if(ee(r))return{date:K(r),time:X(r)}}return null},[e]);return s.jsxs(xs,{children:[i&&s.jsxs(gs,{children:[i.date," · ",i.time]}),t.title&&s.jsx(js,{children:t.title}),s.jsx(n.u,{...t})]})},Ms=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),Ts=({openedQuestion:e})=>{var t,i;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ys,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?s.jsx(vs,{created:e.attributes.created,...e.attributes.attributes.value}):null},As=({extendedQuestion:e,vote:t,close:i})=>{const{loading:r,data:o}=e;return o?s.jsx(ls,{vote:t,close:i,openedQuestion:o,isLoading:!!r}):null},Ns=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const o=i.type;return s.jsxs(Ms,{children:[s.jsx(ge,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),o==="question"&&s.jsx(As,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:r}),o!=="question"&&s.jsx(Ts,{openedQuestion:i}),s.jsx(dt,{sponsorLogo:""})]})},Ss=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Ds=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),zs=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),ks=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var Y=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(Y||{});const de=({title:e,active:t,onClick:i})=>s.jsx(zs,{onClick:i,"data-selected":t,children:s.jsx(ks,{children:e})}),Os=({activePage:e="home",toggleActivePage:t})=>s.jsx(Ss,{children:s.jsxs(Ds,{"data-position":e==="home"?"left":"right",children:[s.jsx(de,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(de,{title:"Friends",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})});function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},Z.apply(this,arguments)}function ue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function J(e,t){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},J(e,t)}function ws(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,J(e,t)}var pe=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function bs(e,t){return!!(e===t||pe(e)&&pe(t))}function Cs(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!bs(e[i],t[i]))return!1;return!0}function H(e,t){t===void 0&&(t=Cs);var i,r=[],o,c=!1;function l(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return c&&i===this&&t(u,r)||(o=e.apply(this,u),c=!0,i=this,r=u),o}return l}var _s=typeof performance=="object"&&typeof performance.now=="function",me=_s?function(){return performance.now()}:function(){return Date.now()};function he(e){cancelAnimationFrame(e.id)}function Es(e,t){var i=me();function r(){me()-i>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var G=-1;function fe(e){if(e===void 0&&(e=!1),G===-1||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",document.body.appendChild(t),G=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return G}var E=null;function Ie(e){if(e===void 0&&(e=!1),E===null||e){var t=document.createElement("div"),i=t.style;i.width="50px",i.height="50px",i.overflow="scroll",i.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?E="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?E="negative":E="positive-ascending"),document.body.removeChild(t),E}return E}var Ls=150,$s=function(t,i){return t};function Rs(e){var t,i=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,c=e.getOffsetForIndexAndAlignment,l=e.getStartIndexForOffset,u=e.getStopIndexForStartIndex,d=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(g){ws(I,g);function I(M){var a;return a=g.call(this,M)||this,a._instanceProps=d(a.props,ue(a)),a._outerRef=void 0,a._resetIsScrollingTimeoutId=null,a.state={instance:ue(a),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof a.props.initialScrollOffset=="number"?a.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},a._callOnItemsRendered=void 0,a._callOnItemsRendered=H(function(p,m,h,y){return a.props.onItemsRendered({overscanStartIndex:p,overscanStopIndex:m,visibleStartIndex:h,visibleStopIndex:y})}),a._callOnScroll=void 0,a._callOnScroll=H(function(p,m,h){return a.props.onScroll({scrollDirection:p,scrollOffset:m,scrollUpdateWasRequested:h})}),a._getItemStyle=void 0,a._getItemStyle=function(p){var m=a.props,h=m.direction,y=m.itemSize,A=m.layout,j=a._getItemStyleCache(f&&y,f&&A,f&&h),N;if(j.hasOwnProperty(p))N=j[p];else{var S=i(a.props,p,a._instanceProps),D=o(a.props,p,a._instanceProps),k=h==="horizontal"||A==="horizontal",O=h==="rtl",C=k?S:0;j[p]=N={position:"absolute",left:O?void 0:C,right:O?C:void 0,top:k?0:S,height:k?"100%":D,width:k?D:"100%"}}return N},a._getItemStyleCache=void 0,a._getItemStyleCache=H(function(p,m,h){return{}}),a._onScrollHorizontal=function(p){var m=p.currentTarget,h=m.clientWidth,y=m.scrollLeft,A=m.scrollWidth;a.setState(function(j){if(j.scrollOffset===y)return null;var N=a.props.direction,S=y;if(N==="rtl")switch(Ie()){case"negative":S=-y;break;case"positive-descending":S=A-h-y;break}return S=Math.max(0,Math.min(S,A-h)),{isScrolling:!0,scrollDirection:j.scrollOffset<y?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._onScrollVertical=function(p){var m=p.currentTarget,h=m.clientHeight,y=m.scrollHeight,A=m.scrollTop;a.setState(function(j){if(j.scrollOffset===A)return null;var N=Math.max(0,Math.min(A,y-h));return{isScrolling:!0,scrollDirection:j.scrollOffset<N?"forward":"backward",scrollOffset:N,scrollUpdateWasRequested:!1}},a._resetIsScrollingDebounced)},a._outerRefSetter=function(p){var m=a.props.outerRef;a._outerRef=p,typeof m=="function"?m(p):m!=null&&typeof m=="object"&&m.hasOwnProperty("current")&&(m.current=p)},a._resetIsScrollingDebounced=function(){a._resetIsScrollingTimeoutId!==null&&he(a._resetIsScrollingTimeoutId),a._resetIsScrollingTimeoutId=Es(a._resetIsScrolling,Ls)},a._resetIsScrolling=function(){a._resetIsScrollingTimeoutId=null,a.setState({isScrolling:!1},function(){a._getItemStyleCache(-1,null)})},a}I.getDerivedStateFromProps=function(a,p){return Qs(a,p),v(a),null};var T=I.prototype;return T.scrollTo=function(a){a=Math.max(0,a),this.setState(function(p){return p.scrollOffset===a?null:{scrollDirection:p.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},T.scrollToItem=function(a,p){p===void 0&&(p="auto");var m=this.props,h=m.itemCount,y=m.layout,A=this.state.scrollOffset;a=Math.max(0,Math.min(a,h-1));var j=0;if(this._outerRef){var N=this._outerRef;y==="vertical"?j=N.scrollWidth>N.clientWidth?fe():0:j=N.scrollHeight>N.clientHeight?fe():0}this.scrollTo(c(this.props,a,p,A,this._instanceProps,j))},T.componentDidMount=function(){var a=this.props,p=a.direction,m=a.initialScrollOffset,h=a.layout;if(typeof m=="number"&&this._outerRef!=null){var y=this._outerRef;p==="horizontal"||h==="horizontal"?y.scrollLeft=m:y.scrollTop=m}this._callPropsCallbacks()},T.componentDidUpdate=function(){var a=this.props,p=a.direction,m=a.layout,h=this.state,y=h.scrollOffset,A=h.scrollUpdateWasRequested;if(A&&this._outerRef!=null){var j=this._outerRef;if(p==="horizontal"||m==="horizontal")if(p==="rtl")switch(Ie()){case"negative":j.scrollLeft=-y;break;case"positive-ascending":j.scrollLeft=y;break;default:var N=j.clientWidth,S=j.scrollWidth;j.scrollLeft=S-N-y;break}else j.scrollLeft=y;else j.scrollTop=y}this._callPropsCallbacks()},T.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&he(this._resetIsScrollingTimeoutId)},T.render=function(){var a=this.props,p=a.children,m=a.className,h=a.direction,y=a.height,A=a.innerRef,j=a.innerElementType,N=a.innerTagName,S=a.itemCount,D=a.itemData,k=a.itemKey,O=k===void 0?$s:k,C=a.layout,W=a.outerElementType,w=a.outerTagName,R=a.style,F=a.useIsScrolling,V=a.width,Q=this.state.isScrolling,z=h==="horizontal"||C==="horizontal",b=z?this._onScrollHorizontal:this._onScrollVertical,te=this._getRangeToRender(),De=te[0],ze=te[1],se=[];if(S>0)for(var L=De;L<=ze;L++)se.push(x.createElement(p,{data:D,key:O(L,D),index:L,isScrolling:F?Q:void 0,style:this._getItemStyle(L)}));var ne=r(this.props,this._instanceProps);return x.createElement(W||w||"div",{className:m,onScroll:b,ref:this._outerRefSetter,style:Z({position:"relative",height:y,width:V,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:h},R)},x.createElement(j||N||"div",{children:se,ref:A,style:{height:z?"100%":ne,pointerEvents:Q?"none":void 0,width:z?ne:"100%"}}))},T._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var a=this.props.itemCount;if(a>0){var p=this._getRangeToRender(),m=p[0],h=p[1],y=p[2],A=p[3];this._callOnItemsRendered(m,h,y,A)}}if(typeof this.props.onScroll=="function"){var j=this.state,N=j.scrollDirection,S=j.scrollOffset,D=j.scrollUpdateWasRequested;this._callOnScroll(N,S,D)}},T._getRangeToRender=function(){var a=this.props,p=a.itemCount,m=a.overscanCount,h=this.state,y=h.isScrolling,A=h.scrollDirection,j=h.scrollOffset;if(p===0)return[0,0,0,0];var N=l(this.props,j,this._instanceProps),S=u(this.props,N,j,this._instanceProps),D=!y||A==="backward"?Math.max(1,m):1,k=!y||A==="forward"?Math.max(1,m):1;return[Math.max(0,N-D),Math.max(0,Math.min(p-1,S+k)),N,S]},I}(x.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var Qs=function(t,i){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,i.instance},Us=Rs({getItemOffset:function(t,i){var r=t.itemSize;return i*r},getItemSize:function(t,i){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var i=t.itemCount,r=t.itemSize;return r*i},getOffsetForIndexAndAlignment:function(t,i,r,o,c,l){var u=t.direction,d=t.height,f=t.itemCount,v=t.itemSize,g=t.layout,I=t.width,T=u==="horizontal"||g==="horizontal",M=T?I:d,a=Math.max(0,f*v-M),p=Math.min(a,i*v),m=Math.max(0,i*v-M+v+l);switch(r==="smart"&&(o>=m-M&&o<=p+M?r="auto":r="center"),r){case"start":return p;case"end":return m;case"center":{var h=Math.round(m+(p-m)/2);return h<Math.ceil(M/2)?0:h>a+Math.floor(M/2)?a:h}case"auto":default:return o>=m&&o<=p?o:o<m?m:p}},getStartIndexForOffset:function(t,i){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(i/o)))},getStopIndexForStartIndex:function(t,i,r){var o=t.direction,c=t.height,l=t.itemCount,u=t.itemSize,d=t.layout,f=t.width,v=o==="horizontal"||d==="horizontal",g=i*u,I=v?f:c,T=Math.ceil((I+r-g)/u);return Math.max(0,Math.min(l-1,i+T-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){t.itemSize}});function qs(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,r=e.startIndex,o=e.stopIndex;return!(r>i||o<t)}function Ps(e){for(var t=e.isItemLoaded,i=e.itemCount,r=e.minimumBatchSize,o=e.startIndex,c=e.stopIndex,l=[],u=null,d=null,f=o;f<=c;f++){var v=t(f);v?d!==null&&(l.push(u,d),u=d=null):(d=f,u===null&&(u=f))}if(d!==null){for(var g=Math.min(Math.max(d,u+r-1),i-1),I=d+1;I<=g&&!t(I);I++)d=I;l.push(u,d)}if(l.length)for(;l[1]-l[0]+1<r&&l[0]>0;){var T=l[0]-1;if(!t(T))l[0]=T;else break}return l}var Ys=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Ws=function(){function e(t,i){for(var r=0;r<i.length;r++){var o=i[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),Fs=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},ye=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},Vs=function(e){Fs(t,e);function t(){var i,r,o,c;Ys(this,t);for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];return c=(r=(o=ye(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(u))),o),o._lastRenderedStartIndex=-1,o._lastRenderedStopIndex=-1,o._memoizedUnloadedRanges=[],o._onItemsRendered=function(f){var v=f.visibleStartIndex,g=f.visibleStopIndex;o._lastRenderedStartIndex=v,o._lastRenderedStopIndex=g,o._ensureRowsLoaded(v,g)},o._setRef=function(f){o._listRef=f},r),ye(o,c)}return Ws(t,[{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,o){var c=this.props,l=c.isItemLoaded,u=c.itemCount,d=c.minimumBatchSize,f=d===void 0?10:d,v=c.threshold,g=v===void 0?15:v,I=Ps({isItemLoaded:l,itemCount:u,minimumBatchSize:f,startIndex:Math.max(0,r-g),stopIndex:Math.min(u-1,o+g)});(this._memoizedUnloadedRanges.length!==I.length||this._memoizedUnloadedRanges.some(function(T,M){return I[M]!==T}))&&(this._memoizedUnloadedRanges=I,this._loadUnloadedRanges(I))}},{key:"_loadUnloadedRanges",value:function(r){for(var o=this,c=this.props.loadMoreItems||this.props.loadMoreRows,l=function(f){var v=r[f],g=r[f+1],I=c(v,g);I!=null&&I.then(function(){if(qs({lastRenderedStartIndex:o._lastRenderedStartIndex,lastRenderedStopIndex:o._lastRenderedStopIndex,startIndex:v,stopIndex:g})){if(o._listRef==null)return;typeof o._listRef.resetAfterIndex=="function"?o._listRef.resetAfterIndex(v,!0):(typeof o._listRef._getItemStyleCache=="function"&&o._listRef._getItemStyleCache(-1),o._listRef.forceUpdate())}})},u=0;u<r.length;u+=2)l(u)}}]),t}(x.PureComponent);const Bs=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Gs=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Zs=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),Js=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Ks=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Xs=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),en=()=>n.o1,tn=n.styled_default(en())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0}),sn=({rank:e,avatar:t,name:i,points:r,isCurrentUser:o,openItemDetail:c,style:l})=>s.jsxs(Bs,{onClick:c,style:l,children:[s.jsx(Hs,{children:e||0}),s.jsxs(Js,{children:[t?s.jsx(Gs,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Zs,{children:je(i||"")}),s.jsxs(Ks,{children:[s.jsx(Xs,{children:i||""}),o&&s.jsx(tn,{name:"icon-star"})]})]}),s.jsx("div",{children:ve(r)})]}),nn=n.styled_default("div")({name:"ScrollContainer",class:"s13d8sg6",propsAsIs:!1}),rn=({items:e,currentUserId:t,openItemDetail:i,fetchMore:r})=>s.jsx(n.AutoSizer,{children:({width:o,height:c})=>s.jsx(Vs,{isItemLoaded:l=>l<e.length,itemCount:e.length+1,loadMoreItems:r,children:({onItemsRendered:l,ref:u})=>s.jsx(nn,{children:s.jsx(Us,{itemSize:56,onItemsRendered:l,ref:u,itemCount:e.length,width:o,height:c,children:({index:d,style:f})=>s.jsx(sn,{style:{...f,maxHeight:48},...e[d],openItemDetail:()=>i(e[d].userId),isCurrentUser:!!t&&t===e[d].userId},e[d].userId)})})})}),on=({deepLink:e})=>{const{data:t}=n.useStore(e.$store),i=t==null?void 0:t.url,r=e.desktopLink;return s.jsx(n.O,{inviteLink:i||r,socialLinks:[{icon:"icon-facebook",link:"https://www.facebook.com/TheMasters",label:"Facebook"},{icon:"icon-twitter",link:"https://twitter.com/@TheMasters",label:"X"}],inviteCardTitle:"It’s More Fun With Friends",inviteCardSubtext:"Invite and compete against your friends for the top spot on the leaderboard."})},an=({gamification:e})=>{const{data:t}=n.useStore(e.leaderboardList.$store);return t!=null&&t.length?s.jsx(rn,{fetchMore:e.leaderboardList.fetchMore,items:t,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}):s.jsx(on,{deepLink:e.deepLink})},ln=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),cn=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),dn=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),un=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),pn=()=>n.o1,P=n.styled_default(pn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),mn=()=>n.o1,hn=n.styled_default(mn())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),fn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),In=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),yn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),xn={[n.PickHistoryStatus.LOST]:s.jsx(P,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(P,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(P,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(P,{name:"icon-arrow"})},gn=({questionId:e,questionType:t,questionStatus:i,subject:r,openForVoting:o,openQuestion:c,status:l})=>{const u=n.o[t],d=xn[l];return u?s.jsxs(ln,{onClick:()=>c==null?void 0:c(e),children:[s.jsxs(In,{children:[s.jsxs(cn,{children:[s.jsx(hn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:u.iconName}),s.jsxs(fn,{children:[u.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(dn,{children:r||""})]}),s.jsx(un,{children:o?s.jsx(yn,{children:"Play"}):d})]}):null},jn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),vn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Mn=({openInsight:e,questionId:t,...i})=>s.jsxs(jn,{children:[s.jsx(Se,{questionId:t,...i,isPickHistory:!0}),e&&s.jsx(vn,{onClick:()=>e(t),children:"View Insight"})]}),Tn=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),An=()=>n.c,Nn=n.styled_default(An())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),Sn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),Dn=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),zn=({openTweet:e,created:t,...i})=>{const r=x.useMemo(()=>{if(t){const o=new Date(t);if(ee(o))return{date:K(o),time:X(o)}}return null},[t]);return s.jsxs(Tn,{children:[r&&s.jsxs(Sn,{children:[r.date," · ",r.time]}),i.title&&s.jsx(Dn,{children:i.title}),s.jsx(n.u,{...i}),e&&s.jsx(Nn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},kn=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),On=({questions:e,openQuestion:t})=>s.jsx(kn,{children:e==null?void 0:e.map(i=>{var r,o,c;if(i.type==="question"&&((r=i.attributes)==null?void 0:r.attributes.case)==="question"){const l=i.attributes.attributes.value;return s.jsx(gn,{openQuestion:t,...l},l.questionId)}if(i.type==="insight"&&((o=i.attributes)==null?void 0:o.attributes.case)==="insight"){const l=i.attributes.attributes.value,u=i.attributes.created;return s.jsx(Mn,{openInsight:t,...l,created:u},l.questionId)}if(i.type==="tweet"&&((c=i.attributes)==null?void 0:c.attributes.case)==="tweet"){const l=i.attributes.attributes.value,u=i.attributes.id,d=i.attributes.created;return s.jsx(zn,{openTweet:t,...l,tweetId:u,created:d},u)}return null})}),wn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(On,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},bn=({userSummary:e})=>{var t;const[i,r]=x.useState(void 0);return x.useEffect(()=>{const o=e.subscribe(c=>{c!=null&&c.data&&r(c.data)});return()=>{o()}},[e]),i!=null&&i.summary?s.jsx(Me,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):s.jsx("div",{children:"wait user..."})},Cn=({gamification:e})=>{const[t,i]=x.useState(Y.HOME);return s.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[s.jsx(n.a,{style:{paddingBottom:"4px"},children:s.jsx(Os,{activePage:t,toggleActivePage:i})}),t===Y.HOME&&s.jsxs(n.r,{children:[s.jsx(n.a,{style:{paddingTop:"12px"},children:s.jsx(bn,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(wn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),t===Y.LEADERBOARD&&s.jsx("div",{className:"c1bp9dj2",children:s.jsx(an,{gamification:e})})]})},_n=()=>n.f,xe=n.styled_default(_n())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),En=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),Ln=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},$n=({gamification:e,className:t})=>{const i=n.useStore(e.openedQuestion.$store),r=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[i&&s.jsx(xe,{className:t,children:s.jsx(Ns,{gamification:e})}),r&&s.jsx(xe,{className:t,children:s.jsxs(En,{children:[s.jsx(ge,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(Me,{...r,successRate:Ln(r)})})]})}),s.jsx(n.r,{className:t,"data-nav":"true",children:s.jsx(Cn,{gamification:e})})]})};exports.default=$n;
|