@streamlayer/react 0.34.11 → 0.34.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/masters2.js +52 -52
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +62 -62
- package/lib/dist/es/gamification-feature.js +440 -443
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +14713 -14691
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +434 -437
- package/lib/es/masters.js +3 -3
- package/lib/es/masters2.js +11222 -11199
- package/lib/style.css +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Ne=Object.defineProperty;var Te=(e,t,i)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Y=(e,t,i)=>(Te(e,typeof t!="symbol"?t+"":t,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),ge=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),fe=()=>n.c1,Ae=n.styled_default(fe())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ve=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ee=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Le=()=>n.c1,ze=n.styled_default(Le())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:t,label:i})=>{const o=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(ge,{children:[s.jsxs(De,{children:[(o==null?void 0:o.iconName)&&s.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&s.jsx(ve,{children:o.label})]}),s.jsx(Ee,{onClick:t,children:s.jsx(ze,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Oe=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Se=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Z=({indicator:e,title:t})=>s.jsxs(Oe,{children:[s.jsx(Se,{children:t}),s.jsx(Ce,{children:e})]}),ke=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),we=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(ke,{children:[s.jsx(we,{children:e}),s.jsx(Qe,{children:t})]}),be=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ue=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Je=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Xe=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Ke="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzE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zEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ae=({avatar:e,name:t,points:i,friendsRank:o,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:M})=>s.jsxs(be,{children:[s.jsx($e,{children:s.jsxs(Re,{children:[s.jsxs(Xe,{children:[e&&s.jsx(Ue,{alt:"avatar",src:e}),!e&&s.jsx(Je,{children:oe(t||"")})]}),s.jsxs(Ye,{children:[s.jsx(Pe,{children:t}),s.jsxs(qe,{children:[s.jsxs(We,{children:[s.jsx(Ve,{alt:"rank-icon",src:Ke}),s.jsxs(Fe,{children:[re(i),s.jsx(Be,{children:"PTS"})]})]}),s.jsx(He,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(_e,{children:[s.jsxs(Ze,{children:[s.jsx(Z,{indicator:o||0,title:"Friends rank"}),s.jsx(Z,{indicator:r||0,title:"Global rank"})]}),s.jsxs(Ge,{children:[s.jsx($,{indicator:l||0,title:"Win streak"}),s.jsx($,{indicator:a||0,title:"Correct"}),s.jsx($,{indicator:d||0,title:"Incorrect"}),s.jsx($,{indicator:`${M||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.c1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>s.jsx(es,{children:s.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:t})=>s.jsxs(is,{children:[s.jsx(n.c1,{name:"icon-check-circle"}),s.jsx(os,{children:e}),s.jsx(rs,{children:t})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.c1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),Q=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),k=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),P=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:o,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:M,enteredAnActiveQuestion:I,marketClosed:p})=>{const j=i&&(o===n.QuestionType.TRIVIA||o===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,x=o===n.QuestionType.PREDICTION&&!r,f=p&&o===n.QuestionType.PREDICTION&&!i&&!I||o===n.QuestionType.PREDICTION&&M&&c&&I,m=j&&x,N=j&&r,y=o===n.QuestionType.PREDICTION&&i&&c&&r,g=i&&o===n.QuestionType.POLL&&c;if(!a&&!d&&!m&&!N&&!f&&!g&&!y)return null;const T=t?"correct":"incorrect",D=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return s.jsxs(ls,{"data-isPrediction":x,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Expired"})}),s.jsx(P,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),d&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Closed"})}),s.jsx(P,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),f&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Closed"})}),s.jsx(P,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),m&&s.jsxs(s.Fragment,{children:[s.jsx(cs,{name:"icon-prediction"}),s.jsx(k,{children:"Stay tuned to see if your prediction was correct."})]}),g&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{"data-feedbackType":"correct",children:s.jsx(n.c1,{name:"correct"})}),s.jsx(k,{children:"That's for answering. Please stay tuned for the next question."})]}),(N||y)&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{"data-feedbackType":T,children:s.jsx(n.c1,{name:T})}),s.jsx("div",{children:s.jsxs(_,{children:[s.jsx(us,{"data-feedbackType":T,children:D==null?void 0:D.title}),s.jsx(k,{children:D==null?void 0:D.description})]})})]})]})},Ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),Is=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),js=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ys=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ms=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),hs=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ns=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Ts=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),gs=()=>le,Ds=n.styled_default(gs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),fs=()=>le,As=n.styled_default(fs())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),vs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Es=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ls=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),zs=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Os=()=>n.c1,Ss=n.styled_default(Os())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Ds,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Ns,{children:s.jsx(Ts,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:o,questionVoted:r})=>{if(e===n.QuestionType.POLL&&o)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&r)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return e===n.QuestionType.TRIVIA&&r&&o?i?"correct":"incorrect":"unset"},ks=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:o,questionStatus:r})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&o||r===n.QuestionStatus.RESOLVED&&i:!1,ws=e=>{var t;const{id:i,icon:o,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:M,questionVoted:I,imageMode:p,answerTimeExpired:j,questionStatus:x,isLoading:f,questionType:m,correct:N,hasCorrectAnswer:y,votedAfterQuestionClosed:g,enteredAnActiveQuestion:T,marketClosed:D}=e,L=Cs(e),S=ks({questionType:m,questionVoted:I,correct:N,hasCorrectAnswer:y,questionStatus:x}),O=D&&m===n.QuestionType.PREDICTION,b=I||O,h=m===n.QuestionType.PREDICTION&&!I&&x!==n.QuestionStatus.RESOLVED;return s.jsxs(ys,{value:i,"data-selected":M,"data-answer-state":L,disabled:I||f||j||O&&!T||O&&T&&g,"data-is-not-checked":I&&!M&&L!=="incorrect",onClick:v=>{c(m===n.QuestionType.PREDICTION?D:x===n.QuestionStatus.RESOLVED),d(v)},children:[s.jsx(ms,{"data-answer-state":L,style:{width:`${b?l:0}%`}}),s.jsxs(hs,{children:[o&&p&&((t=G[p])==null?void 0:t.call(G,o)),s.jsx(vs,{children:r}),h&&s.jsxs("div",{children:[s.jsx(n.d,{value:a}),s.jsx(Ls,{children:"pts"})]}),b&&s.jsxs(Es,{children:[S&&s.jsx(Ss,{name:"selected"}),s.jsx(zs,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Qs=({isPlaying:e,duration:t,startAt:i=0,updateInterval:o=0,onComplete:r,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),M=u.useRef(i),I=u.useRef(i*-1e3),p=u.useRef(null),j=u.useRef(null),x=u.useRef(null),f=y=>{let g=y/1e3;if(j.current===null){j.current=g,p.current=requestAnimationFrame(f);return}let T=g-j.current,D=c.current+T;j.current=g,c.current=D;let L=M.current+(o===0?D:(D/o|0)*o),S=M.current+D,O=typeof t=="number"&&S>=t;d(O?t:L),O||(p.current=requestAnimationFrame(f))},m=()=>{p.current&&cancelAnimationFrame(p.current),x.current&&clearTimeout(x.current),j.current=null},N=u.useCallback(y=>{m(),c.current=0;let g=typeof y=="number"?y:i;M.current=g,d(g),e&&(p.current=requestAnimationFrame(f))},[e,i]);return J(()=>{if(l==null||l(a),t&&a>=t){I.current+=t*1e3;let{shouldRepeat:y=!1,delay:g=0,newStartAt:T}=(r==null?void 0:r(I.current/1e3))||{};y&&(x.current=setTimeout(()=>N(T),g*1e3))}},[a,t]),J(()=>(e&&(p.current=requestAnimationFrame(f)),m),[e,t,o]),{elapsedTime:a,reset:N}},bs=(e,t,i)=>{let o=e/2,r=t/2,l=o-r,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${o},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},X=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,t,i,o,r)=>{if(o===0)return t;let l=(r?o-e:e)/o;return t+i*l},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(o,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:t.map(o=>parseInt(o,16)))!=null?i:[]},Rs=(e,t)=>{var i;let{colors:o,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof o=="string")return o;let a=(i=r==null?void 0:r.findIndex((j,x)=>j>=t&&t>=r[x+1]))!=null?i:-1;if(!r||a===-1)return o[0];if(!l)return o[a];let d=r[a]-t,c=r[a]-r[a+1],M=K(o[a]),I=K(o[a+1]),p=!!e.isGrowing;return`rgb(${M.map((j,x)=>de(d,j,I[x]-j,c,p)|0).join(",")})`},Us=e=>{let{duration:t,initialRemainingTime:i,updateInterval:o,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:M="clockwise",onComplete:I,onUpdate:p}=e,j=u.useRef(),x=Math.max(l,a??0),{path:f,pathLength:m}=bs(r,x,M),{elapsedTime:N}=Qs({isPlaying:d,duration:t,startAt:X(t,i),updateInterval:o,onUpdate:typeof p=="function"?g=>{let T=Math.ceil(t-g);T!==j.current&&(j.current=T,p(T))}:void 0,onComplete:typeof I=="function"?g=>{var T;let{shouldRepeat:D,delay:L,newInitialRemainingTime:S}=(T=I(g))!=null?T:{};if(D)return{shouldRepeat:D,delay:L,newStartAt:X(t,S)}}:void 0}),y=t-N;return{elapsedTime:N,path:f,pathLength:m,remainingTime:Math.ceil(y),rotation:M,size:r,stroke:Rs(e,y),strokeDashoffset:de(N,0,m,t,c),strokeWidth:l}},ce=e=>{let{children:t,strokeLinecap:i,trailColor:o,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:M,elapsedTime:I,size:p,strokeWidth:j}=Us(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:o??"#d9d9d9",strokeWidth:r??j}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:j,strokeDasharray:a,strokeDashoffset:c})),typeof t=="function"&&u.createElement("div",{style:_s},t({remainingTime:M,elapsedTime:I,color:d})))};ce.displayName="CountdownCircleTimer";const Ys=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ps=[10,10,1,0],qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[o,r]=u.useState(t>10?Vs:ee),l=({remainingTime:c})=>s.jsx(qs,{children:c}),a=u.useCallback(()=>{i==null||i(),r(Ws)},[i,r]),d=u.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(ce,{isPlaying:e,duration:t,colors:Ys,colorsTime:Ps,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Zs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Gs=()=>n.c1,Js=n.styled_default(Gs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Xs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ks=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:t,isPlayingTimer:i,isTimer:o,questionType:r,timerDuration:l,onTimerExpired:a})=>s.jsxs(Bs,{style:{justifyContent:r===n.QuestionType.PREDICTION?"center":"space-between"},children:[s.jsxs(Hs,{children:[e&&s.jsx(Zs,{children:e}),t!==void 0&&r!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Js,{name:"icon-trophy"}),s.jsxs(Xs,{children:[s.jsx(Ks,{children:s.jsx(n.d,{value:t})}),s.jsx(et,{children:"PTS"})]})]})]}),o&&r!==n.QuestionType.PREDICTION&&s.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:t,vote:i,close:o})=>{var r,l;const a=e.subject,d=e.type,c=e.status,M=(r=e.options)==null?void 0:r.options,I=e.marketClosed,[p,j]=u.useState(!1),[x,f]=u.useState(!1),[m,N]=u.useState(!0),[y,g]=u.useState(!1),[T,D]=u.useState(""),L=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?I&&N(!1):c===n.QuestionStatus.RESOLVED&&N(!1)},[]);const S=u.useCallback(A=>{f(A),j(!0)},[]),O=u.useCallback(async A=>{if(L){const w=A.currentTarget.value;D(w),await i(L,w)}},[L,D,i]),b=u.useCallback(()=>{g(!0),setTimeout(o,3e3)},[o]),h=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),v=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),z=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),je=u.useMemo(()=>e?e.answers.map(A=>{var w;return{...A,questionVoted:!!h,youSelected:T===A.id,isLoading:t,hasCorrectAnswer:v,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(w=e.appearance)==null?void 0:w.images,onVote:O}}):[],[v,y,t,e,h,c,O,T]),xe=M&&(M.case==="trivia"||M.case==="prediction")?M.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!h&&!m,B=d===n.QuestionType.TRIVIA&&x&&p&&m,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(h&&!v||h&&v&&z!=null&&z.youVoted):!0,[d,h,v,z]),ye=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&h&&(!v||v&&z!=null&&z.youVoted))return h.points;if(!(C||y))return c===n.QuestionStatus.RESOLVED?0:h?h.correct?h.points:0:z==null?void 0:z.points},[y,h,z,c,C,d,v]),me=u.useMemo(()=>d===n.QuestionType.PREDICTION&&h?v?v&&z!=null&&z.youVoted?"You won":"":"To win":C||y?"Time expired":d===n.QuestionType.POLL?"Time remaining":h?"You won":"To win",[y,d,h,C,v,z]),he=h||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&m;return s.jsx(n.r,{"data-question-header":"true",children:s.jsx(Ms,{children:s.jsxs(Is,{children:[s.jsx(ps,{feedbackMessages:xe,questionVoted:!!h,questionVotedCorrectly:h==null?void 0:h.correct,questionType:d,hasCorrectAnswer:v,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:x,enteredAnActiveQuestion:m,marketClosed:I}),H&&s.jsx(st,{title:me,points:ye,onTimerExpired:b,questionType:e.type,isTimer:!t,isPlayingTimer:!h,timerDuration:he?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?s.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(js,{style:H?{}:{marginTop:0},children:a}),s.jsx(xs,{children:je.map(A=>s.jsx(ws,{...A,markThatVoted:S,votedAfterQuestionClosed:x,enteredAnActiveQuestion:m,marketClosed:I},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:t,title:i,isPickHistory:o,instantView:r,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(r==null?void 0:r.image)||t;return s.jsxs(nt,{children:[a&&s.jsxs(at,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&s.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),d&&!(r!=null&&r.video)&&s.jsx(lt,{src:d}),s.jsxs(it,{children:[s.jsx(ot,{children:o?i:r==null?void 0:r.heading}),s.jsx(rt,{children:o?l==null?void 0:l.body:r==null?void 0:r.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...t})=>s.jsxs(dt,{children:[s.jsx(ue,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,s.jsx(n.c1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),Mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),It=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),jt=({created:e,...t})=>{const i=u.useMemo(()=>{if(e){const o=new Date(e);if(F(o))return{date:V(o),time:W(o)}}return null},[e]);return s.jsxs(pt,{children:[i&&s.jsxs(Mt,{children:[i.date," · ",i.time]}),t.title&&s.jsx(It,{children:t.title}),s.jsx(n.j,{...t})]})},xt=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),yt=({openedQuestion:e})=>{var t,i;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?s.jsx(jt,{created:e.attributes.created,...e.attributes.attributes.value}):null},mt=({extendedQuestion:e,vote:t,close:i})=>{const{loading:o,data:r}=e;return r?s.jsx(tt,{vote:t,close:i,openedQuestion:r,isLoading:!!o}):null},ht=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),o=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const r=i.type;return s.jsxs(xt,{children:[s.jsx(ie,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),r==="question"&&s.jsx(mt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:o}),r!=="question"&&s.jsx(yt,{openedQuestion:i}),s.jsx(ns,{sponsorLogo:""})]})},Nt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Tt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),gt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Dt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(U||{});const se=({title:e,active:t,onClick:i})=>s.jsx(gt,{onClick:i,"data-selected":t,children:s.jsx(Dt,{children:e})}),ft=({activePage:e="home",toggleActivePage:t})=>s.jsx(Nt,{children:s.jsxs(Tt,{"data-position":e==="home"?"left":"right",children:[s.jsx(se,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})}),At=n.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),vt=n.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),Et=n.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Lt=n.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),zt=n.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),Ot=()=>n.c1,St=n.styled_default(Ot())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),Ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iMTYiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMC40NjE1IDEyLjY4NzVDOS40NDIzMSAxMi42ODc1IDguNjE1MzggMTMuNDY2NSA4LjYxNTM4IDE0LjQyNjZDOC42MTUzOCAxNS4zODY4IDkuNDQyMzEgMTYuM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DIgMTMuOTE2NkMxNS4yMTggMTMuMTc5NiAxNC4zNjk0IDEyLjY4NzUgMTMuMzkwOCAxMi42ODc1Wk0xOC42MSA5QzE3LjUyOTUgOSAxNi42NTI4IDkuODI1ODQgMTYuNjUyOCAxMC44NDM3QzE2LjY1MjggMTEuODYxNiAxNy41Mjk1IDEyLjY4NzUgMTguNjEgMTIuNjg3NUMxOS42OTA1IDEyLjY4NzUgMjAuNTY3MiAxMS44NjE2IDIwLjU2NzIgMTAuODQzN0MyMC41NjcyIDkuODI1ODQgMTkuNjkwNSA5IDE4LjYxIDlaTTE4LjYxIDEyLjY4NzVDMTcuNjMxNCAxMi42ODc1IDE2Ljc4MjggMTMuMTc5NiAxNi4zMjY2IDEzLjkxNjZDMTcuMzA1MiAxNC4wMzkxIDE4LjE0ODcgMTQuNTI0IDE4LjY3MTIgMTUuMjYxQzE4LjY3MTIgMTUuMDE2MSAxOC42MSAxNC43NzYxIDE4LjYxIDE0LjUzMTJDMTguNjEgMTMuODU0MiAxOC44MDg4IDEzLjIzNzIgMTkuMjAxMiAxMi43NDUxQzE5LjAwNSAxMi42ODI3IDE4LjgwNjIgMTIuNjg3NSAxOC42MSAxMi42ODc1WiIgZmlsbD0iIzEwN0Q1NyIvPgo8L3N2Zz4K",kt=({title:e,description:t,onClick:i,className:o})=>s.jsxs(At,{onClick:i,className:o,children:[s.jsx(vt,{alt:"friends-icon",src:Ct}),s.jsxs(Et,{children:[s.jsx(Lt,{children:e}),s.jsx(zt,{children:t})]}),s.jsx(St,{name:"icon-copy"})]});function wt(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,o=e.startIndex,r=e.stopIndex;return!(o>i||r<t)}function Qt(e){for(var t=e.isItemLoaded,i=e.itemCount,o=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,M=r;M<=l;M++){var I=t(M);I?c!==null&&(a.push(d,c),d=c=null):(c=M,d===null&&(d=M))}if(c!==null){for(var p=Math.min(Math.max(c,d+o-1),i-1),j=c+1;j<=p&&!t(j);j++)c=j;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<o&&a[0]>0;){var x=a[0]-1;if(!t(x))a[0]=x;else break}return a}var bt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},$t=function(){function e(t,i){for(var o=0;o<i.length;o++){var r=i[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),_t=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)},te=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};(function(e){_t(t,e);function t(){var i,o,r,l;bt(this,t);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(o=(r=te(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(M){var I=M.visibleStartIndex,p=M.visibleStopIndex;r._lastRenderedStartIndex=I,r._lastRenderedStopIndex=p,r._ensureRowsLoaded(I,p)},r._setRef=function(M){r._listRef=M},o),te(r,l)}return $t(t,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,M=c===void 0?10:c,I=l.threshold,p=I===void 0?15:I,j=Qt({isItemLoaded:a,itemCount:d,minimumBatchSize:M,startIndex:Math.max(0,o-p),stopIndex:Math.min(d-1,r+p)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(x,f){return j[f]!==x}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(o){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(M){var I=o[M],p=o[M+1],j=l(I,p);j!=null&&j.then(function(){if(wt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:I,stopIndex:p})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(I,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<o.length;d+=2)a(d)}}]),t})(u.PureComponent);const Rt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ut=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Yt=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Pt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),qt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Vt=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Wt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Ft=()=>n.c1,Bt=n.styled_default(Ft())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Ht,Gt=Zt;function Me(){}function Ie(){}Ie.resetWarningCache=Me;var Jt=function(){function e(o,r,l,a,d,c){if(c!==Gt){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}e.isRequired=e;function t(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ie,resetWarningCache:Me};return i.PropTypes=i,i};pe.exports=Jt();var Xt=pe.exports;const E=n.getDefaultExportFromCjs(Xt);class q extends u.Component{constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const i={get passive(){t=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let i=window;this.props.useWindow===!1&&(i=t),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,i=window,o=this.getParentElement(t);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(t,a)}else this.props.isReverse?r=o.scrollTop:r=t.scrollHeight-o.scrollTop-o.clientHeight;r<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,i){return t?this.calculateTopPosition(t)+(t.offsetHeight-i-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:i,element:o,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:M,ref:I,threshold:p,useCapture:j,useWindow:x,getScrollParent:f,...m}=t;m.ref=y=>{this.scrollComponent=y,I&&I(y)};const N=[i];return r&&(d?a?N.unshift(d):N.push(d):this.defaultLoader&&(a?N.unshift(this.defaultLoader):N.push(this.defaultLoader))),u.createElement(o,m,N)}}Y(q,"propTypes",{children:E.node.isRequired,element:E.node,hasMore:E.bool,initialLoad:E.bool,isReverse:E.bool,loader:E.node,loadMore:E.func.isRequired,pageStart:E.number,ref:E.func,getScrollParent:E.func,threshold:E.number,useCapture:E.bool,useWindow:E.bool}),Y(q,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Kt=({rank:e,avatar:t,name:i,points:o,isCurrentUser:r,openItemDetail:l,style:a})=>s.jsxs(Rt,{onClick:l,style:a,children:[s.jsx(Ut,{children:e||0}),s.jsxs(qt,{children:[t?s.jsx(Yt,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Pt,{children:oe(i||"")}),s.jsxs(Vt,{children:[s.jsx(Wt,{children:i||""}),r&&s.jsx(Bt,{name:"icon-star"})]})]}),s.jsx("div",{children:re(o)})]}),en=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),sn=({items:e,currentUserId:t,openItemDetail:i,fetchMore:o,scrollNode:r,hasMore:l})=>s.jsx(q,{loadMore:o,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:s.jsx(en,{children:e.map(a=>s.jsx(Kt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!t&&t===a.userId},a.userId))})}),tn=({deepLink:e})=>s.jsx(n.O,{inviteLink:e,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=n.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),on=({gamification:e,scrollNode:t,scrollStore:i})=>{const{data:o,hasMore:r}=n.useStore(e.leaderboardList.$store),{data:l}=n.useStore(e.deepLink.$store);if(!(o!=null&&o.length))return s.jsx(tn,{deepLink:l});const a=async()=>{if(l)try{await navigator.clipboard.writeText(l)}catch(d){console.error("Unable to copy to clipboard",d)}};return s.jsxs(s.Fragment,{children:[s.jsx(sn,{items:o,scrollNode:t,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:r,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}),l&&s.jsx(nn,{children:s.jsx(kt,{onClick:a,title:"Invite Friends",description:"Challenge them now!"})})]})},rn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),dn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),cn=()=>n.c1,R=n.styled_default(cn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),un=()=>n.c1,pn=n.styled_default(un())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Mn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),In=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),jn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),xn={[n.PickHistoryStatus.LOST]:s.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(R,{name:"icon-arrow"})},yn=({questionId:e,questionType:t,questionStatus:i,subject:o,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[t],c=xn[a];return d?s.jsxs(rn,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(In,{children:[s.jsxs(an,{children:[s.jsx(pn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:d.iconName}),s.jsxs(Mn,{children:[d.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(ln,{children:o||""})]}),s.jsx(dn,{children:r?s.jsx(jn,{children:"Play"}):c})]}):null},mn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),hn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Nn=({openInsight:e,questionId:t,...i})=>s.jsxs(mn,{children:[s.jsx(ue,{questionId:t,...i,isPickHistory:!0}),e&&s.jsx(hn,{onClick:()=>e(t),children:"View Insight"})]}),Tn=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),gn=()=>n.c,Dn=n.styled_default(gn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),fn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),An=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),vn=({openTweet:e,created:t,...i})=>{const o=u.useMemo(()=>{if(t){const r=new Date(t);if(F(r))return{date:V(r),time:W(r)}}return null},[t]);return s.jsxs(Tn,{children:[o&&s.jsxs(fn,{children:[o.date," · ",o.time]}),i.title&&s.jsx(An,{children:i.title}),s.jsx(n.j,{...i}),e&&s.jsx(Dn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},En=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),Ln=({questions:e,openQuestion:t})=>s.jsx(En,{children:e==null?void 0:e.map(i=>{var o,r,l;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const a=i.attributes.attributes.value;return s.jsx(yn,{openQuestion:t,...a},a.questionId)}if(i.type==="insight"&&((r=i.attributes)==null?void 0:r.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return s.jsx(Nn,{openInsight:t,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return s.jsx(vn,{openTweet:t,...a,tweetId:d,created:c},d)}return null})}),zn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(Ln,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},On=({userSummary:e})=>{var t;const[i,o]=u.useState(void 0);return u.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&o(l.data)});return()=>{r()}},[e]),i!=null&&i.summary?s.jsx(ae,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):s.jsx("div",{children:"wait user..."})},Sn=({gamification:e,className:t,scrollStore:i,scrollNode:o})=>{const[r,l]=u.useState(!1),[a,d]=u.useState(U.HOME),[,c]=u.useTransition(),M=p=>{c(()=>d(p))},I=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){I(!1),i.setKey("tabsShown",!1);return}I(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),s.jsxs("div",{className:t,children:[s.jsx(n.a,{style:{paddingBottom:"8px",position:"sticky",transition:"top calc(var(--animation-duration) / 2) var(--animation-function)",top:r?"-60px":"0px"},children:s.jsx(ft,{activePage:a,toggleActivePage:M})}),a===U.HOME&&s.jsxs(s.Fragment,{children:[s.jsx(n.a,{style:{paddingTop:"8px"},children:s.jsx(On,{userSummary:e.userSummary})}),s.jsx(n.n,{children:s.jsx(zn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===U.LEADERBOARD&&s.jsx(n.a,{style:{paddingTop:"8px",paddingBottom:"8px"},children:s.jsx(on,{scrollStore:i,scrollNode:o,gamification:e})})]})},Cn=()=>n.x,ne=n.styled_default(Cn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),kn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),wn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},Qn=({gamification:e,scrollStore:t,className:i,appNode:o,scrollNode:r})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[l&&o.current&&n.Pk.createPortal(s.jsx(ne,{className:i,children:s.jsx(ht,{gamification:e})}),o.current),a&&o.current&&n.Pk.createPortal(s.jsx(ne,{className:i,children:s.jsxs(kn,{children:[s.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.a,{children:s.jsx(ae,{...a,successRate:wn(a)})})]})}),o.current),s.jsx(Sn,{scrollStore:t,scrollNode:r,className:i,gamification:e})]})};exports.default=Qn;
|
|
1
|
+
"use strict";var Ne=Object.defineProperty;var Te=(e,t,i)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Y=(e,t,i)=>(Te(e,typeof t!="symbol"?t+"":t,i),i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),n=require("./masters.js"),u=require("react"),ge=n.styled_default("div")({name:"Container",class:"c1vwopgc",propsAsIs:!1}),De=n.styled_default("div")({name:"QuestionTypeWrap",class:"qyktpt0",propsAsIs:!1}),fe=()=>n.c1,Ae=n.styled_default(fe())({name:"QuestionTypeIcon",class:"q951jdx",propsAsIs:!0}),ve=n.styled_default("span")({name:"QuestionTypeTitle",class:"qss5f0e",propsAsIs:!1}),Ee=n.styled_default("button")({name:"CloseButton",class:"c1ao1jtv",propsAsIs:!1}),Le=()=>n.c1,ze=n.styled_default(Le())({name:"CloseIcon",class:"cvsl7l3",propsAsIs:!0}),ie=({type:e,close:t,label:i})=>{const o=e?n.o[e]:{label:i,iconName:void 0};return s.jsxs(ge,{children:[s.jsxs(De,{children:[(o==null?void 0:o.iconName)&&s.jsx(Ae,{"data-type-trivia":e===n.QuestionType.TRIVIA,"data-type-poll":e===n.QuestionType.POLL,name:o.iconName}),(o==null?void 0:o.label)&&s.jsx(ve,{children:o.label})]}),s.jsx(Ee,{onClick:t,children:s.jsx(ze,{name:"icon-cross"})})]})},oe=e=>e.split(/\s+/).map(t=>t[0]).join("").toUpperCase(),re=e=>e?e.toLocaleString("en-US"):"0",V=e=>e.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}),W=e=>e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"}),F=e=>!isNaN(e.getTime()),Oe=n.styled_default("div")({name:"Container",class:"c1zy8a",propsAsIs:!1}),Se=n.styled_default("div")({name:"Title",class:"t1vih9p5",propsAsIs:!1}),Ce=n.styled_default("div")({name:"Indicator",class:"i1fbnvpb",propsAsIs:!1}),Z=({indicator:e,title:t})=>s.jsxs(Oe,{children:[s.jsx(Se,{children:t}),s.jsx(Ce,{children:e})]}),ke=n.styled_default("div")({name:"Container",class:"ctmhwyc",propsAsIs:!1}),we=n.styled_default("div")({name:"Indicator",class:"i1jri200",propsAsIs:!1}),Qe=n.styled_default("div")({name:"Title",class:"t8s05oq",propsAsIs:!1}),$=({indicator:e,title:t})=>s.jsxs(ke,{children:[s.jsx(we,{children:e}),s.jsx(Qe,{children:t})]}),be=n.styled_default("div")({name:"Container",class:"c1yrpn9o",propsAsIs:!1}),$e=n.styled_default("div")({name:"TopInfo",class:"t17fwahh",propsAsIs:!1}),_e=n.styled_default("div")({name:"BottomInfo",class:"by6w7e9",propsAsIs:!1}),Re=n.styled_default("div")({name:"User",class:"u1g7arbm",propsAsIs:!1}),Ue=n.styled_default("img")({name:"Avatar",class:"a1ldeata",propsAsIs:!1}),Ye=n.styled_default("div")({name:"UserInfo",class:"u10d4koz",propsAsIs:!1}),Pe=n.styled_default("div")({name:"UserName",class:"u1q6roj0",propsAsIs:!1}),qe=n.styled_default("div")({name:"UserRating",class:"ui0m425",propsAsIs:!1}),Ve=n.styled_default("img")({name:"TrophyIcon",class:"t1el3mrn",propsAsIs:!1}),We=n.styled_default("div")({name:"Rts",class:"r2vgnxv",propsAsIs:!1}),Fe=n.styled_default("div")({name:"RtsIndicator",class:"roqn06j",propsAsIs:!1}),Be=n.styled_default("div")({name:"RtsLabel",class:"r15adx7c",propsAsIs:!1}),He=n.styled_default("div")({name:"Divider",class:"dv59lta",propsAsIs:!1}),Ze=n.styled_default("div")({name:"Ranks",class:"r55lotb",propsAsIs:!1}),Ge=n.styled_default("div")({name:"Statistics",class:"s1knfgqt",propsAsIs:!1}),Je=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1mqo824",propsAsIs:!1}),Xe=n.styled_default("button")({name:"UserAccountBtn",class:"uxareh6",propsAsIs:!1}),Ke="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEw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gNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=",ae=({avatar:e,name:t,points:i,friendsRank:o,rank:r,streak:l,correct:a,incorrect:d,inTop:c,successRate:M})=>s.jsxs(be,{children:[s.jsx($e,{children:s.jsxs(Re,{children:[s.jsxs(Xe,{children:[e&&s.jsx(Ue,{alt:"avatar",src:e}),!e&&s.jsx(Je,{children:oe(t||"")})]}),s.jsxs(Ye,{children:[s.jsx(Pe,{children:t}),s.jsxs(qe,{children:[s.jsxs(We,{children:[s.jsx(Ve,{alt:"rank-icon",src:Ke}),s.jsxs(Fe,{children:[re(i),s.jsx(Be,{children:"PTS"})]})]}),s.jsx(He,{}),s.jsxs("div",{children:["TOP ",c||0,"%"]})]})]})]})}),s.jsxs(_e,{children:[s.jsxs(Ze,{children:[s.jsx(Z,{indicator:o||0,title:"Friends rank"}),s.jsx(Z,{indicator:r||0,title:"Global rank"})]}),s.jsxs(Ge,{children:[s.jsx($,{indicator:l||0,title:"Win streak"}),s.jsx($,{indicator:a||0,title:"Correct"}),s.jsx($,{indicator:d||0,title:"Incorrect"}),s.jsx($,{indicator:`${M||0}%`,title:"Succ. rate"})]})]})]}),es=n.styled_default("div")({name:"SponsorLogoWrap",class:"s8p5v5z",propsAsIs:!1}),ss=()=>n.c1,ts=n.styled_default(ss())({name:"SponsorLogo",class:"s755yti",propsAsIs:!0}),ns=()=>s.jsx(es,{children:s.jsx(ts,{name:"mastersLogo"})}),is=n.styled_default("div")({name:"Container",class:"c38csyt",propsAsIs:!1}),os=n.styled_default("div")({name:"Title",class:"ty221rx",propsAsIs:!1}),rs=n.styled_default("div")({name:"Description",class:"dlaj9xp",propsAsIs:!1}),as=({title:e,description:t})=>s.jsxs(is,{children:[s.jsx(n.c1,{name:"icon-check-circle"}),s.jsx(os,{children:e}),s.jsx(rs,{children:t})]}),ls=n.styled_default("div")({name:"Container",class:"c16sbdnm",propsAsIs:!1}),ds=()=>n.c1,cs=n.styled_default(ds())({name:"IconPrediction",class:"ibhorgl",propsAsIs:!0}),Q=n.styled_default("div")({name:"FeedbackIconWrap",class:"f1g20ja7",propsAsIs:!1}),_=n.styled_default("div")({name:"FeedbackHeader",class:"f455ozj",propsAsIs:!1}),us=n.styled_default("span")({name:"FeedbackTitle",class:"f1913njx",propsAsIs:!1}),k=n.styled_default("span")({name:"FeedbackDescription",class:"fzfk69z",propsAsIs:!1}),P=n.styled_default("div")({name:"FeedbackText",class:"fx87qaj",propsAsIs:!1}),ps=({feedbackMessages:e,questionVotedCorrectly:t,questionVoted:i,questionType:o,hasCorrectAnswer:r,questionStatus:l,showExpiredNotification:a,showClosedNotificationTrivia:d,votedInCurrentRender:c,votedAfterQuestionClosed:M,enteredAnActiveQuestion:I,marketClosed:p})=>{const j=i&&(o===n.QuestionType.TRIVIA||o===n.QuestionType.PREDICTION)&&c&&l!==n.QuestionStatus.RESOLVED,x=o===n.QuestionType.PREDICTION&&!r,f=p&&o===n.QuestionType.PREDICTION&&!i&&!I||o===n.QuestionType.PREDICTION&&M&&c&&I,m=j&&x,N=j&&r,y=o===n.QuestionType.PREDICTION&&i&&c&&r,g=i&&o===n.QuestionType.POLL&&c;if(!a&&!d&&!m&&!N&&!f&&!g&&!y)return null;const T=t?"correct":"incorrect",D=t?e==null?void 0:e.correctFeedback:e==null?void 0:e.incorrectFeedback;return s.jsxs(ls,{"data-isPrediction":x,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Expired"})}),s.jsx(P,{children:"You can still answer to see if you're correct, but no points are awarded for expired questions."})]})]}),d&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Closed"})}),s.jsx(P,{children:"This question was answered after the moderator closed the question. So the points for this answer won’t tally."})]})]}),f&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{children:s.jsx(n.c1,{name:"questionExpired"})}),s.jsxs("div",{children:[s.jsx(_,{children:s.jsx(k,{children:"Question Closed"})}),s.jsx(P,{children:"This event has already taken place, so the ability to make a prediction on its outcome is no longer available."})]})]}),m&&s.jsxs(s.Fragment,{children:[s.jsx(cs,{name:"icon-prediction"}),s.jsx(k,{children:"Stay tuned to see if your prediction was correct."})]}),g&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{"data-feedbackType":"correct",children:s.jsx(n.c1,{name:"correct"})}),s.jsx(k,{children:"That's for answering. Please stay tuned for the next question."})]}),(N||y)&&s.jsxs(s.Fragment,{children:[s.jsx(Q,{"data-feedbackType":T,children:s.jsx(n.c1,{name:T})}),s.jsx("div",{children:s.jsxs(_,{children:[s.jsx(us,{"data-feedbackType":T,children:D==null?void 0:D.title}),s.jsx(k,{children:D==null?void 0:D.description})]})})]})]})},Ms=n.styled_default("div")({name:"Container",class:"c14ielyq",propsAsIs:!1}),Is=n.styled_default("div")({name:"Content",class:"c1tlqx57",propsAsIs:!1}),js=n.styled_default("div")({name:"Title",class:"t1hq58md",propsAsIs:!1}),xs=n.styled_default("div")({name:"Options",class:"o1c8nxcx",propsAsIs:!1}),ys=n.styled_default("button")({name:"ButtonContainer",class:"b1b6dl8t",propsAsIs:!1}),ms=n.styled_default("div")({name:"ButtonPct",class:"b4iik8i",propsAsIs:!1}),hs=n.styled_default("span")({name:"ButtonBody",class:"b1gq1lnf",propsAsIs:!1}),Ns=n.styled_default("div")({name:"IconContainer",class:"i1j65z51",propsAsIs:!1}),Ts=n.styled_default("div")({name:"IconWrap",class:"i19tpfua",propsAsIs:!1}),le=n.styled_default("img")({name:"Icon",class:"i1tubmma",propsAsIs:!1}),gs=()=>le,Ds=n.styled_default(gs())({name:"IconDefault",class:"i1grrgwj",propsAsIs:!0}),fs=()=>le,As=n.styled_default(fs())({name:"IconCircle",class:"ibemyq8",propsAsIs:!0}),vs=n.styled_default("span")({name:"Title",class:"t1dceht",propsAsIs:!1}),Es=n.styled_default("span")({name:"Indicators",class:"i116q4vq",propsAsIs:!1}),Ls=n.styled_default("span")({name:"Pts",class:"p17ajcu2",propsAsIs:!1}),zs=n.styled_default("span")({name:"Percentage",class:"pu9kmlb",propsAsIs:!1}),Os=()=>n.c1,Ss=n.styled_default(Os())({name:"CheckIcon",class:"c1j2j0s0",propsAsIs:!0}),G={[n.QuestionImages.CENTERED]:e=>s.jsx(Ds,{alt:"option-icon",src:e}),[n.QuestionImages.TRANSPARENT]:e=>s.jsx(Ns,{children:s.jsx(Ts,{style:{backgroundImage:`url(${e})`}})}),[n.QuestionImages.ROUNDED]:e=>s.jsx(As,{alt:"option-icon",src:e}),[n.QuestionImages.NONE]:()=>null,[n.QuestionImages.UNSET]:()=>null},Cs=({questionType:e,hasCorrectAnswer:t,correct:i,youVoted:o,questionVoted:r})=>{if(e===n.QuestionType.POLL&&o)return"correct";if(e===n.QuestionType.PREDICTION){if(t&&r)return o?i?"correct":"incorrect":"unset";if(o)return"correct"}return e===n.QuestionType.TRIVIA&&r&&o?i?"correct":"incorrect":"unset"},ks=({questionType:e,questionVoted:t,correct:i,hasCorrectAnswer:o,questionStatus:r})=>e===n.QuestionType.TRIVIA?t&&i:e===n.QuestionType.PREDICTION?t&&i&&o||r===n.QuestionStatus.RESOLVED&&i:!1,ws=e=>{var t;const{id:i,icon:o,text:r,percentageDecimal:l,points:a,onVote:d,markThatVoted:c,youSelected:M,questionVoted:I,imageMode:p,answerTimeExpired:j,questionStatus:x,isLoading:f,questionType:m,correct:N,hasCorrectAnswer:y,votedAfterQuestionClosed:g,enteredAnActiveQuestion:T,marketClosed:D}=e,L=Cs(e),S=ks({questionType:m,questionVoted:I,correct:N,hasCorrectAnswer:y,questionStatus:x}),O=D&&m===n.QuestionType.PREDICTION,b=I||O,h=m===n.QuestionType.PREDICTION&&!I&&x!==n.QuestionStatus.RESOLVED;return s.jsxs(ys,{value:i,"data-selected":M,"data-answer-state":L,disabled:I||f||j||O&&!T||O&&T&&g,"data-is-not-checked":I&&!M&&L!=="incorrect",onClick:v=>{c(m===n.QuestionType.PREDICTION?D:x===n.QuestionStatus.RESOLVED),d(v)},children:[s.jsx(ms,{"data-answer-state":L,style:{width:`${b?l:0}%`}}),s.jsxs(hs,{children:[o&&p&&((t=G[p])==null?void 0:t.call(G,o)),s.jsx(vs,{children:r}),h&&s.jsxs("div",{children:[s.jsx(n.d,{value:a}),s.jsx(Ls,{children:"pts"})]}),b&&s.jsxs(Es,{children:[S&&s.jsx(Ss,{name:"selected"}),s.jsx(zs,{children:s.jsx(n.d,{value:l,suffix:"%"})})]})]})]})};var J=typeof window>"u"?u.useEffect:u.useLayoutEffect,Qs=({isPlaying:e,duration:t,startAt:i=0,updateInterval:o=0,onComplete:r,onUpdate:l})=>{let[a,d]=u.useState(i),c=u.useRef(0),M=u.useRef(i),I=u.useRef(i*-1e3),p=u.useRef(null),j=u.useRef(null),x=u.useRef(null),f=y=>{let g=y/1e3;if(j.current===null){j.current=g,p.current=requestAnimationFrame(f);return}let T=g-j.current,D=c.current+T;j.current=g,c.current=D;let L=M.current+(o===0?D:(D/o|0)*o),S=M.current+D,O=typeof t=="number"&&S>=t;d(O?t:L),O||(p.current=requestAnimationFrame(f))},m=()=>{p.current&&cancelAnimationFrame(p.current),x.current&&clearTimeout(x.current),j.current=null},N=u.useCallback(y=>{m(),c.current=0;let g=typeof y=="number"?y:i;M.current=g,d(g),e&&(p.current=requestAnimationFrame(f))},[e,i]);return J(()=>{if(l==null||l(a),t&&a>=t){I.current+=t*1e3;let{shouldRepeat:y=!1,delay:g=0,newStartAt:T}=(r==null?void 0:r(I.current/1e3))||{};y&&(x.current=setTimeout(()=>N(T),g*1e3))}},[a,t]),J(()=>(e&&(p.current=requestAnimationFrame(f)),m),[e,t,o]),{elapsedTime:a,reset:N}},bs=(e,t,i)=>{let o=e/2,r=t/2,l=o-r,a=2*l,d=i==="clockwise"?"1,0":"0,1",c=2*Math.PI*l;return{path:`m ${o},${r} a ${l},${l} 0 ${d} 0,${a} a ${l},${l} 0 ${d} 0,-${a}`,pathLength:c}},X=(e,t)=>e===0||e===t?0:typeof t=="number"?e-t:0,$s=e=>({position:"relative",width:e,height:e}),_s={display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,width:"100%",height:"100%"},de=(e,t,i,o,r)=>{if(o===0)return t;let l=(r?o-e:e)/o;return t+i*l},K=e=>{var t,i;return(i=(t=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(o,r,l,a)=>`#${r}${r}${l}${l}${a}${a}`).substring(1).match(/.{2}/g))==null?void 0:t.map(o=>parseInt(o,16)))!=null?i:[]},Rs=(e,t)=>{var i;let{colors:o,colorsTime:r,isSmoothColorTransition:l=!0}=e;if(typeof o=="string")return o;let a=(i=r==null?void 0:r.findIndex((j,x)=>j>=t&&t>=r[x+1]))!=null?i:-1;if(!r||a===-1)return o[0];if(!l)return o[a];let d=r[a]-t,c=r[a]-r[a+1],M=K(o[a]),I=K(o[a+1]),p=!!e.isGrowing;return`rgb(${M.map((j,x)=>de(d,j,I[x]-j,c,p)|0).join(",")})`},Us=e=>{let{duration:t,initialRemainingTime:i,updateInterval:o,size:r=180,strokeWidth:l=12,trailStrokeWidth:a,isPlaying:d=!1,isGrowing:c=!1,rotation:M="clockwise",onComplete:I,onUpdate:p}=e,j=u.useRef(),x=Math.max(l,a??0),{path:f,pathLength:m}=bs(r,x,M),{elapsedTime:N}=Qs({isPlaying:d,duration:t,startAt:X(t,i),updateInterval:o,onUpdate:typeof p=="function"?g=>{let T=Math.ceil(t-g);T!==j.current&&(j.current=T,p(T))}:void 0,onComplete:typeof I=="function"?g=>{var T;let{shouldRepeat:D,delay:L,newInitialRemainingTime:S}=(T=I(g))!=null?T:{};if(D)return{shouldRepeat:D,delay:L,newStartAt:X(t,S)}}:void 0}),y=t-N;return{elapsedTime:N,path:f,pathLength:m,remainingTime:Math.ceil(y),rotation:M,size:r,stroke:Rs(e,y),strokeDashoffset:de(N,0,m,t,c),strokeWidth:l}},ce=e=>{let{children:t,strokeLinecap:i,trailColor:o,trailStrokeWidth:r}=e,{path:l,pathLength:a,stroke:d,strokeDashoffset:c,remainingTime:M,elapsedTime:I,size:p,strokeWidth:j}=Us(e);return u.createElement("div",{style:$s(p)},u.createElement("svg",{viewBox:`0 0 ${p} ${p}`,width:p,height:p,xmlns:"http://www.w3.org/2000/svg"},u.createElement("path",{d:l,fill:"none",stroke:o??"#d9d9d9",strokeWidth:r??j}),u.createElement("path",{d:l,fill:"none",stroke:d,strokeLinecap:i??"round",strokeWidth:j,strokeDasharray:a,strokeDashoffset:c})),typeof t=="function"&&u.createElement("div",{style:_s},t({remainingTime:M,elapsedTime:I,color:d})))};ce.displayName="CountdownCircleTimer";const Ys=[n.E.PRIMARY_GREEN1,n.E.SECONDARY_RED1,n.E.SECONDARY_RED1,n.E.NEUTRALS_GRAY3],Ps=[10,10,1,0],qs=n.styled_default("div")({name:"RemainingTime",class:"r165427",propsAsIs:!1}),Vs=n.E.SECONDARY_GREEN6,ee=n.E.SECONDARY_RED3,Ws=n.E.NEUTRALS_GRAY3,Fs=({isPlaying:e=!0,duration:t=30,onTimerExpired:i})=>{const[o,r]=u.useState(t>10?Vs:ee),l=({remainingTime:c})=>s.jsx(qs,{children:c}),a=u.useCallback(()=>{i==null||i(),r(Ws)},[i,r]),d=u.useCallback(c=>{c===10&&r(ee)},[r]);return s.jsx(ce,{isPlaying:e,duration:t,colors:Ys,colorsTime:Ps,size:32,strokeWidth:2,trailStrokeWidth:2,trailColor:o,onComplete:a,onUpdate:d,children:l})},Bs=n.styled_default("div")({name:"WinBarContainer",class:"wie6cqo",propsAsIs:!1}),Hs=n.styled_default("div")({name:"Content",class:"cgizw4u",propsAsIs:!1}),Zs=n.styled_default("div")({name:"Title",class:"t1l3ucjp",propsAsIs:!1}),Gs=()=>n.c1,Js=n.styled_default(Gs())({name:"WinIcon",class:"wx7j799",propsAsIs:!0}),Xs=n.styled_default("div")({name:"Points",class:"p4lwuj0",propsAsIs:!1}),Ks=n.styled_default("span")({name:"PointsCount",class:"po9i64o",propsAsIs:!1}),et=n.styled_default("span")({name:"PointsUnits",class:"pe5g05h",propsAsIs:!1}),st=({title:e,points:t,isPlayingTimer:i,isTimer:o,questionType:r,timerDuration:l,onTimerExpired:a})=>s.jsxs(Bs,{style:{justifyContent:r===n.QuestionType.PREDICTION?"center":"space-between"},children:[s.jsxs(Hs,{children:[e&&s.jsx(Zs,{children:e}),t!==void 0&&r!==n.QuestionType.POLL&&s.jsxs(s.Fragment,{children:[s.jsx(Js,{name:"icon-trophy"}),s.jsxs(Xs,{children:[s.jsx(Ks,{children:s.jsx(n.d,{value:t})}),s.jsx(et,{children:"PTS"})]})]})]}),o&&r!==n.QuestionType.PREDICTION&&s.jsx(Fs,{isPlaying:i,onTimerExpired:a,duration:l})]}),tt=({openedQuestion:e,isLoading:t,vote:i,close:o})=>{var r,l;const a=e.subject,d=e.type,c=e.status,M=(r=e.options)==null?void 0:r.options,I=e.marketClosed,[p,j]=u.useState(!1),[x,f]=u.useState(!1),[m,N]=u.useState(!0),[y,g]=u.useState(!1),[T,D]=u.useState(""),L=e==null?void 0:e.id;u.useEffect(()=>{d===n.QuestionType.PREDICTION?I&&N(!1):c===n.QuestionStatus.RESOLVED&&N(!1)},[]);const S=u.useCallback(A=>{f(A),j(!0)},[]),O=u.useCallback(async A=>{if(L){const w=A.currentTarget.value;D(w),await i(L,w)}},[L,D,i]),b=u.useCallback(()=>{g(!0),setTimeout(o,3e3)},[o]),h=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.youVoted===!0),[e]),v=u.useMemo(()=>!!(e!=null&&e.answers.find(A=>A.correct===!0)),[e]),z=u.useMemo(()=>e==null?void 0:e.answers.find(A=>A.correct===!0),[e]),je=u.useMemo(()=>e?e.answers.map(A=>{var w;return{...A,questionVoted:!!h,youSelected:T===A.id,isLoading:t,hasCorrectAnswer:v,questionType:e.type,answerTimeExpired:y,questionStatus:c,imageMode:(w=e.appearance)==null?void 0:w.images,onVote:O}}):[],[v,y,t,e,h,c,O,T]),xe=M&&(M.case==="trivia"||M.case==="prediction")?M.value:void 0,C=c===n.QuestionStatus.RESOLVED&&d===n.QuestionType.TRIVIA&&!h&&!m,B=d===n.QuestionType.TRIVIA&&x&&p&&m,H=u.useMemo(()=>d===n.QuestionType.PREDICTION?!!(h&&!v||h&&v&&z!=null&&z.youVoted):!0,[d,h,v,z]),ye=u.useMemo(()=>{if(d===n.QuestionType.PREDICTION&&h&&(!v||v&&z!=null&&z.youVoted))return h.points;if(!(C||y))return c===n.QuestionStatus.RESOLVED?0:h?h.correct?h.points:0:z==null?void 0:z.points},[y,h,z,c,C,d,v]),me=u.useMemo(()=>d===n.QuestionType.PREDICTION&&h?v?v&&z!=null&&z.youVoted?"You won":"":"To win":C||y?"Time expired":d===n.QuestionType.POLL?"Time remaining":h?"You won":"To win",[y,d,h,C,v,z]),he=h||C||B||d===n.QuestionType.TRIVIA&&c===n.QuestionStatus.RESOLVED&&m;return s.jsx(n.i,{"data-question-header":"true",children:s.jsx(Ms,{children:s.jsxs(Is,{children:[s.jsx(ps,{feedbackMessages:xe,questionVoted:!!h,questionVotedCorrectly:h==null?void 0:h.correct,questionType:d,hasCorrectAnswer:v,questionStatus:c,showExpiredNotification:C,showClosedNotificationTrivia:B,votedInCurrentRender:p,votedAfterQuestionClosed:x,enteredAnActiveQuestion:m,marketClosed:I}),H&&s.jsx(st,{title:me,points:ye,onTimerExpired:b,questionType:e.type,isTimer:!t,isPlayingTimer:!h,timerDuration:he?0:Number(((l=e==null?void 0:e.appearance)==null?void 0:l.autoHideInterval)||"30")}),y?s.jsx(as,{title:"More to come...",description:"Watch for additional enhanced stream interactive experience."}):s.jsxs(s.Fragment,{children:[s.jsx(js,{style:H?{}:{marginTop:0},children:a}),s.jsx(xs,{children:je.map(A=>s.jsx(ws,{...A,markThatVoted:S,votedAfterQuestionClosed:x,enteredAnActiveQuestion:m,marketClosed:I},A.id))})]})]})})})},nt=n.styled_default("div")({name:"Container",class:"cgn5uen",propsAsIs:!1}),it=n.styled_default("div")({name:"Content",class:"c1px8nt6",propsAsIs:!1}),ot=n.styled_default("h3")({name:"Title",class:"t5et2jt",propsAsIs:!1}),rt=n.styled_default("div")({name:"Description",class:"d1i2kpk2",propsAsIs:!1}),at=n.styled_default("div")({name:"DateWrap",class:"dd3lh3p",propsAsIs:!1}),lt=n.styled_default("img")({name:"Image",class:"i1gfjeu5",propsAsIs:!1}),ue=({created:e,image:t,title:i,isPickHistory:o,instantView:r,notification:l})=>{const a=u.useMemo(()=>{if(e){const c=new Date(e);if(F(c))return{date:V(c),time:W(c)}}return null},[e]),d=(r==null?void 0:r.image)||t;return s.jsxs(nt,{children:[a&&s.jsxs(at,{children:[a.date," · ",a.time]}),(r==null?void 0:r.video)&&s.jsx(n.w,{source:r.video.url,poster:r.video.thumbnailUrl}),d&&!(r!=null&&r.video)&&s.jsx(lt,{src:d}),s.jsxs(it,{children:[s.jsx(ot,{children:o?i:r==null?void 0:r.heading}),s.jsx(rt,{children:o?l==null?void 0:l.body:r==null?void 0:r.body})]})]})},dt=n.styled_default("div")({name:"Container",class:"c1euiow",propsAsIs:!1}),ct=n.styled_default("a")({name:"WebLinkBtn",class:"w19zie3h",propsAsIs:!1}),ut=({instantView:e,...t})=>s.jsxs(dt,{children:[s.jsx(ue,{instantView:e,...t}),(e==null?void 0:e.webLink)&&s.jsxs(ct,{href:e==null?void 0:e.webLink.url,target:"_blank",children:[e==null?void 0:e.webLink.label,s.jsx(n.c1,{name:"icon-external-link"})]})]}),pt=n.styled_default("div")({name:"Container",class:"c1dcxmvf",propsAsIs:!1}),Mt=n.styled_default("div")({name:"DateTime",class:"db4q22c",propsAsIs:!1}),It=n.styled_default("blockquote")({name:"Quote",class:"q111mmic",propsAsIs:!1}),jt=({created:e,...t})=>{const i=u.useMemo(()=>{if(e){const o=new Date(e);if(F(o))return{date:V(o),time:W(o)}}return null},[e]);return s.jsxs(pt,{children:[i&&s.jsxs(Mt,{children:[i.date," · ",i.time]}),t.title&&s.jsx(It,{children:t.title}),s.jsx(n.j,{...t})]})},xt=n.styled_default("div")({name:"QuestionContainer",class:"qdri6g3",propsAsIs:!1}),yt=({openedQuestion:e})=>{var t,i;return((t=e==null?void 0:e.attributes)==null?void 0:t.attributes.case)==="insight"?s.jsx(ut,{created:e.attributes.created,...e.attributes.attributes.value}):((i=e==null?void 0:e.attributes)==null?void 0:i.attributes.case)==="tweet"?s.jsx(jt,{created:e.attributes.created,...e.attributes.attributes.value}):null},mt=({extendedQuestion:e,vote:t,close:i})=>{const{loading:o,data:r}=e;return r?s.jsx(tt,{vote:t,close:i,openedQuestion:r,isLoading:!!o}):null},ht=({gamification:e})=>{var t;const i=n.useStore(e.openedQuestion.$store),o=n.useStore(e.openedQuestion.$extendedStore);if(!i)return null;const r=i.type;return s.jsxs(xt,{children:[s.jsx(ie,{close:e.closeQuestion,type:((t=i.attributes)==null?void 0:t.type)||n.QuestionType.UNSET}),r==="question"&&s.jsx(mt,{vote:e.submitAnswer,close:e.closeQuestion,extendedQuestion:o}),r!=="question"&&s.jsx(yt,{openedQuestion:i}),s.jsx(ns,{sponsorLogo:""})]})},Nt=n.styled_default("div")({name:"Container",class:"c115qtkr",propsAsIs:!1}),Tt=n.styled_default("div")({name:"STabs",class:"sxnslc8",propsAsIs:!1}),gt=n.styled_default("button")({name:"Button",class:"b1umzux0",propsAsIs:!1}),Dt=n.styled_default("span")({name:"Title",class:"tspsaas",propsAsIs:!1});var U=(e=>(e.HOME="home",e.LEADERBOARD="leaderboard",e))(U||{});const se=({title:e,active:t,onClick:i})=>s.jsx(gt,{onClick:i,"data-selected":t,children:s.jsx(Dt,{children:e})}),ft=({activePage:e="home",toggleActivePage:t})=>s.jsx(Nt,{children:s.jsxs(Tt,{"data-position":e==="home"?"left":"right",children:[s.jsx(se,{title:"Home",active:e==="home",onClick:()=>t("home")}),s.jsx(se,{title:"Friends",active:e==="leaderboard",onClick:()=>t("leaderboard")})]})}),At=n.styled_default("div")({name:"Container",class:"c1ux29ft",propsAsIs:!1}),vt=n.styled_default("img")({name:"FriendsIcon",class:"f10ncfg2",propsAsIs:!1}),Et=n.styled_default("div")({name:"Content",class:"c1yc07bd",propsAsIs:!1}),Lt=n.styled_default("div")({name:"Title",class:"tj6cq7w",propsAsIs:!1}),zt=n.styled_default("div")({name:"Description",class:"d1ag78xo",propsAsIs:!1}),Ot=()=>n.c1,St=n.styled_default(Ot())({name:"ArrowInviteIcon",class:"awohrz6",propsAsIs:!0}),Ct="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iMTYiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik0xMC40NjE1IDEyLjY4NzVDOS40NDIzMSAxMi42ODc1IDguNjE1MzggMTMuNDY2NSA4LjYxNTM4IDE0LjQyNjZDOC42MTUzOCAxNS4zODY4IDkuNDQyMzEgMTYuMTY1OCAxMC40NjE1IDE2LjE2NThDMTEuNDgwOCAxNi4xNjU4IDEyLjMwNzcgMTUuMzg2OCAxMi4zMDc3IDE0LjQyNjZDMTIuMzA3NyAxMy40NjY1IDExLjQ4MDggMTIuNjg3NSAxMC40NjE1IDEyLjY4NzVaTTEwLjQ2MTUgMTYuMTY1OEM5LjEwODE3IDE2LjE2NTggOCAxNy4yMDk3IDggMTguNDg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NzUgMjAuNTY3MiAxMS44NjE2IDIwLjU2NzIgMTAuODQzN0MyMC41NjcyIDkuODI1ODQgMTkuNjkwNSA5IDE4LjYxIDlaTTE4LjYxIDEyLjY4NzVDMTcuNjMxNCAxMi42ODc1IDE2Ljc4MjggMTMuMTc5NiAxNi4zMjY2IDEzLjkxNjZDMTcuMzA1MiAxNC4wMzkxIDE4LjE0ODcgMTQuNTI0IDE4LjY3MTIgMTUuMjYxQzE4LjY3MTIgMTUuMDE2MSAxOC42MSAxNC43NzYxIDE4LjYxIDE0LjUzMTJDMTguNjEgMTMuODU0MiAxOC44MDg4IDEzLjIzNzIgMTkuMjAxMiAxMi43NDUxQzE5LjAwNSAxMi42ODI3IDE4LjgwNjIgMTIuNjg3NSAxOC42MSAxMi42ODc1WiIgZmlsbD0iIzEwN0Q1NyIvPgo8L3N2Zz4K",kt=({title:e,description:t,onClick:i,className:o})=>s.jsxs(At,{onClick:i,className:o,children:[s.jsx(vt,{alt:"friends-icon",src:Ct}),s.jsxs(Et,{children:[s.jsx(Lt,{children:e}),s.jsx(zt,{children:t})]}),s.jsx(St,{name:"icon-copy"})]});function wt(e){var t=e.lastRenderedStartIndex,i=e.lastRenderedStopIndex,o=e.startIndex,r=e.stopIndex;return!(o>i||r<t)}function Qt(e){for(var t=e.isItemLoaded,i=e.itemCount,o=e.minimumBatchSize,r=e.startIndex,l=e.stopIndex,a=[],d=null,c=null,M=r;M<=l;M++){var I=t(M);I?c!==null&&(a.push(d,c),d=c=null):(c=M,d===null&&(d=M))}if(c!==null){for(var p=Math.min(Math.max(c,d+o-1),i-1),j=c+1;j<=p&&!t(j);j++)c=j;a.push(d,c)}if(a.length)for(;a[1]-a[0]+1<o&&a[0]>0;){var x=a[0]-1;if(!t(x))a[0]=x;else break}return a}var bt=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},$t=function(){function e(t,i){for(var o=0;o<i.length;o++){var r=i[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),_t=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)},te=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};(function(e){_t(t,e);function t(){var i,o,r,l;bt(this,t);for(var a=arguments.length,d=Array(a),c=0;c<a;c++)d[c]=arguments[c];return l=(o=(r=te(this,(i=t.__proto__||Object.getPrototypeOf(t)).call.apply(i,[this].concat(d))),r),r._lastRenderedStartIndex=-1,r._lastRenderedStopIndex=-1,r._memoizedUnloadedRanges=[],r._onItemsRendered=function(M){var I=M.visibleStartIndex,p=M.visibleStopIndex;r._lastRenderedStartIndex=I,r._lastRenderedStopIndex=p,r._ensureRowsLoaded(I,p)},r._setRef=function(M){r._listRef=M},o),te(r,l)}return $t(t,[{key:"resetloadMoreItemsCache",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this._memoizedUnloadedRanges=[],o&&this._ensureRowsLoaded(this._lastRenderedStartIndex,this._lastRenderedStopIndex)}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var o=this.props.children;return o({onItemsRendered:this._onItemsRendered,ref:this._setRef})}},{key:"_ensureRowsLoaded",value:function(o,r){var l=this.props,a=l.isItemLoaded,d=l.itemCount,c=l.minimumBatchSize,M=c===void 0?10:c,I=l.threshold,p=I===void 0?15:I,j=Qt({isItemLoaded:a,itemCount:d,minimumBatchSize:M,startIndex:Math.max(0,o-p),stopIndex:Math.min(d-1,r+p)});(this._memoizedUnloadedRanges.length!==j.length||this._memoizedUnloadedRanges.some(function(x,f){return j[f]!==x}))&&(this._memoizedUnloadedRanges=j,this._loadUnloadedRanges(j))}},{key:"_loadUnloadedRanges",value:function(o){for(var r=this,l=this.props.loadMoreItems||this.props.loadMoreRows,a=function(M){var I=o[M],p=o[M+1],j=l(I,p);j!=null&&j.then(function(){if(wt({lastRenderedStartIndex:r._lastRenderedStartIndex,lastRenderedStopIndex:r._lastRenderedStopIndex,startIndex:I,stopIndex:p})){if(r._listRef==null)return;typeof r._listRef.resetAfterIndex=="function"?r._listRef.resetAfterIndex(I,!0):(typeof r._listRef._getItemStyleCache=="function"&&r._listRef._getItemStyleCache(-1),r._listRef.forceUpdate())}})},d=0;d<o.length;d+=2)a(d)}}]),t})(u.PureComponent);const Rt=n.styled_default("div")({name:"Container",class:"culdu4a",propsAsIs:!1}),Ut=n.styled_default("div")({name:"Position",class:"pwf8e69",propsAsIs:!1}),Yt=n.styled_default("img")({name:"Avatar",class:"atf4yh4",propsAsIs:!1}),Pt=n.styled_default("div")({name:"AvatarPlaceholder",class:"a1dg29ja",propsAsIs:!1}),qt=n.styled_default("div")({name:"Content",class:"c10a68rc",propsAsIs:!1}),Vt=n.styled_default("div")({name:"NameContainer",class:"nc4kck5",propsAsIs:!1}),Wt=n.styled_default("span")({name:"Name",class:"njsrqgr",propsAsIs:!1}),Ft=()=>n.c1,Bt=n.styled_default(Ft())({name:"CurrentUserBadge",class:"c17uc4zr",propsAsIs:!0});var pe={exports:{}},Ht="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Zt=Ht,Gt=Zt;function Me(){}function Ie(){}Ie.resetWarningCache=Me;var Jt=function(){function e(o,r,l,a,d,c){if(c!==Gt){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}}e.isRequired=e;function t(){return e}var i={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ie,resetWarningCache:Me};return i.PropTypes=i,i};pe.exports=Jt();var Xt=pe.exports;const E=n.getDefaultExportFromCjs(Xt);class q extends u.Component{constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const i={get passive(){t=!0}};try{document.addEventListener("test",null,i),document.removeEventListener("test",null,i)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const i=this.props.getScrollParent&&this.props.getScrollParent();return i??(t&&t.parentNode)}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let i=window;this.props.useWindow===!1&&(i=t),i.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),i.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),i.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,i=window,o=this.getParentElement(t);let r;if(this.props.useWindow){const l=document.documentElement||document.body.parentNode||document.body,a=i.pageYOffset!==void 0?i.pageYOffset:l.scrollTop;this.props.isReverse?r=a:r=this.calculateOffset(t,a)}else this.props.isReverse?r=o.scrollTop:r=t.scrollHeight-o.scrollTop-o.clientHeight;r<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=o.scrollHeight,this.beforeScrollTop=o.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,i){return t?this.calculateTopPosition(t)+(t.offsetHeight-i-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const t=this.filterProps(this.props),{children:i,element:o,hasMore:r,initialLoad:l,isReverse:a,loader:d,loadMore:c,pageStart:M,ref:I,threshold:p,useCapture:j,useWindow:x,getScrollParent:f,...m}=t;m.ref=y=>{this.scrollComponent=y,I&&I(y)};const N=[i];return r&&(d?a?N.unshift(d):N.push(d):this.defaultLoader&&(a?N.unshift(this.defaultLoader):N.push(this.defaultLoader))),u.createElement(o,m,N)}}Y(q,"propTypes",{children:E.node.isRequired,element:E.node,hasMore:E.bool,initialLoad:E.bool,isReverse:E.bool,loader:E.node,loadMore:E.func.isRequired,pageStart:E.number,ref:E.func,getScrollParent:E.func,threshold:E.number,useCapture:E.bool,useWindow:E.bool}),Y(q,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Kt=({rank:e,avatar:t,name:i,points:o,isCurrentUser:r,openItemDetail:l,style:a})=>s.jsxs(Rt,{onClick:l,style:a,children:[s.jsx(Ut,{children:e||0}),s.jsxs(qt,{children:[t?s.jsx(Yt,{alt:"leaderboard-item-avatar",src:t}):s.jsx(Pt,{children:oe(i||"")}),s.jsxs(Vt,{children:[s.jsx(Wt,{children:i||""}),r&&s.jsx(Bt,{name:"icon-star"})]})]}),s.jsx("div",{children:re(o)})]}),en=n.styled_default("div")({name:"Container",class:"c16btbfp",propsAsIs:!1}),sn=({items:e,currentUserId:t,openItemDetail:i,fetchMore:o,scrollNode:r,hasMore:l})=>s.jsx(q,{loadMore:o,initialLoad:!1,hasMore:l,useWindow:!1,getScrollParent:()=>r.current,children:s.jsx(en,{children:e.map(a=>s.jsx(Kt,{...a,openItemDetail:()=>i(a.userId),isCurrentUser:!!t&&t===a.userId},a.userId))})}),tn=({deepLink:e})=>s.jsx(n.O,{inviteLink:e,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=n.styled_default("div")({name:"InviteLinkContainer",class:"i1chxfpe",propsAsIs:!1}),on=({gamification:e,scrollNode:t,scrollStore:i})=>{const{data:o,hasMore:r}=n.useStore(e.leaderboardList.$store),{data:l}=n.useStore(e.deepLink.$store);if(!(o!=null&&o.length))return s.jsx(tn,{deepLink:l});const a=async()=>{if(l)try{await navigator.clipboard.writeText(l)}catch(d){console.error("Unable to copy to clipboard",d)}};return s.jsxs(s.Fragment,{children:[s.jsx(sn,{items:o,scrollNode:t,scrollStore:i,fetchMore:e.leaderboardList.fetchMore,hasMore:r,openItemDetail:e.openUser,currentUserId:e.currentUserId.get()}),l&&s.jsx(nn,{children:s.jsx(kt,{onClick:a,title:"Invite Friends",description:"Challenge them now!"})})]})},rn=n.styled_default("div")({name:"QuestionItem",class:"q1w97g3p",propsAsIs:!1}),an=n.styled_default("div")({name:"QuestionCaption",class:"q2sl39u",propsAsIs:!1}),ln=n.styled_default("div")({name:"QuestionBody",class:"qd5h0uc",propsAsIs:!1}),dn=n.styled_default("div")({name:"QuestionAction",class:"q105uluy",propsAsIs:!1}),cn=()=>n.c1,R=n.styled_default(cn())({name:"QuestionActionIcon",class:"q1fa0b9h",propsAsIs:!0}),un=()=>n.c1,pn=n.styled_default(un())({name:"QuestionTypeIcon",class:"qxlt78s",propsAsIs:!0}),Mn=n.styled_default("div")({name:"QuestionTypeLabel",class:"qmg0vkx",propsAsIs:!1}),In=n.styled_default("div")({name:"QuestionContent",class:"q1uz5j1g",propsAsIs:!1}),jn=n.styled_default("button")({name:"PlayButton",class:"p1pba9p1",propsAsIs:!1}),xn={[n.PickHistoryStatus.LOST]:s.jsx(R,{name:"incorrectVoted"}),[n.PickHistoryStatus.WON]:s.jsx(R,{name:"icon-check"}),[n.PickHistoryStatus.UNSET]:s.jsx(R,{name:"icon-arrow"}),[n.PickHistoryStatus.DNP]:s.jsx(R,{name:"icon-arrow"})},yn=({questionId:e,questionType:t,questionStatus:i,subject:o,openForVoting:r,openQuestion:l,status:a})=>{const d=n.o[t],c=xn[a];return d?s.jsxs(rn,{onClick:()=>l==null?void 0:l(e),children:[s.jsxs(In,{children:[s.jsxs(an,{children:[s.jsx(pn,{"data-type-trivia":t===n.QuestionType.TRIVIA,"data-type-poll":t===n.QuestionType.POLL,name:d.iconName}),s.jsxs(Mn,{children:[d.label,t===n.QuestionType.TRIVIA&&i===n.QuestionStatus.RESOLVED&&" • Expired"]})]}),s.jsx(ln,{children:o||""})]}),s.jsx(dn,{children:r?s.jsx(jn,{children:"Play"}):c})]}):null},mn=n.styled_default("div")({name:"Container",class:"cll3md7",propsAsIs:!1}),hn=n.styled_default("button")({name:"ActionBtn",class:"a10g1iik",propsAsIs:!1}),Nn=({openInsight:e,questionId:t,...i})=>s.jsxs(mn,{children:[s.jsx(ue,{questionId:t,...i,isPickHistory:!0}),e&&s.jsx(hn,{onClick:()=>e(t),children:"View Insight"})]}),Tn=n.styled_default("div")({name:"Container",class:"cl56x6b",propsAsIs:!1}),gn=()=>n.c,Dn=n.styled_default(gn())({name:"ActionButton",class:"a11pzf92",propsAsIs:!0}),fn=n.styled_default("div")({name:"DateTime",class:"d1hbaleq",propsAsIs:!1}),An=n.styled_default("blockquote")({name:"Quote",class:"qvvgqjm",propsAsIs:!1}),vn=({openTweet:e,created:t,...i})=>{const o=u.useMemo(()=>{if(t){const r=new Date(t);if(F(r))return{date:V(r),time:W(r)}}return null},[t]);return s.jsxs(Tn,{children:[o&&s.jsxs(fn,{children:[o.date," · ",o.time]}),i.title&&s.jsx(An,{children:i.title}),s.jsx(n.j,{...i}),e&&s.jsx(Dn,{onClick:()=>e(i.tweetId),children:"View Insight"})]})},En=n.styled_default("div")({name:"QuestionsContainer",class:"qvghv3l",propsAsIs:!1}),Ln=({questions:e,openQuestion:t})=>s.jsx(En,{children:e==null?void 0:e.map(i=>{var o,r,l;if(i.type==="question"&&((o=i.attributes)==null?void 0:o.attributes.case)==="question"){const a=i.attributes.attributes.value;return s.jsx(yn,{openQuestion:t,...a},a.questionId)}if(i.type==="insight"&&((r=i.attributes)==null?void 0:r.attributes.case)==="insight"){const a=i.attributes.attributes.value,d=i.attributes.created;return s.jsx(Nn,{openInsight:t,...a,created:d},a.questionId)}if(i.type==="tweet"&&((l=i.attributes)==null?void 0:l.attributes.case)==="tweet"){const a=i.attributes.attributes.value,d=i.attributes.id,c=i.attributes.created;return s.jsx(vn,{openTweet:t,...a,tweetId:d,created:c},d)}return null})}),zn=({store:e,openQuestion:t})=>{const i=n.useStore(e);return i!=null&&i.data?s.jsx(Ln,{openQuestion:t,questions:i.data}):s.jsx("div",{children:"wait questions..."})},On=({userSummary:e})=>{var t;const[i,o]=u.useState(void 0);return u.useEffect(()=>{const r=e.subscribe(l=>{l!=null&&l.data&&o(l.data)});return()=>{r()}},[e]),i!=null&&i.summary?s.jsx(ae,{...i.summary,successRate:(t=i.percentage)==null?void 0:t.correct}):s.jsx("div",{children:"wait user..."})},Sn=({gamification:e,className:t,scrollStore:i,scrollNode:o})=>{const[r,l]=u.useState(!1),[a,d]=u.useState(U.HOME),[,c]=u.useTransition(),M=p=>{c(()=>d(p))},I=p=>{c(()=>l(p))};return u.useEffect(()=>i.listen(p=>{if(p.scrollPosition===0){I(!1),i.setKey("tabsShown",!1);return}I(p.scrollDirection==="forward"),i.setKey("tabsShown",p.scrollDirection!=="forward")}),[i]),s.jsxs(n.p,{className:t,children:[s.jsx(n.C,{style:{top:r?"-60px":"0px"},children:s.jsx(ft,{activePage:a,toggleActivePage:M})}),a===U.HOME&&s.jsxs(s.Fragment,{children:[s.jsx(n.n,{style:{paddingTop:"8px"},children:s.jsx(On,{userSummary:e.userSummary})}),s.jsx(n.e,{style:{flex:1},children:s.jsx(zn,{openQuestion:e.openQuestion,store:e.feedList.getStore()})})]}),a===U.LEADERBOARD&&s.jsx(n.l,{children:s.jsx(on,{scrollStore:i,scrollNode:o,gamification:e})})]})},Cn=()=>n.x,ne=n.styled_default(Cn())({name:"OpenedContainer",class:"oar61gl",propsAsIs:!0}),kn=n.styled_default("div")({name:"UserContainer",class:"u14zaal4",propsAsIs:!1}),wn=({correct:e,incorrect:t})=>{const i=e+t;return i===0?0:Math.round(e/i*100)},Qn=({gamification:e,scrollStore:t,className:i,appNode:o,scrollNode:r})=>{const l=n.useStore(e.openedQuestion.$store),a=n.useStore(e.openedUser);return s.jsxs(s.Fragment,{children:[l&&o.current&&n.Pk.createPortal(s.jsx(ne,{className:i,children:s.jsx(ht,{gamification:e})}),o.current),a&&o.current&&n.Pk.createPortal(s.jsx(ne,{className:i,children:s.jsxs(kn,{children:[s.jsx(ie,{label:"Friend's Rank",close:e.closeUser}),s.jsx(n.n,{children:s.jsx(ae,{...a,successRate:wn(a)})})]})}),o.current),s.jsx(Sn,{scrollStore:t,scrollNode:r,className:i,gamification:e})]})};exports.default=Qn;
|