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